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

	Copyright (c) GeoWorks 1991 -- All Rights Reserved

PROJECT:	PC GEOS
MODULE:		Include/Objects
FILE:		uiInputC.def

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	doug	4/92		Initial version

DESCRIPTION:
	Input, input flow messages defined by the UI library in the MetaClass
	range.  Messages are documented here, but actual declaration is
	in ui.def, only to ensure consistent number of these messages among
	all MetaUIMessages.

	$Id: uiInputC.def,v 1.1 97/04/04 14:18:22 newdeal Exp $

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

SetDef	__UIINPUTC

StartLibrary	ui

;------------------------------------------------------------------------------
; Mouse/Kbd/Pressure/Direction Gained/Lost messages
;------------------------------------------------------------------------------

;MSG_META_GAINED_MOUSE_EXCL	message	MetaUIMessages
;MSG_META_LOST_MOUSE_EXCL	message	MetaUIMessages
;MSG_META_GAINED_KBD_EXCL	message	MetaUIMessages
;MSG_META_LOST_KBD_EXCL	message	MetaUIMessages
;MSG_META_GAINED_PRESSURE_EXCL	message	MetaUIMessages
;MSG_META_LOST_PRESSURE_EXCL	message	MetaUIMessages
;MSG_META_GAINED_DIRECTION_EXCL	message	MetaUIMessages
;MSG_META_LOST_DIRECTION_EXCL	message	MetaUIMessages
;
; see documentation in ui.def
;

;------------------------------------------------------------------------------
; Focus/Target/Model
;------------------------------------------------------------------------------

;MSG_META_GRAB_FOCUS_EXCL	message	MetaUIMessages

;MSG_META_RELEASE_FOCUS_EXCL	message	MetaUIMessages
;MSG_META_GET_FOCUS_EXCL	message	MetaUIMessages
;MSG_META_GRAB_TARGET_EXCL	message	MetaUIMessages
;MSG_META_RELEASE_TARGET_EXCL	message	MetaUIMessages
;MSG_META_GET_TARGET_EXCL	message	MetaUIMessages
;MSG_META_GRAB_MODEL_EXCL	message	MetaUIMessages
;MSG_META_RELEASE_MODEL_EXCL	message	MetaUIMessages
;MSG_META_GET_MODEL_EXCL	message	MetaUIMessages
;MSG_META_RELEASE_FTVMC_EXCL	message	MetaUIMessages
;MSG_META_MUP_ALTER_FTVMC_EXCL	message	MetaUIMessages
;
; see documentation in ui.def
;

MetaAlterFTVMCExclFlags	record
	MAEF_NOT_HERE:1
	; OVERRIDES all other flags!
	; Set if this request should NOT be honored here, but instead
	; sent on up the hierarchy with this bit cleared.  This bit
	; exists for two reasons:
	;	1) So that nodes can tell the difference between messages
	; 	   coming up from objects below & those requests which it has
	; 	   made for itself, which should be handled by the next node up.
	;	2) Thus allowing MSG_META_MUP_ALTER_FTVMC_EXCL to be sent to
	;	   the object making the requist itself, thereby allowing
	;	   nodes the freedom to direct the message in directions other
	;	   than the visual hierarchy, if the next node is not in that
	;	   direction.

	MAEF_SYS_EXCL:1
	; Not passed, but this bit as stored in a HierarchicalGrab
	; structure indicates whether the object has a system-wide exclusive
	; NOTE:  MUST BE IN SAME BIT SLOT AS HGF_SYS_EXCL!

	MAEF_APP_EXCL:1
	; Not passed, but this bit as stored in a HierarchicalGrab
	; structure indicates whether the object has an applications-wide
	; exclusive
	; NOTE:  MUST BE IN SAME BIT SLOT AS HGF_APP_EXCL!

	MAEF_GRAB:1
	; Set to force grab exclusive, clear to release it.
	; NOTE:  MUST BE IN SAME BIT SLOT AS HGF_GRAB!

	MAEF_FOCUS:1
	; Set to grab/release focus.

	MAEF_TARGET:1
	; Set to grab/release target

	MAEF_MODEL:1
	; Set to grab/release model

	MAEF_FULL_SCREEN:1
	; Set to grab/release full screen exclusive

	:5

	MAEF_MODAL:1
	; Meaningful for FOCUS GRAB only -- set if object requesting grab is a
	; modal dialog, or a derivative window that happens to have the same
	; focus node above it as the modal dialog (such as a popup menu).
	; If this bit is clear, but the application/field/system etc. is in a
	; modal state, the requesting object's optr will be saved away, but
	; not granted the focus, until the current modal state within that
	; focus node has been completed.

	MAEF_OD_IS_WINDOW:1
	; Meaningful for FOCUS GRAB only -- whether object is a windowed object
	; or not.

	MAEF_OD_IS_MENU_RELATED:1
	; Meaningful for FOCUS GRAB only -- whether object is a specific UI
	; menu-related object


