gtk2/docs/reference/gdk/tmpl/regions.sgml

264 lines
5.3 KiB
Plaintext
Raw Normal View History

1999-08-16 18:51:52 +00:00
<!-- ##### SECTION Title ##### -->
Points, Rectangles and Regions
<!-- ##### SECTION Short_Description ##### -->
simple graphical data types.
1999-08-16 18:51:52 +00:00
<!-- ##### SECTION Long_Description ##### -->
<para>
GDK provides the #GdkPoint, #GdkRectangle and #GdkRegion data types for
representing pixels and sets of pixels on the screen.
</para>
<para>
#GdkPoint is a simple structure containing an x and y coordinate of a point.
</para>
<para>
#GdkRectangle is a structure holding the position and size of a rectangle.
The intersection of two rectangles can be computed with
gdk_rectangle_intersect(). To find the union of two rectangles use
gdk_rectangle_union().
</para>
<para>
#GdkRegion is an opaque data type holding a set of arbitrary pixels, and is
usually used for clipping graphical operations (see gdk_gc_set_clip_region()).
1999-08-16 18:51:52 +00:00
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### STRUCT GdkPoint ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@x:
@y:
1999-08-16 18:51:52 +00:00
<!-- ##### STRUCT GdkRectangle ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@x:
@y:
@width:
@height:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_rectangle_intersect ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@src1:
@src2:
@dest:
@Returns:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_rectangle_union ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@src1:
@src2:
@dest:
1999-08-16 18:51:52 +00:00
<!-- ##### STRUCT GdkRegion ##### -->
<para>
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.
1999-08-16 18:51:52 +00:00
</para>
<!-- ##### FUNCTION gdk_region_new ##### -->
<para>
Creates a new empty #GdkRegion.
1999-08-16 18:51:52 +00:00
</para>
@Returns: a new empty #GdkRegion.
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_polygon ##### -->
1999-08-16 18:51:52 +00:00
<para>
Creates a new #GdkRegion using the polygon defined by a number of points.
1999-08-16 18:51:52 +00:00
</para>
@points: an array of #GdkPoint structs.
@npoints: the number of elements in the @points array.
@fill_rule: specifies which pixels are included in the region when the polygon
overlaps itself.
@Returns: a new #GdkRegion based on the given polygon.
1999-08-16 18:51:52 +00:00
<!-- ##### ENUM GdkFillRule ##### -->
1999-08-16 18:51:52 +00:00
<para>
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.
1999-08-16 18:51:52 +00:00
</para>
@GDK_EVEN_ODD_RULE: areas which are overlapped an odd number of times are
included in the region, while areas overlapped an even number of times are not.
@GDK_WINDING_RULE: overlapping areas are always included.
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_copy ##### -->
<para>
</para>
@region:
@Returns:
<!-- ##### FUNCTION gdk_region_rectangle ##### -->
<para>
</para>
@rectangle:
@Returns:
<!-- ##### FUNCTION gdk_region_destroy ##### -->
1999-08-16 18:51:52 +00:00
<para>
Destroys a #GdkRegion.
1999-08-16 18:51:52 +00:00
</para>
@region: a #GdkRegion.
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_get_clipbox ##### -->
1999-08-16 18:51:52 +00:00
<para>
Returns the smallest rectangle which includes the entire #GdkRegion.
1999-08-16 18:51:52 +00:00
</para>
@region: a #GdkRegion.
@rectangle: returns the smallest rectangle which includes all of @region.
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_empty ##### -->
1999-08-16 18:51:52 +00:00
<para>
Returns TRUE if the #GdkRegion is empty.
1999-08-16 18:51:52 +00:00
</para>
@region: a #GdkRegion.
@Returns: TRUE if @region is empty.
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_equal ##### -->
1999-08-16 18:51:52 +00:00
<para>
Returns TRUE if the two regions are the same.
1999-08-16 18:51:52 +00:00
</para>
@region1: a #GdkRegion.
@region2: a #GdkRegion.
@Returns: TRUE if @region1 and @region2 are equal.
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_point_in ##### -->
1999-08-16 18:51:52 +00:00
<para>
Returns TRUE if a point is in a region.
1999-08-16 18:51:52 +00:00
</para>
@region: a #GdkRegion.
@x: the x coordinate of a point.
@y: the y coordinate of a point.
@Returns: TRUE if the point is in @region.
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_rect_in ##### -->
<para>
Tests whether a rectangle is within a region.
1999-08-16 18:51:52 +00:00
</para>
@region: a #GdkRegion.
@rect: a #GdkRectangle.
@Returns: GDK_OVERLAP_RECTANGLE_IN, GDK_OVERLAP_RECTANGLE_OUT, or
GDK_OVERLAP_RECTANGLE_PART, depending on whether the rectangle is inside,
outside, or partly inside the #GdkRegion, respectively.
<!-- ##### ENUM GdkOverlapType ##### -->
<para>
Specifies the possible values returned by gdk_region_rect_in().
</para>
1999-08-16 18:51:52 +00:00
@GDK_OVERLAP_RECTANGLE_IN: if the rectangle is inside the #GdkRegion.
@GDK_OVERLAP_RECTANGLE_OUT: if the rectangle is outside the #GdkRegion.
@GDK_OVERLAP_RECTANGLE_PART: if the rectangle is partly inside the #GdkRegion.
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_offset ##### -->
<para>
Moves a region the specified distance.
1999-08-16 18:51:52 +00:00
</para>
@region: a #GdkRegion.
@dx: the distance to move the region horizontally.
@dy: the distance to move the region vertically.
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_shrink ##### -->
<para>
Resizes a region by the specified amount.
Positive values shrink the region. Negative values expand it.
1999-08-16 18:51:52 +00:00
</para>
@region: a #GdkRegion.
@dx: the number of pixels to shrink the region horizontally.
@dy: the number of pixels to shrink the region vertically.
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_union_with_rect ##### -->
1999-08-16 18:51:52 +00:00
<para>
Returns the union of a region and a rectangle.
1999-08-16 18:51:52 +00:00
</para>
@region: a #GdkRegion.
@rect: a #GdkRectangle.
<!-- # Unused Parameters # -->
@Returns: the union of @region and @rect.
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_intersect ##### -->
1999-08-16 18:51:52 +00:00
<para>
1999-08-16 18:51:52 +00:00
</para>
@source1:
@source2:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_union ##### -->
1999-08-16 18:51:52 +00:00
<para>
1999-08-16 18:51:52 +00:00
</para>
@source1:
@source2:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_subtract ##### -->
1999-08-16 18:51:52 +00:00
<para>
1999-08-16 18:51:52 +00:00
</para>
@source1:
@source2:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_xor ##### -->
1999-08-16 18:51:52 +00:00
<para>
</para>
@source1:
@source2:
1999-08-16 18:51:52 +00:00