Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4998) +++ trunk/doc-rnd/hacking/renames (revision 4999) @@ -773,3 +773,8 @@ ROTATE_VIA_LOWLEVEL -> PCB_VIA_ROTATE90 ROTATE_PIN_LOWLEVEL -> PCB_PIN_ROTATE90 ROTATE_PAD_LOWLEVEL -> PCB_PAD_ROTATE90 +RotateBoxLowLevel -> pcb_box_rotate90 +RotateObject -> pcb_obj_rotate90 +RotateScreenObject -> pcb_screen_obj_rotate90 +RotatePointLowLevel -> pcb_point_rotate90 +free_rotate -> pcb_rotate Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 4998) +++ trunk/src/action_helper.c (revision 4999) @@ -1131,7 +1131,7 @@ break; case PCB_MODE_ROTATE: - RotateScreenObject(Note.X, Note.Y, gui->shift_is_pressed()? (SWAP_IDENT ? 1 : 3) + pcb_screen_obj_rotate90(Note.X, Note.Y, gui->shift_is_pressed()? (SWAP_IDENT ? 1 : 3) : (SWAP_IDENT ? 3 : 1)); break; Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 4998) +++ trunk/src/buffer.c (revision 4999) @@ -273,7 +273,7 @@ /* finally the origin and the bounding box */ PCB_ROTATE90(Buffer->X, Buffer->Y, Buffer->X, Buffer->Y, Number); - RotateBoxLowLevel(&Buffer->BoundingBox, Buffer->X, Buffer->Y, Number); + pcb_box_rotate90(&Buffer->BoundingBox, Buffer->X, Buffer->Y, Number); } void pcb_buffer_free_rotate(pcb_buffer_t *Buffer, pcb_angle_t angle) @@ -288,7 +288,7 @@ PCB_VIA_LOOP(Buffer->Data); { r_delete_entry(Buffer->Data->via_tree, (pcb_box_t *) via); - free_rotate(&via->X, &via->Y, Buffer->X, Buffer->Y, cosa, sina); + pcb_rotate(&via->X, &via->Y, Buffer->X, Buffer->Y, cosa, sina); pcb_pin_bbox(via); r_insert_entry(Buffer->Data->via_tree, (pcb_box_t *) via, 0); } @@ -305,8 +305,8 @@ PCB_LINE_ALL_LOOP(Buffer->Data); { r_delete_entry(layer->line_tree, (pcb_box_t *) line); - free_rotate(&line->Point1.X, &line->Point1.Y, Buffer->X, Buffer->Y, cosa, sina); - free_rotate(&line->Point2.X, &line->Point2.Y, Buffer->X, Buffer->Y, cosa, sina); + pcb_rotate(&line->Point1.X, &line->Point1.Y, Buffer->X, Buffer->Y, cosa, sina); + pcb_rotate(&line->Point2.X, &line->Point2.Y, Buffer->X, Buffer->Y, cosa, sina); pcb_line_bbox(line); r_insert_entry(layer->line_tree, (pcb_box_t *) line, 0); } @@ -314,7 +314,7 @@ PCB_ARC_ALL_LOOP(Buffer->Data); { r_delete_entry(layer->arc_tree, (pcb_box_t *) arc); - free_rotate(&arc->X, &arc->Y, Buffer->X, Buffer->Y, cosa, sina); + pcb_rotate(&arc->X, &arc->Y, Buffer->X, Buffer->Y, cosa, sina); arc->StartAngle = NormalizeAngle(arc->StartAngle + angle); r_insert_entry(layer->arc_tree, (pcb_box_t *) arc, 0); } @@ -325,7 +325,7 @@ r_delete_entry(layer->polygon_tree, (pcb_box_t *) polygon); PCB_POLY_POINT_LOOP(polygon); { - free_rotate(&point->X, &point->Y, Buffer->X, Buffer->Y, cosa, sina); + pcb_rotate(&point->X, &point->Y, Buffer->X, Buffer->Y, cosa, sina); } END_LOOP; pcb_poly_bbox(polygon); Index: trunk/src/obj_arc.c =================================================================== --- trunk/src/obj_arc.c (revision 4998) +++ trunk/src/obj_arc.c (revision 4999) @@ -537,7 +537,7 @@ Arc->Width = Arc->Height; Arc->Height = save; } - RotateBoxLowLevel(&Arc->BoundingBox, X, Y, Number); + pcb_box_rotate90(&Arc->BoundingBox, X, Y, Number); } /* rotates an arc */ Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 4998) +++ trunk/src/obj_elem.c (revision 4999) @@ -409,8 +409,8 @@ #endif PCB_ELEMENT_PCB_LINE_LOOP(Element); { - free_rotate(&line->Point1.X, &line->Point1.Y, X, Y, cosa, sina); - free_rotate(&line->Point2.X, &line->Point2.Y, X, Y, cosa, sina); + pcb_rotate(&line->Point1.X, &line->Point1.Y, X, Y, cosa, sina); + pcb_rotate(&line->Point2.X, &line->Point2.Y, X, Y, cosa, sina); pcb_line_bbox(line); } END_LOOP; @@ -420,7 +420,7 @@ if (Data) r_delete_entry(Data->pin_tree, (pcb_box_t *) pin); pcb_poly_restore_to_poly(Data, PCB_TYPE_PIN, Element, pin); - free_rotate(&pin->X, &pin->Y, X, Y, cosa, sina); + pcb_rotate(&pin->X, &pin->Y, X, Y, cosa, sina); pcb_pin_bbox(pin); } END_LOOP; @@ -430,19 +430,19 @@ if (Data) r_delete_entry(Data->pad_tree, (pcb_box_t *) pad); pcb_poly_restore_to_poly(Data, PCB_TYPE_PAD, Element, pad); - free_rotate(&pad->Point1.X, &pad->Point1.Y, X, Y, cosa, sina); - free_rotate(&pad->Point2.X, &pad->Point2.Y, X, Y, cosa, sina); + pcb_rotate(&pad->Point1.X, &pad->Point1.Y, X, Y, cosa, sina); + pcb_rotate(&pad->Point2.X, &pad->Point2.Y, X, Y, cosa, sina); pcb_line_bbox((pcb_line_t *) pad); } END_LOOP; PCB_ARC_LOOP(Element); { - free_rotate(&arc->X, &arc->Y, X, Y, cosa, sina); + pcb_rotate(&arc->X, &arc->Y, X, Y, cosa, sina); arc->StartAngle = NormalizeAngle(arc->StartAngle + angle); } END_LOOP; - free_rotate(&Element->MarkX, &Element->MarkY, X, Y, cosa, sina); + pcb_rotate(&Element->MarkX, &Element->MarkY, X, Y, cosa, sina); pcb_element_bbox(Data, Element, &PCB->Font); pcb_poly_clear_from_poly(Data, PCB_TYPE_ELEMENT, Element, Element); } Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 4998) +++ trunk/src/obj_line.c (revision 4999) @@ -654,7 +654,7 @@ } else r_delete_entry(PCB->Data->rat_tree, (pcb_box_t *) Line); - RotatePointLowLevel(Point, ctx->rotate.center_x, ctx->rotate.center_y, ctx->rotate.number); + pcb_point_rotate90(Point, ctx->rotate.center_x, ctx->rotate.center_y, ctx->rotate.number); pcb_line_bbox(Line); if (Layer) { r_insert_entry(Layer->line_tree, (pcb_box_t *) Line, 0); Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 4998) +++ trunk/src/obj_poly.c (revision 4999) @@ -126,7 +126,7 @@ PCB_ROTATE90(point->X, point->Y, X, Y, Number); } END_LOOP; - RotateBoxLowLevel(&Polygon->BoundingBox, X, Y, Number); + pcb_box_rotate90(&Polygon->BoundingBox, X, Y, Number); } Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 4998) +++ trunk/src/obj_text.c (revision 4999) @@ -193,7 +193,7 @@ Text->BoundingBox.Y1 = Text->Y - miny; Text->BoundingBox.X2 = Text->X + maxx; Text->BoundingBox.Y2 = Text->Y - maxy; - RotateBoxLowLevel(&Text->BoundingBox, Text->X, Text->Y, (4 - Text->Direction) & 0x03); + pcb_box_rotate90(&Text->BoundingBox, Text->X, Text->Y, (4 - Text->Direction) & 0x03); } else { Text->BoundingBox.X1 = Text->X + minx; @@ -200,7 +200,7 @@ Text->BoundingBox.Y1 = Text->Y + miny; Text->BoundingBox.X2 = Text->X + maxx; Text->BoundingBox.Y2 = Text->Y + maxy; - RotateBoxLowLevel(&Text->BoundingBox, Text->X, Text->Y, Text->Direction); + pcb_box_rotate90(&Text->BoundingBox, Text->X, Text->Y, Text->Direction); } /* the bounding box covers the extent of influence @@ -439,7 +439,7 @@ pcb_uint8_t number; number = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, Text) ? (4 - Number) & 3 : Number; - RotateBoxLowLevel(&Text->BoundingBox, X, Y, Number); + pcb_box_rotate90(&Text->BoundingBox, X, Y, Number); PCB_ROTATE90(Text->X, Text->Y, X, Y, Number); /* set new direction, 0..3, @@ -524,7 +524,7 @@ defaultsymbol.X2 = PCB_SCALE_TEXT(defaultsymbol.X2 + x, Text->Scale); defaultsymbol.Y2 = PCB_SCALE_TEXT(defaultsymbol.Y2, Text->Scale); - RotateBoxLowLevel(&defaultsymbol, 0, 0, Text->Direction); + pcb_box_rotate90(&defaultsymbol, 0, 0, Text->Direction); /* add offset and draw box */ defaultsymbol.X1 += Text->X; Index: trunk/src/rotate.c =================================================================== --- trunk/src/rotate.c (revision 4998) +++ trunk/src/rotate.c (revision 4999) @@ -70,7 +70,7 @@ /* --------------------------------------------------------------------------- * rotates a point in 90 degree steps */ -void RotatePointLowLevel(pcb_point_t *Point, pcb_coord_t X, pcb_coord_t Y, unsigned Number) +void pcb_point_rotate90(pcb_point_t *Point, pcb_coord_t X, pcb_coord_t Y, unsigned Number) { PCB_ROTATE90(Point->X, Point->Y, X, Y, Number); } @@ -78,7 +78,7 @@ /* --------------------------------------------------------------------------- * rotates a box in 90 degree steps */ -void RotateBoxLowLevel(pcb_box_t *Box, pcb_coord_t X, pcb_coord_t Y, unsigned Number) +void pcb_box_rotate90(pcb_box_t *Box, pcb_coord_t X, pcb_coord_t Y, unsigned Number) { pcb_coord_t x1 = Box->X1, y1 = Box->Y1, x2 = Box->X2, y2 = Box->Y2; @@ -94,7 +94,7 @@ * rotates an objects at the cursor position as identified by its ID * the center of rotation is determined by the current cursor location */ -void *RotateObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t X, pcb_coord_t Y, unsigned Steps) +void *pcb_obj_rotate90(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t X, pcb_coord_t Y, unsigned Steps) { pcb_rubberband_t *ptr; void *ptr2; @@ -120,7 +120,7 @@ } else r_delete_entry(PCB->Data->rat_tree, (pcb_box_t *) ptr->Line); - RotatePointLowLevel(ptr->MovedPoint, ctx.rotate.center_x, ctx.rotate.center_y, Steps); + pcb_point_rotate90(ptr->MovedPoint, ctx.rotate.center_x, ctx.rotate.center_y, Steps); pcb_line_bbox(ptr->Line); if (ptr->Layer) { r_insert_entry(ptr->Layer->line_tree, (pcb_box_t *) ptr->Line, 0); @@ -144,7 +144,7 @@ return (ptr2); } -void RotateScreenObject(pcb_coord_t X, pcb_coord_t Y, unsigned Steps) +void pcb_screen_obj_rotate90(pcb_coord_t X, pcb_coord_t Y, unsigned Steps) { int type; void *ptr1, *ptr2, *ptr3; @@ -158,7 +158,7 @@ LookupRubberbandLines(type, ptr1, ptr2, ptr3); if (type == PCB_TYPE_ELEMENT) LookupRatLines(type, ptr1, ptr2, ptr3); - RotateObject(type, ptr1, ptr2, ptr3, X, Y, Steps); + pcb_obj_rotate90(type, ptr1, ptr2, ptr3, X, Y, Steps); SetChangedFlag(pcb_true); } } Index: trunk/src/rotate.h =================================================================== --- trunk/src/rotate.h (revision 4998) +++ trunk/src/rotate.h (revision 4999) @@ -92,14 +92,14 @@ #define ROTATE_TYPES (PCB_TYPE_ELEMENT | PCB_TYPE_TEXT | PCB_TYPE_ELEMENT_NAME | PCB_TYPE_ARC) -void RotateBoxLowLevel(pcb_box_t *, pcb_coord_t, pcb_coord_t, unsigned); +void pcb_box_rotate90(pcb_box_t *, pcb_coord_t, pcb_coord_t, unsigned); void pcb_poly_rotate90(pcb_polygon_t *, pcb_coord_t, pcb_coord_t, unsigned); -void *RotateObject(int, void *, void *, void *, pcb_coord_t, pcb_coord_t, unsigned); -void RotateScreenObject(pcb_coord_t, pcb_coord_t, unsigned); +void *pcb_obj_rotate90(int, void *, void *, void *, pcb_coord_t, pcb_coord_t, unsigned); +void pcb_screen_obj_rotate90(pcb_coord_t, pcb_coord_t, unsigned); -void RotatePointLowLevel(pcb_point_t *Point, pcb_coord_t X, pcb_coord_t Y, unsigned Number); +void pcb_point_rotate90(pcb_point_t *Point, pcb_coord_t X, pcb_coord_t Y, unsigned Number); -static inline PCB_FUNC_UNUSED void free_rotate(pcb_coord_t * x, pcb_coord_t * y, pcb_coord_t cx, pcb_coord_t cy, double cosa, double sina) +static inline PCB_FUNC_UNUSED void pcb_rotate(pcb_coord_t * x, pcb_coord_t * y, pcb_coord_t cx, pcb_coord_t cy, double cosa, double sina) { double nx, ny; pcb_coord_t px = *x - cx; Index: trunk/src/undo.c =================================================================== --- trunk/src/undo.c (revision 4998) +++ trunk/src/undo.c (revision 4999) @@ -267,7 +267,7 @@ /* lookup entry by it's ID */ type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind); if (type != PCB_TYPE_NONE) { - RotateObject(type, ptr1, ptr2, ptr3, + pcb_obj_rotate90(type, ptr1, ptr2, ptr3, Entry->Data.Rotate.CenterX, Entry->Data.Rotate.CenterY, (4 - Entry->Data.Rotate.Steps) & 0x03); Entry->Data.Rotate.Steps = (4 - Entry->Data.Rotate.Steps) & 0x03; return (pcb_true); Index: trunk/src_plugins/propedit/propsel.c =================================================================== --- trunk/src_plugins/propedit/propsel.c (revision 4998) +++ trunk/src_plugins/propedit/propsel.c (revision 4999) @@ -300,7 +300,7 @@ } else delta = st->d; - if (RotateObject(type, layer_or_element, text, text, text->X, text->Y, delta) != NULL) + if (pcb_obj_rotate90(type, layer_or_element, text, text, text->X, text->Y, delta) != NULL) DONE; } } Index: trunk/src_plugins/stroke/stroke.c =================================================================== --- trunk/src_plugins/stroke/stroke.c (revision 4998) +++ trunk/src_plugins/stroke/stroke.c (revision 4999) @@ -67,13 +67,13 @@ case 987412: case 8741236: case 874123: - RotateScreenObject(StrokeBox.X1, StrokeBox.Y1, SWAP_IDENT ? 1 : 3); + pcb_screen_obj_rotate90(StrokeBox.X1, StrokeBox.Y1, SWAP_IDENT ? 1 : 3); break; case 7896321: case 786321: case 789632: case 896321: - RotateScreenObject(StrokeBox.X1, StrokeBox.Y1, SWAP_IDENT ? 3 : 1); + pcb_screen_obj_rotate90(StrokeBox.X1, StrokeBox.Y1, SWAP_IDENT ? 3 : 1); break; case 258: SetMode(PCB_MODE_LINE);