diff dwt/internal/cocoa/NSFont.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/NSFont.d	Sat Aug 09 17:00:02 2008 +0200
+++ b/dwt/internal/cocoa/NSFont.d	Tue Aug 19 17:35:17 2008 +0200
@@ -69,19 +69,19 @@
     public NSSize advancementForGlyph (NSGlyph ag)
     {
         NSSize result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_advancementForGlyph_1, ag);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_advancementForGlyph_1, ag);
         return result;
     }
 
     public NSDictionary afmDictionary ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_afmDictionary);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_afmDictionary);
         return result !is null ? new NSDictionary(result) : null;
     }
 
     public CGFloat ascender ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_ascender);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_ascender);
     }
 
     public static NSFont boldSystemFontOfSize (CGFloat fontSize)
@@ -93,20 +93,20 @@
     public NSRect boundingRectForFont ()
     {
         NSRect result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_boundingRectForFont);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_boundingRectForFont);
         return result;
     }
 
     public NSRect boundingRectForGlyph (NSGlyph aGlyph)
     {
         NSRect result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_boundingRectForGlyph_1, aGlyph);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_boundingRectForGlyph_1, aGlyph);
         return result;
     }
 
     public CGFloat capHeight ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_capHeight);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_capHeight);
     }
 
     public static NSFont controlContentFontOfSize (CGFloat fontSize)
@@ -117,53 +117,53 @@
 
     public NSCharacterSet coveredCharacterSet ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_coveredCharacterSet);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_coveredCharacterSet);
         return result !is null ? new NSCharacterSet(result) : null;
     }
 
     public CGFloat defaultLineHeightForFont ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_defaultLineHeightForFont);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_defaultLineHeightForFont);
     }
 
     public CGFloat descender ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_descender);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_descender);
     }
 
     public NSString displayName ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_displayName);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_displayName);
         return result !is null ? new NSString(result) : null;
     }
 
     public NSString encodingScheme ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_encodingScheme);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_encodingScheme);
         return result !is null ? new NSString(result) : null;
     }
 
     public NSString familyName ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_familyName);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_familyName);
         return result !is null ? new NSString(result) : null;
     }
 
     public NSFontDescriptor fontDescriptor ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_fontDescriptor);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_fontDescriptor);
         return result !is null ? new NSFontDescriptor(result) : null;
     }
 
     public NSString fontName ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_fontName);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_fontName);
         return result !is null ? new NSString(result) : null;
     }
 
     public static NSFont static_fontWithDescriptor_size_ (NSFontDescriptor fontDescriptor, CGFloat fontSize)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSFont, OS.sel_fontWithDescriptor_1size_1, fontDescriptor !is null ? fontDescriptor.id : null,
+        objc.id result = OS.objc_msgSend(OS.class_NSFont, OS.sel_fontWithDescriptor_1size_1, fontDescriptor !is null ? fontDescriptor.id_ : null,
                 fontSize);
         return result !is null ? new NSFont(result) : null;
     }
@@ -171,65 +171,65 @@
     public static NSFont static_fontWithDescriptor_textTransform_ (NSFontDescriptor fontDescriptor, NSAffineTransform textTransform)
     {
         objc.id result = OS.objc_msgSend(OS.class_NSFont, OS.sel_fontWithDescriptor_1textTransform_1,
-                fontDescriptor !is null ? fontDescriptor.id : null, textTransform !is null ? textTransform.id : null);
+                fontDescriptor !is null ? fontDescriptor.id_ : null, textTransform !is null ? textTransform.id_ : null);
         return result !is null ? new NSFont(result) : null;
     }
 
     public static NSFont static_fontWithName_matrix_ (NSString fontName, CGFloat fontMatrix)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSFont, OS.sel_fontWithName_1matrix_1, fontName !is null ? fontName.id : null, fontMatrix);
+        objc.id result = OS.objc_msgSend(OS.class_NSFont, OS.sel_fontWithName_1matrix_1, fontName !is null ? fontName.id_ : null, fontMatrix);
         return result !is null ? new NSFont(result) : null;
     }
 
     public static NSFont static_fontWithName_size_ (NSString fontName, CGFloat fontSize)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSFont, OS.sel_fontWithName_1size_1, fontName !is null ? fontName.id : null, fontSize);
+        objc.id result = OS.objc_msgSend(OS.class_NSFont, OS.sel_fontWithName_1size_1, fontName !is null ? fontName.id_ : null, fontSize);
         return result !is null ? new NSFont(result) : null;
     }
 
     public void getAdvancements_forGlyphs_count_ (NSSizeArray advancements, /*const*/NSGlyph* glyphs, NSUInteger glyphCount)
     {
-        OS.objc_msgSend(this.id, OS.sel_getAdvancements_1forGlyphs_1count_1, advancements, glyphs, glyphCount);
+        OS.objc_msgSend(this.id_, OS.sel_getAdvancements_1forGlyphs_1count_1, advancements, glyphs, glyphCount);
     }
 
     public void getAdvancements_forPackedGlyphs_length_ (NSSizeArray advancements, /*const*/void* packedGlyphs, NSUInteger length)
     {
-        OS.objc_msgSend(this.id, OS.sel_getAdvancements_1forPackedGlyphs_1length_1, advancements, packedGlyphs, length);
+        OS.objc_msgSend(this.id_, OS.sel_getAdvancements_1forPackedGlyphs_1length_1, advancements, packedGlyphs, length);
     }
 
     public void getBoundingRects (NSRectArray bounds, /*const*/NSGlyph* glyphs, NSUInteger glyphCount)
     {
-        OS.objc_msgSend(this.id, OS.sel_getBoundingRects_1forGlyphs_1count_1, bounds, glyphs, glyphCount);
+        OS.objc_msgSend(this.id_, OS.sel_getBoundingRects_1forGlyphs_1count_1, bounds, glyphs, glyphCount);
     }
 
     public bool glyphIsEncoded (NSGlyph aGlyph)
     {
-        return OS.objc_msgSend(this.id, OS.sel_glyphIsEncoded_1, aGlyph) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_glyphIsEncoded_1, aGlyph) !is null;
     }
 
     public NSMultibyteGlyphPacking glyphPacking ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_glyphPacking);
+        return cast(NSMultibyteGlyphPacking) OS.objc_msgSend(this.id_, OS.sel_glyphPacking);
     }
 
     public NSGlyph glyphWithName (NSString aName)
     {
-        return OS.objc_msgSend(this.id, OS.sel_glyphWithName_1, aName !is null ? aName.id : null);
+        return cast(NSGlyph) OS.objc_msgSend(this.id_, OS.sel_glyphWithName_1, aName !is null ? aName.id_ : null);
     }
 
     public bool isBaseFont ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_isBaseFont) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_isBaseFont) !is null;
     }
 
     public bool isFixedPitch ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_isFixedPitch) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_isFixedPitch) !is null;
     }
 
     public CGFloat italicAngle ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_italicAngle);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_italicAngle);
     }
 
     public static NSFont labelFontOfSize (CGFloat fontSize)
@@ -245,18 +245,18 @@
 
     public CGFloat leading ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_leading);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_leading);
     }
 
     public /*const*/CGFloat* matrix ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_matrix);
+        return cast(/*const*/CGFloat*) OS.objc_msgSend(this.id_, OS.sel_matrix);
     }
 
     public NSSize maximumAdvancement ()
     {
         NSSize result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_maximumAdvancement);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_maximumAdvancement);
         return result;
     }
 
@@ -280,12 +280,12 @@
 
     public NSStringEncoding mostCompatibleStringEncoding ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_mostCompatibleStringEncoding);
+        return cast(NSStringEncoding) OS.objc_msgSend(this.id_, OS.sel_mostCompatibleStringEncoding);
     }
 
     public NSUInteger numberOfGlyphs ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_numberOfGlyphs);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfGlyphs);
     }
 
     public static NSFont paletteFontOfSize (CGFloat fontSize)
@@ -296,34 +296,34 @@
 
     public CGFloat pointSize ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_pointSize);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_pointSize);
     }
 
     public NSPoint positionOfGlyph_forCharacter_struckOverRect_ (NSGlyph aGlyph, short aChar, NSRect aRect)
     {
         NSPoint result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_positionOfGlyph_1forCharacter_1struckOverRect_1, aGlyph, aChar, aRect);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_positionOfGlyph_1forCharacter_1struckOverRect_1, aGlyph, aChar, aRect);
         return result;
     }
 
     public NSPoint positionOfGlyph_precededByGlyph_isNominal_ (NSGlyph curGlyph, NSGlyph prevGlyph, bool* nominal)
     {
         NSPoint result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_positionOfGlyph_1precededByGlyph_1isNominal_1, curGlyph, prevGlyph, nominal);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_positionOfGlyph_1precededByGlyph_1isNominal_1, curGlyph, prevGlyph, nominal);
         return result;
     }
 
     public NSPoint positionOfGlyph_struckOverGlyph_metricsExist_ (NSGlyph curGlyph, NSGlyph prevGlyph, bool* exist)
     {
         NSPoint result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_positionOfGlyph_1struckOverGlyph_1metricsExist_1, curGlyph, prevGlyph, exist);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_positionOfGlyph_1struckOverGlyph_1metricsExist_1, curGlyph, prevGlyph, exist);
         return result;
     }
 
     public NSPoint positionOfGlyph_struckOverRect_metricsExist_ (NSGlyph aGlyph, NSRect aRect, bool* exist)
     {
         NSPoint result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_positionOfGlyph_1struckOverRect_1metricsExist_1, aGlyph, aRect, exist);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_positionOfGlyph_1struckOverRect_1metricsExist_1, aGlyph, aRect, exist);
         return result;
     }
 
