home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / gcc / !GCC / patches / DeskLib / h / Wimp < prev    next >
Encoding:
Text File  |  1994-10-03  |  20.9 KB  |  889 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Wimp.h
  12.     Author:  Copyright © 1992 John Winters and Jason Williams
  13.     Version: 1.11 (14 Jul 1993)
  14.     Purpose: Type/structure definitions for Wimp SWI interface
  15. */
  16.  
  17.  
  18. #ifndef __dl_wimp_h
  19. #define __dl_wimp_h
  20.  
  21. #ifndef __dl_core_h
  22. #include "Core.h"
  23. #endif
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29.  
  30. /* The size of wimp names (icon text fields, sprite names, etc) */
  31. #define wimp_MAXNAME 12
  32.  
  33.  
  34. typedef struct
  35. {
  36.   int x, y;
  37. } wimp_point;
  38.  
  39. typedef wimp_point wimp_coord;
  40.  
  41.  
  42. typedef struct
  43. {
  44.   wimp_point min;
  45.   wimp_point max;
  46. } wimp_rect;
  47.  
  48. typedef wimp_rect wimp_box;
  49.  
  50. typedef int window_handle;
  51. typedef int icon_handle;
  52. typedef int task_handle;
  53.  
  54.  
  55. /* -------------------------------------------------------------------------
  56.    Wimp colours and palettes
  57.    ------------------------------------------------------------------------- */
  58.  
  59. #define colour_WHITE        0
  60. #define colour_GREY0        0
  61. #define colour_GREY1        1
  62. #define colour_GREY2        2
  63. #define colour_GREY3        3
  64. #define colour_GREY4        4
  65. #define colour_GREY5        5
  66. #define colour_GREY6        6
  67. #define colour_GREY7        7
  68. #define colour_BLACK        7
  69. #define colour_DARK_BLUE    8
  70. #define colour_YELLOW       9
  71. #define colour_GREEN       10
  72. #define colour_RED         11
  73. #define colour_CREAM       12
  74. #define colour_ARMY_GREEN  13
  75. #define colour_ORANGE      14
  76. #define colour_LIGHT_BLUE  15
  77.  
  78. #define colour_TRANSPARENT 255
  79.  
  80. typedef union
  81. {
  82.   int value;
  83.   struct
  84.   {
  85.     unsigned int wimpcolour : 4;
  86.     unsigned int gcolaction : 3;
  87.     unsigned int foreback   : 1;
  88.     unsigned int padding    : 24;
  89.   } data;
  90. } wimp_colour;
  91.  
  92.  
  93. typedef union
  94. {
  95.   int value;
  96.   struct
  97.   {
  98.     char gcol;
  99.     char red;
  100.     char green;
  101.     char blue;
  102.   } data;
  103. } palette_entry;
  104.  
  105.  
  106. typedef struct
  107. {
  108.   palette_entry colour[16];
  109.   palette_entry border;
  110.   palette_entry mouse1;
  111.   palette_entry mouse2;
  112.   palette_entry mouse3;
  113. } palette_block;
  114.  
  115.  
  116. /* -------------------------------------------------------------------------
  117.    Wimp icon data:
  118.    ------------------------------------------------------------------------- */
  119.  
  120. #define iconbtype_NEVER            0
  121. #define iconbtype_ALWAYS           1
  122. #define iconbtype_AUTOREPEAT       2
  123. #define iconbtype_CLICK            3
  124. #define iconbtype_RELEASE          4
  125. #define iconbtype_DOUBLECLICK      5
  126. #define iconbtype_CLICKDRAG        6
  127. #define iconbtype_RELEASEDRAG      7
  128. #define iconbtype_DOUBLEDRAG       8
  129. #define iconbtype_MENU             9
  130. #define iconbtype_DOUBLECLICKDRAG 10
  131. #define iconbtype_RADIO           11
  132. #define iconbtype_RESERVED1       12
  133. #define iconbtype_RESERVED2       13
  134. #define iconbtype_WRITECLICKDRAG  14
  135. #define iconbtype_WRITABLE        15
  136.  
  137.  
  138. /*  Icon bar icon positions, and
  139.  *  the window handle of the iconbar when returned by the Wimp
  140.  */
  141. #define iconbar_RIGHT -1
  142. #define iconbar_LEFT  -2
  143. #define window_ICONBAR -2
  144.  
  145. /* Icon flag bits */
  146. #define icon_TEXT        0x00000001      /* icon contains text               */
  147. #define icon_SPRITE      0x00000002      /* icon is a sprite                 */
  148. #define icon_BORDER      0x00000004      /* icon has a border                */
  149. #define icon_HCENTRE     0x00000008      /* text is horizontally centred     */
  150. #define icon_VCENTRE     0x00000010      /* text is vertically centred       */
  151. #define icon_FILLED      0x00000020      /* icon has a filled background     */
  152. #define icon_FONT        0x00000040      /* text is an anti-aliased font     */
  153. #define icon_NEEDSHELP   0x00000080      /* redraw needs application's help  */
  154. #define icon_INDIRECTED  0x00000100      /* icon data is 'indirected'        */
  155. #define icon_RJUSTIFY    0x00000200      /* text right justified in box      */
  156. #define icon_ALLOWADJUST 0x00000400      /* Allow multiple select with adjust*/
  157. #define icon_HALVESPRITE 0x00000800      /* plot sprites half-size           */
  158. #define icon_BUTTONTYPE  0x00001000      /* 4-bit field: button type         */
  159. #define icon_SELECTED    0x00200000      /* icon selected by user (inverted) */
  160. #define icon_SHADED      0x00400000      /* icon cannot be selected (shaded) */
  161. #define icon_DELETED     0x00800000      /* icon has been deleted            */
  162.  
  163. #define icon_FORECOLOUR  0x01000000      /* 4-bit field: foreground colour   */
  164. #define icon_BACKCOLOUR  0x10000000      /* 4-bit field: background colour   */
  165.  
  166. #define iconvalid_ALLOW           'A'
  167. #define iconvalid_BORDERTYPE      'R'
  168. #define iconvalid_DISPLAY         'D'
  169. #define iconvalid_FONTCOLOURS     'F'
  170. #define iconvalid_LINESPACE       'L'
  171. #define iconvalid_SPRITENAME      'S'
  172.  
  173. #define iconborder_PLINTH          0
  174. #define iconborder_SURROUND        1
  175. #define iconborder_OKBUTTON        2
  176. #define iconborder_INDENT          3
  177.  
  178. typedef union
  179. {
  180.   unsigned int value;
  181.  
  182.   struct
  183.   {
  184.     unsigned int garbage1      : 6;    /* New struct to allow easy access to */
  185.     unsigned int font          : 1;    /* the font handle of an icon. NOTE   */
  186.     unsigned int garbage2      : 17;   /* that handle is ONLY valid IF       */
  187.     unsigned int handle        : 8;    /* 'font' is TRUE.                    */
  188.   } font;
  189.  
  190.   struct
  191.   {
  192.     unsigned int text          : 1;
  193.     unsigned int sprite        : 1;
  194.     unsigned int border        : 1;
  195.     unsigned int hcentre       : 1;
  196.     unsigned int vcentre       : 1;
  197.     unsigned int filled        : 1;
  198.     unsigned int font          : 1;
  199.     unsigned int needshelp     : 1;
  200.     unsigned int indirected    : 1;
  201.     unsigned int rightjustify  : 1;
  202.     unsigned int allowadjust   : 1;
  203.     unsigned int halfsize      : 1;
  204.     unsigned int buttontype    : 4;
  205.     unsigned int esg           : 5;
  206.     unsigned int selected      : 1;
  207.     unsigned int shaded        : 1;
  208.     unsigned int deleted       : 1;
  209.     unsigned int foreground    : 4;
  210.     unsigned int background    : 4;
  211.   } data;
  212. } icon_flags;
  213.  
  214.  
  215. typedef struct
  216. {
  217.   char         *buffer;
  218.   char         *validstring;
  219.   unsigned int bufflen;
  220. } icon_indtext;
  221.  
  222.  
  223. typedef struct
  224. {
  225.   const char   *name;
  226.   unsigned int *spritearea;
  227.   unsigned int nameisname;
  228. } icon_indsprite;
  229.  
  230.  
  231. typedef union
  232. {
  233.   char           text[wimp_MAXNAME];
  234.   icon_indtext   indirecttext;
  235.   char           spritename[wimp_MAXNAME];
  236.   icon_indsprite indirectsprite;
  237. } icon_data;
  238.  
  239.  
  240. typedef struct
  241. {
  242.   wimp_box   workarearect;
  243.   icon_flags flags;
  244.   icon_data  data;
  245. } icon_block;
  246.  
  247.  
  248. typedef struct
  249. {
  250.   window_handle window;
  251.   icon_block    icondata;
  252. } icon_createblock;
  253.  
  254.  
  255. /* -------------------------------------------------------------------------
  256.    Window data:
  257.    ------------------------------------------------------------------------- */
  258.  
  259. typedef union
  260. {
  261.   struct
  262.   {
  263.     unsigned int hastitle      : 1;  /* these are "old-style" flags  */
  264.     unsigned int moveable      : 1;  /* You should not be using them */
  265.     unsigned int hasvscroll    : 1;  /* " */
  266.     unsigned int hashscroll    : 1;  /* " */
  267.     unsigned int autoredraw    : 1;  /* " */
  268.     unsigned int pane          : 1;  /* " */
  269.     unsigned int nobounds      : 1;  /* " */
  270.     unsigned int nobackclose   : 1;  /* " */
  271.  
  272.     unsigned int scrollrq      : 1;
  273.     unsigned int scrollrqdebounced : 1;
  274.     unsigned int realcolours   : 1;
  275.     unsigned int backwindow    : 1;
  276.     unsigned int hotkeys       : 1;
  277.     unsigned int dummy13       : 1;
  278.     unsigned int dummy14       : 1;
  279.     unsigned int dummy15       : 1;
  280.     unsigned int open          : 1;
  281.     unsigned int top           : 1;
  282.     unsigned int fullsize      : 1;
  283.     unsigned int istoggling    : 1;
  284.     unsigned int focus         : 1;
  285.     unsigned int dummy21       : 1;
  286.     unsigned int dummy22       : 1;
  287.     unsigned int dummy23       : 1;
  288.     unsigned int backicon      : 1;
  289.     unsigned int closeicon     : 1;
  290.     unsigned int titlebar      : 1;
  291.     unsigned int toggleicon    : 1;
  292.     unsigned int vscroll       : 1;
  293.     unsigned int adjusticon    : 1;
  294.     unsigned int hscroll       : 1;
  295.     unsigned int newflags      : 1;  /* This should always be TRUE */
  296.   } data;
  297.   int value;
  298. } window_flags;
  299.  
  300.  
  301. typedef struct                /* Minimum width/height of window. Used to be: */
  302. {                             /*   unsigned short minwidth, minheight;       */
  303.   int x : 16;                 /* This has been changed for compatability     */
  304.   int y : 16;                 /* with compilers other than Desktop C         */
  305. } window_minsize;
  306.  
  307.  
  308. typedef enum
  309. {
  310.   windowcol_TITLEFORE = 0,
  311.   windowcol_TITLEBACK,
  312.   windowcol_WORKFORE,
  313.   windowcol_WORKBACK,
  314.   windowcol_SCROLLBACK,
  315.   windowcol_SCROLLFORE,
  316.   windowcol_TITLEHILITE
  317. } window_colourindices;
  318.  
  319.  
  320. typedef struct
  321. {
  322.   wimp_box       screenrect;
  323.   wimp_point     scroll;
  324.   window_handle  behind;
  325.   window_flags   flags;
  326.   char           colours[8];
  327.   wimp_box       workarearect;
  328.   icon_flags     titleflags;
  329.   icon_flags     workflags;
  330.   void           *spritearea;
  331.   window_minsize minsize;
  332.   icon_data      title;
  333.   unsigned int   numicons;
  334.   /*
  335.    *  What we really want here is :
  336.   icon_block        icons [0];
  337.    *  but unfortunately 'C' (stupidly) doesn't allow it.  Just think it.
  338.    */
  339. } window_block;
  340.  
  341.  
  342. typedef struct
  343. {
  344.   window_handle window;
  345.   wimp_box      screenrect;
  346.   wimp_point    scroll;
  347.   window_handle behind;
  348. } window_openblock;
  349.  
  350.  
  351. typedef struct
  352. {
  353.   window_openblock openblock;
  354.   window_flags     flags;
  355. } window_state;
  356.  
  357.  
  358. typedef struct
  359. {
  360.   window_handle window;
  361.   window_block  block;
  362. } window_info;
  363.  
  364.  
  365. typedef struct
  366. {
  367.   window_handle window;
  368.   wimp_box      rect;
  369.   wimp_point    scroll;
  370.   wimp_box      cliprect;
  371. } window_redrawblock;
  372.  
  373.  
  374. typedef struct
  375. {
  376.   window_handle window;
  377.   wimp_box      screenrect;
  378. } window_outline;
  379.  
  380.  
  381. /* -------------------------------------------------------------------------
  382.    Mouse/Pointer information:
  383.    ------------------------------------------------------------------------- */
  384.  
  385. #define button_ADJUST      0x00000001
  386. #define button_MENU        0x00000002
  387. #define button_SELECT      0x00000004
  388. #define button_DRAGADJUST  0x00000010
  389. #define button_DRAGSELECT  0x00000040
  390. #define button_CLICKADJUST 0x00000100
  391. #define button_CLICKSELECT 0x00000400
  392.  
  393. typedef union
  394. {
  395.   unsigned int value;
  396.   struct
  397.   {
  398.     unsigned int adjust       : 1;
  399.     unsigned int menu         : 1;
  400.     unsigned int select       : 1;
  401.     unsigned int dummy3       : 1;
  402.     unsigned int dragadjust   : 1;
  403.     unsigned int dummy5       : 1;
  404.     unsigned int dragselect   : 1;
  405.     unsigned int dummy7       : 1;
  406.     unsigned int clickadjust  : 1;
  407.     unsigned int dummy9       : 1;
  408.     unsigned int clickselect  : 1;
  409.   } data;
  410. } button_state;
  411.  
  412.  
  413. typedef struct
  414. {
  415.   wimp_point    pos;
  416.   button_state  button;
  417.   window_handle window;
  418.   icon_handle   icon;
  419. } mouse_block;
  420.  
  421.  
  422. typedef struct
  423. {
  424.   int           shapenumber;
  425.   char          *shapedata;
  426.   unsigned int  width;
  427.   unsigned int  height;
  428.   wimp_point    active;
  429. } pointer_shapeblock;
  430.  
  431.  
  432. /* -------------------------------------------------------------------------
  433.    Wimp drag data:
  434.    ------------------------------------------------------------------------- */
  435.  
  436. typedef enum
  437. {
  438.   drag_MOVEWINDOW    = 1,
  439.   drag_RESIZEWINDOW,
  440.   drag_SCROLLX,
  441.   drag_SCROLLY,
  442.   drag_FIXEDBOX,
  443.   drag_RUBBERBOX,
  444.   drag_INVISIBLE,
  445.   drag_USERFIXEDBBOX,
  446.   drag_USERRUBBERBOX,
  447.   drag_USERFIXEDNC,
  448.   drag_USERRUBBERNC
  449. } drag_type;
  450.  
  451.  
  452. typedef struct
  453. {
  454.   window_handle window;
  455.   drag_type     type;
  456.   wimp_box      screenrect;
  457.   wimp_box      parent;
  458. } drag_block;
  459.  
  460.  
  461. /* -------------------------------------------------------------------------
  462.    Wimp errors:
  463.    ------------------------------------------------------------------------- */
  464.  
  465. typedef union
  466. {
  467.   unsigned int value;
  468.   struct
  469.   {
  470.     unsigned int ok               : 1;
  471.     unsigned int cancel           : 1;
  472.     unsigned int highlightcancel  : 1;
  473.     unsigned int noprompt         : 1;
  474.     unsigned int noprefix         : 1;
  475.     unsigned int nowait           : 1;
  476.     unsigned int closebox         : 1;
  477.   } data;
  478. } error_flags;
  479.  
  480.  
  481. /* -------------------------------------------------------------------------
  482.    Menus
  483.    ------------------------------------------------------------------------- */
  484.  
  485. typedef struct menu_block *menu_ptr;
  486.  
  487.  
  488. typedef union
  489. {
  490.   unsigned int value;
  491.   struct
  492.   {
  493.     unsigned int ticked     : 1;
  494.     unsigned int dotted     : 1;
  495.     unsigned int writable   : 1;
  496.     unsigned int notifysub  : 1;
  497.     unsigned int dummy3     : 3;
  498.     unsigned int last       : 1;
  499.     unsigned int dummy14    : 14;
  500.     unsigned int shaded     : 1;
  501.     unsigned int dummy1     : 1;
  502.     unsigned int foreground : 4;
  503.     unsigned int background : 4;
  504.   } data;
  505. } menu_flags;
  506.  
  507.  
  508. typedef union
  509. {
  510.   menu_ptr      menu;
  511.   window_handle window;
  512.   int           value;
  513. } menu_submenu;
  514.  
  515.  
  516. typedef struct
  517. {
  518.   menu_flags   menuflags;
  519.   menu_submenu submenu;
  520.   icon_flags   iconflags;
  521.   icon_data    icondata;
  522. } menu_item;
  523.  
  524.  
  525. typedef struct menu_block
  526. {
  527.   char     title [wimp_MAXNAME];
  528.   char     titlefore, titleback, workfore, workback;
  529.   unsigned int width;
  530.   unsigned int height;
  531.   unsigned int gap;
  532.   /*  Followed immediately by menu items */
  533. } menu_block;
  534.  
  535.  
  536. /* -------------------------------------------------------------------------
  537.    Caret/Keypress data:
  538.    ------------------------------------------------------------------------- */
  539.  
  540. typedef int key_press;
  541.  
  542. typedef struct
  543. {
  544.   window_handle window;
  545.   icon_handle   icon;
  546.   wimp_point    offset;
  547.   int           height;
  548.   int           index;
  549. } caret_block;
  550.  
  551.  
  552. typedef struct
  553. {
  554.   caret_block caret;
  555.   key_press   code;
  556. } key_block;
  557.  
  558.  
  559. typedef struct
  560. {
  561.   int address;
  562.   int contents;
  563. } pollword_block;
  564.  
  565.  
  566. /* -------------------------------------------------------------------------
  567.    Wimp message data:
  568.    ------------------------------------------------------------------------- */
  569.  
  570. typedef enum
  571. {
  572.   message_QUIT           = 0,
  573.   message_CLOSEDOWN      = 0,
  574.   message_DATASAVE       = 1,
  575.   message_DATASAVEACK    = 2,
  576.   message_DATASAVEOK     = 2,
  577.   message_DATALOAD       = 3,
  578.   message_DATALOADACK    = 4,
  579.   message_DATALOADOK     = 4,
  580.   message_DATAOPEN,
  581.   message_RAMFETCH,
  582.   message_RAMTRANSMIT,
  583.   message_PREQUIT,
  584.   message_PALETTECHANGE,
  585.   message_SAVEDESK,
  586.   message_DEVICECLAIM,
  587.   message_DEVICEINUSE,
  588.   message_DATASAVED,
  589.  
  590.   message_FILEROPENDIR   = 0x400,
  591.   message_FILERCLOSEDIR,
  592.  
  593.   message_HELPREQUEST    = 0x502,
  594.   message_HELPREPLY,
  595.  
  596.   message_NOTIFY         = 0x40040,
  597.   message_MENUWARNING    = 0x400C0,
  598.   message_MENUWARN       = 0x400C0,
  599.   message_MODECHANGE,
  600.   message_TASKINITIALISE = 0x400C2,
  601.   message_INITTASK       = 0x400C2,
  602.   message_TASKCLOSEDOWN  = 0x400C3,
  603.   message_CLOSETASK      = 0x400C3,
  604.   message_SLOTSIZE       = 0x400C4,
  605.   message_SLOTCHANGE     = 0x400C4,
  606.   message_SETSLOT        = 0x400C5,
  607.   message_TASKNAMERQ,
  608.   message_TASKNAMEIS,
  609.   message_TASKSTARTED,
  610.   message_MENUSDELETED,              /* RO3 Menu closed warning    */
  611.   message_WINDOWINFO     = 0x400CC,  /* RO3 For window iconisation */
  612.  
  613.   message_POPUPRQ        = 0x46D40,  /* PopUp messages - cf PopUp.h */
  614.   message_POPUPREQUEST   = 0x46D40,
  615.   message_POPUPSTATE,
  616.   message_POPUPCLOSED,
  617.  
  618.   message_PRINTFILE      = 0x80140,
  619.   message_WILLPRINT,
  620.   message_PRINTTYPEODD   = 0x80145,
  621.   message_PRINTTYPEKNOWN,
  622.   message_PRINTERCHANGE
  623. } message_action;
  624.  
  625.  
  626. typedef int message_destinee;  /* Window or Task handle */
  627.  
  628.  
  629. typedef struct
  630. {
  631.   unsigned int   size;
  632.   task_handle    sender;
  633.   unsigned int   myref;
  634.   unsigned int   yourref;
  635.   message_action action;
  636. } message_header;
  637.  
  638.  
  639. typedef struct
  640. {
  641.   window_handle window;
  642.   icon_handle   icon;
  643.   wimp_point    pos;
  644.   int           estsize;
  645.   int           filetype;
  646.   char          leafname[12];
  647. } message_datasave;
  648.  
  649.  
  650. typedef struct
  651. {
  652.   window_handle window;   /* window, icon, pos, estsize, filetype all copied */
  653.   icon_handle   icon;     /* from the initiating datasave message            */
  654.   wimp_point    pos;
  655.   int           estsize;
  656.   int           filetype;
  657.   char          filename[212];
  658. } message_datasaveack;
  659.  
  660.  
  661. typedef struct
  662. {
  663.   window_handle window;
  664.   icon_handle   icon;
  665.   wimp_point    pos;
  666.   int           size;
  667.   int           filetype;
  668.   char          filename[212];
  669. } message_dataload;
  670.  
  671. /*
  672.  * typedef struct
  673.  * {
  674.  *   -- Nothing in here - no data needed in DataLoadAck --
  675.  * } message_dataloadack;
  676.  */
  677.  
  678.  
  679. typedef message_dataload message_dataopen;
  680.  
  681.  
  682. typedef struct
  683. {
  684.   char *buffer;
  685.   int  buffsize;
  686. } message_ramfetch;
  687.  
  688.  
  689. typedef struct
  690. {
  691.   char *buffer;   /* copied directly from initiating RamFetch */
  692.   int  byteswritten;
  693. } message_ramtransmit;
  694.  
  695.  
  696. typedef struct
  697. {
  698.   mouse_block where;  /* Where is help needed for? */
  699. } message_helprequest;
  700.  
  701.  
  702. typedef struct
  703. {
  704.   char text[200];
  705. } message_helpreply;
  706.  
  707.  
  708. typedef struct
  709. {
  710.   int filler[5];
  711.   int filetype;
  712.   char filename[212];
  713. } message_print;
  714.  
  715. typedef struct
  716. {
  717.   int        id;                      /* The number given to Wimp_CreateMenu */
  718.   wimp_point openpos;                 /* Position to open window/menu at     */
  719.   int        selection[10];           /* -1 terminated list of menu hits     */
  720. } message_menuwarn;
  721.  
  722.  
  723. typedef struct
  724. {
  725.   message_header  header;
  726.   union
  727.   {
  728.     char                 bytes [236];
  729.     int                  words [59];
  730.     message_datasave     datasave;
  731.     message_datasaveack  datasaveack;
  732.     message_dataload     dataload;
  733.     message_dataopen     dataopen;
  734.     message_ramfetch     ramfetch;
  735.     message_ramtransmit  ramtransmit;
  736.     message_helprequest  helprequest;
  737.     message_helpreply    helpreply;
  738.     message_print        print;
  739.     message_menuwarn     menuwarn;
  740.  
  741. #if FALSE
  742.     message_popuprequest popuprequest;    /* If PopUps in use, also include */
  743.     message_popupstate   popupstate;      /* the relevant PopUp messages    */
  744. #endif
  745.  
  746.   } data;
  747. } message_block;
  748.  
  749.  
  750. /* -------------------------------------------------------------------------
  751.    Wimp events:
  752.    ------------------------------------------------------------------------- */
  753.  
  754. #define wimp_NUMBEROFEVENTS 20
  755. /*
  756.  *  N.B.  There aren't 20, but you need an array this big to store them
  757.  *  due to the way they are numbered.
  758.  */
  759.  
  760.  
  761. typedef enum
  762. {
  763.   event_ANY                 = -99,  /*  see event.c: this is used to denote
  764.                                      *  any event type, any window handle,
  765.                                      *  or any icon handle ... thus -99.
  766.                                      */
  767.   event_NULL                = 0,
  768.   event_REDRAW,
  769.   event_OPEN,
  770.   event_CLOSE,
  771.   event_PTRLEAVE,
  772.   event_PTRENTER,
  773.   event_CLICK = 6,
  774.   event_BUTTON = 6,
  775.   event_USERDRAG,
  776.   event_KEY,
  777.   event_MENU,
  778.   event_SCROLL,
  779.   event_LOSECARET,
  780.   event_GAINCARET,
  781.   event_NONZEROPOLLWORD,
  782.   event_USERMESSAGE         = 17,
  783.   event_SEND                = 17,
  784.   event_USERMESSAGERECORDED = 18,
  785.   event_SENDWANTACK         = 18,
  786.   event_USERMESSAGEACK      = 19,
  787.   event_ACK                 = 19
  788. } event_type;
  789.  
  790.  
  791. typedef union
  792. {
  793.   unsigned int value;
  794.   struct
  795.   {
  796.     unsigned int null                : 1;
  797.     unsigned int redraw              : 1;
  798.     unsigned int open                : 1;
  799.     unsigned int close               : 1;
  800.     unsigned int ptrleave            : 1;
  801.     unsigned int ptrenter            : 1;
  802.     unsigned int click               : 1;
  803.     unsigned int userdrag            : 1;
  804.     unsigned int key                 : 1;
  805.     unsigned int menu                : 1;
  806.     unsigned int scroll              : 1;
  807.     unsigned int losecaret           : 1;
  808.     unsigned int gaincaret           : 1;
  809.     unsigned int nonzeropollword     : 1;
  810.     unsigned int dummy14             : 1;
  811.     unsigned int dummy15             : 1;
  812.     unsigned int dummy16             : 1;
  813.     unsigned int usermessage         : 1;
  814.     unsigned int usermessagerecorded : 1;
  815.     unsigned int usermessageack      : 1;
  816.     unsigned int dummy20             : 1;
  817.     unsigned int dummy21             : 1;
  818.     unsigned int r3ispollwordptr     : 1;
  819.     unsigned int highprioritypoll    : 1;
  820.     unsigned int keepfpregisters     : 1;
  821.   } data;
  822. } event_pollmask;
  823.  
  824.  
  825. typedef struct
  826. {
  827.   window_openblock openblock;
  828.   wimp_point       direction;
  829. } scroll_rq;
  830.  
  831.  
  832. typedef union
  833. {
  834.   caret_block      caret;
  835.   key_block        key;
  836.   pollword_block   pollword;
  837.   window_openblock openblock;
  838.   message_block    message;
  839.   mouse_block      mouse;
  840.   wimp_box         screenrect;
  841.   int              selection[10];
  842.   scroll_rq        scroll;
  843.   char             bytes [256];
  844.   int              words [64];
  845. } event_data;
  846.  
  847.  
  848. typedef struct
  849. {
  850.   event_type type;
  851.   event_data data;
  852. } event_pollblock;
  853.  
  854.  
  855. /* -------------------------------------------------------------------------
  856.    Miscellanea
  857.    ------------------------------------------------------------------------- */
  858.  
  859.  
  860. /* See Font.h for a description of this */
  861. typedef struct
  862. {
  863.   char fonts[256];
  864. } font_array;
  865.  
  866.  
  867. typedef struct
  868. {
  869.   window_block   *buffer;
  870.   char           *workfree;
  871.   char           *workend;
  872.   font_array     *font;
  873.   char           *name;
  874.   unsigned int   index;
  875. } template_block;
  876.  
  877.  
  878. typedef struct
  879. {
  880.   wimp_point mul;
  881.   wimp_point div;
  882. } scale_block;
  883.  
  884. #ifdef __cplusplus
  885.            }
  886. #endif
  887.  
  888. #endif
  889.