home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-14 | 88.0 KB | 2,757 lines |
- #ifndef wimp_H
- #define wimp_H
-
- /* C header file for Wimp
- * written by DefMod (Sep 7 1994) on Wed Sep 14 13:17:56 1994
- * Copyright © Acorn Computers Ltd, 1994
- */
-
- /*************************************************************************
- * This source file was written by Acorn Computers Limited. It is part *
- * of the OSLib library for writing applications for RISC OS. It may be *
- * used freely in the creation of programs for RISC OS. *
- *************************************************************************/
-
- #ifndef types_H
- #include "types.h"
- #endif
-
- #ifndef os_H
- #include "os.h"
- #endif
-
- #ifndef osspriteop_H
- #include "osspriteop.h"
- #endif
-
- #ifndef font_H
- #include "font.h"
- #endif
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef Wimp_Initialise
- #define Wimp_Initialise 0x400C0
- #undef XWimp_Initialise
- #define XWimp_Initialise 0x600C0
- #undef Wimp_CreateWindow
- #define Wimp_CreateWindow 0x400C1
- #undef XWimp_CreateWindow
- #define XWimp_CreateWindow 0x600C1
- #undef Wimp_CreateIcon
- #define Wimp_CreateIcon 0x400C2
- #undef XWimp_CreateIcon
- #define XWimp_CreateIcon 0x600C2
- #undef Wimp_CreateIconRelative
- #define Wimp_CreateIconRelative 0x400C2
- #undef XWimp_CreateIconRelative
- #define XWimp_CreateIconRelative 0x600C2
- #undef Wimp_CreateIconPrioritised
- #define Wimp_CreateIconPrioritised 0x400C2
- #undef XWimp_CreateIconPrioritised
- #define XWimp_CreateIconPrioritised 0x600C2
- #undef Wimp_DeleteWindow
- #define Wimp_DeleteWindow 0x400C3
- #undef XWimp_DeleteWindow
- #define XWimp_DeleteWindow 0x600C3
- #undef Wimp_DeleteIcon
- #define Wimp_DeleteIcon 0x400C4
- #undef XWimp_DeleteIcon
- #define XWimp_DeleteIcon 0x600C4
- #undef Wimp_OpenWindow
- #define Wimp_OpenWindow 0x400C5
- #undef XWimp_OpenWindow
- #define XWimp_OpenWindow 0x600C5
- #undef Wimp_CloseWindow
- #define Wimp_CloseWindow 0x400C6
- #undef XWimp_CloseWindow
- #define XWimp_CloseWindow 0x600C6
- #undef Wimp_Poll
- #define Wimp_Poll 0x400C7
- #undef XWimp_Poll
- #define XWimp_Poll 0x600C7
- #undef Wimp_RedrawWindow
- #define Wimp_RedrawWindow 0x400C8
- #undef XWimp_RedrawWindow
- #define XWimp_RedrawWindow 0x600C8
- #undef Wimp_UpdateWindow
- #define Wimp_UpdateWindow 0x400C9
- #undef XWimp_UpdateWindow
- #define XWimp_UpdateWindow 0x600C9
- #undef Wimp_GetRectangle
- #define Wimp_GetRectangle 0x400CA
- #undef XWimp_GetRectangle
- #define XWimp_GetRectangle 0x600CA
- #undef Wimp_GetWindowState
- #define Wimp_GetWindowState 0x400CB
- #undef XWimp_GetWindowState
- #define XWimp_GetWindowState 0x600CB
- #undef Wimp_GetWindowInfo
- #define Wimp_GetWindowInfo 0x400CC
- #undef XWimp_GetWindowInfo
- #define XWimp_GetWindowInfo 0x600CC
- #undef Wimp_GetWindowInfoHeaderOnly
- #define Wimp_GetWindowInfoHeaderOnly 0x400CC
- #undef XWimp_GetWindowInfoHeaderOnly
- #define XWimp_GetWindowInfoHeaderOnly 0x600CC
- #undef Wimp_SetIconState
- #define Wimp_SetIconState 0x400CD
- #undef XWimp_SetIconState
- #define XWimp_SetIconState 0x600CD
- #undef Wimp_GetIconState
- #define Wimp_GetIconState 0x400CE
- #undef XWimp_GetIconState
- #define XWimp_GetIconState 0x600CE
- #undef Wimp_GetPointerInfo
- #define Wimp_GetPointerInfo 0x400CF
- #undef XWimp_GetPointerInfo
- #define XWimp_GetPointerInfo 0x600CF
- #undef Wimp_DragBox
- #define Wimp_DragBox 0x400D0
- #undef XWimp_DragBox
- #define XWimp_DragBox 0x600D0
- #undef Wimp_ForceRedraw
- #define Wimp_ForceRedraw 0x400D1
- #undef XWimp_ForceRedraw
- #define XWimp_ForceRedraw 0x600D1
- #undef Wimp_SetCaretPosition
- #define Wimp_SetCaretPosition 0x400D2
- #undef XWimp_SetCaretPosition
- #define XWimp_SetCaretPosition 0x600D2
- #undef Wimp_GetCaretPosition
- #define Wimp_GetCaretPosition 0x400D3
- #undef XWimp_GetCaretPosition
- #define XWimp_GetCaretPosition 0x600D3
- #undef Wimp_CreateMenu
- #define Wimp_CreateMenu 0x400D4
- #undef XWimp_CreateMenu
- #define XWimp_CreateMenu 0x600D4
- #undef Wimp_DecodeMenu
- #define Wimp_DecodeMenu 0x400D5
- #undef XWimp_DecodeMenu
- #define XWimp_DecodeMenu 0x600D5
- #undef Wimp_WhichIcon
- #define Wimp_WhichIcon 0x400D6
- #undef XWimp_WhichIcon
- #define XWimp_WhichIcon 0x600D6
- #undef Wimp_SetExtent
- #define Wimp_SetExtent 0x400D7
- #undef XWimp_SetExtent
- #define XWimp_SetExtent 0x600D7
- #undef Wimp_SetPointerShape
- #define Wimp_SetPointerShape 0x400D8
- #undef XWimp_SetPointerShape
- #define XWimp_SetPointerShape 0x600D8
- #undef Wimp_OpenTemplate
- #define Wimp_OpenTemplate 0x400D9
- #undef XWimp_OpenTemplate
- #define XWimp_OpenTemplate 0x600D9
- #undef Wimp_CloseTemplate
- #define Wimp_CloseTemplate 0x400DA
- #undef XWimp_CloseTemplate
- #define XWimp_CloseTemplate 0x600DA
- #undef Wimp_LoadTemplate
- #define Wimp_LoadTemplate 0x400DB
- #undef XWimp_LoadTemplate
- #define XWimp_LoadTemplate 0x600DB
- #undef Wimp_ProcessKey
- #define Wimp_ProcessKey 0x400DC
- #undef XWimp_ProcessKey
- #define XWimp_ProcessKey 0x600DC
- #undef Wimp_CloseDown
- #define Wimp_CloseDown 0x400DD
- #undef XWimp_CloseDown
- #define XWimp_CloseDown 0x600DD
- #undef Wimp_StartTask
- #define Wimp_StartTask 0x400DE
- #undef XWimp_StartTask
- #define XWimp_StartTask 0x600DE
- #undef Wimp_ReportError
- #define Wimp_ReportError 0x400DF
- #undef XWimp_ReportError
- #define XWimp_ReportError 0x600DF
- #undef Wimp_ReportErrorByCategory
- #define Wimp_ReportErrorByCategory 0x400DF
- #undef XWimp_ReportErrorByCategory
- #define XWimp_ReportErrorByCategory 0x600DF
- #undef Wimp_GetWindowOutline
- #define Wimp_GetWindowOutline 0x400E0
- #undef XWimp_GetWindowOutline
- #define XWimp_GetWindowOutline 0x600E0
- #undef Wimp_PollIdle
- #define Wimp_PollIdle 0x400E1
- #undef XWimp_PollIdle
- #define XWimp_PollIdle 0x600E1
- #undef Wimp_PlotIcon
- #define Wimp_PlotIcon 0x400E2
- #undef XWimp_PlotIcon
- #define XWimp_PlotIcon 0x600E2
- #undef Wimp_SetMode
- #define Wimp_SetMode 0x400E3
- #undef XWimp_SetMode
- #define XWimp_SetMode 0x600E3
- #undef Wimp_SetPalette
- #define Wimp_SetPalette 0x400E4
- #undef XWimp_SetPalette
- #define XWimp_SetPalette 0x600E4
- #undef Wimp_ReadPalette
- #define Wimp_ReadPalette 0x400E5
- #undef XWimp_ReadPalette
- #define XWimp_ReadPalette 0x600E5
- #undef Wimp_ReadTruePalette
- #define Wimp_ReadTruePalette 0x400E5
- #undef XWimp_ReadTruePalette
- #define XWimp_ReadTruePalette 0x600E5
- #undef Wimp_SetColour
- #define Wimp_SetColour 0x400E6
- #undef XWimp_SetColour
- #define XWimp_SetColour 0x600E6
- #undef Wimp_SendMessage
- #define Wimp_SendMessage 0x400E7
- #undef XWimp_SendMessage
- #define XWimp_SendMessage 0x600E7
- #undef Wimp_SendMessageToWindow
- #define Wimp_SendMessageToWindow 0x400E7
- #undef XWimp_SendMessageToWindow
- #define XWimp_SendMessageToWindow 0x600E7
- #undef Wimp_CreateSubMenu
- #define Wimp_CreateSubMenu 0x400E8
- #undef XWimp_CreateSubMenu
- #define XWimp_CreateSubMenu 0x600E8
- #undef Wimp_BaseOfSprites
- #define Wimp_BaseOfSprites 0x400EA
- #undef XWimp_BaseOfSprites
- #define XWimp_BaseOfSprites 0x600EA
- #undef Wimp_BlockCopy
- #define Wimp_BlockCopy 0x400EB
- #undef XWimp_BlockCopy
- #define XWimp_BlockCopy 0x600EB
- #undef Wimp_SlotSize
- #define Wimp_SlotSize 0x400EC
- #undef XWimp_SlotSize
- #define XWimp_SlotSize 0x600EC
- #undef Wimp_ReadPixTrans
- #define Wimp_ReadPixTrans 0x400ED
- #undef XWimp_ReadPixTrans
- #define XWimp_ReadPixTrans 0x600ED
- #undef Wimp_ClaimFreeMemory
- #define Wimp_ClaimFreeMemory 0x400EE
- #undef XWimp_ClaimFreeMemory
- #define XWimp_ClaimFreeMemory 0x600EE
- #undef WimpClaimFreeMemory_Alloc
- #define WimpClaimFreeMemory_Alloc 0x1
- #undef WimpClaimFreeMemory_Free
- #define WimpClaimFreeMemory_Free 0x0
- #undef Wimp_CommandWindow
- #define Wimp_CommandWindow 0x400EF
- #undef XWimp_CommandWindow
- #define XWimp_CommandWindow 0x600EF
- #undef Wimp_TextColour
- #define Wimp_TextColour 0x400F0
- #undef XWimp_TextColour
- #define XWimp_TextColour 0x600F0
- #undef Wimp_TransferBlock
- #define Wimp_TransferBlock 0x400F1
- #undef XWimp_TransferBlock
- #define XWimp_TransferBlock 0x600F1
- #undef Wimp_SetFontColours
- #define Wimp_SetFontColours 0x400F3
- #undef XWimp_SetFontColours
- #define XWimp_SetFontColours 0x600F3
- #undef Wimp_GetMenuState
- #define Wimp_GetMenuState 0x400F4
- #undef XWimp_GetMenuState
- #define XWimp_GetMenuState 0x600F4
- #undef Wimp_RegisterFilter
- #define Wimp_RegisterFilter 0x400F5
- #undef XWimp_RegisterFilter
- #define XWimp_RegisterFilter 0x600F5
- #undef Wimp_AddMessages
- #define Wimp_AddMessages 0x400F6
- #undef XWimp_AddMessages
- #define XWimp_AddMessages 0x600F6
- #undef Wimp_RemoveMessages
- #define Wimp_RemoveMessages 0x400F7
- #undef XWimp_RemoveMessages
- #define XWimp_RemoveMessages 0x600F7
- #undef Wimp_SetColourMapping
- #define Wimp_SetColourMapping 0x400F8
- #undef XWimp_SetColourMapping
- #define XWimp_SetColourMapping 0x600F8
- #undef Wimp_TextOp
- #define Wimp_TextOp 0x400F9
- #undef XWimp_TextOp
- #define XWimp_TextOp 0x600F9
- #undef WimpTextOp_SetColour
- #define WimpTextOp_SetColour 0x0
- #undef WimpTextOp_StringWidth
- #define WimpTextOp_StringWidth 0x1
- #undef WimpTextOp_Paint
- #define WimpTextOp_Paint 0x2
- #undef Wimp_SetWatchdogState
- #define Wimp_SetWatchdogState 0x400FA
- #undef XWimp_SetWatchdogState
- #define XWimp_SetWatchdogState 0x600FA
- #undef Wimp_Extend
- #define Wimp_Extend 0x400FB
- #undef XWimp_Extend
- #define XWimp_Extend 0x600FB
- #undef Wimp_ResizeIcon
- #define Wimp_ResizeIcon 0x400FC
- #undef XWimp_ResizeIcon
- #define XWimp_ResizeIcon 0x600FC
- #undef Service_Memory
- #define Service_Memory 0x11
- #undef Service_StartWimp
- #define Service_StartWimp 0x49
- #undef Service_StartedWimp
- #define Service_StartedWimp 0x4A
- #undef Service_MouseTrap
- #define Service_MouseTrap 0x52
- #undef Service_WimpCloseDown
- #define Service_WimpCloseDown 0x53
- #undef Service_WimpReportError
- #define Service_WimpReportError 0x57
- #undef Service_WimpSaveDesktop
- #define Service_WimpSaveDesktop 0x5C
- #undef Service_WimpPalette
- #define Service_WimpPalette 0x5D
- #undef Service_DesktopWelcome
- #define Service_DesktopWelcome 0x7C
- #undef Service_ShutDown
- #define Service_ShutDown 0x7E
- #undef Service_ShutDownComplete
- #define Service_ShutDownComplete 0x80
- #undef Service_WimpSpritesMoved
- #define Service_WimpSpritesMoved 0x85
- #undef Service_WimpRegisterFilters
- #define Service_WimpRegisterFilters 0x86
- #undef Service_ErrorStarting
- #define Service_ErrorStarting 0x400C0
- #undef Service_ErrorButtonPressed
- #define Service_ErrorButtonPressed 0x400C1
- #undef Service_ErrorEnding
- #define Service_ErrorEnding 0x400C2
-
- /************************************
- * Structure and union declarations *
- ************************************/
- typedef struct wimp_w_ *wimp_w;
- typedef struct wimp_t_ *wimp_t;
- typedef union wimp_icon_data wimp_icon_data;
- typedef struct wimp_icon wimp_icon;
- typedef struct wimp_icon_create wimp_icon_create;
- typedef struct wimp_window wimp_window;
- typedef struct wimp_window_state wimp_window_state;
- typedef struct wimp_icon_state wimp_icon_state;
- typedef struct wimp_window_info wimp_window_info;
- typedef struct wimp_outline wimp_outline;
- typedef struct wimp_draw wimp_draw;
- typedef struct wimp_open wimp_open;
- typedef struct wimp_close wimp_close;
- typedef struct wimp_leaving wimp_leaving;
- typedef struct wimp_entering wimp_entering;
- typedef struct wimp_pointer wimp_pointer;
- typedef struct wimp_dragged wimp_dragged;
- typedef struct wimp_key wimp_key;
- typedef struct wimp_selection wimp_selection;
- typedef struct wimp_scroll wimp_scroll;
- typedef struct wimp_pollword wimp_pollword;
- typedef struct wimp_drag wimp_drag;
- typedef struct wimp_caret wimp_caret;
- typedef struct wimp_menu_entry wimp_menu_entry;
- typedef struct wimp_menu wimp_menu;
- typedef struct wimp_message_data_xfer wimp_message_data_xfer;
- typedef struct wimp_message_ram_xfer wimp_message_ram_xfer;
- typedef struct wimp_message_prequit wimp_message_prequit;
- typedef struct wimp_message_save_desktop wimp_message_save_desktop;
- typedef struct wimp_message_device wimp_message_device;
- typedef struct wimp_message_data_saved wimp_message_data_saved;
- typedef struct wimp_message_shutdown wimp_message_shutdown;
- typedef struct wimp_message_claim_entity wimp_message_claim_entity;
- typedef struct wimp_message_data_request wimp_message_data_request;
- typedef struct wimp_message_dragging wimp_message_dragging;
- typedef struct wimp_message_drag_claim wimp_message_drag_claim;
- typedef struct wimp_message_menu_warning wimp_message_menu_warning;
- typedef struct wimp_message_task_initialise wimp_message_task_initialise;
- typedef struct wimp_message_slot_size wimp_message_slot_size;
- typedef struct wimp_message_set_slot wimp_message_set_slot;
- typedef struct wimp_message_task_name_rq wimp_message_task_name_rq;
- typedef struct wimp_message_task_name_is wimp_message_task_name_is;
- typedef struct wimp_message_menus_deleted wimp_message_menus_deleted;
- typedef struct wimp_message_iconise wimp_message_iconise;
- typedef struct wimp_message_window_closed wimp_message_window_closed;
- typedef struct wimp_message_window_info wimp_message_window_info;
- typedef struct wimp_message_font_changed wimp_message_font_changed;
- typedef struct wimp_message wimp_message;
- typedef union wimp_block wimp_block;
- typedef struct wimp_message_list wimp_message_list;
-
- /********************
- * Type definitions *
- ********************/
- typedef int wimp_i;
-
- typedef byte wimp_colour;
-
- union wimp_icon_data
- { char text [12];
- char sprite [12];
- char text_and_sprite [12];
- struct
- { char *text;
- char *validation;
- int size;
- }
- indirected_text;
- struct
- { osspriteop_id id;
- osspriteop_area *area;
- int size;
- }
- indirected_sprite;
- struct
- { char *text;
- char *validation;
- int size;
- }
- indirected_text_and_sprite;
- };
-
- struct wimp_icon
- { os_box extent;
- bits flags;
- wimp_icon_data data;
- };
-
- struct wimp_icon_create
- { wimp_w w;
- wimp_icon icon;
- };
-
- struct wimp_window
- { os_box visible;
- int xscroll;
- int yscroll;
- wimp_w next;
- bits flags;
- wimp_colour title_fg;
- wimp_colour title_bg;
- wimp_colour work_fg;
- wimp_colour work_bg;
- wimp_colour scroll_outer;
- wimp_colour scroll_inner;
- wimp_colour highlight_bg;
- wimp_colour reserved;
- os_box extent;
- bits title_flags;
- bits work_flags;
- osspriteop_area *sprite_area;
- short xmin;
- short ymin;
- wimp_icon_data title_data;
- int icon_count;
- wimp_icon icons [UNKNOWN];
- };
-
- #define wimp_WINDOW(N) \
- struct \
- { os_box visible; \
- int xscroll; \
- int yscroll; \
- wimp_w next; \
- bits flags; \
- wimp_colour title_fg; \
- wimp_colour title_bg; \
- wimp_colour work_fg; \
- wimp_colour work_bg; \
- wimp_colour scroll_outer; \
- wimp_colour scroll_inner; \
- wimp_colour highlight_bg; \
- wimp_colour reserved; \
- os_box extent; \
- bits title_flags; \
- bits work_flags; \
- osspriteop_area *sprite_area; \
- short xmin; \
- short ymin; \
- wimp_icon_data title_data; \
- int icon_count; \
- wimp_icon icons [N]; \
- }
-
- #define wimp_SIZEOF_WINDOW(N) \
- (offsetof (wimp_window, icons) + \
- (N)*sizeof ((wimp_window *) NULL)->icons)
-
- struct wimp_window_state
- { wimp_w w;
- os_box visible;
- int xscroll;
- int yscroll;
- wimp_w next;
- bits flags;
- };
-
- struct wimp_icon_state
- { wimp_w w;
- wimp_i i;
- wimp_icon icon;
- };
-
- struct wimp_window_info
- { wimp_w w;
- os_box visible;
- int xscroll;
- int yscroll;
- wimp_w next;
- bits flags;
- wimp_colour title_fg;
- wimp_colour title_bg;
- wimp_colour work_fg;
- wimp_colour work_bg;
- wimp_colour scroll_outer;
- wimp_colour scroll_inner;
- wimp_colour highlight_bg;
- wimp_colour reserved;
- os_box extent;
- bits title_flags;
- bits work_flags;
- osspriteop_area *sprite_area;
- short xmin;
- short ymin;
- wimp_icon_data title_data;
- int icon_count;
- wimp_icon icons [UNKNOWN];
- };
-
- #define wimp_WINDOW_INFO(N) \
- struct \
- { wimp_w w; \
- os_box visible; \
- int xscroll; \
- int yscroll; \
- wimp_w next; \
- bits flags; \
- wimp_colour title_fg; \
- wimp_colour title_bg; \
- wimp_colour work_fg; \
- wimp_colour work_bg; \
- wimp_colour scroll_outer; \
- wimp_colour scroll_inner; \
- wimp_colour highlight_bg; \
- wimp_colour reserved; \
- os_box extent; \
- bits title_flags; \
- bits work_flags; \
- osspriteop_area *sprite_area; \
- short xmin; \
- short ymin; \
- wimp_icon_data title_data; \
- int icon_count; \
- wimp_icon icons [N]; \
- }
-
- #define wimp_SIZEOF_WINDOW_INFO(N) \
- (offsetof (wimp_window_info, icons) + \
- (N)*sizeof ((wimp_window_info *) NULL)->icons)
-
- struct wimp_outline
- { wimp_w w;
- os_box outline;
- };
-
- struct wimp_draw
- { wimp_w w;
- os_box box;
- int xscroll;
- int yscroll;
- os_box clip;
- };
-
- struct wimp_open
- { wimp_w w;
- os_box visible;
- int xscroll;
- int yscroll;
- wimp_w next;
- };
-
- struct wimp_close
- { wimp_w w;
- };
-
- struct wimp_leaving
- { wimp_w w;
- };
-
- struct wimp_entering
- { wimp_w w;
- };
-
- struct wimp_pointer
- { os_coord pos;
- bits buttons;
- wimp_w w;
- wimp_i i;
- };
-
- struct wimp_dragged
- { os_box final;
- };
-
- struct wimp_key
- { wimp_w w;
- wimp_i i;
- os_coord pos;
- int height;
- int index;
- int c;
- };
-
- struct wimp_selection
- { int items [9];
- };
-
- struct wimp_scroll
- { wimp_w w;
- os_box visible;
- int xscroll;
- int yscroll;
- wimp_w next;
- int xmin;
- int ymin;
- };
-
- struct wimp_pollword
- { byte *addr;
- int word;
- };
-
- struct wimp_drag
- { wimp_w w;
- int type;
- os_box initial;
- os_box bbox;
- byte *handle;
- void *draw;
- void *undraw;
- void *redraw;
- };
-
- struct wimp_caret
- { wimp_w w;
- wimp_i i;
- os_coord pos;
- int height;
- int index;
- };
-
- struct wimp_menu_entry
- { bits menu_flags;
- wimp_menu *sub_menu;
- bits icon_flags;
- wimp_icon_data data;
- };
-
- struct wimp_menu
- { union
- { char text [12];
- struct
- { char *text;
- byte reserved [8];
- }
- indirected_text;
- }
- title_data;
- wimp_colour title_fg;
- wimp_colour title_bg;
- wimp_colour work_fg;
- wimp_colour work_bg;
- int width;
- int height;
- int gap;
- wimp_menu_entry entries [UNKNOWN];
- };
-
- #define wimp_MENU(N) \
- struct \
- { union \
- { char text [12]; \
- struct \
- { char *text; \
- byte reserved [8]; \
- } \
- indirected_text; \
- } \
- title_data; \
- wimp_colour title_fg; \
- wimp_colour title_bg; \
- wimp_colour work_fg; \
- wimp_colour work_bg; \
- int width; \
- int height; \
- int gap; \
- wimp_menu_entry entries [N]; \
- }
-
- #define wimp_SIZEOF_MENU(N) \
- (offsetof (wimp_menu, entries) + \
- (N)*sizeof ((wimp_menu *) NULL)->entries)
-
- struct wimp_message_data_xfer
- { wimp_w w;
- wimp_i i;
- os_coord pos;
- int est_size;
- bits file_type;
- char file_name [212];
- };
-
- struct wimp_message_ram_xfer
- { byte *addr;
- int size;
- };
-
- struct wimp_message_prequit
- { bits flags;
- };
-
- struct wimp_message_save_desktop
- { os_f file;
- byte reserved [3];
- bits flags;
- };
-
- struct wimp_message_device
- { int major;
- int minor;
- char info [228];
- };
-
- struct wimp_message_data_saved
- { int ref;
- };
-
- struct wimp_message_shutdown
- { bits flags;
- };
-
- struct wimp_message_claim_entity
- { bits flags;
- };
-
- struct wimp_message_data_request
- { wimp_w w;
- wimp_i i;
- os_coord pos;
- bits flags;
- bits file_types [54];
- };
-
- struct wimp_message_dragging
- { wimp_w w;
- wimp_i i;
- os_coord pos;
- bits flags;
- os_box box;
- bits file_types [50];
- };
-
- struct wimp_message_drag_claim
- { bits flags;
- bits file_types [58];
- };
-
- struct wimp_message_menu_warning
- { wimp_menu *sub_menu;
- os_coord pos;
- wimp_selection selection;
- };
-
- struct wimp_message_task_initialise
- { byte *cao;
- int size;
- char task_name [228];
- };
-
- struct wimp_message_slot_size
- { int new_curr;
- int new_next;
- };
-
- struct wimp_message_set_slot
- { int new_curr;
- wimp_t task;
- };
-
- struct wimp_message_task_name_rq
- { wimp_t task;
- };
-
- struct wimp_message_task_name_is
- { wimp_t task;
- int size;
- char task_name [228];
- };
-
- struct wimp_message_menus_deleted
- { wimp_menu *menu;
- };
-
- struct wimp_message_iconise
- { wimp_w w;
- wimp_t task;
- char title [20];
- };
-
- struct wimp_message_window_closed
- { wimp_w w;
- };
-
- struct wimp_message_window_info
- { wimp_w w;
- int reserved;
- char sprite_name [8];
- char title [20];
- };
-
- struct wimp_message_font_changed
- { font_f font;
- };
-
- struct wimp_message
- { int size;
- wimp_t sender;
- int my_ref;
- int your_ref;
- bits action;
- union
- { wimp_message_data_xfer data_xfer;
- wimp_message_ram_xfer ram_xfer;
- wimp_message_prequit prequit;
- wimp_message_save_desktop save_desktop;
- wimp_message_device device;
- wimp_message_data_saved data_saved;
- wimp_message_shutdown shutdown;
- wimp_message_claim_entity claim_entity;
- wimp_message_data_request data_request;
- wimp_message_dragging dragging;
- wimp_message_drag_claim drag_claim;
- byte reserved [236];
- }
- data;
- };
-
- union wimp_block
- { wimp_draw redraw;
- wimp_open open;
- wimp_close close;
- wimp_leaving leaving;
- wimp_entering entering;
- wimp_pointer pointer;
- wimp_dragged dragged;
- wimp_key key;
- wimp_selection selection;
- wimp_scroll scroll;
- wimp_caret caret;
- wimp_pollword pollword;
- wimp_message message;
- byte reserved [256];
- };
-
- struct wimp_message_list
- { int messages [UNKNOWN];
- };
-
- #define wimp_MESSAGE_LIST(N) \
- struct \
- { int messages [N]; \
- }
-
- #define wimp_SIZEOF_MESSAGE_LIST(N) \
- ((N)*sizeof ((wimp_message_list *) NULL)->messages)
-
- /************************
- * Constant definitions *
- ************************/
- #define wimp_VERSION_RO2 200
- #define wimp_VERSION_RO3 310
- #define wimp_ICON_NAME_LIMIT 12
- #define wimp_TEMPLATE_NAME_LIMIT 12
- #define wimp_MENU_NAME_LIMIT 12
- #define wimp_MENU_DEPTH_LIMIT 8
- #define wimp_CHAR_XSIZE 16
- #define wimp_CHAR_YSIZE 32
- #define wimp_NULL_REASON_CODE 0
- #define wimp_REDRAW_WINDOW_REQUEST 1
- #define wimp_OPEN_WINDOW_REQUEST 2
- #define wimp_CLOSE_WINDOW_REQUEST 3
- #define wimp_POINTER_LEAVING_WINDOW 4
- #define wimp_POINTER_ENTERING_WINDOW 5
- #define wimp_MOUSE_CLICK 6
- #define wimp_USER_DRAG_BOX 7
- #define wimp_KEY_PRESSED 8
- #define wimp_MENU_SELECTION 9
- #define wimp_SCROLL_REQUEST 10
- #define wimp_LOSE_CARET 11
- #define wimp_GAIN_CARET 12
- #define wimp_POLLWORD_NON_ZERO 13
- #define wimp_USER_MESSAGE 17
- #define wimp_USER_MESSAGE_RECORDED 18
- #define wimp_USER_MESSAGE_ACKNOWLEDGE 19
- #define wimp_POLL_WORD 22
- #define wimp_POLLWORD_PRIORITY 23
- #define wimp_FP 24
- #define wimp_MASK_NULL 0x1u
- #define wimp_QUEUE_REDRAW 0x2u
- #define wimp_MASK_LEAVING 0x10u
- #define wimp_MASK_ENTERING 0x20u
- #define wimp_QUEUE_MOUSE 0x40u
- #define wimp_QUEUE_KEY 0x100u
- #define wimp_MASK_LOSE 0x800u
- #define wimp_MASK_GAIN 0x1000u
- #define wimp_MASK_POLLWORD 0x2000u
- #define wimp_MASK_MESSAGE 0x20000u
- #define wimp_MASK_RECORDED 0x40000u
- #define wimp_MASK_ACKNOWLEDGE 0x80000u
- #define wimp_GIVEN_POLLWORD 0x400000u
- #define wimp_POLL_HIGH_PRIORITY 0x800000u
- #define wimp_SAVE_FP 0x1000000u
- #define wimp_BROADCAST ((wimp_t) 0)
- #define wimp_BACKGROUND ((wimp_w) -1)
- #define wimp_ICON_BAR ((wimp_w) -2)
- #define wimp_ICON_BAR_RIGHT ((wimp_w) -1)
- #define wimp_ICON_BAR_LEFT ((wimp_w) -2)
- #define wimp_ICON_BAR_LEFT_RELATIVE ((wimp_w) -3)
- #define wimp_ICON_BAR_RIGHT_RELATIVE ((wimp_w) -4)
- #define wimp_ICON_BAR_LEFT_HIGH_PRIORITY ((wimp_w) -5)
- #define wimp_ICON_BAR_LEFT_LOW_PRIORITY ((wimp_w) -6)
- #define wimp_ICON_BAR_RIGHT_LOW_PRIORITY ((wimp_w) -7)
- #define wimp_ICON_BAR_RIGHT_HIGH_PRIORITY ((wimp_w) -8)
- #define wimp_TOP ((wimp_w) -1)
- #define wimp_BOTTOM ((wimp_w) -2)
- #define wimp_NO_ICON ((wimp_w) -1)
- #define wimp_ICON_WINDOW ((wimp_i) -1)
- #define wimp_ICON_BACK ((wimp_i) -2)
- #define wimp_ICON_CLOSE ((wimp_i) -3)
- #define wimp_ICON_TITLE ((wimp_i) -4)
- #define wimp_ICON_TOGGLE ((wimp_i) -5)
- #define wimp_ICON_SCROLL_UP ((wimp_i) -6)
- #define wimp_ICON_VSCROLL ((wimp_i) -7)
- #define wimp_ICON_SCROLL_DOWN ((wimp_i) -8)
- #define wimp_ICON_SIZE ((wimp_i) -9)
- #define wimp_ICON_SCROLL_LEFT ((wimp_i) -10)
- #define wimp_ICON_HSCROLL ((wimp_i) -11)
- #define wimp_ICON_SCROLL_RIGHT ((wimp_i) -12)
- #define wimp_ICON_FRAME ((wimp_i) -13)
- #define wimp_WINDOW_MOVEABLE 0x2u
- #define wimp_WINDOW_AUTO_REDRAW 0x10u
- #define wimp_WINDOW_PANE 0x20u
- #define wimp_WINDOW_NO_BOUNDS 0x40u
- #define wimp_WINDOW_SCROLL_REPEAT 0x100u
- #define wimp_WINDOW_SCROLL 0x200u
- #define wimp_WINDOW_REAL_COLOURS 0x400u
- #define wimp_WINDOW_BACK 0x800u
- #define wimp_WINDOW_HOT_KEYS 0x1000u
- #define wimp_WINDOW_BOUNDED 0x2000u
- #define wimp_WINDOW_IGNORE_XEXTENT 0x4000u
- #define wimp_WINDOW_IGNORE_YEXTENT 0x8000u
- #define wimp_WINDOW_OPEN 0x10000u
- #define wimp_WINDOW_NOT_COVERED 0x20000u
- #define wimp_WINDOW_FULL_SIZE 0x40000u
- #define wimp_WINDOW_TOGGLED 0x80000u
- #define wimp_WINDOW_HAS_FOCUS 0x100000u
- #define wimp_WINDOW_BOUNDED_ONCE 0x200000u
- #define wimp_WINDOW_BACK_ICON 0x1000000u
- #define wimp_WINDOW_CLOSE_ICON 0x2000000u
- #define wimp_WINDOW_TITLE_ICON 0x4000000u
- #define wimp_WINDOW_TOGGLE_ICON 0x8000000u
- #define wimp_WINDOW_VSCROLL 0x10000000u
- #define wimp_WINDOW_SIZE_ICON 0x20000000u
- #define wimp_WINDOW_HSCROLL 0x40000000u
- #define wimp_WINDOW_NEW_FORMAT 0x80000000u
- #define wimp_ICON_TEXT 0x1u
- #define wimp_ICON_SPRITE 0x2u
- #define wimp_ICON_BORDER 0x4u
- #define wimp_ICON_HCENTRED 0x8u
- #define wimp_ICON_VCENTRED 0x10u
- #define wimp_ICON_FILLED 0x20u
- #define wimp_ICON_ANTI_ALIASED 0x40u
- #define wimp_ICON_NEEDS_HELP 0x80u
- #define wimp_ICON_INDIRECTED 0x100u
- #define wimp_ICON_RJUSTIFIED 0x200u
- #define wimp_ICON_ALLOW_ADJUST 0x400u
- #define wimp_ICON_HALF_SIZE 0x800u
- #define wimp_ICON_BUTTON_TYPE_SHIFT 12
- #define wimp_ICON_BUTTON_TYPE 0xF000u
- #define wimp_ICON_ESG_SHIFT 16
- #define wimp_ICON_ESG 0x1F0000u
- #define wimp_ICON_SELECTED 0x200000u
- #define wimp_ICON_SHADED 0x400000u
- #define wimp_ICON_DELETED 0x800000u
- #define wimp_ICON_FG_COLOUR_SHIFT 24
- #define wimp_ICON_FG_COLOUR 0xF000000u
- #define wimp_ICON_BG_COLOUR_SHIFT 28
- #define wimp_ICON_BG_COLOUR 0xF0000000u
- #define wimp_ICON_FONT_HANDLE_SHIFT 24
- #define wimp_ICON_FONT_HANDLE 0xFF000000u
- #define wimp_BUTTON_NEVER 0
- #define wimp_BUTTON_ALWAYS 1
- #define wimp_BUTTON_REPEAT 2
- #define wimp_BUTTON_CLICK 3
- #define wimp_BUTTON_RELEASE 4
- #define wimp_BUTTON_DOUBLE_CLICK 5
- #define wimp_BUTTON_CLICK_DRAG 6
- #define wimp_BUTTON_RELEASE_DRAG 7
- #define wimp_BUTTON_DOUBLE_DRAG 8
- #define wimp_BUTTON_MENU_ICON 9
- #define wimp_BUTTON_DOUBLE_CLICK_DRAG 10
- #define wimp_BUTTON_RADIO 11
- #define wimp_BUTTON_WRITE_CLICK_DRAG 14
- #define wimp_BUTTON_WRITABLE 15
- #define wimp_MENU_TICKED 0x1u
- #define wimp_MENU_SEPARATE 0x2u
- #define wimp_MENU_WRITABLE 0x4u
- #define wimp_MENU_GIVE_WARNING 0x8u
- #define wimp_MENU_SUB_MENU_WHEN_SHADED 0x10u
- #define wimp_MENU_LAST 0x80u
- #define wimp_MENU_TITLE_INDIRECTED 0x100u
- #define wimp_CLOSE_MENU ((wimp_menu *) -1)
- #define wimp_NO_SUB_MENU ((wimp_menu *) -1)
- #define wimp_DEFER_SUB_MENU ((wimp_menu *) 1)
- #define wimp_NO_FONTS ((font_f *) -1)
- #define wimp_CLICK_ADJUST 0x1u
- #define wimp_DOUBLE_ADJUST 0x1u
- #define wimp_CLICK_MENU 0x2u
- #define wimp_CLICK_SELECT 0x4u
- #define wimp_DOUBLE_SELECT 0x4u
- #define wimp_DRAG_ADJUST 0x10u
- #define wimp_DRAG_SELECT 0x40u
- #define wimp_SINGLE_ADJUST 0x100u
- #define wimp_SINGLE_SELECT 0x400u
- #define wimp_MENU_ITEM_HEIGHT 44
- #define wimp_MENU_ITEM_GAP 0
- #define wimp_MENU_ITEM_SEPARATION 24
- #define wimp_DRAG_SYSTEM_POSITION 1
- #define wimp_DRAG_SYSTEM_SIZE 2
- #define wimp_DRAG_SYSTEM_HSCROLL 3
- #define wimp_DRAG_SYSTEM_VSCROLL 4
- #define wimp_DRAG_USER_FIXED 5
- #define wimp_DRAG_USER_RUBBER 6
- #define wimp_DRAG_USER_POINT 7
- #define wimp_DRAG_ASM_FIXED 8
- #define wimp_DRAG_ASM_RUBBER 9
- #define wimp_DRAG_ASM_FIXED_INDEFINITE 10
- #define wimp_DRAG_ASM_RUBBER_INDEFINITE 11
- #define wimp_DRAG_SYSTEM_SCROLL_BOTH 12
- #define wimp_KEY_BACKSPACE 8
- #define wimp_KEY_RETURN 13
- #define wimp_KEY_ESCAPE 27
- #define wimp_KEY_HOME 30
- #define wimp_KEY_DELETE 127
- #define wimp_KEY_SHIFT 16
- #define wimp_KEY_CONTROL 32
- #define wimp_KEY_PRINT 384
- #define wimp_KEY_F1 385
- #define wimp_KEY_F2 386
- #define wimp_KEY_F3 387
- #define wimp_KEY_F4 388
- #define wimp_KEY_F5 389
- #define wimp_KEY_F6 390
- #define wimp_KEY_F7 391
- #define wimp_KEY_F8 392
- #define wimp_KEY_F9 393
- #define wimp_KEY_TAB 394
- #define wimp_KEY_COPY 395
- #define wimp_KEY_LEFT 396
- #define wimp_KEY_RIGHT 397
- #define wimp_KEY_F10 458
- #define wimp_KEY_F11 459
- #define wimp_KEY_F12 460
- #define wimp_KEY_INSERT 461
- #define wimp_KEY_DOWN 398
- #define wimp_KEY_UP 399
- #define wimp_KEY_PAGE_DOWN 414
- #define wimp_KEY_PAGE_UP 415
- #define message_QUIT 0x0u
- #define message_DATA_SAVE 0x1u
- #define message_DATA_SAVE_ACK 0x2u
- #define message_DATA_LOAD 0x3u
- #define message_DATA_LOAD_ACK 0x4u
- #define message_DATA_OPEN 0x5u
- #define message_RAM_FETCH 0x6u
- #define message_RAM_TRANSMIT 0x7u
- #define message_PREQUIT 0x8u
- #define message_PALETTE_CHANGE 0x9u
- #define message_SAVE_DESKTOP 0xAu
- #define message_DEVICE_CLAIM 0xBu
- #define message_DEVICE_IN_USE 0xCu
- #define message_DATA_SAVED 0xDu
- #define message_SHUTDOWN 0xEu
- #define message_CLAIM_ENTITY 0xFu
- #define message_DATA_REQUEST 0x10u
- #define message_DRAGGING 0x11u
- #define message_DRAG_CLAIM 0x12u
- #define message_MENU_WARNING 0x400C0u
- #define message_MODE_CHANGE 0x400C1u
- #define message_TASK_INITIALISE 0x400C2u
- #define message_TASK_CLOSE_DOWN 0x400C3u
- #define message_SLOT_SIZE 0x400C4u
- #define message_SET_SLOT 0x400C5u
- #define message_TASK_NAME_RQ 0x400C6u
- #define message_TASK_NAME_IS 0x400C7u
- #define message_TASK_STARTED 0x400C8u
- #define message_MENUS_DELETED 0x400C9u
- #define message_ICONISE 0x400CAu
- #define message_WINDOW_CLOSED 0x400CBu
- #define message_WINDOW_INFO 0x400CCu
- #define message_SWAP 0x400CDu
- #define message_TOOLS_CHANGED 0x400CEu
- #define message_FONT_CHANGED 0x400CFu
- #define wimp_ERROR_BOX_OK_ICON 0x1u
- #define wimp_ERROR_BOX_CANCEL_ICON 0x2u
- #define wimp_ERROR_BOX_HIGHLIGHT_CANCEL 0x4u
- #define wimp_ERROR_BOX_NO_PROMPT 0x8u
- #define wimp_ERROR_BOX_SHORT_TITLE 0x10u
- #define wimp_ERROR_BOX_LEAVE_OPEN 0x20u
- #define wimp_ERROR_BOX_CLOSE 0x40u
- #define wimp_ERROR_BOX_NO_BEEP 0x80u
- #define wimp_ERROR_BOX_GIVEN_CATEGORY 0x100u
- #define wimp_ERROR_BOX_CATEGORY 0xE00u
- #define wimp_ERROR_BOX_CATEGORY_SHIFT 9
- #define wimp_ERROR_BOX_CATEGORY_INFO 0x1u
- #define wimp_ERROR_BOX_CATEGORY_ERROR 0x2u
- #define wimp_ERROR_BOX_CATEGORY_PROGRAM 0x3u
- #define wimp_ERROR_BOX_CATEGORY_QUESTION 0x4u
- #define wimp_ERROR_BOX_SELECTED_NOTHING 0
- #define wimp_ERROR_BOX_SELECTED_OK 1
- #define wimp_ERROR_BOX_SELECTED_CANCEL 2
- #define wimp_COLOUR_WHITE ((wimp_colour) 0)
- #define wimp_COLOUR_VERY_LIGHT_GREY ((wimp_colour) 1)
- #define wimp_COLOUR_LIGHT_GREY ((wimp_colour) 2)
- #define wimp_COLOUR_MID_LIGHT_GREY ((wimp_colour) 3)
- #define wimp_COLOUR_MID_DARK_GREY ((wimp_colour) 4)
- #define wimp_COLOUR_DARK_GREY ((wimp_colour) 5)
- #define wimp_COLOUR_VERY_DARK_GREY ((wimp_colour) 6)
- #define wimp_COLOUR_BLACK ((wimp_colour) 7)
- #define wimp_COLOUR_DARK_BLUE ((wimp_colour) 8)
- #define wimp_COLOUR_YELLOW ((wimp_colour) 9)
- #define wimp_COLOUR_LIGHT_GREEN ((wimp_colour) 10)
- #define wimp_COLOUR_RED ((wimp_colour) 11)
- #define wimp_COLOUR_CREAM ((wimp_colour) 12)
- #define wimp_COLOUR_DARK_GREEN ((wimp_colour) 13)
- #define wimp_COLOUR_ORANGE ((wimp_colour) 14)
- #define wimp_COLOUR_LIGHT_BLUE ((wimp_colour) 15)
- #define wimp_COLOUR_TRANSPARENT ((wimp_colour) -1)
- #define error_WIMP_NO_CLAIM 0x280u
- #define error_WIMP_BAD_OP 0x281u
- #define error_WIMP_RECT_FULL 0x282u
- #define error_WIMP_TOO_MANY 0x283u
- #define error_WIMP_TOO_BIG 0x284u
- #define error_WIMP_DIV_BY0 0x285u
- #define error_WIMP_GET_RECT 0x286u
- #define error_WIMP_FOCUS 0x287u
- #define error_WIMP_BAD_HANDLE 0x288u
- #define error_WIMP_TOO_MENUS 0x289u
- #define error_WIMP_BAD_EXTENT 0x28Au
- #define error_WIMP_BAD_POINTER 0x28Bu
- #define error_WIMP_NO_TEMPLATE_FILE 0x28Cu
- #define error_WIMP_BAD_TEMPLATE 0x28Du
- #define error_WIMP_BAD_FONTS 0x28Eu
- #define error_WIMP_BAD_SYNTAX 0x28Fu
- #define error_WIMP_NO_TASKS 0x290u
- #define error_WIMP_NO_TEMPLATE 0x291u
- #define error_WIMP_NOT_PRESENT 0x292u
- #define error_WIMP_IN_USE 0x293u
- #define error_WIMP_BAD_PAL_FILE 0x294u
- #define error_WIMP_BAD_VERSION 0x295u
- #define error_WIMP_BAD_MESSAGE_SIZE 0x296u
- #define error_WIMP_BAD_REASON_CODE 0x297u
- #define error_WIMP_BAD_TASK_HANDLE 0x298u
- #define error_WIMP_CANT_TASK 0x299u
- #define error_WIMP_BAD_SUB_MENU 0x29Au
- #define error_WIMP_OWNER_WINDOW 0x29Bu
- #define error_WIMP_BAD_MODE 0x29Cu
- #define error_WIMP_BAD_TRANSFER 0x29Du
- #define error_WIMP_BAD_SYS_INFO 0x29Eu
- #define error_WIMP_BAD_PTR_IN_R1 0x29Fu
- #define error_WIMP_BAD_ESCAPE_STATE 0x2A0u
- #define error_WIMP_BAD_ICON_HANDLE 0x2A1u
- #define error_WIMP_BAD_R3 0x2A2u
- #define error_WIMP_NO_DOT_IN_FILENAME 0x2A3u
- #define error_WIMP_TEMPLATE_EOF 0x2A4u
- #define error_WIMP_BAD_SLOT 0x2A5u
- #define error_WIMP_BAD_CONF_FONT 0x2A6u
- #define error_WIMP_NO_SPRITES 0x2A7u
- #define error_WIMP_BAD_PAL_FILE2 0x2A8u
- #define error_WIMP_BAD_SPRITES 0x2A9u
- #define wimp_PRIORITY_TASK_MANAGER 0x60000000u
- #define wimp_PRIORITY_PALETTE_UTILITY 0x20000000u
- #define wimp_PRIORITY_ADFS_FILER_HARD_DISCS 0x70000000u
- #define wimp_PRIORITY_ADFS_FILER_FLOPPY_DISCS 0x60000000u
- #define wimp_PRIORITY_RESOURCE_FILER 0x50000000u
- #define wimp_PRIORITY_RAMFS_FILER 0x40000000u
- #define wimp_PRIORITY_NFS_FILER 0x30000000u
- #define wimp_PRIORITY_NET_FILER 0x20000000u
- #define wimp_PRIORITY_PRINTERS 0xF000000u
- #define wimp_PRIORITY_TINY_DIRS 0xC0000000u
- #define wimp_DEFAULT_PALETTE ((os_palette *) -1)
- #define wimp_PALETTE ((os_palette *) 0)
- #define wimptextop_RJUSTIFY 0x40000000u
- #define wimptextop_GIVEN_BASELINE 0x80000000u
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*************************************************************
- * NOTE: The following functions provide direct access to *
- * the SWI's noted in the function description. *
- * Please read the relevant PRM section for more *
- * information on their input/output parameters. *
- *************************************************************/
-
- /* ------------------------------------------------------------------------
- * Function: wimp_initialise()
- *
- * Description: Registers a task with the Wimp
- *
- * Input: version - value of R0 on entry
- * name - value of R2 on entry
- * messages - value of R3 on entry
- *
- * Output: version_out - value of R0 on exit
- * task_out - value of R1 on exit (X version only)
- *
- * Returns: R1 (non-X version only)
- *
- * Other notes: Calls SWI 0x400C0 with R1 = 0x4B534154.
- */
-
- extern os_error *xwimp_initialise (int version,
- char *name,
- wimp_message_list *messages,
- int *version_out,
- wimp_t *task_out);
- extern wimp_t wimp_initialise (int version,
- char *name,
- wimp_message_list *messages,
- int *version_out);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_create_window()
- *
- * Description: Tells the Wimp what the characteristics of a window are
- *
- * Input: window - value of R1 on entry
- *
- * Output: w - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x400C1.
- */
-
- extern os_error *xwimp_create_window (wimp_window *window,
- wimp_w *w);
- extern wimp_w wimp_create_window (wimp_window *window);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_create_icon()
- *
- * Description: Tells the Wimp what the characteristics of an icon are
- *
- * Input: icon - value of R1 on entry
- *
- * Output: i - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x400C2.
- */
-
- extern os_error *xwimp_create_icon (wimp_icon_create *icon,
- wimp_i *i);
- extern wimp_i wimp_create_icon (wimp_icon_create *icon);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_create_icon_relative()
- *
- * Description: Tells the Wimp what the characteristics of an iconbar
- * icon with a fixed relative position are
- *
- * Input: neighbour - value of R0 on entry
- * icon - value of R1 on entry
- *
- * Output: i - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x400C2.
- */
-
- extern os_error *xwimp_create_icon_relative (wimp_i neighbour,
- wimp_icon_create *icon,
- wimp_i *i);
- extern wimp_i wimp_create_icon_relative (wimp_i neighbour,
- wimp_icon_create *icon);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_create_icon_prioritised()
- *
- * Description: Tells the Wimp what the characteristics of an iconbar
- * icon with a fixed priority are
- *
- * Input: priority - value of R0 on entry
- * icon - value of R1 on entry
- *
- * Output: i - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x400C2.
- */
-
- extern os_error *xwimp_create_icon_prioritised (int priority,
- wimp_icon_create *icon,
- wimp_i *i);
- extern wimp_i wimp_create_icon_prioritised (int priority,
- wimp_icon_create *icon);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_delete_window()
- *
- * Description: Closes a specified window if it is still open, and then
- * removes its definition
- *
- * Input: w - component 0
- *
- * Other notes: Calls SWI 0x400C3.
- */
-
- extern os_error *xwimp_delete_window (wimp_w w);
- extern void wimp_delete_window (wimp_w w);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_delete_icon()
- *
- * Description: Removes the definition of a specified icon
- *
- * Input: w - component 0
- * i - component 1
- *
- * Other notes: Calls SWI 0x400C4.
- */
-
- extern os_error *xwimp_delete_icon (wimp_w w,
- wimp_i i);
- extern void wimp_delete_icon (wimp_w w,
- wimp_i i);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_open_window()
- *
- * Description: Updates the list of active windows (ones that are to be
- * displayed)
- *
- * Input: open - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400C5.
- */
-
- extern os_error *xwimp_open_window (wimp_open *open);
- extern void wimp_open_window (wimp_open *open);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_close_window()
- *
- * Description: Removes the specified window from the active list
- *
- * Input: w - component 0
- *
- * Other notes: Calls SWI 0x400C6.
- */
-
- extern os_error *xwimp_close_window (wimp_w w);
- extern void wimp_close_window (wimp_w w);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_poll()
- *
- * Description: Polls the Wimp to see whether certain events have
- * occurred
- *
- * Input: mask - value of R0 on entry
- * block - value of R1 on entry
- * pollword - value of R3 on entry
- *
- * Output: event - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x400C7.
- */
-
- extern os_error *xwimp_poll (bits mask,
- wimp_block *block,
- int *pollword,
- int *event);
- extern int wimp_poll (bits mask,
- wimp_block *block,
- int *pollword);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_redraw_window()
- *
- * Description: Starts a redraw of the parts of a window that are not up
- * to date
- *
- * Input: redraw - value of R1 on entry
- *
- * Output: more - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x400C8.
- */
-
- extern os_error *xwimp_redraw_window (wimp_draw *redraw,
- bool *more);
- extern bool wimp_redraw_window (wimp_draw *redraw);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_update_window()
- *
- * Description: Starts a redraw of the parts of a window that are up to
- * date
- *
- * Input: update - value of R1 on entry
- *
- * Output: more - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x400C9.
- */
-
- extern os_error *xwimp_update_window (wimp_draw *update,
- bool *more);
- extern bool wimp_update_window (wimp_draw *update);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_get_rectangle()
- *
- * Description: Returns the details of the next rectangle of the work
- * area to be drawn
- *
- * Input: draw - value of R1 on entry
- *
- * Output: more - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x400CA.
- */
-
- extern os_error *xwimp_get_rectangle (wimp_draw *draw,
- bool *more);
- extern bool wimp_get_rectangle (wimp_draw *draw);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_get_window_state()
- *
- * Description: Returns a summary of the given window's state
- *
- * Input: state - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400CB.
- */
-
- extern os_error *xwimp_get_window_state (wimp_window_state *state);
- extern void wimp_get_window_state (wimp_window_state *state);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_get_window_info()
- *
- * Description: Returns complete details of the given window's state
- *
- * Input: info - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400CC.
- */
-
- extern os_error *xwimp_get_window_info (wimp_window_info *info);
- extern void wimp_get_window_info (wimp_window_info *info);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_get_window_info_header_only()
- *
- * Description: Returns complete details of the given window's state,
- * excluding icons
- *
- * Input: info - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400CC with R1 |= 0x1.
- */
-
- extern os_error *xwimp_get_window_info_header_only (wimp_window_info *info);
- extern void wimp_get_window_info_header_only (wimp_window_info *info);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_set_icon_state()
- *
- * Description: Sets a given icon's state held in its flags word
- *
- * Input: w - component 0
- * i - component 1
- * eor_bits - component 2
- * clear_bits - component 3
- *
- * Other notes: Calls SWI 0x400CD.
- */
-
- extern os_error *xwimp_set_icon_state (wimp_w w,
- wimp_i i,
- bits eor_bits,
- bits clear_bits);
- extern void wimp_set_icon_state (wimp_w w,
- wimp_i i,
- bits eor_bits,
- bits clear_bits);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_get_icon_state()
- *
- * Description: Returns a given icon's state held in its flags word
- *
- * Input: icon_state - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400CE.
- */
-
- extern os_error *xwimp_get_icon_state (wimp_icon_state *icon_state);
- extern void wimp_get_icon_state (wimp_icon_state *icon_state);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_get_pointer_info()
- *
- * Description: Returns the position of the pointer and the state of the
- * mouse buttons
- *
- * Input: pointer - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400CF.
- */
-
- extern os_error *xwimp_get_pointer_info (wimp_pointer *pointer);
- extern void wimp_get_pointer_info (wimp_pointer *pointer);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_drag_box()
- *
- * Description: Initiates a dragging operation
- *
- * Input: drag - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400D0.
- */
-
- extern os_error *xwimp_drag_box (wimp_drag *drag);
- extern void wimp_drag_box (wimp_drag *drag);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_force_redraw()
- *
- * Description: Forces an area of a window or the screen to be redrawn
- * later
- *
- * Input: w - value of R0 on entry
- * x0 - value of R1 on entry
- * y0 - value of R2 on entry
- * x1 - value of R3 on entry
- * y1 - value of R4 on entry
- *
- * Other notes: Calls SWI 0x400D1.
- */
-
- extern os_error *xwimp_force_redraw (wimp_w w,
- int x0,
- int y0,
- int x1,
- int y1);
- extern void wimp_force_redraw (wimp_w w,
- int x0,
- int y0,
- int x1,
- int y1);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_set_caret_position()
- *
- * Description: Sets up the data for a new caret position, and redraws it
- * there
- *
- * Input: w - value of R0 on entry
- * i - value of R1 on entry
- * x - value of R2 on entry
- * y - value of R3 on entry
- * height - value of R4 on entry
- * index - value of R5 on entry
- *
- * Other notes: Calls SWI 0x400D2.
- */
-
- extern os_error *xwimp_set_caret_position (wimp_w w,
- wimp_i i,
- int x,
- int y,
- int height,
- int index);
- extern void wimp_set_caret_position (wimp_w w,
- wimp_i i,
- int x,
- int y,
- int height,
- int index);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_get_caret_position()
- *
- * Description: Returns details of the caret's state
- *
- * Input: caret - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400D3.
- */
-
- extern os_error *xwimp_get_caret_position (wimp_caret *caret);
- extern void wimp_get_caret_position (wimp_caret *caret);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_create_menu()
- *
- * Description: Creates a menu structure
- *
- * Input: menu - value of R1 on entry
- * x - value of R2 on entry
- * y - value of R3 on entry
- *
- * Other notes: Calls SWI 0x400D4.
- */
-
- extern os_error *xwimp_create_menu (wimp_menu *menu,
- int x,
- int y);
- extern void wimp_create_menu (wimp_menu *menu,
- int x,
- int y);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_decode_menu()
- *
- * Description: Converts a numerical list of menu selections to a string
- * containing their text
- *
- * Input: menu - value of R1 on entry
- * selection - value of R2 on entry
- * decode - value of R3 on entry
- *
- * Other notes: Calls SWI 0x400D5.
- */
-
- extern os_error *xwimp_decode_menu (wimp_menu *menu,
- wimp_selection *selection,
- char *decode);
- extern void wimp_decode_menu (wimp_menu *menu,
- wimp_selection *selection,
- char *decode);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_which_icon()
- *
- * Description: Searches for icons that match a given flags word
- *
- * Input: w - value of R0 on entry
- * which - value of R1 on entry
- * mask - value of R2 on entry
- * match - value of R3 on entry
- *
- * Other notes: Calls SWI 0x400D6.
- */
-
- extern os_error *xwimp_which_icon (wimp_w w,
- wimp_i *which,
- bits mask,
- bits match);
- extern void wimp_which_icon (wimp_w w,
- wimp_i *which,
- bits mask,
- bits match);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_set_extent()
- *
- * Description: Sets the work area extent of a given window
- *
- * Input: w - value of R0 on entry
- * box - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400D7.
- */
-
- extern os_error *xwimp_set_extent (wimp_w w,
- os_box *box);
- extern void wimp_set_extent (wimp_w w,
- os_box *box);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_set_pointer_shape()
- *
- * Description: Sets the shape and active point of the pointer (prefer
- * WimpSpriteOp_SetPointerShape
- *
- * Input: shape_no - value of R0 on entry
- * shape_data - value of R1 on entry
- * width - value of R2 on entry
- * height - value of R3 on entry
- * xactive - value of R4 on entry
- * yactive - value of R5 on entry
- *
- * Other notes: Calls SWI 0x400D8.
- */
-
- extern os_error *xwimp_set_pointer_shape (int shape_no,
- byte *shape_data,
- int width,
- int height,
- int xactive,
- int yactive);
- extern void wimp_set_pointer_shape (int shape_no,
- byte *shape_data,
- int width,
- int height,
- int xactive,
- int yactive);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_open_template()
- *
- * Description: Opens a specified template file
- *
- * Input: file_name - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400D9.
- */
-
- extern os_error *xwimp_open_template (char *file_name);
- extern void wimp_open_template (char *file_name);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_close_template()
- *
- * Description: Closes the currently open template file
- *
- * Other notes: Calls SWI 0x400DA.
- */
-
- extern os_error *xwimp_close_template (void);
- extern void wimp_close_template (void);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_load_template()
- *
- * Description: Loads a template
- *
- * Input: window - value of R1 on entry
- * data - value of R2 on entry
- * end - value of R3 on entry
- * font_ref - value of R4 on entry
- * name - value of R5 on entry
- * context - value of R6 on entry
- *
- * Output: used - value of R1 on exit
- * data_used - value of R2 on exit
- * context_out - value of R6 on exit (X version only)
- *
- * Returns: R6 (non-X version only)
- *
- * Other notes: Calls SWI 0x400DB.
- */
-
- extern os_error *xwimp_load_template (wimp_window *window,
- char *data,
- char *end,
- font_f *font_ref,
- char *name,
- int context,
- int *used,
- int *data_used,
- int *context_out);
- extern int wimp_load_template (wimp_window *window,
- char *data,
- char *end,
- font_f *font_ref,
- char *name,
- int context,
- int *used,
- int *data_used);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_process_key()
- *
- * Description: Creates or passes on key presses
- *
- * Input: c - value of R0 on entry
- *
- * Other notes: Calls SWI 0x400DC.
- */
-
- extern os_error *xwimp_process_key (int c);
- extern void wimp_process_key (int c);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_close_down()
- *
- * Description: Informs the Wimp that a task is about to terminate
- *
- * Input: t - value of R0 on entry
- *
- * Other notes: Calls SWI 0x400DD with R1 = 0x4B534154.
- */
-
- extern os_error *xwimp_close_down (wimp_t t);
- extern void wimp_close_down (wimp_t t);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_start_task()
- *
- * Description: Starts a 'child' task from within another program
- *
- * Input: command - value of R0 on entry
- *
- * Output: t - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x400DE.
- */
-
- extern os_error *xwimp_start_task (char *command,
- wimp_t *t);
- extern wimp_t wimp_start_task (char *command);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_report_error()
- *
- * Description: Reports an error
- *
- * Input: error - value of R0 on entry
- * flags - value of R1 on entry
- * name - value of R2 on entry
- *
- * Output: click - value of R1 on exit (X version only)
- *
- * Returns: R1 (non-X version only)
- *
- * Other notes: Calls SWI 0x400DF.
- */
-
- extern os_error *xwimp_report_error (os_error *error,
- bits flags,
- char *name,
- bits *click);
- extern bits wimp_report_error (os_error *error,
- bits flags,
- char *name);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_report_error_by_category()
- *
- * Description: Reports an error of a given category
- *
- * Input: error - value of R0 on entry
- * flags - value of R1 on entry
- * name - value of R2 on entry
- * sprite_name - value of R3 on entry
- * area - value of R4 on entry
- * buttons - value of R5 on entry
- *
- * Output: click - value of R1 on exit (X version only)
- *
- * Returns: R1 (non-X version only)
- *
- * Other notes: Calls SWI 0x400DF with R1 |= 0x100.
- */
-
- extern os_error *xwimp_report_error_by_category (os_error *error,
- bits flags,
- char *name,
- char *sprite_name,
- osspriteop_area *area,
- char *buttons,
- bits *click);
- extern bits wimp_report_error_by_category (os_error *error,
- bits flags,
- char *name,
- char *sprite_name,
- osspriteop_area *area,
- char *buttons);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_get_window_outline()
- *
- * Description: Gets the bounding box for a window
- *
- * Input: outline - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400E0.
- */
-
- extern os_error *xwimp_get_window_outline (wimp_outline *outline);
- extern void wimp_get_window_outline (wimp_outline *outline);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_poll_idle()
- *
- * Description: Polls the Wimp, sleeping unless certain events have
- * occurred
- *
- * Input: mask - value of R0 on entry
- * block - value of R1 on entry
- * t - value of R2 on entry
- * pollword - value of R3 on entry
- *
- * Output: event - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x400E1.
- */
-
- extern os_error *xwimp_poll_idle (bits mask,
- wimp_block *block,
- os_t t,
- int *pollword,
- int *event);
- extern int wimp_poll_idle (bits mask,
- wimp_block *block,
- os_t t,
- int *pollword);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_plot_icon()
- *
- * Description: Plots an icon in a window during a window redraw or
- * update loop
- *
- * Input: icon - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400E2.
- */
-
- extern os_error *xwimp_plot_icon (wimp_icon *icon);
- extern void wimp_plot_icon (wimp_icon *icon);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_set_mode()
- *
- * Description: Changes the display mode used by the Wimp
- *
- * Input: mode - value of R0 on entry
- *
- * Other notes: Calls SWI 0x400E3.
- */
-
- extern os_error *xwimp_set_mode (os_mode mode);
- extern void wimp_set_mode (os_mode mode);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_set_palette()
- *
- * Description: Sets the palette
- *
- * Input: palette - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400E4.
- */
-
- extern os_error *xwimp_set_palette (os_palette *palette);
- extern void wimp_set_palette (os_palette *palette);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_read_palette()
- *
- * Description: Reads the palette
- *
- * Input: palette - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400E5 with R2 = 0x0.
- */
-
- extern os_error *xwimp_read_palette (os_palette *palette);
- extern void wimp_read_palette (os_palette *palette);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_read_true_palette()
- *
- * Description: Reads the palette, returning true colour values
- *
- * Input: palette - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400E5 with R2 = 0x45555254.
- */
-
- extern os_error *xwimp_read_true_palette (os_palette *palette);
- extern void wimp_read_true_palette (os_palette *palette);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_set_colour()
- *
- * Description: Sets the current graphics foreground or background colour
- * and action
- *
- * Input: colour - value of R0 on entry
- *
- * Other notes: Calls SWI 0x400E6.
- */
-
- extern os_error *xwimp_set_colour (int colour);
- extern void wimp_set_colour (int colour);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_send_message()
- *
- * Description: Sends a message to a task, or broadcasts to all tasks
- *
- * Input: event - value of R0 on entry
- * message - value of R1 on entry
- * to - value of R2 on entry
- *
- * Other notes: Calls SWI 0x400E7.
- */
-
- extern os_error *xwimp_send_message (int event,
- wimp_message *message,
- wimp_t to);
- extern void wimp_send_message (int event,
- wimp_message *message,
- wimp_t to);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_send_message_to_window()
- *
- * Description: Sends a message to the task that created a window
- *
- * Input: event - value of R0 on entry
- * message - value of R1 on entry
- * to_w - value of R2 on entry
- * to_i - value of R3 on entry
- *
- * Output: to_t - value of R2 on exit (X version only)
- *
- * Returns: R2 (non-X version only)
- *
- * Other notes: Calls SWI 0x400E7.
- */
-
- extern os_error *xwimp_send_message_to_window (int event,
- wimp_message *message,
- wimp_w to_w,
- wimp_i to_i,
- wimp_t *to_t);
- extern wimp_t wimp_send_message_to_window (int event,
- wimp_message *message,
- wimp_w to_w,
- wimp_i to_i);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_create_sub_menu()
- *
- * Description: Creates a submenu
- *
- * Input: sub_menu - value of R1 on entry
- * x - value of R2 on entry
- * y - value of R3 on entry
- *
- * Other notes: Calls SWI 0x400E8.
- */
-
- extern os_error *xwimp_create_sub_menu (wimp_menu *sub_menu,
- int x,
- int y);
- extern void wimp_create_sub_menu (wimp_menu *sub_menu,
- int x,
- int y);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_base_of_sprites()
- *
- * Description: Finds the addresses of the ROM and RAM parts of the
- * Wimp's sprite pool
- *
- * Output: rom - value of R0 on exit
- * ram - value of R1 on exit
- *
- * Other notes: Calls SWI 0x400EA.
- */
-
- extern os_error *xwimp_base_of_sprites (osspriteop_area **rom,
- osspriteop_area **ram);
- extern void wimp_base_of_sprites (osspriteop_area **rom,
- osspriteop_area **ram);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_block_copy()
- *
- * Description: Copies a block of work area space to another position
- *
- * Input: w - value of R0 on entry
- * x0 - value of R1 on entry
- * y0 - value of R2 on entry
- * x1 - value of R3 on entry
- * y1 - value of R4 on entry
- * X0 - value of R5 on entry
- * Y0 - value of R6 on entry
- *
- * Other notes: Calls SWI 0x400EB.
- */
-
- extern os_error *xwimp_block_copy (wimp_w w,
- int x0,
- int y0,
- int x1,
- int y1,
- int X0,
- int Y0);
- extern void wimp_block_copy (wimp_w w,
- int x0,
- int y0,
- int x1,
- int y1,
- int X0,
- int Y0);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_slot_size()
- *
- * Description: Reads or sets the size of the current slot, the next
- * slot, and the Wimp free pool
- *
- * Input: new_curr_slot - value of R0 on entry
- * new_next_slot - value of R1 on entry
- *
- * Output: curr_slot - value of R0 on exit
- * next_slot - value of R1 on exit
- * free_slot - value of R2 on exit
- *
- * Other notes: Calls SWI 0x400EC.
- */
-
- extern os_error *xwimp_slot_size (int new_curr_slot,
- int new_next_slot,
- int *curr_slot,
- int *next_slot,
- int *free_slot);
- extern void wimp_slot_size (int new_curr_slot,
- int new_next_slot,
- int *curr_slot,
- int *next_slot,
- int *free_slot);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_read_pix_trans()
- *
- * Description: Reads pixel translation table for a given sprite
- *
- * Input: flags - value of R0 on entry
- * area - value of R1 on entry
- * id - value of R2 on entry
- * factors - value of R6 on entry
- * trans_tab - value of R7 on entry
- *
- * Other notes: Calls SWI 0x400ED.
- */
-
- extern os_error *xwimp_read_pix_trans (bits flags,
- osspriteop_area *area,
- osspriteop_id id,
- os_factors *factors,
- osspriteop_trans_tab *trans_tab);
- extern void wimp_read_pix_trans (bits flags,
- osspriteop_area *area,
- osspriteop_id id,
- os_factors *factors,
- osspriteop_trans_tab *trans_tab);
-
- /* ------------------------------------------------------------------------
- * Function: wimpclaimfreememory_alloc()
- *
- * Description: Claims the whole of the Wimp's free memory pool for the
- * calling task
- *
- * Input: size - value of R1 on entry
- *
- * Output: size_out - value of R1 on exit
- * blk - value of R2 on exit (X version only)
- *
- * Returns: R2 (non-X version only)
- *
- * Other notes: Calls SWI 0x400EE with R0 = 0x1.
- */
-
- extern os_error *xwimpclaimfreememory_alloc (int size,
- int *size_out,
- void **blk);
- extern void *wimpclaimfreememory_alloc (int size,
- int *size_out);
-
- /* ------------------------------------------------------------------------
- * Function: wimpclaimfreememory_free()
- *
- * Description: Releases the Wimp's free memory pool
- *
- * Other notes: Calls SWI 0x400EE with R0 = 0x0.
- */
-
- extern os_error *xwimpclaimfreememory_free (void);
- extern void wimpclaimfreememory_free (void);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_command_window()
- *
- * Description: Opens a text window in which normal VDU 4-type text can
- * be displayed
- *
- * Input: op - value of R0 on entry
- *
- * Other notes: Calls SWI 0x400EF.
- */
-
- extern os_error *xwimp_command_window (char *op);
- extern void wimp_command_window (char *op);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_text_colour()
- *
- * Description: Sets the text foreground or background colour
- *
- * Input: colour - value of R0 on entry
- *
- * Other notes: Calls SWI 0x400F0.
- */
-
- extern os_error *xwimp_text_colour (wimp_colour colour);
- extern void wimp_text_colour (wimp_colour colour);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_transfer_block()
- *
- * Description: Copies a block of memory from one task's address space to
- * another's
- *
- * Input: from_t - value of R0 on entry
- * from - value of R1 on entry
- * to_t - value of R2 on entry
- * to - value of R3 on entry
- * len - value of R4 on entry
- *
- * Other notes: Calls SWI 0x400F1.
- */
-
- extern os_error *xwimp_transfer_block (wimp_t from_t,
- byte *from,
- wimp_t to_t,
- byte *to,
- int len);
- extern void wimp_transfer_block (wimp_t from_t,
- byte *from,
- wimp_t to_t,
- byte *to,
- int len);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_set_font_colours()
- *
- * Description: Sets the anti-aliases font colours from the two (standard
- * Wimp) colours specified
- *
- * Input: fg - value of R1 on entry
- * bg - value of R2 on entry
- *
- * Other notes: Calls SWI 0x400F3.
- */
-
- extern os_error *xwimp_set_font_colours (wimp_colour fg,
- wimp_colour bg);
- extern void wimp_set_font_colours (wimp_colour fg,
- wimp_colour bg);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_get_menu_state()
- *
- * Description: Gets the state of a menu, showing which item is selected
- *
- * Input: flags - value of R0 on entry
- * selection - value of R1 on entry
- * w - value of R2 on entry
- * i - value of R3 on entry
- *
- * Other notes: Calls SWI 0x400F4.
- */
-
- extern os_error *xwimp_get_menu_state (bits flags,
- wimp_selection *selection,
- wimp_w w,
- wimp_i i);
- extern void wimp_get_menu_state (bits flags,
- wimp_selection *selection,
- wimp_w w,
- wimp_i i);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_register_filter()
- *
- * Description: Used by the Filter Manager to register or deregister a
- * filter with the Wimp
- *
- * Input: type - value of R0 on entry
- * filter_code - value of R1 on entry
- * handle - value of R2 on entry
- *
- * Other notes: Calls SWI 0x400F5.
- */
-
- extern os_error *xwimp_register_filter (bits type,
- void *filter_code,
- byte *handle);
- extern void wimp_register_filter (bits type,
- void *filter_code,
- byte *handle);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_add_messages()
- *
- * Description: Adds messages to the list of those known by a certain
- * task
- *
- * Input: messages - value of R0 on entry
- *
- * Other notes: Calls SWI 0x400F6.
- */
-
- extern os_error *xwimp_add_messages (wimp_message_list *messages);
- extern void wimp_add_messages (wimp_message_list *messages);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_remove_messages()
- *
- * Description: Removes messages from the list of those known by a
- * certain task
- *
- * Input: messages - value of R0 on entry
- *
- * Other notes: Calls SWI 0x400F7.
- */
-
- extern os_error *xwimp_remove_messages (wimp_message_list *messages);
- extern void wimp_remove_messages (wimp_message_list *messages);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_set_colour_mapping()
- *
- * Description: Changes the mapping between Wimp colours and physical
- * colours
- *
- * Input: palette - value of R1 on entry
- * map2 - value of R2 on entry
- * map4 - value of R3 on entry
- * map16 - value of R4 on entry
- *
- * Other notes: Calls SWI 0x400F8 with R5 = 0x0, R6 = 0x0, R7 = 0x0.
- */
-
- extern os_error *xwimp_set_colour_mapping (os_palette *palette,
- byte *map2,
- byte *map4,
- byte *map16);
- extern void wimp_set_colour_mapping (os_palette *palette,
- byte *map2,
- byte *map4,
- byte *map16);
-
- /* ------------------------------------------------------------------------
- * Function: wimptextop_set_colour()
- *
- * Description: Sets the colour to use for text plotting with
- * WimpTextOp_Paint
- *
- * Input: fg - value of R1 on entry
- * bg - value of R2 on entry
- *
- * Other notes: Calls SWI 0x400F9 with R0 = 0x0.
- */
-
- extern os_error *xwimptextop_set_colour (os_colour fg,
- os_colour bg);
- extern void wimptextop_set_colour (os_colour fg,
- os_colour bg);
-
- /* ------------------------------------------------------------------------
- * Function: wimptextop_string_width()
- *
- * Description: Gets the width of a string for the current desktop font
- *
- * Input: s - value of R1 on entry
- * len - value of R2 on entry
- *
- * Output: width - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x400F9 with R0 = 0x1.
- */
-
- extern os_error *xwimptextop_string_width (char *s,
- int len,
- int *width);
- extern int wimptextop_string_width (char *s,
- int len);
-
- /* ------------------------------------------------------------------------
- * Function: wimptextop_paint()
- *
- * Description: Plots text on the screen using the current desktop font
- *
- * Input: flags - value of R0 on entry
- * s - value of R1 on entry
- * x0 - value of R4 on entry
- * y0 - value of R5 on entry
- *
- * Other notes: Calls SWI 0x400F9 with R0 |= 0x2, R2 = 0xFFFFFFFF, R3 = 0xFFFFFFFF.
- */
-
- extern os_error *xwimptextop_paint (bits flags,
- char *s,
- int x0,
- int y0);
- extern void wimptextop_paint (bits flags,
- char *s,
- int x0,
- int y0);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_set_watchdog_state()
- *
- * Description: Sets the state of the Wimp's watchdog
- *
- * Input: enable - value of R0 on entry
- * code_word - value of R1 on entry
- *
- * Other notes: Calls SWI 0x400FA.
- */
-
- extern os_error *xwimp_set_watchdog_state (bool enable,
- int code_word);
- extern void wimp_set_watchdog_state (bool enable,
- int code_word);
-
- /* ------------------------------------------------------------------------
- * Function: wimp_resize_icon()
- *
- * Description: Changes the bounding box of an icon
- *
- * Input: w - value of R0 on entry
- * i - value of R1 on entry
- * x0 - value of R2 on entry
- * y0 - value of R3 on entry
- * x1 - value of R4 on entry
- * y1 - value of R5 on entry
- *
- * Other notes: Calls SWI 0x400FC.
- */
-
- extern os_error *xwimp_resize_icon (wimp_w w,
- wimp_i i,
- int x0,
- int y0,
- int x1,
- int y1);
- extern void wimp_resize_icon (wimp_w w,
- wimp_i i,
- int x0,
- int y0,
- int x1,
- int y1);
-
- /* ------------------------------------------------------------------------
- * Function: service_memory()
- *
- * Description: Memory controller about to be remapped
- *
- * Input: change - value of R0 on entry
- * cao - value of R2 on entry
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x11.
- */
-
- extern os_error *xservice_memory (int change,
- byte *cao);
- extern void service_memory (int change,
- byte *cao);
-
- /* ------------------------------------------------------------------------
- * Function: service_start_wimp()
- *
- * Description: Start up any resident module tasks using Wimp_StartTask
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x49.
- */
-
- extern os_error *xservice_start_wimp (void);
- extern void service_start_wimp (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_started_wimp()
- *
- * Description: Request to task modules to set task_handle variable to 0
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x4A.
- */
-
- extern os_error *xservice_started_wimp (void);
- extern void service_started_wimp (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_mouse_trap()
- *
- * Description: The Wimp has detected a significant mouse movement
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x52.
- */
-
- extern os_error *xservice_mouse_trap (void);
- extern void service_mouse_trap (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_wimp_close_down()
- *
- * Description: Notification the the Wimp is about to close down a task
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x53.
- */
-
- extern os_error *xservice_wimp_close_down (void);
- extern void service_wimp_close_down (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_wimp_report_error()
- *
- * Description: Request to suspend trapping of VDU output so an error can
- * be displayed
- *
- * Input: opening - value of R0 on entry
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x57.
- */
-
- extern os_error *xservice_wimp_report_error (bool opening);
- extern void service_wimp_report_error (bool opening);
-
- /* ------------------------------------------------------------------------
- * Function: service_wimp_save_desktop()
- *
- * Description: Save some state to a desktop boot file
- *
- * Input: flags - value of R0 on entry
- * file - value of R2 on entry
- *
- * Output: error - value of R0 on exit
- * unclaimed - value of R1 on exit (X version only)
- *
- * Returns: R1 (non-X version only)
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x5C.
- */
-
- extern os_error *xservice_wimp_save_desktop (bits flags,
- os_f file,
- os_error **error,
- bool *unclaimed);
- extern bool service_wimp_save_desktop (bits flags,
- os_f file,
- os_error **error);
-
- /* ------------------------------------------------------------------------
- * Function: service_wimp_palette()
- *
- * Description: Palette change
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x5D.
- */
-
- extern os_error *xservice_wimp_palette (void);
- extern void service_wimp_palette (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_desktop_welcome()
- *
- * Description: Desktop starting
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x7C.
- */
-
- extern os_error *xservice_desktop_welcome (void);
- extern void service_desktop_welcome (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_shut_down()
- *
- * Description: Task Manager shutting down
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x7E.
- */
-
- extern os_error *xservice_shut_down (void);
- extern void service_shut_down (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_shut_down_complete()
- *
- * Description: Shutdown complete
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x80.
- */
-
- extern os_error *xservice_shut_down_complete (void);
- extern void service_shut_down_complete (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_wimp_sprites_moved()
- *
- * Description: Wimp sprite pools have moved
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x85.
- */
-
- extern os_error *xservice_wimp_sprites_moved (void);
- extern void service_wimp_sprites_moved (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_wimp_register_filters()
- *
- * Description: Allows the Filter Manager to install filters with the
- * Wimp
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x86.
- */
-
- extern os_error *xservice_wimp_register_filters (void);
- extern void service_wimp_register_filters (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_error_starting()
- *
- * Description: Issued immediately after Wimp_ReportError is called
- *
- * Input: error - value of R2 on entry
- * flags - value of R3 on entry
- * name - value of R4 on entry
- * sprite_name - value of R5 on entry
- * area - value of R6 on entry
- * buttons - value of R7 on entry
- *
- * Output: error_out - value of R2 on exit
- * flags_out - value of R3 on exit
- * name_out - value of R4 on exit
- * sprite_name_out - value of R5 on exit
- * area_out - value of R6 on exit
- * buttons_out - value of R7 on exit
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x400C0.
- */
-
- extern os_error *xservice_error_starting (os_error *error,
- bits flags,
- char *name,
- char *sprite_name,
- osspriteop_area *area,
- char *buttons,
- os_error **error_out,
- bits *flags_out,
- char **name_out,
- char **sprite_name_out,
- osspriteop_area **area_out,
- char **buttons_out);
- extern void service_error_starting (os_error *error,
- bits flags,
- char *name,
- char *sprite_name,
- osspriteop_area *area,
- char *buttons,
- os_error **error_out,
- bits *flags_out,
- char **name_out,
- char **sprite_name_out,
- osspriteop_area **area_out,
- char **buttons_out);
-
- /* ------------------------------------------------------------------------
- * Function: service_error_button_pressed()
- *
- * Description: Issued when any button on the error report is pressed
- *
- * Input: button - value of R2 on entry
- * button_list - value of R3 on entry
- *
- * Output: redisplay - value of R0 on exit
- * unclaimed - value of R1 on exit (X version only)
- * button_out - value of R2 on exit
- *
- * Returns: R1 (non-X version only)
- *
- * Other notes: Calls SWI 0x30 with R0 = 0x0, R1 = 0x400C1.
- */
-
- extern os_error *xservice_error_button_pressed (int button,
- char *button_list,
- bool *redisplay,
- bool *unclaimed,
- int *button_out);
- extern bool service_error_button_pressed (int button,
- char *button_list,
- bool *redisplay,
- int *button_out);
-
- /* ------------------------------------------------------------------------
- * Function: service_error_ending()
- *
- * Description: Issued immediately before an error report closes
- *
- * Input: button - value of R2 on entry
- *
- * Output: unclaimed - value of R1 on exit (X version only)
- * button_out - value of R2 on exit
- *
- * Returns: R1 (non-X version only)
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x400C2.
- */
-
- extern os_error *xservice_error_ending (int button,
- bool *unclaimed,
- int *button_out);
- extern bool service_error_ending (int button,
- int *button_out);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-