Name
Points, Rectangles and Regions -- simple graphical data types.
Synopsis
#include <gdk/gdk.h>
struct GdkPoint;
struct GdkRectangle;
gboolean gdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
void gdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
struct GdkRegion;
GdkRegion* gdk_region_new (void);
GdkRegion* gdk_region_polygon (GdkPoint *points,
gint npoints,
GdkFillRule fill_rule);
enum GdkFillRule;
GdkRegion* gdk_region_copy (GdkRegion *region);
GdkRegion* gdk_region_rectangle (GdkRectangle *rectangle);
void gdk_region_destroy (GdkRegion *region);
void gdk_region_get_clipbox (GdkRegion *region,
GdkRectangle *rectangle);
gboolean gdk_region_empty (GdkRegion *region);
gboolean gdk_region_equal (GdkRegion *region1,
GdkRegion *region2);
gboolean gdk_region_point_in (GdkRegion *region,
int x,
int y);
GdkOverlapType gdk_region_rect_in (GdkRegion *region,
GdkRectangle *rect);
enum GdkOverlapType;
void gdk_region_offset (GdkRegion *region,
gint dx,
gint dy);
void gdk_region_shrink (GdkRegion *region,
gint dx,
gint dy);
void gdk_region_union_with_rect (GdkRegion *region,
GdkRectangle *rect);
void gdk_region_intersect (GdkRegion *source1,
GdkRegion *source2);
void gdk_region_union (GdkRegion *source1,
GdkRegion *source2);
void gdk_region_subtract (GdkRegion *source1,
GdkRegion *source2);
void gdk_region_xor (GdkRegion *source1,
GdkRegion *source2); |
Details
struct GdkPoint
struct GdkPoint
{
gint x;
gint y;
}; |
struct GdkRectangle
struct GdkRectangle
{
gint x;
gint y;
gint width;
gint height;
}; |
gdk_rectangle_intersect ()
struct GdkRegion
A GdkRegion represents a set of pixels on the screen.
The only user-visible field of the structure is the user_data member, which
can be used to attach arbitrary data to the GdkRegion.
gdk_region_new ()
Creates a new empty GdkRegion.
gdk_region_polygon ()
Creates a new GdkRegion using the polygon defined by a number of points.
enum GdkFillRule
typedef enum
{
GDK_EVEN_ODD_RULE,
GDK_WINDING_RULE
} GdkFillRule; |
The method for determining which pixels are included in a region, when
creating a GdkRegion from a polygon.
The fill rule is only relevant for polygons which overlap themselves.
gdk_region_get_clipbox ()
Returns the smallest rectangle which includes the entire GdkRegion.
gdk_region_empty ()
Returns TRUE if the GdkRegion is empty.
gdk_region_equal ()
Returns TRUE if the two regions are the same.
gdk_region_point_in ()
Returns TRUE if a point is in a region.
gdk_region_rect_in ()
Tests whether a rectangle is within a region.
enum GdkOverlapType
typedef enum
{
GDK_OVERLAP_RECTANGLE_IN,
GDK_OVERLAP_RECTANGLE_OUT,
GDK_OVERLAP_RECTANGLE_PART
} GdkOverlapType; |
Specifies the possible values returned by gdk_region_rect_in().
gdk_region_offset ()
Moves a region the specified distance.
gdk_region_shrink ()
Resizes a region by the specified amount.
Positive values shrink the region. Negative values expand it.
gdk_region_union_with_rect ()
Returns the union of a region and a rectangle.