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

	Copyright (c) GeoWorks 1989 -- All Rights Reserved

PROJECT:	PC GEOS
FILE:		Objects/gViewC.def

DECLARER:	UI

DESCRIPTION:
	This file defines GenViewClass

	$Id: gViewC.def,v 1.1 97/04/04 14:18:19 newdeal Exp $

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

SetDef	__GVIEWC

StartLibrary	ui

GenViewClass	class	GenClass

global GenSetupTrackingArgs:far
global GenReturnTrackingArgs:far
global GenViewSetSimpleBounds:far
global GenViewSendToLinksIfNeeded:far		
global GenViewSendToLinksIfNeededDirection:far

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

;------------------------------------------------------------------------
;	Methods relating to document coordinates
;------------------------------------------------------------------------

MSG_GEN_VIEW_GET_ORIGIN			message

; This method returns the current document origin.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		cx:dx - buffer of size PointDWord to return args
; Return:	cx:dx - {PointDWord} current origin.
;		ax, bp - destroyed


MSG_GEN_VIEW_SET_ORIGIN			message

; This method sets a new origin. If window is built, it will visually update
; appropriately.  Adjustments will be made to keep part of the document
; visible under the view.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		ss:bp  - {PointDWord} new origin
;		dx     - size PointDWord
; Return:	none
;		ax, cx, dx, bp - destroyed


MSG_GEN_VIEW_SCROLL				message

; This method scrolls the document a certain relative amount.  If the
; view is built, it will visually update appropriately.  Adjustments will be
; made to keep part of the document visible under the view.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		ss:[bp] - {PointDWord} relative amount to scroll.
;		dx      - size PointDWord
; Return:	none
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_MAKE_RECT_VISIBLE		message

; This method may be called to scroll a rectangle on the document into view
; if it is not already visible.  The document will be scrolled until the
; rectangle is scrolled through a certain percentage of the view. Scrolling
; the rectangle with a 50% margin will center the rectangle onscreen, 0% just
; barely onscreen, 100% all the way to the other edge.  The rectangle can
; be anywhere in the 32 bit document space, but cannot be larger than
; 65535 points high or wide.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		ss:[bp]  -- MakeRectVisibleParams
;		dx - size MakeRectVisibleParams
;

MakeRectVisibleFlags	record
	:8,			;keep unused, for now.
	MRVF_ALWAYS_SCROLL:1,
		;Set if we always want to do the scrolling, even if the object
		;is already partly onscreen.  Mostly only useful if an object
		;is already barely onscreen and we want to center it.

	MRVF_USE_MARGIN_FROM_TOP_LEFT:1,
		;Ignore current placement of the object; margins are always
		;calculated from the top or left edge of the view, regardless
		;of the original position of the rect.
	:6
MakeRectVisibleFlags	end

MakeRectVisibleMargin	etype	word
	; How far to bring the rect onscreen.  See comments for each constant.
	; If you need to get more a precise percentage, multiply your percentage
	; by 0ffffh and use that rather than one of these constants.

	MRVM_0_PERCENT 		enum MakeRectVisibleMargin, 0
				;Scroll the view just far enough to get the
				;rect barely onscreen.  If rect is larger than
				;the view, brings as much as possible onscreen.
				;If MRVF_USE_MARGIN_FROM_TOP_LEFT is set, always
				;brings the object to the top or left edge of
				;the screen.

	MRVM_25_PERCENT		enum MakeRectVisibleMargin, 0ffffh/4

	MRVM_50_PERCENT		enum MakeRectVisibleMargin, 0ffffh/2
				;Centers the object onscreen.

	MRVM_75_PERCENT		enum MakeRectVisibleMargin, 0ffffh*3/4

	MRVM_100_PERCENT	enum MakeRectVisibleMargin, 0ffffh
				;Scrolls the rect all the way to the opposite
				;edge of the screen from whence it came.
				;Probably only useful if always using margin
				;from top left, in order to bring something
				;to the bottom edge of the screen.


MakeRectVisibleParams	struct
	MRVP_bounds	RectDWord		;bounds of rect to make visible
					;  (must be < 65535 points high or wide)
	MRVP_xMargin	MakeRectVisibleMargin	;how far to bring rect onscreen
	MRVP_xFlags	MakeRectVisibleFlags

	MRVP_yMargin	MakeRectVisibleMargin
	MRVP_yFlags	MakeRectVisibleFlags

MakeRectVisibleParams	ends



MSG_GEN_VIEW_SET_SCALE_FACTOR				message

; This method scales the view's window.  Several options are included to
; decide what point to scroll around, i.e. the point that stays fixed as
; we scale.  The view may scroll to keep itself visible under the view.

; Context:	the GenView's scaling mechanism
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		ss:[bp]  -- ScaleViewParams
;		dx       -- size ScaleViewParams
; Return:	none
;		ax, cx, dx, bp -- destroyed


ScaleViewType	etype	byte
	SVT_AROUND_UPPER_LEFT 		enum 	ScaleViewType
					;Upper left corner of subview is kept
					;fixed as we scale.

	SVT_AROUND_CENTER		enum	ScaleViewType
					;Center of subview kept fixed as we
					;scale.

	SVT_AROUND_POINT		enum	ScaleViewType
					;Point specified in SVP_point is kept
					;fixed as we scale.


ScaleViewParams	struct
	SVP_scaleFactor	PointWWFixed	;new, absolute scale factor
	SVP_unused	byte			;to keep C stuff working
	SVP_type	ScaleViewType		;type of scaling to do
	SVP_point	PointDWord		;point to scale around
ScaleViewParams	ends



MSG_GEN_VIEW_GET_SCALE_FACTOR			message
;
; This method returns the current scale factor for the given subview.
;
; Context:	the GenView's scaling mechanism
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	dx:cx -- X-scale factor (WWFixed)
;		bp:ax -- Y-scale factor (WWFixed)
;


MSG_GEN_VIEW_SET_CONTENT				message
;
; Initialize a new content for a view.  Sends all of the normal things to
; the output as if the view were coming up for the first time.  Closes the
; current content first, if there is one, simulating the window going down.
; Just sets the appropriate instance data if the view hasn't been built yet.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		^lcx:dx - new content to set (0 to set none)
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_GET_CONTENT				message
;
; Get the current content.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		none
; Return:	^lcx:dx - content
; 		ax, bp - destroyed
;

MSG_GEN_VIEW_GET_WINDOW			message
;
; This method can be used to get the current window handle for this view.
; If unbuilt, returns null.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	cx -- window handle, or null if none
;		ax, dx, bp - destroyed
;

