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

317 lines
5.1 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>
i2000-11-22 Alexander Larsson <alexl@redhat.com> * gdk/gdktypes.h: Add new type GdkSpan * docs/reference/gdk/gdk-sections.txt, docs/reference/gdk/tmpl/regions.sgml, gdk/gdkregion-generic.c, gdk/gdkregion.h: Implement and document gdk_region_spans_intersect_foreach. * gdk/linux-fb/Makefile.am, gdk/linux-fb/gdkrender-fb.c: Add new file gdkrender-fb.c which contains all core rendering code. Add gdk_fb_fill_rectangle_generic (old rectangle code) and gdk_fb_fill_rectangle_simple_16, gdk_fb_fill_rectangle_simple_32 (optimized rectangle fillers). * gdk/linux-fb/gdkdrawable-fb2.c: Move all rendering code to gdkrender-fb.c. Change from using GdkRectangles and GdkSegments for spans to GdkSpan. Use the new span intersection functions in gdk_fb_fill_spans. gdk_fb_draw_rectangle() clips filled rectangles and calls gc->fill_rectangle with the result. gdk_fb_fill_spans() gets extra argument "sorted". * gdk/linux-fb/gdkevents-fb.c: Remove unused includes and defines. New function gdk_fb_get_time() to get correct time for events. * gdk/linux-fb/gdkinput-ps2.c: Use gdk method of generating multiple-clicks (gdk_event_button_generate) Make sure to set the time of all events. * gdk/linux-fb/gdkmain-fb.c: Use gdk_fb_get_time (). * gdk/linux-fb/gdkprivate-fb.h: New virtual GC calls: fill_span & fill_rectangle. Export gdk_fb_get_time(). gdk_fb_fill_spans() gets extra argument "sorted". * gdk/linux-fb/mi*.c: Use GdkSpan instead of GdkRectangle. Pass correct sorted to gdk_fb_fill_spans. (sorted value taken from XFree 4 source)
2000-11-22 10:07:34 +00:00
GDK provides the #GdkPoint, #GdkRectangle, #GdkRegion and #GdkSpan 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>
i2000-11-22 Alexander Larsson <alexl@redhat.com> * gdk/gdktypes.h: Add new type GdkSpan * docs/reference/gdk/gdk-sections.txt, docs/reference/gdk/tmpl/regions.sgml, gdk/gdkregion-generic.c, gdk/gdkregion.h: Implement and document gdk_region_spans_intersect_foreach. * gdk/linux-fb/Makefile.am, gdk/linux-fb/gdkrender-fb.c: Add new file gdkrender-fb.c which contains all core rendering code. Add gdk_fb_fill_rectangle_generic (old rectangle code) and gdk_fb_fill_rectangle_simple_16, gdk_fb_fill_rectangle_simple_32 (optimized rectangle fillers). * gdk/linux-fb/gdkdrawable-fb2.c: Move all rendering code to gdkrender-fb.c. Change from using GdkRectangles and GdkSegments for spans to GdkSpan. Use the new span intersection functions in gdk_fb_fill_spans. gdk_fb_draw_rectangle() clips filled rectangles and calls gc->fill_rectangle with the result. gdk_fb_fill_spans() gets extra argument "sorted". * gdk/linux-fb/gdkevents-fb.c: Remove unused includes and defines. New function gdk_fb_get_time() to get correct time for events. * gdk/linux-fb/gdkinput-ps2.c: Use gdk method of generating multiple-clicks (gdk_event_button_generate) Make sure to set the time of all events. * gdk/linux-fb/gdkmain-fb.c: Use gdk_fb_get_time (). * gdk/linux-fb/gdkprivate-fb.h: New virtual GC calls: fill_span & fill_rectangle. Export gdk_fb_get_time(). gdk_fb_fill_spans() gets extra argument "sorted". * gdk/linux-fb/mi*.c: Use GdkSpan instead of GdkRectangle. Pass correct sorted to gdk_fb_fill_spans. (sorted value taken from XFree 4 source)
2000-11-22 10:07:34 +00:00
<para>
#GdkSpan is a structure holding a spanline. A spanline is a horizontal line that
is one pixel wide. It is mainly used when rasterizing other graphics primitives.
It can be intersected to regions by using gdk_region_spans_intersect_foreach().
</para>
1999-08-16 18:51:52 +00:00
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
2005-06-20 22:06:27 +00:00
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
1999-08-16 18:51:52 +00:00
<!-- ##### STRUCT GdkPoint ##### -->
<para>
Defines the x and y coordinates of a point.
1999-08-16 18:51:52 +00:00
</para>
@x: the x coordinate of the point.
@y: the y coordinate of the point.
1999-08-16 18:51:52 +00:00
<!-- ##### STRUCT GdkRectangle ##### -->
<para>
Defines the position and size of a rectangle.
1999-08-16 18:51:52 +00:00
</para>
@x: the x coordinate of the left edge of the rectangle.
@y: the y coordinate of the top of the rectangle.
@width: the width of the rectangle.
@height: the height of the rectangle.
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>
2006-05-05 16:21:19 +00:00
@src1:
@src2:
@dest:
1999-08-16 18:51:52 +00:00
<!-- ##### STRUCT GdkRegion ##### -->
<para>
A GdkRegion represents a set of pixels on the screen.
1999-08-16 18:51:52 +00:00
</para>
<!-- ##### FUNCTION gdk_region_new ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@void:
@Returns:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_polygon ##### -->
1999-08-16 18:51:52 +00:00
<para>
1999-08-16 18:51:52 +00:00
</para>
@points:
@n_points:
@fill_rule:
2006-05-05 16:21:19 +00:00
@Returns:
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>
1999-08-16 18:51:52 +00:00
</para>
@region:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_get_clipbox ##### -->
1999-08-16 18:51:52 +00:00
<para>
1999-08-16 18:51:52 +00:00
</para>
2006-05-05 16:21:19 +00:00
@region:
@rectangle:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_get_rectangles ##### -->
<para>
</para>
@region:
@rectangles:
@n_rectangles:
<!-- ##### FUNCTION gdk_region_empty ##### -->
1999-08-16 18:51:52 +00:00
<para>
1999-08-16 18:51:52 +00:00
</para>
@region:
2006-05-05 16:21:19 +00:00
@Returns:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_equal ##### -->
1999-08-16 18:51:52 +00:00
<para>
1999-08-16 18:51:52 +00:00
</para>
@region1:
@region2:
2006-05-05 16:21:19 +00:00
@Returns:
1999-08-16 18:51:52 +00:00
2009-07-07 05:05:29 +00:00
<!-- ##### FUNCTION gdk_region_rect_equal ##### -->
<para>
</para>
@region:
@rectangle:
@Returns:
<!-- ##### FUNCTION gdk_region_point_in ##### -->
1999-08-16 18:51:52 +00:00
<para>
1999-08-16 18:51:52 +00:00
</para>
2006-05-05 16:21:19 +00:00
@region:
@x:
@y:
2006-05-05 16:21:19 +00:00
@Returns:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_rect_in ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@region:
@rectangle:
2006-05-05 16:21:19 +00:00
@Returns:
<!-- ##### 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>
1999-08-16 18:51:52 +00:00
</para>
@region:
@dx:
@dy:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_shrink ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@region:
@dx:
@dy:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_union_with_rect ##### -->
1999-08-16 18:51:52 +00:00
<para>
1999-08-16 18:51:52 +00:00
</para>
@region:
@rect:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_region_intersect ##### -->
1999-08-16 18:51:52 +00:00
<para>
</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>
</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
<!-- ##### STRUCT GdkSpan ##### -->
<para>
A GdkSpan represents a horizontal line of pixels starting
at the pixel with coordinates @x, @y and ending before @x + @width, @y.
</para>
@x: x coordinate of the first pixel.
@y: y coordinate of the first pixel.
@width: number of pixels in the span.
<!-- ##### USER_FUNCTION GdkSpanFunc ##### -->
<para>
This defines the type of the function passed to
gdk_region_spans_intersect_foreach().
</para>
@span: a #GdkSpan.
@data: the user data passed to gdk_region_spans_intersect_foreach().
<!-- ##### FUNCTION gdk_region_spans_intersect_foreach ##### -->
<para>
</para>
@region:
2006-05-05 16:21:19 +00:00
@spans:
@n_spans:
@sorted:
2006-05-05 16:21:19 +00:00
@function:
@data: