chiark / gitweb /
Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / fontmenu
1 ;
2 ; fontMenu.sh
3 ;
4 ; Fontmenu creation
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 ;  fm_create
32 ;  fm_tickFont
33 ;  fm_init
34
35                 [       :LNOT::DEF:fontMenu__dfn
36                 GBLL    fontMenu__dfn
37
38 ; --- fm_create ---
39 ;
40 ; On entry:     R0 == current font name
41 ;               R1 == handler to call when selection made
42 ;               R2 == R10 value to call with
43 ;               R3 == R12 value to call with
44 ;               R4 == pointer to routine to call to create submenu
45 ;                     (ie. menu_create or tms_create)
46 ;
47 ; On exit:      CS if any fonts exist and
48 ;                 R0 == pointer to a menu definition
49 ;                 R1 == event handler to call
50 ;                 R2 == R10 value for event handler
51 ;                 R3 == R12 value for event handler
52 ;               else CC and
53 ;                 R0-R3 corrupted
54 ;               May return an error
55 ;
56 ; Use:          Creates a user menu definition suitable for passing directly
57 ;               to (menu|tms)_create. Note however, that the menu defintion
58 ;               does *not* include any title; this must be created first.
59 ;               If you require items such as the system font, then
60 ;               add these to the menu before creating the menu returned
61 ;               from this call.
62
63                 IMPORT  fm_create
64
65 ; --- fm_tickFont ---
66 ;
67 ; On entry:     R0 == name to tick
68 ;
69 ; On exit:      --
70 ;
71 ; Use:          Ticks the font with tht given name in the fontmenu. If
72 ;               no font exists then the existing ticks are removed
73
74                 IMPORT  fm_tickFont
75
76 ; --- fm_init ---
77 ;
78 ; On entry:     --
79 ;
80 ; On exit:      --
81 ;
82 ; Use:          Initialises the font menu system.
83
84                 IMPORT  fm_init
85
86                 ]
87
88 ;----- Events ---------------------------------------------------------------
89
90                 ^       0
91 fmEvent_select  #       1                       ;User selected a font
92                                                 ;R1 == pointer to name
93
94 ;----- That's all, folks ----------------------------------------------------
95
96                 END