Changed/updated the #define mechanism for creating custom gEDA/gaf versions.
[geda-gaf.git] / libgeda / include / defines.h
blobc42f613ea6ee7a6c542ba447e162ae42b21fc19d
1 /* gEDA - GPL Electronic Design Automation
2 * libgeda - gEDA's Library
3 * Copyright (C) 1998-2004 Ales V. 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.
20 #ifndef _DEFINES_H_INCL
21 #define _DEFINES_H_INCL
23 /* Current schematic/symbol file format */
24 #define FILEFORMAT_VERSION 1
26 /* release version which had file format changes */
27 /* New file format changes after 20030921 use the above version */
28 /* and not these #defines anymore. */
29 #define VERSION_20000220 20000220
30 #define VERSION_20000704 20000704
31 #define VERSION_20020825 20020825
32 #define VERSION_20030921 20030921
33 /* 20030921 wasn't a real version, just a MinGW test version, but it is */
34 /* out there */
36 /* Set this string to something interesting to create a custom */
37 /* version of gEDA/gaf. This string is prepended to all messages that */
38 /* output the program's VERSION. You would set this if you are creating a */
39 /* specific custom version of gEDA/gaf. This string is also used to */
40 /* distinguish between stable and development versions of gEDA/gaf. */
41 /* For example, if you set this string to "1.0-", the resulting output is: */
42 /* 1.0-20060906. */
43 #define PREPEND_VERSION_STRING "1.1-"
46 /* for color mechanism used in gschem */
47 #define MAX_COLORS 25
49 /* for new fileselection dialog box */
50 #define MAX_FILES 2048
51 #define MAX_DIRS 2048
53 #define ZOOM_OUT 0
54 #define ZOOM_IN 1
55 #define ZOOM_FULL 2
57 #define CONNECTION_NONE 0 /* this one is not used */
58 #define CONNECTION_REGULAR 1
59 #define CONNECTION_ROUND 2
61 #if 0 /* Comment this in if you don't have gtk 1.0.4 or greater */
62 #define TRUE 1
63 #define FALSE 0
64 #endif
66 /* X's obsession with *64 */
67 #define FULL_CIRCLE 360*64
69 /* for show_name_value in st_objects */
70 #define SHOW_NAME_VALUE 0
71 #define SHOW_VALUE 1
72 #define SHOW_NAME 2
73 #define LEAVE_NAME_VALUE_ALONE -1
75 /* for visibility in st_objects */
76 #define INVISIBLE 0
77 #define VISIBLE 1
78 #define LEAVE_VISIBILITY_ALONE -1
80 /* For pin and net styles */
81 #define THIN 0
82 #define THICK 1
84 /* various thicknesses (in mils) */
85 #define NET_WIDTH 10
86 #define PIN_WIDTH 10
87 #define LINE_WIDTH 10
88 #define BUS_WIDTH 30
90 /* various visual cue sizes (in mils) */
91 #define CUE_BOX_SIZE 30
92 #define CUE_CIRCLE_SMALL_SIZE 30
93 #define CUE_CIRCLE_LARGE_SIZE 60
95 /* For grip size */
96 #define GRIP_SIZE1 25
97 #define GRIP_SIZE2 50
98 #define GRIP_SIZE3 80
99 #define SMALL_ZOOMFACTOR1 150
100 #define SMALL_ZOOMFACTOR2 30
103 /* For text location on component not found graphics */
104 #define NOT_FOUND_TEXT_X 100
105 #define NOT_FOUND_TEXT_Y 100
107 /* for bus_ripper_type */
108 #define COMP_BUS_RIPPER 0
109 #define NET_BUS_RIPPER 1
111 /* for bus_ripper_rotation */
112 #define SYMMETRIC 0
113 #define NON_SYMMETRIC 1
115 #undef max
116 #define max(a,b) ((a) > (b) ? (a) : (b))
118 #undef min
119 #define min(a,b) ((a) < (b) ? (a) : (b))
121 #define FREE 1
122 #define CONSTRAINED 2
124 /* for attrib_edit_dialog invocation flag */
125 #define FROM_MENU 0
126 #define FROM_HOTKEY 1
128 /* for s_clib_getfilename() */
129 #define OPEN_DIR 0
130 #define READ_DIR 1
131 #define CLOSE_DIR 2
132 #define SET_COUNT 3
134 /* for s_slib_search() */
135 #define SLIB_SEARCH_START 0
136 #define SLIB_SEARCH_NEXT 1
137 #define SLIB_SEARCH_DONE 2
139 /* for text cap style */
140 #define LOWER 0
141 #define UPPER 1
142 #define BOTH 2
144 /* for text alignment */
145 /* 2 -- 5 -- 8 */
146 /* | | | */
147 /* 1 -- 4 -- 7 */
148 /* | | | */
149 /* 0 -- 3 -- 6 */
150 #define LOWER_LEFT 0
151 #define MIDDLE_LEFT 1
152 #define UPPER_LEFT 2
153 #define LOWER_MIDDLE 3
154 #define MIDDLE_MIDDLE 4
155 #define UPPER_MIDDLE 5
156 #define LOWER_RIGHT 6
157 #define MIDDLE_RIGHT 7
158 #define UPPER_RIGHT 8
160 /* maximum single line length when reading in text strings */
161 #define MAX_TEXT_LINE_LENGTH 1024
163 /* one character string used to calculate tab's width */
164 /* Warning: it MUST be a string. */
165 #define TAB_CHAR_MODEL "b"
167 /* multi text line spacing (multipled times character height) */
168 #define LINE_SPACING 2.0
170 /* These modes are for net_endpoint_mode */
171 #define NONE 0
172 #define FILLEDBOX 1
173 #define EMPTYBOX 2
174 #define X 3
176 /* These modes are for net_midpoint_mode */
177 /* NONE also applies here */
178 #define FILLED 3
179 #define EMPTY 4
182 /* The conn modes for type */
183 #define CONN_NULL 0
184 #define CONN_ENDPOINT 1
185 #define CONN_MIDPOINT 2
187 /* The conn whole type */
188 #define NO_MIDPOINT 0
189 #define HAS_MIDPOINT 1
190 #define HAS_BUS_MIDPOINT 2
192 /* The conn modes for visual_cue */
193 #define NO_CUE 1
194 #define NET_DANGLING_CUE 2
195 #define PIN_DANGLING_CUE 3
196 #define BUS_DANGLING_CUE 4
197 #define MIDPOINT_CUE 5
198 #define BUS_MIDPOINT_CUE 6
199 #define INVALID_CUE 7
202 /* used by world_tiles to set the size of the array */
203 #define MAX_TILES_X 10
204 #define MAX_TILES_Y 10
206 /* These modes are for actionfeedback_mode */
207 /* there's a hack in i_keypress.c dealing with the 0 and 1 (has to be these */
208 /* values */
209 #define OUTLINE 0
210 #define BOUNDINGBOX 1
213 /* there are modes for text-feedback */
214 #define ONLY_WHEN_READABLE 0
215 #define ALWAYS 1
217 /* used in o_undo_callback */
218 #define UNDO_ACTION 0
219 #define REDO_ACTION 1
221 /* used for undo_type */
222 #define UNDO_DISK 0
223 #define UNDO_MEMORY 1
225 /* used for undo_savestate flag */
226 #define UNDO_ALL 0
227 #define UNDO_VIEWPORT_ONLY 1
229 /* These are for where status information goes */
230 #define LOG_WINDOW 0
231 #define STDOUT_TTY 1
232 #define BOTH_LOGWIN_STDOUT 2
234 /* list copying flags */
235 #define NORMAL_FLAG 0
236 #define SELECTION_FLAG 1
238 /* hierarchy loading flags */
239 #define HIERARCHY_NORMAL_LOAD 0
240 #define HIERARCHY_FORCE_LOAD 1
242 /* hierarchy traversing flags */
243 #define HIERARCHY_NODUPS (1<<0)
244 #define HIERARCHY_POSTORDER (1<<1)
245 #define HIERARCHY_INNERLOOP (1<<7)
247 /* selection types */
248 /* used in o_select_object */
249 #define SINGLE 0
250 #define MULTIPLE 1
252 #define MILS_PER_INCH 1000
254 /* for text_output */
255 #define VECTOR_FONTS 0
256 #define PS_FONTS 1
258 /* for grid_mode */
259 #define GRID_VARIABLE_MODE 0
260 #define GRID_FIXED_MODE 1
262 /* for print dialog box */
263 #define EXTENTS 0
264 #define WINDOW 1
265 #define EXTENTS_NOMARGINS 2
267 /* for output-capstyle */
268 #define BUTT_CAP 0
269 #define ROUND_CAP 1
270 #define SQUARE_CAP 2
272 /* for print dialog box */
273 #define LANDSCAPE 0
274 #define PORTRAIT 1
276 /* for type to s_cue_output_all */
277 #define POSTSCRIPT 0
278 #define PNG 1
280 /* for log-window keyword */
281 #define MAP_LATER 0
282 #define MAP_ON_STARTUP 1
284 /* for log-window-type */
285 #define DECORATED 0
286 #define TRANSIENT 1
288 /* for third-mouse */
289 #define POPUP_ENABLED 0
290 #define MOUSEPAN_ENABLED 1
292 /* for middle-mouse */
293 #define STROKE 0
294 #define REPEAT 1
295 #define ACTION 2
296 #define MID_MOUSEPAN_ENABLED 3
298 /* for selected_from */
299 #define DONTCARE 0
300 #define MENU 1
301 #define HOTKEY 2
303 /* for a_pan_general and a_zoom */
304 #define A_PAN_IGNORE_BORDERS 1
305 #define A_PAN_DONT_REDRAW 2
307 /* for o_net_orientation */
308 #define NEITHER 0
309 #define HORIZONTAL 1
310 #define VERTICAL 2
311 #define HORIZONTAL_ABOVE 3
312 #define HORIZONTAL_BELOW 4
313 #define VERTICAL_LEFT 5
314 #define VERTICAL_RIGHT 6
316 /* for pin_type */
317 #define PIN_TYPE_NET 0
318 #define PIN_TYPE_BUS 1
320 /* gnetlist: hierarchy_*_order */
321 #define APPEND 0
322 #define PREPEND 1
324 /* gnetlist: netlist_mode */
325 #define gEDA 0
326 #define SPICE 1
327 #define TANGO 2
329 /* gnetlist: net-naming-priority */
330 #define NETATTRIB_ATTRIBUTE 0
331 #define NETNAME_ATTRIBUTE 1
333 /* gschcheck: Error types */
334 #define NO_ERR 0
335 #define FLOAT_NET 1
336 #define FLOAT_PIN 2
337 #define DUP_NET_NAME 4
339 /* Max level of symlinks */
340 #define MAX_LINK_LEVEL 256
342 #if defined(__MINGW32__) && !defined(M_PI)
343 #define M_PI 3.14159265358979323846
344 #endif
346 /* Logs a normal message. */
347 /* inspired of GLib's g_message() (gmessages.h) - LGPL */
348 #ifdef G_HAVE_ISO_VARARGS
349 #define s_log_message(...) g_log (G_LOG_DOMAIN, \
350 G_LOG_LEVEL_MESSAGE, \
351 __VA_ARGS__)
352 #elif defined(G_HAVE_GNUC_VARARGS)
353 #define s_log_message(format...) g_log (G_LOG_DOMAIN, \
354 G_LOG_LEVEL_MESSAGE, \
355 format)
356 #else /* no varargs macros */
357 static void
358 s_log_message (const gchar *format,
359 ...)
361 va_list args;
362 va_start (args, format);
363 g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, args);
364 va_end (args);
366 #endif /* !__GNUC__ */
368 #endif
370 /* Backup filename creation string */
371 #define AUTOSAVE_BACKUP_FILENAME_STRING "#%s#"
373 /* These permission bits are absent on MinGW */
374 #ifndef S_IWGRP
375 # define S_IWGRP 0
376 #endif
377 #ifndef S_IWOTH
378 # define S_IWOTH 0
379 #endif
380 #ifndef S_IXGRP
381 # define S_IXGRP 0
382 #endif
383 #ifndef S_IXOTH
384 # define S_IXOTH 0
385 #endif
386 #ifndef S_IRWXG
387 # define S_IRWXG 0
388 #endif