1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
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.
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/.
27 #ifndef __GDK_REGION_H__
28 #define __GDK_REGION_H__
30 #include <gdk/gdktypes.h>
34 /* GC fill rule for polygons
44 /* Types of overlapping between a rectangle and a region
45 * GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
46 * GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
47 * GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
51 GDK_OVERLAP_RECTANGLE_IN,
52 GDK_OVERLAP_RECTANGLE_OUT,
53 GDK_OVERLAP_RECTANGLE_PART
56 typedef void (*GdkSpanFunc) (GdkSpan *span,
59 GdkRegion *gdk_region_new (void);
60 GdkRegion *gdk_region_polygon (GdkPoint *points,
62 GdkFillRule fill_rule);
63 GdkRegion *gdk_region_copy (GdkRegion *region);
64 GdkRegion *gdk_region_rectangle (GdkRectangle *rectangle);
65 void gdk_region_destroy (GdkRegion *region);
67 void gdk_region_get_clipbox (GdkRegion *region,
68 GdkRectangle *rectangle);
69 void gdk_region_get_rectangles (GdkRegion *region,
70 GdkRectangle **rectangles,
73 gboolean gdk_region_empty (GdkRegion *region);
74 gboolean gdk_region_equal (GdkRegion *region1,
76 gboolean gdk_region_point_in (GdkRegion *region,
79 GdkOverlapType gdk_region_rect_in (GdkRegion *region,
80 GdkRectangle *rectangle);
82 void gdk_region_offset (GdkRegion *region,
85 void gdk_region_shrink (GdkRegion *region,
88 void gdk_region_union_with_rect (GdkRegion *region,
90 void gdk_region_intersect (GdkRegion *source1,
92 void gdk_region_union (GdkRegion *source1,
94 void gdk_region_subtract (GdkRegion *source1,
96 void gdk_region_xor (GdkRegion *source1,
99 void gdk_region_spans_intersect_foreach (GdkRegion *region,
103 GdkSpanFunc function,
108 #endif /* __GDK_REGION_H__ */