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

	Copyright (c) GeoWorks 1991 -- All Rights Reserved

PROJECT:	PC GEOS
FILE:		Objects/gSysC.def

DECLARER:	UI

DESCRIPTION:
	This file defines GenSystemClass

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

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

SetDef	__GSYSC

StartLibrary	ui

GenSystemClass	class	GenClass


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

MSG_GEN_SYSTEM_SET_SPECIFIC_UI			message
;
; Set the specific UI
;
; Pass:		*ds:si - instance data
;		dx - specific UI
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_SYSTEM_SET_DEFAULT_SCREEN		message
;
; Allows changing default screen object.  This is where fields
; will come up by default.
;
; Pass:		*ds:si - instance data
;		cx:dx	- object descriptor to be default visible parent
;		 	 of field (Should be a GenScreenClass object)
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_SYSTEM_GET_DEFAULT_SCREEN		message
;
; Returns current default screen.
;
; Pass:		nothing
; Return:	^lcx:dx	- GenScreenClass object
; 		ax, bp - destroyed

MSG_GEN_SYSTEM_ADD_SCREEN_CHILD			message
;
; Pass: 	cx:dx	- OD of GenScreen class object to add
;		bp	- Composite Add flags
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_SYSTEM_REMOVE_SCREEN_CHILD		message
;
; Pass: 	cx:dx	- OD of GenScreen class object to remove
; Return:	nothing
; 		ax, cx, dx, bp - destroyed


MSG_GEN_SYSTEM_SET_DEFAULT_FIELD		message
;
; Allows changing default field object.  This is where applications
; will come up by default.
;
; Pass:		*ds:si - instance data
;		cx:dx	- object descriptor to be default visible parent
;		 	 of application (Should be a GenFieldClass object)
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_SYSTEM_GET_DEFAULT_FIELD		message
;
; Returns current default field.
;
; Pass:		nothing
; Return:	^lcx:dx	- GenFieldClass object
; 		ax, bp - destroyed

MSG_GEN_SYSTEM_SET_PTR_IMAGE			message
;
; Used to change the mouse ptr image.  The mouse ptr defined at the 
; highest PtrImageLevel will actually be used.  This function is also
; accessible via the Input Manager library routine ImSetPtrImage, but this
; message is provided for cases where an interrupt routine needs to change
; the ptr image -- it may send this method to the IM to effect the change.
;
; Pass:		cx:dx	- handle:offset to PointerDef to use
;		bp	- PtrImageLevel to change mouse image for
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_SYSTEM_NOTIFY_SYS_MODAL_WIN_CHANGE	message
;
; Is called on system object by UI whenever it should check to see if there
; is a change in system-modal status.  Current behavior is to look for the
; top window on the screen residing at a window priority of WIN_PRIO_MODAL
; within a layer at LAYER_PRIO_MODAL, & to start directing input to the owning
; geode's InputObj, if it isn't already getting it.  If no system modal windows
; are up, input returns to normal flow pattern.
;
; Pass: 	Nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed
;

MSG_GEN_SYSTEM_GET_MODAL_GEODE		message
; 
; Returns current system modal geode, if there is one.  Used internally by the
; UI, where results are synchronous to the caller.  I would not recommend
; using this within apps, as the results may not be valid by the time the
; message call returns.
;
; Pass:		nothing
; Return:	^lcx:dx	- InputObj of modal geode, if any, else NULL
;		^hbp	- modal geode
;

MSG_GEN_SYSTEM_BRING_GEODE_TO_TOP	message
;
; Synchonously raises a geode's window layer to the top, & gives the geode 
; the focus & target, if focusable/targetable.  This method is called from
; within the UI itself to implement "autoraise", i.e. the automatic raising
; of a geode & the passage of focus/target to it when clicked on.  Also
; call by GenApplication's handler for MSG_GEN_BRING_TO_TOP.
;
; Pass:		cx	- geode, or 0 if no geode to give FT
;		dx	- LayerID of windows on parent window to raise to
;			  top, or 0 if no layer to raise (is normally
;			  geode handle, which is used for common windows of
;			  app)
;		bp	- parent window
; Return:	nothing
;		ax, cx, dx, bp - destroyed

