1 #define VERSION "1.9c" 2 3 /* variable sizes */ 4 #define SMALLBUFLEN 64 /* small text buffer */ 5 #define BUFLEN 512 /* large text buffer */ 6 7 /* user interface settings elements */ 8 #define DOUBLECLICKTHRES 450 /* how fast a double click needs to be (in ticks) */ 9 #define CURSORWIDTH 6 /* width of text cursor */ 10 #define FIRSTLET 33 /* first ASCII value for letters */ 11 #define LASTLET 122 /* last ASCII value for letters */ 12 #define OBOXPAGESIZE (4) /* how many lines a pageup/down will scroll the object box */ 13 #define MULTIRAISENUM (10) /* this many presses of { or } will raise/lower a thing to the very bottom/top */ 14 #define LINESELTHRESHOLD (4) /* how close to a link you need to click to select it */ 15 16 /* graphical elements */ 17 #define SHORTCUTSIZE (10) /* font size (points) for shortcut numbers on buttons */ 18 #define BEZIERQUALITY 50 /* how many sub=lines to use when drawing bezier curves */ 19 #define MAPBOXTEXTHEIGHT 10 /* size of text in mapbox (points) */ 20 #define LINESELHANDLESIZE (5) /* how large the boxes on the ends of a selected link are */ 21 #define OBJSELHANDLEPCT (15) /* what percentage of the selected object's size the selection boxes are */ 22 #define SIDEBARW 100 /* how width the toolbox/mapbox/objectbox are */ 23 #define ERRORFLASHSPEED 5 /* how fast to fade out the statusbar error highlight */ 24 #define INFOFLASHSPEED 2 /* how fast to fade out the statusbar information highlight */ 25 #define SEARCHFLASHSPEED 5 /* how fast to fade out the search result box */ 26 27 /* defaults */ 28 #define DEFTEXTW 8 /* default text width (in pixels) for new text items */ 29 #define DEFTEXTH 10 /* default text height (in POINTS) for new text items */ 30 31 #define STATUSH (DEFTEXTH + 4) 32 33 #define SBSIZE 15 34 35 #define DEFSCREENW 900 36 #define DEFSCREENH 600 37 38 39 /* maximum/minimum values */ 40 #define MINSCREENX 100 41 #define MINSCREENY 100 42 43 #define MAXBUTTONS 18 /* maximum number of toolbox buttons from buttons.dat */ 44 #define MAXOBJTYPES 50 /* maximum amount of different types from objects.dat */ 45 46 #define MAXCHILDREN 30 /* maximum amount of submaps for any one given map */ 47 #define MAXHISTORY 50 /* maximum amount that we can drill down into a map */ 48 #define MAXLINKS 512 /* maximum number of links between objects each map can contain */ 49 #define MAXMAPS 60 /* maximum number of (sub)maps in a project */ 50 #define MAXOBJECTS 512 /* maximum number of objects each map can contain */ 51 #define MAXPOINTS 20 /* maximum number of points on a line */ 52 #define MAXTEXT 512 /* maximum number of text objects per map */ 53 54 #define MINLETTERWIDTH 6 /* minimum letter width (pixels) */ 55 #define MINLETTERHEIGHT 6 /* minimum letter width (points) */ 56 #define MAXLETTERWIDTH 100 /* maximum letter width (pixels) */ 57 #define MAXLETTERHEIGHT 100 /* maximum letter width (points) */ 58 59 #define MAXOBJWIDTH 500 /* maximum object width */ 60 #define MAXOBJHEIGHT 500 /* maximum object height */ 61 #define MINOBJWIDTH 20 /* minimum object width */ 62 #define MINOBJHEIGHT 20 /* minimum object height */ 63 64 #define MAXFILLSTACK 500000 /* used for flood fill function */ 65 66 #define OLDMAXVECTORSPERIMAGE (60) /* maximum vectors per image in old version map files */ 67 #define MAXVECTORSPERIMAGE (120) /* maximum vectors per image in current map files */ 68 69 #define MAXLINESTYLE (4) /* Types of lines (dotted, dashed, etc) */ 70 #define LINESTYLESIZE (10) /* How big each line style array is */ 71 72 /************************************* 73 * Constants 74 */ 75 76 /* The SDL_Color.unused item is ORed with the following */ 77 #define USECOLOUR (0x01) /* used as a NULL value for colours */ 78 #define ISFLOW (0x02) /* used to show whether things are traffic flows */ 79 80 /* map element ("thing") types */ 81 #define T_EMPTY (0) 82 #define T_OBJECT (1) 83 #define T_LINK (2) 84 #define T_TEXT (3) 85 #define T_LINKPOINT (4) 86 #define T_MAP (5) 87 88 /* vector types */ 89 #define VT_LINE (0) 90 #define VT_BOX (1) 91 #define VT_DOT (2) 92 #define VT_FILL (3) 93 #define VT_ELLIPSE (4) 94 #define VT_POLY (5) 95 #define VT_BEZIER (6) 96 #define VT_ENDPOLY (7) 97 #define VT_SUBOBJ (8) 98 99 /* boolean flags */ 100 #define TRUE (-1) 101 #define FALSE (0) 102 103 /* states */ 104 #define S_NONE (0) 105 #define S_OBJMOVING (1) 106 #define S_RESIZING (2) 107 #define S_DRAWLINK (3) 108 #define S_ADDOBJ (4) 109 #define S_LINKMOVING (5) 110 #define S_LINKSRCMOVE (6) 111 #define S_LINKDSTMOVE (7) 112 #define S_ADDTEXT (8) 113 #define S_TYPETEXT (9) 114 #define S_TEXTMOVING (10) 115 #define S_TEXTRESIZING (11) 116 #define S_SAVING (12) 117 #define S_LOADING (13) 118 #define S_LINKPOINTMOVE (14) 119 #define S_FGCOL (15) 120 #define S_MAPNAMING (16) 121 #define S_MATCHSIZE (17) 122 #define S_MATCHX (18) 123 #define S_MATCHY (19) 124 #define S_CREATETELE (20) 125 #define S_REALLYQUIT (21) 126 #define S_FILLCOL (22) 127 #define S_EDITTEXT (23) 128 #define S_CHANGEOBJECT (24) 129 #define S_DRAWFLOW (25) 130 #define S_SEARCH (26) 131 #define S_XSCROLL (27) 132 #define S_YSCROLL (28) 133 134 /* toolbox buttons */ 135 #define TB_POINTER (0) 136 #define TB_ADDOBJ (1) 137 #define TB_ADDTEXT (2) 138 #define TB_COPY (3) 139 #define TB_PASTE (4) 140 #define TB_GRID (5) 141 #define TB_FGCOL (6) 142 #define TB_FILLCOL (7) 143 #define TB_LINESTYLE (8) 144 #define TB_MATCHSIZE (9) 145 #define TB_MATCHPOS (10) 146 #define TB_FLOW (11) 147 #define TB_DRILLDOWN (12) 148 #define TB_CREATETELE (13) 149 #define TB_DELETEMAP (14) 150 #define TB_NEW (15) 151 #define TB_LOAD (16) 152 #define TB_SAVE (17) 153 154 155 /* selection screen values */ 156 #define YES (1) 157 #define NO (0) 158 #define MAYBE (-1) 159 160 /* Line styles are a 32-bit int split up as follows: */ 161 /* 162 * Unused Arrow Style Thickness (max 5?) 163 * 00000000 00000000 00000000 00000000 164 */ 165 #define LS_SOLID (0) 166 #define LS_DOTTED (1) 167 #define LS_BIGDASH (2) 168 #define LS_DASHDOT (3) 169 170 171 /* arrow positions */ 172 #define AP_NONE (0) 173 #define AP_START (1) 174 #define AP_END (2) 175 #define AP_BOTH (3) 176 177 /* Special mapbox child values for scroll buttons */ 178 #define C_NONE (-1) 179 #define C_SCROLLUP (-2) 180 #define C_SCROLLDOWN (-3) 181 182 /* Mouse positions */ 183 #define MP_NONE (0) 184 #define MP_TOOLBOX (1) 185 #define MP_MAPBOXNAME (2) 186 #define MP_MAPBOXCHILDREN (3) 187 #define MP_OBJECTBOX (4)