MetaAlterFTVMCExclFlags	end

MAEF_MASK_OF_ALL_HIERARCHIES equ	mask MAEF_FOCUS or mask MAEF_TARGET or \
					mask MAEF_MODEL or mask MAEF_FULL_SCREEN

;MSG_META_GAINED_FOCUS_EXCL	message	MetaUIMessages
;MSG_META_LOST_FOCUS_EXCL	message	MetaUIMessages
;MSG_META_GAINED_TARGET_EXCL	message	MetaUIMessages
;MSG_META_LOST_TARGET_EXCL	message	MetaUIMessages
;MSG_META_GAINED_MODEL_EXCL	message	MetaUIMessages
;MSG_META_LOST_MODEL_EXCL	message	MetaUIMessages
;MSG_META_GAINED_FULL_SCREEN_EXCL	message	MetaUIMessages
;MSG_META_LOST_FULL_SCREEN_EXCL	message	MetaUIMessages
;	All asserts moved to ui.def, since these messages
;	are only defined there, and we don't want to include
;	the entire ui.def file just to deal with UI characters
;	in keyboard drivers.
;				-- todd 12/17/94

;
; see documentation in ui.def
;

;------------------------------------------------------------------------------
; Default Gained/Lost messages
;------------------------------------------------------------------------------

;MSG_META_GAINED_DEFAULT_EXCL	message	MetaUIMessages
;MSG_META_LOST_DEFAULT_EXCL	message	MetaUIMessages
;
; see documentation in ui.def
;

;------------------------------------------------------------------------------
;	MISC METHODS
;------------------------------------------------------------------------------

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


;------------------------------------------------------------------------------
;	KEYBOARD METHODS
;------------------------------------------------------------------------------

;MSG_META_FUP_KBD_CHAR	message	MetaUIMessages
;MSG_META_PRE_PASSIVE_KBD_CHAR	message	MetaUIMessages
;MSG_META_POST_PASSIVE_KBD_CHAR	message	MetaUIMessages

;
; KbdReturnFlags - flags to be returned in ax by all MSG_PASSIVE_KBD_CHAR
; messages
;
KbdReturnFlags	record	KRF_PREVENT_PASS_THROUGH:1, KRF_UNUSED:15
;
; KRF_PREVENT_PASS_THROUGH
;		- set for PASSIVE keyboard routines if event should be 
; 		  destroyed & not passed on to implied/default grab

;-------------------------------------------------
;		Ink/Pen support methods
;-------------------------------------------------

;MSG_META_QUERY_IF_PRESS_IS_INK	message	MetaUIMessages
;MSG_META_LARGE_QUERY_IF_PRESS_IS_INK	message	MetaUIMessages
;
; see documentation in ui.def
;

	; About the InkDestinationInfo structure:
	;	
	; This is used by objects to force a destination for the ink
	; (this forces the ink to go to an object if the initial click was
	;  in the object).
	;
	; This is also used by the Ink object to keep from having to redraw
	; the ink. The ink that is collected is drawn through the returned
	; gstate to clip it to the bounds of the ink. The gstate that is
	; returned will be destroyed by the IM thread.

