Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 4768) +++ trunk/src/action_helper.c (revision 4769) @@ -83,8 +83,8 @@ *y = ((ElementTypePtr) ptr2)->MarkY; break; case PCB_TYPE_POLYGON: - *x = ((PolygonTypePtr) ptr2)->Points[0].X; - *y = ((PolygonTypePtr) ptr2)->Points[0].Y; + *x = ((pcb_polygon_t *) ptr2)->Points[0].X; + *y = ((pcb_polygon_t *) ptr2)->Points[0].Y; break; case PCB_TYPE_LINE_POINT: @@ -226,7 +226,7 @@ static pcb_point_t InsertedPoint; pcb_layer_t *lastLayer; static struct { - PolygonTypePtr poly; + pcb_polygon_t *poly; pcb_line_t line; } fake; @@ -901,7 +901,7 @@ if (Crosshair.AttachedBox.State == STATE_THIRD && Crosshair.AttachedBox.Point1.X != Crosshair.AttachedBox.Point2.X && Crosshair.AttachedBox.Point1.Y != Crosshair.AttachedBox.Point2.Y) { - PolygonTypePtr polygon; + pcb_polygon_t *polygon; int flags = PCB_FLAG_CLEARPOLY; if (conf_core.editor.full_poly) @@ -1001,7 +1001,7 @@ break; /* don't start doing anything if clicket out of polys */ } - if (TEST_FLAG(PCB_FLAG_LOCK, (PolygonTypePtr) + if (TEST_FLAG(PCB_FLAG_LOCK, (pcb_polygon_t *) Crosshair.AttachedObject.Ptr2)) { Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n")); Crosshair.AttachedObject.Type = PCB_TYPE_NONE; @@ -1032,7 +1032,7 @@ if (n >= 3 && points[0].X == Crosshair.AttachedLine.Point2.X && points[0].Y == Crosshair.AttachedLine.Point2.Y) { /* Create POLYAREAs from the original polygon * and the new hole polygon */ - original = PolygonToPoly((PolygonType *) Crosshair.AttachedObject.Ptr2); + original = PolygonToPoly((pcb_polygon_t *) Crosshair.AttachedObject.Ptr2); new_hole = PolygonToPoly(&Crosshair.AttachedPolygon); /* Subtract the hole from the original polygon shape */ @@ -1042,7 +1042,7 @@ * and place them on the page. Delete the original polygon. */ SaveUndoSerialNumber(); - Flags = ((PolygonType *) Crosshair.AttachedObject.Ptr2)->Flags; + Flags = ((pcb_polygon_t *) Crosshair.AttachedObject.Ptr2)->Flags; PolyToPolygonsOnLayer(PCB->Data, (pcb_layer_t *) Crosshair.AttachedObject.Ptr1, result, Flags); RemoveObject(PCB_TYPE_POLYGON, Crosshair.AttachedObject.Ptr1, Crosshair.AttachedObject.Ptr2, Crosshair.AttachedObject.Ptr3); @@ -1051,7 +1051,7 @@ Draw(); /* reset state of attached line */ - memset(&Crosshair.AttachedPolygon, 0, sizeof(PolygonType)); + memset(&Crosshair.AttachedPolygon, 0, sizeof(pcb_polygon_t)); Crosshair.AttachedLine.State = STATE_FIRST; Crosshair.AttachedObject.State = STATE_FIRST; addedLines = 0; @@ -1215,7 +1215,7 @@ &Crosshair.AttachedObject.Ptr1, &Crosshair.AttachedObject.Ptr2, &Crosshair.AttachedObject.Ptr3); if (Crosshair.AttachedObject.Type != PCB_TYPE_NONE) { - if (TEST_FLAG(PCB_FLAG_LOCK, (PolygonTypePtr) + if (TEST_FLAG(PCB_FLAG_LOCK, (pcb_polygon_t *) Crosshair.AttachedObject.Ptr2)) { Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n")); Crosshair.AttachedObject.Type = PCB_TYPE_NONE; @@ -1224,7 +1224,7 @@ else { /* get starting point of nearest segment */ if (Crosshair.AttachedObject.Type == PCB_TYPE_POLYGON) { - fake.poly = (PolygonTypePtr) Crosshair.AttachedObject.Ptr2; + fake.poly = (pcb_polygon_t *) Crosshair.AttachedObject.Ptr2; polyIndex = GetLowestDistancePolygonPoint(fake.poly, Note.X, Note.Y); fake.line.Point1 = fake.poly->Points[polyIndex]; fake.line.Point2 = fake.poly->Points[prev_contour_point(fake.poly, polyIndex)]; Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 4768) +++ trunk/src/crosshair.c (revision 4769) @@ -53,7 +53,7 @@ /* --------------------------------------------------------------------------- * some local prototypes */ -static void XORPolygon(PolygonTypePtr, Coord, Coord, int); +static void XORPolygon(pcb_polygon_t *, Coord, Coord, int); static void XORDrawElement(ElementTypePtr, Coord, Coord); static void XORDrawBuffer(pcb_buffer_t *); static void XORDrawInsertPointObject(void); @@ -102,7 +102,7 @@ /* --------------------------------------------------------------------------- * creates a tmp polygon with coordinates converted to screen system */ -static void XORPolygon(PolygonTypePtr polygon, Coord dx, Coord dy, int dash_last) +static void XORPolygon(pcb_polygon_t *polygon, Coord dx, Coord dy, int dash_last) { pcb_cardinal_t i; for (i = 0; i < polygon->PointN; i++) { @@ -386,7 +386,7 @@ case PCB_TYPE_POLYGON: { - PolygonTypePtr polygon = (PolygonTypePtr) Crosshair.AttachedObject.Ptr2; + pcb_polygon_t *polygon = (pcb_polygon_t *) Crosshair.AttachedObject.Ptr2; /* the tmp polygon has n+1 points because the first * and the last one are set to the same coordinates @@ -411,11 +411,11 @@ case PCB_TYPE_POLYGON_POINT: { - PolygonTypePtr polygon; + pcb_polygon_t *polygon; pcb_point_t *point; pcb_cardinal_t point_idx, prev, next; - polygon = (PolygonTypePtr) Crosshair.AttachedObject.Ptr2; + polygon = (pcb_polygon_t *) Crosshair.AttachedObject.Ptr2; point = (pcb_point_t *) Crosshair.AttachedObject.Ptr3; point_idx = polygon_point_idx(polygon, point); Index: trunk/src/crosshair.h =================================================================== --- trunk/src/crosshair.h (revision 4768) +++ trunk/src/crosshair.h (revision 4769) @@ -76,7 +76,7 @@ MaxX, MaxY; AttachedLineType AttachedLine; /* data of new lines... */ pcb_attached_box_t AttachedBox; - PolygonType AttachedPolygon; + pcb_polygon_t AttachedPolygon; pcb_attached_object_t AttachedObject; /* data of attached objects */ enum crosshair_shape shape; /* shape of crosshair */ vtop_t onpoint_objs; Index: trunk/src/data.c =================================================================== --- trunk/src/data.c (revision 4768) +++ trunk/src/data.c (revision 4769) @@ -224,7 +224,7 @@ FreePolygonMemory(polygon); } END_LOOP; - list_map0(&layer->Polygon, PolygonType, RemoveFreePolygon); + list_map0(&layer->Polygon, pcb_polygon_t, RemoveFreePolygon); if (layer->line_tree) r_destroy_tree(&layer->line_tree); if (layer->arc_tree) Index: trunk/src/data.h =================================================================== --- trunk/src/data.h (revision 4768) +++ trunk/src/data.h (revision 4769) @@ -92,7 +92,7 @@ typedef void (*pcb_line_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_line_t *line); typedef void (*pcb_arc_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_arc_t *arc); typedef void (*pcb_text_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, TextType *text); -typedef void (*pcb_poly_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, PolygonType *poly); +typedef void (*pcb_poly_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_polygon_t *poly); /* element callbacks */ typedef int (*pcb_element_cb_t)(void *ctx, pcb_board_t *pcb, ElementType *element, int enter); Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 4768) +++ trunk/src/draw.c (revision 4769) @@ -503,7 +503,7 @@ EraseText((pcb_layer_t *) lptr, (TextTypePtr) ptr); break; case PCB_TYPE_POLYGON: - ErasePolygon((PolygonTypePtr) ptr); + ErasePolygon((pcb_polygon_t *) ptr); break; case PCB_TYPE_ELEMENT: EraseElement((ElementTypePtr) ptr); @@ -547,7 +547,7 @@ break; case PCB_TYPE_POLYGON: if (((pcb_layer_t *) ptr1)->On) - DrawPolygon((pcb_layer_t *) ptr1, (PolygonTypePtr) ptr2); + DrawPolygon((pcb_layer_t *) ptr1, (pcb_polygon_t *) ptr2); break; case PCB_TYPE_ELEMENT: if (PCB->ElementOn && (FRONT((ElementTypePtr) ptr2) || PCB->InvisibleObjectsOn)) Index: trunk/src/find.c =================================================================== --- trunk/src/find.c (revision 4768) +++ trunk/src/find.c (revision 4769) @@ -107,7 +107,7 @@ (((pcb_rat_t **)RatList.Data)[(I)]) #define POLYGONLIST_ENTRY(L,I) \ - (((PolygonTypePtr *)PolygonList[(L)].Data)[(I)]) + (((pcb_polygon_t **)PolygonList[(L)].Data)[(I)]) #define PVLIST_ENTRY(I) \ (((PinTypePtr *)PVList.Data)[(I)]) @@ -157,7 +157,7 @@ static pcb_bool LookupPVConnectionsToPVList(void); static pcb_bool LookupLOConnectionsToLine(pcb_line_t *, pcb_cardinal_t, pcb_bool); static pcb_bool LookupLOConnectionsToPad(PadTypePtr, pcb_cardinal_t); -static pcb_bool LookupLOConnectionsToPolygon(PolygonTypePtr, pcb_cardinal_t); +static pcb_bool LookupLOConnectionsToPolygon(pcb_polygon_t *, pcb_cardinal_t); static pcb_bool LookupLOConnectionsToArc(pcb_arc_t *, pcb_cardinal_t); static pcb_bool LookupLOConnectionsToRatEnd(pcb_point_t *, pcb_cardinal_t); static pcb_bool IsRatPointOnLineEnd(pcb_point_t *, pcb_line_t *); Index: trunk/src/find.h =================================================================== --- trunk/src/find.h (revision 4768) +++ trunk/src/find.h (revision 4769) @@ -65,7 +65,7 @@ pcb_bool PinLineIntersect(PinTypePtr, pcb_line_t *); pcb_bool LinePadIntersect(pcb_line_t *, PadTypePtr); pcb_bool ArcPadIntersect(pcb_arc_t *, PadTypePtr); -pcb_bool IsPolygonInPolygon(PolygonTypePtr, PolygonTypePtr); +pcb_bool IsPolygonInPolygon(pcb_polygon_t *, pcb_polygon_t *); void LookupElementConnections(ElementTypePtr, FILE *); void LookupConnectionsToAllElements(FILE *); void LookupConnection(Coord, Coord, pcb_bool, Coord, int); @@ -84,9 +84,9 @@ void SaveFindFlag(int); void RestoreFindFlag(void); int DRCAll(void); -pcb_bool IsLineInPolygon(pcb_line_t *, PolygonTypePtr); -pcb_bool IsArcInPolygon(pcb_arc_t *, PolygonTypePtr); -pcb_bool IsPadInPolygon(PadTypePtr, PolygonTypePtr); +pcb_bool IsLineInPolygon(pcb_line_t *, pcb_polygon_t *); +pcb_bool IsArcInPolygon(pcb_arc_t *, pcb_polygon_t *); +pcb_bool IsPadInPolygon(PadTypePtr, pcb_polygon_t *); /* find_clear.c */ pcb_bool ClearFlagOnPinsViasAndPads(pcb_bool AndDraw, int flag); Index: trunk/src/find_deadcode.c =================================================================== --- trunk/src/find_deadcode.c (revision 4768) +++ trunk/src/find_deadcode.c (revision 4769) @@ -98,7 +98,7 @@ /* handle normal layers */ if (layer < max_copper_layer) { gdl_iterator_t it; - PolygonType *polygon; + pcb_polygon_t *polygon; /* find the first line that touches coordinates */ Index: trunk/src/find_drc.c =================================================================== --- trunk/src/find_drc.c (revision 4768) +++ trunk/src/find_drc.c (revision 4769) @@ -146,7 +146,7 @@ } case PCB_TYPE_POLYGON: { - PolygonTypePtr polygon = (PolygonTypePtr) thing_ptr3; + pcb_polygon_t *polygon = (pcb_polygon_t *) thing_ptr3; *x = (polygon->Clipped->contours->xmin + polygon->Clipped->contours->xmax) / 2; *y = (polygon->Clipped->contours->ymin + polygon->Clipped->contours->ymax) / 2; break; @@ -223,7 +223,7 @@ } /* DRC clearance callback */ -static r_dir_t drc_callback(pcb_data_t *data, pcb_layer_t *layer, PolygonTypePtr polygon, int type, void *ptr1, void *ptr2) +static r_dir_t drc_callback(pcb_data_t *data, pcb_layer_t *layer, pcb_polygon_t *polygon, int type, void *ptr1, void *ptr2) { const char *message; Coord x, y; Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 4768) +++ trunk/src/find_geo.c (revision 4769) @@ -471,7 +471,7 @@ * - check the two end points of the arc. If none of them matches * - check all segments of the polygon against the arc. */ -pcb_bool IsArcInPolygon(pcb_arc_t *Arc, PolygonTypePtr Polygon) +pcb_bool IsArcInPolygon(pcb_arc_t *Arc, pcb_polygon_t *Polygon) { pcb_box_t *Box = (pcb_box_t *) Arc; @@ -500,7 +500,7 @@ * - check the two end points of the line. If none of them matches * - check all segments of the polygon against the line. */ -pcb_bool IsLineInPolygon(pcb_line_t *Line, PolygonTypePtr Polygon) +pcb_bool IsLineInPolygon(pcb_line_t *Line, pcb_polygon_t *Polygon) { pcb_box_t *Box = (pcb_box_t *) Line; POLYAREA *lp; @@ -535,7 +535,7 @@ * * The polygon is assumed to already have been proven non-clearing */ -pcb_bool IsPadInPolygon(PadTypePtr pad, PolygonTypePtr polygon) +pcb_bool IsPadInPolygon(PadTypePtr pad, pcb_polygon_t *polygon) { return IsLineInPolygon((pcb_line_t *) pad, polygon); } @@ -546,7 +546,7 @@ * First check all points out of P1 against P2 and vice versa. * If both fail check all lines of P1 against the ones of P2 */ -pcb_bool IsPolygonInPolygon(PolygonTypePtr P1, PolygonTypePtr P2) +pcb_bool IsPolygonInPolygon(pcb_polygon_t *P1, pcb_polygon_t *P2) { if (!P1->Clipped || !P2->Clipped) return pcb_false; Index: trunk/src/find_lookup.c =================================================================== --- trunk/src/find_lookup.c (revision 4768) +++ trunk/src/find_lookup.c (revision 4769) @@ -133,7 +133,7 @@ return pcb_false; } -static pcb_bool ADD_POLYGON_TO_LIST(pcb_cardinal_t L, PolygonTypePtr Ptr, int from_type, void *from_ptr, found_conn_type_t type) +static pcb_bool ADD_POLYGON_TO_LIST(pcb_cardinal_t L, pcb_polygon_t *Ptr, int from_type, void *from_ptr, found_conn_type_t type) { if (User) AddObjectToFlagUndoList(PCB_TYPE_POLYGON, LAYER_PTR(L), (Ptr), (Ptr)); @@ -249,7 +249,7 @@ } if (polylist_length(&layer->Polygon)) { PolygonList[i].Size = polylist_length(&layer->Polygon); - PolygonList[i].Data = (void **) calloc(PolygonList[i].Size, sizeof(PolygonTypePtr)); + PolygonList[i].Data = (void **) calloc(PolygonList[i].Size, sizeof(pcb_polygon_t *)); } /* clear some struct members */ @@ -340,7 +340,7 @@ static r_dir_t LOCtoPVpoly_callback(const pcb_box_t * b, void *cl) { - PolygonTypePtr polygon = (PolygonTypePtr) b; + pcb_polygon_t *polygon = (pcb_polygon_t *) b; struct pv_info *i = (struct pv_info *) cl; /* if the pin doesn't have a therm and polygon is clearing @@ -603,7 +603,7 @@ pcb_line_t line; PadType pad; pcb_arc_t arc; - PolygonType polygon; + pcb_polygon_t polygon; pcb_rat_t rat; jmp_buf env; }; @@ -884,7 +884,7 @@ /* handle normal layers */ if (layer < max_copper_layer) { - PolygonType *polygon; + pcb_polygon_t *polygon; gdl_iterator_t it; info.layer = layer; @@ -1017,7 +1017,7 @@ /* now check all polygons */ if (PolysTo) { gdl_iterator_t it; - PolygonType *polygon; + pcb_polygon_t *polygon; polylist_foreach(&(PCB->Data->Layer[layer].Polygon), &it, polygon) { if (!TEST_FLAG(TheFlag, polygon) && IsLineInPolygon(Line, polygon) @@ -1061,7 +1061,7 @@ static r_dir_t PolygonToRat_callback(const pcb_box_t * b, void *cl) { - PolygonTypePtr polygon = (PolygonTypePtr) b; + pcb_polygon_t *polygon = (pcb_polygon_t *) b; struct rat_info *i = (struct rat_info *) cl; if (!TEST_FLAG(TheFlag, polygon) && polygon->Clipped && @@ -1161,7 +1161,7 @@ static r_dir_t LOCtoPadPoly_callback(const pcb_box_t * b, void *cl) { - PolygonTypePtr polygon = (PolygonTypePtr) b; + pcb_polygon_t *polygon = (pcb_polygon_t *) b; struct lo_info *i = (struct lo_info *) cl; @@ -1370,7 +1370,7 @@ * looks up LOs that are connected to the given polygon * on the given layergroup. All found connections are added to the list */ -static pcb_bool LookupLOConnectionsToPolygon(PolygonTypePtr Polygon, pcb_cardinal_t LayerGroup) +static pcb_bool LookupLOConnectionsToPolygon(pcb_polygon_t *Polygon, pcb_cardinal_t LayerGroup) { pcb_cardinal_t entry; struct lo_info info; @@ -1394,7 +1394,7 @@ /* handle normal layers */ if (layer < max_copper_layer) { gdl_iterator_t it; - PolygonType *polygon; + pcb_polygon_t *polygon; /* check all polygons */ polylist_foreach(&(PCB->Data->Layer[layer].Polygon), &it, polygon) { Index: trunk/src/find_misc.c =================================================================== --- trunk/src/find_misc.c (revision 4768) +++ trunk/src/find_misc.c (revision 4769) @@ -191,7 +191,7 @@ int layer = GetLayerNumber(PCB->Data, (pcb_layer_t *) ptr1); - if (ADD_POLYGON_TO_LIST(layer, (PolygonTypePtr) ptr2, 0, NULL, FCT_START)) + if (ADD_POLYGON_TO_LIST(layer, (pcb_polygon_t *) ptr2, 0, NULL, FCT_START)) return pcb_true; break; } Index: trunk/src/global_typedefs.h =================================================================== --- trunk/src/global_typedefs.h (revision 4768) +++ trunk/src/global_typedefs.h (revision 4769) @@ -39,7 +39,7 @@ typedef struct pcb_point_s pcb_point_t; typedef struct pcb_rat_line_s pcb_rat_t; -typedef struct polygon_st PolygonType, *PolygonTypePtr; +typedef struct pcb_polygon_s pcb_polygon_t; typedef struct pad_st PadType, *PadTypePtr; typedef struct pin_st PinType, *PinTypePtr, **PinTypeHandle; typedef struct rtree rtree_t; Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 4768) +++ trunk/src/hid.h (revision 4769) @@ -284,8 +284,8 @@ void (*draw_rect) (hidGC gc_, Coord x1_, Coord y1_, Coord x2_, Coord y2_); void (*fill_circle) (hidGC gc_, Coord cx_, Coord cy_, Coord radius_); void (*fill_polygon) (hidGC gc_, int n_coords_, Coord * x_, Coord * y_); - void (*fill_pcb_polygon) (hidGC gc_, PolygonType * poly, const pcb_box_t * clip_box); - void (*thindraw_pcb_polygon) (hidGC gc_, PolygonType * poly, const pcb_box_t * clip_box); + void (*fill_pcb_polygon) (hidGC gc_, pcb_polygon_t * poly, const pcb_box_t * clip_box); + void (*thindraw_pcb_polygon) (hidGC gc_, pcb_polygon_t * poly, const pcb_box_t * clip_box); void (*fill_pcb_pad) (hidGC gc_, PadType * pad, pcb_bool clip, pcb_bool mask); void (*thindraw_pcb_pad) (hidGC gc_, PadType * pad, pcb_bool clip, pcb_bool mask); void (*fill_pcb_pv) (hidGC fg_gc, hidGC bg_gc, PinType * pv, pcb_bool drawHole, pcb_bool mask); Index: trunk/src/hid_draw_helpers.c =================================================================== --- trunk/src/hid_draw_helpers.c (revision 4768) +++ trunk/src/hid_draw_helpers.c (revision 4769) @@ -102,7 +102,7 @@ * lets compute the complete no-holes polygon. */ #define BOUNDS_INSIDE_CLIP_THRESHOLD 0.5 -static int should_compute_no_holes(PolygonType * poly, const pcb_box_t * clip_box) +static int should_compute_no_holes(pcb_polygon_t * poly, const pcb_box_t * clip_box) { Coord x1, x2, y1, y2; double poly_bounding_area; @@ -134,7 +134,7 @@ #undef BOUNDS_INSIDE_CLIP_THRESHOLD -void common_fill_pcb_polygon(hidGC gc, PolygonType * poly, const pcb_box_t * clip_box) +void common_fill_pcb_polygon(hidGC gc, pcb_polygon_t * poly, const pcb_box_t * clip_box) { if (!poly->NoHolesValid) { /* If enough of the polygon is on-screen, compute the entire @@ -160,7 +160,7 @@ /* Draw other parts of the polygon if fullpoly flag is set */ /* NB: No "NoHoles" cache for these */ if (TEST_FLAG(PCB_FLAG_FULLPOLY, poly)) { - PolygonType p = *poly; + pcb_polygon_t p = *poly; for (p.Clipped = poly->Clipped->f; p.Clipped != poly->Clipped; p.Clipped = p.Clipped->f) NoHolesPolygonDicer(&p, clip_box, fill_contour_cb, gc); @@ -174,7 +174,7 @@ return 0; } -void common_thindraw_pcb_polygon(hidGC gc, PolygonType * poly, const pcb_box_t * clip_box) +void common_thindraw_pcb_polygon(hidGC gc, pcb_polygon_t * poly, const pcb_box_t * clip_box) { thindraw_contour(gc, poly->Clipped->contours); PolygonHoles(poly, clip_box, thindraw_hole_cb, gc); Index: trunk/src/hid_draw_helpers.h =================================================================== --- trunk/src/hid_draw_helpers.h (revision 4768) +++ trunk/src/hid_draw_helpers.h (revision 4769) @@ -1,7 +1,7 @@ #ifndef PCB_HID_DRAW_HELPERS_H #define PCB_HID_DRAW_HELPERS_H -void common_fill_pcb_polygon(hidGC gc, PolygonType * poly, const pcb_box_t * clip_box); -void common_thindraw_pcb_polygon(hidGC gc, PolygonType * poly, const pcb_box_t * clip_box); +void common_fill_pcb_polygon(hidGC gc, pcb_polygon_t * poly, const pcb_box_t * clip_box); +void common_thindraw_pcb_polygon(hidGC gc, pcb_polygon_t * poly, const pcb_box_t * clip_box); void common_fill_pcb_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool mask); void common_thindraw_pcb_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool mask); void common_fill_pcb_pv(hidGC gc, PinType * pv, pcb_bool drawHole, pcb_bool mask); Index: trunk/src/hid_nogui.c =================================================================== --- trunk/src/hid_nogui.c (revision 4768) +++ trunk/src/hid_nogui.c (revision 4769) @@ -118,7 +118,7 @@ CRASH("fill_polygon"); } -static void nogui_fill_pcb_polygon(hidGC gc, PolygonType * poly, const pcb_box_t * clip_box) +static void nogui_fill_pcb_polygon(hidGC gc, pcb_polygon_t * poly, const pcb_box_t * clip_box) { CRASH("fill_pcb_polygon"); } Index: trunk/src/obj_any.h =================================================================== --- trunk/src/obj_any.h (revision 4768) +++ trunk/src/obj_any.h (revision 4769) @@ -81,7 +81,7 @@ pcb_point_t *point; pcb_line_t *line; TextType *text; - PolygonType *polygon; + pcb_polygon_t *polygon; pcb_arc_t *arc; pcb_rat_t *rat; PadType *pad; Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 4768) +++ trunk/src/obj_elem.c (revision 4769) @@ -224,7 +224,7 @@ } /* see if a polygon is a rectangle. If so, canonicalize it. */ -static int polygon_is_rectangle(PolygonTypePtr poly) +static int polygon_is_rectangle(pcb_polygon_t *poly) { int i, best; pcb_point_t temp[4]; Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 4768) +++ trunk/src/obj_poly.c (revision 4769) @@ -54,17 +54,17 @@ /*** allocation ***/ /* get next slot for a polygon object, allocates memory if necessary */ -PolygonType *GetPolygonMemory(pcb_layer_t * layer) +pcb_polygon_t *GetPolygonMemory(pcb_layer_t * layer) { - PolygonType *new_obj; + pcb_polygon_t *new_obj; - new_obj = calloc(sizeof(PolygonType), 1); + new_obj = calloc(sizeof(pcb_polygon_t), 1); polylist_append(&layer->Polygon, new_obj); return new_obj; } -void RemoveFreePolygon(PolygonType * data) +void RemoveFreePolygon(pcb_polygon_t * data) { polylist_remove(data); free(data); @@ -71,7 +71,7 @@ } /* gets the next slot for a point in a polygon struct, allocates memory if necessary */ -pcb_point_t *GetPointMemoryInPolygon(PolygonTypePtr Polygon) +pcb_point_t *GetPointMemoryInPolygon(pcb_polygon_t *Polygon) { pcb_point_t *points = Polygon->Points; @@ -86,7 +86,7 @@ } /* gets the next slot for a point in a polygon struct, allocates memory if necessary */ -pcb_cardinal_t *GetHoleIndexMemoryInPolygon(PolygonTypePtr Polygon) +pcb_cardinal_t *GetHoleIndexMemoryInPolygon(pcb_polygon_t *Polygon) { pcb_cardinal_t *holeindex = Polygon->HoleIndex; @@ -101,7 +101,7 @@ } /* frees memory used by a polygon */ -void FreePolygonMemory(PolygonType * polygon) +void FreePolygonMemory(pcb_polygon_t * polygon) { if (polygon == NULL) return; @@ -113,13 +113,13 @@ poly_Free(&polygon->Clipped); poly_FreeContours(&polygon->NoHoles); - reset_obj_mem(PolygonType, polygon); + reset_obj_mem(pcb_polygon_t, polygon); } /*** utility ***/ /* rotates a polygon in 90 degree steps */ -void RotatePolygonLowLevel(PolygonTypePtr Polygon, Coord X, Coord Y, unsigned Number) +void RotatePolygonLowLevel(pcb_polygon_t *Polygon, Coord X, Coord Y, unsigned Number) { POLYGONPOINT_LOOP(Polygon); { @@ -131,7 +131,7 @@ /* sets the bounding box of a polygons */ -void SetPolygonBoundingBox(PolygonTypePtr Polygon) +void SetPolygonBoundingBox(pcb_polygon_t *Polygon) { Polygon->BoundingBox.X1 = Polygon->BoundingBox.Y1 = MAX_COORD; Polygon->BoundingBox.X2 = Polygon->BoundingBox.Y2 = 0; @@ -148,9 +148,9 @@ } /* creates a new polygon from the old formats rectangle data */ -PolygonTypePtr CreateNewPolygonFromRectangle(pcb_layer_t *Layer, Coord X1, Coord Y1, Coord X2, Coord Y2, FlagType Flags) +pcb_polygon_t *CreateNewPolygonFromRectangle(pcb_layer_t *Layer, Coord X1, Coord Y1, Coord X2, Coord Y2, FlagType Flags) { - PolygonTypePtr polygon = CreateNewPolygon(Layer, Flags); + pcb_polygon_t *polygon = CreateNewPolygon(Layer, Flags); if (!polygon) return (polygon); @@ -163,7 +163,7 @@ return (polygon); } -void pcb_add_polygon_on_layer(pcb_layer_t *Layer, PolygonType *polygon) +void pcb_add_polygon_on_layer(pcb_layer_t *Layer, pcb_polygon_t *polygon) { SetPolygonBoundingBox(polygon); if (!Layer->polygon_tree) @@ -172,9 +172,9 @@ } /* creates a new polygon on a layer */ -PolygonTypePtr CreateNewPolygon(pcb_layer_t *Layer, FlagType Flags) +pcb_polygon_t *CreateNewPolygon(pcb_layer_t *Layer, FlagType Flags) { - PolygonTypePtr polygon = GetPolygonMemory(Layer); + pcb_polygon_t *polygon = GetPolygonMemory(Layer); /* copy values */ polygon->Flags = Flags; @@ -186,7 +186,7 @@ } /* creates a new point in a polygon */ -pcb_point_t *CreateNewPointInPolygon(PolygonTypePtr Polygon, Coord X, Coord Y) +pcb_point_t *CreateNewPointInPolygon(pcb_polygon_t *Polygon, Coord X, Coord Y) { pcb_point_t *point = GetPointMemoryInPolygon(Polygon); @@ -198,7 +198,7 @@ } /* creates a new hole in a polygon */ -PolygonType *CreateNewHoleInPolygon(PolygonType * Polygon) +pcb_polygon_t *CreateNewHoleInPolygon(pcb_polygon_t * Polygon) { pcb_cardinal_t *holeindex = GetHoleIndexMemoryInPolygon(Polygon); *holeindex = Polygon->PointN; @@ -206,7 +206,7 @@ } /* copies data from one polygon to another; 'Dest' has to exist */ -PolygonTypePtr CopyPolygonLowLevel(PolygonTypePtr Dest, PolygonTypePtr Src) +pcb_polygon_t *CopyPolygonLowLevel(pcb_polygon_t *Dest, pcb_polygon_t *Src) { pcb_cardinal_t hole = 0; pcb_cardinal_t n; @@ -227,10 +227,10 @@ /*** ops ***/ /* copies a polygon to buffer */ -void *AddPolygonToBuffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon) +void *AddPolygonToBuffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon) { pcb_layer_t *layer = &ctx->buffer.dst->Layer[GetLayerNumber(ctx->buffer.src, Layer)]; - PolygonTypePtr polygon; + pcb_polygon_t *polygon; polygon = CreateNewPolygon(layer, Polygon->Flags); CopyPolygonLowLevel(polygon, Polygon); @@ -249,7 +249,7 @@ /* moves a polygon to buffer. Doesn't allocate memory for the points */ -void *MovePolygonToBuffer(pcb_opctx_t *ctx, pcb_layer_t * layer, PolygonType * polygon) +void *MovePolygonToBuffer(pcb_opctx_t *ctx, pcb_layer_t * layer, pcb_polygon_t * polygon) { pcb_layer_t *lay = &ctx->buffer.dst->Layer[GetLayerNumber(ctx->buffer.src, layer)]; @@ -267,7 +267,7 @@ } /* Handle attempts to change the clearance of a polygon. */ -void *ChangePolygonClearSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr poly) +void *ChangePolygonClearSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *poly) { static int shown_this_message = 0; if (!shown_this_message) { @@ -282,7 +282,7 @@ } /* changes the CLEARPOLY flag of a polygon */ -void *ChangePolyClear(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon) +void *ChangePolyClear(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon) { if (TEST_FLAG(PCB_FLAG_LOCK, Polygon)) return (NULL); @@ -295,7 +295,7 @@ } /* inserts a point into a polygon */ -void *InsertPointIntoPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon) +void *InsertPointIntoPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon) { pcb_point_t save; pcb_cardinal_t n; @@ -340,7 +340,7 @@ } /* low level routine to move a polygon */ -void MovePolygonLowLevel(PolygonTypePtr Polygon, Coord DX, Coord DY) +void MovePolygonLowLevel(pcb_polygon_t *Polygon, Coord DX, Coord DY) { POLYGONPOINT_LOOP(Polygon); { @@ -351,7 +351,7 @@ } /* moves a polygon */ -void *MovePolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon) +void *MovePolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon) { if (Layer->On) { ErasePolygon(Polygon); @@ -368,7 +368,7 @@ } /* moves a polygon-point */ -void *MovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon, pcb_point_t *Point) +void *MovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point) { if (Layer->On) { ErasePolygon(Polygon); @@ -387,7 +387,7 @@ } /* moves a polygon between layers; lowlevel routines */ -void *MovePolygonToLayerLowLevel(pcb_opctx_t *ctx, pcb_layer_t * Source, PolygonType * polygon, pcb_layer_t * Destination) +void *MovePolygonToLayerLowLevel(pcb_opctx_t *ctx, pcb_layer_t * Source, pcb_polygon_t * polygon, pcb_layer_t * Destination) { r_delete_entry(Source->polygon_tree, (pcb_box_t *) polygon); @@ -404,7 +404,7 @@ struct mptlc { pcb_cardinal_t snum, dnum; int type; - PolygonTypePtr polygon; + pcb_polygon_t *polygon; } mptlc; r_dir_t mptl_pin_callback(const pcb_box_t * b, void *cl) @@ -423,9 +423,9 @@ } /* moves a polygon between layers */ -void *MovePolygonToLayer(pcb_opctx_t *ctx, pcb_layer_t * Layer, PolygonType * Polygon) +void *MovePolygonToLayer(pcb_opctx_t *ctx, pcb_layer_t * Layer, pcb_polygon_t * Polygon) { - PolygonTypePtr newone; + pcb_polygon_t *newone; struct mptlc d; if (TEST_FLAG(PCB_FLAG_LOCK, Polygon)) { @@ -445,7 +445,7 @@ r_search(PCB->Data->pin_tree, &Polygon->BoundingBox, NULL, mptl_pin_callback, &d, NULL); d.type = PCB_TYPE_VIA; r_search(PCB->Data->via_tree, &Polygon->BoundingBox, NULL, mptl_pin_callback, &d, NULL); - newone = (struct polygon_st *) MovePolygonToLayerLowLevel(ctx, Layer, Polygon, ctx->move.dst_layer); + newone = (struct pcb_polygon_s *) MovePolygonToLayerLowLevel(ctx, Layer, Polygon, ctx->move.dst_layer); InitClip(PCB->Data, ctx->move.dst_layer, newone); if (ctx->move.dst_layer->On) { DrawPolygon(ctx->move.dst_layer, newone); @@ -456,7 +456,7 @@ /* destroys a polygon from a layer */ -void *DestroyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon) +void *DestroyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon) { r_delete_entry(Layer->polygon_tree, (pcb_box_t *) Polygon); FreePolygonMemory(Polygon); @@ -467,7 +467,7 @@ } /* removes a polygon-point from a polygon and destroys the data */ -void *DestroyPolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon, pcb_point_t *Point) +void *DestroyPolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point) { pcb_cardinal_t point_idx; pcb_cardinal_t i; @@ -502,7 +502,7 @@ } /* removes a polygon from a layer */ -void *RemovePolygon_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon) +void *RemovePolygon_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon) { /* erase from screen */ if (Layer->On) { @@ -514,7 +514,7 @@ return NULL; } -void *RemovePolygon(pcb_layer_t *Layer, PolygonTypePtr Polygon) +void *RemovePolygon(pcb_layer_t *Layer, pcb_polygon_t *Polygon) { pcb_opctx_t ctx; @@ -527,7 +527,7 @@ /* Removes a contour from a polygon. If removing the outer contour, it removes the whole polygon. */ -void *RemovePolygonContour(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon, pcb_cardinal_t contour) +void *RemovePolygonContour(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_cardinal_t contour) { pcb_cardinal_t contour_start, contour_end, contour_points; pcb_cardinal_t i; @@ -569,7 +569,7 @@ } /* removes a polygon-point from a polygon */ -void *RemovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon, pcb_point_t *Point) +void *RemovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point) { pcb_cardinal_t point_idx; pcb_cardinal_t i; @@ -617,9 +617,9 @@ } /* copies a polygon */ -void *CopyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon) +void *CopyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon) { - PolygonTypePtr polygon; + pcb_polygon_t *polygon; polygon = CreateNewPolygon(Layer, NoFlags()); CopyPolygonLowLevel(polygon, Polygon); @@ -637,7 +637,7 @@ r_dir_t draw_poly_callback(const pcb_box_t * b, void *cl) { struct draw_poly_info *i = cl; - PolygonType *polygon = (PolygonType *) b; + pcb_polygon_t *polygon = (pcb_polygon_t *) b; static const char *color; char buf[sizeof("#XXXXXX")]; @@ -666,7 +666,7 @@ /* If checking planes, thin-draw any pieces which have been clipped away */ if (gui->thindraw_pcb_polygon != NULL && conf_core.editor.check_planes && !TEST_FLAG(PCB_FLAG_FULLPOLY, polygon)) { - PolygonType poly = *polygon; + pcb_polygon_t poly = *polygon; for (poly.Clipped = polygon->Clipped->f; poly.Clipped != polygon->Clipped; poly.Clipped = poly.Clipped->f) gui->thindraw_pcb_polygon(Output.fgGC, &poly, i->drawn_area); @@ -676,13 +676,13 @@ } /* erases a polygon on a layer */ -void ErasePolygon(PolygonTypePtr Polygon) +void ErasePolygon(pcb_polygon_t *Polygon) { pcb_draw_invalidate(Polygon); EraseFlags(&Polygon->Flags); } -void DrawPolygon(pcb_layer_t *Layer, PolygonTypePtr Polygon) +void DrawPolygon(pcb_layer_t *Layer, pcb_polygon_t *Polygon) { pcb_draw_invalidate(Polygon); } Index: trunk/src/obj_poly.h =================================================================== --- trunk/src/obj_poly.h (revision 4768) +++ trunk/src/obj_poly.h (revision 4769) @@ -32,7 +32,7 @@ #include "obj_common.h" #include "polyarea.h" -struct polygon_st { /* holds information about a polygon */ +struct pcb_polygon_s { /* holds information about a polygon */ ANYOBJECTFIELDS; pcb_cardinal_t PointN; /* number of points in polygon */ pcb_cardinal_t PointMax; /* max number from malloc() */ @@ -48,28 +48,28 @@ -PolygonType *GetPolygonMemory(pcb_layer_t * layer); -void RemoveFreePolygon(PolygonType * data); -pcb_point_t *GetPointMemoryInPolygon(PolygonTypePtr Polygon); -pcb_cardinal_t *GetHoleIndexMemoryInPolygon(PolygonTypePtr Polygon); -void FreePolygonMemory(PolygonType * polygon); +pcb_polygon_t *GetPolygonMemory(pcb_layer_t * layer); +void RemoveFreePolygon(pcb_polygon_t * data); +pcb_point_t *GetPointMemoryInPolygon(pcb_polygon_t *Polygon); +pcb_cardinal_t *GetHoleIndexMemoryInPolygon(pcb_polygon_t *Polygon); +void FreePolygonMemory(pcb_polygon_t * polygon); -void SetPolygonBoundingBox(PolygonTypePtr Polygon); -PolygonTypePtr CreateNewPolygonFromRectangle(pcb_layer_t *Layer, Coord X1, Coord Y1, Coord X2, Coord Y2, FlagType Flags); -PolygonTypePtr CreateNewPolygon(pcb_layer_t *Layer, FlagType Flags); -pcb_point_t *CreateNewPointInPolygon(PolygonTypePtr Polygon, Coord X, Coord Y); -PolygonType *CreateNewHoleInPolygon(PolygonType * Polygon); -void *RemovePolygon(pcb_layer_t *Layer, PolygonTypePtr Polygon); +void SetPolygonBoundingBox(pcb_polygon_t *Polygon); +pcb_polygon_t *CreateNewPolygonFromRectangle(pcb_layer_t *Layer, Coord X1, Coord Y1, Coord X2, Coord Y2, FlagType Flags); +pcb_polygon_t *CreateNewPolygon(pcb_layer_t *Layer, FlagType Flags); +pcb_point_t *CreateNewPointInPolygon(pcb_polygon_t *Polygon, Coord X, Coord Y); +pcb_polygon_t *CreateNewHoleInPolygon(pcb_polygon_t * Polygon); +void *RemovePolygon(pcb_layer_t *Layer, pcb_polygon_t *Polygon); -void MovePolygonLowLevel(PolygonTypePtr Polygon, Coord DX, Coord DY); -void RotatePolygonLowLevel(PolygonTypePtr Polygon, Coord X, Coord Y, unsigned Number); -PolygonTypePtr CopyPolygonLowLevel(PolygonTypePtr Dest, PolygonTypePtr Src); +void MovePolygonLowLevel(pcb_polygon_t *Polygon, Coord DX, Coord DY); +void RotatePolygonLowLevel(pcb_polygon_t *Polygon, Coord X, Coord Y, unsigned Number); +pcb_polygon_t *CopyPolygonLowLevel(pcb_polygon_t *Dest, pcb_polygon_t *Src); /* Add objects without creating them or making any "sanity modifications" to them */ -void pcb_add_polygon_on_layer(pcb_layer_t *Layer, PolygonType *polygon); +void pcb_add_polygon_on_layer(pcb_layer_t *Layer, pcb_polygon_t *polygon); #define POLYGON_LOOP(layer) do { \ - PolygonType *polygon; \ + pcb_polygon_t *polygon; \ gdl_iterator_t __it__; \ linelist_foreach(&(layer)->Polygon, &__it__, polygon) { Index: trunk/src/obj_poly_draw.h =================================================================== --- trunk/src/obj_poly_draw.h (revision 4768) +++ trunk/src/obj_poly_draw.h (revision 4769) @@ -35,5 +35,5 @@ r_dir_t draw_poly_callback(const pcb_box_t * b, void *cl); #endif -void ErasePolygon(PolygonTypePtr Polygon); -void DrawPolygon(pcb_layer_t *Layer, PolygonTypePtr Polygon); +void ErasePolygon(pcb_polygon_t *Polygon); +void DrawPolygon(pcb_layer_t *Layer, pcb_polygon_t *Polygon); Index: trunk/src/obj_poly_list.h =================================================================== --- trunk/src/obj_poly_list.h (revision 4768) +++ trunk/src/obj_poly_list.h (revision 4769) @@ -28,7 +28,7 @@ /* List of Lines */ #define TDL(x) polylist_ ## x #define TDL_LIST_T polylist_t -#define TDL_ITEM_T PolygonType +#define TDL_ITEM_T pcb_polygon_t #define TDL_FIELD link #define TDL_SIZE_T size_t #define TDL_FUNC Index: trunk/src/obj_poly_op.h =================================================================== --- trunk/src/obj_poly_op.h (revision 4768) +++ trunk/src/obj_poly_op.h (revision 4769) @@ -28,20 +28,20 @@ #include "operation.h" -void *AddPolygonToBuffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon); -void *MovePolygonToBuffer(pcb_opctx_t *ctx, pcb_layer_t * layer, PolygonType * polygon); -void *ChangePolygonClearSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr poly); -void *ChangePolyClear(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon); -void *InsertPointIntoPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon); -void *MovePolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon); -void *MovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon, pcb_point_t *Point); -void *MovePolygonToLayerLowLevel(pcb_opctx_t *ctx, pcb_layer_t * Source, PolygonType * polygon, pcb_layer_t * Destination); -void *MovePolygonToLayer(pcb_opctx_t *ctx, pcb_layer_t * Layer, PolygonType * Polygon); -void *DestroyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon); -void *DestroyPolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon, pcb_point_t *Point); -void *RemovePolygon_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon); -void *RemovePolygonContour(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon, pcb_cardinal_t contour); -void *RemovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon, pcb_point_t *Point); -void *CopyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, PolygonTypePtr Polygon); +void *AddPolygonToBuffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon); +void *MovePolygonToBuffer(pcb_opctx_t *ctx, pcb_layer_t * layer, pcb_polygon_t * polygon); +void *ChangePolygonClearSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *poly); +void *ChangePolyClear(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon); +void *InsertPointIntoPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon); +void *MovePolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon); +void *MovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point); +void *MovePolygonToLayerLowLevel(pcb_opctx_t *ctx, pcb_layer_t * Source, pcb_polygon_t * polygon, pcb_layer_t * Destination); +void *MovePolygonToLayer(pcb_opctx_t *ctx, pcb_layer_t * Layer, pcb_polygon_t * Polygon); +void *DestroyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon); +void *DestroyPolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point); +void *RemovePolygon_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon); +void *RemovePolygonContour(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_cardinal_t contour); +void *RemovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point); +void *CopyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon); Index: trunk/src/operation.h =================================================================== --- trunk/src/operation.h (revision 4768) +++ trunk/src/operation.h (revision 4769) @@ -112,7 +112,7 @@ typedef struct { void *(*Line)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_line_t *); void *(*Text)(pcb_opctx_t *ctx, pcb_layer_t *, TextTypePtr); - void *(*Polygon)(pcb_opctx_t *ctx, pcb_layer_t *, PolygonTypePtr); + void *(*Polygon)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_polygon_t *); void *(*Via)(pcb_opctx_t *ctx, PinTypePtr); void *(*Element)(pcb_opctx_t *ctx, ElementTypePtr); void *(*ElementName)(pcb_opctx_t *ctx, ElementTypePtr); @@ -119,7 +119,7 @@ void *(*Pin)(pcb_opctx_t *ctx, ElementTypePtr, PinTypePtr); void *(*Pad)(pcb_opctx_t *ctx, ElementTypePtr, PadTypePtr); void *(*LinePoint)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_line_t *, pcb_point_t *); - void *(*Point)(pcb_opctx_t *ctx, pcb_layer_t *, PolygonTypePtr, pcb_point_t *); + void *(*Point)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_polygon_t *, pcb_point_t *); void *(*Arc)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_arc_t *); void *(*Rat)(pcb_opctx_t *ctx, pcb_rat_t *); } pcb_opfunc_t; Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 4768) +++ trunk/src/polygon.c (revision 4769) @@ -30,10 +30,10 @@ Here's a brief tour of the data and life of a polygon, courtesy of Ben Jackson: -A PCB PolygonType contains an array of points outlining the polygon. +A PCB pcb_polygon_t contains an array of points outlining the polygon. This is what is manipulated by the UI and stored in the saved PCB. -A PolygonType also contains a POLYAREA called 'Clipped' which is +A pcb_polygon_t also contains a POLYAREA called 'Clipped' which is computed dynamically by InitClip every time a board is loaded. The point array is converted to a POLYAREA by original_poly and then holes are cut in it by clearPoly. After that it is maintained dynamically @@ -46,11 +46,11 @@ first contour. POLYAREAs are in a doubly-linked list and each member of the list is an independent (non-overlapping) area with its own outline and holes. The function biggest() finds the largest POLYAREA -so that PolygonType.Clipped points to that shape. The rest of the +so that pcb_polygon_t.Clipped points to that shape. The rest of the polygon still exists, it's just ignored when turning the polygon into copper. -The first POLYAREA in PolygonType.Clipped is what is used for the vast +The first POLYAREA in pcb_polygon_t.Clipped is what is used for the vast majority of Polygon related tests. The basic logic for an intersection is "is the target shape inside POLYAREA.contours and NOT fully enclosed in any of POLYAREA.contours.next... (the holes)". @@ -114,7 +114,7 @@ rotate_circle_seg[3] = cos_ang; } -pcb_cardinal_t polygon_point_idx(PolygonTypePtr polygon, pcb_point_t *point) +pcb_cardinal_t polygon_point_idx(pcb_polygon_t *polygon, pcb_point_t *point) { assert(point >= polygon->Points); assert(point <= polygon->Points + polygon->PointN); @@ -122,7 +122,7 @@ } /* Find contour number: 0 for outer, 1 for first hole etc.. */ -pcb_cardinal_t polygon_point_contour(PolygonTypePtr polygon, pcb_cardinal_t point) +pcb_cardinal_t polygon_point_contour(pcb_polygon_t *polygon, pcb_cardinal_t point) { pcb_cardinal_t i; pcb_cardinal_t contour = 0; @@ -133,7 +133,7 @@ return contour; } -pcb_cardinal_t next_contour_point(PolygonTypePtr polygon, pcb_cardinal_t point) +pcb_cardinal_t next_contour_point(pcb_polygon_t *polygon, pcb_cardinal_t point) { pcb_cardinal_t contour; pcb_cardinal_t this_contour_start; @@ -151,7 +151,7 @@ return point; } -pcb_cardinal_t prev_contour_point(PolygonTypePtr polygon, pcb_cardinal_t point) +pcb_cardinal_t prev_contour_point(pcb_polygon_t *polygon, pcb_cardinal_t point) { pcb_cardinal_t contour; pcb_cardinal_t prev_contour_end; @@ -173,7 +173,7 @@ static void add_noholes_polyarea(PLINE * pline, void *user_data) { - PolygonType *poly = (PolygonType *) user_data; + pcb_polygon_t *poly = (pcb_polygon_t *) user_data; /* Prepend the pline into the NoHoles linked list */ pline->next = poly->NoHoles; @@ -180,7 +180,7 @@ poly->NoHoles = pline; } -void ComputeNoHoles(PolygonType * poly) +void ComputeNoHoles(pcb_polygon_t * poly) { poly_FreeContours(&poly->NoHoles); if (poly->Clipped) @@ -247,7 +247,7 @@ return p; } -static POLYAREA *original_poly(PolygonType * p) +static POLYAREA *original_poly(pcb_polygon_t * p) { PLINE *contour = NULL; POLYAREA *np = NULL; @@ -292,7 +292,7 @@ return biggest(np); } -POLYAREA *PolygonToPoly(PolygonType * p) +POLYAREA *PolygonToPoly(pcb_polygon_t * p) { return original_poly(p); } @@ -695,7 +695,7 @@ } /* clear np1 from the polygon */ -static int Subtract(POLYAREA * np1, PolygonType * p, pcb_bool fnp) +static int Subtract(POLYAREA * np1, pcb_polygon_t * p, pcb_bool fnp) { POLYAREA *merged = NULL, *np = np1; int x; @@ -774,7 +774,7 @@ } /* remove the pin clearance from the polygon */ -static int SubtractPin(pcb_data_t * d, PinType * pin, pcb_layer_t * l, PolygonType * p) +static int SubtractPin(pcb_data_t * d, PinType * pin, pcb_layer_t * l, pcb_polygon_t * p) { POLYAREA *np; pcb_cardinal_t i; @@ -796,7 +796,7 @@ return Subtract(np, p, pcb_true); } -static int SubtractLine(pcb_line_t * line, PolygonType * p) +static int SubtractLine(pcb_line_t * line, pcb_polygon_t * p) { POLYAREA *np; @@ -807,7 +807,7 @@ return Subtract(np, p, pcb_true); } -static int SubtractArc(pcb_arc_t * arc, PolygonType * p) +static int SubtractArc(pcb_arc_t * arc, pcb_polygon_t * p) { POLYAREA *np; @@ -818,7 +818,7 @@ return Subtract(np, p, pcb_true); } -static int SubtractText(TextType * text, PolygonType * p) +static int SubtractText(TextType * text, pcb_polygon_t * p) { POLYAREA *np; const pcb_box_t *b = &text->BoundingBox; @@ -830,7 +830,7 @@ return Subtract(np, p, pcb_true); } -static int SubtractPad(PadType * pad, PolygonType * p) +static int SubtractPad(PadType * pad, pcb_polygon_t * p) { POLYAREA *np = NULL; @@ -851,7 +851,7 @@ const pcb_box_t *other; pcb_data_t *data; pcb_layer_t *layer; - PolygonType *polygon; + pcb_polygon_t *polygon; pcb_bool solder; POLYAREA *accumulate; int batch_size; @@ -858,7 +858,7 @@ jmp_buf env; }; -static void subtract_accumulated(struct cpInfo *info, PolygonTypePtr polygon) +static void subtract_accumulated(struct cpInfo *info, pcb_polygon_t *polygon) { if (info->accumulate == NULL) return; @@ -871,7 +871,7 @@ { PinTypePtr pin = (PinTypePtr) b; struct cpInfo *info = (struct cpInfo *) cl; - PolygonTypePtr polygon; + pcb_polygon_t *polygon; POLYAREA *np; POLYAREA *merged; pcb_cardinal_t i; @@ -910,7 +910,7 @@ { pcb_arc_t *arc = (pcb_arc_t *) b; struct cpInfo *info = (struct cpInfo *) cl; - PolygonTypePtr polygon; + pcb_polygon_t *polygon; /* don't subtract the object that was put back! */ if (b == info->other) @@ -927,7 +927,7 @@ { PadTypePtr pad = (PadTypePtr) b; struct cpInfo *info = (struct cpInfo *) cl; - PolygonTypePtr polygon; + pcb_polygon_t *polygon; /* don't subtract the object that was put back! */ if (b == info->other) @@ -947,7 +947,7 @@ { pcb_line_t *line = (pcb_line_t *) b; struct cpInfo *info = (struct cpInfo *) cl; - PolygonTypePtr polygon; + pcb_polygon_t *polygon; POLYAREA *np; POLYAREA *merged; @@ -975,7 +975,7 @@ { TextTypePtr text = (TextTypePtr) b; struct cpInfo *info = (struct cpInfo *) cl; - PolygonTypePtr polygon; + pcb_polygon_t *polygon; /* don't subtract the object that was put back! */ if (b == info->other) @@ -998,7 +998,7 @@ return i; } -static int clearPoly(pcb_data_t *Data, pcb_layer_t *Layer, PolygonType * polygon, const pcb_box_t * here, Coord expand) +static int clearPoly(pcb_data_t *Data, pcb_layer_t *Layer, pcb_polygon_t * polygon, const pcb_box_t * here, Coord expand) { int r = 0, seen; pcb_box_t region; @@ -1049,7 +1049,7 @@ return r; } -static int Unsubtract(POLYAREA * np1, PolygonType * p) +static int Unsubtract(POLYAREA * np1, pcb_polygon_t * p) { POLYAREA *merged = NULL, *np = np1; POLYAREA *orig_poly, *clipped_np; @@ -1084,7 +1084,7 @@ return 0; } -static int UnsubtractPin(PinType * pin, pcb_layer_t * l, PolygonType * p) +static int UnsubtractPin(PinType * pin, pcb_layer_t * l, pcb_polygon_t * p) { POLYAREA *np; @@ -1100,7 +1100,7 @@ return 1; } -static int UnsubtractArc(pcb_arc_t * arc, pcb_layer_t * l, PolygonType * p) +static int UnsubtractArc(pcb_arc_t * arc, pcb_layer_t * l, pcb_polygon_t * p) { POLYAREA *np; @@ -1118,7 +1118,7 @@ return 1; } -static int UnsubtractLine(pcb_line_t * line, pcb_layer_t * l, PolygonType * p) +static int UnsubtractLine(pcb_line_t * line, pcb_layer_t * l, pcb_polygon_t * p) { POLYAREA *np; @@ -1136,7 +1136,7 @@ return 1; } -static int UnsubtractText(TextType * text, pcb_layer_t * l, PolygonType * p) +static int UnsubtractText(TextType * text, pcb_layer_t * l, pcb_polygon_t * p) { POLYAREA *np; @@ -1154,7 +1154,7 @@ return 1; } -static int UnsubtractPad(PadType * pad, pcb_layer_t * l, PolygonType * p) +static int UnsubtractPad(PadType * pad, pcb_layer_t * l, pcb_polygon_t * p) { POLYAREA *np; @@ -1171,7 +1171,7 @@ static pcb_bool inhibit = pcb_false; -int InitClip(pcb_data_t *Data, pcb_layer_t *layer, PolygonType * p) +int InitClip(pcb_data_t *Data, pcb_layer_t *layer, pcb_polygon_t * p) { if (inhibit) return 0; @@ -1194,7 +1194,7 @@ * line between the points on either side of it is redundant. * returns pcb_true if any points are removed */ -pcb_bool RemoveExcessPolygonPoints(pcb_layer_t *Layer, PolygonTypePtr Polygon) +pcb_bool RemoveExcessPolygonPoints(pcb_layer_t *Layer, pcb_polygon_t *Polygon) { pcb_point_t *p; pcb_cardinal_t n, prev, next; @@ -1225,7 +1225,7 @@ * point of the segment with the lowest distance to the passed * coordinates */ -pcb_cardinal_t GetLowestDistancePolygonPoint(PolygonTypePtr Polygon, Coord X, Coord Y) +pcb_cardinal_t GetLowestDistancePolygonPoint(pcb_polygon_t *Polygon, Coord X, Coord Y) { double mindistance = (double) MAX_COORD * MAX_COORD; pcb_point_t *ptr1, *ptr2; @@ -1332,7 +1332,7 @@ */ void CopyAttachedPolygonToLayer(void) { - PolygonTypePtr polygon; + pcb_polygon_t *polygon; int saveID; /* move data to layer and clear attached struct */ @@ -1343,7 +1343,7 @@ SET_FLAG(PCB_FLAG_CLEARPOLY, polygon); if (conf_core.editor.full_poly) SET_FLAG(PCB_FLAG_FULLPOLY, polygon); - memset(&Crosshair.AttachedPolygon, 0, sizeof(PolygonType)); + memset(&Crosshair.AttachedPolygon, 0, sizeof(pcb_polygon_t)); SetPolygonBoundingBox(polygon); if (!CURRENT->polygon_tree) CURRENT->polygon_tree = r_create_tree(NULL, 0, 0); @@ -1366,7 +1366,7 @@ * the search. */ int -PolygonHoles(PolygonType * polygon, const pcb_box_t * range, int (*callback) (PLINE * contour, void *user_data), void *user_data) +PolygonHoles(pcb_polygon_t * polygon, const pcb_box_t * range, int (*callback) (PLINE * contour, void *user_data), void *user_data) { POLYAREA *pa = polygon->Clipped; PLINE *pl; @@ -1390,10 +1390,10 @@ void *ptr1, *ptr2; pcb_layer_t *layer; pcb_data_t *data; - r_dir_t (*callback) (pcb_data_t *, pcb_layer_t *, PolygonTypePtr, int, void *, void *); + r_dir_t (*callback) (pcb_data_t *, pcb_layer_t *, pcb_polygon_t *, int, void *, void *); }; -static r_dir_t subtract_plow(pcb_data_t *Data, pcb_layer_t *Layer, PolygonTypePtr Polygon, int type, void *ptr1, void *ptr2) +static r_dir_t subtract_plow(pcb_data_t *Data, pcb_layer_t *Layer, pcb_polygon_t *Polygon, int type, void *ptr1, void *ptr2) { if (!Polygon->Clipped) return 0; @@ -1423,7 +1423,7 @@ return R_DIR_NOT_FOUND; } -static r_dir_t add_plow(pcb_data_t *Data, pcb_layer_t *Layer, PolygonTypePtr Polygon, int type, void *ptr1, void *ptr2) +static r_dir_t add_plow(pcb_data_t *Data, pcb_layer_t *Layer, pcb_polygon_t *Polygon, int type, void *ptr1, void *ptr2) { switch (type) { case PCB_TYPE_PIN: @@ -1449,7 +1449,7 @@ static r_dir_t plow_callback(const pcb_box_t * b, void *cl) { struct plow_info *plow = (struct plow_info *) cl; - PolygonTypePtr polygon = (PolygonTypePtr) b; + pcb_polygon_t *polygon = (pcb_polygon_t *) b; if (TEST_FLAG(PCB_FLAG_CLEARPOLY, polygon)) return plow->callback(plow->data, plow->layer, polygon, plow->type, plow->ptr1, plow->ptr2); @@ -1458,7 +1458,7 @@ int PlowsPolygon(pcb_data_t * Data, int type, void *ptr1, void *ptr2, - r_dir_t (*call_back) (pcb_data_t *data, pcb_layer_t *lay, PolygonTypePtr poly, int type, void *ptr1, void *ptr2)) + r_dir_t (*call_back) (pcb_data_t *data, pcb_layer_t *lay, pcb_polygon_t *poly, int type, void *ptr1, void *ptr2)) { pcb_box_t sb = ((PinTypePtr) ptr2)->BoundingBox; int r = 0, seen; @@ -1543,7 +1543,7 @@ void RestoreToPolygon(pcb_data_t * Data, int type, void *ptr1, void *ptr2) { if (type == PCB_TYPE_POLYGON) - InitClip(PCB->Data, (pcb_layer_t *) ptr1, (PolygonTypePtr) ptr2); + InitClip(PCB->Data, (pcb_layer_t *) ptr1, (pcb_polygon_t *) ptr2); else PlowsPolygon(Data, type, ptr1, ptr2, add_plow); } @@ -1551,12 +1551,12 @@ void ClearFromPolygon(pcb_data_t * Data, int type, void *ptr1, void *ptr2) { if (type == PCB_TYPE_POLYGON) - InitClip(PCB->Data, (pcb_layer_t *) ptr1, (PolygonTypePtr) ptr2); + InitClip(PCB->Data, (pcb_layer_t *) ptr1, (pcb_polygon_t *) ptr2); else PlowsPolygon(Data, type, ptr1, ptr2, subtract_plow); } -pcb_bool isects(POLYAREA * a, PolygonTypePtr p, pcb_bool fr) +pcb_bool isects(POLYAREA * a, pcb_polygon_t *p, pcb_bool fr) { POLYAREA *x; pcb_bool ans; @@ -1569,7 +1569,7 @@ } -pcb_bool IsPointInPolygon(Coord X, Coord Y, Coord r, PolygonTypePtr p) +pcb_bool IsPointInPolygon(Coord X, Coord Y, Coord r, pcb_polygon_t *p) { POLYAREA *c; Vector v; @@ -1579,7 +1579,7 @@ return pcb_true; if (TEST_FLAG(PCB_FLAG_FULLPOLY, p)) { - PolygonType tmp = *p; + pcb_polygon_t tmp = *p; /* Check all clipped-away regions that are now drawn because of full-poly */ for (tmp.Clipped = p->Clipped->f; tmp.Clipped != p->Clipped; tmp.Clipped = tmp.Clipped->f) @@ -1595,7 +1595,7 @@ } -pcb_bool IsPointInPolygonIgnoreHoles(Coord X, Coord Y, PolygonTypePtr p) +pcb_bool IsPointInPolygonIgnoreHoles(Coord X, Coord Y, pcb_polygon_t *p) { Vector v; v[0] = X; @@ -1603,7 +1603,7 @@ return poly_InsideContour(p->Clipped->contours, v); } -pcb_bool IsRectangleInPolygon(Coord X1, Coord Y1, Coord X2, Coord Y2, PolygonTypePtr p) +pcb_bool IsRectangleInPolygon(Coord X1, Coord Y1, Coord X2, Coord Y2, pcb_polygon_t *p) { POLYAREA *s; if (!(s = RectPoly(min(X1, X2), max(X1, X2), min(Y1, Y2), max(Y1, Y2)))) @@ -1657,7 +1657,7 @@ } } -void NoHolesPolygonDicer(PolygonTypePtr p, const pcb_box_t * clip, void (*emit) (PLINE *, void *), void *user_data) +void NoHolesPolygonDicer(pcb_polygon_t *p, const pcb_box_t * clip, void (*emit) (PLINE *, void *), void *user_data) { POLYAREA *main_contour, *cur, *next; @@ -1685,7 +1685,7 @@ } /* make a polygon split into multiple parts into multiple polygons */ -pcb_bool MorphPolygon(pcb_layer_t *layer, PolygonTypePtr poly) +pcb_bool MorphPolygon(pcb_layer_t *layer, pcb_polygon_t *poly) { POLYAREA *p, *start; pcb_bool many = pcb_false; @@ -1714,7 +1714,7 @@ inhibit = pcb_true; do { VNODE *v; - PolygonTypePtr newone; + pcb_polygon_t *newone; if (p->contours->area > PCB->IsleArea) { newone = CreateNewPolygon(layer, flags); @@ -1772,7 +1772,7 @@ debug_pline(pl); } -void debug_polygon(PolygonType * p) +void debug_polygon(pcb_polygon_t * p) { pcb_cardinal_t i; POLYAREA *pa; @@ -1800,7 +1800,7 @@ */ void PolyToPolygonsOnLayer(pcb_data_t * Destination, pcb_layer_t * Layer, POLYAREA * Input, FlagType Flags) { - PolygonType *Polygon; + pcb_polygon_t *Polygon; POLYAREA *pa; PLINE *pline; VNODE *node; Index: trunk/src/polygon.h =================================================================== --- trunk/src/polygon.h (revision 4768) +++ trunk/src/polygon.h (revision 4769) @@ -52,21 +52,21 @@ /* Prototypes */ void polygon_init(void); -pcb_cardinal_t polygon_point_idx(PolygonTypePtr polygon, pcb_point_t *point); -pcb_cardinal_t polygon_point_contour(PolygonTypePtr polygon, pcb_cardinal_t point); -pcb_cardinal_t prev_contour_point(PolygonTypePtr polygon, pcb_cardinal_t point); -pcb_cardinal_t next_contour_point(PolygonTypePtr polygon, pcb_cardinal_t point); -pcb_cardinal_t GetLowestDistancePolygonPoint(PolygonTypePtr, Coord, Coord); -pcb_bool RemoveExcessPolygonPoints(pcb_layer_t *, PolygonTypePtr); +pcb_cardinal_t polygon_point_idx(pcb_polygon_t *polygon, pcb_point_t *point); +pcb_cardinal_t polygon_point_contour(pcb_polygon_t *polygon, pcb_cardinal_t point); +pcb_cardinal_t prev_contour_point(pcb_polygon_t *polygon, pcb_cardinal_t point); +pcb_cardinal_t next_contour_point(pcb_polygon_t *polygon, pcb_cardinal_t point); +pcb_cardinal_t GetLowestDistancePolygonPoint(pcb_polygon_t *, Coord, Coord); +pcb_bool RemoveExcessPolygonPoints(pcb_layer_t *, pcb_polygon_t *); void GoToPreviousPoint(void); void ClosePolygon(void); void CopyAttachedPolygonToLayer(void); -int PolygonHoles(PolygonType * ptr, const pcb_box_t * range, int (*callback) (PLINE *, void *user_data), void *user_data); +int PolygonHoles(pcb_polygon_t * ptr, const pcb_box_t * range, int (*callback) (PLINE *, void *user_data), void *user_data); int PlowsPolygon(pcb_data_t *, int, void *, void *, - r_dir_t (*callback) (pcb_data_t *, pcb_layer_t *, PolygonTypePtr, int, void *, void *)); -void ComputeNoHoles(PolygonType * poly); + r_dir_t (*callback) (pcb_data_t *, pcb_layer_t *, pcb_polygon_t *, int, void *, void *)); +void ComputeNoHoles(pcb_polygon_t * poly); POLYAREA *ContourToPoly(PLINE *); -POLYAREA *PolygonToPoly(PolygonType *); +POLYAREA *PolygonToPoly(pcb_polygon_t *); POLYAREA *RectPoly(Coord x1, Coord x2, Coord y1, Coord y2); POLYAREA *CirclePoly(Coord x, Coord y, Coord radius); POLYAREA *OctagonPoly(Coord x, Coord y, Coord radius, int style); @@ -75,16 +75,16 @@ POLYAREA *PinPoly(PinType * l, Coord thick, Coord clear); POLYAREA *BoxPolyBloated(pcb_box_t * box, Coord radius); void frac_circle(PLINE *, Coord, Coord, Vector, int); -int InitClip(pcb_data_t * d, pcb_layer_t * l, PolygonType * p); +int InitClip(pcb_data_t * d, pcb_layer_t * l, pcb_polygon_t * p); void RestoreToPolygon(pcb_data_t *, int, void *, void *); void ClearFromPolygon(pcb_data_t *, int, void *, void *); -pcb_bool IsPointInPolygon(Coord, Coord, Coord, PolygonTypePtr); -pcb_bool IsPointInPolygonIgnoreHoles(Coord, Coord, PolygonTypePtr); -pcb_bool IsRectangleInPolygon(Coord, Coord, Coord, Coord, PolygonTypePtr); -pcb_bool isects(POLYAREA *, PolygonTypePtr, pcb_bool); -pcb_bool MorphPolygon(pcb_layer_t *, PolygonTypePtr); -void NoHolesPolygonDicer(PolygonType * p, const pcb_box_t * clip, void (*emit) (PLINE *, void *), void *user_data); +pcb_bool IsPointInPolygon(Coord, Coord, Coord, pcb_polygon_t *); +pcb_bool IsPointInPolygonIgnoreHoles(Coord, Coord, pcb_polygon_t *); +pcb_bool IsRectangleInPolygon(Coord, Coord, Coord, Coord, pcb_polygon_t *); +pcb_bool isects(POLYAREA *, pcb_polygon_t *, pcb_bool); +pcb_bool MorphPolygon(pcb_layer_t *, pcb_polygon_t *); +void NoHolesPolygonDicer(pcb_polygon_t * p, const pcb_box_t * clip, void (*emit) (PLINE *, void *), void *user_data); void PolyToPolygonsOnLayer(pcb_data_t *, pcb_layer_t *, POLYAREA *, FlagType); void square_pin_factors(int style, double *xm, double *ym); Index: trunk/src/polygon_act.c =================================================================== --- trunk/src/polygon_act.c (revision 4768) +++ trunk/src/polygon_act.c (revision 4769) @@ -43,7 +43,7 @@ /* --------------------------------------------------------------------------- */ -static const char morphpolygon_syntax[] = "MorphPolygon(Object|Selected)"; +static const char morphpcb_polygon_syntax[] = "MorphPolygon(Object|Selected)"; static const char morphpolygon_help[] = "Converts dead polygon islands into separate polygons."; @@ -69,7 +69,7 @@ gui->get_coords(_("Select an Object"), &x, &y); if ((type = SearchScreen(x, y, PCB_TYPE_POLYGON, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) { - MorphPolygon((pcb_layer_t *) ptr1, (PolygonType *) ptr3); + MorphPolygon((pcb_layer_t *) ptr1, (pcb_polygon_t *) ptr3); Draw(); IncrementUndoSerialNumber(); } @@ -93,7 +93,7 @@ /* --------------------------------------------------------------------------- */ -static const char polygon_syntax[] = "Polygon(Close|PreviousPoint)"; +static const char pcb_polygon_syntax[] = "Polygon(Close|PreviousPoint)"; static const char polygon_help[] = "Some polygon related stuff."; @@ -139,10 +139,10 @@ HID_Action polygon_action_list[] = { {"MorphPolygon", 0, ActionMorphPolygon, - morphpolygon_help, morphpolygon_syntax} + morphpolygon_help, morphpcb_polygon_syntax} , {"Polygon", 0, ActionPolygon, - polygon_help, polygon_syntax} + polygon_help, pcb_polygon_syntax} }; REGISTER_ACTIONS(polygon_action_list, NULL) Index: trunk/src/rats.c =================================================================== --- trunk/src/rats.c (revision 4768) +++ trunk/src/rats.c (revision 4769) @@ -497,7 +497,7 @@ pcb_rat_t *line; register float distance, temp; register pcb_connection_t *conn1, *conn2, *firstpoint, *secondpoint; - PolygonTypePtr polygon; + pcb_polygon_t *polygon; pcb_bool changed = pcb_false; pcb_bool havepoints; pcb_cardinal_t n, m, j; @@ -569,7 +569,7 @@ * via in the Net to make that connection. */ if (conn1->type == PCB_TYPE_POLYGON && - (polygon = (PolygonTypePtr) conn1->ptr2) && + (polygon = (pcb_polygon_t *) conn1->ptr2) && !(distance == 0 && firstpoint && firstpoint->type == PCB_TYPE_VIA) && IsPointInPolygonIgnoreHoles(conn2->X, conn2->Y, polygon)) { distance = 0; @@ -579,7 +579,7 @@ havepoints = pcb_true; } else if (conn2->type == PCB_TYPE_POLYGON && - (polygon = (PolygonTypePtr) conn2->ptr2) && + (polygon = (pcb_polygon_t *) conn2->ptr2) && !(distance == 0 && firstpoint && firstpoint->type == PCB_TYPE_VIA) && IsPointInPolygonIgnoreHoles(conn1->X, conn1->Y, polygon)) { distance = 0; Index: trunk/src/rotate.h =================================================================== --- trunk/src/rotate.h (revision 4768) +++ trunk/src/rotate.h (revision 4769) @@ -93,7 +93,7 @@ void RotateBoxLowLevel(pcb_box_t *, Coord, Coord, unsigned); -void RotatePolygonLowLevel(PolygonTypePtr, Coord, Coord, unsigned); +void RotatePolygonLowLevel(pcb_polygon_t *, Coord, Coord, unsigned); void *RotateObject(int, void *, void *, void *, Coord, Coord, unsigned); void RotateScreenObject(Coord, Coord, unsigned); Index: trunk/src/rubberband.c =================================================================== --- trunk/src/rubberband.c (revision 4768) +++ trunk/src/rubberband.c (revision 4769) @@ -45,7 +45,7 @@ static void CheckPadForRubberbandConnection(PadTypePtr); static void CheckPinForRubberbandConnection(PinTypePtr); static void CheckLinePointForRubberbandConnection(pcb_layer_t *, pcb_line_t *, pcb_point_t *, pcb_bool); -static void CheckPolygonForRubberbandConnection(pcb_layer_t *, PolygonTypePtr); +static void CheckPolygonForRubberbandConnection(pcb_layer_t *, pcb_polygon_t *); static void CheckLinePointForRat(pcb_layer_t *, pcb_point_t *); static r_dir_t rubber_callback(const pcb_box_t * b, void *cl); @@ -354,7 +354,7 @@ * If one of the endpoints of the line lays inside the passed polygon, * the scanned line is added to the 'rubberband' list */ -static void CheckPolygonForRubberbandConnection(pcb_layer_t *Layer, PolygonTypePtr Polygon) +static void CheckPolygonForRubberbandConnection(pcb_layer_t *Layer, pcb_polygon_t *Polygon) { pcb_cardinal_t group; @@ -443,7 +443,7 @@ case PCB_TYPE_POLYGON: if (GetLayerNumber(PCB->Data, (pcb_layer_t *) Ptr1) < max_copper_layer) - CheckPolygonForRubberbandConnection((pcb_layer_t *) Ptr1, (PolygonTypePtr) Ptr2); + CheckPolygonForRubberbandConnection((pcb_layer_t *) Ptr1, (pcb_polygon_t *) Ptr2); break; } } Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 4768) +++ trunk/src/search.c (revision 4769) @@ -57,13 +57,13 @@ static pcb_bool SearchArcByLocation(int, pcb_layer_t **, pcb_arc_t **, pcb_arc_t **); static pcb_bool SearchRatLineByLocation(int, pcb_rat_t **, pcb_rat_t **, pcb_rat_t **); static pcb_bool SearchTextByLocation(int, pcb_layer_t **, TextTypePtr *, TextTypePtr *); -static pcb_bool SearchPolygonByLocation(int, pcb_layer_t **, PolygonTypePtr *, PolygonTypePtr *); +static pcb_bool SearchPolygonByLocation(int, pcb_layer_t **, pcb_polygon_t **, pcb_polygon_t **); static pcb_bool SearchPinByLocation(int, ElementTypePtr *, PinTypePtr *, PinTypePtr *); static pcb_bool SearchPadByLocation(int, ElementTypePtr *, PadTypePtr *, PadTypePtr *, pcb_bool); static pcb_bool SearchViaByLocation(int, PinTypePtr *, PinTypePtr *, PinTypePtr *); static pcb_bool SearchElementNameByLocation(int, ElementTypePtr *, TextTypePtr *, TextTypePtr *, pcb_bool); static pcb_bool SearchLinePointByLocation(int, pcb_layer_t **, pcb_line_t **, pcb_point_t **); -static pcb_bool SearchPointByLocation(int, pcb_layer_t **, PolygonTypePtr *, pcb_point_t **); +static pcb_bool SearchPointByLocation(int, pcb_layer_t **, pcb_polygon_t **, pcb_point_t **); static pcb_bool SearchElementByLocation(int, ElementTypePtr *, ElementTypePtr *, ElementTypePtr *, pcb_bool); /* --------------------------------------------------------------------------- @@ -320,7 +320,7 @@ static r_dir_t polygon_callback(const pcb_box_t * box, void *cl) { - PolygonTypePtr polygon = (PolygonTypePtr) box; + pcb_polygon_t *polygon = (pcb_polygon_t *) box; struct ans_info *i = (struct ans_info *) cl; if (TEST_FLAG(i->locked, polygon)) @@ -337,7 +337,7 @@ /* --------------------------------------------------------------------------- * searches a polygon on the SearchLayer */ -static pcb_bool SearchPolygonByLocation(int locked, pcb_layer_t ** Layer, PolygonTypePtr * Polygon, PolygonTypePtr * Dummy) +static pcb_bool SearchPolygonByLocation(int locked, pcb_layer_t ** Layer, pcb_polygon_t ** Polygon, pcb_polygon_t ** Dummy) { struct ans_info info; @@ -401,7 +401,7 @@ * searches a polygon-point on all layers that are switched on * in layerstack order */ -static pcb_bool SearchPointByLocation(int locked, pcb_layer_t ** Layer, PolygonTypePtr * Polygon, pcb_point_t ** Point) +static pcb_bool SearchPointByLocation(int locked, pcb_layer_t ** Layer, pcb_polygon_t ** Polygon, pcb_point_t ** Point) { double d, least; pcb_bool found = pcb_false; @@ -1037,7 +1037,7 @@ if (SearchLayer->On) { if ((HigherAvail & (PCB_TYPE_PIN | PCB_TYPE_PAD)) == 0 && Type & PCB_TYPE_POLYGON_POINT && - SearchPointByLocation(locked, (pcb_layer_t **) Result1, (PolygonTypePtr *) Result2, (pcb_point_t **) Result3)) + SearchPointByLocation(locked, (pcb_layer_t **) Result1, (pcb_polygon_t **) Result2, (pcb_point_t **) Result3)) return (PCB_TYPE_POLYGON_POINT); if ((HigherAvail & (PCB_TYPE_PIN | PCB_TYPE_PAD)) == 0 && @@ -1058,9 +1058,9 @@ return (PCB_TYPE_TEXT); if (Type & PCB_TYPE_POLYGON && - SearchPolygonByLocation(locked, (pcb_layer_t **) Result1, (PolygonTypePtr *) Result2, (PolygonTypePtr *) Result3)) { + SearchPolygonByLocation(locked, (pcb_layer_t **) Result1, (pcb_polygon_t **) Result2, (pcb_polygon_t **) Result3)) { if (HigherAvail) { - pcb_box_t *box = &(*(PolygonTypePtr *) Result2)->BoundingBox; + pcb_box_t *box = &(*(pcb_polygon_t **) Result2)->BoundingBox; double area = (double) (box->X2 - box->X1) * (double) (box->X2 - box->X1); if (HigherBound < area) break; Index: trunk/src/select.c =================================================================== --- trunk/src/select.c (revision 4768) +++ trunk/src/select.c (revision 4769) @@ -170,7 +170,7 @@ case PCB_TYPE_POLYGON: { - PolygonType *poly = (PolygonTypePtr) ptr2; + pcb_polygon_t *poly = (pcb_polygon_t *) ptr2; layer = (pcb_layer_t *) ptr1; AddObjectToFlagUndoList(PCB_TYPE_POLYGON, ptr1, ptr2, ptr2); @@ -509,12 +509,12 @@ case PCB_TYPE_POLYGON: if (F->Polygon) - return (F->Polygon(ctx, (pcb_layer_t *) Ptr1, (PolygonTypePtr) Ptr2)); + return (F->Polygon(ctx, (pcb_layer_t *) Ptr1, (pcb_polygon_t *) Ptr2)); break; case PCB_TYPE_POLYGON_POINT: if (F->Point) - return (F->Point(ctx, (pcb_layer_t *) Ptr1, (PolygonTypePtr) Ptr2, (pcb_point_t *) Ptr3)); + return (F->Point(ctx, (pcb_layer_t *) Ptr1, (pcb_polygon_t *) Ptr2, (pcb_point_t *) Ptr3)); break; case PCB_TYPE_VIA: Index: trunk/src/undo.c =================================================================== --- trunk/src/undo.c (revision 4768) +++ trunk/src/undo.c (revision 4769) @@ -666,7 +666,7 @@ static pcb_bool UndoRemovePoint(UndoListTypePtr Entry) { pcb_layer_t *layer; - PolygonTypePtr polygon; + pcb_polygon_t *polygon; void *ptr3; int type; @@ -705,7 +705,7 @@ static pcb_bool UndoInsertPoint(UndoListTypePtr Entry) { pcb_layer_t *layer; - PolygonTypePtr polygon; + pcb_polygon_t *polygon; pcb_point_t *pnt; int type; pcb_cardinal_t point_idx; @@ -782,7 +782,7 @@ obj = (AnyObjectType *) MoveObjectToBuffer(PCB->Data, RemoveList, type, ptr1, ptr2, ptr3); if (Entry->Kind == PCB_TYPE_POLYGON) - InitClip(PCB->Data, (pcb_layer_t *) ptr1b, (PolygonType *) obj); + InitClip(PCB->Data, (pcb_layer_t *) ptr1b, (pcb_polygon_t *) obj); return (pcb_true); } @@ -1241,7 +1241,7 @@ void AddObjectToRemovePointUndoList(int Type, void *Ptr1, void *Ptr2, pcb_cardinal_t index) { UndoListTypePtr undo; - PolygonTypePtr polygon = (PolygonTypePtr) Ptr2; + pcb_polygon_t *polygon = (pcb_polygon_t *) Ptr2; pcb_cardinal_t hole; pcb_bool last_in_contour = pcb_false; @@ -1303,7 +1303,7 @@ * adds an object to the list of removed contours * (Actually just takes a copy of the whole polygon to restore) */ -void AddObjectToRemoveContourUndoList(int Type, pcb_layer_t * Layer, PolygonType * Polygon) +void AddObjectToRemoveContourUndoList(int Type, pcb_layer_t * Layer, pcb_polygon_t * Polygon) { CopyObjectToUndoList(UNDO_REMOVE_CONTOUR, Type, Layer, Polygon, NULL); } @@ -1312,7 +1312,7 @@ * adds an object to the list of insert contours * (Actually just takes a copy of the whole polygon to restore) */ -void AddObjectToInsertContourUndoList(int Type, pcb_layer_t * Layer, PolygonType * Polygon) +void AddObjectToInsertContourUndoList(int Type, pcb_layer_t * Layer, pcb_polygon_t * Polygon) { CopyObjectToUndoList(UNDO_INSERT_CONTOUR, Type, Layer, Polygon, NULL); } Index: trunk/src/undo.h =================================================================== --- trunk/src/undo.h (revision 4768) +++ trunk/src/undo.h (revision 4769) @@ -45,8 +45,8 @@ void MoveObjectToRemoveUndoList(int, void *, void *, void *); void AddObjectToRemovePointUndoList(int, void *, void *, pcb_cardinal_t); void AddObjectToInsertPointUndoList(int, void *, void *, void *); -void AddObjectToRemoveContourUndoList(int, pcb_layer_t *, PolygonType *); -void AddObjectToInsertContourUndoList(int, pcb_layer_t *, PolygonType *); +void AddObjectToRemoveContourUndoList(int, pcb_layer_t *, pcb_polygon_t *); +void AddObjectToInsertContourUndoList(int, pcb_layer_t *, pcb_polygon_t *); void AddObjectToMoveUndoList(int, void *, void *, void *, Coord, Coord); void AddObjectToChangeNameUndoList(int, void *, void *, void *, char *); void AddObjectToChangePinnumUndoList(int, void *, void *, void *, char *); Index: trunk/src_plugins/autocrop/autocrop.c =================================================================== --- trunk/src_plugins/autocrop/autocrop.c (revision 4768) +++ trunk/src_plugins/autocrop/autocrop.c (revision 4769) @@ -103,7 +103,7 @@ return Arc; } -static void *MyMovePolygonLowLevel(pcb_data_t * Data, pcb_layer_t * Layer, PolygonType * Polygon, Coord dx, Coord dy) +static void *MyMovePolygonLowLevel(pcb_data_t * Data, pcb_layer_t * Layer, pcb_polygon_t * Polygon, Coord dx, Coord dy) { if (Data) { r_delete_entry(Layer->polygon_tree, (pcb_box_t *) Polygon); Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 4768) +++ trunk/src_plugins/autoroute/autoroute.c (revision 4769) @@ -727,7 +727,7 @@ return *rbpp; } -static routebox_t *AddPolygon(PointerListType layergroupboxes[], pcb_cardinal_t layer, PolygonTypePtr polygon, RouteStyleType * style) +static routebox_t *AddPolygon(PointerListType layergroupboxes[], pcb_cardinal_t layer, pcb_polygon_t *polygon, RouteStyleType * style) { int is_not_rectangle = 1; int layergroup = GetLayerGroupNumberByNumber(layer); @@ -1007,7 +1007,7 @@ rb = AddPolygon(layergroupboxes, GetLayerNumber(PCB->Data, (pcb_layer_t *) connection->ptr1), - (struct polygon_st *) connection->ptr2, rd->styles[j]); + (struct pcb_polygon_s *) connection->ptr2, rd->styles[j]); break; } assert(rb); Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 4768) +++ trunk/src_plugins/export_ps/ps.c (revision 4769) @@ -1216,7 +1216,7 @@ return *c1 < *c2; } -static void ps_fill_pcb_polygon(hidGC gc, PolygonType * poly, const pcb_box_t * clip_box) +static void ps_fill_pcb_polygon(hidGC gc, pcb_polygon_t * poly, const pcb_box_t * clip_box) { /* Ignore clip_box, just draw everything */ Index: trunk/src_plugins/gl/hidgl.c =================================================================== --- trunk/src_plugins/gl/hidgl.c (revision 4768) +++ trunk/src_plugins/gl/hidgl.c (revision 4769) @@ -566,7 +566,7 @@ static int assigned_bits = 0; /* FIXME: JUST DRAWS THE FIRST PIECE.. TODO: SUPPORT FOR FULLPOLY POLYGONS */ -void hidgl_fill_pcb_polygon(PolygonType * poly, const pcb_box_t * clip_box, double scale) +void hidgl_fill_pcb_polygon(pcb_polygon_t * poly, const pcb_box_t * clip_box, double scale) { int vertex_count = 0; PLINE *contour; Index: trunk/src_plugins/gl/hidgl.h =================================================================== --- trunk/src_plugins/gl/hidgl.h (revision 4768) +++ trunk/src_plugins/gl/hidgl.h (revision 4769) @@ -67,7 +67,7 @@ void hidgl_draw_rect(Coord x1, Coord y1, Coord x2, Coord y2); void hidgl_fill_circle(Coord vx, Coord vy, Coord vr, double scale); void hidgl_fill_polygon(int n_coords, Coord * x, Coord * y); -void hidgl_fill_pcb_polygon(PolygonType * poly, const pcb_box_t * clip_box, double scale); +void hidgl_fill_pcb_polygon(pcb_polygon_t * poly, const pcb_box_t * clip_box, double scale); void hidgl_fill_rect(Coord x1, Coord y1, Coord x2, Coord y2); void hidgl_init(void); Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.h =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.h (revision 4768) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.h (revision 4769) @@ -35,7 +35,7 @@ Beveled_Cap /* octagon pins or bevel-cornered pads */ } EndCapStyle; -typedef void *PolygonType; +typedef void *pcb_polygon_t; typedef void *pcb_box_t; #endif Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c (revision 4768) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c (revision 4769) @@ -151,7 +151,7 @@ gpmi_event(h->module, HIDE_fill_polygon, h, gc, x, y); } -void gpmi_hid_fill_pcb_polygon(hidGC gc, PolygonType *poly, const pcb_box_t *clip_box) +void gpmi_hid_fill_pcb_polygon(hidGC gc, pcb_polygon_t *poly, const pcb_box_t *clip_box) { /* TODO */ } Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.h =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.h (revision 4768) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.h (revision 4769) @@ -15,7 +15,7 @@ void gpmi_hid_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2); void gpmi_hid_fill_circle(hidGC gc, Coord cx, Coord cy, Coord radius); void gpmi_hid_fill_polygon(hidGC gc, int n_coords, Coord *x, Coord *y); -void gpmi_hid_fill_pcb_polygon(hidGC gc, PolygonType *poly, const pcb_box_t *clip_box); +void gpmi_hid_fill_pcb_polygon(hidGC gc, pcb_polygon_t *poly, const pcb_box_t *clip_box); void gpmi_hid_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2); void gpmi_hid_fill_pcb_pv(hidGC fg_gc, hidGC bg_gc, PinType *pad, pcb_bool drawHole, pcb_bool mask); void gpmi_hid_fill_pcb_pad(hidGC gc, PadType * pad, pcb_bool clear, pcb_bool mask); Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layout.h =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layout.h (revision 4768) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layout.h (revision 4769) @@ -83,7 +83,7 @@ union { pcb_line_t *l; TextType *t; - PolygonType *p; + pcb_polygon_t *p; pcb_arc_t *a; PinType *v; PinType *pin; @@ -257,8 +257,8 @@ void draw_rect(dctx_t *ctx, int x1_, int y1_, int x2_, int y2_); void fill_circle(dctx_t *ctx, int cx_, int cy_, int radius_); void fill_polygon(dctx_t *ctx, int n_ints_, int *x_, int *y_); -void fill_pcb_polygon(dctx_t *ctx, PolygonType *poly, const pcb_box_t *clip_box); -void thindraw_pcb_polygon(dctx_t *ctx, PolygonType *poly, const pcb_box_t *clip_box); +void fill_pcb_polygon(dctx_t *ctx, pcb_polygon_t *poly, const pcb_box_t *clip_box); +void thindraw_pcb_polygon(dctx_t *ctx, pcb_polygon_t *poly, const pcb_box_t *clip_box); void fill_pcb_pad(dctx_t *ctx, PadType *pad, pcb_bool clip, pcb_bool mask); void thindraw_pcb_pad(dctx_t *ctx, PadType *pad, pcb_bool clip, pcb_bool mask); void fill_pcb_pv(hidGC fg_gc, hidGC bg_gc, PinType *pv, pcb_bool drawHole, pcb_bool mask); Index: trunk/src_plugins/hid_gtk/ghid-propedit.c =================================================================== --- trunk/src_plugins/hid_gtk/ghid-propedit.c (revision 4768) +++ trunk/src_plugins/hid_gtk/ghid-propedit.c (revision 4769) @@ -350,7 +350,7 @@ PCB_MIL_TO_COORD(850), PCB_MIL_TO_COORD(1150), 0, 100, "Text", MakeFlags(PCB_FLAG_CLEARLINE)); { - PolygonType *v = CreateNewPolygonFromRectangle(preview_pcb.Data->Layer, + pcb_polygon_t *v = CreateNewPolygonFromRectangle(preview_pcb.Data->Layer, PCB_MIL_TO_COORD(10), PCB_MIL_TO_COORD(10), PCB_MIL_TO_COORD(1200), PCB_MIL_TO_COORD(1200), MakeFlags(PCB_FLAG_CLEARPOLY)); Index: trunk/src_plugins/hid_gtk/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-gl.c (revision 4768) +++ trunk/src_plugins/hid_gtk/gtkhid-gl.c (revision 4769) @@ -520,7 +520,7 @@ hidgl_fill_polygon(n_coords, x, y); } -void ghid_fill_pcb_polygon(hidGC gc, PolygonType * poly, const pcb_box_t * clip_box) +void ghid_fill_pcb_polygon(hidGC gc, pcb_polygon_t * poly, const pcb_box_t * clip_box) { USE_GC(gc); @@ -527,7 +527,7 @@ hidgl_fill_pcb_polygon(poly, clip_box, gport->view.coord_per_px); } -void ghid_thindraw_pcb_polygon(hidGC gc, PolygonType * poly, const pcb_box_t * clip_box) +void ghid_thindraw_pcb_polygon(hidGC gc, pcb_polygon_t * poly, const pcb_box_t * clip_box) { common_thindraw_pcb_polygon(gc, poly, clip_box); ghid_set_alpha_mult(gc, 0.25); Index: trunk/src_plugins/io_kicad/read.c =================================================================== --- trunk/src_plugins/io_kicad/read.c (revision 4768) +++ trunk/src_plugins/io_kicad/read.c (revision 4769) @@ -1822,7 +1822,7 @@ unsigned long tally = 0; unsigned long required; - PolygonTypePtr polygon = NULL; + pcb_polygon_t *polygon = NULL; FlagType flags = MakeFlags(PCB_FLAG_CLEARPOLY); char *end; double val; Index: trunk/src_plugins/io_kicad/write.c =================================================================== --- trunk/src_plugins/io_kicad/write.c (revision 4768) +++ trunk/src_plugins/io_kicad/write.c (revision 4769) @@ -1259,7 +1259,7 @@ { int i, j; gdl_iterator_t it; - PolygonType *polygon; + pcb_polygon_t *polygon; pcb_cardinal_t currentLayer = number; /* write information about non empty layers */ Index: trunk/src_plugins/io_kicad_legacy/write.c =================================================================== --- trunk/src_plugins/io_kicad_legacy/write.c (revision 4768) +++ trunk/src_plugins/io_kicad_legacy/write.c (revision 4769) @@ -1189,7 +1189,7 @@ { int i, j; gdl_iterator_t it; - PolygonType *polygon; + pcb_polygon_t *polygon; pcb_cardinal_t currentLayer = number; /* write information about non empty layers */ Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 4768) +++ trunk/src_plugins/io_lihata/read.c (revision 4769) @@ -440,7 +440,7 @@ static int parse_polygon(pcb_layer_t *ly, ElementType *el, lht_node_t *obj) { - PolygonType *poly = GetPolygonMemory(ly); + pcb_polygon_t *poly = GetPolygonMemory(ly); lht_node_t *geo; pcb_cardinal_t n = 0, c; Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 4768) +++ trunk/src_plugins/io_lihata/write.c (revision 4769) @@ -316,7 +316,7 @@ return obj; } -static lht_node_t *build_polygon(PolygonType *poly) +static lht_node_t *build_polygon(pcb_polygon_t *poly) { char buff[128]; lht_node_t *obj, *tbl, *geo; @@ -423,7 +423,7 @@ lht_node_t *obj, *grp; pcb_line_t *li; pcb_arc_t *ar; - PolygonType *po; + pcb_polygon_t *po; TextType *tx; char tmp[16]; int added = 0; Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 4768) +++ trunk/src_plugins/io_pcb/file.c (revision 4769) @@ -442,7 +442,7 @@ pcb_line_t *line; pcb_arc_t *arc; TextType *text; - PolygonType *polygon; + pcb_polygon_t *polygon; /* write information about non empty layers */ if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) { Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 4768) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 4769) @@ -121,7 +121,7 @@ #include "obj_all.h" static pcb_layer_t *Layer; -static PolygonTypePtr Polygon; +static pcb_polygon_t *Polygon; static SymbolTypePtr Symbol; static int pin_num; static LibraryMenuTypePtr Menu; Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 4768) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 4769) @@ -58,7 +58,7 @@ #include "obj_all.h" static pcb_layer_t *Layer; -static PolygonTypePtr Polygon; +static pcb_polygon_t *Polygon; static SymbolTypePtr Symbol; static int pin_num; static LibraryMenuTypePtr Menu; Index: trunk/src_plugins/loghid/hid-logger.c =================================================================== --- trunk/src_plugins/loghid/hid-logger.c (revision 4768) +++ trunk/src_plugins/loghid/hid-logger.c (revision 4769) @@ -134,12 +134,12 @@ delegatee_->fill_polygon(gc, n_coords, x, y); } -static void log_fill_pcb_polygon(hidGC gc, PolygonType *poly, const pcb_box_t *clip_box) { +static void log_fill_pcb_polygon(hidGC gc, pcb_polygon_t *poly, const pcb_box_t *clip_box) { pcb_fprintf(out_, "fill_pcb_polygon(gc, poly->PointN=%d, ...)\n", poly->PointN); delegatee_->fill_pcb_polygon(gc, poly, clip_box); } -static void log_thindraw_pcb_polygon(hidGC gc, PolygonType *poly, const pcb_box_t *clip_box) { +static void log_thindraw_pcb_polygon(hidGC gc, pcb_polygon_t *poly, const pcb_box_t *clip_box) { pcb_fprintf(out_, "thindraw_pcb_polygon(gc, poly->PointN=%d, ...)\n", poly->PointN); delegatee_->thindraw_pcb_polygon(gc, poly, clip_box); } Index: trunk/src_plugins/polycombine/polycombine.c =================================================================== --- trunk/src_plugins/polycombine/polycombine.c (revision 4768) +++ trunk/src_plugins/polycombine/polycombine.c (revision 4769) @@ -38,7 +38,7 @@ #include "hid_actions.h" #include "obj_poly.h" -static POLYAREA *original_poly(PolygonType *p, pcb_bool *forward) +static POLYAREA *original_poly(pcb_polygon_t *p, pcb_bool *forward) { PLINE *contour = NULL; POLYAREA *np = NULL; @@ -92,7 +92,7 @@ typedef struct poly_tree poly_tree; struct poly_tree { - PolygonType *polygon; + pcb_polygon_t *polygon; pcb_bool forward; POLYAREA *polyarea; poly_tree *parent; @@ -277,7 +277,7 @@ POLYAREA *pa; PLINE *pline; VNODE *node; - PolygonType *Polygon;*/ + pcb_polygon_t *Polygon;*/ pcb_layer_t *Layer = NULL; poly_tree *root = NULL; poly_tree *this_node; Index: trunk/src_plugins/polystitch/polystitch.c =================================================================== --- trunk/src_plugins/polystitch/polystitch.c (revision 4768) +++ trunk/src_plugins/polystitch/polystitch.c (revision 4769) @@ -39,7 +39,7 @@ #include "obj_poly.h" #include "obj_poly_draw.h" -static PolygonType *inner_poly, *outer_poly; +static pcb_polygon_t *inner_poly, *outer_poly; static pcb_layer_t *poly_layer; static double ATAN2(pcb_point_t a, pcb_point_t b) @@ -49,7 +49,7 @@ return atan2((double) b.Y - a.Y, (double) b.X - a.X); } -static double poly_winding(PolygonType * poly) +static double poly_winding(pcb_polygon_t * poly) { double winding, turn; double prev_angle, this_angle; @@ -151,7 +151,7 @@ * \brief Rotate the polygon point list around so that point N is the * first one in the list. */ -static void rotate_points(PolygonType * poly, int n) +static void rotate_points(pcb_polygon_t * poly, int n) { pcb_point_t *np; int n2 = poly->PointN - n; @@ -167,7 +167,7 @@ * \brief Make sure the first and last point of the polygon are the same * point, so we can stitch them properly. */ -static void dup_endpoints(PolygonType * poly) +static void dup_endpoints(pcb_polygon_t * poly) { int n = poly->PointN; if (poly->Points[0].X == poly->Points[n - 1].X && poly->Points[0].Y == poly->Points[n - 1].Y) Index: trunk/src_plugins/propedit/propsel.c =================================================================== --- trunk/src_plugins/propedit/propsel.c (revision 4768) +++ trunk/src_plugins/propedit/propsel.c (revision 4769) @@ -118,7 +118,7 @@ map_attr(ctx, &text->Attributes); } -static void map_poly_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, PolygonType *poly) +static void map_poly_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_polygon_t *poly) { map_chk_skip(ctx, poly); map_attr(ctx, &poly->Attributes); @@ -311,7 +311,7 @@ } -static void set_poly_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, PolygonType *poly) +static void set_poly_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_polygon_t *poly) { set_ctx_t *st = (set_ctx_t *)ctx; @@ -504,7 +504,7 @@ del_attr(ctx, &text->Attributes); } -static void del_poly_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, PolygonType *poly) +static void del_poly_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_polygon_t *poly) { map_chk_skip(ctx, poly); del_attr(ctx, &poly->Attributes); Index: trunk/src_plugins/puller/puller.c =================================================================== --- trunk/src_plugins/puller/puller.c (revision 4768) +++ trunk/src_plugins/puller/puller.c (revision 4769) @@ -1545,7 +1545,7 @@ static r_dir_t gp_poly_cb(const pcb_box_t * b, void *cb) { int i; - const PolygonTypePtr p = (PolygonTypePtr) b; + const pcb_polygon_t *p = (pcb_polygon_t *) b; for (i = 0; i < p->PointN; i++) gp_point(p->Points[i].X, p->Points[i].Y, 0, 0); return R_DIR_NOT_FOUND; Index: trunk/src_plugins/query/query_access.c =================================================================== --- trunk/src_plugins/query/query_access.c (revision 4768) +++ trunk/src_plugins/query/query_access.c (revision 4769) @@ -64,7 +64,7 @@ APPEND(ctx, PCB_OBJ_TEXT, text, PCB_PARENT_LAYER, layer); } -static void list_poly_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, PolygonType *poly) +static void list_poly_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_polygon_t *poly) { APPEND(ctx, PCB_OBJ_POLYGON, poly, PCB_PARENT_LAYER, layer); } @@ -416,7 +416,7 @@ static int field_polygon(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res) { - PolygonType *p = obj->data.polygon; + pcb_polygon_t *p = obj->data.polygon; query_fields_keys_t fh1; fld2hash_req(fh1, fld, 0); Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 4768) +++ trunk/src_plugins/report/report.c (revision 4769) @@ -297,7 +297,7 @@ } case PCB_TYPE_POLYGON: { - PolygonTypePtr Polygon; + pcb_polygon_t *Polygon; #ifndef NDEBUG if (gui->shift_is_pressed()) { pcb_layer_t *layer = (pcb_layer_t *) ptr1; @@ -305,7 +305,7 @@ return 0; } #endif - Polygon = (PolygonTypePtr) ptr2; + Polygon = (pcb_polygon_t *) ptr2; report = pcb_strdup_printf("%m+POLYGON ID# %ld; Flags:%s\n" "Its bounding box is %$mD %$mD.\n" Index: trunk/src_plugins/toporouter/toporouter.c =================================================================== --- trunk/src_plugins/toporouter/toporouter.c (revision 4768) +++ trunk/src_plugins/toporouter/toporouter.c (revision 4769) @@ -2758,7 +2758,7 @@ #endif } else if (connection->type == PCB_TYPE_POLYGON) { - PolygonType *polygon = (PolygonType *) connection->ptr2; + pcb_polygon_t *polygon = (pcb_polygon_t *) connection->ptr2; toporouter_bbox_t *box = toporouter_bbox_locate(r, POLYGON, polygon, connection->X, connection->Y, connection->group); cluster_join_bbox(cluster, box);