Updated copyright text/header in most source files.
[geda-gaf/peter-b.git] / libgeda / include / libgeda / defines.h
blobd1f0422c7ce0f1bac2f99fe9f7da668d4510ab76
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.
20 /*! \file defines.h
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 */
38 /* out there */
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 */
49 #define MAX_COLORS 25
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
56 #define SHOW_VALUE 1
57 #define SHOW_NAME 2
58 #define LEAVE_NAME_VALUE_ALONE -1
60 /* for visibility in st_objects */
61 #define INVISIBLE 0
62 #define VISIBLE 1
63 #define LEAVE_VISIBILITY_ALONE -1
65 /* For pin and net styles */
66 #define THIN 0
67 #define THICK 1
69 /* various thicknesses (in mils) */
70 #define LINE_WIDTH 10
71 #define NET_WIDTH 10
72 #define PIN_WIDTH_NET 10
73 #define BUS_WIDTH 30
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
87 #undef max
88 #define max(a,b) ((a) > (b) ? (a) : (b))
90 #undef min
91 #define min(a,b) ((a) < (b) ? (a) : (b))
93 /* for s_clib_getfilename() */
94 #define OPEN_DIR 0
95 #define READ_DIR 1
96 #define CLOSE_DIR 2
97 #define SET_COUNT 3
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 */
105 /* 2 -- 5 -- 8 */
106 /* | | | */
107 /* 1 -- 4 -- 7 */
108 /* | | | */
109 /* 0 -- 3 -- 6 */
110 #define LOWER_LEFT 0
111 #define MIDDLE_LEFT 1
112 #define UPPER_LEFT 2
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 */
128 #define CONN_NULL 0
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 */
137 #define UNDO_ALL 0
138 #define UNDO_VIEWPORT_ONLY 1
140 /* These are for where status information goes */
141 #define LOG_WINDOW 0
142 #define STDOUT_TTY 1
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
162 #define PS_FONTS 1
164 /* for print dialog box */
165 #define EXTENTS 0
166 #define WINDOW 1
167 #define EXTENTS_NOMARGINS 2
169 /* for output-capstyle */
170 #define BUTT_CAP 0
171 #define ROUND_CAP 1
172 #define SQUARE_CAP 2
174 /* for print dialog box */
175 #define LANDSCAPE 0
176 #define PORTRAIT 1
178 /* for type to s_cue_output_all */
179 #define POSTSCRIPT 0
180 #define PNG 1
182 /* for o_net_orientation */
183 #define NEITHER 0
184 #define HORIZONTAL 1
185 #define VERTICAL 2
186 #define HORIZONTAL_ABOVE 3
187 #define HORIZONTAL_BELOW 4
188 #define VERTICAL_LEFT 5
189 #define VERTICAL_RIGHT 6
191 /* for pin_type */
192 #define PIN_TYPE_NET 0
193 #define PIN_TYPE_BUS 1
195 /* gnetlist: hierarchy_*_order */
196 #define APPEND 0
197 #define PREPEND 1
199 /* gnetlist: netlist_mode */
200 #define gEDA 0
201 #define SPICE 1
202 #define TANGO 2
204 /* gnetlist: net-naming-priority */
205 #define NETATTRIB_ATTRIBUTE 0
206 #define NETNAME_ATTRIBUTE 1
208 /* gschcheck: Error types */
209 #define NO_ERR 0
210 #define FLOAT_NET 1
211 #define FLOAT_PIN 2
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
219 #endif
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 */
228 #ifndef S_IWGRP
229 # define S_IWGRP 0
230 #endif
231 #ifndef S_IWOTH
232 # define S_IWOTH 0
233 #endif
234 #ifndef S_IXGRP
235 # define S_IXGRP 0
236 #endif
237 #ifndef S_IXOTH
238 # define S_IXOTH 0
239 #endif
240 #ifndef S_IRWXG
241 # define S_IRWXG 0
242 #endif
245 /* Used by the rc loading mechanism */
246 #define RETURN_G_RC_MODE(rc, var, size) \
247 return g_rc_mode_general(mode, \
248 (rc), \
249 &(var), \
250 mode_table, \
251 size)
254 #endif /* !_DEFINES_H_INCL */