changeset 129:ad4e1fe71a5a

Fixed runtime errors
author Jacob Carlborg <doob@me.com>
date Sun, 18 Jan 2009 18:39:46 +0100
parents 07399639c0c8
children 3d4579727e0e
files dwt/accessibility/Accessible.d dwt/accessibility/SWTAccessibleDelegate.d dwt/dwthelper/array.d dwt/dwthelper/associativearray.d dwt/dwthelper/utils.d dwt/graphics/Device.d dwt/graphics/GC.d dwt/graphics/Image.d dwt/internal/cocoa/NSArray.d dwt/internal/cocoa/NSBitmapImageRep.d dwt/internal/cocoa/NSView.d dwt/internal/objc/bindings.d dwt/internal/objc/runtime.d dwt/widgets/Caret.d dwt/widgets/Composite.d dwt/widgets/Control.d dwt/widgets/Display.d dwt/widgets/MenuItem.d dwt/widgets/Table.d
diffstat 19 files changed, 208 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/accessibility/Accessible.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/accessibility/Accessible.d	Sun Jan 18 18:39:46 2009 +0100
@@ -47,6 +47,7 @@
 import dwt.accessibility.AccessibleTextEvent;
 import dwt.accessibility.AccessibleTextListener;
 import dwt.accessibility.SWTAccessibleDelegate;
+import dwt.dwthelper.associativearray;
 
 /**
  * Instances of this class provide a bridge between application
@@ -89,7 +90,7 @@
     AccessibleTextListener[] accessibleTextListeners;
     Control control;
     
-    HashMap!(int, SWTAccessibleDelegate) children;
+    SWTAccessibleDelegate[int] children;
     
     this (Control control) {
         
@@ -553,7 +554,7 @@
         parameterizedAttributeNames = null;        
         
         foreach (childDelegate ; children)
-        childDelegate.internal_dispose_SWTAccessibleDelegate();
+            childDelegate.internal_dispose_SWTAccessibleDelegate();
         
         children.clear();
     }
@@ -1397,7 +1398,7 @@
         
         if (childRef is null) {
             childRef = new SWTAccessibleDelegate(this, childID);
-            children.add(childID, childRef);
+            children.put(childID, childRef);
         }
         
         return childRef;
--- a/dwt/accessibility/SWTAccessibleDelegate.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/accessibility/SWTAccessibleDelegate.d	Sun Jan 18 18:39:46 2009 +0100
@@ -37,7 +37,7 @@
      * using <code>setData(String, Object)</code>.
      */
     static final String ACCESSIBLE_KEY = "Accessible"; //$NON-NLS-1$
-    static final String DWT_OBJECT = "DWT_OBJECT";
+    static final String SWT_OBJECT = "SWT_OBJECT";
     
     static objc.IMP proc2Args, proc3Args, proc4Args;
     
@@ -70,7 +70,7 @@
         size_t size = C.PTR_SIZEOF, align_ = C.PTR_SIZEOF is 4 ? 2 : 3;
         
         objc.Class cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSObject, className, 0);
-        OS.class_addIvar(cls, DWT_OBJECT, size, cast(byte)align_, types);
+        OS.class_addIvar(cls, SWT_OBJECT, size, cast(byte)align_, types);
         
         // Add the NSAccessibility overrides
         OS.class_addMethod(cls, OS.sel_accessibilityActionNames, proc2Args, "@:");
@@ -99,7 +99,7 @@
         alloc().init();
         delegateJniRef = OS.NewGlobalRef(this);
         if (delegateJniRef is null) DWT.error(DWT.ERROR_NO_HANDLES);
