home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / c / xaes_new / xaes.h < prev    next >
C/C++ Source or Header  |  1994-12-25  |  24KB  |  604 lines

  1. /********************************************************************
  2.  *                                                                1.10*
  3.  *    XAES: The Extended Application Environment Systems                *
  4.  *    Code by Ken Hollis, GNU C Extensions by Sascha Blank            *
  5.  *                                                                    *
  6.  *    Copyright (c) 1994, Bitgate Software.  All Rights Reserved.        *
  7.  *                                                                    *
  8.  ********************************************************************/
  9.  
  10. #include <aes.h>
  11. #include <vdi.h>
  12. #include <stdio.h>
  13.  
  14. /*    Hmmm...  XAES really isn't that compatible is it? */
  15. #ifdef    __GNUC__
  16. #error    "XAES is not compatible with Gnu C or Gnu C++"
  17. #elif    __ALCYON__
  18. #error    "XAES is not compatible with Alcyon C"
  19. #elif    __PROSPERO__
  20. #error    "XAES is not compatible with Prospero C"
  21. #elif    __SOZOBON__
  22. #error    "XAES is not compatible with Sozobon C"
  23. #elif    __LASER_C__
  24. #error    "XAES is not compatible with Laser C"
  25. #endif
  26.  
  27. #ifdef __AES__
  28. #ifndef DEBUG
  29. #error    "PLEASE ENABLE DEBUGGING!"
  30. #endif
  31.  
  32. #define    GLOBAL            /* A globally useful routine            */
  33. #define    LOCAL    static    /* A module-only routine                */
  34.  
  35. #ifdef __TURBOC__
  36. #pragma warn -pia        /* Possibly Incorrect Assignment is off    */
  37. #pragma warn -sus        /* Sustain strange warnings                */
  38. #endif
  39.  
  40. #ifndef min
  41. #define min(a,b)    ((a) < (b) ? (a) : (b))    /* Minimum value    */
  42. #define max(a,b)    ((a) > (b) ? (a) : (b))    /* Maximum value    */
  43. #endif
  44.  
  45. #define    BOOL    int        /* Extended boolean values                */
  46. #define    TRUE    1        /* True boolean value                    */
  47. #define    FALSE    0        /* False boolean value                    */
  48. #define    FAIL    -1        /* Fail boolean value (supported too!)    */
  49. #define    NOMORE    FAIL    /* No more windows available            */
  50.  
  51. #define    MAX_WINDOWS        100        /* Maximum number of windows    */
  52. #define AES_VERSION        _GemParBlk.global[0]    /* Version of AES */
  53.  
  54. #define    UNUSED(x)        ((void)(x))        /* Any unused variables */
  55.  
  56. #define WC_NOTOBJECTABLE    0    /* Window can be closed w/o asking */
  57. #define WC_OBJECTABLE        1    /* Pause before closing window    */
  58. #define    WC_FORCED            2    /* Force window to be closed    */
  59. #define    WC_NOTCLOSABLE        3    /* Window cannot be closed        */
  60.  
  61. /* Extended window KIND creation flags */
  62. #ifndef SMALLER
  63. #define    SMALLER        0x2000        /* Window smaller gadget        */
  64. #endif
  65. #define    CASCADE        0x1000        /* Cascade window gadget        */
  66. #define    MENUWORK    0x4000        /* Menu workspace                */
  67. #define    OPTIONS        0x8000        /* Options (not yet used)        */
  68.  
  69. /* These signify the starting point of user defined messages */
  70. #define    WM_USER        0x0500        /* User defined window messages */
  71. #define    WF_USER        0x1000        /* User defined window fixes    */
  72. #define    WM_MAGIC    0x0500        /* Additive for our messages    */
  73. #define    WF_MAGIC    0x3E20        /* Additive for our window fixes */
  74.  
  75. #define    WM_XAES        (WM_USER + WM_MAGIC)    /* Remind you of    */
  76. #define    WF_XAES        (WF_USER + WF_MAGIC)    /* Windows??? :)    */
  77. #define    WM_XAESKEY    (WM_XAES + 0x0100)        /* Keyer events        */
  78. #define    WM_XAESPS    (WM_XAESKEY + 0x0400)    /* Program events    */
  79.  
  80. /* Activation events */
  81. #define    WM_DIALOG    (WM_XAES + 0)    /* Dialog                    */
  82. #define    WM_KEYBD    (WM_XAES + 1)    /* Keyboard                    */
  83. #define    WM_BUTTON    (WM_XAES + 2)    /* General button            */
  84. #define    WM_TEXT        (WM_XAES + 3)    /* Text                        */
  85. #define    WM_HOTKEY    (WM_XAES + 4)    /* Hotkey (object activation by ALT) */
  86. #define    WM_FKEY        (WM_XAES + 5)    /* Function key                */
  87. #define    WM_HELP        (WM_XAES + 6)    /* Help key                    */
  88. #define    WM_UNDO        (WM_XAES + 7)    /* Undo key                    */
  89. #define    WM_MENU        (WM_XAES + 8)    /* Menu                        */
  90. #define    WM_CLIP        (WM_XAES + 9)    /* Clipboard usage            */
  91. #define    WM_TIMECHG    (WM_XAES + 10)    /* Change timer information */
  92. #define    WM_GETHELP    (WM_XAES + 11)    /* Help about info            */
  93. #define    WM_SLIDER    (WM_XAES + 12)    /* Slider message            */
  94. #define    WM_ICONIFY    (WM_XAES + 13)    /* Iconified message        */
  95. #define    WM_UNICONIFY    (WM_XAES + 14)    /* Uniconified message    */
  96.  
  97. /* Keyer events */
  98. #define    WM_CREATED    (WM_XAESKEY + 0)    /* Window created        */
  99. #define    WM_KILL        (WM_XAESKEY + 1)    /* Window killed        */
  100. #define    WM_TIMER    (WM_XAESKEY + 2)    /* Timer event has elapsed */
  101. #define    WM_PAINT    (WM_XAESKEY + 3)    /* Dispatch "redraw"    */
  102. #define    WM_COPIED    (WM_XAESKEY + 4)    /* Window just copied    */
  103.  
  104. /* Program status events */
  105. #define    WM_CLOSEALL    (WM_XAESPS + 0)    /* All windows closed message */
  106. #define    WM_PROGEND    (WM_XAESPS + 1)    /* Program termination message */
  107.  
  108. /* Window states */
  109. #define    W_NULLIFIED            0x0000    /* Window has no state        */
  110. #define W_OPEN                0x0001    /* Window is currently opened */
  111. #define W_MINIMIZED         0x0002    /* Window is minimized        */
  112. #define W_UNUNTOPPABLE        0x0004    /* Window cannot be un-untopped */
  113. #define W_BEVENT            0x0008    /* Window accepts bkgnd clicks */
  114. #define    W_FLYING            0x0010    /* Window is a flying dialog */
  115. #define    W_TEXT                0x0020    /* Window is a text window    */
  116. #define    W_TIMER                0x0040    /* Window is a timer        */
  117. #define    W_DIALOG            0x0080    /* Window is a dialog        */
  118. #define    W_DESKTOP            0x0100    /* Window is the desktop    */
  119. #define    W_UNSIZABLE            0x0200    /* Window cannot be sized    */
  120. #define    W_ICONIFIED            0x0400    /* Window is iconified        */
  121.  
  122. /* Window styles */
  123. #define    W_CUSTOMWINDOW        0x0001    /* Window has custom elements */
  124.  
  125. /* Window get and set messages */
  126. #define WF_MINIMIZE     (WF_XAES + 0)    /* Minimizable window    */
  127. #define WF_UNUNTOPPABLE    (WF_XAES + 1)    /* Cannot untop window    */
  128. #define    WF_FLYING        (WF_XAES + 2)    /* Flying Dialog window */
  129. #define    WF_TEXT            (WF_XAES + 3)    /* Text window            */
  130. #define    WF_TIMER        (WF_XAES + 4)    /* Timer window            */
  131. #define    WF_DIALOG        (WF_XAES + 5)    /* Dialog window        */
  132. #define    WF_UNSIZABLE    (WF_XAES + 6)    /* Cannot size window    */
  133. #define    WF_CUSTOMWIN    (WF_XAES + 7)    /* Customized window    */
  134. #define    WF_SLIDEPOS        (WF_XAES + 8)    /* Slider position        */
  135. #define    WF_ICONIFIED    (WF_XAES + 9)    /* Iconified window        */
  136. #define    WF_UNICONIFIED    (WF_XAES + 10)    /* Uniconified window    */
  137.  
  138. /* Window callback methods */
  139. #define    CBK_NONE        0x0000    /* No callbacks are provided */
  140. #define    CBK_OBJECTS        0x0001    /* Callbacks only on object selection */
  141. #define    CBK_WINDOW        0x0002    /* Callbacks on any window actions */
  142. #define    CBK_ACTION        0x0004    /* Callbacks on an action-by-action basis */
  143. #define    CBK_CREATION    0x0008    /* Callbacks only on window creation */
  144. #define    CBK_DELETION    0x0010    /* Callbacks only on window deletion */
  145.  
  146. /* Size-box mode indices; these are self-explanatory. */
  147. #define    S_UPPERLEFT        1
  148. #define    S_TOP            2
  149. #define    S_UPPERRIGHT    3
  150. #define    S_RIGHT            4
  151. #define    S_LOWERRIGHT    5
  152. #define    S_BOTTOM        6
  153. #define    S_LOWERLEFT        7
  154. #define    S_LEFT            8
  155.  
  156. /* Object Creation types */
  157. #define    WC_WINDOW        1        /* Create a window                */
  158. #define WC_SWINDOW        2        /* Create a small window        */
  159. #define    WC_FLYING        3        /* Create a flying dialog        */
  160. #define    WC_SLIDER        4        /* Create an object slider        */
  161. #define    WC_POPUP        5        /* Create an object popup        */
  162. #define    WC_TEXTGADGET    6        /* Create an object text gadget */
  163. #define    WC_GRAPHGADGET    7        /* Create an object graphic gadget */
  164. #define    WC_LISTBOX        8        /* Create a popup list box        */
  165. #define    WC_TOOLBAR        9        /* Create a toolbar                */
  166. #define    WC_ICONIFIED    10        /* Create an iconified window    */
  167.  
  168. /* Editing modes */
  169. #define    EDIT_INSERT        1        /* Edit insert mode                */
  170. #define    EDIT_REPLACE    2        /* Edit replace mode            */
  171.  
  172. /* Mouse forms.  These are the custom mouse forms that are called with
  173.    WGrafMouse.  These are currently used for the custom windows (will
  174.    be used) and for loading and initializing stuff.. */
  175. #define    INIT_MOUSE        50        /* Computer-type mouse            */
  176. #define    LOAD_MOUSE        51        /* Resource mouse                */
  177. #define    LRSLIDE_MOUSE    52        /* Left/right slider            */
  178. #define    UDSLIDE_MOUSE    53        /* Up/down slider                */
  179. #define    URMOVE_MOUSE    54        /* Upper-right sizer            */
  180. #define    ULMOVE_MOUSE    55        /* Upper-left sizer                */
  181. #define    LLMOVE_MOUSE    56        /* Lower-left sizer                */
  182. #define    LRMOVE_MOUSE    57        /* Lower-right sizer            */
  183. #define    CLIP_MOUSE        58        /* Clipboard mouse                */
  184. #define    DIALOG_MOUSE    59        /* Dialog box mouse                */
  185. #define    HELP_MOUSE        60        /* Help mouse                    */
  186. #define    IBARHELP_MOUSE    61        /* I-BAR Help mouse                */
  187. #define    TSIZER_MOUSE    62        /* Top sizer mouse                */
  188. #define    LSIZER_MOUSE    63        /* Left sizer mouse                */
  189. #define    RSIZER_MOUSE    64        /* Right sizer mouse            */
  190. #define    BSIZER_MOUSE    65        /* Bottom sizer mouse            */
  191. #define    MOVER_MOUSE        66        /* Mover mouse                    */
  192. #define    NOMODAL_MOUSE    67        /* Outside of modal mouse        */
  193. #define    NOWINDOW_MOUSE    68        /* Outside of window mouse        */
  194. #define    ANIMATED_MOUSE    300        /* Animated mouse                */
  195. #define    COLOR_MOUSE        301        /* Colour mouse (if ever)        */
  196.  
  197. /* Mouse form tools.  This is for mouse animation, and for other
  198.    tools if the programmer wants to store mouse shapes from loading
  199.    in from memory, or if they create a mouse tool.  Very handy. */
  200. #define    GET_MOUSE        400        /* Get current mouse form index */
  201. #define    SAVE_MOUSE        401        /* Save current mouse form index */
  202. #define    PREV_MOUSE        402        /* Get previous mouse form index */
  203. #define    NEXT_MOUSE        403        /* Get next mouse form index    */
  204. #define    FIRST_MOUSE        404     /* Get first mouse form index    */
  205. #define    LAST_MOUSE        405        /* Get last mouse form index    */
  206. #define    CLEAR_MOUSE        406        /* Clear all mice indices        */
  207. #define    FIND_MOUSE        407        /* Find mouse form index        */
  208. #define    NEWPOS_MOUSE    408        /* Reposition counter            */
  209.  
  210. /* Timer status modes.  The PAUSED and RESUMED modes are not yet
  211.    functioning, because we don't have multiple timer access yet.
  212.    These are passed in msg_buf[4]. */
  213. #define    T_NOTEXIST    -1            /* Timer is non-existent        */
  214. #define T_STOPPED    0            /* Timer stopped                */
  215. #define T_RUNNING    1            /* Timer running                */
  216. #define    T_PAUSED    T_STOPPED    /* Timer "paused"                */
  217. #define    T_RESUMED    T_RUNNING    /* Timer resumed (running)        */
  218. #define    T_ALLSTOP    2            /* All timers stopped            */
  219. #define    T_ALLRUN    3            /* All timers running            */
  220. #define    T_ALLPAUSE    T_ALLSTOP    /* All timers "paused"            */
  221. #define    T_ALLRESUME    T_ALLRUN    /* All timers resumed (running) */
  222.  
  223. /* Checks for the all window kill */
  224. #define    K_NO_STOP    0            /* Kill all windows, no stopping */
  225. #define    K_ASK        1            /* Ask before killing windows    */
  226. #define    K_ACC        2            /* Close windows in an accessory */
  227.  
  228. /* Extended Object Types */
  229. #define SCALE            16        /* Automatic scaling of image    */
  230. #define    FLYING            17        /* Flying dialog mover            */
  231. #define CUSTOM            18        /* Custom arrow buttons            */
  232. #define UNDERLINE        19        /* Underlined text                */
  233. #define    BOXFRAME        20        /* Box frame for selections        */
  234. #define    HELPBTN            21        /* Activation button under [HELP] */
  235. #define    CYCLEBTN        22        /* Cycle button for popup menus */
  236. #define    TEXTEFFECTS        23        /* Object text effects            */
  237. #define    CUSTBTN            24        /* Custom Selection and Radio boxes */
  238. #define    DROPDOWN        25        /* Dropdown button for dropdown selections */
  239. #define    MENUTEAR        30        /* Detatchable menu bar            */
  240. #define    UNDOBTN            31        /* Activation button under [UNDO] */
  241. #define    MENULINE        40        /* Thick line for separator        */
  242. #define    SLIDERLEFT        100        /* Move slider left                */
  243. #define    SLIDERRIGHT        101        /* Move slider right            */
  244. #define    SLIDERUP        102        /* Move slider up                */
  245. #define    SLIDERDOWN        103        /* Move slider down                */
  246. #define    SLIDERTRACK        104        /* Slider track                    */
  247. #define    SLIDERSLIDE        105        /* Slider mover                    */
  248.  
  249. /* Standard Extended Object Flags */
  250. #ifdef OBFLAGS11                    /* (New AES bindings available?) */
  251. #define HANDSLIDE        OBFLAGS12    /* Hand shown for slider    */
  252. #define MENUSIDE        OBFLAGS13    /* Menu with side items        */
  253. #define    BOXFRAMETITLE    OBFLAGS15    /* Box frame title with box around it */
  254. #else
  255. #define    HANDSLIDE        0x0800    /* See above */
  256. #define    MENUSIDE        0x2000
  257. #define    BOXFRAMETITLE    0x8000
  258. #endif
  259.  
  260. /* Extended Object States */
  261. #ifdef OBSTATE15                /* New AES bindings available?    */
  262. #define    MENUTYPE    OBSTATE13    /* Object is a menu title        */
  263. #define    ALREADYMOD    OBSTATE14    /* Already modified for sizing (temporary state) */
  264. #define    FAKED3D        OBSTATE15    /* Faked 3D setting for Falcon    */
  265. #else
  266. #define    MENUTYPE    0x2000        /* See above */
  267. #define    ALREADYMOD    0x4000
  268. #define    FAKED3D        0x8000
  269. #endif
  270.  
  271. /* WDie types */
  272. #define    FORCE_EXIT        -1        /* Force exit with query        */
  273. #define    FORCE_EXIT_ABS    -2        /* Absolute force exit (no query) */
  274.  
  275. /* WFindOwner returns */
  276. #define    W_NOTOWNER        -1        /* Not owner of this window        */
  277.  
  278. /* Scaling settings */
  279. #define NO_SCALING        0x0000    /* No scaling is done            */
  280. #define SCALING            0x0001    /* All/complete scaling is performed */
  281. #define TEST_SCALING    0x0002    /* Icon mask scaling is done    */
  282. #define DARK_SCALING    0x0004    /* Icon data scaling is done    */
  283.  
  284. /* XAES STANDARD Configuration bits */
  285. #define    X_LEFTBORDER    0x0001    /* Allow left border moving        */
  286. #define    X_WINXCOMPAT    0x0002    /* Allow WinX compatibility        */
  287. #define    X_MOUSEGADGETS    0x0004    /* Change mouse under element    */
  288. #define    X_MOUSESLIDERS    0x0008    /* Change mouse to slider shape */
  289. #define    X_ROUNDOBJECTS    0x0010    /* Rounded objects allowed        */
  290. #define    X_ROUNDSHADOW    0x0020    /* Rounded shadowing allowed    */
  291. #define    X_NICELINE        0x0040    /* Niceline dashing allowed        */
  292. #define    X_GENEVACOMPAT    0x0080    /* Geneva compatibility            */
  293. #define    X_DRAW3DCOMPAT    0x0100    /* Draw-3D two-color compatibility */
  294. #define    X_AUTOCHANGE    0x0200    /* Auto change mouse allowed    */
  295. #define    X_ELEMENTSEL    0x0400    /* Select elements on click        */
  296. #define    X_MEDEMUL        0x0800    /* Medium resolution 3D Colors    */
  297.  
  298. /* XAES EXTENDED Configuration bits */
  299. #define    X_INTERFACE        0x0001    /* InterFace-like object drawing */
  300. #define    X_ACTIVEDRAG    0x0002    /* Active redrawing windows        */
  301. #define    X_BACKGROUND    0x0004    /* Background clickable windows */
  302.  
  303. /* XAES Window centering flags */
  304. #define    XW_MOUSECENTER    1        /* Center window to mouse        */
  305. #define    XW_SCREENCENTER    2        /* Center window to screen        */
  306. #define    XW_PHYSICCENTER    3        /* Center window to logical screen */
  307.  
  308. /* XAES 3D drawing styles */
  309. #define    DRAW_STANDARD    1        /* Standard (and crappy) TOS look */
  310. #define    DRAW_MULTITOS    2        /* Standard MultiTOS look        */
  311. #define    DRAW_GENEVA        3        /* Geneva look                    */
  312. #define    DRAW_ZOOM        4        /* Zoom look (offset of MOTIF)    */
  313. #define    DRAW_MOTIF        5        /* Motif look (X11R6 type)        */
  314. #define    DRAW_LTMF        6        /* Let 'em Fly 1.30 look        */
  315. #define    DRAW_XAES        7        /* Our own drawing style        */
  316.  
  317. /* Slider types */
  318. #define    SLIDER_HOR        1        /* Horizontal slider type        */
  319. #define    SLIDER_VER        2        /* Vertical slider type            */
  320. #define    SLIDER_2D        3        /* Free-moving slider type        */
  321.  
  322. /* Object routine creation types */
  323. #define    MOUSE_DOWN        1        /* Mouse press event            */
  324. #define    MOUSE_UP        2        /* Mouse release event            */
  325. #define    MOUSE_MOVE        3        /* Mouse slider move event        */
  326. #define    MOUSE_CLICK        4        /* Mouse click event            */
  327.  
  328. /* Attribute flags for WChangeAttribute */
  329. #define    TEXT_ATTRIB        1        /* Change text string            */
  330. #define    TEMPLATE_ATTRIB    2        /* Change template string        */
  331. #define    VALID_ATTRIB    3        /* Change validation string        */
  332. #define    FONT_ATTRIB        4        /* Change font size                */
  333. #define    JUSTIFY_ATTRIB    5        /* Change justification of text */
  334. #define    BORDCOL_ATTRIB    6        /* Change border color            */
  335. #define    TEXTCOL_ATTRIB    7        /* Change text color            */
  336. #define    TRANS_ATTRIB    8        /* Change transparency mode        */
  337. #define    FILLPTN_ATTRIB    9        /* Change fill pattern            */
  338. #define    INCOL_ATTRIB    10        /* Change fill (interior) color */
  339. #define    THICK_ATTRIB    11        /* Change thickness of object    */
  340.  
  341. #define    XC_INITIALIZE    1        /* Initialization callback def    */
  342. #define    XC_DEINITIALIZE    2        /* Deinitialization callback def */
  343. #define    XC_STARTUP        3        /* Startup callback def            */
  344. #define    XC_EXIT            4        /* Exit callback def            */
  345.  
  346. #define    OUTSIDE_DIALOG    -1        /* Outside of any dialog area    */
  347.  
  348. #define    XCallInitializeCallback        DoCallback(XC_INITIALIZE)
  349. #define    XCallDeinitializeCallback    DoCallback(XC_DEINITIALIZE)
  350. #define    XCallStartupCallback        DoCallback(XC_STARTUP)
  351. #define    XCallExitCallback            DoCallback(XC_EXIT)
  352.  
  353. typedef struct timer
  354. {
  355.     long    clock;                /* Clock ticks to wait for        */
  356.     long    ev_mtcount;            /* Timer counter                */
  357.     void    *user;                /* User parameters to give Dispatcher routine */
  358.     int        status;                /* Status of timer                */
  359.     int        tick_count;            /* Number of clock ticks past    */
  360. } TIMER;
  361.  
  362. /* Window routine callbacks...  Quite a workout if you ask me! */
  363. typedef struct callbacks {
  364.     BOOL    (*MN_SELECTED_callback)(int, int, int, int);
  365.     BOOL    (*WM_REDRAW_callback)(int, int, int, int, int);
  366.     BOOL    (*WM_TOPPED_callback)(int);
  367.     BOOL    (*WM_CLOSED_callback)(int);
  368.     BOOL    (*WM_FULLED_callback)(int);
  369.     BOOL    (*WM_ARROWED_callback)(int, int);
  370.     BOOL    (*WM_HSLID_callback)(int, int);
  371.     BOOL    (*WM_VSLID_callback)(int, int);
  372.     BOOL    (*WM_SIZED_callback)(int, int, int, int, int);
  373.     BOOL    (*WM_MOVED_callback)(int, int, int, int, int);
  374.     BOOL    (*WM_NEWTOP_callback)(int);
  375.     BOOL    (*WM_UNTOPPED_callback)(int);
  376.     BOOL    (*WM_ONTOP_callback)(int);
  377.     BOOL    (*AC_OPEN_callback)(int);
  378.     BOOL    (*AC_CLOSE_callback)(int);
  379.     BOOL    (*CT_UPDATE_callback)();    /* Undocumented, not used */
  380.     BOOL    (*CT_MOVE_callback)();        /* Undocumented, not used */
  381.     BOOL    (*CT_NEWTOP_callback)();    /* Undocumented, not used */
  382.     BOOL    (*AP_TERM_callback)(void);
  383.     BOOL    (*AP_TFAIL_callback)(int);
  384.     BOOL    (*AP_RESCHG_callback)(int);
  385.     BOOL    (*SHUT_COMPLETED_callback)(int);
  386.     BOOL    (*RESCHG_COMPLETED_callback)(int);
  387.     BOOL    (*AP_DRAGDROP_callback)(int, int, int, int, int, long);
  388.     BOOL    (*CH_EXIT_callback)(int, int);
  389. } CALLS;
  390.  
  391. typedef struct window {
  392.     struct window *prev, *next;    /* Linked-list for windows        */
  393.     int        handle;                /* Window AES handle            */
  394.     int        state, oldstate;    /* Window state settings        */
  395.     int        style, oldstyle;    /* Window style settings        */
  396.     int        kind, oldkind;        /* Window display settings        */
  397.     int        editmode;            /* Editing mode                    */
  398.     int        edobject, edpos;    /* Editing object and position    */
  399.     int        wind_type;            /* Large or small window        */
  400.     int        icon_num;            /* Object number of the actual icon */
  401.     int        infpos, infend;        /* Info display and end display indices */
  402.     char    title[128], info[128];    /* Window name information    */
  403.     char    *icon_text;            /* Text to replace in icon field */
  404.     BOOL    has_edit;            /* Window has an editable object */
  405.     BOOL    edit_disp;            /* Window's cursor is displayed */
  406.     GRECT    size, minimum, maximum;    /* Current size, min & max size */
  407.     GRECT    oldsize;            /* Size saved at iconify time    */
  408.     OBJECT    *tree, *wind, *iconify;    /* Tree, window, and iconified trees */
  409.     CALLS    *callbacks;            /* Window callback routines        */
  410.     TIMER    timer;                /* Timer window information        */
  411.     void    *WndDispatcher;        /* Dispatcher linked to window    */
  412.     void    *user;                /* User information                */
  413. } WINDOW;
  414.  
  415. typedef struct {
  416.     void    (*Initialize)(void);        /* Initialization routine */
  417.     void    (*Deinitialize)(void);        /* Deinitialize routine */
  418.     void    (*Startup)(void);            /* Startup routine        */
  419.     void    (*Exit)(void);                /* Exit routine            */
  420. } INITS;
  421.  
  422. typedef struct {
  423.     OBJECT    *tree;                /* Flying dialog tree            */
  424.     void    *flybuffer;            /* Flying dialog saved screen buffer */
  425. } FLYDIAL;
  426.  
  427. typedef struct
  428. {
  429.     long cookie_id;                /* Cookie ID number                */
  430.     long cookie_value;            /* Points to your cookie data    */
  431. } COOKIE;
  432.  
  433. typedef struct {
  434.     int        textattributes[10];    /* Text saved attributes        */
  435.     int        fillattributes[5];    /* Fill saved attributes        */
  436.     int        lineattributes[6];    /* Line saved attributes        */
  437. } XVDIVARS;
  438. typedef struct {    long    magic;                /* Magic number to check if buffer installed */    int        vdihandle;            /* VDI Handle of buffer (= VDIhandle) */    int        pxy[8];                /* Point XY array for memory buffer */    MFDB    mfdb,scr;            /* Memory Form Definition Blocks of graphics */    char    data[];                /* Any extra data                */} Buffer;
  439.  
  440. typedef struct slider
  441. {
  442.     int        slide_pos;            /* Slider position                */
  443.     int        slide_max;            /* Slider maximum position        */
  444.     long    slide_acc;            /* Slider accumulator            */
  445.     long    slide_step;            /* Slider step setting for accumulator */
  446.     int        slide_tstep;        /* Slider step rate for positioning */
  447.     int        slide_type;            /* Slider type (Horizontal or Vertical) */
  448.     int        slide_increase;        /* Slider increase object        */
  449.     int        slide_decrease;        /* Slider decrease object        */
  450.     int        slide_slider;        /* Slider slide object            */
  451.     int        slide_track;        /* Slider track object            */
  452. } SLIDER;
  453.  
  454. typedef struct
  455. {
  456.     int        curr_sel;            /* Currently selected object    */
  457.     char    *sel_text;            /* Selection text                */
  458. } POPUP;
  459.  
  460. typedef struct
  461. {
  462.     void    (*mouse_down)(int, int, int, int, int);
  463.     void    (*mouse_up)(int, int, int, int, int);
  464.     void    (*mouse_move)(int, int, int, int, int);
  465.     void    (*mouse_click)(int, int, int, int);
  466. } ROUTS;
  467.  
  468. typedef struct extinfo
  469. {
  470.     char    *te_ptext;         /* Pointer to text string           */
  471.     char    *te_ptmplt;        /* Pointer to text template         */
  472.     char    *te_pvalid;        /* Pointer to validation string     */
  473.     int     te_font;           /* Font size                        */
  474.     int     te_junk1;          /* Unused                           */
  475.     int     te_just;           /* Text justification               */
  476.     struct {
  477.         unsigned int bord_color        : 4;    /* Border color           */
  478.         unsigned int text_color        : 4;    /* Text display color  */
  479.         unsigned int transparency    : 1;    /* vswr_mode to use    */
  480.         unsigned int fill_ptn        : 3;    /* Fill pattern        */
  481.         unsigned int in_color        : 4;    /* Fill pattern color  */
  482.     }        te_color;          /* Color                            */
  483.     int     te_junk2;           /* Unused                           */
  484.     int     te_thickness;      /* Border thickness                 */
  485.     char    te_character, nullterm;    /* Character/nullterm string   */
  486.     int     te_txtlen;         /* Text length                      */
  487.     int     te_tmplen;         /* Length of template               */
  488.     int        te_hotkey;           /* Hotkey storage                   */
  489.     SLIDER    te_slider;         /* Slider information               */
  490.     POPUP    te_popup;          /* Popup information                */
  491.     POPUP    te_listbox;        /* Listbox information              */
  492.     ROUTS    te_routines;       /* Button-routine callbacks           */
  493.     void    *oldparm;           /* Old ub_parms                     */
  494.     int        oldtype;           /* Old object type                  */
  495. } EXTINFO;
  496.  
  497. typedef struct mouseforms
  498. {
  499.     int    forms[16];
  500. } MICE;
  501.  
  502. typedef struct window_owner_info
  503. {
  504.     int    handle;
  505.     int    owner;
  506. } WOWNERS;
  507.  
  508. typedef struct
  509. {
  510.     char *wind_title;
  511.     char *hline1, *hline2, *hline3, *hline4, *hline5, *hline6,
  512.          *hline7, *hline8;
  513. } WHELP;
  514.  
  515. typedef struct image
  516. {
  517.     int        *hi_on, *hi_off, *lo_on, *lo_off;
  518. } IMAGE;
  519.  
  520. typedef struct images
  521. {
  522.     int        count;
  523.     IMAGE    *image;
  524. } IMAGES;
  525.  
  526. typedef struct
  527. {
  528.     int        sizer_ul[2];
  529.     int        sizer_top[2];
  530.     int        sizer_ur[2];
  531.     int        sizer_right[2];
  532.     int        sizer_lr[2];
  533.     int        sizer_bot[2];
  534.     int        sizer_ll[2];
  535.     int        sizer_left[2];
  536.     int        mover[2];
  537.     int        hor_slide_hatch[2];
  538.     int        hor_track_hatch[2];
  539.     int        ver_slide_hatch[2];
  540.     int        ver_track_hatch[2];
  541. } ELEMENT;
  542.  
  543. /*     1 = MultiTOS
  544.  *    2 = Geneva
  545.  *    3 = Zoom
  546.  *    4 = Motif
  547.  *    5 = XAES
  548.  */
  549. typedef struct
  550. {
  551.     int        shade_lower_part[5];
  552.     int        shade_upper_part[5];
  553.     int        shade_fill[5];
  554. } SHADES;
  555.  
  556. typedef struct
  557. {
  558.     int        topped_focus;
  559.     int        untopped_focus;
  560. } FCOL;
  561.  
  562. typedef struct
  563. {
  564.     int        config1;
  565.     int        config2;
  566.     int        wind_center;
  567.     int        draw_3d;
  568.     int        hotkey_color;
  569.     int        active_text_color;
  570.     int        inactive_text_color;
  571.     ELEMENT    window_elements;
  572.     SHADES    button_shades;
  573.     FCOL    focus_colors;
  574. } CONFIG;
  575.  
  576. extern    int        VDIhandle;
  577. extern    int        Life, Return, Ap_ID;
  578. extern    int        gr_cw, gr_ch, gr_bw, gr_bh, small_font, large_font;
  579. extern    int        color_font, image_w, image_h, big_img, num_colors;
  580. extern    int        num_planes, config1, config2, cur_mouse, cur_mouse_form;
  581. extern    int        edit_old_x, edit_old_y, num_configs, GenevaInstalled;
  582. extern     int        colorsave1, colorsave2, colorsave3;
  583. extern    char    *prgnameheader;
  584. extern    void    *_MainDispatcher, *_MainKeyDispatcher, *dpbuffer;
  585. extern    void    *bgbuffer;
  586. extern    BOOL    helpmode;
  587. extern    MFDB    screen;
  588. extern    MICE    mouseform;
  589. extern    GRECT    desk;
  590. extern    INITS    GlobInits;
  591. extern    CONFIG    xaes;
  592. extern    OBJECT    *wl_menubar, *WINDTREE, *WINPOPUP, *CASCPOPUP;
  593. extern    OBJECT    *FULLPOPUP, *WINPOPUP, *CASCPOPUP, *FULLPOPUP;
  594. extern    OBJECT    *RTPOPUP, *HELPWINDOW, *LBOX, *P_UP, *ALERTWIN;
  595. extern    OBJECT    *ERRORWIN;
  596. extern    WINDOW    *WindowChain;
  597. extern    WOWNERS    owned_winds[MAX_WINDOWS];
  598. extern    XVDIVARS SaveHandles;
  599.  
  600. #include "xproto.h"
  601.  
  602. #else
  603. #error    "Compilation stopped.  Where is AES.H's __AES__ define?"
  604. #endif