2009-07-30 06:06:00 +10:00
|
|
|
#define VERSION "1.9a"
|
2006-01-17 14:27:15 +11:00
|
|
|
|
|
|
|
/* variable sizes */
|
|
|
|
#define SMALLBUFLEN 64 /* small text buffer */
|
|
|
|
#define BUFLEN 512 /* large text buffer */
|
|
|
|
|
|
|
|
/* user interface settings elements */
|
2006-02-03 15:56:08 +11:00
|
|
|
#define DOUBLECLICKTHRES 450 /* how fast a double click needs to be (in ticks) */
|
2006-01-17 14:27:15 +11:00
|
|
|
#define CURSORWIDTH 6 /* width of text cursor */
|
|
|
|
#define FIRSTLET 33 /* first ASCII value for letters */
|
|
|
|
#define LASTLET 122 /* last ASCII value for letters */
|
|
|
|
#define OBOXPAGESIZE (4) /* how many lines a pageup/down will scroll the object box */
|
|
|
|
#define MULTIRAISENUM (10) /* this many presses of { or } will raise/lower a thing to the very bottom/top */
|
|
|
|
#define LINESELTHRESHOLD (4) /* how close to a link you need to click to select it */
|
|
|
|
|
|
|
|
/* graphical elements */
|
|
|
|
#define SHORTCUTSIZE (10) /* font size (points) for shortcut numbers on buttons */
|
|
|
|
#define BEZIERQUALITY 50 /* how many sub=lines to use when drawing bezier curves */
|
|
|
|
#define MAPBOXTEXTHEIGHT 10 /* size of text in mapbox (points) */
|
|
|
|
#define LINESELHANDLESIZE (5) /* how large the boxes on the ends of a selected link are */
|
|
|
|
#define OBJSELHANDLEPCT (15) /* what percentage of the selected object's size the selection boxes are */
|
|
|
|
#define SIDEBARW 100 /* how width the toolbox/mapbox/objectbox are */
|
|
|
|
#define ERRORFLASHSPEED 5 /* how fast to fade out the statusbar error highlight */
|
|
|
|
#define INFOFLASHSPEED 2 /* how fast to fade out the statusbar information highlight */
|
2006-06-20 11:50:21 +10:00
|
|
|
#define SEARCHFLASHSPEED 5 /* how fast to fade out the search result box */
|
2006-01-17 14:27:15 +11:00
|
|
|
|
|
|
|
/* defaults */
|
|
|
|
#define DEFTEXTW 8 /* default text width (in pixels) for new text items */
|
|
|
|
#define DEFTEXTH 10 /* default text height (in POINTS) for new text items */
|
|
|
|
|
2006-05-22 17:21:36 +10:00
|
|
|
#define STATUSH (DEFTEXTH + 4)
|
|
|
|
|
|
|
|
#define SBSIZE 15
|
|
|
|
|
|
|
|
#define DEFSCREENW 900
|
|
|
|
#define DEFSCREENH 600
|
|
|
|
|
|
|
|
|
2006-01-17 14:27:15 +11:00
|
|
|
/* maximum/minimum values */
|
2006-05-22 17:21:36 +10:00
|
|
|
#define MINSCREENX 100
|
|
|
|
#define MINSCREENY 100
|
|
|
|
|
2006-01-17 14:27:15 +11:00
|
|
|
#define MAXBUTTONS 18 /* maximum number of toolbox buttons from buttons.dat */
|
|
|
|
#define MAXOBJTYPES 50 /* maximum amount of different types from objects.dat */
|
|
|
|
|
|
|
|
#define MAXCHILDREN 30 /* maximum amount of submaps for any one given map */
|
|
|
|
#define MAXHISTORY 50 /* maximum amount that we can drill down into a map */
|
|
|
|
#define MAXLINKS 512 /* maximum number of links between objects each map can contain */
|
|
|
|
#define MAXMAPS 60 /* maximum number of (sub)maps in a project */
|
|
|
|
#define MAXOBJECTS 512 /* maximum number of objects each map can contain */
|
|
|
|
#define MAXPOINTS 20 /* maximum number of points on a line */
|
|
|
|
#define MAXTEXT 512 /* maximum number of text objects per map */
|
|
|
|
|
|
|
|
#define MINLETTERWIDTH 6 /* minimum letter width (pixels) */
|
|
|
|
#define MINLETTERHEIGHT 6 /* minimum letter width (points) */
|
|
|
|
#define MAXLETTERWIDTH 100 /* maximum letter width (pixels) */
|
|
|
|
#define MAXLETTERHEIGHT 100 /* maximum letter width (points) */
|
|
|
|
|
|
|
|
#define MAXOBJWIDTH 500 /* maximum object width */
|
|
|
|
#define MAXOBJHEIGHT 500 /* maximum object height */
|
|
|
|
#define MINOBJWIDTH 20 /* minimum object width */
|
|
|
|
#define MINOBJHEIGHT 20 /* minimum object height */
|
|
|
|
|
|
|
|
#define MAXFILLSTACK 500000 /* used for flood fill function */
|
|
|
|
|
|
|
|
#define OLDMAXVECTORSPERIMAGE (60) /* maximum vectors per image in old version map files */
|
|
|
|
#define MAXVECTORSPERIMAGE (120) /* maximum vectors per image in current map files */
|
|
|
|
|
|
|
|
#define MAXLINESTYLE (4) /* Types of lines (dotted, dashed, etc) */
|
|
|
|
#define LINESTYLESIZE (10) /* How big each line style array is */
|
|
|
|
|
|
|
|
/*************************************
|
|
|
|
* Constants
|
|
|
|
*/
|
2005-10-30 19:45:37 +11:00
|
|
|
|
2006-01-17 14:27:15 +11:00
|
|
|
/* The SDL_Color.unused item is ORed with the following */
|
2005-11-15 14:45:04 +11:00
|
|
|
#define USECOLOUR (0x01) /* used as a NULL value for colours */
|
|
|
|
#define ISFLOW (0x02) /* used to show whether things are traffic flows */
|
2005-10-28 16:05:57 +10:00
|
|
|
|
2006-01-17 14:27:15 +11:00
|
|
|
/* map element ("thing") types */
|
2005-10-25 16:35:55 +10:00
|
|
|
#define T_EMPTY (0)
|
|
|
|
#define T_OBJECT (1)
|
|
|
|
#define T_LINK (2)
|
|
|
|
#define T_TEXT (3)
|
|
|
|
#define T_LINKPOINT (4)
|
2005-11-15 14:45:04 +11:00
|
|
|
#define T_MAP (5)
|
2005-10-25 16:35:55 +10:00
|
|
|
|
2006-01-17 14:27:15 +11:00
|
|
|
/* vector types */
|
2005-10-25 16:35:55 +10:00
|
|
|
#define VT_LINE (0)
|
|
|
|
#define VT_BOX (1)
|
|
|
|
#define VT_DOT (2)
|
|
|
|
#define VT_FILL (3)
|
2005-11-11 23:42:29 +11:00
|
|
|
#define VT_ELLIPSE (4)
|
2005-11-18 19:39:29 +11:00
|
|
|
#define VT_POLY (5)
|
2005-11-15 14:45:04 +11:00
|
|
|
#define VT_BEZIER (6)
|
2005-11-18 19:39:29 +11:00
|
|
|
#define VT_ENDPOLY (7)
|
|
|
|
#define VT_SUBOBJ (8)
|
2005-10-25 16:35:55 +10:00
|
|
|
|
2006-01-17 14:27:15 +11:00
|
|
|
/* boolean flags */
|
2005-10-25 16:35:55 +10:00
|
|
|
#define TRUE (-1)
|
|
|
|
#define FALSE (0)
|
|
|
|
|
2006-01-17 14:27:15 +11:00
|
|
|
/* states */
|
2005-10-25 16:35:55 +10:00
|
|
|
#define S_NONE (0)
|
|
|
|
#define S_OBJMOVING (1)
|
|
|
|
#define S_RESIZING (2)
|
|
|
|
#define S_DRAWLINK (3)
|
|
|
|
#define S_ADDOBJ (4)
|
|
|
|
#define S_LINKMOVING (5)
|
|
|
|
#define S_LINKSRCMOVE (6)
|
|
|
|
#define S_LINKDSTMOVE (7)
|
|
|
|
#define S_ADDTEXT (8)
|
|
|
|
#define S_TYPETEXT (9)
|
|
|
|
#define S_TEXTMOVING (10)
|
|
|
|
#define S_TEXTRESIZING (11)
|
|
|
|
#define S_SAVING (12)
|
|
|
|
#define S_LOADING (13)
|
|
|
|
#define S_LINKPOINTMOVE (14)
|
|
|
|
#define S_FGCOL (15)
|
|
|
|
#define S_MAPNAMING (16)
|
|
|
|
#define S_MATCHSIZE (17)
|
|
|
|
#define S_MATCHX (18)
|
|
|
|
#define S_MATCHY (19)
|
|
|
|
#define S_CREATETELE (20)
|
|
|
|
#define S_REALLYQUIT (21)
|
2005-10-28 16:05:57 +10:00
|
|
|
#define S_FILLCOL (22)
|
2005-10-29 16:37:41 +10:00
|
|
|
#define S_EDITTEXT (23)
|
2005-11-11 23:42:29 +11:00
|
|
|
#define S_CHANGEOBJECT (24)
|
2005-11-15 14:45:04 +11:00
|
|
|
#define S_DRAWFLOW (25)
|
2006-01-17 14:27:15 +11:00
|
|
|
#define S_SEARCH (26)
|
2006-05-22 17:21:36 +10:00
|
|
|
#define S_XSCROLL (27)
|
|
|
|
#define S_YSCROLL (28)
|
2005-10-25 16:35:55 +10:00
|
|
|
|
2006-01-17 14:27:15 +11:00
|
|
|
/* toolbox buttons */
|
2005-10-25 16:35:55 +10:00
|
|
|
#define TB_POINTER (0)
|
|
|
|
#define TB_ADDOBJ (1)
|
|
|
|
#define TB_ADDTEXT (2)
|
2005-11-15 14:45:04 +11:00
|
|
|
#define TB_COPY (3)
|
|
|
|
#define TB_PASTE (4)
|
|
|
|
#define TB_GRID (5)
|
|
|
|
#define TB_FGCOL (6)
|
|
|
|
#define TB_FILLCOL (7)
|
|
|
|
#define TB_LINESTYLE (8)
|
|
|
|
#define TB_MATCHSIZE (9)
|
|
|
|
#define TB_MATCHPOS (10)
|
|
|
|
#define TB_FLOW (11)
|
|
|
|
#define TB_DRILLDOWN (12)
|
|
|
|
#define TB_CREATETELE (13)
|
|
|
|
#define TB_DELETEMAP (14)
|
|
|
|
#define TB_NEW (15)
|
|
|
|
#define TB_LOAD (16)
|
|
|
|
#define TB_SAVE (17)
|
2005-10-25 16:35:55 +10:00
|
|
|
|
|
|
|
|
2006-01-17 14:27:15 +11:00
|
|
|
/* selection screen values */
|
2005-10-25 16:35:55 +10:00
|
|
|
#define YES (1)
|
|
|
|
#define NO (0)
|
|
|
|
#define MAYBE (-1)
|
2005-10-30 19:45:37 +11:00
|
|
|
|
2006-01-17 14:27:15 +11:00
|
|
|
/* Line styles are a 32-bit int split up as follows: */
|
2005-10-30 19:45:37 +11:00
|
|
|
/*
|
|
|
|
* Unused Arrow Style Thickness (max 5?)
|
|
|
|
* 00000000 00000000 00000000 00000000
|
|
|
|
*/
|
|
|
|
#define LS_SOLID (0)
|
|
|
|
#define LS_DOTTED (1)
|
|
|
|
#define LS_BIGDASH (2)
|
|
|
|
#define LS_DASHDOT (3)
|
|
|
|
|
|
|
|
|
2005-11-05 14:22:50 +11:00
|
|
|
/* arrow positions */
|
|
|
|
#define AP_NONE (0)
|
|
|
|
#define AP_START (1)
|
|
|
|
#define AP_END (2)
|
|
|
|
#define AP_BOTH (3)
|
2005-10-30 19:45:37 +11:00
|
|
|
|
2006-01-17 14:27:15 +11:00
|
|
|
/* Special mapbox child values for scroll buttons */
|
2005-10-31 13:20:14 +11:00
|
|
|
#define C_NONE (-1)
|
|
|
|
#define C_SCROLLUP (-2)
|
|
|
|
#define C_SCROLLDOWN (-3)
|
|
|
|
|
2006-01-17 14:27:15 +11:00
|
|
|
/* Mouse positions */
|
2005-11-05 14:22:50 +11:00
|
|
|
#define MP_NONE (0)
|
|
|
|
#define MP_TOOLBOX (1)
|
|
|
|
#define MP_MAPBOXNAME (2)
|
|
|
|
#define MP_MAPBOXCHILDREN (3)
|
|
|
|
#define MP_OBJECTBOX (4)
|