comparison dwt/internal/cocoa/NSBezierPath.d @ 45:d8635bb48c7c

Merge with SWT 3.5
author Jacob Carlborg <doob@me.com>
date Mon, 01 Dec 2008 17:07:00 +0100
parents db5a898b2119
children 62202ce0039f
comparison
equal deleted inserted replaced
44:ca5e494f2bbf 45:d8635bb48c7c
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * 10 *
11 * Port to the D programming language: 11 * Port to the D programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com> 12 * Jacob Carlborg <doob@me.com>
13 *******************************************************************************/ 13 *******************************************************************************/
14 module dwt.internal.cocoa.NSBezierPath; 14 module dwt.internal.cocoa.NSBezierPath;
15 15
16 import dwt.internal.cocoa.CGFloat; 16 import dwt.dwthelper.utils;
17 import dwt.internal.c.Carbon;
18 import cocoa = dwt.internal.cocoa.id;
17 import dwt.internal.cocoa.NSAffineTransform; 19 import dwt.internal.cocoa.NSAffineTransform;
18 import dwt.internal.cocoa.NSFont; 20 import dwt.internal.cocoa.NSFont;
19 import dwt.internal.cocoa.NSInteger;
20 import dwt.internal.cocoa.NSObject; 21 import dwt.internal.cocoa.NSObject;
21 import dwt.internal.cocoa.NSPoint; 22 import dwt.internal.cocoa.NSPoint;
22 import dwt.internal.cocoa.NSRect; 23 import dwt.internal.cocoa.NSRect;
23 import dwt.internal.cocoa.OS; 24 import dwt.internal.cocoa.OS;
25 import dwt.internal.objc.cocoa.Cocoa;
24 import objc = dwt.internal.objc.runtime; 26 import objc = dwt.internal.objc.runtime;
25 27
26 enum NSBezierPathElement 28 enum NSBezierPathElement
27 { 29 {
28 NSMoveToBezierPathElement, 30 NSMoveToBezierPathElement,
29 NSLineToBezierPathElement, 31 NSLineToBezierPathElement,
30 NSCurveToBezierPathElement, 32 NSCurveToBezierPathElement,
31 NSClosePathBezierPathElement 33 NSClosePathBezierPathElement
32 } 34 }
33 35
34 alias NSBezierPathElement.NSMoveToBezierPathElement NSMoveToBezierPathElement;
35 alias NSBezierPathElement.NSLineToBezierPathElement NSLineToBezierPathElement;
36 alias NSBezierPathElement.NSCurveToBezierPathElement NSCurveToBezierPathElement;
37 alias NSBezierPathElement.NSClosePathBezierPathElement NSClosePathBezierPathElement;
38
39 enum NSLineCapStyle 36 enum NSLineCapStyle
40 { 37 {
41 NSButtLineCapStyle = 0, 38 NSButtLineCapStyle = 0,
42 NSRoundLineCapStyle = 1, 39 NSRoundLineCapStyle = 1,
43 NSSquareLineCapStyle = 2 40 NSSquareLineCapStyle = 2
44 } 41 }
45 42
46 alias NSLineCapStyle.NSButtLineCapStyle NSButtLineCapStyle;
47 alias NSLineCapStyle.NSRoundLineCapStyle NSRoundLineCapStyle;
48 alias NSLineCapStyle.NSSquareLineCapStyle NSSquareLineCapStyle;
49
50 enum NSLineJoinStyle 43 enum NSLineJoinStyle
51 { 44 {
52 NSMiterLineJoinStyle = 0, 45 NSMiterLineJoinStyle = 0,
53 NSRoundLineJoinStyle = 1, 46 NSRoundLineJoinStyle = 1,
54 NSBevelLineJoinStyle = 2 47 NSBevelLineJoinStyle = 2
55 } 48 }
56 49
57 alias NSLineJoinStyle.NSMiterLineJoinStyle NSMiterLineJoinStyle;
58 alias NSLineJoinStyle.NSRoundLineJoinStyle NSRoundLineJoinStyle;
59 alias NSLineJoinStyle.NSBevelLineJoinStyle NSBevelLineJoinStyle;
60
61 enum NSWindingRule 50 enum NSWindingRule
62 { 51 {
63 NSNonZeroWindingRule = 0, 52 NSNonZeroWindingRule = 0,
64 NSEvenOddWindingRule = 1 53 NSEvenOddWindingRule = 1
65 } 54 }
66 55
67 alias NSWindingRule.NSNonZeroWindingRule NSNonZeroWindingRule; 56 public class NSBezierPath : NSObject {
68 alias NSWindingRule.NSEvenOddWindingRule NSEvenOddWindingRule; 57
69 58 public this() {
70 public class NSBezierPath : NSObject 59 super();
71 { 60 }
72 public this () 61
73 { 62 public this(objc.id id) {
74 super(); 63 super(id);
75 } 64 }
76 65
77 public this (objc.id id) 66 public this(cocoa.id id) {
78 { 67 super(id);
79 super(id); 68 }
80 } 69
81 70 public void addClip() {
82 public void addClip () 71 OS.objc_msgSend(this.id, OS.sel_addClip);
83 { 72 }
84 OS.objc_msgSend(this.id_, OS.sel_addClip); 73
85 } 74 public void appendBezierPath(NSBezierPath path) {
86 75 OS.objc_msgSend(this.id, OS.sel_appendBezierPath_, path !is null ? path.id : null);
87 public void appendBezierPath (NSBezierPath path) 76 }
88 { 77
89 OS.objc_msgSend(this.id_, OS.sel_appendBezierPath_1, path !is null ? path.id_ : null); 78 public void appendBezierPathWithArcWithCenter(NSPoint center, CGFloat radius, CGFloat startAngle, CGFloat endAngle) {
90 } 79 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_, center, radius, startAngle, endAngle);
91 80 }
92 public void appendBezierPathWithArcFromPoint (NSPoint point1, NSPoint point2, CGFloat radius) 81
93 { 82 public void appendBezierPathWithArcWithCenter(NSPoint center, CGFloat radius, CGFloat startAngle, CGFloat endAngle, bool clockwise) {
94 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithArcFromPoint_1toPoint_1radius_1, point1, point2, radius); 83 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_clockwise_, center, radius, startAngle, endAngle, clockwise);
95 } 84 }
96 85
97 public void appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_ (NSPoint center, CGFloat radius, CGFloat startAngle, CGFloat endAngle) 86 public void appendBezierPathWithGlyphs(NSGlyph* glyphs, NSInteger count, NSFont font) {
98 { 87 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithGlyphs_count_inFont_, glyphs, count, font !is null ? font.id : null);
99 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithArcWithCenter_1radius_1startAngle_1endAngle_1, center, radius, startAngle, endAngle); 88 }
100 } 89
101 90 public void appendBezierPathWithOvalInRect(NSRect rect) {
102 public void appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_clockwise_ (NSPoint center, CGFloat radius, CGFloat startAngle, 91 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithOvalInRect_, rect);
103 CGFloat endAngle, bool clockwise) 92 }
104 { 93
105 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithArcWithCenter_1radius_1startAngle_1endAngle_1clockwise_1, center, radius, startAngle, 94 public void appendBezierPathWithRect(NSRect rect) {
106 endAngle, clockwise); 95 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithRect_, rect);
107 } 96 }
108 97
109 public void appendBezierPathWithGlyph (NSGlyph glyph, NSFont font) 98 public void appendBezierPathWithRoundedRect(NSRect rect, CGFloat xRadius, CGFloat yRadius) {
110 { 99 OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithRoundedRect_xRadius_yRadius_, rect, xRadius, yRadius);
111 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithGlyph_1inFont_1, glyph, font !is null ? font.id_ : null); 100 }
112 } 101
113 102 public static NSBezierPath bezierPath() {
114 public void appendBezierPathWithGlyphs (NSGlyph* glyphs, NSInteger count, NSFont font) 103 objc.id result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPath);
115 { 104 return result !is null ? new NSBezierPath(result) : null;
116 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithGlyphs_1count_1inFont_1, glyphs, count, font !is null ? font.id_ : null); 105 }
117 } 106
118 107 public NSBezierPath bezierPathByFlatteningPath() {
119 public void appendBezierPathWithOvalInRect (NSRect rect) 108 objc.id result = OS.objc_msgSend(this.id, OS.sel_bezierPathByFlatteningPath);
120 { 109 return result is this.id ? this : (result !is null ? new NSBezierPath(result) : null);
121 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithOvalInRect_1, rect); 110 }
122 } 111
123 112 public static NSBezierPath bezierPathWithRect(NSRect rect) {
124 public void appendBezierPathWithPackedGlyphs (/*const*/char* packedGlyphs) 113 objc.id result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPathWithRect_, rect);
125 { 114 return result !is null ? new NSBezierPath(result) : null;
126 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithPackedGlyphs_1, packedGlyphs); 115 }
127 } 116
128 117 public NSRect bounds() {
129 public void appendBezierPathWithPoints (NSPointArray points, NSInteger count) 118 NSRect result = NSRect();
130 { 119 OS.objc_msgSend_stret(result, this.id, OS.sel_bounds);
131 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithPoints_1count_1, points, count); 120 return result;
132 } 121 }
133 122
134 public void appendBezierPathWithRect (NSRect rect) 123 public void closePath() {
135 { 124 OS.objc_msgSend(this.id, OS.sel_closePath);
136 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithRect_1, rect); 125 }
137 } 126
138 127 public bool containsPoint(NSPoint point) {
139 public void appendBezierPathWithRoundedRect (NSRect rect, CGFloat xRadius, CGFloat yRadius) 128 return OS.objc_msgSend_bool(this.id, OS.sel_containsPoint_, point);
140 { 129 }
141 OS.objc_msgSend(this.id_, OS.sel_appendBezierPathWithRoundedRect_1xRadius_1yRadius_1, rect, xRadius, yRadius); 130
142 } 131 public NSRect controlPointBounds() {
143 132 NSRect result = NSRect();
144 public static NSBezierPath bezierPath () 133 OS.objc_msgSend_stret(result, this.id, OS.sel_controlPointBounds);
145 { 134 return result;
146 objc.id result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPath); 135 }
147 return result !is null ? new NSBezierPath(result) : null; 136
148 } 137 public NSPoint currentPoint() {
149 138 NSPoint result = NSPoint();
150 public NSBezierPath bezierPathByFlatteningPath () 139 OS.objc_msgSend_stret(result, this.id, OS.sel_currentPoint);
151 { 140 return result;
152 objc.id result = OS.objc_msgSend(this.id_, OS.sel_bezierPathByFlatteningPath); 141 }
153 return result is this.id_ ? this : (result !is null ? new NSBezierPath(result) : null); 142
154 } 143 public void curveToPoint(NSPoint endPoint, NSPoint controlPoint1, NSPoint controlPoint2) {
155 144 OS.objc_msgSend(this.id, OS.sel_curveToPoint_controlPoint1_controlPoint2_, endPoint, controlPoint1, controlPoint2);
156 public NSBezierPath bezierPathByReversingPath () 145 }
157 { 146
158 objc.id result = OS.objc_msgSend(this.id_, OS.sel_bezierPathByReversingPath); 147 public static CGFloat defaultFlatness() {
159 return result is this.id_ ? this : (result !is null ? new NSBezierPath(result) : null); 148 return cast(CGFloat) OS.objc_msgSend_fpret(OS.class_NSBezierPath, OS.sel_defaultFlatness);
160 } 149 }
161 150
162 public static NSBezierPath bezierPathWithOvalInRect (NSRect rect) 151 public NSBezierPathElement elementAtIndex(NSInteger index, NSPointArray points) {
163 { 152 return cast(NSBezierPathElement) OS.objc_msgSend(this.id, OS.sel_elementAtIndex_associatedPoints_, index, points);
164 objc.id result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPathWithOvalInRect_1, rect); 153 }
165 return result !is null ? new NSBezierPath(result) : null; 154
166 } 155 public NSInteger elementCount() {
167 156 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_elementCount);
168 public static NSBezierPath bezierPathWithRect (NSRect rect) 157 }
169 { 158
170 objc.id result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPathWithRect_1, rect); 159 public void fill() {
171 return result !is null ? new NSBezierPath(result) : null; 160 OS.objc_msgSend(this.id, OS.sel_fill);
172 } 161 }
173 162
174 public static NSBezierPath bezierPathWithRoundedRect (NSRect rect, CGFloat xRadius, CGFloat yRadius) 163 public static void fillRect(NSRect rect) {
175 { 164 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_fillRect_, rect);
176 objc.id result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPathWithRoundedRect_1xRadius_1yRadius_1, rect, xRadius, yRadius); 165 }
177 return result !is null ? new NSBezierPath(result) : null; 166
178 } 167 public bool isEmpty() {
179 168 return OS.objc_msgSend_bool(this.id, OS.sel_isEmpty);
180 public NSRect bounds () 169 }
181 { 170
182 NSRect result; 171 public void lineToPoint(NSPoint point) {
183 OS.objc_msgSend_stret(&result, this.id_, OS.sel_bounds); 172 OS.objc_msgSend(this.id, OS.sel_lineToPoint_, point);
184 return result; 173 }
185 } 174
186 175 public void moveToPoint(NSPoint point) {
187 public bool cachesBezierPath () 176 OS.objc_msgSend(this.id, OS.sel_moveToPoint_, point);
188 { 177 }
189 return OS.objc_msgSend(this.id_, OS.sel_cachesBezierPath) !is null; 178
190 } 179 public void removeAllPoints() {
191 180 OS.objc_msgSend(this.id, OS.sel_removeAllPoints);
192 public static void clipRect (NSRect rect) 181 }
193 { 182
194 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_clipRect_1, rect); 183 public void setClip() {
195 } 184 OS.objc_msgSend(this.id, OS.sel_setClip);
196 185 }
197 public void closePath () 186
198 { 187 public static void setDefaultFlatness(CGFloat flatness) {
199 OS.objc_msgSend(this.id_, OS.sel_closePath); 188 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultFlatness_, flatness);
200 } 189 }
201 190
202 public bool containsPoint (NSPoint point) 191 public void setLineCapStyle(NSLineCapStyle lineCapStyle) {
203 { 192 OS.objc_msgSend(this.id, OS.sel_setLineCapStyle_, lineCapStyle);
204 return OS.objc_msgSend(this.id_, OS.sel_containsPoint_1, point) !is null; 193 }
205 } 194
206 195 public void setLineDash(/*const*/CGFloat* pattern, NSInteger count, CGFloat phase) {
207 public NSRect controlPointBounds () 196 OS.objc_msgSend(this.id, OS.sel_setLineDash_count_phase_, pattern, count, phase);
208 { 197 }
209 NSRect result; 198
210 OS.objc_msgSend_stret(&result, this.id_, OS.sel_controlPointBounds); 199 public void setLineJoinStyle(NSLineJoinStyle lineJoinStyle) {
211 return result; 200 OS.objc_msgSend(this.id, OS.sel_setLineJoinStyle_, lineJoinStyle);
212 } 201 }
213 202
214 public NSPoint currentPoint () 203 public void setLineWidth(CGFloat lineWidth) {
215 { 204 OS.objc_msgSend(this.id, OS.sel_setLineWidth_, lineWidth);
216 NSPoint result; 205 }
217 OS.objc_msgSend_stret(&result, this.id_, OS.sel_currentPoint); 206
218 return result; 207 public void setMiterLimit(CGFloat miterLimit) {
219 } 208 OS.objc_msgSend(this.id, OS.sel_setMiterLimit_, miterLimit);
220 209 }
221 public void curveToPoint (NSPoint endPoint, NSPoint controlPoint1, NSPoint controlPoint2) 210
222 { 211 public void setWindingRule(NSWindingRule windingRule) {
223 OS.objc_msgSend(this.id_, OS.sel_curveToPoint_1controlPoint1_1controlPoint2_1, endPoint, controlPoint1, controlPoint2); 212 OS.objc_msgSend(this.id, OS.sel_setWindingRule_, windingRule);
224 } 213 }
225 214
226 public static CGFloat defaultFlatness () 215 public void stroke() {
227 { 216 OS.objc_msgSend(this.id, OS.sel_stroke);
228 return cast(CGFloat) OS.objc_msgSend_fpret(OS.class_NSBezierPath, OS.sel_defaultFlatness); 217 }
229 } 218
230 219 public static void strokeRect(NSRect rect) {
231 public static NSLineCapStyle defaultLineCapStyle () 220 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_strokeRect_, rect);
232 { 221 }
233 return cast(NSLineCapStyle) OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_defaultLineCapStyle); 222
234 } 223 public void transformUsingAffineTransform(NSAffineTransform transform) {
235 224 OS.objc_msgSend(this.id, OS.sel_transformUsingAffineTransform_, transform !is null ? transform.id : null);
236 public static NSLineJoinStyle defaultLineJoinStyle () 225 }
237 { 226
238 return cast(NSLineJoinStyle) OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_defaultLineJoinStyle); 227 }
239 }
240
241 public static CGFloat defaultLineWidth ()
242 {
243 return cast(CGFloat) OS.objc_msgSend_fpret(OS.class_NSBezierPath, OS.sel_defaultLineWidth);
244 }
245
246 public static CGFloat defaultMiterLimit ()
247 {
248 return cast(CGFloat) OS.objc_msgSend_fpret(OS.class_NSBezierPath, OS.sel_defaultMiterLimit);
249 }
250
251 public static NSWindingRule defaultWindingRule ()
252 {
253 return cast(NSWindingRule) OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_defaultWindingRule);
254 }
255
256 public static void drawPackedGlyphs (/*const*/char* packedGlyphs, NSPoint point)
257 {
258 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_drawPackedGlyphs_1atPoint_1, packedGlyphs, point);
259 }
260
261 public NSBezierPathElement elementAtIndex_ (NSInteger index)
262 {
263 return cast(NSBezierPathElement) OS.objc_msgSend(this.id_, OS.sel_elementAtIndex_1, index);
264 }
265
266 public NSBezierPathElement elementAtIndex_associatedPoints_ (NSInteger index, NSPointArray points)
267 {
268 return cast(NSBezierPathElement) OS.objc_msgSend(this.id_, OS.sel_elementAtIndex_1associatedPoints_1, index, points);
269 }
270
271 public NSInteger elementCount ()
272 {
273 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_elementCount);
274 }
275
276 public void fill ()
277 {
278 OS.objc_msgSend(this.id_, OS.sel_fill);
279 }
280
281 public static void fillRect (NSRect rect)
282 {
283 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_fillRect_1, rect);
284 }
285
286 public CGFloat flatness ()
287 {
288 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_flatness);
289 }
290
291 public void getLineDash (CGFloat* pattern, NSInteger* count, CGFloat* phase)
292 {
293 OS.objc_msgSend(this.id_, OS.sel_getLineDash_1count_1phase_1, pattern, count, phase);
294 }
295
296 public bool isEmpty ()
297 {
298 return OS.objc_msgSend(this.id_, OS.sel_isEmpty) !is null;
299 }
300
301 public NSLineCapStyle lineCapStyle ()
302 {
303 return cast(NSLineCapStyle) OS.objc_msgSend(this.id_, OS.sel_lineCapStyle);
304 }
305
306 public NSLineJoinStyle lineJoinStyle ()
307 {
308 return cast(NSLineJoinStyle) OS.objc_msgSend(this.id_, OS.sel_lineJoinStyle);
309 }
310
311 public void lineToPoint (NSPoint point)
312 {
313 OS.objc_msgSend(this.id_, OS.sel_lineToPoint_1, point);
314 }
315
316 public CGFloat lineWidth ()
317 {
318 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_lineWidth);
319 }
320
321 public CGFloat miterLimit ()
322 {
323 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_miterLimit);
324 }
325
326 public void moveToPoint (NSPoint point)
327 {
328 OS.objc_msgSend(this.id_, OS.sel_moveToPoint_1, point);
329 }
330
331 public void relativeCurveToPoint (NSPoint endPoint, NSPoint controlPoint1, NSPoint controlPoint2)
332 {
333 OS.objc_msgSend(this.id_, OS.sel_relativeCurveToPoint_1controlPoint1_1controlPoint2_1, endPoint, controlPoint1, controlPoint2);
334 }
335
336 public void relativeLineToPoint (NSPoint point)
337 {
338 OS.objc_msgSend(this.id_, OS.sel_relativeLineToPoint_1, point);
339 }
340
341 public void relativeMoveToPoint (NSPoint point)
342 {
343 OS.objc_msgSend(this.id_, OS.sel_relativeMoveToPoint_1, point);
344 }
345
346 public void removeAllPoints ()
347 {
348 OS.objc_msgSend(this.id_, OS.sel_removeAllPoints);
349 }
350
351 public void setAssociatedPoints (NSPointArray points, NSInteger index)
352 {
353 OS.objc_msgSend(this.id_, OS.sel_setAssociatedPoints_1atIndex_1, points, index);
354 }
355
356 public void setCachesBezierPath (bool flag)
357 {
358 OS.objc_msgSend(this.id_, OS.sel_setCachesBezierPath_1, flag);
359 }
360
361 public void setClip ()
362 {
363 OS.objc_msgSend(this.id_, OS.sel_setClip);
364 }
365
366 public static void setDefaultFlatness (CGFloat flatness)
367 {
368 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultFlatness_1, flatness);
369 }
370
371 public static void setDefaultLineCapStyle (NSLineCapStyle lineCapStyle)
372 {
373 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultLineCapStyle_1, lineCapStyle);
374 }
375
376 public static void setDefaultLineJoinStyle (NSLineJoinStyle lineJoinStyle)
377 {
378 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultLineJoinStyle_1, lineJoinStyle);
379 }
380
381 public static void setDefaultLineWidth (CGFloat lineWidth)
382 {
383 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultLineWidth_1, lineWidth);
384 }
385
386 public static void setDefaultMiterLimit (CGFloat limit)
387 {
388 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultMiterLimit_1, limit);
389 }
390
391 public static void setDefaultWindingRule (NSWindingRule windingRule)
392 {
393 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultWindingRule_1, windingRule);
394 }
395
396 public void setFlatness (CGFloat flatness)
397 {
398 OS.objc_msgSend(this.id_, OS.sel_setFlatness_1, flatness);
399 }
400
401 public void setLineCapStyle (NSLineCapStyle lineCapStyle)
402 {
403 OS.objc_msgSend(this.id_, OS.sel_setLineCapStyle_1, lineCapStyle);
404 }
405
406 public void setLineDash (/*const*/CGFloat* pattern, NSInteger count, CGFloat phase)
407 {
408 OS.objc_msgSend(this.id_, OS.sel_setLineDash_1count_1phase_1, pattern, count, phase);
409 }
410
411 public void setLineJoinStyle (NSLineJoinStyle lineJoinStyle)
412 {
413 OS.objc_msgSend(this.id_, OS.sel_setLineJoinStyle_1, lineJoinStyle);
414 }
415
416 public void setLineWidth (CGFloat lineWidth)
417 {
418 OS.objc_msgSend(this.id_, OS.sel_setLineWidth_1, lineWidth);
419 }
420
421 public void setMiterLimit (CGFloat miterLimit)
422 {
423 OS.objc_msgSend(this.id_, OS.sel_setMiterLimit_1, miterLimit);
424 }
425
426 public void setWindingRule (NSWindingRule windingRule)
427 {
428 OS.objc_msgSend(this.id_, OS.sel_setWindingRule_1, windingRule);
429 }
430
431 public void stroke ()
432 {
433 OS.objc_msgSend(this.id_, OS.sel_stroke);
434 }
435
436 public static void strokeLineFromPoint (NSPoint point1, NSPoint point2)
437 {
438 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_strokeLineFromPoint_1toPoint_1, point1, point2);
439 }
440
441 public static void strokeRect (NSRect rect)
442 {
443 OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_strokeRect_1, rect);
444 }
445
446 public void transformUsingAffineTransform (NSAffineTransform transform)
447 {
448 OS.objc_msgSend(this.id_, OS.sel_transformUsingAffineTransform_1, transform !is null ? transform.id_ : null);
449 }
450
451 public NSWindingRule windingRule ()
452 {
453 return cast(NSWindingRule) OS.objc_msgSend(this.id_, OS.sel_windingRule);
454 }
455 }