diff dwt/internal/cocoa/NSMenuView.d @ 1:8b48be5454ce

The internal cocoa classes compile now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Tue, 19 Aug 2008 17:35:17 +0200
parents 380af2bdd8e5
children f565d3a95c0a
line wrap: on
line diff
--- a/dwt/internal/cocoa/NSMenuView.d	Sat Aug 09 17:00:02 2008 +0200
+++ b/dwt/internal/cocoa/NSMenuView.d	Tue Aug 19 17:35:17 2008 +0200
@@ -13,8 +13,16 @@
  *******************************************************************************/
 module dwt.internal.cocoa.NSMenuView;
 
+import dwt.internal.cocoa.CGFloat;
+import dwt.internal.cocoa.NSEvent;
+import dwt.internal.cocoa.NSFont;
 import dwt.internal.cocoa.NSInteger;
-import dwt.internal.cocoa.NSRect : NSRectEdge;
+import dwt.internal.cocoa.NSMenu;
+import dwt.internal.cocoa.NSMenuItemCell;
+import dwt.internal.cocoa.NSNotification;
+import dwt.internal.cocoa.NSPoint;
+import dwt.internal.cocoa.NSRect;
+import dwt.internal.cocoa.NSScreen;
 import dwt.internal.cocoa.NSView;
 import dwt.internal.cocoa.OS;
 import objc = dwt.internal.objc.runtime;
@@ -34,120 +42,120 @@
 
     public void attachSubmenuForItemAtIndex (NSInteger index)
     {
-        OS.objc_msgSend(this.id, OS.sel_attachSubmenuForItemAtIndex_1, index);
+        OS.objc_msgSend(this.id_, OS.sel_attachSubmenuForItemAtIndex_1, index);
     }
 
     public NSMenu attachedMenu ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_attachedMenu);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_attachedMenu);
         return result !is null ? new NSMenu(result) : null;
     }
 
     public NSMenuView attachedMenuView ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_attachedMenuView);
-        return result is this.id ? this : (result !is null ? new NSMenuView(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_attachedMenuView);
+        return result is this.id_ ? this : (result !is null ? new NSMenuView(result) : null);
     }
 
     public void detachSubmenu ()
     {
-        OS.objc_msgSend(this.id, OS.sel_detachSubmenu);
+        OS.objc_msgSend(this.id_, OS.sel_detachSubmenu);
     }
 
     public NSFont font ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_font);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_font);
         return result !is null ? new NSFont(result) : null;
     }
 
     public NSInteger highlightedItemIndex ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_highlightedItemIndex);
+        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_highlightedItemIndex);
     }
 
     public CGFloat horizontalEdgePadding ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_horizontalEdgePadding);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_horizontalEdgePadding);
     }
 
     public CGFloat imageAndTitleOffset ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_imageAndTitleOffset);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_imageAndTitleOffset);
     }
 
     public CGFloat imageAndTitleWidth ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_imageAndTitleWidth);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_imageAndTitleWidth);
     }
 
     public NSInteger indexOfItemAtPoint (NSPoint point)
     {
-        return OS.objc_msgSend(this.id, OS.sel_indexOfItemAtPoint_1, point);
+        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_indexOfItemAtPoint_1, point);
     }
 
     public NSMenuView initAsTearOff ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initAsTearOff);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initAsTearOff);
         return result !is null ? this : null;
     }
 
     public NSRect innerRect ()
     {
         NSRect result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_innerRect);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_innerRect);
         return result;
     }
 
     public bool isAttached ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_isAttached) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_isAttached) !is null;
     }
 
     public bool isHorizontal ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_isHorizontal) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_isHorizontal) !is null;
     }
 
     public bool isTornOff ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_isTornOff) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_isTornOff) !is null;
     }
 
     public void itemAdded (NSNotification notification)
     {
-        OS.objc_msgSend(this.id, OS.sel_itemAdded_1, notification !is null ? notification.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_itemAdded_1, notification !is null ? notification.id_ : null);
     }
 
     public void itemChanged (NSNotification notification)
     {
-        OS.objc_msgSend(this.id, OS.sel_itemChanged_1, notification !is null ? notification.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_itemChanged_1, notification !is null ? notification.id_ : null);
     }
 
     public void itemRemoved (NSNotification notification)
     {
-        OS.objc_msgSend(this.id, OS.sel_itemRemoved_1, notification !is null ? notification.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_itemRemoved_1, notification !is null ? notification.id_ : null);
     }
 
     public CGFloat keyEquivalentOffset ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_keyEquivalentOffset);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_keyEquivalentOffset);
     }
 
     public CGFloat keyEquivalentWidth ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_keyEquivalentWidth);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_keyEquivalentWidth);
     }
 
     public NSPoint locationForSubmenu (NSMenu aSubmenu)
     {
         NSPoint result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_locationForSubmenu_1, aSubmenu !is null ? aSubmenu.id : null);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_locationForSubmenu_1, aSubmenu !is null ? aSubmenu.id_ : null);
         return result;
     }
 
     public NSMenu menu ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_menu);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_menu);
         return result !is null ? new NSMenu(result) : null;
     }
 
