;
; dbx.fileIcon.sh
;
; Draggable file icons as dbx controls
;
;  1994-1998 Straylight
;

;----- Licensing note -------------------------------------------------------
;
; This file is part of Straylight's Sapphire library.
;
; Sapphire is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2, or (at your option)
; any later version.
;
; Sapphire is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with Sapphire.  If not, write to the Free Software Foundation,
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

;----- Overview -------------------------------------------------------------
;
; Functions provided:
;
;  fileIcon_sprName
;  fileIcon_reAppear
;  fileIcon_closed
;
; Controls provided:
;
;   fileIcon
;
; Macros provided:
;
;   FILEICN

		GET	sapphire:dbx.dbx

		[	:LNOT::DEF:fileIcon__dfn
		GBLL	fileIcon__dfn

; --- fileIcon_sprName ---
;
; On entry:	R0 == filetype
;		R1 == pointer to filename
;
; On exit:	R0 == pointer to sprite name to use
;
; Use:		Works out the sprite name to use for the given filetype and
;		name pair.

		IMPORT	fileIcon_sprName

; --- fileIcon_reAppear ---
;
; On entry:	--
;
; On exit:	--
;
; Use:		Makes the currently vanished file icon reappear.

		IMPORT	fileIcon_reAppear

; --- fileIcon_closed ---
;
; On entry:	R0 == dialogue box handle
;
; On exit:	--
;
; Use:		Informs fileIcon that the specified dialogue box has closed.

		IMPORT	fileIcon_closed

; --- fileIcon ---
;
; Control data:	+0
;
; Workspace:	+0 == filetype of object to display
;		+4 == address of filename
;		+8
;
; Flags:	--
;
; Use:		Control which displays a filetype icon, and allows it to
;		be dragged.

		IMPORT	fileIcon

;----- Macros and symbols ---------------------------------------------------

		MACRO
$label		FILEICN	$icon,$baseReg,$data

$label		CONTROL	$icon,fileIcon,$baseReg,0,$data
		ECTRL

		MEND

fIcon_event	EQU	&80000003		;File icon dropped
						;R1 == icon handle
						;R2 == dest window handle
						;R3 == dest icon handle

		]

;----- That's all, folks ----------------------------------------------------

		END