-        OS.object_setInstanceVariable(this.id, DWT_OBJECT, delegateJniRef);
+        OS.object_setInstanceVariable(this.id, SWT_OBJECT, delegateJniRef);
     }
     
     NSArray accessibilityActionNames() {
@@ -253,7 +253,7 @@
     static SWTAccessibleDelegate getAccessibleDelegate(objc.id id) {
         if (id is null) return null;
         void* jniRef;
-        OS.object_getInstanceVariable(id, DWT_OBJECT, jniRef);
+        OS.object_getInstanceVariable(id, SWT_OBJECT, jniRef);
         if (jniRef is null) return null;
         return cast(SWTAccessibleDelegate)OS.JNIGetObject(jniRef);
     }
--- a/dwt/dwthelper/array.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/dwthelper/array.d	Sun Jan 18 18:39:46 2009 +0100
@@ -25,15 +25,8 @@
  *     
  * Returns: the modified array
  * 
- * Throws: AssertException if the length of the array is 0
- * Throws: AssertException if the element is null
  */
 T[] add (T) (ref T[] arr, T element)
-in
-{
-    assert(arr.length > 0);
-}
-body
 {
     return arr ~= element;
 }
@@ -46,9 +39,7 @@
  *     element = element to be appended to this list
  *     
  * Returns: the modified array
- * 
- * Throws: AssertException if the length of the array is 0
- * Throws: AssertException if the element is null
+ *
  */
 alias add addElement;
 
@@ -64,7 +55,6 @@
 T elementAt (T) (T[] arr, int index)
 in
 {
-    assert(arr.length > 0);
     assert(index > -1 && index < arr.length);
 }
 body
@@ -107,14 +97,12 @@
  *     
  * Returns: the element that was removed or $(D_CODE null)
  * 
- * Throws: AssertException if the length of the array is 0
  * Throws: AssertException if the $(D_CODE index) argument is
  *         negative or not less than the length of this array.
  */
 T remove (T) (ref T[] arr, int index)
 in
 {
-    assert(arr.length > 0);
     assert(index > -1 && index < arr.length);
 }
 body
@@ -155,17 +143,12 @@
  *     element = the element to be removed
  *     
  * Returns: the element that was removed or $(null null)
- * 
- * Throws: AssertException if the length of the array is 0
+ *
  */
 T remove (T) (ref T[] arr, T element)
-in
-{
-    assert(arr.length > 0);
-}
 out (result)
 {
-    assert(result is element || result is null);
+    assert(result is element);
 }
 body
 {
@@ -214,14 +197,12 @@
  *     
  * Returns: the index of the element or -1 if it's not in the array
  * 
- * Throws: AssertException if the length of the array is 0
  * Throws: AssertException if the return value is less than -1 or
  *         greater than the length of the array - 1.
  */
 size_t indexOf (T, U = size_t) (T[] arr, T[] match, U start = 0)
 in
 {
-    assert(arr.length > 0);
     assert(start >= 0);
 }
 out (result)
@@ -250,14 +231,12 @@
  *     
  * Returns: the index of the element or -1 if it's not in the array
  * 
- * Throws: AssertException if the length of the array is 0
  * Throws: AssertException if the return value is less than -1 or
  *         greater than the length of the array - 1.
  */
 size_t indexOf (T, U = size_t) (T[] arr, T element, U start = 0)
 in
 {
-    assert(arr.length > 0);
     assert(start >= 0);
 }
 out (result)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwt/dwthelper/associativearray.d	Sun Jan 18 18:39:46 2009 +0100
@@ -0,0 +1,150 @@
+/**
+ * Copyright: Copyright (c) 2008 Jacob Carlborg. All rights reserved.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: 2008
+ * License: $(LINK2 http://opensource.org/licenses/bsd-license.php, BSD Style)
+ * 
+ */
+module dwt.dwthelper.associativearray;
+
+/**
+ * Returns the value to which the specified key is mapped,
+ * or ($D_CODE null) if this associative array contains no mapping for the key.
+ * 
+ * $(P More formally, if the specified associative array contains a mapping from a key
+ * $(D_CODE k) to a value $(D_CODE v) such that $(D_CODE (key==null ? k==null :
+ * key.equals(k))), then this method returns $(D_CODE v); otherwise
+ * it returns $(D_CODE null).  (There can be at most one such mapping.))
+ * 
+ * Params:
+ *     aa = the associative array to get the value from
+ *     key = the key whose associated value is to be returned
+ *     
+ *     
+ * Returns: the value to which the specified key is mapped, or
+ * 			$(D_CODE null) if this map contains no mapping for the key
+ * 
+ * Throws: AssertException if any paramter is invalid
+ */
+V get (K, V) (V[K] aa, K key)
+in
+{
+	assert(aa.length > 0);
+}
+body
+{
+	return aa[key];
+}
+
+/**
+ * Associates the specified value with the specified key in the specified 
+ * associative array. If the associative array previously contained a mapping for
+ * the key, the old value is replaced by the specified value.  (An associative array
+ * <tt>aa</tt> is said to contain a mapping for a key <tt>k</tt> if and only
+ * if $(LINK2 #containsKey(Object), m.containsKey(k)) would return
+ * <tt>true</tt>.)
+ * 
+ * Params:
+ *     aa = the associative array to add the key/value pair to
+ *     key = key with which the specified value is to be associated
+ *     value = value to be associated with the specified key
+ *     
+ * Returns: the previous value associated with <tt>key</tt>, or
+ *         <tt>null</tt> if there was no mapping for <tt>key</tt>.
+ *         (A <tt>null</tt> return can also indicate that the 
+ *         associative array previously associated <tt>null</tt> 
+ *         with <tt>key</tt>.)
+ */
+V put (K, V) (V[K] aa, K key, V value)
+{
+	return aa[key] = value;
+}
+
+/**
+ * Removes the mapping for a key from the specified 
+ * associative array if it is present. More formally, 
+ * if the associative array contains a mapping
+ * from key <tt>k</tt> to value <tt>v</tt> such that
+ * $(D_CODE (key==null ?  k==null : key.equals(k))), that mapping
+ * is removed.  (The associative array can contain at most one such mapping.)
+ *
+ * $(P Returns the value to which the associative array previously associated the key,
+ * or <tt>null</tt> if the map contained no mapping for the key.)
+ * 
+ * Params:
+ *     aa = the associative array to remove the key/value pair from
+ *     key = key whose mapping is to be removed from the associative array
+ *     
+ * Returns:
+ */
+V remove (K, V) (V[K] aa, K key)
+{
+	V v = aa[key];
+	aa.remove(k);
+	
+	return v;
+}
+
+/**
+ * Returns <tt>true</tt> if the specified 
+ * associative array contains no key-value mappings.
+ * 
+ * Params:
+ *     aa = the associative array to check if it's empty
+ *
+ * Returns: <tt>true</tt> if the specified 
+ * 			associative array contains no key-value mappings
+ */
+bool isEmpty (K, V) (V[K] aa)
+{
+	return aa.length == 0;
+}
+
+
+/**
+ * Returns a array of the values contained in the 
+ * specifed associative array. The array is backed by 
+ * the associative array(if it contains classes or pointers),
+ * so changes to the associative array are reflected in 
+ * the array, and vice-versa. If the associative array is
+ * modified while an iteration over the collection is in progress
+ * (except through the iterator's own <tt>remove</tt> operation),
+ * the results of the iteration are undefined.  The collection
+ * supports element removal, which removes the corresponding
+ * mapping from the map, via the <tt>Iterator.remove</tt>,
+ * <tt>Collection.remove</tt>, <tt>removeAll</tt>,
+ * <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not
+ * support the <tt>add</tt> or <tt>addAll</tt> operations.
+ * 
+ * Params:
+ *     aa = the associative array to get the values from
+ *     
+ * Returns: a collection view of the values contained in this map
+ */
+V[] values (K, V) (V[K] aa)
+{
+	return aa.values;
+}
+
+/**
+ * Removes all mappings from this map
+ */
+void clear (K, V) (V[K] aa)
+{
+    foreach (k, v ; aa)
+        aa.remove(k);
+}
+
+/**
+ * Returns the number of key-value mappings in
+ * the specifed associative array
+ * 
+ * Params:
+ *     aa = the associative array to get the number of key-value mappings from
+ *     
+ * Returns: the number of key-value mappings in the associative array
+ */
+/*int size (K, V) (V[K] aa)
+{
+	aa.length;
+}*/
\ No newline at end of file
--- a/dwt/dwthelper/utils.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/dwthelper/utils.d	Sun Jan 18 18:39:46 2009 +0100
@@ -261,8 +261,7 @@
         return value;
     }
     public static String toString( double value ){
-        implMissing( __FILE__, __LINE__ );
-        return null;
+        return Format("{}", value);
     }
 }
 
