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

	Copyright (c) GeoWorks 1989 -- All Rights Reserved

PROJECT:	PC GEOS
FILE:		Objects/genFSelC.def

DECLARER:	UI

DESCRIPTION:
	This file defines GenFileSelectorClass

	$Id: gFSelC.def,v 1.1 97/04/04 14:18:07 newdeal Exp $

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

SetDef	__GENFSELC

StartLibrary	ui

include file.def

GenFileSelectorClass	class	GenClass

; This PASTA variable exists in order to get the Geos 2.0 PASTA fax
; solution to compile under 3.0
ifndef 	PASTA
	PASTA	equ	0
endif
;-----------------------------------------------------------------------------
;		Methods sent from outside
;-----------------------------------------------------------------------------

MSG_GEN_FILE_SELECTOR_GET_SELECTION	message
;
; Returns null-terminated name of the currently selected entry
; (either a file or a directory).
;
; If sent when GenFileSelector is off-screen, returns last selection.
;
; Context:	Utility message sent to get GenFileSelector selection.  This
;		is used to get the selection name when the user decides to
;		perform the operation on the current selection.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, call superclass
;		first to get the default return values and modify them or
;		do your processing first then call superclass to use default
;		return values.
;
; Pass:		cx:dx - address to copy to (cx=0 if selection name not desired)
;			(should be at least FILE_LONGNAME_BUFFER_SIZE bytes)
; Return:	cx:dx - filled with selection (fptr preserved)
;			(null if no entries selected)
;		ax - entry # of selection
;		bp - GenFileSelectorEntryFlags
;			GFSEF_TYPE - type of entry that current selection is
;				GFSET_FILE - if selection is a regular file
;				GFSET_SUBDIR - if selection is a subdirectory
;				GFSET_VOLUME - if selection is a volume
;			GFSEF_OPEN - (not used)
;			GFSEF_NO_ENTRIES - set if no entries selected
;			GFSEF_ERROR - (not used)
;			GFSEF_TEMPLATE - set if file is a template (from
;				 GFHF_TEMPLATE)
;			GFSEF_SHARED_MULTIPLE - set if file is shared with
;					multiple writers (from
;					GFHF_SHARED_MULTIPLE)
;			GFSEF_SHARED_SINGLE - set if file is shared with single
;				      writer (from GFHF_SHARED_SINGLE)
;			GFSEF_READ_ONLY - set if file is read-only (from
;					  FA_RDONLY)
;			GFSEF_PARENT_DIR - set if current selection is the
;					parent directory entry (first entry)
;

MSG_GEN_FILE_SELECTOR_SET_SELECTION	message
;
; Attempts to select the specified entry.  Must be an entry in the currently
; displayed list.
;
; If sent before GenFileSelector is on-screen, will be saved until
; GenFileSelector is on-screen.  If sent when GenFileSelector is on-screen,
; will take affect immediately.
;
; Context:	Utility message sent to set GenFileSelector selection.  This
;		is only needed for special situations where you wish to force
;		the selection to a certain entry.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:		cx:dx - buffer containing null-terminated name to match.
;			Depending on the current mode, this can be a volume
;			name or a file/directory name.  This is
;			case-sensitive, as longnames can be upper/lowercase.
; Return:	Entry is selected, if it exists; if not, the current selection
;			remains the same
;		CARRY CLEAR if entry exists and selected, CARRY SET otherwise
;		(If file selector is suspended, then carry will be clear as
;		 validity of selection is not determined until rescanning)
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_GET_FULL_SELECTION_PATH	message
;
; Returns null-terminated full pathname of the currently selected entry
; (either a file or a directory).
;
; If sent when GenFileSelector is off-screen, returns last selection.
;
; Context:	Utility message sent to get full path of GenFileSelector
;		selection.  This can be used in place of seperate calls
;		to MSG_GEN_PATH_GET and MSG_GEN_FILE_SELECTOR_GET_SELECTION.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, call superclass
;		first to get the default return values and modify them or
;		do your processing first then call superclass to use default
;		return values.
;
; Pass:		cx:dx - address to copy to (cx=0 if selection name not desired)
;			(should be at least
;			 PATH_BUFFER_SIZE+FILE_LONGNAME_BUFFER_SIZE bytes)
; Return:	cx:dx - filled with selection (fptr preserved)
;			(null if no entries selected)
;		ax - disk handle of path
;		bp - GenFileSelectorEntryFlags
;			GFSEF_TYPE - type of entry that current selection is
;				GFSET_FILE - if selection is a regular file
;				GFSET_SUBDIR - if selection is a subdirectory
;				GFSET_VOLUME - if selection is a volume
;			GFSEF_OPEN - (not used)
;			GFSEF_NO_ENTRIES - set if no entries selected
;			GFSEF_ERROR - (not used)
;			GFSEF_TEMPLATE - set if file is a template (from
;				 GFHF_TEMPLATE)
;			GFSEF_SHARED_MULTIPLE - set if file is shared with
;					multiple writers (from
;					GFHF_SHARED_MULTIPLE)
;			GFSEF_SHARED_SINGLE - set if file is shared with single
;				      writer (from GFHF_SHARED_SINGLE)
;			GFSEF_READ_ONLY - set if file is read-only (from
;					  FA_RDONLY)
;			GFSEF_PARENT_DIR - set if current selection is the
;					parent directory entry (first entry)
;

