home *** CD-ROM | disk | FTP | other *** search
- #ifndef button_H
- #define button_H
-
- /* C header file for Button
- * written by DefMod (Aug 30 1995) on Tue Sep 5 16:29:24 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 Button_GetFlags
- #define Button_GetFlags 0x3C0
- #undef Button_SetFlags
- #define Button_SetFlags 0x3C1
- #undef Button_SetValue
- #define Button_SetValue 0x3C2
- #undef Button_GetValue
- #define Button_GetValue 0x3C3
- #undef Button_SetValidation
- #define Button_SetValidation 0x3C4
- #undef Button_GetValidation
- #define Button_GetValidation 0x3C5
- #undef Button_SetFont
- #define Button_SetFont 0x3C6
-
- /************************************
- * Structure and union declarations *
- ************************************/
- typedef struct button_gadget button_gadget;
-
- /********************
- * Type definitions *
- ********************/
- struct button_gadget
- { bits flags;
- toolbox_msg_reference value;
- int value_limit;
- toolbox_string_reference validation;
- int validation_limit;
- };
-
- /************************
- * Constant definitions *
- ************************/
- #define class_BUTTON ((toolbox_class) 0x3C0u)
- #define button_TASK_SPRITE_AREA 0x1u
- #define button_ALLOW_MENU_CLICKS 0x2u
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /* ------------------------------------------------------------------------
- * Function: button_get_flags()
- *
- * Description: Calls reason code 960 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * button - value of R3 on entry
- *
- * Output: icon_flags - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Before entry, R2 = 0x3C0.
- */
-
- extern os_error *xbutton_get_flags (bits flags,
- toolbox_o window,
- toolbox_c button,
- bits *icon_flags);
- extern bits button_get_flags (bits flags,
- toolbox_o window,
- toolbox_c button);
-
- /* ------------------------------------------------------------------------
- * Function: button_set_flags()
- *
- * Description: Calls reason code 961 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * button - value of R3 on entry
- * clear_word - value of R4 on entry
- * eor_word - value of R5 on entry
- *
- * Other notes: Before entry, R2 = 0x3C1.
- */
-
- extern os_error *xbutton_set_flags (bits flags,
- toolbox_o window,
- toolbox_c button,
- int clear_word,
- int eor_word);
- extern void button_set_flags (bits flags,
- toolbox_o window,
- toolbox_c button,
- int clear_word,
- int eor_word);
-
- /* ------------------------------------------------------------------------
- * Function: button_set_value()
- *
- * Description: Calls reason code 962 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * button - value of R3 on entry
- * value - value of R4 on entry
- *
- * Other notes: Before entry, R2 = 0x3C2.
- */
-
- extern os_error *xbutton_set_value (bits flags,
- toolbox_o window,
- toolbox_c button,
- char const *value);
- extern void button_set_value (bits flags,
- toolbox_o window,
- toolbox_c button,
- char const *value);
-
- /* ------------------------------------------------------------------------
- * Function: button_get_value()
- *
- * Description: Calls reason code 963 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * 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: Before entry, R2 = 0x3C3.
- */
-
- extern os_error *xbutton_get_value (bits flags,
- toolbox_o window,
- toolbox_c button,
- char *buffer,
- int size,
- int *used);
- extern int button_get_value (bits flags,
- toolbox_o window,
- toolbox_c button,
- char *buffer,
- int size);
-
- /* ------------------------------------------------------------------------
- * Function: button_set_validation()
- *
- * Description: Calls reason code 964 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * button - value of R3 on entry
- * validation - value of R4 on entry
- *
- * Other notes: Before entry, R2 = 0x3C4.
- */
-
- extern os_error *xbutton_set_validation (bits flags,
- toolbox_o window,
- toolbox_c button,
- char const *validation);
- extern void button_set_validation (bits flags,
- toolbox_o window,
- toolbox_c button,
- char const *validation);
-
- /* ------------------------------------------------------------------------
- * Function: button_get_validation()
- *
- * Description: Calls reason code 965 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * 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: Before entry, R2 = 0x3C5.
- */
-
- extern os_error *xbutton_get_validation (bits flags,
- toolbox_o window,
- toolbox_c button,
- char *buffer,
- int size,
- int *used);
- extern int button_get_validation (bits flags,
- toolbox_o window,
- toolbox_c button,
- char *buffer,
- int size);
-
- /* ------------------------------------------------------------------------
- * Function: button_set_font()
- *
- * Description: Calls reason code 966 of SWI 0x44EC6
- *
- * Input: flags - value of R0 on entry
- * window - value of R1 on entry
- * button - value of R3 on entry
- * font_name - value of R4 on entry
- *
- * Other notes: Before entry, R2 = 0x3C6.
- */
-
- extern os_error *xbutton_set_font (bits flags,
- toolbox_o window,
- toolbox_c button,
- char const *font_name);
- extern void button_set_font (bits flags,
- toolbox_o window,
- toolbox_c button,
- char const *font_name);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-