diff --git a/docs/reference/gdk/Makefile.am b/docs/reference/gdk/Makefile.am index 1ac562c1b8..764a967e13 100644 --- a/docs/reference/gdk/Makefile.am +++ b/docs/reference/gdk/Makefile.am @@ -28,7 +28,6 @@ IGNORE_HFILES= \ gdkinternals.h \ gdkprivate.h \ gdkpoly-generic.h \ - gdkregion-generic.h \ keyname-table.h \ win32 \ directfb \ diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt index 2e062f2377..89b53bb7c2 100644 --- a/docs/reference/gdk/gdk3-sections.txt +++ b/docs/reference/gdk/gdk3-sections.txt @@ -870,43 +870,6 @@ GdkRectangle gdk_rectangle_intersect gdk_rectangle_union - -GdkRegion -gdk_region_new -gdk_region_polygon -GdkFillRule -gdk_region_copy -gdk_region_rectangle -gdk_region_destroy - - -gdk_region_get_clipbox -gdk_region_get_rectangles -gdk_region_empty -gdk_region_equal -gdk_region_rect_equal -gdk_region_point_in -gdk_region_rect_in -GdkOverlapType - - -gdk_region_offset -gdk_region_shrink -gdk_region_union_with_rect -gdk_region_intersect -gdk_region_union -gdk_region_subtract -gdk_region_xor - - -GdkSpan -GdkSpanFunc -gdk_region_spans_intersect_foreach - - -GDK_TYPE_OVERLAP_TYPE -GDK_TYPE_RECTANGLE - gdk_rectangle_get_type diff --git a/docs/reference/gdk/tmpl/images.sgml b/docs/reference/gdk/tmpl/images.sgml index 5dbb3e1800..469af53011 100644 --- a/docs/reference/gdk/tmpl/images.sgml +++ b/docs/reference/gdk/tmpl/images.sgml @@ -195,6 +195,15 @@ and if that fails then %GDK_IMAGE_NORMAL will be used. @Returns: + + + + + +@image: +@Returns: + + Sets a pixel in a #GdkImage to a given pixel value. diff --git a/docs/reference/gdk/tmpl/regions.sgml b/docs/reference/gdk/tmpl/regions.sgml index 4de1b2b798..5236c54230 100644 --- a/docs/reference/gdk/tmpl/regions.sgml +++ b/docs/reference/gdk/tmpl/regions.sgml @@ -1,13 +1,14 @@ -Points, Rectangles and Regions +Points and Rectangles Simple graphical data types -GDK provides the #GdkPoint, #GdkRectangle, #GdkRegion and #GdkSpan data types -for representing pixels and sets of pixels on the screen. +GDK provides the #GdkPoint and #GdkRectangle data types for representing pixels +and sets of pixels on the screen. Together with Cairo's #cairo_region_t data +type, they make up the central types for representing graphical data. #GdkPoint is a simple structure containing an x and y coordinate of a point. @@ -19,13 +20,7 @@ gdk_rectangle_intersect(). To find the union of two rectangles use gdk_rectangle_union(). -#GdkRegion is an opaque data type holding a set of arbitrary pixels, and is -usually used for clipping graphical operations (see gdk_gc_set_clip_region()). - - -#GdkSpan is a structure holding a spanline. A spanline is a horizontal line that -is one pixel wide. It is mainly used when rasterizing other graphics primitives. -It can be intersected to regions by using gdk_region_spans_intersect_foreach(). +#cairo_region_t is usually used for managing clipping of graphical operations. @@ -75,239 +70,3 @@ Defines the position and size of a rectangle. It is identical to @dest: - - -A GdkRegion represents a set of pixels on the screen. - - - - - - - - -@void: -@Returns: - - - - - - - -@points: -@n_points: -@fill_rule: -@Returns: - - - - -The method for determining which pixels are included in a region, when -creating a #GdkRegion from a polygon. -The fill rule is only relevant for polygons which overlap themselves. - - -@GDK_EVEN_ODD_RULE: areas which are overlapped an odd number of times are -included in the region, while areas overlapped an even number of times are not. -@GDK_WINDING_RULE: overlapping areas are always included. - - - - - - -@region: -@Returns: - - - - - - - -@rectangle: -@Returns: - - - - - - - -@region: - - - - - - - -@region: -@rectangle: - - - - - - - -@region: -@rectangles: -@n_rectangles: - - - - - - - -@region: -@Returns: - - - - - - - -@region1: -@region2: -@Returns: - - - - - - - -@region: -@rectangle: -@Returns: - - - - - - - -@region: -@x: -@y: -@Returns: - - - - - - - -@region: -@rectangle: -@Returns: - - - - -Specifies the possible values returned by gdk_region_rect_in(). - - -@GDK_OVERLAP_RECTANGLE_IN: if the rectangle is inside the #GdkRegion. -@GDK_OVERLAP_RECTANGLE_OUT: if the rectangle is outside the #GdkRegion. -@GDK_OVERLAP_RECTANGLE_PART: if the rectangle is partly inside the #GdkRegion. - - - - - - -@region: -@dx: -@dy: - - - - - - - -@region: -@dx: -@dy: - - - - - - - -@region: -@rect: - - - - - - -@source1: -@source2: - - - - - - - -@source1: -@source2: - - - - - - -@source1: -@source2: - - - - - - -@source1: -@source2: - - - - -A GdkSpan represents a horizontal line of pixels starting -at the pixel with coordinates @x, @y and ending before @x + @width, @y. - - -@x: x coordinate of the first pixel. -@y: y coordinate of the first pixel. -@width: number of pixels in the span. - - - -This defines the type of the function passed to -gdk_region_spans_intersect_foreach(). - - -@span: a #GdkSpan. -@data: the user data passed to gdk_region_spans_intersect_foreach(). - - - - - - - -@region: -@spans: -@n_spans: -@sorted: -@function: -@data: - - diff --git a/docs/reference/gtk/tmpl/gtkbutton.sgml b/docs/reference/gtk/tmpl/gtkbutton.sgml index 13ca4a6e77..9cab72a400 100644 --- a/docs/reference/gtk/tmpl/gtkbutton.sgml +++ b/docs/reference/gtk/tmpl/gtkbutton.sgml @@ -387,3 +387,12 @@ Returns the current relief style of the given #GtkButton. @Returns: + + + + + +@button: +@Returns: + + diff --git a/docs/reference/gtk/tmpl/gtkcalendar.sgml b/docs/reference/gtk/tmpl/gtkcalendar.sgml index c4dbd96638..4c117a6149 100644 --- a/docs/reference/gtk/tmpl/gtkcalendar.sgml +++ b/docs/reference/gtk/tmpl/gtkcalendar.sgml @@ -205,7 +205,6 @@ calendar. @calendar: @month: @year: -@Returns: @@ -222,7 +221,6 @@ calendar. @calendar: @day: -@Returns: @@ -231,7 +229,6 @@ calendar. @calendar: @day: -@Returns: diff --git a/docs/reference/gtk/tmpl/gtkentry.sgml b/docs/reference/gtk/tmpl/gtkentry.sgml index 12825b621e..40cb0a5958 100644 --- a/docs/reference/gtk/tmpl/gtkentry.sgml +++ b/docs/reference/gtk/tmpl/gtkentry.sgml @@ -785,7 +785,6 @@ Specifies the side of the entry at which an icon is placed. @GTK_ENTRY_ICON_PRIMARY: At the beginning of the entry (depending on the text direction). @GTK_ENTRY_ICON_SECONDARY: At the end of the entry (depending on the text direction). - @Since: 2.16 diff --git a/docs/reference/gtk/tmpl/gtkfontseldlg.sgml b/docs/reference/gtk/tmpl/gtkfontseldlg.sgml index 6e98aa7992..625ce4961b 100644 --- a/docs/reference/gtk/tmpl/gtkfontseldlg.sgml +++ b/docs/reference/gtk/tmpl/gtkfontseldlg.sgml @@ -118,3 +118,12 @@ fonts. @Returns: + + + + + +@fsd: +@Returns: + + diff --git a/docs/reference/gtk/tmpl/gtkicontheme.sgml b/docs/reference/gtk/tmpl/gtkicontheme.sgml index 922329952c..07e52dc96f 100644 --- a/docs/reference/gtk/tmpl/gtkicontheme.sgml +++ b/docs/reference/gtk/tmpl/gtkicontheme.sgml @@ -436,6 +436,19 @@ The #GQuark used for #GtkIconThemeError errors. @Returns: + + + + + +@icon_info: +@style: +@state: +@was_symbolic: +@error: +@Returns: + + diff --git a/docs/reference/gtk/tmpl/gtknotebook.sgml b/docs/reference/gtk/tmpl/gtknotebook.sgml index 154a6424cf..b8bd5e3d36 100644 --- a/docs/reference/gtk/tmpl/gtknotebook.sgml +++ b/docs/reference/gtk/tmpl/gtknotebook.sgml @@ -487,17 +487,6 @@ The #GtkNotebookPage is an opaque implementation detail of #GtkNotebook. @Returns: - - - - -@notebook: -@child: -@expand: -@fill: -@pack_type: - - @@ -525,17 +514,6 @@ The #GtkNotebookPage is an opaque implementation detail of #GtkNotebook. @tab_label: - - - - -@notebook: -@child: -@expand: -@fill: -@pack_type: - - diff --git a/docs/reference/gtk/tmpl/gtkprogressbar.sgml b/docs/reference/gtk/tmpl/gtkprogressbar.sgml index 3d4b816134..9139772a8b 100644 --- a/docs/reference/gtk/tmpl/gtkprogressbar.sgml +++ b/docs/reference/gtk/tmpl/gtkprogressbar.sgml @@ -89,6 +89,11 @@ and should be accessed using the functions below. + + + + + @@ -141,15 +146,6 @@ Creates a new #GtkProgressBar. @pbar: - - - - - -@pbar: -@text: - - @@ -159,31 +155,13 @@ Creates a new #GtkProgressBar. @fraction: - + @pbar: -@fraction: - - - - - - - -@pbar: -@orientation: - - - - - - - -@pbar: -@mode: +@Returns: @@ -197,31 +175,13 @@ directions for the visible progress bar. @GTK_PROGRESS_BOTTOM_TO_TOP: A vertical progress bar growing from bottom to top. @GTK_PROGRESS_TOP_TO_BOTTOM: A vertical progress bar growing from top to bottom. - + @pbar: -@Returns: - - - - - - - -@pbar: -@Returns: - - - - - - - -@pbar: -@Returns: +@orientation: @@ -233,6 +193,51 @@ directions for the visible progress bar. @Returns: + + + + + +@pbar: +@show_text: + + + + + + + +@pbar: +@Returns: + + + + + + + +@pbar: +@text: + + + + + + + +@pbar: +@Returns: + + + + + + + +@pbar: +@mode: + + @@ -242,11 +247,21 @@ directions for the visible progress bar. @Returns: - + -An enumeration representing the styles for drawing the progress bar. + -@GTK_PROGRESS_CONTINUOUS: The progress bar grows in a smooth, continuous manner. -@GTK_PROGRESS_DISCRETE: The progress bar grows in discrete, visible blocks. +@pbar: +@fraction: + + + + + + + +@pbar: +@Returns: + diff --git a/docs/reference/gtk/tmpl/gtktable.sgml b/docs/reference/gtk/tmpl/gtktable.sgml index 4a0d7cae74..780713f6b8 100644 --- a/docs/reference/gtk/tmpl/gtktable.sgml +++ b/docs/reference/gtk/tmpl/gtktable.sgml @@ -151,6 +151,16 @@ If you need to change a table's size after it has been crea @columns: The new number of columns. + + + + + +@table: +@rows: +@columns: + + Adds a widget to a table. The number of 'cells' that a widget will occupy is diff --git a/docs/reference/gtk/tmpl/gtkwindowgroup.sgml b/docs/reference/gtk/tmpl/gtkwindowgroup.sgml index 00e8aa08db..71bd142abd 100644 --- a/docs/reference/gtk/tmpl/gtkwindowgroup.sgml +++ b/docs/reference/gtk/tmpl/gtkwindowgroup.sgml @@ -62,6 +62,15 @@ Limit the effect of grabs @Returns: + + + + + +@window_group: +@Returns: + + diff --git a/gdk/Makefile.am b/gdk/Makefile.am index 4073d957e0..9e9378d357 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -92,7 +92,6 @@ gdk_public_h_sources = \ gdkpixmap.h \ gdkprivate.h \ gdkproperty.h \ - gdkregion.h \ gdkrgb.h \ gdkscreen.h \ gdkselection.h \ @@ -112,8 +111,7 @@ gdk_private_headers = \ gdkinternals.h \ gdkdeviceprivate.h \ gdkintl.h \ - gdkpoly-generic.h \ - gdkregion-generic.h + gdkpoly-generic.h gdk_c_sources = \ $(medialib_sources) \ @@ -139,9 +137,7 @@ gdk_c_sources = \ gdkpixbuf-drawable.c \ gdkpixbuf-render.c \ gdkpixmap.c \ - gdkpolyreg-generic.c \ gdkrectangle.c \ - gdkregion-generic.c \ gdkrgb.c \ gdkscreen.c \ gdkselection.c \ diff --git a/gdk/gdk.h b/gdk/gdk.h index 62c2e89c77..bf383e8207 100644 --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols index fcf06c0c52..59f172d7a5 100644 --- a/gdk/gdk.symbols +++ b/gdk/gdk.symbols @@ -258,7 +258,6 @@ gdk_extension_mode_get_type G_GNUC_CONST gdk_event_mask_get_type G_GNUC_CONST gdk_event_type_get_type G_GNUC_CONST gdk_fill_get_type G_GNUC_CONST -gdk_fill_rule_get_type G_GNUC_CONST gdk_filter_return_get_type G_GNUC_CONST gdk_function_get_type G_GNUC_CONST gdk_grab_ownership_get_type G_GNUC_CONST @@ -268,7 +267,6 @@ gdk_join_style_get_type G_GNUC_CONST gdk_line_style_get_type G_GNUC_CONST gdk_modifier_type_get_type G_GNUC_CONST gdk_notify_type_get_type G_GNUC_CONST -gdk_overlap_type_get_type G_GNUC_CONST gdk_owner_change_get_type G_GNUC_CONST gdk_property_state_get_type G_GNUC_CONST gdk_prop_mode_get_type G_GNUC_CONST @@ -975,40 +973,6 @@ gdk_pixmap_lookup_for_display #endif #endif -#if IN_HEADER(__GDK_REGION_H__) -#if IN_FILE(__GDK_REGION_GENERIC_C__) -#ifndef GDK_DISABLE_DEPRECATED -gdk_region_copy -gdk_region_destroy -gdk_region_empty -gdk_region_equal -gdk_region_rect_equal -gdk_region_get_clipbox -gdk_region_get_rectangles -gdk_region_intersect -gdk_region_new -gdk_region_offset -gdk_region_point_in -gdk_region_rectangle -gdk_region_rect_in -gdk_region_shrink -gdk_region_spans_intersect_foreach -gdk_region_subtract -gdk_region_union -gdk_region_union_with_rect -gdk_region_xor -#endif -#endif -#endif - -#if IN_HEADER(__GDK_REGION_H__) -#if IN_FILE(__GDK_POLYREG_GENERIC_C__) -#ifndef GDK_DISABLE_DEPRECATED -gdk_region_polygon -#endif -#endif -#endif - #if IN_HEADER(__GDK_RGB_H__) #if IN_FILE(__GDK_RGB_C__) gdk_rgb_cmap_free diff --git a/gdk/gdkpolyreg-generic.c b/gdk/gdkpolyreg-generic.c deleted file mode 100644 index afcc278286..0000000000 --- a/gdk/gdkpolyreg-generic.c +++ /dev/null @@ -1,602 +0,0 @@ -/* $TOG: PolyReg.c /main/15 1998/02/06 17:47:08 kaleb $ */ -/************************************************************************ - -Copyright 1987, 1998 The Open Group - -All Rights Reserved. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -************************************************************************/ -/* $XFree86: xc/lib/X11/PolyReg.c,v 1.4 1998/10/03 08:41:21 dawes Exp $ */ - -#define LARGE_COORDINATE 1000000 -#define SMALL_COORDINATE -LARGE_COORDINATE - -#include "config.h" -#include -#include "gdkregion-generic.h" -#include "gdkpoly-generic.h" -#include "gdkalias.h" - -/* - * InsertEdgeInET - * - * Insert the given edge into the edge table. - * First we must find the correct bucket in the - * Edge table, then find the right slot in the - * bucket. Finally, we can insert it. - * - */ -static void -InsertEdgeInET (EdgeTable *ET, - EdgeTableEntry *ETE, - int scanline, - ScanLineListBlock **SLLBlock, - int *iSLLBlock) -{ - EdgeTableEntry *start, *prev; - ScanLineList *pSLL, *pPrevSLL; - ScanLineListBlock *tmpSLLBlock; - - /* - * find the right bucket to put the edge into - */ - pPrevSLL = &ET->scanlines; - pSLL = pPrevSLL->next; - while (pSLL && (pSLL->scanline < scanline)) - { - pPrevSLL = pSLL; - pSLL = pSLL->next; - } - - /* - * reassign pSLL (pointer to ScanLineList) if necessary - */ - if ((!pSLL) || (pSLL->scanline > scanline)) - { - if (*iSLLBlock > SLLSPERBLOCK-1) - { - tmpSLLBlock = - (ScanLineListBlock *)g_malloc(sizeof(ScanLineListBlock)); - (*SLLBlock)->next = tmpSLLBlock; - tmpSLLBlock->next = (ScanLineListBlock *)NULL; - *SLLBlock = tmpSLLBlock; - *iSLLBlock = 0; - } - pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]); - - pSLL->next = pPrevSLL->next; - pSLL->edgelist = (EdgeTableEntry *)NULL; - pPrevSLL->next = pSLL; - } - pSLL->scanline = scanline; - - /* - * now insert the edge in the right bucket - */ - prev = (EdgeTableEntry *)NULL; - start = pSLL->edgelist; - while (start && (start->bres.minor_axis < ETE->bres.minor_axis)) - { - prev = start; - start = start->next; - } - ETE->next = start; - - if (prev) - prev->next = ETE; - else - pSLL->edgelist = ETE; -} - -/* - * CreateEdgeTable - * - * This routine creates the edge table for - * scan converting polygons. - * The Edge Table (ET) looks like: - * - * EdgeTable - * -------- - * | ymax | ScanLineLists - * |scanline|-->------------>-------------->... - * -------- |scanline| |scanline| - * |edgelist| |edgelist| - * --------- --------- - * | | - * | | - * V V - * list of ETEs list of ETEs - * - * where ETE is an EdgeTableEntry data structure, - * and there is one ScanLineList per scanline at - * which an edge is initially entered. - * - */ - -static void -CreateETandAET (int count, - const GdkPoint *pts, - EdgeTable *ET, - EdgeTableEntry *AET, - EdgeTableEntry *pETEs, - ScanLineListBlock *pSLLBlock) -{ - const GdkPoint *top, *bottom; - const GdkPoint *PrevPt, *CurrPt; - int iSLLBlock = 0; - int dy; - - if (count < 2) return; - - /* - * initialize the Active Edge Table - */ - AET->next = (EdgeTableEntry *)NULL; - AET->back = (EdgeTableEntry *)NULL; - AET->nextWETE = (EdgeTableEntry *)NULL; - AET->bres.minor_axis = SMALL_COORDINATE; - - /* - * initialize the Edge Table. - */ - ET->scanlines.next = (ScanLineList *)NULL; - ET->ymax = SMALL_COORDINATE; - ET->ymin = LARGE_COORDINATE; - pSLLBlock->next = (ScanLineListBlock *)NULL; - - PrevPt = &pts[count-1]; - - /* - * for each vertex in the array of points. - * In this loop we are dealing with two vertices at - * a time -- these make up one edge of the polygon. - */ - while (count--) - { - CurrPt = pts++; - - /* - * find out which point is above and which is below. - */ - if (PrevPt->y > CurrPt->y) - { - bottom = PrevPt, top = CurrPt; - pETEs->ClockWise = 0; - } - else - { - bottom = CurrPt, top = PrevPt; - pETEs->ClockWise = 1; - } - - /* - * don't add horizontal edges to the Edge table. - */ - if (bottom->y != top->y) - { - pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */ - - /* - * initialize integer edge algorithm - */ - dy = bottom->y - top->y; - BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres); - - InsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock); - - if (PrevPt->y > ET->ymax) - ET->ymax = PrevPt->y; - if (PrevPt->y < ET->ymin) - ET->ymin = PrevPt->y; - pETEs++; - } - - PrevPt = CurrPt; - } -} - -/* - * loadAET - * - * This routine moves EdgeTableEntries from the - * EdgeTable into the Active Edge Table, - * leaving them sorted by smaller x coordinate. - * - */ - -static void -loadAET(EdgeTableEntry *AET, - EdgeTableEntry *ETEs) -{ - EdgeTableEntry *pPrevAET; - EdgeTableEntry *tmp; - - pPrevAET = AET; - AET = AET->next; - while (ETEs) - { - while (AET && (AET->bres.minor_axis < ETEs->bres.minor_axis)) - { - pPrevAET = AET; - AET = AET->next; - } - tmp = ETEs->next; - ETEs->next = AET; - if (AET) - AET->back = ETEs; - ETEs->back = pPrevAET; - pPrevAET->next = ETEs; - pPrevAET = ETEs; - - ETEs = tmp; - } -} - -/* - * computeWAET - * - * This routine links the AET by the - * nextWETE (winding EdgeTableEntry) link for - * use by the winding number rule. The final - * Active Edge Table (AET) might look something - * like: - * - * AET - * ---------- --------- --------- - * |ymax | |ymax | |ymax | - * | ... | |... | |... | - * |next |->|next |->|next |->... - * |nextWETE| |nextWETE| |nextWETE| - * --------- --------- ^-------- - * | | | - * V-------------------> V---> ... - * - */ -static void -computeWAET (EdgeTableEntry *AET) -{ - EdgeTableEntry *pWETE; - int inside = 1; - int isInside = 0; - - AET->nextWETE = (EdgeTableEntry *)NULL; - pWETE = AET; - AET = AET->next; - while (AET) - { - if (AET->ClockWise) - isInside++; - else - isInside--; - - if ((!inside && !isInside) || - ( inside && isInside)) - { - pWETE->nextWETE = AET; - pWETE = AET; - inside = !inside; - } - AET = AET->next; - } - pWETE->nextWETE = (EdgeTableEntry *)NULL; -} - -/* - * InsertionSort - * - * Just a simple insertion sort using - * pointers and back pointers to sort the Active - * Edge Table. - * - */ - -static int -InsertionSort (EdgeTableEntry *AET) -{ - EdgeTableEntry *pETEchase; - EdgeTableEntry *pETEinsert; - EdgeTableEntry *pETEchaseBackTMP; - int changed = 0; - - AET = AET->next; - while (AET) - { - pETEinsert = AET; - pETEchase = AET; - while (pETEchase->back->bres.minor_axis > AET->bres.minor_axis) - pETEchase = pETEchase->back; - - AET = AET->next; - if (pETEchase != pETEinsert) - { - pETEchaseBackTMP = pETEchase->back; - pETEinsert->back->next = AET; - if (AET) - AET->back = pETEinsert->back; - pETEinsert->next = pETEchase; - pETEchase->back->next = pETEinsert; - pETEchase->back = pETEinsert; - pETEinsert->back = pETEchaseBackTMP; - changed = 1; - } - } - return(changed); -} - -/* - * Clean up our act. - */ -static void -FreeStorage (ScanLineListBlock *pSLLBlock) -{ - ScanLineListBlock *tmpSLLBlock; - - while (pSLLBlock) - { - tmpSLLBlock = pSLLBlock->next; - g_free (pSLLBlock); - pSLLBlock = tmpSLLBlock; - } -} - -/* - * Create an array of rectangles from a list of points. - * If indeed these things (POINTS, RECTS) are the same, - * then this proc is still needed, because it allocates - * storage for the array, which was allocated on the - * stack by the calling procedure. - * - */ -static cairo_region_t * -PtsToRegion (int numFullPtBlocks, - int iCurPtBlock, - POINTBLOCK *FirstPtBlock) -{ - GdkRectangle *rects, *allRects; - GdkPoint *pts; - POINTBLOCK *CurPtBlock; - int i; - int numRects; - cairo_region_t *region; - - numRects = ((numFullPtBlocks * NUMPTSTOBUFFER) + iCurPtBlock) >> 1; - - allRects = g_new (GdkRectangle, numRects); - - CurPtBlock = FirstPtBlock; - rects = allRects - 1; - numRects = 0; - - for ( ; numFullPtBlocks >= 0; numFullPtBlocks--) { - /* the loop uses 2 points per iteration */ - i = NUMPTSTOBUFFER >> 1; - if (!numFullPtBlocks) - i = iCurPtBlock >> 1; - for (pts = CurPtBlock->pts; i--; pts += 2) { - if (pts->x == pts[1].x) - continue; - if (numRects && pts->x == rects->x && pts->y == rects->y + rects->height && - pts[1].x == rects->x + rects->width && - (numRects == 1 || rects[-1].y != rects->y) && - (i && pts[2].y > pts[1].y)) { - rects->height = pts[1].y + 1 - rects->y; - continue; - } - numRects++; - rects++; - rects->x = pts->x; rects->y = pts->y; - rects->width = pts[1].x - rects->x; rects->height = pts[1].y + 1 - rects->y; - } - CurPtBlock = CurPtBlock->next; - } - - region = cairo_region_create_rectangles (allRects, numRects); - g_free (allRects); - return region; -} - -/** - * gdk_region_polygon: - * @points: an array of #GdkPoint structs - * @n_points: the number of elements in the @points array - * @fill_rule: specifies which pixels are included in the region when the - * polygon overlaps itself. - * - * Creates a new #GdkRegion using the polygon defined by a - * number of points. - * - * Returns: a new #GdkRegion based on the given polygon - */ -GdkRegion * -gdk_region_polygon (const GdkPoint *points, - gint n_points, - GdkFillRule fill_rule) -{ - GdkRegion *region; - EdgeTableEntry *pAET; /* Active Edge Table */ - int y; /* current scanline */ - int iPts = 0; /* number of pts in buffer */ - EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/ - ScanLineList *pSLL; /* current scanLineList */ - GdkPoint *pts; /* output buffer */ - EdgeTableEntry *pPrevAET; /* ptr to previous AET */ - EdgeTable ET; /* header node for ET */ - EdgeTableEntry AET; /* header node for AET */ - EdgeTableEntry *pETEs; /* EdgeTableEntries pool */ - ScanLineListBlock SLLBlock; /* header for scanlinelist */ - int fixWAET = FALSE; - POINTBLOCK FirstPtBlock, *curPtBlock; /* PtBlock buffers */ - POINTBLOCK *tmpPtBlock; - int numFullPtBlocks = 0; - - /* special case a rectangle */ - if (((n_points == 4) || - ((n_points == 5) && (points[4].x == points[0].x) && (points[4].y == points[0].y))) && - (((points[0].y == points[1].y) && - (points[1].x == points[2].x) && - (points[2].y == points[3].y) && - (points[3].x == points[0].x)) || - ((points[0].x == points[1].x) && - (points[1].y == points[2].y) && - (points[2].x == points[3].x) && - (points[3].y == points[0].y)))) { - GdkRectangle extents; - - extents.x = MIN(points[0].x, points[2].x); - extents.y = MIN(points[0].y, points[2].y); - extents.width = MAX(points[0].x, points[2].x) - extents.x; - extents.height = MAX(points[0].y, points[2].y) - extents.y; - return cairo_region_create_rectangle (&extents); - } - - pETEs = g_new (EdgeTableEntry, n_points); - - pts = FirstPtBlock.pts; - CreateETandAET(n_points, points, &ET, &AET, pETEs, &SLLBlock); - pSLL = ET.scanlines.next; - curPtBlock = &FirstPtBlock; - - if (fill_rule == GDK_EVEN_ODD_RULE) { - /* - * for each scanline - */ - for (y = ET.ymin; y < ET.ymax; y++) { - /* - * Add a new edge to the active edge table when we - * get to the next edge. - */ - if (pSLL != NULL && y == pSLL->scanline) { - loadAET(&AET, pSLL->edgelist); - pSLL = pSLL->next; - } - pPrevAET = &AET; - pAET = AET.next; - - /* - * for each active edge - */ - while (pAET) { - pts->x = pAET->bres.minor_axis, pts->y = y; - pts++, iPts++; - - /* - * send out the buffer - */ - if (iPts == NUMPTSTOBUFFER) { - tmpPtBlock = (POINTBLOCK *)g_malloc(sizeof(POINTBLOCK)); - tmpPtBlock->next = NULL; - curPtBlock->next = tmpPtBlock; - curPtBlock = tmpPtBlock; - pts = curPtBlock->pts; - numFullPtBlocks++; - iPts = 0; - } - EVALUATEEDGEEVENODD(pAET, pPrevAET, y); - } - (void) InsertionSort(&AET); - } - } - else { - /* - * for each scanline - */ - for (y = ET.ymin; y < ET.ymax; y++) { - /* - * Add a new edge to the active edge table when we - * get to the next edge. - */ - if (pSLL != NULL && y == pSLL->scanline) { - loadAET(&AET, pSLL->edgelist); - computeWAET(&AET); - pSLL = pSLL->next; - } - pPrevAET = &AET; - pAET = AET.next; - pWETE = pAET; - - /* - * for each active edge - */ - while (pAET) { - /* - * add to the buffer only those edges that - * are in the Winding active edge table. - */ - if (pWETE == pAET) { - pts->x = pAET->bres.minor_axis, pts->y = y; - pts++, iPts++; - - /* - * send out the buffer - */ - if (iPts == NUMPTSTOBUFFER) { - tmpPtBlock = (POINTBLOCK *)g_malloc(sizeof(POINTBLOCK)); - tmpPtBlock->next = NULL; - curPtBlock->next = tmpPtBlock; - curPtBlock = tmpPtBlock; - pts = curPtBlock->pts; - numFullPtBlocks++; iPts = 0; - } - pWETE = pWETE->nextWETE; - } - EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); - } - - /* - * recompute the winding active edge table if - * we just resorted or have exited an edge. - */ - if (InsertionSort(&AET) || fixWAET) { - computeWAET(&AET); - fixWAET = FALSE; - } - } - } - FreeStorage(SLLBlock.next); - region = PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock); - for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) { - tmpPtBlock = curPtBlock->next; - g_free (curPtBlock); - curPtBlock = tmpPtBlock; - } - g_free (pETEs); - return(region); -} - -#define __GDK_POLYREG_GENERIC_C__ -#include "gdkaliasdef.c" diff --git a/gdk/gdkregion-generic.c b/gdk/gdkregion-generic.c deleted file mode 100644 index 5fe743c0e3..0000000000 --- a/gdk/gdkregion-generic.c +++ /dev/null @@ -1,576 +0,0 @@ -#include "config.h" -#include -#include -#include -#include "gdkalias.h" - -/** - * gdk_region_new: - * - * Creates a new empty #GdkRegion. - * - * Returns: a new empty #GdkRegion - * - * Deprecated: 2.22: Use cairo_region_create() instead. - */ -GdkRegion * -gdk_region_new (void) -{ - return cairo_region_create (); -} - -/** - * gdk_region_rectangle: - * @rectangle: a #GdkRectangle - * - * Creates a new region containing the area @rectangle. - * - * Return value: a new region - * - * Deprecated: 2.22: Use cairo_region_create_rectangle() - **/ -GdkRegion * -gdk_region_rectangle (const GdkRectangle *rectangle) -{ - g_return_val_if_fail (rectangle != NULL, NULL); - - if (rectangle->width <= 0 || rectangle->height <= 0) - return gdk_region_new(); - - return cairo_region_create_rectangle (rectangle); -} - -/** - * gdk_region_copy: - * @region: a #GdkRegion - * - * Copies @region, creating an identical new region. - * - * Return value: a new region identical to @region - * - * Deprecated: 2.22: Use cairo_region_copy() - **/ -GdkRegion * -gdk_region_copy (const GdkRegion *region) -{ - return cairo_region_copy (region); -} - -/** - * gdk_region_get_clipbox: - * @region: a #GdkRegion - * @rectangle: return location for the clipbox - * - * Obtains the smallest rectangle which includes the entire #GdkRegion. - * - * Deprecated: 2.22: Use cairo_region_get_extents() - */ -void -gdk_region_get_clipbox (const GdkRegion *region, - GdkRectangle *rectangle) -{ - g_return_if_fail (region != NULL); - g_return_if_fail (rectangle != NULL); - - cairo_region_get_extents (region, rectangle); -} - - -/** - * gdk_region_get_rectangles: - * @region: a #GdkRegion - * @rectangles: (array length=n_rectangles) (transfer container): return location for an array of rectangles - * @n_rectangles: length of returned array - * - * Obtains the area covered by the region as a list of rectangles. - * The array returned in @rectangles must be freed with g_free(). - * - * Deprecated: 2.22: Use cairo_region_num_rectangles() and cairo_region_get_rectangle() instead. - **/ -void -gdk_region_get_rectangles (const GdkRegion *region, - GdkRectangle **rectangles, - gint *n_rectangles) -{ - gint i, n; - GdkRectangle *rects; - - g_return_if_fail (region != NULL); - g_return_if_fail (rectangles != NULL); - g_return_if_fail (n_rectangles != NULL); - - n = cairo_region_num_rectangles (region); - rects = g_new (GdkRectangle, n); - - for (i = 0; i < n; i++) - { - cairo_region_get_rectangle (region, i, &rects[i]); - } - - *n_rectangles = n; - *rectangles = rects; -} - -/** - * gdk_region_union_with_rect: - * @region: a #GdkRegion. - * @rect: a #GdkRectangle. - * - * Sets the area of @region to the union of the areas of @region and - * @rect. The resulting area is the set of pixels contained in - * either @region or @rect. - * - * Deprecated: 2.22: Use cairo_region_union_rectangle() instead. - **/ -void -gdk_region_union_with_rect (GdkRegion *region, - const GdkRectangle *rect) -{ - g_return_if_fail (region != NULL); - g_return_if_fail (rect != NULL); - - if (rect->width <= 0 || rect->height <= 0) - return; - - cairo_region_union_rectangle (region, rect); -} - -/** - * gdk_region_destroy: - * @region: a #GdkRegion - * - * Destroys a #GdkRegion. - * - * Deprecated: 2.22: Use cairo_region_destroy() instead. - */ -void -gdk_region_destroy (GdkRegion *region) -{ - g_return_if_fail (region != NULL); - - cairo_region_destroy (region); -} - - -/** - * gdk_region_offset: - * @region: a #GdkRegion - * @dx: the distance to move the region horizontally - * @dy: the distance to move the region vertically - * - * Moves a region the specified distance. - * - * Deprecated: 2.22: Use cairo_region_translate() instead. - */ -void -gdk_region_offset (GdkRegion *region, - gint x, - gint y) -{ - cairo_region_translate (region, x, y); -} - -/** - * gdk_region_shrink: - * @region: a #GdkRegion - * @dx: the number of pixels to shrink the region horizontally - * @dy: the number of pixels to shrink the region vertically - * - * Resizes a region by the specified amount. - * Positive values shrink the region. Negative values expand it. - * - * Deprecated: 2.22: There is no replacement for this function. - */ -void -gdk_region_shrink (GdkRegion *region, - int dx, - int dy) -{ - GdkRectangle *rects; - int i, n_rects; - - gdk_region_get_rectangles (region, &rects, &n_rects); - /* clear region */ - gdk_region_subtract (region, region); - - for (i = 0; i < n_rects; i++) - { - if (rects[i].width <= 2 * dx || - rects[i].height <= 2 * dy) - continue; - - rects[i].x += dx; - rects[i].y += dy; - rects[i].width -= 2 * dx; - rects[i].height -= 2 * dy; - cairo_region_union_rectangle (region, &rects[i]); - } -} - -/** - * gdk_region_intersect: - * @source1: a #GdkRegion - * @source2: another #GdkRegion - * - * Sets the area of @source1 to the intersection of the areas of @source1 - * and @source2. The resulting area is the set of pixels contained in - * both @source1 and @source2. - * - * Deprecated: 2.22: Use cairo_region_intersect() instead. - **/ -void -gdk_region_intersect (GdkRegion *source1, - const GdkRegion *source2) -{ - g_return_if_fail (source1 != NULL); - g_return_if_fail (source2 != NULL); - - cairo_region_intersect (source1, (cairo_region_t *) source2); -} - -/** - * gdk_region_union: - * @source1: a #GdkRegion - * @source2: a #GdkRegion - * - * Sets the area of @source1 to the union of the areas of @source1 and - * @source2. The resulting area is the set of pixels contained in - * either @source1 or @source2. - * - * Deprecated: 2.22: Use cairo_region_union() instead. - **/ -void -gdk_region_union (GdkRegion *source1, - const GdkRegion *source2) -{ - g_return_if_fail (source1 != NULL); - g_return_if_fail (source2 != NULL); - - cairo_region_union (source1, (cairo_region_t *) source2); -} - -/** - * gdk_region_subtract: - * @source1: a #GdkRegion - * @source2: another #GdkRegion - * - * Subtracts the area of @source2 from the area @source1. The resulting - * area is the set of pixels contained in @source1 but not in @source2. - * - * Deprecated: 2.22: Use cairo_region_subtract() instead. - **/ -void -gdk_region_subtract (GdkRegion *source1, - const GdkRegion *source2) -{ - g_return_if_fail (source1 != NULL); - g_return_if_fail (source2 != NULL); - - cairo_region_subtract (source1, source2); -} - -/** - * gdk_region_xor: - * @source1: a #GdkRegion - * @source2: another #GdkRegion - * - * Sets the area of @source1 to the exclusive-OR of the areas of @source1 - * and @source2. The resulting area is the set of pixels contained in one - * or the other of the two sources but not in both. - * - * Deprecated: 2.22: There is no replacement, but the function can be - * reimplemented using cairo_region_intersect() and - * cairo_region_subract() easily. - **/ -void -gdk_region_xor (GdkRegion *source1, - const GdkRegion *source2) -{ - GdkRegion *trb; - - g_return_if_fail (source1 != NULL); - g_return_if_fail (source2 != NULL); - - trb = gdk_region_copy (source2); - - gdk_region_subtract (trb, source1); - gdk_region_subtract (source1, source2); - - gdk_region_union (source1, trb); - - gdk_region_destroy (trb); -} - -/** - * gdk_region_empty: - * @region: a #GdkRegion - * - * Finds out if the #GdkRegion is empty. - * - * Returns: %TRUE if @region is empty. - * - * Deprecated: 2.22: Use cairo_region_is_empty() instead. - */ -gboolean -gdk_region_empty (const GdkRegion *region) -{ - g_return_val_if_fail (region != NULL, FALSE); - - return cairo_region_is_empty (region); -} - -/** - * gdk_region_equal: - * @region1: a #GdkRegion - * @region2: a #GdkRegion - * - * Finds out if the two regions are the same. - * - * Returns: %TRUE if @region1 and @region2 are equal. - * - * Deprecated: 2.22: Use cairo_region_equal() instead. - */ -gboolean -gdk_region_equal (const GdkRegion *region1, - const GdkRegion *region2) -{ - g_return_val_if_fail (region1 != NULL, FALSE); - g_return_val_if_fail (region2 != NULL, FALSE); - - return cairo_region_equal (region1, region2); -} - -/** - * gdk_region_rect_equal: - * @region: a #GdkRegion - * @rectangle: a #GdkRectangle - * - * Finds out if a regions is the same as a rectangle. - * - * Returns: %TRUE if @region and @rectangle are equal. - * - * Since: 2.18 - */ -gboolean -gdk_region_rect_equal (const GdkRegion *region, - const GdkRectangle *rectangle) -{ - cairo_rectangle_int_t extents; - - g_return_val_if_fail (region != NULL, FALSE); - g_return_val_if_fail (rectangle != NULL, FALSE); - - if (cairo_region_num_rectangles (region) != 1) return FALSE; - cairo_region_get_extents (region, &extents); - if (extents.x != rectangle->x) return FALSE; - else if (extents.y != rectangle->y) return FALSE; - else if (extents.width != rectangle->width) return FALSE; - else if (extents.height != rectangle->height) return FALSE; - return TRUE; -} - -/** - * gdk_region_point_in: - * @region: a #GdkRegion - * @x: the x coordinate of a point - * @y: the y coordinate of a point - * - * Finds out if a point is in a region. - * - * Returns: %TRUE if the point is in @region. - * - * Deprecated: 2.22: Use cairo_region_contains_point() instead. - */ -gboolean -gdk_region_point_in (const GdkRegion *region, - int x, - int y) -{ - g_return_val_if_fail (region != NULL, FALSE); - - return cairo_region_contains_point (region, x, y); -} - -/** - * gdk_region_rect_in: - * @region: a #GdkRegion. - * @rectangle: a #GdkRectangle. - * - * Tests whether a rectangle is within a region. - * - * Returns: %GDK_OVERLAP_RECTANGLE_IN, %GDK_OVERLAP_RECTANGLE_OUT, or - * %GDK_OVERLAP_RECTANGLE_PART, depending on whether the rectangle is inside, - * outside, or partly inside the #GdkRegion, respectively. - * - * Deprecated: 2.22: Use cairo_region_contains_rectangle() instead. - */ -GdkOverlapType -gdk_region_rect_in (const GdkRegion *region, - const GdkRectangle *rectangle) -{ - g_return_val_if_fail (region != NULL, GDK_OVERLAP_RECTANGLE_OUT); - g_return_val_if_fail (rectangle != NULL, GDK_OVERLAP_RECTANGLE_OUT); - - return cairo_region_contains_rectangle (region, rectangle); -} - - -static void -gdk_region_unsorted_spans_intersect_foreach (GdkRegion *region, - const GdkSpan *spans, - int n_spans, - GdkSpanFunc function, - gpointer data) -{ - gint i, j, left, right, y, n_rects; - gint clipped_left, clipped_right; - cairo_rectangle_int_t pbox, extents; - - n_rects = cairo_region_num_rectangles (region); - if (!n_rects) - return; - - cairo_region_get_extents (region, &extents); - for (i=0;i y) && - (extents.x < right) && - (extents.x + extents.width > left)) ) - continue; - - /* can stop when we passed y */ - for (j = 0; j < n_rects; j++) - { - cairo_region_get_rectangle (region, j, &pbox); - - if (pbox.y + pbox.height <= y) - continue; /* Not quite there yet */ - - if (pbox.y > y) - break; /* passed the spanline */ - - if ((right > pbox.x) && (left < pbox.x + pbox.width)) - { - GdkSpan out_span; - - clipped_left = MAX (left, pbox.x); - clipped_right = MIN (right, pbox.x + pbox.width); - - out_span.y = y; - out_span.x = clipped_left; - out_span.width = clipped_right - clipped_left; - (*function) (&out_span, data); - } - } - } -} - -/** - * gdk_region_spans_intersect_foreach: - * @region: a #GdkRegion - * @spans: an array of #GdkSpans - * @n_spans: the length of @spans - * @sorted: %TRUE if @spans is sorted wrt. the y coordinate - * @function: function to call on each span in the intersection - * @data: data to pass to @function - * - * Calls a function on each span in the intersection of @region and @spans. - * - * Deprecated: 2.22: There is no replacement. - */ -void -gdk_region_spans_intersect_foreach (GdkRegion *region, - const GdkSpan *spans, - int n_spans, - gboolean sorted, - GdkSpanFunc function, - gpointer data) -{ - gint i, left, right, y, n_rects; - gint clipped_left, clipped_right; - GdkRectangle pbox; - const GdkSpan *span, *tmpspan; - const GdkSpan *end_span; - - g_return_if_fail (region != NULL); - g_return_if_fail (spans != NULL); - - if (!sorted) - { - gdk_region_unsorted_spans_intersect_foreach (region, - spans, - n_spans, - function, - data); - return; - } - - n_rects = cairo_region_num_rectangles (region); - if (n_rects == 0 || n_spans == 0) - return; - - /* The main method here is to step along the - * sorted rectangles and spans in lock step, and - * clipping the spans that are in the current - * rectangle before going on to the next rectangle. - */ - - span = spans; - end_span = spans + n_spans; - for (i = 0; i < n_rects; i++) - { - cairo_region_get_rectangle (region, i, &pbox); - - while ((pbox.y + pbox.height < span->y) || (span->y < pbox.y)) - { - /* Skip any rectangles that are above the current span */ - if (pbox.y + pbox.height < span->y) - { - i++; - if (i == n_rects) - return; - cairo_region_get_rectangle (region, i, &pbox); - } - /* Skip any spans that are above the current rectangle */ - if (span->y < pbox.y) - { - span++; - if (span == end_span) - return; - } - } - - /* Ok, we got at least one span that might intersect this rectangle. */ - tmpspan = span; - while ((tmpspan < end_span) && - (tmpspan->y < pbox.y + pbox.height)) - { - y = tmpspan->y; - left = tmpspan->x; - right = left + tmpspan->width; /* right is not in the span! */ - - if ((right > pbox.x) && (left < pbox.x + pbox.width)) - { - GdkSpan out_span; - - clipped_left = MAX (left, pbox.x); - clipped_right = MIN (right, pbox.x + pbox.width); - - out_span.y = y; - out_span.x = clipped_left; - out_span.width = clipped_right - clipped_left; - (*function) (&out_span, data); - } - - tmpspan++; - } - } -} - -#define __GDK_REGION_GENERIC_C__ -#include "gdkaliasdef.c" diff --git a/gdk/gdkregion-generic.h b/gdk/gdkregion-generic.h deleted file mode 100644 index 9f510621e7..0000000000 --- a/gdk/gdkregion-generic.h +++ /dev/null @@ -1,177 +0,0 @@ -/* $TOG: region.h /main/9 1998/02/06 17:50:30 kaleb $ */ -/************************************************************************ - -Copyright 1987, 1998 The Open Group - -All Rights Reserved. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -************************************************************************/ - -#ifndef __GDK_REGION_GENERIC_H__ -#define __GDK_REGION_GENERIC_H__ - -typedef GdkSegment GdkRegionBox; - -/* - * clip region - */ - -struct _GdkRegion -{ - long size; - long numRects; - GdkRegionBox *rects; - GdkRegionBox extents; -}; - -/* 1 if two BOXs overlap. - * 0 if two BOXs do not overlap. - * Remember, x2 and y2 are not in the region - */ -#define EXTENTCHECK(r1, r2) \ - ((r1)->x2 > (r2)->x1 && \ - (r1)->x1 < (r2)->x2 && \ - (r1)->y2 > (r2)->y1 && \ - (r1)->y1 < (r2)->y2) - -/* - * update region extents - */ -#define EXTENTS(r,idRect){\ - if((r)->x1 < (idRect)->extents.x1)\ - (idRect)->extents.x1 = (r)->x1;\ - if((r)->y1 < (idRect)->extents.y1)\ - (idRect)->extents.y1 = (r)->y1;\ - if((r)->x2 > (idRect)->extents.x2)\ - (idRect)->extents.x2 = (r)->x2;\ - if((r)->y2 > (idRect)->extents.y2)\ - (idRect)->extents.y2 = (r)->y2;\ - } - -#define GROWREGION(reg, nRects) { \ - if ((nRects) == 0) { \ - if ((reg)->rects != &(reg)->extents) { \ - g_free ((reg)->rects); \ - (reg)->rects = &(reg)->extents; \ - } \ - } \ - else if ((reg)->rects == &(reg)->extents) { \ - (reg)->rects = g_new (GdkRegionBox, (nRects)); \ - (reg)->rects[0] = (reg)->extents; \ - } \ - else \ - (reg)->rects = g_renew (GdkRegionBox, (reg)->rects, (nRects)); \ - (reg)->size = (nRects); \ - } - -/* - * Check to see if there is enough memory in the present region. - */ -#define MEMCHECK(reg, rect, firstrect){ \ - if ((reg)->numRects >= ((reg)->size - 1)) { \ - GROWREGION(reg,2*(reg)->size); \ - (rect) = &(firstrect)[(reg)->numRects]; \ - } \ - } - -/* this routine checks to see if the previous rectangle is the same - * or subsumes the new rectangle to add. - */ - -#define CHECK_PREVIOUS(Reg, R, Rx1, Ry1, Rx2, Ry2)\ - (!(((Reg)->numRects > 0)&&\ - ((R-1)->y1 == (Ry1)) &&\ - ((R-1)->y2 == (Ry2)) &&\ - ((R-1)->x1 <= (Rx1)) &&\ - ((R-1)->x2 >= (Rx2)))) - -/* add a rectangle to the given Region */ -#define ADDRECT(reg, r, rx1, ry1, rx2, ry2){\ - if (((rx1) < (rx2)) && ((ry1) < (ry2)) &&\ - CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\ - (r)->x1 = (rx1);\ - (r)->y1 = (ry1);\ - (r)->x2 = (rx2);\ - (r)->y2 = (ry2);\ - EXTENTS((r), (reg));\ - (reg)->numRects++;\ - (r)++;\ - }\ - } - - - -/* add a rectangle to the given Region */ -#define ADDRECTNOX(reg, r, rx1, ry1, rx2, ry2){\ - if ((rx1 < rx2) && (ry1 < ry2) &&\ - CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\ - (r)->x1 = (rx1);\ - (r)->y1 = (ry1);\ - (r)->x2 = (rx2);\ - (r)->y2 = (ry2);\ - (reg)->numRects++;\ - (r)++;\ - }\ - } - -#define EMPTY_REGION(pReg) pReg->numRects = 0 - -#define REGION_NOT_EMPTY(pReg) pReg->numRects - -#define INBOX(r, x, y) \ - ( ( ((r).x2 > x)) && \ - ( ((r).x1 <= x)) && \ - ( ((r).y2 > y)) && \ - ( ((r).y1 <= y)) ) - -/* - * number of points to buffer before sending them off - * to scanlines() : Must be an even number - */ -#define NUMPTSTOBUFFER 200 - -/* - * used to allocate buffers for points and link - * the buffers together - */ -typedef struct _POINTBLOCK { - GdkPoint pts[NUMPTSTOBUFFER]; - struct _POINTBLOCK *next; -} POINTBLOCK; - -#endif /* __GDK_REGION_GENERIC_H__ */ diff --git a/gdk/gdkregion.h b/gdk/gdkregion.h deleted file mode 100644 index b1996eef56..0000000000 --- a/gdk/gdkregion.h +++ /dev/null @@ -1,124 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * 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 - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __GDK_REGION_H__ -#define __GDK_REGION_H__ - -#include - -G_BEGIN_DECLS - -/* GC fill rule for polygons - * EvenOddRule - * WindingRule - */ -typedef enum -{ - GDK_EVEN_ODD_RULE, - GDK_WINDING_RULE -} GdkFillRule; - -#ifndef GDK_DISABLE_DEPRECATED -/* 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 - * - * Deprecated: 2.22: Superceded by #cairo_region_overlap_t and - * cairo_region_contains_rectangle(). - */ -typedef enum -{ - GDK_OVERLAP_RECTANGLE_IN, - GDK_OVERLAP_RECTANGLE_OUT, - GDK_OVERLAP_RECTANGLE_PART -} GdkOverlapType; - -typedef void (* GdkSpanFunc) (GdkSpan *span, - gpointer data); - -GdkRegion * gdk_region_new (void); -#endif -cairo_region_t * gdk_region_polygon (const GdkPoint *points, - gint n_points, - GdkFillRule fill_rule); -#ifndef GDK_DISABLE_DEPRECATED -GdkRegion * gdk_region_copy (const GdkRegion *region); -GdkRegion * gdk_region_rectangle (const GdkRectangle *rectangle); -void gdk_region_destroy (GdkRegion *region); - -void gdk_region_get_clipbox (const GdkRegion *region, - GdkRectangle *rectangle); -void gdk_region_get_rectangles (const GdkRegion *region, - GdkRectangle **rectangles, - gint *n_rectangles); - -gboolean gdk_region_empty (const GdkRegion *region); -gboolean gdk_region_equal (const GdkRegion *region1, - const GdkRegion *region2); -#endif -gboolean gdk_region_rect_equal (const cairo_region_t *region, - const GdkRectangle *rectangle); -#ifndef GDK_DISABLE_DEPRECATED -gboolean gdk_region_point_in (const GdkRegion *region, - int x, - int y); -GdkOverlapType gdk_region_rect_in (const GdkRegion *region, - const GdkRectangle *rectangle); - -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); - -void gdk_region_spans_intersect_foreach (GdkRegion *region, - const GdkSpan *spans, - int n_spans, - gboolean sorted, - GdkSpanFunc function, - gpointer data); -#endif - -G_END_DECLS - -#endif /* __GDK_REGION_H__ */ - diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index 5ce626f8b2..16a4f91f84 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -105,9 +105,6 @@ typedef struct _GdkColormap GdkColormap; typedef struct _GdkCursor GdkCursor; typedef struct _GdkGC GdkGC; typedef struct _GdkImage GdkImage; -#ifndef GDK_DISABLE_DEPRECATED -typedef cairo_region_t GdkRegion; -#endif typedef struct _GdkVisual GdkVisual; typedef struct _GdkDrawable GdkDrawable; @@ -274,16 +271,6 @@ struct _GdkPoint gint y; }; -#ifndef GDK_DISABLE_DEPRECATED -struct _GdkRectangle -{ - gint x; - gint y; - gint width; - gint height; -}; -#endif - struct _GdkSegment { gint x1; diff --git a/gdk/makefile.msc b/gdk/makefile.msc index 73b181f681..a2f4be614f 100644 --- a/gdk/makefile.msc +++ b/gdk/makefile.msc @@ -88,9 +88,7 @@ gdk_OBJECTS = \ gdkpixbuf-drawable.obj \ gdkpixbuf-render.obj \ gdkpixmap.obj \ - gdkpolyreg-generic.obj \ gdkrectangle.obj \ - gdkregion-generic.obj \ gdkrgb.obj \ gdkscreen.obj \ gdkselection.obj \ @@ -113,7 +111,6 @@ gdk_public_h_sources = \ gdkpixbuf.h \ gdkpixmap.h \ gdkproperty.h \ - gdkregion.h \ gdkrgb.h \ gdkselection.h \ gdktypes.h \