COMMENT @=====================================================================

	Copyright (c) GeoWorks 1992 -- All Rights Reserved

PROJECT:	PC GEOS
MODULE:		Shell Library
FILE:		shell.def

AUTHOR:		Martin Turon, Oct  2, 1992

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	martin	10/ 2/92	Initial version


DESCRIPTION:
	This file defines shell structures and routines

RCS STAMP:		
	$Id: shell.def,v 1.1 97/04/04 14:24:29 newdeal Exp $

=============================================================================@

SetDef	__SHELL

StartLibrary	shell

;-------------------------------------------------------
; 	Types, Constants & Structures
;-------------------------------------------------------

;---------------------------------------------------------------------------
;		SHELL BUFFER STRUCTURES and CONSTANTS
;---------------------------------------------------------------------------
SHELL_BUFFER_MAX_LINE_LENGTH	= 500
;
; The ShellBuffer is essentially a memory block 
; with a ShellBuffer structure as its header.
; The portion of the file that is desired to be read
; is copied into the SB_buffer offset.
; Future expansions: add linkage for multiple blocks.
;
ShellBuffer		struct
	SB_fileHandle		hptr
	SB_bufferHandle		hptr.ShellBufferHeader
	SB_offset		nptr.char		; to current line
	SB_nextLine		nptr.char		; may be cut off
	SB_bufferEnd		nptr.char; pt to char after last char from file
	SB_buffer		char	SHELL_BUFFER_MAX_LINE_LENGTH dup (??)
ShellBuffer		ends


;-------------------------------------------------------
; 	Structures for dealing with Error Dialogs
;-------------------------------------------------------

ReportErrorExtraStringType	etype	byte
	REEST_NONE		enum ReportErrorExtraStringType
	REEST_FPTR		enum ReportErrorExtraStringType
	REEST_HPTR		enum ReportErrorExtraStringType
	REEST_OPTR		enum ReportErrorExtraStringType

ReportErrorFlags record
	REF_GENERIC_ERROR_AVAILABLE:1
ReportErrorFlags end

ErrorTableEntryFlags	record
	ETF_SHOW_EXTRA_STRING:1		; show extra string passed in
	ETF_NO_CANCEL:1			; no CANCEL button
	ETF_NOTICE:1			; a notice instead of an error
	ETF_PROMPT:1			; for prompting (OK/CANCEL, notice)
	ETF_SYS_MODAL:1			; make error box sys modal (app launch)
	:11				; force a word-size
ErrorTableEntryFlags	end

ErrorTableEntry	struct
	ETE_error	word
	ETE_string	optr.char
	ETE_flags	ErrorTableEntryFlags
ErrorTableEntry	ends

ERROR_TABLE_LAST_ENTRY	 = -1
REPORT_GENERIC_NO_STRING = (mask REF_GENERIC_ERROR_AVAILABLE shl 8) + REEST_NONE
REPORT_GENERIC_FPTR 	 = (mask REF_GENERIC_ERROR_AVAILABLE shl 8) + REEST_FPTR
REPORT_GENERIC_HPTR 	 = (mask REF_GENERIC_ERROR_AVAILABLE shl 8) + REEST_HPTR
REPORT_GENERIC_OPTR 	 = (mask REF_GENERIC_ERROR_AVAILABLE shl 8) + REEST_OPTR

;-------------------------------------------------------
; 	Structures for dealing with paths
;-------------------------------------------------------
PathBuffer	struct
	PB_handle	hptr.PathBuffer
	PB_path		PathName		<>
PathBuffer	ends

PathBuffer2	struct
	PB2_handle	hptr.PathBuffer2
	PB2_path1	PathName		<>
	PB2_path2	PathName		<>
PathBuffer2	ends

;-------------------------------------------------------
; 	Structures for dealing with tokens
;-------------------------------------------------------
TokenMoniker	struct
	TM_token	TokenChars
	TM_moniker	optr			; pointer to MonikerList
TokenMoniker	ends

TOKEN_MONIKER_END_OF_LIST	= -1

ShellDefineTokenFlags	record
	SDTF_FORCE_OVERWRITE:1		; define every token in list,
					; even if they already exist
	SDTF_CALLBACK_DEFINED:1,	; call a callback routine for
					; each token defined
	SDTF_CALLBACK_PROCESSED:1,	; call a callback routine for
					; each token processed
	:13
ShellDefineTokenFlags	end


IconLookupTableHeader	struct
	ILTH_tableSize	word			; size of icon lookup table
	ILTH_table	label GeodeToken	; start of table
IconLookupTableHeader	ends

;-------------------------------------------------------
; 	Structures for dealing with DirInfo files
;-------------------------------------------------------
;
; The DIRINFO.VM file exists in every directory which needs to
; remember something special about itself.  It was created as a place
; to store position information of icons, but other information could
; be added easily.
; - Add information about the folder 
;	(color, placement, type) in DirInfoFileHeader 
; - Add information about individual files in DirInfoFileEntry
;
; Note: Since DIRINFO.VM could potentially exist in EVERY directy,
; 	avoid using/creating it if at all possible.
;	If no DIRINFO.VM file is found, the Desktop will assume DOS
;	order, and none will be created. 
;
; What follows are the structures that are contained in the map block
; of the DIRINFO.VM file.  It consists of a header containing window
; (folder) specific information, and a pointer to a chunk array of
; file (icon) specific information. 
;

DIRINFO_PROTOCOL_NUM = 4 	; protocol number of dirinfo file
				; updated to 4 to add DIFH_displayOptions
				; (12/24/98)

