home *** CD-ROM | disk | FTP | other *** search
- #ifndef actionbutton_H
- #define actionbutton_H
-
- /* C header file for ActionButton
- * written by DefMod (Aug 30 1995) on Tue Sep 5 16:29:26 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 ActionButton_SetText
- #define ActionButton_SetText 0x80
- #undef ActionButton_GetText
- #define ActionButton_GetText 0x81
- #undef ActionButton_SetAction
- #define ActionButton_SetAction 0x82
- #undef ActionButton_GetAction
- #define ActionButton_GetAction 0x83
- #undef ActionButton_SetClickShow
- #define ActionButton_SetClickShow 0x84
- #undef ActionButton_GetClickShow
- #define ActionButton_GetClickShow 0x85
-
- /************************************
- * Structure and union declarations *
- ************************************/
- typedef struct actionbutton_gadget actionbutton_gadget;
-
- /********************
- * Type definitions *
- ********************/
- struct actionbutton_gadget
- { toolbox_msg_reference text;
- int text_limit;
- toolbox_string_reference click_show;
- bits action;
- };
-
- /************************
- * Constant definitions *
- ************************/
- #define class_ACTION_BUTTON ((toolbox_class) 0x80u)
- #define actionbutton_IS_DEFAULT ((gadget_flags) 0x1u)
- #define actionbutton_IS_CANCEL ((gadget_flags) 0x2u)
- #define actionbutton_IS_LOCAL ((gadget_flags) 0x4u)
- #define actionbutton_IS_MENU ((gadget_flags) 0x8u)
- #define action_ACTION_BUTTON_SELECTED 0x82881u
- #define actionbutton_SELECTED_ADJUST 0x1u
- #define actionbutton_SELECTED_SELECT 0x4u
- #define actionbutton_SELECTED_DEFAULT 0x8u
- #define actionbutton_SELECTED_CANCEL 0x10u
- #define actionbutton_SELECTED_LOCAL 0x20u
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /* ------------------------------------------------------------------------
- * Function: actionbutton_set_text()
- *
- * Description: Sets the text that will be displayed in the specified
- * action button
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * action_button - value of R3 on entry
- * text - value of R4 on entry
- *
- * Other notes: Calls SWI 0x44EC6 with R2 = 0x80.
- */
-
- extern os_error *xactionbutton_set_text (bits flags,
- toolbox_o window,
- toolbox_c action_button,
- char const *text);
- extern void actionbutton_set_text (bits flags,
- toolbox_o window,
- toolbox_c action_button,
- char const *text);
-
- /* ------------------------------------------------------------------------
- * Function: actionbutton_get_text()
- *
- * Description: Calls reason code 129 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * action_button - value of R3 on entry
- * text - 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: Before entry, R2 = 0x81.
- */
-
- extern os_error *xactionbutton_get_text (bits flags,
- toolbox_o window,
- toolbox_c action_button,
- char *text,
- int size,
- int *used);
- extern int actionbutton_get_text (bits flags,
- toolbox_o window,
- toolbox_c action_button,
- char *text,
- int size);
-
- /* ------------------------------------------------------------------------
- * Function: actionbutton_set_action()
- *
- * Description: Sets the action that is raised when the button is clicked
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * action_button - value of R3 on entry
- * action - value of R4 on entry
- *
- * Other notes: Calls SWI 0x44EC6 with R2 = 0x82.
- */
-
- extern os_error *xactionbutton_set_action (bits flags,
- toolbox_o window,
- toolbox_c action_button,
- bits action);
- extern void actionbutton_set_action (bits flags,
- toolbox_o window,
- toolbox_c action_button,
- bits action);
-
- /* ------------------------------------------------------------------------
- * Function: actionbutton_get_action()
- *
- * Description: Gets the action that is raised when the button is clicked
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * action_button - value of R3 on entry
- *
- * Output: action - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x44EC6 with R2 = 0x83.
- */
-
- extern os_error *xactionbutton_get_action (bits flags,
- toolbox_o window,
- toolbox_c action_button,
- bits *action);
- extern bits actionbutton_get_action (bits flags,
- toolbox_o window,
- toolbox_c action_button);
-
- /* ------------------------------------------------------------------------
- * Function: actionbutton_set_click_show()
- *
- * Description: Calls reason code 132 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * action_button - value of R3 on entry
- * obj - value of R4 on entry
- *
- * Other notes: Before entry, R2 = 0x84.
- */
-
- extern os_error *xactionbutton_set_click_show (bits flags,
- toolbox_o window,
- toolbox_c action_button,
- toolbox_o obj);
- extern void actionbutton_set_click_show (bits flags,
- toolbox_o window,
- toolbox_c action_button,
- toolbox_o obj);
-
- /* ------------------------------------------------------------------------
- * Function: actionbutton_get_click_show()
- *
- * Description: Calls reason code 133 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * action_button - value of R3 on entry
- *
- * Output: obj - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Before entry, R2 = 0x85.
- */
-
- extern os_error *xactionbutton_get_click_show (bits flags,
- toolbox_o window,
- toolbox_c action_button,
- toolbox_o *obj);
- extern toolbox_o actionbutton_get_click_show (bits flags,
- toolbox_o window,
- toolbox_c action_button);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-