;
; template.sh
;
; Load window template resources
;
;  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:
;
;  template_find
;  template_copy
;  template_embedded
;  template_free
;  template_load
;  template_init

		[	:LNOT::DEF:template__dfn
		GBLL	template__dfn

; --- template_find ---
;
; On entry:	R0 == pointer to name to match
;
; On exit:	R0 == pointer to window definition if found
;		May return an error
;
; Use:		Locates a template in the list and gives you a pointer to
;		the corresponding window defintion.  You may update the
;		definition to store an updated window state if you really
;		want to.

		IMPORT	template_find

; --- template_copy ---
;
; On entry:	R0 == pointer to name to match
;
; On exit:	R0 == pointer to copy of a window definition
;		May return an error
;
; Use:		Returns a copy of a window template (for the use of the
;		dialogue box system mainly), including all indirected data
;		set up properly and everything.  The copy is writable.  To
;		get rid of the copy, call template_free.

		IMPORT	template_copy

; --- template_embedded ---
;
; On entry:	R0 == pointer to embedded template definition
;
; On exit:	R0 == pointer to copy (as for template_copy)
;
; Use:		Extracts an embedded template into a template block.
;		Embedded templates can be generated using the templAOF
;		program, and then linked into your application.

		IMPORT	template_embedded

; --- template_free ---
;
; On entry:	R0 == pointer to block allocated with template_copy
;
; On exit:	--
;
; Use:		Frees a template copy created using template_copy.

		IMPORT	template_free

; --- template_load ---
;
; On entry:	R0 == pointer to name of template file to load
;
; On exit:	May return an error
;
; Use:		Loads the specified template file, and adds its window
;		definitions into the template list so they can be used when
;		creating dialogue boxes or windows.
;
;		If the templates can't be loaded (e.g. there isn't enough
;		memory) an error is generated (and can be caught using the
;		standard Sapphire except mechanism).

		IMPORT	template_load

; --- template_init ---
;
; On entry:	R0 == pointer to application name
;
; On exit:	--
;
; Use:		Initialises the template list and font array, and loads the
;		`Templates' resource file.

		IMPORT	template_init

		]

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

		END