DirInfoFileHeader	struct
	DIFH_header		LMemBlockHeader
	DIFH_protocol		byte	; protocol number of the dirinfo file
  					; If any changes are made to the
					; format of the dirinfo file,
					; this number must be updated,
					; so old versions will be delt
					; with correctly. 
	DIFH_posArray		lptr		; pointer to array of info 
	DIFH_winSize		SpecWinSizePair
	DIFH_winPosition	SpecWinSizePair
	DIFH_displayOptions	dword
DirInfoFileHeader	ends

DirInfoFileEntryFlags	record
	DIFEF_PERCENTAGE:1
DirInfoFileEntryFlags	end


DirInfoFileEntry	struct
	DIFE_position	Point		; top left corner of bounding
					; box of this icon
	DIFE_flags	DirInfoFileEntryFlags

	DIFE_fileID	FileID		; Identifier for this file,
					; unique within the directory

DirInfoFileEntry	ends

;-------------------------------------------------------
;		Class definitions
;-------------------------------------------------------

IconListClass	class	GenDynamicListClass

MSG_ICON_LIST_GET_SELECTED		message
;
; Returns the token of the selected icon.  If no icon is
; selected returns the first icon in the list.
;
; Pass:		nothing
; Return:	ax:cx:dx	= GeodeToken
;		carry flag	= set if no token selected
;				  clear otherwise
; Destroyed:	bp
;

MSG_ICON_LIST_SET_TOKEN_OF_FILE		message
;
; Sets the token of the given file to that of the current
; selection. 
;	
; Pass:		cx:dx	= filename
; Return:	nothing
; Destroyed:	ax, cx, dx, bp
;

MSG_ICON_LIST_SET_TOKEN_LIST		message
;
; Sets the list of icons to be displayed, and redraws.
;	
; Pass:		^ldx:cx	= GeodeToken lookup table
; Return:	nothing
; Destroyed:	ax, cx, dx, bp
;

MSG_ICON_LIST_INITIALIZE		message
;
; Build a table if necessary, and display all items.
;	
; Pass:		nothing
; Return:	nothing
; Destroyed:	ax, cx, dx, bp
;

MSG_ICON_LIST_SET_SELECTION_TO_TOKEN	message
;
; Sets the current selection to that of the given token.
; If given token not found, does nothing.
;
; Pass:		bp:cx:dx	= GeodeToken
; Return:	nothing
; Destroyed:	ax, cx, dx, bp
;

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

	ILI_lookupTable		optr.IconLookupTableHeader
IconListClass	endc



IconDisplayClass	class	GenGlyphClass

MSG_ICON_DISPLAY_GET_CURRENT_ICON	message
;
; Updates the display with the icon selected in the associated
; IconList.
;
; Pass: 	nothing
; Return:	nothing
; Destroyed:	ax, cx, dx, bp
;

MSG_ICON_DISPLAY_SET_ICON	message
;
; Updates the display with the given token.	
;
; Pass:		bp:cx:dx	= GeodeToken	
; Return:	nothing
; Destroyed:	ax, cx, dx, bp
;
;
;
;

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

	IDI_iconList	optr			; pointer to associated list

IconDisplayClass	endc


;---------------------------------------------------------------------------
;		SHELL ROUTINES
;---------------------------------------------------------------------------

;-------------------------------------------------------
;		File Module Routines
;-------------------------------------------------------
global	ShellSetObjectType:far
global	ShellGetObjectType:far
global	ShellSetToken:far
global	ShellGetToken:far
global 	ShellSetFileHeaderFlags:far
global	ShellPushToRoot:far
global	ShellGetFileHeaderFlags:far
global	ShellDropFinalComponent:far

;-------------------------------------------------------
;		Util Module Routines
;-------------------------------------------------------
global	ShellBuildFullFilename:far
global	ShellCombineFileAndPath:far
global	FileComparePathsEvalLinks:far
global 	ShellAllocPathBuffer:far
global	ShellAlloc2PathBuffers:far
global  ShellFreePathBuffer:far

;-------------------------------------------------------
;		Icon Module Routines
;-------------------------------------------------------
global	ShellLoadMoniker:far
global	ShellDefineTokens:far

;-------------------------------------------------------
;		DirInfo Module Routines
;-------------------------------------------------------
global	ShellCreateDirInfo:far
global	ShellOpenDirInfo:far
global	ShellOpenDirInfoRW:far
global	ShellCloseDirInfo:far
global	ShellSearchDirInfo:far
global	ShellSetPosition:far
global	ShellGetPosition:far
global	ECCheckDirInfo:far

;-------------------------------------------------------
;		Dialog Module Routines
;-------------------------------------------------------
global	ShellReportFileError:far
global	ShellReportError:far

;-------------------------------------------------------
;		FQT Module Routines (FileQuickTransfer)
;-------------------------------------------------------
global	ShellGetTrueDiskHandleFromFQT:far
global	ShellGetRemoteFlagFromFQT:far

;-------------------------------------------------------
;		HugeFile Module Routines
;-------------------------------------------------------
global	ShellBufferOpen:far
global	ShellBufferClose:far
global	ShellBufferReadLine:far
global	ShellBufferReadNLines:far
global	ShellBufferLock:far
global	ShellBufferUnlock:far

;-------------------------------------------------------
;		C Stubs
;-------------------------------------------------------
global  SHELLREPORTFILEERROR:far

EndLibrary	shell



