diff dwt/internal/cocoa/NSDecimalNumber.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/NSDecimalNumber.d	Sat Aug 09 17:00:02 2008 +0200
+++ b/dwt/internal/cocoa/NSDecimalNumber.d	Tue Aug 19 17:35:17 2008 +0200
@@ -18,6 +18,7 @@
 import dwt.internal.cocoa.NSDecimal;
 import dwt.internal.cocoa.NSInteger;
 import dwt.internal.cocoa.NSNumber;
+import dwt.internal.cocoa.NSPoint;
 import dwt.internal.cocoa.NSString;
 import dwt.internal.cocoa.OS;
 import objc = dwt.internal.objc.runtime;
@@ -37,91 +38,91 @@
 
     public NSComparisonResult compare (NSNumber decimalNumber)
     {
-        return cast(NSComparisonResult) OS.objc_msgSend(this.id, OS.sel_compare_1, decimalNumber !is null ? decimalNumber.id : null);
+        return cast(NSComparisonResult) OS.objc_msgSend(this.id_, OS.sel_compare_1, decimalNumber !is null ? decimalNumber.id_ : null);
     }
 
     public NSDecimalNumber decimalNumberByAdding_ (NSDecimalNumber decimalNumber)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByAdding_1, decimalNumber !is null ? decimalNumber.id : null);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberByAdding_1, decimalNumber !is null ? decimalNumber.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public NSDecimalNumber decimalNumberByAdding_withBehavior_ (NSDecimalNumber decimalNumber, id behavior)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByAdding_1withBehavior_1, decimalNumber !is null ? decimalNumber.id : null,
-                behavior !is null ? behavior.id : null);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberByAdding_1withBehavior_1, decimalNumber !is null ? decimalNumber.id_ : null,
+                behavior !is null ? behavior.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public NSDecimalNumber decimalNumberByDividingBy_ (NSDecimalNumber decimalNumber)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByDividingBy_1, decimalNumber !is null ? decimalNumber.id : null);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberByDividingBy_1, decimalNumber !is null ? decimalNumber.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public NSDecimalNumber decimalNumberByDividingBy_withBehavior_ (NSDecimalNumber decimalNumber, id behavior)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByDividingBy_1withBehavior_1, decimalNumber !is null ? decimalNumber.id : null,
-                behavior !is null ? behavior.id : null);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberByDividingBy_1withBehavior_1, decimalNumber !is null ? decimalNumber.id_ : null,
+                behavior !is null ? behavior.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public NSDecimalNumber decimalNumberByMultiplyingBy_ (NSDecimalNumber decimalNumber)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByMultiplyingBy_1, decimalNumber !is null ? decimalNumber.id : null);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberByMultiplyingBy_1, decimalNumber !is null ? decimalNumber.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public NSDecimalNumber decimalNumberByMultiplyingBy_withBehavior_ (NSDecimalNumber decimalNumber, id behavior)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByMultiplyingBy_1withBehavior_1,
-                decimalNumber !is null ? decimalNumber.id : null, behavior !is null ? behavior.id : null);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberByMultiplyingBy_1withBehavior_1,
+                decimalNumber !is null ? decimalNumber.id_ : null, behavior !is null ? behavior.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public NSDecimalNumber decimalNumberByMultiplyingByPowerOf10_ (short power)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByMultiplyingByPowerOf10_1, power);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberByMultiplyingByPowerOf10_1, power);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public NSDecimalNumber decimalNumberByMultiplyingByPowerOf10_withBehavior_ (short power, id behavior)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByMultiplyingByPowerOf10_1withBehavior_1, power,
-                behavior !is null ? behavior.id : null);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberByMultiplyingByPowerOf10_1withBehavior_1, power,
+                behavior !is null ? behavior.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public NSDecimalNumber decimalNumberByRaisingToPower_ (NSUInteger power)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByRaisingToPower_1, power);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberByRaisingToPower_1, power);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public NSDecimalNumber decimalNumberByRaisingToPower_withBehavior_ (uint power, id behavior)
     {
         objc.id
-                result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByRaisingToPower_1withBehavior_1, power, behavior !is null ? behavior.id : null);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+                result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberByRaisingToPower_1withBehavior_1, power, behavior !is null ? behavior.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public NSDecimalNumber decimalNumberByRoundingAccordingToBehavior (id behavior)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByRoundingAccordingToBehavior_1, behavior !is null ? behavior.id : null);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberByRoundingAccordingToBehavior_1, behavior !is null ? behavior.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public NSDecimalNumber decimalNumberBySubtracting_ (NSDecimalNumber decimalNumber)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decimalNumberBySubtracting_1, decimalNumber !is null ? decimalNumber.id : null);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberBySubtracting_1, decimalNumber !is null ? decimalNumber.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public NSDecimalNumber decimalNumberBySubtracting_withBehavior_ (NSDecimalNumber decimalNumber, id behavior)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decimalNumberBySubtracting_1withBehavior_1,
-                decimalNumber !is null ? decimalNumber.id : null, behavior !is null ? behavior.id : null);
-        return result is this.id ? this : (result !is null ? new NSDecimalNumber(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalNumberBySubtracting_1withBehavior_1,
+                decimalNumber !is null ? decimalNumber.id_ : null, behavior !is null ? behavior.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSDecimalNumber(result) : null);
     }
 
     public static NSDecimalNumber decimalNumberWithDecimal (NSDecimal dcm)
