diff dwt/internal/cocoa/NSColor.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/NSColor.d	Sat Aug 09 17:00:02 2008 +0200
+++ b/dwt/internal/cocoa/NSColor.d	Tue Aug 19 17:35:17 2008 +0200
@@ -14,6 +14,7 @@
 module dwt.internal.cocoa.NSColor;
 
 import dwt.internal.cocoa.CGFloat;
+import dwt.internal.cocoa.CIColor;
 import dwt.internal.cocoa.NSArray;
 import dwt.internal.cocoa.NSColorSpace;
 import dwt.internal.cocoa.NSDictionary;
@@ -41,7 +42,7 @@
 
     public CGFloat alphaComponent ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_alphaComponent);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_alphaComponent);
     }
 
     public static NSColor alternateSelectedControlColor ()
@@ -64,13 +65,13 @@
 
     public CGFloat blackComponent ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_blackComponent);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_blackComponent);
     }
 
     public NSColor blendedColorWithFraction (CGFloat fraction, NSColor color)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_blendedColorWithFraction_1ofColor_1, fraction, color !is null ? color.id : null);
-        return result is this.id ? this : (result !is null ? new NSColor(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_blendedColorWithFraction_1ofColor_1, fraction, color !is null ? color.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSColor(result) : null);
     }
 
     public static NSColor blueColor ()
@@ -81,12 +82,12 @@
 
     public CGFloat blueComponent ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_blueComponent);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_blueComponent);
     }
 
     public CGFloat brightnessComponent ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_brightnessComponent);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_brightnessComponent);
     }
 
     public static NSColor brownColor ()
@@ -97,7 +98,7 @@
 
     public NSString catalogNameComponent ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_catalogNameComponent);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_catalogNameComponent);
         return result !is null ? new NSString(result) : null;
     }
 
@@ -115,56 +116,56 @@
 
     public static NSColor colorFromPasteboard (NSPasteboard pasteBoard)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorFromPasteboard_1, pasteBoard !is null ? pasteBoard.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorFromPasteboard_1, pasteBoard !is null ? pasteBoard.id_ : null);
         return result !is null ? new NSColor(result) : null;
     }
 
     public NSString colorNameComponent ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_colorNameComponent);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorNameComponent);
         return result !is null ? new NSString(result) : null;
     }
 
     public NSColorSpace colorSpace ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_colorSpace);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorSpace);
         return result !is null ? new NSColorSpace(result) : null;
     }
 
     public NSString colorSpaceName ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_colorSpaceName);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorSpaceName);
         return result !is null ? new NSString(result) : null;
     }
 
     public NSColor colorUsingColorSpace (NSColorSpace space)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_colorUsingColorSpace_1, space !is null ? space.id : null);
-        return result is this.id ? this : (result !is null ? new NSColor(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorUsingColorSpace_1, space !is null ? space.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSColor(result) : null);
     }
 
     public NSColor colorUsingColorSpaceName_ (NSString colorSpace)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_colorUsingColorSpaceName_1, colorSpace !is null ? colorSpace.id : null);
-        return result is this.id ? this : (result !is null ? new NSColor(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorUsingColorSpaceName_1, colorSpace !is null ? colorSpace.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSColor(result) : null);
     }
 
     public NSColor colorUsingColorSpaceName_device_ (NSString colorSpace, NSDictionary deviceDescription)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_colorUsingColorSpaceName_1device_1, colorSpace !is null ? colorSpace.id : null,
-                deviceDescription !is null ? deviceDescription.id : null);
-        return result is this.id ? this : (result !is null ? new NSColor(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorUsingColorSpaceName_1device_1, colorSpace !is null ? colorSpace.id_ : null,
+                deviceDescription !is null ? deviceDescription.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSColor(result) : null);
     }
 
     public NSColor colorWithAlphaComponent (CGFloat alpha)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_colorWithAlphaComponent_1, alpha);
-        return result is this.id ? this : (result !is null ? new NSColor(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorWithAlphaComponent_1, alpha);
+        return result is this.id_ ? this : (result !is null ? new NSColor(result) : null);
     }
 
     public static NSColor colorWithCIColor (CIColor color)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCIColor_1, color !is null ? color.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCIColor_1, color !is null ? color.id_ : null);
         return result !is null ? new NSColor(result) : null;
     }
 
@@ -189,14 +190,14 @@
 
     public static NSColor colorWithCatalogName (NSString listName, NSString colorName)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCatalogName_1colorName_1, listName !is null ? listName.id : null,
-                colorName !is null ? colorName.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCatalogName_1colorName_1, listName !is null ? listName.id_ : null,
+                colorName !is null ? colorName.id_ : null);
         return result !is null ? new NSColor(result) : null;
     }
 
     public static NSColor colorWithColorSpace (NSColorSpace space, /*const*/CGFloat* components, NSInteger numberOfComponents)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithColorSpace_1components_1count_1, space !is null ? space.id : null,
+        objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithColorSpace_1components_1count_1, space !is null ? space.id_ : null,
                 components, numberOfComponents);
         return result !is null ? new NSColor(result) : null;
     }
@@ -229,7 +230,7 @@
 
     public static NSColor colorWithPatternImage (NSImage image)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithPatternImage_1, image !is null ? image.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithPatternImage_1, image !is null ? image.id_ : null);
         return result !is null ? new NSColor(result) : null;
     }
 
@@ -294,7 +295,7 @@
 
     public CGFloat cyanComponent ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_cyanComponent);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_cyanComponent);
     }
 
     public static NSColor darkGrayColor ()
