diff options
author | Michael Natterer <mitch@imendio.com> | 2008-01-14 14:02:12 +0000 |
---|---|---|
committer | Michael Natterer <mitch@src.gnome.org> | 2008-01-14 14:02:12 +0000 |
commit | 92f86e049670c1696f135b32ca9b0a9ac619eed6 (patch) | |
tree | fd979d6627bdc83ecae1ff29c335be070144521e /gdk/gdkpolyreg-generic.c | |
parent | 112dad66954c84e91300959f8d5fe20dccd5d8f1 (diff) | |
download | gtk+-92f86e049670c1696f135b32ca9b0a9ac619eed6.tar.gz |
gdk/gdk.h gdk/gdkcairo.h gdk/gdkcolor.h gdk/gdkgc.h gdk/gdkinternals.h
2008-01-14 Michael Natterer <mitch@imendio.com>
* gdk/gdk.h
* gdk/gdkcairo.h
* gdk/gdkcolor.h
* gdk/gdkgc.h
* gdk/gdkinternals.h
* gdk/gdkregion.h
* gdk/gdkwindow.h: made GdkRectangle*, GdkRegion* and GdkColor*
parameters const.
* gdk/gdkcairo.c
* gdk/gdkgc.c
* gdk/gdkwindow.c
* gdk/gdkrectangle.c
* gdk/gdkpolyreg-generic.c
* gdk/gdkregion-generic.c
* gdk/directfb/gdkcolor-directfb.c
* gdk/directfb/gdkgc-directfb.c
* gdk/directfb/gdkgeometry-directfb.c
* gdk/directfb/gdkwindow-directfb.c
* gdk/quartz/gdkcolor-quartz.c
* gdk/quartz/gdkgc-quartz.c
* gdk/quartz/gdkgeometry-quartz.c
* gdk/quartz/gdkwindow-quartz.c
* gdk/win32/gdkcolor-win32.c
* gdk/win32/gdkgc-win32.c
* gdk/win32/gdkgeometry-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwindow-win32.c
* gdk/x11/gdkcolor-x11.c
* gdk/x11/gdkgc-x11.c
* gdk/x11/gdkgeometry-x11.c
* gdk/x11/gdkmain-x11.c
* gdk/x11/gdkprivate-x11.h
* gdk/x11/gdkwindow-x11.c: changed accordingly.
* gdk/gdkpolyreg-generic.c: uncruftify to have proper function
headers.
svn path=/trunk/; revision=19365
Diffstat (limited to 'gdk/gdkpolyreg-generic.c')
-rw-r--r-- | gdk/gdkpolyreg-generic.c | 83 |
1 files changed, 40 insertions, 43 deletions
diff --git a/gdk/gdkpolyreg-generic.c b/gdk/gdkpolyreg-generic.c index e759cb8d44..3fb43a207c 100644 --- a/gdk/gdkpolyreg-generic.c +++ b/gdk/gdkpolyreg-generic.c @@ -62,12 +62,11 @@ SOFTWARE. * */ static void -InsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock) - EdgeTable *ET; - EdgeTableEntry *ETE; - int scanline; - ScanLineListBlock **SLLBlock; - int *iSLLBlock; +InsertEdgeInET (EdgeTable *ET, + EdgeTableEntry *ETE, + int scanline, + ScanLineListBlock **SLLBlock, + int *iSLLBlock) { EdgeTableEntry *start, *prev; ScanLineList *pSLL, *pPrevSLL; @@ -150,16 +149,15 @@ InsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock) */ static void -CreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock) - int count; - GdkPoint *pts; - EdgeTable *ET; - EdgeTableEntry *AET; - EdgeTableEntry *pETEs; - ScanLineListBlock *pSLLBlock; +CreateETandAET (int count, + const GdkPoint *pts, + EdgeTable *ET, + EdgeTableEntry *AET, + EdgeTableEntry *pETEs, + ScanLineListBlock *pSLLBlock) { - GdkPoint *top, *bottom; - GdkPoint *PrevPt, *CurrPt; + const GdkPoint *top, *bottom; + const GdkPoint *PrevPt, *CurrPt; int iSLLBlock = 0; int dy; @@ -242,8 +240,8 @@ CreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock) */ static void -loadAET(AET, ETEs) - EdgeTableEntry *AET, *ETEs; +loadAET(EdgeTableEntry *AET, + EdgeTableEntry *ETEs) { EdgeTableEntry *pPrevAET; EdgeTableEntry *tmp; @@ -290,8 +288,7 @@ loadAET(AET, ETEs) * */ static void -computeWAET(AET) - EdgeTableEntry *AET; +computeWAET (EdgeTableEntry *AET) { EdgeTableEntry *pWETE; int inside = 1; @@ -329,8 +326,7 @@ computeWAET(AET) */ static int -InsertionSort(AET) - EdgeTableEntry *AET; +InsertionSort (EdgeTableEntry *AET) { EdgeTableEntry *pETEchase; EdgeTableEntry *pETEinsert; @@ -366,8 +362,7 @@ InsertionSort(AET) * Clean up our act. */ static void -FreeStorage(pSLLBlock) - ScanLineListBlock *pSLLBlock; +FreeStorage (ScanLineListBlock *pSLLBlock) { ScanLineListBlock *tmpSLLBlock; @@ -387,10 +382,11 @@ FreeStorage(pSLLBlock) * stack by the calling procedure. * */ -static int PtsToRegion(numFullPtBlocks, iCurPtBlock, FirstPtBlock, reg) - int numFullPtBlocks, iCurPtBlock; - POINTBLOCK *FirstPtBlock; - GdkRegion *reg; +static int +PtsToRegion (int numFullPtBlocks, + int iCurPtBlock, + POINTBLOCK *FirstPtBlock, + GdkRegion *reg) { GdkRegionBox *rects; GdkPoint *pts; @@ -464,7 +460,9 @@ static int PtsToRegion(numFullPtBlocks, iCurPtBlock, FirstPtBlock, reg) * Returns: a new #GdkRegion based on the given polygon */ GdkRegion * -gdk_region_polygon(GdkPoint *Pts, gint Count, GdkFillRule rule) +gdk_region_polygon (const GdkPoint *Pts, + gint Count, + GdkFillRule rule) { GdkRegion *region; EdgeTableEntry *pAET; /* Active Edge Table */ @@ -472,7 +470,7 @@ gdk_region_polygon(GdkPoint *Pts, gint Count, GdkFillRule rule) int iPts = 0; /* number of pts in buffer */ EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/ ScanLineList *pSLL; /* current scanLineList */ - GdkPoint *pts; /* output buffer */ + GdkPoint *pts; /* output buffer */ EdgeTableEntry *pPrevAET; /* ptr to previous AET */ EdgeTable ET; /* header node for ET */ EdgeTableEntry AET; /* header node for AET */ @@ -486,21 +484,20 @@ gdk_region_polygon(GdkPoint *Pts, gint Count, GdkFillRule rule) region = gdk_region_new (); /* special case a rectangle */ - pts = Pts; if (((Count == 4) || - ((Count == 5) && (pts[4].x == pts[0].x) && (pts[4].y == pts[0].y))) && - (((pts[0].y == pts[1].y) && - (pts[1].x == pts[2].x) && - (pts[2].y == pts[3].y) && - (pts[3].x == pts[0].x)) || - ((pts[0].x == pts[1].x) && - (pts[1].y == pts[2].y) && - (pts[2].x == pts[3].x) && - (pts[3].y == pts[0].y)))) { - region->extents.x1 = MIN(pts[0].x, pts[2].x); - region->extents.y1 = MIN(pts[0].y, pts[2].y); - region->extents.x2 = MAX(pts[0].x, pts[2].x); - region->extents.y2 = MAX(pts[0].y, pts[2].y); + ((Count == 5) && (Pts[4].x == Pts[0].x) && (Pts[4].y == Pts[0].y))) && + (((Pts[0].y == Pts[1].y) && + (Pts[1].x == Pts[2].x) && + (Pts[2].y == Pts[3].y) && + (Pts[3].x == Pts[0].x)) || + ((Pts[0].x == Pts[1].x) && + (Pts[1].y == Pts[2].y) && + (Pts[2].x == Pts[3].x) && + (Pts[3].y == Pts[0].y)))) { + region->extents.x1 = MIN(Pts[0].x, Pts[2].x); + region->extents.y1 = MIN(Pts[0].y, Pts[2].y); + region->extents.x2 = MAX(Pts[0].x, Pts[2].x); + region->extents.y2 = MAX(Pts[0].y, Pts[2].y); if ((region->extents.x1 != region->extents.x2) && (region->extents.y1 != region->extents.y2)) { region->numRects = 1; |