Repopulate route style selector on PCBChanged action
[geda-pcb/whiteaudio.git] / src / rotate.h
blob7748b19cabba0056bfe88989dd389cc124cf499a
1 /*
2 * COPYRIGHT
4 * PCB, interactive printed circuit board design
5 * Copyright (C) 1994,1995,1996 Thomas Nau
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Contact addresses for paper mail and Email:
22 * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
23 * Thomas.Nau@rz.uni-ulm.de
25 * RCS: $Id$
28 /* prototypes for transform routines
31 #ifndef PCB_ROTATE_H
32 #define PCB_ROTATE_H
34 #include "global.h"
36 /* ---------------------------------------------------------------------------
37 * some useful transformation macros and constants
39 #define ROTATE(x,y,x0,y0,n) \
40 { \
41 Coord dx = (x)-(x0), \
42 dy = (y)-(y0); \
44 switch(n & 0x03) \
45 { \
46 case 1: (x)=(x0)+dy; (y)=(y0)-dx; \
47 break; \
48 case 2: (x)=(x0)-dx; (y)=(y0)-dy; \
49 break; \
50 case 3: (x)=(x0)-dy; (y)=(y0)+dx; \
51 break; \
52 default: break; \
53 } \
55 #define ROTATE_VIA_LOWLEVEL(v,x0,y0,n) ROTATE((v)->X,(v)->Y,(x0),(y0),(n))
56 #define ROTATE_PIN_LOWLEVEL(p,x0,y0,n) ROTATE((p)->X,(p)->Y,(x0),(y0),(n))
57 #define ROTATE_PAD_LOWLEVEL(p,x0,y0,n) \
58 RotateLineLowLevel(((LineTypePtr) (p)),(x0),(y0),(n))
60 #define ROTATE_TYPES (ELEMENT_TYPE | TEXT_TYPE | ELEMENTNAME_TYPE | ARC_TYPE)
63 void RotateLineLowLevel (LineTypePtr, Coord, Coord, unsigned);
64 void RotateArcLowLevel (ArcTypePtr, Coord, Coord, unsigned);
65 void RotateBoxLowLevel (BoxTypePtr, Coord, Coord, unsigned);
66 void RotateTextLowLevel (TextTypePtr, Coord, Coord, unsigned);
67 void RotatePolygonLowLevel (PolygonTypePtr, Coord, Coord, unsigned);
68 void RotateElementLowLevel (DataTypePtr, ElementTypePtr, Coord, Coord, unsigned);
69 void *RotateObject (int, void *, void *, void *, Coord, Coord,
70 unsigned);
71 void RotateScreenObject (Coord, Coord, unsigned);
73 #endif