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

	Copyright (c) GeoWorks 1989 -- All Rights Reserved

PROJECT:	PC GEOS
FILE:		clipbrd.def

DECLARER:	UI

DESCRIPTION:
	This file defines clipboard stuff

	$Id: clipbrd.def,v 1.1 97/04/04 14:18:09 newdeal Exp $

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

SetDef	__CLIPBRD

StartLibrary	ui

include geoworks.def

global ClipboardRegisterItem:far
global ClipboardUnregisterItem:far
global ClipboardQueryItem:far
global ClipboardTestItemFormat:far
global ClipboardEnumItemFormats:far
global ClipboardGetItemInfo:far
global ClipboardRequestItemFormat:far
global ClipboardDoneWithItem:far
global ClipboardGetNormalItemInfo:far
global ClipboardGetQuickItemInfo:far
global ClipboardGetUndoItemInfo:far
global ClipboardGetClipboardFile:far
global CLIPBOARDOPENCLIPBOARDFILE:far
ClipboardOpenClipboardFile	equ	CLIPBOARDOPENCLIPBOARDFILE
global CLIPBOARDCLOSECLIPBOARDFILE:far
ClipboardCloseClipboardFile	equ	CLIPBOARDCLOSECLIPBOARDFILE
global ClipboardAddToNotificationList:far
global ClipboardRemoveFromNotificationList:far
global ClipboardRemoteSend:far
global ClipboardRemoteReceive:far
global ClipboardFreeItem:far
global ClipboardFreeFormat:far

global ClipboardFreeItemsNotInUse:far	;Internal, currently Redwood only

;-----------------------------------------------------------------------------
;	Imported method documentation
;-----------------------------------------------------------------------------

;MSG_META_CLIPBOARD_NOTIFY_QUICK_TRANSFER_FEEDBACK	method	MetaUIMessages
;MSG_META_CLIPBOARD_NOTIFY_QUICK_TRANSFER_CONCLUDED	method	MetaUIMessages
;
; see documentation in ui.def
;

ClipboardQuickNotifyFlags	record
	CQNF_ERROR:1,
	CQNF_SOURCE_EQUAL_DEST:1,
	CQNF_MOVE:1,
	CQNF_COPY:1,
	CQNF_NO_OPERATION:1,
	CQNF_UNUSED:11
ClipboardQuickNotifyFlags	end

;MSG_META_CLIPBOARD_CUT					method	MetaUIMessages
;MSG_META_CLIPBOARD_COPY				method	MetaUIMessages
;MSG_META_CLIPBOARD_PASTE				method	MetaUIMessages
;MSG_META_SELECT_ALL					method	MetaUIMessages
;MSG_META_DELETE					method	MetaUIMessages
;MSG_META_CLIPBOARD_NOTIFY_TRANSFER_ITEM_FREED		method	MetaUIMessages
;MSG_META_CLIPBOARD_NOTIFY_NORMAL_TRANSFER_ITEM_CHANGED	method	MetaUIMessages
;
; see documentation in ui.def
;

;-----------------------------------------------------------------------------
;	Structures used for transfers
;-----------------------------------------------------------------------------

CLIPBOARD_MAX_FORMATS	equ	10

;
; formats are identified by two words, one is a manufacturer ID and the other
; is a manufacturer-specific value that specifies the actual format
;
ClipboardItemFormatID	struct
	CIFID_manufacturer	ManufacturerID
	CIFID_type		word
ClipboardItemFormatID	ends

;ClipboardItemFlags	record	TIF_RAW:1, CIF_QUICK:1, TIF_UNUSED:14
;no RAW format for 2.0 (must keep position of relevant bits the same as
;scrapbook data file stores this record)
ClipboardItemFlags	record	CIF_UNUSED1:1, CIF_QUICK:1, CIF_UNUSED2:14


SBCS< CLIPBOARD_ITEM_NAME_LENGTH	=	32	>
DBCS< CLIPBOARD_ITEM_NAME_LENGTH	=	15	>

SBCS< ClipboardItemNameBuffer	type	CLIPBOARD_ITEM_NAME_LENGTH+1 dup (char)   >
DBCS< ClipboardItemNameBuffer	type	CLIPBOARD_ITEM_NAME_LENGTH+1 dup (wchar)  >


;
; A clipboard item header contains all of the data for the item
; in all formats supported by the owner.  Each format is identified
; by a structure that stores the format type, two words of format-
; specific extra data, and the VM block handle of the first VM block
; in a chain of VM data blocks for the format.
;
ClipboardItemFormatInfo	struct
	;
	; two words of format identification
	;
	CIFI_format		ClipboardItemFormatID

	;
	; two words of format-specific extra data
	;	(not used for CIF_TEXT, gstring size for CIF_GRAPHICS_STRING,
	;	 not used for CIF_FILES)
	;
	CIFI_extra1		word
	CIFI_extra2		word

	;
	; VM block handle of first block in linked chain of data blocks
	;
	CIFI_vmChain		dword

	;
	; token of application that knows how to render this format
	; (not currently used)
	;
	CIFI_renderer		GeodeToken <>
ClipboardItemFormatInfo	ends