--- a/dwt/graphics/Device.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/graphics/Device.d	Sun Jan 18 18:39:46 2009 +0100
@@ -46,6 +46,8 @@
 import dwt.internal.objc.cocoa.Cocoa;
 import objc = dwt.internal.objc.runtime;
 
+import tango.io.Stdout;
+
 /**
  * This class is the abstract superclass of all device objects,
  * such as the Display device and the Printer device. Devices
--- a/dwt/graphics/GC.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/graphics/GC.d	Sun Jan 18 18:39:46 2009 +0100
@@ -716,6 +716,7 @@
                     }
                     break;
                 }
+                default:
             }
         }
         length = j;
--- a/dwt/graphics/Image.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/graphics/Image.d	Sun Jan 18 18:39:46 2009 +0100
@@ -45,6 +45,8 @@
 import dwt.graphics.Resource;
 import dwt.internal.objc.cocoa.Cocoa;
 import objc = dwt.internal.objc.runtime;
+
+import tango.io.Stdout;
  
 /**
  * Instances of this class are graphics which have been prepared
@@ -277,7 +279,7 @@
     rep = rep.initWithBitmapDataPlanes(null, width, height, srcRep.bitsPerSample(), srcRep.samplesPerPixel(), srcRep.samplesPerPixel() is 4, srcRep.isPlanar(), OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, srcRep.bytesPerRow(), srcRep.bitsPerPixel());
         handle.addRepresentation(rep);
 
-    objc.id data = rep.bitmapData();
+    ubyte* data = rep.bitmapData();
     OS.memmove(data, srcImage.imageRep.bitmapData(), width * height * 4);
         if (flag !is DWT.IMAGE_COPY) {
 
@@ -815,7 +817,7 @@
     handle = handle.initWithSize(size);
     NSBitmapImageRep rep = imageRep = cast(NSBitmapImageRep)(new NSBitmapImageRep()).alloc();
     rep = rep.initWithBitmapDataPlanes(null, width, height, 8, 3, false, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32);
-    OS.memset(rep.bitmapData(), 0xFF, cast(size_t) (width * height * 4));
+    OS.memset(rep.bitmapData(), 0xFF, width * height * 4);
     handle.addRepresentation(rep);
 //  rep.release();
 }
@@ -954,7 +956,7 @@
         if (imageRep.hasAlpha()) {
         NSInteger bpr = width * 4;
         rep = cast(NSBitmapImageRep)(new NSBitmapImageRep()).alloc();
-        objc.id bitmapData = imageRep.bitmapData();
+        ubyte* bitmapData = imageRep.bitmapData();
         if (data.bitmapDataAddress !is null) OS.free(data.bitmapDataAddress);
         data.bitmapDataAddress = cast(ubyte*) OS.malloc(C.PTR_SIZEOF);
         OS.memmove(data.bitmapDataAddress, bitmapData, C.PTR_SIZEOF);
--- a/dwt/internal/cocoa/NSArray.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/internal/cocoa/NSArray.d	Sun Jan 18 18:39:46 2009 +0100
@@ -53,8 +53,8 @@
 }
 
 public cocoa.id objectAtIndex(NSUInteger index) {
-    objc.id result = OS.objc_msgSend(this.id, OS.sel_objectAtIndex_, index);
-    return result !is null ? new cocoa.id(result) : null;
+	objc.id result = OS.objc_msgSend(this.id, OS.sel_objectAtIndex_, index);
+	return result !is null ? new cocoa.id(result) : null;
 }
 
 }
--- a/dwt/internal/cocoa/NSBitmapImageRep.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/internal/cocoa/NSBitmapImageRep.d	Sun Jan 18 18:39:46 2009 +0100
@@ -38,11 +38,10 @@
 
 public this (cocoa.id id) {
     super(id);
-
 }
 
-public objc.id bitmapData () {
-    return OS.objc_msgSend(this.id, OS.sel_bitmapData);
+public ubyte* bitmapData () {
+    return cast(ubyte*) OS.objc_msgSend(this.id, OS.sel_bitmapData);
 }
 
 public NSInteger bitsPerPixel () {
@@ -58,13 +57,13 @@
 }
 
 public NSBitmapImageRep initWithBitmapDataPlanes (ubyte** planes, NSInteger width, NSInteger height, NSInteger bps, NSInteger spp, bool alpha, bool isPlanar, NSString colorSpaceName, NSBitmapFormat bitmapFormat, NSInteger rBytes, NSInteger pBits) {
-    objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel_, planes, width, height, bps, spp, alpha, isPlanar, colorSpaceName !is null ? colorSpaceName.id : null, bitmapFormat, rBytes, pBits);
-    return result !is null ? this : null;
+	objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel_, planes, width, height, bps, spp, alpha, isPlanar, colorSpaceName !is null ? colorSpaceName.id : null, bitmapFormat, rBytes, pBits);
+	return result is this.id ? this : (result !is null ? new NSBitmapImageRep(result) : null);
 }
 
 public NSBitmapImageRep initWithBitmapDataPlanes (ubyte** planes, NSInteger width, NSInteger height, NSInteger bps, NSInteger spp, bool alpha, bool isPlanar, NSString colorSpaceName, NSInteger rBytes, NSInteger pBits) {
-    objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bytesPerRow_bitsPerPixel_, planes, width, height, bps, spp, alpha, isPlanar, colorSpaceName !is null ? colorSpaceName.id : null, rBytes, pBits);
-    return result !is null ? this : null;
+	objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bytesPerRow_bitsPerPixel_, planes, width, height, bps, spp, alpha, isPlanar, colorSpaceName !is null ? colorSpaceName.id : null, rBytes, pBits);
+	return result is this.id ? this : (result !is null ? new NSBitmapImageRep(result) : null);
 }
 
 public bool isPlanar () {
--- a/dwt/internal/cocoa/NSView.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/internal/cocoa/NSView.d	Sun Jan 18 18:39:46 2009 +0100
@@ -240,8 +240,8 @@
 }
 
 public NSArray subviews() {
-    objc.id result = OS.objc_msgSend(this.id, OS.sel_subviews);
-    return result !is null ? new NSArray(result) : null;
+	objc.id result = OS.objc_msgSend(this.id, OS.sel_subviews);
+	return result !is null ? new NSArray(result) : null;
 }
 
 public NSView superview() {
--- a/dwt/internal/objc/bindings.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/internal/objc/bindings.d	Sun Jan 18 18:39:46 2009 +0100
@@ -25,7 +25,7 @@
 Class object_getClass (id object);
 /*const*/char* object_getClassName (id obj);
 Class object_setClass (id object, Class cls);
