2 Copyright © 1999, David Le Corfec.
3 Copyright © 2002 - 2014, The AROS Development Team.
9 #ifndef _MUI_CLASSES_AREA_H
10 #define _MUI_CLASSES_AREA_H
12 #ifndef INTUITION_INTUITION_H
13 #include <intuition/intuition.h>
16 #ifndef GRAPHICS_GRAPHICS_H
17 #include <graphics/gfx.h>
20 #ifndef _MUI_CLASSES_WINDOW_H
21 #include "classes/window.h" /* for MUI_EventHandlerNode, will be gone if this MUI_AreaData is moved to area.c */
24 /*** Name *******************************************************************/
25 #define MUIC_Area "Area.mui"
27 /*** Identifier base (for Zune extensions) **********************************/
28 #define MUIB_Area (MUIB_ZUNE | 0x00000200)
30 /*** Methods ****************************************************************/
31 #define MUIM_AskMinMax \
32 (MUIB_MUI | 0x00423874) /* MUI: V4 */ /* For Custom Classes only */
33 #define MUIM_Cleanup \
34 (MUIB_MUI | 0x0042d985) /* MUI: V4 */ /* For Custom Classes only */
35 #define MUIM_ContextMenuBuild \
36 (MUIB_MUI | 0x00429d2e) /* MUI: V11 */
37 #define MUIM_ContextMenuChoice \
38 (MUIB_MUI | 0x00420f0e) /* MUI: V11 */
39 #define MUIM_CreateBubble \
40 (MUIB_MUI | 0x00421c41) /* MUI: V18 */
41 #define MUIM_CreateDragImage \
42 (MUIB_MUI | 0x0042eb6f) /* MUI: V18 */ /* For Custom Classes only, undoc */
43 #define MUIM_CreateShortHelp \
44 (MUIB_MUI | 0x00428e93) /* MUI: V11 */
45 #define MUIM_CustomBackfill \
46 (MUIB_MUI | 0x00428d73) /* Undoc */
47 #define MUIM_DeleteBubble \
48 (MUIB_MUI | 0x004211af) /* MUI: V18 */
49 #define MUIM_DeleteDragImage \
50 (MUIB_MUI | 0x00423037) /* MUI: V18 */ /* For Custom Classes only, undoc */
51 #define MUIM_DeleteShortHelp \
52 (MUIB_MUI | 0x0042d35a) /* MUI: V11 */
54 (MUIB_MUI | 0x004216bb) /* MUI: V18 */ /* For Custom Classes only, undoc */
55 #define MUIM_DragBegin \
56 (MUIB_MUI | 0x0042c03a) /* MUI: V11 */
57 #define MUIM_DragDrop \
58 (MUIB_MUI | 0x0042c555) /* MUI: V11 */
59 #define MUIM_UnknownDropDestination \
60 (MUIB_MUI | 0x00425550) /* ZUNE */
61 #define MUIM_DragFinish \
62 (MUIB_MUI | 0x004251f0) /* MUI: V11 */
63 #define MUIM_DragQuery \
64 (MUIB_MUI | 0x00420261) /* MUI: V11 */
65 #define MUIM_DragReport \
66 (MUIB_MUI | 0x0042edad) /* MUI: V11 */
68 (MUIB_MUI | 0x00426f3f) /* MUI: V4 */ /* For Custom Classes only */
69 #define MUIM_DrawBackground \
70 (MUIB_MUI | 0x004238ca) /* MUI: V11 */
71 #define MUIM_GoActive \
72 (MUIB_MUI | 0x0042491a) /* Undoc */
73 #define MUIM_GoInactive \
74 (MUIB_MUI | 0x00422c0c) /* Undoc */
75 #define MUIM_HandleEvent \
76 (MUIB_MUI | 0x00426d66) /* MUI: V16 */ /* For Custom Classes only */
77 #define MUIM_HandleInput \
78 (MUIB_MUI | 0x00422a1a) /* MUI: V4 */ /* For Custom Classes only */
80 (MUIB_MUI | 0x0042f20f) /* MUI: V4 */ /* For Custom Classes only */
82 (MUIB_MUI | 0x00428354) /* MUI: V4 */ /* For Custom Classes only */
84 (MUIB_MUI | 0x0042cc84) /* MUI: V4 */ /* For Custom Classes only */
88 STACKED ULONG MethodID
;
89 STACKED
struct MUI_MinMax
*MinMaxInfo
;
94 STACKED ULONG MethodID
;
97 struct MUIP_ContextMenuBuild
99 STACKED ULONG MethodID
;
104 struct MUIP_ContextMenuChoice
106 STACKED ULONG MethodID
;
107 STACKED Object
*item
;
110 struct MUIP_CreateBubble
112 STACKED ULONG MethodID
;
119 struct MUIP_CreateDragImage
121 STACKED ULONG MethodID
;
127 struct MUIP_CreateShortHelp
129 STACKED ULONG MethodID
;
134 struct MUIP_CustomBackfill
136 STACKED ULONG MethodID
;
141 STACKED LONG xoffset
;
142 STACKED LONG yoffset
;
145 struct MUIP_DeleteBubble
147 STACKED ULONG MethodID
;
151 struct MUIP_DeleteDragImage
153 STACKED ULONG MethodID
;
154 STACKED
struct MUI_DragImage
*di
;
157 struct MUIP_DeleteShortHelp
159 STACKED ULONG MethodID
;
165 STACKED ULONG MethodID
;
171 struct MUIP_UnknownDropDestination
173 STACKED ULONG MethodID
;
174 STACKED
struct IntuiMessage
*imsg
;
177 struct MUIP_DragBegin
179 STACKED ULONG MethodID
;
185 STACKED ULONG MethodID
;
191 struct MUIP_DragFinish
193 STACKED ULONG MethodID
;
197 struct MUIP_DragQuery
199 STACKED ULONG MethodID
;
203 struct MUIP_DragReport
205 STACKED ULONG MethodID
;
214 STACKED ULONG MethodID
;
218 struct MUIP_DrawBackground
220 STACKED ULONG MethodID
;
225 STACKED LONG xoffset
;
226 STACKED LONG yoffset
;
230 struct MUIP_DrawBackgroundBuffered
232 STACKED ULONG MethodID
;
233 STACKED
struct RastPort
*rp
;
238 STACKED LONG xoffset
;
239 STACKED LONG yoffset
;
245 STACKED ULONG MethodID
;
248 struct MUIP_GoInactive
250 STACKED ULONG MethodID
;
253 struct MUIP_HandleEvent
255 STACKED ULONG MethodID
;
256 STACKED
struct IntuiMessage
*imsg
;
260 struct MUIP_HandleInput
262 STACKED ULONG MethodID
;
263 STACKED
struct IntuiMessage
*imsg
;
269 STACKED ULONG MethodID
;
274 STACKED ULONG MethodID
;
275 STACKED
struct MUI_RenderInfo
*RenderInfo
;
280 STACKED ULONG MethodID
;
283 #define MUIM_Layout \
284 (MUIB_Area | 0x00000000)
285 #define MUIM_DrawParentBackground \
286 (MUIB_Area | 0x00000001)
287 #define MUIM_DragQueryExtended /* PRIV */ \
288 (MUIB_Area | 0x00000002) /* PRIV - returns a object or NULL */
289 #define MUIM_Timer /* PRIV */ \
290 (MUIB_Area | 0x00000003) /* PRIV */
291 #define MUIM_UpdateInnerSizes /* PRIV */ \
292 (MUIB_Area | 0x00000004) /* PRIV for now */
293 #define MUIM_FindAreaObject /* PRIV */ \
294 (MUIB_Area | 0x00000005) /* PRIV */
295 #define MUIM_DrawBackgroundBuffered /* PRIV */ \
296 (MUIB_Area | 0x00000006) /* PRIV */
300 STACKED ULONG MethodID
;
303 struct MUIP_DrawParentBackground
305 STACKED ULONG MethodID
;
310 STACKED LONG xoffset
;
311 STACKED LONG yoffset
;
315 struct MUIP_DragQueryExtended
/* PRIV */
317 STACKED ULONG MethodID
; /* PRIV */
318 STACKED Object
*obj
; /* PRIV */
319 STACKED LONG x
; /* PRIV */
320 STACKED LONG y
; /* PRIV */
323 struct MUIP_Timer
/* PRIV */
325 STACKED ULONG MethodID
; /* PRIV */
328 struct MUIP_UpdateInnerSizes
/* PRIV */
330 STACKED ULONG MethodID
; /* PRIV */
333 struct MUIP_FindAreaObject
/* PRIV */
335 STACKED ULONG MethodID
; /* PRIV */
336 STACKED Object
*obj
; /* PRIV */
342 WORD width
; /* exact width and height of bitmap */
344 WORD touchx
; /* position of pointer click relative to bitmap */
349 // #define MUIF_DRAGIMAGE_HASMASK (1<<0) /* Use provided mask for drawing */
350 /* Not supported at the moment */
351 #define MUIF_DRAGIMAGE_SOURCEALPHA (1<<1) /* Use drag image source alpha
352 * information for transparent
355 /*** Attributes *************************************************************/
356 #define MUIA_Background \
357 (MUIB_MUI | 0x0042545b) /* MUI: V4 is. LONG */
358 #define MUIA_BottomEdge \
359 (MUIB_MUI | 0x0042e552) /* MUI: V4 ..g LONG */
360 #define MUIA_ContextMenu \
361 (MUIB_MUI | 0x0042b704) /* MUI: V11 isg Object * */
362 #define MUIA_ContextMenuTrigger \
363 (MUIB_MUI | 0x0042a2c1) /* MUI: V11 ..g Object * */
364 #define MUIA_ControlChar \
365 (MUIB_MUI | 0x0042120b) /* MUI: V4 isg char */
366 #define MUIA_CustomBackfill \
367 (MUIB_MUI | 0x00420a63) /* undoc i.. */
368 #define MUIA_CycleChain \
369 (MUIB_MUI | 0x00421ce7) /* MUI: V11 isg LONG */
370 #define MUIA_Disabled \
371 (MUIB_MUI | 0x00423661) /* MUI: V4 isg BOOL */
372 #define MUIA_DoubleBuffer \
373 (MUIB_MUI | 0x0042a9c7) /* MUI: V20 isg BOOL */
374 #define MUIA_Draggable \
375 (MUIB_MUI | 0x00420b6e) /* MUI: V11 isg BOOL */
376 #define MUIA_Dropable \
377 (MUIB_MUI | 0x0042fbce) /* MUI: V11 isg BOOL */
378 #define MUIA_FillArea \
379 (MUIB_MUI | 0x004294a3) /* MUI: V4 is. BOOL */
380 #define MUIA_FixHeight \
381 (MUIB_MUI | 0x0042a92b) /* MUI: V4 i.. LONG */
382 #define MUIA_FixHeightTxt \
383 (MUIB_MUI | 0x004276f2) /* MUI: V4 i.. STRPTR */
384 #define MUIA_FixWidth \
385 (MUIB_MUI | 0x0042a3f1) /* MUI: V4 i.. LONG */
386 #define MUIA_FixWidthTxt \
387 (MUIB_MUI | 0x0042d044) /* MUI: V4 i.. STRPTR */
389 (MUIB_MUI | 0x0042be50) /* MUI: V4 i.g struct TextFont * */
391 (MUIB_MUI | 0x0042ac64) /* MUI: V4 i.. LONG */
392 #define MUIA_FramePhantomHoriz \
393 (MUIB_MUI | 0x0042ed76) /* MUI: V4 i.. BOOL */
394 #define MUIA_FrameTitle \
395 (MUIB_MUI | 0x0042d1c7) /* MUI: V4 i.. STRPTR */
396 #define MUIA_Height \
397 (MUIB_MUI | 0x00423237) /* MUI: V4 ..g LONG */
398 #define MUIA_HorizDisappear \
399 (MUIB_MUI | 0x00429615) /* MUI: V11 isg LONG */
400 #define MUIA_HorizWeight \
401 (MUIB_MUI | 0x00426db9) /* MUI: V4 isg WORD */
402 #define MUIA_InnerBottom \
403 (MUIB_MUI | 0x0042f2c0) /* MUI: V4 i.g LONG */
404 #define MUIA_InnerLeft \
405 (MUIB_MUI | 0x004228f8) /* MUI: V4 i.g LONG */
406 #define MUIA_InnerRight \
407 (MUIB_MUI | 0x004297ff) /* MUI: V4 i.g LONG */
408 #define MUIA_InnerTop \
409 (MUIB_MUI | 0x00421eb6) /* MUI: V4 i.g LONG */
410 #define MUIA_InputMode \
411 (MUIB_MUI | 0x0042fb04) /* MUI: V4 i.. LONG */
412 #define MUIA_LeftEdge \
413 (MUIB_MUI | 0x0042bec6) /* MUI: V4 ..g LONG */
414 #define MUIA_MaxHeight \
415 (MUIB_MUI | 0x004293e4) /* MUI: V11 i.. LONG */
416 #define MUIA_MaxWidth \
417 (MUIB_MUI | 0x0042f112) /* MUI: V11 i.. LONG */
418 #define MUIA_Pressed \
419 (MUIB_MUI | 0x00423535) /* MUI: V4 ..g BOOL */
420 #define MUIA_RightEdge \
421 (MUIB_MUI | 0x0042ba82) /* MUI: V4 ..g LONG */
422 #define MUIA_Selected \
423 (MUIB_MUI | 0x0042654b) /* MUI: V4 isg BOOL */
424 #define MUIA_ShortHelp \
425 (MUIB_MUI | 0x00428fe3) /* MUI: V11 isg STRPTR */
426 #define MUIA_ShowMe \
427 (MUIB_MUI | 0x00429ba8) /* MUI: V4 isg BOOL */
428 #define MUIA_ShowSelState \
429 (MUIB_MUI | 0x0042caac) /* MUI: V4 i.. BOOL */
431 (MUIB_MUI | 0x00426435) /* MUI: V4 ..g LONG */
432 #define MUIA_TopEdge \
433 (MUIB_MUI | 0x0042509b) /* MUI: V4 ..g LONG */
434 #define MUIA_VertDisappear \
435 (MUIB_MUI | 0x0042d12f) /* MUI: V11 isg LONG */
436 #define MUIA_VertWeight \
437 (MUIB_MUI | 0x004298d0) /* MUI: V4 isg WORD */
438 #define MUIA_Weight \
439 (MUIB_MUI | 0x00421d1f) /* MUI: V4 i.. WORD */
441 (MUIB_MUI | 0x0042b59c) /* MUI: V4 ..g LONG */
442 #define MUIA_Window \
443 (MUIB_MUI | 0x00421591) /* MUI: V4 ..g struct Window * */
444 #define MUIA_WindowObject \
445 (MUIB_MUI | 0x0042669e) /* MUI: V4 ..g Object * */
447 #define MUIA_NestedDisabled \
448 (MUIB_Area | 0x00000000) /* Zune 20030530 isg BOOL */
451 #define MUIA_ExportID (MUIB_MUI | 0x0042d76e) /* V4 isg ULONG */
452 #endif /* MUI_OBSOLETE */
454 struct MUI_ImageSpec_intern
;
458 struct MUI_RenderInfo
*mad_RenderInfo
; /* RenderInfo for this object */
459 struct MUI_ImageSpec_intern
*mad_Background
; /* bg setting - *private* ! */
460 struct TextFont
*mad_Font
; /* Font which is used to draw */
461 struct MUI_MinMax mad_MinMax
; /* min/max/default dimensions */
462 struct IBox mad_Box
; /* coordinates and dim of this object after layout */
463 BYTE mad_addleft
; /* left offset (frame & innerspacing) */
464 BYTE mad_addtop
; /* top offset (frame & innerspacing) */
465 BYTE mad_subwidth
; /* additional width (frame & innerspacing) */
466 BYTE mad_subheight
; /* additional height (frame & innerspacing) */
467 ULONG mad_Flags
; /* some flags; see below */
469 // 40 bytes up to here
471 /* The following data is private */
474 UWORD mad_HorizWeight
; /* weight values for layout. default 100 */
475 UWORD mad_VertWeight
;
479 ULONG mad_IDCMP
; /* IDCMP flags this listens to (for HandleInput) */
481 CONST_STRPTR mad_BackgroundSpec
;
483 IPTR mad_FontPreset
; /* MUIV_Font_xxx or pointer to struct TextFont */
485 CONST_STRPTR mad_FrameTitle
; /* for groups. Req. mad_Frame > 0 */
486 // Inner values at offset 88 in MUI:
487 BYTE mad_InnerLeft
; /* frame or hardcoded */
490 BYTE mad_InnerBottom
;
492 BYTE mad_FrameOBSOLETE
; /* frame setting -- private */
494 BYTE mad_InputMode
; /* how to react to events */
496 TEXT mad_ControlChar
; /* key shortcut */
497 BYTE mad_TitleHeightAdd
; /* frame title height = mad_TitleBelow + mad_TitleBaseline */
498 BYTE mad_TitleHeightBelow
; /* height below frame */
499 BYTE mad_TitleHeightAbove
; /* height above frame */
503 WORD mad_HardHeight
; /* if harcoded dim (see flags) */
504 WORD mad_HardWidth
; /* if harcoded dim (see flags) */
505 CONST_STRPTR mad_HardWidthTxt
;
506 CONST_STRPTR mad_HardHeightTxt
;
507 // TODO: move SelBack in RenderInfo as it's common for all objects
508 struct MUI_ImageSpec_intern
*mad_SelBack
; /* selected state background */
509 CONST_STRPTR mad_ShortHelp
; /* bubble help */
510 // there's an event handler at 114
511 struct MUI_EventHandlerNode mad_ehn
;
512 struct MUI_InputHandlerNode mad_Timer
; /* MUIA_Timer */
513 ULONG mad_Timeval
; /* just to trigger notifications */
514 struct MUI_EventHandlerNode mad_ccn
; /* gross hack for control char */
515 Object
*mad_ContextMenu
; /* menu strip */
516 LONG mad_ClickX
; /* x position of the initial SELECTDOWN click */
517 LONG mad_ClickY
; /* y position of the intiial SELECTDOWN click */
518 struct ZMenu
*mad_ContextZMenu
;
519 struct MUI_EventHandlerNode mad_hiehn
; /* Eventhandler to simulate MUIM_HandleInput */
521 LONG mad_DisableCount
; /* counts number of disables */
523 // only 148 bytes for the struct in MUI !
526 /* Flags during MUIM_Draw */
527 #define MADF_DRAWOBJECT (1<< 0) /* draw object completely */
528 #define MADF_DRAWUPDATE (1<< 1) /* update object */
530 #define MADF_DRAWALL (1<< 31)
533 /* mad_Flags, private one */
534 #define MADF_DRAW_XXX (1<< 2) /* PRIV - mui verified, what use ? */
535 #define MADF_DRAGGABLE (1<< 3) /* PRIV - mui verified */
536 #define MADF_MAXHEIGHT (1<< 4) /* PRIV - share bit 6 in mui */
537 #define MADF_CYCLECHAIN (1<< 5) /* PRIV - mui verified */
538 #define MADF_MAXWIDTH (1<< 6) /* PRIV - share bit 6 in mui */
539 #define MADF_DRAGGING (1<< 7) /* PRIV - zune-specific ? */
540 #define MADF_OWNBG (1<< 8) /* PRIV - zune-specific ? */
541 #define MADF_SHOWME (1<< 9) /* PRIV - mui verified */
542 #define MADF_BORDERGADGET (1<< 10) /* PRIV - is a border gadget; zune-specific ? */
543 #define MADF_DRAWFRAME (1<< 11) /* PRIV - nearly mui verified */
544 #define MADF_DRAW_XXX_2 (1<< 12) /* PRIV - mui verified, what use ? */
545 #define MADF_DROPABLE (1<< 13) /* PRIV - mui verified */
546 #define MADF_CANDRAW (1<< 14) /* PRIV - roughly mui equivalent */
547 #define MADF_DISABLED (1<< 15) /* PRIV - mui verified */
548 #define MADF_SHOWSELSTATE (1<< 16) /* PRIV - mui verified */
549 #define MADF_PRESSED (1<< 17) /* PRIV - nearly mui verified */
550 #define MADF_SELECTED (1<< 18) /* PRIV - mui verified */
551 #define MADF_FIXHEIGHT (1<< 19) /* PRIV - zune-specific */
552 #define MADF_FILLAREA (1<< 20) /* PRIV - mui verified */
553 #define MADF_FIXWIDTH (1<< 22) /* PRIV - zune-specific */
554 #define MADF_FIXHEIGHTTXT (1<< 22) /* PRIV - mui verified (unused in zune) */
555 #define MADF_INNERLEFT (1<< 23) /* PRIV - mui verified */
556 #define MADF_INNERTOP (1<< 24) /* PRIV - mui verified */
557 #define MADF_INNERRIGHT (1<< 25) /* PRIV - mui verified */
558 #define MADF_INNERBOTTOM (1<< 26) /* PRIV - mui verified */
559 #define MADF_FRAMEPHANTOM (1<< 27) /* PRIV - mui verified */
560 #define MADF_SETUP (1<< 28) /* PRIV - zune-specific */
562 #define MADF_INVIRTUALGROUP (1<<29) /* PRIV UNDOC: The object is inside a virtual group */
563 #define MADF_ISVIRTUALGROUP (1<<30) /* PRIV UNDOC: The object is a virtual group */
565 #define MADF_DRAWFLAGS (MADF_DRAWOBJECT | MADF_DRAWUPDATE | MADF_DRAW_XXX \
566 | MADF_DRAWFRAME | MADF_DRAW_XXX_2 | MADF_DRAWALL)
569 // offset 94 (byte) (frame << 1) (lsb is SETUP_DONE flag)
574 MUIV_Frame_ImageButton
,
578 MUIV_Frame_InputList
,
588 MUIV_Frame_Register
= 21,
594 MUIV_InputMode_None
= 0, // 0x00
595 MUIV_InputMode_RelVerify
, // 0x40 (1<<6)
596 MUIV_InputMode_Immediate
, // 0x80 (1<<7)
597 MUIV_InputMode_Toggle
, // 0xc0 (1<<7 | 1<<6)
604 MUIV_DragQuery_Refuse
= 0,
605 MUIV_DragQuery_Accept
,
610 MUIV_DragReport_Abort
= 0,
611 MUIV_DragReport_Continue
,
612 MUIV_DragReport_Lock
,
613 MUIV_DragReport_Refresh
,
616 #define MUIV_CreateBubble_DontHidePointer (1<<0)
618 /* A private functions and macros */
619 void __area_finish_minmax(Object
*obj
, struct MUI_MinMax
*MinMaxInfo
); /* PRIV */
621 /*#define DRAW_BG_RECURSIVE (1<<1)*/
622 #define _vweight(obj) /* PRIV */ \
623 (muiAreaData(obj)->mad_VertWeight) /* accesses private members PRIV */
624 #define _hweight(obj) /* PRIV */ \
625 (muiAreaData(obj)->mad_HorizWeight) /* accesses private members PRIV */
627 extern const struct __MUIBuiltinClass _MUI_Area_desc
; /* PRIV */
629 #endif /* _MUI_CLASSES_AREA_H */