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