[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (4615d7da3c49ba00dea064629b1d43b5283c31dc)



The branch, master has been updated
       via  4615d7da3c49ba00dea064629b1d43b5283c31dc (commit)
      from  8dd739f9bd72dc3c8beb6e4e5e32c124cac0d13b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/draw.c    |    4 ++--
 src/polygon.c |   15 ++++++++-------
 src/polygon.h |    4 +++-
 3 files changed, 13 insertions(+), 10 deletions(-)


=================
 Commit Messages
=================

commit 4615d7da3c49ba00dea064629b1d43b5283c31dc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Feb 21 17:47:47 2009 +0000

    Add user_data parameter to NoHolesPolygonDicer
    
    Also switch the clip_box parameter before the ones defining the
    callback and its user_data.

:100644 100644 22b9b53... 3da0bf9... M	src/draw.c
:100644 100644 b65f0df... 8cee66a... M	src/polygon.c
:100644 100644 c9672e2... a0563d2... M	src/polygon.h

=========
 Changes
=========

commit 4615d7da3c49ba00dea064629b1d43b5283c31dc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Feb 21 17:47:47 2009 +0000

    Add user_data parameter to NoHolesPolygonDicer
    
    Also switch the clip_box parameter before the ones defining the
    callback and its user_data.

diff --git a/src/draw.c b/src/draw.c
index 22b9b53..3da0bf9 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -2123,7 +2123,7 @@ DrawPlainPolygon (LayerTypePtr Layer, PolygonTypePtr Polygon)
     }
   else if (Polygon->Clipped)
     {
-      NoHolesPolygonDicer (Polygon, DrawPolygonLowLevel, clip_box);
+      NoHolesPolygonDicer (Polygon, clip_box, DrawPolygonLowLevel, NULL);
       /* draw other parts of the polygon if fullpoly flag is set */
       if (TEST_FLAG (FULLPOLYFLAG, Polygon))
 	{
@@ -2132,7 +2132,7 @@ DrawPlainPolygon (LayerTypePtr Layer, PolygonTypePtr Polygon)
 	    {
 	      PolygonType poly;
 	      poly.Clipped = pg;
-	      NoHolesPolygonDicer (&poly, DrawPolygonLowLevel, clip_box);
+	      NoHolesPolygonDicer (&poly, clip_box, DrawPolygonLowLevel, NULL);
 	    }
 	}
     }
diff --git a/src/polygon.c b/src/polygon.c
index b65f0df..8cee66a 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -1509,7 +1509,8 @@ IsRectangleInPolygon (LocationType X1, LocationType Y1, LocationType X2,
 }
 
 static void
-r_NoHolesPolygonDicer (PLINE * p, void (*emit) (PolygonTypePtr))
+r_NoHolesPolygonDicer (PLINE * p,
+                       void (*emit) (PolygonTypePtr, void *), void *user_data)
 {
   POLYAREA *pa;
 
@@ -1537,7 +1538,7 @@ r_NoHolesPolygonDicer (PLINE * p, void (*emit) (PolygonTypePtr))
       pts[3].X = pts[3].X2 = p->xmin;
       pts[3].Y = pts[3].Y2 = p->ymax;
       poly.Flags = MakeFlags (CLEARPOLYFLAG);
-      emit (&poly);
+      emit (&poly, user_data);
       poly_Free (&pa);
       return;
     }
@@ -1557,7 +1558,7 @@ r_NoHolesPolygonDicer (PLINE * p, void (*emit) (PolygonTypePtr))
           do
             {
               PLINE *pl = x->contours;
-              r_NoHolesPolygonDicer (pl, emit);
+              r_NoHolesPolygonDicer (pl, emit, user_data);
               y = x->f;
               /* the pline was already freed by its use int he recursive dicer */
               free (x);
@@ -1571,7 +1572,7 @@ r_NoHolesPolygonDicer (PLINE * p, void (*emit) (PolygonTypePtr))
           do
             {
               PLINE *pl = x->contours;
-              r_NoHolesPolygonDicer (pl, emit);
+              r_NoHolesPolygonDicer (pl, emit, user_data);
               y = x->f;
               free (x);
             }
@@ -1581,8 +1582,8 @@ r_NoHolesPolygonDicer (PLINE * p, void (*emit) (PolygonTypePtr))
 }
 
 void
-NoHolesPolygonDicer (PolygonTypePtr p, void (*emit) (PolygonTypePtr),
-                     const BoxType * clip)
+NoHolesPolygonDicer (PolygonTypePtr p, const BoxType * clip,
+                     void (*emit) (PolygonTypePtr, void *), void *user_data)
 {
   POLYAREA *save, *ans;
 
@@ -1607,7 +1608,7 @@ NoHolesPolygonDicer (PolygonTypePtr p, void (*emit) (PolygonTypePtr),
   do
     {
       POLYAREA *prev;
-      r_NoHolesPolygonDicer (save->contours, emit);
+      r_NoHolesPolygonDicer (save->contours, emit, user_data);
       /* go to next poly (could be one because of clip) */
       prev = save;
       save = prev->f;
diff --git a/src/polygon.h b/src/polygon.h
index c9672e2..a0563d2 100644
--- a/src/polygon.h
+++ b/src/polygon.h
@@ -62,5 +62,7 @@ Boolean IsRectangleInPolygon (LocationType, LocationType, LocationType,
 			      LocationType, PolygonTypePtr);
 Boolean isects (POLYAREA *, PolygonTypePtr, Boolean);
 Boolean MorphPolygon (LayerTypePtr, PolygonTypePtr);
-void NoHolesPolygonDicer (PolygonTypePtr p, void (*emit) (PolygonTypePtr), const BoxType *clip);
+void NoHolesPolygonDicer (PolygonType *p, const BoxType *clip,
+                          void (*emit) (PolygonTypePtr, void *),
+                          void *user_data);
 #endif




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs