2 Copyright © 1995-2005, 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 IPTR
MenuBarLabelClass__OM_NEW(Class
*cl
, Object
*obj
, Msg msg
)
58 struct Image
*im
= (struct Image
*)DoSuperMethodA(cl
, obj
, msg
);
62 struct MenuBarLabelData
*data
= INST_DATA(cl
, im
);
69 /****************************************************************************/
71 IPTR
MenuBarLabelClass__OM_SET(Class
*cl
, struct Image
*im
, struct opSet
*msg
)
75 if ((ti
= FindTagItem(SYSIA_DrawInfo
, msg
->ops_AttrList
)))
77 struct MenuBarLabelData
*data
= INST_DATA(cl
, im
);
79 data
->dri
= (struct DrawInfo
*)ti
->ti_Data
;
82 return DoSuperMethodA(cl
, (Object
*)im
, (Msg
)msg
);
85 /****************************************************************************/
87 IPTR
MenuBarLabelClass__OM_GET(Class
*cl
, struct Image
*im
, struct opGet
*msg
)
89 switch(msg
->opg_AttrID
)
91 case IA_SupportsDisable
:
94 *(msg
->opg_Storage
) = 0;
98 *(msg
->opg_Storage
) = 1;
103 return DoSuperMethodA(cl
, (Object
*)im
, (Msg
)msg
);
107 /****************************************************************************/
109 IPTR
MenuBarLabelClass__IM_DRAW(Class
*cl
, struct Image
*im
, struct impDraw
*msg
)
111 struct MenuBarLabelData
*data
= INST_DATA(cl
, im
);
115 struct RastPort
*rp
= msg
->imp_RPort
;
118 if (!rp
) return (IPTR
)0;
122 x1
= im
->LeftEdge
+ msg
->imp_Offset
.X
;
123 y1
= im
->TopEdge
+ msg
->imp_Offset
.Y
;
124 x2
= x1
+ im
->Width
- 1;
125 y2
= y1
+ im
->Height
- 1;
130 SetAPen(rp
, data
->dri
->dri_Pens
[BARDETAILPEN
]);
131 RectFill(rp
, x1
, y1
, x2
, y2
);
135 /* Will only work if imageheight = 2 */
136 SetAPen(rp
, data
->dri
->dri_Pens
[SHADOWPEN
]);
137 RectFill(rp
, x1
, y1
, x2
- 1, y1
);
138 WritePixel(rp
, x1
, y2
);
140 SetAPen(rp
, data
->dri
->dri_Pens
[SHINEPEN
]);
141 RectFill(rp
, x1
+ 1, y2
, x2
, y2
);
142 WritePixel(rp
, x2
, y1
);
145 } /* if (data->dri) */
150 /****************************************************************************/