Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 099699b0a168a8bfc299524ae3dafc4f5a66e13a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/*******************************************************************************
 * Copyright (c) 2000, 2009 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.swt.internal.cocoa;

public class NSBezierPath extends NSObject {

public NSBezierPath() {
	super();
}

public NSBezierPath(int /*long*/ id) {
	super(id);
}

public NSBezierPath(id id) {
	super(id);
}

public void addClip() {
	OS.objc_msgSend(this.id, OS.sel_addClip);
}

public void appendBezierPath(NSBezierPath path) {
	OS.objc_msgSend(this.id, OS.sel_appendBezierPath_, path != null ? path.id : 0);
}

public void appendBezierPathWithArcWithCenter(NSPoint center, float /*double*/ radius, float /*double*/ startAngle, float /*double*/ endAngle) {
	OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_, center, radius, startAngle, endAngle);
}

public void appendBezierPathWithArcWithCenter(NSPoint center, float /*double*/ radius, float /*double*/ startAngle, float /*double*/ endAngle, boolean clockwise) {
	OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_clockwise_, center, radius, startAngle, endAngle, clockwise);
}

public void appendBezierPathWithGlyphs(int /*long*/ glyphs, int /*long*/ count, NSFont font) {
	OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithGlyphs_count_inFont_, glyphs, count, font != null ? font.id : 0);
}

public void appendBezierPathWithOvalInRect(NSRect rect) {
	OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithOvalInRect_, rect);
}

public void appendBezierPathWithRect(NSRect rect) {
	OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithRect_, rect);
}

public void appendBezierPathWithRoundedRect(NSRect rect, float /*double*/ xRadius, float /*double*/ yRadius) {
	OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithRoundedRect_xRadius_yRadius_, rect, xRadius, yRadius);
}

public static NSBezierPath bezierPath() {
	int /*long*/ result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPath);
	return result != 0 ? new NSBezierPath(result) : null;
}

public NSBezierPath bezierPathByFlatteningPath() {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_bezierPathByFlatteningPath);
	return result == this.id ? this : (result != 0 ? new NSBezierPath(result) : null);
}

public static NSBezierPath bezierPathWithRect(NSRect rect) {
	int /*long*/ result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPathWithRect_, rect);
	return result != 0 ? new NSBezierPath(result) : null;
}

public NSRect bounds() {
	NSRect result = new NSRect();
	OS.objc_msgSend_stret(result, this.id, OS.sel_bounds);
	return result;
}

public void closePath() {
	OS.objc_msgSend(this.id, OS.sel_closePath);
}

public boolean containsPoint(NSPoint point) {
	return OS.objc_msgSend_bool(this.id, OS.sel_containsPoint_, point);
}

public NSRect controlPointBounds() {
	NSRect result = new NSRect();
	OS.objc_msgSend_stret(result, this.id, OS.sel_controlPointBounds);
	return result;
}

public NSPoint currentPoint() {
	NSPoint result = new NSPoint();
	OS.objc_msgSend_stret(result, this.id, OS.sel_currentPoint);
	return result;
}

public void curveToPoint(NSPoint endPoint, NSPoint controlPoint1, NSPoint controlPoint2) {
	OS.objc_msgSend(this.id, OS.sel_curveToPoint_controlPoint1_controlPoint2_, endPoint, controlPoint1, controlPoint2);
}

public static float /*double*/ defaultFlatness() {
	return (float)OS.objc_msgSend_fpret(OS.class_NSBezierPath, OS.sel_defaultFlatness);
}

public int /*long*/ elementAtIndex(int /*long*/ index, int /*long*/ points) {
	return OS.objc_msgSend(this.id, OS.sel_elementAtIndex_associatedPoints_, index, points);
}

public int /*long*/ elementCount() {
	return OS.objc_msgSend(this.id, OS.sel_elementCount);
}

public void fill() {
	OS.objc_msgSend(this.id, OS.sel_fill);
}

public static void fillRect(NSRect rect) {
	OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_fillRect_, rect);
}

public boolean isEmpty() {
	return OS.objc_msgSend_bool(this.id, OS.sel_isEmpty);
}

public void lineToPoint(NSPoint point) {
	OS.objc_msgSend(this.id, OS.sel_lineToPoint_, point);
}

public void moveToPoint(NSPoint point) {
	OS.objc_msgSend(this.id, OS.sel_moveToPoint_, point);
}

public void removeAllPoints() {
	OS.objc_msgSend(this.id, OS.sel_removeAllPoints);
}

public void setClip() {
	OS.objc_msgSend(this.id, OS.sel_setClip);
}

public static void setDefaultFlatness(float /*double*/ flatness) {
	OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultFlatness_, flatness);
}

public void setLineCapStyle(int /*long*/ lineCapStyle) {
	OS.objc_msgSend(this.id, OS.sel_setLineCapStyle_, lineCapStyle);
}

public void setLineDash(float[] /*double[]*/ pattern, int /*long*/ count, float /*double*/ phase) {
	OS.objc_msgSend(this.id, OS.sel_setLineDash_count_phase_, pattern, count, phase);
}

public void setLineJoinStyle(int /*long*/ lineJoinStyle) {
	OS.objc_msgSend(this.id, OS.sel_setLineJoinStyle_, lineJoinStyle);
}

public void setLineWidth(float /*double*/ lineWidth) {
	OS.objc_msgSend(this.id, OS.sel_setLineWidth_, lineWidth);
}

public void setMiterLimit(float /*double*/ miterLimit) {
	OS.objc_msgSend(this.id, OS.sel_setMiterLimit_, miterLimit);
}

public void setWindingRule(int /*long*/ windingRule) {
	OS.objc_msgSend(this.id, OS.sel_setWindingRule_, windingRule);
}

public void stroke() {
	OS.objc_msgSend(this.id, OS.sel_stroke);
}

public static void strokeRect(NSRect rect) {
	OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_strokeRect_, rect);
}

public void transformUsingAffineTransform(NSAffineTransform transform) {
	OS.objc_msgSend(this.id, OS.sel_transformUsingAffineTransform_, transform != null ? transform.id : 0);
}

}

Back to the top