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

  1. #ifndef scale_H
  2. #define scale_H
  3.  
  4. /* C header file for Scale
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 15:14:00 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 window_H
  18. #include "window.h"
  19. #endif
  20.  
  21. /**********************************
  22.  * SWI names and SWI reason codes *
  23.  **********************************/
  24. #undef  Scale_ClassSWI
  25. #define Scale_ClassSWI                          0x82C00
  26. #undef  XScale_ClassSWI
  27. #define XScale_ClassSWI                         0xA2C00
  28. #undef  Scale_PostFilter
  29. #define Scale_PostFilter                        0x82C01
  30. #undef  XScale_PostFilter
  31. #define XScale_PostFilter                       0xA2C01
  32. #undef  Scale_PreFilter
  33. #define Scale_PreFilter                         0x82C02
  34. #undef  XScale_PreFilter
  35. #define XScale_PreFilter                        0xA2C02
  36. #undef  Scale_GetWindowID
  37. #define Scale_GetWindowID                       0x0
  38. #undef  Scale_SetValue
  39. #define Scale_SetValue                          0x1
  40. #undef  Scale_GetValue
  41. #define Scale_GetValue                          0x2
  42. #undef  Scale_SetBounds
  43. #define Scale_SetBounds                         0x3
  44. #undef  Scale_GetBounds
  45. #define Scale_GetBounds                         0x4
  46. #undef  Scale_SetTitle
  47. #define Scale_SetTitle                          0x5
  48. #undef  Scale_GetTitle
  49. #define Scale_GetTitle                          0x6
  50.  
  51. /************************************
  52.  * Structure and union declarations *
  53.  ************************************/
  54. typedef struct scale_object                     scale_object;
  55. typedef struct scale_action_about_to_be_shown   scale_action_about_to_be_shown;
  56. typedef struct scale_action_apply_factor        scale_action_apply_factor;
  57.  
  58. /********************
  59.  * Type definitions *
  60.  ********************/
  61. typedef bits scale_flags;
  62.  
  63. struct scale_object
  64.    {  scale_flags flags;
  65.       int lower_bound;
  66.       int upper_bound;
  67.       int step_size;
  68.       toolbox_msg_reference title;
  69.       int title_limit;
  70.       toolbox_string_reference alternative_window_name;
  71.       int std_value [4];
  72.    };
  73.  
  74. typedef toolbox_full scale_full;
  75.  
  76. struct scale_action_about_to_be_shown
  77.    {  toolbox_position_tag tag;
  78.       union
  79.       {  os_coord top_left;
  80.          scale_full full;
  81.       }
  82.       position;
  83.    };
  84.  
  85. struct scale_action_apply_factor
  86.    {  int percent;
  87.    };
  88.  
  89. /************************
  90.  * Constant definitions *
  91.  ************************/
  92. #define class_SCALE                             ((toolbox_class) 0x82C00u)
  93. #define scale_GENERATE_ABOUT_TO_BE_SHOWN        ((scale_flags) 0x1u)
  94. #define scale_GENERATE_DIALOGUE_COMPLETED       ((scale_flags) 0x2u)
  95. #define scale_INCLUDE_SCALE_TO_FIT              ((scale_flags) 0x4u)
  96. #define scale_PERCENT                           ((toolbox_c) 0x82C000u)
  97. #define scale_STD_VALUE0                        ((toolbox_c) 0x82C001u)
  98. #define scale_STD_VALUE1                        ((toolbox_c) 0x82C002u)
  99. #define scale_STD_VALUE2                        ((toolbox_c) 0x82C003u)
  100. #define scale_STD_VALUE3                        ((toolbox_c) 0x82C004u)
  101. #define scale_CANCEL                            ((toolbox_c) 0x82C005u)
  102. #define scale_SCALE                             ((toolbox_c) 0x82C006u)
  103. #define scale_PERCENT_LABEL                     ((toolbox_c) 0x82C007u)
  104. #define scale_SCALE_LABEL                       ((toolbox_c) 0x82C008u)
  105. #define scale_SCALE_TO_FIT                      ((toolbox_c) 0x82C009u)
  106. #define action_SCALE_ABOUT_TO_BE_SHOWN          0x82C00u
  107. #define action_SCALE_DIALOGUE_COMPLETED         0x82C01u
  108. #define action_SCALE_APPLY_FACTOR               0x82C02u
  109. #define error_SCALE_TASKS_ACTIVE                0x80B700u
  110. #define error_SCALE_ALLOC_FAILED                0x80B701u
  111. #define error_SCALE_SHORT_BUFFER                0x80B702u
  112. #define error_SCALE_NO_SUCH_TASK                0x80B711u
  113. #define error_SCALE_NO_SUCH_METHOD              0x80B712u
  114. #define error_SCALE_NO_SUCH_MISC_OP_METHOD      0x80B713u
  115. #define scale_SET_LOWER_BOUND                   0x1u
  116. #define scale_SET_UPPER_BOUND                   0x2u
  117. #define scale_SET_STEP_SIZE                     0x4u
  118.  
  119. /*************************
  120.  * Function declarations *
  121.  *************************/
  122.  
  123. #ifdef __cplusplus
  124.    extern "C" {
  125. #endif
  126.  
  127. /* ------------------------------------------------------------------------
  128.  * Function:      scale_get_window_id()
  129.  *
  130.  * Description:   Calls reason code 0 of SWI 0x44EC6
  131.  *
  132.  * Input:         flags - value of R0 on entry
  133.  *                scale - value of R1 on entry
  134.  *
  135.  * Output:        window - value of R0 on exit (X version only)
  136.  *
  137.  * Returns:       R0 (non-X version only)
  138.  *
  139.  * Other notes:   Before entry, R2 = 0x0.
  140.  */
  141.  
  142. extern os_error *xscale_get_window_id (bits flags,
  143.       toolbox_o scale,
  144.       toolbox_o *window);
  145. extern toolbox_o scale_get_window_id (bits flags,
  146.       toolbox_o scale);
  147.  
  148. /* ------------------------------------------------------------------------
  149.  * Function:      scale_set_value()
  150.  *
  151.  * Description:   Calls reason code 1 of SWI 0x44EC6
  152.  *
  153.  * Input:         flags - value of R0 on entry
  154.  *                scale - value of R1 on entry
  155.  *                value - value of R3 on entry
  156.  *
  157.  * Other notes:   Before entry, R2 = 0x1.
  158.  */
  159.  
  160. extern os_error *xscale_set_value (bits flags,
  161.       toolbox_o scale,
  162.       int value);
  163. extern void scale_set_value (bits flags,
  164.       toolbox_o scale,
  165.       int value);
  166.  
  167. /* ------------------------------------------------------------------------
  168.  * Function:      scale_get_value()
  169.  *
  170.  * Description:   Calls reason code 2 of SWI 0x44EC6
  171.  *
  172.  * Input:         flags - value of R0 on entry
  173.  *                scale - value of R1 on entry
  174.  *
  175.  * Output:        value - value of R0 on exit (X version only)
  176.  *
  177.  * Returns:       R0 (non-X version only)
  178.  *
  179.  * Other notes:   Before entry, R2 = 0x2.
  180.  */
  181.  
  182. extern os_error *xscale_get_value (bits flags,
  183.       toolbox_o scale,
  184.       int *value);
  185. extern int scale_get_value (bits flags,
  186.       toolbox_o scale);
  187.  
  188. /* ------------------------------------------------------------------------
  189.  * Function:      scale_set_bounds()
  190.  *
  191.  * Description:   Calls reason code 3 of SWI 0x44EC6
  192.  *
  193.  * Input:         flags - value of R0 on entry
  194.  *                scale - value of R1 on entry
  195.  *                lower_bound - value of R3 on entry
  196.  *                upper_bound - value of R4 on entry
  197.  *                step_size - value of R5 on entry
  198.  *
  199.  * Other notes:   Before entry, R2 = 0x3.
  200.  */
  201.  
  202. extern os_error *xscale_set_bounds (bits flags,
  203.       toolbox_o scale,
  204.       int lower_bound,
  205.       int upper_bound,
  206.       int step_size);
  207. extern void scale_set_bounds (bits flags,
  208.       toolbox_o scale,
  209.       int lower_bound,
  210.       int upper_bound,
  211.       int step_size);
  212.  
  213. /* ------------------------------------------------------------------------
  214.  * Function:      scale_get_bounds()
  215.  *
  216.  * Description:   Calls reason code 4 of SWI 0x44EC6
  217.  *
  218.  * Input:         flags - value of R0 on entry
  219.  *                scale - value of R1 on entry
  220.  *
  221.  * Output:        lower_bound - value of R0 on exit
  222.  *                upper_bound - value of R1 on exit
  223.  *                step_size - value of R2 on exit
  224.  *
  225.  * Other notes:   Before entry, R2 = 0x4.
  226.  */
  227.  
  228. extern os_error *xscale_get_bounds (bits flags,
  229.       toolbox_o scale,
  230.       int *lower_bound,
  231.       int *upper_bound,
  232.       int *step_size);
  233. extern void scale_get_bounds (bits flags,
  234.       toolbox_o scale,
  235.       int *lower_bound,
  236.       int *upper_bound,
  237.       int *step_size);
  238.  
  239. /* ------------------------------------------------------------------------
  240.  * Function:      scale_set_title()
  241.  *
  242.  * Description:   Calls reason code 5 of SWI 0x44EC6
  243.  *
  244.  * Input:         flags - value of R0 on entry
  245.  *                scale - value of R1 on entry
  246.  *                title - value of R3 on entry
  247.  *
  248.  * Other notes:   Before entry, R2 = 0x5.
  249.  */
  250.  
  251. extern os_error *xscale_set_title (bits flags,
  252.       toolbox_o scale,
  253.       char const *title);
  254. extern void scale_set_title (bits flags,
  255.       toolbox_o scale,
  256.       char const *title);
  257.  
  258. /* ------------------------------------------------------------------------
  259.  * Function:      scale_get_title()
  260.  *
  261.  * Description:   Calls reason code 6 of SWI 0x44EC6
  262.  *
  263.  * Input:         flags - value of R0 on entry
  264.  *                scale - value of R1 on entry
  265.  *                buffer - value of R3 on entry
  266.  *                size - value of R4 on entry
  267.  *
  268.  * Output:        used - value of R3 on exit (X version only)
  269.  *
  270.  * Returns:       R3 (non-X version only)
  271.  *
  272.  * Other notes:   Before entry, R2 = 0x6.
  273.  */
  274.  
  275. extern os_error *xscale_get_title (bits flags,
  276.       toolbox_o scale,
  277.       char *buffer,
  278.       int size,
  279.       int *used);
  280. extern int scale_get_title (bits flags,
  281.       toolbox_o scale,
  282.       char *buffer,
  283.       int size);
  284.  
  285. #ifdef __cplusplus
  286.    }
  287. #endif
  288.  
  289. #endif
  290.