1 <!-- ##### SECTION Title ##### -->
2 Points, Rectangles and Regions
4 <!-- ##### SECTION Short_Description ##### -->
5 Simple graphical data types
7 <!-- ##### SECTION Long_Description ##### -->
9 GDK provides the #GdkPoint, #GdkRectangle, #GdkRegion and #GdkSpan data types
10 for representing pixels and sets of pixels on the screen.
13 #GdkPoint is a simple structure containing an x and y coordinate of a point.
16 #GdkRectangle is a structure holding the position and size of a rectangle.
17 The intersection of two rectangles can be computed with
18 gdk_rectangle_intersect(). To find the union of two rectangles use
19 gdk_rectangle_union().
22 #GdkRegion is an opaque data type holding a set of arbitrary pixels, and is
23 usually used for clipping graphical operations (see gdk_gc_set_clip_region()).
26 #GdkSpan is a structure holding a spanline. A spanline is a horizontal line that
27 is one pixel wide. It is mainly used when rasterizing other graphics primitives.
28 It can be intersected to regions by using gdk_region_spans_intersect_foreach().
31 <!-- ##### SECTION See_Also ##### -->
36 <!-- ##### SECTION Stability_Level ##### -->
39 <!-- ##### SECTION Image ##### -->
42 <!-- ##### STRUCT GdkPoint ##### -->
44 Defines the x and y coordinates of a point.
47 @x: the x coordinate of the point.
48 @y: the y coordinate of the point.
50 <!-- ##### STRUCT GdkRectangle ##### -->
52 Defines the position and size of a rectangle.
55 @x: the x coordinate of the left edge of the rectangle.
56 @y: the y coordinate of the top of the rectangle.
57 @width: the width of the rectangle.
58 @height: the height of the rectangle.
60 <!-- ##### FUNCTION gdk_rectangle_intersect ##### -->
71 <!-- ##### FUNCTION gdk_rectangle_union ##### -->
81 <!-- ##### STRUCT GdkRegion ##### -->
83 A GdkRegion represents a set of pixels on the screen.
87 <!-- ##### FUNCTION gdk_region_new ##### -->
96 <!-- ##### FUNCTION gdk_region_polygon ##### -->
107 <!-- ##### ENUM GdkFillRule ##### -->
109 The method for determining which pixels are included in a region, when
110 creating a #GdkRegion from a polygon.
111 The fill rule is only relevant for polygons which overlap themselves.
114 @GDK_EVEN_ODD_RULE: areas which are overlapped an odd number of times are
115 included in the region, while areas overlapped an even number of times are not.
116 @GDK_WINDING_RULE: overlapping areas are always included.
118 <!-- ##### FUNCTION gdk_region_copy ##### -->
127 <!-- ##### FUNCTION gdk_region_rectangle ##### -->
136 <!-- ##### FUNCTION gdk_region_destroy ##### -->
144 <!-- ##### FUNCTION gdk_region_get_clipbox ##### -->
153 <!-- ##### FUNCTION gdk_region_get_rectangles ##### -->
163 <!-- ##### FUNCTION gdk_region_empty ##### -->
172 <!-- ##### FUNCTION gdk_region_equal ##### -->
182 <!-- ##### FUNCTION gdk_region_rect_equal ##### -->
192 <!-- ##### FUNCTION gdk_region_point_in ##### -->
203 <!-- ##### FUNCTION gdk_region_rect_in ##### -->
213 <!-- ##### ENUM GdkOverlapType ##### -->
215 Specifies the possible values returned by gdk_region_rect_in().
218 @GDK_OVERLAP_RECTANGLE_IN: if the rectangle is inside the #GdkRegion.
219 @GDK_OVERLAP_RECTANGLE_OUT: if the rectangle is outside the #GdkRegion.
220 @GDK_OVERLAP_RECTANGLE_PART: if the rectangle is partly inside the #GdkRegion.
222 <!-- ##### FUNCTION gdk_region_offset ##### -->
232 <!-- ##### FUNCTION gdk_region_shrink ##### -->
242 <!-- ##### FUNCTION gdk_region_union_with_rect ##### -->
251 <!-- ##### FUNCTION gdk_region_intersect ##### -->
259 <!-- ##### FUNCTION gdk_region_union ##### -->
268 <!-- ##### FUNCTION gdk_region_subtract ##### -->
276 <!-- ##### FUNCTION gdk_region_xor ##### -->
284 <!-- ##### STRUCT GdkSpan ##### -->
286 A GdkSpan represents a horizontal line of pixels starting
287 at the pixel with coordinates @x, @y and ending before @x + @width, @y.
290 @x: x coordinate of the first pixel.
291 @y: y coordinate of the first pixel.
292 @width: number of pixels in the span.
294 <!-- ##### USER_FUNCTION GdkSpanFunc ##### -->
296 This defines the type of the function passed to
297 gdk_region_spans_intersect_foreach().
301 @data: the user data passed to gdk_region_spans_intersect_foreach().
304 <!-- ##### FUNCTION gdk_region_spans_intersect_foreach ##### -->