Home » Archimedes archive » Archimedes World » AW-1992-09.adf » AWSept92 » !AWSept92/Goodies/Work/h/wimpstr

!AWSept92/Goodies/Work/h/wimpstr

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » AW-1992-09.adf » AWSept92
Filename: !AWSept92/Goodies/Work/h/wimpstr
Read OK:
File size: 0AF1 bytes
Load address: 0000
Exec address: 0000
File contents
/********************************************************/
/*                                                      */
/*  Wimp data structures header file.                   */
/*                                                      */
/*  (c) John Skingley 1992                              */
/*                                                      */
/*  Archimedes World, 'All at C series'.                */
/*                                                      */
/********************************************************/


#ifndef _wimpstr
#define _wimpstr


/*************** Structure definitions. *****************/


typedef struct boxstr
{
    int x0, y0, x1, y1;
} boxstr;


typedef union icondata      /* Data field in an icon              */
{
    char text[12];          /* Text string.                       */
    char sprite[12];        /* Sprite name                        */

    struct                  /* Indirect text icon.                */
    {
        char *buffer;       /* Pointer to text buffer             */
        char *valid;        /* Pointer to validation string       */
        int  length;        /* Length of text buffer              */

    } indirect;

    struct
    {
        char *name;         /* Sprite name.                       */
        void *area;         /* Sprite area pointer.               */
        int   isname;       /* Flag, 'name' is sprite name.       */
    } indsprite;

} icondata;



typedef struct iconstr      /* Icon description structure         */
{                    
    boxstr   box;           /* Bounding box - relative to work area origin  */
    int      flags;         /* Flag bits.                         */
    icondata data;          /* Union of data types above          */

} iconstr;


typedef struct windstr      /* Wimp window definition structure.  */
{
    boxstr box;             /* Screen coords of work area */
    int    scx, scy;        /* Scroll bar positions       */
    int    behind;          /* Handle to open window behind, or -1 if top */
    int    flags;           /* Word of flag bits defined above */
    char   colours[8];      /* Colours: index using wimp_wcolours. */
    boxstr extent;          /* Maximum extent of work area */
    int    titleflags;      /* Icon flags for title bar    */
    int    workflags;       /* Only button type relevant   */
    void   *spritearea;     /* 0 == use the common sprite area  */
                            /* 1 == use the wimp sprite area    */
    int    minsize;         /* Two 16-bit OS-units, (width/height). */
    icondata title;         /* Title icon data */
    int    nicons;          /* Number of icons in window */

} windstr;


typedef struct windstr *wind;
typedef struct iconstr *icon;
typedef struct boxstr  *box;


#endif



