chiark / gitweb /
Initial revision
[ssr] / StraySrc / Libraries / Steel / h / template
1 /*
2  * template.c
3  *
4  * Loading and manipulation of window templates
5  *
6  * © 1994-1998 Straylight
7  */
8
9 /*----- Licensing note ----------------------------------------------------*
10  *
11  * This file is part of Straylight's Steel library.
12  *
13  * Steel 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  * Steel 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 Steel.  If not, write to the Free Software Foundation,
25  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26  */
27
28 #ifndef __template_h
29 #define __template_h
30
31 /* --- Acorn stupidly decided to make this public --- */
32
33 typedef struct template__str
34 {
35   struct template__str *next;
36   char *workspace;
37   int workspacesize;
38   char *font;
39   char name[12];
40   wimp_wind window;
41 }
42 template;
43
44 /* --- The actual functions --- */
45
46 /*
47  * template *template_copy(template *from)
48  *
49  * Use
50  *  Copies a template field-for-field and fixes up new indirected data for
51  *  it.
52  */
53
54 template *template_copy(template *from);
55
56 /*
57  * BOOL template_readfile(char *name)
58  *
59  * Use
60  *  Loads the template file named into memory, and sorts out all its
61  *  indirected data.
62  *
63  *  Template entries with strange identifiers are ignored.  Other entry
64  *  types may be supported later.
65  *
66  * Parameters
67  *  char *name == the name of the template file to load (a resource file)
68  *
69  * Returns
70  *  FALSE if the file contained no sprite icons.  No, I don't understand
71  *  the use of this either.  It's not my problem though.  I just write the
72  *  code.
73  */
74
75 BOOL template_readfile(char *file);
76
77 /*
78  * void template_init(void)
79  *
80  * Use
81  *  Loads the application's `Templates' file.
82  */
83
84 void template_init(void);
85
86 /*
87  * void template_use_fancyfonts(void)
88  *
89  * Use
90  *  Does absolutely nothing at all.  Fancy font support happens anyway.
91  */
92
93 void template_use_fancyfonts(void);
94
95 /*
96  * BOOL template_exists(char *name)
97  *
98  * Use
99  *  Returns TRUE if the named template is known at the moment, or FALSE
100  *  otherwise
101  */
102
103 BOOL template_exists(char *name);
104
105 /*
106  * template *template_find(char *name)
107  *
108  * Use
109  *  Locates a named template and returns a pointer to it
110  */
111
112 template *template_find(char *name);
113
114 /*
115  * wimp_wind *template_syshandle(char *name)
116  *
117  * Use
118  *  Not very much, if the truth be known.  It returns a pointer to a named
119  *  window definition.
120  */
121
122 wimp_wind *template_syshandle(char *name);
123
124 /*
125  * BOOL template_loaded(void)
126  *
127  * Use
128  *  Returns TRUE if we have templates on board.
129  */
130
131 BOOL template_loaded(void);
132
133 #endif