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

  1. #ifndef slider_H
  2. #define slider_H
  3.  
  4. /* C header file for Slider
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 16:29:07 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  Slider_SetValue
  25. #define Slider_SetValue                         0x240
  26. #undef  Slider_GetValue
  27. #define Slider_GetValue                         0x241
  28. #undef  Slider_SetBounds
  29. #define Slider_SetBounds                        0x242
  30. #undef  Slider_GetBounds
  31. #define Slider_GetBounds                        0x243
  32. #undef  Slider_SetColour
  33. #define Slider_SetColour                        0x244
  34. #undef  Slider_GetColour
  35. #define Slider_GetColour                        0x245
  36.  
  37. /************************************
  38.  * Structure and union declarations *
  39.  ************************************/
  40. typedef struct slider_gadget                    slider_gadget;
  41. typedef struct slider_action_value_changed      slider_action_value_changed;
  42.  
  43. /********************
  44.  * Type definitions *
  45.  ********************/
  46. struct slider_gadget
  47.    {  int lower_bound;
  48.       int upper_bound;
  49.       int step_size;
  50.       int initial_value;
  51.    };
  52.  
  53. struct slider_action_value_changed
  54.    {  int value;
  55.    };
  56.  
  57. typedef bits slider_bounds_flags;
  58.  
  59. /************************
  60.  * Constant definitions *
  61.  ************************/
  62. #define class_SLIDER                            ((toolbox_class) 0x240u)
  63. #define slider_GENERATE_VALUE_CHANGED           ((gadget_flags) 0x1u)
  64. #define slider_GENERATE_VALUE_CHANGED_BY_DRAGGING ((gadget_flags) 0x2u)
  65. #define slider_GENERATE_SET_VALUE_CHANGED       ((gadget_flags) 0x4u)
  66. #define slider_VERTICAL                         ((gadget_flags) 0x8u)
  67. #define slider_DRAGGABLE                        ((gadget_flags) 0x10u)
  68. #define slider_KNOB_COLOUR                      ((gadget_flags) 0xF000u)
  69. #define slider_KNOB_COLOUR_SHIFT                12
  70. #define slider_WELL_COLOUR                      ((gadget_flags) 0xF0000u)
  71. #define slider_WELL_COLOUR_SHIFT                16
  72. #define action_SLIDER_VALUE_CHANGED             0x82886u
  73. #define slider_VALUE_CHANGING                   0x1u
  74. #define slider_VALUE_CHANGED_BY_DRAGGING        0x2u
  75. #define slider_VALUE_CHANGED                    0x4u
  76. #define slider_BOUND_LOWER                      ((slider_bounds_flags) 0x1u)
  77. #define slider_BOUND_UPPER                      ((slider_bounds_flags) 0x2u)
  78. #define slider_BOUND_STEP                       ((slider_bounds_flags) 0x4u)
  79.  
  80. /*************************
  81.  * Function declarations *
  82.  *************************/
  83.  
  84. #ifdef __cplusplus
  85.    extern "C" {
  86. #endif
  87.  
  88. /* ------------------------------------------------------------------------
  89.  * Function:      slider_set_value()
  90.  *
  91.  * Description:   Calls reason code 576 of SWI 0x44EC6
  92.  *
  93.  * Input:         flags - value of R0 on entry
  94.  *                window - value of R1 on entry
  95.  *                slider - value of R3 on entry
  96.  *                colour - value of R4 on entry
  97.  *
  98.  * Other notes:   Before entry, R2 = 0x240.
  99.  */
  100.  
  101. extern os_error *xslider_set_value (bits flags,
  102.       toolbox_o window,
  103.       toolbox_c slider,
  104.       wimp_colour colour);
  105. extern void slider_set_value (bits flags,
  106.       toolbox_o window,
  107.       toolbox_c slider,
  108.       wimp_colour colour);
  109.  
  110. /* ------------------------------------------------------------------------
  111.  * Function:      slider_get_value()
  112.  *
  113.  * Description:   Calls reason code 577 of SWI 0x44EC6
  114.  *
  115.  * Input:         flags - value of R0 on entry
  116.  *                window - value of R1 on entry
  117.  *                slider - value of R3 on entry
  118.  *
  119.  * Output:        value - value of R0 on exit (X version only)
  120.  *
  121.  * Returns:       R0 (non-X version only)
  122.  *
  123.  * Other notes:   Before entry, R2 = 0x241.
  124.  */
  125.  
  126. extern os_error *xslider_get_value (bits flags,
  127.       toolbox_o window,
  128.       toolbox_c slider,
  129.       int *value);
  130. extern int slider_get_value (bits flags,
  131.       toolbox_o window,
  132.       toolbox_c slider);
  133.  
  134. /* ------------------------------------------------------------------------
  135.  * Function:      slider_set_bounds()
  136.  *
  137.  * Description:   Calls reason code 578 of SWI 0x44EC6
  138.  *
  139.  * Input:         flags - value of R0 on entry
  140.  *                window - value of R1 on entry
  141.  *                slider - value of R3 on entry
  142.  *                upper_bound - value of R4 on entry
  143.  *                lower_bound - value of R5 on entry
  144.  *                step_size - value of R6 on entry
  145.  *
  146.  * Other notes:   Before entry, R2 = 0x242.
  147.  */
  148.  
  149. extern os_error *xslider_set_bounds (slider_bounds_flags flags,
  150.       toolbox_o window,
  151.       toolbox_c slider,
  152.       int upper_bound,
  153.       int lower_bound,
  154.       int step_size);
  155. extern void slider_set_bounds (slider_bounds_flags flags,
  156.       toolbox_o window,
  157.       toolbox_c slider,
  158.       int upper_bound,
  159.       int lower_bound,
  160.       int step_size);
  161.  
  162. /* ------------------------------------------------------------------------
  163.  * Function:      slider_get_bounds()
  164.  *
  165.  * Description:   Calls reason code 579 of SWI 0x44EC6
  166.  *
  167.  * Input:         flags - value of R0 on entry
  168.  *                window - value of R1 on entry
  169.  *                slider - value of R3 on entry
  170.  *
  171.  * Output:        upper_bound - value of R4 on exit
  172.  *                lower_bound - value of R5 on exit
  173.  *                step_size - value of R6 on exit
  174.  *
  175.  * Other notes:   Before entry, R2 = 0x243.
  176.  */
  177.  
  178. extern os_error *xslider_get_bounds (slider_bounds_flags flags,
  179.       toolbox_o window,
  180.       toolbox_c slider,
  181.       int *upper_bound,
  182.       int *lower_bound,
  183.       int *step_size);
  184. extern void slider_get_bounds (slider_bounds_flags flags,
  185.       toolbox_o window,
  186.       toolbox_c slider,
  187.       int *upper_bound,
  188.       int *lower_bound,
  189.       int *step_size);
  190.  
  191. /* ------------------------------------------------------------------------
  192.  * Function:      slider_set_colour()
  193.  *
  194.  * Description:   Calls reason code 580 of SWI 0x44EC6
  195.  *
  196.  * Input:         flags - value of R0 on entry
  197.  *                window - value of R1 on entry
  198.  *                slider - value of R3 on entry
  199.  *                colour - value of R4 on entry
  200.  *
  201.  * Other notes:   Before entry, R2 = 0x244.
  202.  */
  203.  
  204. extern os_error *xslider_set_colour (bits flags,
  205.       toolbox_o window,
  206.       toolbox_c slider,
  207.       wimp_colour colour);
  208. extern void slider_set_colour (bits flags,
  209.       toolbox_o window,
  210.       toolbox_c slider,
  211.       wimp_colour colour);
  212.  
  213. /* ------------------------------------------------------------------------
  214.  * Function:      slider_get_colour()
  215.  *
  216.  * Description:   Calls reason code 581 of SWI 0x44EC6
  217.  *
  218.  * Input:         flags - value of R0 on entry
  219.  *                window - value of R1 on entry
  220.  *                slider - value of R3 on entry
  221.  *
  222.  * Output:        colour - value of R0 on exit (X version only)
  223.  *
  224.  * Returns:       R0 (non-X version only)
  225.  *
  226.  * Other notes:   Before entry, R2 = 0x245.
  227.  */
  228.  
  229. extern os_error *xslider_get_colour (bits flags,
  230.       toolbox_o window,
  231.       toolbox_c slider,
  232.       wimp_colour *colour);
  233. extern wimp_colour slider_get_colour (bits flags,
  234.       toolbox_o window,
  235.       toolbox_c slider);
  236.  
  237. #ifdef __cplusplus
  238.    }
  239. #endif
  240.  
  241. #endif
  242.