2008-07-01 22:57:50 +00:00
|
|
|
/* GDK - The GIMP Drawing Kit
|
2005-07-12 05:09:13 +00:00
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
2008-05-28 14:01:57 +00:00
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
2005-07-12 05:09:13 +00:00
|
|
|
*/
|
|
|
|
|
2008-05-28 14:01:57 +00:00
|
|
|
#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
|
|
|
#error "Only <gdk/gdk.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
1999-10-01 23:18:30 +00:00
|
|
|
#ifndef __GDK_REGION_H__
|
|
|
|
#define __GDK_REGION_H__
|
|
|
|
|
|
|
|
#include <gdk/gdktypes.h>
|
|
|
|
|
2005-06-12 05:32:25 +00:00
|
|
|
G_BEGIN_DECLS
|
1999-10-01 23:18:30 +00:00
|
|
|
|
|
|
|
/* GC fill rule for polygons
|
|
|
|
* EvenOddRule
|
|
|
|
* WindingRule
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GDK_EVEN_ODD_RULE,
|
|
|
|
GDK_WINDING_RULE
|
|
|
|
} GdkFillRule;
|
|
|
|
|
|
|
|
/* Types of overlapping between a rectangle and a region
|
|
|
|
* GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
|
|
|
|
* GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
|
|
|
|
* GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GDK_OVERLAP_RECTANGLE_IN,
|
|
|
|
GDK_OVERLAP_RECTANGLE_OUT,
|
|
|
|
GDK_OVERLAP_RECTANGLE_PART
|
|
|
|
} GdkOverlapType;
|
|
|
|
|
2008-01-14 14:02:12 +00:00
|
|
|
typedef void (* GdkSpanFunc) (GdkSpan *span,
|
|
|
|
gpointer data);
|
2000-11-22 10:07:34 +00:00
|
|
|
|
2008-01-14 14:02:12 +00:00
|
|
|
GdkRegion * gdk_region_new (void);
|
|
|
|
GdkRegion * gdk_region_polygon (const GdkPoint *points,
|
|
|
|
gint n_points,
|
|
|
|
GdkFillRule fill_rule);
|
|
|
|
GdkRegion * gdk_region_copy (const GdkRegion *region);
|
|
|
|
GdkRegion * gdk_region_rectangle (const GdkRectangle *rectangle);
|
|
|
|
void gdk_region_destroy (GdkRegion *region);
|
1999-10-01 23:18:30 +00:00
|
|
|
|
2008-01-14 14:02:12 +00:00
|
|
|
void gdk_region_get_clipbox (const GdkRegion *region,
|
|
|
|
GdkRectangle *rectangle);
|
|
|
|
void gdk_region_get_rectangles (const GdkRegion *region,
|
|
|
|
GdkRectangle **rectangles,
|
|
|
|
gint *n_rectangles);
|
1999-10-01 23:18:30 +00:00
|
|
|
|
2008-01-14 14:02:12 +00:00
|
|
|
gboolean gdk_region_empty (const GdkRegion *region);
|
|
|
|
gboolean gdk_region_equal (const GdkRegion *region1,
|
|
|
|
const GdkRegion *region2);
|
2009-07-03 19:35:41 +00:00
|
|
|
gboolean gdk_region_rect_equal (const GdkRegion *region,
|
2009-05-26 18:48:10 +00:00
|
|
|
const GdkRectangle *rectangle);
|
2008-01-14 14:02:12 +00:00
|
|
|
gboolean gdk_region_point_in (const GdkRegion *region,
|
|
|
|
int x,
|
|
|
|
int y);
|
|
|
|
GdkOverlapType gdk_region_rect_in (const GdkRegion *region,
|
|
|
|
const GdkRectangle *rectangle);
|
1999-10-01 23:18:30 +00:00
|
|
|
|
2008-01-14 14:02:12 +00:00
|
|
|
void gdk_region_offset (GdkRegion *region,
|
|
|
|
gint dx,
|
|
|
|
gint dy);
|
|
|
|
void gdk_region_shrink (GdkRegion *region,
|
|
|
|
gint dx,
|
|
|
|
gint dy);
|
|
|
|
void gdk_region_union_with_rect (GdkRegion *region,
|
|
|
|
const GdkRectangle *rect);
|
|
|
|
void gdk_region_intersect (GdkRegion *source1,
|
|
|
|
const GdkRegion *source2);
|
|
|
|
void gdk_region_union (GdkRegion *source1,
|
|
|
|
const GdkRegion *source2);
|
|
|
|
void gdk_region_subtract (GdkRegion *source1,
|
|
|
|
const GdkRegion *source2);
|
|
|
|
void gdk_region_xor (GdkRegion *source1,
|
|
|
|
const GdkRegion *source2);
|
1999-10-01 23:18:30 +00:00
|
|
|
|
2008-01-14 14:02:12 +00:00
|
|
|
void gdk_region_spans_intersect_foreach (GdkRegion *region,
|
2008-01-15 15:32:37 +00:00
|
|
|
const GdkSpan *spans,
|
2008-01-14 14:02:12 +00:00
|
|
|
int n_spans,
|
|
|
|
gboolean sorted,
|
|
|
|
GdkSpanFunc function,
|
|
|
|
gpointer data);
|
2000-11-22 10:07:34 +00:00
|
|
|
|
2005-06-12 05:32:25 +00:00
|
|
|
G_END_DECLS
|
1999-10-01 23:18:30 +00:00
|
|
|
|
|
|
|
#endif /* __GDK_REGION_H__ */
|
2000-11-22 10:07:34 +00:00
|
|
|
|