diff dwt/internal/cocoa/NSTabViewItem.d @ 45:d8635bb48c7c

Merge with SWT 3.5
author Jacob Carlborg <doob@me.com>
date Mon, 01 Dec 2008 17:07:00 +0100
parents f565d3a95c0a
children 63a09873578e
line wrap: on
line diff
--- a/dwt/internal/cocoa/NSTabViewItem.d	Tue Oct 21 15:20:04 2008 +0200
+++ b/dwt/internal/cocoa/NSTabViewItem.d	Mon Dec 01 17:07:00 2008 +0100
@@ -1,135 +1,51 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *     IBM Corporation - initial API and implementation
+ *    IBM Corporation - initial API and implementation
  *     
  * Port to the D programming language:
- *     Jacob Carlborg <jacob.carlborg@gmail.com>
+ *    Jacob Carlborg <doob@me.com>
  *******************************************************************************/
 module dwt.internal.cocoa.NSTabViewItem;
 
-import dwt.internal.cocoa.id;
-import dwt.internal.cocoa.NSColor;
+import dwt.dwthelper.utils;
+import cocoa = dwt.internal.cocoa.id;
 import dwt.internal.cocoa.NSObject;
-import dwt.internal.cocoa.NSRect;
-import dwt.internal.cocoa.NSSize;
 import dwt.internal.cocoa.NSString;
-import dwt.internal.cocoa.NSTabView;
 import dwt.internal.cocoa.NSView;
 import dwt.internal.cocoa.OS;
 import objc = dwt.internal.objc.runtime;
 
-enum NSTabState
-{
-    NSSelectedTab = 0,
-    NSBackgroundTab = 1,
-    NSPressedTab = 2
+public class NSTabViewItem : NSObject {
+    
+public this() {
+    super();
+}
+
+public this(objc.id id) {
+    super(id);
 }
 
-alias NSTabState.NSSelectedTab NSSelectedTab;
-alias NSTabState.NSBackgroundTab NSBackgroundTab;
-alias NSTabState.NSPressedTab NSPressedTab;
-
-public class NSTabViewItem : NSObject
-{
-
-    public this ()
-    {
-        super();
-    }
-
-    public this (objc.id id)
-    {
-        super(id);
-    }
-
-    public NSColor color ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_color);
-        return result !is null ? new NSColor(result) : null;
-    }
-
-    public void drawLabel (bool shouldTruncateLabel, NSRect labelRect)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_drawLabel_1inRect_1, shouldTruncateLabel, labelRect);
-    }
-
-    public id identifier ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_identifier);
-        return result !is null ? new id(result) : null;
-    }
-
-    public NSTabViewItem initWithIdentifier (id identifier)
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithIdentifier_1, identifier !is null ? identifier.id_ : null);
-        return result !is null ? this : null;
-    }
-
-    public NSTabViewItem initialFirstResponder ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initialFirstResponder);
-        return result !is null ? this : null;
-    }
+public this(cocoa.id id) {
+    super(id);
+}
+    
+public cocoa.id initWithIdentifier(cocoa.id identifier) {
+    objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithIdentifier_, identifier !is null ? identifier.id : null);
+    return result !is null ? new id(result) : null;
+}
 
-    public NSString label ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_label);
-        return result !is null ? new NSString(result) : null;
-    }
-
-    public void setColor (NSColor color)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setColor_1, color !is null ? color.id_ : null);
-    }
-
-    public void setIdentifier (id identifier)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setIdentifier_1, identifier !is null ? identifier.id_ : null);
-    }
-
-    public void setInitialFirstResponder (NSView view)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setInitialFirstResponder_1, view !is null ? view.id_ : null);
-    }
-
-    public void setLabel (NSString label)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setLabel_1, label !is null ? label.id_ : null);
-    }
+public void setLabel(NSString label) {
+    OS.objc_msgSend(this.id, OS.sel_setLabel_, label !is null ? label.id : null);
+}
 
-    public void setView (NSView view)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setView_1, view !is null ? view.id_ : null);
-    }
-
-    public NSSize sizeOfLabel (bool computeMin)
-    {
-        NSSize result;
-        OS.objc_msgSend_stret(&result, this.id_, OS.sel_sizeOfLabel_1, computeMin);
-        return result;
-    }
-
-    public NSTabState tabState ()
-    {
-        return cast(NSTabState) OS.objc_msgSend(this.id_, OS.sel_tabState);
-    }
-
-    public NSTabView tabView ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_tabView);
-        return result !is null ? new NSTabView(result) : null;
-    }
-
-    public id view ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_view);
-        return result !is null ? new id(result) : null;
-    }
+public void setView(NSView view) {
+    OS.objc_msgSend(this.id, OS.sel_setView_, view !is null ? view.id : null);
+}
 
 }