InkDestinationInfo	struct
	IDI_destObj	optr
	; This is the object that the ink should be sent to.

	IDI_gstate	hptr.GState
	; A gstate to draw through (this is optional, and can be set to 0 if
	; ink can go all over the screen)

	IDI_brushSize	word
	; The width/height parameter of the ink lines (see GrBrushPolyline).
	; (use 0 for default)

	IDI_gestureCallback	dword
	; The virtual far pointer to the callback routine. The callback
	; routine params are the following:
	;
	;	Passed on the stack (Pascal calling type):
	;
	;		fptr	arrayOfInkPoints
	;		word	numPoints	;contains num of points
	;		word	GestureCallbackFlags;The # strokes entered by
	;					; the user. If you only support
	;					; single-stroke gestures, you
	;					; can check this to quickly 
	;					; exit if the user has entered
	;					; a bunch of strokes.
	;
	;	Returns:
	;		AX - Non-zero if the ink is a gesture
	;
InkDestinationInfo	ends

InkReturnValue	etype	word
	IRV_NO_REPLY				enum InkReturnValue, 0
	; VisComp objects use VisCallChildUnderPoint to send
	; MSG_META_QUERY_IF_PRESS_IS_INK to its children, and
	; VisCallChildUnderPoint returns this value (0) if there was not
	; child under the point. No object should actually return this
	; value.

	IRV_NO_INK				enum InkReturnValue
	; Return this if the object wants the START_SELECT to be
	; passed on to it.

	IRV_INK_WITH_STANDARD_OVERRIDE		enum InkReturnValue
	; Return this if the object normally wants ink (the text object
	; does this), but the user can force mouse events instead by
	; pressing the pen and holding for some user-adjustable amount of
	; time).

	IRV_DESIRES_INK				enum InkReturnValue
	; Return this if the object does not want the START_SELECT (it
	; should be captured as ink).

	IRV_WAIT				enum InkReturnValue
	; This should be the last item in the enumerated type for EC reasons.
	;
	; Return this value if the object under the point is run by a
	; different thread, and you want to hold up input (don't do 
	; anything with the START_SELECT) until an object sends a
	; MSG_GEN_APPLICATION_INK_QUERY_REPLY to the application object.


;------------------------------------------------------------------------------
;	PTR METHODS
;------------------------------------------------------------------------------

;
;	MSG_META_PTR is modified by the flow object & sent on to the implied/
; active mouse grab.  There is no PASSIVE equivalent.
; See file Spec/User/button.doc for more details.
;
; Pass:
;		cx	- X position of mouse, in document coordinates of
;			  receiving object
;		dx	- Y position of mouse, in document coordinates of
;			  receiving object
;
;		bp low  - ButtonInfo		(In Include/mouse.def)
;			  mask BI_PRESS		- set if press
;			  mask BI_DOUBLE_PRESS	- set if double-press
;			  mask BI_B3_DOWN	- state of button 3
;			  mask BI_B2_DOWN	- state of button 2
;			  mask BI_B1_DOWN	- state of button 1
;			  mask BI_B0_DOWN	- state of button 0
;
;		bp high - UIFunctionsActive	(In this file)
;
; Return:
;		ax	- MouseReturnFlags	(In this file)
; 			  mask MRF_PROCESSED - if event processed by gadget.
;					       See def. below.
;
; 			  mask MRF_REPLAY    - causes a replay of the ptr
;					       to the modified implied/active
;					       grab.   See def. below.
;
;			  mask MRF_SET_POINTER_IMAGE - sets the PIL_GADGET
;			  level cursor based on the value of cx:dx:
;			  cx:dx	- optr to PointerDef in sharable memory block,
;			  OR cx = 0, and dx = PtrImageValue (Internal/im.def)
;
;			  mask MRF_CLEAR_POINTER_IMAGE - Causes the PIL_GADGET
;						level cursor to be cleared



;------------------------------------------------------------------------------
;	BUTTON METHODS
;------------------------------------------------------------------------------

