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

	Copyright (c) GeoWorks 1989 -- All Rights Reserved

PROJECT:	PC GEOS
FILE:		Objects/gViewCC.def

DECLARER:	UI

DESCRIPTION:
	This file defines GenViewControlClass

	$Id: gViewCC.def,v 1.1 97/04/04 14:18:16 newdeal Exp $

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

SetDef	__VIEWCC

StartLibrary	ui

;
; Message(s) sent out:
; MSG_GEN_VIEW_SET_CONTROLLER_ATTRS
; MSG_GEN_VIEW_SET_CONTROLLER_SCALE_FACTOR
;
; Notification type(s) responded to:
; MANUFACTURER_ID_GEOWORKS.GWNT_VIEW_STATE_CHANGE: NotifySelectStateChange
;
; GenApplication GCN lists to place the ViewControl on:
;	MGCNLT_ACTIVE_LIST, GAGCNLT_SELF_LOAD_OPTIONS, 
; GenApplication GCN lists to place the View on:
;	GAGCNLT_CONTROLLED_GEN_VIEW_OBJECTS


GenViewControlClass	class	GenControlClass

;
; The GenViewControl controls all GenView's that have the
; GVA_CONTROLLED flag set in the attributes.  
;
; If the GenViewControl is in "apply to all" mode then the current values
; set in the GenViewControl are applied to all GenView's (existing and newly
; created) and the values with the ATTR are ignored (or more accurately, they
; are overwritten).
;
; If the GenViewControl is not in "apply to all" mode then the values in the
; ATTR of a newly created view are used *if* the APPLY_TO_ALL bit is set
; in the ATTR.  Otherwise the values stored with the GenViewControl are used.

;-----------------------------------------------------------------------------
;		Methods
;-----------------------------------------------------------------------------

MSG_GEN_VIEW_CONTROL_SET_ATTRS	message
;
; Set the GenViewControlAttrs
;
; Pass:
;	cx - GenViewControlAttrs to set
;	dx - GenViewControlAttrs to clear

MSG_GEN_VIEW_CONTROL_SET_MINIMUM_SCALE_FACTOR	message
;
; Set the minimum scale factor.
;
; Pass:
;	cx - minimun scale factor
;

MSG_GEN_VIEW_CONTROL_SET_MAXIMUM_SCALE_FACTOR	message
;
; Set the maximum scale factor.
;
; Pass:
;	cx - maximum scale factor
;
 
;-----------------------------------------------------------------------------
;		Internal methods
;-----------------------------------------------------------------------------

MSG_GVC_SET_SCALE		message
MSG_GVC_SET_SCALE_VIA_LIST	message
MSG_GVC_SET_ATTRS		message
MSG_GVC_REDRAW			message
MSG_GVC_ZOOM_IN			message
MSG_GVC_ZOOM_OUT		message
MSG_GVC_PAGE_LEFT		message
MSG_GVC_PAGE_RIGHT		message
MSG_GVC_PAGE_UP			message
MSG_GVC_PAGE_DOWN		message

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

ATR_GEN_VIEW_CONTROL_LARGE_ZOOM		vardata
;
; Cause zoom to go by large increments

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

; Features flags (used with ATTR_GEN_CONTROL_REQUIRE_UI and
; ATTR_GEN_CONTROL_PROHIBIT_UI)

GVCFeatures	record
    GVCF_MAIN_100:1
    GVCF_MAIN_SCALE_TO_FIT:1
    GVCF_ZOOM_IN:1
    GVCF_ZOOM_OUT:1
    GVCF_REDUCE:1
    GVCF_100:1
    GVCF_ENLARGE:1
    GVCF_BIG_ENLARGE:1
    GVCF_SCALE_TO_FIT:1
    GVCF_ADJUST_ASPECT_RATIO:1
    GVCF_APPLY_TO_ALL:1
    GVCF_SHOW_HORIZONTAL:1
    GVCF_SHOW_VERTICAL:1
    GVCF_CUSTOM_SCALE:1
    GVCF_REDRAW:1
GVCFeatures	end

