2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
9 #include <proto/alib.h>
10 #include <proto/exec.h>
11 #include <proto/dos.h>
12 #include <proto/utility.h>
13 #include <proto/intuition.h>
14 #include <proto/graphics.h>
15 #include <proto/cybergraphics.h>
16 #include <exec/memory.h>
17 #include <intuition/screens.h>
18 #include <intuition/icclass.h>
19 #include <intuition/cghooks.h>
20 #include <intuition/imageclass.h>
21 #include <intuition/gadgetclass.h>
22 #include <graphics/gfx.h>
23 #include <cybergraphx/cybergraphics.h>
27 #include "asl_intern.h"
33 #include <aros/debug.h>
35 #define CLASS_ASLBASE ((struct AslBase_intern *)cl->cl_UserData)
36 #define HOOK_ASLBASE ((struct AslBase_intern *)hook->h_Data)
38 #define AslBase CLASS_ASLBASE
40 /********************** ASL STRING CLASS **************************************************/
42 IPTR
AslString__OM_NEW(Class
* cl
, Object
* o
, struct opSet
* msg
)
44 struct AslStringData
*data
;
45 struct TagItem fitags
[] =
47 {IA_FrameType
, FRAME_RIDGE
},
51 struct ExtGadget
*eg
= (struct ExtGadget
*)DoSuperMethodA(cl
, o
, (Msg
)msg
);
54 data
= INST_DATA(cl
, eg
);
56 eg
->BoundsLeftEdge
= eg
->LeftEdge
;
57 eg
->BoundsTopEdge
= eg
->TopEdge
;
58 eg
->BoundsWidth
= eg
->Width
;
59 eg
->BoundsHeight
= eg
->Height
;
60 eg
->MoreFlags
|= GMORE_BOUNDS
;
62 eg
->LeftEdge
+= BORDERSTRINGSPACINGX
;
63 eg
->TopEdge
+= BORDERSTRINGSPACINGY
;
64 eg
->Width
-= BORDERSTRINGSPACINGX
* 2;
65 eg
->Height
-= BORDERSTRINGSPACINGY
* 2;
67 data
->frame
= NewObjectA(NULL
, FRAMEICLASS
, fitags
);
70 CoerceMethod(cl
, (Object
*)eg
, OM_DISPOSE
);
78 /***********************************************************************************/
80 IPTR
AslString__OM_DISPOSE(Class
* cl
, Object
* o
, Msg msg
)
82 struct AslStringData
*data
;
85 data
= INST_DATA(cl
, o
);
86 if (data
->frame
) DisposeObject(data
->frame
);
88 retval
= DoSuperMethodA(cl
, o
, msg
);
93 /***********************************************************************************/
95 IPTR
AslString__GM_RENDER(Class
*cl
, struct Gadget
*g
, struct gpRender
*msg
)
97 struct AslStringData
*data
;
100 data
= INST_DATA(cl
, g
);
102 if (msg
->gpr_Redraw
== GREDRAW_REDRAW
)
104 struct TagItem im_tags
[] =
112 getgadgetcoords(g
, msg
->gpr_GInfo
, &x
, &y
, &w
, &h
);
114 x
-= BORDERSTRINGSPACINGX
;
115 y
-= BORDERSTRINGSPACINGY
;
116 w
+= BORDERSTRINGSPACINGX
* 2;
117 h
+= BORDERSTRINGSPACINGY
* 2;
119 im_tags
[0].ti_Data
= w
;
120 im_tags
[1].ti_Data
= h
;
122 SetAttrsA(data
->frame
, im_tags
);
124 DrawImageState(msg
->gpr_RPort
,
125 (struct Image
*)data
->frame
,
129 msg
->gpr_GInfo
->gi_DrInfo
);
131 } /* if (msg->gpr_Redraw == GREDRAW_REDRAW) */
133 retval
= DoSuperMethodA(cl
, (Object
*)g
, (Msg
)msg
);
138 /***********************************************************************************/