-Ivar object_getInstanceVariable (id obj, /*const*/char* name, out void* outValue);
+Ivar object_getInstanceVariable (id obj, /*const*/char* name, void** outValue);
 Ivar object_setInstanceVariable (id obj, /*const*/char* name, void* value);
 SEL sel_registerName (/*const*/char* str);
 id objc_msgSend (id theReceiver, SEL theSelector, ...);
--- a/dwt/internal/objc/runtime.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/internal/objc/runtime.d	Sun Jan 18 18:39:46 2009 +0100
@@ -129,12 +129,12 @@
 
 bool class_addIvar (Class cls, String name, size_t size, byte alignment, String types)
 {
-    return dwt.internal.objc.bindings.class_addIvar(cls, name.ptr, size, alignment, types.ptr);
+    return dwt.internal.objc.bindings.class_addIvar(cls, name.ptr, size, alignment, types.toStringz());
 }
 
 bool class_addMethod (Class cls, SEL name, IMP imp, String types)
 {
-    return dwt.internal.objc.bindings.class_addMethod(cls, name, imp, types.ptr);
+    return dwt.internal.objc.bindings.class_addMethod(cls, name, imp, types.toStringz());
 }
 
 IMP class_getMethodImplementation (Class cls, SEL name)
@@ -149,22 +149,22 @@
 
 Class objc_allocateClassPair (Class superclass, String name, size_t extraBytes)
 {
-    return dwt.internal.objc.bindings.objc_allocateClassPair(superclass, name.ptr, extraBytes);
+    return dwt.internal.objc.bindings.objc_allocateClassPair(superclass, name.toStringz(), extraBytes);
 }
 
 id objc_getClass (String name)
 {
-    return dwt.internal.objc.bindings.objc_getClass(name.ptr);
+    return dwt.internal.objc.bindings.objc_getClass(name.toStringz());
 }
 
 Protocol* objc_getProtocol (String name)
 {
-    return dwt.internal.objc.bindings.objc_getProtocol(name.ptr);
+    return dwt.internal.objc.bindings.objc_getProtocol(name.toStringz());
 }
 
 id objc_lookUpClass (String name)
 {
-    return dwt.internal.objc.bindings.objc_lookUpClass(name.ptr);
+    return dwt.internal.objc.bindings.objc_lookUpClass(name.toStringz());
 }
 
 SEL object_getClassName (id obj)