MSG_GEN_VIEW_GET_VISIBLE_RECT	message
;
; Returns the area currently visible in the view, in document coords.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		cx:dx  -- buffer of size RectDWord
; Return:	cx:dx  -- {RectDWord} visible area (or null if not yet built)
;		ax, bp -- destroyed
;

MSG_GEN_VIEW_GET_INCREMENT			message

; This method is used to get the current increment amount.

; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		cx:dx - buffer of size PointDWord to put result
; Return:	cx:dx - {PointDWord} current increment amount
;		ax, bp - destroyed
;

MSG_GEN_VIEW_SET_INCREMENT			message

; This method is used to set the current increment amount.  Cannot be negative.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		ss:[bp] - {PointDWord} new increment amount
;			  (zero in a given dimension if no change desired)
;		dx      - size PointDWord
; Return:	nothing
;		ax, cx, dx, bp - destroyed


MSG_GEN_VIEW_SUSPEND_UPDATE		message
;
; Suspends redrawing in the view's window until it receives a MSG_GEN_VIEW_
; UNSUSPEND_UPDATE.  Useful for doing several scroll actions without a lot
; of intermediate redrawing.  Suspend/unsuspend combinations can be nested.
; If there is any chance of the view window not yet created yet, you'll want
; to check the carry on exit to ensure that the view window was indeed 
; suspended (if it wasn't, you'll need to avoid calling MSG_GEN_VIEW_UNSUSPEND_-
; UPDATE, or you'll get a SUSPEND_COUNT_UNDERFLOW error.)
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	carry set if view window was suspended
; 		ax, cx, dx, bp destroyed
;

MSG_GEN_VIEW_UNSUSPEND_UPDATE		message
;
; Turns off previous suspension of window updates begun by a MSG_GEN_VIEW_
; SUSPEND_UPDATE.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp destroyed
;

MSG_GEN_VIEW_SET_DOC_BOUNDS			message

; Allows you to set the document bounds that the view can scroll around in.
; View will scroll appropriately to keep the part of the document onscreen.
; See GenViewSetSimpleBounds if you don't need 32 bits or a left and top bound.
;
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		ss:bp -- {RectDWord}  New scrollable document bounds, zero
;				    if no constrain requested
;		dx     - size RectDWord
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_GET_DOC_BOUNDS			message

; This method gets the current document size.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		cx:dx - buffer of size RectDWord to put result
; Return:	cx:dx - {RectDWord} current scrollable bounds
;		ax, bp - destroyed
;

MSG_GEN_VIEW_GET_ATTRS			message
;
; Get the current attributes for the view.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	cx	- viewAttributes
;		ax, dx, bp - destroyed
;
;

MSG_GEN_VIEW_SET_ATTRS			message
;
; Allows changing view attributes.  Geometry updating may be necessary for
; some of the attributes.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass: 	cx	- GenViewAttrs to set
;		dx	- GenViewAttrs to reset.
;		bp	- VisUpdateMode (VUM_MANUAL allowed here)
;
; Return:	nothing
; 		ax, cx, dx, bp  - destroyed
;
;

MSG_GEN_VIEW_SET_COLOR			message
;
; Allows changing of background window color.  
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		cl	- Red value
;		ch	- ColorFlag
;		dl	- Green color
;		dh	- Blue color
; Return:	nothing
; 		ax, cx, dx, bp - destroyed


MSG_GEN_VIEW_GET_COLOR			message
;
; Returns current view colors.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	cl	- Red value
;		ch	- ColorFlag
;		dl	- Green color
;		dh	- Blue color
; 		ax, bp  - destroyed


MSG_GEN_VIEW_CALC_WIN_SIZE		message
;
; The view sends this method to itself when choosing the size for its
; window.  The size returned will be always be used as the size of the view
; window, except at small sizes, where scrollers and other objects put in with 
; the scrollers force the size of the view window out.
;
; Context:	occurs during geometry calculations on the view
; Source:	the GenView object
; Destination:  the GenView object 
; Interception: There is no default handler for this message.  This will be
; 		intercepted by a subclass of the GenView in order to more 
;		precisely control the size of the GenView.  A warning:  the
;		size returned by this message should: a) be deterministic
;		based on the suggested size, and b) should be able to be
;		suggested later, and get the same output (e.g. the size should
;		not always be larger or smaller than what is passed in).  
;
; Pass:		cx -- suggested width of the window
;		dx -- suggested height of the window
; Return:	cx -- new suggested width of the window
;		dx -- new suggested height of the window
;		ax, bp -- destroyed
;

;------------------------------------------------------------------------

;------------------------------------------------------------------------
;	Methods for changing the view ptr
;------------------------------------------------------------------------

MSG_GEN_VIEW_SET_PTR_IMAGE			message
;
;	This method allows setting of window & gadget level pointer images
; for use when the mouse is over the window area of a view, or grabbed by
; the view.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		^lcx:dx	- optr to PointerDef in sharable memory block, OR
;		cx = 0, and dx = 0 for no ptr image request for view, OR
;			    dx = PtrImageValue (see Internal/im.def)
;               bp      - PIL_GADGET, for feedback from individual gadgets, OR
;			  PIL_WINDOW, to set the lower priority background
;		   		      cursor to use over the view.
;               NOTE:  if cx = 0, dx = PIV_UPDATE, bp is not used.
;
; Return: 	nothing
;

MSG_GEN_VIEW_UPDATE_CONTENT_TARGET_INFO	message	; Should only be sent by
;						; VisContent or process
;						; (outputOD of View)
;
;	This method is sent to views from VisContents, whenever
; target information within the view changes.  This is so that MSG_GET_TARGET
; may be used to retrieve target information about the portion of the
; target hierarchy which is within the content itself  (The UI can't directly
; call objects running in other threads, so this method is required to update
; it with the latest info)
;
; Context:	basic gen view functions
; Source:	a VisContent object
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		dx	- size ViewTargetInfo
;		ss:bp	pointer to ViewTargetInfo
; Return:	nothing
;		ax, cx, dx, bp - destroyed


TargetReference	struct
	TR_object		optr		; OD of node/leaf in target hierarchy
	TR_class	fptr		; class of above object
TargetReference	ends

ViewTargetInfo	struct
	VTI_target	TargetReference	; Final target object within content
	VTI_content	TargetReference	; The content object itself
ViewTargetInfo	ends



MSG_GEN_VIEW_INITIATE_DRAG_SCROLL		message
;
; This may be sent to cause drag scrolling (auto-scrolling of subview on
; dragging of mouse outside of view) to occur with mouse buttons other than
; SELECT, which is normally done by default.  This would be used, say, in
; Draw when the user presses the DIRECT_ACTION button on a control point of
; an object, which will initiate a move or resize of the object within the
; draw document itself, & NOT start a quick copy or move between applications.
; Calling this at the MSG_META_START_MOVE_COPY would cause the view to auto-scroll
; until the button is released, thereby letting the user move/resize the object
; within the view.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
;		ax, cx, dx, bp - destroyed


