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. 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: */
43 #define PREPEND_VERSION_STRING "1.1-"
46 /* for color mechanism used in gschem */
49 /* for new fileselection dialog box */
50 #define MAX_FILES 2048
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 */
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
73 #define LEAVE_NAME_VALUE_ALONE -1
75 /* for visibility in st_objects */
78 #define LEAVE_VISIBILITY_ALONE -1
80 /* For pin and net styles */
84 /* various thicknesses (in mils) */
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
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 */
113 #define NON_SYMMETRIC 1
116 #define max(a,b) ((a) > (b) ? (a) : (b))
119 #define min(a,b) ((a) < (b) ? (a) : (b))
122 #define CONSTRAINED 2
124 /* for attrib_edit_dialog invocation flag */
126 #define FROM_HOTKEY 1
128 /* for s_clib_getfilename() */
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 */
144 /* for text alignment */
151 #define MIDDLE_LEFT 1
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 */
176 /* These modes are for net_midpoint_mode */
177 /* NONE also applies here */
182 /* The conn modes for type */
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 */
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 */
210 #define BOUNDINGBOX 1
213 /* there are modes for text-feedback */
214 #define ONLY_WHEN_READABLE 0
217 /* used in o_undo_callback */
218 #define UNDO_ACTION 0
219 #define REDO_ACTION 1
221 /* used for undo_type */
223 #define UNDO_MEMORY 1
225 /* used for undo_savestate flag */
227 #define UNDO_VIEWPORT_ONLY 1
229 /* These are for where status information goes */
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 */
252 #define MILS_PER_INCH 1000
254 /* for text_output */
255 #define VECTOR_FONTS 0
259 #define GRID_VARIABLE_MODE 0
260 #define GRID_FIXED_MODE 1
262 /* for print dialog box */
265 #define EXTENTS_NOMARGINS 2
267 /* for output-capstyle */
272 /* for print dialog box */
276 /* for type to s_cue_output_all */
280 /* for log-window keyword */
282 #define MAP_ON_STARTUP 1
284 /* for log-window-type */
288 /* for third-mouse */
289 #define POPUP_ENABLED 0
290 #define MOUSEPAN_ENABLED 1
292 /* for middle-mouse */
296 #define MID_MOUSEPAN_ENABLED 3
298 /* for selected_from */
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 */
311 #define HORIZONTAL_ABOVE 3
312 #define HORIZONTAL_BELOW 4
313 #define VERTICAL_LEFT 5
314 #define VERTICAL_RIGHT 6
317 #define PIN_TYPE_NET 0
318 #define PIN_TYPE_BUS 1
320 /* gnetlist: hierarchy_*_order */
324 /* gnetlist: netlist_mode */
329 /* gnetlist: net-naming-priority */
330 #define NETATTRIB_ATTRIBUTE 0
331 #define NETNAME_ATTRIBUTE 1
333 /* gschcheck: Error types */
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
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, \
352 #elif defined(G_HAVE_GNUC_VARARGS)
353 #define s_log_message(format...) g_log (G_LOG_DOMAIN, \
354 G_LOG_LEVEL_MESSAGE, \
356 #else /* no varargs macros */
358 s_log_message (const gchar
*format
,
362 va_start (args
, format
);
363 g_logv (G_LOG_DOMAIN
, G_LOG_LEVEL_MESSAGE
, format
, args
);
366 #endif /* !__GNUC__ */
370 /* Backup filename creation string */
371 #define AUTOSAVE_BACKUP_FILENAME_STRING "#%s#"
373 /* These permission bits are absent on MinGW */