home *** CD-ROM | disk | FTP | other *** search
- #ifndef colourpicker_H
- #define colourpicker_H
-
- /* C header file for ColourPicker
- * written by DefMod (Sep 7 1994) on Wed Sep 14 13:19:23 1994
- * Copyright © Acorn Computers Ltd, 1994
- */
-
- /*************************************************************************
- * This source file was written by Acorn Computers Limited. It is part *
- * of the OSLib library for writing applications for RISC OS. It may be *
- * used freely in the creation of programs for RISC OS. *
- *************************************************************************/
-
- #ifndef types_H
- #include "types.h"
- #endif
-
- #ifndef os_H
- #include "os.h"
- #endif
-
- #ifndef wimp_H
- #include "wimp.h"
- #endif
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef ColourPicker_RegisterModel
- #define ColourPicker_RegisterModel 0x47700
- #undef XColourPicker_RegisterModel
- #define XColourPicker_RegisterModel 0x67700
- #undef ColourPicker_DeregisterModel
- #define ColourPicker_DeregisterModel 0x47701
- #undef XColourPicker_DeregisterModel
- #define XColourPicker_DeregisterModel 0x67701
- #undef ColourPicker_OpenDialogue
- #define ColourPicker_OpenDialogue 0x47702
- #undef XColourPicker_OpenDialogue
- #define XColourPicker_OpenDialogue 0x67702
- #undef ColourPicker_CloseDialogue
- #define ColourPicker_CloseDialogue 0x47703
- #undef XColourPicker_CloseDialogue
- #define XColourPicker_CloseDialogue 0x67703
- #undef ColourPicker_UpdateDialogue
- #define ColourPicker_UpdateDialogue 0x47704
- #undef XColourPicker_UpdateDialogue
- #define XColourPicker_UpdateDialogue 0x67704
- #undef ColourPicker_ReadDialogue
- #define ColourPicker_ReadDialogue 0x47705
- #undef XColourPicker_ReadDialogue
- #define XColourPicker_ReadDialogue 0x67705
- #undef ColourPicker_SetColour
- #define ColourPicker_SetColour 0x47706
- #undef XColourPicker_SetColour
- #define XColourPicker_SetColour 0x67706
- #undef ColourPicker_HelpReply
- #define ColourPicker_HelpReply 0x47707
- #undef XColourPicker_HelpReply
- #define XColourPicker_HelpReply 0x67707
- #undef ColourPicker_ModelSWI
- #define ColourPicker_ModelSWI 0x47708
- #undef XColourPicker_ModelSWI
- #define XColourPicker_ModelSWI 0x67708
- #undef ColourPickerModelSWI_ColourChanged
- #define ColourPickerModelSWI_ColourChanged 0x0
- #undef ColourPickerModelSWI_ColourChangedByDragging
- #define ColourPickerModelSWI_ColourChangedByDragging 0x1
- #undef ColourPickerModelSWI_ClaimEvent
- #define ColourPickerModelSWI_ClaimEvent 0x2
- #undef ColourPickerModelSWI_ReleaseEvent
- #define ColourPickerModelSWI_ReleaseEvent 0x3
- #undef ColourPickerModelSWI_ProcessKey
- #define ColourPickerModelSWI_ProcessKey 0x4
- #undef Service_ColourPickerLoaded
- #define Service_ColourPickerLoaded 0x93
-
- /************************************
- * Structure and union declarations *
- ************************************/
- typedef struct colourpicker_d_ *colourpicker_d;
- typedef struct colourpicker_colour colourpicker_colour;
- typedef struct colourpicker_dialogue colourpicker_dialogue;
- typedef struct colourpicker_model colourpicker_model;
- typedef struct colourpicker_message_colour_choice colourpicker_message_colour_choice;
- typedef struct colourpicker_message_colour_changed colourpicker_message_colour_changed;
- typedef struct colourpicker_message_open_parent_request colourpicker_message_open_parent_request;
- typedef struct colourpicker_message_close_dialogue_request colourpicker_message_close_dialogue_request;
-
- /********************
- * Type definitions *
- ********************/
- struct colourpicker_colour
- { os_colour colour;
- int size;
- int info [UNKNOWN];
- };
-
- #define colourpicker_COLOUR(N) \
- struct \
- { os_colour colour; \
- int size; \
- int info [N]; \
- }
-
- #define colourpicker_SIZEOF_COLOUR(N) \
- (offsetof (colourpicker_colour, info) + \
- (N)*sizeof ((colourpicker_colour *) NULL)->info)
-
- struct colourpicker_dialogue
- { bits flags;
- char *title;
- os_box visible;
- int xscroll;
- int yscroll;
- os_colour colour;
- int size;
- int info [UNKNOWN];
- };
-
- #define colourpicker_DIALOGUE(N) \
- struct \
- { bits flags; \
- char *title; \
- os_box visible; \
- int xscroll; \
- int yscroll; \
- os_colour colour; \
- int size; \
- int info [N]; \
- }
-
- #define colourpicker_SIZEOF_DIALOGUE(N) \
- (offsetof (colourpicker_dialogue, info) + \
- (N)*sizeof ((colourpicker_dialogue *) NULL)->info)
-
- struct colourpicker_model
- { bits flags;
- char *name;
- char *description;
- int info_size;
- os_coord pane_size;
- void *entries [8];
- };
-
- struct colourpicker_message_colour_choice
- { colourpicker_d d;
- bits flags;
- os_colour colour;
- int size;
- int info [UNKNOWN];
- };
-
- #define colourpicker_MESSAGE_COLOUR_CHOICE(N) \
- struct \
- { colourpicker_d d; \
- bits flags; \
- os_colour colour; \
- int size; \
- int info [N]; \
- }
-
- #define colourpicker_SIZEOF_MESSAGE_COLOUR_CHOICE(N) \
- (offsetof (colourpicker_message_colour_choice, info) + \
- (N)*sizeof ((colourpicker_message_colour_choice *) NULL)->info)
-
- struct colourpicker_message_colour_changed
- { colourpicker_d d;
- bits flags;
- os_colour colour;
- int size;
- int info [UNKNOWN];
- };
-
- #define colourpicker_MESSAGE_COLOUR_CHANGED(N) \
- struct \
- { colourpicker_d d; \
- bits flags; \
- os_colour colour; \
- int size; \
- int info [N]; \
- }
-
- #define colourpicker_SIZEOF_MESSAGE_COLOUR_CHANGED(N) \
- (offsetof (colourpicker_message_colour_changed, info) + \
- (N)*sizeof ((colourpicker_message_colour_changed *) NULL)->info)
-
- struct colourpicker_message_open_parent_request
- { colourpicker_d d;
- };
-
- struct colourpicker_message_close_dialogue_request
- { colourpicker_d d;
- };
-
- /************************
- * Constant definitions *
- ************************/
- #define error_COLOUR_PICKER_UNINIT 0x20D00u
- #define error_COLOUR_PICKER_BAD_MODEL 0x20D01u
- #define error_COLOUR_PICKER_BAD_HANDLE 0x20D02u
- #define error_COLOUR_PICKER_BAD_FLAGS 0x20D03u
- #define error_COLOUR_PICKER_IN_USE 0x20D04u
- #define error_COLOUR_PICKER_MODEL_IN_USE 0x20D05u
- #define error_COLOUR_PICKER_BAD_REASON 0x20D06u
- #define colourpicker_DIALOGUE_OFFERS_TRANSPARENT 0x1u
- #define colourpicker_DIALOGUE_TRANSPARENT 0x2u
- #define colourpicker_DIALOGUE_TYPE 0xCu
- #define colourpicker_DIALOGUE_TYPE_SHIFT 2
- #define colourpicker_DIALOGUE_TYPE_NEVER 0x0u
- #define colourpicker_DIALOGUE_TYPE_CLICK 0x1u
- #define colourpicker_DIALOGUE_TYPE_CLICK_DRAG 0x2u
- #define colourpicker_DIALOGUE_IGNORE_HELP 0x10u
- #define colourpicker_OPEN_TRANSIENT 0x1u
- #define colourpicker_OPEN_SUB_MENU 0x2u
- #define colourpicker_OPEN_TOOLBOX 0x2u
- #define colourpicker_UPDATE_OFFERS_TRANSPARENT 0x1u
- #define colourpicker_UPDATE_TRANSPARENT 0x2u
- #define colourpicker_UPDATE_TYPE 0x4u
- #define colourpicker_UPDATE_VISIBLE 0x8u
- #define colourpicker_UPDATE_SCROLL 0x10u
- #define colourpicker_UPDATE_TITLE 0x20u
- #define colourpicker_UPDATE_COLOUR 0x40u
- #define colourpicker_UPDATE_MODEL 0x80u
- #define colourpicker_UPDATE_IGNORE_HELP 0x100u
- #define colourpicker_COLOUR_TRANSPARENT 0x1u
- #define colourpicker_COLOUR_DRAGGING 0x2u
- #define colourpicker_ENTRY_DIALOGUE_STARTING 0
- #define colourpicker_ENTRY_DIALOGUE_FINISHING 1
- #define colourpicker_ENTRY_REDRAW_AREA 2
- #define colourpicker_ENTRY_UPDATE_AREA 3
- #define colourpicker_ENTRY_READ_VALUES 4
- #define colourpicker_ENTRY_SET_VALUES 5
- #define colourpicker_ENTRY_PROCESS_EVENT 6
- #define colourpicker_ENTRY_SET_COLOUR 7
- #define colourpicker_ENTRY_LIMIT 8
- #define colourpicker_MODEL_SIZE_RGB 16
- #define colourpicker_MODEL_SIZE_CMYK 20
- #define colourpicker_MODEL_SIZE_HSV 16
- #define colourpicker_MODEL_RGB 0
- #define colourpicker_MODEL_CMYK 1
- #define colourpicker_MODEL_HSV 2
- #define message_COLOUR_PICKER_COLOUR_CHOICE 0x47700u
- #define message_COLOUR_PICKER_COLOUR_CHANGED 0x47701u
- #define message_COLOUR_PICKER_CLOSE_DIALOGUE_REQUEST 0x47702u
- #define message_COLOUR_PICKER_OPEN_PARENT_REQUEST 0x47703u
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*************************************************************
- * NOTE: The following functions provide direct access to *
- * the SWI's noted in the function description. *
- * Please read the relevant PRM section for more *
- * information on their input/output parameters. *
- *************************************************************/
-
- /* ------------------------------------------------------------------------
- * Function: colourpicker_register_model()
- *
- * Description: For internal use only
- *
- * Input: model_no - value of R0 on entry
- * model - value of R1 on entry
- * workspace - value of R2 on entry
- *
- * Other notes: Calls SWI 0x47700.
- */
-
- extern os_error *xcolourpicker_register_model (int model_no,
- colourpicker_model *model,
- byte *workspace);
- extern void colourpicker_register_model (int model_no,
- colourpicker_model *model,
- byte *workspace);
-
- /* ------------------------------------------------------------------------
- * Function: colourpicker_deregister_model()
- *
- * Description: For internal use only
- *
- * Input: model_no - value of R0 on entry
- *
- * Other notes: Calls SWI 0x47701.
- */
-
- extern os_error *xcolourpicker_deregister_model (int model_no);
- extern void colourpicker_deregister_model (int model_no);
-
- /* ------------------------------------------------------------------------
- * Function: colourpicker_open_dialogue()
- *
- * Description: Creates and opens a colour picker dialogue
- *
- * Input: flags - value of R0 on entry
- * dialogue - value of R1 on entry
- *
- * Output: d - value of R0 on exit (X version only)
- * w - value of R1 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x47702.
- */
-
- extern os_error *xcolourpicker_open_dialogue (bits flags,
- colourpicker_dialogue *dialogue,
- colourpicker_d *d,
- wimp_w *w);
- extern colourpicker_d colourpicker_open_dialogue (bits flags,
- colourpicker_dialogue *dialogue,
- wimp_w *w);
-
- /* ------------------------------------------------------------------------
- * Function: colourpicker_close_dialogue()
- *
- * Description: Closes a colour picker dialogue which is in progress
- *
- * Input: flags - value of R0 on entry
- * d - value of R1 on entry
- *
- * Other notes: Calls SWI 0x47703.
- */
-
- extern os_error *xcolourpicker_close_dialogue (bits flags,
- colourpicker_d d);
- extern void colourpicker_close_dialogue (bits flags,
- colourpicker_d d);
-
- /* ------------------------------------------------------------------------
- * Function: colourpicker_update_dialogue()
- *
- * Description: Updates some or all of the contents of a colour picker
- * dialogue
- *
- * Input: flags - value of R0 on entry
- * d - value of R1 on entry
- * dialogue - value of R2 on entry
- *
- * Other notes: Calls SWI 0x47704.
- */
-
- extern os_error *xcolourpicker_update_dialogue (bits flags,
- colourpicker_d d,
- colourpicker_dialogue *dialogue);
- extern void colourpicker_update_dialogue (bits flags,
- colourpicker_d d,
- colourpicker_dialogue *dialogue);
-
- /* ------------------------------------------------------------------------
- * Function: colourpicker_read_dialogue()
- *
- * Description: Reads the current state of a colour picker dialogue
- * without changing it
- *
- * Input: flags - value of R0 on entry
- * d - value of R1 on entry
- * dialogue - value of R2 on entry
- *
- * Output: w - value of R1 on exit
- * size - value of R2 on exit
- *
- * Other notes: Calls SWI 0x47705.
- */
-
- extern os_error *xcolourpicker_read_dialogue (bits flags,
- colourpicker_d d,
- colourpicker_dialogue *dialogue,
- wimp_w *w,
- int *size);
- extern void colourpicker_read_dialogue (bits flags,
- colourpicker_d d,
- colourpicker_dialogue *dialogue,
- wimp_w *w,
- int *size);
-
- /* ------------------------------------------------------------------------
- * Function: colourpicker_set_colour()
- *
- * Description: Reserved for future expansion
- *
- * Input: flags - value of R0 on entry
- * colour - value of R1 on entry
- *
- * Other notes: Calls SWI 0x47706.
- */
-
- extern os_error *xcolourpicker_set_colour (bits flags,
- colourpicker_colour *colour);
- extern void colourpicker_set_colour (bits flags,
- colourpicker_colour *colour);
-
- /* ------------------------------------------------------------------------
- * Function: colourpicker_help_reply()
- *
- * Description: Makes a colour picker respond to a Message_HelpRequest
- * with its own help text
- *
- * Input: flags - value of R0 on entry
- * help_request - value of R1 on entry
- *
- * Other notes: Calls SWI 0x47707.
- */
-
- extern os_error *xcolourpicker_help_reply (bits flags,
- wimp_message *help_request);
- extern void colourpicker_help_reply (bits flags,
- wimp_message *help_request);
-
- /* ------------------------------------------------------------------------
- * Function: colourpickermodelswi_colour_changed()
- *
- * Description: Informs the front end to send a message to the client, if
- * required
- *
- * Input: colour - value of R1 on entry
- *
- * Other notes: Calls SWI 0x47708 with R0 = 0x0.
- */
-
- extern os_error *xcolourpickermodelswi_colour_changed (colourpicker_colour *colour);
- extern void colourpickermodelswi_colour_changed (colourpicker_colour *colour);
-
- /* ------------------------------------------------------------------------
- * Function: colourpickermodelswi_colour_changed_by_dragging()
- *
- * Description: Informs the front end to send a dragging message to the
- * client, if required
- *
- * Input: colour - value of R1 on entry
- *
- * Other notes: Calls SWI 0x47708 with R0 = 0x1.
- */
-
- extern os_error *xcolourpickermodelswi_colour_changed_by_dragging (colourpicker_colour *colour);
- extern void colourpickermodelswi_colour_changed_by_dragging (colourpicker_colour *colour);
-
- /* ------------------------------------------------------------------------
- * Function: colourpickermodelswi_claim_event()
- *
- * Description: Informs the front end that the back end wants an event
- * type
- *
- * Input: event - value of R1 on entry
- * colour - value of R2 on entry
- *
- * Other notes: Calls SWI 0x47708 with R0 = 0x2.
- */
-
- extern os_error *xcolourpickermodelswi_claim_event (int event,
- colourpicker_colour *colour);
- extern void colourpickermodelswi_claim_event (int event,
- colourpicker_colour *colour);
-
- /* ------------------------------------------------------------------------
- * Function: colourpickermodelswi_release_event()
- *
- * Description: Informs the front end that the back end no longer wants
- * an event type
- *
- * Input: event - value of R1 on entry
- * colour - value of R2 on entry
- *
- * Other notes: Calls SWI 0x47708 with R0 = 0x3.
- */
-
- extern os_error *xcolourpickermodelswi_release_event (int event,
- colourpicker_colour *colour);
- extern void colourpickermodelswi_release_event (int event,
- colourpicker_colour *colour);
-
- /* ------------------------------------------------------------------------
- * Function: colourpickermodelswi_process_key()
- *
- * Description: Passes an unhandled key press on to the front end
- *
- * Input: c - value of R1 on entry
- * colour - value of R2 on entry
- *
- * Other notes: Calls SWI 0x47708 with R0 = 0x4.
- */
-
- extern os_error *xcolourpickermodelswi_process_key (int c,
- colourpicker_colour *colour);
- extern void colourpickermodelswi_process_key (int c,
- colourpicker_colour *colour);
-
- /* ------------------------------------------------------------------------
- * Function: service_colour_picker_loaded()
- *
- * Description: For internal use only
- *
- * Input: loaded_service - value of R2 on entry
- * workspace - value of R3 on entry
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x93.
- */
-
- extern os_error *xservice_colour_picker_loaded (void *loaded_service,
- byte *workspace);
- extern void service_colour_picker_loaded (void *loaded_service,
- byte *workspace);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-