@@ -174,17 +174,17 @@
 
 Ivar object_getInstanceVariable (id obj, String name, out void* outValue)
 {
-    return dwt.internal.objc.bindings.object_getInstanceVariable(obj, name.ptr, outValue);
+    return dwt.internal.objc.bindings.object_getInstanceVariable(obj, name.toStringz(), &outValue);
 }
 
 Ivar object_setInstanceVariable (id obj, String name, void* value)
 {
-    return dwt.internal.objc.bindings.object_setInstanceVariable(obj, name.ptr, value);
+    return dwt.internal.objc.bindings.object_setInstanceVariable(obj, name.toStringz(), value);
 }
 
 SEL sel_registerName (String str)
 {
-    return dwt.internal.objc.bindings.sel_registerName(str.ptr);
+    return dwt.internal.objc.bindings.sel_registerName(str.toStringz());
 }
 
 id objc_msgSend (ARGS...) (id theReceiver, SEL theSelector, ARGS args)
--- a/dwt/widgets/Caret.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/widgets/Caret.d	Sun Jan 18 18:39:46 2009 +0100
@@ -53,7 +53,7 @@
     Image image;
     Font font;
 
-    static final int DEFAULT_WIDTH  = 1;
+    static const int DEFAULT_WIDTH  = 1;
     
 /**
  * Constructs a new instance of this class given its parent
--- a/dwt/widgets/Composite.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/widgets/Composite.d	Sun Jan 18 18:39:46 2009 +0100
@@ -45,6 +45,8 @@
 import dwt.widgets.Shell;
 import dwt.widgets.Widget;
 
+import tango.io.Stdout;
+
 /**
  * Instances of this class are controls which are capable
  * of containing other controls.
@@ -128,12 +130,13 @@
 }
 
 Control [] _getChildren () {
+    auto vi = view.id;
     NSArray views = contentView().subviews();
-    int count = cast(int)/*64*/views.count();
+    NSUInteger count = views.count();
     Control [] children = new Control [count];
     if (count is 0) return children;
