comparison dwt/graphics/Path.d @ 53:0405e18fec7f

Gdiplus implemented - test build of dwt.lib successful; updated graphics package as necessary
author John Reimer <terminal.node@gmail.com
date Sun, 03 Feb 2008 15:48:14 -0800
parents 9a64a7781bab
children ab60f3309436
comparison
equal deleted inserted replaced
52:0553f4e8ed93 53:0405e18fec7f
57 * public API. It is marked public only so that it can be shared 57 * public API. It is marked public only so that it can be shared
58 * within the packages provided by DWT. It is not available on all 58 * within the packages provided by DWT. It is not available on all
59 * platforms and should never be accessed from application code. 59 * platforms and should never be accessed from application code.
60 * </p> 60 * </p>
61 */ 61 */
62 public Gdip.GraphicsPath* handle; 62 public Gdip.Path handle;
63 63
64 Gdip.PointF currentPoint, startPoint; 64 Gdip.PointF currentPoint, startPoint;
65 65
66 /** 66 /**
67 * Constructs a new empty Path. 67 * Constructs a new empty Path.
134 y = y + height; 134 y = y + height;
135 height = -height; 135 height = -height;
136 } 136 }
137 if (width is 0 || height is 0 || arcAngle is 0) return; 137 if (width is 0 || height is 0 || arcAngle is 0) return;
138 if (width is height) { 138 if (width is height) {
139 Gdip.GraphicsPath_AddArc(handle, x, y, width, height, -startAngle, -arcAngle); 139 Gdip.GraphicsPath_AddArcF(handle, x, y, width, height, -startAngle, -arcAngle);
140 } else { 140 } else {
141 auto path = Gdip.GraphicsPath_new(Gdip.FillModeAlternate); 141 auto path = Gdip.GraphicsPath_new(Gdip.FillModeAlternate);
142 if (path is null) DWT.error(DWT.ERROR_NO_HANDLES); 142 if (path is null) DWT.error(DWT.ERROR_NO_HANDLES);
143 auto matrix = Gdip.Matrix_new(width, 0, 0, height, x, y); 143 auto matrix = Gdip.Matrix_new(width, 0, 0, height, x, y);
144 if (matrix is null) DWT.error(DWT.ERROR_NO_HANDLES); 144 if (matrix is null) DWT.error(DWT.ERROR_NO_HANDLES);
191 Gdip.RectF rect; 191 Gdip.RectF rect;
192 rect.X = x; 192 rect.X = x;
193 rect.Y = y; 193 rect.Y = y;
194 rect.Width = width; 194 rect.Width = width;
195 rect.Height = height; 195 rect.Height = height;
196 Gdip.GraphicsPath_AddRectangle(handle, &rect); 196 Gdip.GraphicsPath_AddRectangle(handle, rect);
197 currentPoint.X = x; 197 currentPoint.X = x;
198 currentPoint.Y = y; 198 currentPoint.Y = y;
199 } 199 }
200 200
201 /** 201 /**
398 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 398 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
399 int count = Gdip.GraphicsPath_GetPointCount(handle); 399 int count = Gdip.GraphicsPath_GetPointCount(handle);
400 byte[] gdipTypes = new byte[count]; 400 byte[] gdipTypes = new byte[count];
401 float[] points = new float[count * 2]; 401 float[] points = new float[count * 2];
402 Gdip.GraphicsPath_GetPathTypes(handle, gdipTypes, count); 402 Gdip.GraphicsPath_GetPathTypes(handle, gdipTypes, count);
403 Gdip.GraphicsPath_GetPathPoints(handle, points.ptr, count); 403 Gdip.GraphicsPath_GetPathPoints(handle, cast(Gdip.PointF[])points, count);
404 byte[] types = new byte[count * 2]; 404 byte[] types = new byte[count * 2];
405 int index = 0, typesIndex = 0; 405 int index = 0, typesIndex = 0;
406 while (index < count) { 406 while (index < count) {
407 byte type = gdipTypes[index]; 407 byte type = gdipTypes[index];
408 bool close = false; 408 bool close = false;