Mercurial > projects > dwt-mac
diff dwt/graphics/Device.d @ 46:cfa563df4fdd
Updated Widget and Display to 3.514
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Fri, 05 Dec 2008 16:00:41 +0100 |
parents | d8635bb48c7c |
children | 62202ce0039f |
line wrap: on
line diff
--- a/dwt/graphics/Device.d Mon Dec 01 17:07:00 2008 +0100 +++ b/dwt/graphics/Device.d Fri Dec 05 16:00:41 2008 +0100 @@ -30,9 +30,10 @@ import dwt.internal.cocoa.NSThread; import dwt.internal.cocoa.NSValue; import dwt.internal.cocoa.OS; -import dwt.internal.cocoa.id; +import cocoa = dwt.internal.cocoa.id; import dwt.dwthelper.Runnable; +import dwt.dwthelper.System; import dwt.dwthelper.utils; import dwt.graphics.Drawable; import dwt.graphics.Color; @@ -42,7 +43,7 @@ import dwt.graphics.GCData; import dwt.graphics.Point; import dwt.graphics.Rectangle; -import dwt.internal.cocoa.NSInteger; +import dwt.internal.objc.cocoa.Cocoa; import objc = dwt.internal.objc.runtime; @@ -145,13 +146,13 @@ objects = new Object [128]; trackingLock = new Object (); } - NSAutoreleasePool pool = (NSAutoreleasePool) new NSAutoreleasePool().alloc().init(); + NSAutoreleasePool pool = cast(NSAutoreleasePool) (new NSAutoreleasePool()).alloc().init(); NSThread nsthread = NSThread.currentThread(); NSMutableDictionary dictionary = nsthread.threadDictionary(); NSString key = NSString.stringWith("DWT_NSAutoreleasePool"); - id obj = dictionary.objectForKey(key); + cocoa.id obj = dictionary.objectForKey(key); if (obj is null) { - NSNumber nsnumber = NSNumber.numberWithInteger(pool.id); + NSNumber nsnumber = NSNumber.numberWithInteger(cast(NSInteger) pool.id); dictionary.setObject(nsnumber, key); } else { pool.release(); @@ -347,7 +348,7 @@ */ public int getDepth () { checkDevice (); - return (int)/*64*/OS.NSBitsPerPixelFromDepth(getPrimaryScreen().depth()); + return cast(int)/*64*/OS.NSBitsPerPixelFromDepth(getPrimaryScreen().depth()); } /** @@ -426,9 +427,9 @@ Point getScreenDPI () { NSDictionary dictionary = getPrimaryScreen().deviceDescription(); - NSValue value = new NSValue(dictionary.objectForKey(new id(OS.NSDeviceResolution())).id); + NSValue value = new NSValue(dictionary.objectForKey(new cocoa.id(OS.NSDeviceResolution)).id); NSSize size = value.sizeValue(); - return new Point((int)size.width, (int)size.height); + return new Point(cast(int)size.width, cast(int)size.height); } /**