home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / User / h / wimp < prev    next >
Encoding:
Text File  |  1995-08-01  |  95.8 KB  |  2,833 lines

  1. #ifndef wimp_H
  2. #define wimp_H
  3.  
  4. /* C header file for Wimp
  5.  * written by DefMod (Jul 24 1995) on Tue Aug  1 10:55:49 1995
  6.  * Jonathan Coxhead, Acorn Computers Ltd
  7.  */
  8.  
  9. #ifndef types_H
  10. #include "types.h"
  11. #endif
  12.  
  13. #ifndef os_H
  14. #include "os.h"
  15. #endif
  16.  
  17. #ifndef osspriteop_H
  18. #include "osspriteop.h"
  19. #endif
  20.  
  21. #ifndef font_H
  22. #include "font.h"
  23. #endif
  24.  
  25. /**********************************
  26.  * SWI names and SWI reason codes *
  27.  **********************************/
  28. #undef  Wimp_Initialise
  29. #define Wimp_Initialise                         0x400C0
  30. #undef  XWimp_Initialise
  31. #define XWimp_Initialise                        0x600C0
  32. #undef  Wimp_CreateWindow
  33. #define Wimp_CreateWindow                       0x400C1
  34. #undef  XWimp_CreateWindow
  35. #define XWimp_CreateWindow                      0x600C1
  36. #undef  Wimp_CreateIcon
  37. #define Wimp_CreateIcon                         0x400C2
  38. #undef  XWimp_CreateIcon
  39. #define XWimp_CreateIcon                        0x600C2
  40. #undef  Wimp_CreateIconRelative
  41. #define Wimp_CreateIconRelative                 0x400C2
  42. #undef  XWimp_CreateIconRelative
  43. #define XWimp_CreateIconRelative                0x600C2
  44. #undef  Wimp_CreateIconPrioritised
  45. #define Wimp_CreateIconPrioritised              0x400C2
  46. #undef  XWimp_CreateIconPrioritised
  47. #define XWimp_CreateIconPrioritised             0x600C2
  48. #undef  Wimp_DeleteWindow
  49. #define Wimp_DeleteWindow                       0x400C3
  50. #undef  XWimp_DeleteWindow
  51. #define XWimp_DeleteWindow                      0x600C3
  52. #undef  Wimp_DeleteIcon
  53. #define Wimp_DeleteIcon                         0x400C4
  54. #undef  XWimp_DeleteIcon
  55. #define XWimp_DeleteIcon                        0x600C4
  56. #undef  Wimp_OpenWindow
  57. #define Wimp_OpenWindow                         0x400C5
  58. #undef  XWimp_OpenWindow
  59. #define XWimp_OpenWindow                        0x600C5
  60. #undef  Wimp_CloseWindow
  61. #define Wimp_CloseWindow                        0x400C6
  62. #undef  XWimp_CloseWindow
  63. #define XWimp_CloseWindow                       0x600C6
  64. #undef  Wimp_Poll
  65. #define Wimp_Poll                               0x400C7
  66. #undef  XWimp_Poll
  67. #define XWimp_Poll                              0x600C7
  68. #undef  Wimp_RedrawWindow
  69. #define Wimp_RedrawWindow                       0x400C8
  70. #undef  XWimp_RedrawWindow
  71. #define XWimp_RedrawWindow                      0x600C8
  72. #undef  Wimp_UpdateWindow
  73. #define Wimp_UpdateWindow                       0x400C9
  74. #undef  XWimp_UpdateWindow
  75. #define XWimp_UpdateWindow                      0x600C9
  76. #undef  Wimp_GetRectangle
  77. #define Wimp_GetRectangle                       0x400CA
  78. #undef  XWimp_GetRectangle
  79. #define XWimp_GetRectangle                      0x600CA
  80. #undef  Wimp_GetWindowState
  81. #define Wimp_GetWindowState                     0x400CB
  82. #undef  XWimp_GetWindowState
  83. #define XWimp_GetWindowState                    0x600CB
  84. #undef  Wimp_GetWindowInfo
  85. #define Wimp_GetWindowInfo                      0x400CC
  86. #undef  XWimp_GetWindowInfo
  87. #define XWimp_GetWindowInfo                     0x600CC
  88. #undef  Wimp_GetWindowInfoHeaderOnly
  89. #define Wimp_GetWindowInfoHeaderOnly            0x400CC
  90. #undef  XWimp_GetWindowInfoHeaderOnly
  91. #define XWimp_GetWindowInfoHeaderOnly           0x600CC
  92. #undef  Wimp_SetIconState
  93. #define Wimp_SetIconState                       0x400CD
  94. #undef  XWimp_SetIconState
  95. #define XWimp_SetIconState                      0x600CD
  96. #undef  Wimp_GetIconState
  97. #define Wimp_GetIconState                       0x400CE
  98. #undef  XWimp_GetIconState
  99. #define XWimp_GetIconState                      0x600CE
  100. #undef  Wimp_GetPointerInfo
  101. #define Wimp_GetPointerInfo                     0x400CF
  102. #undef  XWimp_GetPointerInfo
  103. #define XWimp_GetPointerInfo                    0x600CF
  104. #undef  Wimp_DragBox
  105. #define Wimp_DragBox                            0x400D0
  106. #undef  XWimp_DragBox
  107. #define XWimp_DragBox                           0x600D0
  108. #undef  Wimp_ForceRedraw
  109. #define Wimp_ForceRedraw                        0x400D1
  110. #undef  XWimp_ForceRedraw
  111. #define XWimp_ForceRedraw                       0x600D1
  112. #undef  Wimp_SetCaretPosition
  113. #define Wimp_SetCaretPosition                   0x400D2
  114. #undef  XWimp_SetCaretPosition
  115. #define XWimp_SetCaretPosition                  0x600D2
  116. #undef  Wimp_GetCaretPosition
  117. #define Wimp_GetCaretPosition                   0x400D3
  118. #undef  XWimp_GetCaretPosition
  119. #define XWimp_GetCaretPosition                  0x600D3
  120. #undef  Wimp_CreateMenu
  121. #define Wimp_CreateMenu                         0x400D4
  122. #undef  XWimp_CreateMenu
  123. #define XWimp_CreateMenu                        0x600D4
  124. #undef  Wimp_DecodeMenu
  125. #define Wimp_DecodeMenu                         0x400D5
  126. #undef  XWimp_DecodeMenu
  127. #define XWimp_DecodeMenu                        0x600D5
  128. #undef  Wimp_WhichIcon
  129. #define Wimp_WhichIcon                          0x400D6
  130. #undef  XWimp_WhichIcon
  131. #define XWimp_WhichIcon                         0x600D6
  132. #undef  Wimp_SetExtent
  133. #define Wimp_SetExtent                          0x400D7
  134. #undef  XWimp_SetExtent
  135. #define XWimp_SetExtent                         0x600D7
  136. #undef  Wimp_SetPointerShape
  137. #define Wimp_SetPointerShape                    0x400D8
  138. #undef  XWimp_SetPointerShape
  139. #define XWimp_SetPointerShape                   0x600D8
  140. #undef  Wimp_OpenTemplate
  141. #define Wimp_OpenTemplate                       0x400D9
  142. #undef  XWimp_OpenTemplate
  143. #define XWimp_OpenTemplate                      0x600D9
  144. #undef  Wimp_CloseTemplate
  145. #define Wimp_CloseTemplate                      0x400DA
  146. #undef  XWimp_CloseTemplate
  147. #define XWimp_CloseTemplate                     0x600DA
  148. #undef  Wimp_LoadTemplate
  149. #define Wimp_LoadTemplate                       0x400DB
  150. #undef  XWimp_LoadTemplate
  151. #define XWimp_LoadTemplate                      0x600DB
  152. #undef  Wimp_ProcessKey
  153. #define Wimp_ProcessKey                         0x400DC
  154. #undef  XWimp_ProcessKey
  155. #define XWimp_ProcessKey                        0x600DC
  156. #undef  Wimp_CloseDown
  157. #define Wimp_CloseDown                          0x400DD
  158. #undef  XWimp_CloseDown
  159. #define XWimp_CloseDown                         0x600DD
  160. #undef  Wimp_StartTask
  161. #define Wimp_StartTask                          0x400DE
  162. #undef  XWimp_StartTask
  163. #define XWimp_StartTask                         0x600DE
  164. #undef  Wimp_ReportError
  165. #define Wimp_ReportError                        0x400DF
  166. #undef  XWimp_ReportError
  167. #define XWimp_ReportError                       0x600DF
  168. #undef  Wimp_ReportErrorByCategory
  169. #define Wimp_ReportErrorByCategory              0x400DF
  170. #undef  XWimp_ReportErrorByCategory
  171. #define XWimp_ReportErrorByCategory             0x600DF
  172. #undef  Wimp_GetWindowOutline
  173. #define Wimp_GetWindowOutline                   0x400E0
  174. #undef  XWimp_GetWindowOutline
  175. #define XWimp_GetWindowOutline                  0x600E0
  176. #undef  Wimp_PollIdle
  177. #define Wimp_PollIdle                           0x400E1
  178. #undef  XWimp_PollIdle
  179. #define XWimp_PollIdle                          0x600E1
  180. #undef  Wimp_PlotIcon
  181. #define Wimp_PlotIcon                           0x400E2
  182. #undef  XWimp_PlotIcon
  183. #define XWimp_PlotIcon                          0x600E2
  184. #undef  Wimp_SetMode
  185. #define Wimp_SetMode                            0x400E3
  186. #undef  XWimp_SetMode
  187. #define XWimp_SetMode                           0x600E3
  188. #undef  Wimp_SetPalette
  189. #define Wimp_SetPalette                         0x400E4
  190. #undef  XWimp_SetPalette
  191. #define XWimp_SetPalette                        0x600E4
  192. #undef  Wimp_ReadPalette
  193. #define Wimp_ReadPalette                        0x400E5
  194. #undef  XWimp_ReadPalette
  195. #define XWimp_ReadPalette                       0x600E5
  196. #undef  Wimp_ReadTruePalette
  197. #define Wimp_ReadTruePalette                    0x400E5
  198. #undef  XWimp_ReadTruePalette
  199. #define XWimp_ReadTruePalette                   0x600E5
  200. #undef  Wimp_SetColour
  201. #define Wimp_SetColour                          0x400E6
  202. #undef  XWimp_SetColour
  203. #define XWimp_SetColour                         0x600E6
  204. #undef  Wimp_SendMessage
  205. #define Wimp_SendMessage                        0x400E7
  206. #undef  XWimp_SendMessage
  207. #define XWimp_SendMessage                       0x600E7
  208. #undef  Wimp_SendMessageToWindow
  209. #define Wimp_SendMessageToWindow                0x400E7
  210. #undef  XWimp_SendMessageToWindow
  211. #define XWimp_SendMessageToWindow               0x600E7
  212. #undef  Wimp_CreateSubMenu
  213. #define Wimp_CreateSubMenu                      0x400E8
  214. #undef  XWimp_CreateSubMenu
  215. #define XWimp_CreateSubMenu                     0x600E8
  216. #undef  Wimp_BaseOfSprites
  217. #define Wimp_BaseOfSprites                      0x400EA
  218. #undef  XWimp_BaseOfSprites
  219. #define XWimp_BaseOfSprites                     0x600EA
  220. #undef  Wimp_BlockCopy
  221. #define Wimp_BlockCopy                          0x400EB
  222. #undef  XWimp_BlockCopy
  223. #define XWimp_BlockCopy                         0x600EB
  224. #undef  Wimp_SlotSize
  225. #define Wimp_SlotSize                           0x400EC
  226. #undef  XWimp_SlotSize
  227. #define XWimp_SlotSize                          0x600EC
  228. #undef  Wimp_ReadPixTrans
  229. #define Wimp_ReadPixTrans                       0x400ED
  230. #undef  XWimp_ReadPixTrans
  231. #define XWimp_ReadPixTrans                      0x600ED
  232. #undef  Wimp_ClaimFreeMemory
  233. #define Wimp_ClaimFreeMemory                    0x400EE
  234. #undef  XWimp_ClaimFreeMemory
  235. #define XWimp_ClaimFreeMemory                   0x600EE
  236. #undef  WimpClaimFreeMemory_Alloc
  237. #define WimpClaimFreeMemory_Alloc               0x1
  238. #undef  WimpClaimFreeMemory_Free
  239. #define WimpClaimFreeMemory_Free                0x0
  240. #undef  Wimp_CommandWindow
  241. #define Wimp_CommandWindow                      0x400EF
  242. #undef  XWimp_CommandWindow
  243. #define XWimp_CommandWindow                     0x600EF
  244. #undef  Wimp_TextColour
  245. #define Wimp_TextColour                         0x400F0
  246. #undef  XWimp_TextColour
  247. #define XWimp_TextColour                        0x600F0
  248. #undef  Wimp_TransferBlock
  249. #define Wimp_TransferBlock                      0x400F1
  250. #undef  XWimp_TransferBlock
  251. #define XWimp_TransferBlock                     0x600F1
  252. #undef  Wimp_SetFontColours
  253. #define Wimp_SetFontColours                     0x400F3
  254. #undef  XWimp_SetFontColours
  255. #define XWimp_SetFontColours                    0x600F3
  256. #undef  Wimp_GetMenuState
  257. #define Wimp_GetMenuState                       0x400F4
  258. #undef  XWimp_GetMenuState
  259. #define XWimp_GetMenuState                      0x600F4
  260. #undef  Wimp_RegisterFilter
  261. #define Wimp_RegisterFilter                     0x400F5
  262. #undef  XWimp_RegisterFilter
  263. #define XWimp_RegisterFilter                    0x600F5
  264. #undef  Wimp_AddMessages
  265. #define Wimp_AddMessages                        0x400F6
  266. #undef  XWimp_AddMessages
  267. #define XWimp_AddMessages                       0x600F6
  268. #undef  Wimp_RemoveMessages
  269. #define Wimp_RemoveMessages                     0x400F7
  270. #undef  XWimp_RemoveMessages
  271. #define XWimp_RemoveMessages                    0x600F7
  272. #undef  Wimp_SetColourMapping
  273. #define Wimp_SetColourMapping                   0x400F8
  274. #undef  XWimp_SetColourMapping
  275. #define XWimp_SetColourMapping                  0x600F8
  276. #undef  Wimp_TextOp
  277. #define Wimp_TextOp                             0x400F9
  278. #undef  XWimp_TextOp
  279. #define XWimp_TextOp                            0x600F9
  280. #undef  WimpTextOp_SetColour
  281. #define WimpTextOp_SetColour                    0x0
  282. #undef  WimpTextOp_StringWidth
  283. #define WimpTextOp_StringWidth                  0x1
  284. #undef  WimpTextOp_Paint
  285. #define WimpTextOp_Paint                        0x2
  286. #undef  Wimp_SetWatchdogState
  287. #define Wimp_SetWatchdogState                   0x400FA
  288. #undef  XWimp_SetWatchdogState
  289. #define XWimp_SetWatchdogState                  0x600FA
  290. #undef  Wimp_Extend
  291. #define Wimp_Extend                             0x400FB
  292. #undef  XWimp_Extend
  293. #define XWimp_Extend                            0x600FB
  294. #undef  Wimp_ResizeIcon
  295. #define Wimp_ResizeIcon                         0x400FC
  296. #undef  XWimp_ResizeIcon
  297. #define XWimp_ResizeIcon                        0x600FC
  298. #undef  Service_Memory
  299. #define Service_Memory                          0x11
  300. #undef  Service_StartWimp
  301. #define Service_StartWimp                       0x49
  302. #undef  Service_StartedWimp
  303. #define Service_StartedWimp                     0x4A
  304. #undef  Service_MouseTrap
  305. #define Service_MouseTrap                       0x52
  306. #undef  Service_WimpCloseDown
  307. #define Service_WimpCloseDown                   0x53
  308. #undef  Service_WimpReportError
  309. #define Service_WimpReportError                 0x57
  310. #undef  Service_WimpSaveDesktop
  311. #define Service_WimpSaveDesktop                 0x5C
  312. #undef  Service_WimpPalette
  313. #define Service_WimpPalette                     0x5D
  314. #undef  Service_DesktopWelcome
  315. #define Service_DesktopWelcome                  0x7C
  316. #undef  Service_ShutDown
  317. #define Service_ShutDown                        0x7E
  318. #undef  Service_ShutDownComplete
  319. #define Service_ShutDownComplete                0x80
  320. #undef  Service_WimpSpritesMoved
  321. #define Service_WimpSpritesMoved                0x85
  322. #undef  Service_WimpRegisterFilters
  323. #define Service_WimpRegisterFilters             0x86
  324. #undef  Service_ErrorStarting
  325. #define Service_ErrorStarting                   0x400C0
  326. #undef  Service_ErrorButtonPressed
  327. #define Service_ErrorButtonPressed              0x400C1
  328. #undef  Service_ErrorEnding
  329. #define Service_ErrorEnding                     0x400C2
  330.  
  331. /************************************
  332.  * Structure and union declarations *
  333.  ************************************/
  334. typedef struct wimp_w_                          *wimp_w;
  335. typedef struct wimp_t_                          *wimp_t;
  336. typedef union  wimp_icon_data                   wimp_icon_data;
  337. typedef struct wimp_icon                        wimp_icon;
  338. typedef struct wimp_icon_create                 wimp_icon_create;
  339. typedef struct wimp_window                      wimp_window;
  340. typedef struct wimp_window_state                wimp_window_state;
  341. typedef struct wimp_icon_state                  wimp_icon_state;
  342. typedef struct wimp_window_info                 wimp_window_info;
  343. typedef struct wimp_outline                     wimp_outline;
  344. typedef struct wimp_draw                        wimp_draw;
  345. typedef struct wimp_open                        wimp_open;
  346. typedef struct wimp_close                       wimp_close;
  347. typedef struct wimp_leaving                     wimp_leaving;
  348. typedef struct wimp_entering                    wimp_entering;
  349. typedef struct wimp_pointer                     wimp_pointer;
  350. typedef struct wimp_dragged                     wimp_dragged;
  351. typedef struct wimp_key                         wimp_key;
  352. typedef struct wimp_selection                   wimp_selection;
  353. typedef struct wimp_scroll                      wimp_scroll;
  354. typedef struct wimp_pollword                    wimp_pollword;
  355. typedef struct wimp_drag                        wimp_drag;
  356. typedef struct wimp_caret                       wimp_caret;
  357. typedef struct wimp_menu_entry                  wimp_menu_entry;
  358. typedef struct wimp_menu                        wimp_menu;
  359. typedef struct wimp_message_data_xfer           wimp_message_data_xfer;
  360. typedef struct wimp_message_ram_xfer            wimp_message_ram_xfer;
  361. typedef struct wimp_message_prequit             wimp_message_prequit;
  362. typedef struct wimp_message_save_desktop        wimp_message_save_desktop;
  363. typedef struct wimp_message_device              wimp_message_device;
  364. typedef struct wimp_message_data_saved          wimp_message_data_saved;
  365. typedef struct wimp_message_shutdown            wimp_message_shutdown;
  366. typedef struct wimp_message_claim_entity        wimp_message_claim_entity;
  367. typedef struct wimp_message_data_request        wimp_message_data_request;
  368. typedef struct wimp_message_dragging            wimp_message_dragging;
  369. typedef struct wimp_message_drag_claim          wimp_message_drag_claim;
  370. typedef struct wimp_message_menu_warning        wimp_message_menu_warning;
  371. typedef struct wimp_message_task_initialise     wimp_message_task_initialise;
  372. typedef struct wimp_message_slot_size           wimp_message_slot_size;
  373. typedef struct wimp_message_set_slot            wimp_message_set_slot;
  374. typedef struct wimp_message_task_name_rq        wimp_message_task_name_rq;
  375. typedef struct wimp_message_task_name_is        wimp_message_task_name_is;
  376. typedef struct wimp_message_menus_deleted       wimp_message_menus_deleted;
  377. typedef struct wimp_message_iconise             wimp_message_iconise;
  378. typedef struct wimp_message_window_closed       wimp_message_window_closed;
  379. typedef struct wimp_message_window_info         wimp_message_window_info;
  380. typedef struct wimp_message_font_changed        wimp_message_font_changed;
  381. typedef struct wimp_message                     wimp_message;
  382. typedef union  wimp_block                       wimp_block;
  383. typedef struct wimp_message_list                wimp_message_list;
  384.  
  385. /********************
  386.  * Type definitions *
  387.  ********************/
  388. typedef int wimp_i;
  389.  
  390. typedef byte wimp_colour;
  391.  
  392. typedef int wimp_version_no;
  393.  
  394. typedef int wimp_event_no;
  395.  
  396. typedef bits wimp_poll_flags;
  397.  
  398. typedef bits wimp_window_flags;
  399.  
  400. typedef bits wimp_icon_flags;
  401.  
  402. typedef bits wimp_menu_flags;
  403.  
  404. typedef bits wimp_mouse_state;
  405.       /*Mouse button state - use the elements of only one of these sets: {Click}, {Click, Drag}, {Single, Drag, Double}*/
  406.  
  407. typedef int wimp_drag_type;
  408.  
  409. typedef int wimp_key_no;
  410.  
  411. typedef bits wimp_error_box_flags;
  412.  
  413. typedef int wimp_error_box_selection;
  414.  
  415. union wimp_icon_data
  416.    {  char text [12];
  417.       char sprite [12];
  418.       char text_and_sprite [12];
  419.       struct
  420.       {  char *text;
  421.          char *validation;
  422.          int size;
  423.       }
  424.       indirected_text;
  425.       struct
  426.       {  osspriteop_id id;
  427.          osspriteop_area *area;
  428.          int size;
  429.       }
  430.       indirected_sprite;
  431.       struct
  432.       {  char *text;
  433.          char *validation;
  434.          int size;
  435.       }
  436.       indirected_text_and_sprite;
  437.    };
  438.  
  439. struct wimp_icon
  440.    {  os_box extent;
  441.       wimp_icon_flags flags;
  442.       wimp_icon_data data;
  443.    };
  444.  
  445. struct wimp_icon_create
  446.    {  wimp_w w;
  447.       wimp_icon icon;
  448.    };
  449.  
  450. struct wimp_window
  451.    {  os_box visible;
  452.       int xscroll;
  453.       int yscroll;
  454.       wimp_w next;
  455.       wimp_window_flags flags;
  456.       wimp_colour title_fg;
  457.       wimp_colour title_bg;
  458.       wimp_colour work_fg;
  459.       wimp_colour work_bg;
  460.       wimp_colour scroll_outer;
  461.       wimp_colour scroll_inner;
  462.       wimp_colour highlight_bg;
  463.       wimp_colour reserved;
  464.       os_box extent;
  465.       wimp_icon_flags title_flags;
  466.       wimp_icon_flags work_flags;
  467.       osspriteop_area *sprite_area;
  468.       short xmin;
  469.       short ymin;
  470.       wimp_icon_data title_data;
  471.       int icon_count;
  472.       wimp_icon icons [UNKNOWN];
  473.    };
  474.  
  475. #define wimp_WINDOW(N) \
  476.    struct \
  477.       {  os_box visible; \
  478.          int xscroll; \
  479.          int yscroll; \
  480.          wimp_w next; \
  481.          wimp_window_flags flags; \
  482.          wimp_colour title_fg; \
  483.          wimp_colour title_bg; \
  484.          wimp_colour work_fg; \
  485.          wimp_colour work_bg; \
  486.          wimp_colour scroll_outer; \
  487.          wimp_colour scroll_inner; \
  488.          wimp_colour highlight_bg; \
  489.          wimp_colour reserved; \
  490.          os_box extent; \
  491.          wimp_icon_flags title_flags; \
  492.          wimp_icon_flags work_flags; \
  493.          osspriteop_area *sprite_area; \
  494.          short xmin; \
  495.          short ymin; \
  496.          wimp_icon_data title_data; \
  497.          int icon_count; \
  498.          wimp_icon icons [N]; \
  499.       }
  500.  
  501. #define wimp_SIZEOF_WINDOW(N) \
  502.    (offsetof (wimp_window, icons) + \
  503.          (N)*sizeof ((wimp_window *) NULL)->icons)
  504.  
  505. struct wimp_window_state
  506.    {  wimp_w w;
  507.       os_box visible;
  508.       int xscroll;
  509.       int yscroll;
  510.       wimp_w next;
  511.       wimp_window_flags flags;
  512.    };
  513.  
  514. struct wimp_icon_state
  515.    {  wimp_w w;
  516.       wimp_i i;
  517.       wimp_icon icon;
  518.    };
  519.  
  520. struct wimp_window_info
  521.    {  wimp_w w;
  522.       os_box visible;
  523.       int xscroll;
  524.       int yscroll;
  525.       wimp_w next;
  526.       wimp_window_flags flags;
  527.       wimp_colour title_fg;
  528.       wimp_colour title_bg;
  529.       wimp_colour work_fg;
  530.       wimp_colour work_bg;
  531.       wimp_colour scroll_outer;
  532.       wimp_colour scroll_inner;
  533.       wimp_colour highlight_bg;
  534.       wimp_colour reserved;
  535.       os_box extent;
  536.       wimp_icon_flags title_flags;
  537.       wimp_icon_flags work_flags;
  538.       osspriteop_area *sprite_area;
  539.       short xmin;
  540.       short ymin;
  541.       wimp_icon_data title_data;
  542.       int icon_count;
  543.       wimp_icon icons [UNKNOWN];
  544.    };
  545.  
  546. #define wimp_WINDOW_INFO(N) \
  547.    struct \
  548.       {  wimp_w w; \
  549.          os_box visible; \
  550.          int xscroll; \
  551.          int yscroll; \
  552.          wimp_w next; \
  553.          wimp_window_flags flags; \
  554.          wimp_colour title_fg; \
  555.          wimp_colour title_bg; \
  556.          wimp_colour work_fg; \
  557.          wimp_colour work_bg; \
  558.          wimp_colour scroll_outer; \
  559.          wimp_colour scroll_inner; \
  560.          wimp_colour highlight_bg; \
  561.          wimp_colour reserved; \
  562.          os_box extent; \
  563.          wimp_icon_flags title_flags; \
  564.          wimp_icon_flags work_flags; \
  565.          osspriteop_area *sprite_area; \
  566.          short xmin; \
  567.          short ymin; \
  568.          wimp_icon_data title_data; \
  569.          int icon_count; \
  570.          wimp_icon icons [N]; \
  571.       }
  572.  
  573. #define wimp_SIZEOF_WINDOW_INFO(N) \
  574.    (offsetof (wimp_window_info, icons) + \
  575.          (N)*sizeof ((wimp_window_info *) NULL)->icons)
  576.  
  577. struct wimp_outline
  578.    {  wimp_w w;
  579.       os_box outline;
  580.    };
  581.  
  582. struct wimp_draw
  583.    {  wimp_w w;
  584.       os_box box;
  585.       int xscroll;
  586.       int yscroll;
  587.       os_box clip;
  588.    };
  589.  
  590. struct wimp_open
  591.    {  wimp_w w;
  592.       os_box visible;
  593.       int xscroll;
  594.       int yscroll;
  595.       wimp_w next;
  596.    };
  597.  
  598. struct wimp_close
  599.    {  wimp_w w;
  600.    };
  601.  
  602. struct wimp_leaving
  603.    {  wimp_w w;
  604.    };
  605.  
  606. struct wimp_entering
  607.    {  wimp_w w;
  608.    };
  609.  
  610. struct wimp_pointer
  611.    {  os_coord pos;
  612.       wimp_mouse_state buttons;
  613.       wimp_w w;
  614.       wimp_i i;
  615.    };
  616.  
  617. struct wimp_dragged
  618.    {  os_box final;
  619.    };
  620.  
  621. struct wimp_key
  622.    {  wimp_w w;
  623.       wimp_i i;
  624.       os_coord pos;
  625.       int height;
  626.       int index;
  627.       wimp_key_no c;
  628.    };
  629.  
  630. struct wimp_selection
  631.    {  int items [9];
  632.    };
  633.  
  634. struct wimp_scroll
  635.    {  wimp_w w;
  636.       os_box visible;
  637.       int xscroll;
  638.       int yscroll;
  639.       wimp_w next;
  640.       int xmin;
  641.       int ymin;
  642.    };
  643.  
  644. struct wimp_pollword
  645.    {  byte *addr;
  646.       int word;
  647.    };
  648.  
  649. struct wimp_drag
  650.    {  wimp_w w;
  651.       wimp_drag_type type;
  652.       os_box initial;
  653.       os_box bbox;
  654.       byte *handle;
  655.       void *draw;
  656.       void *undraw;
  657.       void *redraw;
  658.    };
  659.  
  660. struct wimp_caret
  661.    {  wimp_w w;
  662.       wimp_i i;
  663.       os_coord pos;
  664.       int height;
  665.       int index;
  666.    };
  667.  
  668. struct wimp_menu_entry
  669.    {  wimp_menu_flags menu_flags;
  670.       wimp_menu *sub_menu;
  671.       wimp_icon_flags icon_flags;
  672.       wimp_icon_data data;
  673.    };
  674.  
  675. struct wimp_menu
  676.    {  union
  677.       {  char text [12];
  678.          struct
  679.          {  char *text;
  680.             byte reserved [8];
  681.          }
  682.          indirected_text;
  683.       }
  684.       title_data;
  685.       wimp_colour title_fg;
  686.       wimp_colour title_bg;
  687.       wimp_colour work_fg;
  688.       wimp_colour work_bg;
  689.       int width;
  690.       int height;
  691.       int gap;
  692.       wimp_menu_entry entries [UNKNOWN];
  693.    };
  694.  
  695. #define wimp_MENU(N) \
  696.    struct \
  697.       {  union \
  698.          {  char text [12]; \
  699.             struct \
  700.             {  char *text; \
  701.                byte reserved [8]; \
  702.             } \
  703.             indirected_text; \
  704.          } \
  705.          title_data; \
  706.          wimp_colour title_fg; \
  707.          wimp_colour title_bg; \
  708.          wimp_colour work_fg; \
  709.          wimp_colour work_bg; \
  710.          int width; \
  711.          int height; \
  712.          int gap; \
  713.          wimp_menu_entry entries [N]; \
  714.       }
  715.  
  716. #define wimp_SIZEOF_MENU(N) \
  717.    (offsetof (wimp_menu, entries) + \
  718.          (N)*sizeof ((wimp_menu *) NULL)->entries)
  719.  
  720. typedef bits wimp_pre_quit_flags;
  721.  
  722. typedef bits wimp_save_desktop_flags;
  723.  
  724. typedef bits wimp_shutdown_flags;
  725.  
  726. typedef bits wimp_claim_flags;
  727.  
  728. typedef bits wimp_data_request_flags;
  729.  
  730. typedef bits wimp_dragging_flags;
  731.  
  732. typedef bits wimp_drag_claim_flags;
  733.  
  734. struct wimp_message_data_xfer
  735.    {  wimp_w w;
  736.       wimp_i i;
  737.       os_coord pos;
  738.       int est_size;
  739.       bits file_type;
  740.       char file_name [212];
  741.    };
  742.  
  743. struct wimp_message_ram_xfer
  744.    {  byte *addr;
  745.       int size;
  746.    };
  747.  
  748. struct wimp_message_prequit
  749.    {  wimp_pre_quit_flags flags;
  750.    };
  751.  
  752. struct wimp_message_save_desktop
  753.    {  os_f file;
  754.       byte reserved [3];
  755.       wimp_save_desktop_flags flags;
  756.    };
  757.  
  758. struct wimp_message_device
  759.    {  int major;
  760.       int minor;
  761.       char info [228];
  762.    };
  763.  
  764. struct wimp_message_data_saved
  765.    {  int ref;
  766.    };
  767.  
  768. struct wimp_message_shutdown
  769.    {  wimp_shutdown_flags flags;
  770.    };
  771.  
  772. struct wimp_message_claim_entity
  773.    {  wimp_claim_flags flags;
  774.    };
  775.  
  776. struct wimp_message_data_request
  777.    {  wimp_w w;
  778.       wimp_i i;
  779.       os_coord pos;
  780.       wimp_data_request_flags flags;
  781.       bits file_types [54];
  782.    };
  783.  
  784. struct wimp_message_dragging
  785.    {  wimp_w w;
  786.       wimp_i i;
  787.       os_coord pos;
  788.       wimp_dragging_flags flags;
  789.       os_box box;
  790.       bits file_types [50];
  791.    };
  792.  
  793. struct wimp_message_drag_claim
  794.    {  wimp_drag_claim_flags flags;
  795.       bits file_types [58];
  796.    };
  797.  
  798. struct wimp_message_menu_warning
  799.    {  wimp_menu *sub_menu;
  800.       os_coord pos;
  801.       wimp_selection selection;
  802.    };
  803.  
  804. struct wimp_message_task_initialise
  805.    {  byte *cao;
  806.       int size;
  807.       char task_name [228];
  808.    };
  809.  
  810. struct wimp_message_slot_size
  811.    {  int new_curr;
  812.       int new_next;
  813.    };
  814.  
  815. struct wimp_message_set_slot
  816.    {  int new_curr;
  817.       wimp_t task;
  818.    };
  819.  
  820. struct wimp_message_task_name_rq
  821.    {  wimp_t task;
  822.    };
  823.  
  824. struct wimp_message_task_name_is
  825.    {  wimp_t task;
  826.       int size;
  827.       char task_name [228];
  828.    };
  829.  
  830. struct wimp_message_menus_deleted
  831.    {  wimp_menu *menu;
  832.    };
  833.  
  834. struct wimp_message_iconise
  835.    {  wimp_w w;
  836.       wimp_t task;
  837.       char title [20];
  838.    };
  839.  
  840. struct wimp_message_window_closed
  841.    {  wimp_w w;
  842.    };
  843.  
  844. struct wimp_message_window_info
  845.    {  wimp_w w;
  846.       int reserved;
  847.       char sprite_name [8];
  848.       char title [20];
  849.    };
  850.  
  851. struct wimp_message_font_changed
  852.    {  font_f font;
  853.    };
  854.  
  855. struct wimp_message
  856.    {  int size;
  857.       wimp_t sender;
  858.       int my_ref;
  859.       int your_ref;
  860.       bits action;
  861.       union
  862.       {  wimp_message_data_xfer data_xfer;
  863.          wimp_message_ram_xfer ram_xfer;
  864.          wimp_message_prequit prequit;
  865.          wimp_message_save_desktop save_desktop;
  866.          wimp_message_device device;
  867.          wimp_message_data_saved data_saved;
  868.          wimp_message_shutdown shutdown;
  869.          wimp_message_claim_entity claim_entity;
  870.          wimp_message_data_request data_request;
  871.          wimp_message_dragging dragging;
  872.          wimp_message_drag_claim drag_claim;
  873.          byte reserved [236];
  874.       }
  875.       data;
  876.    };
  877.  
  878. union wimp_block
  879.    {  wimp_draw redraw;
  880.       wimp_open open;
  881.       wimp_close close;
  882.       wimp_leaving leaving;
  883.       wimp_entering entering;
  884.       wimp_pointer pointer;
  885.       wimp_dragged dragged;
  886.       wimp_key key;
  887.       wimp_selection selection;
  888.       wimp_scroll scroll;
  889.       wimp_caret caret;
  890.       wimp_pollword pollword;
  891.       wimp_message message;
  892.       byte reserved [256];
  893.    };
  894.  
  895. struct wimp_message_list
  896.    {  int messages [UNKNOWN];
  897.    };
  898.  
  899. #define wimp_MESSAGE_LIST(N) \
  900.    struct \
  901.       {  int messages [N]; \
  902.       }
  903.  
  904. #define wimp_SIZEOF_MESSAGE_LIST(N) \
  905.    ((N)*sizeof ((wimp_message_list *) NULL)->messages)
  906.  
  907. typedef bits wimp_priority;
  908.  
  909. typedef bits wimp_menu_state_flags;
  910.  
  911. typedef bits wimptextop_paint_flags;
  912.  
  913. /************************
  914.  * Constant definitions *
  915.  ************************/
  916. #define wimp_VERSION_RO2                        ((wimp_version_no) 0xC8u)
  917. #define wimp_VERSION_RO30                       ((wimp_version_no) 0x12Cu)
  918. #define wimp_VERSION_RO3                        ((wimp_version_no) 0x136u)
  919. #define wimp_VERSION_RO35                       ((wimp_version_no) 0x15Eu)
  920. #define wimp_ICON_NAME_LIMIT                    12
  921. #define wimp_TEMPLATE_NAME_LIMIT                12
  922. #define wimp_MENU_NAME_LIMIT                    12
  923. #define wimp_MENU_DEPTH_LIMIT                   8
  924. #define wimp_CHAR_XSIZE                         16
  925.       /*Width of system font (in O S U)*/
  926. #define wimp_CHAR_YSIZE                         32
  927.       /*Height of system font (in O S U)*/
  928. #define wimp_NULL_REASON_CODE                   ((wimp_event_no) 0x0u)
  929. #define wimp_REDRAW_WINDOW_REQUEST              ((wimp_event_no) 0x1u)
  930. #define wimp_OPEN_WINDOW_REQUEST                ((wimp_event_no) 0x2u)
  931. #define wimp_CLOSE_WINDOW_REQUEST               ((wimp_event_no) 0x3u)
  932. #define wimp_POINTER_LEAVING_WINDOW             ((wimp_event_no) 0x4u)
  933. #define wimp_POINTER_ENTERING_WINDOW            ((wimp_event_no) 0x5u)
  934. #define wimp_MOUSE_CLICK                        ((wimp_event_no) 0x6u)
  935. #define wimp_USER_DRAG_BOX                      ((wimp_event_no) 0x7u)
  936. #define wimp_KEY_PRESSED                        ((wimp_event_no) 0x8u)
  937. #define wimp_MENU_SELECTION                     ((wimp_event_no) 0x9u)
  938. #define wimp_SCROLL_REQUEST                     ((wimp_event_no) 0xAu)
  939. #define wimp_LOSE_CARET                         ((wimp_event_no) 0xBu)
  940. #define wimp_GAIN_CARET                         ((wimp_event_no) 0xCu)
  941. #define wimp_POLLWORD_NON_ZERO                  ((wimp_event_no) 0xDu)
  942. #define wimp_USER_MESSAGE                       ((wimp_event_no) 0x11u)
  943. #define wimp_USER_MESSAGE_RECORDED              ((wimp_event_no) 0x12u)
  944. #define wimp_USER_MESSAGE_ACKNOWLEDGE           ((wimp_event_no) 0x13u)
  945. #define wimp_MASK_NULL                          ((wimp_poll_flags) 0x1u)
  946. #define wimp_QUEUE_REDRAW                       ((wimp_poll_flags) 0x2u)
  947. #define wimp_MASK_LEAVING                       ((wimp_poll_flags) 0x10u)
  948. #define wimp_MASK_ENTERING                      ((wimp_poll_flags) 0x20u)
  949. #define wimp_QUEUE_MOUSE                        ((wimp_poll_flags) 0x40u)
  950. #define wimp_QUEUE_KEY                          ((wimp_poll_flags) 0x100u)
  951. #define wimp_MASK_LOSE                          ((wimp_poll_flags) 0x800u)
  952. #define wimp_MASK_GAIN                          ((wimp_poll_flags) 0x1000u)
  953. #define wimp_MASK_POLLWORD                      ((wimp_poll_flags) 0x2000u)
  954. #define wimp_MASK_MESSAGE                       ((wimp_poll_flags) 0x20000u)
  955. #define wimp_MASK_RECORDED                      ((wimp_poll_flags) 0x40000u)
  956. #define wimp_MASK_ACKNOWLEDGE                   ((wimp_poll_flags) 0x80000u)
  957. #define wimp_GIVEN_POLLWORD                     ((wimp_poll_flags) 0x400000u)
  958. #define wimp_POLL_HIGH_PRIORITY                 ((wimp_poll_flags) 0x800000u)
  959. #define wimp_SAVE_FP                            ((wimp_poll_flags) 0x1000000u)
  960. #define wimp_BROADCAST                          ((wimp_t) 0x0u)
  961. #define wimp_BACKGROUND                         ((wimp_w) 0xFFFFFFFFu)
  962. #define wimp_ICON_BAR                           ((wimp_w) 0xFFFFFFFEu)
  963. #define wimp_ICON_BAR_RIGHT                     ((wimp_w) 0xFFFFFFFFu)
  964. #define wimp_ICON_BAR_LEFT                      ((wimp_w) 0xFFFFFFFEu)
  965. #define wimp_ICON_BAR_LEFT_RELATIVE             ((wimp_w) 0xFFFFFFFDu)
  966. #define wimp_ICON_BAR_RIGHT_RELATIVE            ((wimp_w) 0xFFFFFFFCu)
  967. #define wimp_ICON_BAR_LEFT_HIGH_PRIORITY        ((wimp_w) 0xFFFFFFFBu)
  968. #define wimp_ICON_BAR_LEFT_LOW_PRIORITY         ((wimp_w) 0xFFFFFFFAu)
  969. #define wimp_ICON_BAR_RIGHT_LOW_PRIORITY        ((wimp_w) 0xFFFFFFF9u)
  970. #define wimp_ICON_BAR_RIGHT_HIGH_PRIORITY       ((wimp_w) 0xFFFFFFF8u)
  971. #define wimp_TOP                                ((wimp_w) 0xFFFFFFFFu)
  972. #define wimp_BOTTOM                             ((wimp_w) 0xFFFFFFFEu)
  973. #define wimp_HIDDEN                             ((wimp_w) 0xFFFFFFFDu)
  974. #define wimp_NO_ICON                            ((wimp_w) 0xFFFFFFFFu)
  975. #define wimp_ICON_WINDOW                        ((wimp_i) 0xFFFFFFFFu)
  976. #define wimp_ICON_BACK                          ((wimp_i) 0xFFFFFFFEu)
  977. #define wimp_ICON_CLOSE                         ((wimp_i) 0xFFFFFFFDu)
  978. #define wimp_ICON_TITLE                         ((wimp_i) 0xFFFFFFFCu)
  979. #define wimp_ICON_TOGGLE                        ((wimp_i) 0xFFFFFFFBu)
  980. #define wimp_ICON_SCROLL_UP                     ((wimp_i) 0xFFFFFFFAu)
  981. #define wimp_ICON_VSCROLL                       ((wimp_i) 0xFFFFFFF9u)
  982. #define wimp_ICON_SCROLL_DOWN                   ((wimp_i) 0xFFFFFFF8u)
  983. #define wimp_ICON_SIZE                          ((wimp_i) 0xFFFFFFF7u)
  984. #define wimp_ICON_SCROLL_LEFT                   ((wimp_i) 0xFFFFFFF6u)
  985. #define wimp_ICON_HSCROLL                       ((wimp_i) 0xFFFFFFF5u)
  986. #define wimp_ICON_SCROLL_RIGHT                  ((wimp_i) 0xFFFFFFF4u)
  987. #define wimp_ICON_FRAME                         ((wimp_i) 0xFFFFFFF3u)
  988. #define wimp_WINDOW_MOVEABLE                    ((wimp_window_flags) 0x2u)
  989. #define wimp_WINDOW_AUTO_REDRAW                 ((wimp_window_flags) 0x10u)
  990. #define wimp_WINDOW_PANE                        ((wimp_window_flags) 0x20u)
  991. #define wimp_WINDOW_NO_BOUNDS                   ((wimp_window_flags) 0x40u)
  992. #define wimp_WINDOW_SCROLL_REPEAT               ((wimp_window_flags) 0x100u)
  993. #define wimp_WINDOW_SCROLL                      ((wimp_window_flags) 0x200u)
  994. #define wimp_WINDOW_REAL_COLOURS                ((wimp_window_flags) 0x400u)
  995. #define wimp_WINDOW_BACK                        ((wimp_window_flags) 0x800u)
  996. #define wimp_WINDOW_HOT_KEYS                    ((wimp_window_flags) 0x1000u)
  997. #define wimp_WINDOW_BOUNDED                     ((wimp_window_flags) 0x2000u)
  998. #define wimp_WINDOW_IGNORE_XEXTENT              ((wimp_window_flags) 0x4000u)
  999. #define wimp_WINDOW_IGNORE_YEXTENT              ((wimp_window_flags) 0x8000u)
  1000. #define wimp_WINDOW_OPEN                        ((wimp_window_flags) 0x10000u)
  1001. #define wimp_WINDOW_NOT_COVERED                 ((wimp_window_flags) 0x20000u)
  1002. #define wimp_WINDOW_FULL_SIZE                   ((wimp_window_flags) 0x40000u)
  1003. #define wimp_WINDOW_TOGGLED                     ((wimp_window_flags) 0x80000u)
  1004. #define wimp_WINDOW_HAS_FOCUS                   ((wimp_window_flags) 0x100000u)
  1005. #define wimp_WINDOW_BOUNDED_ONCE                ((wimp_window_flags) 0x200000u)
  1006. #define wimp_WINDOW_BACK_ICON                   ((wimp_window_flags) 0x1000000u)
  1007. #define wimp_WINDOW_CLOSE_ICON                  ((wimp_window_flags) 0x2000000u)
  1008. #define wimp_WINDOW_TITLE_ICON                  ((wimp_window_flags) 0x4000000u)
  1009. #define wimp_WINDOW_TOGGLE_ICON                 ((wimp_window_flags) 0x8000000u)
  1010. #define wimp_WINDOW_VSCROLL                     ((wimp_window_flags) 0x10000000u)
  1011. #define wimp_WINDOW_SIZE_ICON                   ((wimp_window_flags) 0x20000000u)
  1012. #define wimp_WINDOW_HSCROLL                     ((wimp_window_flags) 0x40000000u)
  1013. #define wimp_WINDOW_NEW_FORMAT                  ((wimp_window_flags) 0x80000000u)
  1014. #define wimp_ICON_TEXT                          ((wimp_icon_flags) 0x1u)
  1015. #define wimp_ICON_SPRITE                        ((wimp_icon_flags) 0x2u)
  1016. #define wimp_ICON_BORDER                        ((wimp_icon_flags) 0x4u)
  1017. #define wimp_ICON_HCENTRED                      ((wimp_icon_flags) 0x8u)
  1018. #define wimp_ICON_VCENTRED                      ((wimp_icon_flags) 0x10u)
  1019. #define wimp_ICON_FILLED                        ((wimp_icon_flags) 0x20u)
  1020. #define wimp_ICON_ANTI_ALIASED                  ((wimp_icon_flags) 0x40u)
  1021. #define wimp_ICON_NEEDS_HELP                    ((wimp_icon_flags) 0x80u)
  1022. #define wimp_ICON_INDIRECTED                    ((wimp_icon_flags) 0x100u)
  1023. #define wimp_ICON_RJUSTIFIED                    ((wimp_icon_flags) 0x200u)
  1024. #define wimp_ICON_ALLOW_ADJUST                  ((wimp_icon_flags) 0x400u)
  1025. #define wimp_ICON_HALF_SIZE                     ((wimp_icon_flags) 0x800u)
  1026. #define wimp_ICON_BUTTON_TYPE_SHIFT             12
  1027. #define wimp_ICON_BUTTON_TYPE                   ((wimp_icon_flags) 0xF000u)
  1028. #define wimp_ICON_ESG_SHIFT                     16
  1029. #define wimp_ICON_ESG                           ((wimp_icon_flags) 0x1F0000u)
  1030. #define wimp_ICON_SELECTED                      ((wimp_icon_flags) 0x200000u)
  1031. #define wimp_ICON_SHADED                        ((wimp_icon_flags) 0x400000u)
  1032. #define wimp_ICON_DELETED                       ((wimp_icon_flags) 0x800000u)
  1033. #define wimp_ICON_FG_COLOUR_SHIFT               24
  1034. #define wimp_ICON_FG_COLOUR                     ((wimp_icon_flags) 0xF000000u)
  1035. #define wimp_ICON_BG_COLOUR_SHIFT               28
  1036. #define wimp_ICON_BG_COLOUR                     ((wimp_icon_flags) 0xF0000000u)
  1037. #define wimp_ICON_FONT_HANDLE_SHIFT             24
  1038. #define wimp_ICON_FONT_HANDLE                   ((wimp_icon_flags) 0xFF000000u)
  1039. #define wimp_BUTTON_NEVER                       ((wimp_icon_flags) 0x0u)
  1040. #define wimp_BUTTON_ALWAYS                      ((wimp_icon_flags) 0x1u)
  1041. #define wimp_BUTTON_REPEAT                      ((wimp_icon_flags) 0x2u)
  1042. #define wimp_BUTTON_CLICK                       ((wimp_icon_flags) 0x3u)
  1043. #define wimp_BUTTON_RELEASE                     ((wimp_icon_flags) 0x4u)
  1044. #define wimp_BUTTON_DOUBLE_CLICK                ((wimp_icon_flags) 0x5u)
  1045. #define wimp_BUTTON_CLICK_DRAG                  ((wimp_icon_flags) 0x6u)
  1046. #define wimp_BUTTON_RELEASE_DRAG                ((wimp_icon_flags) 0x7u)
  1047. #define wimp_BUTTON_DOUBLE_DRAG                 ((wimp_icon_flags) 0x8u)
  1048. #define wimp_BUTTON_MENU_ICON                   ((wimp_icon_flags) 0x9u)
  1049. #define wimp_BUTTON_DOUBLE_CLICK_DRAG           ((wimp_icon_flags) 0xAu)
  1050. #define wimp_BUTTON_RADIO                       ((wimp_icon_flags) 0xBu)
  1051. #define wimp_BUTTON_WRITE_CLICK_DRAG            ((wimp_icon_flags) 0xEu)
  1052. #define wimp_BUTTON_WRITABLE                    ((wimp_icon_flags) 0xFu)
  1053. #define wimp_MENU_TICKED                        ((wimp_menu_flags) 0x1u)
  1054. #define wimp_MENU_SEPARATE                      ((wimp_menu_flags) 0x2u)
  1055. #define wimp_MENU_WRITABLE                      ((wimp_menu_flags) 0x4u)
  1056. #define wimp_MENU_GIVE_WARNING                  ((wimp_menu_flags) 0x8u)
  1057. #define wimp_MENU_SUB_MENU_WHEN_SHADED          ((wimp_menu_flags) 0x10u)
  1058. #define wimp_MENU_LAST                          ((wimp_menu_flags) 0x80u)
  1059. #define wimp_MENU_TITLE_INDIRECTED              ((wimp_menu_flags) 0x100u)
  1060. #define wimp_CLOSE_MENU                         ((wimp_menu *) 0xFFFFFFFFu)
  1061. #define wimp_NO_SUB_MENU                        ((wimp_menu *) 0xFFFFFFFFu)
  1062. #define wimp_DEFER_SUB_MENU                     ((wimp_menu *) 0x1u)
  1063. #define wimp_NO_FONTS                           ((font_f *) 0xFFFFFFFFu)
  1064. #define wimp_CLICK_ADJUST                       ((wimp_mouse_state) 0x1u)
  1065. #define wimp_DOUBLE_ADJUST                      ((wimp_mouse_state) 0x1u)
  1066. #define wimp_CLICK_MENU                         ((wimp_mouse_state) 0x2u)
  1067. #define wimp_CLICK_SELECT                       ((wimp_mouse_state) 0x4u)
  1068. #define wimp_DOUBLE_SELECT                      ((wimp_mouse_state) 0x4u)
  1069. #define wimp_DRAG_ADJUST                        ((wimp_mouse_state) 0x10u)
  1070. #define wimp_DRAG_SELECT                        ((wimp_mouse_state) 0x40u)
  1071. #define wimp_SINGLE_ADJUST                      ((wimp_mouse_state) 0x100u)
  1072. #define wimp_SINGLE_SELECT                      ((wimp_mouse_state) 0x400u)
  1073. #define wimp_MENU_ITEM_HEIGHT                   44
  1074. #define wimp_MENU_ITEM_GAP                      0
  1075. #define wimp_MENU_ITEM_SEPARATION               24
  1076. #define wimp_DRAG_SYSTEM_POSITION               ((wimp_drag_type) 0x1u)
  1077. #define wimp_DRAG_SYSTEM_SIZE                   ((wimp_drag_type) 0x2u)
  1078. #define wimp_DRAG_SYSTEM_HSCROLL                ((wimp_drag_type) 0x3u)
  1079. #define wimp_DRAG_SYSTEM_VSCROLL                ((wimp_drag_type) 0x4u)
  1080. #define wimp_DRAG_USER_FIXED                    ((wimp_drag_type) 0x5u)
  1081. #define wimp_DRAG_USER_RUBBER                   ((wimp_drag_type) 0x6u)
  1082. #define wimp_DRAG_USER_POINT                    ((wimp_drag_type) 0x7u)
  1083. #define wimp_DRAG_ASM_FIXED                     ((wimp_drag_type) 0x8u)
  1084. #define wimp_DRAG_ASM_RUBBER                    ((wimp_drag_type) 0x9u)
  1085. #define wimp_DRAG_ASM_FIXED_INDEFINITE          ((wimp_drag_type) 0xAu)
  1086. #define wimp_DRAG_ASM_RUBBER_INDEFINITE         ((wimp_drag_type) 0xBu)
  1087. #define wimp_DRAG_SYSTEM_SCROLL_BOTH            ((wimp_drag_type) 0xCu)
  1088. #define wimp_KEY_BACKSPACE                      ((wimp_key_no) 0x8u)
  1089. #define wimp_KEY_RETURN                         ((wimp_key_no) 0xDu)
  1090. #define wimp_KEY_ESCAPE                         ((wimp_key_no) 0x1Bu)
  1091. #define wimp_KEY_HOME                           ((wimp_key_no) 0x1Eu)
  1092. #define wimp_KEY_DELETE                         ((wimp_key_no) 0x7Fu)
  1093. #define wimp_KEY_SHIFT                          ((wimp_key_no) 0x10u)
  1094. #define wimp_KEY_CONTROL                        ((wimp_key_no) 0x20u)
  1095. #define wimp_KEY_PRINT                          ((wimp_key_no) 0x180u)
  1096. #define wimp_KEY_F1                             ((wimp_key_no) 0x181u)
  1097. #define wimp_KEY_F2                             ((wimp_key_no) 0x182u)
  1098. #define wimp_KEY_F3                             ((wimp_key_no) 0x183u)
  1099. #define wimp_KEY_F4                             ((wimp_key_no) 0x184u)
  1100. #define wimp_KEY_F5                             ((wimp_key_no) 0x185u)
  1101. #define wimp_KEY_F6                             ((wimp_key_no) 0x186u)
  1102. #define wimp_KEY_F7                             ((wimp_key_no) 0x187u)
  1103. #define wimp_KEY_F8                             ((wimp_key_no) 0x188u)
  1104. #define wimp_KEY_F9                             ((wimp_key_no) 0x189u)
  1105. #define wimp_KEY_TAB                            ((wimp_key_no) 0x18Au)
  1106. #define wimp_KEY_COPY                           ((wimp_key_no) 0x18Bu)
  1107. #define wimp_KEY_LEFT                           ((wimp_key_no) 0x18Cu)
  1108. #define wimp_KEY_RIGHT                          ((wimp_key_no) 0x18Du)
  1109. #define wimp_KEY_F10                            ((wimp_key_no) 0x1CAu)
  1110. #define wimp_KEY_F11                            ((wimp_key_no) 0x1CBu)
  1111. #define wimp_KEY_F12                            ((wimp_key_no) 0x1CCu)
  1112. #define wimp_KEY_INSERT                         ((wimp_key_no) 0x1CDu)
  1113. #define wimp_KEY_DOWN                           ((wimp_key_no) 0x18Eu)
  1114. #define wimp_KEY_UP                             ((wimp_key_no) 0x18Fu)
  1115. #define wimp_KEY_PAGE_DOWN                      ((wimp_key_no) 0x19Eu)
  1116. #define wimp_KEY_PAGE_UP                        ((wimp_key_no) 0x19Fu)
  1117. #define message_QUIT                            0x0u
  1118. #define message_DATA_SAVE                       0x1u
  1119. #define message_DATA_SAVE_ACK                   0x2u
  1120. #define message_DATA_LOAD                       0x3u
  1121. #define message_DATA_LOAD_ACK                   0x4u
  1122. #define message_DATA_OPEN                       0x5u
  1123. #define message_RAM_FETCH                       0x6u
  1124. #define message_RAM_TRANSMIT                    0x7u
  1125. #define message_PREQUIT                         0x8u
  1126. #define message_PALETTE_CHANGE                  0x9u
  1127. #define message_SAVE_DESKTOP                    0xAu
  1128. #define message_DEVICE_CLAIM                    0xBu
  1129. #define message_DEVICE_IN_USE                   0xCu
  1130. #define message_DATA_SAVED                      0xDu
  1131. #define message_SHUTDOWN                        0xEu
  1132. #define message_CLAIM_ENTITY                    0xFu
  1133. #define message_DATA_REQUEST                    0x10u
  1134. #define message_DRAGGING                        0x11u
  1135. #define message_DRAG_CLAIM                      0x12u
  1136. #define message_MENU_WARNING                    0x400C0u
  1137. #define message_MODE_CHANGE                     0x400C1u
  1138. #define message_TASK_INITIALISE                 0x400C2u
  1139. #define message_TASK_CLOSE_DOWN                 0x400C3u
  1140. #define message_SLOT_SIZE                       0x400C4u
  1141. #define message_SET_SLOT                        0x400C5u
  1142. #define message_TASK_NAME_RQ                    0x400C6u
  1143. #define message_TASK_NAME_IS                    0x400C7u
  1144. #define message_TASK_STARTED                    0x400C8u
  1145. #define message_MENUS_DELETED                   0x400C9u
  1146. #define message_ICONISE                         0x400CAu
  1147. #define message_WINDOW_CLOSED                   0x400CBu
  1148. #define message_WINDOW_INFO                     0x400CCu
  1149. #define message_SWAP                            0x400CDu
  1150. #define message_TOOLS_CHANGED                   0x400CEu
  1151. #define message_FONT_CHANGED                    0x400CFu
  1152. #define wimp_ERROR_BOX_OK_ICON                  ((wimp_error_box_flags) 0x1u)
  1153. #define wimp_ERROR_BOX_CANCEL_ICON              ((wimp_error_box_flags) 0x2u)
  1154. #define wimp_ERROR_BOX_HIGHLIGHT_CANCEL         ((wimp_error_box_flags) 0x4u)
  1155. #define wimp_ERROR_BOX_NO_PROMPT                ((wimp_error_box_flags) 0x8u)
  1156. #define wimp_ERROR_BOX_SHORT_TITLE              ((wimp_error_box_flags) 0x10u)
  1157. #define wimp_ERROR_BOX_LEAVE_OPEN               ((wimp_error_box_flags) 0x20u)
  1158. #define wimp_ERROR_BOX_CLOSE                    ((wimp_error_box_flags) 0x40u)
  1159. #define wimp_ERROR_BOX_NO_BEEP                  ((wimp_error_box_flags) 0x80u)
  1160. #define wimp_ERROR_BOX_GIVEN_CATEGORY           ((wimp_error_box_flags) 0x100u)
  1161. #define wimp_ERROR_BOX_CATEGORY                 ((wimp_error_box_flags) 0xE00u)
  1162. #define wimp_ERROR_BOX_CATEGORY_SHIFT           9
  1163. #define wimp_ERROR_BOX_CATEGORY_INFO            ((wimp_error_box_flags) 0x1u)
  1164. #define wimp_ERROR_BOX_CATEGORY_ERROR           ((wimp_error_box_flags) 0x2u)
  1165. #define wimp_ERROR_BOX_CATEGORY_PROGRAM         ((wimp_error_box_flags) 0x3u)
  1166. #define wimp_ERROR_BOX_CATEGORY_QUESTION        ((wimp_error_box_flags) 0x4u)
  1167. #define wimp_ERROR_BOX_SELECTED_NOTHING         ((wimp_error_box_selection) 0x0u)
  1168. #define wimp_ERROR_BOX_SELECTED_OK              ((wimp_error_box_selection) 0x1u)
  1169. #define wimp_ERROR_BOX_SELECTED_CANCEL          ((wimp_error_box_selection) 0x2u)
  1170. #define wimp_COLOUR_WHITE                       ((wimp_colour) 0x0u)
  1171. #define wimp_COLOUR_VERY_LIGHT_GREY             ((wimp_colour) 0x1u)
  1172. #define wimp_COLOUR_LIGHT_GREY                  ((wimp_colour) 0x2u)
  1173. #define wimp_COLOUR_MID_LIGHT_GREY              ((wimp_colour) 0x3u)
  1174. #define wimp_COLOUR_MID_DARK_GREY               ((wimp_colour) 0x4u)
  1175. #define wimp_COLOUR_DARK_GREY                   ((wimp_colour) 0x5u)
  1176. #define wimp_COLOUR_VERY_DARK_GREY              ((wimp_colour) 0x6u)
  1177. #define wimp_COLOUR_BLACK                       ((wimp_colour) 0x7u)
  1178. #define wimp_COLOUR_DARK_BLUE                   ((wimp_colour) 0x8u)
  1179. #define wimp_COLOUR_YELLOW                      ((wimp_colour) 0x9u)
  1180. #define wimp_COLOUR_LIGHT_GREEN                 ((wimp_colour) 0xAu)
  1181. #define wimp_COLOUR_RED                         ((wimp_colour) 0xBu)
  1182. #define wimp_COLOUR_CREAM                       ((wimp_colour) 0xCu)
  1183. #define wimp_COLOUR_DARK_GREEN                  ((wimp_colour) 0xDu)
  1184. #define wimp_COLOUR_ORANGE                      ((wimp_colour) 0xEu)
  1185. #define wimp_COLOUR_LIGHT_BLUE                  ((wimp_colour) 0xFu)
  1186. #define wimp_COLOUR_TRANSPARENT                 ((wimp_colour) 0xFFFFFFFFu)
  1187. #define wimp_PRE_QUIT_TASK_ONLY                 ((wimp_pre_quit_flags) 0x1u)
  1188. #define error_WIMP_NO_CLAIM                     0x280u
  1189.       /*Wimp unable to claim work area*/
  1190. #define error_WIMP_BAD_OP                       0x281u
  1191.       /*Invalid Wimp operation in this context*/
  1192. #define error_WIMP_RECT_FULL                    0x282u
  1193.       /*Rectangle area full*/
  1194. #define error_WIMP_TOO_MANY                     0x283u
  1195.       /*Too many windows*/
  1196. #define error_WIMP_TOO_BIG                      0x284u
  1197.       /*Window definition won't fit*/
  1198. #define error_WIMP_DIV_BY0                      0x285u
  1199.       /*Division by zero*/
  1200. #define error_WIMP_GET_RECT                     0x286u
  1201.       /*Get_Rectangle not called correctly*/
  1202. #define error_WIMP_FOCUS                        0x287u
  1203.       /*Input focus window not found*/
  1204. #define error_WIMP_BAD_HANDLE                   0x288u
  1205.       /*Illegal window handle*/
  1206. #define error_WIMP_TOO_MENUS                    0x289u
  1207.       /*Too many menus*/
  1208. #define error_WIMP_BAD_EXTENT                   0x28Au
  1209.       /*Bad work area extent*/
  1210. #define error_WIMP_BAD_POINTER                  0x28Bu
  1211.       /*Syntax: *POINTER <0|1|2>*/
  1212. #define error_WIMP_NO_TEMPLATE_FILE             0x28Cu
  1213.       /*Template file not found*/
  1214. #define error_WIMP_BAD_TEMPLATE                 0x28Du
  1215.       /*Template entry invalid*/
  1216. #define error_WIMP_BAD_FONTS                    0x28Eu
  1217.       /*Unable to bind font handle*/
  1218. #define error_WIMP_BAD_SYNTAX                   0x28Fu
  1219.       /*Syntax error in validation string*/
  1220. #define error_WIMP_NO_TASKS                     0x290u
  1221.       /*Too many tasks*/
  1222. #define error_WIMP_NO_TEMPLATE                  0x291u
  1223.       /*Template entry not found*/
  1224. #define error_WIMP_NOT_PRESENT                  0x292u
  1225.       /*Window manager not present/too old*/
  1226. #define error_WIMP_IN_USE                       0x293u
  1227.       /*Window manager in use*/
  1228. #define error_WIMP_BAD_PAL_FILE                 0x294u
  1229.       /*Error in palette file*/
  1230. #define error_WIMP_BAD_VERSION                  0x295u
  1231.       /*Bad version number*/
  1232. #define error_WIMP_BAD_MESSAGE_SIZE             0x296u
  1233.       /*Message block too big/not a multiple of 4*/
  1234. #define error_WIMP_BAD_REASON_CODE              0x297u
  1235.       /*Illegal reason code*/
  1236. #define error_WIMP_BAD_TASK_HANDLE              0x298u
  1237.       /*Illegal task handle*/
  1238. #define error_WIMP_CANT_TASK                    0x299u
  1239.       /*Can't start task from here*/
  1240. #define error_WIMP_BAD_SUB_MENU                 0x29Au
  1241.       /*SubMenus require a parent menu tree*/
  1242. #define error_WIMP_OWNER_WINDOW                 0x29Bu
  1243.       /*Access to window denied*/
  1244. #define error_WIMP_BAD_MODE                     0x29Cu
  1245.       /*Bad Wimp mode*/
  1246. #define error_WIMP_BAD_TRANSFER                 0x29Du
  1247.       /*Wimp transfer out of range*/
  1248. #define error_WIMP_BAD_SYS_INFO                 0x29Eu
  1249.       /*Bad parameter passed to Wimp in R0*/
  1250. #define error_WIMP_BAD_PTR_IN_R1                0x29Fu
  1251.       /*Bad pointer passed to Wimp in R1*/
  1252. #define error_WIMP_BAD_ESCAPE_STATE             0x2A0u
  1253.       /*Wimp_Poll called with escape enabled*/
  1254. #define error_WIMP_BAD_ICON_HANDLE              0x2A1u
  1255.       /*Illegal icon handle*/
  1256. #define error_WIMP_BAD_R3                       0x2A2u
  1257.       /*Illegal Wimp_Poll pointer in R3*/
  1258. #define error_WIMP_NO_DOT_IN_FILENAME           0x2A3u
  1259.       /*To save: drag the icon to a directory viewer*/
  1260. #define error_WIMP_TEMPLATE_EOF                 0x2A4u
  1261.       /*End of file while reading template file*/
  1262. #define error_WIMP_BAD_SLOT                     0x2A5u
  1263.       /*Wimp transfer required paging in beyond end of slot*/
  1264. #define error_WIMP_BAD_CONF_FONT                0x2A6u
  1265.       /*bad configuration font*/
  1266. #define error_WIMP_NO_SPRITES                   0x2A7u
  1267.       /*Not enough room for sprites*/
  1268. #define error_WIMP_BAD_PAL_FILE2                0x2A8u
  1269.       /*BadPalFile2 */
  1270. #define error_WIMP_BAD_SPRITES                  0x2A9u
  1271.       /*Squashed or missing sprite file*/
  1272. #define wimp_PRIORITY_TASK_MANAGER              ((wimp_priority) 0x60000000u)
  1273. #define wimp_PRIORITY_PALETTE_UTILITY           ((wimp_priority) 0x20000000u)
  1274. #define wimp_PRIORITY_ADFS_FILER_HARD_DISCS     ((wimp_priority) 0x70000000u)
  1275. #define wimp_PRIORITY_ADFS_FILER_FLOPPY_DISCS   ((wimp_priority) 0x60000000u)
  1276. #define wimp_PRIORITY_RESOURCE_FILER            ((wimp_priority) 0x50000000u)
  1277. #define wimp_PRIORITY_RAMFS_FILER               ((wimp_priority) 0x40000000u)
  1278. #define wimp_PRIORITY_NFS_FILER                 ((wimp_priority) 0x30000000u)
  1279. #define wimp_PRIORITY_NET_FILER                 ((wimp_priority) 0x20000000u)
  1280. #define wimp_PRIORITY_PRINTERS                  ((wimp_priority) 0xF000000u)
  1281. #define wimp_PRIORITY_TINY_DIRS                 ((wimp_priority) 0xC0000000u)
  1282. #define wimp_GIVEN_WINDOW_AND_ICON              ((wimp_menu_state_flags) 0x1u)
  1283. #define wimp_DEFAULT_PALETTE                    ((os_palette *) 0xFFFFFFFFu)
  1284. #define wimp_PALETTE                            ((os_palette *) 0x0u)
  1285. #define wimptextop_GIVEN_BASELINE               ((wimptextop_paint_flags) 0x40000000u)
  1286. #define wimptextop_RJUSTIFY                     ((wimptextop_paint_flags) 0x80000000u)
  1287.  
  1288. /*************************
  1289.  * Function declarations *
  1290.  *************************/
  1291.  
  1292. #ifdef __cplusplus
  1293.    extern "C" {
  1294. #endif
  1295.  
  1296. /* ------------------------------------------------------------------------
  1297.  * Function:      wimp_initialise()
  1298.  *
  1299.  * Description:   Registers a task with the Wimp
  1300.  *
  1301.  * Input:         version - value of R0 on entry
  1302.  *                name - value of R2 on entry
  1303.  *                messages - value of R3 on entry
  1304.  *
  1305.  * Output:        version_out - value of R0 on exit
  1306.  *                task_out - value of R1 on exit (X version only)
  1307.  *
  1308.  * Returns:       R1 (non-X version only)
  1309.  *
  1310.  * Other notes:   Calls SWI 0x400C0 with R1 = 0x4B534154.
  1311.  */
  1312.  
  1313. extern os_error *xwimp_initialise (wimp_version_no version,
  1314.       char const *name,
  1315.       wimp_message_list const *messages,
  1316.       wimp_version_no *version_out,
  1317.       wimp_t *task_out);
  1318. extern wimp_t wimp_initialise (wimp_version_no version,
  1319.       char const *name,
  1320.       wimp_message_list const *messages,
  1321.       wimp_version_no *version_out);
  1322.  
  1323. /* ------------------------------------------------------------------------
  1324.  * Function:      wimp_create_window()
  1325.  *
  1326.  * Description:   Tells the Wimp what the characteristics of a window are
  1327.  *
  1328.  * Input:         window - value of R1 on entry
  1329.  *
  1330.  * Output:        w - value of R0 on exit (X version only)
  1331.  *
  1332.  * Returns:       R0 (non-X version only)
  1333.  *
  1334.  * Other notes:   Calls SWI 0x400C1.
  1335.  */
  1336.  
  1337. extern os_error *xwimp_create_window (wimp_window const *window,
  1338.       wimp_w *w);
  1339. extern wimp_w wimp_create_window (wimp_window const *window);
  1340.  
  1341. /* ------------------------------------------------------------------------
  1342.  * Function:      wimp_create_icon()
  1343.  *
  1344.  * Description:   Tells the Wimp what the characteristics of an icon are
  1345.  *
  1346.  * Input:         icon - value of R1 on entry
  1347.  *
  1348.  * Output:        i - value of R0 on exit (X version only)
  1349.  *
  1350.  * Returns:       R0 (non-X version only)
  1351.  *
  1352.  * Other notes:   Calls SWI 0x400C2.
  1353.  */
  1354.  
  1355. extern os_error *xwimp_create_icon (wimp_icon_create const *icon,
  1356.       wimp_i *i);
  1357. extern wimp_i wimp_create_icon (wimp_icon_create const *icon);
  1358.  
  1359. /* ------------------------------------------------------------------------
  1360.  * Function:      wimp_create_icon_relative()
  1361.  *
  1362.  * Description:   Tells the Wimp what the characteristics of an iconbar
  1363.  *                icon with a fixed relative position are
  1364.  *
  1365.  * Input:         neighbour - value of R0 on entry
  1366.  *                icon - value of R1 on entry
  1367.  *
  1368.  * Output:        i - value of R0 on exit (X version only)
  1369.  *
  1370.  * Returns:       R0 (non-X version only)
  1371.  *
  1372.  * Other notes:   Calls SWI 0x400C2.
  1373.  */
  1374.  
  1375. extern os_error *xwimp_create_icon_relative (wimp_i neighbour,
  1376.       wimp_icon_create const *icon,
  1377.       wimp_i *i);
  1378. __swi (0x400C2) wimp_i wimp_create_icon_relative (wimp_i neighbour,
  1379.       wimp_icon_create const *icon);
  1380.  
  1381. /* ------------------------------------------------------------------------
  1382.  * Function:      wimp_create_icon_prioritised()
  1383.  *
  1384.  * Description:   Tells the Wimp what the characteristics of an iconbar
  1385.  *                icon with a fixed priority are
  1386.  *
  1387.  * Input:         priority - value of R0 on entry
  1388.  *                icon - value of R1 on entry
  1389.  *
  1390.  * Output:        i - value of R0 on exit (X version only)
  1391.  *
  1392.  * Returns:       R0 (non-X version only)
  1393.  *
  1394.  * Other notes:   Calls SWI 0x400C2.
  1395.  */
  1396.  
  1397. extern os_error *xwimp_create_icon_prioritised (wimp_priority priority,
  1398.       wimp_icon_create const *icon,
  1399.       wimp_i *i);
  1400. __swi (0x400C2) wimp_i wimp_create_icon_prioritised (wimp_priority priority,
  1401.       wimp_icon_create const *icon);
  1402.  
  1403. /* ------------------------------------------------------------------------
  1404.  * Function:      wimp_delete_window()
  1405.  *
  1406.  * Description:   Closes a specified window if it is still open, and then
  1407.  *                removes its definition
  1408.  *
  1409.  * Input:         w - component 0
  1410.  *
  1411.  * Other notes:   Calls SWI 0x400C3.
  1412.  */
  1413.  
  1414. extern os_error *xwimp_delete_window (wimp_w w);
  1415. extern void wimp_delete_window (wimp_w w);
  1416.  
  1417. /* ------------------------------------------------------------------------
  1418.  * Function:      wimp_delete_icon()
  1419.  *
  1420.  * Description:   Removes the definition of a specified icon
  1421.  *
  1422.  * Input:         w - component 0
  1423.  *                i - component 1
  1424.  *
  1425.  * Other notes:   Calls SWI 0x400C4.
  1426.  */
  1427.  
  1428. extern os_error *xwimp_delete_icon (wimp_w w,
  1429.       wimp_i i);
  1430. extern void wimp_delete_icon (wimp_w w,
  1431.       wimp_i i);
  1432.  
  1433. /* ------------------------------------------------------------------------
  1434.  * Function:      wimp_open_window()
  1435.  *
  1436.  * Description:   Updates the list of active windows (ones that are to be
  1437.  *                displayed)
  1438.  *
  1439.  * Input:         open - value of R1 on entry
  1440.  *
  1441.  * Other notes:   Calls SWI 0x400C5.
  1442.  */
  1443.  
  1444. extern os_error *xwimp_open_window (wimp_open const *open);
  1445. extern void wimp_open_window (wimp_open const *open);
  1446.  
  1447. /* ------------------------------------------------------------------------
  1448.  * Function:      wimp_close_window()
  1449.  *
  1450.  * Description:   Removes the specified window from the active list
  1451.  *
  1452.  * Input:         w - component 0
  1453.  *
  1454.  * Other notes:   Calls SWI 0x400C6.
  1455.  */
  1456.  
  1457. extern os_error *xwimp_close_window (wimp_w w);
  1458. extern void wimp_close_window (wimp_w w);
  1459.  
  1460. /* ------------------------------------------------------------------------
  1461.  * Function:      wimp_poll()
  1462.  *
  1463.  * Description:   Polls the Wimp to see whether certain events have
  1464.  *                occurred
  1465.  *
  1466.  * Input:         mask - value of R0 on entry
  1467.  *                block - value of R1 on entry
  1468.  *                pollword - value of R3 on entry
  1469.  *
  1470.  * Output:        event - value of R0 on exit (X version only)
  1471.  *
  1472.  * Returns:       R0 (non-X version only)
  1473.  *
  1474.  * Other notes:   Calls SWI 0x400C7.
  1475.  */
  1476.  
  1477. extern os_error *xwimp_poll (wimp_poll_flags mask,
  1478.       wimp_block *block,
  1479.       int *pollword,
  1480.       wimp_event_no *event);
  1481. extern wimp_event_no wimp_poll (wimp_poll_flags mask,
  1482.       wimp_block *block,
  1483.       int *pollword);
  1484.  
  1485. /* ------------------------------------------------------------------------
  1486.  * Function:      wimp_redraw_window()
  1487.  *
  1488.  * Description:   Starts a redraw of the parts of a window that are not up
  1489.  *                to date
  1490.  *
  1491.  * Input:         redraw - value of R1 on entry
  1492.  *
  1493.  * Output:        more - value of R0 on exit (X version only)
  1494.  *
  1495.  * Returns:       R0 (non-X version only)
  1496.  *
  1497.  * Other notes:   Calls SWI 0x400C8.
  1498.  */
  1499.  
  1500. extern os_error *xwimp_redraw_window (wimp_draw *redraw,
  1501.       bool *more);
  1502. extern bool wimp_redraw_window (wimp_draw *redraw);
  1503.  
  1504. /* ------------------------------------------------------------------------
  1505.  * Function:      wimp_update_window()
  1506.  *
  1507.  * Description:   Starts a redraw of the parts of a window that are up to
  1508.  *                date
  1509.  *
  1510.  * Input:         update - value of R1 on entry
  1511.  *
  1512.  * Output:        more - value of R0 on exit (X version only)
  1513.  *
  1514.  * Returns:       R0 (non-X version only)
  1515.  *
  1516.  * Other notes:   Calls SWI 0x400C9.
  1517.  */
  1518.  
  1519. extern os_error *xwimp_update_window (wimp_draw *update,
  1520.       bool *more);
  1521. extern bool wimp_update_window (wimp_draw *update);
  1522.  
  1523. /* ------------------------------------------------------------------------
  1524.  * Function:      wimp_get_rectangle()
  1525.  *
  1526.  * Description:   Returns the details of the next rectangle of the work
  1527.  *                area to be drawn
  1528.  *
  1529.  * Input:         draw - Partially filled in on entry
  1530.  *
  1531.  * Output:        more - value of R0 on exit (X version only)
  1532.  *
  1533.  * Returns:       R0 (non-X version only)
  1534.  *
  1535.  * Other notes:   Calls SWI 0x400CA.
  1536.  */
  1537.  
  1538. extern os_error *xwimp_get_rectangle (wimp_draw *draw,
  1539.       bool *more);
  1540. extern bool wimp_get_rectangle (wimp_draw *draw);
  1541.  
  1542. /* ------------------------------------------------------------------------
  1543.  * Function:      wimp_get_window_state()
  1544.  *
  1545.  * Description:   Returns a summary of the given window's state
  1546.  *
  1547.  * Input:         state - Partially filled in on entry
  1548.  *
  1549.  * Other notes:   Calls SWI 0x400CB.
  1550.  */
  1551.  
  1552. extern os_error *xwimp_get_window_state (wimp_window_state *state);
  1553. extern void wimp_get_window_state (wimp_window_state *state);
  1554.  
  1555. /* ------------------------------------------------------------------------
  1556.  * Function:      wimp_get_window_info()
  1557.  *
  1558.  * Description:   Returns complete details of the given window's state
  1559.  *
  1560.  * Input:         info - Partially filled in on entry
  1561.  *
  1562.  * Other notes:   Calls SWI 0x400CC.
  1563.  */
  1564.  
  1565. extern os_error *xwimp_get_window_info (wimp_window_info *info);
  1566. extern void wimp_get_window_info (wimp_window_info *info);
  1567.  
  1568. /* ------------------------------------------------------------------------
  1569.  * Function:      wimp_get_window_info_header_only()
  1570.  *
  1571.  * Description:   Returns complete details of the given window's state,
  1572.  *                excluding icons
  1573.  *
  1574.  * Input:         info - Partially filled in on entry
  1575.  *
  1576.  * Other notes:   Calls SWI 0x400CC with R1 |= 0x1.
  1577.  */
  1578.  
  1579. extern os_error *xwimp_get_window_info_header_only (wimp_window_info *info);
  1580. extern void wimp_get_window_info_header_only (wimp_window_info *info);
  1581.  
  1582. /* ------------------------------------------------------------------------
  1583.  * Function:      wimp_set_icon_state()
  1584.  *
  1585.  * Description:   Sets a given icon's state held in its flags word
  1586.  *
  1587.  * Input:         w - component 0
  1588.  *                i - component 1
  1589.  *                eor_bits - component 2
  1590.  *                clear_bits - component 3
  1591.  *
  1592.  * Other notes:   Calls SWI 0x400CD.
  1593.  */
  1594.  
  1595. extern os_error *xwimp_set_icon_state (wimp_w w,
  1596.       wimp_i i,
  1597.       wimp_icon_flags eor_bits,
  1598.       wimp_icon_flags clear_bits);
  1599. extern void wimp_set_icon_state (wimp_w w,
  1600.       wimp_i i,
  1601.       wimp_icon_flags eor_bits,
  1602.       wimp_icon_flags clear_bits);
  1603.  
  1604. /* ------------------------------------------------------------------------
  1605.  * Function:      wimp_get_icon_state()
  1606.  *
  1607.  * Description:   Returns a given icon's state held in its flags word
  1608.  *
  1609.  * Input:         icon_state - Partially filled in on entry
  1610.  *
  1611.  * Other notes:   Calls SWI 0x400CE.
  1612.  */
  1613.  
  1614. extern os_error *xwimp_get_icon_state (wimp_icon_state *icon_state);
  1615. extern void wimp_get_icon_state (wimp_icon_state *icon_state);
  1616.  
  1617. /* ------------------------------------------------------------------------
  1618.  * Function:      wimp_get_pointer_info()
  1619.  *
  1620.  * Description:   Returns the position of the pointer and the state of the
  1621.  *                mouse buttons
  1622.  *
  1623.  * Input:         pointer - value of R1 on entry
  1624.  *
  1625.  * Other notes:   Calls SWI 0x400CF.
  1626.  */
  1627.  
  1628. extern os_error *xwimp_get_pointer_info (wimp_pointer *pointer);
  1629. extern void wimp_get_pointer_info (wimp_pointer *pointer);
  1630.  
  1631. /* ------------------------------------------------------------------------
  1632.  * Function:      wimp_drag_box()
  1633.  *
  1634.  * Description:   Initiates or cancels a dragging operation
  1635.  *
  1636.  * Input:         drag - value of R1 on entry
  1637.  *
  1638.  * Other notes:   Calls SWI 0x400D0.
  1639.  */
  1640.  
  1641. extern os_error *xwimp_drag_box (wimp_drag const *drag);
  1642. extern void wimp_drag_box (wimp_drag const *drag);
  1643.  
  1644. /* ------------------------------------------------------------------------
  1645.  * Function:      wimp_force_redraw()
  1646.  *
  1647.  * Description:   Forces an area of a window or the screen to be redrawn
  1648.  *                later
  1649.  *
  1650.  * Input:         w - value of R0 on entry
  1651.  *                x0 - value of R1 on entry
  1652.  *                y0 - value of R2 on entry
  1653.  *                x1 - value of R3 on entry
  1654.  *                y1 - value of R4 on entry
  1655.  *
  1656.  * Other notes:   Calls SWI 0x400D1.
  1657.  */
  1658.  
  1659. extern os_error *xwimp_force_redraw (wimp_w w,
  1660.       int x0,
  1661.       int y0,
  1662.       int x1,
  1663.       int y1);
  1664. extern void wimp_force_redraw (wimp_w w,
  1665.       int x0,
  1666.       int y0,
  1667.       int x1,
  1668.       int y1);
  1669.  
  1670. /* ------------------------------------------------------------------------
  1671.  * Function:      wimp_set_caret_position()
  1672.  *
  1673.  * Description:   Sets up the data for a new caret position, and redraws it
  1674.  *                there
  1675.  *
  1676.  * Input:         w - value of R0 on entry
  1677.  *                i - value of R1 on entry
  1678.  *                x - value of R2 on entry
  1679.  *                y - value of R3 on entry
  1680.  *                height - value of R4 on entry
  1681.  *                index - value of R5 on entry
  1682.  *
  1683.  * Other notes:   Calls SWI 0x400D2.
  1684.  */
  1685.  
  1686. extern os_error *xwimp_set_caret_position (wimp_w w,
  1687.       wimp_i i,
  1688.       int x,
  1689.       int y,
  1690.       int height,
  1691.       int index);
  1692. extern void wimp_set_caret_position (wimp_w w,
  1693.       wimp_i i,
  1694.       int x,
  1695.       int y,
  1696.       int height,
  1697.       int index);
  1698.  
  1699. /* ------------------------------------------------------------------------
  1700.  * Function:      wimp_get_caret_position()
  1701.  *
  1702.  * Description:   Returns details of the caret's state
  1703.  *
  1704.  * Input:         caret - value of R1 on entry
  1705.  *
  1706.  * Other notes:   Calls SWI 0x400D3.
  1707.  */
  1708.  
  1709. extern os_error *xwimp_get_caret_position (wimp_caret *caret);
  1710. extern void wimp_get_caret_position (wimp_caret *caret);
  1711.  
  1712. /* ------------------------------------------------------------------------
  1713.  * Function:      wimp_create_menu()
  1714.  *
  1715.  * Description:   Creates a menu structure
  1716.  *
  1717.  * Input:         menu - value of R1 on entry
  1718.  *                x - value of R2 on entry
  1719.  *                y - value of R3 on entry
  1720.  *
  1721.  * Other notes:   Calls SWI 0x400D4.
  1722.  */
  1723.  
  1724. extern os_error *xwimp_create_menu (wimp_menu const *menu,
  1725.       int x,
  1726.       int y);
  1727. extern void wimp_create_menu (wimp_menu const *menu,
  1728.       int x,
  1729.       int y);
  1730.  
  1731. /* ------------------------------------------------------------------------
  1732.  * Function:      wimp_decode_menu()
  1733.  *
  1734.  * Description:   Converts a numerical list of menu selections to a string
  1735.  *                containing their text
  1736.  *
  1737.  * Input:         menu - value of R1 on entry
  1738.  *                selection - value of R2 on entry
  1739.  *                decode - value of R3 on entry
  1740.  *
  1741.  * Other notes:   Calls SWI 0x400D5.
  1742.  */
  1743.  
  1744. extern os_error *xwimp_decode_menu (wimp_menu const *menu,
  1745.       wimp_selection const *selection,
  1746.       char *decode);
  1747. extern void wimp_decode_menu (wimp_menu const *menu,
  1748.       wimp_selection const *selection,
  1749.       char *decode);
  1750.  
  1751. /* ------------------------------------------------------------------------
  1752.  * Function:      wimp_which_icon()
  1753.  *
  1754.  * Description:   Searches for icons that match a given flags word
  1755.  *
  1756.  * Input:         w - value of R0 on entry
  1757.  *                which - value of R1 on entry
  1758.  *                mask - value of R2 on entry
  1759.  *                match - value of R3 on entry
  1760.  *
  1761.  * Other notes:   Calls SWI 0x400D6.
  1762.  */
  1763.  
  1764. extern os_error *xwimp_which_icon (wimp_w w,
  1765.       wimp_i *which,
  1766.       wimp_icon_flags mask,
  1767.       wimp_icon_flags match);
  1768. __swi (0x400D6) void wimp_which_icon (wimp_w w,
  1769.       wimp_i *which,
  1770.       wimp_icon_flags mask,
  1771.       wimp_icon_flags match);
  1772.  
  1773. /* ------------------------------------------------------------------------
  1774.  * Function:      wimp_set_extent()
  1775.  *
  1776.  * Description:   Sets the work area extent of a given window
  1777.  *
  1778.  * Input:         w - value of R0 on entry
  1779.  *                box - value of R1 on entry
  1780.  *
  1781.  * Other notes:   Calls SWI 0x400D7.
  1782.  */
  1783.  
  1784. extern os_error *xwimp_set_extent (wimp_w w,
  1785.       os_box const *box);
  1786. __swi (0x400D7) void wimp_set_extent (wimp_w w,
  1787.       os_box const *box);
  1788.  
  1789. /* ------------------------------------------------------------------------
  1790.  * Function:      wimp_set_pointer_shape()
  1791.  *
  1792.  * Description:   Sets the shape and active point of the pointer (prefer
  1793.  *                WimpSpriteOp_SetPointerShape
  1794.  *
  1795.  * Input:         shape_no - value of R0 on entry
  1796.  *                shape_data - value of R1 on entry
  1797.  *                width - value of R2 on entry
  1798.  *                height - value of R3 on entry
  1799.  *                xactive - value of R4 on entry
  1800.  *                yactive - value of R5 on entry
  1801.  *
  1802.  * Other notes:   Calls SWI 0x400D8.
  1803.  */
  1804.  
  1805. extern os_error *xwimp_set_pointer_shape (int shape_no,
  1806.       byte const *shape_data,
  1807.       int width,
  1808.       int height,
  1809.       int xactive,
  1810.       int yactive);
  1811. extern void wimp_set_pointer_shape (int shape_no,
  1812.       byte const *shape_data,
  1813.       int width,
  1814.       int height,
  1815.       int xactive,
  1816.       int yactive);
  1817.  
  1818. /* ------------------------------------------------------------------------
  1819.  * Function:      wimp_open_template()
  1820.  *
  1821.  * Description:   Opens a specified template file
  1822.  *
  1823.  * Input:         file_name - value of R1 on entry
  1824.  *
  1825.  * Other notes:   Calls SWI 0x400D9.
  1826.  */
  1827.  
  1828. extern os_error *xwimp_open_template (char const *file_name);
  1829. extern void wimp_open_template (char const *file_name);
  1830.  
  1831. /* ------------------------------------------------------------------------
  1832.  * Function:      wimp_close_template()
  1833.  *
  1834.  * Description:   Closes the currently open template file
  1835.  *
  1836.  * Other notes:   Calls SWI 0x400DA.
  1837.  */
  1838.  
  1839. extern os_error *xwimp_close_template (void);
  1840. __swi (0x400DA) void wimp_close_template (void);
  1841.  
  1842. /* ------------------------------------------------------------------------
  1843.  * Function:      wimp_load_template()
  1844.  *
  1845.  * Description:   Loads a template
  1846.  *
  1847.  * Input:         window - value of R1 on entry
  1848.  *                data - value of R2 on entry
  1849.  *                end - value of R3 on entry
  1850.  *                font_ref - value of R4 on entry
  1851.  *                name - value of R5 on entry
  1852.  *                context - value of R6 on entry
  1853.  *
  1854.  * Output:        used - value of R1 on exit
  1855.  *                data_used - value of R2 on exit
  1856.  *                context_out - value of R6 on exit (X version only)
  1857.  *
  1858.  * Returns:       R6 (non-X version only)
  1859.  *
  1860.  * Other notes:   Calls SWI 0x400DB.
  1861.  */
  1862.  
  1863. extern os_error *xwimp_load_template (wimp_window *window,
  1864.       char *data,
  1865.       char const *end,
  1866.       font_f *font_ref,
  1867.       char const *name,
  1868.       int context,
  1869.       int *used,
  1870.       int *data_used,
  1871.       int *context_out);
  1872. extern int wimp_load_template (wimp_window *window,
  1873.       char *data,
  1874.       char const *end,
  1875.       font_f *font_ref,
  1876.       char const *name,
  1877.       int context,
  1878.       int *used,
  1879.       int *data_used);
  1880.  
  1881. /* ------------------------------------------------------------------------
  1882.  * Function:      wimp_process_key()
  1883.  *
  1884.  * Description:   Creates or passes on key presses
  1885.  *
  1886.  * Input:         c - value of R0 on entry
  1887.  *
  1888.  * Other notes:   Calls SWI 0x400DC.
  1889.  */
  1890.  
  1891. extern os_error *xwimp_process_key (wimp_key_no c);
  1892. __swi (0x400DC) void wimp_process_key (wimp_key_no c);
  1893.  
  1894. /* ------------------------------------------------------------------------
  1895.  * Function:      wimp_close_down()
  1896.  *
  1897.  * Description:   Informs the Wimp that a task is about to terminate
  1898.  *
  1899.  * Input:         t - value of R0 on entry
  1900.  *
  1901.  * Other notes:   Calls SWI 0x400DD with R1 = 0x4B534154.
  1902.  */
  1903.  
  1904. extern os_error *xwimp_close_down (wimp_t t);
  1905. extern void wimp_close_down (wimp_t t);
  1906.  
  1907. /* ------------------------------------------------------------------------
  1908.  * Function:      wimp_start_task()
  1909.  *
  1910.  * Description:   Starts a 'child' task from within another program
  1911.  *
  1912.  * Input:         command - value of R0 on entry
  1913.  *
  1914.  * Output:        t - value of R0 on exit (X version only)
  1915.  *
  1916.  * Returns:       R0 (non-X version only)
  1917.  *
  1918.  * Other notes:   Calls SWI 0x400DE.
  1919.  */
  1920.  
  1921. extern os_error *xwimp_start_task (char const *command,
  1922.       wimp_t *t);
  1923. __swi (0x400DE) wimp_t wimp_start_task (char const *command);
  1924.  
  1925. /* ------------------------------------------------------------------------
  1926.  * Function:      wimp_report_error()
  1927.  *
  1928.  * Description:   Reports an error
  1929.  *
  1930.  * Input:         error - value of R0 on entry
  1931.  *                flags - value of R1 on entry
  1932.  *                name - value of R2 on entry
  1933.  *
  1934.  * Output:        click - value of R1 on exit (X version only)
  1935.  *
  1936.  * Returns:       R1 (non-X version only)
  1937.  *
  1938.  * Other notes:   Calls SWI 0x400DF.
  1939.  */
  1940.  
  1941. extern os_error *xwimp_report_error (os_error const *error,
  1942.       wimp_error_box_flags flags,
  1943.       char const *name,
  1944.       wimp_error_box_selection *click);
  1945. extern wimp_error_box_selection wimp_report_error (os_error const *error,
  1946.       wimp_error_box_flags flags,
  1947.       char const *name);
  1948.  
  1949. /* ------------------------------------------------------------------------
  1950.  * Function:      wimp_report_error_by_category()
  1951.  *
  1952.  * Description:   Reports an error of a given category
  1953.  *
  1954.  * Input:         error - value of R0 on entry
  1955.  *                flags - value of R1 on entry
  1956.  *                name - value of R2 on entry
  1957.  *                sprite_name - value of R3 on entry
  1958.  *                area - value of R4 on entry
  1959.  *                buttons - value of R5 on entry
  1960.  *
  1961.  * Output:        click - value of R1 on exit (X version only)
  1962.  *
  1963.  * Returns:       R1 (non-X version only)
  1964.  *
  1965.  * Other notes:   Calls SWI 0x400DF with R1 |= 0x100.
  1966.  */
  1967.  
  1968. extern os_error *xwimp_report_error_by_category (os_error const *error,
  1969.       wimp_error_box_flags flags,
  1970.       char const *name,
  1971.       char const *sprite_name,
  1972.       osspriteop_area const *area,
  1973.       char const *buttons,
  1974.       wimp_error_box_selection *click);
  1975. extern wimp_error_box_selection wimp_report_error_by_category (os_error const *error,
  1976.       wimp_error_box_flags flags,
  1977.       char const *name,
  1978.       char const *sprite_name,
  1979.       osspriteop_area const *area,
  1980.       char const *buttons);
  1981.  
  1982. /* ------------------------------------------------------------------------
  1983.  * Function:      wimp_get_window_outline()
  1984.  *
  1985.  * Description:   Gets the bounding box for a window
  1986.  *
  1987.  * Input:         outline - value of R1 on entry
  1988.  *
  1989.  * Other notes:   Calls SWI 0x400E0.
  1990.  */
  1991.  
  1992. extern os_error *xwimp_get_window_outline (wimp_outline *outline);
  1993. extern void wimp_get_window_outline (wimp_outline *outline);
  1994.  
  1995. /* ------------------------------------------------------------------------
  1996.  * Function:      wimp_poll_idle()
  1997.  *
  1998.  * Description:   Polls the Wimp, sleeping unless certain events have
  1999.  *                occurred
  2000.  *
  2001.  * Input:         mask - value of R0 on entry
  2002.  *                block - value of R1 on entry
  2003.  *                t - value of R2 on entry
  2004.  *                pollword - value of R3 on entry
  2005.  *
  2006.  * Output:        event - value of R0 on exit (X version only)
  2007.  *
  2008.  * Returns:       R0 (non-X version only)
  2009.  *
  2010.  * Other notes:   Calls SWI 0x400E1.
  2011.  */
  2012.  
  2013. extern os_error *xwimp_poll_idle (wimp_poll_flags mask,
  2014.       wimp_block *block,
  2015.       os_t t,
  2016.       int *pollword,
  2017.       wimp_event_no *event);
  2018. __swi (0x400E1) wimp_event_no wimp_poll_idle (wimp_poll_flags mask,
  2019.       wimp_block *block,
  2020.       os_t t,
  2021.       int *pollword);
  2022.  
  2023. /* ------------------------------------------------------------------------
  2024.  * Function:      wimp_plot_icon()
  2025.  *
  2026.  * Description:   Plots an icon in a window during a window redraw or
  2027.  *                update loop
  2028.  *
  2029.  * Input:         icon - value of R1 on entry
  2030.  *
  2031.  * Other notes:   Calls SWI 0x400E2.
  2032.  */
  2033.  
  2034. extern os_error *xwimp_plot_icon (wimp_icon const *icon);
  2035. extern void wimp_plot_icon (wimp_icon const *icon);
  2036.  
  2037. /* ------------------------------------------------------------------------
  2038.  * Function:      wimp_set_mode()
  2039.  *
  2040.  * Description:   Changes the display mode used by the Wimp
  2041.  *
  2042.  * Input:         mode - value of R0 on entry
  2043.  *
  2044.  * Other notes:   Calls SWI 0x400E3.
  2045.  */
  2046.  
  2047. extern os_error *xwimp_set_mode (os_mode mode);
  2048. __swi (0x400E3) void wimp_set_mode (os_mode mode);
  2049.  
  2050. /* ------------------------------------------------------------------------
  2051.  * Function:      wimp_set_palette()
  2052.  *
  2053.  * Description:   Sets the palette
  2054.  *
  2055.  * Input:         palette - value of R1 on entry
  2056.  *
  2057.  * Other notes:   Calls SWI 0x400E4.
  2058.  */
  2059.  
  2060. extern os_error *xwimp_set_palette (os_palette const *palette);
  2061. extern void wimp_set_palette (os_palette const *palette);
  2062.  
  2063. /* ------------------------------------------------------------------------
  2064.  * Function:      wimp_read_palette()
  2065.  *
  2066.  * Description:   Reads the palette
  2067.  *
  2068.  * Input:         palette - value of R1 on entry
  2069.  *
  2070.  * Other notes:   Calls SWI 0x400E5 with R2 = 0x0.
  2071.  */
  2072.  
  2073. extern os_error *xwimp_read_palette (os_palette *palette);
  2074. extern void wimp_read_palette (os_palette *palette);
  2075.  
  2076. /* ------------------------------------------------------------------------
  2077.  * Function:      wimp_read_true_palette()
  2078.  *
  2079.  * Description:   Reads the palette, returning true colour values
  2080.  *
  2081.  * Input:         palette - value of R1 on entry
  2082.  *
  2083.  * Other notes:   Calls SWI 0x400E5 with R2 = 0x45555254.
  2084.  */
  2085.  
  2086. extern os_error *xwimp_read_true_palette (os_palette *palette);
  2087. extern void wimp_read_true_palette (os_palette *palette);
  2088.  
  2089. /* ------------------------------------------------------------------------
  2090.  * Function:      wimp_set_colour()
  2091.  *
  2092.  * Description:   Sets the current graphics foreground or background colour
  2093.  *                and action
  2094.  *
  2095.  * Input:         colour - value of R0 on entry
  2096.  *
  2097.  * Other notes:   Calls SWI 0x400E6.
  2098.  */
  2099.  
  2100. extern os_error *xwimp_set_colour (wimp_colour colour);
  2101. __swi (0x400E6) void wimp_set_colour (wimp_colour colour);
  2102.  
  2103. /* ------------------------------------------------------------------------
  2104.  * Function:      wimp_send_message()
  2105.  *
  2106.  * Description:   Sends a message to a task, or broadcasts to all tasks
  2107.  *
  2108.  * Input:         event - value of R0 on entry
  2109.  *                message - Message or other event block
  2110.  *                to - value of R2 on entry
  2111.  *
  2112.  * Other notes:   Calls SWI 0x400E7.
  2113.  */
  2114.  
  2115. extern os_error *xwimp_send_message (wimp_event_no event,
  2116.       wimp_message *message,
  2117.       wimp_t to);
  2118. __swi (0x400E7) void wimp_send_message (wimp_event_no event,
  2119.       wimp_message *message,
  2120.       wimp_t to);
  2121.  
  2122. /* ------------------------------------------------------------------------
  2123.  * Function:      wimp_send_message_to_window()
  2124.  *
  2125.  * Description:   Sends a message to the task that created a window
  2126.  *
  2127.  * Input:         event - value of R0 on entry
  2128.  *                message - Message or other event block
  2129.  *                to_w - value of R2 on entry
  2130.  *                to_i - value of R3 on entry
  2131.  *
  2132.  * Output:        to_t - value of R2 on exit (X version only)
  2133.  *
  2134.  * Returns:       R2 (non-X version only)
  2135.  *
  2136.  * Other notes:   Calls SWI 0x400E7.
  2137.  */
  2138.  
  2139. extern os_error *xwimp_send_message_to_window (wimp_event_no event,
  2140.       wimp_message *message,
  2141.       wimp_w to_w,
  2142.       wimp_i to_i,
  2143.       wimp_t *to_t);
  2144. extern wimp_t wimp_send_message_to_window (wimp_event_no event,
  2145.       wimp_message *message,
  2146.       wimp_w to_w,
  2147.       wimp_i to_i);
  2148.  
  2149. /* ------------------------------------------------------------------------
  2150.  * Function:      wimp_create_sub_menu()
  2151.  *
  2152.  * Description:   Creates a submenu
  2153.  *
  2154.  * Input:         sub_menu - value of R1 on entry
  2155.  *                x - value of R2 on entry
  2156.  *                y - value of R3 on entry
  2157.  *
  2158.  * Other notes:   Calls SWI 0x400E8.
  2159.  */
  2160.  
  2161. extern os_error *xwimp_create_sub_menu (wimp_menu const *sub_menu,
  2162.       int x,
  2163.       int y);
  2164. extern void wimp_create_sub_menu (wimp_menu const *sub_menu,
  2165.       int x,
  2166.       int y);
  2167.  
  2168. /* ------------------------------------------------------------------------
  2169.  * Function:      wimp_base_of_sprites()
  2170.  *
  2171.  * Description:   Finds the addresses of the ROM and RAM parts of the
  2172.  *                Wimp's sprite pool
  2173.  *
  2174.  * Output:        rom - value of R0 on exit
  2175.  *                ram - value of R1 on exit
  2176.  *
  2177.  * Other notes:   Calls SWI 0x400EA.
  2178.  */
  2179.  
  2180. extern os_error *xwimp_base_of_sprites (osspriteop_area **rom,
  2181.       osspriteop_area **ram);
  2182. extern void wimp_base_of_sprites (osspriteop_area **rom,
  2183.       osspriteop_area **ram);
  2184.  
  2185. /* ------------------------------------------------------------------------
  2186.  * Function:      wimp_block_copy()
  2187.  *
  2188.  * Description:   Copies a block of work area space to another position
  2189.  *
  2190.  * Input:         w - value of R0 on entry
  2191.  *                x0 - value of R1 on entry
  2192.  *                y0 - value of R2 on entry
  2193.  *                x1 - value of R3 on entry
  2194.  *                y1 - value of R4 on entry
  2195.  *                X0 - value of R5 on entry
  2196.  *                Y0 - value of R6 on entry
  2197.  *
  2198.  * Other notes:   Calls SWI 0x400EB.
  2199.  */
  2200.  
  2201. extern os_error *xwimp_block_copy (wimp_w w,
  2202.       int x0,
  2203.       int y0,
  2204.       int x1,
  2205.       int y1,
  2206.       int X0,
  2207.       int Y0);
  2208. extern void wimp_block_copy (wimp_w w,
  2209.       int x0,
  2210.       int y0,
  2211.       int x1,
  2212.       int y1,
  2213.       int X0,
  2214.       int Y0);
  2215.  
  2216. /* ------------------------------------------------------------------------
  2217.  * Function:      wimp_slot_size()
  2218.  *
  2219.  * Description:   Reads or sets the size of the current slot, the next
  2220.  *                slot, and the Wimp free pool
  2221.  *
  2222.  * Input:         new_curr_slot - value of R0 on entry
  2223.  *                new_next_slot - value of R1 on entry
  2224.  *
  2225.  * Output:        curr_slot - value of R0 on exit
  2226.  *                next_slot - value of R1 on exit
  2227.  *                free_slot - value of R2 on exit
  2228.  *
  2229.  * Other notes:   Calls SWI 0x400EC.
  2230.  */
  2231.  
  2232. extern os_error *xwimp_slot_size (int new_curr_slot,
  2233.       int new_next_slot,
  2234.       int *curr_slot,
  2235.       int *next_slot,
  2236.       int *free_slot);
  2237. extern void wimp_slot_size (int new_curr_slot,
  2238.       int new_next_slot,
  2239.       int *curr_slot,
  2240.       int *next_slot,
  2241.       int *free_slot);
  2242.  
  2243. /* ------------------------------------------------------------------------
  2244.  * Function:      wimp_read_pix_trans()
  2245.  *
  2246.  * Description:   Reads pixel translation table for a given sprite
  2247.  *
  2248.  * Input:         flags - value of R0 on entry
  2249.  *                area - value of R1 on entry
  2250.  *                id - value of R2 on entry
  2251.  *                factors - value of R6 on entry
  2252.  *                trans_tab - value of R7 on entry
  2253.  *
  2254.  * Other notes:   Calls SWI 0x400ED.
  2255.  */
  2256.  
  2257. extern os_error *xwimp_read_pix_trans (osspriteop_flags flags,
  2258.       osspriteop_area const *area,
  2259.       osspriteop_id id,
  2260.       os_factors *factors,
  2261.       osspriteop_trans_tab *trans_tab);
  2262. extern void wimp_read_pix_trans (osspriteop_flags flags,
  2263.       osspriteop_area const *area,
  2264.       osspriteop_id id,
  2265.       os_factors *factors,
  2266.       osspriteop_trans_tab *trans_tab);
  2267.  
  2268. /* ------------------------------------------------------------------------
  2269.  * Function:      wimpclaimfreememory_alloc()
  2270.  *
  2271.  * Description:   Claims the whole of the Wimp's free memory pool for the
  2272.  *                calling task
  2273.  *
  2274.  * Input:         size - value of R1 on entry
  2275.  *
  2276.  * Output:        size_out - value of R1 on exit
  2277.  *                blk - value of R2 on exit (X version only)
  2278.  *
  2279.  * Returns:       R2 (non-X version only)
  2280.  *
  2281.  * Other notes:   Calls SWI 0x400EE with R0 = 0x1.
  2282.  */
  2283.  
  2284. extern os_error *xwimpclaimfreememory_alloc (int size,
  2285.       int *size_out,
  2286.       void **blk);
  2287. extern void *wimpclaimfreememory_alloc (int size,
  2288.       int *size_out);
  2289.  
  2290. /* ------------------------------------------------------------------------
  2291.  * Function:      wimpclaimfreememory_free()
  2292.  *
  2293.  * Description:   Releases the Wimp's free memory pool
  2294.  *
  2295.  * Other notes:   Calls SWI 0x400EE with R0 = 0x0.
  2296.  */
  2297.  
  2298. extern os_error *xwimpclaimfreememory_free (void);
  2299. extern void wimpclaimfreememory_free (void);
  2300.  
  2301. /* ------------------------------------------------------------------------
  2302.  * Function:      wimp_command_window()
  2303.  *
  2304.  * Description:   Opens a text window in which normal VDU 4-type text can
  2305.  *                be displayed
  2306.  *
  2307.  * Input:         op - value of R0 on entry
  2308.  *
  2309.  * Other notes:   Calls SWI 0x400EF.
  2310.  */
  2311.  
  2312. extern os_error *xwimp_command_window (char const *op);
  2313. __swi (0x400EF) void wimp_command_window (char const *op);
  2314.  
  2315. /* ------------------------------------------------------------------------
  2316.  * Function:      wimp_text_colour()
  2317.  *
  2318.  * Description:   Sets the text foreground or background colour
  2319.  *
  2320.  * Input:         colour - value of R0 on entry
  2321.  *
  2322.  * Other notes:   Calls SWI 0x400F0.
  2323.  */
  2324.  
  2325. extern os_error *xwimp_text_colour (wimp_colour colour);
  2326. __swi (0x400F0) void wimp_text_colour (wimp_colour colour);
  2327.  
  2328. /* ------------------------------------------------------------------------
  2329.  * Function:      wimp_transfer_block()
  2330.  *
  2331.  * Description:   Copies a block of memory from one task's address space to
  2332.  *                another's
  2333.  *
  2334.  * Input:         from_t - value of R0 on entry
  2335.  *                from - value of R1 on entry
  2336.  *                to_t - value of R2 on entry
  2337.  *                to - value of R3 on entry
  2338.  *                len - value of R4 on entry
  2339.  *
  2340.  * Other notes:   Calls SWI 0x400F1.
  2341.  */
  2342.  
  2343. extern os_error *xwimp_transfer_block (wimp_t from_t,
  2344.       byte *from,
  2345.       wimp_t to_t,
  2346.       byte *to,
  2347.       int len);
  2348. extern void wimp_transfer_block (wimp_t from_t,
  2349.       byte *from,
  2350.       wimp_t to_t,
  2351.       byte *to,
  2352.       int len);
  2353.  
  2354. /* ------------------------------------------------------------------------
  2355.  * Function:      wimp_set_font_colours()
  2356.  *
  2357.  * Description:   Sets the anti-aliases font colours from the two (standard
  2358.  *                Wimp) colours specified
  2359.  *
  2360.  * Input:         fg - value of R1 on entry
  2361.  *                bg - value of R2 on entry
  2362.  *
  2363.  * Other notes:   Calls SWI 0x400F3.
  2364.  */
  2365.  
  2366. extern os_error *xwimp_set_font_colours (wimp_colour fg,
  2367.       wimp_colour bg);
  2368. extern void wimp_set_font_colours (wimp_colour fg,
  2369.       wimp_colour bg);
  2370.  
  2371. /* ------------------------------------------------------------------------
  2372.  * Function:      wimp_get_menu_state()
  2373.  *
  2374.  * Description:   Gets the state of a menu, showing which item is selected
  2375.  *
  2376.  * Input:         flags - value of R0 on entry
  2377.  *                selection - value of R1 on entry
  2378.  *                w - value of R2 on entry
  2379.  *                i - value of R3 on entry
  2380.  *
  2381.  * Other notes:   Calls SWI 0x400F4.
  2382.  */
  2383.  
  2384. extern os_error *xwimp_get_menu_state (wimp_menu_state_flags flags,
  2385.       wimp_selection *selection,
  2386.       wimp_w w,
  2387.       wimp_i i);
  2388. __swi (0x400F4) void wimp_get_menu_state (wimp_menu_state_flags flags,
  2389.       wimp_selection *selection,
  2390.       wimp_w w,
  2391.       wimp_i i);
  2392.  
  2393. /* ------------------------------------------------------------------------
  2394.  * Function:      wimp_register_filter()
  2395.  *
  2396.  * Description:   Used by the Filter Manager to register or deregister a
  2397.  *                filter with the Wimp
  2398.  *
  2399.  * Input:         type - value of R0 on entry
  2400.  *                filter_code - value of R1 on entry
  2401.  *                handle - value of R2 on entry
  2402.  *
  2403.  * Other notes:   Calls SWI 0x400F5.
  2404.  */
  2405.  
  2406. extern os_error *xwimp_register_filter (bits type,
  2407.       void const *filter_code,
  2408.       byte *handle);
  2409. __swi (0x400F5) void wimp_register_filter (bits type,
  2410.       void const *filter_code,
  2411.       byte *handle);
  2412.  
  2413. /* ------------------------------------------------------------------------
  2414.  * Function:      wimp_add_messages()
  2415.  *
  2416.  * Description:   Adds messages to the list of those known by a certain
  2417.  *                task
  2418.  *
  2419.  * Input:         messages - value of R0 on entry
  2420.  *
  2421.  * Other notes:   Calls SWI 0x400F6.
  2422.  */
  2423.  
  2424. extern os_error *xwimp_add_messages (wimp_message_list const *messages);
  2425. __swi (0x400F6) void wimp_add_messages (wimp_message_list const *messages);
  2426.  
  2427. /* ------------------------------------------------------------------------
  2428.  * Function:      wimp_remove_messages()
  2429.  *
  2430.  * Description:   Removes messages from the list of those known by a
  2431.  *                certain task
  2432.  *
  2433.  * Input:         messages - value of R0 on entry
  2434.  *
  2435.  * Other notes:   Calls SWI 0x400F7.
  2436.  */
  2437.  
  2438. extern os_error *xwimp_remove_messages (wimp_message_list const *messages);
  2439. __swi (0x400F7) void wimp_remove_messages (wimp_message_list const *messages);
  2440.  
  2441. /* ------------------------------------------------------------------------
  2442.  * Function:      wimp_set_colour_mapping()
  2443.  *
  2444.  * Description:   Changes the mapping between Wimp colours and physical
  2445.  *                colours
  2446.  *
  2447.  * Input:         palette - value of R1 on entry
  2448.  *                map2 - value of R2 on entry
  2449.  *                map4 - value of R3 on entry
  2450.  *                map16 - value of R4 on entry
  2451.  *
  2452.  * Other notes:   Calls SWI 0x400F8 with R5 = 0x0, R6 = 0x0, R7 = 0x0.
  2453.  */
  2454.  
  2455. extern os_error *xwimp_set_colour_mapping (os_palette const *palette,
  2456.       byte const *map2,
  2457.       byte const *map4,
  2458.       byte const *map16);
  2459. extern void wimp_set_colour_mapping (os_palette const *palette,
  2460.       byte const *map2,
  2461.       byte const *map4,
  2462.       byte const *map16);
  2463.  
  2464. /* ------------------------------------------------------------------------
  2465.  * Function:      wimptextop_set_colour()
  2466.  *
  2467.  * Description:   Sets the colour to use for text plotting with
  2468.  *                WimpTextOp_Paint
  2469.  *
  2470.  * Input:         fg - value of R1 on entry
  2471.  *                bg - value of R2 on entry
  2472.  *
  2473.  * Other notes:   Calls SWI 0x400F9 with R0 = 0x0.
  2474.  */
  2475.  
  2476. extern os_error *xwimptextop_set_colour (os_colour fg,
  2477.       os_colour bg);
  2478. extern void wimptextop_set_colour (os_colour fg,
  2479.       os_colour bg);
  2480.  
  2481. /* ------------------------------------------------------------------------
  2482.  * Function:      wimptextop_string_width()
  2483.  *
  2484.  * Description:   Gets the width of a string for the current desktop font
  2485.  *
  2486.  * Input:         s - value of R1 on entry
  2487.  *                len - value of R2 on entry
  2488.  *
  2489.  * Output:        width - value of R0 on exit (X version only)
  2490.  *
  2491.  * Returns:       R0 (non-X version only)
  2492.  *
  2493.  * Other notes:   Calls SWI 0x400F9 with R0 = 0x1.
  2494.  */
  2495.  
  2496. extern os_error *xwimptextop_string_width (char const *s,
  2497.       int len,
  2498.       int *width);
  2499. extern int wimptextop_string_width (char const *s,
  2500.       int len);
  2501.  
  2502. /* ------------------------------------------------------------------------
  2503.  * Function:      wimptextop_paint()
  2504.  *
  2505.  * Description:   Plots text on the screen using the current desktop font
  2506.  *
  2507.  * Input:         flags - value of R0 on entry
  2508.  *                s - value of R1 on entry
  2509.  *                x0 - value of R4 on entry
  2510.  *                y0 - value of R5 on entry
  2511.  *
  2512.  * Other notes:   Calls SWI 0x400F9 with R0 |= 0x2, R2 = 0xFFFFFFFF, R3 = 0xFFFFFFFF.
  2513.  */
  2514.  
  2515. extern os_error *xwimptextop_paint (wimptextop_paint_flags flags,
  2516.       char const *s,
  2517.       int x0,
  2518.       int y0);
  2519. extern void wimptextop_paint (wimptextop_paint_flags flags,
  2520.       char const *s,
  2521.       int x0,
  2522.       int y0);
  2523.  
  2524. /* ------------------------------------------------------------------------
  2525.  * Function:      wimp_set_watchdog_state()
  2526.  *
  2527.  * Description:   Sets the state of the Wimp's watchdog
  2528.  *
  2529.  * Input:         enable - value of R0 on entry
  2530.  *                code_word - value of R1 on entry
  2531.  *
  2532.  * Other notes:   Calls SWI 0x400FA.
  2533.  */
  2534.  
  2535. extern os_error *xwimp_set_watchdog_state (bool enable,
  2536.       int code_word);
  2537. __swi (0x400FA) void wimp_set_watchdog_state (bool enable,
  2538.       int code_word);
  2539.  
  2540. /* ------------------------------------------------------------------------
  2541.  * Function:      wimp_resize_icon()
  2542.  *
  2543.  * Description:   Changes the bounding box of an icon
  2544.  *
  2545.  * Input:         w - value of R0 on entry
  2546.  *                i - value of R1 on entry
  2547.  *                x0 - value of R2 on entry
  2548.  *                y0 - value of R3 on entry
  2549.  *                x1 - value of R4 on entry
  2550.  *                y1 - value of R5 on entry
  2551.  *
  2552.  * Other notes:   Calls SWI 0x400FC.
  2553.  */
  2554.  
  2555. extern os_error *xwimp_resize_icon (wimp_w w,
  2556.       wimp_i i,
  2557.       int x0,
  2558.       int y0,
  2559.       int x1,
  2560.       int y1);
  2561. extern void wimp_resize_icon (wimp_w w,
  2562.       wimp_i i,
  2563.       int x0,
  2564.       int y0,
  2565.       int x1,
  2566.       int y1);
  2567.  
  2568. /* ------------------------------------------------------------------------
  2569.  * Function:      service_memory()
  2570.  *
  2571.  * Description:   Memory controller about to be remapped
  2572.  *
  2573.  * Input:         change - value of R0 on entry
  2574.  *                cao - value of R2 on entry
  2575.  *
  2576.  * Other notes:   Calls SWI 0x30 with R1 = 0x11.
  2577.  */
  2578.  
  2579. extern os_error *xservice_memory (int change,
  2580.       byte *cao);
  2581. extern void service_memory (int change,
  2582.       byte *cao);
  2583.  
  2584. /* ------------------------------------------------------------------------
  2585.  * Function:      service_start_wimp()
  2586.  *
  2587.  * Description:   Start up any resident module tasks using Wimp_StartTask
  2588.  *
  2589.  * Other notes:   Calls SWI 0x30 with R1 = 0x49.
  2590.  */
  2591.  
  2592. extern os_error *xservice_start_wimp (void);
  2593. extern void service_start_wimp (void);
  2594.  
  2595. /* ------------------------------------------------------------------------
  2596.  * Function:      service_started_wimp()
  2597.  *
  2598.  * Description:   Request to task modules to set task_handle variable to 0
  2599.  *
  2600.  * Other notes:   Calls SWI 0x30 with R1 = 0x4A.
  2601.  */
  2602.  
  2603. extern os_error *xservice_started_wimp (void);
  2604. extern void service_started_wimp (void);
  2605.  
  2606. /* ------------------------------------------------------------------------
  2607.  * Function:      service_mouse_trap()
  2608.  *
  2609.  * Description:   The Wimp has detected a significant mouse movement
  2610.  *
  2611.  * Other notes:   Calls SWI 0x30 with R1 = 0x52.
  2612.  */
  2613.  
  2614. extern os_error *xservice_mouse_trap (void);
  2615. extern void service_mouse_trap (void);
  2616.  
  2617. /* ------------------------------------------------------------------------
  2618.  * Function:      service_wimp_close_down()
  2619.  *
  2620.  * Description:   Notification the the Wimp is about to close down a task
  2621.  *
  2622.  * Other notes:   Calls SWI 0x30 with R1 = 0x53.
  2623.  */
  2624.  
  2625. extern os_error *xservice_wimp_close_down (void);
  2626. extern void service_wimp_close_down (void);
  2627.  
  2628. /* ------------------------------------------------------------------------
  2629.  * Function:      service_wimp_report_error()
  2630.  *
  2631.  * Description:   Request to suspend trapping of VDU output so an error can
  2632.  *                be displayed
  2633.  *
  2634.  * Input:         opening - value of R0 on entry
  2635.  *
  2636.  * Other notes:   Calls SWI 0x30 with R1 = 0x57.
  2637.  */
  2638.  
  2639. extern os_error *xservice_wimp_report_error (bool opening);
  2640. extern void service_wimp_report_error (bool opening);
  2641.  
  2642. /* ------------------------------------------------------------------------
  2643.  * Function:      service_wimp_save_desktop()
  2644.  *
  2645.  * Description:   Save some state to a desktop boot file
  2646.  *
  2647.  * Input:         flags - value of R0 on entry
  2648.  *                file - value of R2 on entry
  2649.  *
  2650.  * Output:        error - value of R0 on exit
  2651.  *                unclaimed - value of R1 on exit (X version only)
  2652.  *
  2653.  * Returns:       R1 (non-X version only)
  2654.  *
  2655.  * Other notes:   Calls SWI 0x30 with R1 = 0x5C.
  2656.  */
  2657.  
  2658. extern os_error *xservice_wimp_save_desktop (wimp_save_desktop_flags flags,
  2659.       os_f file,
  2660.       os_error **error,
  2661.       bool *unclaimed);
  2662. extern bool service_wimp_save_desktop (wimp_save_desktop_flags flags,
  2663.       os_f file,
  2664.       os_error **error);
  2665.  
  2666. /* ------------------------------------------------------------------------
  2667.  * Function:      service_wimp_palette()
  2668.  *
  2669.  * Description:   Palette change
  2670.  *
  2671.  * Other notes:   Calls SWI 0x30 with R1 = 0x5D.
  2672.  */
  2673.  
  2674. extern os_error *xservice_wimp_palette (void);
  2675. extern void service_wimp_palette (void);
  2676.  
  2677. /* ------------------------------------------------------------------------
  2678.  * Function:      service_desktop_welcome()
  2679.  *
  2680.  * Description:   Desktop starting
  2681.  *
  2682.  * Other notes:   Calls SWI 0x30 with R1 = 0x7C.
  2683.  */
  2684.  
  2685. extern os_error *xservice_desktop_welcome (void);
  2686. extern void service_desktop_welcome (void);
  2687.  
  2688. /* ------------------------------------------------------------------------
  2689.  * Function:      service_shut_down()
  2690.  *
  2691.  * Description:   Task Manager shutting down
  2692.  *
  2693.  * Other notes:   Calls SWI 0x30 with R1 = 0x7E.
  2694.  */
  2695.  
  2696. extern os_error *xservice_shut_down (void);
  2697. extern void service_shut_down (void);
  2698.  
  2699. /* ------------------------------------------------------------------------
  2700.  * Function:      service_shut_down_complete()
  2701.  *
  2702.  * Description:   Shutdown complete
  2703.  *
  2704.  * Other notes:   Calls SWI 0x30 with R1 = 0x80.
  2705.  */
  2706.  
  2707. extern os_error *xservice_shut_down_complete (void);
  2708. extern void service_shut_down_complete (void);
  2709.  
  2710. /* ------------------------------------------------------------------------
  2711.  * Function:      service_wimp_sprites_moved()
  2712.  *
  2713.  * Description:   Wimp sprite pools have moved
  2714.  *
  2715.  * Other notes:   Calls SWI 0x30 with R1 = 0x85.
  2716.  */
  2717.  
  2718. extern os_error *xservice_wimp_sprites_moved (void);
  2719. extern void service_wimp_sprites_moved (void);
  2720.  
  2721. /* ------------------------------------------------------------------------
  2722.  * Function:      service_wimp_register_filters()
  2723.  *
  2724.  * Description:   Allows the Filter Manager to install filters with the
  2725.  *                Wimp
  2726.  *
  2727.  * Other notes:   Calls SWI 0x30 with R1 = 0x86.
  2728.  */
  2729.  
  2730. extern os_error *xservice_wimp_register_filters (void);
  2731. extern void service_wimp_register_filters (void);
  2732.  
  2733. /* ------------------------------------------------------------------------
  2734.  * Function:      service_error_starting()
  2735.  *
  2736.  * Description:   Issued immediately after Wimp_ReportError is called
  2737.  *
  2738.  * Input:         error - value of R2 on entry
  2739.  *                flags - value of R3 on entry
  2740.  *                name - value of R4 on entry
  2741.  *                sprite_name - value of R5 on entry
  2742.  *                area - value of R6 on entry
  2743.  *                buttons - value of R7 on entry
  2744.  *
  2745.  * Output:        error_out - value of R2 on exit
  2746.  *                flags_out - value of R3 on exit
  2747.  *                name_out - value of R4 on exit
  2748.  *                sprite_name_out - value of R5 on exit
  2749.  *                area_out - value of R6 on exit
  2750.  *                buttons_out - value of R7 on exit
  2751.  *
  2752.  * Other notes:   Calls SWI 0x30 with R1 = 0x400C0.
  2753.  */
  2754.  
  2755. extern os_error *xservice_error_starting (os_error const *error,
  2756.       wimp_error_box_flags flags,
  2757.       char const *name,
  2758.       char const *sprite_name,
  2759.       osspriteop_area const *area,
  2760.       char const *buttons,
  2761.       os_error **error_out,
  2762.       wimp_error_box_flags *flags_out,
  2763.       char **name_out,
  2764.       char **sprite_name_out,
  2765.       osspriteop_area **area_out,
  2766.       char **buttons_out);
  2767. extern void service_error_starting (os_error const *error,
  2768.       wimp_error_box_flags flags,
  2769.       char const *name,
  2770.       char const *sprite_name,
  2771.       osspriteop_area const *area,
  2772.       char const *buttons,
  2773.       os_error **error_out,
  2774.       wimp_error_box_flags *flags_out,
  2775.       char **name_out,
  2776.       char **sprite_name_out,
  2777.       osspriteop_area **area_out,
  2778.       char **buttons_out);
  2779.  
  2780. /* ------------------------------------------------------------------------
  2781.  * Function:      service_error_button_pressed()
  2782.  *
  2783.  * Description:   Issued when any button on the error report is pressed
  2784.  *
  2785.  * Input:         button - value of R2 on entry
  2786.  *                button_list - value of R3 on entry
  2787.  *
  2788.  * Output:        redisplay - value of R0 on exit
  2789.  *                unclaimed - value of R1 on exit (X version only)
  2790.  *                button_out - value of R2 on exit
  2791.  *
  2792.  * Returns:       R1 (non-X version only)
  2793.  *
  2794.  * Other notes:   Calls SWI 0x30 with R0 = 0x0, R1 = 0x400C1.
  2795.  */
  2796.  
  2797. extern os_error *xservice_error_button_pressed (wimp_error_box_selection button,
  2798.       char const *button_list,
  2799.       bool *redisplay,
  2800.       bool *unclaimed,
  2801.       wimp_error_box_selection *button_out);
  2802. extern bool service_error_button_pressed (wimp_error_box_selection button,
  2803.       char const *button_list,
  2804.       bool *redisplay,
  2805.       wimp_error_box_selection *button_out);
  2806.  
  2807. /* ------------------------------------------------------------------------
  2808.  * Function:      service_error_ending()
  2809.  *
  2810.  * Description:   Issued immediately before an error report closes
  2811.  *
  2812.  * Input:         button - value of R2 on entry
  2813.  *
  2814.  * Output:        unclaimed - value of R1 on exit (X version only)
  2815.  *                button_out - value of R2 on exit
  2816.  *
  2817.  * Returns:       R1 (non-X version only)
  2818.  *
  2819.  * Other notes:   Calls SWI 0x30 with R1 = 0x400C2.
  2820.  */
  2821.  
  2822. extern os_error *xservice_error_ending (wimp_error_box_selection button,
  2823.       bool *unclaimed,
  2824.       wimp_error_box_selection *button_out);
  2825. extern bool service_error_ending (wimp_error_box_selection button,
  2826.       wimp_error_box_selection *button_out);
  2827.  
  2828. #ifdef __cplusplus
  2829.    }
  2830. #endif
  2831.  
  2832. #endif
  2833.