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

  1. #ifndef actionbutton_H
  2. #define actionbutton_H
  3.  
  4. /* C header file for ActionButton
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 16:29:26 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. #ifndef gadget_H
  18. #include "gadget.h"
  19. #endif
  20.  
  21. /**********************************
  22.  * SWI names and SWI reason codes *
  23.  **********************************/
  24. #undef  ActionButton_SetText
  25. #define ActionButton_SetText                    0x80
  26. #undef  ActionButton_GetText
  27. #define ActionButton_GetText                    0x81
  28. #undef  ActionButton_SetAction
  29. #define ActionButton_SetAction                  0x82
  30. #undef  ActionButton_GetAction
  31. #define ActionButton_GetAction                  0x83
  32. #undef  ActionButton_SetClickShow
  33. #define ActionButton_SetClickShow               0x84
  34. #undef  ActionButton_GetClickShow
  35. #define ActionButton_GetClickShow               0x85
  36.  
  37. /************************************
  38.  * Structure and union declarations *
  39.  ************************************/
  40. typedef struct actionbutton_gadget              actionbutton_gadget;
  41.  
  42. /********************
  43.  * Type definitions *
  44.  ********************/
  45. struct actionbutton_gadget
  46.    {  toolbox_msg_reference text;
  47.       int text_limit;
  48.       toolbox_string_reference click_show;
  49.       bits action;
  50.    };
  51.  
  52. /************************
  53.  * Constant definitions *
  54.  ************************/
  55. #define class_ACTION_BUTTON                     ((toolbox_class) 0x80u)
  56. #define actionbutton_IS_DEFAULT                 ((gadget_flags) 0x1u)
  57. #define actionbutton_IS_CANCEL                  ((gadget_flags) 0x2u)
  58. #define actionbutton_IS_LOCAL                   ((gadget_flags) 0x4u)
  59. #define actionbutton_IS_MENU                    ((gadget_flags) 0x8u)
  60. #define action_ACTION_BUTTON_SELECTED           0x82881u
  61. #define actionbutton_SELECTED_ADJUST            0x1u
  62. #define actionbutton_SELECTED_SELECT            0x4u
  63. #define actionbutton_SELECTED_DEFAULT           0x8u
  64. #define actionbutton_SELECTED_CANCEL            0x10u
  65. #define actionbutton_SELECTED_LOCAL             0x20u
  66.  
  67. /*************************
  68.  * Function declarations *
  69.  *************************/
  70.  
  71. #ifdef __cplusplus
  72.    extern "C" {
  73. #endif
  74.  
  75. /* ------------------------------------------------------------------------
  76.  * Function:      actionbutton_set_text()
  77.  *
  78.  * Description:   Sets the text that will be displayed in the specified
  79.  *                action button
  80.  *
  81.  * Input:         flags - value of R0 on entry
  82.  *                window - value of R1 on entry
  83.  *                action_button - value of R3 on entry
  84.  *                text - value of R4 on entry
  85.  *
  86.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x80.
  87.  */
  88.  
  89. extern os_error *xactionbutton_set_text (bits flags,
  90.       toolbox_o window,
  91.       toolbox_c action_button,
  92.       char const *text);
  93. extern void actionbutton_set_text (bits flags,
  94.       toolbox_o window,
  95.       toolbox_c action_button,
  96.       char const *text);
  97.  
  98. /* ------------------------------------------------------------------------
  99.  * Function:      actionbutton_get_text()
  100.  *
  101.  * Description:   Calls reason code 129 of SWI 0x44EC6
  102.  *
  103.  * Input:         flags - value of R0 on entry
  104.  *                window - value of R1 on entry
  105.  *                action_button - value of R3 on entry
  106.  *                text - value of R4 on entry
  107.  *                size - value of R5 on entry
  108.  *
  109.  * Output:        used - value of R5 on exit (X version only)
  110.  *
  111.  * Returns:       R5 (non-X version only)
  112.  *
  113.  * Other notes:   Before entry, R2 = 0x81.
  114.  */
  115.  
  116. extern os_error *xactionbutton_get_text (bits flags,
  117.       toolbox_o window,
  118.       toolbox_c action_button,
  119.       char *text,
  120.       int size,
  121.       int *used);
  122. extern int actionbutton_get_text (bits flags,
  123.       toolbox_o window,
  124.       toolbox_c action_button,
  125.       char *text,
  126.       int size);
  127.  
  128. /* ------------------------------------------------------------------------
  129.  * Function:      actionbutton_set_action()
  130.  *
  131.  * Description:   Sets the action that is raised when the button is clicked
  132.  *
  133.  * Input:         flags - value of R0 on entry
  134.  *                window - value of R1 on entry
  135.  *                action_button - value of R3 on entry
  136.  *                action - value of R4 on entry
  137.  *
  138.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x82.
  139.  */
  140.  
  141. extern os_error *xactionbutton_set_action (bits flags,
  142.       toolbox_o window,
  143.       toolbox_c action_button,
  144.       bits action);
  145. extern void actionbutton_set_action (bits flags,
  146.       toolbox_o window,
  147.       toolbox_c action_button,
  148.       bits action);
  149.  
  150. /* ------------------------------------------------------------------------
  151.  * Function:      actionbutton_get_action()
  152.  *
  153.  * Description:   Gets the action that is raised when the button is clicked
  154.  *
  155.  * Input:         flags - value of R0 on entry
  156.  *                window - value of R1 on entry
  157.  *                action_button - value of R3 on entry
  158.  *
  159.  * Output:        action - value of R0 on exit (X version only)
  160.  *
  161.  * Returns:       R0 (non-X version only)
  162.  *
  163.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x83.
  164.  */
  165.  
  166. extern os_error *xactionbutton_get_action (bits flags,
  167.       toolbox_o window,
  168.       toolbox_c action_button,
  169.       bits *action);
  170. extern bits actionbutton_get_action (bits flags,
  171.       toolbox_o window,
  172.       toolbox_c action_button);
  173.  
  174. /* ------------------------------------------------------------------------
  175.  * Function:      actionbutton_set_click_show()
  176.  *
  177.  * Description:   Calls reason code 132 of SWI 0x44EC6
  178.  *
  179.  * Input:         flags - value of R0 on entry
  180.  *                window - value of R1 on entry
  181.  *                action_button - value of R3 on entry
  182.  *                obj - value of R4 on entry
  183.  *
  184.  * Other notes:   Before entry, R2 = 0x84.
  185.  */
  186.  
  187. extern os_error *xactionbutton_set_click_show (bits flags,
  188.       toolbox_o window,
  189.       toolbox_c action_button,
  190.       toolbox_o obj);
  191. extern void actionbutton_set_click_show (bits flags,
  192.       toolbox_o window,
  193.       toolbox_c action_button,
  194.       toolbox_o obj);
  195.  
  196. /* ------------------------------------------------------------------------
  197.  * Function:      actionbutton_get_click_show()
  198.  *
  199.  * Description:   Calls reason code 133 of SWI 0x44EC6
  200.  *
  201.  * Input:         flags - value of R0 on entry
  202.  *                window - value of R1 on entry
  203.  *                action_button - value of R3 on entry
  204.  *
  205.  * Output:        obj - value of R0 on exit (X version only)
  206.  *
  207.  * Returns:       R0 (non-X version only)
  208.  *
  209.  * Other notes:   Before entry, R2 = 0x85.
  210.  */
  211.  
  212. extern os_error *xactionbutton_get_click_show (bits flags,
  213.       toolbox_o window,
  214.       toolbox_c action_button,
  215.       toolbox_o *obj);
  216. extern toolbox_o actionbutton_get_click_show (bits flags,
  217.       toolbox_o window,
  218.       toolbox_c action_button);
  219.  
  220. #ifdef __cplusplus
  221.    }
  222. #endif
  223.  
  224. #endif
  225.