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 Boolean
IsDataEmpty (DataTypePtr
);
47 BoxTypePtr
GetDataBoundingBox (DataTypePtr
);
48 void CenterDisplay (LocationType
, LocationType
, Boolean
);
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, Boolean
, Boolean
);
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 (char *, char *, Boolean
*);
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
89 int AttributePutToList (AttributeListType
*list
, char *name
, 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)
95 /* For passing modified flags to other functions. */
96 FlagType
MakeFlags (unsigned int);
97 FlagType
OldFlags (unsigned int);
98 FlagType
AddFlags (FlagType
, unsigned int);
99 FlagType
MaskFlags (FlagType
, unsigned int);
100 #define NoFlags() MakeFlags(0)
102 /* Layer Group Functions */
104 /* Returns group actually moved to (i.e. either group or previous) */
105 int MoveLayerToGroup (int layer
, int group
);
106 /* returns pointer to private buffer */
107 char *LayerGroupsToString (LayerGroupTypePtr
);
108 /* Make the current layer groups the default. */
109 void MakeLayerGroupsDefault ();
111 /* These act like you'd expect, except always in the C locale. */
112 extern double c_strtod(const char *s
);
113 extern const char *c_dtostr(double d
);
115 /* Returns a string with info about this copy of pcb. */
116 char * GetInfoString (void);
118 /* Return a relative rotation for an element, useful only for
119 comparing two similar footprints. */
120 int ElementOrientation (ElementType
*e
);
122 /* These are in netlist.c */
124 void NetlistChanged (int force_unfreeze
);