2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
6 AROS menubarlabelclass implementation (does not exist in AmigaOS)
9 #include <exec/types.h>
12 #include <dos/dosextens.h>
14 #include <intuition/intuition.h>
15 #include <intuition/intuitionbase.h>
16 #include <intuition/classes.h>
17 #include <intuition/classusr.h>
18 #include <intuition/imageclass.h>
20 #include <graphics/gfxbase.h>
21 #include <graphics/gfxmacros.h>
22 #include <graphics/rpattr.h>
24 #include <cybergraphx/cybergraphics.h>
26 #include <utility/tagitem.h>
27 #include <utility/hooks.h>
29 #include <clib/macros.h>
31 #include <proto/exec.h>
32 #include <proto/intuition.h>
33 #include <proto/graphics.h>
34 #include <proto/utility.h>
35 #include <proto/cybergraphics.h>
38 #include <aros/asmcall.h>
39 #include <proto/alib.h>
40 #include "intuition_intern.h"
41 #endif /* !__MORPHOS__ */
44 # include "intuition_customize.h"
45 # include "intuition_extend.h"
52 #define IntuitionBase ((struct IntuitionBase *)(cl->cl_UserData))
54 /*************************** BarLabelClass *****************************/
56 struct MenuBarLabelData
61 AROS_UFH3S(IPTR
, dispatch_menubarlabelclass
,
62 AROS_UFHA(Class
*, cl
, A0
),
63 AROS_UFHA(Object
*, obj
, A2
),
64 AROS_UFHA(Msg
, msg
, A1
)
69 struct MenuBarLabelData
*data
;
76 switch (msg
->MethodID
)
79 obj
= (Object
*)DoSuperMethodA(cl
, obj
, msg
);
82 data
= INST_DATA(cl
, obj
);
90 if ((ti
= FindTagItem(SYSIA_DrawInfo
, ((struct opSet
*)msg
)->ops_AttrList
)))
92 data
= INST_DATA(cl
, obj
);
94 data
->dri
= (struct DrawInfo
*)ti
->ti_Data
;
96 retval
= DoSuperMethodA(cl
, obj
, msg
);
100 switch(((struct opGet
*)msg
)->opg_AttrID
)
102 case IA_SupportsDisable
:
105 *(((struct opGet
*)msg
)->opg_Storage
) = 0;
109 *(((struct opGet
*)msg
)->opg_Storage
) = 1;
116 retval
= DoSuperMethodA(cl
, obj
, msg
);
122 data
= INST_DATA(cl
, obj
);
126 rp
= ((struct impDraw
*)msg
)->imp_RPort
;
132 x1
= ((struct Image
*)obj
)->LeftEdge
+ ((struct impDraw
*)msg
)->imp_Offset
.X
;
133 y1
= ((struct Image
*)obj
)->TopEdge
+ ((struct impDraw
*)msg
)->imp_Offset
.Y
;
134 x2
= x1
+ ((struct Image
*)obj
)->Width
- 1;
135 y2
= y1
+ ((struct Image
*)obj
)->Height
- 1;
140 SetAPen(rp
, data
->dri
->dri_Pens
[BARDETAILPEN
]);
141 RectFill(rp
, x1
, y1
, x2
, y2
);
145 /* Will only work if imageheight = 2 */
146 SetAPen(rp
, data
->dri
->dri_Pens
[SHADOWPEN
]);
147 RectFill(rp
, x1
, y1
, x2
- 1, y1
);
148 WritePixel(rp
, x1
, y2
);
150 SetAPen(rp
, data
->dri
->dri_Pens
[SHINEPEN
]);
151 RectFill(rp
, x1
+ 1, y2
, x2
, y2
);
152 WritePixel(rp
, x2
, y1
);
155 } /* if (data->dri) */
159 retval
= DoSuperMethodA(cl
, obj
, msg
);
162 } /* switch (msg->MethodID) */
169 /****************************************************************************/
173 /****************************************************************************/
175 struct IClass
*InitMenuBarLabelClass (struct IntuitionBase
* IntuitionBase
)
179 if ( (cl
= MakeClass(MENUBARLABELCLASS
, IMAGECLASS
, NULL
, sizeof(struct MenuBarLabelData
), 0)) )
181 cl
->cl_Dispatcher
.h_Entry
= (APTR
)AROS_ASMSYMNAME(dispatch_menubarlabelclass
);
182 cl
->cl_Dispatcher
.h_SubEntry
= NULL
;
183 cl
->cl_UserData
= (IPTR
)IntuitionBase
;