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 */
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 output. You would set this if you are */
39 /* creating a specific custom version of gEDA/gaf. */
40 /* For example, if you set this string to "FIX-", the resulting output is: */
41 /* FIX-1.0.0.20060906. */
42 #define PREPEND_VERSION_STRING ""
44 /* for color mechanism used in gschem */
47 /* for new fileselection dialog box */
48 #define MAX_FILES 2048
55 #define CONNECTION_NONE 0 /* this one is not used */
56 #define CONNECTION_REGULAR 1
57 #define CONNECTION_ROUND 2
59 #if 0 /* Comment this in if you don't have gtk 1.0.4 or greater */
64 /* X's obsession with *64 */
65 #define FULL_CIRCLE 360*64
67 /* for show_name_value in st_objects */
68 #define SHOW_NAME_VALUE 0
71 #define LEAVE_NAME_VALUE_ALONE -1
73 /* for visibility in st_objects */
76 #define LEAVE_VISIBILITY_ALONE -1
78 /* For pin and net styles */
82 /* various thicknesses (in mils) */
88 /* various visual cue sizes (in mils) */
89 #define CUE_BOX_SIZE 30
90 #define CUE_CIRCLE_SMALL_SIZE 30
91 #define CUE_CIRCLE_LARGE_SIZE 60
97 #define SMALL_ZOOMFACTOR1 150
98 #define SMALL_ZOOMFACTOR2 30
101 /* For text location on component not found graphics */
102 #define NOT_FOUND_TEXT_X 100
103 #define NOT_FOUND_TEXT_Y 100
105 /* for bus_ripper_type */
106 #define COMP_BUS_RIPPER 0
107 #define NET_BUS_RIPPER 1
109 /* for bus_ripper_rotation */
111 #define NON_SYMMETRIC 1
114 #define max(a,b) ((a) > (b) ? (a) : (b))
117 #define min(a,b) ((a) < (b) ? (a) : (b))
120 #define CONSTRAINED 2
122 /* for attrib_edit_dialog invocation flag */
124 #define FROM_HOTKEY 1
126 /* for s_clib_getfilename() */
132 /* for s_slib_search() */
133 #define SLIB_SEARCH_START 0
134 #define SLIB_SEARCH_NEXT 1
135 #define SLIB_SEARCH_DONE 2
137 /* for text cap style */
142 /* for text alignment */
149 #define MIDDLE_LEFT 1
151 #define LOWER_MIDDLE 3
152 #define MIDDLE_MIDDLE 4
153 #define UPPER_MIDDLE 5
154 #define LOWER_RIGHT 6
155 #define MIDDLE_RIGHT 7
156 #define UPPER_RIGHT 8
158 /* maximum single line length when reading in text strings */
159 #define MAX_TEXT_LINE_LENGTH 1024
161 /* one character string used to calculate tab's width */
162 /* Warning: it MUST be a string. */
163 #define TAB_CHAR_MODEL "b"
165 /* multi text line spacing (multipled times character height) */
166 #define LINE_SPACING 2.0
168 /* These modes are for net_endpoint_mode */
174 /* These modes are for net_midpoint_mode */
175 /* NONE also applies here */
180 /* The conn modes for type */
182 #define CONN_ENDPOINT 1
183 #define CONN_MIDPOINT 2
185 /* The conn whole type */
186 #define NO_MIDPOINT 0
187 #define HAS_MIDPOINT 1
188 #define HAS_BUS_MIDPOINT 2
190 /* The conn modes for visual_cue */
192 #define NET_DANGLING_CUE 2
193 #define PIN_DANGLING_CUE 3
194 #define BUS_DANGLING_CUE 4
195 #define MIDPOINT_CUE 5
196 #define BUS_MIDPOINT_CUE 6
197 #define INVALID_CUE 7
200 /* used by world_tiles to set the size of the array */
201 #define MAX_TILES_X 10
202 #define MAX_TILES_Y 10
204 /* These modes are for actionfeedback_mode */
205 /* there's a hack in i_keypress.c dealing with the 0 and 1 (has to be these */
208 #define BOUNDINGBOX 1
211 /* there are modes for text-feedback */
212 #define ONLY_WHEN_READABLE 0
215 /* used in o_undo_callback */
216 #define UNDO_ACTION 0
217 #define REDO_ACTION 1
219 /* used for undo_type */
221 #define UNDO_MEMORY 1
223 /* used for undo_savestate flag */
225 #define UNDO_VIEWPORT_ONLY 1
227 /* These are for where status information goes */
230 #define BOTH_LOGWIN_STDOUT 2
232 /* list copying flags */
233 #define NORMAL_FLAG 0
234 #define SELECTION_FLAG 1
236 /* hierarchy loading flags */
237 #define HIERARCHY_NORMAL_LOAD 0
238 #define HIERARCHY_FORCE_LOAD 1
240 /* hierarchy traversing flags */
241 #define HIERARCHY_NODUPS (1<<0)
242 #define HIERARCHY_POSTORDER (1<<1)
243 #define HIERARCHY_INNERLOOP (1<<7)
245 /* selection types */
246 /* used in o_select_object */
250 #define MILS_PER_INCH 1000
252 /* for text_output */
253 #define VECTOR_FONTS 0
257 #define GRID_VARIABLE_MODE 0
258 #define GRID_FIXED_MODE 1
260 /* for print dialog box */
263 #define EXTENTS_NOMARGINS 2
265 /* for output-capstyle */
270 /* for print dialog box */
274 /* for type to s_cue_output_all */
278 /* for log-window keyword */
280 #define MAP_ON_STARTUP 1
282 /* for log-window-type */
286 /* for third-mouse */
287 #define POPUP_ENABLED 0
288 #define MOUSEPAN_ENABLED 1
290 /* for middle-mouse */
294 #define MID_MOUSEPAN_ENABLED 3
296 /* for selected_from */
301 /* for a_pan_general and a_zoom */
302 #define A_PAN_IGNORE_BORDERS 1
303 #define A_PAN_DONT_REDRAW 2
305 /* for o_net_orientation */
309 #define HORIZONTAL_ABOVE 3
310 #define HORIZONTAL_BELOW 4
311 #define VERTICAL_LEFT 5
312 #define VERTICAL_RIGHT 6
315 #define PIN_TYPE_NET 0
316 #define PIN_TYPE_BUS 1
318 /* gnetlist: hierarchy_*_order */
322 /* gnetlist: netlist_mode */
327 /* gnetlist: net-naming-priority */
328 #define NETATTRIB_ATTRIBUTE 0
329 #define NETNAME_ATTRIBUTE 1
331 /* gschcheck: Error types */
335 #define DUP_NET_NAME 4
337 /* Max level of symlinks */
338 #define MAX_LINK_LEVEL 256
340 #if defined(__MINGW32__) && !defined(M_PI)
341 #define M_PI 3.14159265358979323846
344 /* Logs a normal message. */
345 /* inspired of GLib's g_message() (gmessages.h) - LGPL */
346 #ifdef G_HAVE_ISO_VARARGS
347 #define s_log_message(...) g_log (G_LOG_DOMAIN, \
348 G_LOG_LEVEL_MESSAGE, \
350 #elif defined(G_HAVE_GNUC_VARARGS)
351 #define s_log_message(format...) g_log (G_LOG_DOMAIN, \
352 G_LOG_LEVEL_MESSAGE, \
354 #else /* no varargs macros */
356 s_log_message (const gchar
*format
,
360 va_start (args
, format
);
361 g_logv (G_LOG_DOMAIN
, G_LOG_LEVEL_MESSAGE
, format
, args
);
364 #endif /* !__GNUC__ */
368 /* Backup filename creation string */
369 #define AUTOSAVE_BACKUP_FILENAME_STRING "#%s#"
371 /* These permission bits are absent on MinGW */
389 /* Used by the rc loading mechanism */
390 #define RETURN_G_RC_MODE(rc, var, size) \
391 return g_rc_mode_general(mode, \