;
;	Generic button events
;
; IMPORTANT NOTE:  Code in flow object & elsewhere depends on START/END pairs
; being sequential methods, as well as the order of SELECT, ADJUST, etc.
; in order, followed by the DRAG methods.  BE CAREFUL WHEN CHANGING!
;
; Specific ASSUMPTIONS which are currently made:
;
;	MSG_META_START_XXX +1 = MSG_META_END_XXX
;
;	MSG_XXXXXX + (MSG_XXX_PASSIVE_START_SELECT - MSG_META_START_SELECT)
;			= passive method #
;
;	MSG_META_START_XXX + (MSG_META_DRAG_SELECT - MSG_META_START_SELECT)
;			= DRAG method #
;
;
;MSG_META_START_SELECT	message	MetaUIMessages
;MSG_META_END_SELECT	message	MetaUIMessages

;MSG_META_START_MOVE_COPY	message	MetaUIMessages
;MSG_META_END_MOVE_COPY	message	MetaUIMessages

;MSG_META_START_FEATURES	message	MetaUIMessages
;MSG_META_END_FEATURES	message	MetaUIMessages

;MSG_META_START_OTHER	message	MetaUIMessages
;MSG_META_END_OTHER	message	MetaUIMessages

;MSG_META_DRAG_SELECT	message	MetaUIMessages
;MSG_META_DRAG_MOVE_COPY	message	MetaUIMessages
;MSG_META_DRAG_FEATURES	message	MetaUIMessages
;MSG_META_DRAG_OTHER	message	MetaUIMessages
;
; see documentation in ui.def
;

;
; Structures for button information
;
UIFunctionsActive	record
	UIFA_SELECT:1
	; Basic mouse function

	UIFA_MOVE_COPY:1
	; Direct action (move/copy, "quick transfer" if between apps)

	UIFA_FEATURES:1
	; Popup menu, special UI capabilities

	UIFA_CONSTRAIN:1
	; Set if modifier(s) designated as "constrain" are pressed.  This
	; flag will change with the state of the modifier.  Note that it
	; may generally NOT be used when the target object can infer a
	; meaning to "Extend" or "Toggle" selection.  (i.e. should only be
	; used w/SELECT function on things like object control points)

	UIFA_PREF_A:1
	UIFA_PREF_B:1
	UIFA_PREF_C:1
	; User "preferences"  Meaning varies with active function.  NOTE:
	; 1) requests followed by (D) are updated every event holding this
	;    info (Dynamic)
	;
	;		A	B	C
	; SELECT:	Toggle	Extend
	;
	; MOVE_COPY:	Move(D)	Copy(D)
	;
	; FEATURES:	Popup	Pan
	;		menu	View
	;

	UIFA_IN:1
	; Set if point (cx, dx) is inside the visual bounds of the object
UIFunctionsActive	end


; Equates to make the above easer to use
;
UIFA_ADJUST	equ <UIFA_PREF_A>
UIFA_EXTEND	equ <UIFA_PREF_B>
UIFA_MOVE	equ <UIFA_PREF_A>
UIFA_COPY	equ <UIFA_PREF_B>
UIFA_POPUP	equ <UIFA_PREF_A>
UIFA_PAN	equ <UIFA_PREF_B>


;
; MouseReturnFlags - flags to be returned in ax by PASSIVE & ACTIVE, PTR &
; BUTTON methods.
;
MouseReturnFlags	record
    MRF_PROCESSED:1		;to be set by any non-window objects which
				;have had mouse events passed on down to them.
				;Used by base window to determine if window
				;background was hit, as opposed to any of its
				;children.  THIS should be returned set by any
				;object finding the mouse within its bounds.
    MRF_REPLAY:1		;will cause event to be played through implied
				;grab if the active grab has gone from a valid
				;grab to no grab, in the MSG_META_BUTTON routine
				;which is returning this flag set.  Normally
				;used when a gadget releases the grab because
				;the ptr is out of its range, & it wishes to
				;have the event replayed to the implied grab.
				;NOTE: in a pre passive button handler,
				;this can be returned to cause the event to
				;be re-sent to the pre-passive list.
    MRF_PREVENT_PASS_THROUGH:1	;set by PRE-PASSIVE BUTTON routines only, if
				;event should NOT be passed through to
				;active/implied mouse grab.  Any grab in the
				;pre-passive list may set this bit, & the
				;effect will occur
    MRF_SET_POINTER_IMAGE:1	;Causes the PIL_GADGET level cursor to be
				;changed to cx:dx
    MRF_CLEAR_POINTER_IMAGE:1	;Causes the PIL_GADGET level cursor to be
				;reset to the default
    :7
    MRF_INK_RETURN_VALUE InkReturnValue:4
				;This field is only filled in by handlers for
				; MSG_META_QUERY_IF_PRESS_IS_INK
