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
28 /* prototypes for move routines
36 /* ---------------------------------------------------------------------------
37 * some useful transformation macros and constants
39 #define MOVE(xs,ys,deltax,deltay) \
44 #define MOVE_BOX_LOWLEVEL(b,dx,dy) \
46 MOVE((b)->X1,(b)->Y1,(dx),(dy)) \
47 MOVE((b)->X2,(b)->Y2,(dx),(dy)) \
49 #define MOVE_VIA_LOWLEVEL(v,dx,dy) \
51 MOVE((v)->X,(v)->Y,(dx),(dy)) \
52 MOVE_BOX_LOWLEVEL(&((v)->BoundingBox),(dx),(dy)); \
54 #define MOVE_PIN_LOWLEVEL(p,dx,dy) \
56 MOVE((p)->X,(p)->Y,(dx),(dy)) \
57 MOVE_BOX_LOWLEVEL(&((p)->BoundingBox),(dx),(dy)); \
60 #define MOVE_ARC_LOWLEVEL(a,dx,dy) \
62 MOVE((a)->X,(a)->Y,(dx),(dy)) \
63 MOVE_BOX_LOWLEVEL(&((a)->BoundingBox),(dx),(dy)); \
64 MOVE((a)->Point1.X,(a)->Point1.Y,(dx),(dy)) \
65 MOVE((a)->Point2.X,(a)->Point2.Y,(dx),(dy)) \
67 /* Rather than mode the line bounding box, we set it so the point bounding
68 * boxes are updated too.
70 #define MOVE_LINE_LOWLEVEL(l,dx,dy) \
72 MOVE((l)->Point1.X,(l)->Point1.Y,(dx),(dy)) \
73 MOVE((l)->Point2.X,(l)->Point2.Y,(dx),(dy)) \
74 SetLineBoundingBox ((l)); \
76 #define MOVE_PAD_LOWLEVEL(p,dx,dy) \
78 MOVE((p)->Point1.X,(p)->Point1.Y,(dx),(dy)) \
79 MOVE((p)->Point2.X,(p)->Point2.Y,(dx),(dy)) \
80 SetPadBoundingBox ((p)); \
82 #define MOVE_TEXT_LOWLEVEL(t,dx,dy) \
84 MOVE_BOX_LOWLEVEL(&((t)->BoundingBox),(dx),(dy)); \
85 MOVE((t)->X, (t)->Y, (dx), (dy)); \
89 (VIA_TYPE | LINE_TYPE | TEXT_TYPE | ELEMENT_TYPE | ELEMENTNAME_TYPE | \
90 POLYGON_TYPE | POLYGONPOINT_TYPE | LINEPOINT_TYPE | ARC_TYPE)
91 #define MOVETOLAYER_TYPES \
92 (LINE_TYPE | TEXT_TYPE | POLYGON_TYPE | RATLINE_TYPE | ARC_TYPE)
95 /* ---------------------------------------------------------------------------
98 void MovePolygonLowLevel (PolygonTypePtr
, Coord
, Coord
);
99 void MoveElementLowLevel (DataTypePtr
, ElementTypePtr
, Coord
, Coord
);
100 void *MoveObject (int, void *, void *, void *, Coord
, Coord
);
101 void *MoveObjectToLayer (int, void *, void *, void *, LayerTypePtr
, bool);
102 void *MoveObjectAndRubberband (int, void *, void *, void *,
104 bool MoveSelectedObjectsToLayer (LayerTypePtr
);
106 /* index is 0..MAX_LAYER-1. If old_index is -1, a new layer is
107 inserted at that index. If new_index is -1, the specified layer is
108 deleted. Returns non-zero on error, zero if OK. */
109 int MoveLayer(int old_index
, int new_index
);