Initial revision
[ssr] / StraySrc / Libraries / Core / EmbTemp / README
CommitLineData
2ee739cc 1Embedded Templates
2~~~~~~~~~~~~~~~~~~
3
4For small programs, it's irritating to have a separate templates file
5hanging around. Separate files aren't necessary for sprites or messages,
6so templates become rather annoying. An `embedded template' is a
7position-independent in-memory representation of a window template which
8has had some extra information added to make it particularly easy to
9construct a real window definition. (The idea of adding relocation
10offsets is admittedly based on the Toolbox resource format.) This
11trivial library unpacks embedded templates.
12
13The format of an embedded template is (I think) as follows:
14
15Offset Size Value
16
17 0 4 Offset to window definition ($w$)
18 4 4 Offset to indirected data ($i$)
19 8 4 Offset to limit of the template ($l$)
20 12 $w - 12$ Relocation directives
21
22 $w$ $i - w$ Template window definition (as in template files)
23
24 $i$ $l - i$ Initialisation strings for indirected icons and
25 window titles. This will be copied literally
26 into the application's indirected data space.
27
28Each relocation directive consists of a single word; the top four bits of
29a relocation directive determine the `type'; the bottom twenty-eight bits
30give the `offset'.
31
32Currently defined types are:
33
34Type Meaning
35
36 0 Add the address of the indirected data area to the word at the
37 given offset into the window definition.
38 1 Store the `window sprite area' in the word at the given offset
39 into the window definition.
40 2 Store the `icon sprite area' in the word at the given offset
41 into the window definition.
42
43Embedded templates are not meant to be built by hand. Instead, the
44programs `templAOF' and `resGen' will build AOF files containing embedded
45template defintions from standard template files. These can be linked
46into applications and modules.
47
48--
49[mdw]