home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / Toolbox / h / toolbox < prev    next >
Encoding:
Text File  |  1995-09-07  |  33.7 KB  |  1,065 lines

  1. #ifndef toolbox_H
  2. #define toolbox_H
  3.  
  4. /* C header file for Toolbox
  5.  * written by DefMod (Aug 30 1995) on Thu Sep  7 18:31:47 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 wimp_H
  18. #include "wimp.h"
  19. #endif
  20.  
  21. #ifndef messagetrans_H
  22. #include "messagetrans.h"
  23. #endif
  24.  
  25. #ifndef osspriteop_H
  26. #include "osspriteop.h"
  27. #endif
  28.  
  29. /**********************************
  30.  * SWI names and SWI reason codes *
  31.  **********************************/
  32. #undef  Toolbox_CreateObject
  33. #define Toolbox_CreateObject                    0x44EC0
  34. #undef  XToolbox_CreateObject
  35. #define XToolbox_CreateObject                   0x64EC0
  36. #undef  Toolbox_DeleteObject
  37. #define Toolbox_DeleteObject                    0x44EC1
  38. #undef  XToolbox_DeleteObject
  39. #define XToolbox_DeleteObject                   0x64EC1
  40. #undef  Toolbox_ShowObject
  41. #define Toolbox_ShowObject                      0x44EC3
  42. #undef  XToolbox_ShowObject
  43. #define XToolbox_ShowObject                     0x64EC3
  44. #undef  Toolbox_HideObject
  45. #define Toolbox_HideObject                      0x44EC4
  46. #undef  XToolbox_HideObject
  47. #define XToolbox_HideObject                     0x64EC4
  48. #undef  Toolbox_GetObjectInfo
  49. #define Toolbox_GetObjectInfo                   0x44EC5
  50. #undef  XToolbox_GetObjectInfo
  51. #define XToolbox_GetObjectInfo                  0x64EC5
  52. #undef  Toolbox_ObjectMiscOp
  53. #define Toolbox_ObjectMiscOp                    0x44EC6
  54. #undef  XToolbox_ObjectMiscOp
  55. #define XToolbox_ObjectMiscOp                   0x64EC6
  56. #undef  Toolbox_SetClientHandle
  57. #define Toolbox_SetClientHandle                 0x44EC7
  58. #undef  XToolbox_SetClientHandle
  59. #define XToolbox_SetClientHandle                0x64EC7
  60. #undef  Toolbox_GetClientHandle
  61. #define Toolbox_GetClientHandle                 0x44EC8
  62. #undef  XToolbox_GetClientHandle
  63. #define XToolbox_GetClientHandle                0x64EC8
  64. #undef  Toolbox_GetObjectClass
  65. #define Toolbox_GetObjectClass                  0x44EC9
  66. #undef  XToolbox_GetObjectClass
  67. #define XToolbox_GetObjectClass                 0x64EC9
  68. #undef  Toolbox_GetParent
  69. #define Toolbox_GetParent                       0x44ECA
  70. #undef  XToolbox_GetParent
  71. #define XToolbox_GetParent                      0x64ECA
  72. #undef  Toolbox_GetAncestor
  73. #define Toolbox_GetAncestor                     0x44ECB
  74. #undef  XToolbox_GetAncestor
  75. #define XToolbox_GetAncestor                    0x64ECB
  76. #undef  Toolbox_GetTemplateName
  77. #define Toolbox_GetTemplateName                 0x44ECC
  78. #undef  XToolbox_GetTemplateName
  79. #define XToolbox_GetTemplateName                0x64ECC
  80. #undef  Toolbox_RaiseToolboxEvent
  81. #define Toolbox_RaiseToolboxEvent               0x44ECD
  82. #undef  XToolbox_RaiseToolboxEvent
  83. #define XToolbox_RaiseToolboxEvent              0x64ECD
  84. #undef  Toolbox_GetSysInfo
  85. #define Toolbox_GetSysInfo                      0x44ECE
  86. #undef  XToolbox_GetSysInfo
  87. #define XToolbox_GetSysInfo                     0x64ECE
  88. #undef  ToolboxGetSysInfo_TaskName
  89. #define ToolboxGetSysInfo_TaskName              0x0
  90. #undef  ToolboxGetSysInfo_MessageTransControlBlock
  91. #define ToolboxGetSysInfo_MessageTransControlBlock 0x1
  92. #undef  ToolboxGetSysInfo_DirName
  93. #define ToolboxGetSysInfo_DirName               0x2
  94. #undef  ToolboxGetSysInfo_Task
  95. #define ToolboxGetSysInfo_Task                  0x3
  96. #undef  ToolboxGetSysInfo_SpriteArea
  97. #define ToolboxGetSysInfo_SpriteArea            0x4
  98. #undef  Toolbox_Initialise
  99. #define Toolbox_Initialise                      0x44ECF
  100. #undef  XToolbox_Initialise
  101. #define XToolbox_Initialise                     0x64ECF
  102. #undef  Toolbox_LoadResources
  103. #define Toolbox_LoadResources                   0x44ED0
  104. #undef  XToolbox_LoadResources
  105. #define XToolbox_LoadResources                  0x64ED0
  106. #undef  Toolbox_DeRegisterObjectModule
  107. #define Toolbox_DeRegisterObjectModule          0x44EFA
  108. #undef  XToolbox_DeRegisterObjectModule
  109. #define XToolbox_DeRegisterObjectModule         0x64EFA
  110. #undef  Toolbox_TemplateLookUp
  111. #define Toolbox_TemplateLookUp                  0x44EFB
  112. #undef  XToolbox_TemplateLookUp
  113. #define XToolbox_TemplateLookUp                 0x64EFB
  114. #undef  Toolbox_RegisterObjectModule
  115. #define Toolbox_RegisterObjectModule            0x44EFD
  116. #undef  XToolbox_RegisterObjectModule
  117. #define XToolbox_RegisterObjectModule           0x64EFD
  118. #undef  Toolbox_RegisterPreFilter
  119. #define Toolbox_RegisterPreFilter               0x44EFE
  120. #undef  XToolbox_RegisterPreFilter
  121. #define XToolbox_RegisterPreFilter              0x64EFE
  122. #undef  Toolbox_RegisterPostFilter
  123. #define Toolbox_RegisterPostFilter              0x44EFF
  124. #undef  XToolbox_RegisterPostFilter
  125. #define XToolbox_RegisterPostFilter             0x64EFF
  126. #undef  Service_ToolboxStarting
  127. #define Service_ToolboxStarting                 0x44EC1
  128. #undef  Service_ToolboxTaskBorn
  129. #define Service_ToolboxTaskBorn                 0x44EC2
  130. #undef  Service_ToolboxTaskDied
  131. #define Service_ToolboxTaskDied                 0x44EC3
  132. #undef  Service_WindowDeleted
  133. #define Service_WindowDeleted                   0x44EC5
  134. #undef  Service_RedrawingWindow
  135. #define Service_RedrawingWindow                 0x44EC6
  136.  
  137. /************************************
  138.  * Structure and union declarations *
  139.  ************************************/
  140. typedef struct toolbox_o_                       *toolbox_o;
  141.       /*Abstract type for Toolbox objects*/
  142. typedef struct toolbox_id_                      *toolbox_id;
  143.       /*Should be union of string and various object definition types, but that's inconvenient because the list is subject to later extension, and you can't project into unions by cast*/
  144. typedef struct toolbox_full                     toolbox_full;
  145. typedef union  toolbox_position                 toolbox_position;
  146. typedef struct toolbox_block                    toolbox_block;
  147. typedef struct toolbox_resource_file_object     toolbox_resource_file_object;
  148. typedef struct toolbox_relocation               toolbox_relocation;
  149. typedef struct toolbox_relocation_table         toolbox_relocation_table;
  150. typedef struct toolbox_relocatable_object       toolbox_relocatable_object;
  151. typedef struct toolbox_resource_file            toolbox_resource_file;
  152. typedef struct toolbox_action_list              toolbox_action_list;
  153. typedef struct toolbox_event_pair               toolbox_event_pair;
  154. typedef struct toolbox_event_pair_list          toolbox_event_pair_list;
  155. typedef struct toolbox_message_pair             toolbox_message_pair;
  156. typedef struct toolbox_message_pair_list        toolbox_message_pair_list;
  157. typedef struct toolbox_action_pair              toolbox_action_pair;
  158. typedef struct toolbox_action_pair_list         toolbox_action_pair_list;
  159. typedef union  toolbox_pair_list                toolbox_pair_list;
  160. typedef struct toolbox_action_interest          toolbox_action_interest;
  161. typedef struct toolbox_action_error             toolbox_action_error;
  162. typedef struct toolbox_action_object_auto_created toolbox_action_object_auto_created;
  163. typedef struct toolbox_action                   toolbox_action;
  164. typedef struct toolbox_message                  toolbox_message;
  165.  
  166. /********************
  167.  * Type definitions *
  168.  ********************/
  169. typedef int toolbox_c;
  170.       /*Type for Toolbox components*/
  171.  
  172. typedef short toolbox_class;
  173.       /*Toolbox class identification number*/
  174.  
  175. typedef int toolbox_position_tag;
  176.       /*Discriminates between the ways of specifying a position*/
  177.  
  178. /* ------------------------------------------------------------------------
  179.  * Type:          toolbox_full
  180.  *
  181.  * Description:   One way of specifying a position
  182.  */
  183.  
  184. struct toolbox_full
  185.    {  os_box visible;
  186.       int xscroll;
  187.       int yscroll;
  188.       wimp_w next;
  189.    };
  190.  
  191. /* ------------------------------------------------------------------------
  192.  * Type:          toolbox_position
  193.  *
  194.  * Description:   One way of specifying a position
  195.  *
  196.  * Fields:        full - A distributed union for each object type
  197.  */
  198.  
  199. union toolbox_position
  200.    {  os_coord top_left;
  201.       toolbox_full full;
  202.    };
  203.  
  204. typedef bits toolbox_object_flags;
  205.  
  206. struct toolbox_block
  207.    {  toolbox_o ancestor_obj;
  208.       toolbox_c ancestor_cmp;
  209.       toolbox_o parent_obj;
  210.       toolbox_c parent_cmp;
  211.       toolbox_o this_obj;
  212.       toolbox_c this_cmp;
  213.    };
  214.  
  215. struct toolbox_resource_file_object
  216.    {  toolbox_class class_no;
  217.       short reserved;
  218.       bits flags;
  219.       int version;
  220.       char name [12];
  221.       int size;
  222.       int header_size;
  223.       int body_size;
  224.       int object [UNKNOWN];
  225.    };
  226.  
  227. #define toolbox_RESOURCE_FILE_OBJECT(N) \
  228.    struct \
  229.       {  toolbox_class class_no; \
  230.          short reserved; \
  231.          bits flags; \
  232.          int version; \
  233.          char name [12]; \
  234.          int size; \
  235.          int header_size; \
  236.          int body_size; \
  237.          int object [N]; \
  238.       }
  239.  
  240. #define toolbox_SIZEOF_RESOURCE_FILE_OBJECT(N) \
  241.    (offsetof (toolbox_resource_file_object, object) + \
  242.          (N)*sizeof ((toolbox_resource_file_object *) NULL)->object)
  243.  
  244. typedef char *toolbox_string_reference;
  245.       /*Type of a string reference after relocation*/
  246.  
  247. typedef char *toolbox_msg_reference;
  248.       /*Type of a message reference after relocation*/
  249.  
  250. typedef osspriteop_area *toolbox_sprite_area_reference;
  251.       /*Type of a sprite area reference after relocation*/
  252.  
  253. typedef int *toolbox_object_offset;
  254.       /*Type of an object offset after relocation*/
  255.  
  256. typedef int toolbox_relocation_directive;
  257.  
  258. struct toolbox_relocation
  259.    {  int word;
  260.       toolbox_relocation_directive relocation;
  261.    };
  262.  
  263. struct toolbox_relocation_table
  264.    {  int relocation_count;
  265.       toolbox_relocation relocations [UNKNOWN];
  266.    };
  267.  
  268. #define toolbox_RELOCATION_TABLE(N) \
  269.    struct \
  270.       {  int relocation_count; \
  271.          toolbox_relocation relocations [N]; \
  272.       }
  273.  
  274. #define toolbox_SIZEOF_RELOCATION_TABLE(N) \
  275.    (offsetof (toolbox_relocation_table, relocations) + \
  276.          (N)*sizeof ((toolbox_relocation_table *) NULL)->relocations)
  277.  
  278. struct toolbox_relocatable_object
  279.    {  int string_table_offset;
  280.       int message_table_offset;
  281.       int relocation_table_offset;
  282.       toolbox_resource_file_object rf_obj;
  283.    };
  284.  
  285. struct toolbox_resource_file
  286.    {  int file_id;
  287.       int version;
  288.       int header_size;
  289.       toolbox_relocatable_object rel_obj [UNKNOWN];
  290.    };
  291.  
  292. struct toolbox_action_list
  293.    {  bits action_nos [UNKNOWN];
  294.    };
  295.  
  296. #define toolbox_ACTION_LIST(N) \
  297.    struct \
  298.       {  bits action_nos [N]; \
  299.       }
  300.  
  301. #define toolbox_SIZEOF_ACTION_LIST(N) \
  302.    ((N)*sizeof ((toolbox_action_list *) NULL)->action_nos)
  303.  
  304. typedef bits toolbox_create_flags;
  305.  
  306. typedef bits toolbox_delete_flags;
  307.  
  308. typedef bits toolbox_show_flags;
  309.  
  310. typedef bits toolbox_hide_flags;
  311.  
  312. typedef bits toolbox_get_info_flags;
  313.  
  314. typedef bits toolbox_info;
  315.  
  316. typedef bits toolbox_misc_op_flags;
  317.  
  318. typedef bits toolbox_handle_flags;
  319.  
  320. typedef bits toolbox_get_class_flags;
  321.  
  322. typedef bits toolbox_get_parent_flags;
  323.  
  324. typedef bits toolbox_get_ancestor_flags;
  325.  
  326. typedef bits toolbox_get_template_flags;
  327.  
  328. typedef bits toolbox_event_flags;
  329.  
  330. typedef bits toolbox_initialise_flags;
  331.  
  332. typedef bits toolbox_load_flags;
  333.  
  334. typedef bits toolbox_look_up_flags;
  335.  
  336. typedef int toolbox_filter_type;
  337.  
  338. struct toolbox_event_pair
  339.    {  int event;
  340.       toolbox_class class_no;
  341.    };
  342.  
  343. struct toolbox_event_pair_list
  344.    {  toolbox_event_pair pair [UNKNOWN];
  345.    };
  346.  
  347. #define toolbox_EVENT_PAIR_LIST(N) \
  348.    struct \
  349.       {  toolbox_event_pair pair [N]; \
  350.       }
  351.  
  352. #define toolbox_SIZEOF_EVENT_PAIR_LIST(N) \
  353.    ((N)*sizeof ((toolbox_event_pair_list *) NULL)->pair)
  354.  
  355. struct toolbox_message_pair
  356.    {  bits message;
  357.       toolbox_class class_no;
  358.    };
  359.  
  360. struct toolbox_message_pair_list
  361.    {  toolbox_message_pair pair [UNKNOWN];
  362.    };
  363.  
  364. #define toolbox_MESSAGE_PAIR_LIST(N) \
  365.    struct \
  366.       {  toolbox_message_pair pair [N]; \
  367.       }
  368.  
  369. #define toolbox_SIZEOF_MESSAGE_PAIR_LIST(N) \
  370.    ((N)*sizeof ((toolbox_message_pair_list *) NULL)->pair)
  371.  
  372. struct toolbox_action_pair
  373.    {  bits action_no;
  374.       toolbox_class class_no;
  375.    };
  376.  
  377. struct toolbox_action_pair_list
  378.    {  toolbox_action_pair pair [UNKNOWN];
  379.    };
  380.  
  381. #define toolbox_ACTION_PAIR_LIST(N) \
  382.    struct \
  383.       {  toolbox_action_pair pair [N]; \
  384.       }
  385.  
  386. #define toolbox_SIZEOF_ACTION_PAIR_LIST(N) \
  387.    ((N)*sizeof ((toolbox_action_pair_list *) NULL)->pair)
  388.  
  389. union toolbox_pair_list
  390.    {  toolbox_event_pair_list events;
  391.       toolbox_message_pair_list messages;
  392.       toolbox_action_pair_list action_pairs;
  393.    };
  394.  
  395. typedef bits toolbox_register_flags;
  396.  
  397. struct toolbox_action_interest
  398.    {  bits action_no;
  399.       toolbox_class class_no;
  400.    };
  401.  
  402. struct toolbox_action_error
  403.    {  bits errnum;
  404.       char errmess [208];
  405.    };
  406.  
  407. struct toolbox_action_object_auto_created
  408.    {  char name [212];
  409.    };
  410.  
  411. struct toolbox_action
  412.    {  int size;
  413.       int ref_no;
  414.       bits action_no;
  415.       bits flags;
  416.       union
  417.       {  toolbox_action_error error;
  418.          toolbox_action_object_auto_created created;
  419.          byte reserved [212];
  420.       }
  421.       data;
  422.    };
  423.  
  424. struct toolbox_message
  425.    {  toolbox_o o;
  426.       toolbox_c c;
  427.       toolbox_action action_no;
  428.    };
  429.  
  430. /************************
  431.  * Constant definitions *
  432.  ************************/
  433. #define toolbox_NULL_OBJECT                     ((toolbox_o) 0x0u)
  434. #define toolbox_NULL_COMPONENT                  ((toolbox_c) 0xFFFFFFFFu)
  435. #define toolbox_NAME_LIMIT                      12
  436. #define toolbox_WIMP_OBJECTS                    ((toolbox_class) 0x0u)
  437. #define toolbox_ALL                             ((toolbox_class) 0xFFFFFFFFu)
  438. #define toolbox_EVENT                           0x200u
  439.       /*Wimp event number of a Toolbox action*/
  440. #define error_TOOLBOX_NO_MEM                    0x80CB00u
  441. #define error_TOOLBOX_BAD_SWI                   0x80CB01u
  442. #define error_TOOLBOX_INVALID_OBJECT_ID         0x80CB02u
  443. #define error_TOOLBOX_NOT_ATOOLBOX_TASK         0x80CB03u
  444. #define error_TOOLBOX_NO_DIR_NAME               0x80CB04u
  445. #define error_TOOLBOX_NO_MSGS_FD                0x80CB05u
  446. #define error_TOOLBOX_NO_ID_BLOCK               0x80CB06u
  447. #define error_TOOLBOX_BAD_RES_FILE              0x80CB07u
  448. #define error_TOOLBOX_TASKS_ACTIVE              0x80CB08u
  449. #define error_TOOLBOX_TEMPLATE_NOT_FOUND        0x80CB09u
  450. #define error_TOOLBOX_NO_SUCH_PRE_FILTER        0x80CB0Au
  451. #define error_TOOLBOX_NOT_ARES_FILE             0x80CB0Bu
  452. #define error_TOOLBOX_BAD_RES_FILE_VERSION      0x80CB0Cu
  453. #define error_TOOLBOX_BAD_FLAGS                 0x80CB0Du
  454. #define toolbox_OBJECT_CREATE_ON_LOAD           ((toolbox_object_flags) 0x1u)
  455. #define toolbox_OBJECT_SHOW_ON_CREATE           ((toolbox_object_flags) 0x2u)
  456. #define toolbox_OBJECT_SHARED                   ((toolbox_object_flags) 0x4u)
  457. #define toolbox_OBJECT_ANCESTOR                 ((toolbox_object_flags) 0x8u)
  458. #define toolbox_RESOURCE_FILE_VERSION           101
  459. #define toolbox_RELOCATE_STRING_REFERENCE       ((toolbox_relocation_directive) 0x1u)
  460. #define toolbox_RELOCATE_MSG_REFERENCE          ((toolbox_relocation_directive) 0x2u)
  461. #define toolbox_RELOCATE_SPRITE_AREA_REFERENCE  ((toolbox_relocation_directive) 0x3u)
  462. #define toolbox_RELOCATE_OBJECT_OFFSET          ((toolbox_relocation_directive) 0x4u)
  463. #define toolbox_CREATE_GIVEN_OBJECT             ((toolbox_create_flags) 0x1u)
  464. #define toolbox_DELETE_NO_RECURSE               ((toolbox_delete_flags) 0x1u)
  465. #define toolbox_SHOW_AS_MENU                    ((toolbox_show_flags) 0x1u)
  466. #define toolbox_SHOW_AS_SUB_MENU                ((toolbox_show_flags) 0x2u)
  467. #define toolbox_INFO_SHOWING                    ((toolbox_info) 0x1u)
  468. #define toolbox_REGISTER_EVENT_FILTER           ((toolbox_filter_type) 0x1u)
  469. #define toolbox_REGISTER_MESSAGE_FILTER         ((toolbox_filter_type) 0x2u)
  470. #define toolbox_REGISTER_ACTION_FILTER          ((toolbox_filter_type) 0x3u)
  471. #define toolbox_DE_REGISTER_FILTER              ((toolbox_register_flags) 0x1u)
  472. #define toolbox_POSITION_DEFAULT                ((toolbox_position_tag) 0x0u)
  473. #define toolbox_POSITION_FULL                   ((toolbox_position_tag) 0x1u)
  474. #define toolbox_POSITION_TOP_LEFT               ((toolbox_position_tag) 0x2u)
  475. #define toolbox_WIMP_OBJECT_POST_FILTER         ((toolbox_class) 0x0u)
  476. #define toolbox_ANY_POST_FILTER                 ((toolbox_class) 0xFFFFFFFFu)
  477. #define action_ERROR                            0x44EC0u
  478. #define action_OBJECT_AUTO_CREATED              0x44EC1u
  479. #define action_OBJECT_DELETED                   0x44EC2u
  480.  
  481. /*************************
  482.  * Function declarations *
  483.  *************************/
  484.  
  485. #ifdef __cplusplus
  486.    extern "C" {
  487. #endif
  488.  
  489. /* ------------------------------------------------------------------------
  490.  * Function:      toolbox_create_object()
  491.  *
  492.  * Description:   Creates an object from a named resource or an object
  493.  *                structure
  494.  *
  495.  * Input:         flags - value of R0 on entry
  496.  *                id - value of R1 on entry
  497.  *
  498.  * Output:        obj - value of R0 on exit (X version only)
  499.  *
  500.  * Returns:       R0 (non-X version only)
  501.  *
  502.  * Other notes:   Calls SWI 0x44EC0.
  503.  */
  504.  
  505. extern os_error *xtoolbox_create_object (toolbox_create_flags flags,
  506.       toolbox_id id,
  507.       toolbox_o *obj);
  508. __swi (0x44EC0) toolbox_o toolbox_create_object (toolbox_create_flags flags,
  509.       toolbox_id id);
  510.  
  511. /* ------------------------------------------------------------------------
  512.  * Function:      toolbox_delete_object()
  513.  *
  514.  * Description:   Deletes an object
  515.  *
  516.  * Input:         flags - value of R0 on entry
  517.  *                obj - value of R1 on entry
  518.  *
  519.  * Other notes:   Calls SWI 0x44EC1.
  520.  */
  521.  
  522. extern os_error *xtoolbox_delete_object (toolbox_delete_flags flags,
  523.       toolbox_o obj);
  524. __swi (0x44EC1) void toolbox_delete_object (toolbox_delete_flags flags,
  525.       toolbox_o obj);
  526.  
  527. /* ------------------------------------------------------------------------
  528.  * Function:      toolbox_show_object()
  529.  *
  530.  * Description:   Shows an object on the screen
  531.  *
  532.  * Input:         flags - value of R0 on entry
  533.  *                obj - value of R1 on entry
  534.  *                tag - value of R2 on entry
  535.  *                position - value of R3 on entry
  536.  *                parent_obj - value of R4 on entry
  537.  *                parent_cmp - value of R5 on entry
  538.  *
  539.  * Other notes:   Calls SWI 0x44EC3.
  540.  */
  541.  
  542. extern os_error *xtoolbox_show_object (toolbox_show_flags flags,
  543.       toolbox_o obj,
  544.       toolbox_position_tag tag,
  545.       toolbox_position const *position,
  546.       toolbox_o parent_obj,
  547.       toolbox_c parent_cmp);
  548. extern void toolbox_show_object (toolbox_show_flags flags,
  549.       toolbox_o obj,
  550.       toolbox_position_tag tag,
  551.       toolbox_position const *position,
  552.       toolbox_o parent_obj,
  553.       toolbox_c parent_cmp);
  554.  
  555. /* ------------------------------------------------------------------------
  556.  * Function:      toolbox_hide_object()
  557.  *
  558.  * Description:   Removes an object from the screen, if it is being shown
  559.  *
  560.  * Input:         flags - value of R0 on entry
  561.  *                obj - value of R1 on entry
  562.  *
  563.  * Other notes:   Calls SWI 0x44EC4.
  564.  */
  565.  
  566. extern os_error *xtoolbox_hide_object (toolbox_hide_flags flags,
  567.       toolbox_o obj);
  568. __swi (0x44EC4) void toolbox_hide_object (toolbox_hide_flags flags,
  569.       toolbox_o obj);
  570.  
  571. /* ------------------------------------------------------------------------
  572.  * Function:      toolbox_get_object_info()
  573.  *
  574.  * Description:   Returns current information for an object
  575.  *
  576.  * Input:         flags - value of R0 on entry
  577.  *                obj - value of R1 on entry
  578.  *
  579.  * Output:        info - value of R0 on exit (X version only)
  580.  *
  581.  * Returns:       R0 (non-X version only)
  582.  *
  583.  * Other notes:   Calls SWI 0x44EC5.
  584.  */
  585.  
  586. extern os_error *xtoolbox_get_object_info (toolbox_get_info_flags flags,
  587.       toolbox_o obj,
  588.       toolbox_info *info);
  589. __swi (0x44EC5) toolbox_info toolbox_get_object_info (toolbox_get_info_flags flags,
  590.       toolbox_o obj);
  591.  
  592. /* ------------------------------------------------------------------------
  593.  * Function:      toolbox_set_client_handle()
  594.  *
  595.  * Description:   Sets the value of a handle associated with an object
  596.  *
  597.  * Input:         flags - value of R0 on entry
  598.  *                obj - value of R1 on entry
  599.  *                handle - value of R2 on entry
  600.  *
  601.  * Other notes:   Calls SWI 0x44EC7.
  602.  */
  603.  
  604. extern os_error *xtoolbox_set_client_handle (toolbox_handle_flags flags,
  605.       toolbox_o obj,
  606.       void *handle);
  607. __swi (0x44EC7) void toolbox_set_client_handle (toolbox_handle_flags flags,
  608.       toolbox_o obj,
  609.       void *handle);
  610.  
  611. /* ------------------------------------------------------------------------
  612.  * Function:      toolbox_get_client_handle()
  613.  *
  614.  * Description:   Returns the handle associated with an object
  615.  *
  616.  * Input:         flags - value of R0 on entry
  617.  *                obj - value of R1 on entry
  618.  *
  619.  * Output:        handle - value of R0 on exit (X version only)
  620.  *
  621.  * Returns:       R0 (non-X version only)
  622.  *
  623.  * Other notes:   Calls SWI 0x44EC8.
  624.  */
  625.  
  626. extern os_error *xtoolbox_get_client_handle (toolbox_handle_flags flags,
  627.       toolbox_o obj,
  628.       void **handle);
  629. __swi (0x44EC8) void *toolbox_get_client_handle (toolbox_handle_flags flags,
  630.       toolbox_o obj);
  631.  
  632. /* ------------------------------------------------------------------------
  633.  * Function:      toolbox_get_object_class()
  634.  *
  635.  * Description:   Returns the class of the specified object
  636.  *
  637.  * Input:         flags - value of R0 on entry
  638.  *                obj - value of R1 on entry
  639.  *
  640.  * Output:        class_no - value of R0 on exit (X version only)
  641.  *
  642.  * Returns:       R0 (non-X version only)
  643.  *
  644.  * Other notes:   Calls SWI 0x44EC9.
  645.  */
  646.  
  647. extern os_error *xtoolbox_get_object_class (toolbox_get_class_flags flags,
  648.       toolbox_o obj,
  649.       toolbox_class *class_no);
  650. __swi (0x44EC9) toolbox_class toolbox_get_object_class (toolbox_get_class_flags flags,
  651.       toolbox_o obj);
  652.  
  653. /* ------------------------------------------------------------------------
  654.  * Function:      toolbox_get_parent()
  655.  *
  656.  * Description:   Returns the parent of an object
  657.  *
  658.  * Input:         flags - value of R0 on entry
  659.  *                obj - value of R1 on entry
  660.  *
  661.  * Output:        parent_obj - value of R0 on exit
  662.  *                parent_cmp - value of R1 on exit
  663.  *
  664.  * Other notes:   Calls SWI 0x44ECA.
  665.  */
  666.  
  667. extern os_error *xtoolbox_get_parent (toolbox_get_parent_flags flags,
  668.       toolbox_o obj,
  669.       toolbox_o *parent_obj,
  670.       toolbox_c *parent_cmp);
  671. extern void toolbox_get_parent (toolbox_get_parent_flags flags,
  672.       toolbox_o obj,
  673.       toolbox_o *parent_obj,
  674.       toolbox_c *parent_cmp);
  675.  
  676. /* ------------------------------------------------------------------------
  677.  * Function:      toolbox_get_ancestor()
  678.  *
  679.  * Description:   Returns the ancestor of an object
  680.  *
  681.  * Input:         flags - value of R0 on entry
  682.  *                obj - value of R1 on entry
  683.  *
  684.  * Output:        ancestor_obj - value of R0 on exit
  685.  *                ancestor_cmp - value of R1 on exit
  686.  *
  687.  * Other notes:   Calls SWI 0x44ECB.
  688.  */
  689.  
  690. extern os_error *xtoolbox_get_ancestor (toolbox_get_ancestor_flags flags,
  691.       toolbox_o obj,
  692.       toolbox_o *ancestor_obj,
  693.       toolbox_c *ancestor_cmp);
  694. extern void toolbox_get_ancestor (toolbox_get_ancestor_flags flags,
  695.       toolbox_o obj,
  696.       toolbox_o *ancestor_obj,
  697.       toolbox_c *ancestor_cmp);
  698.  
  699. /* ------------------------------------------------------------------------
  700.  * Function:      toolbox_get_template_name()
  701.  *
  702.  * Description:   Gets the name of the resource used to create an object
  703.  *
  704.  * Input:         flags - value of R0 on entry
  705.  *                obj - value of R1 on entry
  706.  *                buffer - value of R2 on entry
  707.  *                size - value of R3 on entry
  708.  *
  709.  * Output:        used - value of R3 on exit (X version only)
  710.  *
  711.  * Returns:       R3 (non-X version only)
  712.  *
  713.  * Other notes:   Calls SWI 0x44ECC.
  714.  */
  715.  
  716. extern os_error *xtoolbox_get_template_name (toolbox_get_template_flags flags,
  717.       toolbox_o obj,
  718.       char *buffer,
  719.       int size,
  720.       int *used);
  721. extern int toolbox_get_template_name (toolbox_get_template_flags flags,
  722.       toolbox_o obj,
  723.       char *buffer,
  724.       int size);
  725.  
  726. /* ------------------------------------------------------------------------
  727.  * Function:      toolbox_raise_toolbox_event()
  728.  *
  729.  * Description:   Raises a toolbox action
  730.  *
  731.  * Input:         flags - value of R0 on entry
  732.  *                obj - value of R1 on entry
  733.  *                cmp - value of R2 on entry
  734.  *                action - value of R3 on entry
  735.  *
  736.  * Other notes:   Calls SWI 0x44ECD.
  737.  */
  738.  
  739. extern os_error *xtoolbox_raise_toolbox_event (toolbox_event_flags flags,
  740.       toolbox_o obj,
  741.       toolbox_c cmp,
  742.       toolbox_action const *action);
  743. __swi (0x44ECD) void toolbox_raise_toolbox_event (toolbox_event_flags flags,
  744.       toolbox_o obj,
  745.       toolbox_c cmp,
  746.       toolbox_action const *action);
  747.  
  748. /* ------------------------------------------------------------------------
  749.  * Function:      toolboxgetsysinfo_task_name()
  750.  *
  751.  * Description:   Returns the task name
  752.  *
  753.  * Input:         buffer - value of R1 on entry
  754.  *                size - value of R2 on entry
  755.  *
  756.  * Output:        used - value of R2 on exit (X version only)
  757.  *
  758.  * Returns:       R2 (non-X version only)
  759.  *
  760.  * Other notes:   Calls SWI 0x44ECE with R0 = 0x0.
  761.  */
  762.  
  763. extern os_error *xtoolboxgetsysinfo_task_name (char *buffer,
  764.       int size,
  765.       int *used);
  766. extern int toolboxgetsysinfo_task_name (char *buffer,
  767.       int size);
  768.  
  769. /* ------------------------------------------------------------------------
  770.  * Function:      toolboxgetsysinfo_message_trans_control_block()
  771.  *
  772.  * Description:   Returns the message file control block
  773.  *
  774.  * Input:         cb - value of R1 on entry
  775.  *
  776.  * Other notes:   Calls SWI 0x44ECE with R0 = 0x1.
  777.  */
  778.  
  779. extern os_error *xtoolboxgetsysinfo_message_trans_control_block (messagetrans_control_block *cb);
  780. extern void toolboxgetsysinfo_message_trans_control_block (messagetrans_control_block *cb);
  781.  
  782. /* ------------------------------------------------------------------------
  783.  * Function:      toolboxgetsysinfo_dir_name()
  784.  *
  785.  * Description:   Returns the 'home directory'
  786.  *
  787.  * Input:         buffer - value of R1 on entry
  788.  *                size - value of R2 on entry
  789.  *
  790.  * Output:        used - value of R2 on exit (X version only)
  791.  *
  792.  * Returns:       R2 (non-X version only)
  793.  *
  794.  * Other notes:   Calls SWI 0x44ECE with R0 = 0x2.
  795.  */
  796.  
  797. extern os_error *xtoolboxgetsysinfo_dir_name (char *buffer,
  798.       int size,
  799.       int *used);
  800. extern int toolboxgetsysinfo_dir_name (char *buffer,
  801.       int size);
  802.  
  803. /* ------------------------------------------------------------------------
  804.  * Function:      toolboxgetsysinfo_task()
  805.  *
  806.  * Description:   Returns the task handle
  807.  *
  808.  * Output:        task - value of R0 on exit (X version only)
  809.  *
  810.  * Returns:       R0 (non-X version only)
  811.  *
  812.  * Other notes:   Calls SWI 0x44ECE with R0 = 0x3.
  813.  */
  814.  
  815. extern os_error *xtoolboxgetsysinfo_task (wimp_t *task);
  816. extern wimp_t toolboxgetsysinfo_task (void);
  817.  
  818. /* ------------------------------------------------------------------------
  819.  * Function:      toolboxgetsysinfo_sprite_area()
  820.  *
  821.  * Description:   Returns a pointer to the sprite area
  822.  *
  823.  * Output:        area - value of R0 on exit (X version only)
  824.  *
  825.  * Returns:       R0 (non-X version only)
  826.  *
  827.  * Other notes:   Calls SWI 0x44ECE with R0 = 0x4.
  828.  */
  829.  
  830. extern os_error *xtoolboxgetsysinfo_sprite_area (osspriteop_area **area);
  831. extern osspriteop_area *toolboxgetsysinfo_sprite_area (void);
  832.  
  833. /* ------------------------------------------------------------------------
  834.  * Function:      toolbox_initialise()
  835.  *
  836.  * Description:   Initialises the Toolbox
  837.  *
  838.  * Input:         flags - value of R0 on entry
  839.  *                version - value of R1 on entry
  840.  *                messages - value of R2 on entry
  841.  *                action_nos - value of R3 on entry
  842.  *                resource_dir_name - value of R4 on entry
  843.  *                cb - value of R5 on entry
  844.  *                block - value of R6 on entry
  845.  *
  846.  * Output:        version_out - value of R0 on exit
  847.  *                task_out - value of R1 on exit (X version only)
  848.  *                area - value of R2 on exit
  849.  *
  850.  * Returns:       R1 (non-X version only)
  851.  *
  852.  * Other notes:   Calls SWI 0x44ECF.
  853.  */
  854.  
  855. extern os_error *xtoolbox_initialise (toolbox_initialise_flags flags,
  856.       int version,
  857.       wimp_message_list const *messages,
  858.       toolbox_action_list const *action_nos,
  859.       char const *resource_dir_name,
  860.       messagetrans_control_block *cb,
  861.       toolbox_block *block,
  862.       int *version_out,
  863.       wimp_t *task_out,
  864.       osspriteop_area **area);
  865. extern wimp_t toolbox_initialise (toolbox_initialise_flags flags,
  866.       int version,
  867.       wimp_message_list const *messages,
  868.       toolbox_action_list const *action_nos,
  869.       char const *resource_dir_name,
  870.       messagetrans_control_block *cb,
  871.       toolbox_block *block,
  872.       int *version_out,
  873.       osspriteop_area **area);
  874.  
  875. /* ------------------------------------------------------------------------
  876.  * Function:      toolbox_load_resources()
  877.  *
  878.  * Description:   Loads a resource file
  879.  *
  880.  * Input:         flags - value of R0 on entry
  881.  *                resource_file_name - value of R1 on entry
  882.  *
  883.  * Other notes:   Calls SWI 0x44ED0.
  884.  */
  885.  
  886. extern os_error *xtoolbox_load_resources (toolbox_load_flags flags,
  887.       char const *resource_file_name);
  888. __swi (0x44ED0) void toolbox_load_resources (toolbox_load_flags flags,
  889.       char const *resource_file_name);
  890.  
  891. /* ------------------------------------------------------------------------
  892.  * Function:      toolbox_de_register_object_module()
  893.  *
  894.  * Description:   Deregisters an object module
  895.  *
  896.  * Input:         flags - value of R0 on entry
  897.  *                class_no - value of R1 on entry
  898.  *
  899.  * Other notes:   Calls SWI 0x44EFA.
  900.  */
  901.  
  902. extern os_error *xtoolbox_de_register_object_module (bits flags,
  903.       toolbox_class class_no);
  904. __swi (0x44EFA) void toolbox_de_register_object_module (bits flags,
  905.       toolbox_class class_no);
  906.  
  907. /* ------------------------------------------------------------------------
  908.  * Function:      toolbox_template_look_up()
  909.  *
  910.  * Description:   Returns the object pointer for a named resource
  911.  *
  912.  * Input:         flags - value of R0 on entry
  913.  *                object_name - value of R1 on entry
  914.  *
  915.  * Output:        id - value of R0 on exit (X version only)
  916.  *
  917.  * Returns:       R0 (non-X version only)
  918.  *
  919.  * Other notes:   Calls SWI 0x44EFB.
  920.  */
  921.  
  922. extern os_error *xtoolbox_template_look_up (toolbox_look_up_flags flags,
  923.       char const *object_name,
  924.       toolbox_id *id);
  925. __swi (0x44EFB) toolbox_id toolbox_template_look_up (toolbox_look_up_flags flags,
  926.       char const *object_name);
  927.  
  928. /* ------------------------------------------------------------------------
  929.  * Function:      toolbox_register_object_module()
  930.  *
  931.  * Description:   Registers an object module
  932.  *
  933.  * Input:         flags - value of R0 on entry
  934.  *                class_no - value of R1 on entry
  935.  *                swi_base - value of R2 on entry
  936.  *                resource_file_name - value of R3 on entry
  937.  *
  938.  * Other notes:   Calls SWI 0x44EFD.
  939.  */
  940.  
  941. extern os_error *xtoolbox_register_object_module (bits flags,
  942.       toolbox_class class_no,
  943.       bits swi_base,
  944.       char const *resource_file_name);
  945. __swi (0x44EFD) void toolbox_register_object_module (bits flags,
  946.       toolbox_class class_no,
  947.       bits swi_base,
  948.       char const *resource_file_name);
  949.  
  950. /* ------------------------------------------------------------------------
  951.  * Function:      toolbox_register_pre_filter()
  952.  *
  953.  * Description:   Registers an object module's prefilter
  954.  *
  955.  * Input:         flags - value of R0 on entry
  956.  *                swi_no - value of R1 on entry
  957.  *                handle - value of R2 on entry
  958.  *
  959.  * Other notes:   Calls SWI 0x44EFE.
  960.  */
  961.  
  962. extern os_error *xtoolbox_register_pre_filter (toolbox_register_flags flags,
  963.       bits swi_no,
  964.       void *handle);
  965. __swi (0x44EFE) void toolbox_register_pre_filter (toolbox_register_flags flags,
  966.       bits swi_no,
  967.       void *handle);
  968.  
  969. /* ------------------------------------------------------------------------
  970.  * Function:      toolbox_register_post_filter()
  971.  *
  972.  * Description:   Registers an object module's postfilter
  973.  *
  974.  * Input:         flags - value of R0 on entry
  975.  *                swi_no - value of R1 on entry
  976.  *                handle - value of R2 on entry
  977.  *                filter_type - value of R3 on entry
  978.  *                pairs - value of R4 on entry
  979.  *
  980.  * Other notes:   Calls SWI 0x44EFF.
  981.  */
  982.  
  983. extern os_error *xtoolbox_register_post_filter (toolbox_register_flags flags,
  984.       bits swi_no,
  985.       void *handle,
  986.       toolbox_filter_type filter_type,
  987.       toolbox_pair_list const *pairs);
  988. extern void toolbox_register_post_filter (toolbox_register_flags flags,
  989.       bits swi_no,
  990.       void *handle,
  991.       toolbox_filter_type filter_type,
  992.       toolbox_pair_list const *pairs);
  993.  
  994. /* ------------------------------------------------------------------------
  995.  * Function:      service_toolbox_starting()
  996.  *
  997.  * Description:   Toolbox starting
  998.  *
  999.  * Other notes:   Calls SWI 0x30 with R1 = 0x44EC1.
  1000.  */
  1001.  
  1002. extern os_error *xservice_toolbox_starting (void);
  1003. extern void service_toolbox_starting (void);
  1004.  
  1005. /* ------------------------------------------------------------------------
  1006.  * Function:      service_toolbox_task_born()
  1007.  *
  1008.  * Description:   New Toolbox task started
  1009.  *
  1010.  * Input:         task - value of R0 on entry
  1011.  *
  1012.  * Other notes:   Calls SWI 0x30 with R1 = 0x44EC2.
  1013.  */
  1014.  
  1015. extern os_error *xservice_toolbox_task_born (wimp_t task);
  1016. extern void service_toolbox_task_born (wimp_t task);
  1017.  
  1018. /* ------------------------------------------------------------------------
  1019.  * Function:      service_toolbox_task_died()
  1020.  *
  1021.  * Description:   Toolbox task died
  1022.  *
  1023.  * Input:         task - value of R0 on entry
  1024.  *
  1025.  * Other notes:   Calls SWI 0x30 with R1 = 0x44EC3.
  1026.  */
  1027.  
  1028. extern os_error *xservice_toolbox_task_died (wimp_t task);
  1029. extern void service_toolbox_task_died (wimp_t task);
  1030.  
  1031. /* ------------------------------------------------------------------------
  1032.  * Function:      service_window_deleted()
  1033.  *
  1034.  * Description:   Window deleted
  1035.  *
  1036.  * Input:         w - value of R0 on entry
  1037.  *                task - value of R2 on entry
  1038.  *
  1039.  * Other notes:   Calls SWI 0x30 with R1 = 0x44EC5.
  1040.  */
  1041.  
  1042. extern os_error *xservice_window_deleted (wimp_w w,
  1043.       wimp_t task);
  1044. extern void service_window_deleted (wimp_w w,
  1045.       wimp_t task);
  1046.  
  1047. /* ------------------------------------------------------------------------
  1048.  * Function:      service_redrawing_window()
  1049.  *
  1050.  * Description:   Window is being redrawn
  1051.  *
  1052.  * Input:         type - value of R0 on entry
  1053.  *
  1054.  * Other notes:   Calls SWI 0x30 with R1 = 0x44EC6.
  1055.  */
  1056.  
  1057. extern os_error *xservice_redrawing_window (int type);
  1058. extern void service_redrawing_window (int type);
  1059.  
  1060. #ifdef __cplusplus
  1061.    }
  1062. #endif
  1063.  
  1064. #endif
  1065.