COMMENT @----------------------------------------------------------------------

	Copyright (c) GeoWorks 1990, 1991 -- All Rights Reserved

PROJECT:	PC GEOS
FILE:		tCtrlC.def

DECLARER:	Color Library

DESCRIPTION:
	This file contains the definition of the color library

	$Id: colorC.def,v 1.2 98/04/24 00:37:35 gene Exp $

------------------------------------------------------------------------------@

SetDef __COLORC

StartLibrary	color

;******************************************************************************
;		ColorSelectorClass
;******************************************************************************

;
; GenApplication GCN lists to be placed on:
;	GAGCNLT_SELF_LOAD_OPTIONS

ColorSelectorClass	class	GenControlClass

;-----------------------------------------------------------------------------
;		Structures
;-----------------------------------------------------------------------------

;-----------------------------------------------------------------------------
;		Messages
;-----------------------------------------------------------------------------

MSG_COLOR_SELECTOR_GET_COLOR	message
;
; Get the current color
;
; Pass:
;	none
; Return:
;	dxcx - ColorQuad (dx = high, cx = low)
;	bp - non-zero if indeterminate

MSG_COLOR_SELECTOR_UPDATE_COLOR		message
;
; Update the current color in the toolbox and normal ui. This
; is the message you'll probably want to send from a
; MSG_GEN_CONTROL_UPDATE_UI handler.
;
; Pass:
;	dxcx - ColorQuad (dx = high, cx = low)
;	bp - non-zero if indeterminate
; Return:
;	nothing

MSG_COLOR_SELECTOR_SET_COLOR	message
;
; Set the current color
;
; Pass:
;	dxcx - ColorQuad (dx = high, cx = low)
;	bp - non-zero if indeterminate
; Return:
;	nothing


MSG_COLOR_SELECTOR_APPLY_COLOR	message
;
; Outputs a MSG_META_COLORED_OBJECT_SET_COLOR.
;
; Pass:
;	dxcx - ColorQuad
; Return:
;	nothing

MSG_COLOR_SELECTOR_UPDATE_FILLED_STATUS		message
;
;
; Pass:
;	cl - SystemDrawMask
;	dx - non-zero if indeterminate
;	bp - non-zero to update toolbox UI as well
;
; Return:
;	none

MSG_COLOR_SELECTOR_GET_FILLED_MONIKER		message
;
;	Returns the VisMoniker that should be used to represent the
;	"Do Draw" item in the color selector.
;
; Pass:		nothing
;
; Return:	^lcx:dx - VisMoniker
;		or cx=0 to use default (which is currently "Filled")


MSG_COLOR_SELECTOR_GET_UNFILLED_MONIKER		message
;
;	Returns the VisMoniker that should be used to represent the
;	"Don't Draw" item in the color selector.
;
; Pass:		nothing
;
; Return:	^lcx:dx - VisMoniker
;		or cx=0 to use default (which is currently "Unfilled")


MSG_COLOR_SELECTOR_UPDATE_DRAW_MASK	message
;
; Update the current draw mask in the toolbox and normal ui. This
; is the message you'll probably want to send from a
; MSG_GEN_CONTROL_UPDATE_UI handler.
;
; Pass:
;	cl - SystemDrawMask
;	dx - non-zero if indeterminate
; Return:
;	none

MSG_COLOR_SELECTOR_GET_DRAW_MASK	message
;
; Get the current draw mask
;
; Pass:
;	none
; Return:
;	cl - SystemDrawMask
;	dx - non-zero if indeterminate

MSG_COLOR_SELECTOR_SET_DRAW_MASK	message
;
; Set the current draw mask
;
; Pass:
;	cl - SystemDrawMask
;	dx - non-zero if indeterminate
; Return:
;	none

MSG_COLOR_SELECTOR_APPLY_DRAW_MASK	message
;
; Outputs a MSG_META_COLORED_OBJECT_SET_DRAW_MASK.
;
; Pass:
;	cl - SystemDrawMask
; Return:
;	nothing

MSG_COLOR_SELECTOR_UPDATE_PATTERN	message
;
; Update the current pattern in the toolbox and normal ui. This
; is the message you'll probably want to send from a
; MSG_GEN_CONTROL_UPDATE_UI handler.
;
; Pass:
;	cx - GraphicPattern
;	dx - non-zero if indeterminate
; Return:
;	none

MSG_COLOR_SELECTOR_GET_PATTERN	message
;
; Get the current pattern
;
; Pass:
;	none
; Return:
;	cx - GraphicPattern
;	dx - non-zero if indeterminate

MSG_COLOR_SELECTOR_SET_PATTERN	message
;
; Set the current pattern
;
; Pass:
;	cx - GraphicPattern
;	dx - non-zero if indeterminate
; Return:
;	none

MSG_COLOR_SELECTOR_APPLY_PATTERN	message
;
; Outputs a MSG_META_COLORED_OBJECT_SET_PATTERN.
;
; Pass:
;	cx - GraphicPattern
;
; Return:
;	nothing

