2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <intuition/intuition.h>
8 #include <intuition/classusr.h>
9 #include <intuition/gadgetclass.h>
10 #include <intuition/intuitionbase.h>
11 #include <proto/intuition.h>
13 #include "intuition_intern.h"
15 #include "intuition_customizesupport.h"
19 # include <aros/debug.h>
21 VOID
DoGMLayout(struct Gadget
*glist
, struct Window
*win
, struct Requester
*req
,
22 UWORD numgad
, BOOL initial
, struct IntuitionBase
*IntuitionBase
)
24 while (glist
&& numgad
)
26 /* Is this a BOOPSI gad with special relativity ? */
27 if (((glist
->GadgetType
& GTYP_GTYPEMASK
) == GTYP_CUSTOMGADGET
) &&
29 (glist
->Flags
& (GFLG_RELSPECIAL
| GFLG_RELRIGHT
| GFLG_RELBOTTOM
|
30 GFLG_RELWIDTH
| GFLG_RELHEIGHT
))))
34 lmsg
.MethodID
= GM_LAYOUT
;
35 lmsg
.gpl_GInfo
= NULL
;
36 lmsg
.gpl_Initial
= initial
;
38 DoGadgetMethodA(glist
, win
, req
, (Msg
)&(lmsg
));
42 int_relayoutprop(win
,glist
,IntuitionBase
);
46 WORD left
= glist
->LeftEdge
;
47 WORD top
= glist
->TopEdge
;
48 WORD width
= glist
->Width
;
49 WORD height
= glist
->Height
;
51 if (glist
->Flags
& GFLG_RELRIGHT
)
52 left
+= win
->Width
- 1;
53 if (glist
->Flags
& GFLG_RELBOTTOM
)
54 top
+= win
->Height
- 1;
55 if (glist
->Flags
& GFLG_RELWIDTH
)
57 if (glist
->Flags
& GFLG_RELHEIGHT
)
58 height
+= win
->Height
;
60 if ((left
>= win
->Width
- win
->BorderRight
||
61 top
>= win
->Height
- win
->BorderBottom
||
62 left
+ width
- 1 <= win
->BorderLeft
||
63 top
+ height
- 1 <= win
->BorderTop
) &&
64 (glist
->Flags
& (GFLG_RELSPECIAL
| GFLG_RELRIGHT
| GFLG_RELBOTTOM
|
65 GFLG_RELWIDTH
| GFLG_RELHEIGHT
)))
67 glist
->Activation
|= GACT_BORDERSNIFF
;
71 glist
->Activation
&= ~GACT_BORDERSNIFF
;
75 glist
= glist
->NextGadget
;
83 void RefreshBoopsiGadget (struct Gadget
* gadget
, struct Window
* win
,
84 struct Requester
* req
, struct IntuitionBase
* IntuitionBase
)
88 gpr
.MethodID
= GM_RENDER
;
89 gpr
.gpr_Redraw
= GREDRAW_REDRAW
;
91 DoGadgetMethodA (gadget
, win
, req
, (Msg
)&gpr
);
92 } /* RefreshBoopsiGadget */