1 #ifndef _MUI_CLASSES_WINDOW_H
2 #define _MUI_CLASSES_WINDOW_H
5 Copyright © 1999, David Le Corfec.
6 Copyright © 2002-2015, The AROS Development Team.
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
;
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
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
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 don't use it! */
111 #define MUIM_Window_Refresh /* PRIV */ \
112 (MUIB_Window | 0x00000008) /* Zune: V1, PRIV don't use it! */
114 struct MUIP_Window_AddControlCharHandler
116 STACKED ULONG MethodID
;
117 STACKED
struct MUI_EventHandlerNode
*ccnode
;
120 struct MUIP_Window_AllocGadgetID
122 STACKED ULONG MethodID
;
123 }; /* Custom Class - returns the Gadget ID */
125 struct MUIP_Window_DrawBackground
127 STACKED ULONG MethodID
;
132 STACKED LONG xoffset
;
133 STACKED LONG yoffset
;
137 struct MUIP_Window_DragObject
139 STACKED ULONG MethodID
;
146 struct MUIP_Window_FreeGadgetID
148 STACKED ULONG MethodID
;
149 STACKED LONG gadgetid
;
150 }; /* Custom Class */
152 struct MUIP_Window_RecalcDisplay
154 STACKED ULONG MethodID
;
155 STACKED Object
*originator
;
158 struct MUIP_Window_RemControlCharHandler
160 STACKED ULONG MethodID
;
161 STACKED
struct MUI_EventHandlerNode
*ccnode
;
164 struct MUIP_Window_UpdateMenu
166 STACKED ULONG MethodID
;
170 #define MUIM_Window_GetMenuCheck (MUIB_MUI | 0x00420414) /* MUI: V4 */
171 #define MUIM_Window_GetMenuState (MUIB_MUI | 0x00420d2f) /* MUI: V4 */
172 #define MUIM_Window_SetCycleChain (MUIB_MUI | 0x00426510) /* MUI: V4 */
173 #define MUIM_Window_SetMenuCheck (MUIB_MUI | 0x00422243) /* MUI: V4 */
174 #define MUIM_Window_SetMenuState (MUIB_MUI | 0x00422b5e) /* MUI: V4 */
176 struct MUIP_Window_GetMenuCheck
179 STACKED ULONG MenuID
;
182 struct MUIP_Window_GetMenuState
185 STACKED ULONG MenuID
;
188 struct MUIP_Window_SetCycleChain
191 STACKED Object
*obj
[1];
194 struct MUIP_Window_SetMenuCheck
197 STACKED ULONG MenuID
;
201 struct MUIP_Window_SetMenuState
204 STACKED ULONG MenuID
;
207 #endif /* MUI_OBSOLETE */
209 /*** Attributes *************************************************************/
210 #define MUIA_Window_Activate \
211 (MUIB_MUI | 0x00428d2f) /* MUI: V4 isg BOOL */
212 #define MUIA_Window_ActiveObject \
213 (MUIB_MUI | 0x00427925) /* MUI: V4 .sg Object * */
214 #define MUIA_Window_AltHeight \
215 (MUIB_MUI | 0x0042cce3) /* MUI: V4 i.g LONG */
216 #define MUIA_Window_AltLeftEdge \
217 (MUIB_MUI | 0x00422d65) /* MUI: V4 i.g LONG */
218 #define MUIA_Window_AltTopEdge \
219 (MUIB_MUI | 0x0042e99b) /* MUI: V4 i.g LONG */
220 #define MUIA_Window_AltWidth \
221 (MUIB_MUI | 0x004260f4) /* MUI: V4 i.g LONG */
222 #define MUIA_Window_AppWindow \
223 (MUIB_MUI | 0x004280cf) /* MUI: V5 i.. BOOL */
224 #define MUIA_Window_Backdrop \
225 (MUIB_MUI | 0x0042c0bb) /* MUI: V4 i.. BOOL */
226 #define MUIA_Window_Borderless \
227 (MUIB_MUI | 0x00429b79) /* MUI: V4 i.. BOOL */
228 #define MUIA_Window_CloseGadget \
229 (MUIB_MUI | 0x0042a110) /* MUI: V4 i.. BOOL */
230 #define MUIA_Window_CloseRequest \
231 (MUIB_MUI | 0x0042e86e) /* MUI: V4 ..g BOOL */
232 #define MUIA_Window_DefaultObject \
233 (MUIB_MUI | 0x004294d7) /* MUI: V4 isg Object * */
234 #define MUIA_Window_DepthGadget \
235 (MUIB_MUI | 0x00421923) /* MUI: V4 i.. BOOL */
236 #define MUIA_Window_DisableKeys \
237 (MUIB_MUI | 0x00424c36) /* MUI: V15 isg ULONG */ /* undoc */
238 #define MUIA_Window_DragBar \
239 (MUIB_MUI | 0x0042045d) /* MUI: V4 i.. BOOL */
240 #define MUIA_Window_FancyDrawing \
241 (MUIB_MUI | 0x0042bd0e) /* MUI: V8 isg BOOL */
242 #define MUIA_Window_Height \
243 (MUIB_MUI | 0x00425846) /* MUI: V4 i.g LONG */
244 #define MUIA_Window_ID \
245 (MUIB_MUI | 0x004201bd) /* MUI: V4 isg ULONG */
246 #define MUIA_Window_InputEvent \
247 (MUIB_MUI | 0x004247d8) /* MUI: V4 ..g struct InputEvent * */
248 #define MUIA_Window_IsSubWindow \
249 (MUIB_MUI | 0x0042b5aa) /* MUI: V4 isg BOOL */
250 #define MUIA_Window_LeftEdge \
251 (MUIB_MUI | 0x00426c65) /* MUI: V4 i.g LONG */
252 #define MUIA_Window_MenuAction \
253 (MUIB_MUI | 0x00427521) /* MUI: V8 isg ULONG */
254 #define MUIA_Window_Menustrip \
255 (MUIB_MUI | 0x0042855e) /* MUI: V8 i.g Object * */
256 #define MUIA_Window_MouseObject \
257 (MUIB_MUI | 0x0042bf9b) /* MUI: V10 ..g Object * */
258 #define MUIA_Window_NeedsMouseObject \
259 (MUIB_MUI | 0x0042372a) /* MUI: V10 i.. BOOL */
260 #define MUIA_Window_NoMenus \
261 (MUIB_MUI | 0x00429df5) /* MUI: V4 is. BOOL */
262 #define MUIA_Window_Open \
263 (MUIB_MUI | 0x00428aa0) /* MUI: V4 .sg BOOL */
264 #define MUIA_Window_PublicScreen \
265 (MUIB_MUI | 0x004278e4) /* MUI: V6 isg STRPTR */
266 #define MUIA_Window_RefWindow \
267 (MUIB_MUI | 0x004201f4) /* MUI: V4 is. Object * */
268 #define MUIA_Window_RootObject \
269 (MUIB_MUI | 0x0042cba5) /* MUI: V4 isg Object * */
270 #define MUIA_Window_Screen \
271 (MUIB_MUI | 0x0042df4f) /* MUI: V4 isg struct Screen * */
272 #define MUIA_Window_ScreenTitle \
273 (MUIB_MUI | 0x004234b0) /* MUI: V5 isg STRPTR */
274 #define MUIA_Window_SizeGadget \
275 (MUIB_MUI | 0x0042e33d) /* MUI: V4 i.. BOOL */
276 #define MUIA_Window_SizeRight \
277 (MUIB_MUI | 0x00424780) /* MUI: V4 i.. BOOL */
278 #define MUIA_Window_Sleep \
279 (MUIB_MUI | 0x0042e7db) /* MUI: V4 .sg BOOL */
280 #define MUIA_Window_Title \
281 (MUIB_MUI | 0x0042ad3d) /* MUI: V4 isg STRPTR */
282 #define MUIA_Window_TopEdge \
283 (MUIB_MUI | 0x00427c66) /* MUI: V4 i.g LONG */
284 #define MUIA_Window_UseBottomBorderScroller \
285 (MUIB_MUI | 0x00424e79) /* MUI: V13 isg BOOL */
286 #define MUIA_Window_UseLeftBorderScroller \
287 (MUIB_MUI | 0x0042433e) /* MUI: V13 isg BOOL */
288 #define MUIA_Window_UseRightBorderScroller \
289 (MUIB_MUI | 0x0042c05e) /* MUI: V13 isg BOOL */
290 #define MUIA_Window_Width \
291 (MUIB_MUI | 0x0042dcae) /* MUI: V4 i.g LONG */
292 #define MUIA_Window_Window \
293 (MUIB_MUI | 0x00426a42) /* MUI: V4 ..g struct Window * */
295 #define MUIA_Window_EraseArea \
296 (MUIB_Window | 0x00000000) /* Zune only i.. BOOL (default: TRUE) */
297 #define MUIA_Window_ZoomGadget \
298 (MUIB_Window | 0x00000002)
299 #define MUIA_Window_ToolBox \
300 (MUIB_Window | 0x00000003)
302 #define MUIV_Window_ActiveObject_None 0
303 #define MUIV_Window_ActiveObject_Next (-1)
304 #define MUIV_Window_ActiveObject_Prev (-2)
305 #define MUIV_Window_AltHeight_MinMax(p) (0-(p))
306 #define MUIV_Window_AltHeight_Visible(p) (-100-(p))
307 #define MUIV_Window_AltHeight_Screen(p) (-200-(p))
308 #define MUIV_Window_AltHeight_Scaled (-1000)
309 #define MUIV_Window_AltLeftEdge_Centered (-1)
310 #define MUIV_Window_AltLeftEdge_Moused (-2)
311 #define MUIV_Window_AltLeftEdge_NoChange (-1000)
312 #define MUIV_Window_AltTopEdge_Centered (-1)
313 #define MUIV_Window_AltTopEdge_Moused (-2)
314 #define MUIV_Window_AltTopEdge_Delta(p) (-3-(p))
315 #define MUIV_Window_AltTopEdge_NoChange (-1000)
316 #define MUIV_Window_AltWidth_MinMax(p) (0-(p))
317 #define MUIV_Window_AltWidth_Visible(p) (-100-(p))
318 #define MUIV_Window_AltWidth_Screen(p) (-200-(p))
319 #define MUIV_Window_AltWidth_Scaled (-1000)
320 #define MUIV_Window_Height_MinMax(p) (0-(p))
321 #define MUIV_Window_Height_Visible(p) (-100-(p))
322 #define MUIV_Window_Height_Screen(p) (-200-(p))
323 #define MUIV_Window_Height_Scaled (-1000)
324 #define MUIV_Window_Height_Default (-1001)
325 #define MUIV_Window_LeftEdge_Centered (-1)
326 #define MUIV_Window_LeftEdge_Moused (-2)
327 #define MUIV_Window_TopEdge_Centered (-1)
328 #define MUIV_Window_TopEdge_Moused (-2)
329 #define MUIV_Window_TopEdge_Delta(p) (-3-(p))
330 #define MUIV_Window_Width_MinMax(p) (0-(p))
331 #define MUIV_Window_Width_Visible(p) (-100-(p))
332 #define MUIV_Window_Width_Screen(p) (-200-(p))
333 #define MUIV_Window_Width_Scaled (-1000)
334 #define MUIV_Window_Width_Default (-1001)
336 #define MUIV_Window_Button_MUI 1
337 #define MUIV_Window_Button_Snapshot 2
338 #define MUIV_Window_Button_Iconify 4
339 #define MUIV_Window_Button_Popup 8
343 #define MUIA_Window_Menu \
344 (MUIB_MUI | 0x0042db94) /* MUI: V4 i.. struct NewMenu * */
346 #define MUIV_Window_Menu_NoMenu (-1)
347 #endif /* MUI_OBSOLETE */
349 /* Forward declaration for application opaque custom frame specification */
350 struct dt_frame_image
;
352 /**************************************************************************
353 Info about the display environment on which all Area Objects have a
355 **************************************************************************/
357 #define MRI_RARRAY_SIZE 20
359 struct MUI_RenderInfo
361 Object
*mri_WindowObject
; /* accessable in-between
362 * MUIM_Setup/MUIM_Cleanup */
363 struct Screen
*mri_Screen
; /* accessable in-between
364 * MUIM_Setup/MUIM_Cleanup */
365 struct DrawInfo
*mri_DrawInfo
; /* accessable in-between
366 * MUIM_Setup/MUIM_Cleanup */
367 UWORD
*mri_Pens
; /* accessable in-between
368 * MUIM_Setup/MUIM_Cleanup */
369 struct Window
*mri_Window
; /* accessable in-between
370 * MUIM_Show/MUIM_Hide */
371 struct RastPort
*mri_RastPort
; /* accessable in-between
372 * MUIM_Show/MUIM_Hide */
373 ULONG mri_Flags
; /* accessable in-between
374 * MUIM_Setup/MUIM_Cleanup */
376 /* the following stuff is private */
377 struct ColorMap
*mri_Colormap
;
378 UWORD mri_ScreenWidth
;
379 UWORD mri_ScreenHeight
;
380 UWORD mri_PensStorage
[MPEN_COUNT
]; /* storage for pens, mri_Pens points
383 /* Opened text fonts, done by zune_get_font() */
384 struct TextFont
*mri_Fonts
[-MUIV_Font_NegCount
];
386 /* this is for AddClipping/AddClipRegion */
387 struct Region
*mri_rArray
[MRI_RARRAY_SIZE
];
390 struct Rectangle mri_ClipRect
;
392 UWORD mri_BorderTop
; /* The height of the window's top border (title) */
393 UWORD mri_BorderBottom
; /* The height of the window's bottom bodder */
394 UWORD mri_BorderLeft
; /* The width of the window's left border */
395 UWORD mri_BorderRight
; /* The width of the window's right border */
397 /* Stuff for Borderscrollers */
398 Object
*mri_LeftImage
; /* Valid between MUIM_Setup/MUIM_Cleanup */
399 Object
*mri_RightImage
;
401 Object
*mri_DownImage
;
402 Object
*mri_SizeImage
;
404 Object
*mri_VertProp
; /* Valid between MUIM_Show/MUIM_Hide */
405 Object
*mri_HorizProp
;
408 struct RastPort mri_BufferRP
;
409 struct BitMap
*mri_BufferBM
;
411 struct dt_frame_image
*mri_FrameImage
[16];
414 #define MUIMRI_RECTFILL (1<<0)
415 #define MUIMRI_TRUECOLOR (1<<1)
416 #define MUIMRI_THINFRAMES (1<<2)
417 #define MUIMRI_REFRESHMODE (1<<3)
419 /**************************************************************************
420 MUI_EventHandlerNode as used by
421 MUIM_Window_AddEventHandler/RemoveEventHandler
422 **************************************************************************/
424 struct MUI_EventHandlerNode
426 struct MinNode ehn_Node
; /* embedded node structure, private! */
427 BYTE ehn_Reserved
; /* private! */
428 BYTE ehn_Priority
; /* sorted by priority. */
429 UWORD ehn_Flags
; /* some flags, see below */
430 Object
*ehn_Object
; /* object which should receive MUIM_HandleEvent. */
431 struct IClass
*ehn_Class
; /* Class for CoerceMethod(). If NULL,
432 * DoMethod() is used */
433 ULONG ehn_Events
; /* the IDCMP flags the handler should be
437 /* here are the flags for ehn_Flags */
438 #define MUI_EHF_ALWAYSKEYS (1<<0)
439 #define MUI_EHF_GUIMODE (1<<1) /* handler will not be called if object
440 * is not visible or disabled */
441 #define MUI_EHF_HANDLEINPUT (1<<15) /* ZUNEPRIV: Send MUIM_HandleInput */
442 /* ZUNEPRIV: instead of MUIM_HandleEvent */
444 /* MUIM_HandleEvent must return a bitmask where following bits can be set
445 * (all others must be 0) */
446 #define MUI_EventHandlerRC_Eat (1<<0) /* do not invoke more handlers ers */
449 extern const struct __MUIBuiltinClass _MUI_Window_desc
; /* PRIV */
451 #endif /* _MUI_CLASSES_WINDOW_H */