4 * \brief Definition of types.
8 * <h1><b>Copyright.</b></h1>\n
10 * PCB, interactive printed circuit board design
12 * Copyright (C) 1994,1995,1996, 2004 Thomas Nau
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 * Contact addresses for paper mail and Email:
29 * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
30 * Thomas.Nau@rz.uni-ulm.de
36 * 10/11/96 11:37 AJF Added support for a Text() driver function.
37 * This was done out of a pressing need to force text to be printed on the
38 * silkscreen layer. Perhaps the design is not the best.
62 #include <sys/types.h>
66 /* Forward declarations for structures the HIDs need. */
67 typedef struct BoxType BoxType
;
68 typedef struct polygon_st PolygonType
;
69 typedef struct pad_st PadType
;
70 typedef struct pin_st PinType
;
71 typedef struct drc_violation_st DrcViolationType
;
72 typedef struct rtree rtree_t
;
73 typedef struct AttributeListType AttributeListType
;
75 typedef struct unit Unit
;
76 typedef struct increments Increments
;
78 typedef COORD_TYPE Coord
; /*!< pcb base unit. */
79 typedef double Angle
; /*!< Degrees. */
84 /* Internationalization support. */
87 #if defined (ENABLE_NLS)
88 /* When an empty string is used for msgid, the functions may return a nonempty
90 # define _(S) (S[0] != '\0') ? gettext(S) : S
91 # define N_(S) gettext_noop(S)
92 # define C_(C, S) pgettext(C, S)
97 #endif /* ENABLE_NLS */
100 * \brief This is used by the lexer/parser.
109 #ifndef XtSpecificationRelease
110 typedef unsigned int Cardinal
;
111 /*typedef unsigned int Pixel;*/
112 typedef char *String
;
113 typedef short Position
;
114 typedef short Dimension
;
116 typedef unsigned char BYTE
;
119 * \brief Nobody should know about the internals of this except the
120 * macros in macros.h that access it.
122 * This structure must be simple-assignable for now.
126 unsigned long f
; /* generic flags */
127 unsigned char t
[(MAX_LAYER
+ 1) / 2]; /* thermals */
131 #define __FUNCTION1(a,b) a ":" #b
132 #define __FUNCTION2(a,b) __FUNCTION1(a,b)
133 #define __FUNCTION__ __FUNCTION2(__FILE__,__LINE__)
137 /* ---------------------------------------------------------------------------
138 * Macros to annotate branch-prediction information.
139 * Taken from GLib 2.16.3 (LGPL 2).G_ / g_ prefixes have
140 * been removed to avoid namespace clashes.
143 /* The LIKELY and UNLIKELY macros let the programmer give hints to
144 * the compiler about the expected result of an expression. Some compilers
145 * can use this information for optimizations.
147 * The PCB_BOOLEAN_EXPR macro is intended to trigger a gcc warning when
148 * putting assignments inside the test.
150 #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
151 #define PCB_BOOLEAN_EXPR(expr) \
160 #define LIKELY(expr) (__builtin_expect (PCB_BOOLEAN_EXPR(expr), 1))
161 #define UNLIKELY(expr) (__builtin_expect (PCB_BOOLEAN_EXPR(expr), 0))
163 #define LIKELY(expr) (expr)
164 #define UNLIKELY(expr) (expr)
168 /* ---------------------------------------------------------------------------
169 * Do not change the following definitions even if they're not very
170 * nice. It allows us to have functions act on these "base types" and
171 * not need to know what kind of actual object they're working on.
174 /* Any object that uses the "object flags" defined in const.h, or
175 exists as an object on the pcb, MUST be defined using this as the
176 first fields, either directly or through ANYLINEFIELDS. */
177 #define ANYOBJECTFIELDS \
178 BoxType BoundingBox; \
181 // struct LibraryEntryType *net
183 /* Lines, pads, and rats all use this so they can be cross-cast. */
184 #define ANYLINEFIELDS \
191 /* ---------------------------------------------------------------------------
192 * some useful values of our widgets
196 * \brief Holds information about output window.
200 hidGC bgGC
, /*!< Background; changed from some routines. */
201 fgGC
, /*!< Foreground; changed from some routines. */
202 pmGC
; /*!< Depth 1 pixmap GC to store clip. */
207 * \brief Layer group.
209 * A layer group identifies layers which are always switched on/off
214 Cardinal Number
[MAX_GROUP
], /*!< Number of entries per groups. */
215 Entries
[MAX_GROUP
][MAX_ALL_LAYER
];
219 * \brief A bounding box.
223 Coord X1
, Y1
; /*!< Upper left corner. */
224 Coord X2
, Y2
; /*!< Lower right corner. */
239 struct AttributeListType
245 /* ---------------------------------------------------------------------------
246 * the basic object types supported by PCB
250 * \brief All on-pcb objects (elements, lines, pads, vias, rats, etc)
258 * \brief A line/polygon point.
262 Coord X
, Y
, X2
, Y2
; /*!< So Point type can be cast as BoxType. */
267 * \brief Lines, rats, pads, etc.
274 * \brief Holds information about one line.
285 int Scale
; /*!< Text scaling in percent. */
286 Coord X
; /*!< X-coordinate of origin. */
287 Coord Y
; /*!< Y-coordinate of origin. */
289 char *TextString
; /*!< String. */
294 * \brief Holds information about a polygon.
299 Cardinal PointN
; /*!< Number of points in polygon. */
300 Cardinal PointMax
; /*!< Max number from malloc(). */
301 POLYAREA
*Clipped
; /*!< The clipped region of this polygon. */
302 PLINE
*NoHoles
; /*!< The polygon broken into hole-less regions */
303 int NoHolesValid
; /*!< Is the NoHoles polygon up to date? */
304 PointType
*Points
; /*!< Data. */
305 Cardinal
*HoleIndex
; /*!< Index of hole data within the Points array. */
306 Cardinal HoleIndexN
; /*!< Number of holes in polygon. */
307 Cardinal HoleIndexMax
; /*!< Max number from malloc(). */
312 * \brief Holds information about arcs.
317 Coord Thickness
, Clearance
;
320 Coord Width
; /*!< Length of axis */
321 Coord Height
; /*!< Width of axis */
322 Coord X
; /*!< X-value of the center coordinates. */
323 Coord Y
; /*!< Y-value of the center coordinates. */
324 Angle StartAngle
; /*!< The start angle in degrees. */
325 Angle Delta
; /*!< The described angle in degrees. */
330 struct rtree_node
*root
;
331 int size
; /*!< Number of entries in tree */
335 * \brief Holds information about one layer. */
338 LayertypeType Type
; /*!< LT_* from hid.h */
339 char *Name
; /*!< Layer name. */
340 Cardinal LineN
; /*!< Number of lines. */
341 Cardinal TextN
; /*!< Labels. */
342 Cardinal PolygonN
; /*!< Polygons. */
343 Cardinal ArcN
; /*!< Arcs. */
348 rtree_t
*line_tree
, *text_tree
, *polygon_tree
, *arc_tree
;
349 bool On
; /*!< Visible flag. */
350 char *Color
, /*!< Color. */
352 AttributeListType Attributes
;
353 int no_drc
; /*!< Whether to ignore the layer when checking the design
364 Cardinal group1
; /*!< The layer group each point is on. */
365 Cardinal group2
; /*!< The layer group each point is on. */
375 char *Name
, *Number
; /*!< 'Line'. */
389 Coord DrillingHole
; /*!< Diameter of the drill hole. */
390 Coord X
; /*!< X-value of the center coordinates. */
391 Coord Y
; /*!< Y-value of the center coordinates. */
398 /* This is the extents of a Pin or Via, depending on whether it's a
400 #define PIN_SIZE(pinptr) (TEST_FLAG(HOLEFLAG, (pinptr)) \
401 ? (pinptr)->DrillingHole \
402 : (pinptr)->Thickness)
410 TextType Name
[MAX_ELEMENTNAMES
];
411 /*!< The elements names;
412 * - description text,
413 * - name on PCB second,
417 Coord MarkX
; /*!< X-value of the position mark. */
418 Coord MarkY
; /*!< Y-value of the position mark. */
419 Cardinal PinN
; /*!< Number of pins. */
420 Cardinal PadN
; /*!< Number of pads. */
421 Cardinal LineN
; /*!< Number of lines. */
422 Cardinal ArcN
; /*!< Number of arcs. */
428 AttributeListType Attributes
;
431 /* ---------------------------------------------------------------------------
432 * symbol and font related stuff
435 * \brief A single symbol.
441 Cardinal LineN
; /*!< Number of lines. */
443 Coord Width
; /*!< Width of cell. */
444 Coord Height
; /*!< Height of cell. */
445 Coord Delta
; /*!< Distance to next symbol. */
449 * \brief Complete set of symbols.
453 Coord MaxHeight
; /*!< Maximum cell width. */
454 Coord MaxWidth
; /*!< Maximum cell height. */
455 BoxType DefaultSymbol
; /*!< The default symbol is a filled box. */
456 SymbolType Symbol
[MAX_FONTPOSITION
+ 1];
461 * \brief Holds all objects.
465 Cardinal ViaN
; /*!< Number of vias. */
466 Cardinal ElementN
; /*!< Number of elements. */
467 Cardinal RatN
; /*!< Number of rat-lines. */
468 int LayerN
; /*!< Number of layers in this board. */
472 rtree_t
*via_tree
, *element_tree
, *pin_tree
, *pad_tree
, *name_tree
[3], /* for element names */
475 LayerType Layer
[MAX_ALL_LAYER
];
480 * \brief Holds drill information.
484 Coord DrillSize
; /*!< This drill's diameter. */
485 Cardinal ElementN
; /*!< The number of elements using this drill size. */
486 Cardinal ElementMax
; /*!< Max. number of elements from malloc(). */
487 Cardinal PinCount
; /*!< Number of pins drilled this size. */
488 Cardinal ViaCount
; /*!< Number of vias drilled this size. */
489 Cardinal UnplatedCount
; /*!< Number of these holes that are unplated. */
490 Cardinal PinN
; /*!< Number of drill coordinates in the list. */
491 Cardinal PinMax
; /*!< Max. number of coordinates from malloc(). */
492 PinType
**Pin
; /*!< Coordinates to drill. */
493 ElementType
**Element
; /*!< A pointer to an array of element pointers. */
497 * \brief Holds a range of Drill Infos.
501 Cardinal DrillN
; /*!< Number of drill sizes. */
502 Cardinal DrillMax
; /*!< Max. number from malloc(). */
503 DrillType
*Drill
; /*!< Plated holes. */
508 Coord Thick
; /*!< Line thickness. */
509 Coord Diameter
; /*!< Via diameter. */
510 Coord Hole
; /*!< Via drill hole. */
511 Coord Keepaway
; /*!< Min. separation from other nets. */
517 * \brief Structure used by library routines.
521 char *ListEntry
; /*!< The string for the selection box. */
522 char *AllocatedMemory
; /*!< Pointer to allocated memory;
523 all others point to parts of the string. */
524 char *Template
; /*!< m4 template name. */
525 char *Package
; /*!< Package. */
526 char *Value
; /*!< The value field. */
527 char *Description
; /*!< Some descriptional text. */
533 * If the internal flag is set, the only field that is valid is Name,
534 * and the struct is allocated with malloc instead of
535 * CreateLibraryEntry. These "internal" entries are used for
536 * electrical paths that aren't yet assigned to a real net.
540 char *Name
; /*!< Name of the menu entry. */
541 char *directory
; /*!< Directory name library elements are from. */
542 char *Style
; /*!< Routing style. */
543 Cardinal EntryN
; /*!< Number of objects. */
544 Cardinal EntryMax
; /*!< Number of reserved memory locations. */
545 LibraryEntryType
*Entry
; /*!< The entries. */
546 char flag
; /*!< Used by the netlist window to enable/disable nets. */
547 char internal
; /*!< If set, this is an internal-only entry, not
548 * part of the global netlist. */
553 Cardinal MenuN
; /*!< Number of objects. */
554 Cardinal MenuMax
; /*!< Number of reserved memory locations. */
555 LibraryMenuType
*Menu
; /*!< The entries. */
560 * \brief The PCBType struct holds information about board layout most
561 * of which is saved with the layout.
563 * A new PCB layout struct is first initialized with values from the
564 * user configurable \c Settings struct and then reset to the saved
565 * layout values when a layout is loaded.
567 * This struct is also used for the remove list and for buffer handling.
569 typedef struct PCBType
571 long ID
; /*!< See macro.h. */
573 char *Name
, /*!< Name of board. */
574 *Filename
, /*!< Name of file (from load). */
575 *PrintFilename
, /*!< From print dialog. */
576 *Netlistname
, /*!< Name of netlist file. */
577 ThermStyle
; /*!< Type of thermal to place with thermal tool. */
578 bool Changed
, /*!< Layout has been changed. */
579 ViaOn
, /*!< Visibility flag for vias. */
580 ElementOn
, /*!< Visibility flag for elements. */
581 RatOn
, /*!< Visibility flag for rat lines. */
583 PinOn
, /*!< Visibility flag for pins. */
584 SilkActive
, /*!< Active layer is actually silk. */
585 RatDraw
; /*!< We're drawing rats. */
586 char *ViaColor
, /*!< Via color. */
587 *ViaSelectedColor
, /*!< Selected via color. */
588 *PinColor
, /*!< Pin color. */
589 *PinSelectedColor
, /*!< Selected pin color. */
590 *PinNameColor
, /*!< Pin name color. */
591 *ElementColor
, /*!< Element color. */
592 *RatColor
, /*!< Rat line color. */
593 *InvisibleObjectsColor
, /*!< Invisible objects color. */
594 *InvisibleMarkColor
, /*!< Invisible mark color. */
595 *ElementSelectedColor
, /*!< Selected elements color. */
596 *RatSelectedColor
, /*!< Selected rat line color. */
597 *ConnectedColor
, /*!< Connected color. */
598 *FoundColor
, /*!< Found color. */
599 *WarnColor
, /*!< Warning color. */
600 *MaskColor
; /*!< Mask color. */
601 long CursorX
, /*!< Cursor position as saved with layout (X value). */
602 CursorY
, /*!< Cursor position as saved with layout (Y value). */
604 Coord Bloat
, /*!< DRC bloat size saved with layout. */
605 Shrink
, /*!< DRC shrink size saved with layout. */
606 minWid
, /*!< DRC minimum width size saved with layout. */
607 minSlk
, /*!< DRC minimum silk size saved with layout. */
608 minDrill
, /*!< DRC minimum drill size saved with layout. */
609 minRing
; /*!< DRC minimum annular ring size saved with layout. */
610 Coord GridOffsetX
, /*!< As saved with layout (X value). */
611 GridOffsetY
, /*!< As saved with layout (Y value). */
612 MaxWidth
, /*!< Maximum allowed width size. */
613 MaxHeight
; /*!< Maximum allowed height size. */
615 Coord Grid
; /*!< Used grid with offsets. */
616 double IsleArea
, /*!< Minimum poly island to retain. */
617 ThermScale
; /*!< Scale factor used with thermals. */
619 LayerGroupType LayerGroups
;
620 RouteStyleType RouteStyle
[NUM_STYLES
];
621 LibraryType NetlistLib
;
622 AttributeListType Attributes
;
623 DataType
*Data
; /*!< Entire database. */
625 bool is_footprint
; /*!< If set, the user has loaded a footprint, not a pcb. */
630 * \brief Information about the paste buffer.
634 Coord X
; /*!< Offset (X value). */
635 Coord Y
; /*!< Offset (Y value). */
637 DataType
*Data
; /*!< Data; not all members of PCBType are used. */
640 /* ---------------------------------------------------------------------------
641 * some types for cursor drawing, setting of block and lines
642 * as well as for merging of elements
646 * \brief Rubberband lines for element moves.
650 LayerType
*Layer
; /*!< Layer that holds the line. */
651 LineType
*Line
; /*!< The line itself. */
652 PointType
*MovedPoint
; /*!< And finally the point. */
656 * \brief Current marked line.
660 PointType Point1
; /*!< Start position. */
661 PointType Point2
; /*!< End position. */
667 * \brief Currently marked block.
671 PointType Point1
; /*!< Start position. */
672 PointType Point2
; /*!< End position. */
678 * \brief Currently attached object.
682 Coord X
; /*!< Saved position when MOVE_MODE (X value). */
683 Coord Y
; /*!< Saved position when MOVE_MODE (Y value). */
685 long int Type
, /*!< Object type. */
687 void *Ptr1
; /*!< Pointer to data, see search.c. */
688 void *Ptr2
; /*!< Pointer to data, see search.c. */
689 void *Ptr3
; /*!< Pointer to data, see search.c. */
690 Cardinal RubberbandN
, /*!< Number of lines in array. */
692 RubberbandType
*Rubberband
;
693 } AttachedObjectType
;
697 Basic_Crosshair_Shape
= 0, /*!< 4-ray. */
698 Union_Jack_Crosshair_Shape
, /*!< 8-ray. */
699 Dozen_Crosshair_Shape
, /*!< 12-ray. */
700 Crosshair_Shapes_Number
704 * \brief Holds cursor information.
708 hidGC GC
; /*!< GC for cursor drawing. */
709 hidGC AttachGC
; /*!< GC for displaying buffer contents. */
710 Coord X
; /*!< Position in PCB coordinates (X value). */
711 Coord Y
; /*!< Position in PCB coordinates (Y value). */
712 Coord MinX
; /*!< Lowest coordinates (X value). */
713 Coord MinY
; /*!< Lowest coordinates (Y value). */
714 Coord MaxX
; /*!< Highest coordinates (X value). */
715 Coord MaxY
; /*!< Highest coordinates (Y value). */
716 AttachedLineType AttachedLine
; /*!< Data of new lines. */
717 AttachedBoxType AttachedBox
;
718 PolygonType AttachedPolygon
;
719 AttachedObjectType AttachedObject
; /*!< Data of attached objects. */
720 enum crosshair_shape shape
; /*!< Shape of Crosshair. */
730 * \brief Our resources.
732 * Most of them are used as default when a new design is started.
736 const Unit
*grid_unit
;
737 Increments
*increments
;
743 *BackgroundColor
, /*!< Background color. */
744 *CrosshairColor
, /*!< Crosshair color. */
745 *CrossColor
, /*!< Cross color. */
746 *ViaColor
, /*!< Via color. */
747 *ViaSelectedColor
, /*!< Selected via color. */
748 *PinColor
, /*!< Pin color. */
749 *PinSelectedColor
, /*!< Selected pin color. */
750 *PinNameColor
, /*!< Pin name color. */
751 *ElementColor
, /*!< Element color. */
752 *RatColor
, /*!< Rat color. */
753 *InvisibleObjectsColor
, /*!< Invisible objects color. */
754 *InvisibleMarkColor
, /*!< Invisible mark color. */
755 *ElementSelectedColor
, /*!< Selected element color. */
756 *RatSelectedColor
, /*!< Selected rat color. */
757 *ConnectedColor
, /*!< Connected color. */
758 *FoundColor
, /*!< Found color. */
760 *GridColor
, /*!< Grid color. */
761 *LayerColor
[MAX_LAYER
],
762 *LayerSelectedColor
[MAX_LAYER
],
763 *WarnColor
, /*!< Warning color. */
764 *MaskColor
; /*!< Mask color. */
765 Coord ViaThickness
, /*!< Default via thickness value. */
766 ViaDrillingHole
, /*!< Default via drill hole value. */
767 LineThickness
, /*!< Default line thickness value. */
768 RatThickness
, /*!< Default rat thickness value. */
769 Keepaway
, /*!< Default keepaway value. */
770 MaxWidth
, /*!< Default size of a new layout (X value). */
771 MaxHeight
, /*!< Default size of a new layout (Y value). */
773 Bloat
, /*!< Default drc size for bloat. */
774 Shrink
, /*!< Default drc size for shrink. */
775 minWid
, /*!< Default drc size for minimum trace width. */
776 minSlk
, /*!< Default drc size for minumum silk width. */
777 minDrill
, /*!< Default drc size for minimum drill size. */
778 minRing
; /*!< Default drc size for minimum annular ring. */
779 int TextScale
; /*!< Text scaling in %. */
780 Coord Grid
; /*!< Grid in pcb-units. */
781 double IsleArea
; /*!< Polygon min area. */
782 int PinoutNameLength
, /*!< Max displayed length of a pinname. */
783 Volume
, /*!< The speakers volume -100 .. 100. */
784 CharPerLine
, /*!< Width of an output line in characters. */
785 Mode
, /*!< Currently active mode. */
786 BufferNumber
; /*!< Number of the current buffer. */
787 int BackupInterval
; /*!< Time between two backups in seconds. */
788 char *DefaultLayerName
[MAX_LAYER
],
789 *FontCommand
, /*!< Command for font file loading. */
790 *FileCommand
, /*!< Command for file loading. */
791 *ElementCommand
, /*!< Command for element file loading. */
795 *LibraryContentsCommand
,
796 *LibraryTree
, /*!< Path to library tree. */
799 *FontFile
, /*!< Name of default font file. */
800 *Groups
, /*!< String with layergroups. */
801 *Routes
, /*!< String with route styles. */
809 *Size
, /*!< Geometry string for size. */
810 *BackgroundImage
, /*!< PPM file for board background. */
811 *ScriptFilename
, /*!< PCB Actions script to execute on startup. */
812 *ActionString
, /*!< PCB Actions string to execute on startup. */
813 *FabAuthor
, /*!< Full name of author for FAB drawings. */
814 *GnetlistProgram
, /*!< gnetlist program name. */
815 *MakeProgram
, /*!< make program name. */
816 *InitialLayerStack
; /*!< If set, the initial layer stack is set to this. */
817 Coord PinoutOffsetX
; /*!< Offset of origin (X value). */
818 Coord PinoutOffsetY
; /*!< Offset of origin (Y value). */
819 Coord PinoutTextOffsetX
; /*!< Offset of text from pin center (X value). */
820 Coord PinoutTextOffsetY
; /*!< Offset of text from pin center (Y value). */
821 RouteStyleType RouteStyle
[NUM_STYLES
]; /*!< Default routing styles. */
822 LayerGroupType LayerGroups
; /*!< Default layer groups. */
825 UniqueNames
, /*!< Force unique names. */
826 SnapPin
, /*!< Snap to pins and pads. */
827 ShowBottomSide
, /*!< Mirror output. */
828 SaveLastCommand
, /*!< Save the last command entered by user. */
829 SaveInTMP
, /*!< Always save data in /tmp. */
830 SaveMetricOnly
, /*!< Save with mm suffix only, not mil/mm hybrid. */
831 DrawGrid
, /*!< Draw grid points. */
832 RatWarn
, /*!< Rats nest has set warnings. */
833 StipplePolygons
, /*!< Draw polygons with stipple. */
834 AllDirectionLines
, /*!< Enable lines to all directions. */
835 RubberBandMode
, /*!< Move, rotate use rubberband connections. */
836 SwapStartDirection
,/*!< Change starting direction after each click. */
837 ShowDRC
, /*!< Show drc region on crosshair. */
839 ShowNumber
, /*!< Pinout shows number. */
840 OrthogonalMoves
, /*!< . */
841 ResetAfterElement
, /*!< Reset connections after each element. */
842 liveRouting
, /*!< Autorouter shows tracks in progress. */
843 RingBellWhenFinished
,
844 /*!< flag if a signal should be produced when searching of
845 * connections is done. */
847 /*!< Flag which says we should force placement of the windows on
853 * \brief Pointer to low-level copy, move and rotate functions.
857 void *(*Line
) (LayerType
*, LineType
*);
858 void *(*Text
) (LayerType
*, TextType
*);
859 void *(*Polygon
) (LayerType
*, PolygonType
*);
860 void *(*Via
) (PinType
*);
861 void *(*Element
) (ElementType
*);
862 void *(*ElementName
) (ElementType
*);
863 void *(*Pin
) (ElementType
*, PinType
*);
864 void *(*Pad
) (ElementType
*, PadType
*);
865 void *(*LinePoint
) (LayerType
*, LineType
*, PointType
*);
866 void *(*Point
) (LayerType
*, PolygonType
*, PointType
*);
867 void *(*Arc
) (LayerType
*, ArcType
*);
868 void *(*Rat
) (RatType
*);
869 } ObjectFunctionType
;
871 /* ---------------------------------------------------------------------------
872 * structure used by device drivers
877 * \brief Holds a connection.
881 Coord X
; /*!< Coordinate of connection (X value). */
882 Coord Y
; /*!< Coordinate of connection (Y value). */
883 long int type
; /*!< Type of object in ptr1 - 3. */
884 void *ptr1
; /*!< The object of the connection. */
885 void *ptr2
; /*!< The object of the connection. */
886 Cardinal group
; /*!< The layer group of the connection. */
887 LibraryMenuType
*menu
; /*!< The netmenu this *SHOULD* belong to. */
891 * \brief Holds a net of connections.
895 Cardinal ConnectionN
; /*!< The number of connections contained. */
896 Cardinal ConnectionMax
; /*!< Max connections from malloc. */
897 ConnectionType
*Connection
;
898 RouteStyleType
*Style
;
902 * \brief Holds a list of nets.
906 Cardinal NetN
; /*!< The number of subnets contained. */
907 Cardinal NetMax
; /*!< Max subnets from malloc. */
912 * \brief Holds a list of net lists.
916 Cardinal NetListN
; /*!< The number of net lists contained. */
917 Cardinal NetListMax
; /*!< Max net lists from malloc. */
918 NetListType
*NetList
;
922 * \brief Holds a generic list of pointers.
926 Cardinal PtrN
; /*!< The number of pointers contained. */
927 Cardinal PtrMax
; /*!< Max subnets from malloc. */
933 Cardinal BoxN
; /*!< The number of boxes contained. */
934 Cardinal BoxMax
; /*!< Max boxes from malloc. */
938 struct drc_violation_st
945 Coord measured_value
;
946 Coord required_value
;
948 long int *object_id_list
;
949 int *object_type_list
;
952 /* ---------------------------------------------------------------------------
953 * define supported types of undo operations
954 * note these must be separate bits now
956 #define UNDO_CHANGENAME 0x0001 /*!< Change of names. */
957 #define UNDO_MOVE 0x0002 /*!< Moving objects. */
958 #define UNDO_REMOVE 0x0004 /*!< Removing objects. */
959 #define UNDO_REMOVE_POINT 0x0008 /*!< Removing polygon/... points. */
960 #define UNDO_INSERT_POINT 0x0010 /*!< Inserting polygon/... points. */
961 #define UNDO_REMOVE_CONTOUR 0x0020 /*!< Removing a contour from a polygon. */
962 #define UNDO_INSERT_CONTOUR 0x0040 /*!< Inserting a contour from a polygon. */
963 #define UNDO_ROTATE 0x0080 /*!< Rotations. */
964 #define UNDO_CREATE 0x0100 /*!< Creation of objects. */
965 #define UNDO_MOVETOLAYER 0x0200 /*!< Moving objects to. */
966 #define UNDO_FLAG 0x0400 /*!< Toggling SELECTED flag. */
967 #define UNDO_CHANGESIZE 0x0800 /*!< Change size of object. */
968 #define UNDO_CHANGE2NDSIZE 0x1000 /*!< Change 2ndSize of object. */
969 #define UNDO_MIRROR 0x2000 /*!< Change side of board. */
970 #define UNDO_CHANGECLEARSIZE 0x4000 /*!< Change clearance size. */
971 #define UNDO_CHANGEMASKSIZE 0x8000 /*!< Change mask size. */
972 #define UNDO_CHANGEANGLES 0x10000 /*!< Change arc angles. */
973 #define UNDO_LAYERCHANGE 0x20000 /*!< Layer new/delete/move. */
974 #define UNDO_CLEAR 0x40000 /*!< Clear/restore to polygons. */
975 #define UNDO_NETLISTCHANGE 0x80000 /*!< Netlist change. */
977 /* ---------------------------------------------------------------------------
979 #if (__GNUC__ * 1000 + __GNUC_MINOR__) > 2007
980 #define ATTRIBUTE_UNUSED __attribute__((unused))
982 #define ATTRIBUTE_UNUSED
985 /* ---------------------------------------------------------------------------
986 * Macros called by various action routines to show usage or to report
987 * a syntax error and fail
989 #define AUSAGE(x) Message ("Usage:\n%s\n", (x##_syntax))
990 #define AFAIL(x) { Message ("Syntax error. Usage:\n%s\n", (x##_syntax)); return 1; }
992 /* ---------------------------------------------------------------------------
993 * Variables with absolute paths to various directories. These are deduced
994 * at runtime to allow pcb to be relocatable
996 extern char *bindir
; /*!< The dir in which PCB installation was found. */
997 extern char *pcblibdir
; /*!< The system M4 fp directory. */
998 extern char *pcblibpath
; /*!< The search path for M4 fps. */
999 extern char *pcbtreedir
; /*!< The system newlib fp directory. */
1000 extern char *pcbtreepath
; /*!< The search path for newlib fps. */
1001 extern char *exec_prefix
;
1002 extern char *homedir
;
1004 #endif /* PCB_GLOBAL_H */