Mercurial > projects > dwt-mac
diff dwt/graphics/Device.d @ 36:db5a898b2119
Fixed a lot of compile errors
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 07 Oct 2008 12:56:18 +0200 |
parents | 71b49a659702 |
children | 642f460a0908 |
line wrap: on
line diff
--- a/dwt/graphics/Device.d Sun Sep 14 23:32:29 2008 +0200 +++ b/dwt/graphics/Device.d Tue Oct 07 12:56:18 2008 +0200 @@ -13,8 +13,6 @@ *******************************************************************************/ module dwt.graphics.Device; -import dwt.dwthelper.utils; - import dwt.DWT; import dwt.DWTException; import dwt.internal.Compatibility; @@ -30,15 +28,18 @@ import dwt.internal.cocoa.OS; import dwt.internal.cocoa.id; +import dwt.dwthelper.Runnable; +import dwt.dwthelper.utils; import dwt.graphics.Drawable; - import dwt.graphics.Color; import dwt.graphics.DeviceData; import dwt.graphics.Font; import dwt.graphics.FontData; import dwt.graphics.GCData; +import dwt.graphics.Point; import dwt.graphics.Rectangle; import dwt.internal.cocoa.NSInteger; +import objc = dwt.internal.objc.runtime; /** @@ -49,9 +50,9 @@ */ public abstract class Device : Drawable { - /* Debugging */ - public static bool DEBUG; - bool debugg = DEBUG; + /* debug_ing */ + public static const bool DEBUG = true; + bool debug_ = DEBUG; bool tracking = DEBUG; Error [] errors; Object [] objects; @@ -127,7 +128,7 @@ public this(DeviceData data) { synchronized (Device.classinfo) { if (data !is null) { - debugg = data.debugg; + debug_ = data.debug_; tracking = data.tracking; } if (tracking) { @@ -136,7 +137,7 @@ trackingLock = new Object (); } create (data); - init (); + init_ (); } } @@ -269,7 +270,7 @@ public DeviceData getDeviceData () { checkDevice(); DeviceData data = new DeviceData (); - data.debugg = debugg; + data.debug_ = debug_; data.tracking = tracking; if (tracking) { synchronized (trackingLock) { @@ -345,7 +346,7 @@ public Point getDPI () { checkDevice (); NSDictionary dictionary = NSScreen.mainScreen().deviceDescription(); - NSValue value = new NSValue(dictionary.objectForKey(new id(OS.NSDeviceResolution())).id_); + NSValue value = new NSValue(dictionary.objectForKey(new id(OS.NSDeviceResolution().id_)).id_); NSSize size = value.sizeValue(); return new Point(cast(int)size.width, cast(int)size.height); } @@ -486,7 +487,7 @@ * * @see #create */ -protected void init () { +protected void init_ () { /* Create the standard colors */ COLOR_BLACK = new Color (this, 0,0,0); COLOR_DARK_RED = new Color (this, 0x80,0,0); @@ -523,7 +524,7 @@ * @param data the platform specific GC data * @return the platform specific GC handle */ -public abstract int internal_new_GC (GCData data); +public abstract objc.id internal_new_GC (GCData data); /** * Invokes platform specific functionality to dispose a GC handle. @@ -586,7 +587,7 @@ for (int i=0; i<objects.length; i++) { if (objects [i] is null) { objects [i] = object; - errors [i] = new Error (); + errors [i] = new Error (""); return; } } @@ -596,7 +597,7 @@ objects = newObjects; Error [] newErrors = new Error [errors.length + 128]; System.arraycopy (errors, 0, newErrors, 0, errors.length); - newErrors [errors.length] = new Error (); + newErrors [errors.length] = new Error (""); errors = newErrors; } }