Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / template
1 ;
2 ; template.sh
3 ;
4 ; Load window template resources
5 ;
6 ; © 1994-1998 Straylight
7 ;
8
9 ;----- Licensing note -------------------------------------------------------
10 ;
11 ; This file is part of Straylight's Sapphire library.
12 ;
13 ; Sapphire is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
16 ; any later version.
17 ;
18 ; Sapphire is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ; GNU General Public License for more details.
22 ;
23 ; You should have received a copy of the GNU General Public License
24 ; along with Sapphire. If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27 ;----- Overview -------------------------------------------------------------
28 ;
29 ; Functions provided:
30 ;
31 ; template_find
32 ; template_copy
33 ; template_embedded
34 ; template_free
35 ; template_load
36 ; template_init
37
38 [ :LNOT::DEF:template__dfn
39 GBLL template__dfn
40
41 ; --- template_find ---
42 ;
43 ; On entry: R0 == pointer to name to match
44 ;
45 ; On exit: R0 == pointer to window definition if found
46 ; May return an error
47 ;
48 ; Use: Locates a template in the list and gives you a pointer to
49 ; the corresponding window defintion. You may update the
50 ; definition to store an updated window state if you really
51 ; want to.
52
53 IMPORT template_find
54
55 ; --- template_copy ---
56 ;
57 ; On entry: R0 == pointer to name to match
58 ;
59 ; On exit: R0 == pointer to copy of a window definition
60 ; May return an error
61 ;
62 ; Use: Returns a copy of a window template (for the use of the
63 ; dialogue box system mainly), including all indirected data
64 ; set up properly and everything. The copy is writable. To
65 ; get rid of the copy, call template_free.
66
67 IMPORT template_copy
68
69 ; --- template_embedded ---
70 ;
71 ; On entry: R0 == pointer to embedded template definition
72 ;
73 ; On exit: R0 == pointer to copy (as for template_copy)
74 ;
75 ; Use: Extracts an embedded template into a template block.
76 ; Embedded templates can be generated using the templAOF
77 ; program, and then linked into your application.
78
79 IMPORT template_embedded
80
81 ; --- template_free ---
82 ;
83 ; On entry: R0 == pointer to block allocated with template_copy
84 ;
85 ; On exit: --
86 ;
87 ; Use: Frees a template copy created using template_copy.
88
89 IMPORT template_free
90
91 ; --- template_load ---
92 ;
93 ; On entry: R0 == pointer to name of template file to load
94 ;
95 ; On exit: May return an error
96 ;
97 ; Use: Loads the specified template file, and adds its window
98 ; definitions into the template list so they can be used when
99 ; creating dialogue boxes or windows.
100 ;
101 ; If the templates can't be loaded (e.g. there isn't enough
102 ; memory) an error is generated (and can be caught using the
103 ; standard Sapphire except mechanism).
104
105 IMPORT template_load
106
107 ; --- template_init ---
108 ;
109 ; On entry: R0 == pointer to application name
110 ;
111 ; On exit: --
112 ;
113 ; Use: Initialises the template list and font array, and loads the
114 ; `Templates' resource file.
115
116 IMPORT template_init
117
118 ]
119
120 ;----- That's all, folks ----------------------------------------------------
121
122 END