@@ -139,21 +140,21 @@
 
     public static NSDecimalNumber static_decimalNumberWithString_ (NSString numberValue)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_decimalNumberWithString_1, numberValue !is null ? numberValue.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_decimalNumberWithString_1, numberValue !is null ? numberValue.id_ : null);
         return result !is null ? new NSDecimalNumber(result) : null;
     }
 
     public static NSDecimalNumber static_decimalNumberWithString_locale_ (NSString numberValue, id locale)
     {
         objc.id result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_decimalNumberWithString_1locale_1,
-                numberValue !is null ? numberValue.id : null, locale !is null ? locale.id : null);
+                numberValue !is null ? numberValue.id_ : null, locale !is null ? locale.id_ : null);
         return result !is null ? new NSDecimalNumber(result) : null;
     }
 
     public NSDecimal decimalValue ()
     {
-        NSDecimal result = new NSDecimal();
-        OS.objc_msgSend_stret(result, this.id, OS.sel_decimalValue);
+        NSDecimal result;
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_decimalValue);
         return result;
     }
 
@@ -165,37 +166,37 @@
 
     public NSString descriptionWithLocale (id locale)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1, locale !is null ? locale.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_descriptionWithLocale_1, locale !is null ? locale.id_ : null);
         return result !is null ? new NSString(result) : null;
     }
 
     public double doubleValue ()
     {
-        return OS.objc_msgSend_fpret(this.id, OS.sel_doubleValue);
+        return OS.objc_msgSend_fpret(this.id_, OS.sel_doubleValue);
     }
 
     public id initWithDecimal (NSDecimal dcm)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithDecimal_1, dcm);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithDecimal_1, dcm);
         return result !is null ? new id(result) : null;
     }
 
     public id initWithMantissa (ulong mantissa, short exponent, bool flag)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithMantissa_1exponent_1isNegative_1, mantissa, exponent, flag);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithMantissa_1exponent_1isNegative_1, mantissa, exponent, flag);
         return result !is null ? new id(result) : null;
     }
 
     public id initWithString_ (NSString numberValue)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithString_1, numberValue !is null ? numberValue.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithString_1, numberValue !is null ? numberValue.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public id initWithString_locale_ (NSString numberValue, id locale)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithString_1locale_1, numberValue !is null ? numberValue.id : null,
-                locale !is null ? locale.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithString_1locale_1, numberValue !is null ? numberValue.id_ : null,
+                locale !is null ? locale.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
@@ -219,7 +220,7 @@
 
     public /*const char* */byte* objCType ()
     {
-        return cast(/*const char* */byte*) OS.objc_msgSend(this.id, OS.sel_objCType);
+        return cast(/*const char* */byte*) OS.objc_msgSend(this.id_, OS.sel_objCType);
     }
 
     public static NSDecimalNumber one ()
@@ -230,7 +231,7 @@
 
     public static void setDefaultBehavior (id behavior)
     {
-        OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_setDefaultBehavior_1, behavior !is null ? behavior.id : null);
+        OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_setDefaultBehavior_1, behavior !is null ? behavior.id_ : null);
     }
 
     public static NSDecimalNumber zero ()