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 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
28 #error "Only <gdk/gdk.h> can be included directly."
31 #ifndef __GDK_REGION_H__
32 #define __GDK_REGION_H__
34 #include <gdk/gdktypes.h>
38 /* GC fill rule for polygons
48 /* Types of overlapping between a rectangle and a region
49 * GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
50 * GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
51 * GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
55 GDK_OVERLAP_RECTANGLE_IN,
56 GDK_OVERLAP_RECTANGLE_OUT,
57 GDK_OVERLAP_RECTANGLE_PART
60 typedef void (* GdkSpanFunc) (GdkSpan *span,
63 GdkRegion * gdk_region_new (void);
64 GdkRegion * gdk_region_polygon (const GdkPoint *points,
66 GdkFillRule fill_rule);
67 GdkRegion * gdk_region_copy (const GdkRegion *region);
68 GdkRegion * gdk_region_rectangle (const GdkRectangle *rectangle);
69 void gdk_region_destroy (GdkRegion *region);
71 void gdk_region_get_clipbox (const GdkRegion *region,
72 GdkRectangle *rectangle);
73 void gdk_region_get_rectangles (const GdkRegion *region,
74 GdkRectangle **rectangles,
77 gboolean gdk_region_empty (const GdkRegion *region);
78 gboolean gdk_region_equal (const GdkRegion *region1,
79 const GdkRegion *region2);
80 gboolean gdk_region_rect_equal (const GdkRegion *region,
81 const GdkRectangle *rectangle);
82 gboolean gdk_region_point_in (const GdkRegion *region,
85 GdkOverlapType gdk_region_rect_in (const GdkRegion *region,
86 const GdkRectangle *rectangle);
88 void gdk_region_offset (GdkRegion *region,
91 void gdk_region_shrink (GdkRegion *region,
94 void gdk_region_union_with_rect (GdkRegion *region,
95 const GdkRectangle *rect);
96 void gdk_region_intersect (GdkRegion *source1,
97 const GdkRegion *source2);
98 void gdk_region_union (GdkRegion *source1,
99 const GdkRegion *source2);
100 void gdk_region_subtract (GdkRegion *source1,
101 const GdkRegion *source2);
102 void gdk_region_xor (GdkRegion *source1,
103 const GdkRegion *source2);
105 void gdk_region_spans_intersect_foreach (GdkRegion *region,
106 const GdkSpan *spans,
109 GdkSpanFunc function,
114 #endif /* __GDK_REGION_H__ */