int sender_task_handle; /* task handle of sender task (not used on entry) */
int my_ref; /* unique non-zero word */
int your_ref; /* 0 if originating the message */
int message_action; /* code depending on message action */
} Message_block;
/* Set up some useful pointers / variables */
extern int *wimp_block;
extern int quit;
extern Window_block *window_block;
extern Redraw_block *redraw_block;
extern Mouse_block *mouse_block;
extern Message_block *message_block;
extern Message_dataload *message_dataload;
extern Menu_block *menu_block;
/* Initialise task and setup wimp block. */
/* On exit: 0 = success.
1 = failed to malloc wimp block. */
int hl_initialise_task(int os_version, char *task_name, int *mask, unsigned int *task_handle);
/* Open a template file. */
void hl_open_templates(char *name);
/* Close a template file. */
void hl_close_templates(void);
/* Load a given window definition and fill in a Window struct. */
/* sprite_area is a pointer to a sprite area used by the window */
/* On exit: 0 = fail.
address = success */
Window *hl_load_window(char *name1, int *sprite_area);
/* Load the HawkLib sprite area */
/* On exit: ptr to sparea = success.
1 = couldn't malloc sprite area.
2 = couldn't open spritefile. */
int *hl_load_sprites(char *name);
/* Attach a pane to a window. can be called multiple times to attach multiple panes. */
/* On exit: 0 = success.
1 = couldn't malloc space to store Pane struct. */
int hl_attach_pane(Window *window, Window *pane, int x_offset, int y_offset);
/* Remove a pane from a window */
/* On exit: 0 = success.
1 = pane not found. */
int hl_remove_pane(Window *window, Window *pane);
/* swap two pane windows */
int hl_swap_pane(Window *window, Window *original_pane, Window *new_pane);
/* Attach a slider - returns either slider pointer or null for fail */
Slider *hl_attach_slider(Window *window, int x_offset, int y_offset,int width, int height, int max_value, int min_value, int centre_value, int value, int fg_colour, int bg_colour, int (*fnptr)(), int flags);
/* Remove a slider from a window */
/* On exit: 0 = success.
1 = slider not found. */
int hl_remove_slider(Window *window, Slider *slider);
/* Handle opening windows and panes of windows... */
/* convert window handle to pointer to Window */
/* On exit: NULL = failed
pointer to window if succeded */
Window *hl_hawklib_convert_to_Window(int handle);
/* Open using pointer to window struct */
/* This also calls Wimp_GetWindowState before opening */
void hl_show_window(Window *window, int style);
/* find struct pointer given handle... */
int hl_open_window(int handle);
/* close window */
void hl_hide_window(Window *window);
/* close window given handle, not struct pointer */
int hl_close_window(int handle);
/* Initiate a Wimp Drag */
/* Horrid routine */
void hl_start_drag(int a, int b, int c, int d, int e, int f, int g, int h, int i,int j, int k, int l, int m, int n);
/* Icon routines */
int hl_create_icon(int w_handle, int min_x, int min_y, int max_x, int max_y, int flags, int ind_a, int ind_b, int ind_c);
/* Set icon text */
void hl_set_icon_text(Window *window, int icon_handle, char *icon_text, int flags);
/* fill in wimp_block with icon state */
void hl_get_icon_state(Window *window, int icon_handle);
/* Set an icons state according to the clear and eor words */
void hl_set_icon_state(Window *window, int icon_handle, int eor, int clear);
/* return pointer to icon text */
char *hl_get_icon_text(Window *window, int icon_handle);
/* Grey out an icon */
void hl_grey_icon(Window *window, int icon_handle);
/* Ungrey an icon */
void hl_ungrey_icon(Window *window, int icon_handle);
/* create menu - returns -1 for fail, otherwise, handle is passed back. */
int hl_create_menu(char *title, char tfgc, char tbgc, char wfgc, char wbgc, int width, int height, int gap);
/* Add menu item to end of menu returns 0 for success. */
int hl_add_menu_item(int menu_handle, int flags, int sub_ptr, int icon_flags, char *name, int i1, int i2, int i3);
/* Display menu on screen */
void hl_show_menu(int menu_handle, int x, int y);
/* Alter existing menu entries - 1 = first entry, 2 = second etc. */
void hl_alter_menu_item(int menu_handle, int item, int alterflags, int flags, int sub_ptr, int icon_flags, char *name, int i1, int i2, int i3);
/* allow menu flags to be edited */
void hl_edit_menu_flags(int menu_handle, int item, int new_flags_clear, int new_flags_or);
/* Set menu handler function */
void hl_set_menu_handler(int (*fnptr)());
/* Set mouse rectangle, screen co-ordinates */
void hl_set_mouse_rectangle(int min_x, int min_y, int max_x, int max_y);
/* On exit: returns reason code from Wimp_Poll. */