MSG_GEN_FILE_SELECTOR_SET_FULL_SELECTION_PATH	message
;
; Attempts to select the specified entry.  May be an entry in any directory.
;
; If sent before GenFileSelector is on-screen, will be saved until
; GenFileSelector is on-screen.  If sent when GenFileSelector is on-screen,
; will take effect immediately.
;
; Context:	Utility message sent to set full path of GenFileSelector
;		selection.  This can be used in place of seperate calls to
;		MSG_GEN_PATH_SET and
;		MSG_GEN_FILE_SELECTOR_SET_SELECTION.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:		cx:dx - buffer containing null-terminated pathname to match.
;			This can only be path and a file/directory name, no
;			volume entry (i.e. drive letter and colon allowed).
;			This is case-sensitive, as longnames can be upper/
;			lowercase.  If partial path is passed, it is
;			relative to current path of file selector and passed
;			disk handle is ignored.
;		bp - disk handle of path
;			(if 0, will use FileSelector's current disk
;			 handle)
; Return:	Entry is selected, if it exists; if not, but just the path
;			portion is valid, the first entry in that directory
;			is selected; if path portion is also invalid, volume
;			listing is shown
;		CARRY CLEAR if entry exists and selected, CARRY SET otherwise
;		(If file selector is suspended, then carry will be clear as
;		 validity of selection is not determined until rescanning)
;		ax, cx, dx, bp - destroyed
;

;MSG_GEN_PATH_GET	message
;
; Returns null-terminated complete path (no drive letter -- drive is
; determined by disk handle) of files currently being shown. Note that as for
; FileGetCurrentPath, if the object is within a standard directory, the
; disk handle will be a StandardPath constant and the path will appear
; to be relative.