MouseReturnFlags	end


;==============================================================================

;
; Passive versions of button events
;
;MSG_META_PRE_PASSIVE_BUTTON	message	MetaUIMessages
;MSG_META_POST_PASSIVE_BUTTON	message	MetaUIMessages
;
; see documentation in ui.def
;

;
; Passive button methods generated by FlowTranslatePassiveButton
;
;MSG_META_PRE_PASSIVE_START_SELECT	message	MetaUIMessages
;MSG_META_PRE_PASSIVE_END_SELECT	message	MetaUIMessages
;MSG_META_PRE_PASSIVE_START_MOVE_COPY	message	MetaUIMessages
;MSG_META_PRE_PASSIVE_END_MOVE_COPY	message	MetaUIMessages
;MSG_META_PRE_PASSIVE_START_FEATURES	message	MetaUIMessages
;MSG_META_PRE_PASSIVE_END_FEATURES	message	MetaUIMessages
;MSG_META_PRE_PASSIVE_START_OTHER	message	MetaUIMessages
;MSG_META_PRE_PASSIVE_END_OTHER		message	MetaUIMessages

;MSG_META_POST_PASSIVE_START_SELECT	message	MetaUIMessages
;MSG_META_POST_PASSIVE_END_SELECT	message	MetaUIMessages
;MSG_META_POST_PASSIVE_START_ADJUST	message	MetaUIMessages
;MSG_META_POST_PASSIVE_END_MOVE_COPY	message	MetaUIMessages
;MSG_META_POST_PASSIVE_START_FEATURES	message	MetaUIMessages
;MSG_META_POST_PASSIVE_END_FEATURES	message	MetaUIMessages
;MSG_META_POST_PASSIVE_START_OTHER	message	MetaUIMessages
;MSG_META_POST_PASSIVE_END_OTHER	message	MetaUIMessages
;
; see documentation in ui.def
;


;------------------------------------------------------------------------------
;	LARGE DOCUMENT MODEL
;------------------------------------------------------------------------------

; Large versions of mouse events.  Available by request from GenView/Content
; for use within 32-bit visible document models.  Mouse position data is
; in full 32-bit integer, 16-bit fraction format, as generated by View.

;MSG_META_LARGE_PTR		message	MetaUIMessages

;MSG_META_LARGE_START_SELECT	message	MetaUIMessages
;MSG_META_LARGE_END_SELECT	message	MetaUIMessages

;MSG_META_LARGE_START_MOVE_COPY	message	MetaUIMessages
;MSG_META_LARGE_END_MOVE_COPY	message	MetaUIMessages

;MSG_META_LARGE_START_FEATURES	message	MetaUIMessages
;MSG_META_LARGE_END_FEATURES	message	MetaUIMessages

;MSG_META_LARGE_START_OTHER	message	MetaUIMessages
;MSG_META_LARGE_END_OTHER	message	MetaUIMessages

;MSG_META_LARGE_DRAG_SELECT	message	MetaUIMessages
;MSG_META_LARGE_DRAG_MOVE_COPY	message	MetaUIMessages
;MSG_META_LARGE_DRAG_FEATURES	message	MetaUIMessages
;MSG_META_LARGE_DRAG_OTHER	message	MetaUIMessages
;
; see documentation in ui.def
;

