Safer handling of Booleans.
[AROS.git] / workbench / libs / muimaster / classes / window.h
blob3653d7dfb804d5670fca818b9a1f2b73b18960fc
1 #ifndef _MUI_CLASSES_WINDOW_H
2 #define _MUI_CLASSES_WINDOW_H
4 /*
5 Copyright 1999, David Le Corfec.
6 Copyright 2002-2003, The AROS Development Team.
7 All rights reserved.
9 $Id$
12 /*** Name *******************************************************************/
13 #define MUIC_Window "Window.mui"
15 /*** Identifier base (for Zune extensions) **********************************/
16 #define MUIB_Window (MUIB_ZUNE | 0x00003600)
18 /*** Methods ****************************************************************/
19 #define MUIM_Window_ActionIconify \
20 (MUIB_MUI | 0x00422cc0) /* MUI: V18 undoc */
21 #define MUIM_Window_AddEventHandler \
22 (MUIB_MUI | 0x004203b7) /* MUI: V16 */
23 #define MUIM_Window_Cleanup \
24 (MUIB_MUI | 0x0042ab26) /* MUI: V18 undoc */ /* For custom classes only */
25 #define MUIM_Window_RemEventHandler \
26 (MUIB_MUI | 0x0042679e) /* MUI: V16 */
27 #define MUIM_Window_ScreenToBack \
28 (MUIB_MUI | 0x0042913d) /* MUI: V4 */
29 #define MUIM_Window_ScreenToFront \
30 (MUIB_MUI | 0x004227a4) /* MUI: V4 */
31 #define MUIM_Window_Setup \
32 (MUIB_MUI | 0x0042c34c) /* MUI: V18 undoc */ /* For custom Classes only */
33 #define MUIM_Window_Snapshot \
34 (MUIB_MUI | 0x0042945e) /* MUI: V11 */
35 #define MUIM_Window_ToBack \
36 (MUIB_MUI | 0x0042152e) /* MUI: V4 */
37 #define MUIM_Window_ToFront \
38 (MUIB_MUI | 0x0042554f) /* MUI: V4 */
40 struct MUIP_Window_ActionIconify
42 STACKED ULONG MethodID;
45 struct MUIP_Window_AddEventHandler
47 STACKED ULONG MethodID;
48 STACKED struct MUI_EventHandlerNode *ehnode;
51 struct MUIP_Window_Cleanup
53 STACKED ULONG MethodID;
56 struct MUIP_Window_RemEventHandler
58 STACKED ULONG MethodID;
59 STACKED struct MUI_EventHandlerNode *ehnode;
62 struct MUIP_Window_ScreenToBack
64 STACKED ULONG MethodID;
67 struct MUIP_Window_ScreenToFront
69 STACKED ULONG MethodID;
72 struct MUIP_Window_Setup
74 STACKED ULONG MethodID;
77 struct MUIP_Window_Snapshot
79 STACKED ULONG MethodID;
80 STACKED LONG flags;
83 struct MUIP_Window_ToBack
85 STACKED ULONG MethodID;
88 struct MUIP_Window_ToFront
90 STACKED ULONG MethodID;
93 #define MUIM_Window_AddControlCharHandler /* PRIV */ \
94 (MUIB_Window | 0x00000000) /* Zune: V1, PRIV don't use it! */
95 #define MUIM_Window_AllocGadgetID \
96 (MUIB_Window | 0x00000001) /* Zune: V1 - allocate a GadgetID for
97 * BOOPSI gadgets */
98 #define MUIM_Window_DrawBackground /* PRIV */ \
99 (MUIB_Window | 0x00000002) /* Zune: V1 - like MUIM_DrawBackground but PRIV */
100 #define MUIM_Window_DragObject /* PRIV */ \
101 (MUIB_Window | 0x00000003) /* Zune: V1, PRIV don't use it! */
102 #define MUIM_Window_FreeGadgetID \
103 (MUIB_Window | 0x00000004) /* Zune: V1 - free the GadgetID for
104 * BOOPSI gadgets */
105 #define MUIM_Window_RecalcDisplay /* PRIV */ \
106 (MUIB_Window | 0x00000005) /* Zune: V1, PRIV don't use it! */
107 #define MUIM_Window_RemControlCharHandler /* PRIV */ \
108 (MUIB_Window | 0x00000006) /* Zune: V1, PRIV don't use it! */
109 #define MUIM_Window_UpdateMenu /* PRIV */ \
110 (MUIB_Window | 0x00000007) /* Zune: V1, PRIV dont' use it! */
112 struct MUIP_Window_AddControlCharHandler
114 STACKED ULONG MethodID;
115 STACKED struct MUI_EventHandlerNode *ccnode;
118 struct MUIP_Window_AllocGadgetID
120 STACKED ULONG MethodID;
121 }; /* Custom Class - returns the Gadget ID */
123 struct MUIP_Window_DrawBackground
125 STACKED ULONG MethodID;
126 STACKED LONG left;
127 STACKED LONG top;
128 STACKED LONG width;
129 STACKED LONG height;
130 STACKED LONG xoffset;
131 STACKED LONG yoffset;
132 STACKED LONG flags;
135 struct MUIP_Window_DragObject
137 STACKED ULONG MethodID;
138 STACKED Object *obj;
139 STACKED LONG touchx;
140 STACKED LONG touchy;
141 STACKED ULONG flags;
144 struct MUIP_Window_FreeGadgetID
146 STACKED ULONG MethodID;
147 STACKED LONG gadgetid;
148 }; /* Custom Class */
150 struct MUIP_Window_RecalcDisplay
152 STACKED ULONG MethodID;
153 STACKED Object *originator;
156 struct MUIP_Window_RemControlCharHandler
158 STACKED ULONG MethodID;
159 STACKED struct MUI_EventHandlerNode *ccnode;
162 struct MUIP_Window_UpdateMenu
164 STACKED ULONG MethodID;
167 #ifdef MUI_OBSOLETE
168 #define MUIM_Window_GetMenuCheck (MUIB_MUI | 0x00420414) /* MUI: V4 */
169 #define MUIM_Window_GetMenuState (MUIB_MUI | 0x00420d2f) /* MUI: V4 */
170 #define MUIM_Window_SetCycleChain (MUIB_MUI | 0x00426510) /* MUI: V4 */
171 #define MUIM_Window_SetMenuCheck (MUIB_MUI | 0x00422243) /* MUI: V4 */
172 #define MUIM_Window_SetMenuState (MUIB_MUI | 0x00422b5e) /* MUI: V4 */
174 struct MUIP_Window_GetMenuCheck
176 STACKULONG MethodID;
177 STACKED ULONG MenuID;
180 struct MUIP_Window_GetMenuState
182 STACKULONG MethodID;
183 STACKED ULONG MenuID;
186 struct MUIP_Window_SetCycleChain
188 STACKULONG MethodID;
189 STACKED Object *obj[1];
192 struct MUIP_Window_SetMenuCheck
194 STACKULONG MethodID;
195 STACKED ULONG MenuID;
196 STACKED LONG stat;
199 struct MUIP_Window_SetMenuState
201 STACKULONG MethodID;
202 STACKED ULONG MenuID;
203 STACKED LONG stat;
205 #endif /* MUI_OBSOLETE */
207 /*** Attributes *************************************************************/
208 #define MUIA_Window_Activate \
209 (MUIB_MUI | 0x00428d2f) /* MUI: V4 isg BOOL */
210 #define MUIA_Window_ActiveObject \
211 (MUIB_MUI | 0x00427925) /* MUI: V4 .sg Object * */
212 #define MUIA_Window_AltHeight \
213 (MUIB_MUI | 0x0042cce3) /* MUI: V4 i.g LONG */
214 #define MUIA_Window_AltLeftEdge \
215 (MUIB_MUI | 0x00422d65) /* MUI: V4 i.g LONG */
216 #define MUIA_Window_AltTopEdge \
217 (MUIB_MUI | 0x0042e99b) /* MUI: V4 i.g LONG */
218 #define MUIA_Window_AltWidth \
219 (MUIB_MUI | 0x004260f4) /* MUI: V4 i.g LONG */
220 #define MUIA_Window_AppWindow \
221 (MUIB_MUI | 0x004280cf) /* MUI: V5 i.. BOOL */
222 #define MUIA_Window_Backdrop \
223 (MUIB_MUI | 0x0042c0bb) /* MUI: V4 i.. BOOL */
224 #define MUIA_Window_Borderless \
225 (MUIB_MUI | 0x00429b79) /* MUI: V4 i.. BOOL */
226 #define MUIA_Window_CloseGadget \
227 (MUIB_MUI | 0x0042a110) /* MUI: V4 i.. BOOL */
228 #define MUIA_Window_CloseRequest \
229 (MUIB_MUI | 0x0042e86e) /* MUI: V4 ..g BOOL */
230 #define MUIA_Window_DefaultObject \
231 (MUIB_MUI | 0x004294d7) /* MUI: V4 isg Object * */
232 #define MUIA_Window_DepthGadget \
233 (MUIB_MUI | 0x00421923) /* MUI: V4 i.. BOOL */
234 #define MUIA_Window_DisableKeys \
235 (MUIB_MUI | 0x00424c36) /* MUI: V15 isg ULONG */ /* undoc */
236 #define MUIA_Window_DragBar \
237 (MUIB_MUI | 0x0042045d) /* MUI: V4 i.. BOOL */
238 #define MUIA_Window_FancyDrawing \
239 (MUIB_MUI | 0x0042bd0e) /* MUI: V8 isg BOOL */
240 #define MUIA_Window_Height \
241 (MUIB_MUI | 0x00425846) /* MUI: V4 i.g LONG */
242 #define MUIA_Window_ID \
243 (MUIB_MUI | 0x004201bd) /* MUI: V4 isg ULONG */
244 #define MUIA_Window_InputEvent \
245 (MUIB_MUI | 0x004247d8) /* MUI: V4 ..g struct InputEvent * */
246 #define MUIA_Window_IsSubWindow \
247 (MUIB_MUI | 0x0042b5aa) /* MUI: V4 isg BOOL */
248 #define MUIA_Window_LeftEdge \
249 (MUIB_MUI | 0x00426c65) /* MUI: V4 i.g LONG */
250 #define MUIA_Window_MenuAction \
251 (MUIB_MUI | 0x00427521) /* MUI: V8 isg ULONG */
252 #define MUIA_Window_Menustrip \
253 (MUIB_MUI | 0x0042855e) /* MUI: V8 i.g Object * */
254 #define MUIA_Window_MouseObject \
255 (MUIB_MUI | 0x0042bf9b) /* MUI: V10 ..g Object * */
256 #define MUIA_Window_NeedsMouseObject \
257 (MUIB_MUI | 0x0042372a) /* MUI: V10 i.. BOOL */
258 #define MUIA_Window_NoMenus \
259 (MUIB_MUI | 0x00429df5) /* MUI: V4 is. BOOL */
260 #define MUIA_Window_Open \
261 (MUIB_MUI | 0x00428aa0) /* MUI: V4 .sg BOOL */
262 #define MUIA_Window_PublicScreen \
263 (MUIB_MUI | 0x004278e4) /* MUI: V6 isg STRPTR */
264 #define MUIA_Window_RefWindow \
265 (MUIB_MUI | 0x004201f4) /* MUI: V4 is. Object * */
266 #define MUIA_Window_RootObject \
267 (MUIB_MUI | 0x0042cba5) /* MUI: V4 isg Object * */
268 #define MUIA_Window_Screen \
269 (MUIB_MUI | 0x0042df4f) /* MUI: V4 isg struct Screen * */
270 #define MUIA_Window_ScreenTitle \
271 (MUIB_MUI | 0x004234b0) /* MUI: V5 isg STRPTR */
272 #define MUIA_Window_SizeGadget \
273 (MUIB_MUI | 0x0042e33d) /* MUI: V4 i.. BOOL */
274 #define MUIA_Window_SizeRight \
275 (MUIB_MUI | 0x00424780) /* MUI: V4 i.. BOOL */
276 #define MUIA_Window_Sleep \
277 (MUIB_MUI | 0x0042e7db) /* MUI: V4 .sg BOOL */
278 #define MUIA_Window_Title \
279 (MUIB_MUI | 0x0042ad3d) /* MUI: V4 isg STRPTR */
280 #define MUIA_Window_TopEdge \
281 (MUIB_MUI | 0x00427c66) /* MUI: V4 i.g LONG */
282 #define MUIA_Window_UseBottomBorderScroller \
283 (MUIB_MUI | 0x00424e79) /* MUI: V13 isg BOOL */
284 #define MUIA_Window_UseLeftBorderScroller \
285 (MUIB_MUI | 0x0042433e) /* MUI: V13 isg BOOL */
286 #define MUIA_Window_UseRightBorderScroller \
287 (MUIB_MUI | 0x0042c05e) /* MUI: V13 isg BOOL */
288 #define MUIA_Window_Width \
289 (MUIB_MUI | 0x0042dcae) /* MUI: V4 i.g LONG */
290 #define MUIA_Window_Window \
291 (MUIB_MUI | 0x00426a42) /* MUI: V4 ..g struct Window * */
293 #define MUIA_Window_EraseArea \
294 (MUIB_Window | 0x00000000) /* Zune only i.. BOOL (default: TRUE) */
295 #define MUIA_Window_ZoomGadget \
296 (MUIB_Window | 0x00000002)
297 #define MUIA_Window_ToolBox \
298 (MUIB_Window | 0x00000003)
300 #define MUIV_Window_ActiveObject_None 0
301 #define MUIV_Window_ActiveObject_Next (-1)
302 #define MUIV_Window_ActiveObject_Prev (-2)
303 #define MUIV_Window_AltHeight_MinMax(p) (0-(p))
304 #define MUIV_Window_AltHeight_Visible(p) (-100-(p))
305 #define MUIV_Window_AltHeight_Screen(p) (-200-(p))
306 #define MUIV_Window_AltHeight_Scaled (-1000)
307 #define MUIV_Window_AltLeftEdge_Centered (-1)
308 #define MUIV_Window_AltLeftEdge_Moused (-2)
309 #define MUIV_Window_AltLeftEdge_NoChange (-1000)
310 #define MUIV_Window_AltTopEdge_Centered (-1)
311 #define MUIV_Window_AltTopEdge_Moused (-2)
312 #define MUIV_Window_AltTopEdge_Delta(p) (-3-(p))
313 #define MUIV_Window_AltTopEdge_NoChange (-1000)
314 #define MUIV_Window_AltWidth_MinMax(p) (0-(p))
315 #define MUIV_Window_AltWidth_Visible(p) (-100-(p))
316 #define MUIV_Window_AltWidth_Screen(p) (-200-(p))
317 #define MUIV_Window_AltWidth_Scaled (-1000)
318 #define MUIV_Window_Height_MinMax(p) (0-(p))
319 #define MUIV_Window_Height_Visible(p) (-100-(p))
320 #define MUIV_Window_Height_Screen(p) (-200-(p))
321 #define MUIV_Window_Height_Scaled (-1000)
322 #define MUIV_Window_Height_Default (-1001)
323 #define MUIV_Window_LeftEdge_Centered (-1)
324 #define MUIV_Window_LeftEdge_Moused (-2)
325 #define MUIV_Window_TopEdge_Centered (-1)
326 #define MUIV_Window_TopEdge_Moused (-2)
327 #define MUIV_Window_TopEdge_Delta(p) (-3-(p))
328 #define MUIV_Window_Width_MinMax(p) (0-(p))
329 #define MUIV_Window_Width_Visible(p) (-100-(p))
330 #define MUIV_Window_Width_Screen(p) (-200-(p))
331 #define MUIV_Window_Width_Scaled (-1000)
332 #define MUIV_Window_Width_Default (-1001)
334 #define MUIV_Window_Button_MUI 1
335 #define MUIV_Window_Button_Snapshot 2
336 #define MUIV_Window_Button_Iconify 4
337 #define MUIV_Window_Button_Popup 8
340 #ifdef MUI_OBSOLETE
341 #define MUIA_Window_Menu \
342 (MUIB_MUI | 0x0042db94) /* MUI: V4 i.. struct NewMenu * */
344 #define MUIV_Window_Menu_NoMenu (-1)
345 #endif /* MUI_OBSOLETE */
347 /* Forward declaration for application opaque custom frame specification */
348 struct dt_frame_image;
350 /**************************************************************************
351 Info about the display environment on which all Area Objects have a
352 reference to it.
353 **************************************************************************/
355 #define MRI_RARRAY_SIZE 20
357 struct MUI_RenderInfo
359 Object *mri_WindowObject; /* accessable in-between
360 * MUIM_Setup/MUIM_Cleanup */
361 struct Screen *mri_Screen; /* accessable in-between
362 * MUIM_Setup/MUIM_Cleanup */
363 struct DrawInfo *mri_DrawInfo; /* accessable in-between
364 * MUIM_Setup/MUIM_Cleanup */
365 UWORD *mri_Pens; /* accessable in-between
366 * MUIM_Setup/MUIM_Cleanup */
367 struct Window *mri_Window; /* accessable in-between
368 * MUIM_Show/MUIM_Hide */
369 struct RastPort *mri_RastPort; /* accessable in-between
370 * MUIM_Show/MUIM_Hide */
371 ULONG mri_Flags; /* accessable in-between
372 * MUIM_Setup/MUIM_Cleanup */
374 /* the following stuff is private */
375 struct ColorMap *mri_Colormap;
376 UWORD mri_ScreenWidth;
377 UWORD mri_ScreenHeight;
378 UWORD mri_PensStorage[MPEN_COUNT]; /* storage for pens, mri_Pens points
379 * to here */
381 /* Opened text fonts, done by zune_get_font() */
382 struct TextFont *mri_Fonts[-MUIV_Font_NegCount];
384 /* this is for AddClipping/AddClipRegion */
385 struct Region *mri_rArray[MRI_RARRAY_SIZE];
386 int mri_rCount;
388 struct Rectangle mri_ClipRect;
390 UWORD mri_BorderTop; /* The height of the window's top border (title) */
391 UWORD mri_BorderBottom; /* The height of the window's bottom bodder */
392 UWORD mri_BorderLeft; /* The width of the window's left border */
393 UWORD mri_BorderRight; /* The width of the window's right border */
395 /* Stuff for Borderscrollers */
396 Object *mri_LeftImage; /* Valid between MUIM_Setup/MUIM_Cleanup */
397 Object *mri_RightImage;
398 Object *mri_UpImage;
399 Object *mri_DownImage;
400 Object *mri_SizeImage;
402 Object *mri_VertProp; /* Valid between MUIM_Show/MUIM_Hide */
403 Object *mri_HorizProp;
405 /* buffering */
406 struct RastPort mri_BufferRP;
407 struct BitMap *mri_BufferBM;
409 struct dt_frame_image *mri_FrameImage[16];
412 #define MUIMRI_RECTFILL (1<<0)
413 #define MUIMRI_TRUECOLOR (1<<1)
414 #define MUIMRI_THINFRAMES (1<<2)
415 #define MUIMRI_REFRESHMODE (1<<3)
417 /**************************************************************************
418 MUI_EventHandlerNode as used by
419 MUIM_Window_AddEventHandler/RemoveEventHandler
420 **************************************************************************/
422 struct MUI_EventHandlerNode
424 struct MinNode ehn_Node; /* embedded node structure, private! */
425 BYTE ehn_Reserved; /* private! */
426 BYTE ehn_Priority; /* sorted by priority. */
427 UWORD ehn_Flags; /* some flags, see below */
428 Object *ehn_Object; /* object which should receive MUIM_HandleEvent. */
429 struct IClass *ehn_Class; /* Class for CoerceMethod(). If NULL,
430 * DoMethod() is used */
431 ULONG ehn_Events; /* the IDCMP flags the handler should be
432 * invoked with */
435 /* here are the flags for ehn_Flags */
436 #define MUI_EHF_ALWAYSKEYS (1<<0)
437 #define MUI_EHF_GUIMODE (1<<1) /* handler will not be called if object
438 * is not visible or disabled */
439 #define MUI_EHF_HANDLEINPUT (1<<15) /* ZUNEPRIV: Send MUIM_HandleInput */
440 /* ZUNEPRIV: instead of MUIM_HandleEvent */
442 /* MUIM_HandleEvent must return a bitmask where following bits can be set
443 * (all others must be 0) */
444 #define MUI_EventHandlerRC_Eat (1<<0) /* do not invoke more handlers ers */
447 extern const struct __MUIBuiltinClass _MUI_Window_desc; /* PRIV */
449 #endif /* _MUI_CLASSES_WINDOW_H */