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

  1. #ifndef optionbutton_H
  2. #define optionbutton_H
  3.  
  4. /* C header file for OptionButton
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 16:29:11 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  OptionButton_SetLabel
  25. #define OptionButton_SetLabel                   0xC0
  26. #undef  OptionButton_GetLabel
  27. #define OptionButton_GetLabel                   0xC1
  28. #undef  OptionButton_SetAction
  29. #define OptionButton_SetAction                  0xC2
  30. #undef  OptionButton_GetAction
  31. #define OptionButton_GetAction                  0xC3
  32. #undef  OptionButton_SetState
  33. #define OptionButton_SetState                   0xC4
  34. #undef  OptionButton_GetState
  35. #define OptionButton_GetState                   0xC5
  36.  
  37. /************************************
  38.  * Structure and union declarations *
  39.  ************************************/
  40. typedef struct optionbutton_gadget              optionbutton_gadget;
  41. typedef struct optionbutton_action_state_changed optionbutton_action_state_changed;
  42.  
  43. /********************
  44.  * Type definitions *
  45.  ********************/
  46. struct optionbutton_gadget
  47.    {  toolbox_msg_reference label;
  48.       int label_limit;
  49.       bits action;
  50.    };
  51.  
  52. struct optionbutton_action_state_changed
  53.    {  bool on;
  54.    };
  55.  
  56. /************************
  57.  * Constant definitions *
  58.  ************************/
  59. #define class_OPTION_BUTTON                     ((toolbox_class) 0xC0u)
  60. #define action_OPTION_BUTTON_STATE_CHANGED      0x82882u
  61. #define optionbutton_STATE_CHANGED_ADJUST       0x1u
  62. #define optionbutton_STATE_CHANGED_SELECT       0x4u
  63.  
  64. /*************************
  65.  * Function declarations *
  66.  *************************/
  67.  
  68. #ifdef __cplusplus
  69.    extern "C" {
  70. #endif
  71.  
  72. /* ------------------------------------------------------------------------
  73.  * Function:      optionbutton_set_label()
  74.  *
  75.  * Description:   Sets the label of the specified option button
  76.  *
  77.  * Input:         flags - value of R0 on entry
  78.  *                window - value of R1 on entry
  79.  *                option_button - value of R3 on entry
  80.  *                label - value of R4 on entry
  81.  *
  82.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0xC0.
  83.  */
  84.  
  85. extern os_error *xoptionbutton_set_label (bits flags,
  86.       toolbox_o window,
  87.       toolbox_c option_button,
  88.       char const *label);
  89. extern void optionbutton_set_label (bits flags,
  90.       toolbox_o window,
  91.       toolbox_c option_button,
  92.       char const *label);
  93.  
  94. /* ------------------------------------------------------------------------
  95.  * Function:      optionbutton_get_label()
  96.  *
  97.  * Description:   Gets the label of the specified option button
  98.  *
  99.  * Input:         flags - value of R0 on entry
  100.  *                window - value of R1 on entry
  101.  *                option_button - value of R3 on entry
  102.  *                buffer - value of R4 on entry
  103.  *                size - value of R5 on entry
  104.  *
  105.  * Output:        used - value of R5 on exit (X version only)
  106.  *
  107.  * Returns:       R5 (non-X version only)
  108.  *
  109.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0xC1.
  110.  */
  111.  
  112. extern os_error *xoptionbutton_get_label (bits flags,
  113.       toolbox_o window,
  114.       toolbox_c option_button,
  115.       char *buffer,
  116.       int size,
  117.       int *used);
  118. extern int optionbutton_get_label (bits flags,
  119.       toolbox_o window,
  120.       toolbox_c option_button,
  121.       char *buffer,
  122.       int size);
  123.  
  124. /* ------------------------------------------------------------------------
  125.  * Function:      optionbutton_set_action()
  126.  *
  127.  * Description:   Calls reason code 194 of SWI 0x44EC6
  128.  *
  129.  * Input:         flags - value of R0 on entry
  130.  *                window - value of R1 on entry
  131.  *                option_button - value of R3 on entry
  132.  *                action - value of R4 on entry
  133.  *
  134.  * Other notes:   Before entry, R2 = 0xC2.
  135.  */
  136.  
  137. extern os_error *xoptionbutton_set_action (bits flags,
  138.       toolbox_o window,
  139.       toolbox_c option_button,
  140.       bits action);
  141. extern void optionbutton_set_action (bits flags,
  142.       toolbox_o window,
  143.       toolbox_c option_button,
  144.       bits action);
  145.  
  146. /* ------------------------------------------------------------------------
  147.  * Function:      optionbutton_get_action()
  148.  *
  149.  * Description:   Calls reason code 195 of SWI 0x44EC6
  150.  *
  151.  * Input:         flags - value of R0 on entry
  152.  *                window - value of R1 on entry
  153.  *                option_button - value of R3 on entry
  154.  *
  155.  * Output:        action - value of R0 on exit (X version only)
  156.  *
  157.  * Returns:       R0 (non-X version only)
  158.  *
  159.  * Other notes:   Before entry, R2 = 0xC3.
  160.  */
  161.  
  162. extern os_error *xoptionbutton_get_action (bits flags,
  163.       toolbox_o window,
  164.       toolbox_c option_button,
  165.       bits *action);
  166. extern bits optionbutton_get_action (bits flags,
  167.       toolbox_o window,
  168.       toolbox_c option_button);
  169.  
  170. /* ------------------------------------------------------------------------
  171.  * Function:      optionbutton_set_state()
  172.  *
  173.  * Description:   Calls reason code 196 of SWI 0x44EC6
  174.  *
  175.  * Input:         flags - value of R0 on entry
  176.  *                window - value of R1 on entry
  177.  *                option_button - value of R3 on entry
  178.  *                on - value of R4 on entry
  179.  *
  180.  * Other notes:   Before entry, R2 = 0xC4.
  181.  */
  182.  
  183. extern os_error *xoptionbutton_set_state (bits flags,
  184.       toolbox_o window,
  185.       toolbox_c option_button,
  186.       bool on);
  187. extern void optionbutton_set_state (bits flags,
  188.       toolbox_o window,
  189.       toolbox_c option_button,
  190.       bool on);
  191.  
  192. /* ------------------------------------------------------------------------
  193.  * Function:      optionbutton_get_state()
  194.  *
  195.  * Description:   Calls reason code 197 of SWI 0x44EC6
  196.  *
  197.  * Input:         flags - value of R0 on entry
  198.  *                window - value of R1 on entry
  199.  *                option_button - value of R3 on entry
  200.  *
  201.  * Output:        on - value of R0 on exit (X version only)
  202.  *
  203.  * Returns:       R0 (non-X version only)
  204.  *
  205.  * Other notes:   Before entry, R2 = 0xC5.
  206.  */
  207.  
  208. extern os_error *xoptionbutton_get_state (bits flags,
  209.       toolbox_o window,
  210.       toolbox_c option_button,
  211.       bool *on);
  212. extern bool optionbutton_get_state (bits flags,
  213.       toolbox_o window,
  214.       toolbox_c option_button);
  215.  
  216. #ifdef __cplusplus
  217.    }
  218. #endif
  219.  
  220. #endif
  221.