;
; fontMenu.sh
;
; Fontmenu creation
;
;  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:
;
;  fm_create
;  fm_tickFont
;  fm_init

		[	:LNOT::DEF:fontMenu__dfn
		GBLL	fontMenu__dfn

; --- fm_create ---
;
; On entry:	R0 == current font name
;		R1 == handler to call when selection made
;		R2 == R10 value to call with
;		R3 == R12 value to call with
;		R4 == pointer to routine to call to create submenu
;		      (ie. menu_create or tms_create)
;
; On exit:	CS if any fonts exist and
;                 R0 == pointer to a menu definition
;		  R1 == event handler to call
;		  R2 == R10 value for event handler
;		  R3 == R12 value for event handler
;		else CC and
;		  R0-R3 corrupted
;		May return an error
;
; Use:		Creates a user menu definition suitable for passing directly
;		to (menu|tms)_create. Note however, that the menu defintion
;		does *not* include any title; this must be created first.
;		If you require items such as the system font, then
;		add these to the menu before creating the menu returned
;		from this call.

		IMPORT	fm_create

; --- fm_tickFont ---
;
; On entry:	R0 == name to tick
;
; On exit:	--
;
; Use:		Ticks the font with tht given name in the fontmenu. If
;		no font exists then the existing ticks are removed

		IMPORT	fm_tickFont

; --- fm_init ---
;
; On entry:	--
;
; On exit:	--
;
; Use:		Initialises the font menu system.

		IMPORT	fm_init

		]

;----- Events ---------------------------------------------------------------

		^	0
fmEvent_select	#	1			;User selected a font
						;R1 == pointer to name

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

		END
