src/toporouter.h: Converted plain comments into doxygen comments.
[geda-pcb/pcjc2.git] / src / move.h
blob4c2c98abe177935a5ee9267aba4df518eaa2f575
1 /*!
2 * \file src/move.h
4 * \brief Prototypes for move routines.
6 * <hr>
8 * <h1><b>Copyright.</b></h1>\n
10 * PCB, interactive printed circuit board design
12 * Copyright (C) 1994,1995,1996 Thomas Nau
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 * Contact addresses for paper mail and Email:
30 * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
32 * Thomas.Nau@rz.uni-ulm.de
35 #ifndef PCB_MOVE_H
36 #define PCB_MOVE_H
38 #include "global.h"
40 /* ---------------------------------------------------------------------------
41 * some useful transformation macros and constants
43 #define MOVE(xs,ys,deltax,deltay) \
44 { \
45 ((xs) += (deltax)); \
46 ((ys) += (deltay)); \
48 #define MOVE_BOX_LOWLEVEL(b,dx,dy) \
49 { \
50 MOVE((b)->X1,(b)->Y1,(dx),(dy)) \
51 MOVE((b)->X2,(b)->Y2,(dx),(dy)) \
53 #define MOVE_VIA_LOWLEVEL(v,dx,dy) \
54 { \
55 MOVE((v)->X,(v)->Y,(dx),(dy)) \
56 MOVE_BOX_LOWLEVEL(&((v)->BoundingBox),(dx),(dy)); \
58 #define MOVE_PIN_LOWLEVEL(p,dx,dy) \
59 { \
60 MOVE((p)->X,(p)->Y,(dx),(dy)) \
61 MOVE_BOX_LOWLEVEL(&((p)->BoundingBox),(dx),(dy)); \
64 #define MOVE_ARC_LOWLEVEL(a,dx,dy) \
65 { \
66 MOVE((a)->X,(a)->Y,(dx),(dy)) \
67 MOVE_BOX_LOWLEVEL(&((a)->BoundingBox),(dx),(dy)); \
68 MOVE((a)->Point1.X,(a)->Point1.Y,(dx),(dy)) \
69 MOVE((a)->Point2.X,(a)->Point2.Y,(dx),(dy)) \
71 /* Rather than mode the line bounding box, we set it so the point bounding
72 * boxes are updated too.
74 #define MOVE_LINE_LOWLEVEL(l,dx,dy) \
75 { \
76 MOVE((l)->Point1.X,(l)->Point1.Y,(dx),(dy)) \
77 MOVE((l)->Point2.X,(l)->Point2.Y,(dx),(dy)) \
78 SetLineBoundingBox ((l)); \
80 #define MOVE_PAD_LOWLEVEL(p,dx,dy) \
81 { \
82 MOVE((p)->Point1.X,(p)->Point1.Y,(dx),(dy)) \
83 MOVE((p)->Point2.X,(p)->Point2.Y,(dx),(dy)) \
84 SetPadBoundingBox ((p)); \
86 #define MOVE_TEXT_LOWLEVEL(t,dx,dy) \
87 { \
88 MOVE_BOX_LOWLEVEL(&((t)->BoundingBox),(dx),(dy)); \
89 MOVE((t)->X, (t)->Y, (dx), (dy)); \
92 #define MOVE_TYPES \
93 (VIA_TYPE | LINE_TYPE | TEXT_TYPE | ELEMENT_TYPE | ELEMENTNAME_TYPE | \
94 POLYGON_TYPE | POLYGONPOINT_TYPE | LINEPOINT_TYPE | ARC_TYPE)
95 #define MOVETOLAYER_TYPES \
96 (LINE_TYPE | TEXT_TYPE | POLYGON_TYPE | RATLINE_TYPE | ARC_TYPE)
99 /* ---------------------------------------------------------------------------
100 * prototypes
102 void MovePolygonLowLevel (PolygonType *, Coord, Coord);
103 void MoveElementLowLevel (DataType *, ElementType *, Coord, Coord);
104 void *MoveObject (int, void *, void *, void *, Coord, Coord);
105 void *MoveObjectToLayer (int, void *, void *, void *, LayerType *, bool);
106 void *MoveObjectAndRubberband (int, void *, void *, void *,
107 Coord, Coord);
108 bool MoveSelectedObjectsToLayer (LayerType *);
110 int MoveLayer(int old_index, int new_index);
112 #endif