Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSButtonCell.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 |
---|---|
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | 12 * Jacob Carlborg <jacob.carlborg@gmail.com> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 module dwt.internal.cocoa.NSButtonCell; | 14 module dwt.internal.cocoa.NSButtonCell; |
15 | 15 |
16 import dwt.internal.cocoa.CGFloat; | 16 import dwt.internal.cocoa.CGFloat; |
17 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSActionCell; | 18 import dwt.internal.cocoa.NSActionCell; |
18 import dwt.internal.cocoa.NSAttributedString; | 19 import dwt.internal.cocoa.NSAttributedString; |
19 import dwt.internal.cocoa.NSColor; | 20 import dwt.internal.cocoa.NSColor; |
20 import dwt.internal.cocoa.NSEvent; | 21 import dwt.internal.cocoa.NSEvent; |
21 import dwt.internal.cocoa.NSFont; | 22 import dwt.internal.cocoa.NSFont; |
41 super(id); | 42 super(id); |
42 } | 43 } |
43 | 44 |
44 public NSImage alternateImage () | 45 public NSImage alternateImage () |
45 { | 46 { |
46 objc.id result = OS.objc_msgSend(this.id, OS.sel_alternateImage); | 47 objc.id result = OS.objc_msgSend(this.id_, OS.sel_alternateImage); |
47 return result !is null ? new NSImage(result) : null; | 48 return result !is null ? new NSImage(result) : null; |
48 } | 49 } |
49 | 50 |
50 public NSString alternateMnemonic () | 51 public NSString alternateMnemonic () |
51 { | 52 { |
52 objc.id result = OS.objc_msgSend(this.id, OS.sel_alternateMnemonic); | 53 objc.id result = OS.objc_msgSend(this.id_, OS.sel_alternateMnemonic); |
53 return result !is null ? new NSString(result) : null; | 54 return result !is null ? new NSString(result) : null; |
54 } | 55 } |
55 | 56 |
56 public NSUInteger alternateMnemonicLocation () | 57 public NSUInteger alternateMnemonicLocation () |
57 { | 58 { |
58 return OS.objc_msgSend(this.id, OS.sel_alternateMnemonicLocation); | 59 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_alternateMnemonicLocation); |
59 } | 60 } |
60 | 61 |
61 public NSString alternateTitle () | 62 public NSString alternateTitle () |
62 { | 63 { |
63 objc.id result = OS.objc_msgSend(this.id, OS.sel_alternateTitle); | 64 objc.id result = OS.objc_msgSend(this.id_, OS.sel_alternateTitle); |
64 return result !is null ? new NSString(result) : null; | 65 return result !is null ? new NSString(result) : null; |
65 } | 66 } |
66 | 67 |
67 public NSAttributedString attributedAlternateTitle () | 68 public NSAttributedString attributedAlternateTitle () |
68 { | 69 { |
69 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedAlternateTitle); | 70 objc.id result = OS.objc_msgSend(this.id_, OS.sel_attributedAlternateTitle); |
70 return result !is null ? new NSAttributedString(result) : null; | 71 return result !is null ? new NSAttributedString(result) : null; |
71 } | 72 } |
72 | 73 |
73 public NSAttributedString attributedTitle () | 74 public NSAttributedString attributedTitle () |
74 { | 75 { |
75 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedTitle); | 76 objc.id result = OS.objc_msgSend(this.id_, OS.sel_attributedTitle); |
76 return result !is null ? new NSAttributedString(result) : null; | 77 return result !is null ? new NSAttributedString(result) : null; |
77 } | 78 } |
78 | 79 |
79 public NSColor backgroundColor () | 80 public NSColor backgroundColor () |
80 { | 81 { |
81 objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColor); | 82 objc.id result = OS.objc_msgSend(this.id_, OS.sel_backgroundColor); |
82 return result !is null ? new NSColor(result) : null; | 83 return result !is null ? new NSColor(result) : null; |
83 } | 84 } |
84 | 85 |
85 public objc.id bezelStyle () | 86 public objc.id bezelStyle () |
86 { | 87 { |
87 return OS.objc_msgSend(this.id, OS.sel_bezelStyle); | 88 return OS.objc_msgSend(this.id_, OS.sel_bezelStyle); |
88 } | 89 } |
89 | 90 |
90 public void drawBezelWithFrame (NSRect frame, NSView controlView) | 91 public void drawBezelWithFrame (NSRect frame, NSView controlView) |
91 { | 92 { |
92 OS.objc_msgSend(this.id, OS.sel_drawBezelWithFrame_1inView_1, frame, controlView !is null ? controlView.id : null); | 93 OS.objc_msgSend(this.id_, OS.sel_drawBezelWithFrame_1inView_1, frame, controlView !is null ? controlView.id_ : null); |
93 } | 94 } |
94 | 95 |
95 public void drawImage (NSImage image, NSRect frame, NSView controlView) | 96 public void drawImage (NSImage image, NSRect frame, NSView controlView) |
96 { | 97 { |
97 OS.objc_msgSend(this.id, OS.sel_drawImage_1withFrame_1inView_1, image !is null ? image.id : null, frame, | 98 OS.objc_msgSend(this.id_, OS.sel_drawImage_1withFrame_1inView_1, image !is null ? image.id_ : null, frame, |
98 controlView !is null ? controlView.id : null); | 99 controlView !is null ? controlView.id_ : null); |
99 } | 100 } |
100 | 101 |
101 public NSRect drawTitle (NSAttributedString title, NSRect frame, NSView controlView) | 102 public NSRect drawTitle (NSAttributedString title, NSRect frame, NSView controlView) |
102 { | 103 { |
103 NSRect result; | 104 NSRect result; |
104 OS.objc_msgSend_stret(result, this.id, OS.sel_drawTitle_1withFrame_1inView_1, title !is null ? title.id : null, frame, | 105 OS.objc_msgSend_stret(&result, this.id_, OS.sel_drawTitle_1withFrame_1inView_1, title !is null ? title.id_ : null, frame, |
105 controlView !is null ? controlView.id : null); | 106 controlView !is null ? controlView.id_ : null); |
106 return result; | 107 return result; |
107 } | 108 } |
108 | 109 |
109 public void getPeriodicDelay (float* delay, float* interval) | 110 public void getPeriodicDelay (float* delay, float* interval) |
110 { | 111 { |
111 OS.objc_msgSend(this.id, OS.sel_getPeriodicDelay_1interval_1, delay, interval); | 112 OS.objc_msgSend(this.id_, OS.sel_getPeriodicDelay_1interval_1, delay, interval); |
112 } | 113 } |
113 | 114 |
114 public objc.id gradientType () | 115 public objc.id gradientType () |
115 { | 116 { |
116 return OS.objc_msgSend(this.id, OS.sel_gradientType); | 117 return OS.objc_msgSend(this.id_, OS.sel_gradientType); |
117 } | 118 } |
118 | 119 |
119 public NSInteger highlightsBy () | 120 public NSInteger highlightsBy () |
120 { | 121 { |
121 return OS.objc_msgSend(this.id, OS.sel_highlightsBy); | 122 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_highlightsBy); |
122 } | 123 } |
123 | 124 |
124 public bool imageDimsWhenDisabled () | 125 public bool imageDimsWhenDisabled () |
125 { | 126 { |
126 return OS.objc_msgSend(this.id, OS.sel_imageDimsWhenDisabled) !is null; | 127 return OS.objc_msgSend(this.id_, OS.sel_imageDimsWhenDisabled) !is null; |
127 } | 128 } |
128 | 129 |
129 public objc.id imagePosition () | 130 public objc.id imagePosition () |
130 { | 131 { |
131 return OS.objc_msgSend(this.id, OS.sel_imagePosition); | 132 return OS.objc_msgSend(this.id_, OS.sel_imagePosition); |
132 } | 133 } |
133 | 134 |
134 public objc.id imageScaling () | 135 public objc.id imageScaling () |
135 { | 136 { |
136 return OS.objc_msgSend(this.id, OS.sel_imageScaling); | 137 return OS.objc_msgSend(this.id_, OS.sel_imageScaling); |
137 } | 138 } |
138 | 139 |
139 public bool isOpaque () | 140 public bool isOpaque () |
140 { | 141 { |
141 return OS.objc_msgSend(this.id, OS.sel_isOpaque) !is null; | 142 return OS.objc_msgSend(this.id_, OS.sel_isOpaque) !is null; |
142 } | 143 } |
143 | 144 |
144 public bool isTransparent () | 145 public bool isTransparent () |
145 { | 146 { |
146 return OS.objc_msgSend(this.id, OS.sel_isTransparent) !is null; | 147 return OS.objc_msgSend(this.id_, OS.sel_isTransparent) !is null; |
147 } | 148 } |
148 | 149 |
149 public NSString keyEquivalent () | 150 public NSString keyEquivalent () |
150 { | 151 { |
151 objc.id result = OS.objc_msgSend(this.id, OS.sel_keyEquivalent); | 152 objc.id result = OS.objc_msgSend(this.id_, OS.sel_keyEquivalent); |
152 return result !is null ? new NSString(result) : null; | 153 return result !is null ? new NSString(result) : null; |
153 } | 154 } |
154 | 155 |
155 public NSFont keyEquivalentFont () | 156 public NSFont keyEquivalentFont () |
156 { | 157 { |
157 objc.id result = OS.objc_msgSend(this.id, OS.sel_keyEquivalentFont); | 158 objc.id result = OS.objc_msgSend(this.id_, OS.sel_keyEquivalentFont); |
158 return result !is null ? new NSFont(result) : null; | 159 return result !is null ? new NSFont(result) : null; |
159 } | 160 } |
160 | 161 |
161 public NSUInteger keyEquivalentModifierMask () | 162 public NSUInteger keyEquivalentModifierMask () |
162 { | 163 { |
163 return OS.objc_msgSend(this.id, OS.sel_keyEquivalentModifierMask); | 164 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_keyEquivalentModifierMask); |
164 } | 165 } |
165 | 166 |
166 public void mouseEntered (NSEvent event) | 167 public void mouseEntered (NSEvent event) |
167 { | 168 { |
168 OS.objc_msgSend(this.id, OS.sel_mouseEntered_1, event !is null ? event.id : null); | 169 OS.objc_msgSend(this.id_, OS.sel_mouseEntered_1, event !is null ? event.id_ : null); |
169 } | 170 } |
170 | 171 |
171 public void mouseExited (NSEvent event) | 172 public void mouseExited (NSEvent event) |
172 { | 173 { |
173 OS.objc_msgSend(this.id, OS.sel_mouseExited_1, event !is null ? event.id : null); | 174 OS.objc_msgSend(this.id_, OS.sel_mouseExited_1, event !is null ? event.id_ : null); |
174 } | 175 } |
175 | 176 |
176 public void performClick (id sender) | 177 public void performClick (id sender) |
177 { | 178 { |
178 OS.objc_msgSend(this.id, OS.sel_performClick_1, sender !is null ? sender.id : null); | 179 OS.objc_msgSend(this.id_, OS.sel_performClick_1, sender !is null ? sender.id_ : null); |
179 } | 180 } |
180 | 181 |
181 public void setAlternateImage (NSImage image) | 182 public void setAlternateImage (NSImage image) |
182 { | 183 { |
183 OS.objc_msgSend(this.id, OS.sel_setAlternateImage_1, image !is null ? image.id : null); | 184 OS.objc_msgSend(this.id_, OS.sel_setAlternateImage_1, image !is null ? image.id_ : null); |
184 } | 185 } |
185 | 186 |
186 public void setAlternateMnemonicLocation (NSUInteger location) | 187 public void setAlternateMnemonicLocation (NSUInteger location) |
187 { | 188 { |
188 OS.objc_msgSend(this.id, OS.sel_setAlternateMnemonicLocation_1, location); | 189 OS.objc_msgSend(this.id_, OS.sel_setAlternateMnemonicLocation_1, location); |
189 } | 190 } |
190 | 191 |
191 public void setAlternateTitle (NSString aString) | 192 public void setAlternateTitle (NSString aString) |
192 { | 193 { |
193 OS.objc_msgSend(this.id, OS.sel_setAlternateTitle_1, aString !is null ? aString.id : null); | 194 OS.objc_msgSend(this.id_, OS.sel_setAlternateTitle_1, aString !is null ? aString.id_ : null); |
194 } | 195 } |
195 | 196 |
196 public void setAlternateTitleWithMnemonic (NSString StringWithAmpersand) | 197 public void setAlternateTitleWithMnemonic (NSString StringWithAmpersand) |
197 { | 198 { |
198 OS.objc_msgSend(this.id, OS.sel_setAlternateTitleWithMnemonic_1, StringWithAmpersand !is null ? StringWithAmpersand.id : null); | 199 OS.objc_msgSend(this.id_, OS.sel_setAlternateTitleWithMnemonic_1, StringWithAmpersand !is null ? StringWithAmpersand.id_ : null); |
199 } | 200 } |
200 | 201 |
201 public void setAttributedAlternateTitle (NSAttributedString obj) | 202 public void setAttributedAlternateTitle (NSAttributedString obj) |
202 { | 203 { |
203 OS.objc_msgSend(this.id, OS.sel_setAttributedAlternateTitle_1, obj !is null ? obj.id : null); | 204 OS.objc_msgSend(this.id_, OS.sel_setAttributedAlternateTitle_1, obj !is null ? obj.id_ : null); |
204 } | 205 } |
205 | 206 |
206 public void setAttributedTitle (NSAttributedString obj) | 207 public void setAttributedTitle (NSAttributedString obj) |
207 { | 208 { |
208 OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, obj !is null ? obj.id : null); | 209 OS.objc_msgSend(this.id_, OS.sel_setAttributedTitle_1, obj !is null ? obj.id_ : null); |
209 } | 210 } |
210 | 211 |
211 public void setBackgroundColor (NSColor color) | 212 public void setBackgroundColor (NSColor color) |
212 { | 213 { |
213 OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color !is null ? color.id : null); | 214 OS.objc_msgSend(this.id_, OS.sel_setBackgroundColor_1, color !is null ? color.id_ : null); |
214 } | 215 } |
215 | 216 |
216 public void setBezelStyle (objc.id bezelStyle) | 217 public void setBezelStyle (objc.id bezelStyle) |
217 { | 218 { |
218 OS.objc_msgSend(this.id, OS.sel_setBezelStyle_1, bezelStyle); | 219 OS.objc_msgSend(this.id_, OS.sel_setBezelStyle_1, bezelStyle); |
219 } | 220 } |
220 | 221 |
221 public void setButtonType (objc.id aType) | 222 public void setButtonType (objc.id aType) |
222 { | 223 { |
223 OS.objc_msgSend(this.id, OS.sel_setButtonType_1, aType); | 224 OS.objc_msgSend(this.id_, OS.sel_setButtonType_1, aType); |
224 } | 225 } |
225 | 226 |
226 public void setFont (NSFont fontObj) | 227 public void setFont (NSFont fontObj) |
227 { | 228 { |
228 OS.objc_msgSend(this.id, OS.sel_setFont_1, fontObj !is null ? fontObj.id : null); | 229 OS.objc_msgSend(this.id_, OS.sel_setFont_1, fontObj !is null ? fontObj.id_ : null); |
229 } | 230 } |
230 | 231 |
231 public void setGradientType (objc.id type) | 232 public void setGradientType (objc.id type) |
232 { | 233 { |
233 OS.objc_msgSend(this.id, OS.sel_setGradientType_1, type); | 234 OS.objc_msgSend(this.id_, OS.sel_setGradientType_1, type); |
234 } | 235 } |
235 | 236 |
236 public void setHighlightsBy (NSInteger aType) | 237 public void setHighlightsBy (NSInteger aType) |
237 { | 238 { |
238 OS.objc_msgSend(this.id, OS.sel_setHighlightsBy_1, aType); | 239 OS.objc_msgSend(this.id_, OS.sel_setHighlightsBy_1, aType); |
239 } | 240 } |
240 | 241 |
241 public void setImageDimsWhenDisabled (bool flag) | 242 public void setImageDimsWhenDisabled (bool flag) |
242 { | 243 { |
243 OS.objc_msgSend(this.id, OS.sel_setImageDimsWhenDisabled_1, flag); | 244 OS.objc_msgSend(this.id_, OS.sel_setImageDimsWhenDisabled_1, flag); |
244 } | 245 } |
245 | 246 |
246 public void setImagePosition (objc.id aPosition) | 247 public void setImagePosition (objc.id aPosition) |
247 { | 248 { |
248 OS.objc_msgSend(this.id, OS.sel_setImagePosition_1, aPosition); | 249 OS.objc_msgSend(this.id_, OS.sel_setImagePosition_1, aPosition); |
249 } | 250 } |
250 | 251 |
251 public void setImageScaling (objc.id scaling) | 252 public void setImageScaling (objc.id scaling) |
252 { | 253 { |
253 OS.objc_msgSend(this.id, OS.sel_setImageScaling_1, scaling); | 254 OS.objc_msgSend(this.id_, OS.sel_setImageScaling_1, scaling); |
254 } | 255 } |
255 | 256 |
256 public void setKeyEquivalent (NSString aKeyEquivalent) | 257 public void setKeyEquivalent (NSString aKeyEquivalent) |
257 { | 258 { |
258 OS.objc_msgSend(this.id, OS.sel_setKeyEquivalent_1, aKeyEquivalent !is null ? aKeyEquivalent.id : null); | 259 OS.objc_msgSend(this.id_, OS.sel_setKeyEquivalent_1, aKeyEquivalent !is null ? aKeyEquivalent.id_ : null); |
259 } | 260 } |
260 | 261 |
261 public void setKeyEquivalentFont_ (NSFont fontObj) | 262 public void setKeyEquivalentFont_ (NSFont fontObj) |
262 { | 263 { |
263 OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentFont_1, fontObj !is null ? fontObj.id : null); | 264 OS.objc_msgSend(this.id_, OS.sel_setKeyEquivalentFont_1, fontObj !is null ? fontObj.id_ : null); |
264 } | 265 } |
265 | 266 |
266 public void setKeyEquivalentFont_size_ (NSString fontName, CGFloat fontSize) | 267 public void setKeyEquivalentFont_size_ (NSString fontName, CGFloat fontSize) |
267 { | 268 { |
268 OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentFont_1size_1, fontName !is null ? fontName.id : null, fontSize); | 269 OS.objc_msgSend(this.id_, OS.sel_setKeyEquivalentFont_1size_1, fontName !is null ? fontName.id_ : null, fontSize); |
269 } | 270 } |
270 | 271 |
271 public void setKeyEquivalentModifierMask (NSUInteger mask) | 272 public void setKeyEquivalentModifierMask (NSUInteger mask) |
272 { | 273 { |
273 OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentModifierMask_1, mask); | 274 OS.objc_msgSend(this.id_, OS.sel_setKeyEquivalentModifierMask_1, mask); |
274 } | 275 } |
275 | 276 |
276 public void setPeriodicDelay (float delay, float interval) | 277 public void setPeriodicDelay (float delay, float interval) |
277 { | 278 { |
278 OS.objc_msgSend(this.id, OS.sel_setPeriodicDelay_1interval_1, delay, interval); | 279 OS.objc_msgSend(this.id_, OS.sel_setPeriodicDelay_1interval_1, delay, interval); |
279 } | 280 } |
280 | 281 |
281 public void setShowsBorderOnlyWhileMouseInside (bool show) | 282 public void setShowsBorderOnlyWhileMouseInside (bool show) |
282 { | 283 { |
283 OS.objc_msgSend(this.id, OS.sel_setShowsBorderOnlyWhileMouseInside_1, show); | 284 OS.objc_msgSend(this.id_, OS.sel_setShowsBorderOnlyWhileMouseInside_1, show); |
284 } | 285 } |
285 | 286 |
286 public void setShowsStateBy (NSInteger aType) | 287 public void setShowsStateBy (NSInteger aType) |
287 { | 288 { |
288 OS.objc_msgSend(this.id, OS.sel_setShowsStateBy_1, aType); | 289 OS.objc_msgSend(this.id_, OS.sel_setShowsStateBy_1, aType); |
289 } | 290 } |
290 | 291 |
291 public void setSound (NSSound aSound) | 292 public void setSound (NSSound aSound) |
292 { | 293 { |
293 OS.objc_msgSend(this.id, OS.sel_setSound_1, aSound !is null ? aSound.id : null); | 294 OS.objc_msgSend(this.id_, OS.sel_setSound_1, aSound !is null ? aSound.id_ : null); |
294 } | 295 } |
295 | 296 |
296 public void setTitle (NSString aString) | 297 public void setTitle (NSString aString) |
297 { | 298 { |
298 OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString !is null ? aString.id : null); | 299 OS.objc_msgSend(this.id_, OS.sel_setTitle_1, aString !is null ? aString.id_ : null); |
299 } | 300 } |
300 | 301 |
301 public void setTitleWithMnemonic (NSString StringWithAmpersand) | 302 public void setTitleWithMnemonic (NSString StringWithAmpersand) |
302 { | 303 { |
303 OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, StringWithAmpersand !is null ? StringWithAmpersand.id : null); | 304 OS.objc_msgSend(this.id_, OS.sel_setTitleWithMnemonic_1, StringWithAmpersand !is null ? StringWithAmpersand.id_ : null); |
304 } | 305 } |
305 | 306 |
306 public void setTransparent (bool flag) | 307 public void setTransparent (bool flag) |
307 { | 308 { |
308 OS.objc_msgSend(this.id, OS.sel_setTransparent_1, flag); | 309 OS.objc_msgSend(this.id_, OS.sel_setTransparent_1, flag); |
309 } | 310 } |
310 | 311 |
311 public bool showsBorderOnlyWhileMouseInside () | 312 public bool showsBorderOnlyWhileMouseInside () |
312 { | 313 { |
313 return OS.objc_msgSend(this.id, OS.sel_showsBorderOnlyWhileMouseInside) !is null; | 314 return OS.objc_msgSend(this.id_, OS.sel_showsBorderOnlyWhileMouseInside) !is null; |
314 } | 315 } |
315 | 316 |
316 public NSInteger showsStateBy () | 317 public NSInteger showsStateBy () |
317 { | 318 { |
318 return OS.objc_msgSend(this.id, OS.sel_showsStateBy); | 319 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_showsStateBy); |
319 } | 320 } |
320 | 321 |
321 public NSSound sound () | 322 public NSSound sound () |
322 { | 323 { |
323 objc.id result = OS.objc_msgSend(this.id, OS.sel_sound); | 324 objc.id result = OS.objc_msgSend(this.id_, OS.sel_sound); |
324 return result !is null ? new NSSound(result) : null; | 325 return result !is null ? new NSSound(result) : null; |
325 } | 326 } |
326 | 327 |
327 public NSString title () | 328 public NSString title () |
328 { | 329 { |
329 objc.id result = OS.objc_msgSend(this.id, OS.sel_title); | 330 objc.id result = OS.objc_msgSend(this.id_, OS.sel_title); |
330 return result !is null ? new NSString(result) : null; | 331 return result !is null ? new NSString(result) : null; |
331 } | 332 } |
332 | 333 |
333 } | 334 } |