MSG_GEN_VIEW_GET_DIMENSION_ATTRS			message
;
; Get the current dimension attributes for the view.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	cl	- GenViewDimensionAttrs: horizAttributes
;		ch	- GenViewDimensionAttrs: vertAttributes
;		ax, dx, bp - destroyed
;

MSG_GEN_VIEW_SET_DIMENSION_ATTRS			message
;
; Allows changing view attributes.
;
; Context:	basic gen view functions
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass: 	cl	- GenViewDimensionAttrs: horizAttributes to set
;		ch	- GenViewDimensionAttrs: horizAttributes to reset
; 		dl	- GenViewDimensionAttrs: vertAttributes to set
;		dh	- GenViewDimensionAttrs: vertAttributes to reset
;		bp	- VisUpdateMode
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;


;
; These methods are used by scrollers to manipulate the view, but might be
; useful to applications as well.  These methods only function when the view
; is specifically built.
;
; (These must keep the ordering: minimum, page decrement, decrement, non-inc-
; dec-change, increment, page increment, maximum.  GenRanges can deliver 
; multiple messages based on this order.)
;

MSG_GEN_VIEW_SCROLL_TOP			message
;
; Scroll to the top bound of the document.  Only works while
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SCROLL_PAGE_UP			message
;
; Scroll up one window length.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SCROLL_UP			message
;
; Scroll up one increment amount.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SCROLL_SET_Y_ORIGIN		message
;
; Change the Y origin, keeping X origin fixed.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		dx:cx -- new y origin
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SCROLL_DOWN			message
;
; Scroll down one increment amount.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SCROLL_PAGE_DOWN			message
;
; Scroll down one window length.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SCROLL_BOTTOM			message
;
; Scroll to the bottom bound of the document.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

VERTICAL_VIEW_BASE_MESSAGE	equ	MSG_GEN_VIEW_SCROLL_TOP



MSG_GEN_VIEW_SCROLL_LEFT_EDGE			message
;
; Scroll to the left bound of the document.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SCROLL_PAGE_LEFT		message
;
; Scroll left one window width.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SCROLL_LEFT			message
;
; Scroll left one increment.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SCROLL_SET_X_ORIGIN		message
;
; Set a new x origin, keeping the y origin fixed.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		dx:cx -- new x origin
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SCROLL_RIGHT			message
;
; Scroll right one increment amount.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SCROLL_PAGE_RIGHT		message
;
; Scroll right one window width.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SCROLL_RIGHT_EDGE		message
;
; Scroll to the right bound of the document.
;
; Context:	the GenView's scroll mechanism
; Source:	no restrictions
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

HORIZONTAL_VIEW_BASE_MESSAGE	equ	MSG_GEN_VIEW_SCROLL_LEFT_EDGE


;------------------------------------------------------------------------
;	Method to allowing quick transfer
;------------------------------------------------------------------------

MSG_GEN_VIEW_ALLOW_GLOBAL_TRANSFER	message
;
;	This method allows quick transfer destinations to receive
;	MSG_PTRs.  It should be sent to the GenView when the
;	GenView content starts a quick transfer.
;
; Context:	general GenView functions
; Source:	no restrictions, usually the content of the view
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass: 	nothing
; Return: 	nothing
;

MSG_GEN_VIEW_SET_DRAG_BOUNDS				message
;
; Allows setting of a temporary rectangle to allow drag-scrolling to work in.
; The way this is used is when the user presses on a visual object in the
; content, the object will notify the view of its bounds, so that any
; subsequent drag scrolling only works in order to get the object onscreen.
; This bounds will only be in effect until the next mouse event.
;
; Context:	general GenView functions
; Source:	no restrictions, usually the content of the view on selection
;		of a visual area within the content
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		ss:bp -- {RectDWord} draggable bounds
;		dx    -- size draggable bounds
; Return:	nothing
;		ax, cx, dx, bp -- destroyed
;


;------------------------------------------------------------------------
;	Messages to be sent by track-scrolling handlers
;------------------------------------------------------------------------

MSG_GEN_VIEW_SETUP_TRACKING_ARGS		message
;
; This should be called by the application in response to a MSG_TRACK_
; SCROLLING to set up the position & size of the view in TrackScrollingParams.
; Also ensures that the desired new origin is still in bounds, and adjusts
; it if so.  Assembly programs can use the library routine GenSetupTrackingArgs.
; One or the other *must* be called at the start of a MSG_VIS_CONTENT_TRACK-
; _SCROLLING handler.  See discussion on MSG_META_CONTENT_TRACK_SCROLLING.
;
; Context:	the GenView scroll mechanism
; Source:	must be the first thing sent in a content's 
;		MSG_META_CONTENT_TRACK_SCROLLING handler.
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		cx:dx - pointer to TrackScrollingParams 
; Return:	cx, bp	- preserved
;		ax, dx  - destroyed

MSG_GEN_VIEW_TRACKING_COMPLETE			message
;
; An application *must* send this in response to a MSG_META_CONTENT_TRACK_-
; SCROLLING, returning the value that it wants to use for scrolling.   This is 
; sent directly to the object that initiated the TRACK_SCROLLING, whose
; optr is in TSP_caller.  GenReturnTrackingArgs is provided to do this
; automatically for you.  See discussion on MSG_META_CONTENT_TRACK_SCROLLING.
;
; Context:	the GenView scroll mechanism
; Source:	must be sent by a content's MSG_META_CONTENT_TRACK_SCROLLING
;		handler, usually at the end of the handler.
; Destination:  a USABLE GenView object
; Interception: not typically intercepted
;
; Pass:		ss:bp - TrackScrollingParams
;		dx    - size TrackScrollingParams
; Returns: 	nothing
;      		ax, cx, dx, bp - destroyed
;

;------------------------------------------------------------------------
;	Methods not needed by the application
;------------------------------------------------------------------------

MSG_GEN_VIEW_DETERMINE_VIS_PARENT			message
;
; Returns vis parent for a view's child object.   Used in visibly building
; objects underneath the view.
;
; Context:	the view's spec-build mechanism
; Source:	a generic child of the view
; Destination:  the view
; Interception: internal, should not be intercepted
;
; Pass:		^lcx:dx -- child to get vis parent for
; Return:	^lcx:dx -- vis parent to use
;		ax, bp  -- destroyed
;
	
;------------------------------------------------------------------------
;	Internal linked view propagation messages
;------------------------------------------------------------------------
	
