Mercurial > projects > dwt-mac
changeset 11:a329f9c3d66d
Ported dwt.internal.cocoa.SWT* again
line wrap: on
line diff
--- a/dwt/internal/C.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/C.d Fri Aug 22 15:39:51 2008 +0200 @@ -30,7 +30,7 @@ Library.loadLibrary ("swt"); //$NON-NLS-1$ }*/ - public static const int PTR_SIZEOF = (void*).sizeof; + public static const size_t PTR_SIZEOF = (void*).sizeof; alias stdc.free free; alias stdc.getenv getenv;
--- a/dwt/internal/Callback.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/Callback.d Fri Aug 22 15:39:51 2008 +0200 @@ -15,6 +15,7 @@ import dwt.dwthelper.utils; import dwt.internal.C; +import c = dwt.internal.c.callback; /** * Instances of this class represent entry points into Java @@ -138,7 +139,7 @@ */ static synchronized int /*long*/ bind (Callback callback, Object object, String method, String signature, int argCount, boolean isStatic, boolean isArrayBased, int /*long*/ errorResult) { - + return c.bind(callback, object, method, signature, argCount, isStatic, isArrayBased, errorResult); } /** @@ -148,7 +149,7 @@ * from accidentally holding onto extraneous garbage. */ public void dispose () { - if (object == null) return; + if (object is null) return; unbind (this); object = method = signature = null; address = 0; @@ -182,12 +183,15 @@ * * @since 2.1 */ -public static int getEntryCount (); +public static int getEntryCount () +{ + return c.getEntryCount; +} static String getSignature(int argCount) { String signature = "("; //$NON-NLS-1$ - for (int i = 0; i < argCount; i++) signature += PTR_SIGNATURE; - signature += ")" + PTR_SIGNATURE; //$NON-NLS-1$ + for (int i = 0; i < argCount; i++) signature = PTR_SIGNATURE; + signature += ")" ~ PTR_SIGNATURE; //$NON-NLS-1$ return signature; } @@ -203,7 +207,10 @@ * * @param enable true if callbacks should be invoked */ -public static final synchronized void setEnabled (boolean enable); +public static final synchronized void setEnabled (boolean enable) +{ + return c.setEnabled(enable); +} /** * Returns whether or not callbacks which are triggered at the @@ -217,7 +224,10 @@ * * @return true if callbacks should not be invoked */ -public static final synchronized boolean getEnabled (); +public static final synchronized boolean getEnabled () +{ + return c.getEnabled; +} /** * This might be called directly from native code in environments @@ -246,6 +256,9 @@ * * @see #dispose */ -static final synchronized void unbind (Callback callback); +static final synchronized void unbind (Callback callback) +{ + c.unbind(callback); +} }
--- a/dwt/internal/c/callback.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/c/callback.d Fri Aug 22 15:39:51 2008 +0200 @@ -16,29 +16,52 @@ /** * Callback implementation. */ + +import tango.stdc.string; + import dwt.dwthelper.utils; import dwt.internal.Callback; /* Header */ +const bool REDUCED_CALLBACKS = false; +alias size_t SWT_PTR; + version (Win32) { import tango.sys.win32.UserGdi; import tango.sys.win32.Types; + + alias LRESULT RETURN_TYPE; } else version (Win32_WCE) { import tango.sys.win32.UserGdi; import tango.sys.win32.Types; + + alias LRESULT RETURN_TYPE; } else - alias RETURN_TYPE SWT_PTR; + alias SWT_PTR RETURN_TYPE; + +version (X86) + const bool USE_ASSEMBLER = true; + +else + const bool USE_ASSEMBLER = true; -/* Implementation */ +static if (REDUCED_CALLBACKS) + const int MAX_CALLBACKS = 16; -alias size_t SWT_PTR; +else static if (USE_ASSEMBLER) + const int MAX_CALLBACKS = 256; + +else + const int MAX_CALLBACKS = 128; + +const int MAX_ARGS = 12; struct CALLBACK_DATA { @@ -51,21 +74,22 @@ SWT_PTR errorResult; } -bool USE_ASSEMBLER = false; +/* Implementation */ -version (X86) - bool USE_ASSEMBLER = true; + +/* --------------- callback globals ----------------- */ private { CALLBACK_DATA callbackData[MAX_CALLBACKS]; int callbackEnabled = 1; int callbackEntryCount = 0; - int initialized = 0; + bool initialized = 0; + + debug + int counter = 0; } -SWT_PTR callback(int index, ...); - static if (USE_ASSEMBLER) { version (Win32){} @@ -73,32 +97,29 @@ else import tango.stdc.posix.sys.mman; - ubyte* callbackCode = null; - int CALLBACK_THUNK_SIZE = 64; + private ubyte* callbackCode = null; + const int CALLBACK_THUNK_SIZE = 64; } -SWT_PTR bind (Callback callbackObject, Object object, String method, String signature, int argCount, boolean isStatic, boolean isArrayBased, SWT_PTR errorResult) +SWT_PTR bind (Callback callbackObject, Object object, String method, String signature, int argCount, bool isStatic, bool isArrayBased, SWT_PTR errorResult) { int i; jmethodID mid = null; jclass javaClass = that; - const char* methodString = null; - const char* sigString = null; - - if (jvm == null) - (*env).GetJavaVM(env, &jvm); + string methodString = null; + string sigString = null; if (!initialized) { memset(&callbackData, 0, callbackData.sizeof); - initialized = 1; + initialized = true; } if (method) - methodString = cast(/*const*/char*) (*env).GetStringUTFChars(env, method, null); + methodString = method; if (signature) - sigString = cast(/*const*/char*) (*env).GetStringUTFChars(env, signature, null); + sigString = signature; if (object && methodString && sigString) { @@ -113,12 +134,6 @@ } } - if (method && methodString) - (*env).ReleaseStringUTFChars(env, method, methodString); - - if (signature && sigString) - (*env).ReleaseStringUTFChars(env, signature, sigString); - if (mid == 0) goto fail; @@ -126,10 +141,10 @@ { if (!callbackData[i].callback) { - if ((callbackData[i].callback = (*env).NewGlobalRef(env, callbackObject)) == null) + if ((callbackData[i].callback = callbackObject) == null) goto fail; - if ((callbackData[i].object = (*env).NewGlobalRef(env, object)) == null) + if ((callbackData[i].object = object) == null) goto fail; callbackData[i].isStatic = isStatic; @@ -140,7 +155,8 @@ static if (!USE_ASSEMBLER) return cast(SWT_PTR) fnx_array[argCount][i]; - + + else { int j = 0, k, pad = 0; ubyte* code; @@ -260,10 +276,7 @@ } if (j > CALLBACK_THUNK_SIZE) - { - jclass errorClass = (*env).FindClass(env, "java/lang/Error"); - (*env).ThrowNew(env, errorClass, "Callback thunk overflow"); - } + throw new Error("Callback thunk overflow"); return cast(SWT_PTR) code; } @@ -273,3 +286,35 @@ fail: return 0; } + +void unbind (Callback callback) +{ + int i; + for (i=0; i<MAX_CALLBACKS; i++) { + if (callbackData[i].callback !is null && callbackData[i].callback == callback) { + if (callbackData[i].callback !is null) delete callbackData[i].callback; + if (callbackData[i].object !is null) delete allbackData[i].object; + memset(&callbackData[i], 0, CALLBACK_DATA.sizeof); + } + } +} + +bool getEnabled () +{ + return callbackEnabled; +} + +int getEntryCount () +{ + return callbackEntryCount; +} + +void setEnabled (bool enable) +{ + callbackEnabled = enable; +} + +void reset () +{ + memset(cast(void*) &callbackData, 0, callbackData.sizeof); +}
--- a/dwt/internal/cocoa/NSHashTableCallBacks.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/NSHashTableCallBacks.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,6 +13,15 @@ *******************************************************************************/ module dwt.internal.cocoa.NSHashTableCallBacks; -public class NSHashTableCallBacks { -//TODO +import dwt.internal.cocoa.NSHashTable; +import dwt.internal.cocoa.NSString; + +public struct NSHashTableCallBacks { + extern (C): + + uint function (NSHashTable table, /*const*/ void*) hash; + bool function (NSHashTable table, /*const*/ void*, /*const*/ void*) isEqual; + void function (NSHashTable table, /*const*/ void*) retain; + void function (NSHashTable table, void*) release; + NSString function (NSHashTable table, /*const*/ void*) describe; }
--- a/dwt/internal/cocoa/NSInteger.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/NSInteger.d Fri Aug 22 15:39:51 2008 +0200 @@ -7,26 +7,8 @@ */ module dwt.internal.cocoa.NSInteger; -version (X86_64) { - alias ulong NSUInteger; - alias long NSInteger; -} +import tango.stdc.config; -else version (PPC64) { - alias ulong NSUInteger; - alias long NSInteger; -} -else version (X86) { - alias uint NSUInteger; - alias int NSInteger; -} - -else version (PPC) { - alias uint NSUInteger; - alias int NSInteger; -} - -else { - pragma(error, "Unsupported architecture"); -} \ No newline at end of file +alias c_long NSInteger; +alias c_ulong NSUInteger; \ No newline at end of file
--- a/dwt/internal/cocoa/SWTApplicationDelegate.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTApplicationDelegate.d Fri Aug 22 15:39:51 2008 +0200 @@ -4,15 +4,15 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTApplicationDelegate; -import dwt.dwthelper.utils; import dwt.internal.cocoa.NSObject; +import objc = dwt.internal.objc.runtime; -public class DWTApplicationDelegate : NSObject { +public class SWTApplicationDelegate : NSObject { public this () { - super(0); + super(null); } - public this (int id) { + public this (objc.id id) { super(id); } }
--- a/dwt/internal/cocoa/SWTBox.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTBox.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,12 +13,12 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTBox; -import dwt.dwthelper.utils; import dwt.internal.cocoa.NSBox; +import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.OS; -public class DWTBox : NSBox { - public void setTag (int tag) { +public class SWTBox : NSBox { + public void setTag (NSInteger tag) { OS.objc_msgSend(id, OS.sel_setTag_1, tag); } }
--- a/dwt/internal/cocoa/SWTButton.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTButton.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,9 +13,8 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTButton; -import dwt.dwthelper.utils; import dwt.internal.cocoa.NSButton; -public class DWTButton : NSButton { +public class SWTButton : NSButton { }
--- a/dwt/internal/cocoa/SWTComboBox.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTComboBox.d Fri Aug 22 15:39:51 2008 +0200 @@ -16,6 +16,6 @@ import dwt.dwthelper.utils; import dwt.internal.cocoa.NSComboBox; -public class DWTComboBox : NSComboBox { +public class SWTComboBox : NSComboBox { }
--- a/dwt/internal/cocoa/SWTDatePicker.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTDatePicker.d Fri Aug 22 15:39:51 2008 +0200 @@ -16,6 +16,6 @@ import dwt.dwthelper.utils; import dwt.internal.cocoa.NSDatePicker; -public class DWTDatePicker : NSDatePicker { +public class SWTDatePicker : NSDatePicker { }
--- a/dwt/internal/cocoa/SWTImageView.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTImageView.d Fri Aug 22 15:39:51 2008 +0200 @@ -16,6 +16,6 @@ import dwt.dwthelper.utils; import dwt.internal.cocoa.NSImageView; -public class DWTImageView : NSImageView { +public class SWTImageView : NSImageView { }
--- a/dwt/internal/cocoa/SWTMenu.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTMenu.d Fri Aug 22 15:39:51 2008 +0200 @@ -4,13 +4,13 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTMenu; -import dwt.dwthelper.utils; +import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSMenu; import dwt.internal.cocoa.OS; -public class DWTMenu : NSMenu { +public class SWTMenu : NSMenu { - public void setTag (int tag) { + public void setTag (NSInteger tag) { OS.objc_msgSend(id, OS.sel_setTag_1, tag); } }
--- a/dwt/internal/cocoa/SWTMenuItem.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTMenuItem.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,9 +13,8 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTMenuItem; -import dwt.dwthelper.utils; import dwt.internal.cocoa.NSMenuItem; -public class DWTMenuItem : NSMenuItem { +public class SWTMenuItem : NSMenuItem { }
--- a/dwt/internal/cocoa/SWTOutlineView.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTOutlineView.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,9 +13,8 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTOutlineView; -import dwt.dwthelper.utils; import dwt.internal.cocoa.NSOutlineView; -public class DWTOutlineView : NSOutlineView { +public class SWTOutlineView : NSOutlineView { }
--- a/dwt/internal/cocoa/SWTPanelDelegate.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTPanelDelegate.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,25 +13,26 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTPanelDelegate; -import dwt.dwthelper.utils; +import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSObject; import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; -public class DWTPanelDelegate : NSObject { +public class SWTPanelDelegate : NSObject { public this () { - super(0); + super(null); } - public this (int id) { + public this (objc.id id) { super(id); } - public int tag () { - return OS.objc_msgSend(id, OS.sel_tag); + public NSInteger tag () { + return cast(NSInteger) OS.objc_msgSend(id, OS.sel_tag); } - public void setTag (int tag) { + public void setTag (NSInteger tag) { OS.objc_msgSend(id, OS.sel_setTag_1, tag); }
--- a/dwt/internal/cocoa/SWTPopUpButton.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTPopUpButton.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,9 +13,8 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTPopUpButton; -import dwt.dwthelper.utils; import dwt.internal.cocoa.NSPopUpButton; -public class DWTPopUpButton : NSPopUpButton { +public class SWTPopUpButton : NSPopUpButton { }
--- a/dwt/internal/cocoa/SWTProgressIndicator.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTProgressIndicator.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,13 +13,13 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTProgressIndicator; -import dwt.dwthelper.utils; +import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSProgressIndicator; import dwt.internal.cocoa.OS; -public class DWTProgressIndicator : NSProgressIndicator { +public class SWTProgressIndicator : NSProgressIndicator { - public void setTag (int tag) { + public void setTag (NSInteger tag) { OS.objc_msgSend(id, OS.sel_setTag_1, tag); } }
--- a/dwt/internal/cocoa/SWTScrollView.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTScrollView.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,21 +13,21 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTScrollView; -import dwt.dwthelper.utils; import dwt.internal.cocoa.NSScrollView; import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; -public class DWTScrollView : NSScrollView { +public class SWTScrollView : NSScrollView { public this () { - super(0); + super(null); } - public this (int id) { + public this (objc.id id) { super(id); } - public void setTag (int tag) { + public void setTag (NSInteger tag) { OS.objc_msgSend(id, OS.sel_setTag_1, tag); }
--- a/dwt/internal/cocoa/SWTScroller.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTScroller.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,9 +13,8 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTScroller; -import dwt.dwthelper.utils; import dwt.internal.cocoa.NSScroller; -public class DWTScroller : NSScroller { +public class SWTScroller : NSScroller { }
--- a/dwt/internal/cocoa/SWTSlider.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTSlider.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,9 +13,8 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTSlider; -import dwt.dwthelper.utils; import dwt.internal.cocoa.NSSlider; -public class DWTSlider : NSSlider { +public class SWTSlider : NSSlider { }
--- a/dwt/internal/cocoa/SWTStepper.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTStepper.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,9 +13,8 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTStepper; -import dwt.dwthelper.utils; import dwt.internal.cocoa.NSStepper; -public class DWTStepper : NSStepper { +public class SWTStepper : NSStepper { } \ No newline at end of file
--- a/dwt/internal/cocoa/SWTTabView.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTTabView.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,21 +13,22 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTTabView; -import dwt.dwthelper.utils; +import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSTabView; import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; -public class DWTTabView : NSTabView { +public class SWTTabView : NSTabView { public this () { - super(0); + super(null); } - public this (int id) { + public this (objc.id id) { super(id); } - public void setTag (int tag) { + public void setTag (NSInteger tag) { OS.objc_msgSend(id, OS.sel_setTag_1, tag); } }
--- a/dwt/internal/cocoa/SWTTableView.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTTableView.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,9 +13,8 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTTableView; -import dwt.dwthelper.utils; import dwt.internal.cocoa.NSTableView; -public class DWTTableView : NSTableView { +public class SWTTableView : NSTableView { }
--- a/dwt/internal/cocoa/SWTTextField.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTTextField.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,9 +13,8 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTTextField; -import dwt.dwthelper.utils; import dwt.internal.cocoa.NSTextField; -public class DWTTextField : NSTextField { +public class SWTTextField : NSTextField { }
--- a/dwt/internal/cocoa/SWTTextView.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTTextView.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,21 +13,22 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTTextView; -import dwt.dwthelper.utils; +import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSTextView; import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; -public class DWTTextView : NSTextView { +public class SWTTextView : NSTextView { public this () { - super(0); + super(null ); } - public this (int id) { + public this (objc.id id) { super(id); } - public void setTag (int tag) { + public void setTag (NSInteger tag) { OS.objc_msgSend(id, OS.sel_setTag_1, tag); } }
--- a/dwt/internal/cocoa/SWTTreeItem.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTTreeItem.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,16 +13,16 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTTreeItem; -import dwt.dwthelper.utils; +import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSObject; -public class DWTTreeItem : NSObject { +public class SWTTreeItem : NSObject { - public int tag () { - return OS.objc_msgSend(id, OS.sel_tag); + public NSInteger tag () { + return cast(NSInteger) OS.objc_msgSend(id, OS.sel_tag); } - public void setTag (int tag) { + public void setTag (NSInteger tag) { OS.objc_msgSend(id, OS.sel_setTag_1, tag); } }
--- a/dwt/internal/cocoa/SWTView.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTView.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,21 +13,22 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTView; -import dwt.dwthelper.utils; +import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSView; import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; -public class DWTView : NSView { +public class SWTView : NSView { public this () { - super(0); + super(null); } - public this (int id) { + public this (objc.id id) { super(id); } - public void setTag (int tag) { + public void setTag (NSInteger tag) { OS.objc_msgSend(id, OS.sel_setTag_1, tag); } } \ No newline at end of file
--- a/dwt/internal/cocoa/SWTWebViewDelegate.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTWebViewDelegate.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,12 +13,12 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTWebViewDelegate; -import dwt.dwthelper.utils; +import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSObject; -public class DWTWebViewDelegate : NSObject { +public class SWTWebViewDelegate : NSObject { - public void setTag (int tag) { + public void setTag (NSInteger tag) { OS.objc_msgSend(id, OS.sel_setTag_1, tag); } }
--- a/dwt/internal/cocoa/SWTWindow.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTWindow.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,13 +13,13 @@ *******************************************************************************/ module dwt.internal.cocoa.SWTWindow; -import dwt.dwthelper.utils; +import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSWindow; import dwt.internal.cocoa.OS; -public class DWTWindow : NSWindow { +public class SWTWindow : NSWindow { - public void setTag (int tag) { + public void setTag (NSInteger tag) { OS.objc_msgSend(id, OS.sel_setTag_1, tag); } }
--- a/dwt/internal/cocoa/SWTWindowDelegate.d Tue Aug 19 17:40:11 2008 +0200 +++ b/dwt/internal/cocoa/SWTWindowDelegate.d Fri Aug 22 15:39:51 2008 +0200 @@ -13,23 +13,25 @@ *******************************************************************************/ module dwt.internal.cocoa.DWTWindowDelegate; +import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSObject; +import objc = dwt.internal.objc.runtime; -public class DWTWindowDelegate : NSObject { +public class SWTWindowDelegate : NSObject { public this () { - super(0); + super(null); } - public this (int id) { + public this (objc.id id) { super(id); } - public int tag () { - return OS.objc_msgSend(id, OS.sel_tag); + public NSInteger tag () { + return cast(NSInteger) OS.objc_msgSend(id, OS.sel_tag); } - public void setTag (int tag) { + public void setTag (NSInteger tag) { OS.objc_msgSend(id, OS.sel_setTag_1, tag); }