;
; Clipboard item header - this is the block passed to
; ClipboardRegisterItem, ClipboardRequestItemFormat, ClipboardDoneWithItem and
; returned from ClipboardQueryItem
;	(offsets inside this structure same for DBCS and SBCS)
;
ClipboardItemHeader	struct
	;
	; owner of the transfer item - this is is cleared when a clipboard
	; item is saved to disk when shutting down.  Note that only normal
	; transfer items persist across shutdown.
	;
	CIH_owner		optr

	;
	; quick/normal (quick item is only temporary)
	;
	CIH_flags		ClipboardItemFlags

	;
	; name of this clipboard item
	;
	CIH_name		ClipboardItemNameBuffer
DBCS<	CIH_pad0DBCS		char	; Must keep offsets the same!	>

	;
	; number of data formats available
	;
	CIH_formatCount	word

	;
	; Optr of additional info about transfer item source (used to
	; determine default move/copy behavior during quick transfer).
	; "source document ID" -- most things will want to put the optr
	; of the parent GenDocument object here
	;
	CIH_sourceID	optr

	;
	; data formats available ordered from most informative
	; (includes VM block handles containing data for the format)
	;	(all formats for a given transfer item must be in
	;	 the  same VM file)
	;
	CIH_formats	ClipboardItemFormatInfo	CLIPBOARD_MAX_FORMATS dup (<>)

	;
	; reserved for future expansion (must be 0 for now)
	;
	CIH_reserved	dword

ClipboardItemHeader	ends


	;
	; the map block of the transfer VM file, this is saved out in the
	; UIs transfer VM file when the system is shutdown.  The VM block
	; handles must be valid handles for this VM transfer file.
	;
TransferFileHeader	struct
	TFH_normalItem	word	; VM block handle of normal transfer item
TransferFileHeader	ends

;-----------------------------------------------------------------------------
;	Routines and structures for quick transfer support
;-----------------------------------------------------------------------------

global ClipboardStartQuickTransfer:far
global ClipboardGetQuickTransferStatus:far
global ClipboardSetQuickTransferFeedback:far
global ClipboardEndQuickTransfer:far
global ClipboardAbortQuickTransfer:far
global ClipboardClearQuickTransferNotification:far
global ClipboardHandleEndMoveCopy:far

;
; flag to ClipboardStartQuickTransfer to say whether or not to use region
;
ClipboardQuickTransferFlags	record
	CQTF_IN_PROGRESS:1,		; in progress (used internally only)
	CQTF_COPY_ONLY:1,		; if source only supports copying
	CQTF_USE_REGION:1,		; use region
	CQTF_NOTIFICATION:1		; set if the quick-transfer source
					;	wants to be notified when the
					;	transfer item has been processed
	:12
ClipboardQuickTransferFlags	end

;
; stack parameters to ClipboardStartQuickTransfer, IF using region for QT cursor
;
ClipboardQuickTransferRegionInfo	struct
	CQTRI_paramAX	word
	CQTRI_paramBX	word
	CQTRI_paramCX	word
	CQTRI_paramDX	word
	CQTRI_regionPos	Point
	CQTRI_strategy	dword
	CQTRI_region	dword
ClipboardQuickTransferRegionInfo	ends

;
; parameters to ClipboardSetQuickTransferFeedback
;
ClipboardQuickTransferFeedback	etype	word
CQTF_SET_DEFAULT				enum ClipboardQuickTransferFeedback
	; sets default modal cursor (used internally)
CQTF_CLEAR_DEFAULT			enum ClipboardQuickTransferFeedback
	; clears default modal cursor (used internally)
CQTF_MOVE				enum ClipboardQuickTransferFeedback
	; sets move cursor
CQTF_COPY				enum ClipboardQuickTransferFeedback
	; sets copy cursor
CQTF_CLEAR				enum ClipboardQuickTransferFeedback
	; clears move/copy cursor


;-----------------------------------------------------------------------------
;		C stub routines
;-----------------------------------------------------------------------------

global	CLIPBOARDREGISTERITEM:far
global	CLIPBOARDUNREGISTERITEM:far
global	CLIPBOARDQUERYITEM:far
global	CLIPBOARDTESTITEMFORMAT:far
global	CLIPBOARDENUMITEMFORMATS:far
global	CLIPBOARDGETITEMINFO:far
global	CLIPBOARDREQUESTITEMFORMAT:far
global	CLIPBOARDDONEWITHITEM:far
global	CLIPBOARDGETNORMALITEMINFO:far
global	CLIPBOARDGETQUICKITEMINFO:far
global	CLIPBOARDGETUNDOITEMINFO:far
global	CLIPBOARDGETCLIPBOARDFILE:far
global	CLIPBOARDADDTONOTIFICATIONLIST:far
global	CLIPBOARDREMOVEFROMNOTIFICATIONLIST:far
global  CLIPBOARDREMOTESEND:far
global  CLIPBOARDREMOTERECEIVE:far
global	CLIPBOARDSTARTQUICKTRANSFER:far
global	CLIPBOARDGETQUICKTRANSFERSTATUS:far
global	CLIPBOARDSETQUICKTRANSFERFEEDBACK:far
global	CLIPBOARDENDQUICKTRANSFER:far
global	CLIPBOARDABORTQUICKTRANSFER:far
global	CLIPBOARDCLEARQUICKTRANSFERNOTIFICATION:far
global	CLIPBOARDHANDLEENDMOVECOPY:far

EndLibrary	ui
