2 Copyright © 1995-2005, The AROS Development Team. All rights reserved.
9 #include <proto/exec.h>
10 #include <proto/utility.h>
11 #include <proto/intuition.h>
12 #include <proto/graphics.h>
13 #include <proto/layers.h>
15 #include <exec/memory.h>
16 #include <intuition/screens.h>
17 #include <intuition/cghooks.h>
18 #include <intuition/imageclass.h>
19 #include <intuition/gadgetclass.h>
20 #include <graphics/gfx.h>
24 #include "asl_intern.h"
30 #include <aros/debug.h>
35 #define NewRectRegion(_MinX,_MinY,_MaxX,_MaxY) \
36 ({ struct Region *_region; \
37 if ((_region = NewRegion())) \
38 { struct Rectangle _rect; \
43 if (!OrRectRegion(_region, &_rect)) { DisposeRegion(_region); _region = NULL; } \
51 #define CLASS_ASLBASE ((struct AslBase_intern *)cl->cl_UserData)
52 #define HOOK_ASLBASE ((struct AslBase_intern *)hook->h_Data)
54 #define AslBase CLASS_ASLBASE
56 /********************** ASL ERASER CLASS **************************************************/
58 IPTR
AslEraser__OM_NEW(Class
* cl
, Object
* o
, struct opSet
* msg
)
60 struct Gadget
*g
= (struct Gadget
*)DoSuperMethodA(cl
, o
, (Msg
)msg
);
64 g
->Flags
|= GFLG_RELSPECIAL
;
76 /***********************************************************************************/
78 IPTR
AslEraser__GM_HITTEST(Class
*cl
, Object
*o
, struct gpHitTest
*msg
)
84 /***********************************************************************************/
86 IPTR
AslEraser__GM_RENDER(Class
*cl
, Object
*o
, struct gpRender
*msg
)
88 WORD x
, y
, w
, h
, x2
, y2
;
90 if (msg
->gpr_Redraw
== GREDRAW_REDRAW
)
92 struct Window
*win
= msg
->gpr_GInfo
->gi_Window
;
93 struct RastPort
*rp
= msg
->gpr_RPort
;
96 if ((clip
= NewRectRegion(win
->BorderLeft
,
98 win
->Width
- 1 - win
->BorderRight
,
99 win
->Height
- 1 - win
->BorderBottom
)))
101 struct Gadget
*g
= win
->FirstGadget
;
102 struct RegionRectangle
*rr
;
106 struct Rectangle rect
;
108 getgadgetbounds(g
, msg
->gpr_GInfo
, &x
, &y
, &w
, &h
);
112 rect
.MaxX
= x
+ w
- 1;
113 rect
.MaxY
= y
+ h
- 1;
115 ClearRectRegion(clip
, &rect
);
121 SetABPenDrMd(rp
, msg
->gpr_GInfo
->gi_DrInfo
->dri_Pens
[BACKGROUNDPEN
], 0, JAM2
);
122 rr
= clip
->RegionRectangle
;
125 x
= clip
->bounds
.MinX
+ rr
->bounds
.MinX
;
126 y
= clip
->bounds
.MinY
+ rr
->bounds
.MinY
;
127 x2
= clip
->bounds
.MinX
+ rr
->bounds
.MaxX
;
128 y2
= clip
->bounds
.MinY
+ rr
->bounds
.MaxY
;
130 RectFill(rp
, x
, y
, x2
, y2
);
139 } /* if (msg->gpr_Redraw == GREDRAW_REDRAW) */
144 /***********************************************************************************/