-    int j = 0;
-    for (int i=0; i<count; i++){
+    NSUInteger j = 0;
+    for (NSUInteger i=0; i<count; i++){auto o = views.objectAtIndex (count - i - 1).id;
         Widget widget = display.getWidget (views.objectAtIndex (count - i - 1).id);
         if (widget !is null && widget !is this && cast(Control) widget) {
             children [j++] = cast(Control) widget;
--- a/dwt/widgets/Control.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/widgets/Control.d	Sun Jan 18 18:39:46 2009 +0100
@@ -79,6 +79,8 @@
 import dwt.widgets.TypedListener;
 import dwt.widgets.Widget;
 
+import tango.io.Stdout;
+
 /**
  * Control is the abstract superclass of all windowed user interface classes.
  * <p>
--- a/dwt/widgets/Display.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/widgets/Display.d	Sun Jan 18 18:39:46 2009 +0100
@@ -95,6 +95,8 @@
 import dwt.widgets.Tray;
 import dwt.widgets.Widget;
 
+import tango.io.Stdout;
+
 /**
  * Instances of this class are responsible for managing the
  * connection between DWT and the underlying operating
@@ -3569,7 +3571,7 @@
         }
         Control control = null;
         if (view !is null) {
-            do {
+            do {auto vi = view.id;
                 Widget widget = getWidget (view);
                 if (cast(Control) widget) {
                     control = cast(Control)widget;
--- a/dwt/widgets/MenuItem.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/widgets/MenuItem.d	Sun Jan 18 18:39:46 2009 +0100
@@ -416,7 +416,6 @@
         */
 //      case DWT.INSERT: return ??;
         default:
-            assert(false);
     }
     return 0;
 }
@@ -836,6 +835,7 @@
                         }
                     }
                     break;
+                default:
             }
         }
         NSString string = NSString.stringWith (key is 0 ? "" : cast(char)key ~ "");
--- a/dwt/widgets/Table.d	Sat Jan 17 16:26:49 2009 +0100
+++ b/dwt/widgets/Table.d	Sun Jan 18 18:39:46 2009 +0100
@@ -120,8 +120,13 @@
  */
 public class Table : Composite {
 
+    alias Composite.computeSize computeSize;
+    alias Composite.createHandle createHandle;
+    alias Composite.dragDetect dragDetect;
     alias Composite.setBackground setBackground;
+    alias Composite.setBounds setBounds;
     alias Composite.setFont setFont;
+    alias Composite.setForeground setForeground;
 
     TableItem [] items;
     TableColumn [] columns;