]> Pileus Git - ~andy/gtk/blob - docs/reference/gdk/tmpl/regions.sgml
add --deprecated-guards
[~andy/gtk] / docs / reference / gdk / tmpl / regions.sgml
1 <!-- ##### SECTION Title ##### -->
2 Points, Rectangles and Regions
3
4 <!-- ##### SECTION Short_Description ##### -->
5 simple graphical data types.
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 GDK provides the #GdkPoint, #GdkRectangle, #GdkRegion and #GdkSpan data types
10 for representing pixels and sets of pixels on the screen.
11 </para>
12 <para>
13 #GdkPoint is a simple structure containing an x and y coordinate of a point.
14 </para>
15 <para>
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().
20 </para>
21 <para>
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()).
24 </para>
25 <para>
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().
29 </para>
30
31 <!-- ##### SECTION See_Also ##### -->
32 <para>
33
34 </para>
35
36 <!-- ##### STRUCT GdkPoint ##### -->
37 <para>
38 Defines the x and y coordinates of a point.
39 Note that both are defined as #gint16 values, so the coordinates are limited
40 to between -32,768 and 32,767.
41 </para>
42
43 @x: the x coordinate of the point.
44 @y: the y coordinate of the point.
45
46 <!-- ##### STRUCT GdkRectangle ##### -->
47 <para>
48 Defines the position and size of a rectangle.
49 </para>
50
51 @x: the x coordinate of the left edge of the rectangle.
52 @y: the y coordinate of the top of the rectangle.
53 @width: the width of the rectangle.
54 @height: the height of the rectangle.
55
56 <!-- ##### FUNCTION gdk_rectangle_intersect ##### -->
57 <para>
58 Calculates the intersection of two rectangles.
59 </para>
60
61 @src1: a #GdkRectangle.
62 @src2: a #GdkRectangle.
63 @dest: the intersection of @src1 and @src2.
64 @Returns: TRUE if the rectangles intersect.
65
66
67 <!-- ##### FUNCTION gdk_rectangle_union ##### -->
68 <para>
69 Calculates the union of two rectangles.
70 The union of rectangles @src1 and @src2 is the smallest rectangle which
71 includes both @src1 and @src2 within it.
72 </para>
73
74 @src1: a #GdkRectangle.
75 @src2: a #GdkRectangle.
76 @dest: the union of @src1 and @src2.
77
78
79 <!-- ##### STRUCT GdkRegion ##### -->
80 <para>
81 A GdkRegion represents a set of pixels on the screen.
82 The only user-visible field of the structure is the user_data member, which
83 can be used to attach arbitrary data to the #GdkRegion.
84 </para>
85
86
87 <!-- ##### FUNCTION gdk_region_new ##### -->
88 <para>
89 Creates a new empty #GdkRegion.
90 </para>
91
92 @Returns: a new empty #GdkRegion.
93
94
95 <!-- ##### FUNCTION gdk_region_polygon ##### -->
96 <para>
97 Creates a new #GdkRegion using the polygon defined by a number of points.
98
99 </para>
100
101 @points: an array of #GdkPoint structs.
102 @npoints: the number of elements in the @points array.
103 @fill_rule: specifies which pixels are included in the region when the polygon
104 overlaps itself.
105 @Returns: a new #GdkRegion based on the given polygon.
106
107
108 <!-- ##### ENUM GdkFillRule ##### -->
109 <para>
110 The method for determining which pixels are included in a region, when
111 creating a #GdkRegion from a polygon.
112 The fill rule is only relevant for polygons which overlap themselves.
113 </para>
114
115 @GDK_EVEN_ODD_RULE: areas which are overlapped an odd number of times are
116 included in the region, while areas overlapped an even number of times are not.
117 @GDK_WINDING_RULE: overlapping areas are always included.
118
119 <!-- ##### FUNCTION gdk_region_copy ##### -->
120 <para>
121
122 </para>
123
124 @region: 
125 @Returns: 
126
127
128 <!-- ##### FUNCTION gdk_region_rectangle ##### -->
129 <para>
130
131 </para>
132
133 @rectangle: 
134 @Returns: 
135
136
137 <!-- ##### FUNCTION gdk_region_destroy ##### -->
138 <para>
139 Destroys a #GdkRegion.
140 </para>
141
142 @region: a #GdkRegion.
143
144
145 <!-- ##### FUNCTION gdk_region_get_clipbox ##### -->
146 <para>
147 Returns the smallest rectangle which includes the entire #GdkRegion.
148 </para>
149
150 @region: a #GdkRegion.
151 @rectangle: returns the smallest rectangle which includes all of @region.
152
153
154 <!-- ##### FUNCTION gdk_region_empty ##### -->
155 <para>
156 Returns TRUE if the #GdkRegion is empty.
157 </para>
158
159 @region: a #GdkRegion.
160 @Returns: TRUE if @region is empty.
161
162
163 <!-- ##### FUNCTION gdk_region_equal ##### -->
164 <para>
165 Returns TRUE if the two regions are the same.
166 </para>
167
168 @region1: a #GdkRegion.
169 @region2: a #GdkRegion.
170 @Returns: TRUE if @region1 and @region2 are equal.
171
172
173 <!-- ##### FUNCTION gdk_region_point_in ##### -->
174 <para>
175 Returns TRUE if a point is in a region.
176 </para>
177
178 @region: a #GdkRegion.
179 @x: the x coordinate of a point.
180 @y: the y coordinate of a point.
181 @Returns: TRUE if the point is in @region.
182
183
184 <!-- ##### FUNCTION gdk_region_rect_in ##### -->
185 <para>
186 Tests whether a rectangle is within a region.
187 </para>
188
189 @region: a #GdkRegion.
190 @rect: a #GdkRectangle.
191 @Returns: GDK_OVERLAP_RECTANGLE_IN, GDK_OVERLAP_RECTANGLE_OUT, or
192 GDK_OVERLAP_RECTANGLE_PART, depending on whether the rectangle is inside,
193 outside, or partly inside the #GdkRegion, respectively.
194
195
196 <!-- ##### ENUM GdkOverlapType ##### -->
197 <para>
198 Specifies the possible values returned by gdk_region_rect_in().
199 </para>
200
201 @GDK_OVERLAP_RECTANGLE_IN: if the rectangle is inside the #GdkRegion.
202 @GDK_OVERLAP_RECTANGLE_OUT: if the rectangle is outside the #GdkRegion.
203 @GDK_OVERLAP_RECTANGLE_PART: if the rectangle is partly inside the #GdkRegion.
204
205 <!-- ##### FUNCTION gdk_region_offset ##### -->
206 <para>
207 Moves a region the specified distance.
208 </para>
209
210 @region: a #GdkRegion.
211 @dx: the distance to move the region horizontally.
212 @dy: the distance to move the region vertically.
213
214
215 <!-- ##### FUNCTION gdk_region_shrink ##### -->
216 <para>
217 Resizes a region by the specified amount.
218 Positive values shrink the region. Negative values expand it.
219 </para>
220
221 @region: a #GdkRegion.
222 @dx: the number of pixels to shrink the region horizontally.
223 @dy: the number of pixels to shrink the region vertically.
224
225
226 <!-- ##### FUNCTION gdk_region_union_with_rect ##### -->
227 <para>
228 Returns the union of a region and a rectangle.
229 </para>
230
231 @region: a #GdkRegion.
232 @rect: a #GdkRectangle.
233 <!-- # Unused Parameters # -->
234 @Returns: the union of @region and @rect.
235
236
237 <!-- ##### FUNCTION gdk_region_intersect ##### -->
238 <para>
239
240 </para>
241
242 @source1: 
243 @source2: 
244
245
246 <!-- ##### FUNCTION gdk_region_union ##### -->
247 <para>
248
249 </para>
250
251 @source1: 
252 @source2: 
253
254
255 <!-- ##### FUNCTION gdk_region_subtract ##### -->
256 <para>
257
258 </para>
259
260 @source1: 
261 @source2: 
262
263
264 <!-- ##### FUNCTION gdk_region_xor ##### -->
265 <para>
266
267 </para>
268
269 @source1: 
270 @source2: 
271
272
273 <!-- ##### STRUCT GdkSpan ##### -->
274 <para>
275
276 </para>
277
278 @x: 
279 @y: 
280 @width: 
281
282 <!-- ##### USER_FUNCTION GdkSpanFunc ##### -->
283 <para>
284
285 </para>
286
287 @span: 
288 @data: 
289
290
291 <!-- ##### FUNCTION gdk_region_spans_intersect_foreach ##### -->
292 <para>
293
294 </para>
295
296 @region: 
297 @spans: 
298 @n_spans: 
299 @sorted: 
300 @function: 
301 @data: 
302
303