@@ -331,14 +331,14 @@
             NSGlyph baseGlyph, NSSizePointer adv, bool* exist)
     {
         NSPoint result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_positionOfGlyph_1withRelation_1toBaseGlyph_1totalAdvancement_1metricsExist_1, thisGlyph, rel,
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_positionOfGlyph_1withRelation_1toBaseGlyph_1totalAdvancement_1metricsExist_1, thisGlyph, rel,
                 baseGlyph, adv, exist);
         return result;
     }
 
     public NSInteger positionsForCompositeSequence (NSGlyph* someGlyphs, NSInteger numGlyphs, NSPointArray points)
     {
-        return OS.objc_msgSend(this.id, OS.sel_positionsForCompositeSequence_1numberOfGlyphs_1pointArray_1, someGlyphs, numGlyphs, points);
+        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_positionsForCompositeSequence_1numberOfGlyphs_1pointArray_1, someGlyphs, numGlyphs, points);
     }
 
     public static NSArray preferredFontNames ()
@@ -349,50 +349,50 @@
 
     public NSFont printerFont ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_printerFont);
-        return result is this.id ? this : (result !is null ? new NSFont(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_printerFont);
+        return result is this.id_ ? this : (result !is null ? new NSFont(result) : null);
     }
 
     public NSFontRenderingMode renderingMode ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_renderingMode);
+        return cast(NSFontRenderingMode) OS.objc_msgSend(this.id_, OS.sel_renderingMode);
     }
 
     public NSFont screenFont ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_screenFont);
-        return result is this.id ? this : (result !is null ? new NSFont(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_screenFont);
+        return result is this.id_ ? this : (result !is null ? new NSFont(result) : null);
     }
 
     public NSFont screenFontWithRenderingMode (NSFontRenderingMode renderingMode)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_screenFontWithRenderingMode_1, renderingMode);
-        return result is this.id ? this : (result !is null ? new NSFont(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_screenFontWithRenderingMode_1, renderingMode);
+        return result is this.id_ ? this : (result !is null ? new NSFont(result) : null);
     }
 
     public void set ()
     {
-        OS.objc_msgSend(this.id, OS.sel_set);
+        OS.objc_msgSend(this.id_, OS.sel_set);
     }
 
     public void setInContext (NSGraphicsContext graphicsContext)
     {
-        OS.objc_msgSend(this.id, OS.sel_setInContext_1, graphicsContext !is null ? graphicsContext.id : null);
+        OS.objc_msgSend(this.id_, OS.sel_setInContext_1, graphicsContext !is null ? graphicsContext.id_ : null);
     }
 
     public static void setPreferredFontNames (NSArray fontNameArray)
     {
-        OS.objc_msgSend(OS.class_NSFont, OS.sel_setPreferredFontNames_1, fontNameArray !is null ? fontNameArray.id : null);
+        OS.objc_msgSend(OS.class_NSFont, OS.sel_setPreferredFontNames_1, fontNameArray !is null ? fontNameArray.id_ : null);
     }
 
     public static void setUserFixedPitchFont (NSFont aFont)
     {
-        OS.objc_msgSend(OS.class_NSFont, OS.sel_setUserFixedPitchFont_1, aFont !is null ? aFont.id : null);
+        OS.objc_msgSend(OS.class_NSFont, OS.sel_setUserFixedPitchFont_1, aFont !is null ? aFont.id_ : null);
     }
 
     public static void setUserFont (NSFont aFont)
     {
-        OS.objc_msgSend(OS.class_NSFont, OS.sel_setUserFont_1, aFont !is null ? aFont.id : null);
+        OS.objc_msgSend(OS.class_NSFont, OS.sel_setUserFont_1, aFont !is null ? aFont.id_ : null);
     }
 
     public static CGFloat smallSystemFontSize ()
@@ -418,7 +418,7 @@
 
     public NSAffineTransform textTransform ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_textTransform);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_textTransform);
         return result !is null ? new NSAffineTransform(result) : null;
     }
 
@@ -436,17 +436,17 @@
 
     public CGFloat underlinePosition ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_underlinePosition);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_underlinePosition);
     }
 
     public CGFloat underlineThickness ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_underlineThickness);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_underlineThickness);
     }
 
     public static void useFont (NSString fontName)
     {
-        OS.objc_msgSend(OS.class_NSFont, OS.sel_useFont_1, fontName !is null ? fontName.id : null);
+        OS.objc_msgSend(OS.class_NSFont, OS.sel_useFont_1, fontName !is null ? fontName.id_ : null);
     }
 
     public static NSFont userFixedPitchFontOfSize (CGFloat fontSize)
@@ -463,12 +463,12 @@
 
     public CGFloat widthOfString (NSString string)
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_widthOfString_1, string !is null ? string.id : null);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_widthOfString_1, string !is null ? string.id_ : null);
     }
 
     public CGFloat xHeight ()
     {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_xHeight);
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_xHeight);
     }
 
 }