Home » Archimedes archive » Acorn User » AU 1997-12.adf » Regulars » C/!Skeleton/h/AUlib

C/!Skeleton/h/AUlib

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 » Acorn User » AU 1997-12.adf » Regulars
Filename: C/!Skeleton/h/AUlib
Read OK:
File size: 11AC bytes
Load address: 0000
Exec address: 0000
File contents
/* AULib.h - a header file for the Acorn User WIMP C library */
/* Modified 6/10/97 by SJPM */

#ifndef AULIB_H
#define AULIB_H

/* #Include the appropriate files - swis.h and kernel.h hold the information
 * we need to call SWI functions from within C */

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "swis.h"
#include "kernel.h"

/* A few #defines to set up some constants */

#define IBAR_ONRIGHT	-1
#define IBAR_ONLEFT	-2
#define IBAR_PRIOR_APP	0

/* #Defines for icon flags */
#define ICON_ISTEXT	1u << 0
#define ICON_ISSPRITE	1u << 1
#define ICON_HASBORDER	1u << 2
#define ICON_HCENTRE	1u << 3
#define ICON_VCENTRE	1u << 4
#define ICON_ISFILLED	1u << 5
#define ICON_CLICKNOTIFIESONCE	3u << 12 

/* These are for a StyleGuide-compliant square iconbar icon - without text */
#define IBAR_BBOX_MINX	0
#define IBAR_BBOX_MINY	0
#define IBAR_BBOX_MAXX	68
#define IBAR_BBOX_MAXY	68

/* These are for a StyleGuide-compliant square iconbar icon - with text */
#define IBART_BBOX_MINX	0
#define IBART_BBOX_MINY	20
#define IBART_BBOX_MAXX	68
#define IBART_BBOX_MAXY	84

/* #Defines for menu creation */

#define MENU_TITLEFORE	7u
#define MENU_TITLEBACK	2u << 8
#define MENU_WORKFORE	7u << 16
#define MENU_WORKBACK	0u << 24 /* these define colours */
#define MENU_TICK	1u << 0
#define MENU_DOTTED	1u << 1
#define MENU_LASTITEM	1u << 7
#define MENU_SHADED	1u << 22

#define MENUITEM_FORE	7u << 24
#define MENUITEM_BACK	0u << 28

#define MENU_WIDTH	172 /* could be more intelligent, but it's a start */
#define MENU_HEIGHT	44 /* by order of the Style Guide */
#define MENU_VERTGAP	0

/* Message types */

#define MESSAGE_QUIT	0
#define MESSAGE_DATASAVE	1
#define MESSAGE_DATASAVEACK	2
#define MESSAGE_DATALOAD	3
#define MESSAGE_DATALOADACK	4
#define MESSAGE_PALETTECHANGE	9
#define MESSAGE_MODECHANGE	0x400c1


/* Sizes for block definitions */

#define ICON_BLOCK_SIZE	40

/* Other miscellaneous definitions */

#define SAVEDRAG_TYPE	5

/* Colour definitions (RGB values) */

#define COLOUR_WHITE	0xffffff00
#define COLOUR_BLACK	0x00000000
#define COLOUR_RED	0x0000ff00
#define COLOUR_GREEN	0x00ff0000
#define COLOUR_BLUE	0xff000000
#define COLOUR_PURPLE	0xff00ff00
#define COLOUR_CYAN	0xffff0000
#define COLOUR_YELLOW	0x00ffff00

/* Structure definitions */

typedef struct window_data {
	int	win_handle;
	unsigned char	*buffer;
	unsigned char	*workspace;
	char *win_name;
} window_data;

typedef struct pointer_data {
	long int	mouse_x;
	long int	mouse_y;
	long int	button_state;
	long int	win_handle;
	long int	icon_handle;
} pointer_data;

typedef struct menu_element {
	long int flags;
	long int submenu;
	long int menu_iconflags;
	char menu_text[12];
	struct menu_element *next_menuelem;
} menu_element;

typedef struct menu_data {
	char title[12];
	int size;
	long int colours;
	long int width;
	long int height;
	long int vert_gap;
	unsigned char* datablock;
	menu_element *next_menuelem;
} menu_data;

