4 * [Generated from viewer, 25 September 1996]
7 #if !defined(__CC_NORCROFT) || !defined(__arm)
8 #error You must use the Norcroft ARM Compiler for Sapphire programs
11 #pragma include_only_once
12 #pragma force_top_level
21 /*----- Overview ----------------------------------------------------------*
34 * viewer_dragSelection
41 /* --- viewer_create --- *
43 * On entry: R0 == pointer to a viewer definition block
44 * R1 == pointer to a list
45 * R2 == sprite area for window
47 * On exit: R0 == viewer handle
50 * Use: Creates a viewer window. The viewer definition block
51 * contains various interesting bits of information about the
52 * viewer which are likely to be known at assembly time:
54 * (word) address of a list manager definition block
55 * (word) address of a shape handler function (or 0)
56 * (word) standard width of icons
57 * (word) standard height of icons
58 * (string) banner text message tag, or empty
60 * The shape function is used to allow viewer icons to have a
61 * non-rectangular shape. The function is called with a reason
62 * code in R0; entry and exit conditions depend on this:
66 * R1 == pointer to list item
67 * R2 == standard width of icon
68 * R3 == standard height of icon
71 * R2 == width of this icon
72 * R3 == height of this icon
75 * This routine is used to find the actual size of an icon.
76 * The icons are aligned on a grid according to the largest
77 * one: this routine is used to find out which one that is.
81 * R1 == pointer to list item
82 * R2 == address of bounding box of this icon
83 * R3 == address of bounding box to compare
86 * CS if boxes intersect, else CC
89 * For detecting mouse clicks etc. on an icon. viewer has
90 * already ensured that the box in R3 intersects with the
91 * bounding box, so for rectangular icons, you can just return
92 * with C set always. This entry is provided so that you
93 * can check against the sprite and text of a text+sprite
96 * More reason codes may be added later; it will always be
97 * sensible to return immediately preserving all registers and
101 extern routine viewer_create;
103 /* --- viewer_destroy --- *
105 * On entry: R0 == viewer handle
109 * Use: Destroys a viewer, removing it from the screen etc.
112 extern routine viewer_destroy;
114 /* --- viewer_open --- *
116 * On entry: R0 == viewer handle
117 * R1 == opening style
118 * R2,R3 == extra arguments
122 * Use: Opens a viewer window on the screen.
125 extern routine viewer_open;
127 /* --- viewer_close --- *
129 * On entry: R0 == viewer handle
133 * Use: Closes a viewer window.
136 extern routine viewer_close;
138 /* --- viewer_eventHandler --- *
140 * On entry: R0 == viewer handle
141 * R1 == pointer to event handler
142 * R2 == value to pass in R10
143 * R3 == value to pass in R12
145 * On exit: R1-R3 == old values
147 * Use: Sets up the event handle for the viewer.
150 extern routine viewer_eventHandler;
152 /* --- viewer_select --- *
154 * On entry: R0 == viewer handle
156 * R2 == 0 to unselect, 1 to select or 2 to toggle
160 * Use: Selects an icon, or maybe unselects it. Whatever, it doesn't
161 * flicker if it doesn't need to.
164 extern routine viewer_select;
166 /* --- viewer_isSelected --- *
168 * On entry: R0 == viewer handle
171 * On exit: CS if icon is selected, else CC
173 * Use: Informs you whether an icon is selected.
176 extern routine viewer_isSelected;
178 /* --- viewer_selectAll --- *
180 * On entry: R0 == viewer handle
181 * R2 == 0 to deselect, or 1 to select
185 * Use: Selects or deselects all the icons in a viewer.
188 extern routine viewer_selectAll;
190 /* --- viewer_click --- *
192 * On entry: R0 == viewer handle
193 * R1 == icon handle (or 0)
194 * R2 == mouse button state
198 * Use: Handles a click, drag etc. according to the standard
202 extern routine viewer_click;
204 /* --- viewer_dragSelection --- *
206 * On entry: R0 == viewer handle
210 * Use: Starts a drag of the icons within the viewer. When the drag
211 * is finished, you get sent a vwEvent_dragged event.
214 extern routine viewer_dragSelection;
216 /* --- viewer_window --- *
218 * On entry: R0 == viewer handle
220 * On exit: R0 == window handle
222 * Use: Returns the window handle of the viewer.
225 extern routine viewer_window;
227 /* --- viewer_update --- *
229 * On entry: R0 == viewer handle
234 * Use: Updates (redraws) a given icon.
237 extern routine viewer_update;
239 /* --- viewer_setTitle --- *
241 * On entry: R0 == viewer handle
246 * Use: Sets the viewer window's title.
249 extern routine viewer_setTitle;
251 /* --- viewer_rescan --- *
253 * On entry: R0 == viewer handle
257 * Use: Rescans all the icons in the viewer and forces a redraw,
258 * in case icons have been added or deleted (or renamed). Note
259 * that the redraw is done *anyway* -- it's your responsibility
260 * to avoid calling this routine when you don't need to.
263 extern routine viewer_rescan;
265 /*----- Shape function reason codes ---------------------------------------*/
267 #define vwShape_size 0
269 #define vwShape_intersects 1
271 #define vwShape_slowBit 2
273 /*----- Viewer event codes ------------------------------------------------*/
275 #define vwEvent_close 0
277 #define vwEvent_click 1
279 #define vwEvent_double 2
281 #define vwEvent_drag 3
283 #define vwEvent_menu 4
285 #define vwEvent_redraw 5
287 #define vwEvent_drop 6
289 #define vwEvent_help 7
291 #define vwEvent_key 8
293 #define vwEvent_dragged 9
295 #define vwEvent_sprite 10
297 #define vwEvent_open 11
299 #define vwEvent_draw 12
301 #define vwEvent_unDraw 13
303 #define vwDrop_save 0
304 #define vwDrop_load 1
306 /*----- That's all, folks -------------------------------------------------*/