LargeMouseData	struct
	LMD_location		PointDWFixed
	;
	; Mouse position in <32 bit integer>.<16 bit fraction> format
	; NOTE - code in the Graphic Object Library depends on 
	; LMD_location being the first field of this structure

	LMD_buttonInfo		byte	; ButtonInfo -- not added here, for
					; then apps would have to include
					; mouse.def.  Perhaps this can be
					; cleaned up further for 2.0!

	LMD_uiFunctionsActive	UIFunctionsActive
	;
	; Additional data normally passed as part of mouse event in BP.
	; The data normally provided by the bit UIFA_IN is NOT provided
	; by PC/GEOS for LARGE mouse events.  The reason for this is
	; that with small mouse events, VisCallChildUnderPoint can lock down
	; each child, look at its bounds, & set UIFA_IN correctly.  This is
	; not possible with large objects, as the bounds information, if at
	; all existant, is private to that object & not known by the Vis
	; library.  The bit will be unchanged from the state it holds going
	; into the VisContentClass handler for the mouse event.


LargeMouseData	ends


;------------------------------------------------------------------------------
;	NOTIFICATION SYSTEMS
;------------------------------------------------------------------------------


if	(0)
;MSG_EC_ENSURE_HANDLE_NOT_REFERENCED	message	MetaUIMessages
; 	An EC method which is used to make sure the handle passed is not
; referenced anywhere in the flow object
;
;	Pass:	cx	- handle to check
;

;MSG_EC_ENSURE_OD_NOT_REFERENCED	message	MetaUIMessages
; 	An EC method which is used to make sure the OD passed is not
; referenced anywhere in the flow object
;
;	Pass:	cx:dx	- OD to check
;

;MSG_EC_ENSURE_WIN_NOT_REFERENCED	message	MetaUIMessages
; 	An EC method which is used to make sure the window passed is not
; referenced anywhere in the flow object
;
;	Pass:	cx	- window handle to check
;
endif

;MSG_META_ENSURE_MOUSE_NOT_ACTIVELY_TRESPASSING	message	MetaUIMessages
;MSG_META_ENSURE_NO_MENUS_IN_STAY_UP_MODE	message	MetaUIMessages
;MSG_META_ENSURE_ACTIVE_FT		message	MetaUIMessages
;MSG_META_NOTIFY_NO_FOCUS_WITHIN_NODE		message	MetaUIMessages
;
; see documentation in ui.def
;

;MSG_META_GRAB_KBD				message MetaUIMessages
;MSG_META_FORCE_GRAB_KBD			message MetaUIMessages
;MSG_META_RELEASE_KBD				message MetaUIMessages
;
; see documentation in ui.def
;

;------------------------------------------------------------------------------
; UI characteristics (user preferences)
;------------------------------------------------------------------------------

UIButtonFlags	record
    UIBF_NO_KEYBOARD:1		;TRUE if working in no keyboard mode (i.e. pen
				;system).  Can be used by UI and applications
				;to provide extensions to easy simplify usage.
				;This is exclusive of UIBF_KEYBOARD_ONLY below.

    UIBF_CLICK_TO_TYPE:1	;- determines which FOCUS model to use:
				;TRUE: "explicit focus" - must press
				;mouse button over window to give window
				;keyboard focus.
				;FALSE: "pointer focus" or "real estate model"
				;- window underneath mouse pointer is
				;automatically given keyboard focus, after a
				;delay in some UIs.
    UIBF_SELECT_ALWAYS_RAISES:1	;- TRUE if the SELECT function always raises the
				;window underneath the pointer to the front,
				;whether in the visible region of the window,
				;or inside a view that is inside the window.
				;If FALSE, the SELECT function within a view
				;will not bring that window to the front.

    UIBF_SELECT_DISPLAYS_MENU:1	;TRUE if SELECT and FEATURES buttons are swapped
				;so that SELECT opens a menu, while FEATURES
				;executes the default menu item.

    UIBF_KEYBOARD_ONLY:1	;TRUE if working in keyboard only mode.
				;Can be used by UI and applications to provide
				;extensions to easy simplify keyboard usage.
				;This is exclusive of UIBF_NO_KEYBOARD below.

    UIBF_CLICK_GOES_THRU:1	;- applies only in "Explicit Focus" model -
				;otherwise known as "click to type".
				;TRUE if mouse press event which brings window
				;to front should also be sent onto gadget.
    UIBF_SPECIFIC_UI_COMPATIBLE:1
				;-TRUE if specific UI should run in
				;compatibility mode, so as to not piss off any
				;lawyers.
    UIBF_BLINKING_CURSOR:1	;- TRUE if the text cursor should blink
