changeset 47:8615c76f10e4

Updated dwt.widgets.Compisite to 3.514
author Jacob Carlborg <doob@me.com>
date Fri, 05 Dec 2008 16:23:23 +0100
parents cfa563df4fdd
children 34237ae5156a
files dwt/widgets/Composite.d dwt/widgets/Scrollable.d
diffstat 2 files changed, 21 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/widgets/Composite.d	Fri Dec 05 16:00:41 2008 +0100
+++ b/dwt/widgets/Composite.d	Fri Dec 05 16:23:23 2008 +0100
@@ -28,10 +28,11 @@
 import dwt.internal.cocoa.OS;
 import dwt.internal.cocoa.SWTScrollView;
 import dwt.internal.cocoa.SWTView;
-import dwt.internal.cocoa.id;
+import cocoa = dwt.internal.cocoa.id;
 
 import dwt.dwthelper.utils;
-import dwt.internal.cocoa.NSInteger;
+import dwt.internal.c.Carbon;
+import dwt.internal.objc.cocoa.Cocoa;
 import dwt.widgets.Control;
 import dwt.widgets.Decorations;
 import dwt.widgets.Display;
@@ -125,7 +126,7 @@
     int j = 0;
     for (int i=0; i<count; i++){
         Widget widget = display.getWidget (views.objectAtIndex (count - i - 1).id);
-        if (widget !is null && widget !is this && widget instanceof Control) {
+        if (widget !is null && widget !is this && cast(Control) widget) {
             children [j++] = cast(Control) widget;
         }
     }
@@ -153,20 +154,20 @@
     return tabList;
 }
 
