chiark / gitweb /
Initial revision
[ssr] / StraySrc / Libraries / Sapphire / csapph / h / menuDefs
1 /*
2  * menuDefs.h
3  *
4  * [Generated from menuDefs, 25 September 1996]
5  */
6
7 #if !defined(__CC_NORCROFT) || !defined(__arm)
8   #error You must use the Norcroft ARM Compiler for Sapphire programs
9 #endif
10
11 #pragma include_only_once
12 #pragma force_top_level
13
14 #ifndef __menuDefs_h
15 #define __menuDefs_h
16
17 #ifndef __sapphire_h
18   #include "sapphire.h"
19 #endif
20
21 /*----- Overview ----------------------------------------------------------*
22  *
23  * Macros provided:
24  *
25  *   BITSPEC
26  *   SETBIT
27  *   NEWITEM
28  *   MENU
29  *   MENUI
30  *   TEAROFF
31  *   TEAROFFI
32  *   R12DATA
33  *   MAKEME
34  *   MHEIGHT
35  *   GLOBALM
36  *   ITEM
37  *   ITEWI
38  *   SHADE
39  *   ISHADE
40  *   SWITCH
41  *   RADIO
42  *   SPRITE
43  *   HALFSZ
44  *   SUBWARN
45  *   SUBMENU
46  *   NOWARN
47  *   RULEOFF
48  *   MENUEND
49  */
50
51 /*----- Constants for menus -----------------------------------------------*
52  *
53  * In the descriptions of flags below, the data required in the packed menu
54  * definition is shown in the comments.  Insert items in the order of the
55  * bit precedences of the flags.
56  *
57  * Note -- a (*) following a description means the flag is only supported by
58  * tms (the tearoff system), and a (+) means that the flag is only supported
59  * by menu (the WIMP system).
60  */
61
62 /* --- Flags for menu titles and items --- */
63
64 #define mFlag_indirect ((1<<0))
65
66 #define mFlag_R12 ((1<<16))
67
68 #define mFlag_noTrans ((1<<19))
69
70 /* --- Menu title flags --- */
71
72 #define mFlag_tearoff ((1<<1))
73
74 #define mFlag_makeMe ((1<<2))
75
76 #define mFlag_maxHeight ((1<<3))
77
78 #define mFlag_global ((1<<4))
79
80 /* --- Menu item flags --- */
81
82 #define mFlag_shortCut ((1<<1))
83
84 #define mFlag_iShortCut ((1<<2))
85
86 #define mFlag_shade ((1<<3))
87
88 #define mFlag_invShade ((1<<4))
89
90 #define mFlag_switch ((1<<5))
91
92 #define mFlag_radio ((1<<6))
93
94 #define mFlag_sprite ((1<<7))
95
96 #define mFlag_halfSize ((1<<8))
97
98 #define mFlag_subWarn ((1<<9))
99
100 #define mFlag_subMenu ((1<<10))
101
102 #define mFlag_noWarn ((1<<17))
103
104 #define mFlag_ruleOff ((1<<18))
105
106 #define mFlag_end ((1<<31))
107
108 /* --- Event codes --- *
109  *
110  * Event codes are returned in R0, with R1 being the item number within
111  * the packed menu definition, indexed from 0.
112  *
113  * Note: mEvent_deleted is only sent to the topmost menu title by the
114  * standard menu system, but is sent to the titles of all menus being closed
115  * by TMS.  If you are converting from one to the other, bear this in mind.
116  */
117
118 #define mEvent_select (0)
119
120 #define mEvent_subMenu (1)
121
122 #define mEvent_deleted (2)
123
124 #define mEvent_help (3)
125
126 /*----- Menu creation macros ----------------------------------------------*/
127
128 /* --- Note to reader --- *
129  *
130  * These macros make a lot of use of private constants and variables.  Try to
131  * avoid examining these too closely, because you'll probably get lost.
132  */
133
134 /* --- Set up the variables --- */
135
136 /* --- Macro: BITSPEC --- *
137  *
138  * Arguments:   offset == offset into workspace of target word
139  *              bit == bitmask with a 1 in the position of the bit
140  *
141  * Use:         Assembles a bit specification referencing the described bit.
142  *              The bit is described by a mask word rather than a bit
143  *              position, because it is expected that you will already have
144  *              set up constants for bit masks.
145  */
146
147 /* --- Macro: SETBIT --- *
148  *
149  * Arguments:   flag == which menu flag above to set
150  *
151  * Use:         Sets a bit within the current item or menu title's flags
152  *              word.  It ensures that items are inserted in the correct
153  *              order.
154  */
155
156 /* --- Macro: NEWITEM --- *
157  *
158  * Arguments:   --
159  *
160  * Use:         Starts a new menu item or menu title.  It also inserts a new
161  *              flags word in the current position.
162  */
163
164 /* --- Macro: MENU --- *
165  *
166  * Arguments:   title == the menu's title string/message tag
167  *
168  * Use:         Creates a nonindirected menu title and starts a new menu.
169  */
170
171 /* --- Macro: MENUI --- *
172  *
173  * Arguments:   title == offset to title pointer in client's workspace
174  *
175  * Use:         Creates an indirected menu title and starts a new menu.
176  */
177
178 /* --- Macro: TEAROFF --- *
179  *
180  * Arguments:   title == menu's title string/message tag
181  *
182  * Use:         Creates a nonindirected tearoff menu title and starts a new
183  *              menu.
184  */
185
186 /* --- Macro: TEARI --- *
187  *
188  * Arguments:   title == offset to title pointer in client's workspace
189  *
190  * Use:         Creates an indirected tearoff menu title and starts a new
191  *              menu.
192  */
193
194 /* --- Macro: R12DATA --- *
195  *
196  * Arguments:   --
197  *
198  * Use:         Sets the current menu item or menu title to use the client's
199  *              R12 pointer rather than its R10 pointer for workspace.
200  */
201
202 /* --- Macro: NOTRANS --- *
203  *
204  * Arguments:   --
205  *
206  * Use:         Disables message translation of the current item or menu
207  *              title.  This is useful if you're building the item or title
208  *              text dynamically.
209  */
210
211 /* --- Macro: MAKEME --- *
212  *
213  * Arguments:   makeProc == pointer to procedure which will remake the menu
214  *
215  * Use:         Sets the current menu to require being remade from scratch
216  *              when being updated (e.g. after an item is selected).
217  */
218
219 /* --- Macro: MHEIGHT --- *
220  *
221  * Arguments:   height == maximum permitted height for menu in OS units
222  *
223  * Use:         Sets the menu's maximum allowable height.
224  */
225
226 /* --- Macro: GLOBALM --- *
227  *
228  * Arguments:   --
229  *
230  * Use:         Sets the menu's maximum allowable height.
231  */
232
233 /* --- Macro: ITEM --- *
234  *
235  * Arguments:   text == item's text string/message tag
236  *
237  * Use:         Creates a new nonindirected menu item.
238  */
239
240 /* --- Macro: ITEMI --- *
241  *
242  * Arguments:   text == offset of pointer to menu text
243  *
244  * Use:         Creates a new indirected menu item
245  */
246
247 /* --- Macro: SHADE --- *
248  *
249  * Arguments:   $offset,$bit == bitspec of item's `shaded' bit
250  *
251  * Use:         Sets the current item to be shadable.
252  */
253
254 /* --- Macro: ISHADE --- *
255  *
256  * Arguments:   offset,$bit == bitspec of item's `unshaded' bit
257  *
258  * Use:         Sets the current item to be inverse shadable.
259  */
260
261 /* --- Macro: SWITCH --- *
262  *
263  * Arguments:   offset,$bit == bitspec of item's `ticked' bit
264  *
265  * Use:         Sets the current item to be tickable.
266  */
267
268 /* --- Macro: RADIO --- *
269  *
270  * Arguments:   group == offset of this item's radio group selector
271  *              selector == value of selector to blob this item
272  *
273  * Use:         Marks this item as a radio item, so that it is blobbed (or
274  *              ticked under the WIMP menu system) when the selector in the
275  *              client's workspace matches the item's selector.
276  */
277
278 /* --- Macro: SPRITE --- *
279  *
280  * Arguments:   sprite == EITHER address of validation string, OR offset of
281  *                sprite name pointer (if area argument given)
282  *              area == (optional) sprite area, or -1 for resspr_area
283  *
284  * Use:         Adds a sprite to the menu item definition.
285  */
286
287 /* --- Macro: HALFSZ --- *
288  *
289  * Arguments:   --
290  *
291  * Use:         Sets the item to display its sprite at half size
292  */
293
294 /* --- Macro: SUBWARN --- *
295  *
296  * Arguments:   --
297  *
298  * Use:         Sets the item to generate submenu warnings when its submenu
299  *              arrow is pointed at.
300  */
301
302 /* --- Macro: SUBMENU --- *
303  *
304  * Arguments:   subMenu == pointer to packed definition of the submenu
305  *              handler == pointer to handler routine
306  *
307  * Use:         Attaches the given menu as a submenu of this item.
308  */
309
310 /* --- Macro: NOWARN --- *
311  *
312  * Arguments:   --
313  *
314  * Use:         Prevents this item from returning submenu events if it is
315  *              shaded.
316  */
317
318 /* --- Macro: RULEOFF --- *
319  *
320  * Arguments:   --
321  *
322  * Use:         Inserts a ruleoff after the current item, assuming there are
323  *              some more items after it.
324  */
325
326 /* --- Macro: MENUEND --- *
327  *
328  * Arguments:   --
329  *
330  * Use:         Finishes off the current menu.
331  */
332
333 /*----- That's all, folks -------------------------------------------------*/
334
335 #endif