Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSTextBlock.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 |
comparison
equal
deleted
inserted
replaced
0:380af2bdd8e5 | 1:8b48be5454ce |
---|---|
39 super(id); | 39 super(id); |
40 } | 40 } |
41 | 41 |
42 public NSColor backgroundColor () | 42 public NSColor backgroundColor () |
43 { | 43 { |
44 objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColor); | 44 objc.id result = OS.objc_msgSend(this.id_, OS.sel_backgroundColor); |
45 return result !is null ? new NSColor(result) : null; | 45 return result !is null ? new NSColor(result) : null; |
46 } | 46 } |
47 | 47 |
48 public NSColor borderColorForEdge (NSRectEdge edge) | 48 public NSColor borderColorForEdge (NSRectEdge edge) |
49 { | 49 { |
50 objc.id result = OS.objc_msgSend(this.id, OS.sel_borderColorForEdge_1, edge); | 50 objc.id result = OS.objc_msgSend(this.id_, OS.sel_borderColorForEdge_1, edge); |
51 return result !is null ? new NSColor(result) : null; | 51 return result !is null ? new NSColor(result) : null; |
52 } | 52 } |
53 | 53 |
54 public NSRect boundsRectForContentRect (NSRect contentRect, NSRect rect, NSTextContainer textContainer, NSRange charRange) | 54 public NSRect boundsRectForContentRect (NSRect contentRect, NSRect rect, NSTextContainer textContainer, NSRange charRange) |
55 { | 55 { |
56 NSRect result; | 56 NSRect result; |
57 OS.objc_msgSend_stret(result, this.id, OS.sel_boundsRectForContentRect_1inRect_1textContainer_1characterRange_1, contentRect, rect, | 57 OS.objc_msgSend_stret(&result, this.id_, OS.sel_boundsRectForContentRect_1inRect_1textContainer_1characterRange_1, contentRect, rect, |
58 textContainer !is null ? textContainer.id : null, charRange); | 58 textContainer !is null ? textContainer.id_ : null, charRange); |
59 return result; | 59 return result; |
60 } | 60 } |
61 | 61 |
62 public CGFloat contentWidth () | 62 public CGFloat contentWidth () |
63 { | 63 { |
64 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_contentWidth); | 64 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_contentWidth); |
65 } | 65 } |
66 | 66 |
67 public NSTextBlockValueType contentWidthValueType () | 67 public NSTextBlockValueType contentWidthValueType () |
68 { | 68 { |
69 return cast(NSTextBlockValueType) OS.objc_msgSend(this.id, OS.sel_contentWidthValueType); | 69 return cast(NSTextBlockValueType) OS.objc_msgSend(this.id_, OS.sel_contentWidthValueType); |
70 } | 70 } |
71 | 71 |
72 public void drawBackgroundWithFrame (NSRect frameRect, NSView controlView, NSRange charRange, NSLayoutManager layoutManager) | 72 public void drawBackgroundWithFrame (NSRect frameRect, NSView controlView, NSRange charRange, NSLayoutManager layoutManager) |
73 { | 73 { |
74 OS.objc_msgSend(this.id, OS.sel_drawBackgroundWithFrame_1inView_1characterRange_1layoutManager_1, frameRect, | 74 OS.objc_msgSend(this.id_, OS.sel_drawBackgroundWithFrame_1inView_1characterRange_1layoutManager_1, frameRect, |
75 controlView !is null ? controlView.id : null, charRange, layoutManager !is null ? layoutManager.id : null); | 75 controlView !is null ? controlView.id_ : null, charRange, layoutManager !is null ? layoutManager.id_ : null); |
76 } | 76 } |
77 | 77 |
78 public NSRect rectForLayoutAtPoint (NSPoint startingPoint, NSRect rect, NSTextContainer textContainer, NSRange charRange) | 78 public NSRect rectForLayoutAtPoint (NSPoint startingPoint, NSRect rect, NSTextContainer textContainer, NSRange charRange) |
79 { | 79 { |
80 NSRect result; | 80 NSRect result; |
81 OS.objc_msgSend_stret(result, this.id, OS.sel_rectForLayoutAtPoint_1inRect_1textContainer_1characterRange_1, startingPoint, rect, | 81 OS.objc_msgSend_stret(&result, this.id_, OS.sel_rectForLayoutAtPoint_1inRect_1textContainer_1characterRange_1, startingPoint, rect, |
82 textContainer !is null ? textContainer.id : null, charRange); | 82 textContainer !is null ? textContainer.id_ : null, charRange); |
83 return result; | 83 return result; |
84 } | 84 } |
85 | 85 |
86 public void setBackgroundColor (NSColor color) | 86 public void setBackgroundColor (NSColor color) |
87 { | 87 { |
88 OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color !is null ? color.id : null); | 88 OS.objc_msgSend(this.id_, OS.sel_setBackgroundColor_1, color !is null ? color.id_ : null); |
89 } | 89 } |
90 | 90 |
91 public void setBorderColor_ (NSColor color) | 91 public void setBorderColor_ (NSColor color) |
92 { | 92 { |
93 OS.objc_msgSend(this.id, OS.sel_setBorderColor_1, color !is null ? color.id : null); | 93 OS.objc_msgSend(this.id_, OS.sel_setBorderColor_1, color !is null ? color.id_ : null); |
94 } | 94 } |
95 | 95 |
96 public void setBorderColor_forEdge_ (NSColor color, NSRectEdge edge) | 96 public void setBorderColor_forEdge_ (NSColor color, NSRectEdge edge) |
97 { | 97 { |
98 OS.objc_msgSend(this.id, OS.sel_setBorderColor_1forEdge_1, color !is null ? color.id : null, edge); | 98 OS.objc_msgSend(this.id_, OS.sel_setBorderColor_1forEdge_1, color !is null ? color.id_ : null, edge); |
99 } | 99 } |
100 | 100 |
101 public void setContentWidth (CGFloat val, NSTextBlockValueType type) | 101 public void setContentWidth (CGFloat val, NSTextBlockValueType type) |
102 { | 102 { |
103 OS.objc_msgSend(this.id, OS.sel_setContentWidth_1type_1, val, type); | 103 OS.objc_msgSend(this.id_, OS.sel_setContentWidth_1type_1, val, type); |
104 } | 104 } |
105 | 105 |
106 public void setValue (CGFloat val, NSTextBlockValueType type, NSTextBlockDimension dimension) | 106 public void setValue (CGFloat val, NSTextBlockValueType type, NSTextBlockDimension dimension) |
107 { | 107 { |
108 OS.objc_msgSend(this.id, OS.sel_setValue_1type_1forDimension_1, val, type, dimension); | 108 OS.objc_msgSend(this.id_, OS.sel_setValue_1type_1forDimension_1, val, type, dimension); |
109 } | 109 } |
110 | 110 |
111 public void setVerticalAlignment (NSTextBlockVerticalAlignment alignment) | 111 public void setVerticalAlignment (NSTextBlockVerticalAlignment alignment) |
112 { | 112 { |
113 OS.objc_msgSend(this.id, OS.sel_setVerticalAlignment_1, alignment); | 113 OS.objc_msgSend(this.id_, OS.sel_setVerticalAlignment_1, alignment); |
114 } | 114 } |
115 | 115 |
116 public void setWidth_type_forLayer_ (CGFloat val, NSTextBlockValueType type, NSTextBlockLayer layer) | 116 public void setWidth_type_forLayer_ (CGFloat val, NSTextBlockValueType type, NSTextBlockLayer layer) |
117 { | 117 { |
118 OS.objc_msgSend(this.id, OS.sel_setWidth_1type_1forLayer_1, val, type, layer); | 118 OS.objc_msgSend(this.id_, OS.sel_setWidth_1type_1forLayer_1, val, type, layer); |
119 } | 119 } |
120 | 120 |
121 public void setWidth_type_forLayer_edge_ (CGFloat val, NSTextBlockValueType type, NSTextBlockLayer layer, NSRectEdge edge) | 121 public void setWidth_type_forLayer_edge_ (CGFloat val, NSTextBlockValueType type, NSTextBlockLayer layer, NSRectEdge edge) |
122 { | 122 { |
123 OS.objc_msgSend(this.id, OS.sel_setWidth_1type_1forLayer_1edge_1, val, type, layer, edge); | 123 OS.objc_msgSend(this.id_, OS.sel_setWidth_1type_1forLayer_1edge_1, val, type, layer, edge); |
124 } | 124 } |
125 | 125 |
126 public CGFloat valueForDimension (NSTextBlockDimension dimension) | 126 public CGFloat valueForDimension (NSTextBlockDimension dimension) |
127 { | 127 { |
128 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_valueForDimension_1, dimension); | 128 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_valueForDimension_1, dimension); |
129 } | 129 } |
130 | 130 |
131 public NSTextBlockValueType valueTypeForDimension (NSTextBlockDimension dimension) | 131 public NSTextBlockValueType valueTypeForDimension (NSTextBlockDimension dimension) |
132 { | 132 { |
133 return cast(NSTextBlockValueType) OS.objc_msgSend(this.id, OS.sel_valueTypeForDimension_1, dimension); | 133 return cast(NSTextBlockValueType) OS.objc_msgSend(this.id_, OS.sel_valueTypeForDimension_1, dimension); |
134 } | 134 } |
135 | 135 |
136 public NSTextBlockVerticalAlignment verticalAlignment () | 136 public NSTextBlockVerticalAlignment verticalAlignment () |
137 { | 137 { |
138 return cast(NSTextBlockVerticalAlignment) OS.objc_msgSend(this.id, OS.sel_verticalAlignment); | 138 return cast(NSTextBlockVerticalAlignment) OS.objc_msgSend(this.id_, OS.sel_verticalAlignment); |
139 } | 139 } |
140 | 140 |
141 public CGFloat widthForLayer (NSTextBlockLayer layer, NSRectEdge edge) | 141 public CGFloat widthForLayer (NSTextBlockLayer layer, NSRectEdge edge) |
142 { | 142 { |
143 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_widthForLayer_1edge_1, layer, edge); | 143 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_widthForLayer_1edge_1, layer, edge); |
144 } | 144 } |
145 | 145 |
146 public NSTextBlockValueType widthValueTypeForLayer (NSTextBlockLayer layer, NSRectEdge edge) | 146 public NSTextBlockValueType widthValueTypeForLayer (NSTextBlockLayer layer, NSRectEdge edge) |
147 { | 147 { |
148 return cast(NSTextBlockValueType) OS.objc_msgSend(this.id, OS.sel_widthValueTypeForLayer_1edge_1, layer, edge); | 148 return cast(NSTextBlockValueType) OS.objc_msgSend(this.id_, OS.sel_widthValueTypeForLayer_1edge_1, layer, edge); |
149 } | 149 } |
150 | 150 |
151 } | 151 } |