MSG_GEN_SYSTEM_LOWER_GEODE_TO_BOTTOM	message
;
; Synchronously lowers geode's window layer to the bottom, releases its focus
; & target exclusives, & then re-determines the new most suitable geode to give
; the focus/target exclusives to.  Called by GenApplication's handler for
; MSG_GEN_LOWER_TO_BOTTOM
;
; Pass:		cx	- geode, or 0 if no geode to release FT for
;		dx	- LayerID of windows on parent window to lower to
;			  bottom, or 0 if no layer to lower.  (Is normally
;			  geode handle, which is used for common windows
;			  of app)
;		bp	- parent window
; Return:	nothing
;		ax, cx, dx, bp - destroyed


;MSG_META_ENSURE_ACTIVE_FT			message
;
; Behavior as implemented in GenSystemClass:
;
; Checks to make sure that some field within the system has the Focus & Target
; exclusives.  Called from within the UI, usually when field windows are
; closed, or moved to the back, to give the Focus and/or Target to the most
; suitable field.  Typical click-to-type model is implemented using the
; following rules:
;
;	Target:
;		1) Object currently having target
;		2) On default screen:
;			Top targetable window of LAYER_PRIO_STD priority
;			(InputOD if is a GenField run by the UI, else
;			InputObj of owning Geode)
;		3) On default screen:
;			Top targetable window of LAYER_PRIO_ON_TOP priority
;			(InputOD if is a GenField run by the UI, else
;			InputObj of owning Geode)
;		4) NULL
;
; 	Focus:
;		1) Object currently having focus
;		2) InputOD of field on which a current system modal geode sits
;		3) Last non-modal object to have or request the exlusive
;		4) Object having Target exclusive
;		5) On default screen:
;			Top focusable window of LAYER_PRIO_STD priority
;			(InputOD if is a GenField run by the UI, else
;			InputObj of owning Geode)
;		6) On default screen:
;			Top focusable window of LAYER_PRIO_ON_TOP priority
;			(InputOD if is a GenField run by the UI, else
;			InputObj of owning Geode)
;		7) UI geode (?)
;
;
; Pass: 	Nothing
; Return:	nothing
; 		ax, cx, dx, bp - destroyed

MSG_GEN_SYSTEM_FOREACH_FIELD			message
;
; Call a callback function for each currently-attached field. In the absence
; of a carry-set return by the callback, the final callback will be with the
; optr of the system field created by the UI on startup.
;
; Context:	This message is used by system geodes that need either to
;		find the initial field (as a task-switching driver/app must
;		do), or to locate all fields (so it can create a control
;		panel in all extant express menus).
; Source:	System geode
; Destination:	GenSystem object
; Interception:	N/A
; Pass:		cx:dx	= routine to call:
; 				Pass:	^lbx:si	= optr of field
; 					ax	= bp passed to method
; 				Return:	carry set to stop enumerating
;				Destroy: ax, ds, es, di
;		bp	= ax to pass to callback
; 
; Return:	carry set if callback returned carry set:
; 			cx:dx	= field on which it stopped
; 		carry clear if callback never returned carry set:
; 			cx:dx	= 0:0
;		ax, bp - destroyed
;

MSG_GEN_SYSTEM_MARK_BUSY			message
MSG_GEN_SYSTEM_MARK_NOT_BUSY			message
;
; Called by the field & app objects while an application is being launched,
; but is not yet up on screen.
; While "Busy", the UI will continue to allow mouse events through.
; The system object keeps a count of how many times this has been called.
; When MSG_GEN_SYSTEM_MARK_NOT_BUSY has been called enough times to  bring
; the balance to 0, the cursor image is restored, if the system
; is otherwise not busy.
;
; Pass:		nothing
; Return:	nothing
;		ax, cx, dx, bp - destroyed

;------------------------------------------------------------------------------
;	Constants
;------------------------------------------------------------------------------

TEMP_GEN_SYSTEM_FIELDS_DETACHED		vardata
; Internal flag used by MSG_META_DETACH_COMPLETE to keep track of whether
; the current detach cycle was that of fields detaching, or that of the UI
; application being detached.

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

    GSYI_specificUI	hptr
    ; UI that this System object was done in

    GSYI_defaultUI	hptr
    ; Default UI to use for next application loaded (unless overridden
    ; by field group)

    GSYI_defaultScreen	optr
    ; Default screen to add next field to, if not specified.

    GSYI_defaultField	optr
    ; Default field to add next application to, if not specified.

    GSYI_screenComp		CompPart <>
    ; This is a composite group for holding screens.  Yes, their very own
    ; tree.

GenSystemClass	endc

EndLibrary	ui
