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

  1. #ifndef colourdbox_H
  2. #define colourdbox_H
  3.  
  4. /* C header file for ColourDbox
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 14:01:02 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. #ifndef colourpicker_H
  22. #include "colourpicker.h"
  23. #endif
  24.  
  25. /**********************************
  26.  * SWI names and SWI reason codes *
  27.  **********************************/
  28. #undef  ColourDbox_ClassSWI
  29. #define ColourDbox_ClassSWI                     0x829C0
  30. #undef  XColourDbox_ClassSWI
  31. #define XColourDbox_ClassSWI                    0xA29C0
  32. #undef  ColourDbox_PostFilter
  33. #define ColourDbox_PostFilter                   0x829C1
  34. #undef  XColourDbox_PostFilter
  35. #define XColourDbox_PostFilter                  0xA29C1
  36. #undef  ColourDbox_PreFilter
  37. #define ColourDbox_PreFilter                    0x829C2
  38. #undef  XColourDbox_PreFilter
  39. #define XColourDbox_PreFilter                   0xA29C2
  40. #undef  ColourDbox_GetWimpHandle
  41. #define ColourDbox_GetWimpHandle                0x0
  42. #undef  ColourDbox_GetDialogueHandle
  43. #define ColourDbox_GetDialogueHandle            0x1
  44. #undef  ColourDbox_SetColour
  45. #define ColourDbox_SetColour                    0x2
  46. #undef  ColourDbox_GetColour
  47. #define ColourDbox_GetColour                    0x3
  48. #undef  ColourDbox_SetColourModel
  49. #define ColourDbox_SetColourModel               0x4
  50. #undef  ColourDbox_GetColourModel
  51. #define ColourDbox_GetColourModel               0x5
  52. #undef  ColourDbox_SetNoneAvailable
  53. #define ColourDbox_SetNoneAvailable             0x6
  54. #undef  ColourDbox_GetNoneAvailable
  55. #define ColourDbox_GetNoneAvailable             0x7
  56.  
  57. /************************************
  58.  * Structure and union declarations *
  59.  ************************************/
  60. typedef struct colourdbox_object                colourdbox_object;
  61. typedef struct colourdbox_action_about_to_be_shown colourdbox_action_about_to_be_shown;
  62. typedef struct colourdbox_colour_model          colourdbox_colour_model;
  63. typedef struct colourdbox_action_dialogue_completed colourdbox_action_dialogue_completed;
  64. typedef struct colourdbox_action_colour_selected colourdbox_action_colour_selected;
  65.  
  66. /********************
  67.  * Type definitions *
  68.  ********************/
  69. typedef bits colourdbox_flags;
  70.  
  71. typedef bits colourdbox_colour_flags;
  72.  
  73. struct colourdbox_object
  74.    {  colourdbox_flags flags;
  75.       toolbox_msg_reference title;
  76.       int title_limit;
  77.       os_colour colour;
  78.    };
  79.  
  80. typedef toolbox_full colourdbox_full;
  81.  
  82. struct colourdbox_action_about_to_be_shown
  83.    {  toolbox_position_tag tag;
  84.       union
  85.       {  os_coord top_left;
  86.          colourdbox_full full;
  87.       }
  88.       position;
  89.    };
  90.  
  91. struct colourdbox_colour_model
  92.    {  int size;
  93.       int info [UNKNOWN];
  94.    };
  95.  
  96. #define colourdbox_COLOUR_MODEL(N) \
  97.    struct \
  98.       {  int size; \
  99.          int info [N]; \
  100.       }
  101.  
  102. #define colourdbox_SIZEOF_COLOUR_MODEL(N) \
  103.    (offsetof (colourdbox_colour_model, info) + \
  104.          (N)*sizeof ((colourdbox_colour_model *) NULL)->info)
  105.  
  106. typedef bits colourdbox_dialogue_completed_flags;
  107.  
  108. struct colourdbox_action_dialogue_completed
  109.    {  colourdbox_dialogue_completed_flags flags;
  110.    };
  111.  
  112. struct colourdbox_action_colour_selected
  113.    {  colourdbox_colour_flags flags;
  114.       os_colour colour;
  115.       int size;
  116.       int info [50];
  117.    };
  118.  
  119. /************************
  120.  * Constant definitions *
  121.  ************************/
  122. #define class_COLOUR_DBOX                       ((toolbox_class) 0x829C0u)
  123. #define error_COLOUR_DBOX_TASKS_ACTIVE          0x80AE00u
  124. #define error_COLOUR_DBOX_ALLOC_FAILED          0x80AE01u
  125. #define error_COLOUR_DBOX_SHORT_BUFFER          0x80AE02u
  126. #define error_COLOUR_DBOX_NO_SUCH_TASK          0x80AE11u
  127. #define error_COLOUR_DBOX_NO_SUCH_METHOD        0x80AE12u
  128. #define error_COLOUR_DBOX_NO_SUCH_MISC_OP_METHOD 0x80AE13u
  129. #define colourdbox_GENERATE_ABOUT_TO_BE_SHOWN   ((colourdbox_flags) 0x1u)
  130. #define colourdbox_GENERATE_DIALOGUE_COMPLETED  ((colourdbox_flags) 0x2u)
  131. #define colourdbox_INCLUDE_NONE_BUTTON          ((colourdbox_flags) 0x4u)
  132. #define colourdbox_SELECT_NONE_BUTTON           ((colourdbox_flags) 0x8u)
  133. #define colourdbox_COLOUR_TRANSPARENT           ((colourdbox_colour_flags) 0x1u)
  134. #define action_COLOUR_DBOX_ABOUT_TO_BE_SHOWN    0x829C0u
  135. #define action_COLOUR_DBOX_DIALOGUE_COMPLETED   0x829C1u
  136. #define action_COLOUR_DBOX_COLOUR_SELECTED      0x829C2u
  137. #define colourdbox_DIALOGUE_COMPLETED_COLOUR_CHOICE ((colourdbox_dialogue_completed_flags) 0x1u)
  138.  
  139. /*************************
  140.  * Function declarations *
  141.  *************************/
  142.  
  143. #ifdef __cplusplus
  144.    extern "C" {
  145. #endif
  146.  
  147. /* ------------------------------------------------------------------------
  148.  * Function:      colourdbox_get_wimp_handle()
  149.  *
  150.  * Description:   Calls reason code 0 of SWI 0x44EC6
  151.  *
  152.  * Input:         flags - value of R0 on entry
  153.  *                colour_dbox - value of R1 on entry
  154.  *
  155.  * Output:        w - value of R0 on exit (X version only)
  156.  *
  157.  * Returns:       R0 (non-X version only)
  158.  *
  159.  * Other notes:   Before entry, R2 = 0x0.
  160.  */
  161.  
  162. extern os_error *xcolourdbox_get_wimp_handle (bits flags,
  163.       toolbox_o colour_dbox,
  164.       wimp_w *w);
  165. extern wimp_w colourdbox_get_wimp_handle (bits flags,
  166.       toolbox_o colour_dbox);
  167.  
  168. /* ------------------------------------------------------------------------
  169.  * Function:      colourdbox_get_dialogue_handle()
  170.  *
  171.  * Description:   Calls reason code 1 of SWI 0x44EC6
  172.  *
  173.  * Input:         flags - value of R0 on entry
  174.  *                colour_dbox - value of R1 on entry
  175.  *
  176.  * Output:        d - value of R0 on exit (X version only)
  177.  *
  178.  * Returns:       R0 (non-X version only)
  179.  *
  180.  * Other notes:   Before entry, R2 = 0x1.
  181.  */
  182.  
  183. extern os_error *xcolourdbox_get_dialogue_handle (bits flags,
  184.       toolbox_o colour_dbox,
  185.       colourpicker_d *d);
  186. extern colourpicker_d colourdbox_get_dialogue_handle (bits flags,
  187.       toolbox_o colour_dbox);
  188.  
  189. /* ------------------------------------------------------------------------
  190.  * Function:      colourdbox_set_colour()
  191.  *
  192.  * Description:   Calls reason code 2 of SWI 0x44EC6
  193.  *
  194.  * Input:         flags - value of R0 on entry
  195.  *                colour_dbox - value of R1 on entry
  196.  *                colour - value of R3 on entry
  197.  *
  198.  * Other notes:   Before entry, R2 = 0x2.
  199.  */
  200.  
  201. extern os_error *xcolourdbox_set_colour (colourdbox_colour_flags flags,
  202.       toolbox_o colour_dbox,
  203.       colourpicker_colour const *colour);
  204. extern void colourdbox_set_colour (colourdbox_colour_flags flags,
  205.       toolbox_o colour_dbox,
  206.       colourpicker_colour const *colour);
  207.  
  208. /* ------------------------------------------------------------------------
  209.  * Function:      colourdbox_get_colour()
  210.  *
  211.  * Description:   Calls reason code 3 of SWI 0x44EC6
  212.  *
  213.  * Input:         flags - value of R0 on entry
  214.  *                colour_dbox - value of R1 on entry
  215.  *                buffer - value of R3 on entry
  216.  *                size - value of R4 on entry
  217.  *
  218.  * Output:        flags_out - value of R0 on exit
  219.  *                used - value of R4 on exit (X version only)
  220.  *
  221.  * Returns:       R4 (non-X version only)
  222.  *
  223.  * Other notes:   Before entry, R2 = 0x3.
  224.  */
  225.  
  226. extern os_error *xcolourdbox_get_colour (bits flags,
  227.       toolbox_o colour_dbox,
  228.       colourpicker_colour *buffer,
  229.       int size,
  230.       colourdbox_colour_flags *flags_out,
  231.       int *used);
  232. extern int colourdbox_get_colour (bits flags,
  233.       toolbox_o colour_dbox,
  234.       colourpicker_colour *buffer,
  235.       int size,
  236.       colourdbox_colour_flags *flags_out);
  237.  
  238. /* ------------------------------------------------------------------------
  239.  * Function:      colourdbox_set_colour_model()
  240.  *
  241.  * Description:   Calls reason code 4 of SWI 0x44EC6
  242.  *
  243.  * Input:         flags - value of R0 on entry
  244.  *                colour_dbox - value of R1 on entry
  245.  *                model - value of R3 on entry
  246.  *
  247.  * Other notes:   Before entry, R2 = 0x4.
  248.  */
  249.  
  250. extern os_error *xcolourdbox_set_colour_model (bits flags,
  251.       toolbox_o colour_dbox,
  252.       colourdbox_colour_model const *model);
  253. extern void colourdbox_set_colour_model (bits flags,
  254.       toolbox_o colour_dbox,
  255.       colourdbox_colour_model const *model);
  256.  
  257. /* ------------------------------------------------------------------------
  258.  * Function:      colourdbox_get_colour_model()
  259.  *
  260.  * Description:   Calls reason code 5 of SWI 0x44EC6
  261.  *
  262.  * Input:         flags - value of R0 on entry
  263.  *                colour_dbox - value of R1 on entry
  264.  *                buffer - value of R3 on entry
  265.  *                size - value of R4 on entry
  266.  *
  267.  * Output:        used - value of R4 on exit (X version only)
  268.  *
  269.  * Returns:       R4 (non-X version only)
  270.  *
  271.  * Other notes:   Before entry, R2 = 0x5.
  272.  */
  273.  
  274. extern os_error *xcolourdbox_get_colour_model (bits flags,
  275.       toolbox_o colour_dbox,
  276.       colourdbox_colour_model *buffer,
  277.       int size,
  278.       int *used);
  279. extern int colourdbox_get_colour_model (bits flags,
  280.       toolbox_o colour_dbox,
  281.       colourdbox_colour_model *buffer,
  282.       int size);
  283.  
  284. /* ------------------------------------------------------------------------
  285.  * Function:      colourdbox_set_none_available()
  286.  *
  287.  * Description:   Sets whether a 'None' option appears in the specified
  288.  *                ColourDbox
  289.  *
  290.  * Input:         flags - value of R0 on entry
  291.  *                colour_dbox - value of R1 on entry
  292.  *                none - value of R3 on entry
  293.  *
  294.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x6.
  295.  */
  296.  
  297. extern os_error *xcolourdbox_set_none_available (bits flags,
  298.       toolbox_o colour_dbox,
  299.       bool none);
  300. extern void colourdbox_set_none_available (bits flags,
  301.       toolbox_o colour_dbox,
  302.       bool none);
  303.  
  304. /* ------------------------------------------------------------------------
  305.  * Function:      colourdbox_get_none_available()
  306.  *
  307.  * Description:   Gets whether the 'None' option is available for the
  308.  *                specified ColourDbox
  309.  *
  310.  * Input:         flags - value of R0 on entry
  311.  *                colour_dbox - value of R1 on entry
  312.  *
  313.  * Output:        none - value of R0 on exit (X version only)
  314.  *
  315.  * Returns:       R0 (non-X version only)
  316.  *
  317.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x7.
  318.  */
  319.  
  320. extern os_error *xcolourdbox_get_none_available (bits flags,
  321.       toolbox_o colour_dbox,
  322.       bool *none);
  323. extern bool colourdbox_get_none_available (bits flags,
  324.       toolbox_o colour_dbox);
  325.  
  326. #ifdef __cplusplus
  327.    }
  328. #endif
  329.  
  330. #endif
  331.