Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / ibicon
1 ;
2 ; ibicon.sh
3 ;
4 ; Icon bar icon handling
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 ; ibicon_create
32 ; ibicon_changeSprite
33 ; ibicon_changeText
34 ; ibicon_remove
35 ; ibicon_init
36
37 [ :LNOT::DEF:ibicon__dfn
38 GBLL ibicon__dfn
39
40 ; --- ibicon_create ---
41 ;
42 ; On entry: R0 == pointer to sprite name
43 ; R1 == pointer to text buffer (must be writable if you
44 ; intend to change the text)
45 ; R2 == icon bar position indicator (`window handle')
46 ; R3 == icon bar priority/icon handle
47 ; R4 == pointer to event handler
48 ; R5 == value to pass in R10
49 ; R6 == value to pass in R12
50 ;
51 ; On exit: R0 == ibicon icon handle
52 ; May return an error
53 ;
54 ; Use: Places an icon on the icon bar. Your handler is called when
55 ; an event occurs on the icon. On entry to the handler, R10
56 ; and R12 are set up as for above, R0 is the event type, and
57 ; R1 is the ibicon pointer.
58
59 IMPORT ibicon_create
60
61 ; --- ibicon_changeSprite ---
62 ;
63 ; On entry: R0 == ibicon pointer
64 ; R1 == pointer to sprite name
65 ;
66 ; On exit: --
67 ;
68 ; Use: Changes the sprite of the ibicon passed to it.
69
70 IMPORT ibicon_changeSprite
71
72 ; --- ibicon_changeText ---
73 ;
74 ; On entry: R0 == ibicon pointer
75 ; R1 == pointer to new text
76 ;
77 ; On exit: --
78 ;
79 ; Use: Changes the sprite of the ibicon passed to it.
80
81 IMPORT ibicon_changeText
82
83 ; --- ibicon_remove ---
84 ;
85 ; On entry: R0 == ibicon icon handle
86 ;
87 ; On exit: --
88 ;
89 ; Use: Removes the given icon from the icon bar.
90
91 IMPORT ibicon_remove
92
93 ; --- ibicon_init ---
94 ;
95 ; On entry: --
96 ;
97 ; On exit: --
98 ;
99 ; Use: Initialises the ibicon unit.
100
101 IMPORT ibicon_init
102
103 ;----- Event types ----------------------------------------------------------
104
105 ^ 0
106 ibEvent_select # 1
107 ibEvent_menu # 1
108 ibEvent_adjust # 1
109 ibEvent_save # 1
110 ibEvent_load # 1
111 ibEvent_help # 1
112
113 ]
114
115 ;----- That's all, folks ----------------------------------------------------
116
117 END