MSG_GEN_VIEW_SEND_TO_LINKS		message
; 
; Dispatches the passed message to itself, then sends propagates this message 
; to all other links (except the originator of the message).  The default
; handler responds by sending a MSG_GEN_VIEW_SEND_TO_VLINK to itself, which
; causes a dispatch of the message to itself and allows any vertical links
; to get the message; it then propagates MSG_GEN_VIEW_SEND_TO_LINKS to its
; horizontal link.  Most non-scrolling GenView messages will be propagated
; to links through this message.
;
; Context:	The view will send this to itself after receiving any scroll
;		or scale message.
; Source:	any GenView
; Destination:  any GenView
; Interception: Can be intercepted to keep an action from taking place
;		on this view, although it ought to be propagated to the
;		next horizontal link in any case.
;
; Pass:		bp -- ClassedEvent to propagate (freed on return)
;		^lcx:dx -- Originator of the message.
; Return:	nothing
;		ax, cx, dx, bp -- destroyed
;
	
MSG_GEN_VIEW_SEND_TO_VLINK		message
; 
; Dispatches the passed message to itself, then propagates this message on
; to its vertical link (provided it's not the originator of the message).
; Any GenView scroll message will be propagated to links through this
; message and MSG_GEN_VIEW_SEND_TO_HLINK.
;
; Context:	These will propagate across vertical links as a result of
; 		an object getting a MSG_GEN_VIEW_SEND_TO_LINKS.
; Source:	any GenView
; Destination:  any GenView
; Interception: Can be intercepted to keep an action from taking place on
;		this view, although it ought to be propagated to the next
;		one in any case.
;
; Pass:		bp      -- ClassedEvent to propagate (preserved after return)
;		^lcx:dx -- Originator of the message
; Return:	nothing
;		ax, cx, dx, bp -- destroyed
;
	
MSG_GEN_VIEW_SEND_TO_HLINK		message
; 
; Dispatches the passed message to itself, then propagates this message on
; to its horizontal link (provided it's not the originator of the message).
; Any GenView scroll message will be propagated to links through this
; message and MSG_GEN_VIEW_SEND_TO_HLINK.
;
; Context:	These will propagate across horizontal links as a result of
; 		an object getting a MSG_GEN_VIEW_SEND_TO_LINKS.
; Source:	any GenView
; Destination:  any GenView
; Interception: Can be intercepted to keep an action from taking place on
;		this view, although it ought to be propagated to the next
;		one in any case.
;
; Pass:		bp      -- ClassedEvent to propagate (preserved after return)
;		^lcx:dx -- Originator of the message
; Return:	nothing
;		ax, cx, dx, bp -- destroyed
;
	
MSG_GEN_VIEW_CALL_WITHOUT_LINKS		message
;
; Allows calling the GenView without having the message sent to linked
; GenView's.  MF_CALL will be used so that arguments will be returned.
;
; Context:	GenView utility
; Source:	no restrictions
; Destination:	any GenView
; Interception:	unlikely
;
; Pass:		bp 	-- ClassedEvent to propagate (should be GenView)
;		cx	-- MessageFlags passed to ObjDispatchMessage:
;			MF_CALL - call GenView, return values in ax, cx, dx, bp
;			MF_RECORD - causes the event not to be freed
;			MF_FORCE_QUEUE - send the message via the event queue 
;				 (even if it could otherwise be handled via a 
;				  direct call)
; Return:	ax, cx, dx, bp -- arguments returned, if any
;
; For example, to page MyView up without affecting any linked views:
;
;	push	bx, si
;	mov	ax, MSG_GEN_VIEW_SCROLL_PAGE_UP
;	mov	bx, segment GenViewClass ;set to the base class that can handle 
;	mov	si, offset GenViewClass	 ;  the message in ax
;	mov	di, mask MF_RECORD 
;	call	ObjMessage
;	mov	bp, di			 ; Get handle to ClassedEvent in bp
;	clr	cx			 ; No message flags
;	pop	bx, si	 		 ; Get object 
;	pop	bx
;	clr	di
;	mov	ax, MSG_GEN_VIEW_CALL_WITHOUT_LINKS
;	call	ObjMessage
;
	
MSG_GEN_VIEW_SET_ORIGIN_LOW		message
;
; Low level scroll message; like MSG_GEN_VIEW_SET_ORIGIN except no normalizing
; or propagation to links will be done by the view.
;
; Context:	Encapsulated in a MSG_GEN_VIEW_SEND_TO_LINKS message by
;		the common scroll code.  This is the message which is sent
;		to any of the linked views.  Can also be sent by apps that
;		don't wish to have normalizing or propagation to links.
; Source:	No restrictions, usually dispatched by the MSG_GEN_VIEW_-
;		SEND_TO_H/VLINK handler.
; Destination:	Any GenView
; Interception:	Not likely
;
; Pass:		ss:bp -- {PointDWord} new absolute scroll offset
;		dx    -- size PointDWord
; Return:	nothing
;		ax, cx, dx, bp -- destroyed
;
GVSOL_NO_CHANGE	equ	8000000h		;passed for no change in a
						;   given direction

MSG_GEN_VIEW_SET_INK_TYPE	message
;
; Set the ink type for a view	
;
; Context: 	basic gen view functions
; Source: 	no restrictions
; Destination:	a GenView object
; Interception: not typically intercepted
;
; Pass: 	CL - GenViewInkType
; Return: 	nothing
; 		ax, cx, dx, bp - destroyed

MSG_GEN_VIEW_SET_EXTENDED_INK_TYPE	message
;
; Set the extended ink information for the view. This data includes what color
; to make the data, etc)	
;
; Context: 	basic gen view functions
; Source: 	no restrictions
; Destination:	a GenView object
; Interception: not typically intercepted
;
; Pass: ss:bp - ptr to InkDestinationInfoParams
; Return: nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_RESET_EXTENDED_INK_TYPE	message
;
; Reset the extended ink information for the view to the default
;
; Context: 	basic gen view functions
; Source: 	no restrictions
; Destination:	a GenView object
; Interception: not typically intercepted
;
; Pass: nothing
; Return: nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_VIEW_SEND_NOTIFICATION		message
;
; Mainly internal message to send notification to the controller if needed
;
; Context: 	Part of the GenViewControl mechanism
; Source: 	no restrictions
; Destination:	a GenView object
; Interception: not typically intercepted
;
; Pass:
;	none
; Return:
;	none
;	ax, cx, dx, bp - destroyed

MSG_GEN_VIEW_SCALE_LOW				message

; Low level routine for scaling.  This is the message sent to linked views.

; Context:	the GenView's scaling mechanism
; Source:	Normally internal
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		ss:[bp]  -- ScaleViewParams
;		dx       -- size ScaleViewParams
; Return:	none
;		ax, cx, dx, bp -- destroyed

MSG_GEN_VIEW_REDRAW_CONTENT			message

; Simple routine for redrawing the content.  Used mainly by the GenViewControl.

; Context:	None
; Source:	Usually GenViewControl
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		none
; Return:	none
;		ax, cx, dx, bp -- destroyed

MSG_GEN_VIEW_SET_CONTROLLED_ATTRS		message

; Set the controlled attributes of the view

; Context:	None
; Source:	Usually GenViewControl
; Destination:  a GenView object
; Interception: not typically intercepted
;
; Pass:		cx - GenViewControlAttrs
;		dx - scale factor
; Return:	none
;		ax, cx, dx, bp -- destroyed

;------------------------------------------------------------------------
;	Imported methods sent to the output descriptor.
;------------------------------------------------------------------------

;MSG_META_CONTENT_SET_VIEW		message	MetaUIMessages
;MSG_META_CONTENT_VIEW_OPENING		message	MetaUIMessages
;MSG_META_CONTENT_VIEW_CLOSING		message	MetaUIMessages
;MSG_META_CONTENT_VIEW_WIN_OPENED	message	MetaUIMessages
;MSG_META_CONTENT_VIEW_WIN_CLOSED	message	MetaUIMessages
;MSG_META_CONTENT_VIEW_ORIGIN_CHANGED	message	MetaUIMessages
;
; see documentation in ui.def
;

OriginChangedParams struct
	OCP_origin	PointDWord		;new origin
	OCP_window	hptr.Window		;window of view
OriginChangedParams end

;MSG_META_CONTENT_VIEW_SCALE_FACTOR_CHANGED	message	MetaUIMessages
;
; see documentation in ui.def
;

ScaleChangedParams struct
	SCP_scaleFactor		PointWWFixed	;new scale factor
	SCP_window		lptr Window		;window of view
ScaleChangedParams end

;MSG_META_CONTENT_VIEW_SIZE_CHANGED	message	MetaUIMessages
;MSG_META_CONTENT_TRACK_SCROLLING	message	MetaUIMessages
;
; see documentation in ui.def
;

ScrollAction etype byte
SA_NOTHING 	enum ScrollAction	;does nothing
SA_TO_BEGINNING enum ScrollAction	;going to beginning of window
SA_PAGE_BACK 	enum ScrollAction	;going up a page
SA_INC_BACK 	enum ScrollAction	;going up a small amount
SA_INC_FWD 	enum ScrollAction	;going down a small amount
SA_DRAGGING 	enum ScrollAction	;dragging
SA_PAGE_FWD 	enum ScrollAction	;going down a small amount
SA_TO_END 	enum ScrollAction	;going to end of window
SA_SCROLL	enum ScrollAction	;generic scroll method called
SA_SCROLL_INTO	enum ScrollAction	;someone called "scroll into" to keep a
					;  point onscreen
SA_INITIAL_POS	enum ScrollAction	;initial scrolling position.  Output
					;  object will receive relative
					;  scroll values equal to the initial
					;  origin.
SA_SCALE	enum ScrollAction	;we're scaling.  There may or may not
					;  be a change in scroll in scroll
					;  position, but certainly the subview
					;  size will have changed.
SA_PAN		enum ScrollAction	;panning. Otherwise exactly like
					;  SA_SCROLL.
SA_DRAG_SCROLL enum ScrollAction	;select-scrolling. Otherwise exactly
		 			;  like SA_SCROLL.
SA_SCROLL_FOR_SIZE_CHANGE enum ScrollAction
					;any scrolling that's required as a
					;  result of the view size change
;
; Direction scroll is occuring, if applicable.
;
ScrollFlags record
	;
	; Keep these in the high bits or pain and suffering will be yours.
	;
	SF_VERTICAL:1
		;Direction of scroll.  Invalid for SA_SCROLL_INTO, SA_SCROLL,
		;SA_INITIAL_POS, SA_SCROLL_FOR_SIZE_CHANGE, SA_DRAG_SCROLL,
		;and SA_SCALE.
	SF_ABSOLUTE:1
		;Whether the scroll is to an absolute position.  Set for
		;SA_TO_BEGINNING, SA_TO_END, SA_INITIAL_POS, SA_SCROLL_INTO,
		;SA_DRAGGING, and some SA_SCROLLs.
	SF_DOC_SIZE_CHANGE:1
		;This scroll is happening as an adjustment for a document
		;size change.  The specific UI uses this to finish changing
		;the document size after the tracking is complete.
	SF_WINDOW_NOT_SUSPENDED:1
		;An internal flag that the view uses to know whether to 
		;unsuspend the view window after the track scrolling arguments
		;are returned by the view output.  Usually the view window is
		;is suspended beforehand, but not if the window hasn't been
		;opened yet.
	SF_SCALE_TO_FIT:1
		;Set if the view is in scale to fit mode (which often causes
		;content to alter its scrolling behavior)
	SF_SETUP_HAPPENED:1
		;PRIVATE.  Set if the view is able to set up track scrolling
		;arguments properly.   If they are not (i.e. the view is not
		;fully onscreen yet) the track scrolling arguments will 
		;ultimately be ignored.
	SF_EC_SETUP_CALLED:1
		;Used in error checking code to ensure that an object handling 
		;MSG_META_CONTENT_TRACK_SCROLLING either calls MSG_GEN_VIEW_-
		;SETUP_TRACK_SCROLLING_ARGS (in C) or calls GenViewSetupTrack-	
		;ingArgs before returning the tracking arguments.
	SF_KBD_RELATED_SCROLL:1
		;In 2.1+ systems, this flag will be set if a scroll was directly
		;the result of a key press from the user (i.e. page up/downs).
		;In pre 2.1+ systems, this flag will always be clear regardless.

ScrollFlags end


TrackScrollingParams	struct
	TSP_action		ScrollAction	;action taking place.  Drags
						;don't require the return
						;message; in fact, return methods
						;will be ignored for drags.

	TSP_flags		ScrollFlags     ;scroll flags

	TSP_caller		optr 		;object to return args to

;
; Only one set of these are sent via a MSG_META_CONTENT_TRACK_SCROLLING.  The
; relative values (xChange, yChange) are sent on the relative scrolls --
; SA_SCROLL, SA_INC_FWD, SA_INC_BACK, SA_PAGE_FWD, SA_PAGE_BACK, SA_PAN.  The
; absolute values (newOriginX, newOriginY) are sent on the absolute scrolls.
; To play it safe, your handler should call GenSetupTrackingArgs, which will
; fill in all of these.
;
	TSP_change		PointDWord	;proposed change
	TSP_newOrigin		PointDWord	;proposed new origin

;
; These arguments are NOT sent via MSG_META_CONTENT_TRACK_SCROLLING.  If you want
; to have these (and you probably will), your handler should call GenSetup-
; TrackingArgs, which will fill in all of these.
;
	TSP_oldOrigin		PointDWord	;old origin
	TSP_viewWidth		sword		;view width
	TSP_viewHeight		sword		;view height
TrackScrollingParams	ends

;MSG_META_CONTENT_VIEW_LOST_GADGET_EXCL	message	MetaUIMessages
;MSG_META_CONTENT_NAVIGATION_QUERY message MetaUIMessages
;MSG_META_CONTENT_APPLY_DEFAULT_FOCUS message MetaUIMessages
;
; see documentation in ui.def
;

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

HINT_VIEW_LEAVE_ROOM_FOR_VERT_SCROLLER	vardata
HINT_VIEW_LEAVE_ROOM_FOR_HORIZ_SCROLLER	vardata
; These hints will cause a view to leave room for a horizontal or vertical
; scroller even if the scroller isn't going to exist.  This will sometimes
; be done automatically by the splitter mechanism, but this left as a way to
; turn this on automatically.  
;

InkDestinationInfoParams	struct
	IDIP_dest		optr
	IDIP_brushSize		word
	; These are the same as the args passed to
	;  UserCreateInkDestinationInfo()     

	IDIP_color		Color
	IDIP_reserved1		byte		;Padding for C stuff
	IDIP_createGState	byte
	IDIP_reserved2		byte		;Padding for C stuff
InkDestinationInfoParams	ends

ATTR_GEN_VIEW_INK_DESTINATION_INFO		vardata	InkDestinationInfoParams
; This is used to store info for what presses should be turned into. It is
; basically an optimization so the UI doesn't have to query the app thread
; to pass ink along.

ATTR_GEN_VIEW_PAGE_SIZE				vardata	XYSize

ATTR_GEN_VIEW_SCALE_TO_FIT_BASED_ON_X		vardata

ATTR_GEN_VIEW_SCALE_TO_FIT_BOTH_DIMENSIONS	vardata

ATTR_GEN_VIEW_DO_NOT_WIN_SCROLL			vardata
; If this is set, the view will not perform a WinScroll on its window in
; response to changes in its origin.  The content will still receive a 
; MSG_META_CONTENT_VIEW_ORIGIN_CHANGED, so it can do whatever it wants
; in response to this message.
; 

HINT_VIEW_IMMEDIATE_DRAG_UPDATES	vardata
; If available in the specific UI, causes view to be updated constantly during
; drags.  In Motif, this is available for flexibility but not recommended, as 
; it goes against the motif specification and may be confusing to the user.

HINT_VIEW_DELAYED_DRAG_UPDATES	vardata
; If available in the specific UI, causes view to be updated only at the end of
; drags.  This is default behavior in motif.

HINT_VIEW_REMOVE_SCROLLERS_WHEN_NOT_SCROLLABLE	vardata
; If available in the specific UI, causes view to remove its scrollers in
; favor of more view window area when the scrollbar is not needed, i.e. the
; entire content is being displayed in that direction.  

HINT_VIEW_SHOW_SCROLLERS_WHEN_NOT_SCROLLABLE	vardata
; If available in the specific UI, causes view to show its scrollers even
; when the scrollbar is not needed, i.e. the entire content is being displayed 
; in that direction.    This is default behavior in most specific UI's.

;Note -- these are NOT currently implemented!

HINT_VIEW_SHARES_SPACE_WITH_VIEW_ABOVE		vardata optr
; Refers to a view object that this object can share vertical real estate with.
; Suggests that a gadget be placed between the two views to share available 
; space between this view and the other view.  Assumes that the other view is 
; appropriately placed in the generic tree (i.e. appears before this view in a 
; vertical composite).   This can also be used for applications with views
; that split -- the other view can start out not usable; when the user picks up
; the gadget, the other view will automatically become usable.

HINT_VIEW_SHARES_SPACE_WITH_VIEW_BELOW		vardata optr
; Refers to a view object that this object can share vertical real estate with.
; Suggests that a gadget be placed between the two views to share available 
; space between this view and the other view.  Assumes that the other view is 
; appropriately placed in the generic tree (i.e. appears before this view in a 
; vertical composite).
; 

HINT_VIEW_SHARES_SPACE_WITH_VIEW_TO_LEFT		vardata optr
; Refers to a view object that this object can share horizontal real estate 
; with. Suggests that a gadget be placed between the two views to share 
; available space between this view and the other view.  Assumes that the other
; view is appropriately placed in the generic tree (i.e. whose tree appears 
; before this view's tree in a common horizontal composite).

HINT_VIEW_SHARES_SPACE_WITH_VIEW_TO_RIGHT		vardata optr
; Refers to a view object that this object can share horizontal real estate 
; with. Suggests that a gadget be placed between the two views to share 
; available space between this view and the other view.  Assumes that the other
; view is appropriately placed in the generic tree (i.e. whose tree appears 
; after this view's tree in a common horizontal composite).

ATTR_GEN_VIEW_DOES_NOT_ACCEPT_TEXT_INPUT			vardata 
;
; If this is placed on a focusable GenView object, that object will not
; cause a floating keyboard to come up. This is used for objects (like
; scrollable text objects) that want to get keystrokes for scrolling
; the view, but that do not want a kbd for general text input.
;

ATTR_GEN_VIEW_NOTIFY_EVEN_IF_NOT_TARGETED		vardata
;
; This attribute causes the GenView object to send out notificiations
; to controllers even when it doesn't have the target.
;

;------------------------------------------------------------------------------
;	Instance data constants, records, etc.
;------------------------------------------------------------------------------

;
;	Generic enumerated constants for the view size (distinguished from
;	normal pixel values by the high bit)

ViewSize etype word, 8000h
VS_TYPICAL 	enum ViewSize	;choose size typical of the specific UI
VS_SMALL 	enum ViewSize	;choose a small size
VS_LARGE 	enum ViewSize	;choose a large size


; Clarification of GenAttributes usage for GenView:
;
;	GA_TARGETABLE:1
;		May be set for non-generic contents only.
; 		Set if view contains application data which should appear
;		to the user as a possible target in the "select then operate"
;		paradigm.  If this attribute is set, the contents will receive
;		MSG_META_GAINED_TARGET_EXCL & MSG_META_LOST_TARGET_EXCL, to
;		indicate when they should display any active selection area
;		outside of having the input focus.
;


;
; Generic non-dimensional view attributes

GenViewAttrs record

;------------------------------------------------------------------------------
;	General View Attributes
;------------------------------------------------------------------------------

	GVA_CONTROLLED:1
;		Set if the view is connected to a controller object and
;		therefore should send out notification as appropriate and
;		should add itsself to the appropriate GCN list.
;
	GVA_GENERIC_CONTENTS:1
;		Set if content is a GenContentClass object.  If this
;		bit is set, the mouse grab mode & ptr event sending mode is
;		set by the specific UI, overriding whatever is passed in
;		the instance data.  Other generic messages (such as MSG_SPEC_
;		SPEC_BUILD_BRANCH) will be sent to the content as appropriate.
;
	GVA_TRACK_SCROLLING:1
; 		Send any scrolling events to the content, so it can control
;		more carefully where scrolling leaves the document origin.
;		See above documentation of this topic, and
;		MSG_META_CONTENT_TRACK_SCROLLING for more info.
;
	GVA_DRAG_SCROLLING:1
; 		if the user presses select and drags out of a subview window,
;		the window will scroll appropriately.  Operates independently
;		of the objects in the window - no special handling by the
;		output objects should be needed.
;
	GVA_NO_WIN_FRAME:1
; 		Don't draw a frame around the subview window.
;
	GVA_SAME_COLOR_AS_PARENT_WIN:1
; 		Make port window color be the same as its parent.  Should
;		nearly always be set if GVA_GENERIC_CONTENTS is set, so the
;		generic objects appear correctly underneath the view!
;
	GVA_VIEW_FOLLOWS_CONTENT_GEOMETRY:1
;		Set if the view, in a non-scrollable direction, should
;		follow the size of the content.  Content object must be running
;		in the same thread as the view, so that MSG_VIS_RECALC_SIZE can
;		be called on the content.


;------------------------------------------------------------------------------
;	Attributes that may be used when GVA_GENERIC_CONTENTS is not set.
;------------------------------------------------------------------------------

	GVA_WINDOW_COORDINATE_MOUSE_EVENTS:1
;		This bit results in mouse events being sent in window
;		coordinates instead of document coordinates, that is, as
;		the offset of the mouse in screen pixels from the upper left
; 		hand corner of the view. This bit may be used transparently
;		in conjunction with a VisContentClass content, by setting
;		VCNA_WINDOW_COORDINATE_MOUSE_EVENTS in the VisContent.
;		This arrangement allows the VisContent to provide both
;		32-bit & fractional mouse data to visible objects within the
;		content.
;
;		Alternatively, if the content is a process, then the process
;		is responsible for converting incoming mouse data back into
;		document coordinates.  This may be done by storing the current
;		document origin & scale factor as sent out by the View, &
;		then using the equation:
;
;	        Document location = (View Window Coordinate/Scale Factor)
;								+ View Origin
;
;		View Window Coordinate
;				- coordinate value passed in 16-bit
;				  mouse event when GVA_WINDOW_COORDINATE_MOUSE_
;				  EVENTS is set in the GenView.
;
;		Scale Factor	- current view scale factor, as sent to process
;				  in MSG_META_CONTENT_VIEW_SCALE_FACTOR_CHANGED
;
;		View Origin	- location in document that currently appears
;				  at upper left corner of the view window, as
;				  sent to process in MSG_META_CONTENT_VIEW_ORIGIN_
;				  CHANGED.
;
;
;		NOTE:  If GVI_docBounds lie outside of the 16-bit graphis space,
;		then this flag MUST be used, since standard mouse events
;		cannot pass 32-bit document positions.
;
	GVA_DONT_SEND_PTR_EVENTS:1
; 		Optimization to avoid sending PTR events to the application,
;		if not needed

	GVA_DONT_SEND_KBD_RELEASES:1
;		Optimization to avoid sending keyboard releases to the
;		application.
;
	GVA_SEND_ALL_KBD_CHARS:1
;		This is provided for apps to force all key presses to go to the
;		content (if it has the focus), regardless of what they are.  
;		Usually the view will check first for mnemonics, accelerators,
;		or other special specific UI keys, and will not pass the key
;		press down if it gets handled by the UI in one of these ways.
;		If applications set this flag, it is their responsibility
;		in their MSG_META_KBD_CHAR handler to return a MSG_FUP_KBD_CHAR
;		back to the view so it can finish the keyboard handling.
;		Also, applications (like geoWrite) that intermix keypresses
;		and other functions (such as changing the font or style)
;		may have problems getting these messages in the correct order
;		if the keypress has to go across threads to the content first,
;		then back to the UI to check for accelerators.  For this reason,
;		a lot of apps may not want to use this flag.  Another thing this
;		flag allows is for oddball keyboard characters to be allowed as
;		accelerators in generic objects.  Usually, only ctrl
;		characters and a few others are acceptable as accelerators.
;	
;		In summary, the differences between each approach:
;		SEND_ALL_KBD_CHARS=0:		SEND_ALL_KBD_CHARS=1:
;		  GenView gets key press,	  GenView gets key press,
;		  Checks ctrl chars for accels	  Sends to content.
;		     and other spec-UI stuff.	  Check *all* chars FUPPED back
;		  If char not used in these ways,    by content for accelerators
;		     Send to content.		     and other spec-UI stuff.
;
	GVA_FOCUSABLE:1
;		If set, indicates the view is allowed to have the focus.
;		Set by default upon instantiation or declaration in UIC,
;		generally cleared only for custom gadgets which should not
;		be able to be navigated to from the keyboard.

	GVA_SCALE_TO_FIT:1
;		If set then the view operates in "scale to fit" mode.  In
;		this mode the Y scale factor will be adjusted so that the
;		entire document fits in the view, and the X scale factor
;		will be adjusted accordingly.  This behavior can be modified
;		by either giving a page size (via ATTR_GEN_VIEW_PAGE_SIZE) to
;		scale into the view or by specifying that the document should
;		fit entirely in X with the Y scale factor following (via
;		ATTR_GEN_VIEW_SCALE_TO_FIT_BASED_ON_X or that both the document
;		should fit in both X and Y (via
;		ATTR_GEN_VIEW_SCALE_TO_FIT_BOTH_DIMENSIONS)

	GVA_ADJUST_FOR_ASPECT_RATIO:1
;		If set then scaling is adjusted to match the aspect ratio
;		of the screen

	:2

GenViewAttrs end

;
; Generic dimensional view attributes

GenViewDimensionAttrs 	record
	GVDA_SCROLLABLE:1
;		Set if view is scrollable in the given dimension.  If not
;		set, the view will force itself to be as big as its document
;		size, so that nothing is obscured.
;
	GVDA_SPLITTABLE:1
;		Set if view is splittable in the given dimension.  (Note that
; 		splitting is not yet supported, but should be for the 2.0
; 		release)
;
	GVDA_TAIL_ORIENTED:1
;		Set if the document prefers to be displayed at end.  The port
;		will scroll to stay at the bottom of the document when you
;		resize or change the document length, but only if you are
;		currently at the bottom.  If you move to the top or middle of
;		the document no scrolling will be done.  Currently, tail
;		orientation does not work across threads -- if you want to do
; 		this, you can try doing it via a tracking.
;
	GVDA_DONT_DISPLAY_SCROLLBAR:1
;		Don't show scroller in this direction, even if we're
;		scrollable.  (Will be going away soon.)
;
	GVDA_NO_LARGER_THAN_CONTENT:1
;		If set the view will not get larger than is needed to fit
;		the content in this direction, based on the current value of 
;		GVI_docBounds. By default there are no restrictions on the 
;		size of the view.
;
	GVDA_NO_SMALLER_THAN_CONTENT:1
;		If set the view will stay large enough to display the entire
;		content in this direction, based on the current value of 
;		GVI_docBounds.  By default there are no restrictions on the 
;		size of the view.
;
	GVDA_SIZE_A_MULTIPLE_OF_INCREMENT:1
;		Set if we want to truncate the view window's size in this
;		direction to a multiple of the increment amount in this
;		direction.  Subclass MSG_GEN_VIEW_CALC_WIN_SIZE if you
;		need finer adjustments of the view window size.
;
	GVDA_KEEP_ASPECT_RATIO:1
;		Set if we want to keep the aspect ratio of
;		the port windows the same as they are in the open size.
;		If set in vertAttrs, then we'll keep the width and use the
;		ratio to calculate the height;  and vice versa for horizAttrs.
;
GenViewDimensionAttrs	end

GenViewInkType	etype	byte
	GVIT_PRESSES_ARE_NOT_INK		enum	GenViewInkType
	; The output of the view cannot handle ink

	;If you are using the large document model, you should subclass
	; the MSG_NOTIFY_DATA_GROUP w/GWNT_INK method on the VisContent
	; attached to the view if you don't want them just sent to the
	; target/first child
	;

	GVIT_INK_WITH_STANDARD_OVERRIDE	enum	GenViewInkType
	; The output of the view wants ink, but the user can override
	; it by holding the mouse down for some user-specified amount 
	; of time before moving the mouse. 

	GVIT_PRESSES_ARE_INK			enum	GenViewInkType
	; The output of the view wants ink

	;NOTE: If you use the following value, you must handle
	; MSG_META_QUERY_IF_PRESS_IS_INK. Note also that a MSG_NOTIFY_DATA_GROUP
	; w/GWNT_INK can come even if no MSG_META_QUERY_IF_PRESS_IS_INK has been
	; received, if the user starts drawing just outside of the view, but
	; then draws inside the view.

	GVIT_QUERY_OUTPUT			enum	GenViewInkType
	; The output of the view only wants presses to be ink under certain
	; conditions - a MSG_META_QUERY_IF_PRESS_IS_INK is sent to the output.

;------------------------------------------------------------------------------
;	Instance data
;------------------------------------------------------------------------------

	; NOTE: The ordering of instance data is relied on in the
	;       NotifyViewStateChange structure in GenViewControlClass

    GVI_origin			PointDWFixed		;originX, originY
;    		The current origin of the view.  Can be set via several
;		messages, including MSG_GEN_VIEW_SET_ORIGIN and
;		MSG_GEN_VIEW_SCROLL.    The origin values are sdwords.
;		The reason that fixed point coordinates are stored here, even
;		though only integer coordinates are passed, is so the 
;		view can (internally) deal with the rounding errors in the
;		Window system, which scrolls by integer pixel amounts (which
;		may translate into fixed point document amounts).
;
    GVI_docBounds	RectDWord	<0, 0, 0, 0>
;		The current scrollable document bounds.  Typically the
;		left and top are zero, but can be negative as well.  It's
;		the area of the document that the view is allowed to scroll
;		around in.  All four coordinates are sdwords.  These can
;		be set with MSG_
;
    GVI_increment	PointDWord <20, 15>
;		The current x and y increments.  The amount scrolled either
;		negatively or positively when you press on the up or down
;		arrows of a scroller.  These are dword values and can be
;		changed via MSG_GEN_VIEW_SET_INCREMENT and MSG_GEN_VIEW_
;		GET_INCREMENT.  They cannot be negative.
;
    GVI_scaleFactor	PointWWFixed <<0, 1>, <0, 1>>
;		The current scale factors for the view.  The view window
;		is scaled according to these values.  MSG_GEN_VIEW_SET_SCALE_
;		FACTOR will set these, MSG_GEN_VIEW_GET_SCALE_FACTOR will return
;		the current values.  These are expressed as WWFixed values.
;
    GVI_color		ColorQuad <C_WHITE, 0, 0, 0>
;		The current background color for the view window.  This can
;		be expressed as a color index or RGB_value and can be translated
;		to a pattern in B/W systems or white.  Can be set via
;		MSG_GEN_VIEW_SET_COLOR and returned via MSG_GEN_VIEW_
;		GET_BG_COLOR.
;
    GVI_attrs		GenViewAttrs (mask GVA_FOCUSABLE)
;		Various attributes for the view.  These can be set with
;		MSG_GEN_VIEW_SET_ATTRS and returned via MSG_GEN_VIEW_
;		GET_ATTRS.
;
    GVI_horizAttrs		GenViewDimensionAttrs	0
    GVI_vertAttrs		GenViewDimensionAttrs	0
;    		Attributes that can be set individually for vertical and
;		horizontal.  These can be set via MSG_GEN_VIEW_SET_DIMENSION_
;		ATTRS and returned via MSG_GEN_VIEW_GET_DIMENSION_ATTRS.
;

    GVI_inkType		GenViewInkType
;		This piece of instance data determines whether or not presses
;		in the view should be always treated as ink, never treated as
;		ink or whether the output should be queried.
;

    GVI_content			optr			
;		The content object.  All the view's and window's output goes
;		to this object.  This object should either be a process,
;		VisContent, or GenContent.  See the discussion
;		of view output objects for more info.  This can be set via
;		MSG_GEN_VIEW_SET_CONTENT and returned vis MSG_GEN_VIEW_
;		GET_CONTENT.
;
    GVI_horizLink		optr
    GVI_vertLink		optr
;		These are links to other related views.  Views linked vertically
;		will be scrolled together horizontally; views linked
;		horizontally will be scrolled together vertically.  Links should
;		be circular, (e.g. View1->View2->View3->View1).
		
GenViewClass	endc

EndLibrary	ui