@@ -158,96 +166,96 @@
 
     public NSMenuItemCell menuItemCellForItemAtIndex (NSInteger index)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_menuItemCellForItemAtIndex_1, index);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_menuItemCellForItemAtIndex_1, index);
         return result !is null ? new NSMenuItemCell(result) : null;
     }
 
     public bool needsSizing ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_needsSizing) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_needsSizing) !is null;
     }
 
     public void performActionWithHighlightingForItemAtIndex (NSInteger index)
     {
-        OS.objc_msgSend(this.id, OS.sel_performActionWithHighlightingForItemAtIndex_1, index);
+        OS.objc_msgSend(this.id_, OS.sel_performActionWithHighlightingForItemAtIndex_1, index);
     }
 
-    public NSRect rectOfItemAtIndex (NSInteger)
+    public NSRect rectOfItemAtIndex (NSInteger index)
     {
         NSRect result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfItemAtIndex_1, index);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rectOfItemAtIndex_1, index);
         return result;
     }
 
     public void setFont (NSFont font)
     {
-        OS.objc_msgSend(this.id, OS.sel_setFont_1, font !is null ? font.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_setFont_1, font !is null ? font.id_ : null);
     }
 
     public void setHighlightedItemIndex (NSInteger index)
     {
-        OS.objc_msgSend(this.id, OS.sel_setHighlightedItemIndex_1, index);
+        OS.objc_msgSend(this.id_, OS.sel_setHighlightedItemIndex_1, index);
     }
 
     public void setHorizontal (bool flag)
     {
-        OS.objc_msgSend(this.id, OS.sel_setHorizontal_1, flag);
+        OS.objc_msgSend(this.id_, OS.sel_setHorizontal_1, flag);
     }
 
     public void setHorizontalEdgePadding (CGFloat pad)
     {
-        OS.objc_msgSend(this.id, OS.sel_setHorizontalEdgePadding_1, pad);
+        OS.objc_msgSend(this.id_, OS.sel_setHorizontalEdgePadding_1, pad);
     }
 
     public void setMenu (NSMenu menu)
     {
-        OS.objc_msgSend(this.id, OS.sel_setMenu_1, menu !is null ? menu.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_setMenu_1, menu !is null ? menu.id_ : null);
     }
 
     public void setMenuItemCell (NSMenuItemCell cell, NSInteger index)
     {
-        OS.objc_msgSend(this.id, OS.sel_setMenuItemCell_1forItemAtIndex_1, cell !is null ? cell.id : null, index);
+        OS.objc_msgSend(this.id_, OS.sel_setMenuItemCell_1forItemAtIndex_1, cell !is null ? cell.id_ : null, index);
     }
 
     public void setNeedsDisplayForItemAtIndex (NSInteger index)
     {
-        OS.objc_msgSend(this.id, OS.sel_setNeedsDisplayForItemAtIndex_1, index);
+        OS.objc_msgSend(this.id_, OS.sel_setNeedsDisplayForItemAtIndex_1, index);
     }
 
     public void setNeedsSizing (bool flag)
     {
-        OS.objc_msgSend(this.id, OS.sel_setNeedsSizing_1, flag);
+        OS.objc_msgSend(this.id_, OS.sel_setNeedsSizing_1, flag);
     }
 
     public void setWindowFrameForAttachingToRect (NSRect screenRect, NSScreen screen, NSRectEdge edge, NSInteger selectedItemIndex)
     {
-        OS.objc_msgSend(this.id, OS.sel_setWindowFrameForAttachingToRect_1onScreen_1preferredEdge_1popUpSelectedItem_1, screenRect,
-                screen !is null ? screen.id : null, edge, selectedItemIndex);
+        OS.objc_msgSend(this.id_, OS.sel_setWindowFrameForAttachingToRect_1onScreen_1preferredEdge_1popUpSelectedItem_1, screenRect,
+                screen !is null ? screen.id_ : null, edge, selectedItemIndex);
     }
 
     public void sizeToFit ()
     {
-        OS.objc_msgSend(this.id, OS.sel_sizeToFit);
+        OS.objc_msgSend(this.id_, OS.sel_sizeToFit);
     }
 
     public CGFloat stateImageOffset ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_stateImageOffset);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_stateImageOffset);
     }
 
     public CGFloat stateImageWidth ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_stateImageWidth);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_stateImageWidth);
     }
 
     public bool trackWithEvent (NSEvent event)
     {
-        return OS.objc_msgSend(this.id, OS.sel_trackWithEvent_1, event !is null ? event.id : null) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_trackWithEvent_1, event !is null ? event.id_ : null) !is null;
     }
 
     public void update ()
     {
-        OS.objc_msgSend(this.id, OS.sel_update);
+        OS.objc_msgSend(this.id_, OS.sel_update);
     }
 
 }