Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4969) +++ trunk/doc-rnd/hacking/renames (revision 4970) @@ -590,3 +590,9 @@ ALLPIN_LOOP -> PCB_PIN_ALL_LOOP VIA_LOOP -> PCB_VIA_LOOP PIN_LOOP -> PCB_PIN_LOOP +POLYGONPOINT_LOOP -> PCB_POLY_POINT_LOOP +ALLPOLYGON_LOOP -> PCB_POLY_ALL_LOOP +COPPERPOLYGON_LOOP -> PCB_POLY_COPPER_LOOP +SILKPOLYGON_LOOP -> PCB_POLY_SILK_LOOP +VISIBLEPOLYGON_LOOP -> PCB_POLY_VISIBLE_LOOP +POLYGON_LOOP -> PCB_POLY_LOOP Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 4969) +++ trunk/src/action_helper.c (revision 4970) @@ -283,7 +283,7 @@ } } ENDALL_LOOP; - ALLPOLYGON_LOOP(PCB->Data); + PCB_POLY_ALL_LOOP(PCB->Data); { if (PCB_FLAG_TEST(PCB_FLAG_WARN, polygon)) { PCB_FLAG_CLEAR(PCB_FLAG_WARN, polygon); Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 4969) +++ trunk/src/buffer.c (revision 4970) @@ -263,7 +263,7 @@ r_insert_entry(layer->text_tree, (pcb_box_t *) text, 0); } ENDALL_LOOP; - ALLPOLYGON_LOOP(Buffer->Data); + PCB_POLY_ALL_LOOP(Buffer->Data); { r_delete_entry(layer->polygon_tree, (pcb_box_t *) polygon); pcb_poly_rotate90(polygon, Buffer->X, Buffer->Y, Number); @@ -320,10 +320,10 @@ } ENDALL_LOOP; /* FIXME: rotate text */ - ALLPOLYGON_LOOP(Buffer->Data); + PCB_POLY_ALL_LOOP(Buffer->Data); { r_delete_entry(layer->polygon_tree, (pcb_box_t *) polygon); - POLYGONPOINT_LOOP(polygon); + PCB_POLY_POINT_LOOP(polygon); { free_rotate(&point->X, &point->Y, Buffer->X, Buffer->Y, cosa, sina); } @@ -441,9 +441,9 @@ pcb_arc_bbox(arc); } ENDALL_LOOP; - ALLPOLYGON_LOOP(Buffer->Data); + PCB_POLY_ALL_LOOP(Buffer->Data); { - POLYGONPOINT_LOOP(polygon); + PCB_POLY_POINT_LOOP(polygon); { point->X = PCB_SWAP_X(point->X); point->Y = PCB_SWAP_Y(point->Y); @@ -505,10 +505,10 @@ r_insert_entry(layer->arc_tree, (pcb_box_t *) arc, 0); } ENDALL_LOOP; - ALLPOLYGON_LOOP(Buffer->Data); + PCB_POLY_ALL_LOOP(Buffer->Data); { r_delete_entry(layer->polygon_tree, (pcb_box_t *) polygon); - POLYGONPOINT_LOOP(polygon); + PCB_POLY_POINT_LOOP(polygon); { point->X = PCB_SWAP_X(point->X); point->Y = PCB_SWAP_Y(point->Y); @@ -653,7 +653,7 @@ CopyText(&ctx, destlayer, text); } END_LOOP; - POLYGON_LOOP(sourcelayer); + PCB_POLY_LOOP(sourcelayer); { CopyPolygon(&ctx, destlayer, polygon); } Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 4969) +++ trunk/src/crosshair.c (revision 4970) @@ -312,7 +312,7 @@ /* the tmp polygon has n+1 points because the first * and the last one are set to the same coordinates */ - POLYGON_LOOP(layer); + PCB_POLY_LOOP(layer); { XORPolygon(polygon, x, y, 0); } Index: trunk/src/data.c =================================================================== --- trunk/src/data.c (revision 4969) +++ trunk/src/data.c (revision 4970) @@ -83,7 +83,7 @@ } if (pocb != NULL) { - POLYGON_LOOP(layer); + PCB_POLY_LOOP(layer); { pocb(ctx, PCB, layer, polygon); } @@ -219,7 +219,7 @@ list_map0(&layer->Line, pcb_line_t, pcb_line_free); list_map0(&layer->Arc, pcb_arc_t, pcb_arc_free); list_map0(&layer->Text, pcb_text_t, pcb_text_free); - POLYGON_LOOP(layer); + PCB_POLY_LOOP(layer); { pcb_poly_free_fields(polygon); } @@ -332,7 +332,7 @@ box.Y2 = MAX(box.Y2, text->BoundingBox.Y2); } ENDALL_LOOP; - ALLPOLYGON_LOOP(Data); + PCB_POLY_ALL_LOOP(Data); { box.X1 = MIN(box.X1, polygon->BoundingBox.X1); box.Y1 = MIN(box.Y1, polygon->BoundingBox.Y1); Index: trunk/src/find_clear.c =================================================================== --- trunk/src/find_clear.c (revision 4969) +++ trunk/src/find_clear.c (revision 4970) @@ -118,7 +118,7 @@ } } ENDALL_LOOP; - COPPERPOLYGON_LOOP(PCB->Data); + PCB_POLY_COPPER_LOOP(PCB->Data); { if (PCB_FLAG_TEST(flag, polygon)) { if (AndDraw) Index: trunk/src/find_misc.c =================================================================== --- trunk/src/find_misc.c (revision 4969) +++ trunk/src/find_misc.c (revision 4970) @@ -384,7 +384,7 @@ } } ENDALL_LOOP; - COPPERPOLYGON_LOOP(PCB->Data); + PCB_POLY_COPPER_LOOP(PCB->Data); { if (PCB_FLAG_TEST(TheFlag, polygon)) { if (AndDraw) Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 4969) +++ trunk/src/obj_elem.c (revision 4970) @@ -329,7 +329,7 @@ hasParts = pcb_true; } END_LOOP; - POLYGON_LOOP(layer); + PCB_POLY_LOOP(layer); { pcb_coord_t x1, y1, x2, y2, w, h, t; Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 4969) +++ trunk/src/obj_poly.c (revision 4970) @@ -121,7 +121,7 @@ /* rotates a polygon in 90 degree steps */ void pcb_poly_rotate90(pcb_polygon_t *Polygon, pcb_coord_t X, pcb_coord_t Y, unsigned Number) { - POLYGONPOINT_LOOP(Polygon); + PCB_POLY_POINT_LOOP(Polygon); { ROTATE(point->X, point->Y, X, Y, Number); } @@ -135,7 +135,7 @@ { Polygon->BoundingBox.X1 = Polygon->BoundingBox.Y1 = MAX_COORD; Polygon->BoundingBox.X2 = Polygon->BoundingBox.Y2 = 0; - POLYGONPOINT_LOOP(Polygon); + PCB_POLY_POINT_LOOP(Polygon); { PCB_MAKE_MIN(Polygon->BoundingBox.X1, point->X); PCB_MAKE_MIN(Polygon->BoundingBox.Y1, point->Y); @@ -342,7 +342,7 @@ /* low level routine to move a polygon */ void pcb_poly_move(pcb_polygon_t *Polygon, pcb_coord_t DX, pcb_coord_t DY) { - POLYGONPOINT_LOOP(Polygon); + PCB_POLY_POINT_LOOP(Polygon); { PCB_MOVE(point->X, point->Y, DX, DY); } Index: trunk/src/obj_poly.h =================================================================== --- trunk/src/obj_poly.h (revision 4969) +++ trunk/src/obj_poly.h (revision 4970) @@ -68,12 +68,12 @@ /* Add objects without creating them or making any "sanity modifications" to them */ void pcb_add_polygon_on_layer(pcb_layer_t *Layer, pcb_polygon_t *polygon); -#define POLYGON_LOOP(layer) do { \ +#define PCB_POLY_LOOP(layer) do { \ pcb_polygon_t *polygon; \ gdl_iterator_t __it__; \ linelist_foreach(&(layer)->Polygon, &__it__, polygon) { -#define POLYGONPOINT_LOOP(polygon) do { \ +#define PCB_POLY_POINT_LOOP(polygon) do { \ pcb_cardinal_t n; \ pcb_point_t *point; \ for (n = (polygon)->PointN-1; n != -1; n--) \ @@ -80,35 +80,35 @@ { \ point = &(polygon)->Points[n] -#define ALLPOLYGON_LOOP(top) do { \ +#define PCB_POLY_ALL_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ for (l = 0; l < max_copper_layer + 2; l++, layer++) \ { \ - POLYGON_LOOP(layer) + PCB_POLY_LOOP(layer) -#define COPPERPOLYGON_LOOP(top) do { \ +#define PCB_POLY_COPPER_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ for (l = 0; l < max_copper_layer; l++, layer++) \ { \ - POLYGON_LOOP(layer) + PCB_POLY_LOOP(layer) -#define SILKPOLYGON_LOOP(top) do { \ +#define PCB_POLY_SILK_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ layer += max_copper_layer; \ for (l = 0; l < 2; l++, layer++) \ { \ - POLYGON_LOOP(layer) + PCB_POLY_LOOP(layer) -#define VISIBLEPOLYGON_LOOP(top) do { \ +#define PCB_POLY_VISIBLE_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ for (l = 0; l < max_copper_layer + 2; l++, layer++) \ { \ if (layer->On) \ - POLYGON_LOOP(layer) + PCB_POLY_LOOP(layer) #endif Index: trunk/src/polygon_act.c =================================================================== --- trunk/src/polygon_act.c (revision 4969) +++ trunk/src/polygon_act.c (revision 4970) @@ -77,7 +77,7 @@ } case F_Selected: case F_SelectedObjects: - ALLPOLYGON_LOOP(PCB->Data); + PCB_POLY_ALL_LOOP(PCB->Data); { if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, polygon)) MorphPolygon(layer, polygon); Index: trunk/src/rats.c =================================================================== --- trunk/src/rats.c (revision 4969) +++ trunk/src/rats.c (revision 4970) @@ -445,7 +445,7 @@ } ENDALL_LOOP; /* add polygons so the auto-router can see them as targets */ - ALLPOLYGON_LOOP(PCB->Data); + PCB_POLY_ALL_LOOP(PCB->Data); { if (PCB_FLAG_TEST(PCB_FLAG_DRC, polygon)) { conn = GetConnectionMemory(a); Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 4969) +++ trunk/src/search.c (revision 4970) @@ -408,9 +408,9 @@ least = SearchRadius + MAX_POLYGON_POINT_DISTANCE; *Layer = SearchLayer; - POLYGON_LOOP(*Layer); + PCB_POLY_LOOP(*Layer); { - POLYGONPOINT_LOOP(polygon); + PCB_POLY_POINT_LOOP(polygon); { d = pcb_distance(point->X, point->Y, PosX, PosY); if (d < least) { @@ -1178,7 +1178,7 @@ } if (type == PCB_TYPE_POLYGON || type == PCB_TYPE_POLYGON_POINT) { - ALLPOLYGON_LOOP(Base); + PCB_POLY_ALL_LOOP(Base); { if (polygon->ID == ID) { *Result1 = (void *) layer; @@ -1186,7 +1186,7 @@ return (PCB_TYPE_POLYGON); } if (type == PCB_TYPE_POLYGON_POINT) - POLYGONPOINT_LOOP(polygon); + PCB_POLY_POINT_LOOP(polygon); { if (point->ID == ID) { *Result1 = (void *) layer; Index: trunk/src/select.c =================================================================== --- trunk/src/select.c (revision 4969) +++ trunk/src/select.c (revision 4970) @@ -344,7 +344,7 @@ } } END_LOOP; - POLYGON_LOOP(layer); + PCB_POLY_LOOP(layer); { if (POLYGON_NEAR_BOX(polygon, Box) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, polygon) @@ -607,7 +607,7 @@ /* check polygons */ if (type & PCB_TYPE_POLYGON && F->Polygon) - VISIBLEPOLYGON_LOOP(PCB->Data); + PCB_POLY_VISIBLE_LOOP(PCB->Data); { if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, polygon)) { if (Reset) { @@ -760,7 +760,7 @@ } } ENDALL_LOOP; - VISIBLEPOLYGON_LOOP(PCB->Data); + PCB_POLY_VISIBLE_LOOP(PCB->Data); { if (PCB_FLAG_TEST(PCB_FLAG_FOUND, polygon) && !PCB_FLAG_TEST(PCB_FLAG_LOCK, polygon)) { AddObjectToFlagUndoList(PCB_TYPE_POLYGON, layer, polygon, polygon); Index: trunk/src_plugins/autocrop/autocrop.c =================================================================== --- trunk/src_plugins/autocrop/autocrop.c (revision 4969) +++ trunk/src_plugins/autocrop/autocrop.c (revision 4970) @@ -167,7 +167,7 @@ AddObjectToMoveUndoList(PCB_TYPE_TEXT, NULL, NULL, text, dx, dy); } ENDALL_LOOP; - ALLPOLYGON_LOOP(PCB->Data); + PCB_POLY_ALL_LOOP(PCB->Data); { /* * XXX MovePolygonLowLevel does not mean "no gui" like Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 4969) +++ trunk/src_plugins/autoroute/autoroute.c (revision 4970) @@ -1103,7 +1103,7 @@ } END_LOOP; /* add all polygons */ - POLYGON_LOOP(LAYER_PTR(i)); + PCB_POLY_LOOP(LAYER_PTR(i)); { if (PCB_FLAG_TEST(PCB_FLAG_DRC, polygon)) PCB_FLAG_CLEAR(PCB_FLAG_DRC, polygon); Index: trunk/src_plugins/boardflip/boardflip.c =================================================================== --- trunk/src_plugins/boardflip/boardflip.c (revision 4969) +++ trunk/src_plugins/boardflip/boardflip.c (revision 4970) @@ -80,10 +80,10 @@ PCB_FLAG_TOGGLE(PCB_FLAG_ONSOLDER, text); } END_LOOP; - POLYGON_LOOP(layer); + PCB_POLY_LOOP(layer); { int i, j; - POLYGONPOINT_LOOP(polygon); + PCB_POLY_POINT_LOOP(polygon); { FLIP(point->Y); } Index: trunk/src_plugins/hid_gtk/gui-drc-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-drc-window.c (revision 4969) +++ trunk/src_plugins/hid_gtk/gui-drc-window.c (revision 4970) @@ -155,7 +155,7 @@ } } ENDALL_LOOP; - COPPERPOLYGON_LOOP(PCB->Data); + PCB_POLY_COPPER_LOOP(PCB->Data); { if (PCB_FLAG_TEST(flag, polygon)) { AddObjectToFlagUndoList(PCB_TYPE_POLYGON, layer, polygon, polygon); Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 4969) +++ trunk/src_plugins/io_lihata/read.c (revision 4970) @@ -983,7 +983,7 @@ /* Run poly clipping at the end so we have all IDs and we can announce the clipping (it's slow, we may need a progress bar) */ - ALLPOLYGON_LOOP(pcb->Data); + PCB_POLY_ALL_LOOP(pcb->Data); { InitClip(pcb->Data, layer, polygon); } Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 4969) +++ trunk/src_plugins/io_pcb/file.c (revision 4970) @@ -109,7 +109,7 @@ int PCBFileVersionNeeded(void) { - ALLPOLYGON_LOOP(PCB->Data); + PCB_POLY_ALL_LOOP(PCB->Data); { if (polygon->HoleIndexN > 0) return PCB_FILE_VERSION_HOLES; Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 4969) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 4970) @@ -1827,7 +1827,7 @@ */ free(layer_group_string); PCB = yyPCB; - ALLPOLYGON_LOOP (yyData); + PCB_POLY_ALL_LOOP(yyData); { InitClip (yyData, layer, polygon); } Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 4969) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 4970) @@ -210,7 +210,7 @@ */ free(layer_group_string); PCB = yyPCB; - ALLPOLYGON_LOOP (yyData); + PCB_POLY_ALL_LOOP(yyData); { InitClip (yyData, layer, polygon); } Index: trunk/src_plugins/polycombine/polycombine.c =================================================================== --- trunk/src_plugins/polycombine/polycombine.c (revision 4969) +++ trunk/src_plugins/polycombine/polycombine.c (revision 4970) @@ -283,7 +283,7 @@ poly_tree *this_node; /* First pass to combine the forward and backward contours */ - VISIBLEPOLYGON_LOOP(PCB->Data); + PCB_POLY_VISIBLE_LOOP(PCB->Data); { if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, polygon)) continue; @@ -317,7 +317,7 @@ SaveUndoSerialNumber(); /* Second pass to remove the input polygons */ - VISIBLEPOLYGON_LOOP(PCB->Data); + PCB_POLY_VISIBLE_LOOP(PCB->Data); { if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, polygon)) continue; Index: trunk/src_plugins/polystitch/polystitch.c =================================================================== --- trunk/src_plugins/polystitch/polystitch.c (revision 4969) +++ trunk/src_plugins/polystitch/polystitch.c (revision 4970) @@ -83,10 +83,10 @@ inner_poly = NULL; poly_layer = NULL; - VISIBLEPOLYGON_LOOP(PCB->Data); + PCB_POLY_VISIBLE_LOOP(PCB->Data); { /* layer, polygon */ - POLYGONPOINT_LOOP(polygon); + PCB_POLY_POINT_LOOP(polygon); { /* point */ int dx = x - point->X; @@ -115,7 +115,7 @@ { outer_poly = NULL; - POLYGON_LOOP(poly_layer); + PCB_POLY_LOOP(poly_layer); { if (polygon == inner_poly) continue;