Mercurial > dwindows
diff gtk/dw.c @ 1275:0b34e2cf0706
Updated dw_draw_rect and dw_draw_polygon to accept flags the same way as dw_draw_arc.
The fill parameter has been replaced by flags which should be backwards compatible.
Also updated the source comments to reflect these changes.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 30 Oct 2011 10:14:49 +0000 |
parents | dfecd7b3c81e |
children | fe92a6f6d3e7 |
line wrap: on
line diff
--- a/gtk/dw.c Sun Oct 30 02:13:47 2011 +0000 +++ b/gtk/dw.c Sun Oct 30 10:14:49 2011 +0000 @@ -7945,12 +7945,12 @@ * Parameters: * handle: Handle to the window. * pixmap: Handle to the pixmap. (choose only one of these) - * fill: if true filled + * flags: DW_DRAW_FILL (1) to fill the polygon or DW_DRAW_DEFAULT (0). * number of points * x[]: X coordinates. * y[]: Y coordinates. */ -void dw_draw_polygon(HWND handle, HPIXMAP pixmap, int fill, int npoints, int *x, int *y) +void dw_draw_polygon(HWND handle, HPIXMAP pixmap, int flags, int npoints, int *x, int *y) { int _locked_by_me = FALSE; int i; @@ -7979,7 +7979,7 @@ { cairo_line_to(cr, x[i], y[i]); } - if(fill) + if(flags & DW_DRAW_FILL) cairo_fill(cr); cairo_stroke(cr); cairo_destroy(cr); @@ -7997,7 +7997,7 @@ points[i].y = y[i]; } - gdk_draw_polygon(handle ? handle->window : pixmap->pixmap, gc, fill, points, npoints ); + gdk_draw_polygon(handle ? handle->window : pixmap->pixmap, gc, (flags & DW_DRAW_FILL), points, npoints ); gdk_gc_unref(gc); } DW_MUTEX_UNLOCK; @@ -8007,13 +8007,13 @@ * Parameters: * handle: Handle to the window. * pixmap: Handle to the pixmap. (choose only one of these) - * fill: if true filled + * flags: DW_DRAW_FILL (1) to fill the box or DW_DRAW_DEFAULT (0). * x: X coordinate. * y: Y coordinate. * width: Width of rectangle. * height: Height of rectangle. */ -void dw_draw_rect(HWND handle, HPIXMAP pixmap, int fill, int x, int y, int width, int height) +void dw_draw_rect(HWND handle, HPIXMAP pixmap, int flags, int x, int y, int width, int height) { int _locked_by_me = FALSE; GdkGC *gc = NULL; @@ -8039,7 +8039,7 @@ cairo_line_to(cr, x, y + height); cairo_line_to(cr, x + width, y + height); cairo_line_to(cr, x + width, y); - if(fill) + if(flags & DW_DRAW_FILL) cairo_fill(cr); cairo_stroke(cr); cairo_destroy(cr); @@ -8047,7 +8047,7 @@ #endif if(gc) { - gdk_draw_rectangle(handle ? handle->window : pixmap->pixmap, gc, fill, x, y, width, height); + gdk_draw_rectangle(handle ? handle->window : pixmap->pixmap, gc, (flags & DW_DRAW_FILL), x, y, width, height); gdk_gc_unref(gc); } DW_MUTEX_UNLOCK; @@ -8057,7 +8057,8 @@ * Parameters: * handle: Handle to the window. * pixmap: Handle to the pixmap. (choose only one of these) - * flags: For future use. + * flags: DW_DRAW_FILL (1) to fill the arc or DW_DRAW_DEFAULT (0). + * DW_DRAW_FULL will draw a complete circle/elipse. * xorigin: X coordinate of center of arc. * yorigin: Y coordinate of center of arc. * x1: X coordinate of first segment of arc.