54
56
* their coordinates as a line.
56
58
#define LINESTRUCT \
61
BDimension Thickness, \
59
63
PointType Point1, \
61
Dimension Thickness, Clearance;
63
66
/* ---------------------------------------------------------------------------
64
67
* some useful values of our widgets
66
typedef struct /* holds information about output window */
69
typedef struct /* holds information about output window */
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 */
85
Width, /* sizes of output window (porthole) */
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) */
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;
92
94
/* ----------------------------------------------------------------------
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;
102
typedef struct /* a bounding box */
104
typedef struct /* a bounding box */
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;
108
110
/* ---------------------------------------------------------------------------
109
111
* the basic object types supported by PCB
111
typedef struct /* all objects start with an ID */
113
typedef struct /* all objects start with a Bounding box and ID */
114
117
} AnyObjectType, *AnyObjectTypePtr;
116
typedef struct /* a line/polygon point */
119
typedef struct /* a line/polygon point */
121
LocationType X, Y, X2, Y2; /* so Point type can be cast as BoxType */
121
123
} PointType, *PointTypePtr;
123
typedef struct /* holds information about one line */
125
typedef struct /* holds information about one line */
128
LINESTRUCT char *Number;
126
129
} LineType, *LineTypePtr;
132
Position X, /* origin */
136
Dimension Scale; /* text scaling in percent */
137
char *TextString; /* string */
135
BDimension Scale; /* text scaling in percent */
136
LocationType X, /* origin */
139
char *TextString; /* string */
138
141
} TextType, *TextTypePtr;
140
143
typedef struct /* holds information about a polygon */
145
Cardinal PointN, /* number of points in polygon */
146
PointMax; /* max number from malloc() */
147
PointTypePtr Points; /* data */
147
Cardinal PointN, /* number of points in polygon */
148
PointMax; /* max number from malloc() */
149
PointTypePtr Points; /* data */
148
150
} PolygonType, *PolygonTypePtr;
150
typedef struct /* holds information about arcs */
152
typedef struct /* holds information about arcs */
152
int ID, /* these fields are unused when contained in elements */
154
Position X, /* center coordinates */
156
Dimension Width, /* length of axis */
160
int StartAngle, /* the two limiting angles in degrees */
162
BoxType BoundingBox; /* only filled in for arcs on layers */
155
long int ID, /* these fields are unused when contained in elements */
157
BDimension Thickness, Clearance;
158
LocationType Width, /* length of axis */
159
Height, X, /* center coordinates */
161
long int StartAngle, /* the two limiting angles in degrees */
163
163
} ArcType, *ArcTypePtr;
167
struct rtree_node *root;
168
int size; /* number of entries in tree */
165
171
typedef struct /* holds information about one layer */
167
char *Name; /* layer name */
168
Cardinal LineN, /* number of lines */
170
PolygonN, /* polygons */
172
LineMax, /* max number from malloc() */
176
LineTypePtr Line; /* pointer to additional structures */
178
PolygonTypePtr Polygon;
180
Boolean On; /* visible flag */
181
Pixel Color, /* color */
173
char *Name; /* layer name */
174
Cardinal LineN, /* number of lines */
176
PolygonN, /* polygons */
178
LineMax, /* max number from malloc() */
179
TextMax, PolygonMax, ArcMax;
180
LineTypePtr Line; /* pointer to additional structures */
182
PolygonTypePtr Polygon;
184
rtree_t *line_tree, *text_tree, *polygon_tree, *arc_tree;
185
Boolean On; /* visible flag */
186
Pixel Color, /* color */
183
188
} LayerType, *LayerTypePtr;
185
typedef struct /* a rat-line */
190
typedef struct /* a rat-line */
188
Cardinal group1, group2; /* the layer group each point is on */
193
LINESTRUCT Cardinal group1, group2; /* the layer group each point is on */
189
194
} RatType, *RatTypePtr;
191
typedef struct /* a SMD pad */
196
typedef struct /* a SMD pad */
195
char *Name, *Number; /* 'Line' */
199
LINESTRUCT BDimension Mask;
200
char *Name, *Number; /* 'Line' */
197
203
} PadType, *PadTypePtr;
203
Position X, /* center and diameter */
209
BDimension Thickness, Clearance, Mask, DrillingHole;
210
LocationType X, /* center and diameter */
211
215
} PinType, *PinTypePtr, **PinTypeHandle;
217
TextType Name[MAX_ELEMENTNAMES]; /* the elements names; */
218
/* description text */
219
/* name on PCB second, */
222
Position MarkX, /* position mark */
225
Cardinal PinN, /* number of pins, lines and arcs */
233
PinTypePtr Pin; /* pin description */
234
PadTypePtr Pad; /* pad description of SMD components */
221
TextType Name[MAX_ELEMENTNAMES]; /* the elements names; */
222
/* description text */
223
/* name on PCB second, */
226
LocationType MarkX, /* position mark */
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 */
237
235
} ElementType, *ElementTypePtr, **ElementTypeHandle;
239
237
/* ---------------------------------------------------------------------------
240
238
* symbol and font related stuff
242
typedef struct /* a single symbol */
240
typedef struct /* a single symbol */
246
Cardinal LineN, /* number of lines */
248
Dimension Width, /* size of cell */
250
Delta; /* distance to next symbol in 0.001'' */
244
Cardinal LineN, /* number of lines */
246
BDimension Width, /* size of cell */
247
Height, Delta; /* distance to next symbol in 0.00001'' */
251
248
} SymbolType, *SymbolTypePtr;
253
typedef struct /* complete set of symbols */
250
typedef struct /* complete set of symbols */
255
Dimension MaxHeight, /* maximum cell width and height */
257
BoxType DefaultSymbol; /* the default symbol is a filled box */
258
SymbolType Symbol[MAX_FONTPOSITION+1];
252
LocationType MaxHeight, /* maximum cell width and height */
254
BoxType DefaultSymbol; /* the default symbol is a filled box */
255
SymbolType Symbol[MAX_FONTPOSITION + 1];
260
257
} FontType, *FontTypePtr;
262
259
typedef struct /* holds all objects */
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 */
270
PinTypePtr Via; /* pointer to object data */
271
ElementTypePtr Element;
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 */
267
PinTypePtr Via; /* pointer to object data */
268
ElementTypePtr Element;
270
rtree_t *via_tree, *element_tree, *pin_tree, *pad_tree, *name_tree[3], /* for element names */
272
LayerType Layer[MAX_LAYER + 2]; /* add 2 silkscreen layers */
274
273
} DataType, *DataTypePtr;
276
typedef struct /* holds drill information */
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;
290
typedef struct /* holds a range of Drill Infos */
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 */
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;
289
typedef struct /* holds a range of Drill Infos */
291
Cardinal DrillN, /* number of drill sizes */
292
DrillMax; /* max number from malloc() */
293
DrillTypePtr Drill; /* plated holes */
294
} DrillInfoType, *DrillInfoTypePtr;
299
Dimension Thick, /* line thickness */
300
Diameter, /* via diameter */
301
Hole; /* via drill hole */
298
BDimension Thick, /* line thickness */
299
Diameter, /* via diameter */
300
Hole, /* via drill hole */
301
Keepaway; /* min. separation from other nets */
303
303
} RouteStyleType, *RouteStyleTypePtr;
305
305
/* ---------------------------------------------------------------------------
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;
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;
332
LibraryMenuTypePtr Menu;
330
Cardinal MenuN, MenuMax;
331
LibraryMenuTypePtr Menu;
334
333
} LibraryType, *LibraryTypePtr;
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 */
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 */
354
SilkActive; /* active layer is actually silk */
355
Pixel ViaColor, /* some colors */
361
InvisibleObjectsColor,
363
ElementSelectedColor,
367
int Zoom, /* zoom factor (factor = 1 << zoom) */
368
CursorX, /* cursor position as saved with layout */
371
Grid, /* used grid with offsets */
372
GridOffsetX, /* as saves with layout */
374
Dimension MaxWidth, /* allowed size */
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 */
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 */
358
InvisibleObjectsColor,
360
ElementSelectedColor,
361
RatSelectedColor, ConnectedColor, WarnColor, MaskColor;
362
long int CursorX, /* cursor position as saved with layout */
364
BDimension GridOffsetX, /* as saves with layout */
365
GridOffsetY, MaxWidth, /* allowed size */
367
float Grid, /* used grid with offsets */
368
Zoom, /* zoom factor */
369
ThermScale; /* scale factor used with thermals */
371
LayerGroupType LayerGroups;
372
RouteStyleType RouteStyle[NUM_STYLES];
373
LibraryType NetlistLib;
374
DataTypePtr Data; /* entire database */
381
375
} PCBType, *PCBTypePtr;
383
typedef struct /* information about the paste buffer */
377
typedef struct /* information about the paste buffer */
385
Position X, /* offset */
388
DataTypePtr Data; /* data; not all members of PCBType */
379
LocationType X, /* offset */
382
DataTypePtr Data; /* data; not all members of PCBType */
390
384
} BufferType, *BufferTypePtr;
392
386
/* ---------------------------------------------------------------------------
396
390
typedef struct /* rubberband lines for element moves */
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;
403
397
typedef struct /* current marked line */
405
PointType Point1, /* start- and end-position */
399
PointType Point1, /* start- and end-position */
408
403
} AttachedLineType, *AttachedLineTypePtr;
410
405
typedef struct /* currently marked block */
412
PointType Point1, /* start- and end-position */
407
PointType Point1, /* start- and end-position */
415
411
} AttachedBoxType, *AttachedBoxTypePtr;
417
413
typedef struct /* currently attached object */
419
Position X, /* saved position when MOVE_MODE */
422
int Type, /* object type */
424
void *Ptr1, /* three pointers to data, see */
425
*Ptr2, /* search.c */
427
Cardinal RubberbandN, /* number of lines in array */
429
RubberbandTypePtr Rubberband;
415
LocationType X, /* saved position when MOVE_MODE */
418
long int Type, /* object type */
420
void *Ptr1, /* three pointers to data, see */
421
*Ptr2, /* search.c */
423
Cardinal RubberbandN, /* number of lines in array */
425
RubberbandTypePtr Rubberband;
430
426
} AttachedObjectType, *AttachedObjectTypePtr;
432
428
typedef struct /* holds cursor information */
434
GC GC, /* GC for cursor drawing */
435
AttachGC; /* and for displaying buffer contents */
436
Position X, /* position in PCB coordinates */
438
MinX, /* lowest and highest coordinates */
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 */
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;
453
446
} MarkType, *MarkTypePtr;
455
448
/* ---------------------------------------------------------------------------
459
452
typedef struct /* some resources... */
461
Pixel bgColor, /* background and cursor color ... */
462
CrosshairColor, /* different object colors */
470
InvisibleObjectsColor,
472
ElementSelectedColor,
477
LayerColor[MAX_LAYER],
478
LayerSelectedColor[MAX_LAYER],
480
Dimension ViaThickness, /* some preset values */
484
MaxWidth, /* maximum size of a layout */
486
TextScale, /* text scaling in % */
488
Bloat, /* drc sizes */
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... */
506
LibraryContentsCommand,
509
FontFile, /* name of default font file */
510
Groups, /* string with layergroups */
511
Routes, /* string with route styles */
518
Size, /* geometry string for size */
519
Media; /* type of output media */
520
Position PinoutOffsetX, /* offset of origin */
522
PinoutTextOffsetX, /* offset of text from pin center */
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 */
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 */
464
InvisibleObjectsColor,
466
ElementSelectedColor,
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 */
502
Position PinoutTextOffsetX, /* offset of text from pin center */
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 */
544
527
} SettingType, *SettingTypePtr;
546
529
/* ----------------------------------------------------------------------
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;
565
548
/* ---------------------------------------------------------------------------
566
549
* structure used by device drivers
568
typedef struct /* media description */
569
{ String Name; /* name and size (in mil) */ Dimension Width,
551
typedef struct /* media description */
553
String Name; /* name and size (in mil*100) */
554
BDimension Width, Height;
555
LocationType MarginX, MarginY;
573
556
} MediaType, *MediaTypePtr;
575
typedef struct /* needs and abilities of a driver */
558
typedef struct /* needs and abilities of a driver */
577
MediaTypePtr SelectedMedia; /* media to be used */
578
FILE *FP; /* file pointers */
579
Boolean MirrorFlag, /* several flags */
582
Position OffsetX, /* offset from lower/left corner */
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 */
566
float Scale; /* scaleing */
567
BoxType BoundingBox; /* bounding box of output */
586
568
} PrintInitType, *PrintInitTypePtr;
588
typedef struct /* functions of a print driver */
570
typedef struct /* functions of a print driver */
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 */
615
598
} PrintDeviceType, *PrintDeviceTypePtr;
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;
623
typedef struct /* holds a connection */
606
typedef struct /* holds a connection */
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;
632
typedef struct /* holds a net of connections */
615
typedef struct /* holds a net of connections */
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;
639
typedef struct /* holds a list of nets */
641
Cardinal NetN, /* the number of subnets contained */
642
NetMax; /* max subnets from malloc */
644
} NetListType, *NetListTypePtr;
646
typedef struct /* holds a generic list of pointers */
648
Cardinal PtrN, /* the number of pointers contained */
649
PtrMax; /* max subnets from malloc */
651
} PointerListType, *PointerListTypePtr;
623
typedef struct /* holds a list of nets */
625
Cardinal NetN, /* the number of subnets contained */
626
NetMax; /* max subnets from malloc */
628
} NetListType, *NetListTypePtr;
630
typedef struct /* holds a list of net lists */
632
Cardinal NetListN, /* the number of net lists contained */
633
NetListMax; /* max net lists from malloc */
634
NetListTypePtr NetList;
635
} NetListListType, *NetListListTypePtr;
637
typedef struct /* holds a generic list of pointers */
639
Cardinal PtrN, /* the number of pointers contained */
640
PtrMax; /* max subnets from malloc */
642
} PointerListType, *PointerListTypePtr;
646
Cardinal BoxN, /* the number of boxes contained */
647
BoxMax; /* max boxes from malloc */
650
} BoxListType, *BoxListTypePtr;
653
653
/* ---------------------------------------------------------------------------
654
654
* define supported types of undo operations