;-----------------------------------------------------------------------------
;		Internal messages
;-----------------------------------------------------------------------------

MSG_CS_SET_FILLED_STATUS	message
;
;  Tells the controller to disable itself and set the mask to 0 or to
;  re-enable itself and set the mask to 100, based on the passed flag.
;  
;
;	PASS:		cl = SysDrawMask
;
;	RETURN:		nothing
;

MSG_CS_SET_CF_INDEX	message
;
; Sent from color list to set a color via an index
;
; Pass:
;	bp low - ListEntryState
;	bp high - ListUpdateFlags

MSG_CS_SET_CF_RGB_RED	message
MSG_CS_SET_CF_RGB_GREEN	message
MSG_CS_SET_CF_RGB_BLUE	message
;
; Sent from RGB spins
;
; Pass:
;	cx - bit to set/reset
;	bp low - ListEntryState
;	bp high - ListUpdateFlags

MSG_CS_SET_DRAW_MASK	message
MSG_CS_SET_PATTERN	message

MSG_CS_SET_SELECTOR_TYPE	message
;
; Sent from color selector type list
;
; Pass:
;	cx - ColorSelectorType
;

MSG_CS_ADD_CUSTOM_COLOR		message
;
; Add the current color to our custom color list
;
; Pass:
;	none
;

MSG_CS_CUSTOM_COLOR_SELECT	message
;
; A custom color has been selected
;
; Pass:
;	cx - color # / list selection
;

MSG_CS_SET_COLOR_RGB		message
;
; Set the color, mark the color as changed, etc.
;
; Pass:
;	none
;

;-----------------------------------------------------------------------------
;		Messages sent out
;-----------------------------------------------------------------------------

MSG_META_COLORED_OBJECT_SET_COLOR	message		MetaColorMessages
;
; Sent out by the color selector (to GCI_output) to set the color
;
; Pass:
;	dxcx - ColorQuad

MSG_META_COLORED_OBJECT_SET_DRAW_MASK	message		MetaColorMessages
;
; Sent out by the color selector (to GCI_output) to set the draw mask
;
; Pass:
;	cl - SystemDrawMask

MSG_META_COLORED_OBJECT_SET_PATTERN	message		MetaColorMessages
;
; Sent out by the color selector (to GCI_output) to set the hatch pattern.
;
; Pass:
;	cx - GraphicPattern


;-----------------------------------------------------------------------------
;		Hints
;-----------------------------------------------------------------------------

;-----------------------------------------------------------------------------
;		Constants & Structures
;-----------------------------------------------------------------------------

; Features flags (used with ATTR_GEN_CONTROL_REQUIRE_UI and
; ATTR_GEN_CONTROL_PROHIBIT_UI)

CSFeatures	record
	:10
    CSF_OTHER:1
    CSF_FILLED_LIST:1
    CSF_INDEX:1
    CSF_RGB:1
    CSF_DRAW_MASK:1
    CSF_PATTERN:1
CSFeatures	end

CSToolboxFeatures	record
    CSTF_INDEX:1
    CSTF_DRAW_MASK:1
    CSTF_PATTERN:1
CSToolboxFeatures	end

CS_DEFAULT_FEATURES		equ	mask CSFeatures \
					and not mask CSF_FILLED_LIST

CS_DEFAULT_TOOLBOX_FEATURES	equ 	mask CSTF_INDEX or \
					mask CSTF_DRAW_MASK or \
					mask CSTF_PATTERN

;-----------------------------------------------------------------------------
;		Instance Data Structures
;-----------------------------------------------------------------------------

ColorModifiedStates	record
    CMS_COLOR_CHANGED:1
    CMS_DRAW_MASK_CHANGED:1
    CMS_PATTERN_CHANGED:1
ColorModifiedStates	end

ColoredObjectOrientation	etype	byte
COO_AREA_ORIENTED	enum	ColoredObjectOrientation
COO_TEXT_ORIENTED	enum	ColoredObjectOrientation
COO_LINE_ORIENTED	enum	ColoredObjectOrientation

ColorToolboxPreferences		record
	:2
	CTP_INDEX_ORIENTATION		: 2	;ColoredObjectOrientation
	CTP_DRAW_MASK_ORIENTATION	: 2	;ColoredObjectOrientation
	CTP_PATTERN_ORIENTATION		: 1	;ColoredObjectOrientation
	CTP_IS_POPUP			: 1
ColorToolboxPreferences		end

;-----------------------------------------------------------------------------
;		Instance Data
;-----------------------------------------------------------------------------

    CSI_color			ColorQuad
    CSI_colorIndeterminate	byte
    CSI_drawMask		SystemDrawMask
    CSI_drawMaskIndeterminate	byte
    CSI_pattern			GraphicPattern
    CSI_patternIndeterminate	byte
    CSI_states			ColorModifiedStates
    CSI_toolboxPrefs		ColorToolboxPreferences

ATTR_COLOR_SELECTOR_DISABLE_OBJECT	vardata		optr

ColorSelectorClass	endc

EndLibrary	color
