~ubuntu-branches/ubuntu/precise/pcb/precise

« back to all changes in this revision

Viewing changes to src/global.h

  • Committer: Bazaar Package Importer
  • Author(s): Hamish Moffatt
  • Date: 2005-02-20 13:14:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050220131400-pfz66g5vhx0azl8f
Tags: 1.99j+20050127-2
* Improved package description: (closes: #295405)
* Fixed dependency: tk84 -> tk8.4 (closes: #295404)
* Updated README.debian (closes: #269578)
* Applied patch to src/djopt.c to allow compilation with gcc-4.0
  (closes: #294319), thanks to Andreas Jochens for the patch.
* Prevent example files from being compressed

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 *                            COPYRIGHT
3
3
 *
4
4
 *  PCB, interactive printed circuit board design
5
 
 *  Copyright (C) 1994,1995,1996 Thomas Nau
 
5
 *  Copyright (C) 1994,1995,1996, 2004 Thomas Nau
6
6
 *
7
7
 *  This program is free software; you can redistribute it and/or modify
8
8
 *  it under the terms of the GNU General Public License as published by
22
22
 *  Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
23
23
 *  Thomas.Nau@rz.uni-ulm.de
24
24
 *
25
 
 *  RCS: $Id: global.h,v 1.6 1998/02/24 22:54:47 cad Exp $
 
25
 *  RCS: $Id: global.h,v 1.28 2005/01/03 12:56:59 danmc Exp $
26
26
 */
27
27
 
28
28
/* definition of types
47
47
#include <X11/Intrinsic.h>
48
48
#include <X11/StringDefs.h>
49
49
#include <X11/keysym.h>
 
50
typedef int LocationType;
 
51
typedef int BDimension;         /* big dimension */
50
52
 
51
53
/* ---------------------------------------------------------------------------
52
54
 * do not change the following definition even if it's not very nice.
54
56
 * their coordinates as a line.
55
57
 */
56
58
#define LINESTRUCT                      \
57
 
        int             ID,             \
 
59
        long int                ID,             \
58
60
                        Flags;          \
 
61
        BDimension      Thickness,      \
 
62
                        Clearance;      \
59
63
        PointType       Point1,         \
60
 
                        Point2;         \
61
 
        Dimension       Thickness, Clearance;
 
64
                        Point2;
62
65
 
63
66
/* ---------------------------------------------------------------------------
64
67
 * some useful values of our widgets
65
68
 */
66
 
typedef struct                          /* holds information about output window */
 
69
typedef struct                  /* holds information about output window */
67
70
{
68
 
        Widget          Toplevel,       /* toplevel widget */
69
 
                        StatusLine,     /* label widget of statusline */
70
 
                        CursorPosition, /* current cursor position */
71
 
                        Control,        /* control widget */
72
 
                        Menu,           /* popup menu */
73
 
                        Message,        /* fields for user message */
74
 
                        MasterForm,     /* the widgets thats hols all the others */
75
 
                        Porthole,       /* porthole widget to pan output */
76
 
                        panner,         /* panner widget for panning */
77
 
                        Output;         /* simple widget for drawing */
78
 
        Window          OutputWindow;   /* window ID of simple widget */
79
 
        GC              bgGC,           /* background and foreground; */
80
 
                        fgGC,           /* changed from some routines */
81
 
                        pmGC,           /* pixmap GC to store clip */
82
 
                        GridGC;         /* for the grid */
83
 
        Dimension       cw,             /* canvas width/height */
84
 
                        ch,
85
 
                        Width,          /* sizes of output window (porthole) */
86
 
                        Height;
87
 
        Cursor          XCursor;        /* used X cursor */
88
 
        unsigned int    XCursorShape;   /* and its shape (cursorfont) */
89
 
        Boolean         VisibilityOK;   /* output is completely visible */
 
71
  Widget Toplevel,              /* toplevel widget */
 
72
    StatusLine,                 /* label widget of statusline */
 
73
    CursorPosition,             /* current cursor position */
 
74
    Control,                    /* control widget */
 
75
    Menu,                       /* popup menu */
 
76
    Message,                    /* fields for user message */
 
77
    MasterForm,                 /* the widgets thats hols all the others */
 
78
    Porthole,                   /* porthole widget to pan output */
 
79
    panner,                     /* panner widget for panning */
 
80
    Output;                     /* simple widget for drawing */
 
81
  Window OutputWindow;          /* window ID of simple widget */
 
82
  GC bgGC,                      /* background and foreground; */
 
83
    fgGC,                       /* changed from some routines */
 
84
    pmGC,                       /* pixmap GC to store clip */
 
85
    GridGC;                     /* for the grid */
 
86
  BDimension cw,                /* canvas width/height */
 
87
    ch, Width,                  /* sizes of output window (porthole) */
 
88
    Height;
 
89
  Cursor XCursor;               /* used X cursor */
 
90
  unsigned long int XCursorShape;       /* and its shape (cursorfont) */
 
91
  Boolean VisibilityOK;         /* output is completely visible */
90
92
} OutputType, *OutputTypePtr;
91
93
 
92
94
/* ----------------------------------------------------------------------
95
97
 */
96
98
typedef struct
97
99
{
98
 
        Cardinal        Number[MAX_LAYER],      /* number of entries per groups */
99
 
                        Entries[MAX_LAYER][MAX_LAYER+2];
 
100
  Cardinal Number[MAX_LAYER],   /* number of entries per groups */
 
101
    Entries[MAX_LAYER][MAX_LAYER + 2];
100
102
} LayerGroupType, *LayerGroupTypePtr;
101
103
 
102
 
typedef struct                          /* a bounding box */
 
104
typedef struct                  /* a bounding box */
103
105
{
104
 
        Position        X1, Y1,         /* upper left */
105
 
                        X2, Y2;         /* and lower right corner */
 
106
  LocationType X1, Y1,          /* upper left */
 
107
    X2, Y2;                     /* and lower right corner */
106
108
} BoxType, *BoxTypePtr;
107
109
 
108
110
/* ---------------------------------------------------------------------------
109
111
 * the basic object types supported by PCB
110
112
 */
111
 
typedef struct                          /* all objects start with an ID */
 
113
typedef struct                  /* all objects start with a Bounding box and ID */
112
114
{
113
 
        int             ID;
 
115
  BoxType BoundingBox;
 
116
  long int ID;
114
117
} AnyObjectType, *AnyObjectTypePtr;
115
118
 
116
 
typedef struct                          /* a line/polygon point */
 
119
typedef struct                  /* a line/polygon point */
117
120
{
118
 
        int             ID;
119
 
        Position        X,
120
 
                        Y;
 
121
  LocationType X, Y, X2, Y2;    /* so Point type can be cast as BoxType */
 
122
  long int ID;
121
123
} PointType, *PointTypePtr;
122
124
 
123
 
typedef struct                          /* holds information about one line */
 
125
typedef struct                  /* holds information about one line */
124
126
{
125
 
        LINESTRUCT
 
127
  BoxType BoundingBox;
 
128
  LINESTRUCT char *Number;
126
129
} LineType, *LineTypePtr;
127
130
 
128
131
typedef struct
129
132
{
130
 
        int             ID,
131
 
                        Flags;
132
 
        Position        X,              /* origin */
133
 
                        Y;
134
 
        BoxType         BoundingBox;
135
 
        BYTE            Direction;
136
 
        Dimension       Scale;          /* text scaling in percent */
137
 
        char            *TextString;    /* string */
 
133
  BoxType BoundingBox;
 
134
  long int ID, Flags;
 
135
  BDimension Scale;             /* text scaling in percent */
 
136
  LocationType X,                       /* origin */
 
137
    Y;
 
138
  BYTE Direction;
 
139
  char *TextString;             /* string */
 
140
  void *Element;
138
141
} TextType, *TextTypePtr;
139
142
 
140
143
typedef struct                  /* holds information about a polygon */
141
144
{
142
 
        int             ID,
143
 
                        Flags;
144
 
        BoxType         BoundingBox;
145
 
        Cardinal        PointN,         /* number of points in polygon */
146
 
                        PointMax;       /* max number from malloc() */
147
 
        PointTypePtr    Points;         /* data */
 
145
  BoxType BoundingBox;
 
146
  long int ID, Flags;
 
147
  Cardinal PointN,              /* number of points in polygon */
 
148
    PointMax;                   /* max number from malloc() */
 
149
  PointTypePtr Points;          /* data */
148
150
} PolygonType, *PolygonTypePtr;
149
151
 
150
 
typedef struct                          /* holds information about arcs */
 
152
typedef struct                  /* holds information about arcs */
151
153
{
152
 
        int             ID,             /* these fields are unused when contained in elements */
153
 
                        Flags;
154
 
        Position        X,              /* center coordinates */
155
 
                        Y;
156
 
        Dimension       Width,          /* length of axis */
157
 
                        Height,
158
 
                        Thickness,
159
 
                        Clearance;
160
 
        int             StartAngle,     /* the two limiting angles in degrees */
161
 
                        Delta;  
162
 
        BoxType         BoundingBox;    /* only filled in for arcs on layers */
 
154
  BoxType BoundingBox;
 
155
  long int ID,                  /* these fields are unused when contained in elements */
 
156
    Flags;
 
157
  BDimension Thickness, Clearance;
 
158
  LocationType Width,           /* length of axis */
 
159
    Height, X,                  /* center coordinates */
 
160
    Y;
 
161
  long int StartAngle,          /* the two limiting angles in degrees */
 
162
    Delta;
163
163
} ArcType, *ArcTypePtr;
164
164
 
 
165
typedef struct
 
166
{
 
167
  struct rtree_node *root;
 
168
  int size;                     /* number of entries in tree */
 
169
} rtree_t;
 
170
 
165
171
typedef struct                  /* holds information about one layer */
166
172
{
167
 
        char            *Name;          /* layer name */
168
 
        Cardinal        LineN,          /* number of lines */
169
 
                        TextN,          /* labels */
170
 
                        PolygonN,       /* polygons */
171
 
                        ArcN,           /* and arcs */
172
 
                        LineMax,        /* max number from malloc() */
173
 
                        TextMax,
174
 
                        PolygonMax,
175
 
                        ArcMax;
176
 
        LineTypePtr     Line;           /* pointer to additional structures */
177
 
        TextTypePtr     Text;
178
 
        PolygonTypePtr  Polygon;
179
 
        ArcTypePtr      Arc;
180
 
        Boolean         On;             /* visible flag */
181
 
        Pixel           Color,          /* color */
182
 
                        SelectedColor;
 
173
  char *Name;                   /* layer name */
 
174
  Cardinal LineN,               /* number of lines */
 
175
    TextN,                      /* labels */
 
176
    PolygonN,                   /* polygons */
 
177
    ArcN,                       /* and arcs */
 
178
    LineMax,                    /* max number from malloc() */
 
179
    TextMax, PolygonMax, ArcMax;
 
180
  LineTypePtr Line;             /* pointer to additional structures */
 
181
  TextTypePtr Text;
 
182
  PolygonTypePtr Polygon;
 
183
  ArcTypePtr Arc;
 
184
  rtree_t *line_tree, *text_tree, *polygon_tree, *arc_tree;
 
185
  Boolean On;                   /* visible flag */
 
186
  Pixel Color,                  /* color */
 
187
    SelectedColor;
183
188
} LayerType, *LayerTypePtr;
184
189
 
185
 
typedef struct                          /* a rat-line */
 
190
typedef struct                  /* a rat-line */
186
191
{
187
 
        LINESTRUCT
188
 
        Cardinal group1, group2;        /* the layer group each point is on */
 
192
  BoxType BoundingBox;
 
193
  LINESTRUCT Cardinal group1, group2;   /* the layer group each point is on */
189
194
} RatType, *RatTypePtr;
190
195
 
191
 
typedef struct                          /* a SMD pad */
 
196
typedef struct                  /* a SMD pad */
192
197
{
193
 
        LINESTRUCT
194
 
        Dimension       Mask;
195
 
        char            *Name, *Number;                 /* 'Line' */
196
 
        void            *Spare;
 
198
  BoxType BoundingBox;
 
199
  LINESTRUCT BDimension Mask;
 
200
  char *Name, *Number;          /* 'Line' */
 
201
  void *Element;
 
202
  void *Spare;
197
203
} PadType, *PadTypePtr;
198
204
 
199
205
typedef struct
200
206
{
201
 
        int             ID,
202
 
                        Flags;
203
 
        Position        X,                      /* center and diameter */
204
 
                        Y;
205
 
        Dimension       Thickness,
206
 
                        Clearance,
207
 
                        Mask,
208
 
                        DrillingHole;
209
 
        char            *Name, *Number;
210
 
        void            *Spare;
 
207
  BoxType BoundingBox;
 
208
  long int ID, Flags;
 
209
  BDimension Thickness, Clearance, Mask, DrillingHole;
 
210
  LocationType X,                       /* center and diameter */
 
211
    Y;
 
212
  char *Name, *Number;
 
213
  void *Element;
 
214
  void *Spare;
211
215
} PinType, *PinTypePtr, **PinTypeHandle;
212
216
 
213
217
typedef struct
214
218
{
215
 
        int             ID,
216
 
                        Flags;
217
 
        TextType        Name[MAX_ELEMENTNAMES]; /* the elements names; */
218
 
                                                /* description text */
219
 
                                                /* name on PCB second, */
220
 
                                                /* value third */
221
 
                                                /* see macro.h */
222
 
        Position        MarkX,          /* position mark */
223
 
                        MarkY;
224
 
        BoxType         BoundingBox;
225
 
        Cardinal        PinN,           /* number of pins, lines and arcs */
226
 
                        PinMax,
227
 
                        PadN,
228
 
                        PadMax,
229
 
                        LineN,
230
 
                        LineMax,
231
 
                        ArcN,
232
 
                        ArcMax;
233
 
        PinTypePtr      Pin;            /* pin description */
234
 
        PadTypePtr      Pad;            /* pad description of SMD components */
235
 
        LineTypePtr     Line;
236
 
        ArcTypePtr      Arc;
 
219
  BoxType BoundingBox;
 
220
  long int ID, Flags;
 
221
  TextType Name[MAX_ELEMENTNAMES];      /* the elements names; */
 
222
  /* description text */
 
223
  /* name on PCB second, */
 
224
  /* value third */
 
225
  /* see macro.h */
 
226
  LocationType MarkX,           /* position mark */
 
227
    MarkY;
 
228
  Cardinal PinN,                /* number of pins, lines and arcs */
 
229
    PinMax, PadN, PadMax, LineN, LineMax, ArcN, ArcMax;
 
230
  PinTypePtr Pin;               /* pin description */
 
231
  PadTypePtr Pad;               /* pad description of SMD components */
 
232
  LineTypePtr Line;
 
233
  ArcTypePtr Arc;
 
234
  BoxType VBox;
237
235
} ElementType, *ElementTypePtr, **ElementTypeHandle;
238
236
 
239
237
/* ---------------------------------------------------------------------------
240
238
 * symbol and font related stuff
241
239
 */
242
 
typedef struct                          /* a single symbol */
 
240
typedef struct                  /* a single symbol */
243
241
{
244
 
        LineTypePtr     Line;
245
 
        Boolean         Valid;
246
 
        Cardinal        LineN,          /* number of lines */
247
 
                        LineMax;
248
 
        Dimension       Width,          /* size of cell */
249
 
                        Height,
250
 
                        Delta;          /* distance to next symbol in 0.001'' */
 
242
  LineTypePtr Line;
 
243
  Boolean Valid;
 
244
  Cardinal LineN,               /* number of lines */
 
245
    LineMax;
 
246
  BDimension Width,             /* size of cell */
 
247
    Height, Delta;              /* distance to next symbol in 0.00001'' */
251
248
} SymbolType, *SymbolTypePtr;
252
249
 
253
 
typedef struct                          /* complete set of symbols */
 
250
typedef struct                  /* complete set of symbols */
254
251
{
255
 
        Dimension       MaxHeight,      /* maximum cell width and height */
256
 
                        MaxWidth;
257
 
        BoxType         DefaultSymbol;  /* the default symbol is a filled box */
258
 
        SymbolType      Symbol[MAX_FONTPOSITION+1];
259
 
        Boolean         Valid;
 
252
  LocationType MaxHeight,               /* maximum cell width and height */
 
253
    MaxWidth;
 
254
  BoxType DefaultSymbol;        /* the default symbol is a filled box */
 
255
  SymbolType Symbol[MAX_FONTPOSITION + 1];
 
256
  Boolean Valid;
260
257
} FontType, *FontTypePtr;
261
258
 
262
259
typedef struct                  /* holds all objects */
263
260
{
264
 
        Cardinal        ViaN,                   /* number of vias */
265
 
                        ViaMax,                 /* max number from malloc() */
266
 
                        ElementN,               /* and elements */
267
 
                        ElementMax,             /* max number from malloc() */
268
 
                        RatN,                   /* and rat-lines */
269
 
                        RatMax;
270
 
        PinTypePtr      Via;                    /* pointer to object data */
271
 
        ElementTypePtr  Element;
272
 
        RatTypePtr      Rat;
273
 
        LayerType       Layer[MAX_LAYER + 2];   /* add 2 silkscreen layers */
 
261
  Cardinal ViaN,                /* number of vias */
 
262
    ViaMax,                     /* max number from malloc() */
 
263
    ElementN,                   /* and elements */
 
264
    ElementMax,                 /* max number from malloc() */
 
265
    RatN,                       /* and rat-lines */
 
266
    RatMax;
 
267
  PinTypePtr Via;               /* pointer to object data */
 
268
  ElementTypePtr Element;
 
269
  RatTypePtr Rat;
 
270
  rtree_t *via_tree, *element_tree, *pin_tree, *pad_tree, *name_tree[3],        /* for element names */
 
271
   *rat_tree;
 
272
  LayerType Layer[MAX_LAYER + 2];       /* add 2 silkscreen layers */
274
273
} DataType, *DataTypePtr;
275
274
 
276
 
typedef struct                                /* holds drill information */
277
 
{
278
 
      Dimension       DrillSize;      /* this drill's diameter */
279
 
      Cardinal        ElementN,       /* the number of elements using this drill size */
280
 
                      ElementMax,             /* max number of elements from malloc() */
281
 
                      PinCount,               /* number of pins drilled this size */
282
 
                      ViaCount,               /* number of vias drilled this size */
283
 
                      UnplatedCount,    /* number of these holes that are unplated */
284
 
                      PinN,                   /* number of drill coordinates in the list */
285
 
                      PinMax;                 /* max number of coordinates from malloc() */
286
 
      PinTypePtr      *Pin;           /* coordinates to drill */
287
 
      ElementTypePtr  *Element;       /* a pointer to an array of element pointers */
288
 
} DrillType, *DrillTypePtr;   
289
 
              
290
 
typedef struct                                /* holds a range of Drill Infos */
291
 
292
 
      Cardinal          DrillN,         /* number of drill sizes */
293
 
                        DrillMax;       /* max number from malloc() */
294
 
      DrillTypePtr      Drill;          /* plated holes */
295
 
} DrillInfoType, *DrillInfoTypePtr;   
 
275
typedef struct                  /* holds drill information */
 
276
{
 
277
  BDimension DrillSize;         /* this drill's diameter */
 
278
  Cardinal ElementN,            /* the number of elements using this drill size */
 
279
    ElementMax,                 /* max number of elements from malloc() */
 
280
    PinCount,                   /* number of pins drilled this size */
 
281
    ViaCount,                   /* number of vias drilled this size */
 
282
    UnplatedCount,              /* number of these holes that are unplated */
 
283
    PinN,                       /* number of drill coordinates in the list */
 
284
    PinMax;                     /* max number of coordinates from malloc() */
 
285
  PinTypePtr *Pin;              /* coordinates to drill */
 
286
  ElementTypePtr *Element;      /* a pointer to an array of element pointers */
 
287
} DrillType, *DrillTypePtr;
 
288
 
 
289
typedef struct                  /* holds a range of Drill Infos */
 
290
{
 
291
  Cardinal DrillN,              /* number of drill sizes */
 
292
    DrillMax;                   /* max number from malloc() */
 
293
  DrillTypePtr Drill;           /* plated holes */
 
294
} DrillInfoType, *DrillInfoTypePtr;
296
295
 
297
296
typedef struct
298
297
{
299
 
        Dimension       Thick,          /* line thickness */
300
 
                        Diameter,       /* via diameter */
301
 
                        Hole;           /* via drill hole */
302
 
        char            *Name;
 
298
  BDimension Thick,             /* line thickness */
 
299
    Diameter,                   /* via diameter */
 
300
    Hole,                       /* via drill hole */
 
301
    Keepaway;                   /* min. separation from other nets */
 
302
  char *Name;
303
303
} RouteStyleType, *RouteStyleTypePtr;
304
304
 
305
305
/* ---------------------------------------------------------------------------
307
307
 */
308
308
typedef struct
309
309
{
310
 
        char    *ListEntry;             /* the string for the selection box */
311
 
        char    *AllocatedMemory,       /* pointer to allocated memory; all others */
312
 
                                        /* point to parts of the string */
313
 
                *Template,              /* m4 template name */
314
 
                *Package,               /* package */
315
 
                *Value,                 /* the value field */
316
 
                *Description;           /* some descritional text */
 
310
  char *ListEntry;              /* the string for the selection box */
 
311
  char *AllocatedMemory,        /* pointer to allocated memory; all others */
 
312
    /* point to parts of the string */
 
313
   *Template,                   /* m4 template name */
 
314
   *Package,                    /* package */
 
315
   *Value,                      /* the value field */
 
316
   *Description;                /* some descritional text */
317
317
} LibraryEntryType, *LibraryEntryTypePtr;
318
318
 
319
319
typedef struct
320
320
{
321
 
        char                    *Name,          /* name of the menu entry */
322
 
                                *Style;         /* routing style */
323
 
        Cardinal                EntryN,         /* number of objects */
324
 
                                EntryMax;       /* number of reserved memory locations */
325
 
        LibraryEntryTypePtr     Entry;          /* the entries */
 
321
  char *Name,                   /* name of the menu entry */
 
322
   *Style;                      /* routing style */
 
323
  Cardinal EntryN,              /* number of objects */
 
324
    EntryMax;                   /* number of reserved memory locations */
 
325
  LibraryEntryTypePtr Entry;    /* the entries */
326
326
} LibraryMenuType, *LibraryMenuTypePtr;
327
327
 
328
328
typedef struct
329
329
{
330
 
        Cardinal                MenuN,
331
 
                                MenuMax;
332
 
        LibraryMenuTypePtr      Menu;
333
 
        Window                  Wind;
 
330
  Cardinal MenuN, MenuMax;
 
331
  LibraryMenuTypePtr Menu;
 
332
  Window Wind;
334
333
} LibraryType, *LibraryTypePtr;
335
334
 
336
 
typedef struct          /* holds information about board layout */
337
 
{                       /* most of the information is saved with layout */
338
 
                        /* and initialized from resources when */
339
 
                        /* a new board design is started */
340
 
                        /* this struct is also used for the remove list */
341
 
                        /* and for buffer handling */
342
 
        int             ID,                     /* see macro.h */
343
 
                        Flags;
344
 
        char            *Name,                  /* name of board */
345
 
                        *Filename,              /* name of file (from load) */
346
 
                        *PrintFilename,         /* from print dialog */
347
 
                        *Netlistname;           /* name of netlist file */
348
 
        Boolean         Changed,                /* layout has been changed */
349
 
                        ViaOn,                  /* visibility flags */
350
 
                        ElementOn,
351
 
                        RatOn,
352
 
                        InvisibleObjectsOn,
353
 
                        PinOn,
354
 
                        SilkActive;             /* active layer is actually silk */
355
 
        Pixel           ViaColor,               /* some colors */
356
 
                        ViaSelectedColor,
357
 
                        PinColor,
358
 
                        PinSelectedColor,
359
 
                        ElementColor,
360
 
                        RatColor,
361
 
                        InvisibleObjectsColor,
362
 
                        InvisibleMarkColor,
363
 
                        ElementSelectedColor,
364
 
                        RatSelectedColor,
365
 
                        ConnectedColor,
366
 
                        WarnColor;
367
 
        int             Zoom,                   /* zoom factor (factor = 1 << zoom) */
368
 
                        CursorX,                /* cursor position as saved with layout */
369
 
                        CursorY,
370
 
                        Clipping,
371
 
                        Grid,                   /* used grid with offsets */
372
 
                        GridOffsetX,    /* as saves with layout */
373
 
                        GridOffsetY;
374
 
        Dimension       MaxWidth,               /* allowed size */
375
 
                        MaxHeight;
376
 
        FontType        Font;
377
 
        LayerGroupType  LayerGroups;
378
 
        RouteStyleType  RouteStyle[NUM_STYLES];
379
 
        LibraryType     NetlistLib;
380
 
        DataTypePtr     Data;                   /* entire database */
 
335
typedef struct                  /* holds information about board layout */
 
336
{                               /* most of the information is saved with layout */
 
337
  /* and initialized from resources when */
 
338
  /* a new board design is started */
 
339
  /* this struct is also used for the remove list */
 
340
  /* and for buffer handling */
 
341
  long int ID,                  /* see macro.h */
 
342
    Flags;
 
343
  char *Name,                   /* name of board */
 
344
   *Filename,                   /* name of file (from load) */
 
345
   *PrintFilename,              /* from print dialog */
 
346
   *Netlistname;                /* name of netlist file */
 
347
  Boolean Changed,              /* layout has been changed */
 
348
    ViaOn,                      /* visibility flags */
 
349
    ElementOn, RatOn, InvisibleObjectsOn, PinOn, SilkActive,    /* active layer is actually silk */
 
350
    RatDraw;                    /* we're drawing rats */
 
351
  Pixel ViaColor,               /* some colors */
 
352
   
 
353
    ViaSelectedColor,
 
354
    PinColor,
 
355
    PinSelectedColor,
 
356
    ElementColor,
 
357
    RatColor,
 
358
    InvisibleObjectsColor,
 
359
    InvisibleMarkColor,
 
360
    ElementSelectedColor,
 
361
    RatSelectedColor, ConnectedColor, WarnColor, MaskColor;
 
362
  long int CursorX,             /* cursor position as saved with layout */
 
363
    CursorY, Clipping;
 
364
  BDimension GridOffsetX,       /* as saves with layout */
 
365
    GridOffsetY, MaxWidth,      /* allowed size */
 
366
    MaxHeight;
 
367
  float Grid,                   /* used grid with offsets */
 
368
    Zoom,                       /* zoom factor */
 
369
    ThermScale;                 /* scale factor used with thermals */
 
370
  FontType Font;
 
371
  LayerGroupType LayerGroups;
 
372
  RouteStyleType RouteStyle[NUM_STYLES];
 
373
  LibraryType NetlistLib;
 
374
  DataTypePtr Data;             /* entire database */
381
375
} PCBType, *PCBTypePtr;
382
376
 
383
 
typedef struct                          /* information about the paste buffer */
 
377
typedef struct                  /* information about the paste buffer */
384
378
{
385
 
        Position        X,                              /* offset */
386
 
                        Y;
387
 
        BoxType         BoundingBox;
388
 
        DataTypePtr     Data;                   /* data; not all members of PCBType */
389
 
                                                /* are used */
 
379
  LocationType X,                       /* offset */
 
380
    Y;
 
381
  BoxType BoundingBox;
 
382
  DataTypePtr Data;             /* data; not all members of PCBType */
 
383
  /* are used */
390
384
} BufferType, *BufferTypePtr;
391
385
 
392
386
/* ---------------------------------------------------------------------------
395
389
 */
396
390
typedef struct                  /* rubberband lines for element moves */
397
391
{
398
 
        LayerTypePtr    Layer;                  /* layer that holds the line */
399
 
        LineTypePtr     Line;                   /* the line itself */
400
 
        PointTypePtr    MovedPoint;             /* and finally the point */
 
392
  LayerTypePtr Layer;           /* layer that holds the line */
 
393
  LineTypePtr Line;             /* the line itself */
 
394
  PointTypePtr MovedPoint;      /* and finally the point */
401
395
} RubberbandType, *RubberbandTypePtr;
402
396
 
403
397
typedef struct                  /* current marked line */
404
398
{
405
 
        PointType       Point1,                 /* start- and end-position */
406
 
                        Point2;
407
 
        int             State;
 
399
  PointType Point1,             /* start- and end-position */
 
400
    Point2;
 
401
  long int State;
 
402
  Boolean draw;
408
403
} AttachedLineType, *AttachedLineTypePtr;
409
404
 
410
405
typedef struct                  /* currently marked block */
411
406
{
412
 
        PointType       Point1,                 /* start- and end-position */
413
 
                        Point2;
414
 
        int             State;
 
407
  PointType Point1,             /* start- and end-position */
 
408
    Point2;
 
409
  long int State;
 
410
  Boolean otherway;
415
411
} AttachedBoxType, *AttachedBoxTypePtr;
416
412
 
417
413
typedef struct                  /* currently attached object */
418
414
{
419
 
        Position                X,              /* saved position when MOVE_MODE */
420
 
                                Y;              /* was entered */
421
 
        BoxType                 BoundingBox;
422
 
        int                     Type,           /* object type */
423
 
                                State;
424
 
        void                    *Ptr1,          /* three pointers to data, see */
425
 
                                *Ptr2,          /* search.c */
426
 
                                *Ptr3;
427
 
        Cardinal                RubberbandN,    /* number of lines in array */
428
 
                                RubberbandMax;
429
 
        RubberbandTypePtr       Rubberband;
 
415
  LocationType X,                       /* saved position when MOVE_MODE */
 
416
    Y;                          /* was entered */
 
417
  BoxType BoundingBox;
 
418
  long int Type,                /* object type */
 
419
    State;
 
420
  void *Ptr1,                   /* three pointers to data, see */
 
421
   *Ptr2,                       /* search.c */
 
422
   *Ptr3;
 
423
  Cardinal RubberbandN,         /* number of lines in array */
 
424
    RubberbandMax;
 
425
  RubberbandTypePtr Rubberband;
430
426
} AttachedObjectType, *AttachedObjectTypePtr;
431
427
 
432
428
typedef struct                  /* holds cursor information */
433
429
{
434
 
        GC                      GC,             /* GC for cursor drawing */
435
 
                                AttachGC;       /* and for displaying buffer contents */
436
 
        Position                X,              /* position in PCB coordinates */
437
 
                                Y,
438
 
                                MinX,           /* lowest and highest coordinates */
439
 
                                MinY,
440
 
                                MaxX,
441
 
                                MaxY;
442
 
        Boolean                 On;             /* flag for 'is visible' */
443
 
        AttachedLineType        AttachedLine;   /* data of new lines... */
444
 
        AttachedBoxType         AttachedBox;
445
 
        PolygonType             AttachedPolygon;
446
 
        AttachedObjectType      AttachedObject; /* data of attached objects */
 
430
  GC GC,                        /* GC for cursor drawing */
 
431
    AttachGC;                   /* and for displaying buffer contents */
 
432
  LocationType X,                       /* position in PCB coordinates */
 
433
    Y, MinX,                    /* lowest and highest coordinates */
 
434
    MinY, MaxX, MaxY;
 
435
  Boolean On;                   /* flag for 'is visible' */
 
436
  AttachedLineType AttachedLine;        /* data of new lines... */
 
437
  AttachedBoxType AttachedBox;
 
438
  PolygonType AttachedPolygon;
 
439
  AttachedObjectType AttachedObject;    /* data of attached objects */
447
440
} CrosshairType, *CrosshairTypePtr;
448
441
 
449
442
typedef struct
450
443
{
451
 
        Boolean         status;
452
 
        int             X, Y;
 
444
  Boolean status;
 
445
  long int X, Y;
453
446
} MarkType, *MarkTypePtr;
454
447
 
455
448
/* ---------------------------------------------------------------------------
458
451
 */
459
452
typedef struct                  /* some resources... */
460
453
{
461
 
        Pixel           bgColor,                /* background and cursor color ... */
462
 
                        CrosshairColor, /* different object colors */
463
 
                        CrossColor,
464
 
                        ViaColor,
465
 
                        ViaSelectedColor,
466
 
                        PinColor,
467
 
                        PinSelectedColor,
468
 
                        ElementColor,
469
 
                        RatColor,
470
 
                        InvisibleObjectsColor,
471
 
                        InvisibleMarkColor,
472
 
                        ElementSelectedColor,
473
 
                        RatSelectedColor,
474
 
                        ConnectedColor,
475
 
                        OffLimitColor,
476
 
                        GridColor,
477
 
                        LayerColor[MAX_LAYER],
478
 
                        LayerSelectedColor[MAX_LAYER],
479
 
                        WarnColor;
480
 
        Dimension       ViaThickness,   /* some preset values */
481
 
                        ViaDrillingHole,
482
 
                        LineThickness,
483
 
                        RatThickness,
484
 
                        MaxWidth,               /* maximum size of a layout */
485
 
                        MaxHeight,
486
 
                        TextScale,              /* text scaling in % */
487
 
                        AlignmentDistance,
488
 
                        Bloat,                  /* drc sizes */
489
 
                        Shrink;
490
 
        int             Grid,                   /* grid 0.001'' */
491
 
                        Zoom,                   /* number of shift operations for zooming */
492
 
                        PinoutZoom,             /* same for pinout windows */
493
 
                        PinoutNameLength,       /* max displayed length of a pinname */
494
 
                        Volume,                 /* the speakers volume -100..100 */
495
 
                        CharPerLine,    /* width of an output line in characters */
496
 
                        Mode,                   /* currently active mode */
497
 
                        BufferNumber,   /* number of the current buffer */
498
 
                        GridFactor;             /* factor used for grid-drawing */
499
 
        long            BackupInterval; /* time between two backups in seconds */
500
 
        String          DefaultLayerName[MAX_LAYER],
501
 
                        FontCommand,    /* commands for file loading... */
502
 
                        FileCommand,
503
 
                        ElementCommand,
504
 
                        PrintFile,
505
 
                        LibraryCommand,
506
 
                        LibraryContentsCommand,
507
 
                        SaveCommand,
508
 
                        LibraryFilename,
509
 
                        FontFile,               /* name of default font file */
510
 
                        Groups,                 /* string with layergroups */
511
 
                        Routes,                 /* string with route styles */
512
 
                        FilePath,
513
 
                        RatPath,
514
 
                        RatCommand,
515
 
                        FontPath,
516
 
                        ElementPath,
517
 
                        LibraryPath,
518
 
                        Size,                   /* geometry string for size */
519
 
                        Media;                  /* type of output media */
520
 
        Position        PinoutOffsetX,          /* offset of origin */
521
 
                        PinoutOffsetY,
522
 
                        PinoutTextOffsetX,      /* offset of text from pin center */
523
 
                        PinoutTextOffsetY;
524
 
        RouteStyleType  RouteStyle[NUM_STYLES]; /* default routing styles */
525
 
        LayerGroupType  LayerGroups;            /* default layer groups */
526
 
        Boolean         AbsoluteGrid,           /* grid is relative to (0,0) */
527
 
                        UseLogWindow,           /* use log window instead of dialog box */
528
 
                        RaiseLogWindow,         /* raise log window if iconified */
529
 
                        ShowSolderSide,         /* mirror output */
530
 
                        SaveLastCommand,        /* save the last command entered by user */
531
 
                        SaveInTMP,              /* always save data in /tmp */
532
 
                        DrawGrid,               /* draw grid points */
533
 
                        RatWarn,                /* rats nest has set warnings */
534
 
                        StipplePolygons,        /* draw polygons with stipple */
535
 
                        AllDirectionLines,      /* enable lines to all directions */
536
 
                        RubberBandMode,         /* move, rotate use rubberband connections */
537
 
                        SwapStartDirection,     /* change starting direction after each click */
538
 
                        ResetAfterElement,      /* reset connections after */
539
 
                                                /* each element */
540
 
                        RingBellWhenFinished;   /* flag if a signal should be */
541
 
                                                /* produced when searching of */
542
 
                                                /* connections is done */
543
 
        XFontStruct     *PinoutFont[MAX_ZOOM+1];/* font ID used for pin names */
 
454
  Pixel bgColor,                /* background and cursor color ... */
 
455
    CrosshairColor,             /* different object colors */
 
456
   
 
457
    CrossColor,
 
458
    ViaColor,
 
459
    ViaSelectedColor,
 
460
    PinColor,
 
461
    PinSelectedColor,
 
462
    ElementColor,
 
463
    RatColor,
 
464
    InvisibleObjectsColor,
 
465
    InvisibleMarkColor,
 
466
    ElementSelectedColor,
 
467
    RatSelectedColor,
 
468
    ConnectedColor,
 
469
    OffLimitColor,
 
470
    GridColor,
 
471
    LayerColor[MAX_LAYER],
 
472
    LayerSelectedColor[MAX_LAYER], WarnColor, MaskColor;
 
473
  BDimension ViaThickness,      /* some preset values */
 
474
    ViaDrillingHole, LineThickness, RatThickness, Keepaway, MaxWidth,   /* maximum size of a layout */
 
475
    MaxHeight, TextScale,       /* text scaling in % */
 
476
    AlignmentDistance, Bloat,   /* drc sizes */
 
477
    Shrink, minWid, minSlk;
 
478
  float Grid,                   /* grid 0.001'' */
 
479
    Zoom,                       /* number of shift operations for zooming */
 
480
    PinoutZoom;                 /* same for pinout windows */
 
481
  long int PinoutNameLength,    /* max displayed length of a pinname */
 
482
    Volume,                     /* the speakers volume -100..100 */
 
483
    CharPerLine,                /* width of an output line in characters */
 
484
    Mode,                       /* currently active mode */
 
485
    BufferNumber,               /* number of the current buffer */
 
486
    GridFactor;                 /* factor used for grid-drawing */
 
487
  long BackupInterval;          /* time between two backups in seconds */
 
488
  String DefaultLayerName[MAX_LAYER], FontCommand,      /* commands for file loading... */
 
489
    FileCommand, ElementCommand, PrintFile, LibraryCommand, LibraryContentsCommand, LibraryTree,        /* path to library tree */
 
490
    SaveCommand, LibraryFilename, FontFile,     /* name of default font file */
 
491
    Groups,                     /* string with layergroups */
 
492
    Routes,                     /* string with route styles */
 
493
    FilePath, RatPath, RatCommand, FontPath, ElementPath, LibraryPath, Size,    /* geometry string for size */
 
494
    Media,                      /* type of output media */
 
495
    MenuFile,                   /* file containing menu definitions */
 
496
    BackgroundImage,            /* PPM file for board background */
 
497
    ScriptFilename,             /* PCB Actions script to execute on startup */
 
498
    ActionString;               /* PCB Actions string to execute on startup */
 
499
  Boolean DumpMenuFile;         /* dump internal menu definitions */
 
500
  LocationType PinoutOffsetX,   /* offset of origin */
 
501
    PinoutOffsetY;
 
502
  Position PinoutTextOffsetX,   /* offset of text from pin center */
 
503
    PinoutTextOffsetY;
 
504
  RouteStyleType RouteStyle[NUM_STYLES];        /* default routing styles */
 
505
  LayerGroupType LayerGroups;   /* default layer groups */
 
506
  Boolean ClearLine, UniqueNames,       /* force unique names */
 
507
    SnapPin,                    /* snap to pins and pads */
 
508
    UseLogWindow,               /* use log window instead of dialog box */
 
509
    RaiseLogWindow,             /* raise log window if iconified */
 
510
    ShowSolderSide,             /* mirror output */
 
511
    SaveLastCommand,            /* save the last command entered by user */
 
512
    SaveInTMP,                  /* always save data in /tmp */
 
513
    DrawGrid,                   /* draw grid points */
 
514
    RatWarn,                    /* rats nest has set warnings */
 
515
    StipplePolygons,            /* draw polygons with stipple */
 
516
    AllDirectionLines,          /* enable lines to all directions */
 
517
    RubberBandMode,             /* move, rotate use rubberband connections */
 
518
    SwapStartDirection,         /* change starting direction after each click */
 
519
    ShowDRC,                    /* show drc region on crosshair */
 
520
    ResetAfterElement,          /* reset connections after each element */
 
521
    liveRouting,                /* autorouter shows tracks in progress */
 
522
    RingBellWhenFinished;       /* flag if a signal should be */
 
523
  /* produced when searching of */
 
524
  /* connections is done */
 
525
  XFontStruct *PinoutFont[MAX_ZOOM + 1];        /* font ID used for pin names */
 
526
  int HistorySize;
544
527
} SettingType, *SettingTypePtr;
545
528
 
546
529
/* ----------------------------------------------------------------------
548
531
 */
549
532
typedef struct
550
533
{
551
 
        void    *(*Line)(LayerTypePtr, LineTypePtr);
552
 
        void    *(*Text)(LayerTypePtr, TextTypePtr);
553
 
        void    *(*Polygon)(LayerTypePtr, PolygonTypePtr);
554
 
        void    *(*Via)(PinTypePtr);
555
 
        void    *(*Element)(ElementTypePtr);
556
 
        void    *(*ElementName)(ElementTypePtr);
557
 
        void    *(*Pin)(ElementTypePtr, PinTypePtr);
558
 
        void    *(*Pad)(ElementTypePtr, PadTypePtr);
559
 
        void    *(*LinePoint)(LayerTypePtr, LineTypePtr, PointTypePtr);
560
 
        void    *(*Point)(LayerTypePtr, PolygonTypePtr, PointTypePtr);
561
 
        void    *(*Arc)(LayerTypePtr, ArcTypePtr);
562
 
        void    *(*Rat)(RatTypePtr);
 
534
  void *(*Line) (LayerTypePtr, LineTypePtr);
 
535
  void *(*Text) (LayerTypePtr, TextTypePtr);
 
536
  void *(*Polygon) (LayerTypePtr, PolygonTypePtr);
 
537
  void *(*Via) (PinTypePtr);
 
538
  void *(*Element) (ElementTypePtr);
 
539
  void *(*ElementName) (ElementTypePtr);
 
540
  void *(*Pin) (ElementTypePtr, PinTypePtr);
 
541
  void *(*Pad) (ElementTypePtr, PadTypePtr);
 
542
  void *(*LinePoint) (LayerTypePtr, LineTypePtr, PointTypePtr);
 
543
  void *(*Point) (LayerTypePtr, PolygonTypePtr, PointTypePtr);
 
544
  void *(*Arc) (LayerTypePtr, ArcTypePtr);
 
545
  void *(*Rat) (RatTypePtr);
563
546
} ObjectFunctionType, *ObjectFunctionTypePtr;
564
547
 
565
548
/* ---------------------------------------------------------------------------
566
549
 * structure used by device drivers
567
550
 */
568
 
typedef struct                          /* media description */
569
 
{ String                Name;           /* name and size (in mil) */ Dimension  Width,
570
 
                        Height;
571
 
        Position        MarginX,
572
 
                        MarginY;
 
551
typedef struct                  /* media description */
 
552
{
 
553
  String Name;                  /* name and size (in mil*100) */
 
554
  BDimension Width, Height;
 
555
  LocationType MarginX, MarginY;
573
556
} MediaType, *MediaTypePtr;
574
557
 
575
 
typedef struct                          /* needs and abilities of a driver */
 
558
typedef struct                  /* needs and abilities of a driver */
576
559
{
577
 
        MediaTypePtr    SelectedMedia;  /* media to be used */
578
 
        FILE            *FP;            /* file pointers */
579
 
        Boolean         MirrorFlag,     /* several flags */
580
 
                        RotateFlag,
581
 
                        InvertFlag;
582
 
        Position        OffsetX,        /* offset from lower/left corner */
583
 
                        OffsetY;
584
 
        float           Scale;          /* scaleing */
585
 
        BoxType         BoundingBox;    /* bounding box of output */
 
560
  MediaTypePtr SelectedMedia;   /* media to be used */
 
561
  FILE *FP;                     /* file pointers */
 
562
  Boolean MirrorFlag,           /* several flags */
 
563
    RotateFlag, InvertFlag;
 
564
  BDimension OffsetX,           /* offset from lower/left corner */
 
565
    OffsetY;
 
566
  float Scale;                  /* scaleing */
 
567
  BoxType BoundingBox;          /* bounding box of output */
586
568
} PrintInitType, *PrintInitTypePtr;
587
569
 
588
 
typedef struct                          /* functions of a print driver */
 
570
typedef struct                  /* functions of a print driver */
589
571
{
590
 
        char            *Name,                                                          /* name of driver */
591
 
                        *Suffix;                                                        /* filename suffix */
592
 
        void            (*init)(PrintInitTypePtr);              /* initializes driver */
593
 
        void            (*Exit)(void);                          /* exit code */
594
 
        char            *(*Preamble)(PrintInitTypePtr, char *); /* initializes file */
595
 
        void            (*Postamble)(void);                             /* exit code */
596
 
        void            (*SetColor)(XColor);                    /* set color */
597
 
        void            (*Polarity)(int);                       /* control drawing polarity */
598
 
        void            (*Line)(LineTypePtr, Boolean);          /* draw a line (Thick/Clear) */
599
 
        void            (*Arc)(ArcTypePtr, Boolean);            /* draw an arc (Thick/Clear) */
600
 
        void            (*Poly)(PolygonTypePtr);                /* draw a polygon */
601
 
        void            (*Text)(TextTypePtr);                   /* draw vector text */
602
 
        void            (*Pad)(PadTypePtr, int);                /* pad thick=0 clear=1 mask=2 */
603
 
        void            (*PinOrVia)(PinTypePtr, int);           /* pin diam=0 clear=1 mask=2 */
604
 
        void            (*ElementPackage)(ElementTypePtr);
605
 
        void            (*Drill)(PinTypePtr, Cardinal);                 /* drilling information */
606
 
        void            (*Outline)(Position, Position, Position, Position);
607
 
        void            (*Alignment)(Position, Position, Position, Position);
608
 
        void            (*DrillHelper)(PinTypePtr, int);
609
 
        void            (*GroupID)(int);                        /* comments group info */
610
 
        Boolean         HandlesColor,           /* colored output */
611
 
                        HandlesDrill,           /* able to produce drill info */
612
 
                        HandlesMedia,           /* able to handle different media */
613
 
                        HandlesMirror,          /* allows mirror flag to be set */
614
 
                        HandlesRotate;          /* allows the rotate flag to be set */
 
572
  char *Name,                   /* name of driver */
 
573
   *Suffix;                     /* filename suffix */
 
574
  void (*init) (PrintInitTypePtr);      /* initializes driver */
 
575
  void (*Exit) (void);          /* exit code */
 
576
  char *(*Preamble) (PrintInitTypePtr, char *); /* initializes file */
 
577
  void (*Postamble) (void);     /* exit code */
 
578
  void (*SetColor) (XColor);    /* set color */
 
579
  void (*Polarity) (int);       /* control drawing polarity */
 
580
  void (*Line) (LineTypePtr, Boolean);  /* draw a line (Thick/Clear) */
 
581
  void (*Arc) (ArcTypePtr, Boolean);    /* draw an arc (Thick/Clear) */
 
582
  void (*Poly) (PolygonTypePtr);        /* draw a polygon */
 
583
  void (*Text) (TextTypePtr);   /* draw vector text */
 
584
  void (*Pad) (PadTypePtr, int);        /* pad thick=0 clear=1 mask=2 */
 
585
  void (*PinOrVia) (PinTypePtr, int);   /* pin diam=0 clear=1 mask=2 */
 
586
  void (*ElementPackage) (ElementTypePtr);
 
587
  void (*Drill) (PinTypePtr, Cardinal); /* drilling information */
 
588
  void (*Outline) (LocationType, LocationType, LocationType, LocationType);
 
589
  void (*Alignment) (LocationType, LocationType, LocationType, LocationType);
 
590
  void (*DrillHelper) (PinTypePtr, int);
 
591
  void (*GroupID) (int);        /* comments group info */
 
592
  Boolean HandlesColor,         /* colored output */
 
593
    HandlesDrill,               /* able to produce drill info */
 
594
    HandlesMedia,               /* able to handle different media */
 
595
    HandlesMirror,              /* allows mirror flag to be set */
 
596
    HandlesRotate,              /* allows the rotate flag to be set */
 
597
    HandlesScale;
615
598
} PrintDeviceType, *PrintDeviceTypePtr;
616
599
 
617
600
typedef struct
618
601
{
619
 
        PrintDeviceTypePtr      (*Query)(void); /* query function */
620
 
        PrintDeviceTypePtr      Info;           /* data returned by Query() */
 
602
  PrintDeviceTypePtr (*Query) (void);   /* query function */
 
603
  PrintDeviceTypePtr Info;      /* data returned by Query() */
621
604
} DeviceInfoType, *DeviceInfoTypePtr;
622
605
 
623
 
typedef struct                        /* holds a connection */
 
606
typedef struct                  /* holds a connection */
624
607
{
625
 
        Position        X, Y;                   /* coordinate of connection */
626
 
        int             type;                   /* type of object in ptr1 - 3 */
627
 
        void            *ptr1, *ptr2;           /* the object of the connection */
628
 
        Cardinal        group;          /* the layer group of the connection */
629
 
        LibraryMenuType *menu;          /* the netmenu this *SHOULD* belong too */
 
608
  LocationType X, Y;            /* coordinate of connection */
 
609
  long int type;                /* type of object in ptr1 - 3 */
 
610
  void *ptr1, *ptr2;            /* the object of the connection */
 
611
  Cardinal group;               /* the layer group of the connection */
 
612
  LibraryMenuType *menu;        /* the netmenu this *SHOULD* belong too */
630
613
} ConnectionType, *ConnectionTypePtr;
631
 
 
632
 
typedef struct                        /* holds a net of connections */
 
614
 
 
615
typedef struct                  /* holds a net of connections */
633
616
{
634
 
      Cardinal                ConnectionN,    /* the number of connections contained */
635
 
                              ConnectionMax;  /* max connections from malloc */
636
 
      ConnectionTypePtr       Connection;
 
617
  Cardinal ConnectionN,         /* the number of connections contained */
 
618
    ConnectionMax;              /* max connections from malloc */
 
619
  ConnectionTypePtr Connection;
 
620
  RouteStyleTypePtr Style;
637
621
} NetType, *NetTypePtr;
638
622
 
639
 
typedef struct                        /* holds a list of nets */ 
640
 
{            
641
 
      Cardinal        NetN,        /* the number of subnets contained */
642
 
                      NetMax;      /* max subnets from malloc */
643
 
      NetTypePtr      Net; 
644
 
} NetListType, *NetListTypePtr;       
645
 
 
646
 
typedef struct                        /* holds a generic list of pointers */ 
647
 
{            
648
 
      Cardinal        PtrN,        /* the number of pointers contained */
649
 
                      PtrMax;      /* max subnets from malloc */
650
 
      void            **Ptr; 
651
 
} PointerListType, *PointerListTypePtr;       
 
623
typedef struct                  /* holds a list of nets */
 
624
{
 
625
  Cardinal NetN,                /* the number of subnets contained */
 
626
    NetMax;                     /* max subnets from malloc */
 
627
  NetTypePtr Net;
 
628
} NetListType, *NetListTypePtr;
 
629
 
 
630
typedef struct                  /* holds a list of net lists */
 
631
{
 
632
  Cardinal NetListN,            /* the number of net lists contained */
 
633
    NetListMax;                 /* max net lists from malloc */
 
634
  NetListTypePtr NetList;
 
635
} NetListListType, *NetListListTypePtr;
 
636
 
 
637
typedef struct                  /* holds a generic list of pointers */
 
638
{
 
639
  Cardinal PtrN,                /* the number of pointers contained */
 
640
    PtrMax;                     /* max subnets from malloc */
 
641
  void **Ptr;
 
642
} PointerListType, *PointerListTypePtr;
 
643
 
 
644
typedef struct
 
645
{
 
646
  Cardinal BoxN,                /* the number of boxes contained */
 
647
    BoxMax;                     /* max boxes from malloc */
 
648
  BoxTypePtr Box;
 
649
 
 
650
} BoxListType, *BoxListTypePtr;
 
651
 
652
652
 
653
653
/* ---------------------------------------------------------------------------
654
654
 * define supported types of undo operations
662
662
#define UNDO_ROTATE                     0x0020  /* rotations */
663
663
#define UNDO_CREATE                     0x0040  /* creation of objects */
664
664
#define UNDO_MOVETOLAYER                0x0080  /* moving objects to */
665
 
#define UNDO_FLAG                       0x0100  /* toggling SELECTED flag */
666
 
#define UNDO_CHANGESIZE                 0x0200  /* change size of object */
667
 
#define UNDO_CHANGE2NDSIZE              0x0400  /* change 2ndSize of object */
668
 
#define UNDO_MIRROR                     0x0800  /* change side of board */
 
665
#define UNDO_FLAG                       0x0100  /* toggling SELECTED flag */
 
666
#define UNDO_CHANGESIZE                 0x0200  /* change size of object */
 
667
#define UNDO_CHANGE2NDSIZE              0x0400  /* change 2ndSize of object */
 
668
#define UNDO_MIRROR                     0x0800  /* change side of board */
669
669
#define UNDO_CHANGECLEARSIZE            0x1000  /* change clearance size */
670
 
 
671
 
#endif
 
670
#define UNDO_CHANGEMASKSIZE             0x2000  /* change mask size */
 
671
 
 
672
 
 
673
/* ---------------------------------------------------------------------------
 
674
 * add a macro for wrapping RCS ID's in so that ident will still work
 
675
 * but we won't get as many compiler warnings
 
676
 */
 
677
 
 
678
#ifndef GCC_VERSION
 
679
#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
 
680
#endif /* GCC_VERSION */
 
681
 
 
682
#if GCC_VERSION > 2007
 
683
#define ATTRIBUTE_UNUSED __attribute__((unused)) 
 
684
#else
 
685
#define ATTRIBUTE_UNUSED
 
686
#endif 
 
687
 
 
688
#define RCSID(x) static char *rcsid  ATTRIBUTE_UNUSED = x
 
689
 
 
690
#endif /* __GLOBAL_INCLUDED__  */
 
691