1 /* gEDA - GPL Electronic Design Automation
2 * libgeda - gEDA's Library
3 * Copyright (C) 1998-2010 Ales Hvezda
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * \brief global libgeda definitions
24 #ifndef _DEFINES_H_INCL
25 #define _DEFINES_H_INCL
27 /* Current schematic/symbol file format */
28 #define FILEFORMAT_VERSION 2
30 /* release version which had file format changes */
31 /* New file format changes after 20030921 use the above version */
32 /* and not these #defines anymore. */
33 #define VERSION_20000220 20000220
34 #define VERSION_20000704 20000704
35 #define VERSION_20020825 20020825
36 #define VERSION_20030921 20030921
37 /* 20030921 wasn't a real version, just a MinGW test version, but it is */
40 /* Set this string to something interesting to create a custom */
41 /* version of gEDA/gaf. This string is prepended to all messages that */
42 /* output the program's version output. You would set this if you are */
43 /* creating a specific custom version of gEDA/gaf. */
44 /* For example, if you set this string to "FIX-", the resulting output is: */
45 /* FIX-1.0.0.20060906. */
46 #define PREPEND_VERSION_STRING ""
48 /* for color mechanism used in gschem */
51 /* X's obsession with *64 */
52 #define FULL_CIRCLE 360*64
54 /* for show_name_value in st_objects */
55 #define SHOW_NAME_VALUE 0
58 #define LEAVE_NAME_VALUE_ALONE -1
60 /* for visibility in st_objects */
63 #define LEAVE_VISIBILITY_ALONE -1
65 /* For pin and net styles */
69 /* various thicknesses (in mils) */
72 #define PIN_WIDTH_NET 10
74 #define PIN_WIDTH_BUS 30
76 /* various visual cue sizes (in mils) */
77 #define CUE_BOX_SIZE 30
78 #define JUNCTION_CUE_SIZE_NET 50
79 #define JUNCTION_CUE_SIZE_BUS 30
80 #define PIN_CUE_SIZE_NET 30
81 #define PIN_CUE_SIZE_BUS 50
83 /* For text location on component not found graphics */
84 #define NOT_FOUND_TEXT_X 100
85 #define NOT_FOUND_TEXT_Y 100
88 #define max(a,b) ((a) > (b) ? (a) : (b))
91 #define min(a,b) ((a) < (b) ? (a) : (b))
93 /* for s_clib_getfilename() */
99 /* for s_slib_search() */
100 #define SLIB_SEARCH_START 0
101 #define SLIB_SEARCH_NEXT 1
102 #define SLIB_SEARCH_DONE 2
104 /* for text alignment */
111 #define MIDDLE_LEFT 1
113 #define LOWER_MIDDLE 3
114 #define MIDDLE_MIDDLE 4
115 #define UPPER_MIDDLE 5
116 #define LOWER_RIGHT 6
117 #define MIDDLE_RIGHT 7
118 #define UPPER_RIGHT 8
120 /* one character string used to calculate tab's width */
121 /* Warning: it MUST be a string. */
122 #define TAB_CHAR_MODEL "b"
124 /* multi text line spacing (multipled times character height) */
125 #define LINE_SPACING 2.0
127 /* The conn modes for type */
129 #define CONN_ENDPOINT 1
130 #define CONN_MIDPOINT 2
132 /* used by world_tiles to set the size of the array */
133 #define MAX_TILES_X 10
134 #define MAX_TILES_Y 10
136 /* used for undo_savestate flag */
138 #define UNDO_VIEWPORT_ONLY 1
140 /* These are for where status information goes */
143 #define BOTH_LOGWIN_STDOUT 2
145 /* list copying flags */
146 #define NORMAL_FLAG 0
147 #define SELECTION_FLAG 1
149 /* hierarchy loading flags */
150 #define HIERARCHY_NORMAL_LOAD 0
151 #define HIERARCHY_FORCE_LOAD 1
153 /* hierarchy traversing flags */
154 #define HIERARCHY_NODUPS (1<<0)
155 #define HIERARCHY_POSTORDER (1<<1)
156 #define HIERARCHY_INNERLOOP (1<<7)
158 #define MILS_PER_INCH 1000
160 /* for text_output */
161 #define VECTOR_FONTS 0
164 /* for print dialog box */
167 #define EXTENTS_NOMARGINS 2
169 /* for output-capstyle */
174 /* for print dialog box */
178 /* for type to s_cue_output_all */
182 /* for o_net_orientation */
186 #define HORIZONTAL_ABOVE 3
187 #define HORIZONTAL_BELOW 4
188 #define VERTICAL_LEFT 5
189 #define VERTICAL_RIGHT 6
192 #define PIN_TYPE_NET 0
193 #define PIN_TYPE_BUS 1
195 /* gnetlist: hierarchy_*_order */
199 /* gnetlist: netlist_mode */
204 /* gnetlist: net-naming-priority */
205 #define NETATTRIB_ATTRIBUTE 0
206 #define NETNAME_ATTRIBUTE 1
208 /* gschcheck: Error types */
212 #define DUP_NET_NAME 4
214 /* Max level of symlinks */
215 #define MAX_LINK_LEVEL 256
217 #if defined(__MINGW32__) && !defined(M_PI)
218 #define M_PI 3.14159265358979323846
221 /* Logs a normal message. */
222 #define s_log_message g_message
224 /* Backup filename creation string */
225 #define AUTOSAVE_BACKUP_FILENAME_STRING "#%s#"
227 /* These permission bits are absent on MinGW */
245 /* Used by the rc loading mechanism */
246 #define RETURN_G_RC_MODE(rc, var, size) \
247 return g_rc_mode_general(mode, \
254 #endif /* !_DEFINES_H_INCL */