home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / Toolbox / h / iconbar < prev    next >
Encoding:
Text File  |  1995-09-05  |  13.6 KB  |  439 lines

  1. #ifndef iconbar_H
  2. #define iconbar_H
  3.  
  4. /* C header file for Iconbar
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 15:14:20 1995
  6.  * Jonathan Coxhead, Acorn Computers Ltd
  7.  */
  8.  
  9. #ifndef types_H
  10. #include "types.h"
  11. #endif
  12.  
  13. #ifndef toolbox_H
  14. #include "toolbox.h"
  15. #endif
  16.  
  17. /**********************************
  18.  * SWI names and SWI reason codes *
  19.  **********************************/
  20. #undef  Iconbar_ClassSWI
  21. #define Iconbar_ClassSWI                        0x82900
  22. #undef  XIconbar_ClassSWI
  23. #define XIconbar_ClassSWI                       0xA2900
  24. #undef  Iconbar_PostFilter
  25. #define Iconbar_PostFilter                      0x82901
  26. #undef  XIconbar_PostFilter
  27. #define XIconbar_PostFilter                     0xA2901
  28. #undef  Iconbar_PreFilter
  29. #define Iconbar_PreFilter                       0x82902
  30. #undef  XIconbar_PreFilter
  31. #define XIconbar_PreFilter                      0xA2902
  32. #undef  Iconbar_GetIconHandle
  33. #define Iconbar_GetIconHandle                   0x0
  34. #undef  Iconbar_SetMenu
  35. #define Iconbar_SetMenu                         0x1
  36. #undef  Iconbar_GetMenu
  37. #define Iconbar_GetMenu                         0x2
  38. #undef  Iconbar_SetAction
  39. #define Iconbar_SetAction                       0x3
  40. #undef  Iconbar_GetAction
  41. #define Iconbar_GetAction                       0x4
  42. #undef  Iconbar_SetShow
  43. #define Iconbar_SetShow                         0x5
  44. #undef  Iconbar_GetShow
  45. #define Iconbar_GetShow                         0x6
  46. #undef  Iconbar_SetHelpMessage
  47. #define Iconbar_SetHelpMessage                  0x7
  48. #undef  Iconbar_GetHelpMessage
  49. #define Iconbar_GetHelpMessage                  0x8
  50. #undef  Iconbar_SetText
  51. #define Iconbar_SetText                         0x9
  52. #undef  Iconbar_GetText
  53. #define Iconbar_GetText                         0xA
  54. #undef  Iconbar_SetSprite
  55. #define Iconbar_SetSprite                       0xB
  56. #undef  Iconbar_GetSprite
  57. #define Iconbar_GetSprite                       0xC
  58.  
  59. /************************************
  60.  * Structure and union declarations *
  61.  ************************************/
  62. typedef struct iconbar_object                   iconbar_object;
  63. typedef struct iconbar_action_about_to_be_shown iconbar_action_about_to_be_shown;
  64.  
  65. /********************
  66.  * Type definitions *
  67.  ********************/
  68. typedef bits iconbar_flags;
  69.  
  70. struct iconbar_object
  71.    {  iconbar_flags flags;
  72.       int position;
  73.       int priority;
  74.       toolbox_string_reference sprite_name;
  75.       int sprite_limit;
  76.       toolbox_msg_reference text;
  77.       int text_limit;
  78.       toolbox_string_reference menu;
  79.       bits select_action;
  80.       bits adjust_action;
  81.       toolbox_string_reference select_show;
  82.       toolbox_string_reference adjust_show;
  83.       toolbox_msg_reference help_message;
  84.       int help_limit;
  85.    };
  86.  
  87. typedef toolbox_full iconbar_full;
  88.  
  89. struct iconbar_action_about_to_be_shown
  90.    {  toolbox_position_tag tag;
  91.       union
  92.       {  os_coord top_left;
  93.          iconbar_full full;
  94.       }
  95.       position;
  96.    };
  97.  
  98. typedef bits iconbar_set_button;
  99.  
  100. /************************
  101.  * Constant definitions *
  102.  ************************/
  103. #define class_ICONBAR                           ((toolbox_class) 0x82900u)
  104. #define error_ICONBAR_ALLOC_FAILED              0x80AB01u
  105. #define error_ICONBAR_SHORT_BUFFER              0x80AB02u
  106. #define error_ICONBAR_BAD_OBJECT_VERSION        0x80AB03u
  107. #define error_ICONBAR_BAD_FLAGS                 0x80AB04u
  108. #define error_ICONBAR_NO_SUCH_TASK              0x80AB11u
  109. #define error_ICONBAR_NO_SUCH_METHOD            0x80AB12u
  110. #define error_ICONBAR_NO_SUCH_MISC_OP_METHOD    0x80AB13u
  111. #define error_ICONBAR_WRONG_SHOW_TYPE           0x80AB14u
  112. #define error_ICONBAR_NO_TEXT                   0x80AB20u
  113. #define error_ICONBAR_TASKS_ACTIVE              0x80AB21u
  114. #define iconbar_GENERATE_SELECT_ABOUT_TO_BE_SHOWN ((iconbar_flags) 0x1u)
  115. #define iconbar_GENERATE_ADJUST_ABOUT_TO_BE_SHOWN ((iconbar_flags) 0x2u)
  116. #define iconbar_SELECT_IS_MENU                  ((iconbar_flags) 0x4u)
  117. #define iconbar_ADJUST_IS_MENU                  ((iconbar_flags) 0x8u)
  118. #define iconbar_HAS_TEXT                        ((iconbar_flags) 0x10u)
  119.       /*Reserved bit - not settable by client*/
  120. #define iconbar_GENERATE_SELECT_CLICKED         ((iconbar_flags) 0x20u)
  121. #define iconbar_GENERATE_ADJUST_CLICKED         ((iconbar_flags) 0x40u)
  122. #define action_ICONBAR_CLICKED                  0x82900u
  123. #define action_ICONBAR_SELECT_ABOUT_TO_BE_SHOWN 0x82901u
  124. #define action_ICONBAR_ADJUST_ABOUT_TO_BE_SHOWN 0x82902u
  125. #define iconbar_SELECT                          ((iconbar_set_button) 0x1u)
  126. #define iconbar_ADJUST                          ((iconbar_set_button) 0x2u)
  127. #define iconbar_CLICKED_ADJUST                  0x1u
  128. #define iconbar_CLICKED_SELECT                  0x4u
  129.  
  130. /*************************
  131.  * Function declarations *
  132.  *************************/
  133.  
  134. #ifdef __cplusplus
  135.    extern "C" {
  136. #endif
  137.  
  138. /* ------------------------------------------------------------------------
  139.  * Function:      iconbar_get_icon_handle()
  140.  *
  141.  * Description:   Gets the icon handle for the iconbar object
  142.  *
  143.  * Input:         flags - value of R0 on entry
  144.  *                iconbar - value of R1 on entry
  145.  *
  146.  * Output:        i - value of R0 on exit (X version only)
  147.  *
  148.  * Returns:       R0 (non-X version only)
  149.  *
  150.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x0.
  151.  */
  152.  
  153. extern os_error *xiconbar_get_icon_handle (bits flags,
  154.       toolbox_o iconbar,
  155.       wimp_i *i);
  156. extern wimp_i iconbar_get_icon_handle (bits flags,
  157.       toolbox_o iconbar);
  158.  
  159. /* ------------------------------------------------------------------------
  160.  * Function:      iconbar_set_menu()
  161.  *
  162.  * Description:   Sets the menu which will be displayed when MENU is
  163.  *                clicked over iconbar object
  164.  *
  165.  * Input:         flags - value of R0 on entry
  166.  *                iconbar - value of R1 on entry
  167.  *                menu - value of R3 on entry
  168.  *
  169.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x1.
  170.  */
  171.  
  172. extern os_error *xiconbar_set_menu (bits flags,
  173.       toolbox_o iconbar,
  174.       toolbox_o menu);
  175. extern void iconbar_set_menu (bits flags,
  176.       toolbox_o iconbar,
  177.       toolbox_o menu);
  178.  
  179. /* ------------------------------------------------------------------------
  180.  * Function:      iconbar_get_menu()
  181.  *
  182.  * Description:   Gets the menu which will be displayed when MENU is
  183.  *                clicked over iconbar
  184.  *
  185.  * Input:         flags - value of R0 on entry
  186.  *                iconbar - value of R1 on entry
  187.  *
  188.  * Output:        menu - value of R0 on exit (X version only)
  189.  *
  190.  * Returns:       R0 (non-X version only)
  191.  *
  192.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x2.
  193.  */
  194.  
  195. extern os_error *xiconbar_get_menu (bits flags,
  196.       toolbox_o iconbar,
  197.       toolbox_o *menu);
  198. extern toolbox_o iconbar_get_menu (bits flags,
  199.       toolbox_o iconbar);
  200.  
  201. /* ------------------------------------------------------------------------
  202.  * Function:      iconbar_set_action()
  203.  *
  204.  * Description:   Sets actions that will be raised when SELECT/ADJUST are
  205.  *                clicked on iconbar
  206.  *
  207.  * Input:         flags - value of R0 on entry
  208.  *                iconbar - value of R1 on entry
  209.  *                select_action - value of R3 on entry
  210.  *                adjust_action - value of R4 on entry
  211.  *
  212.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x3.
  213.  */
  214.  
  215. extern os_error *xiconbar_set_action (iconbar_set_button flags,
  216.       toolbox_o iconbar,
  217.       bits select_action,
  218.       bits adjust_action);
  219. extern void iconbar_set_action (iconbar_set_button flags,
  220.       toolbox_o iconbar,
  221.       bits select_action,
  222.       bits adjust_action);
  223.  
  224. /* ------------------------------------------------------------------------
  225.  * Function:      iconbar_get_action()
  226.  *
  227.  * Description:   Calls reason code 4 of SWI 0x44EC6
  228.  *
  229.  * Input:         flags - value of R0 on entry
  230.  *                iconbar - value of R1 on entry
  231.  *
  232.  * Output:        select_action - value of R0 on exit
  233.  *                adjust_action - value of R1 on exit
  234.  *
  235.  * Other notes:   Before entry, R2 = 0x4.
  236.  */
  237.  
  238. extern os_error *xiconbar_get_action (bits flags,
  239.       toolbox_o iconbar,
  240.       int *select_action,
  241.       int *adjust_action);
  242. extern void iconbar_get_action (bits flags,
  243.       toolbox_o iconbar,
  244.       int *select_action,
  245.       int *adjust_action);
  246.  
  247. /* ------------------------------------------------------------------------
  248.  * Function:      iconbar_set_show()
  249.  *
  250.  * Description:   Sets objects to be shown which SELECT/ADJUST are clicked
  251.  *                on iconbar
  252.  *
  253.  * Input:         flags - value of R0 on entry
  254.  *                iconbar - value of R1 on entry
  255.  *                select - value of R3 on entry
  256.  *                adjust - value of R4 on entry
  257.  *
  258.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x5.
  259.  */
  260.  
  261. extern os_error *xiconbar_set_show (iconbar_set_button flags,
  262.       toolbox_o iconbar,
  263.       toolbox_o select,
  264.       toolbox_o adjust);
  265. extern void iconbar_set_show (iconbar_set_button flags,
  266.       toolbox_o iconbar,
  267.       toolbox_o select,
  268.       toolbox_o adjust);
  269.  
  270. /* ------------------------------------------------------------------------
  271.  * Function:      iconbar_get_show()
  272.  *
  273.  * Description:   Gets the objects that will be shown when SELECT/ADJUST
  274.  *                are clicked on iconbar
  275.  *
  276.  * Input:         flags - value of R0 on entry
  277.  *                iconbar - value of R1 on entry
  278.  *
  279.  * Output:        select - value of R0 on exit
  280.  *                adjust - value of R1 on exit
  281.  *
  282.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x6.
  283.  */
  284.  
  285. extern os_error *xiconbar_get_show (bits flags,
  286.       toolbox_o iconbar,
  287.       toolbox_o *select,
  288.       toolbox_o *adjust);
  289. extern void iconbar_get_show (bits flags,
  290.       toolbox_o iconbar,
  291.       toolbox_o *select,
  292.       toolbox_o *adjust);
  293.  
  294. /* ------------------------------------------------------------------------
  295.  * Function:      iconbar_set_help_message()
  296.  *
  297.  * Description:   Sets the iconbar objects interactive help message
  298.  *
  299.  * Input:         flags - value of R0 on entry
  300.  *                iconbar - value of R1 on entry
  301.  *                help_message - value of R3 on entry
  302.  *
  303.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x7.
  304.  */
  305.  
  306. extern os_error *xiconbar_set_help_message (bits flags,
  307.       toolbox_o iconbar,
  308.       char const *help_message);
  309. extern void iconbar_set_help_message (bits flags,
  310.       toolbox_o iconbar,
  311.       char const *help_message);
  312.  
  313. /* ------------------------------------------------------------------------
  314.  * Function:      iconbar_get_help_message()
  315.  *
  316.  * Description:   Gets the iconbar objects interactive help message
  317.  *
  318.  * Input:         flags - value of R0 on entry
  319.  *                iconbar - value of R1 on entry
  320.  *                buffer - value of R3 on entry
  321.  *                size - value of R4 on entry
  322.  *
  323.  * Output:        used - value of R4 on exit (X version only)
  324.  *
  325.  * Returns:       R4 (non-X version only)
  326.  *
  327.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x8.
  328.  */
  329.  
  330. extern os_error *xiconbar_get_help_message (bits flags,
  331.       toolbox_o iconbar,
  332.       char *buffer,
  333.       int size,
  334.       int *used);
  335. extern int iconbar_get_help_message (bits flags,
  336.       toolbox_o iconbar,
  337.       char *buffer,
  338.       int size);
  339.  
  340. /* ------------------------------------------------------------------------
  341.  * Function:      iconbar_set_text()
  342.  *
  343.  * Description:   Sets the text string that will be used for text & sprite
  344.  *                iconbar objects
  345.  *
  346.  * Input:         flags - value of R0 on entry
  347.  *                iconbar - value of R1 on entry
  348.  *                text - value of R3 on entry
  349.  *
  350.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x9.
  351.  */
  352.  
  353. extern os_error *xiconbar_set_text (bits flags,
  354.       toolbox_o iconbar,
  355.       char const *text);
  356. extern void iconbar_set_text (bits flags,
  357.       toolbox_o iconbar,
  358.       char const *text);
  359.  
  360. /* ------------------------------------------------------------------------
  361.  * Function:      iconbar_get_text()
  362.  *
  363.  * Description:   Gets the text string that will be used for text & sprite
  364.  *                iconbar objects
  365.  *
  366.  * Input:         flags - value of R0 on entry
  367.  *                iconbar - value of R1 on entry
  368.  *                buffer - value of R3 on entry
  369.  *                size - value of R4 on entry
  370.  *
  371.  * Output:        used - value of R4 on exit (X version only)
  372.  *
  373.  * Returns:       R4 (non-X version only)
  374.  *
  375.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0xA.
  376.  */
  377.  
  378. extern os_error *xiconbar_get_text (bits flags,
  379.       toolbox_o iconbar,
  380.       char *buffer,
  381.       int size,
  382.       int *used);
  383. extern int iconbar_get_text (bits flags,
  384.       toolbox_o iconbar,
  385.       char *buffer,
  386.       int size);
  387.  
  388. /* ------------------------------------------------------------------------
  389.  * Function:      iconbar_set_sprite()
  390.  *
  391.  * Description:   Sets the sprite to be used for the iconbar object
  392.  *
  393.  * Input:         flags - value of R0 on entry
  394.  *                iconbar - value of R1 on entry
  395.  *                sprite_name - value of R3 on entry
  396.  *
  397.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0xB.
  398.  */
  399.  
  400. extern os_error *xiconbar_set_sprite (bits flags,
  401.       toolbox_o iconbar,
  402.       char const *sprite_name);
  403. extern void iconbar_set_sprite (bits flags,
  404.       toolbox_o iconbar,
  405.       char const *sprite_name);
  406.  
  407. /* ------------------------------------------------------------------------
  408.  * Function:      iconbar_get_sprite()
  409.  *
  410.  * Description:   Gets the sprite that is used for the iconbar object
  411.  *
  412.  * Input:         flags - value of R0 on entry
  413.  *                iconbar - value of R1 on entry
  414.  *                buffer - value of R3 on entry
  415.  *                size - value of R4 on entry
  416.  *
  417.  * Output:        used - value of R4 on exit (X version only)
  418.  *
  419.  * Returns:       R4 (non-X version only)
  420.  *
  421.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0xC.
  422.  */
  423.  
  424. extern os_error *xiconbar_get_sprite (bits flags,
  425.       toolbox_o iconbar,
  426.       char *buffer,
  427.       int size,
  428.       int *used);
  429. extern int iconbar_get_sprite (bits flags,
  430.       toolbox_o iconbar,
  431.       char *buffer,
  432.       int size);
  433.  
  434. #ifdef __cplusplus
  435.    }
  436. #endif
  437.  
  438. #endif
  439.