Initial revision
[ssr] / StraySrc / Glass / !Glass / h / window
1 /*
2 * window.h
3 *
4 * Manipulation of window templates
5 *
6 * © 1994-1998 Straylight
7 */
8
9 /*----- Licensing note ----------------------------------------------------*
10 *
11 * This file is part of Straylight's Glass.
12 *
13 * Glass 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 * Glass 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 Glass. If not, write to the Free Software Foundation,
25 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 */
27
28 #ifndef __window_h
29 #define __window_h
30
31 /*----- Required header files ---------------------------------------------*/
32
33 #ifndef __gStruct_h
34 #include "gStruct.h"
35 #endif
36
37 /*----- External routines -------------------------------------------------*/
38
39 /*
40 * void window_updateToolbar(void)
41 *
42 * Use
43 * Updates the display of toolbars as necessary in line with new
44 * Preferences settings. It is assumed that Preferences is intelligent
45 * enough to only call this if something actually needs to be done!
46 */
47
48 void window_updateToolbar(void);
49
50 /*
51 * void window_boundingBox(glass_windPointer *w,int icon,wimp_box *box)
52 *
53 * Use
54 * Gets the bounding box of the icon given and returns it in the block
55 * pointed to by box
56 *
57 * Parameters
58 * glass_windPointer *w == the window containing the icon
59 * int icon == the icon to 'boxise'
60 * wimp_box *box == where to put the result
61 */
62
63 void window_boundingBox(glass_windPointer *w,int icon,wimp_box *box);
64
65 /*
66 * void window_setBox(glass_windPointer *w,int icon,wimp_box *box)
67 *
68 * Use
69 * Sets the icon bounding box to the box given, taking into account
70 * Interface borders and so on.
71 *
72 * Parameters
73 * glass_windPointer *w == the window containing the icon
74 * int icon == the icon number
75 * wimp_box *box == the new box for the icon
76 */
77
78 void window_setBox(glass_windPointer *w,int icon,wimp_box *box);
79
80 /*
81 * glass_windPointer *window_selectionOwner(void)
82 *
83 * Use
84 * Returns the window currently owning the selection.
85 */
86
87 glass_windPointer *window_selectionOwner(void);
88
89 /*
90 * void window_deleteIcon(glass_windPointer *w,int icon)
91 *
92 * Use
93 * Deletes the icon specified, good an' proper.
94 *
95 * Parameters
96 * glass_windPointer *w == the scene of the crime
97 * int icon == the victim...
98 */
99
100 void window_deleteIcon(glass_windPointer *w,int icon);
101
102 /*
103 * void window_redrawIcon(glass_windPointer *w,int icon)
104 *
105 * Use
106 * Sets the WIMP up to call for a redraw of the spcified icon (i.e. it
107 * uses Wimp_ForceRedraw).
108 *
109 * Parameters
110 * glass_windPointer *w == pointer to the window owning the icon
111 * int icon == the icon to redraw
112 */
113
114 void window_redrawIcon(glass_windPointer *w,int icon);
115
116 /*
117 * void window_renumber(glass_windPointer *w,int icon,int new)
118 *
119 * Use
120 * Renumbers an icon, by removing it from the array, shuffling others out
121 * the way, and the putting it in its new position (i.e. its an insert
122 * renumber, not a swap renumber like the old version - which wasn't
123 * terribly useful...)
124 *
125 * Parameters
126 * glass_windPointer *w == the window containing the icon
127 * int icon == the icon to renumber
128 * int new == the new number to give it
129 */
130
131 BOOL window_renumber(glass_windPointer *w,int icon,int new);
132
133 /*
134 * void window_hasBeenDeleted(glass_windPointer *w)
135 *
136 * Use
137 * Informs the window system that a window is about to be deleted.
138 *
139 * Parameters
140 * glass_windPointer *w == the window that bites the dust
141 */
142
143 void window_hasBeenDeleted(glass_windPointer *w);
144
145 /*
146 * void window_grab(void (*proc)(wimp_mousestr *m,void *handle),void *handle)
147 *
148 * Use
149 * Turns on 'grab mode' and calls the specified routine when a mouse button
150 * is clicked.
151 *
152 * Parameters
153 * void (*proc)(wimp_mousestr *m,void *handle) == the routine to call
154 * void *handle == the handle to call the routine with
155 */
156
157 void window_grab(void (*proc)(wimp_mousestr *m,void *handle),void *handle);
158
159 /*
160 * BOOL window_grabbing(void)
161 *
162 * Use
163 * Returns whether grab mode is set or not
164 *
165 * Returns
166 * TRUE if grab mode set
167 */
168
169 BOOL window_grabbing(void);
170
171 /*
172 * void window_recreate(glass_windPointer *w)
173 *
174 * Use
175 * Recreates a window after editing. Nothing happens if the window is not
176 * open already. If an error occurs, the open window is removed and left
177 * that way.
178 *
179 * Parameters
180 * glass_windPointer *w == the window to recreate
181 */
182
183 void window_recreate(glass_windPointer *w);
184
185 /*
186 * void window_close(glass_windPointer *w)
187 *
188 * Use
189 * Closes the specified window.
190 *
191 * Parameters
192 * glass_windPointer *w == the window wot we 'ave to close
193 */
194
195 void window_close(glass_windPointer *w);
196
197 /*
198 * void window_open(glass_windPointer *w,BOOL test)
199 *
200 * Use
201 * Opens the specified window. If the window is off-screen, it is moved
202 * back. This routine also registers all handlers required for editing the
203 * window etc. If the window is already open, it is brought to the front.
204 *
205 * Parameters
206 * glass_windPointer *w == pointer to basic window information.
207 * BOOL test == open in test mode or not
208 */
209
210 void window_open(glass_windPointer *w,BOOL test);
211
212 /*
213 * void window_init(void)
214 *
215 * Use
216 * Reads the default template file and ceates the menu etc.
217 */
218
219 void window_init(void);
220
221 #endif