@@ -311,32 +312,32 @@
 
     public void drawSwatchInRect (NSRect rect)
     {
-        OS.objc_msgSend(this.id, OS.sel_drawSwatchInRect_1, rect);
+        OS.objc_msgSend(this.id_, OS.sel_drawSwatchInRect_1, rect);
     }
 
     public void getComponents (CGFloat[] components)
     {
-        OS.objc_msgSend(this.id, OS.sel_getComponents_1, components);
+        OS.objc_msgSend(this.id_, OS.sel_getComponents_1, components);
     }
 
     public void getCyan (CGFloat* cyan, CGFloat* magenta, CGFloat* yellow, CGFloat* black, CGFloat* alpha)
     {
-        OS.objc_msgSend(this.id, OS.sel_getCyan_1magenta_1yellow_1black_1alpha_1, cyan, magenta, yellow, black, alpha);
+        OS.objc_msgSend(this.id_, OS.sel_getCyan_1magenta_1yellow_1black_1alpha_1, cyan, magenta, yellow, black, alpha);
     }
 
     public void getHue (CGFloat* hue, CGFloat* saturation, CGFloat* brightness, CGFloat* alpha)
     {
-        OS.objc_msgSend(this.id, OS.sel_getHue_1saturation_1brightness_1alpha_1, hue, saturation, brightness, alpha);
+        OS.objc_msgSend(this.id_, OS.sel_getHue_1saturation_1brightness_1alpha_1, hue, saturation, brightness, alpha);
     }
 
     public void getRed (CGFloat* red, CGFloat* green, CGFloat* blue, CGFloat* alpha)
     {
-        OS.objc_msgSend(this.id, OS.sel_getRed_1green_1blue_1alpha_1, red, green, blue, alpha);
+        OS.objc_msgSend(this.id_, OS.sel_getRed_1green_1blue_1alpha_1, red, green, blue, alpha);
     }
 
     public void getWhite (CGFloat* white, CGFloat* alpha)
     {
-        OS.objc_msgSend(this.id, OS.sel_getWhite_1alpha_1, white, alpha);
+        OS.objc_msgSend(this.id_, OS.sel_getWhite_1alpha_1, white, alpha);
     }
 
     public static NSColor grayColor ()
@@ -353,7 +354,7 @@
 
     public CGFloat greenComponent ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_greenComponent);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_greenComponent);
     }
 
     public static NSColor gridColor ()
@@ -382,13 +383,13 @@
 
     public NSColor highlightWithLevel (CGFloat val)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_highlightWithLevel_1, val);
-        return result is this.id ? this : (result !is null ? new NSColor(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_highlightWithLevel_1, val);
+        return result is this.id_ ? this : (result !is null ? new NSColor(result) : null);
     }
 
     public CGFloat hueComponent ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_hueComponent);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_hueComponent);
     }
 
     public static bool ignoresAlpha ()
@@ -416,13 +417,13 @@
 
     public NSString localizedCatalogNameComponent ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_localizedCatalogNameComponent);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_localizedCatalogNameComponent);
         return result !is null ? new NSString(result) : null;
     }
 
     public NSString localizedColorNameComponent ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_localizedColorNameComponent);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_localizedColorNameComponent);
         return result !is null ? new NSString(result) : null;
     }
 
@@ -434,12 +435,12 @@
 
     public CGFloat magentaComponent ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_magentaComponent);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_magentaComponent);
     }
 
     public NSInteger numberOfComponents ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_numberOfComponents);
+        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfComponents);
     }
 
     public static NSColor orangeColor ()
@@ -450,7 +451,7 @@
 
     public NSImage patternImage ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_patternImage);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_patternImage);
         return result !is null ? new NSImage(result) : null;
     }
 
@@ -468,12 +469,12 @@
 
     public CGFloat redComponent ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_redComponent);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_redComponent);
     }
 
     public CGFloat saturationComponent ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_saturationComponent);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_saturationComponent);
     }
 
     public static NSColor scrollBarColor ()
@@ -532,12 +533,12 @@
 
     public void set ()
     {
-        OS.objc_msgSend(this.id, OS.sel_set);
+        OS.objc_msgSend(this.id_, OS.sel_set);
     }
 
     public void setFill ()
     {
-        OS.objc_msgSend(this.id, OS.sel_setFill);
+        OS.objc_msgSend(this.id_, OS.sel_setFill);
     }
 
     public static void setIgnoresAlpha (bool flag)
@@ -547,7 +548,7 @@
 
     public void setStroke ()
     {
-        OS.objc_msgSend(this.id, OS.sel_setStroke);
+        OS.objc_msgSend(this.id_, OS.sel_setStroke);
     }
 
     public static NSColor shadowColor ()
@@ -558,8 +559,8 @@
 
     public NSColor shadowWithLevel (CGFloat val)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_shadowWithLevel_1, val);
-        return result is this.id ? this : (result !is null ? new NSColor(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_shadowWithLevel_1, val);
+        return result is this.id_ ? this : (result !is null ? new NSColor(result) : null);
     }
 
     public static NSColor textBackgroundColor ()
@@ -582,7 +583,7 @@
 
     public CGFloat whiteComponent ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_whiteComponent);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_whiteComponent);
     }
 
     public static NSColor windowBackgroundColor ()
@@ -605,7 +606,7 @@
 
     public void writeToPasteboard (NSPasteboard pasteBoard)
     {
-        OS.objc_msgSend(this.id, OS.sel_writeToPasteboard_1, pasteBoard !is null ? pasteBoard.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_writeToPasteboard_1, pasteBoard !is null ? pasteBoard.id_ : null);
     }
 
     public static NSColor yellowColor ()
@@ -616,7 +617,7 @@
 
     public CGFloat yellowComponent ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_yellowComponent);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_yellowComponent);
     }
 
 }