/* Prototyping */
extern int	au_initialise(int, char *, long int[]);
extern void	au_closedown(int);
extern int	au_create_iconbar_icon(int, unsigned long int, unsigned long int, char *);
extern void	au_wordtobyte(unsigned long int, unsigned char[], int);
extern unsigned long int	au_bytetoword(unsigned char[], int);
extern void	au_opentemplate(char *);
extern void	au_closetemplate(void);
extern int	au_loadtemplate(char *, window_data *, int);
extern int	au_report_error(int, char *, int, char *);
extern void	au_openwin_from_templatedata(window_data *, long int);
extern int	au_wimp_poll(int, unsigned char *);
extern void	au_icon_text_change(char *, unsigned long int, unsigned long int);
extern char	*au_get_ptr_to_icontext(unsigned long int, unsigned long int);
extern void	au_buildmenu(char *, menu_data *);
extern void	au_addtomenu(char *, long int, long int, long int, menu_data *);
extern void	au_createmenu(menu_data *);
extern void	au_openmenu(menu_data *, int, int);
extern void	au_icon_get_text(char *, unsigned long int, unsigned long int);
extern void	au_losecaret(void);
extern void	au_dragbox(unsigned long int, unsigned long int);
extern void	au_geticoninfo(unsigned long int, unsigned long int, unsigned char *);
extern void	au_getpointerinfo(pointer_data *);
extern void	au_datasave(pointer_data, int, int, char*);
extern int	au_findfont(char*, int, int);
extern void	au_selectfont(int);
extern void	au_setfontcolours(int, int);
extern void	au_fontpaint(char*, int, int);
extern void	au_losefont(int);
extern void	au_convertwindow_to_screen(unsigned char*, int*, int*);
#endif
00000000  2f 2a 20 41 55 4c 69 62  2e 68 20 2d 20 61 20 68  |/* AULib.h - a h|
00000010  65 61 64 65 72 20 66 69  6c 65 20 66 6f 72 20 74  |eader file for t|
00000020  68 65 20 41 63 6f 72 6e  20 55 73 65 72 20 57 49  |he Acorn User WI|
00000030  4d 50 20 43 20 6c 69 62  72 61 72 79 20 2a 2f 0a  |MP C library */.|
00000040  2f 2a 20 4d 6f 64 69 66  69 65 64 20 36 2f 31 30  |/* Modified 6/10|
00000050  2f 39 37 20 62 79 20 53  4a 50 4d 20 2a 2f 0a 0a  |/97 by SJPM */..|
00000060  23 69 66 6e 64 65 66 20  41 55 4c 49 42 5f 48 0a  |#ifndef AULIB_H.|
00000070  23 64 65 66 69 6e 65 20  41 55 4c 49 42 5f 48 0a  |#define AULIB_H.|
00000080  0a 2f 2a 20 23 49 6e 63  6c 75 64 65 20 74 68 65  |./* #Include the|
00000090  20 61 70 70 72 6f 70 72  69 61 74 65 20 66 69 6c  | appropriate fil|
000000a0  65 73 20 2d 20 73 77 69  73 2e 68 20 61 6e 64 20  |es - swis.h and |
000000b0  6b 65 72 6e 65 6c 2e 68  20 68 6f 6c 64 20 74 68  |kernel.h hold th|
000000c0  65 20 69 6e 66 6f 72 6d  61 74 69 6f 6e 0a 20 2a  |e information. *|
000000d0  20 77 65 20 6e 65 65 64  20 74 6f 20 63 61 6c 6c  | we need to call|
000000e0  20 53 57 49 20 66 75 6e  63 74 69 6f 6e 73 20 66  | SWI functions f|
000000f0  72 6f 6d 20 77 69 74 68  69 6e 20 43 20 2a 2f 0a  |rom within C */.|
00000100  0a 23 69 6e 63 6c 75 64  65 20 3c 73 74 64 69 6f  |.#include <stdio|
00000110  2e 68 3e 0a 23 69 6e 63  6c 75 64 65 20 3c 73 74  |.h>.#include <st|
00000120  72 69 6e 67 2e 68 3e 0a  23 69 6e 63 6c 75 64 65  |ring.h>.#include|
00000130  20 3c 73 74 64 6c 69 62  2e 68 3e 0a 23 69 6e 63  | <stdlib.h>.#inc|
00000140  6c 75 64 65 20 22 73 77  69 73 2e 68 22 0a 23 69  |lude "swis.h".#i|
00000150  6e 63 6c 75 64 65 20 22  6b 65 72 6e 65 6c 2e 68  |nclude "kernel.h|
00000160  22 0a 0a 2f 2a 20 41 20  66 65 77 20 23 64 65 66  |"../* A few #def|
00000170  69 6e 65 73 20 74 6f 20  73 65 74 20 75 70 20 73  |ines to set up s|
00000180  6f 6d 65 20 63 6f 6e 73  74 61 6e 74 73 20 2a 2f  |ome constants */|
00000190  0a 0a 23 64 65 66 69 6e  65 20 49 42 41 52 5f 4f  |..#define IBAR_O|
000001a0  4e 52 49 47 48 54 09 2d  31 0a 23 64 65 66 69 6e  |NRIGHT.-1.#defin|
000001b0  65 20 49 42 41 52 5f 4f  4e 4c 45 46 54 09 2d 32  |e IBAR_ONLEFT.-2|
000001c0  0a 23 64 65 66 69 6e 65  20 49 42 41 52 5f 50 52  |.#define IBAR_PR|
000001d0  49 4f 52 5f 41 50 50 09  30 0a 0a 2f 2a 20 23 44  |IOR_APP.0../* #D|
000001e0  65 66 69 6e 65 73 20 66  6f 72 20 69 63 6f 6e 20  |efines for icon |
000001f0  66 6c 61 67 73 20 2a 2f  0a 23 64 65 66 69 6e 65  |flags */.#define|
00000200  20 49 43 4f 4e 5f 49 53  54 45 58 54 09 31 75 20  | ICON_ISTEXT.1u |
00000210  3c 3c 20 30 0a 23 64 65  66 69 6e 65 20 49 43 4f  |<< 0.#define ICO|
00000220  4e 5f 49 53 53 50 52 49  54 45 09 31 75 20 3c 3c  |N_ISSPRITE.1u <<|
00000230  20 31 0a 23 64 65 66 69  6e 65 20 49 43 4f 4e 5f  | 1.#define ICON_|
00000240  48 41 53 42 4f 52 44 45  52 09 31 75 20 3c 3c 20  |HASBORDER.1u << |
00000250  32 0a 23 64 65 66 69 6e  65 20 49 43 4f 4e 5f 48  |2.#define ICON_H|
00000260  43 45 4e 54 52 45 09 31  75 20 3c 3c 20 33 0a 23  |CENTRE.1u << 3.#|
00000270  64 65 66 69 6e 65 20 49  43 4f 4e 5f 56 43 45 4e  |define ICON_VCEN|
00000280  54 52 45 09 31 75 20 3c  3c 20 34 0a 23 64 65 66  |TRE.1u << 4.#def|
00000290  69 6e 65 20 49 43 4f 4e  5f 49 53 46 49 4c 4c 45  |ine ICON_ISFILLE|
000002a0  44 09 31 75 20 3c 3c 20  35 0a 23 64 65 66 69 6e  |D.1u << 5.#defin|
000002b0  65 20 49 43 4f 4e 5f 43  4c 49 43 4b 4e 4f 54 49  |e ICON_CLICKNOTI|
000002c0  46 49 45 53 4f 4e 43 45  09 33 75 20 3c 3c 20 31  |FIESONCE.3u << 1|
000002d0  32 20 0a 0a 2f 2a 20 54  68 65 73 65 20 61 72 65  |2 ../* These are|
000002e0  20 66 6f 72 20 61 20 53  74 79 6c 65 47 75 69 64  | for a StyleGuid|
000002f0  65 2d 63 6f 6d 70 6c 69  61 6e 74 20 73 71 75 61  |e-compliant squa|
00000300  72 65 20 69 63 6f 6e 62  61 72 20 69 63 6f 6e 20  |re iconbar icon |
00000310  2d 20 77 69 74 68 6f 75  74 20 74 65 78 74 20 2a  |- without text *|
00000320  2f 0a 23 64 65 66 69 6e  65 20 49 42 41 52 5f 42  |/.#define IBAR_B|
00000330  42 4f 58 5f 4d 49 4e 58  09 30 0a 23 64 65 66 69  |BOX_MINX.0.#defi|
00000340  6e 65 20 49 42 41 52 5f  42 42 4f 58 5f 4d 49 4e  |ne IBAR_BBOX_MIN|
00000350  59 09 30 0a 23 64 65 66  69 6e 65 20 49 42 41 52  |Y.0.#define IBAR|
00000360  5f 42 42 4f 58 5f 4d 41  58 58 09 36 38 0a 23 64  |_BBOX_MAXX.68.#d|
00000370  65 66 69 6e 65 20 49 42  41 52 5f 42 42 4f 58 5f  |efine IBAR_BBOX_|
00000380  4d 41 58 59 09 36 38 0a  0a 2f 2a 20 54 68 65 73  |MAXY.68../* Thes|
00000390  65 20 61 72 65 20 66 6f  72 20 61 20 53 74 79 6c  |e are for a Styl|
000003a0  65 47 75 69 64 65 2d 63  6f 6d 70 6c 69 61 6e 74  |eGuide-compliant|
000003b0  20 73 71 75 61 72 65 20  69 63 6f 6e 62 61 72 20  | square iconbar |
000003c0  69 63 6f 6e 20 2d 20 77  69 74 68 20 74 65 78 74  |icon - with text|
000003d0  20 2a 2f 0a 23 64 65 66  69 6e 65 20 49 42 41 52  | */.#define IBAR|
000003e0  54 5f 42 42 4f 58 5f 4d  49 4e 58 09 30 0a 23 64  |T_BBOX_MINX.0.#d|
000003f0  65 66 69 6e 65 20 49 42  41 52 54 5f 42 42 4f 58  |efine IBART_BBOX|
00000400  5f 4d 49 4e 59 09 32 30  0a 23 64 65 66 69 6e 65  |_MINY.20.#define|
00000410  20 49 42 41 52 54 5f 42  42 4f 58 5f 4d 41 58 58  | IBART_BBOX_MAXX|
00000420  09 36 38 0a 23 64 65 66  69 6e 65 20 49 42 41 52  |.68.#define IBAR|
00000430  54 5f 42 42 4f 58 5f 4d  41 58 59 09 38 34 0a 0a  |T_BBOX_MAXY.84..|
00000440  2f 2a 20 23 44 65 66 69  6e 65 73 20 66 6f 72 20  |/* #Defines for |
00000450  6d 65 6e 75 20 63 72 65  61 74 69 6f 6e 20 2a 2f  |menu creation */|
00000460  0a 0a 23 64 65 66 69 6e  65 20 4d 45 4e 55 5f 54  |..#define MENU_T|
00000470  49 54 4c 45 46 4f 52 45  09 37 75 0a 23 64 65 66  |ITLEFORE.7u.#def|
00000480  69 6e 65 20 4d 45 4e 55  5f 54 49 54 4c 45 42 41  |ine MENU_TITLEBA|
00000490  43 4b 09 32 75 20 3c 3c  20 38 0a 23 64 65 66 69  |CK.2u << 8.#defi|
000004a0  6e 65 20 4d 45 4e 55 5f  57 4f 52 4b 46 4f 52 45  |ne MENU_WORKFORE|
000004b0  09 37 75 20 3c 3c 20 31  36 0a 23 64 65 66 69 6e  |.7u << 16.#defin|
000004c0  65 20 4d 45 4e 55 5f 57  4f 52 4b 42 41 43 4b 09  |e MENU_WORKBACK.|
000004d0  30 75 20 3c 3c 20 32 34  20 2f 2a 20 74 68 65 73  |0u << 24 /* thes|
000004e0  65 20 64 65 66 69 6e 65  20 63 6f 6c 6f 75 72 73  |e define colours|
000004f0  20 2a 2f 0a 23 64 65 66  69 6e 65 20 4d 45 4e 55  | */.#define MENU|
00000500  5f 54 49 43 4b 09 31 75  20 3c 3c 20 30 0a 23 64  |_TICK.1u << 0.#d|
00000510  65 66 69 6e 65 20 4d 45  4e 55 5f 44 4f 54 54 45  |efine MENU_DOTTE|
00000520  44 09 31 75 20 3c 3c 20  31 0a 23 64 65 66 69 6e  |D.1u << 1.#defin|
00000530  65 20 4d 45 4e 55 5f 4c  41 53 54 49 54 45 4d 09  |e MENU_LASTITEM.|
00000540  31 75 20 3c 3c 20 37 0a  23 64 65 66 69 6e 65 20  |1u << 7.#define |
00000550  4d 45 4e 55 5f 53 48 41  44 45 44 09 31 75 20 3c  |MENU_SHADED.1u <|
00000560  3c 20 32 32 0a 0a 23 64  65 66 69 6e 65 20 4d 45  |< 22..#define ME|
00000570  4e 55 49 54 45 4d 5f 46  4f 52 45 09 37 75 20 3c  |NUITEM_FORE.7u <|
00000580  3c 20 32 34 0a 23 64 65  66 69 6e 65 20 4d 45 4e  |< 24.#define MEN|
00000590  55 49 54 45 4d 5f 42 41  43 4b 09 30 75 20 3c 3c  |UITEM_BACK.0u <<|
000005a0  20 32 38 0a 0a 23 64 65  66 69 6e 65 20 4d 45 4e  | 28..#define MEN|
000005b0  55 5f 57 49 44 54 48 09  31 37 32 20 2f 2a 20 63  |U_WIDTH.172 /* c|
000005c0  6f 75 6c 64 20 62 65 20  6d 6f 72 65 20 69 6e 74  |ould be more int|
000005d0  65 6c 6c 69 67 65 6e 74  2c 20 62 75 74 20 69 74  |elligent, but it|
000005e0  27 73 20 61 20 73 74 61  72 74 20 2a 2f 0a 23 64  |'s a start */.#d|
000005f0  65 66 69 6e 65 20 4d 45  4e 55 5f 48 45 49 47 48  |efine MENU_HEIGH|
00000600  54 09 34 34 20 2f 2a 20  62 79 20 6f 72 64 65 72  |T.44 /* by order|
00000610  20 6f 66 20 74 68 65 20  53 74 79 6c 65 20 47 75  | of the Style Gu|
00000620  69 64 65 20 2a 2f 0a 23  64 65 66 69 6e 65 20 4d  |ide */.#define M|
00000630  45 4e 55 5f 56 45 52 54  47 41 50 09 30 0a 0a 2f  |ENU_VERTGAP.0../|
00000640  2a 20 4d 65 73 73 61 67  65 20 74 79 70 65 73 20  |* Message types |
00000650  2a 2f 0a 0a 23 64 65 66  69 6e 65 20 4d 45 53 53  |*/..#define MESS|
00000660  41 47 45 5f 51 55 49 54  09 30 0a 23 64 65 66 69  |AGE_QUIT.0.#defi|
00000670  6e 65 20 4d 45 53 53 41  47 45 5f 44 41 54 41 53  |ne MESSAGE_DATAS|
00000680  41 56 45 09 31 0a 23 64  65 66 69 6e 65 20 4d 45  |AVE.1.#define ME|
00000690  53 53 41 47 45 5f 44 41  54 41 53 41 56 45 41 43  |SSAGE_DATASAVEAC|
000006a0  4b 09 32 0a 23 64 65 66  69 6e 65 20 4d 45 53 53  |K.2.#define MESS|
000006b0  41 47 45 5f 44 41 54 41  4c 4f 41 44 09 33 0a 23  |AGE_DATALOAD.3.#|
000006c0  64 65 66 69 6e 65 20 4d  45 53 53 41 47 45 5f 44  |define MESSAGE_D|
000006d0  41 54 41 4c 4f 41 44 41  43 4b 09 34 0a 23 64 65  |ATALOADACK.4.#de|
000006e0  66 69 6e 65 20 4d 45 53  53 41 47 45 5f 50 41 4c  |fine MESSAGE_PAL|
000006f0  45 54 54 45 43 48 41 4e  47 45 09 39 0a 23 64 65  |ETTECHANGE.9.#de|
00000700  66 69 6e 65 20 4d 45 53  53 41 47 45 5f 4d 4f 44  |fine MESSAGE_MOD|
00000710  45 43 48 41 4e 47 45 09  30 78 34 30 30 63 31 0a  |ECHANGE.0x400c1.|
00000720  0a 0a 2f 2a 20 53 69 7a  65 73 20 66 6f 72 20 62  |../* Sizes for b|
00000730  6c 6f 63 6b 20 64 65 66  69 6e 69 74 69 6f 6e 73  |lock definitions|
00000740  20 2a 2f 0a 0a 23 64 65  66 69 6e 65 20 49 43 4f  | */..#define ICO|
00000750  4e 5f 42 4c 4f 43 4b 5f  53 49 5a 45 09 34 30 0a  |N_BLOCK_SIZE.40.|
00000760  0a 2f 2a 20 4f 74 68 65  72 20 6d 69 73 63 65 6c  |./* Other miscel|
00000770  6c 61 6e 65 6f 75 73 20  64 65 66 69 6e 69 74 69  |laneous definiti|
00000780  6f 6e 73 20 2a 2f 0a 0a  23 64 65 66 69 6e 65 20  |ons */..#define |
00000790  53 41 56 45 44 52 41 47  5f 54 59 50 45 09 35 0a  |SAVEDRAG_TYPE.5.|
000007a0  0a 2f 2a 20 43 6f 6c 6f  75 72 20 64 65 66 69 6e  |./* Colour defin|
000007b0  69 74 69 6f 6e 73 20 28  52 47 42 20 76 61 6c 75  |itions (RGB valu|
000007c0  65 73 29 20 2a 2f 0a 0a  23 64 65 66 69 6e 65 20  |es) */..#define |
000007d0  43 4f 4c 4f 55 52 5f 57  48 49 54 45 09 30 78 66  |COLOUR_WHITE.0xf|
000007e0  66 66 66 66 66 30 30 0a  23 64 65 66 69 6e 65 20  |fffff00.#define |
000007f0  43 4f 4c 4f 55 52 5f 42  4c 41 43 4b 09 30 78 30  |COLOUR_BLACK.0x0|
00000800  30 30 30 30 30 30 30 0a  23 64 65 66 69 6e 65 20  |0000000.#define |
00000810  43 4f 4c 4f 55 52 5f 52  45 44 09 30 78 30 30 30  |COLOUR_RED.0x000|
00000820  30 66 66 30 30 0a 23 64  65 66 69 6e 65 20 43 4f  |0ff00.#define CO|
00000830  4c 4f 55 52 5f 47 52 45  45 4e 09 30 78 30 30 66  |LOUR_GREEN.0x00f|
00000840  66 30 30 30 30 0a 23 64  65 66 69 6e 65 20 43 4f  |f0000.#define CO|
00000850  4c 4f 55 52 5f 42 4c 55  45 09 30 78 66 66 30 30  |LOUR_BLUE.0xff00|
00000860  30 30 30 30 0a 23 64 65  66 69 6e 65 20 43 4f 4c  |0000.#define COL|
00000870  4f 55 52 5f 50 55 52 50  4c 45 09 30 78 66 66 30  |OUR_PURPLE.0xff0|
00000880  30 66 66 30 30 0a 23 64  65 66 69 6e 65 20 43 4f  |0ff00.#define CO|
00000890  4c 4f 55 52 5f 43 59 41  4e 09 30 78 66 66 66 66  |LOUR_CYAN.0xffff|
000008a0  30 30 30 30 0a 23 64 65  66 69 6e 65 20 43 4f 4c  |0000.#define COL|
000008b0  4f 55 52 5f 59 45 4c 4c  4f 57 09 30 78 30 30 66  |OUR_YELLOW.0x00f|
000008c0  66 66 66 30 30 0a 0a 2f  2a 20 53 74 72 75 63 74  |fff00../* Struct|
000008d0  75 72 65 20 64 65 66 69  6e 69 74 69 6f 6e 73 20  |ure definitions |
000008e0  2a 2f 0a 0a 74 79 70 65  64 65 66 20 73 74 72 75  |*/..typedef stru|
000008f0  63 74 20 77 69 6e 64 6f  77 5f 64 61 74 61 20 7b  |ct window_data {|
00000900  0a 09 69 6e 74 09 77 69  6e 5f 68 61 6e 64 6c 65  |..int.win_handle|
00000910  3b 0a 09 75 6e 73 69 67  6e 65 64 20 63 68 61 72  |;..unsigned char|
00000920  09 2a 62 75 66 66 65 72  3b 0a 09 75 6e 73 69 67  |.*buffer;..unsig|
00000930  6e 65 64 20 63 68 61 72  09 2a 77 6f 72 6b 73 70  |ned char.*worksp|
00000940  61 63 65 3b 0a 09 63 68  61 72 20 2a 77 69 6e 5f  |ace;..char *win_|
00000950  6e 61 6d 65 3b 0a 7d 20  77 69 6e 64 6f 77 5f 64  |name;.} window_d|
00000960  61 74 61 3b 0a 0a 74 79  70 65 64 65 66 20 73 74  |ata;..typedef st|
00000970  72 75 63 74 20 70 6f 69  6e 74 65 72 5f 64 61 74  |ruct pointer_dat|
00000980  61 20 7b 0a 09 6c 6f 6e  67 20 69 6e 74 09 6d 6f  |a {..long int.mo|
00000990  75 73 65 5f 78 3b 0a 09  6c 6f 6e 67 20 69 6e 74  |use_x;..long int|
000009a0  09 6d 6f 75 73 65 5f 79  3b 0a 09 6c 6f 6e 67 20  |.mouse_y;..long |
000009b0  69 6e 74 09 62 75 74 74  6f 6e 5f 73 74 61 74 65  |int.button_state|
000009c0  3b 0a 09 6c 6f 6e 67 20  69 6e 74 09 77 69 6e 5f  |;..long int.win_|
000009d0  68 61 6e 64 6c 65 3b 0a  09 6c 6f 6e 67 20 69 6e  |handle;..long in|
000009e0  74 09 69 63 6f 6e 5f 68  61 6e 64 6c 65 3b 0a 7d  |t.icon_handle;.}|
000009f0  20 70 6f 69 6e 74 65 72  5f 64 61 74 61 3b 0a 0a  | pointer_data;..|
00000a00  74 79 70 65 64 65 66 20  73 74 72 75 63 74 20 6d  |typedef struct m|
00000a10  65 6e 75 5f 65 6c 65 6d  65 6e 74 20 7b 0a 09 6c  |enu_element {..l|
00000a20  6f 6e 67 20 69 6e 74 20  66 6c 61 67 73 3b 0a 09  |ong int flags;..|
00000a30  6c 6f 6e 67 20 69 6e 74  20 73 75 62 6d 65 6e 75  |long int submenu|
00000a40  3b 0a 09 6c 6f 6e 67 20  69 6e 74 20 6d 65 6e 75  |;..long int menu|
00000a50  5f 69 63 6f 6e 66 6c 61  67 73 3b 0a 09 63 68 61  |_iconflags;..cha|
00000a60  72 20 6d 65 6e 75 5f 74  65 78 74 5b 31 32 5d 3b  |r menu_text[12];|
00000a70  0a 09 73 74 72 75 63 74  20 6d 65 6e 75 5f 65 6c  |..struct menu_el|
00000a80  65 6d 65 6e 74 20 2a 6e  65 78 74 5f 6d 65 6e 75  |ement *next_menu|
00000a90  65 6c 65 6d 3b 0a 7d 20  6d 65 6e 75 5f 65 6c 65  |elem;.} menu_ele|
00000aa0  6d 65 6e 74 3b 0a 0a 74  79 70 65 64 65 66 20 73  |ment;..typedef s|
00000ab0  74 72 75 63 74 20 6d 65  6e 75 5f 64 61 74 61 20  |truct menu_data |
00000ac0  7b 0a 09 63 68 61 72 20  74 69 74 6c 65 5b 31 32  |{..char title[12|
00000ad0  5d 3b 0a 09 69 6e 74 20  73 69 7a 65 3b 0a 09 6c  |];..int size;..l|
00000ae0  6f 6e 67 20 69 6e 74 20  63 6f 6c 6f 75 72 73 3b  |ong int colours;|
00000af0  0a 09 6c 6f 6e 67 20 69  6e 74 20 77 69 64 74 68  |..long int width|
00000b00  3b 0a 09 6c 6f 6e 67 20  69 6e 74 20 68 65 69 67  |;..long int heig|
00000b10  68 74 3b 0a 09 6c 6f 6e  67 20 69 6e 74 20 76 65  |ht;..long int ve|
00000b20  72 74 5f 67 61 70 3b 0a  09 75 6e 73 69 67 6e 65  |rt_gap;..unsigne|
00000b30  64 20 63 68 61 72 2a 20  64 61 74 61 62 6c 6f 63  |d char* databloc|
00000b40  6b 3b 0a 09 6d 65 6e 75  5f 65 6c 65 6d 65 6e 74  |k;..menu_element|
00000b50  20 2a 6e 65 78 74 5f 6d  65 6e 75 65 6c 65 6d 3b  | *next_menuelem;|
00000b60  0a 7d 20 6d 65 6e 75 5f  64 61 74 61 3b 0a 0a 2f  |.} menu_data;../|
00000b70  2a 20 50 72 6f 74 6f 74  79 70 69 6e 67 20 2a 2f  |* Prototyping */|
00000b80  0a 65 78 74 65 72 6e 20  69 6e 74 09 61 75 5f 69  |.extern int.au_i|
00000b90  6e 69 74 69 61 6c 69 73  65 28 69 6e 74 2c 20 63  |nitialise(int, c|
00000ba0  68 61 72 20 2a 2c 20 6c  6f 6e 67 20 69 6e 74 5b  |har *, long int[|
00000bb0  5d 29 3b 0a 65 78 74 65  72 6e 20 76 6f 69 64 09  |]);.extern void.|
00000bc0  61 75 5f 63 6c 6f 73 65  64 6f 77 6e 28 69 6e 74  |au_closedown(int|
00000bd0  29 3b 0a 65 78 74 65 72  6e 20 69 6e 74 09 61 75  |);.extern int.au|
00000be0  5f 63 72 65 61 74 65 5f  69 63 6f 6e 62 61 72 5f  |_create_iconbar_|
00000bf0  69 63 6f 6e 28 69 6e 74  2c 20 75 6e 73 69 67 6e  |icon(int, unsign|
00000c00  65 64 20 6c 6f 6e 67 20  69 6e 74 2c 20 75 6e 73  |ed long int, uns|
00000c10  69 67 6e 65 64 20 6c 6f  6e 67 20 69 6e 74 2c 20  |igned long int, |
00000c20  63 68 61 72 20 2a 29 3b  0a 65 78 74 65 72 6e 20  |char *);.extern |
00000c30  76 6f 69 64 09 61 75 5f  77 6f 72 64 74 6f 62 79  |void.au_wordtoby|
00000c40  74 65 28 75 6e 73 69 67  6e 65 64 20 6c 6f 6e 67  |te(unsigned long|
00000c50  20 69 6e 74 2c 20 75 6e  73 69 67 6e 65 64 20 63  | int, unsigned c|
00000c60  68 61 72 5b 5d 2c 20 69  6e 74 29 3b 0a 65 78 74  |har[], int);.ext|
00000c70  65 72 6e 20 75 6e 73 69  67 6e 65 64 20 6c 6f 6e  |ern unsigned lon|
00000c80  67 20 69 6e 74 09 61 75  5f 62 79 74 65 74 6f 77  |g int.au_bytetow|
00000c90  6f 72 64 28 75 6e 73 69  67 6e 65 64 20 63 68 61  |ord(unsigned cha|
00000ca0  72 5b 5d 2c 20 69 6e 74  29 3b 0a 65 78 74 65 72  |r[], int);.exter|
00000cb0  6e 20 76 6f 69 64 09 61  75 5f 6f 70 65 6e 74 65  |n void.au_opente|
00000cc0  6d 70 6c 61 74 65 28 63  68 61 72 20 2a 29 3b 0a  |mplate(char *);.|
00000cd0  65 78 74 65 72 6e 20 76  6f 69 64 09 61 75 5f 63  |extern void.au_c|
00000ce0  6c 6f 73 65 74 65 6d 70  6c 61 74 65 28 76 6f 69  |losetemplate(voi|
00000cf0  64 29 3b 0a 65 78 74 65  72 6e 20 69 6e 74 09 61  |d);.extern int.a|
00000d00  75 5f 6c 6f 61 64 74 65  6d 70 6c 61 74 65 28 63  |u_loadtemplate(c|
00000d10  68 61 72 20 2a 2c 20 77  69 6e 64 6f 77 5f 64 61  |har *, window_da|
00000d20  74 61 20 2a 2c 20 69 6e  74 29 3b 0a 65 78 74 65  |ta *, int);.exte|
00000d30  72 6e 20 69 6e 74 09 61  75 5f 72 65 70 6f 72 74  |rn int.au_report|
00000d40  5f 65 72 72 6f 72 28 69  6e 74 2c 20 63 68 61 72  |_error(int, char|
00000d50  20 2a 2c 20 69 6e 74 2c  20 63 68 61 72 20 2a 29  | *, int, char *)|
00000d60  3b 0a 65 78 74 65 72 6e  20 76 6f 69 64 09 61 75  |;.extern void.au|
00000d70  5f 6f 70 65 6e 77 69 6e  5f 66 72 6f 6d 5f 74 65  |_openwin_from_te|
00000d80  6d 70 6c 61 74 65 64 61  74 61 28 77 69 6e 64 6f  |mplatedata(windo|
00000d90  77 5f 64 61 74 61 20 2a  2c 20 6c 6f 6e 67 20 69  |w_data *, long i|
00000da0  6e 74 29 3b 0a 65 78 74  65 72 6e 20 69 6e 74 09  |nt);.extern int.|
00000db0  61 75 5f 77 69 6d 70 5f  70 6f 6c 6c 28 69 6e 74  |au_wimp_poll(int|
00000dc0  2c 20 75 6e 73 69 67 6e  65 64 20 63 68 61 72 20  |, unsigned char |
00000dd0  2a 29 3b 0a 65 78 74 65  72 6e 20 76 6f 69 64 09  |*);.extern void.|
00000de0  61 75 5f 69 63 6f 6e 5f  74 65 78 74 5f 63 68 61  |au_icon_text_cha|
00000df0  6e 67 65 28 63 68 61 72  20 2a 2c 20 75 6e 73 69  |nge(char *, unsi|
00000e00  67 6e 65 64 20 6c 6f 6e  67 20 69 6e 74 2c 20 75  |gned long int, u|
00000e10  6e 73 69 67 6e 65 64 20  6c 6f 6e 67 20 69 6e 74  |nsigned long int|
00000e20  29 3b 0a 65 78 74 65 72  6e 20 63 68 61 72 09 2a  |);.extern char.*|
00000e30  61 75 5f 67 65 74 5f 70  74 72 5f 74 6f 5f 69 63  |au_get_ptr_to_ic|
00000e40  6f 6e 74 65 78 74 28 75  6e 73 69 67 6e 65 64 20  |ontext(unsigned |
00000e50  6c 6f 6e 67 20 69 6e 74  2c 20 75 6e 73 69 67 6e  |long int, unsign|
00000e60  65 64 20 6c 6f 6e 67 20  69 6e 74 29 3b 0a 65 78  |ed long int);.ex|
00000e70  74 65 72 6e 20 76 6f 69  64 09 61 75 5f 62 75 69  |tern void.au_bui|
00000e80  6c 64 6d 65 6e 75 28 63  68 61 72 20 2a 2c 20 6d  |ldmenu(char *, m|
00000e90  65 6e 75 5f 64 61 74 61  20 2a 29 3b 0a 65 78 74  |enu_data *);.ext|
00000ea0  65 72 6e 20 76 6f 69 64  09 61 75 5f 61 64 64 74  |ern void.au_addt|
00000eb0  6f 6d 65 6e 75 28 63 68  61 72 20 2a 2c 20 6c 6f  |omenu(char *, lo|
00000ec0  6e 67 20 69 6e 74 2c 20  6c 6f 6e 67 20 69 6e 74  |ng int, long int|
00000ed0  2c 20 6c 6f 6e 67 20 69  6e 74 2c 20 6d 65 6e 75  |, long int, menu|
00000ee0  5f 64 61 74 61 20 2a 29  3b 0a 65 78 74 65 72 6e  |_data *);.extern|
00000ef0  20 76 6f 69 64 09 61 75  5f 63 72 65 61 74 65 6d  | void.au_createm|
00000f00  65 6e 75 28 6d 65 6e 75  5f 64 61 74 61 20 2a 29  |enu(menu_data *)|
00000f10  3b 0a 65 78 74 65 72 6e  20 76 6f 69 64 09 61 75  |;.extern void.au|
00000f20  5f 6f 70 65 6e 6d 65 6e  75 28 6d 65 6e 75 5f 64  |_openmenu(menu_d|
00000f30  61 74 61 20 2a 2c 20 69  6e 74 2c 20 69 6e 74 29  |ata *, int, int)|
00000f40  3b 0a 65 78 74 65 72 6e  20 76 6f 69 64 09 61 75  |;.extern void.au|
00000f50  5f 69 63 6f 6e 5f 67 65  74 5f 74 65 78 74 28 63  |_icon_get_text(c|
00000f60  68 61 72 20 2a 2c 20 75  6e 73 69 67 6e 65 64 20  |har *, unsigned |
00000f70  6c 6f 6e 67 20 69 6e 74  2c 20 75 6e 73 69 67 6e  |long int, unsign|
00000f80  65 64 20 6c 6f 6e 67 20  69 6e 74 29 3b 0a 65 78  |ed long int);.ex|
00000f90  74 65 72 6e 20 76 6f 69  64 09 61 75 5f 6c 6f 73  |tern void.au_los|
00000fa0  65 63 61 72 65 74 28 76  6f 69 64 29 3b 0a 65 78  |ecaret(void);.ex|
00000fb0  74 65 72 6e 20 76 6f 69  64 09 61 75 5f 64 72 61  |tern void.au_dra|
00000fc0  67 62 6f 78 28 75 6e 73  69 67 6e 65 64 20 6c 6f  |gbox(unsigned lo|
00000fd0  6e 67 20 69 6e 74 2c 20  75 6e 73 69 67 6e 65 64  |ng int, unsigned|
00000fe0  20 6c 6f 6e 67 20 69 6e  74 29 3b 0a 65 78 74 65  | long int);.exte|
00000ff0  72 6e 20 76 6f 69 64 09  61 75 5f 67 65 74 69 63  |rn void.au_getic|
00001000  6f 6e 69 6e 66 6f 28 75  6e 73 69 67 6e 65 64 20  |oninfo(unsigned |
00001010  6c 6f 6e 67 20 69 6e 74  2c 20 75 6e 73 69 67 6e  |long int, unsign|
00001020  65 64 20 6c 6f 6e 67 20  69 6e 74 2c 20 75 6e 73  |ed long int, uns|
00001030  69 67 6e 65 64 20 63 68  61 72 20 2a 29 3b 0a 65  |igned char *);.e|
00001040  78 74 65 72 6e 20 76 6f  69 64 09 61 75 5f 67 65  |xtern void.au_ge|
00001050  74 70 6f 69 6e 74 65 72  69 6e 66 6f 28 70 6f 69  |tpointerinfo(poi|
00001060  6e 74 65 72 5f 64 61 74  61 20 2a 29 3b 0a 65 78  |nter_data *);.ex|
00001070  74 65 72 6e 20 76 6f 69  64 09 61 75 5f 64 61 74  |tern void.au_dat|
00001080  61 73 61 76 65 28 70 6f  69 6e 74 65 72 5f 64 61  |asave(pointer_da|
00001090  74 61 2c 20 69 6e 74 2c  20 69 6e 74 2c 20 63 68  |ta, int, int, ch|
000010a0  61 72 2a 29 3b 0a 65 78  74 65 72 6e 20 69 6e 74  |ar*);.extern int|
000010b0  09 61 75 5f 66 69 6e 64  66 6f 6e 74 28 63 68 61  |.au_findfont(cha|
000010c0  72 2a 2c 20 69 6e 74 2c  20 69 6e 74 29 3b 0a 65  |r*, int, int);.e|
000010d0  78 74 65 72 6e 20 76 6f  69 64 09 61 75 5f 73 65  |xtern void.au_se|
000010e0  6c 65 63 74 66 6f 6e 74  28 69 6e 74 29 3b 0a 65  |lectfont(int);.e|
000010f0  78 74 65 72 6e 20 76 6f  69 64 09 61 75 5f 73 65  |xtern void.au_se|
00001100  74 66 6f 6e 74 63 6f 6c  6f 75 72 73 28 69 6e 74  |tfontcolours(int|
00001110  2c 20 69 6e 74 29 3b 0a  65 78 74 65 72 6e 20 76  |, int);.extern v|
00001120  6f 69 64 09 61 75 5f 66  6f 6e 74 70 61 69 6e 74  |oid.au_fontpaint|
00001130  28 63 68 61 72 2a 2c 20  69 6e 74 2c 20 69 6e 74  |(char*, int, int|
00001140  29 3b 0a 65 78 74 65 72  6e 20 76 6f 69 64 09 61  |);.extern void.a|
00001150  75 5f 6c 6f 73 65 66 6f  6e 74 28 69 6e 74 29 3b  |u_losefont(int);|
00001160  0a 65 78 74 65 72 6e 20  76 6f 69 64 09 61 75 5f  |.extern void.au_|
00001170  63 6f 6e 76 65 72 74 77  69 6e 64 6f 77 5f 74 6f  |convertwindow_to|
00001180  5f 73 63 72 65 65 6e 28  75 6e 73 69 67 6e 65 64  |_screen(unsigned|
00001190  20 63 68 61 72 2a 2c 20  69 6e 74 2a 2c 20 69 6e  | char*, int*, in|
000011a0  74 2a 29 3b 0a 23 65 6e  64 69 66 0a              |t*);.#endif.|
000011ac