New function; wrapper for XPolygonRegion().

1998-04-13  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* gdk/gdkregion.c (gdk_region_polygon): New function; wrapper for
	XPolygonRegion().

	* gdk/gdk.h: Added prototype for gdk_region_polygon().

	* gdk/gdktypes.h (GdkFillRule): New enum type of fill rule for polygons.
This commit is contained in:
Federico Mena Quintero 1998-04-14 00:49:06 +00:00 committed by Arturo Espinosa
parent 0b0524d397
commit af36f7765a
11 changed files with 144 additions and 1 deletions

View File

@ -1,3 +1,12 @@
1998-04-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdk/gdkregion.c (gdk_region_polygon): New function; wrapper for
XPolygonRegion().
* gdk/gdk.h: Added prototype for gdk_region_polygon().
* gdk/gdktypes.h (GdkFillRule): New enum type of fill rule for polygons.
Mon Apr 13 15:04:26 1998 Michael K. Johnson <johnsonm@redhat.com>
* gtk/testgtk.c (create_clist): removed duplicate call to

View File

@ -1,3 +1,12 @@
1998-04-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdk/gdkregion.c (gdk_region_polygon): New function; wrapper for
XPolygonRegion().
* gdk/gdk.h: Added prototype for gdk_region_polygon().
* gdk/gdktypes.h (GdkFillRule): New enum type of fill rule for polygons.
Mon Apr 13 15:04:26 1998 Michael K. Johnson <johnsonm@redhat.com>
* gtk/testgtk.c (create_clist): removed duplicate call to

View File

@ -1,3 +1,12 @@
1998-04-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdk/gdkregion.c (gdk_region_polygon): New function; wrapper for
XPolygonRegion().
* gdk/gdk.h: Added prototype for gdk_region_polygon().
* gdk/gdktypes.h (GdkFillRule): New enum type of fill rule for polygons.
Mon Apr 13 15:04:26 1998 Michael K. Johnson <johnsonm@redhat.com>
* gtk/testgtk.c (create_clist): removed duplicate call to

View File

@ -1,3 +1,12 @@
1998-04-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdk/gdkregion.c (gdk_region_polygon): New function; wrapper for
XPolygonRegion().
* gdk/gdk.h: Added prototype for gdk_region_polygon().
* gdk/gdktypes.h (GdkFillRule): New enum type of fill rule for polygons.
Mon Apr 13 15:04:26 1998 Michael K. Johnson <johnsonm@redhat.com>
* gtk/testgtk.c (create_clist): removed duplicate call to

View File

@ -1,3 +1,12 @@
1998-04-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdk/gdkregion.c (gdk_region_polygon): New function; wrapper for
XPolygonRegion().
* gdk/gdk.h: Added prototype for gdk_region_polygon().
* gdk/gdktypes.h (GdkFillRule): New enum type of fill rule for polygons.
Mon Apr 13 15:04:26 1998 Michael K. Johnson <johnsonm@redhat.com>
* gtk/testgtk.c (create_clist): removed duplicate call to

View File

@ -1,3 +1,12 @@
1998-04-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdk/gdkregion.c (gdk_region_polygon): New function; wrapper for
XPolygonRegion().
* gdk/gdk.h: Added prototype for gdk_region_polygon().
* gdk/gdktypes.h (GdkFillRule): New enum type of fill rule for polygons.
Mon Apr 13 15:04:26 1998 Michael K. Johnson <johnsonm@redhat.com>
* gtk/testgtk.c (create_clist): removed duplicate call to

View File

@ -1,3 +1,12 @@
1998-04-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdk/gdkregion.c (gdk_region_polygon): New function; wrapper for
XPolygonRegion().
* gdk/gdk.h: Added prototype for gdk_region_polygon().
* gdk/gdktypes.h (GdkFillRule): New enum type of fill rule for polygons.
Mon Apr 13 15:04:26 1998 Michael K. Johnson <johnsonm@redhat.com>
* gtk/testgtk.c (create_clist): removed duplicate call to

View File

@ -771,7 +771,11 @@ gboolean gdk_region_point_in (GdkRegion *region,
int x,
int y);
GdkOverlapType gdk_region_rect_in (GdkRegion *region,
GdkRectangle *rect);
GdkRectangle *rect);
GdkRegion* gdk_region_polygon (GdkPoint *points,
gint npoints,
GdkFillRule fill_rule);
void gdk_region_offset (GdkRegion *region,
gint dx,

View File

@ -119,6 +119,39 @@ gdk_region_rect_in (GdkRegion *region,
return GDK_OVERLAP_RECTANGLE_OUT; /*what else ? */
}
GdkRegion *
gdk_region_polygon (GdkPoint *points,
gint npoints,
GdkFillRule fill_rule)
{
GdkRegionPrivate *private;
GdkRegion *region;
Region xregion;
int xfill_rule;
g_return_val_if_fail (points != NULL, NULL);
g_return_val_if_fail (npoints != 0, NULL); /* maybe we should check for at least three points */
switch (fill_rule)
{
case GDK_EVEN_ODD_RULE:
xfill_rule = EvenOddRule;
break;
case GDK_WINDING_RULE:
xfill_rule = WindingRule;
break;
}
xregion = XPolygonRegion ((XPoint *) points, npoints, xfill_rule);
private = g_new (GdkRegionPrivate, 1);
private->xregion = xregion;
region = (GdkRegion *) private;
region->user_data = NULL;
return region;
}
void
gdk_region_offset (GdkRegion *region,
gint dx,

View File

@ -239,6 +239,16 @@ typedef enum
GDK_OPAQUE_STIPPLED
} GdkFill;
/* GC fill rule for polygons
* EvenOddRule
* WindingRule
*/
typedef enum
{
GDK_EVEN_ODD_RULE,
GDK_WINDING_RULE
} GdkFillRule;
/* GC line styles
* Solid:
* OnOffDash:

View File

@ -119,6 +119,39 @@ gdk_region_rect_in (GdkRegion *region,
return GDK_OVERLAP_RECTANGLE_OUT; /*what else ? */
}
GdkRegion *
gdk_region_polygon (GdkPoint *points,
gint npoints,
GdkFillRule fill_rule)
{
GdkRegionPrivate *private;
GdkRegion *region;
Region xregion;
int xfill_rule;
g_return_val_if_fail (points != NULL, NULL);
g_return_val_if_fail (npoints != 0, NULL); /* maybe we should check for at least three points */
switch (fill_rule)
{
case GDK_EVEN_ODD_RULE:
xfill_rule = EvenOddRule;
break;
case GDK_WINDING_RULE:
xfill_rule = WindingRule;
break;
}
xregion = XPolygonRegion ((XPoint *) points, npoints, xfill_rule);
private = g_new (GdkRegionPrivate, 1);
private->xregion = xregion;
region = (GdkRegion *) private;
region->user_data = NULL;
return region;
}
void
gdk_region_offset (GdkRegion *region,
gint dx,