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

  1. #ifndef radiobutton_H
  2. #define radiobutton_H
  3.  
  4. /* C header file for RadioButton
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 16:29:08 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  RadioButton_SetLabel
  25. #define RadioButton_SetLabel                    0x180
  26. #undef  RadioButton_GetLabel
  27. #define RadioButton_GetLabel                    0x181
  28. #undef  RadioButton_SetAction
  29. #define RadioButton_SetAction                   0x182
  30. #undef  RadioButton_GetAction
  31. #define RadioButton_GetAction                   0x183
  32. #undef  RadioButton_SetState
  33. #define RadioButton_SetState                    0x184
  34. #undef  RadioButton_GetState
  35. #define RadioButton_GetState                    0x185
  36.  
  37. /************************************
  38.  * Structure and union declarations *
  39.  ************************************/
  40. typedef struct radiobutton_gadget               radiobutton_gadget;
  41. typedef struct radiobutton_action_state_changed radiobutton_action_state_changed;
  42.  
  43. /********************
  44.  * Type definitions *
  45.  ********************/
  46. struct radiobutton_gadget
  47.    {  int group;
  48.       toolbox_msg_reference label;
  49.       int label_limit;
  50.       bits action;
  51.    };
  52.  
  53. struct radiobutton_action_state_changed
  54.    {  bool on;
  55.       toolbox_c previous_on;
  56.    };
  57.  
  58. /************************
  59.  * Constant definitions *
  60.  ************************/
  61. #define class_RADIO_BUTTON                      ((toolbox_class) 0x180u)
  62. #define radiobutton_GENERATE_STATE_CHANGED      ((gadget_flags) 0x1u)
  63. #define radiobutton_GENERATE_SET_STATE_CHANGED  ((gadget_flags) 0x2u)
  64. #define radiobutton_ON                          ((gadget_flags) 0x4u)
  65. #define action_RADIO_BUTTON_STATE_CHANGED       0x82883u
  66. #define radiobutton_STATE_CHANGED_ADJUST        0x1u
  67. #define radiobutton_STATE_CHANGED_SELECT        0x4u
  68.  
  69. /*************************
  70.  * Function declarations *
  71.  *************************/
  72.  
  73. #ifdef __cplusplus
  74.    extern "C" {
  75. #endif
  76.  
  77. /* ------------------------------------------------------------------------
  78.  * Function:      radiobutton_set_label()
  79.  *
  80.  * Description:   sets the label text for the specified radio button
  81.  *
  82.  * Input:         flags - value of R0 on entry
  83.  *                window - value of R1 on entry
  84.  *                radio_button - value of R3 on entry
  85.  *                label - value of R4 on entry
  86.  *
  87.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x180.
  88.  */
  89.  
  90. extern os_error *xradiobutton_set_label (bits flags,
  91.       toolbox_o window,
  92.       toolbox_c radio_button,
  93.       char const *label);
  94. extern void radiobutton_set_label (bits flags,
  95.       toolbox_o window,
  96.       toolbox_c radio_button,
  97.       char const *label);
  98.  
  99. /* ------------------------------------------------------------------------
  100.  * Function:      radiobutton_get_label()
  101.  *
  102.  * Description:   Gets the label text for the specified radio button
  103.  *
  104.  * Input:         flags - value of R0 on entry
  105.  *                window - value of R1 on entry
  106.  *                radio_button - value of R3 on entry
  107.  *                buffer - value of R4 on entry
  108.  *                size - value of R5 on entry
  109.  *
  110.  * Output:        used - value of R5 on exit (X version only)
  111.  *
  112.  * Returns:       R5 (non-X version only)
  113.  *
  114.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x181.
  115.  */
  116.  
  117. extern os_error *xradiobutton_get_label (bits flags,
  118.       toolbox_o window,
  119.       toolbox_c radio_button,
  120.       char *buffer,
  121.       int size,
  122.       int *used);
  123. extern int radiobutton_get_label (bits flags,
  124.       toolbox_o window,
  125.       toolbox_c radio_button,
  126.       char *buffer,
  127.       int size);
  128.  
  129. /* ------------------------------------------------------------------------
  130.  * Function:      radiobutton_set_action()
  131.  *
  132.  * Description:   Calls reason code 386 of SWI 0x44EC6
  133.  *
  134.  * Input:         flags - value of R0 on entry
  135.  *                window - value of R1 on entry
  136.  *                radio_button - value of R3 on entry
  137.  *                action - value of R4 on entry
  138.  *
  139.  * Other notes:   Before entry, R2 = 0x182.
  140.  */
  141.  
  142. extern os_error *xradiobutton_set_action (bits flags,
  143.       toolbox_o window,
  144.       toolbox_c radio_button,
  145.       bits action);
  146. extern void radiobutton_set_action (bits flags,
  147.       toolbox_o window,
  148.       toolbox_c radio_button,
  149.       bits action);
  150.  
  151. /* ------------------------------------------------------------------------
  152.  * Function:      radiobutton_get_action()
  153.  *
  154.  * Description:   Calls reason code 387 of SWI 0x44EC6
  155.  *
  156.  * Input:         flags - value of R0 on entry
  157.  *                window - value of R1 on entry
  158.  *                radio_button - value of R3 on entry
  159.  *
  160.  * Output:        action - value of R0 on exit (X version only)
  161.  *
  162.  * Returns:       R0 (non-X version only)
  163.  *
  164.  * Other notes:   Before entry, R2 = 0x183.
  165.  */
  166.  
  167. extern os_error *xradiobutton_get_action (bits flags,
  168.       toolbox_o window,
  169.       toolbox_c radio_button,
  170.       bits *action);
  171. extern bits radiobutton_get_action (bits flags,
  172.       toolbox_o window,
  173.       toolbox_c radio_button);
  174.  
  175. /* ------------------------------------------------------------------------
  176.  * Function:      radiobutton_set_state()
  177.  *
  178.  * Description:   Calls reason code 388 of SWI 0x44EC6
  179.  *
  180.  * Input:         flags - value of R0 on entry
  181.  *                window - value of R1 on entry
  182.  *                radio_button - value of R3 on entry
  183.  *                on - value of R4 on entry
  184.  *
  185.  * Other notes:   Before entry, R2 = 0x184.
  186.  */
  187.  
  188. extern os_error *xradiobutton_set_state (bits flags,
  189.       toolbox_o window,
  190.       toolbox_c radio_button,
  191.       bool on);
  192. extern void radiobutton_set_state (bits flags,
  193.       toolbox_o window,
  194.       toolbox_c radio_button,
  195.       bool on);
  196.  
  197. /* ------------------------------------------------------------------------
  198.  * Function:      radiobutton_get_state()
  199.  *
  200.  * Description:   Calls reason code 389 of SWI 0x44EC6
  201.  *
  202.  * Input:         flags - value of R0 on entry
  203.  *                window - value of R1 on entry
  204.  *                radio_button - value of R3 on entry
  205.  *
  206.  * Output:        on - value of R0 on exit (X version only)
  207.  *                on_button - value of R1 on exit
  208.  *
  209.  * Returns:       R0 (non-X version only)
  210.  *
  211.  * Other notes:   Before entry, R2 = 0x185.
  212.  */
  213.  
  214. extern os_error *xradiobutton_get_state (bits flags,
  215.       toolbox_o window,
  216.       toolbox_c radio_button,
  217.       bool *on,
  218.       toolbox_c *on_button);
  219. extern bool radiobutton_get_state (bits flags,
  220.       toolbox_o window,
  221.       toolbox_c radio_button,
  222.       toolbox_c *on_button);
  223.  
  224. #ifdef __cplusplus
  225.    }
  226. #endif
  227.  
  228. #endif
  229.