Mercurial > projects > dwt-linux
annotate dwt/graphics/Path.d @ 259:c0d810de7093
Update SWT 3.4M7 to 3.4
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 29 Jun 2008 14:33:38 +0200 |
parents | ce446666f5a2 |
children |
rev | line source |
---|---|
72 | 1 /******************************************************************************* |
259 | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
21 | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
72 | 10 * Port to the D programming language: |
11 * Frank Benoit <benoit@tionex.de> | |
21 | 12 *******************************************************************************/ |
13 module dwt.graphics.Path; | |
14 | |
71 | 15 import dwt.DWT; |
21 | 16 import dwt.internal.Compatibility; |
17 import dwt.internal.cairo.Cairo; | |
18 import dwt.graphics.Resource; | |
19 import dwt.graphics.Device; | |
20 import dwt.graphics.Font; | |
21 import dwt.graphics.GC; | |
22 import dwt.graphics.GCData; | |
23 import dwt.graphics.PathData; | |
200
08789b28bdf3
import dwt.dwthelper.utils now explicit
Frank Benoit <benoit@tionex.de>
parents:
194
diff
changeset
|
24 import dwt.dwthelper.utils; |
21 | 25 |
26 import tango.stdc.string; | |
27 import tango.text.convert.Format; | |
28 | |
29 /** | |
30 * Instances of this class represent paths through the two-dimensional | |
31 * coordinate system. Paths do not have to be continuous, and can be | |
32 * described using lines, rectangles, arcs, cubic or quadratic bezier curves, | |
33 * glyphs, or other paths. | |
34 * <p> | |
35 * Application code must explicitly invoke the <code>Path.dispose()</code> | |
36 * method to release the operating system resources managed by each instance | |
37 * when those instances are no longer required. | |
38 * </p> | |
39 * <p> | |
40 * This class requires the operating system's advanced graphics subsystem | |
41 * which may not be available on some platforms. | |
42 * </p> | |
43 * | |
259 | 44 * @see <a href="http://www.eclipse.org/swt/snippets/#path">Path, Pattern snippets</a> |
45 * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: GraphicsExample</a> | |
46 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | |
47 * | |
21 | 48 * @since 3.1 |
49 */ | |
50 public class Path : Resource { | |
240 | 51 alias Resource.init_ init_; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
52 /** |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
53 * the OS resource for the Path |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
54 * (Warning: This field is platform dependent) |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
55 * <p> |
71 | 56 * <b>IMPORTANT:</b> This field is <em>not</em> part of the DWT |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
57 * public API. It is marked public only so that it can be shared |
71 | 58 * within the packages provided by DWT. It is not available on all |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
59 * platforms and should never be accessed from application code. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
60 * </p> |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
61 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
62 public cairo_t* handle; |
21 | 63 |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
64 bool moved, closed = true; |
21 | 65 |
66 /** | |
67 * Constructs a new empty Path. | |
68 * <p> | |
69 * This operation requires the operating system's advanced | |
70 * graphics subsystem which may not be available on some | |
71 * platforms. | |
72 * </p> | |
73 * | |
74 * @param device the device on which to allocate the path | |
75 * | |
76 * @exception IllegalArgumentException <ul> | |
77 * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device</li> | |
78 * </ul> | |
71 | 79 * @exception DWTException <ul> |
21 | 80 * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> |
81 * </ul> | |
71 | 82 * @exception DWTError <ul> |
21 | 83 * <li>ERROR_NO_HANDLES if a handle for the path could not be obtained</li> |
84 * </ul> | |
85 * | |
86 * @see #dispose() | |
87 */ | |
88 public this (Device device) { | |
240 | 89 super(device); |
90 this.device.checkCairo(); | |
91 auto surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, 1, 1); | |
92 if (surface is null) DWT.error(DWT.ERROR_NO_HANDLES); | |
93 handle = Cairo.cairo_create(surface); | |
94 Cairo.cairo_surface_destroy(surface); | |
95 if (handle is null) DWT.error(DWT.ERROR_NO_HANDLES); | |
96 init_(); | |
97 } | |
98 | |
259 | 99 /** |
100 * Constructs a new Path that is a copy of <code>path</code>. If | |
101 * <code>flatness</code> is less than or equal to zero, an unflatten | |
102 * copy of the path is created. Otherwise, it specifies the maximum | |
103 * error between the path and its flatten copy. Smaller numbers give | |
104 * better approximation. | |
105 * <p> | |
106 * This operation requires the operating system's advanced | |
107 * graphics subsystem which may not be available on some | |
108 * platforms. | |
109 * </p> | |
110 * | |
111 * @param device the device on which to allocate the path | |
112 * @param path the path to make a copy | |
113 * @param flatness the flatness value | |
114 * | |
115 * @exception IllegalArgumentException <ul> | |
116 * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device</li> | |
117 * <li>ERROR_NULL_ARGUMENT - if the path is null</li> | |
118 * <li>ERROR_INVALID_ARGUMENT - if the path has been disposed</li> | |
119 * </ul> | |
120 * @exception DWTException <ul> | |
121 * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> | |
122 * </ul> | |
123 * @exception DWTError <ul> | |
124 * <li>ERROR_NO_HANDLES if a handle for the path could not be obtained</li> | |
125 * </ul> | |
126 * | |
127 * @see #dispose() | |
128 * @since 3.4 | |
129 */ | |
240 | 130 public this (Device device, Path path, float flatness) { |
131 super(device); | |
132 if (path is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); | |
133 if (path.isDisposed()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
134 auto surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, 1, 1); |
71 | 135 if (surface is null) DWT.error(DWT.ERROR_NO_HANDLES); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
136 handle = Cairo.cairo_create(surface); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
137 Cairo.cairo_surface_destroy(surface); |
71 | 138 if (handle is null) DWT.error(DWT.ERROR_NO_HANDLES); |
240 | 139 cairo_path_t* copy; |
140 flatness = Math.max(0, flatness); | |
141 if (flatness is 0) { | |
142 copy = Cairo.cairo_copy_path(path.handle); | |
143 } else { | |
144 double tolerance = Cairo.cairo_get_tolerance(path.handle); | |
145 Cairo.cairo_set_tolerance(path.handle, flatness); | |
146 copy = Cairo.cairo_copy_path_flat(path.handle); | |
147 Cairo.cairo_set_tolerance(path.handle, tolerance); | |
148 } | |
149 if (copy is null) { | |
150 Cairo.cairo_destroy(handle); | |
151 DWT.error(DWT.ERROR_NO_HANDLES); | |
152 } | |
153 Cairo.cairo_append_path(handle, copy); | |
154 Cairo.cairo_path_destroy(copy); | |
155 init_(); | |
156 } | |
157 | |
259 | 158 /** |
159 * Constructs a new Path with the specifed PathData. | |
160 * <p> | |
161 * This operation requires the operating system's advanced | |
162 * graphics subsystem which may not be available on some | |
163 * platforms. | |
164 * </p> | |
165 * | |
166 * @param device the device on which to allocate the path | |
167 * @param data the data for the path | |
168 * | |
169 * @exception IllegalArgumentException <ul> | |
170 * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device</li> | |
171 * <li>ERROR_NULL_ARGUMENT - if the data is null</li> | |
172 * </ul> | |
173 * @exception DWTException <ul> | |
174 * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> | |
175 * </ul> | |
176 * @exception DWTError <ul> | |
177 * <li>ERROR_NO_HANDLES if a handle for the path could not be obtained</li> | |
178 * </ul> | |
179 * | |
180 * @see #dispose() | |
181 * @since 3.4 | |
182 */ | |
240 | 183 public this (Device device, PathData data) { |
184 this(device); | |
185 if (data is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); | |
186 init_(data); | |
21 | 187 } |
188 | |
189 /** | |
190 * Adds to the receiver a circular or elliptical arc that lies within | |
191 * the specified rectangular area. | |
192 * <p> | |
193 * The resulting arc begins at <code>startAngle</code> and extends | |
194 * for <code>arcAngle</code> degrees. | |
195 * Angles are interpreted such that 0 degrees is at the 3 o'clock | |
196 * position. A positive value indicates a counter-clockwise rotation | |
197 * while a negative value indicates a clockwise rotation. | |
198 * </p><p> | |
199 * The center of the arc is the center of the rectangle whose origin | |
200 * is (<code>x</code>, <code>y</code>) and whose size is specified by the | |
201 * <code>width</code> and <code>height</code> arguments. | |
202 * </p><p> | |
203 * The resulting arc covers an area <code>width + 1</code> pixels wide | |
204 * by <code>height + 1</code> pixels tall. | |
205 * </p> | |
206 * | |
207 * @param x the x coordinate of the upper-left corner of the arc | |
208 * @param y the y coordinate of the upper-left corner of the arc | |
209 * @param width the width of the arc | |
210 * @param height the height of the arc | |
211 * @param startAngle the beginning angle | |
212 * @param arcAngle the angular extent of the arc, relative to the start angle | |
213 * | |
71 | 214 * @exception DWTException <ul> |
21 | 215 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
216 * </ul> | |
217 */ | |
218 public void addArc(float x, float y, float width, float height, float startAngle, float arcAngle) { | |
71 | 219 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
220 moved = true; |
194 | 221 if (width is height) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
222 float angle = -startAngle * cast(float)Compatibility.PI / 180; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
223 if (closed) Cairo.cairo_move_to(handle, (x + width / 2f) + width / 2f * Math.cos(angle), (y + height / 2f) + height / 2f * Math.sin(angle)); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
224 if (arcAngle >= 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
225 Cairo.cairo_arc_negative(handle, x + width / 2f, y + height / 2f, width / 2f, angle, -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
226 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
227 Cairo.cairo_arc(handle, x + width / 2f, y + height / 2f, width / 2f, angle, -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
228 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
229 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
230 Cairo.cairo_save(handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
231 Cairo.cairo_translate(handle, x + width / 2f, y + height / 2f); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
232 Cairo.cairo_scale(handle, width / 2f, height / 2f); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
233 float angle = -startAngle * cast(float)Compatibility.PI / 180; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
234 if (closed) Cairo.cairo_move_to(handle, Math.cos(angle), Math.sin(angle)); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
235 if (arcAngle >= 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
236 Cairo.cairo_arc_negative(handle, 0, 0, 1, angle, -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
237 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
238 Cairo.cairo_arc(handle, 0, 0, 1, angle, -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
239 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
240 Cairo.cairo_restore(handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
241 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
242 closed = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
243 if (Math.abs(arcAngle) >= 360) close(); |
21 | 244 } |
245 | |
246 /** | |
247 * Adds to the receiver the path described by the parameter. | |
248 * | |
249 * @param path the path to add to the receiver | |
250 * | |
251 * @exception IllegalArgumentException <ul> | |
252 * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li> | |
253 * <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li> | |
254 * </ul> | |
71 | 255 * @exception DWTException <ul> |
21 | 256 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
257 * </ul> | |
258 */ | |
259 public void addPath(Path path) { | |
71 | 260 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
261 if (path is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); | |
262 if (path.isDisposed()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
263 moved = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
264 auto copy = Cairo.cairo_copy_path(path.handle); |
71 | 265 if (copy is null) DWT.error(DWT.ERROR_NO_HANDLES); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
266 Cairo.cairo_append_path(handle, copy); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
267 Cairo.cairo_path_destroy(copy); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
268 closed = path.closed; |
21 | 269 } |
270 | |
271 /** | |
272 * Adds to the receiver the rectangle specified by x, y, width and height. | |
273 * | |
274 * @param x the x coordinate of the rectangle to add | |
275 * @param y the y coordinate of the rectangle to add | |
276 * @param width the width of the rectangle to add | |
277 * @param height the height of the rectangle to add | |
278 * | |
71 | 279 * @exception DWTException <ul> |
21 | 280 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
281 * </ul> | |
282 */ | |
283 public void addRectangle(float x, float y, float width, float height) { | |
71 | 284 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
285 moved = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
286 Cairo.cairo_rectangle(handle, x, y, width, height); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
287 closed = true; |
21 | 288 } |
289 | |
290 /** | |
291 * Adds to the receiver the pattern of glyphs generated by drawing | |
292 * the given string using the given font starting at the point (x, y). | |
293 * | |
294 * @param string the text to use | |
295 * @param x the x coordinate of the starting point | |
296 * @param y the y coordinate of the starting point | |
297 * @param font the font to use | |
298 * | |
299 * @exception IllegalArgumentException <ul> | |
300 * <li>ERROR_NULL_ARGUMENT - if the font is null</li> | |
301 * <li>ERROR_INVALID_ARGUMENT - if the font has been disposed</li> | |
302 * </ul> | |
71 | 303 * @exception DWTException <ul> |
21 | 304 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
305 * </ul> | |
306 */ | |
238 | 307 public void addString(String str, float x, float y, Font font) { |
71 | 308 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
194 | 309 if (font is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
71 | 310 if (font.isDisposed()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
311 moved = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
312 GC.addCairoString(handle, str, x, y, font); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
313 closed = true; |
21 | 314 } |
315 | |
316 /** | |
317 * Closes the current sub path by adding to the receiver a line | |
318 * from the current point of the path back to the starting point | |
319 * of the sub path. | |
320 * | |
71 | 321 * @exception DWTException <ul> |
21 | 322 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
323 * </ul> | |
324 */ | |
325 public void close() { | |
71 | 326 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
327 Cairo.cairo_close_path(handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
328 moved = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
329 closed = true; |
21 | 330 } |
331 | |
332 /** | |
333 * Returns <code>true</code> if the specified point is contained by | |
334 * the receiver and false otherwise. | |
335 * <p> | |
336 * If outline is <code>true</code>, the point (x, y) checked for containment in | |
337 * the receiver's outline. If outline is <code>false</code>, the point is | |
338 * checked to see if it is contained within the bounds of the (closed) area | |
339 * covered by the receiver. | |
340 * | |
341 * @param x the x coordinate of the point to test for containment | |
342 * @param y the y coordinate of the point to test for containment | |
343 * @param gc the GC to use when testing for containment | |
344 * @param outline controls whether to check the outline or contained area of the path | |
345 * @return <code>true</code> if the path contains the point and <code>false</code> otherwise | |
346 * | |
347 * @exception IllegalArgumentException <ul> | |
348 * <li>ERROR_NULL_ARGUMENT - if the gc is null</li> | |
349 * <li>ERROR_INVALID_ARGUMENT - if the gc has been disposed</li> | |
350 * </ul> | |
71 | 351 * @exception DWTException <ul> |
21 | 352 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
353 * </ul> | |
354 */ | |
355 public bool contains(float x, float y, GC gc, bool outline) { | |
71 | 356 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
194 | 357 if (gc is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
71 | 358 if (gc.isDisposed()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
359 //TODO - see Windows |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
360 gc.initCairo(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
361 gc.checkGC(GC.LINE_CAP | GC.LINE_JOIN | GC.LINE_STYLE | GC.LINE_WIDTH); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
362 bool result = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
363 auto cairo = gc.data.cairo; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
364 auto copy = Cairo.cairo_copy_path(handle); |
71 | 365 if (copy is null) DWT.error(DWT.ERROR_NO_HANDLES); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
366 Cairo.cairo_append_path(cairo, copy); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
367 Cairo.cairo_path_destroy(copy); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
368 if (outline) { |
194 | 369 result = Cairo.cairo_in_stroke(cairo, x, y) !is 0; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
370 } else { |
194 | 371 result = Cairo.cairo_in_fill(cairo, x, y) !is 0; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
372 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
373 Cairo.cairo_new_path(cairo); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
374 return result; |
21 | 375 } |
376 | |
377 /** | |
378 * Adds to the receiver a cubic bezier curve based on the parameters. | |
379 * | |
380 * @param cx1 the x coordinate of the first control point of the spline | |
381 * @param cy1 the y coordinate of the first control of the spline | |
382 * @param cx2 the x coordinate of the second control of the spline | |
383 * @param cy2 the y coordinate of the second control of the spline | |
384 * @param x the x coordinate of the end point of the spline | |
385 * @param y the y coordinate of the end point of the spline | |
386 * | |
71 | 387 * @exception DWTException <ul> |
21 | 388 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
389 * </ul> | |
390 */ | |
391 public void cubicTo(float cx1, float cy1, float cx2, float cy2, float x, float y) { | |
71 | 392 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
393 if (!moved) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
394 double currentX, currentY; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
395 Cairo.cairo_get_current_point(handle, ¤tX, ¤tY); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
396 Cairo.cairo_move_to(handle, currentX, currentY); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
397 moved = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
398 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
399 Cairo.cairo_curve_to(handle, cx1, cy1, cx2, cy2, x, y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
400 closed = false; |
21 | 401 } |
402 | |
403 /** | |
404 * Replaces the first four elements in the parameter with values that | |
405 * describe the smallest rectangle that will completely contain the | |
406 * receiver (i.e. the bounding box). | |
407 * | |
408 * @param bounds the array to hold the result | |
409 * | |
410 * @exception IllegalArgumentException <ul> | |
411 * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li> | |
412 * <li>ERROR_INVALID_ARGUMENT - if the parameter is too small to hold the bounding box</li> | |
413 * </ul> | |
71 | 414 * @exception DWTException <ul> |
21 | 415 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
416 * </ul> | |
417 */ | |
418 public void getBounds(float[] bounds) { | |
71 | 419 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
194 | 420 if (bounds is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
71 | 421 if (bounds.length < 4) DWT.error(DWT.ERROR_INVALID_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
422 auto copy = Cairo.cairo_copy_path(handle); |
71 | 423 if (copy is null) DWT.error(DWT.ERROR_NO_HANDLES); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
424 cairo_path_t* path = new cairo_path_t(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
425 memmove(path, copy, cairo_path_t.sizeof); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
426 double minX = 0, minY = 0, maxX = 0, maxY = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
427 if (path.num_data > 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
428 minX = minY = double.max; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
429 maxX = maxY = -double.max; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
430 int i = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
431 cairo_path_data_t* data = new cairo_path_data_t(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
432 while (i < path.num_data) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
433 *data = path.data[i]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
434 switch (data.header.type) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
435 case Cairo.CAIRO_PATH_MOVE_TO: |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
436 minX = Math.min(minX, path.data[i+1].point.x); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
437 minY = Math.min(minY, path.data[i+1].point.y); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
438 maxX = Math.max(maxX, path.data[i+1].point.x); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
439 maxY = Math.max(maxY, path.data[i+1].point.y); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
440 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
441 case Cairo.CAIRO_PATH_LINE_TO: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
442 minX = Math.min(minX, path.data[i+1].point.x); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
443 minY = Math.min(minY, path.data[i+1].point.y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
444 maxX = Math.max(maxX, path.data[i+1].point.x); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
445 maxY = Math.max(maxY, path.data[i+1].point.y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
446 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
447 case Cairo.CAIRO_PATH_CURVE_TO: |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
448 minX = Math.min(minX, path.data[i+1].point.x); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
449 minY = Math.min(minY, path.data[i+1].point.y); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
450 maxX = Math.max(maxX, path.data[i+1].point.x); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
451 maxY = Math.max(maxY, path.data[i+1].point.y); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
452 minX = Math.min(minX, path.data[i+2].point.x); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
453 minY = Math.min(minY, path.data[i+2].point.y); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
454 maxX = Math.max(maxX, path.data[i+2].point.x); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
455 maxY = Math.max(maxY, path.data[i+2].point.y); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
456 minX = Math.min(minX, path.data[i+3].point.x); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
457 minY = Math.min(minY, path.data[i+3].point.y); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
458 maxX = Math.max(maxX, path.data[i+3].point.x); |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
459 maxY = Math.max(maxY, path.data[i+3].point.y); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
460 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
461 case Cairo.CAIRO_PATH_CLOSE_PATH: break; |
55
93981635e709
Checked and inserted missing default switch cases.
Frank Benoit <benoit@tionex.de>
parents:
33
diff
changeset
|
462 default: |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
463 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
464 i += data.header.length; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
465 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
466 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
467 bounds[0] = cast(float)minX; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
468 bounds[1] = cast(float)minY; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
469 bounds[2] = cast(float)(maxX - minX); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
470 bounds[3] = cast(float)(maxY - minY); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
471 Cairo.cairo_path_destroy(copy); |
21 | 472 } |
473 | |
474 /** | |
475 * Replaces the first two elements in the parameter with values that | |
476 * describe the current point of the path. | |
477 * | |
478 * @param point the array to hold the result | |
479 * | |
480 * @exception IllegalArgumentException <ul> | |
481 * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li> | |
482 * <li>ERROR_INVALID_ARGUMENT - if the parameter is too small to hold the end point</li> | |
483 * </ul> | |
71 | 484 * @exception DWTException <ul> |
21 | 485 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
486 * </ul> | |
487 */ | |
488 public void getCurrentPoint(float[] point) { | |
71 | 489 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
194 | 490 if (point is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
71 | 491 if (point.length < 2) DWT.error(DWT.ERROR_INVALID_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
492 double x, y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
493 Cairo.cairo_get_current_point(handle, &x, &y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
494 point[0] = cast(float)x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
495 point[1] = cast(float)y; |
21 | 496 } |
497 | |
498 /** | |
499 * Returns a device independent representation of the receiver. | |
500 * | |
501 * @return the PathData for the receiver | |
502 * | |
71 | 503 * @exception DWTException <ul> |
21 | 504 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
505 * </ul> | |
506 * | |
507 * @see PathData | |
508 */ | |
509 public PathData getPathData() { | |
71 | 510 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
511 auto copy = Cairo.cairo_copy_path(handle); |
71 | 512 if (copy is null) DWT.error(DWT.ERROR_NO_HANDLES); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
513 cairo_path_t* path = new cairo_path_t(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
514 *path = *copy; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
515 byte[] types = new byte[path.num_data]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
516 float[] pts = new float[path.num_data * 6]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
517 int typeIndex = 0, ptsIndex = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
518 if (path.num_data > 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
519 int i = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
520 double[] points = new double[6]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
521 cairo_path_data_t* data = new cairo_path_data_t(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
522 while (i < path.num_data) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
523 switch (data.header.type) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
524 case Cairo.CAIRO_PATH_MOVE_TO: |
71 | 525 types[typeIndex++] = DWT.PATH_MOVE_TO; |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
526 pts[ptsIndex++] = cast(float)path.data[i+1].point.x; |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
527 pts[ptsIndex++] = cast(float)path.data[i+1].point.y; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
528 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
529 case Cairo.CAIRO_PATH_LINE_TO: |
71 | 530 types[typeIndex++] = DWT.PATH_LINE_TO; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
531 pts[ptsIndex++] = cast(float)path.data[i+1].point.x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
532 pts[ptsIndex++] = cast(float)path.data[i+1].point.y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
533 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
534 case Cairo.CAIRO_PATH_CURVE_TO: |
71 | 535 types[typeIndex++] = DWT.PATH_CUBIC_TO; |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
536 pts[ptsIndex++] = cast(float)path.data[i+1].point.x; |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
537 pts[ptsIndex++] = cast(float)path.data[i+1].point.y; |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
538 pts[ptsIndex++] = cast(float)path.data[i+2].point.x; |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
539 pts[ptsIndex++] = cast(float)path.data[i+2].point.y; |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
540 pts[ptsIndex++] = cast(float)path.data[i+3].point.x; |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
25
diff
changeset
|
541 pts[ptsIndex++] = cast(float)path.data[i+3].point.y; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
542 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
543 case Cairo.CAIRO_PATH_CLOSE_PATH: |
71 | 544 types[typeIndex++] = DWT.PATH_CLOSE; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
545 break; |
55
93981635e709
Checked and inserted missing default switch cases.
Frank Benoit <benoit@tionex.de>
parents:
33
diff
changeset
|
546 default: |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
547 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
548 i += data.header.length; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
549 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
550 } |
194 | 551 if (typeIndex !is types.length) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
552 byte[] newTypes = new byte[typeIndex]; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
553 System.arraycopy(types, 0, newTypes, 0, typeIndex); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
554 types = newTypes; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
555 } |
194 | 556 if (ptsIndex !is pts.length) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
557 float[] newPts = new float[ptsIndex]; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
558 System.arraycopy(pts, 0, newPts, 0, ptsIndex); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
559 pts = newPts; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
560 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
561 Cairo.cairo_path_destroy(copy); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
562 PathData result = new PathData(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
563 result.types = types; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
564 result.points = pts; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
565 return result; |
21 | 566 } |
567 | |
568 /** | |
569 * Adds to the receiver a line from the current point to | |
570 * the point specified by (x, y). | |
571 * | |
572 * @param x the x coordinate of the end of the line to add | |
573 * @param y the y coordinate of the end of the line to add | |
574 * | |
71 | 575 * @exception DWTException <ul> |
21 | 576 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
577 * </ul> | |
578 */ | |
579 public void lineTo(float x, float y) { | |
71 | 580 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
581 if (!moved) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
582 double currentX, currentY; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
583 Cairo.cairo_get_current_point(handle, ¤tX, ¤tY); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
584 Cairo.cairo_move_to(handle, currentX, currentY); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
585 moved = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
586 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
587 Cairo.cairo_line_to(handle, x, y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
588 closed = false; |
21 | 589 } |
590 | |
591 /** | |
592 * Sets the current point of the receiver to the point | |
593 * specified by (x, y). Note that this starts a new | |
594 * sub path. | |
595 * | |
596 * @param x the x coordinate of the new end point | |
597 * @param y the y coordinate of the new end point | |
598 * | |
71 | 599 * @exception DWTException <ul> |
21 | 600 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
601 * </ul> | |
602 */ | |
603 public void moveTo(float x, float y) { | |
71 | 604 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
605 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
606 * Bug in Cairo. If cairo_move_to() is not called at the |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
607 * begining of a subpath, the first cairo_line_to() or |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
608 * cairo_curve_to() segment do not output anything. The fix |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
609 * is to detect that the app did not call cairo_move_to() |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
610 * before those calls and call it explicitly. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
611 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
612 moved = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
613 Cairo.cairo_move_to(handle, x, y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
614 closed = true; |
21 | 615 } |
616 | |
617 /** | |
618 * Adds to the receiver a quadratic curve based on the parameters. | |
619 * | |
620 * @param cx the x coordinate of the control point of the spline | |
621 * @param cy the y coordinate of the control point of the spline | |
622 * @param x the x coordinate of the end point of the spline | |
623 * @param y the y coordinate of the end point of the spline | |
624 * | |
71 | 625 * @exception DWTException <ul> |
21 | 626 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
627 * </ul> | |
628 */ | |
629 public void quadTo(float cx, float cy, float x, float y) { | |
71 | 630 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
631 double currentX, currentY; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
632 Cairo.cairo_get_current_point(handle, ¤tX, ¤tY); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
633 if (!moved) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
634 Cairo.cairo_move_to(handle, currentX, currentY); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
635 moved = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
636 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
637 float x0 = cast(float)currentX; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
638 float y0 = cast(float)currentY; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
639 float cx1 = x0 + 2 * (cx - x0) / 3; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
640 float cy1 = y0 + 2 * (cy - y0) / 3; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
641 float cx2 = cx1 + (x - x0) / 3; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
642 float cy2 = cy1 + (y - y0) / 3; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
643 Cairo.cairo_curve_to(handle, cx1, cy1, cx2, cy2, x, y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
644 closed = false; |
21 | 645 } |
646 | |
240 | 647 void destroy() { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
648 Cairo.cairo_destroy(handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
649 handle = null; |
240 | 650 } |
651 | |
652 void init_(PathData data) { | |
653 byte[] types = data.types; | |
654 float[] points = data.points; | |
655 for (int i = 0, j = 0; i < types.length; i++) { | |
656 switch (types[i]) { | |
657 case DWT.PATH_MOVE_TO: | |
658 moveTo(points[j++], points[j++]); | |
659 break; | |
660 case DWT.PATH_LINE_TO: | |
661 lineTo(points[j++], points[j++]); | |
662 break; | |
663 case DWT.PATH_CUBIC_TO: | |
664 cubicTo(points[j++], points[j++], points[j++], points[j++], points[j++], points[j++]); | |
665 break; | |
666 case DWT.PATH_QUAD_TO: | |
667 quadTo(points[j++], points[j++], points[j++], points[j++]); | |
668 break; | |
669 case DWT.PATH_CLOSE: | |
670 close(); | |
671 break; | |
672 default: | |
673 dispose(); | |
674 DWT.error(DWT.ERROR_INVALID_ARGUMENT); | |
675 } | |
676 } | |
21 | 677 } |
678 | |
679 /** | |
680 * Returns <code>true</code> if the Path has been disposed, | |
681 * and <code>false</code> otherwise. | |
682 * <p> | |
683 * This method gets the dispose state for the Path. | |
684 * When a Path has been disposed, it is an error to | |
685 * invoke any other method using the Path. | |
686 * | |
687 * @return <code>true</code> when the Path is disposed, and <code>false</code> otherwise | |
688 */ | |
150
f2e04420fd6c
reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
689 public override bool isDisposed() { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
690 return handle is null; |
21 | 691 } |
692 | |
693 /** | |
694 * Returns a string containing a concise, human-readable | |
695 * description of the receiver. | |
696 * | |
697 * @return a string representation of the receiver | |
698 */ | |
238 | 699 public override String toString() { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
700 if (isDisposed()) return "Path {*DISPOSED*}"; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
701 return Format( "Path {{{}}", handle ); |
21 | 702 } |
703 | |
704 } |