/*
    ####             #    #     # #
    #   #            #    #       #          The FreeWare C library for 
    #   #  ##   ###  #  # #     # ###             RISC OS machines
    #   # #  # #     # #  #     # #  #   ___________________________________
    #   # ####  ###  ##   #     # #  #                                      
    #   # #        # # #  #     # #  #    Please refer to the accompanying
    ####   ### ####  #  # ##### # ###    documentation for conditions of use
    ________________________________________________________________________

    File:    Wimp.h
    Author:  Copyright  1992, 1993, 1994 John Winters and Jason Williams
    Version: 1.12 (26 Jun 1994)
    Purpose: Type/structure definitions for Wimp SWI interface
*/


#ifndef __dl_wimp_h
#define __dl_wimp_h

#ifdef __cplusplus
extern "C" {
#endif


#ifndef __dl_core_h
#include "Core.h"
#endif



#define wimp_MAXNAME 12
/* The size of wimp names (icon text fields, sprite names, etc) */


typedef struct
{
  int x, y;
} wimp_point;
/*
A C struct which corresponds with how the RISC OS Window Manager usually
represents (x,y) points.
*/

typedef wimp_point wimp_coord;


typedef struct
{
  wimp_point min;
  wimp_point max;
} wimp_rect;
/*
A C struct which corresponds with how the RISC OS Window Manager usually
represents rectangles.
*/


typedef wimp_rect wimp_box;

typedef int window_handle;
typedef int icon_handle;
typedef int task_handle;


/* -------------------------------------------------------------------------
   Wimp colours and palettes
   ------------------------------------------------------------------------- */

#define colour_WHITE        0
#define colour_GREY0        0
#define colour_GREY1        1
#define colour_GREY2        2
#define colour_GREY3        3
#define colour_GREY4        4
#define colour_GREY5        5
#define colour_GREY6        6
#define colour_GREY7        7
#define colour_BLACK        7
#define colour_DARK_BLUE    8
#define colour_YELLOW       9
#define colour_GREEN       10
#define colour_RED         11
#define colour_CREAM       12
#define colour_ARMY_GREEN  13
#define colour_ORANGE      14
#define colour_LIGHT_BLUE  15

#define colour_TRANSPARENT 255 

typedef union
{
  int value;
  struct
  {
    unsigned int wimpcolour : 4;
    unsigned int gcolaction : 3;
    unsigned int foreback   : 1;
    unsigned int padding    : 24;
  } data;
} wimp_colour;


typedef union
{
  int value;
  struct
  {
    char gcol;
    char red;
    char green;
    char blue;
  } data;
} palette_entry;
/*
This holds a RGB colour in the correct form for the ColourTrans SWIs
*/

typedef struct
{
  palette_entry colour[16];
  palette_entry border;
  palette_entry mouse1;
  palette_entry mouse2;
  palette_entry mouse3;
} palette_block;
                

/* -------------------------------------------------------------------------
   Wimp icon data:
   ------------------------------------------------------------------------- */

#define iconbtype_NEVER            0
#define iconbtype_ALWAYS           1
#define iconbtype_AUTOREPEAT       2
#define iconbtype_CLICK            3
#define iconbtype_RELEASE          4
#define iconbtype_DOUBLECLICK      5
#define iconbtype_CLICKDRAG        6
#define iconbtype_RELEASEDRAG      7
#define iconbtype_DOUBLEDRAG       8
#define iconbtype_MENU             9
#define iconbtype_DOUBLECLICKDRAG 10
#define iconbtype_RADIO           11
#define iconbtype_RESERVED1       12
#define iconbtype_RESERVED2       13
#define iconbtype_WRITECLICKDRAG  14
#define iconbtype_WRITABLE        15


/*  Icon bar icon positions, and
 *  the window handle of the iconbar when returned by the Wimp
 */
#define iconbar_RIGHT -1
#define iconbar_LEFT  -2
#define window_ICONBAR -2

/* Icon flag bits */
#define icon_TEXT        0x00000001      /* icon contains text               */
#define icon_SPRITE      0x00000002      /* icon is a sprite                 */
#define icon_BORDER      0x00000004      /* icon has a border                */
#define icon_HCENTRE     0x00000008      /* text is horizontally centred     */
#define icon_VCENTRE     0x00000010      /* text is vertically centred       */
#define icon_FILLED      0x00000020      /* icon has a filled background     */
#define icon_FONT        0x00000040      /* text is an anti-aliased font     */
#define icon_NEEDSHELP   0x00000080      /* redraw needs application's help  */
#define icon_INDIRECTED  0x00000100      /* icon data is 'indirected'        */
#define icon_RJUSTIFY    0x00000200      /* text right justified in box      */
#define icon_ALLOWADJUST 0x00000400      /* Allow multiple select with adjust*/
#define icon_HALVESPRITE 0x00000800      /* plot sprites half-size           */
#define icon_BUTTONTYPE  0x00001000      /* 4-bit field: button type         */
#define icon_SELECTED    0x00200000      /* icon selected by user (inverted) */
#define icon_SHADED      0x00400000      /* icon cannot be selected (shaded) */
#define icon_DELETED     0x00800000      /* icon has been deleted            */

#define icon_FORECOLOUR  0x01000000      /* 4-bit field: foreground colour   */
#define icon_BACKCOLOUR  0x10000000      /* 4-bit field: background colour   */

#define iconvalid_ALLOW           'A'
#define iconvalid_BORDERTYPE      'R'
#define iconvalid_DISPLAY         'D'
#define iconvalid_FONTCOLOURS     'F'
#define iconvalid_LINESPACE       'L'
#define iconvalid_SPRITENAME      'S'

#define iconborder_PLINTH          0
#define iconborder_SURROUND        1
#define iconborder_OKBUTTON        2
#define iconborder_INDENT          3

typedef union
{
  unsigned int value;

  struct
  {
    unsigned int garbage1      : 6;    /* New struct to allow easy access to */
    unsigned int font          : 1;    /* the font handle of an icon. NOTE   */
    unsigned int garbage2      : 17;   /* that handle is ONLY valid IF       */
    unsigned int handle        : 8;    /* 'font' is TRUE.                    */
  } font;

  struct
  {
    unsigned int text          : 1;
    unsigned int sprite        : 1;
    unsigned int border        : 1;
    unsigned int hcentre       : 1;
    unsigned int vcentre       : 1;
    unsigned int filled        : 1;
    unsigned int font          : 1;
    unsigned int needshelp     : 1;
    unsigned int indirected    : 1;
    unsigned int rightjustify  : 1;
    unsigned int allowadjust   : 1;
    unsigned int halfsize      : 1;
    unsigned int buttontype    : 4;
    unsigned int esg           : 5;
    unsigned int selected      : 1;
    unsigned int shaded        : 1;
    unsigned int deleted       : 1;
    unsigned int foreground    : 4;
    unsigned int background    : 4;
  } data;
} icon_flags;
/*
Used in icon_block
*/

typedef struct
{
  char         *buffer;
  char         *validstring;
  unsigned int bufflen;
} icon_indtext;
/*
Used in icon_data union
*/


typedef struct
{
  const char   *name;
  void         *spritearea;
  unsigned int nameisname;
} icon_indsprite;
/*
Used in icon_data union
*/

typedef union
{
  char           text[wimp_MAXNAME];
  icon_indtext   indirecttext;
  char           spritename[wimp_MAXNAME];
  icon_indsprite indirectsprite;
} icon_data;
/*
Used in icon_block
*/


typedef struct
{
  wimp_box   workarearect;
  icon_flags flags;
  icon_data  data;
} icon_block;
/*
See Wimp_GetIconState, Wimp_PlotIcon
*/

typedef struct
{
  window_handle window;
  icon_block    icondata;
} icon_createblock;
/*
Use with Wimp_CreateIcon
*/


/* -------------------------------------------------------------------------
   Window data:
   ------------------------------------------------------------------------- */

typedef union
{
  struct
  {
    unsigned int hastitle          : 1;  /* This is an "old-style" flag - don't use it */
    unsigned int moveable          : 1;
    unsigned int hasvscroll        : 1;  /* This is an "old-style" flag - don't use it */
    unsigned int hashscroll        : 1;  /* This is an "old-style" flag - don't use it */
    unsigned int autoredraw        : 1;
    unsigned int pane              : 1;
    unsigned int nobounds          : 1;
    unsigned int nobackclose       : 1;  /* This is an "old-style" flag - don't use it */
    unsigned int scrollrq          : 1;
    unsigned int scrollrqdebounced : 1;
    unsigned int realcolours       : 1;
    unsigned int backwindow        : 1;
    unsigned int hotkeys           : 1;
    unsigned int keeponscreen      : 1;
    unsigned int ignoreright       : 1;
    unsigned int ignorebottom      : 1;
    unsigned int open              : 1;
    unsigned int top               : 1;
    unsigned int fullsize          : 1;
    unsigned int istoggling        : 1;
    unsigned int focus             : 1;
    unsigned int forceonce         : 1;
    unsigned int dummy22           : 1;
    unsigned int dummy23           : 1;
    unsigned int backicon          : 1;
    unsigned int closeicon         : 1;
    unsigned int titlebar          : 1;
    unsigned int toggleicon        : 1;
    unsigned int vscroll           : 1;
    unsigned int adjusticon        : 1;
    unsigned int hscroll           : 1;
    unsigned int newflags          : 1;  /* This should always be TRUE */
  } data;
  int value;
} window_flags;
/*
Used in window_block
*/

typedef struct                /* Minimum width/height of window. Used to be: */
{                             /*   unsigned short minwidth, minheight;       */
  int x : 16;                 /* This has been changed for compatability     */
  int y : 16;                 /* with compilers other than Desktop C         */
} window_minsize;
/*
Used in window_block
*/

typedef enum
{
  windowcol_TITLEFORE = 0,
  windowcol_TITLEBACK,
  windowcol_WORKFORE,
  windowcol_WORKBACK,
  windowcol_SCROLLBACK,
  windowcol_SCROLLFORE,
  windowcol_TITLEHILITE
} window_colourindices;


typedef struct
{
  wimp_box       screenrect;
  wimp_point     scroll;
  window_handle  behind;
  window_flags   flags;
  char           colours[8];
  wimp_box       workarearect;
  icon_flags     titleflags;
  icon_flags     workflags;
  void           *spritearea;
  window_minsize minsize;
  icon_data      title;
  unsigned int   numicons;
  /*
   *  What we really want here is :
  icon_block        icons [0];
   *  but unfortunately 'C' (stupidly) doesn't allow it.  Just think it.
   */
} window_block;
/*
This is used by Wimp_CreateWindow
*/

typedef struct
{
  window_handle window;
  wimp_box      screenrect;
  wimp_point    scroll;
  window_handle behind;
} window_openblock;
/*
This is used with Wimp_OpenWindow
*/

typedef struct
{
  window_openblock openblock;
  window_flags     flags;
} window_state;
/*
Used with Wimp_GetWindowState
*/

typedef struct
{
  window_handle window;
  window_block  block;
} window_info;
/*
Used with Wimp_GetWindowInfo
*/

typedef struct
{
  window_handle window;
  wimp_box      rect;
  wimp_point    scroll;
  wimp_box      cliprect;
} window_redrawblock;
/*
Used with Wimp_ForceRedraw, Wimp_UpdateWindow
*/

typedef struct
{
  window_handle window;
  wimp_box      screenrect;
} window_outline;
/*
Used with Wimp_GetWindowOutline
*/


/* -------------------------------------------------------------------------
   Mouse/Pointer information:
   ------------------------------------------------------------------------- */

#define button_ADJUST      0x00000001
#define button_MENU        0x00000002
#define button_SELECT      0x00000004
#define button_DRAGADJUST  0x00000010
#define button_DRAGSELECT  0x00000040
#define button_CLICKADJUST 0x00000100
#define button_CLICKSELECT 0x00000400

typedef union
{
  unsigned int value;
  struct
  {
    unsigned int adjust       : 1;
    unsigned int menu         : 1;
    unsigned int select       : 1;
    unsigned int dummy3       : 1;
    unsigned int dragadjust   : 1;
    unsigned int dummy5       : 1;
    unsigned int dragselect   : 1;
    unsigned int dummy7       : 1;
    unsigned int clickadjust  : 1;
    unsigned int dummy9       : 1;
    unsigned int clickselect  : 1;
  } data;
} button_state;
/*
Used in mouse_block
*/

typedef struct
{
  wimp_point    pos;
  button_state  button;
  window_handle window;
  icon_handle   icon;
} mouse_block;
/* 
Used in Wimp_GetPointerInfo
Also a field in the event_data union.
*/

typedef struct
{
  int           shapenumber;
  char          *shapedata;
  unsigned int  width;
  unsigned int  height;
  wimp_point    active;
} pointer_shapeblock;


/* -------------------------------------------------------------------------
   Wimp drag data:
   ------------------------------------------------------------------------- */

typedef enum
{
  drag_MOVEWINDOW    = 1,
  drag_RESIZEWINDOW,
  drag_SCROLLX,
  drag_SCROLLY,
  drag_FIXEDBOX,
  drag_RUBBERBOX,
  drag_INVISIBLE,
  drag_USERFIXEDBBOX,
  drag_USERRUBBERBOX,
  drag_USERFIXEDNC,
  drag_USERRUBBERNC
} drag_type;
/*
This a field in drag_block
*/

typedef struct
{
  window_handle window;
  drag_type     type;
  wimp_box      screenrect;
  wimp_box      parent;
} drag_block;
/*
Used in Wimp_DragBox
*/

/* -------------------------------------------------------------------------
   Wimp errors:
   ------------------------------------------------------------------------- */

typedef union
{
  unsigned int value;
  struct
  {
    unsigned int ok               : 1;
    unsigned int cancel           : 1;
    unsigned int highlightcancel  : 1;
    unsigned int noprompt         : 1;
    unsigned int noprefix         : 1;
    unsigned int nowait           : 1;
    unsigned int closebox         : 1;
  } data;
} error_flags;
/*
See Wimp_ReportError
*/


/* -------------------------------------------------------------------------
   Menus
   ------------------------------------------------------------------------- */

typedef struct menu_block *menu_ptr;
/* See Wimp_CreateMenu, Wimp_CreateSubMenu	*/

typedef union
{
  unsigned int value;
  struct
  {
    unsigned int ticked     : 1;
    unsigned int dotted     : 1;
    unsigned int writable   : 1;
    unsigned int notifysub  : 1;
    unsigned int openshaded : 1;
    unsigned int dummy2     : 2;
    unsigned int last       : 1;
    unsigned int indtitle   : 1;
    unsigned int dummy13    : 13;
    unsigned int shaded     : 1;
    unsigned int dummy1     : 1;
    unsigned int foreground : 4;
    unsigned int background : 4;
  } data;
} menu_flags;
/*
Used in menu_item
*/

typedef union
{
  menu_ptr      menu;
  window_handle window;
  int           value;
} menu_submenu;


typedef struct
{
  menu_flags   menuflags;
  menu_submenu submenu;
  icon_flags   iconflags;
  icon_data    icondata;
} menu_item;
/*
These follow a menu_block in memory
*/

typedef struct menu_block
{
  char     title [wimp_MAXNAME];
  char     titlefore, titleback, workfore, workback;
  unsigned int width;
  unsigned int height;
  unsigned int gap;
  /*  Followed immediately by menu items */
} menu_block;
/*
See menu_ptr, Wimp_CreateMenu, Wimp_CreateSubMenu
*/



/* -------------------------------------------------------------------------
   Caret/Keypress data:
   ------------------------------------------------------------------------- */

typedef int key_press;

typedef struct
{
  window_handle window;
  icon_handle   icon;
  wimp_point    offset;
  int           height;
  int           index;
} caret_block;
/*
This is a field in the event_data union
*/


typedef struct
{
  caret_block caret;
  key_press   code;
} key_block;
/*
This is a field in the event_data union
*/

typedef struct
{
  int address;
  int contents;
} pollword_block;
/*
This is a field in the event_data union
*/


/* -------------------------------------------------------------------------
   Wimp message data:
   ------------------------------------------------------------------------- */

typedef enum
{
  message_QUIT           = 0,
  message_CLOSEDOWN      = 0,
  message_DATASAVE       = 1,
  message_DATASAVEACK    = 2,
  message_DATASAVEOK     = 2,
  message_DATALOAD       = 3,
  message_DATALOADACK    = 4,
  message_DATALOADOK     = 4,
  message_DATAOPEN,
  message_RAMFETCH,
  message_RAMTRANSMIT,
  message_PREQUIT,
  message_PALETTECHANGE,
  message_SAVEDESK,
  message_DEVICECLAIM,
  message_DEVICEINUSE,
  message_DATASAVED,

  message_FILEROPENDIR   = 0x400,
  message_FILERCLOSEDIR,
  message_FILEROPENDIRAT,
  message_FILERSELECTIONDIRECTORY,
  message_FILERADDSELECTION,
  message_FILERACTION,
  message_FILERCONTROLACTION,
  message_FILERSELECTION,
  
  message_HELPREQUEST    = 0x502,
  message_HELPREPLY,

  message_NOTIFY         = 0x40040,
  message_MENUWARNING    = 0x400C0,
  message_MENUWARN       = 0x400C0,
  message_MODECHANGE,
  message_TASKINITIALISE = 0x400C2,
  message_INITTASK       = 0x400C2,
  message_TASKCLOSEDOWN  = 0x400C3,
  message_CLOSETASK      = 0x400C3,
  message_SLOTSIZE       = 0x400C4,
  message_SLOTCHANGE     = 0x400C4,
  message_SETSLOT        = 0x400C5,
  message_TASKNAMERQ,
  message_TASKNAMEIS,
  message_TASKSTARTED,
  message_MENUSDELETED,              /* RO3 Menu closed warning    */
  message_WINDOWINFO     = 0x400CC,  /* RO3 For window iconisation */

  message_POPUPRQ        = 0x46D40,  /* PopUp messages - cf PopUp.h */
  message_POPUPREQUEST   = 0x46D40,
  message_POPUPSTATE,
  message_POPUPCLOSED,

  message_PRINTFILE      = 0x80140,
  message_WILLPRINT,
  message_PRINTSAVE,
  message_PRINTINIT,
  message_PRINTERROR,
  message_PRINTTYPEODD,
  message_PRINTTYPEKNOWN,
  message_SETPRINTER,
  
  message_PSPRINTERQUERY = 0x8014c,
  message_PSPRINTERACK,
  message_PSPRINTERMODIFIED,
  message_PSPRINTERDEFAULTS,
  message_PSPRINTERDEFAULTED,
  message_PSPRINTERNOTPS,
  message_RESETPRINTER,
  message_PSISFONTPRINTRUNNING,
  
  message_TASKWINDOW_INPUT = 0x808c0,
  message_TASKWINDOW_OUTPUT,
  message_TASKWINDOW_EGO,
  message_TASKWINDOW_MORIO,
  message_TASKWINDOW_MORITE,
  message_TASKWINDOW_NEWTASK,
  message_TASKWINDOW_SUSPEND,
  message_TASKWINDOW_RESUME
  
  
  
} message_action;
/*
Part of message_header
*/



typedef int message_destinee;  /* Window or Task handle */


typedef struct
{
  unsigned int   size;
  task_handle    sender;
  unsigned int   myref;
  unsigned int   yourref;
  message_action action;
} message_header;
/*
Used in message_block
*/

typedef struct
{
  window_handle window;
  icon_handle   icon;
  wimp_point    pos;
  int           estsize;
  int           filetype;
  char          leafname[12];
} message_datasave;
/*
Part of the message_block union
*/

typedef struct
{
  window_handle window;   /* window, icon, pos, estsize, filetype all copied */
  icon_handle   icon;     /* from the initiating datasave message            */
  wimp_point    pos;
  int           estsize;
  int           filetype;
  char          filename[212];
} message_datasaveack;
/*
Part of the message_block union
*/


typedef struct
{
  window_handle window;
  icon_handle   icon;
  wimp_point    pos;
  int           size;
  int           filetype;
  char          filename[212];
} message_dataload;
/*
Part of the message_block union
*/


typedef struct         /* DataLoadAck is identical to DataLoad */
{
  window_handle window;
  icon_handle   icon;
  wimp_point    pos;
  int           size;
  int           filetype;
  char          filename[212];
} message_dataloadack;
/*
Part of the message_block union
*/


typedef message_dataload message_dataopen;
/*
Part of the message_block union
*/


typedef struct
{
  char *buffer;
  int  buffsize;
} message_ramfetch;
/*
Part of the message_block union
*/


typedef struct
{
  char *buffer;   /* copied directly from initiating RamFetch */
  int  byteswritten;
} message_ramtransmit;
/*
Part of the message_block union
*/


typedef struct
{
  mouse_block where;  /* Where is help needed for? */
} message_helprequest;
/*
Part of the message_block union
*/


typedef struct
{
  char text[200];
} message_helpreply;
/*
Part of the message_block union
*/


typedef struct
{
  int filler[5];
  int filetype;
  char filename[212];
} message_print;
/*
Part of the message_block union
*/

typedef struct
{
  int        id;                      /* The number given to Wimp_CreateMenu */
  wimp_point openpos;                 /* Position to open window/menu at     */
  int        selection[10];           /* -1 terminated list of menu hits     */
} message_menuwarn;
/*
Part of the message_block union
*/

typedef struct
{
  window_handle window;
  task_handle   task;
  char          title[20];
} message_iconize;
/*
Part of the message_block union
*/


typedef struct
{
  window_handle window;
  int           dummy;
  char          spritename[8];
  char          title[20];
} message_windowinfo;
/*
Part of the message_block union
*/


typedef struct
{
  message_header  header;
  union
  {
    char                 bytes [236];
    int                  words [59];
    message_datasave     datasave;
    message_datasaveack  datasaveack;
    message_dataload     dataload;
    message_dataopen     dataopen;
    message_ramfetch     ramfetch;
    message_ramtransmit  ramtransmit;
    message_helprequest  helprequest;
    message_helpreply    helpreply;
    message_print        print;
    message_menuwarn     menuwarn;
    message_iconize      iconize;
    message_windowinfo   windowinfo;

#if FALSE
    message_popuprequest popuprequest;    /* If PopUps in use, also include */
    message_popupstate   popupstate;      /* the relevant PopUp messages    */
#endif

  } data;
} message_block;
/*
Part of the event_data union
*/

/* -------------------------------------------------------------------------
   Wimp events:
   ------------------------------------------------------------------------- */

#define wimp_NUMBEROFEVENTS 20
/*
 *  N.B.  There aren't 20, but you need an array this big to store them
 *  due to the way they are numbered.
 */


typedef enum
{
  event_ANY                 = -99,  /*  see event.c: this is used to denote
                                     *  any event type, any window handle,
                                     *  or any icon handle ... thus -99.
                                     */
  event_NULL                = 0,
  event_REDRAW,
  event_OPEN,
  event_CLOSE,
  event_PTRLEAVE,
  event_PTRENTER,
  event_CLICK = 6,
  event_BUTTON = 6,
  event_USERDRAG,
  event_KEY,
  event_MENU,
  event_SCROLL,
  event_LOSECARET,
  event_GAINCARET,
  event_NONZEROPOLLWORD,
  event_USERMESSAGE         = 17,
  event_SEND                = 17,
  event_USERMESSAGERECORDED = 18,
  event_SENDWANTACK         = 18,
  event_USERMESSAGEACK      = 19,
  event_ACK                 = 19
} event_type;
/*
Used in event_pollblock
*/

typedef union
{
  unsigned int value;
  struct
  {
    unsigned int null                : 1;
    unsigned int redraw              : 1;
    unsigned int open                : 1;
    unsigned int close               : 1;
    unsigned int ptrleave            : 1;
    unsigned int ptrenter            : 1;
    unsigned int click               : 1;
    unsigned int userdrag            : 1;
    unsigned int key                 : 1;
    unsigned int menu                : 1;
    unsigned int scroll              : 1;
    unsigned int losecaret           : 1;
    unsigned int gaincaret           : 1;
    unsigned int nonzeropollword     : 1;
    unsigned int dummy14             : 1;
    unsigned int dummy15             : 1;
    unsigned int dummy16             : 1;
    unsigned int usermessage         : 1;
    unsigned int usermessagerecorded : 1;
    unsigned int usermessageack      : 1;
    unsigned int dummy20             : 1;
    unsigned int dummy21             : 1;
    unsigned int r3ispollwordptr     : 1;
    unsigned int highprioritypoll    : 1;
    unsigned int keepfpregisters     : 1;
  } data;
} event_pollmask;
/*
Used by Wimp_Poll
*/

typedef struct
{
  window_openblock openblock;
  wimp_point       direction;
} scroll_rq;
/*
Part of the message_block union
*/


typedef union
{
  caret_block      caret;
  key_block        key;
  pollword_block   pollword;
  window_openblock openblock;
  message_block    message;
  mouse_block      mouse;
  wimp_box         screenrect;
  int              selection[10];
  scroll_rq        scroll;
  char             bytes [256];
  int              words [64];
} event_data;
/*
Part of event_pollblock
*/

typedef struct
{
  event_type type;
  event_data data;
} event_pollblock;
/*
Used by Wimp_Poll
*/

/* -------------------------------------------------------------------------
   Miscellanea
   ------------------------------------------------------------------------- */


/* See Font.h for a description of this */
typedef struct
{
  char fonts[256];
} font_array;


typedef struct
{
  window_block   *buffer;
  char           *workfree;
  char           *workend;
  font_array     *font;
  char           *name;
  unsigned int   index;
} template_block;


typedef struct
{
  wimp_point mul;
  wimp_point div;
} scale_block;

#ifdef __cplusplus
}
#endif


#endif
