home *** CD-ROM | disk | FTP | other *** search
- #ifndef optionbutton_H
- #define optionbutton_H
-
- /* C header file for OptionButton
- * written by DefMod (Aug 30 1995) on Tue Sep 5 16:29:11 1995
- * Jonathan Coxhead, Acorn Computers Ltd
- */
-
- #ifndef types_H
- #include "types.h"
- #endif
-
- #ifndef toolbox_H
- #include "toolbox.h"
- #endif
-
- #ifndef gadget_H
- #include "gadget.h"
- #endif
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef OptionButton_SetLabel
- #define OptionButton_SetLabel 0xC0
- #undef OptionButton_GetLabel
- #define OptionButton_GetLabel 0xC1
- #undef OptionButton_SetAction
- #define OptionButton_SetAction 0xC2
- #undef OptionButton_GetAction
- #define OptionButton_GetAction 0xC3
- #undef OptionButton_SetState
- #define OptionButton_SetState 0xC4
- #undef OptionButton_GetState
- #define OptionButton_GetState 0xC5
-
- /************************************
- * Structure and union declarations *
- ************************************/
- typedef struct optionbutton_gadget optionbutton_gadget;
- typedef struct optionbutton_action_state_changed optionbutton_action_state_changed;
-
- /********************
- * Type definitions *
- ********************/
- struct optionbutton_gadget
- { toolbox_msg_reference label;
- int label_limit;
- bits action;
- };
-
- struct optionbutton_action_state_changed
- { bool on;
- };
-
- /************************
- * Constant definitions *
- ************************/
- #define class_OPTION_BUTTON ((toolbox_class) 0xC0u)
- #define action_OPTION_BUTTON_STATE_CHANGED 0x82882u
- #define optionbutton_STATE_CHANGED_ADJUST 0x1u
- #define optionbutton_STATE_CHANGED_SELECT 0x4u
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /* ------------------------------------------------------------------------
- * Function: optionbutton_set_label()
- *
- * Description: Sets the label of the specified option button
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * option_button - value of R3 on entry
- * label - value of R4 on entry
- *
- * Other notes: Calls SWI 0x44EC6 with R2 = 0xC0.
- */
-
- extern os_error *xoptionbutton_set_label (bits flags,
- toolbox_o window,
- toolbox_c option_button,
- char const *label);
- extern void optionbutton_set_label (bits flags,
- toolbox_o window,
- toolbox_c option_button,
- char const *label);
-
- /* ------------------------------------------------------------------------
- * Function: optionbutton_get_label()
- *
- * Description: Gets the label of the specified option button
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * option_button - value of R3 on entry
- * buffer - value of R4 on entry
- * size - value of R5 on entry
- *
- * Output: used - value of R5 on exit (X version only)
- *
- * Returns: R5 (non-X version only)
- *
- * Other notes: Calls SWI 0x44EC6 with R2 = 0xC1.
- */
-
- extern os_error *xoptionbutton_get_label (bits flags,
- toolbox_o window,
- toolbox_c option_button,
- char *buffer,
- int size,
- int *used);
- extern int optionbutton_get_label (bits flags,
- toolbox_o window,
- toolbox_c option_button,
- char *buffer,
- int size);
-
- /* ------------------------------------------------------------------------
- * Function: optionbutton_set_action()
- *
- * Description: Calls reason code 194 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * option_button - value of R3 on entry
- * action - value of R4 on entry
- *
- * Other notes: Before entry, R2 = 0xC2.
- */
-
- extern os_error *xoptionbutton_set_action (bits flags,
- toolbox_o window,
- toolbox_c option_button,
- bits action);
- extern void optionbutton_set_action (bits flags,
- toolbox_o window,
- toolbox_c option_button,
- bits action);
-
- /* ------------------------------------------------------------------------
- * Function: optionbutton_get_action()
- *
- * Description: Calls reason code 195 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * option_button - value of R3 on entry
- *
- * Output: action - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Before entry, R2 = 0xC3.
- */
-
- extern os_error *xoptionbutton_get_action (bits flags,
- toolbox_o window,
- toolbox_c option_button,
- bits *action);
- extern bits optionbutton_get_action (bits flags,
- toolbox_o window,
- toolbox_c option_button);
-
- /* ------------------------------------------------------------------------
- * Function: optionbutton_set_state()
- *
- * Description: Calls reason code 196 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * option_button - value of R3 on entry
- * on - value of R4 on entry
- *
- * Other notes: Before entry, R2 = 0xC4.
- */
-
- extern os_error *xoptionbutton_set_state (bits flags,
- toolbox_o window,
- toolbox_c option_button,
- bool on);
- extern void optionbutton_set_state (bits flags,
- toolbox_o window,
- toolbox_c option_button,
- bool on);
-
- /* ------------------------------------------------------------------------
- * Function: optionbutton_get_state()
- *
- * Description: Calls reason code 197 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * option_button - value of R3 on entry
- *
- * Output: on - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Before entry, R2 = 0xC5.
- */
-
- extern os_error *xoptionbutton_get_state (bits flags,
- toolbox_o window,
- toolbox_c option_button,
- bool *on);
- extern bool optionbutton_get_state (bits flags,
- toolbox_o window,
- toolbox_c option_button);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-