comparison dwt/internal/cocoa/NSBezierPath.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
43 super(id); 43 super(id);
44 } 44 }
45 45
46 public void addClip () 46 public void addClip ()
47 { 47 {
48 OS.objc_msgSend(this.id, OS.sel_addClip); 48 OS.objc_msgSend(this.id_, OS.sel_addClip);
49 } 49 }
50 50
51 public void appendBezierPath (NSBezierPath path) 51 public void appendBezierPath (NSBezierPath path)
52 { 52 {
53 OS.objc_msgSend(this.id, OS.sel_appendBezierPath_1, path !is null ? path.id : null); 53 OS.objc_msgSend(this.id_, OS.sel_appendBezierPath_1, path !is null ? path.id_ : null);
54 } 54 }
55 55
56 public void appendBezierPathWithArcFromPoint (NSPoint point1, NSPoint point2, CGFloat radius) 56 public void appendBezierPathWithArcFromPoint (NSPoint point1, NSPoint point2, CGFloat radius)
57 { 57 {
58 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithArcFromPoint_1toPoint_1radius_1, point1, point2, radius); 58 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithArcFromPoint_1toPoint_1radius_1, point1, point2, radius);
59 } 59 }
60 60
61 public void appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_ (NSPoint center, CGFloat radius, CGFloat startAngle, CGFloat endAngle) 61 public void appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_ (NSPoint center, CGFloat radius, CGFloat startAngle, CGFloat endAngle)
62 { 62 {
63 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithArcWithCenter_1radius_1startAngle_1endAngle_1, center, radius, startAngle, endAngle); 63 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithArcWithCenter_1radius_1startAngle_1endAngle_1, center, radius, startAngle, endAngle);
64 } 64 }
65 65
66 public void appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_clockwise_ (NSPoint center, CGFloat radius, CGFloat startAngle, 66 public void appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_clockwise_ (NSPoint center, CGFloat radius, CGFloat startAngle,
67 CGFloat endAngle, bool clockwise) 67 CGFloat endAngle, bool clockwise)
68 { 68 {
69 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithArcWithCenter_1radius_1startAngle_1endAngle_1clockwise_1, center, radius, startAngle, 69 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithArcWithCenter_1radius_1startAngle_1endAngle_1clockwise_1, center, radius, startAngle,
70 endAngle, clockwise); 70 endAngle, clockwise);
71 } 71 }
72 72
73 public void appendBezierPathWithGlyph (objc.id glyph, NSFont font) 73 public void appendBezierPathWithGlyph (objc.id glyph, NSFont font)
74 { 74 {
75 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithGlyph_1inFont_1, glyph, font !is null ? font.id : null); 75 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithGlyph_1inFont_1, glyph, font !is null ? font.id_ : null);
76 } 76 }
77 77
78 public void appendBezierPathWithGlyphs (objc.id glyphs, NSInteger count, NSFont font) 78 public void appendBezierPathWithGlyphs (objc.id glyphs, NSInteger count, NSFont font)
79 { 79 {
80 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithGlyphs_1count_1inFont_1, glyphs, count, font !is null ? font.id : null); 80 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithGlyphs_1count_1inFont_1, glyphs, count, font !is null ? font.id_ : null);
81 } 81 }
82 82
83 public void appendBezierPathWithOvalInRect (NSRect rect) 83 public void appendBezierPathWithOvalInRect (NSRect rect)
84 { 84 {
85 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithOvalInRect_1, rect); 85 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithOvalInRect_1, rect);
86 } 86 }
87 87
88 public void appendBezierPathWithPackedGlyphs (objc.id packedGlyphs) 88 public void appendBezierPathWithPackedGlyphs (objc.id packedGlyphs)
89 { 89 {
90 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithPackedGlyphs_1, packedGlyphs); 90 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithPackedGlyphs_1, packedGlyphs);
91 } 91 }
92 92
93 public void appendBezierPathWithPoints (objc.id points, NSInteger count) 93 public void appendBezierPathWithPoints (objc.id points, NSInteger count)
94 { 94 {
95 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithPoints_1count_1, points, count); 95 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithPoints_1count_1, points, count);
96 } 96 }
97 97
98 public void appendBezierPathWithRect (NSRect rect) 98 public void appendBezierPathWithRect (NSRect rect)
99 { 99 {
100 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithRect_1, rect); 100 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithRect_1, rect);
101 } 101 }
102 102
103 public void appendBezierPathWithRoundedRect (NSRect rect, CGFloat xRadius, CGFloat yRadius) 103 public void appendBezierPathWithRoundedRect (NSRect rect, CGFloat xRadius, CGFloat yRadius)
104 { 104 {
105 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithRoundedRect_1xRadius_1yRadius_1, rect, xRadius, yRadius); 105 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithRoundedRect_1xRadius_1yRadius_1, rect, xRadius, yRadius);
106 } 106 }
107 107
108 public static NSBezierPath bezierPath () 108 public static NSBezierPath bezierPath ()
109 { 109 {
110 objc.id result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPath); 110 objc.id result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPath);
111 return result !is null ? new NSBezierPath(result) : null; 111 return result !is null ? new NSBezierPath(result) : null;
112 } 112 }
113 113
114 public NSBezierPath bezierPathByFlatteningPath () 114 public NSBezierPath bezierPathByFlatteningPath ()
115 { 115 {
116 objc.id result = OS.objc_msgSend(this.id, OS.sel_bezierPathByFlatteningPath); 116 objc.id result = OS.objc_msgSend(this.id_, OS.sel_bezierPathByFlatteningPath);
117 return result is this.id ? this : (result !is null ? new NSBezierPath(result) : null); 117 return result is this.id_ ? this : (result !is null ? new NSBezierPath(result) : null);
118 } 118 }
119 119
120 public NSBezierPath bezierPathByReversingPath () 120 public NSBezierPath bezierPathByReversingPath ()
121 { 121 {
122 objc.id result = OS.objc_msgSend(this.id, OS.sel_bezierPathByReversingPath); 122 objc.id result = OS.objc_msgSend(this.id_, OS.sel_bezierPathByReversingPath);
123 return result is this.id ? this : (result !is null ? new NSBezierPath(result) : null); 123 return result is this.id_ ? this : (result !is null ? new NSBezierPath(result) : null);
124 } 124 }
125 125
126 public static NSBezierPath bezierPathWithOvalInRect (NSRect rect) 126 public static NSBezierPath bezierPathWithOvalInRect (NSRect rect)
127 { 127 {
128 objc.id result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPathWithOvalInRect_1, rect); 128 objc.id result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPathWithOvalInRect_1, rect);
142 } 142 }
143 143
144 public NSRect bounds () 144 public NSRect bounds ()
145 { 145 {
146 NSRect result; 146 NSRect result;
147 OS.objc_msgSend_stret(result, this.id, OS.sel_bounds); 147 OS.objc_msgSend_stret(&result, this.id_, OS.sel_bounds);
148 return result; 148 return result;
149 } 149 }
150 150
151 public bool cachesBezierPath () 151 public bool cachesBezierPath ()
152 { 152 {
153 return OS.objc_msgSend(this.id, OS.sel_cachesBezierPath) !is null; 153 return OS.objc_msgSend(this.id_, OS.sel_cachesBezierPath) !is null;
154 } 154 }
155 155
156 public static void clipRect (NSRect rect) 156 public static void clipRect (NSRect rect)
157 { 157 {
158 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_clipRect_1, rect); 158 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_clipRect_1, rect);
159 } 159 }
160 160
161 public void closePath () 161 public void closePath ()
162 { 162 {
163 OS.objc_msgSend(this.id, OS.sel_closePath); 163 OS.objc_msgSend(this.id_, OS.sel_closePath);
164 } 164 }
165 165
166 public bool containsPoint (NSPoint point) 166 public bool containsPoint (NSPoint point)
167 { 167 {
168 return OS.objc_msgSend(this.id, OS.sel_containsPoint_1, point) !is null; 168 return OS.objc_msgSend(this.id_, OS.sel_containsPoint_1, point) !is null;
169 } 169 }
170 170
171 public NSRect controlPointBounds () 171 public NSRect controlPointBounds ()
172 { 172 {
173 NSRect result; 173 NSRect result;
174 OS.objc_msgSend_stret(result, this.id, OS.sel_controlPointBounds); 174 OS.objc_msgSend_stret(&result, this.id_, OS.sel_controlPointBounds);
175 return result; 175 return result;
176 } 176 }
177 177
178 public NSPoint currentPoint () 178 public NSPoint currentPoint ()
179 { 179 {
180 NSPoint result; 180 NSPoint result;
181 OS.objc_msgSend_stret(result, this.id, OS.sel_currentPoint); 181 OS.objc_msgSend_stret(&result, this.id_, OS.sel_currentPoint);
182 return result; 182 return result;
183 } 183 }
184 184
185 public void curveToPoint (NSPoint endPoint, NSPoint controlPoint1, NSPoint controlPoint2) 185 public void curveToPoint (NSPoint endPoint, NSPoint controlPoint1, NSPoint controlPoint2)
186 { 186 {
187 OS.objc_msgSend(this.id, OS.sel_curveToPoint_1controlPoint1_1controlPoint2_1, endPoint, controlPoint1, controlPoint2); 187 OS.objc_msgSend(this.id_, OS.sel_curveToPoint_1controlPoint1_1controlPoint2_1, endPoint, controlPoint1, controlPoint2);
188 } 188 }
189 189
190 public static CGFloat defaultFlatness () 190 public static CGFloat defaultFlatness ()
191 { 191 {
192 return cast(CGFloat) OS.objc_msgSend_fpret(OS.class_NSBezierPath, OS.sel_defaultFlatness); 192 return cast(CGFloat) OS.objc_msgSend_fpret(OS.class_NSBezierPath, OS.sel_defaultFlatness);
222 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_drawPackedGlyphs_1atPoint_1, packedGlyphs, point); 222 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_drawPackedGlyphs_1atPoint_1, packedGlyphs, point);
223 } 223 }
224 224
225 public objc.id elementAtIndex_ (NSInteger index) 225 public objc.id elementAtIndex_ (NSInteger index)
226 { 226 {
227 return OS.objc_msgSend(this.id, OS.sel_elementAtIndex_1, index); 227 return OS.objc_msgSend(this.id_, OS.sel_elementAtIndex_1, index);
228 } 228 }
229 229
230 public NSBezierPathElement elementAtIndex_associatedPoints_ (NSInteger index, NSPointArray points) 230 public NSBezierPathElement elementAtIndex_associatedPoints_ (NSInteger index, NSPointArray points)
231 { 231 {
232 return OS.objc_msgSend(this.id, OS.sel_elementAtIndex_1associatedPoints_1, index, points); 232 return cast(NSBezierPathElement) OS.objc_msgSend(this.id_, OS.sel_elementAtIndex_1associatedPoints_1, index, points);
233 } 233 }
234 234
235 public NSInteger elementCount () 235 public NSInteger elementCount ()
236 { 236 {
237 return OS.objc_msgSend(this.id, OS.sel_elementCount); 237 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_elementCount);
238 } 238 }
239 239
240 public void fill () 240 public void fill ()
241 { 241 {
242 OS.objc_msgSend(this.id, OS.sel_fill); 242 OS.objc_msgSend(this.id_, OS.sel_fill);
243 } 243 }
244 244
245 public static void fillRect (NSRect rect) 245 public static void fillRect (NSRect rect)
246 { 246 {
247 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_fillRect_1, rect); 247 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_fillRect_1, rect);
248 } 248 }
249 249
250 public CGFloat flatness () 250 public CGFloat flatness ()
251 { 251 {
252 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_flatness); 252 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_flatness);
253 } 253 }
254 254
255 public void getLineDash (CGFloat* pattern, NSInteger* count, CGFloat* phase) 255 public void getLineDash (CGFloat* pattern, NSInteger* count, CGFloat* phase)
256 { 256 {
257 OS.objc_msgSend(this.id, OS.sel_getLineDash_1count_1phase_1, pattern, count, phase); 257 OS.objc_msgSend(this.id_, OS.sel_getLineDash_1count_1phase_1, pattern, count, phase);
258 } 258 }
259 259
260 public bool isEmpty () 260 public bool isEmpty ()
261 { 261 {
262 return OS.objc_msgSend(this.id, OS.sel_isEmpty) !is null; 262 return OS.objc_msgSend(this.id_, OS.sel_isEmpty) !is null;
263 } 263 }
264 264
265 public objc.id lineCapStyle () 265 public objc.id lineCapStyle ()
266 { 266 {
267 return OS.objc_msgSend(this.id, OS.sel_lineCapStyle); 267 return OS.objc_msgSend(this.id_, OS.sel_lineCapStyle);
268 } 268 }
269 269
270 public objc.id lineJoinStyle () 270 public objc.id lineJoinStyle ()
271 { 271 {
272 return OS.objc_msgSend(this.id, OS.sel_lineJoinStyle); 272 return OS.objc_msgSend(this.id_, OS.sel_lineJoinStyle);
273 } 273 }
274 274
275 public void lineToPoint (NSPoint point) 275 public void lineToPoint (NSPoint point)
276 { 276 {
277 OS.objc_msgSend(this.id, OS.sel_lineToPoint_1, point); 277 OS.objc_msgSend(this.id_, OS.sel_lineToPoint_1, point);
278 } 278 }
279 279
280 public CGFloat lineWidth () 280 public CGFloat lineWidth ()
281 { 281 {
282 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_lineWidth); 282 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_lineWidth);
283 } 283 }
284 284
285 public CGFloat miterLimit () 285 public CGFloat miterLimit ()
286 { 286 {
287 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_miterLimit); 287 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_miterLimit);
288 } 288 }
289 289
290 public void moveToPoint (NSPoint point) 290 public void moveToPoint (NSPoint point)
291 { 291 {
292 OS.objc_msgSend(this.id, OS.sel_moveToPoint_1, point); 292 OS.objc_msgSend(this.id_, OS.sel_moveToPoint_1, point);
293 } 293 }
294 294
295 public void relativeCurveToPoint (NSPoint endPoint, NSPoint controlPoint1, NSPoint controlPoint2) 295 public void relativeCurveToPoint (NSPoint endPoint, NSPoint controlPoint1, NSPoint controlPoint2)
296 { 296 {
297 OS.objc_msgSend(this.id, OS.sel_relativeCurveToPoint_1controlPoint1_1controlPoint2_1, endPoint, controlPoint1, controlPoint2); 297 OS.objc_msgSend(this.id_, OS.sel_relativeCurveToPoint_1controlPoint1_1controlPoint2_1, endPoint, controlPoint1, controlPoint2);
298 } 298 }
299 299
300 public void relativeLineToPoint (NSPoint point) 300 public void relativeLineToPoint (NSPoint point)
301 { 301 {
302 OS.objc_msgSend(this.id, OS.sel_relativeLineToPoint_1, point); 302 OS.objc_msgSend(this.id_, OS.sel_relativeLineToPoint_1, point);
303 } 303 }
304 304
305 public void relativeMoveToPoint (NSPoint point) 305 public void relativeMoveToPoint (NSPoint point)
306 { 306 {
307 OS.objc_msgSend(this.id, OS.sel_relativeMoveToPoint_1, point); 307 OS.objc_msgSend(this.id_, OS.sel_relativeMoveToPoint_1, point);
308 } 308 }
309 309
310 public void removeAllPoints () 310 public void removeAllPoints ()
311 { 311 {
312 OS.objc_msgSend(this.id, OS.sel_removeAllPoints); 312 OS.objc_msgSend(this.id_, OS.sel_removeAllPoints);
313 } 313 }
314 314
315 public void setAssociatedPoints (NSPointArray points, NSInteger index) 315 public void setAssociatedPoints (NSPointArray points, NSInteger index)
316 { 316 {
317 OS.objc_msgSend(this.id, OS.sel_setAssociatedPoints_1atIndex_1, points, index); 317 OS.objc_msgSend(this.id_, OS.sel_setAssociatedPoints_1atIndex_1, points, index);
318 } 318 }
319 319
320 public void setCachesBezierPath (bool flag) 320 public void setCachesBezierPath (bool flag)
321 { 321 {
322 OS.objc_msgSend(this.id, OS.sel_setCachesBezierPath_1, flag); 322 OS.objc_msgSend(this.id_, OS.sel_setCachesBezierPath_1, flag);
323 } 323 }
324 324
325 public void setClip () 325 public void setClip ()
326 { 326 {
327 OS.objc_msgSend(this.id, OS.sel_setClip); 327 OS.objc_msgSend(this.id_, OS.sel_setClip);
328 } 328 }
329 329
330 public static void setDefaultFlatness (CGFloat flatness) 330 public static void setDefaultFlatness (CGFloat flatness)
331 { 331 {
332 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultFlatness_1, flatness); 332 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultFlatness_1, flatness);
357 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultWindingRule_1, windingRule); 357 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultWindingRule_1, windingRule);
358 } 358 }
359 359
360 public void setFlatness (CGFloat flatness) 360 public void setFlatness (CGFloat flatness)
361 { 361 {
362 OS.objc_msgSend(this.id, OS.sel_setFlatness_1, flatness); 362 OS.objc_msgSend(this.id_, OS.sel_setFlatness_1, flatness);
363 } 363 }
364 364
365 public void setLineCapStyle (objc.id lineCapStyle) 365 public void setLineCapStyle (objc.id lineCapStyle)
366 { 366 {
367 OS.objc_msgSend(this.id, OS.sel_setLineCapStyle_1, lineCapStyle); 367 OS.objc_msgSend(this.id_, OS.sel_setLineCapStyle_1, lineCapStyle);
368 } 368 }
369 369
370 public void setLineDash (/*const*/CGFloat* pattern, NSInteger count, CGFloat phase) 370 public void setLineDash (/*const*/CGFloat* pattern, NSInteger count, CGFloat phase)
371 { 371 {
372 OS.objc_msgSend(this.id, OS.sel_setLineDash_1count_1phase_1, pattern, count, phase); 372 OS.objc_msgSend(this.id_, OS.sel_setLineDash_1count_1phase_1, pattern, count, phase);
373 } 373 }
374 374
375 public void setLineJoinStyle (objc.id lineJoinStyle) 375 public void setLineJoinStyle (objc.id lineJoinStyle)
376 { 376 {
377 OS.objc_msgSend(this.id, OS.sel_setLineJoinStyle_1, lineJoinStyle); 377 OS.objc_msgSend(this.id_, OS.sel_setLineJoinStyle_1, lineJoinStyle);
378 } 378 }
379 379
380 public void setLineWidth (CGFloat lineWidth) 380 public void setLineWidth (CGFloat lineWidth)
381 { 381 {
382 OS.objc_msgSend(this.id, OS.sel_setLineWidth_1, lineWidth); 382 OS.objc_msgSend(this.id_, OS.sel_setLineWidth_1, lineWidth);
383 } 383 }
384 384
385 public void setMiterLimit (CGFloat miterLimit) 385 public void setMiterLimit (CGFloat miterLimit)
386 { 386 {
387 OS.objc_msgSend(this.id, OS.sel_setMiterLimit_1, miterLimit); 387 OS.objc_msgSend(this.id_, OS.sel_setMiterLimit_1, miterLimit);
388 } 388 }
389 389
390 public void setWindingRule (objc.id windingRule) 390 public void setWindingRule (objc.id windingRule)
391 { 391 {
392 OS.objc_msgSend(this.id, OS.sel_setWindingRule_1, windingRule); 392 OS.objc_msgSend(this.id_, OS.sel_setWindingRule_1, windingRule);
393 } 393 }
394 394
395 public void stroke () 395 public void stroke ()
396 { 396 {
397 OS.objc_msgSend(this.id, OS.sel_stroke); 397 OS.objc_msgSend(this.id_, OS.sel_stroke);
398 } 398 }
399 399
400 public static void strokeLineFromPoint (NSPoint point1, NSPoint point2) 400 public static void strokeLineFromPoint (NSPoint point1, NSPoint point2)
401 { 401 {
402 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_strokeLineFromPoint_1toPoint_1, point1, point2); 402 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_strokeLineFromPoint_1toPoint_1, point1, point2);
407 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_strokeRect_1, rect); 407 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_strokeRect_1, rect);
408 } 408 }
409 409
410 public void transformUsingAffineTransform (NSAffineTransform transform) 410 public void transformUsingAffineTransform (NSAffineTransform transform)
411 { 411 {
412 OS.objc_msgSend(this.id, OS.sel_transformUsingAffineTransform_1, transform !is null ? transform.id : null); 412 OS.objc_msgSend(this.id_, OS.sel_transformUsingAffineTransform_1, transform !is null ? transform.id_ : null);
413 } 413 }
414 414
415 public objc.id windingRule () 415 public objc.id windingRule ()
416 { 416 {
417 return OS.objc_msgSend(this.id, OS.sel_windingRule); 417 return OS.objc_msgSend(this.id_, OS.sel_windingRule);
418 } 418 }
419 } 419 }