UIButtonFlags	end


;------------------------------------------------------------------------------
; Special CS_UI_FUNCS character set
;------------------------------------------------------------------------------

UChar	etype	byte
	
UC_NULL			enum UChar, 0x00	;NULL
UC_QUICK_COPY		enum UChar, 0x01
UC_BUTTON_EVENT		enum UChar, 0x02	;send on a button event
UC_CUT			enum UChar, 0x03
UC_COPY			enum UChar, 0x04
UC_PASTE		enum UChar, 0x05
UC_DATE			enum UChar, 0x06
UC_TIME			enum UChar, 0x07
UC_EXIT			enum UChar, 0x08	; device-specific
UC_ON			enum UChar, 0x09
UC_OFF			enum UChar, 0x10
UC_LOCK			enum UChar, 0x11	; password lock
UC_JOTTER		enum UChar, 0x12	; device-specific
UC_MENU			enum UChar, 0x13
UC_DELETE		enum UChar, 0x14
UC_ROTATE		enum UChar, 0x15	; rotate display


;------------------------------------------------------------------------------
; Structures used for managing Grabs
;------------------------------------------------------------------------------

;
; The "BasicGrab" structure is used for grab mechanisms where a single OD
; has the grab at any moment in time, and when methods should be sent out
; to notify OD's of their gaining or losing of the grab.  The "data" field
; is solely to keep the struct the same size as the MouseGrab structures,
; so that common routines may operate on the different structures.
;
BasicGrab	struct
    BG_OD		optr
    BG_data		word
BasicGrab	ends


KbdGrab		struct
    KG_OD		optr
    KG_unused		word
KbdGrab		ends
.assert (offset KG_OD eq offset BG_OD), "KbdGrab must match BasicGrab"
.assert (offset KG_unused eq offset BG_data), "KbdGrab must match BasicGrab"

;
; The "MouseGrab" struct additionally stores the window handle that mouse
; data should be translated to before sending.
;
MouseGrab	struct
    MG_OD		optr
    MG_gWin		hptr
MouseGrab	ends
.assert (offset MG_OD eq offset BG_OD), "MouseGrab must match BasicGrab"
.assert (offset MG_gWin eq offset BG_data), "MouseGrab must match BasicGrab"


;
; Top-level grab for controlling input flow to geode
;
GeodeGrab	struct
    GG_OD		optr
    GG_geode		hptr
GeodeGrab	ends
.assert (offset GG_OD eq offset BG_OD), "GeodeGrab must match BasicGrab"
.assert (offset GG_geode eq offset BG_data), "GeodeGrab must match BasicGrab"

;
; Grab structure used by Ink code within Flow object
;
InkGrab		struct
    IG_OD		optr
    IG_gState		hptr
InkGrab		ends
; No need for .assert here, as InkGrab structure is not used with FlowGrab
; utility routines.


;
; The "HierarchicalGrab" structure is used for Focus & Exclusive grabs
; & maybe (Unknown yet)  the gadget exclusive.  Giving the Focus as an
; example,  one field is active, within which one application is active, 
; within which one window has the focus, within with one view does,
; within which one object does, etc.  When any level does not have the grab,
; the levels lower on still remember the "default" position, which would get
; the grab should the level above it regain the grab again.
;
; This record is stored in the HG_flags field of the Grab structure. Some of the
; flags are permanent: they describe the exclusive behavior of the node.
; The other flags provide information on the current owner of the exclusive --
; whether it is a window or not, for example.