00000000  2f 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |/***************|
00000010  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000030  2a 2a 2a 2a 2a 2a 2a 2a  2a 2f 0a 2f 2a 20 20 20  |*********/./*   |
00000040  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000070  20 20 20 2a 2f 0a 2f 2a  20 20 57 69 6d 70 20 64  |   */./*  Wimp d|
00000080  61 74 61 20 73 74 72 75  63 74 75 72 65 73 20 68  |ata structures h|
00000090  65 61 64 65 72 20 66 69  6c 65 2e 20 20 20 20 20  |eader file.     |
000000a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 2a 2f  |              */|
000000b0  0a 2f 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |./*             |
000000c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000000e0  20 20 20 20 20 20 20 20  20 2a 2f 0a 2f 2a 20 20  |         */./*  |
000000f0  28 63 29 20 4a 6f 68 6e  20 53 6b 69 6e 67 6c 65  |(c) John Skingle|
00000100  79 20 31 39 39 32 20 20  20 20 20 20 20 20 20 20  |y 1992          |
00000110  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000120  20 20 20 20 2a 2f 0a 2f  2a 20 20 20 20 20 20 20  |    */./*       |
00000130  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000150  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 2a  |               *|
00000160  2f 0a 2f 2a 20 20 41 72  63 68 69 6d 65 64 65 73  |/./*  Archimedes|
00000170  20 57 6f 72 6c 64 2c 20  27 41 6c 6c 20 61 74 20  | World, 'All at |
00000180  43 20 73 65 72 69 65 73  27 2e 20 20 20 20 20 20  |C series'.      |
00000190  20 20 20 20 20 20 20 20  20 20 2a 2f 0a 2f 2a 20  |          */./* |
000001a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000001d0  20 20 20 20 20 2a 2f 0a  2f 2a 2a 2a 2a 2a 2a 2a  |     */./*******|
000001e0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000210  2a 2f 0a 0a 0a 23 69 66  6e 64 65 66 20 5f 77 69  |*/...#ifndef _wi|
00000220  6d 70 73 74 72 0a 23 64  65 66 69 6e 65 20 5f 77  |mpstr.#define _w|
00000230  69 6d 70 73 74 72 0a 0a  0a 2f 2a 2a 2a 2a 2a 2a  |impstr.../******|
00000240  2a 2a 2a 2a 2a 2a 2a 2a  2a 20 53 74 72 75 63 74  |********* Struct|
00000250  75 72 65 20 64 65 66 69  6e 69 74 69 6f 6e 73 2e  |ure definitions.|
00000260  20 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | ***************|
00000270  2a 2a 2f 0a 0a 0a 74 79  70 65 64 65 66 20 73 74  |**/...typedef st|
00000280  72 75 63 74 20 62 6f 78  73 74 72 0a 7b 0a 20 20  |ruct boxstr.{.  |
00000290  20 20 69 6e 74 20 78 30  2c 20 79 30 2c 20 78 31  |  int x0, y0, x1|
000002a0  2c 20 79 31 3b 0a 7d 20  62 6f 78 73 74 72 3b 0a  |, y1;.} boxstr;.|
000002b0  0a 0a 74 79 70 65 64 65  66 20 75 6e 69 6f 6e 20  |..typedef union |
000002c0  69 63 6f 6e 64 61 74 61  20 20 20 20 20 20 2f 2a  |icondata      /*|
000002d0  20 44 61 74 61 20 66 69  65 6c 64 20 69 6e 20 61  | Data field in a|
000002e0  6e 20 69 63 6f 6e 20 20  20 20 20 20 20 20 20 20  |n icon          |
000002f0  20 20 20 20 2a 2f 0a 7b  0a 20 20 20 20 63 68 61  |    */.{.    cha|
00000300  72 20 74 65 78 74 5b 31  32 5d 3b 20 20 20 20 20  |r text[12];     |
00000310  20 20 20 20 20 2f 2a 20  54 65 78 74 20 73 74 72  |     /* Text str|
00000320  69 6e 67 2e 20 20 20 20  20 20 20 20 20 20 20 20  |ing.            |
00000330  20 20 20 20 20 20 20 20  20 20 20 2a 2f 0a 20 20  |           */.  |
00000340  20 20 63 68 61 72 20 73  70 72 69 74 65 5b 31 32  |  char sprite[12|
00000350  5d 3b 20 20 20 20 20 20  20 20 2f 2a 20 53 70 72  |];        /* Spr|
00000360  69 74 65 20 6e 61 6d 65  20 20 20 20 20 20 20 20  |ite name        |
00000370  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000380  2a 2f 0a 0a 20 20 20 20  73 74 72 75 63 74 20 20  |*/..    struct  |
00000390  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000003a0  2f 2a 20 49 6e 64 69 72  65 63 74 20 74 65 78 74  |/* Indirect text|
000003b0  20 69 63 6f 6e 2e 20 20  20 20 20 20 20 20 20 20  | icon.          |
000003c0  20 20 20 20 20 20 2a 2f  0a 20 20 20 20 7b 0a 20  |      */.    {. |
000003d0  20 20 20 20 20 20 20 63  68 61 72 20 2a 62 75 66  |       char *buf|
000003e0  66 65 72 3b 20 20 20 20  20 20 20 2f 2a 20 50 6f  |fer;       /* Po|
000003f0  69 6e 74 65 72 20 74 6f  20 74 65 78 74 20 62 75  |inter to text bu|
00000400  66 66 65 72 20 20 20 20  20 20 20 20 20 20 20 20  |ffer            |
00000410  20 2a 2f 0a 20 20 20 20  20 20 20 20 63 68 61 72  | */.        char|
00000420  20 2a 76 61 6c 69 64 3b  20 20 20 20 20 20 20 20  | *valid;        |
00000430  2f 2a 20 50 6f 69 6e 74  65 72 20 74 6f 20 76 61  |/* Pointer to va|
00000440  6c 69 64 61 74 69 6f 6e  20 73 74 72 69 6e 67 20  |lidation string |
00000450  20 20 20 20 20 20 2a 2f  0a 20 20 20 20 20 20 20  |      */.       |
00000460  20 69 6e 74 20 20 6c 65  6e 67 74 68 3b 20 20 20  | int  length;   |
00000470  20 20 20 20 20 2f 2a 20  4c 65 6e 67 74 68 20 6f  |     /* Length o|
00000480  66 20 74 65 78 74 20 62  75 66 66 65 72 20 20 20  |f text buffer   |
00000490  20 20 20 20 20 20 20 20  20 20 20 2a 2f 0a 0a 20  |           */.. |
000004a0  20 20 20 7d 20 69 6e 64  69 72 65 63 74 3b 0a 0a  |   } indirect;..|
000004b0  20 20 20 20 73 74 72 75  63 74 0a 20 20 20 20 7b  |    struct.    {|
000004c0  0a 20 20 20 20 20 20 20  20 63 68 61 72 20 2a 6e  |.        char *n|
000004d0  61 6d 65 3b 20 20 20 20  20 20 20 20 20 2f 2a 20  |ame;         /* |
000004e0  53 70 72 69 74 65 20 6e  61 6d 65 2e 20 20 20 20  |Sprite name.    |
000004f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000500  20 20 20 2a 2f 0a 20 20  20 20 20 20 20 20 76 6f  |   */.        vo|
00000510  69 64 20 2a 61 72 65 61  3b 20 20 20 20 20 20 20  |id *area;       |
00000520  20 20 2f 2a 20 53 70 72  69 74 65 20 61 72 65 61  |  /* Sprite area|
00000530  20 70 6f 69 6e 74 65 72  2e 20 20 20 20 20 20 20  | pointer.       |
00000540  20 20 20 20 20 20 20 20  2a 2f 0a 20 20 20 20 20  |        */.     |
00000550  20 20 20 69 6e 74 20 20  20 69 73 6e 61 6d 65 3b  |   int   isname;|
00000560  20 20 20 20 20 20 20 2f  2a 20 46 6c 61 67 2c 20  |       /* Flag, |
00000570  27 6e 61 6d 65 27 20 69  73 20 73 70 72 69 74 65  |'name' is sprite|
00000580  20 6e 61 6d 65 2e 20 20  20 20 20 20 20 2a 2f 0a  | name.       */.|
00000590  20 20 20 20 7d 20 69 6e  64 73 70 72 69 74 65 3b  |    } indsprite;|
000005a0  0a 0a 7d 20 69 63 6f 6e  64 61 74 61 3b 0a 0a 0a  |..} icondata;...|
000005b0  0a 74 79 70 65 64 65 66  20 73 74 72 75 63 74 20  |.typedef struct |
000005c0  69 63 6f 6e 73 74 72 20  20 20 20 20 20 2f 2a 20  |iconstr      /* |
000005d0  49 63 6f 6e 20 64 65 73  63 72 69 70 74 69 6f 6e  |Icon description|
000005e0  20 73 74 72 75 63 74 75  72 65 20 20 20 20 20 20  | structure      |
000005f0  20 20 20 2a 2f 0a 7b 20  20 20 20 20 20 20 20 20  |   */.{         |
00000600  20 20 20 20 20 20 20 20  20 20 20 0a 20 20 20 20  |           .    |
00000610  62 6f 78 73 74 72 20 20  20 62 6f 78 3b 20 20 20  |boxstr   box;   |
00000620  20 20 20 20 20 20 20 20  2f 2a 20 42 6f 75 6e 64  |        /* Bound|
00000630  69 6e 67 20 62 6f 78 20  2d 20 72 65 6c 61 74 69  |ing box - relati|
00000640  76 65 20 74 6f 20 77 6f  72 6b 20 61 72 65 61 20  |ve to work area |
00000650  6f 72 69 67 69 6e 20 20  2a 2f 0a 20 20 20 20 69  |origin  */.    i|
00000660  6e 74 20 20 20 20 20 20  66 6c 61 67 73 3b 20 20  |nt      flags;  |
00000670  20 20 20 20 20 20 20 2f  2a 20 46 6c 61 67 20 62  |       /* Flag b|
00000680  69 74 73 2e 20 20 20 20  20 20 20 20 20 20 20 20  |its.            |
00000690  20 20 20 20 20 20 20 20  20 20 20 20 20 2a 2f 0a  |             */.|
000006a0  20 20 20 20 69 63 6f 6e  64 61 74 61 20 64 61 74  |    icondata dat|
000006b0  61 3b 20 20 20 20 20 20  20 20 20 20 2f 2a 20 55  |a;          /* U|
000006c0  6e 69 6f 6e 20 6f 66 20  64 61 74 61 20 74 79 70  |nion of data typ|
000006d0  65 73 20 61 62 6f 76 65  20 20 20 20 20 20 20 20  |es above        |
000006e0  20 20 2a 2f 0a 0a 7d 20  69 63 6f 6e 73 74 72 3b  |  */..} iconstr;|
000006f0  0a 0a 0a 74 79 70 65 64  65 66 20 73 74 72 75 63  |...typedef struc|
00000700  74 20 77 69 6e 64 73 74  72 20 20 20 20 20 20 2f  |t windstr      /|
00000710  2a 20 57 69 6d 70 20 77  69 6e 64 6f 77 20 64 65  |* Wimp window de|
00000720  66 69 6e 69 74 69 6f 6e  20 73 74 72 75 63 74 75  |finition structu|
00000730  72 65 2e 20 20 2a 2f 0a  7b 0a 20 20 20 20 62 6f  |re.  */.{.    bo|
00000740  78 73 74 72 20 62 6f 78  3b 20 20 20 20 20 20 20  |xstr box;       |
00000750  20 20 20 20 20 20 2f 2a  20 53 63 72 65 65 6e 20  |      /* Screen |
00000760  63 6f 6f 72 64 73 20 6f  66 20 77 6f 72 6b 20 61  |coords of work a|
00000770  72 65 61 20 2a 2f 0a 20  20 20 20 69 6e 74 20 20  |rea */.    int  |
00000780  20 20 73 63 78 2c 20 73  63 79 3b 20 20 20 20 20  |  scx, scy;     |
00000790  20 20 20 2f 2a 20 53 63  72 6f 6c 6c 20 62 61 72  |   /* Scroll bar|
000007a0  20 70 6f 73 69 74 69 6f  6e 73 20 20 20 20 20 20  | positions      |
000007b0  20 2a 2f 0a 20 20 20 20  69 6e 74 20 20 20 20 62  | */.    int    b|
000007c0  65 68 69 6e 64 3b 20 20  20 20 20 20 20 20 20 20  |ehind;          |
000007d0  2f 2a 20 48 61 6e 64 6c  65 20 74 6f 20 6f 70 65  |/* Handle to ope|
000007e0  6e 20 77 69 6e 64 6f 77  20 62 65 68 69 6e 64 2c  |n window behind,|
000007f0  20 6f 72 20 2d 31 20 69  66 20 74 6f 70 20 2a 2f  | or -1 if top */|
00000800  0a 20 20 20 20 69 6e 74  20 20 20 20 66 6c 61 67  |.    int    flag|
00000810  73 3b 20 20 20 20 20 20  20 20 20 20 20 2f 2a 20  |s;           /* |
00000820  57 6f 72 64 20 6f 66 20  66 6c 61 67 20 62 69 74  |Word of flag bit|
00000830  73 20 64 65 66 69 6e 65  64 20 61 62 6f 76 65 20  |s defined above |
00000840  2a 2f 0a 20 20 20 20 63  68 61 72 20 20 20 63 6f  |*/.    char   co|
00000850  6c 6f 75 72 73 5b 38 5d  3b 20 20 20 20 20 20 2f  |lours[8];      /|
00000860  2a 20 43 6f 6c 6f 75 72  73 3a 20 69 6e 64 65 78  |* Colours: index|
00000870  20 75 73 69 6e 67 20 77  69 6d 70 5f 77 63 6f 6c  | using wimp_wcol|
00000880  6f 75 72 73 2e 20 2a 2f  0a 20 20 20 20 62 6f 78  |ours. */.    box|
00000890  73 74 72 20 65 78 74 65  6e 74 3b 20 20 20 20 20  |str extent;     |
000008a0  20 20 20 20 20 2f 2a 20  4d 61 78 69 6d 75 6d 20  |     /* Maximum |
000008b0  65 78 74 65 6e 74 20 6f  66 20 77 6f 72 6b 20 61  |extent of work a|
000008c0  72 65 61 20 2a 2f 0a 20  20 20 20 69 6e 74 20 20  |rea */.    int  |
000008d0  20 20 74 69 74 6c 65 66  6c 61 67 73 3b 20 20 20  |  titleflags;   |
000008e0  20 20 20 2f 2a 20 49 63  6f 6e 20 66 6c 61 67 73  |   /* Icon flags|
000008f0  20 66 6f 72 20 74 69 74  6c 65 20 62 61 72 20 20  | for title bar  |
00000900  20 20 2a 2f 0a 20 20 20  20 69 6e 74 20 20 20 20  |  */.    int    |
00000910  77 6f 72 6b 66 6c 61 67  73 3b 20 20 20 20 20 20  |workflags;      |
00000920  20 2f 2a 20 4f 6e 6c 79  20 62 75 74 74 6f 6e 20  | /* Only button |
00000930  74 79 70 65 20 72 65 6c  65 76 61 6e 74 20 20 20  |type relevant   |
00000940  2a 2f 0a 20 20 20 20 76  6f 69 64 20 20 20 2a 73  |*/.    void   *s|
00000950  70 72 69 74 65 61 72 65  61 3b 20 20 20 20 20 2f  |pritearea;     /|
00000960  2a 20 30 20 3d 3d 20 75  73 65 20 74 68 65 20 63  |* 0 == use the c|
00000970  6f 6d 6d 6f 6e 20 73 70  72 69 74 65 20 61 72 65  |ommon sprite are|
00000980  61 20 20 2a 2f 0a 20 20  20 20 20 20 20 20 20 20  |a  */.          |
00000990  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000009a0  20 20 2f 2a 20 31 20 3d  3d 20 75 73 65 20 74 68  |  /* 1 == use th|
000009b0  65 20 77 69 6d 70 20 73  70 72 69 74 65 20 61 72  |e wimp sprite ar|
000009c0  65 61 20 20 20 20 2a 2f  0a 20 20 20 20 69 6e 74  |ea    */.    int|
000009d0  20 20 20 20 6d 69 6e 73  69 7a 65 3b 20 20 20 20  |    minsize;    |
000009e0  20 20 20 20 20 2f 2a 20  54 77 6f 20 31 36 2d 62  |     /* Two 16-b|
000009f0  69 74 20 4f 53 2d 75 6e  69 74 73 2c 20 28 77 69  |it OS-units, (wi|
00000a00  64 74 68 2f 68 65 69 67  68 74 29 2e 20 2a 2f 0a  |dth/height). */.|
00000a10  20 20 20 20 69 63 6f 6e  64 61 74 61 20 74 69 74  |    icondata tit|
00000a20  6c 65 3b 20 20 20 20 20  20 20 20 20 2f 2a 20 54  |le;         /* T|
00000a30  69 74 6c 65 20 69 63 6f  6e 20 64 61 74 61 20 2a  |itle icon data *|
00000a40  2f 0a 20 20 20 20 69 6e  74 20 20 20 20 6e 69 63  |/.    int    nic|
00000a50  6f 6e 73 3b 20 20 20 20  20 20 20 20 20 20 2f 2a  |ons;          /*|
00000a60  20 4e 75 6d 62 65 72 20  6f 66 20 69 63 6f 6e 73  | Number of icons|
00000a70  20 69 6e 20 77 69 6e 64  6f 77 20 2a 2f 0a 0a 7d  | in window */..}|
00000a80  20 77 69 6e 64 73 74 72  3b 0a 0a 0a 74 79 70 65  | windstr;...type|
00000a90  64 65 66 20 73 74 72 75  63 74 20 77 69 6e 64 73  |def struct winds|
00000aa0  74 72 20 2a 77 69 6e 64  3b 0a 74 79 70 65 64 65  |tr *wind;.typede|
00000ab0  66 20 73 74 72 75 63 74  20 69 63 6f 6e 73 74 72  |f struct iconstr|
00000ac0  20 2a 69 63 6f 6e 3b 0a  74 79 70 65 64 65 66 20  | *icon;.typedef |
00000ad0  73 74 72 75 63 74 20 62  6f 78 73 74 72 20 20 2a  |struct boxstr  *|
00000ae0  62 6f 78 3b 0a 0a 0a 23  65 6e 64 69 66 0a 0a 0a  |box;...#endif...|
00000af0  0a                                                |.|
00000af1