;
; Context:	Utility message sent to get GenFileSelector path.  This is
;		used when the user decides to perform the operation on the
;		selected entry.  The selected entry is located in the path
;		returned by this message.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, call superclass
;		first to get the default return values and modify them or
;		do your processing first then call superclass to use default
;		return values.
;
; Pass:		dx:bp - address to which to copy
;		cx - size of buffer (may be zero)
; Return:	carry set if error (path won't fit in the passed buffer):
; 			cx - number of bytes required
;		carry clear if ok:
;			dx:bp - filled with complete path (fptr preserved)
;			cx - disk handle of path
;			ax - destroyed
;

;MSG_GEN_PATH_SET			message
;
; Set path whose contents will be shown.  Normally, a complete pathname must
; be passed (but, no drive specifier -- drive is determined by disk handle), but
; you can set a path relative to a standard path by passing the StandardPath
; constant for the disk handle. If you pass a disk handle of 0 and a relative
; path, it will be taken relative to the selector's current path.
;
; If done when GenFileSelector is already visible, rescans using new path.
;
; Context:	Utility message sent to set GenFileSelector path.  This is
;		typically used to set some initial path for the GenFileSelector.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:	 	cx:dx - null-terminated pathname
;			(if null, uses root directory of disk specified by
;			 disk handle; if relative, path is taken current to
;			 selector's current path)
;		bp - disk handle of path, or StandardPath constant
;			(if 0, will use FileSelector's current disk
;			 handle; if none, shows top-level GEOS directory)
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_GET_MASK	message
;
; Returns null-terminated filemask for files currently being shown.
;
; Context:	Utility message sent to get GenFileSelector mask.  This
;		is rarely needed.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, call superclass
;		first to get the default return values and modify them or
;		do your processing first then call superclass to use default
;		return values.
;
; Pass:		cx:dx - address to copy to
;			(should be at least VOLUME_NAME_LENGTH+1 bytes)
; Return:	carry set if filemask defined:
; 			cx:dx - filled with mask (fptr preserved)
;		ax, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_SET_MASK	message
;
; Set filemask for files to be shown.
;
; If done when GenFileSelector is already visible, rescans using new mask.
;
; Context:	Utility message sent to set GenFileSelector mask.  Normally,
;		if a mask is needed, and it stays the same, you can set it
;		in the .ui or .goc file.  Otherwise, this message can be
;		used to set the mask dynamically.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:	 	cx:dx - null-terminated filemask (see
;			ATTR_GEN_FILE_SELECTOR_NAME_MASK for definition of
;			a filemask)
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_GET_FILE_ATTRS	message
;
; Returns the current file attributes being used by generic file selector.
; NOTE that file attributes are only used if ATTR_GEN_FILE_SELECTOR_FILE_ATTR
; is set.
;
; Context:	Utility message sent to get GenFileSelector DOS attributes.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, call superclass
;		first to get the default return values and modify them or
;		do your processing first then call superclass to use default
;		return values.
;
; Pass:	 	nothing
; Return:	cl - current FileAttrs that must be set
;		ch - current FileAttrs that must *not* be set
;		ax, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_SET_FILE_ATTRS	message
;
; Sets the current file attributes for the generic file selector.
;
; If done when GenFileSelector is already visible, rescans using new
; file attributes.
;
; Context:	Utility message sent to set GenFileSelector file attributes.
;		Normally, if file attributes are needed, and they stay the
;		same, you can set them in the .ui or .goc file.  Otherwise,
;		this message can be used to set the attributes dynamically.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:	 	cl - FileAttrs that must be set
;		ch - FileAttrs that must *not* be set
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_GET_TOKEN	message
;
; Returns the current token being used by generic file selector.
;
; Context:	Utility message sent to get GenFileSelector token
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, call superclass
;		first to get the default return values and modify them or
;		do your processing first then call superclass to use default
;		return values.
;
; Pass:	 	nothing
; Return:	carry set if token used for selection:
;			<cl><ch><dl><dh> - four bytes of token
;				cl - 1st char
;				ch - 2nd char
;				dl - 3rd char
;				dh - 4th char
;			bp - manufacturer id of token
;		ax - destroyed
;

MSG_GEN_FILE_SELECTOR_SET_TOKEN	message
;
; Sets the current token for the generic file selector.
;
; If done when GenFileSelector is already visible, rescans using new
; token.
;
; Context:	Utility message sent to set GenFileSelector token.
;		Normally, if a token is needed, and it stays the
;		same, you can set it in the .ui or .goc file.  Otherwise,
;		this message can be used to set the token dynamically.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:	 	<cl><ch><dl><dh> - four bytes of token
;			cl - 1st char
;			ch - 2nd char
;			dl - 3rd char
;			dh - 4th char
;		bp - manufacturer id of token
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_GET_CREATOR	message
;
; Returns the current creator being used by generic file selector.
;
; Context:	Utility message sent to get GenFileSelector creator token
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, call superclass
;		first to get the default return values and modify them or
;		do your processing first then call superclass to use default
;		return values.
;
; Pass:	 	nothing
; Return:	carry set if creator token used for selection:
;			<cl><ch><dl><dh> - four bytes of creator token
;				cl - 1st char
;				ch - 2nd char
;				dl - 3rd char
;				dh - 4th char
;			bp - manufacturer id of creator token
;		ax - destroyed
;

MSG_GEN_FILE_SELECTOR_SET_CREATOR	message
;
; Sets the current token for the generic file selector.
;
; If done when GenFileSelector is already visible, rescans using new
; creator token.
;
; Context:	Utility message sent to set GenFileSelector creator token
;		Normally, if a creator token is needed, and it stays the
;		same, you can set it in the .ui or .goc file.  Otherwise,
;		this message can be used to set the creator token dynamically.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:	 	<cl><ch><dl><dh> - four bytes of creator token
;			cl - 1st char
;			ch - 2nd char
;			dl - 3rd char
;			dh - 4th char
;		bp - manufacturer id of creator token
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_GET_GEODE_ATTRS	message
;
; Returns the match GeodeAttrs being used by generic file selector.
;
; Context:	Utility message sent to get GenFileSelector GeodeAttrs
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, call superclass
;		first to get the default return values and modify them or
;		do your processing first then call superclass to use default
;		return values.
;
; Pass:		nothing
; Return:	carry set if GeodeAttrs used in file selection:
; 			cx - GeodeAttrs to match
;			dx - GeodeAttrs to not match
;		ax, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_SET_GEODE_ATTRS	message
;
; Sets the current match GeodeAttrs for the generic file selector.
;
; If done when GenFileSelector is already visible, rescans using new
; match GeodeAttrs.
;
; Context:	Utility message sent to set GenFileSelector GeodeAttrs.
;		Normally, if GeodeAttrs are needed, and they stay the
;		same, you can set it in the .ui or .goc file.  Otherwise,
;		this message can be used to set the GeodeAttrs dynamically.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:	 	cx - GeodeAttrs to match
;		dx - GeodeAttrs to mismatch
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_GET_ACTION	message
;
; Returns action descriptor used by the generic file selector.
;
; Context:	Utility message sent to get GenFileSelector action
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, call superclass
;		first to get the default return values and modify them or
;		do your processing first then call superclass to use default
;		return values.
;
; Pass:	 	nothing
; Return:	^lcx:dx - optr of action descriptor
;		bp - method of action descriptor
;		ax - destroyed
;

MSG_GEN_FILE_SELECTOR_SET_ACTION	message
;
; Sets the action descriptor used by the generic file selector.
;
; Context:	Utility message sent to set GenFileSelector action.
;		Normally, the action descriptor is set in the .ui or .goc
;		file.  If needed, this message can be used to set it
;		dynamically.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:	 	^lcx:dx - optr of action descriptor
;		bp - method of action descriptor
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_GET_ATTRS	message
;
; Returns the current attributes for the generic file selector.
;
; Context:	Utility message sent to get GenFileSelector attributes
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, call superclass
;		first to get the default return values and modify them or
;		do your processing first then call superclass to use default
;		return values.
;
; Pass:	 	nothing
; Return:	cx - current FileSelectorAttrs
;		ax, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_SET_ATTRS	message
;
; Sets the current attributes for the generic file selector.
;
; If done when GenFileSelector is already visible, rescans using new attributes.
;
; Context:	Utility message sent to set GenFileSelector attributes
;		Normally, the file selector attributes are set in the .ui or
;		.goc file (defaults or otherwise).  If needed, this message
;		can be used to set them dynamically.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:	 	cx - new FileSelectorAttrs
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_GET_FILE_CRITERIA	message
;
; Returns the current file criteria for the generic file selector.
;
; Context:	Utility message sent to get GenFileSelector file criteria
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, call superclass
;		first to get the default return values and modify them or
;		do your processing first then call superclass to use default
;		return values.
;
; Pass:		nothing
; Return:	cx - current FileSelectorFileCriteria
;		ax, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_SET_FILE_CRITERIA	message
;
; Sets the current file criteria for the generic file selector.
;
; If done when GenFileSelector is already visible, rescans using new attributes.
;
; Context:	Utility message sent to set GenFileSelector file criteria
;		Normally, the file selector file criteria are set in the .ui
;		or .goc file (defaults or otherwise).  If needed, this message
;		can be used to set them dynamically.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:		cx - new FileSelectorFileCriteria
; Return:	nothing
;		ax, cx, dx, bp, - destroyed
;

MSG_GEN_FILE_SELECTOR_RESCAN	message
;
; Re-builds list using current path.
;
; Does nothing if File Selector is not usable.
;
; Context:	Utility message sent to invoke GenFileSelector rescan.
;		Normally not needed as the file selector rescans automatically
;		on user actions.  May be used to force rescan if disk contents
;		have changed outside of GEOS, for example.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:	 	nothing
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_UP_DIRECTORY	message
;
; Goes up one level in directory tree.  If already at the root, then
; switches to volume listing.
;
; Does nothing if File Selector is not usable.
;
; Context:	Utility message sent to change GenFileSelector directory.
;		Normally not needed as file selector handles directory
;		navigation automatically.  May be used if FSA_ALLOW_CHANGE_DIRS
;		is not set, for example.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:	 	nothing
; Return:	nothing
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_UNUSED		message

MSG_GEN_FILE_SELECTOR_OPEN_ENTRY		message
;
; Open entry specified.  This should be used to manually open a directory
; or a volume, as needed when user clicks a "Open"-type button that is in the
; same dialog box as the GenFileSelector.  Has no effect if entry is a file.
;
; Typically, the entry number passed will have been extracted from the
; GenFileSelectorEntryFlags sent to the action descriptor or returned from
; MSG_GEN_FILE_SELECTOR_GET_SELECTION.
;
; Does nothing if File Selector is not usable.
;
; Context:	Utility message sent to change GenFileSelector directory.
;		Normally used to navigate into directory when user initiates
;		action on selection when that selection is a directory.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:		cx - entry number to open
; Return:	CARRY CLEAR if successful
;		CARRY SET if unable to open entry (no disk, bad disk, etc.)
;			NOTE:	If an error is returned, the following
;				notification method, if any, will not have
;				the GFSEF_ERROR bit set.  Use the carry flag
;				returned here to determine that an error has
;				occured.
;		ax, cx, dx, bp - destroyed
;

MSG_GEN_FILE_SELECTOR_SUSPEND		message
;
; Suspend file rescanning for the object.  Used with
; MSG_GEN_FILE_SELECTOR_END_SUSPEND to prevent multiple rescans when
; making multiple attribute changes.  Use with care as
; MSG_GEN_FILE_SELECTOR_END_SUSPEND required to undo this.
; Only the following attribute-setting methods are affected (no user
; action is affected):
;	MSG_GEN_FILE_SELECTOR_SET_SELECTION
;	MSG_GEN_FILE_SELECTOR_SET_FULL_SELECTION_PATH
;	MSG_GEN_PATH_SET
;	MSG_GEN_FILE_SELECTOR_SET_STANDARD_PATH
;	MSG_GEN_FILE_SELECTOR_SET_MASK
;	MSG_GEN_FILE_SELECTOR_SET_VOLUME
;	MSG_GEN_FILE_SELECTOR_SET_FILE_ATTRS
;	MSG_GEN_FILE_SELECTOR_SET_TOKEN
;	MSG_GEN_FILE_SELECTOR_SET_CREATOR
;	MSG_GEN_FILE_SELECTOR_SET_GEODE_ATTRS
;	MSG_GEN_FILE_SELECTOR_SET_ATTRS
;	MSG_GEN_FILE_SELECTOR_SET_FILE_CRITERIA
;
; Context:	Utility message sent to temporary halt GenFileSelector rescans.
;		Used to allow making several changes without causing rescan.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:		nothing
; Return:	CARRY CLEAR if successful
;		CARRY SET if already suspended
;

MSG_GEN_FILE_SELECTOR_END_SUSPEND	message
;
; End suspension of rescanning.  See MSG_GEN_FILE_SELECTOR_SUSPEND.
; File selector is rescanned with current attributes.
;
; Context:	Utility message sent to restore GenFileSelector rescans.
;		Used to allow making several changes without causing rescan.
;		Should be used to undo corresponding
;		MSG_GEN_FILE_SELECTOR_SUSPEND.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, superclass may
;		be called before or after your processing, depending on what
;		additional processing you do.
;
; Pass:		nothing
; Return:	CARRY CLEAR if successful (file list rescanned)
;		CARRY SET if not suspended
;

MSG_GEN_FILE_SELECTOR_GET_DESTINATION_PATH	message
;
; Returns null-terminated complete path (no drive letter -- drive is
; determined by disk handle) for a destination-related operation like
; "Save As", "Copy To", etc.  Note that as for FileGetCurrentPath, if the
; object is within a standard directory, the disk handle will be a StandardPath
; constant and the path will appear to be relative.  However, the StandardPath
; constant and relative-path combination may be not be the best combination
; possible, so do not rely on this (use FileParseStandardPath if necessary).
;
;
; Context:	Utility message sent to get GenFileSelector path.  This is
;		used when the user decides to perform a destination-related
;		operation to the selected path.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Generally not intercepted.  May be subclassed to replace or
;		supplement default functionality.  If replacing, don't need to
;		call superclass in handler.  If supplementing, call superclass
;		first to get the default return values and modify them or
;		do your processing first then call superclass to use default
;		return values.
;
; Pass:		dx:bp - address to which to copy
;		cx - size of buffer (may be zero)
; Return:	carry set if error (path won't fit in the passed buffer):
; 			ax - number of bytes required
;			cx - disk handle of path
;		carry clear if ok:
;			dx:bp - filled with complete path (fptr preserved)
;			cx - disk handle of path
;			ax - destroyed
;

;-----------------------------------------------------------------------------
;		Methods that can be subclassed
;-----------------------------------------------------------------------------

MSG_GEN_FILE_SELECTOR_GET_FILTER_ROUTINE	message
;
; Sent to self to obtain the address of the extra callback routine for
; the subclass, and the array of additional file attributes to obtain for
; each file.
;
; To filter files, subclass a GenFileSelector with the FSFC_FILE_FILTER bit
; set and intercept this message, returning the address of the extra
; routine to call, and the extra attributes to fetch.
;
; The callback routine whose address you return is passed the
; FileEnumCallbackData block that contains all the attributes requested for
; the file. You can examine them by calling FileEnumLocateAttr to find the
; one you need, and taking it from there.
;
; By the time your subclass receives this message, the GenFileSelector and
; FileEnum have decided to accept the file. Your routine is the final place
; where it can be rejected.
;
; Context:	Sent before FileEnum is called to allow subclass to specify
;		a routine to call for final say as to what files are
;		accepted.
; Source:	GenFileSelector object sends this to itself before calling
;		FileEnum
; Destination:	GenFileSelector object
; Interception:	Must be intercepted to implement file filter.  If not, file
;		is accepted.  No need to call superclass. THE RECEIVING
;		METHOD MAY NOT DO ANYTHING THAT CAUSES THE OBJECT OR ITS
;		BLOCK TO MOVE.
;
; Pass:		nothing
; Return:	cx:ax	= far pointer to routine to call. If routine is in
;			  movable memory, ax should be a virtual segment.
;			  This is normally dealt with automatically if you
;			  declare an fptr vector from which you load the address
;		bp:dx	= far pointer to FileExtAttrDesc array of additional
;			  attributes to fetch. bp is 0 if no additional
;			  attributes required. As for ax, if the array is
;			  in movable memory, bp must be a virtual segment.
;
; Notes:
;
; If the callback routine is written in assembly, it is called with:
; 	Pass:	es	= segment of FileEnumCallbackData containing the
;			  attributes for the file
;		*ds:si	= file selector object
;		bp	= inherited stack frame to pass to any FileEnum
;			  helper routines.
;	Return:	carry set to reject the file
;		carry clear to accept the file
;	Destroy:ax, bx, cx, dx
;
; If the callback routine is written in C, it is called as:
; 	Boolean	FileSelectorCallback(_optr self,
;				     FileEnumCallbackData *attributes,
;				     word frame);
; it should return TRUE to reject the file, and FALSE to accept it.
;

protominor	NewForJediAndBeyond

MSG_GEN_FILE_SELECTOR_DELETE_SELECTION			message
;
; Delete the currently selected file.
;
; Context:	Utility message sent to delete the currently selected entry.
; Source:	Anyone
; Destination:	GenFileSelector object
; Interception:	Can be intercepted to replace default behavior.
;		Currently only implmented in Jedi Motif.
;
; Pass:		nothing
; Return:	nothing
; Destroyed:	ax
;

protoreset

protominor	UINewForResponder

MSG_GEN_FILE_SELECTOR_GET_FILE_ENUM_ROUTINE	message
;
; Sent to self to obtain the address of a FileEnum-like routine for
; the subclass.
;
; To use your own data source in a file selector set the
; FSFC_USE_FAKE_FILE_SYSTEM bit and intercept this message, returning
; the address of the appropriate routine. 
;
; By the time your routine gets called the GenFileSelector has set up
; everything for a call to FileEnum.  You can do what you like, but
; the call to FileEnum will be skipped in favor of your code, and the
; GenFileSelector will expect results as per FileEnum.  Good luck.
;
; Pass:		nothing
;
; Return:	cx:ax	= vfptr to FileEnum-like routine (cx=0 => none)
;

MSG_GEN_FILE_SELECTOR_FAKE_PATH_GET	message
;
;
; Context:	Sent when we need the path of a fake FS..  mostly for
; 		moniker purposes.
;
;		Will return a dummy volume name, "[Dummy]", for a
;		RESPONDER pccom fake file selector.
;
; Source:	OLFileSelectorRequestMoniker
; Destination:  GenFileSelector object using the fake file system
; Interception: Don't call super class
;
; Pass:		cx:dx	= fptr to PATH_BUFFER_SIZE buffer to fill
;			
; Return:	cx:dx	= same buffer, filled in with full path,
; 				including the volume name
;
;	ax - destroyed
;

MSG_GEN_FILE_SELECTOR_FAKE_VOLUME_NAME_GET	message
;
;
; Context:	Sent when we need the volume name for a given drive
;		either for the change drive popup or for the top
;		moniker, mostly.
;
;		Will return a dummy volume name, "[Dummy]", for a
;		RESPONDER pccom fake file selector.
;
; Source:	Global
; Destination:  GenFileSelector object using the fake file system
; Interception: Don't call super class
;
; Pass:		cx - number of drive or zero for current
;		dx:bp - buffer to write it to.
; Return:	ax - non-zero on error
;

MSG_GEN_FILE_SELECTOR_FAKE_ASSERT_HAVE_VOLUME_DATA	message
;
;
; Context:	We need to check to see if we have volume data..  We
; 		don't want to get into a long loop looking for volume
; 		names if we can't get volume data for some reason
; 		(connection problem, etc).
; Source:	
; Destination:  
; Interception: 
;
; Pass:		nothing
; Return:	ax - 0 if we have data
;

MSG_GEN_FILE_SELECTOR_FAKE_DRIVE_CHANGE	message
;
;
; Context:	The drive is changing - do what you need to do, and
; 		fetch the drive ident ("X:\0")
; 		
; Source:	OLFileSelectorChangeDrivePopupHandler
; Destination:  
; Interception: 
;
; Pass:		cl 	- drive to change to
;		bp:dx 	- fptr to dump the drive letter into
; Return:	ax 	- non-zero on error
;
;	- unchanged
;	- destroyed
;

MSG_GEN_FILE_SELECTOR_FAKE_FLUSH_CACHES	message
;
;
; Context:	We want all the old data to go away..
; Source:	Anybody..
; Destination:  a FileSelector with a FakeFileSystem
; Interception: 
;
; Pass:		nothing
;			
; Return:	nothing
;
;

MSG_GEN_FILE_SELECTOR_GET_SELECTION_TOKEN message
;
; Context:	Returns the GeodeToken of the selected file.  If the file is
;               a DOS file the dos extension (including the dot) is returned.
; Source:	Anyone
; Destination:	GenFileSelector object
;
; Pass:		cx:dx - address to copy GeodeToken to
;			(should be at least the size of GeodeToken)
; Return:	cx:dx - filled with selection's GeodeToken (fptr preserved)
;

protoreset

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

;
; file selection criteria for file types include in FileSelector file
; listing
;
FileSelectorFileCriteria	record
	;
	; Types of files to include in the listing
	; 
	FSFC_DIRS:1,			; include directories
	FSFC_NON_GEOS_FILES:1,		; include non-GEOS files
	FSFC_GEOS_EXECUTABLES:1,	; include GEOS executables
	FSFC_GEOS_NON_EXECUTABLES:1,	; include GEOS non-excutables
   	;
	; for files and (if FSFC_USE_MASK_FOR_DIRS is set) directories
	;
	FSFC_MASK_CASE_INSENSITIVE:1,	; matching against mask should be
					;  done in a case-insensitive manner.
	;
	; for all files (FSFC_NON_GEOS_FILES and/or FSFC_GEOS_EXECUTABLESS
	;	and/or FSFC_GEOS_NON_EXECUTABLES)
	;
	FSFC_FILE_FILTER:1		; use filter routine to evaluate
					;  each file accepted by other
					;  selection criteria
	FSFC_FILTER_IS_C:1		; the filter routine returned by
					;  MSG_GEN_FILE_SELECTOR_GET_FILTER_-
					;  ROUTINE is written in C and obeys the
					;  Pascal calling convention
	;
	; for GEOS files (FSFC_GEOS_EXECS_FILES and/or
	;	FSFC_GEOS_NON_EXECUTABLES)
	;
	FSFC_TOKEN_NO_ID:1,		; ignore manufacturer ID when comparing
					;	tokens (for FSFC_TOKEN_MATCH
					;	and FSFC_CREATOR_MATCH)
	;
	; for directories (FSFC_DIRS)
	;
	FSFC_USE_MASK_FOR_DIRS:1,	; also use _NAME_MASK attribute for
					;  directories (normally applied only to
					;  files)
	FSFC_USE_FAKE_FILE_SYSTEM:1,	; use the passed in scan
					; routine and dir change routine
	:6
FileSelectorFileCriteria	end

;
; general attributes for FileSelector
;
FileSelectorAttrs	record
	FSA_ALLOW_CHANGE_DIRS:1,	; allows changing to different
					;	directories.  If not set,
					;	directories are not opened
					;	automatically when the user
					;	double-clicks on them.  It is
					;	up to the application to send
					;	MSG_FILE_SELECTOR_OPEN_ENTRY
					;	to the GenFileSelector.
	:1,
	FSA_SHOW_FIXED_DISKS_ONLY:1,	; show only fixed disks in the volume
					;	listing
	FSA_SHOW_FILES_DISABLED:1,	; when showing a file, don't allow the
					;  user to select it; useful for
					;  Save As operations. Only the
					;  _NAME_MASK attribute and any filter
					;  routine, are obeyed in filtering,
					;  as we assume you set this attribute
					;  to show the user the files whose
					;  names are already taken.
	FSA_HAS_CLOSE_DIR_BUTTON:1,	; set if the corresponding gadget
	FSA_HAS_OPEN_DIR_BUTTON:1,	;	appear in the file selector
	FSA_HAS_DOCUMENT_BUTTON:1,
	FSA_HAS_CHANGE_DIRECTORY_LIST:1,
	FSA_HAS_CHANGE_DRIVE_LIST:1,
	FSA_HAS_FILE_LIST:1,
	FSA_USE_VIRTUAL_ROOT:1,		; set if information in
					; ATTR_GEN_FILE_SELECTOR_VIRTUAL_ROOT
					; should be used (allows turning on and
					; off 'virtual root' feature without
					; changing variable data)
	FSA_SHOW_WRITABLE_DISKS_ONLY:1	; show only writable disks in the
					;	volume listing
	:4
FileSelectorAttrs	end

;
; flags sent to AD as notification of new selection
;

GenFileSelectorEntryType etype byte, 0
	GFSET_FILE	enum	GenFileSelectorEntryType
	GFSET_SUBDIR	enum	GenFileSelectorEntryType
	GFSET_VOLUME	enum	GenFileSelectorEntryType

if not PASTA
GenFileSelectorEntryFlags	record
					; type of entry selected
	GFSEF_TYPE GenFileSelectorEntryType:2,
	GFSEF_OPEN:1,			; selection opened (double-click)
	GFSEF_NO_ENTRIES:1,		; no entries in list
	GFSEF_ERROR:1,			; error opening selection entry
					; (MSG_GEN_FILE_SELECTOR_OPEN_ENTRY or
					;  double-click)
	GFSEF_TEMPLATE:1,		; set if file is a template (from
					;  GFHF_TEMPLATE)
	GFSEF_SHARED_MULTIPLE:1,	; set if file is shared with multiple
					;  writers (from GFHF_SHARED_MULTIPLE)
	GFSEF_SHARED_SINGLE:1,		; set if file is shared with single
					;  writer (from GFHF_SHARED_SINGLE)
	GFSEF_READ_ONLY:1,		; set if file is read-only (from
					;  FA_RDONLY)
	GFSEF_PARENT_DIR:1,		; set if current selection is the
					;  parent directory entry (first entry)
	GFSEF_DISABLED:1,		; set if current selection is disabled
	:5
GenFileSelectorEntryFlags	end
else ; PASTA
GenFileSelectorEntryFlags	record
					; type of entry selected
	GFSEF_TYPE GenFileSelectorEntryType:2,
	GFSEF_OPEN:1,			; selection opened (double-click)
	GFSEF_NO_ENTRIES:1,		; no entries in list
	GFSEF_ERROR:1,			; error opening selection entry
					; (MSG_GEN_FILE_SELECTOR_OPEN_ENTRY or
					;  double-click)
	GFSEF_TEMPLATE:1,		; set if file is a template (from
					;  GFHF_TEMPLATE)
	GFSEF_SHARED_MULTIPLE:1,	; set if file is shared with multiple
					;  writers (from GFHF_SHARED_MULTIPLE)
	GFSEF_SHARED_SINGLE:1,		; set if file is shared with single
					;  writer (from GFHF_SHARED_SINGLE)
	GFSEF_READ_ONLY:1,		; set if file is read-only (from
					;  FA_RDONLY)
	GFSEF_PARENT_DIR:1,		; set if current selection is the
					;  parent directory entry (first entry)
	:6
GenFileSelectorEntryFlags	end
endif ; PASTA

GenFileSelectorMask		type	FileLongName
GenFileSelectorSelection	type	FileLongName

;-----------------------------------------------------------------------------
;		Variable Data
;-----------------------------------------------------------------------------

;
; A few pieces of data are held as variable data
;
GFSTempDataEntry	struct
	GFSTDE_selectionNumber	word
	GFSTDE_selectionFlags	GenFileSelectorEntryFlags
GFSTempDataEntry	ends

TEMP_GEN_FILE_SELECTOR_DATA	vardata	GFSTempDataEntry
	noreloc	TEMP_GEN_FILE_SELECTOR_DATA	; never saved to state...

;
; Additional data that control how the search is conducted. If one of these
; is specified, then its data will be matched against the file being
; enumerated.
;

ATTR_GEN_FILE_SELECTOR_TOKEN_MATCH	vardata	GeodeToken
;
;	Value for FEA_TOKEN comparison. If FSFC_TOKEN_NO_ID, then only
;	GT_chars need be set.
;

ATTR_GEN_FILE_SELECTOR_CREATOR_MATCH	vardata	GeodeToken
;
;	Value for FEA_CREATOR comparison. If FSFC_TOKEN_NO_ID, then only
;	GT_chars need be set.
;

GenFileSelectorFileAttrs	struct
    GFSFA_match		FileAttrs	; Attributes that must match
    GFSFA_mismatch	FileAttrs	; Attributes that must not match
GenFileSelectorFileAttrs	ends

ATTR_GEN_FILE_SELECTOR_FILE_ATTR	vardata GenFileSelectorFileAttrs
;
;	Value for FEA_FILE_ATTR. By default, in the absence of this attribute,
;	files/directories with FA_HIDDEN and FA_SYSTEM are screened out.
;

GenFileSelectorGeodeAttrs	struct
    GFSGA_match		GeodeAttrs	; Attributes that must match
    GFSGA_mismatch	GeodeAttrs	; Attributes that must not match
GenFileSelectorGeodeAttrs	ends

ATTR_GEN_FILE_SELECTOR_GEODE_ATTR	vardata GenFileSelectorGeodeAttrs
;
;	Data for FEA_GEODE_ATTR. First GeodeAttrs is for attributes
;	that must match. Second is for attributes that must not match.
;

ATTR_GEN_FILE_SELECTOR_NAME_MASK	vardata	GenFileSelectorMask
;
;	Wildcard pattern to use. If this attribute isn't defined, then no
;	comparison with the name will occur. The wildcarding used is slightly
;	different from standard DOS wildcarding, where a '.' is effectively
;	ignored (so "*.*" matches even files that don't have an extension).
;	In the wildcarding FileEnum provides, the '.' is meaningful, so if
;	you want to match all files whose names begin with "joe", the pattern
;	would be "joe*", not "joe*.*".
;

ATTR_GEN_FILE_SELECTOR_VIRTUAL_ROOT	vardata	GenFilePath
;
;	This is used to set a 'virtual root' for the file selector.  The
;	user will not be allowed to navigate above the 'virtual root' in
;	the directory tree, except with the "Change Drives" popup list
;	(which can be turned off by the developer).  Once the "Change Drives"
;	popup list is used, the user is then allowed to traverse anywhere in
;	the directory tree.  The 'virtual root' will be the topmost directory
;	displayed in the "Change Directory" popup list (at least until the user
;	uses the "Change Drives" popup list.  The "Close Directory" button will
;	be disabled when the virtual root is the current directory and it is
;	selected.  The GenFilePath data may be set up a .ui/.goc file, or
;	dynamically from the information returned by FileGetCurrentPath or
;	MSG_GEN_PATH_GET.
;

;ATTR_GEN_PATH_DATA			vardata GenFilePath
;
;	This is defined in GenClass, but you can use it with a file-selector
;	to set the initial path displayed by the file-selector. You can
;	set the GFP_disk field to a StandardPath constant to have it start
;	in that standard directory. In the absence of this attribute, the
;	file-selector will start out in SP_TOP.
;

;------------------------------------------------------------------------------
;		Generic Hints Supported
;------------------------------------------------------------------------------
HINT_FILE_SELECTOR_NUMBER_OF_FILES_TO_SHOW		vardata	word
;
;	Specifies the number of files/directories to show at once.
;	Maximum of 255.
;

;
; The following is used to support a scalable UI in the GenFileSelector,
; based on the app features (MSG_GEN_APPLICATION_GET_APP_FEATURES)
;
; The HINT_FILE_SELECTOR_SCALABLE_UI_DATA takes an array of
; GenFileSelectorScalableUIEntry sturctures, usually one element with
; GFSSUIC_SET_FEATURES_IF_APP_FEATURE_ON (to specify the FileSelectorAttrs
; for the case when the app feature is on) and one element with
; GFSSUIC_SET_FEATURES_IF_APP_FEATURE_OFF (to specify the FileSelectorAttrs
; for the case when the app feature is off)
;
GenFileSelectorScalableUICommand	etype	byte
GFSSUIC_SET_FEATURES_IF_APP_FEATURE_ON	enum GenFileSelectorScalableUICommand
GFSSUIC_SET_FEATURES_IF_APP_FEATURE_OFF	enum GenFileSelectorScalableUICommand
GFSSUIC_ADD_FEATURES_IF_APP_FEATURE_ON	enum GenFileSelectorScalableUICommand
GFSSUIC_SET_FEATURES_IF_APP_LEVEL	enum GenFileSelectorScalableUICommand
GFSSUIC_ADD_FEATURES_IF_APP_LEVEL	enum GenFileSelectorScalableUICommand

GenFileSelectorScalableUIEntry	struct
	GFSSUIE_command		GenFileSelectorScalableUICommand
	GFSSUIE_appFeature	word
	GFSSUIE_fsFeatures	FileSelectorAttrs
GenFileSelectorScalableUIEntry	ends

HINT_FILE_SELECTOR_SCALABLE_UI_DATA	vardata GenFileSelectorScalableUIEntry

TEMP_GEN_FILE_SELECTOR_DIR_IDS	vardata	FilePathID 	; array of IDs for the
							;  current directory

HINT_FILE_SELECTOR_FILE_LIST_WIDTH		vardata word
;
; Width of file list.  Specify as a number of average width characters.
; Maximum of 255.
;

HINT_FILE_SELECTOR_USE_DESKTOP_HOME		vardata
;
; Internal hint used by PMBA/WShellBA
;

TEMP_GEN_FILE_SELECTOR_HOME_DIRECTORY		vardata PathName
;
; Internal hint used by PMBA
;

HINT_FILE_SELECTOR_SINGLE_ACTION		vardata
;
; Indicates that only one action can be taken using the file selector.
; Used by some SPUIs to allow user to single click to open directories.
;

HINT_FILE_SELECTOR_SHOW_FILE_SIZE		vardata
;
; Indicates that file selector should display file sizes, if possible.
; (Currently not generally supported.)
;


protominor	UINewForNike

GenFileSelectorFileHeaderFlags        struct
    GFSFHF_match      GeosFileHeaderFlags    ; Attributes that must match
    GFSFHF_mismatch   GeosFileHeaderFlags    ; Attributes that must not match
GenFileSelectorFileHeaderFlags        ends

ATTR_GEN_FILE_SELECTOR_FILE_HEADER_FLAGS vardata GenFileSelectorFileHeaderFlags
;
; Data for FEA_FLAGS. First GeosFileHeaderFlags is for flags that must match.
; Second is for flags that must not match.  (Matches/mismatches files only.)
;

protoreset

protominor UINewForResponder_2

HINT_FILE_SELECTOR_SHOW_SELECTION_EVEN_WHEN_NOT_FOCUS	vardata
;
; Scrolling lists in some UI's (namely Rudy) don't show the selection
; when the focus is not on the list.   This hint forces the selection 
; to be shown for some unusual cases, where objects take the focus from
; the FS list, but the FS list still appears to the user to have the focus
; and be navigable.
;

HINT_FILE_SELECTOR_MINIMIZE_WIDTH		vardata
;
; Some specific UI's (e.g., Rudy) columnate file selector entries, making 
; entries too wide for some applications.  Use this hint to keep entry 
; widths minimal.
;

protoreset

protominor UINewForResponder_3

HINT_FILE_SELECTOR_ALWAYS_SORT_ALPHABETICALLY	vardata
;
; Some specific UI's (e.g., Rudy) cause file selectors to sort entries
; based on date/time or other criteria.  This hint will ensure that
; entries are alphabetically sorted (with directories appearing before
; files).
;

HINT_FILE_SELECTOR_DONT_SORT			vardata
;
; Sometimes the user might not want any default sorting to be done by
; the file selector.  For example, Motif defaults to sorting alpha-
; betically.  Use this hint to avoid sorting at all.  Also, file
; selectors using a fake file system (FSFC_USE_FAKE_FILE_SYSTEM) can
; use this hint if they do some kind of sorting that they don't want 
; the regular file selector code to mess with.
;

HINT_FILE_SELECTOR_REVERSE_SORT			vardata
;
; Used to reverse the default sort order.  Directories remain at the top of
; the list, reverse sorted.  Used only when sorting.
;

protoreset

protominor UINewForGPC

ATTR_GEN_FILE_SELECTOR_FILE_ENUM_FILTER		vardata	fptr
;
; If you find subclassing the FileSelector just to return a fptr silly,
; as I do, you can put the fptr to your callback in this vardata instead.
; MSG_GEN_FILE_SELECTOR_GET_FILE_ENUM_ROUTINE will check here before
; returning zero...
;

protoreset

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

    GFSI_selection	GenFileSelectorSelection <0>	; selection
    ;
    ; current selection
    ;
    ; This saves the current selection within the current directory across
    ; a shutdown.  Usually left blank when defining a GenFileSelector in a
    ; .ui file but can be set with MSG_GEN_FILE_SELECTOR_SET_SELECTION.

    GFSI_fileCriteria	FileSelectorFileCriteria mask FSFC_DIRS or \
					       mask FSFC_NON_GEOS_FILES or \
					       mask FSFC_GEOS_EXECUTABLES or \
					       mask FSFC_GEOS_NON_EXECUTABLES
    ; File selection criteria, including the type of files to list.
    ;
    ; This can be set in the .ui file or with
    ; MSG_GEN_FILE_SELECTOR_SET_FILE_CRITERIA to furthur specify the types of
    ; files to show. Most of the additional criteria are specified with vardata,
    ; but these flags can alter the interpretation of those values.

							; attributes
    GFSI_attrs	FileSelectorAttrs (mask FSA_ALLOW_CHANGE_DIRS or \
				mask FSA_HAS_CLOSE_DIR_BUTTON or \
				mask FSA_HAS_OPEN_DIR_BUTTON or \
				mask FSA_HAS_DOCUMENT_BUTTON or \
				mask FSA_HAS_CHANGE_DIRECTORY_LIST or \
				mask FSA_HAS_CHANGE_DRIVE_LIST or \
				mask FSA_HAS_FILE_LIST)
    ;
    ; File Selector attributes
    ;
    ; This can be used in the .ui file or set with
    ; MSG_GEN_FILE_SELECTOR_SET_ATTRS to specify how the FileSelector will
    ; behave.

    GFSI_destination	optr				; action
    GFSI_notificationMsg	word
    ; optr and method to send as notification of user-selection.  If left
    ; blank, no notification will be sent.  The optr is sent the following
    ; information:
    ;	cx - entry # of selection made
    ;	bp - GenFileSelectorEntryFlags:
    ;		GFSEF_TYPE - type of entry that current selection is
    ;			GFSET_FILE - if selection is a regular file
    ;			GFSET_SUBDIR - if selection is a subdirectory
    ;			GFSET_VOLUME - if selection is a volume
    ;		GFSEF_OPEN - selection opened (double-click)
    ;		GFSEF_NO_ENTRIES - set if no entries selected
    ;		GFSEF_ERROR - set if error opening entry
    ;				(note that this is asynchronous with the
    ;				 actual error and should only be treated as
    ;				 notification)
    ;		GFSEF_TEMPLATE - set if file is a template (from
    ;				 GFHF_TEMPLATE)
    ;		GFSEF_SHARED_MULTIPLE - set if file is shared with multiple
    ;					writers (from GFHF_SHARED_MULTIPLE)
    ;		GFSEF_SHARED_SINGLE - set if file is shared with single
    ;				      writer (from GFHF_SHARED_SINGLE)
    ;		GFSEF_READ_ONLY - set if file is read-only (from FA_RDONLY)
    ;		GFSEF_PARENT_DIR - set if current selection is the
    ;				parent directory entry (first entry)
    ; Can be set in the .ui file or with MSG_GEN_FILE_SELECTOR_SET_ACTION

GenFileSelectorClass	endc

EndLibrary	ui
