* graphics.c: Use C style comments instead of C++ style.
* pen.c (clone_dash_array): new helper function.
(GdipClonePen): Copy matrix and dash_array, removed the FIXME.
svn path=/trunk/mcs/; revision=22493
+2004-01-26 Duncan Mak <duncan@ximian.com>
+
+ * bitmap.c:
+ * graphics.c: Use C style comments instead of C++ style.
+
+ * pen.c (clone_dash_array): new helper function.
+ (GdipClonePen): Copy matrix and dash_array, removed the FIXME.
+
2004-01-23 Duncan Mak <duncan@ximian.com>
* graphics.c (GdipDrawPath): Implemented.
if (hbitmap != 0) {
BITMAPINFO bmi;
gdip_bitmap_fill_info_header (bitmap, &bmi.bmiHeader);
- //_saveBmp ("file1.bmp", bitmap);
+ /* _saveBmp ("file1.bmp", bitmap); */
SetDIBits_pfn (hdc, hbitmap, 0, bitmap->data.Height, bitmap->data.Scan0, &bmi, 0);
holdbitmap = SelectObject_pfn (hdc, hbitmap);
bitmap->hBitmapDC = hdc;
++array;
}
}
- //_saveBmp ("file2.bmp", bitmap);
+ /* _saveBmp ("file2.bmp", bitmap); */
DeleteObject_pfn (bitmap->hBitmap);
DeleteDC_pfn (bitmap->hBitmapDC);
if (stride == 0)
return InvalidParameter;
- if (scan0 == NULL) //FIXME: Win32 GDIPlus accepts NULL as a value for the scan0 parameter. Jordi,
+ if (scan0 == NULL) /* FIXME: Win32 GDIPlus accepts NULL as a value for the scan0 parameter. Jordi, */
return InvalidParameter;
switch (format) {
return Ok;
}
-// FIXME: the stack implementation is probably not suitable
+/* FIXME: the stack implementation is probably not suitable */
#define MAX_GRAPHICS_STATE_STACK 100
GpState saved_stack [MAX_GRAPHICS_STATE_STACK];
}
}
+static float *
+clone_dash_array (float *clone, float *array, int size)
+{
+ int i;
+
+ for (i = 0; i < size; i++)
+ clone [i] = array [i];
+
+ return clone;
+}
+
GpStatus
GdipClonePen (GpPen *pen, GpPen **clonepen)
{
- // FIXME: copy dash array and matrix
GpPen *result = gdip_pen_new ();
+ int count = pen->dash_count;
+ GpMatrix *matrix; /* copy of pen->matrix */
+ float dashes [count]; /* copy off pen->dash_array */
+
+ GdipCloneMatrix (pen->matrix, &matrix);
+ clone_dash_array (dashes, pen->dash_array, count);
+
result->color = pen->color;
result->brush = pen->brush;
result->width = pen->width;
result->dash_offset = pen->dash_offset;
result->dash_count = pen->dash_count;
result->own_dash_array = 0;
- result->dash_array = pen->dash_array;
+ result->dash_array = dashes;
result->unit = pen->unit;
- result->matrix = pen->matrix;
+ result->matrix = matrix;
*clonepen = result;