1/* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 */
19
20/*
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25 */
26
27#ifndef __GDK_REGION_H__
28#define __GDK_REGION_H__
29
30#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
31#error "Only <gdk/gdk.h> can be included directly."
32#endif
33
34#include <gdk/gdktypes.h>
35
36G_BEGIN_DECLS
37
38#ifndef GDK_DISABLE_DEPRECATED
39/* GC fill rule for polygons
40 * EvenOddRule
41 * WindingRule
42 */
43typedef enum
44{
45 GDK_EVEN_ODD_RULE,
46 GDK_WINDING_RULE
47} GdkFillRule;
48#endif
49
50/* Types of overlapping between a rectangle and a region
51 * GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
52 * GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
53 * GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
54 */
55typedef enum
56{
57 GDK_OVERLAP_RECTANGLE_IN,
58 GDK_OVERLAP_RECTANGLE_OUT,
59 GDK_OVERLAP_RECTANGLE_PART
60} GdkOverlapType;
61
62#ifndef GDK_DISABLE_DEPRECATED
63typedef void (* GdkSpanFunc) (GdkSpan *span,
64 gpointer data);
65#endif
66
67GdkRegion * gdk_region_new (void);
68#ifndef GDK_DISABLE_DEPRECATED
69GdkRegion * gdk_region_polygon (const GdkPoint *points,
70 gint n_points,
71 GdkFillRule fill_rule);
72#endif
73GdkRegion * gdk_region_copy (const GdkRegion *region);
74GdkRegion * gdk_region_rectangle (const GdkRectangle *rectangle);
75void gdk_region_destroy (GdkRegion *region);
76
77void gdk_region_get_clipbox (const GdkRegion *region,
78 GdkRectangle *rectangle);
79void gdk_region_get_rectangles (const GdkRegion *region,
80 GdkRectangle **rectangles,
81 gint *n_rectangles);
82
83gboolean gdk_region_empty (const GdkRegion *region);
84gboolean gdk_region_equal (const GdkRegion *region1,
85 const GdkRegion *region2);
86#ifndef GDK_DISABLE_DEPRECATED
87gboolean gdk_region_rect_equal (const GdkRegion *region,
88 const GdkRectangle *rectangle);
89#endif
90gboolean gdk_region_point_in (const GdkRegion *region,
91 int x,
92 int y);
93GdkOverlapType gdk_region_rect_in (const GdkRegion *region,
94 const GdkRectangle *rectangle);
95
96void gdk_region_offset (GdkRegion *region,
97 gint dx,
98 gint dy);
99#ifndef GDK_DISABLE_DEPRECATED
100void gdk_region_shrink (GdkRegion *region,
101 gint dx,
102 gint dy);
103#endif
104void gdk_region_union_with_rect (GdkRegion *region,
105 const GdkRectangle *rect);
106void gdk_region_intersect (GdkRegion *source1,
107 const GdkRegion *source2);
108void gdk_region_union (GdkRegion *source1,
109 const GdkRegion *source2);
110void gdk_region_subtract (GdkRegion *source1,
111 const GdkRegion *source2);
112void gdk_region_xor (GdkRegion *source1,
113 const GdkRegion *source2);
114
115#ifndef GDK_DISABLE_DEPRECATED
116void gdk_region_spans_intersect_foreach (GdkRegion *region,
117 const GdkSpan *spans,
118 int n_spans,
119 gboolean sorted,
120 GdkSpanFunc function,
121 gpointer data);
122#endif
123
124G_END_DECLS
125
126#endif /* __GDK_REGION_H__ */
127
128