Mercurial > projects > dwt-mac
diff dwt/printing/Printer.d @ 7:e831403a80a9
Add 'cast' to casts
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 14:30:35 +0200 |
parents | 1a8b3cb347e0 |
children | db5a898b2119 |
line wrap: on
line diff
--- a/dwt/printing/Printer.d Wed Aug 27 14:10:03 2008 +0200 +++ b/dwt/printing/Printer.d Wed Aug 27 14:30:35 2008 +0200 @@ -91,10 +91,10 @@ } //static int packData(int handle, byte[] buffer, int offset) { // int length = OS.GetHandleSize (handle); -// buffer[offset++] = (byte)((length & 0xFF) >> 0); -// buffer[offset++] = (byte)((length & 0xFF00) >> 8); -// buffer[offset++] = (byte)((length & 0xFF0000) >> 16); -// buffer[offset++] = (byte)((length & 0xFF000000) >> 24); +// buffer[offset++] = cast(byte)((length & 0xFF) >> 0); +// buffer[offset++] = cast(byte)((length & 0xFF00) >> 8); +// buffer[offset++] = cast(byte)((length & 0xFF0000) >> 16); +// buffer[offset++] = cast(byte)((length & 0xFF000000) >> 24); // int [] ptr = new int [1]; // OS.HLock(handle); // OS.memmove(ptr, handle, 4); @@ -197,7 +197,7 @@ // PMRect paperRect = new PMRect(); // OS.PMGetAdjustedPageRect(pageFormat, pageRect); // OS.PMGetAdjustedPaperRect(pageFormat, paperRect); -// return new Rectangle(x+(int)paperRect.left, y+(int)paperRect.top, width+(int)(paperRect.right-pageRect.right), height+(int)(paperRect.bottom-pageRect.bottom)); +// return new Rectangle(x+cast(int)paperRect.left, y+cast(int)paperRect.top, width+cast(int)(paperRect.right-pageRect.right), height+cast(int)(paperRect.bottom-pageRect.bottom)); return null; } @@ -208,7 +208,7 @@ * @param deviceData the device data */ protected void create(DeviceData deviceData) { - data = (PrinterData)deviceData; + data = cast(PrinterData)deviceData; printer = NSPrinter.static_printerWithName_(NSString.stringWith(data.name)); printer.retain(); @@ -247,7 +247,7 @@ // } // // if (PREVIEW_DRIVER.equals(data.driver)) { -// OS.PMSessionSetDestination(printSession, printSettings, (short) OS.kPMDestinationPreview, 0, 0); +// OS.PMSessionSetDestination(printSession, printSettings, cast(short) OS.kPMDestinationPreview, 0, 0); // } // String name = data.name; // char[] buffer1 = new char[name.length ()]; @@ -304,10 +304,10 @@ // PMRect paperRect= new PMRect(); // OS.PMGetAdjustedPaperRect(pageFormat, paperRect); // Rect portRect = new Rect(); -// portRect.left = (short)paperRect.left; -// portRect.right = (short)paperRect.right; -// portRect.top = (short)paperRect.top; -// portRect.bottom = (short)paperRect.bottom; +// portRect.left = cast(short)paperRect.left; +// portRect.right = cast(short)paperRect.right; +// portRect.top = cast(short)paperRect.top; +// portRect.bottom = cast(short)paperRect.bottom; // data.portRect = portRect; // isGCCreated = true; // } @@ -491,7 +491,7 @@ checkDevice(); // PMResolution resolution = new PMResolution(); // OS.PMGetResolution(pageFormat, resolution); -// return new Point((int)resolution.hRes, (int)resolution.vRes); +// return new Point(cast(int)resolution.hRes, cast(int)resolution.vRes); return null; } @@ -512,7 +512,7 @@ checkDevice(); // PMRect paperRect = new PMRect(); // OS.PMGetAdjustedPaperRect(pageFormat, paperRect); -// return new Rectangle(0, 0, (int)(paperRect.right-paperRect.left), (int)(paperRect.bottom-paperRect.top)); +// return new Rectangle(0, 0, cast(int)(paperRect.right-paperRect.left), cast(int)(paperRect.bottom-paperRect.top)); return null; } @@ -535,7 +535,7 @@ checkDevice(); // PMRect pageRect = new PMRect(); // OS.PMGetAdjustedPageRect(pageFormat, pageRect); -// return new Rectangle(0, 0, (int)(pageRect.right-pageRect.left), (int)(pageRect.bottom-pageRect.top)); +// return new Rectangle(0, 0, cast(int)(pageRect.right-pageRect.left), cast(int)(pageRect.bottom-pageRect.top)); return null; } @@ -600,7 +600,7 @@ // PMRect paperRect= new PMRect(); // OS.PMGetAdjustedPaperRect(pageFormat, paperRect); // OS.CGContextScaleCTM(context, 1, -1); -// OS.CGContextTranslateCTM(context, 0, -(float)(paperRect.bottom-paperRect.top)); +// OS.CGContextTranslateCTM(context, 0, -cast(float)(paperRect.bottom-paperRect.top)); // OS.CGContextSetStrokeColorSpace(context, colorspace); // OS.CGContextSetFillColorSpace(context, colorspace); // }