-bool acceptsFirstResponder (int /*long*/ id, int /*long*/ sel) {
+bool acceptsFirstResponder (objc.id id, objc.SEL sel) {
     if ((state & CANVAS) !is 0) {
         return ((style & DWT.NO_FOCUS) is 0);
     }
     return super.acceptsFirstResponder (id, sel);
 }
 
-int accessibilityAttributeNames(int /*long*/ id, int /*long*/ sel) {
+objc.id accessibilityAttributeNames(objc.id id, objc.SEL sel) {
     
     if (id is view.id) {
         if (accessible !is null) {
             // If there is an accessible, it may provide its own list of attributes if it's a lightweight control.
             // If not, let Cocoa handle it for this view.
-            id returnObject = accessible.internal_accessibilityAttributeNames(ACC.CHILDID_SELF);
+            cocoa.id returnObject = accessible.internal_accessibilityAttributeNames(ACC.CHILDID_SELF);
             if (returnObject !is null) return returnObject.id;
         }
     }
@@ -174,16 +175,16 @@
     return super.accessibilityAttributeNames(id, sel);
 }
 
-bool accessibilityIsIgnored(int /*long*/ id, int /*long*/ sel) {
+bool accessibilityIsIgnored(objc.id id, objc.SEL sel) {
     // If we have an accessible and it represents a valid accessible role, this view is not ignored.
     if (view !is null && id is view.id) {
         if (accessible !is null) {
-            id role = accessible.internal_accessibilityAttributeValue(OS.NSAccessibilityRoleAttribute, ACC.CHILDID_SELF);
+            cocoa.id role = accessible.internal_accessibilityAttributeValue(OS.NSAccessibilityRoleAttribute, ACC.CHILDID_SELF);
             if (role !is null) return false; 
         }
     }
 
-    return super.accessibilityIsIgnored(id, sel);   
+    return super.accessibilityIsIgnored(id, sel);
 }
 
 /**
@@ -295,7 +296,7 @@
     view = widget;
 }
 
-void drawWidget (int /*long*/ id, NSRect rect) {
+void drawWidget (objc.id id, NSRect rect) {
     if ((state & CANVAS) !is 0) {
         if ((style & DWT.NO_BACKGROUND) is 0) {
             NSGraphicsContext context = NSGraphicsContext.currentContext();
@@ -511,7 +512,7 @@
     return findDeferredControl () !is null;
 }
 
-bool isOpaque (int /*long*/ id, int /*long*/ sel) {
+bool isOpaque (objc.id id, objc.SEL sel) {
     if ((state & CANVAS) !is 0) {
         if (id is view.id) {
             if (region is null && background !is null && background.handle[3] is 1) {
@@ -527,7 +528,7 @@
     return super.isTabGroup ();
 }
 
-void keyDown (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
+void keyDown (objc.id id, objc.SEL sel, objc.id theEvent) {
     if ((state & CANVAS) !is 0) {
         NSArray array = NSArray.arrayWithObject (new NSEvent (theEvent));
         view.interpretKeyEvents (array);
@@ -733,17 +734,17 @@
     return new Point (width, height);
 }
 
-void pageDown(int /*long*/ id, int /*long*/ sel, int /*long*/ sender) {
+void pageDown(objc.id id, objc.SEL sel, objc.id sender) {
     if ((state & CANVAS) !is 0) return;
     super.pageDown(id, sel, sender);
 }
 
-void pageUp(int /*long*/ id, int /*long*/ sel, int /*long*/ sender) {
+void pageUp(objc.id id, objc.SEL sel, objc.id sender) {
     if ((state & CANVAS) !is 0) return;
     super.pageUp(id, sel, sender);
 }
 
-void reflectScrolledClipView (int /*long*/ id, int /*long*/ sel, int /*long*/ aClipView) {
+void reflectScrolledClipView (objc.id id, objc.SEL sel, objc.id aClipView) {
     if ((state & CANVAS) !is 0) return;
     super.reflectScrolledClipView (id, sel, aClipView);
 }
@@ -777,12 +778,12 @@
     }
 }
 
-void scrollWheel (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
+void scrollWheel (objc.id id, objc.SEL sel, objc.id theEvent) {
     if ((state & CANVAS) !is 0) {
         NSView view = scrollView !is null ? scrollView : this.view;
         if (id is view.id) {
             NSEvent nsEvent = new NSEvent(theEvent);
-            float /*double*/ delta = nsEvent.deltaY();
+            CGFloat delta = nsEvent.deltaY();
             if (delta !is 0) {
                 if (hooks (DWT.MouseWheel) || filters (DWT.MouseWheel)) {
                     if (!sendMouseEvent(nsEvent, DWT.MouseWheel, true)) {
@@ -793,7 +794,7 @@
             bool handled = false;
             ScrollBar bar = verticalBar;
             if (delta !is 0 && bar !is null && bar.getEnabled ()) {
-                int selection = Math.max (0, (int)(0.5f + bar.getSelection () - bar.getIncrement () * delta));
+                int selection = Math.max (0, cast(int)(0.5f + bar.getSelection () - bar.getIncrement () * delta));
                 bar.setSelection (selection);
                 Event event = new Event ();
                 event.detail = delta > 0 ? DWT.PAGE_UP : DWT.PAGE_DOWN; 
@@ -803,7 +804,7 @@
             bar = horizontalBar;
             delta = nsEvent.deltaX ();
             if (delta !is 0 && bar !is null && bar.getEnabled ()) {
-                int selection = Math.max (0, (int)(0.5f + bar.getSelection () - bar.getIncrement () * delta));
+                int selection = Math.max (0, cast(int)(0.5f + bar.getSelection () - bar.getIncrement () * delta));
                 bar.setSelection (selection);
                 Event event = new Event ();
                 event.detail = delta > 0 ? DWT.PAGE_UP : DWT.PAGE_DOWN; 
--- a/dwt/widgets/Scrollable.d	Fri Dec 05 16:00:41 2008 +0100
+++ b/dwt/widgets/Scrollable.d	Fri Dec 05 16:23:23 2008 +0100
@@ -89,7 +89,7 @@
     super (parent, style);
 }
 
-bool accessibilityIsIgnored(int /*long*/ id, int /*long*/ sel) {
+bool accessibilityIsIgnored(objc.id id, objc.SEL sel) {
     // Always ignore scrollers.
     if (scrollView !is null && id is scrollView.id) return true;
     return super.accessibilityIsIgnored(id, sel);