HierarchicalGrabFlags	record
	:1

	HGF_SYS_EXCL:1
	; Not passed anywhere, but stored in hierarchical grab structure, it
	; indicates that the object has the exclusive within the System
	; NOTE:  MUST BE IN SAME BIT SLOT AS MAEF_SYS_EXCL!

	HGF_APP_EXCL:1
	; Not passed anywhere, but stored in hierarchical grab structure, it
	; indicates that the object has the exclusive within the Application
	; NOTE:  MUST BE IN SAME BIT SLOT AS MAEF_APP_EXCL!

	HGF_GRAB:1
	; This bit as passed to FlowAlterHierarchicalGrab indiates whether the object
	; wishes to grab or release the exclusive it has within the node. 
	; Stored in a grab, it indicates that an object has the exclusive with
	; the node (i.e. is redundant with the fact that there is an OD stored
	; in the grab) 
	; NOTE:  MUST BE IN SAME BIT SLOT AS MAEF_GRAB!
 
	HGF_OTHER_INFO:12
	; Use defined by the type of HierarchicalGrab.  This data IS stored
	; in the HG_flags field, whenever FlowAlterHierarchicalGrab is called to
	; grab the exclusive for an object.


HierarchicalGrabFlags	end

HierarchicalGrab	struct
    HG_OD		optr
    HG_flags		HierarchicalGrabFlags <>
HierarchicalGrab	ends
.assert (offset HG_OD eq offset BG_OD), "HierarchicalGrab must match BasicGrab"
.assert (offset HG_flags eq offset BG_data), "HierarchicalGrab must match BasicGrab"


; A variation on the basic MetaAlterFTVMCExclFlags, this structure is used
; for storing Focus/Target/Model hierarchical grabs
;
FTVMCGrab		struct
    FTVMC_OD		optr
    FTVMC_flags		MetaAlterFTVMCExclFlags
FTVMCGrab		ends
.assert (offset FTVMC_OD eq offset HG_OD), "FTVMCGrab must match HierarchicalGrab"
.assert (offset FTVMC_flags eq offset HG_flags), "FTVMCGrab must match HierarchicalGrab"


;------------------------------------------------------------------------------
; Hold-up state flags (Used in FlowClass, VisContentClass)
;------------------------------------------------------------------------------

HoldUpInputFlags	record
	HUIF_FLUSHING_QUEUE:1
	; Set if the HoldUpInputQueue is in the process of being flushed.
	; Used to allow reentrant calls into FlowFlushHoldUpInputQueue.

	HUIF_HOLD_UP_MODE_DISABLED:1
	; Set on call to FlowDisableHoldUpInput.  Forces input data to
	; flow normally until cleared.  Used only by the system object when
	; a system-modal dialog box is put on screen, to ensure that user
	; can interact with it.

	:6
HoldUpInputFlags	end



;------------------------------------------------------------------------------
;	Utility Routines (from userFlowMisc.asm)
;------------------------------------------------------------------------------

global FlowTranslatePassiveButton:far	; Translate a
					; MSG_META_PRE_PASSIVE_BUTTON or
					; MSG_META_POST_PASSIVE_BUTTON to a
					; generic method

global FlowGetUIButtonFlags:far		; Return the current UIButtonFlags
					; and UIFunctionsActive values.
global FlowCheckKbdShortcut:far



;------------------------------------------------------------------------------
; Utility routines (from userFlowUtils.asm)
;------------------------------------------------------------------------------

; Utility routines for implementing a MouseGrab or HierarchicalGrab in
; any object's instance data
;
global FlowForceGrab:far
global FlowReleaseGrab:far
global FlowRequestGrab:far
global FlowUpdateHierarchicalGrab:far
global FlowAlterHierarchicalGrab:far

; Utility for implementing a Target Level
;
global FlowGetTargetAtTargetLevel:far
global FlowDispatchSendOnOrDestroyClassedEvent:far
global FlowHandleFownOrTownClassedEvent:far

; Utility for generating file change notification notices
;
global FlowSendFileChange:far

; Focus/Target/Model primitives
;
global MetaGrabFocusExclLow:far
global MetaReleaseFocusExclLow:far
global MetaGrabTargetExclLow:far
global MetaReleaseTargetExclLow:far
global MetaGrabModelExclLow:far
global MetaReleaseModelExclLow:far
global MetaReleaseFTVMCExclLow:far

; "C" versions of above
;
global FLOWCHECKKBDSHORTCUT:far
global FLOWUPDATEHIERARCHICALGRAB:far
global FLOWALTERHIERARCHICALGRAB:far
global FLOWDISPATCHSENDONORDESTROYCLASSEDEVENT:far

EndLibrary	ui
