Minor fixes to comments.
[AROS.git] / rom / intuition / boopsigadgets.c
blob4a0f6e919083eb74298fe7db3c18b08e682cbf15
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
5 */
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"
14 #ifdef SKINS
15 #include "intuition_customizesupport.h"
16 #endif
17 #undef DEBUG
18 #define DEBUG 0
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) &&
28 (/*initial ||*/
29 (glist->Flags & (GFLG_RELSPECIAL | GFLG_RELRIGHT | GFLG_RELBOTTOM |
30 GFLG_RELWIDTH | GFLG_RELHEIGHT))))
32 struct gpLayout lmsg;
34 lmsg.MethodID = GM_LAYOUT;
35 lmsg.gpl_GInfo = NULL;
36 lmsg.gpl_Initial = initial;
38 DoGadgetMethodA(glist, win, req, (Msg)&(lmsg));
41 #ifdef SKINS
42 int_relayoutprop(win,glist,IntuitionBase);
43 #endif
44 if (win && !req)
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)
56 width += win->Width;
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;
69 else
71 glist->Activation &= ~GACT_BORDERSNIFF;
75 glist = glist->NextGadget;
76 numgad --;
79 return;
83 void RefreshBoopsiGadget (struct Gadget * gadget, struct Window * win,
84 struct Requester * req, struct IntuitionBase * IntuitionBase)
86 struct gpRender gpr;
88 gpr.MethodID = GM_RENDER;
89 gpr.gpr_Redraw = GREDRAW_REDRAW;
91 DoGadgetMethodA (gadget, win, req, (Msg)&gpr);
92 } /* RefreshBoopsiGadget */