Tabs to spaces, more consistent formatting.
[AROS.git] / workbench / libs / muimaster / classes / window.h
blob89274d2e9e3a1c447da23fcb95158802ae6b6877
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 \
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 \
99 (MUIB_Window | 0x00000002) /* Zune: V1 - like MUIM_DrawBackground
100 * but PRIV */
101 #define MUIM_Window_DragObject \
102 (MUIB_Window | 0x00000003) /* Zune: V1, PRIV don't use it! */
103 #define MUIM_Window_FreeGadgetID \
104 (MUIB_Window | 0x00000004) /* Zune: V1 - free the GadgetID for
105 * BOOPSI gadgets */
106 #define MUIM_Window_RecalcDisplay \
107 (MUIB_Window | 0x00000005) /* Zune: V1, PRIV don't use it! */
108 #define MUIM_Window_RemControlCharHandler \
109 (MUIB_Window | 0x00000006) /* Zune: V1, PRIV don't use it! */
110 #define MUIM_Window_UpdateMenu \
111 (MUIB_Window | 0x00000007) /* Zune: V1, PRIV dont' use it! */
113 struct MUIP_Window_AddControlCharHandler
115 STACKED ULONG MethodID;
116 STACKED struct MUI_EventHandlerNode *ccnode;
119 struct MUIP_Window_AllocGadgetID
121 STACKED ULONG MethodID;
122 }; /* Custom Class - returns the Gadget ID */
124 struct MUIP_Window_DrawBackground
126 STACKED ULONG MethodID;
127 STACKED LONG left;
128 STACKED LONG top;
129 STACKED LONG width;
130 STACKED LONG height;
131 STACKED LONG xoffset;
132 STACKED LONG yoffset;
133 STACKED LONG flags;
136 struct MUIP_Window_DragObject
138 STACKED ULONG MethodID;
139 STACKED Object *obj;
140 STACKED LONG touchx;
141 STACKED LONG touchy;
142 STACKED ULONG flags;
145 struct MUIP_Window_FreeGadgetID
147 STACKED ULONG MethodID;
148 STACKED LONG gadgetid;
149 }; /* Custom Class */
151 struct MUIP_Window_RecalcDisplay
153 STACKED ULONG MethodID;
154 STACKED Object *originator;
157 struct MUIP_Window_RemControlCharHandler
159 STACKED ULONG MethodID;
160 STACKED struct MUI_EventHandlerNode *ccnode;
163 struct MUIP_Window_UpdateMenu
165 STACKED ULONG MethodID;
168 #ifdef MUI_OBSOLETE
169 #define MUIM_Window_GetMenuCheck (MUIB_MUI | 0x00420414) /* MUI: V4 */
170 #define MUIM_Window_GetMenuState (MUIB_MUI | 0x00420d2f) /* MUI: V4 */
171 #define MUIM_Window_SetCycleChain (MUIB_MUI | 0x00426510) /* MUI: V4 */
172 #define MUIM_Window_SetMenuCheck (MUIB_MUI | 0x00422243) /* MUI: V4 */
173 #define MUIM_Window_SetMenuState (MUIB_MUI | 0x00422b5e) /* MUI: V4 */
175 struct MUIP_Window_GetMenuCheck
177 STACKULONG MethodID;
178 STACKED ULONG MenuID;
181 struct MUIP_Window_GetMenuState
183 STACKULONG MethodID;
184 STACKED ULONG MenuID;
187 struct MUIP_Window_SetCycleChain
189 STACKULONG MethodID;
190 STACKED Object *obj[1];
193 struct MUIP_Window_SetMenuCheck
195 STACKULONG MethodID;
196 STACKED ULONG MenuID;
197 STACKED LONG stat;
200 struct MUIP_Window_SetMenuState
202 STACKULONG MethodID;
203 STACKED ULONG MenuID;
204 STACKED LONG stat;
206 #endif /* MUI_OBSOLETE */
208 /*** Attributes *************************************************************/
209 #define MUIA_Window_Activate \
210 (MUIB_MUI | 0x00428d2f) /* MUI: V4 isg BOOL */
211 #define MUIA_Window_ActiveObject \
212 (MUIB_MUI | 0x00427925) /* MUI: V4 .sg Object * */
213 #define MUIA_Window_AltHeight \
214 (MUIB_MUI | 0x0042cce3) /* MUI: V4 i.g LONG */
215 #define MUIA_Window_AltLeftEdge \
216 (MUIB_MUI | 0x00422d65) /* MUI: V4 i.g LONG */
217 #define MUIA_Window_AltTopEdge \
218 (MUIB_MUI | 0x0042e99b) /* MUI: V4 i.g LONG */
219 #define MUIA_Window_AltWidth \
220 (MUIB_MUI | 0x004260f4) /* MUI: V4 i.g LONG */
221 #define MUIA_Window_AppWindow \
222 (MUIB_MUI | 0x004280cf) /* MUI: V5 i.. BOOL */
223 #define MUIA_Window_Backdrop \
224 (MUIB_MUI | 0x0042c0bb) /* MUI: V4 i.. BOOL */
225 #define MUIA_Window_Borderless \
226 (MUIB_MUI | 0x00429b79) /* MUI: V4 i.. BOOL */
227 #define MUIA_Window_CloseGadget \
228 (MUIB_MUI | 0x0042a110) /* MUI: V4 i.. BOOL */
229 #define MUIA_Window_CloseRequest \
230 (MUIB_MUI | 0x0042e86e) /* MUI: V4 ..g BOOL */
231 #define MUIA_Window_DefaultObject \
232 (MUIB_MUI | 0x004294d7) /* MUI: V4 isg Object * */
233 #define MUIA_Window_DepthGadget \
234 (MUIB_MUI | 0x00421923) /* MUI: V4 i.. BOOL */
235 #define MUIA_Window_DisableKeys \
236 (MUIB_MUI | 0x00424c36) /* MUI: V15 isg ULONG */ /* undoc */
237 #define MUIA_Window_DragBar \
238 (MUIB_MUI | 0x0042045d) /* MUI: V4 i.. BOOL */
239 #define MUIA_Window_FancyDrawing \
240 (MUIB_MUI | 0x0042bd0e) /* MUI: V8 isg BOOL */
241 #define MUIA_Window_Height \
242 (MUIB_MUI | 0x00425846) /* MUI: V4 i.g LONG */
243 #define MUIA_Window_ID \
244 (MUIB_MUI | 0x004201bd) /* MUI: V4 isg ULONG */
245 #define MUIA_Window_InputEvent \
246 (MUIB_MUI | 0x004247d8) /* MUI: V4 ..g struct InputEvent * */
247 #define MUIA_Window_IsSubWindow \
248 (MUIB_MUI | 0x0042b5aa) /* MUI: V4 isg BOOL */
249 #define MUIA_Window_LeftEdge \
250 (MUIB_MUI | 0x00426c65) /* MUI: V4 i.g LONG */
251 #define MUIA_Window_MenuAction \
252 (MUIB_MUI | 0x00427521) /* MUI: V8 isg ULONG */
253 #define MUIA_Window_Menustrip \
254 (MUIB_MUI | 0x0042855e) /* MUI: V8 i.g Object * */
255 #define MUIA_Window_MouseObject \
256 (MUIB_MUI | 0x0042bf9b) /* MUI: V10 ..g Object * */
257 #define MUIA_Window_NeedsMouseObject \
258 (MUIB_MUI | 0x0042372a) /* MUI: V10 i.. BOOL */
259 #define MUIA_Window_NoMenus \
260 (MUIB_MUI | 0x00429df5) /* MUI: V4 is. BOOL */
261 #define MUIA_Window_Open \
262 (MUIB_MUI | 0x00428aa0) /* MUI: V4 .sg BOOL */
263 #define MUIA_Window_PublicScreen \
264 (MUIB_MUI | 0x004278e4) /* MUI: V6 isg STRPTR */
265 #define MUIA_Window_RefWindow \
266 (MUIB_MUI | 0x004201f4) /* MUI: V4 is. Object * */
267 #define MUIA_Window_RootObject \
268 (MUIB_MUI | 0x0042cba5) /* MUI: V4 isg Object * */
269 #define MUIA_Window_Screen \
270 (MUIB_MUI | 0x0042df4f) /* MUI: V4 isg struct Screen * */
271 #define MUIA_Window_ScreenTitle \
272 (MUIB_MUI | 0x004234b0) /* MUI: V5 isg STRPTR */
273 #define MUIA_Window_SizeGadget \
274 (MUIB_MUI | 0x0042e33d) /* MUI: V4 i.. BOOL */
275 #define MUIA_Window_SizeRight \
276 (MUIB_MUI | 0x00424780) /* MUI: V4 i.. BOOL */
277 #define MUIA_Window_Sleep \
278 (MUIB_MUI | 0x0042e7db) /* MUI: V4 .sg BOOL */
279 #define MUIA_Window_Title \
280 (MUIB_MUI | 0x0042ad3d) /* MUI: V4 isg STRPTR */
281 #define MUIA_Window_TopEdge \
282 (MUIB_MUI | 0x00427c66) /* MUI: V4 i.g LONG */
283 #define MUIA_Window_UseBottomBorderScroller \
284 (MUIB_MUI | 0x00424e79) /* MUI: V13 isg BOOL */
285 #define MUIA_Window_UseLeftBorderScroller \
286 (MUIB_MUI | 0x0042433e) /* MUI: V13 isg BOOL */
287 #define MUIA_Window_UseRightBorderScroller \
288 (MUIB_MUI | 0x0042c05e) /* MUI: V13 isg BOOL */
289 #define MUIA_Window_Width \
290 (MUIB_MUI | 0x0042dcae) /* MUI: V4 i.g LONG */
291 #define MUIA_Window_Window \
292 (MUIB_MUI | 0x00426a42) /* MUI: V4 ..g struct Window * */
294 #define MUIA_Window_EraseArea \
295 (MUIB_Window | 0x00000000) /* Zune only i.. BOOL (default: TRUE) */
296 #define MUIA_Window_ZoomGadget \
297 (MUIB_Window | 0x00000002)
298 #define MUIA_Window_ToolBox \
299 (MUIB_Window | 0x00000003)
301 #define MUIV_Window_ActiveObject_None 0
302 #define MUIV_Window_ActiveObject_Next (-1)
303 #define MUIV_Window_ActiveObject_Prev (-2)
304 #define MUIV_Window_AltHeight_MinMax(p) (0-(p))
305 #define MUIV_Window_AltHeight_Visible(p) (-100-(p))
306 #define MUIV_Window_AltHeight_Screen(p) (-200-(p))
307 #define MUIV_Window_AltHeight_Scaled (-1000)
308 #define MUIV_Window_AltLeftEdge_Centered (-1)
309 #define MUIV_Window_AltLeftEdge_Moused (-2)
310 #define MUIV_Window_AltLeftEdge_NoChange (-1000)
311 #define MUIV_Window_AltTopEdge_Centered (-1)
312 #define MUIV_Window_AltTopEdge_Moused (-2)
313 #define MUIV_Window_AltTopEdge_Delta(p) (-3-(p))
314 #define MUIV_Window_AltTopEdge_NoChange (-1000)
315 #define MUIV_Window_AltWidth_MinMax(p) (0-(p))
316 #define MUIV_Window_AltWidth_Visible(p) (-100-(p))
317 #define MUIV_Window_AltWidth_Screen(p) (-200-(p))
318 #define MUIV_Window_AltWidth_Scaled (-1000)
319 #define MUIV_Window_Height_MinMax(p) (0-(p))
320 #define MUIV_Window_Height_Visible(p) (-100-(p))
321 #define MUIV_Window_Height_Screen(p) (-200-(p))
322 #define MUIV_Window_Height_Scaled (-1000)
323 #define MUIV_Window_Height_Default (-1001)
324 #define MUIV_Window_LeftEdge_Centered (-1)
325 #define MUIV_Window_LeftEdge_Moused (-2)
326 #define MUIV_Window_TopEdge_Centered (-1)
327 #define MUIV_Window_TopEdge_Moused (-2)
328 #define MUIV_Window_TopEdge_Delta(p) (-3-(p))
329 #define MUIV_Window_Width_MinMax(p) (0-(p))
330 #define MUIV_Window_Width_Visible(p) (-100-(p))
331 #define MUIV_Window_Width_Screen(p) (-200-(p))
332 #define MUIV_Window_Width_Scaled (-1000)
333 #define MUIV_Window_Width_Default (-1001)
335 #define MUIV_Window_Button_MUI 1
336 #define MUIV_Window_Button_Snapshot 2
337 #define MUIV_Window_Button_Iconify 4
338 #define MUIV_Window_Button_Popup 8
341 #ifdef MUI_OBSOLETE
342 #define MUIA_Window_Menu \
343 (MUIB_MUI | 0x0042db94) /* MUI: V4 i.. struct NewMenu * */
345 #define MUIV_Window_Menu_NoMenu (-1)
346 #endif /* MUI_OBSOLETE */
348 /* Forward declaration for application opaque custom frame specification */
349 struct dt_frame_image;
351 /**************************************************************************
352 Info about the display environment on which all Area Objects have a
353 reference to it.
354 **************************************************************************/
356 #define MRI_RARRAY_SIZE 20
358 struct MUI_RenderInfo
360 Object *mri_WindowObject; /* accessable in-between
361 * MUIM_Setup/MUIM_Cleanup */
362 struct Screen *mri_Screen; /* accessable in-between
363 * MUIM_Setup/MUIM_Cleanup */
364 struct DrawInfo *mri_DrawInfo; /* accessable in-between
365 * MUIM_Setup/MUIM_Cleanup */
366 UWORD *mri_Pens; /* accessable in-between
367 * MUIM_Setup/MUIM_Cleanup */
368 struct Window *mri_Window; /* accessable in-between
369 * MUIM_Show/MUIM_Hide */
370 struct RastPort *mri_RastPort; /* accessable in-between
371 * MUIM_Show/MUIM_Hide */
372 ULONG mri_Flags; /* accessable in-between
373 * MUIM_Setup/MUIM_Cleanup */
375 /* the following stuff is private */
376 struct ColorMap *mri_Colormap;
377 UWORD mri_ScreenWidth;
378 UWORD mri_ScreenHeight;
379 UWORD mri_PensStorage[MPEN_COUNT]; /* storage for pens, mri_Pens points
380 * to here */
382 /* Opened text fonts, done by zune_get_font() */
383 struct TextFont *mri_Fonts[-MUIV_Font_NegCount];
385 /* this is for AddClipping/AddClipRegion */
386 struct Region *mri_rArray[MRI_RARRAY_SIZE];
387 int mri_rCount;
389 struct Rectangle mri_ClipRect;
391 UWORD mri_BorderTop; /* The height of the window's top border (title) */
392 UWORD mri_BorderBottom; /* The height of the window's bottom bodder */
393 UWORD mri_BorderLeft; /* The width of the window's left border */
394 UWORD mri_BorderRight; /* The width of the window's right border */
396 /* Stuff for Borderscrollers */
397 Object *mri_LeftImage; /* Valid between MUIM_Setup/MUIM_Cleanup */
398 Object *mri_RightImage;
399 Object *mri_UpImage;
400 Object *mri_DownImage;
401 Object *mri_SizeImage;
403 Object *mri_VertProp; /* Valid between MUIM_Show/MUIM_Hide */
404 Object *mri_HorizProp;
406 /* buffering */
407 struct RastPort mri_BufferRP;
408 struct BitMap *mri_BufferBM;
410 struct dt_frame_image *mri_FrameImage[16];
413 #define MUIMRI_RECTFILL (1<<0)
414 #define MUIMRI_TRUECOLOR (1<<1)
415 #define MUIMRI_THINFRAMES (1<<2)
416 #define MUIMRI_REFRESHMODE (1<<3)
418 /**************************************************************************
419 MUI_EventHandlerNode as used by
420 MUIM_Window_AddEventHandler/RemoveEventHandler
421 **************************************************************************/
423 struct MUI_EventHandlerNode
425 struct MinNode ehn_Node; /* embedded node structure, private! */
426 BYTE ehn_Reserved; /* private! */
427 BYTE ehn_Priority; /* sorted by priority. */
428 UWORD ehn_Flags; /* some flags, see below */
429 Object *ehn_Object; /* object which should receive MUIM_HandleEvent. */
430 struct IClass *ehn_Class; /* Class for CoerceMethod(). If NULL,
431 * DoMethod() is used */
432 ULONG ehn_Events; /* the IDCMP flags the handler should be
433 * invoked with */
436 /* here are the flags for ehn_Flags */
437 #define MUI_EHF_ALWAYSKEYS (1<<0)
438 #define MUI_EHF_GUIMODE (1<<1) /* handler will not be called if object
439 * is not visible or disabled */
440 #define MUI_EHF_HANDLEINPUT (1<<15) /* ZUNEPRIV: Send MUIM_HandleInput
441 * instead of MUIM_HandleEvent */
443 /* MUIM_HandleEvent must return a bitmask where following bits can be set
444 * (all others must be 0) */
445 #define MUI_EventHandlerRC_Eat (1<<0) /* do not invoke more handlers ers */
448 extern const struct __MUIBuiltinClass _MUI_Window_desc; /* PRIV */
450 #endif /* _MUI_CLASSES_WINDOW_H */