4 * PCB, interactive printed circuit board design
5 * Copyright (C) 1994,1995,1996,2006 Thomas Nau
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Contact addresses for paper mail and Email:
22 * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
23 * Thomas.Nau@rz.uni-ulm.de
28 /* prototypes for misc routines
31 #ifndef __MISC_INCLUDED__
32 #define __MISC_INCLUDED__
38 void r_delete_element (DataTypePtr
, ElementTypePtr
);
39 void SetLineBoundingBox (LineTypePtr
);
40 void SetArcBoundingBox (ArcTypePtr
);
41 void SetPointBoundingBox (PointTypePtr
);
42 void SetPinBoundingBox (PinTypePtr
);
43 void SetPadBoundingBox (PadTypePtr
);
44 void SetPolygonBoundingBox (PolygonTypePtr
);
45 void SetElementBoundingBox (DataTypePtr
, ElementTypePtr
, FontTypePtr
);
46 bool IsDataEmpty (DataTypePtr
);
47 BoxTypePtr
GetDataBoundingBox (DataTypePtr
);
48 void CenterDisplay (LocationType
, LocationType
, bool);
49 void SetFontInfo (FontTypePtr
);
50 int ParseGroupString (char *, LayerGroupTypePtr
, int /* LayerN */);
51 int ParseRouteString (char *, RouteStyleTypePtr
, int);
52 void QuitApplication (void);
53 char *EvaluateFilename (char *, char *, char *, char *);
54 char *ExpandFilename (char *, char *);
55 void SetTextBoundingBox (FontTypePtr
, TextTypePtr
);
57 void SaveOutputWindow (void);
58 int GetLayerNumber (DataTypePtr
, LayerTypePtr
);
59 int GetLayerGroupNumberByPointer (LayerTypePtr
);
60 int GetLayerGroupNumberByNumber (Cardinal
);
61 int GetGroupOfLayer (int);
62 int ChangeGroupVisibility (int, bool, bool);
63 void LayerStringToLayerStack (char *);
66 BoxTypePtr
GetObjectBoundingBox (int, void *, void *, void *);
67 void ResetStackAndVisibility (void);
68 void SaveStackAndVisibility (void);
69 void RestoreStackAndVisibility (void);
70 char *GetWorkingDirectory (char *);
71 void CreateQuotedString (DynamicStringTypePtr
, char *);
72 int GetGridFactor (void);
73 BoxTypePtr
GetArcEnds (ArcTypePtr
);
74 void ChangeArcAngles (LayerTypePtr
, ArcTypePtr
, long int, long int);
75 char *UniqueElementName (DataTypePtr
, char *);
76 void AttachForCopy (LocationType
, LocationType
);
77 float GetValue (const char *, const char *, bool *);
78 int FileExists (const char *);
79 char *Concat (const char *, ...); /* end with NULL */
83 /* Returns NULL if the name isn't found, else the value for that named
85 char *AttributeGetFromList (AttributeListType
*list
, char *name
);
86 /* Adds an attribute to the list. If the attribute already exists,
87 whether it's replaced or a second copy added depends on
88 REPLACE. Returns non-zero if an existing attribute was replaced. */
89 int AttributePutToList (AttributeListType
*list
, const char *name
, const char *value
, int replace
);
90 /* Simplistic version: Takes a pointer to an object, looks up attributes in it. */
91 #define AttributeGet(OBJ,name) AttributeGetFromList (&(OBJ->Attributes), name)
92 /* Simplistic version: Takes a pointer to an object, sets attributes in it. */
93 #define AttributePut(OBJ,name,value) AttributePutToList (&(OBJ->Attributes), name, value, 1)
94 /* Remove an attribute by name. */
95 void AttributeRemoveFromList(AttributeListType
*list
, char *name
);
96 /* Simplistic version of Remove. */
97 #define AttributeRemove(OBJ, name) AttributeRemoveFromList (&(OBJ->Attributes), name)
99 /* For passing modified flags to other functions. */
100 FlagType
MakeFlags (unsigned int);
101 FlagType
OldFlags (unsigned int);
102 FlagType
AddFlags (FlagType
, unsigned int);
103 FlagType
MaskFlags (FlagType
, unsigned int);
104 #define NoFlags() MakeFlags(0)
106 /* Layer Group Functions */
108 /* Returns group actually moved to (i.e. either group or previous) */
109 int MoveLayerToGroup (int layer
, int group
);
110 /* returns pointer to private buffer */
111 char *LayerGroupsToString (LayerGroupTypePtr
);
112 /* Make the current layer groups the default. */
113 void MakeLayerGroupsDefault ();
115 /* These act like you'd expect, except always in the C locale. */
116 extern double c_strtod(const char *s
);
117 extern const char *c_dtostr(double d
);
119 /* Returns a string with info about this copy of pcb. */
120 char * GetInfoString (void);
122 /* Return a relative rotation for an element, useful only for
123 comparing two similar footprints. */
124 int ElementOrientation (ElementType
*e
);
126 /* These are in netlist.c */
128 void NetlistChanged (int force_unfreeze
);