; Toolbox features flags (used with ATTR_GEN_CONTROL_REQUIRE_TOOLBOX_UI and
; ATTR_GEN_CONTROL_PROHIBIT_TOOLBOX_UI)

GVCToolboxFeatures	record
    GVCTF_100:1
    GVCTF_SCALE_TO_FIT:1
    GVCTF_ZOOM_IN:1
    GVCTF_ZOOM_OUT:1
    GVCTF_REDRAW:1
    GVCTF_PAGE_LEFT:1
    GVCTF_PAGE_RIGHT:1
    GVCTF_PAGE_UP:1
    GVCTF_PAGE_DOWN:1
    GVCTF_ADJUST_ASPECT_RATIO:1
    GVCTF_APPLY_TO_ALL:1
    GVCTF_SHOW_HORIZONTAL:1
    GVCTF_SHOW_VERTICAL:1
GVCToolboxFeatures	end

GVC_DEFAULT_FEATURES equ mask GVCF_MAIN_100 \
			  or mask GVCF_MAIN_SCALE_TO_FIT \
			  or mask GVCF_ZOOM_IN \
			  or mask GVCF_ZOOM_OUT \
			  or mask GVCF_REDUCE \
			  or mask GVCF_100 \
			  or mask GVCF_ENLARGE \
			  or mask GVCF_SCALE_TO_FIT \
			  or mask GVCF_ADJUST_ASPECT_RATIO \
			  or mask GVCF_APPLY_TO_ALL \
			  or mask GVCF_SHOW_HORIZONTAL \
			  or mask GVCF_SHOW_VERTICAL \
			  or mask GVCF_CUSTOM_SCALE

GVC_DEFAULT_TOOLBOX_FEATURES equ mask GVCTF_100 or mask GVCTF_ZOOM_IN \
				  or mask GVCTF_ZOOM_OUT

; Suggested features for different UI levels

GVC_SUGGESTED_INTRODUCTORY_FEATURES equ mask GVCF_MAIN_100 or \
					mask GVCF_ZOOM_IN or \
					mask GVCF_ZOOM_OUT 

GVC_SUGGESTED_BEGINNING_FEATURES equ GVC_SUGGESTED_INTRODUCTORY_FEATURES or \
				     mask GVCF_MAIN_SCALE_TO_FIT

; Constants and structures

DEFAULT_ZOOM_MINIMUM		=	25
DEFAULT_ZOOM_MAXIMUM		=	200

GenViewControlSpecialScaleFactor	etype	word
GVCSSF_TO_FIT			enum	GenViewControlSpecialScaleFactor

; Notification structures

NotifyViewStateChange	struct
    NVSC_origin			PointDWFixed
    NVSC_docBounds		RectDWord
    NVSC_increment		PointDWord
    NVSC_scaleFactor		PointWWFixed
    NVSC_color			ColorQuad
    NVSC_attrs			GenViewAttrs
    NVSC_horizAttrs		GenViewDimensionAttrs
    NVSC_vertAttrs		GenViewDimensionAttrs
    NVSC_inkType		GenViewInkType
NVSC_endCopiedData	label	byte

    NVSC_contentSize		XYSize
    NVSC_contentScreenSize	XYSize
    NVSC_originRelative		PointDWord
    NVSC_documentSize		PointDWord

NotifyViewStateChange	ends

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

GenViewControlAttrs	record
    GVCA_ADJUST_ASPECT_RATIO:1
    GVCA_APPLY_TO_ALL:1
    GVCA_SHOW_HORIZONTAL:1
    GVCA_SHOW_VERTICAL:1
    :12
GenViewControlAttrs	end

    GVCI_minZoom	word	DEFAULT_ZOOM_MINIMUM
    GVCI_maxZoom	word	DEFAULT_ZOOM_MAXIMUM
    GVCI_scale		word	100
    GVCI_attrs		GenViewControlAttrs	\
			mask GVCA_SHOW_HORIZONTAL or mask GVCA_SHOW_VERTICAL \
			or mask GVCA_APPLY_TO_ALL

GenViewControlClass	endc

EndLibrary	ui
