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

  1. #ifndef button_H
  2. #define button_H
  3.  
  4. /* C header file for Button
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 16:29:24 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  Button_GetFlags
  25. #define Button_GetFlags                         0x3C0
  26. #undef  Button_SetFlags
  27. #define Button_SetFlags                         0x3C1
  28. #undef  Button_SetValue
  29. #define Button_SetValue                         0x3C2
  30. #undef  Button_GetValue
  31. #define Button_GetValue                         0x3C3
  32. #undef  Button_SetValidation
  33. #define Button_SetValidation                    0x3C4
  34. #undef  Button_GetValidation
  35. #define Button_GetValidation                    0x3C5
  36. #undef  Button_SetFont
  37. #define Button_SetFont                          0x3C6
  38.  
  39. /************************************
  40.  * Structure and union declarations *
  41.  ************************************/
  42. typedef struct button_gadget                    button_gadget;
  43.  
  44. /********************
  45.  * Type definitions *
  46.  ********************/
  47. struct button_gadget
  48.    {  bits flags;
  49.       toolbox_msg_reference value;
  50.       int value_limit;
  51.       toolbox_string_reference validation;
  52.       int validation_limit;
  53.    };
  54.  
  55. /************************
  56.  * Constant definitions *
  57.  ************************/
  58. #define class_BUTTON                            ((toolbox_class) 0x3C0u)
  59. #define button_TASK_SPRITE_AREA                 0x1u
  60. #define button_ALLOW_MENU_CLICKS                0x2u
  61.  
  62. /*************************
  63.  * Function declarations *
  64.  *************************/
  65.  
  66. #ifdef __cplusplus
  67.    extern "C" {
  68. #endif
  69.  
  70. /* ------------------------------------------------------------------------
  71.  * Function:      button_get_flags()
  72.  *
  73.  * Description:   Calls reason code 960 of SWI 0x44EC6
  74.  *
  75.  * Input:         flags - value of R0 on entry
  76.  *                window - value of R1 on entry
  77.  *                button - value of R3 on entry
  78.  *
  79.  * Output:        icon_flags - value of R0 on exit (X version only)
  80.  *
  81.  * Returns:       R0 (non-X version only)
  82.  *
  83.  * Other notes:   Before entry, R2 = 0x3C0.
  84.  */
  85.  
  86. extern os_error *xbutton_get_flags (bits flags,
  87.       toolbox_o window,
  88.       toolbox_c button,
  89.       bits *icon_flags);
  90. extern bits button_get_flags (bits flags,
  91.       toolbox_o window,
  92.       toolbox_c button);
  93.  
  94. /* ------------------------------------------------------------------------
  95.  * Function:      button_set_flags()
  96.  *
  97.  * Description:   Calls reason code 961 of SWI 0x44EC6
  98.  *
  99.  * Input:         flags - value of R0 on entry
  100.  *                window - value of R1 on entry
  101.  *                button - value of R3 on entry
  102.  *                clear_word - value of R4 on entry
  103.  *                eor_word - value of R5 on entry
  104.  *
  105.  * Other notes:   Before entry, R2 = 0x3C1.
  106.  */
  107.  
  108. extern os_error *xbutton_set_flags (bits flags,
  109.       toolbox_o window,
  110.       toolbox_c button,
  111.       int clear_word,
  112.       int eor_word);
  113. extern void button_set_flags (bits flags,
  114.       toolbox_o window,
  115.       toolbox_c button,
  116.       int clear_word,
  117.       int eor_word);
  118.  
  119. /* ------------------------------------------------------------------------
  120.  * Function:      button_set_value()
  121.  *
  122.  * Description:   Calls reason code 962 of SWI 0x44EC6
  123.  *
  124.  * Input:         flags - value of R0 on entry
  125.  *                window - value of R1 on entry
  126.  *                button - value of R3 on entry
  127.  *                value - value of R4 on entry
  128.  *
  129.  * Other notes:   Before entry, R2 = 0x3C2.
  130.  */
  131.  
  132. extern os_error *xbutton_set_value (bits flags,
  133.       toolbox_o window,
  134.       toolbox_c button,
  135.       char const *value);
  136. extern void button_set_value (bits flags,
  137.       toolbox_o window,
  138.       toolbox_c button,
  139.       char const *value);
  140.  
  141. /* ------------------------------------------------------------------------
  142.  * Function:      button_get_value()
  143.  *
  144.  * Description:   Calls reason code 963 of SWI 0x44EC6
  145.  *
  146.  * Input:         flags - value of R0 on entry
  147.  *                window - value of R1 on entry
  148.  *                button - value of R3 on entry
  149.  *                buffer - value of R4 on entry
  150.  *                size - value of R5 on entry
  151.  *
  152.  * Output:        used - value of R5 on exit (X version only)
  153.  *
  154.  * Returns:       R5 (non-X version only)
  155.  *
  156.  * Other notes:   Before entry, R2 = 0x3C3.
  157.  */
  158.  
  159. extern os_error *xbutton_get_value (bits flags,
  160.       toolbox_o window,
  161.       toolbox_c button,
  162.       char *buffer,
  163.       int size,
  164.       int *used);
  165. extern int button_get_value (bits flags,
  166.       toolbox_o window,
  167.       toolbox_c button,
  168.       char *buffer,
  169.       int size);
  170.  
  171. /* ------------------------------------------------------------------------
  172.  * Function:      button_set_validation()
  173.  *
  174.  * Description:   Calls reason code 964 of SWI 0x44EC6
  175.  *
  176.  * Input:         flags - value of R0 on entry
  177.  *                window - value of R1 on entry
  178.  *                button - value of R3 on entry
  179.  *                validation - value of R4 on entry
  180.  *
  181.  * Other notes:   Before entry, R2 = 0x3C4.
  182.  */
  183.  
  184. extern os_error *xbutton_set_validation (bits flags,
  185.       toolbox_o window,
  186.       toolbox_c button,
  187.       char const *validation);
  188. extern void button_set_validation (bits flags,
  189.       toolbox_o window,
  190.       toolbox_c button,
  191.       char const *validation);
  192.  
  193. /* ------------------------------------------------------------------------
  194.  * Function:      button_get_validation()
  195.  *
  196.  * Description:   Calls reason code 965 of SWI 0x44EC6
  197.  *
  198.  * Input:         flags - value of R0 on entry
  199.  *                window - value of R1 on entry
  200.  *                button - value of R3 on entry
  201.  *                buffer - value of R4 on entry
  202.  *                size - value of R5 on entry
  203.  *
  204.  * Output:        used - value of R5 on exit (X version only)
  205.  *
  206.  * Returns:       R5 (non-X version only)
  207.  *
  208.  * Other notes:   Before entry, R2 = 0x3C5.
  209.  */
  210.  
  211. extern os_error *xbutton_get_validation (bits flags,
  212.       toolbox_o window,
  213.       toolbox_c button,
  214.       char *buffer,
  215.       int size,
  216.       int *used);
  217. extern int button_get_validation (bits flags,
  218.       toolbox_o window,
  219.       toolbox_c button,
  220.       char *buffer,
  221.       int size);
  222.  
  223. /* ------------------------------------------------------------------------
  224.  * Function:      button_set_font()
  225.  *
  226.  * Description:   Calls reason code 966 of SWI 0x44EC6
  227.  *
  228.  * Input:         flags - value of R0 on entry
  229.  *                window - value of R1 on entry
  230.  *                button - value of R3 on entry
  231.  *                font_name - value of R4 on entry
  232.  *
  233.  * Other notes:   Before entry, R2 = 0x3C6.
  234.  */
  235.  
  236. extern os_error *xbutton_set_font (bits flags,
  237.       toolbox_o window,
  238.       toolbox_c button,
  239.       char const *font_name);
  240. extern void button_set_font (bits flags,
  241.       toolbox_o window,
  242.       toolbox_c button,
  243.       char const *font_name);
  244.  
  245. #ifdef __cplusplus
  246.    }
  247. #endif
  248.  
  249. #endif
  250.