2 Copyright 1995-2003, The AROS Development Team. All rights reserved.
3 Copyright 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <proto/graphics.h>
8 #include <proto/intuition.h>
9 #include <proto/cybergraphics.h>
10 #include <proto/layers.h>
11 #include <proto/utility.h>
12 #include <graphics/gfxmacros.h>
13 #include <intuition/cghooks.h>
14 #include <intuition/intuition.h>
15 #include <intuition/imageclass.h>
16 #include <intuition/windecorclass.h>
17 #include <cybergraphx/cybergraphics.h>
18 #include <graphics/rpattr.h>
19 #include "intuition_intern.h"
20 #include "propgadgets.h"
22 #include "intuition_customize.h"
23 #include "intuition_customizesupport.h"
24 #include "morphos/proprender.h"
28 extern IPTR
HookEntry();
32 # include <aros/debug.h>
34 // static data moved to intuibase - Piru
35 //static WORD clickoffset_x, clickoffset_y;
36 #define clickoffset_x GetPrivIBase(IntuitionBase)->prop_clickoffset_x
37 #define clickoffset_y GetPrivIBase(IntuitionBase)->prop_clickoffset_y
39 BOOL
isonborder(struct Gadget
*gadget
,struct Window
*window
);
41 static void RenderPropBackground(struct Gadget
*gad
, struct Window
*win
, struct DrawInfo
*dri
,
42 struct Rectangle
*rect
, struct Rectangle
*proprect
,
43 struct Rectangle
*knobrect
, struct PropInfo
*pi
,
44 struct RastPort
*rp
, BOOL onborder
,
45 struct IntuitionBase
*IntuitionBase
)
49 struct wdpDrawBorderPropBack msg
;
51 msg
.MethodID
= WDM_DRAW_BORDERPROPBACK
;
54 msg
.wdp_TrueColor
= (((struct IntScreen
*)win
->WScreen
)->DInfo
.dri
.dri_Flags
& DRIF_DIRECTCOLOR
);
55 msg
.wdp_UserBuffer
= ((struct IntWindow
*)win
)->DecorUserBuffer
;
59 msg
.wdp_RenderRect
= rect
;
60 msg
.wdp_PropRect
= proprect
;
61 msg
.wdp_KnobRect
= knobrect
;
65 DoMethodA(((struct IntScreen
*)(win
->WScreen
))->WinDecorObj
, (Msg
)&msg
);
69 static UWORD pattern
[] = {0x5555,0xAAAA};
70 struct Hook
*dhook
= NULL
;
72 if ((gad
->Flags
& GFLG_EXTENDED
) != 0)
74 if ((((struct ExtGadget
*) gad
)->MoreFlags
& GMORE_BOOPSIGADGET
) != 0)
76 GetAttr(PGA_DisplayHook
, (Object
*) gad
, &dhook
);
81 struct wdpDrawBorderPropBack msg
;
83 msg
.MethodID
= WDM_DRAW_BORDERPROPBACK
;
86 msg
.wdp_TrueColor
= (((struct IntScreen
*)win
->WScreen
)->DInfo
.dri
.dri_Flags
& DRIF_DIRECTCOLOR
);
89 msg
.wdp_RenderRect
= rect
;
90 msg
.wdp_PropRect
= proprect
;
91 msg
.wdp_KnobRect
= knobrect
;
95 CallHookPkt(dhook
, (Object
*) gad
, (Msg
)&msg
);
101 if (pi
->Flags
& PROPNEWLOOK
)
103 SetAfPt(rp
, pattern
, 1);
104 SetAPen(rp
, dri
->dri_Pens
[SHADOWPEN
]);
105 SetBPen(rp
, dri
->dri_Pens
[BACKGROUNDPEN
]);
107 RectFill(rp
, rect
->MinX
, rect
->MinY
, rect
->MaxX
, rect
->MaxY
);
108 SetAfPt(rp
, NULL
, 0);
112 SetAPen(rp
, dri
->dri_Pens
[BACKGROUNDPEN
]);
113 RectFill(rp
, rect
->MinX
, rect
->MinY
, rect
->MaxX
, rect
->MaxY
);
120 VOID
HandlePropSelectDown(struct Gadget
*gadget
, struct Window
*w
, struct Requester
*req
,
121 UWORD mouse_x
, UWORD mouse_y
, struct IntuitionBase
*IntuitionBase
)
127 pi
= (struct PropInfo
*)gadget
->SpecialInfo
;
132 CalcBBox (w
, req
, gadget
, &knob
);
134 /* This func gets mouse coords relative to gadget box */
136 mouse_x
+= knob
.Left
;
139 if (!CalcKnobSize (gadget
, &knob
))
142 clickoffset_x
= mouse_x
- knob
.Left
;
143 clickoffset_y
= mouse_y
- knob
.Top
;
148 if (pi
->Flags
& FREEHORIZ
)
150 if (mouse_x
< knob
.Left
)
152 if (dx
> pi
->HPotRes
)
157 else if (mouse_x
>= knob
.Left
+ knob
.Width
)
159 if (dx
< MAXPOT
- pi
->HPotRes
)
166 if (pi
->Flags
& FREEVERT
)
168 if (mouse_y
< knob
.Top
)
170 if (dy
> pi
->VPotRes
)
175 else if (mouse_y
>= knob
.Top
+ knob
.Height
)
177 if (dy
< MAXPOT
- pi
->VPotRes
)
186 /* jDc: when clicked on frame, prop gadget also gets activated! */
187 if (!(flags
& PROPBORDERLESS
))
189 if (pi
->Flags
& FREEVERT
)
199 if (mouse_x
>= knob
.Left
&&
200 mouse_y
>= knob
.Top
&&
201 mouse_x
< knob
.Left
+ knob
.Width
&&
202 mouse_y
< knob
.Top
+ knob
.Height
)
211 gadget
->Flags
|= GFLG_SELECTED
;
213 D(bug("New HPot: %d, new VPot: %d\n", dx
, dy
));
215 NewModifyProp(gadget
, w
, req
, flags
, dx
, dy
, pi
->HorizBody
, pi
->VertBody
, 1);
220 VOID
HandlePropSelectUp(struct Gadget
*gadget
, struct Window
*w
,
221 struct Requester
*req
, struct IntuitionBase
*IntuitionBase
)
223 struct PropInfo
* pi
;
225 pi
= (struct PropInfo
*)gadget
->SpecialInfo
;
227 gadget
->Flags
&= ~GFLG_SELECTED
;
228 if (pi
) pi
->Flags
&= ~KNOBHIT
;
230 if (pi
) RefreshPropGadget (gadget
, w
, req
, IntuitionBase
);
233 NewModifyProp (gadget
236 , pi->Flags &= ~KNOBHIT
247 VOID
HandlePropMouseMove(struct Gadget
*gadget
, struct Window
*w
,struct Requester
*req
,
248 LONG dx
, LONG dy
, struct IntuitionBase
*IntuitionBase
)
253 pi
= (struct PropInfo
*)gadget
->SpecialInfo
;
255 /* Has propinfo and the mouse was over the knob */
256 if (pi
&& (pi
->Flags
& KNOBHIT
))
258 CalcBBox (w
, req
, gadget
, &knob
);
260 if (!CalcKnobSize (gadget
, &knob
))
263 /* Move the knob the same amount, ie.
264 knob.Left += dx; knob.Top += dy;
266 knob.Left = knob.Left
267 + (pi->CWidth - knob.Width)
268 * pi->HorizPot / MAXPOT;
270 ie. dx = (pi->CWidth - knob.Width)
271 * pi->HorizPot / MAXPOT;
275 pi->HorizPot = (dx * MAXPOT) /
276 (pi->CWidth - knob.Width);
279 /* stegerg: dx and dy are not delta values
280 anymore but relative to gadget
283 dx
= dx
- clickoffset_x
;
284 dy
= dy
- clickoffset_y
;
286 if (pi
->Flags
& FREEHORIZ
287 && pi
->CWidth
!= knob
.Width
)
290 dx
= (dx
* MAXPOT
) / (pi
->CWidth
- knob
.Width
);
295 else if (dx
> MAXPOT
)
302 if (pi
->Flags
& FREEVERT
303 && pi
->CHeight
!= knob
.Height
)
305 dy
= (dy
* MAXPOT
) / (pi
->CHeight
- knob
.Height
);
311 else if (dy
> MAXPOT
)
318 if ( ((pi
->Flags
& FREEHORIZ
) && (dx
!= pi
->HorizPot
)) ||
319 ((pi
->Flags
& FREEVERT
) && (dy
!= pi
->VertPot
)) )
322 NewModifyProp (gadget
, w
, req
, pi
->Flags
, dx
, dy
, pi
->HorizBody
, pi
->VertBody
, 1);
325 } /* Has PropInfo and Mouse is over knob */
330 int CalcKnobSize (struct Gadget
* propGadget
, struct BBox
* knobbox
)
335 pi
= (struct PropInfo
*)propGadget
->SpecialInfo
;
337 //dprintf("CalcKnobSize(%lx,%d,%d,%d,%d)\n", propGadget,
338 // propGadget->LeftEdge, propGadget->TopEdge, propGadget->Width, propGadget->Height);
339 //dprintf("knob(%d,%d,%d,%d)\n", knobbox->Left, knobbox->Top, knobbox->Width, knobbox->Height);
341 if (pi
->Flags
& PROPBORDERLESS
)
352 knobbox
->Width
-= x
* 2;
353 knobbox
->Height
-= y
* 2;
357 //dprintf("knob(%d,%d,%d,%d)\n", knobbox->Left, knobbox->Top, knobbox->Width, knobbox->Height);
359 pi
->CWidth
= knobbox
->Width
;
360 pi
->CHeight
= knobbox
->Height
;
362 if ((!(pi
->Flags
& AUTOKNOB
)) && propGadget
->GadgetRender
)
364 struct Image
*im
= propGadget
->GadgetRender
;
366 knobbox
->Width
= im
->Width
;
367 knobbox
->Height
= im
->Height
;
370 if (pi
->Flags
& FREEHORIZ
)
372 if (pi
->Flags
& AUTOKNOB
)
374 knobbox
->Width
= pi
->CWidth
* pi
->HorizBody
/ MAXBODY
;
375 if (knobbox
->Width
< KNOBHMIN
) knobbox
->Width
= KNOBHMIN
;
378 knobbox
->Left
= knobbox
->Left
+ (pi
->CWidth
- knobbox
->Width
)
379 * pi
->HorizPot
/ MAXPOT
;
383 if (pi
->HorizBody
< MAXBODY
/2)
384 pi
->HPotRes
= MAXPOT
* 32768 / ((MAXBODY
* 32768 / pi
->HorizBody
) - 32768);
386 pi
->HPotRes
= MAXPOT
;
392 if (pi
->Flags
& FREEVERT
)
394 if (pi
->Flags
& AUTOKNOB
)
396 knobbox
->Height
= pi
->CHeight
* pi
->VertBody
/ MAXBODY
;
397 if (knobbox
->Height
< KNOBVMIN
) knobbox
->Height
= KNOBVMIN
;
400 knobbox
->Top
= knobbox
->Top
+ (pi
->CHeight
- knobbox
->Height
)
401 * pi
->VertPot
/ MAXPOT
;
405 if (pi
->VertBody
< MAXBODY
/2)
406 pi
->VPotRes
= MAXPOT
* 32768 / ((MAXBODY
* 32768 / pi
->VertBody
) - 32768);
408 pi
->VPotRes
= MAXPOT
;
413 //dprintf("knob(%d,%d,%d,%d)\n", knobbox->Left, knobbox->Top, knobbox->Width, knobbox->Height);
419 void RefreshPropGadget (struct Gadget
* gadget
, struct Window
* window
,
420 struct Requester
* req
, struct IntuitionBase
* IntuitionBase
)
423 struct DrawInfo
*dri
;
424 struct GadgetInfo gi
;
425 struct RastPort
*rp
= 0;
426 struct BBox bbox
, kbox
;
429 D(bug("RefreshPropGadget(gad=%p, win=%s, req=%p)\n", gadget
, window
->Title
, req
));
431 onborder
= (IS_BORDER_GADGET(gadget
) || isonborder(gadget
,window
));
433 if ((dri
= GetScreenDrawInfo(window
->WScreen
)))
436 SetupGInfo(&gi
, window
, req
, gadget
, IntuitionBase
);
438 if ((rp
= ObtainGIRPort(&gi
)))
442 CalcBBox (window
, req
, gadget
, &bbox
);
445 if (bbox
.Width
<= 0 || bbox
.Height
<= 0)
448 if (CalcKnobSize (gadget
, &kbox
))
450 pi
= (struct PropInfo
*)gadget
->SpecialInfo
;
457 if (!(pi
->Flags
& PROPBORDERLESS
))
459 SetAPen(rp
,dri
->dri_Pens
[SHADOWPEN
]);
460 drawrect(rp
,bbox
.Left
,
462 bbox
.Left
+ bbox
.Width
- 1,
463 bbox
.Top
+ bbox
.Height
- 1,
466 bbox
.Left
++; bbox
.Top
++;
467 bbox
.Width
-= 2; bbox
.Height
-= 2;
470 RefreshPropGadgetKnob (gadget
, &bbox
, &kbox
, window
, req
, IntuitionBase
);
475 pi
= (struct PropInfo
*)gadget
->SpecialInfo
;
482 if (!(pi
->Flags
& PROPBORDERLESS
))
484 SetAPen(rp
,dri
->dri_Pens
[SHADOWPEN
]);
485 drawrect(rp
,bbox
.Left
,
487 bbox
.Left
+ bbox
.Width
- 1,
488 bbox
.Top
+ bbox
.Height
- 1,
491 bbox
.Left
++; bbox
.Top
++;
492 bbox
.Width
-= 2; bbox
.Height
-= 2;
497 struct Rectangle tmprect
;
499 tmprect
.MinX
= bbox
.Left
;
500 tmprect
.MaxX
= bbox
.Left
+ bbox
.Width
- 1;
501 tmprect
.MinY
= bbox
.Top
;
502 tmprect
.MaxY
= bbox
.Top
+ bbox
.Height
- 1;
504 RenderPropBackground(gadget
, window
, dri
, &tmprect
, &tmprect
, NULL
,
505 pi
, rp
, onborder
, IntuitionBase
);
511 } /* if ((rp = ObtainGIRPort(&gi))) */
513 if (rp
&& gadget
->Flags
& GFLG_DISABLED
)
515 CalcBBox (window
, req
, gadget
, &bbox
);
517 RenderDisabledPattern(rp
, (struct DrawInfo
*)dri
, bbox
.Left
,
519 bbox
.Left
+ bbox
.Width
- 1,
520 bbox
.Top
+ bbox
.Height
- 1,
524 if (rp
) ReleaseGIRPort(rp
);
526 FreeScreenDrawInfo(window
->WScreen
, (struct DrawInfo
*)dri
);
528 } /* if ((dri = GetScreenDrawInfo(window->WScreen))) */
530 ReturnVoid("RefreshPropGadget");
531 } /* RefreshPropGadget */
534 void RefreshPropGadgetKnob (struct Gadget
* gadget
, struct BBox
* clear
,
535 struct BBox
* knob
, struct Window
* window
, struct Requester
* req
,
536 struct IntuitionBase
* IntuitionBase
)
538 struct DrawInfo
*dri
;
541 struct GadgetInfo gi
;
545 D(bug("RefresPropGadgetKnob(flags=%d, clear=%p, knob = %p, win=%s)\n",
546 flags
, clear
, knob
, window
->Title
));
548 onborder
= (IS_BORDER_GADGET(gadget
) || isonborder(gadget
,window
));
550 pi
= (struct PropInfo
*)gadget
->SpecialInfo
;
553 if ((dri
= GetScreenDrawInfo(window
->WScreen
)))
555 SetupGInfo(&gi
, window
, req
, gadget
, IntuitionBase
);
557 if ((rp
= ObtainGIRPort(&gi
)))
560 struct Rectangle brect
;
561 struct Rectangle krect
;
563 CalcBBox (window
, req
, gadget
, &bbox
);
564 brect
.MinX
= bbox
.Left
;
565 brect
.MinY
= bbox
.Top
;
566 brect
.MaxX
= bbox
.Left
+ bbox
.Width
- 1;
567 brect
.MaxY
= bbox
.Top
+ bbox
.Height
- 1;
569 krect
.MinX
= knob
->Left
;
570 krect
.MinY
= knob
->Top
;
571 krect
.MaxX
= knob
->Left
+ knob
->Width
- 1;
572 krect
.MaxY
= knob
->Top
+ knob
->Height
- 1;
578 struct Rectangle a
, b
, clearrects
[4];
581 #if (!(PROP_RENDER_OPTIMIZATION))
582 if (!(flags
& PROPBORDERLESS
))
584 clear
->Left
++; clear
->Top
++;
585 clear
->Width
-= 2; clear
->Height
-= 2;
590 D(bug("RefresPropGadgetKnob: clear Left %d Top %d Width %d Height %d\n",
596 D(bug("RefresPropGadgetKnob: knob Left %d Top %d Width %d Height %d\n",
603 a
.MinX
= clear
->Left
;
605 a
.MaxX
= clear
->Left
+ clear
->Width
- 1;
606 a
.MaxY
= clear
->Top
+ clear
->Height
- 1;
610 b
.MaxX
= knob
->Left
+ knob
->Width
- 1;
611 b
.MaxY
= knob
->Top
+ knob
->Height
- 1;
614 D(bug("RefresPropGadgetKnob: a MinX %d MinY %d MaxX %d MaxY %d\n",
620 D(bug("RefresPropGadgetKnob: a MinX %d MinY %d MaxX %d MaxY %d\n",
627 nrects
= SubtractRectFromRect(&a
, &b
, clearrects
);
629 D(bug("RefresPropGadgetKnob: nrects %d\n",
632 D(bug("RefresPropGadgetKnob: clearrects[0] MinX %d MinY %d MaxX %d MaxY %d\n",
636 clearrects
[0].MaxY
));
638 D(bug("RefresPropGadgetKnob: clearrects[1] MinX %d MinY %d MaxX %d MaxY %d\n",
642 clearrects
[1].MaxY
));
644 D(bug("RefresPropGadgetKnob: clearrects[2] MinX %d MinY %d MaxX %d MaxY %d\n",
648 clearrects
[2].MaxY
));
650 D(bug("RefresPropGadgetKnob: clearrects[3] MinX %d MinY %d MaxX %d MaxY %d\n",
654 clearrects
[3].MaxY
));
657 /*kprintf("\n=== oldknob = %d,%d-%d,%d newknob = %d,%d-%d,%d\n",
667 for(i
= 0; i
< nrects
; i
++)
669 RenderPropBackground(gadget
, window
, dri
, &clearrects
[i
], &brect
, &krect
,
670 pi
, rp
, onborder
, IntuitionBase
);
675 if (flags
& AUTOKNOB
)
677 int hit
= ((flags
& KNOBHIT
) != 0);
679 D(bug("RefresPropGadgetKnob: draw knob Left %d Top %d Width %d Height %d\n",
687 struct wdpDrawBorderPropKnob msg
;
688 struct Rectangle knobrect
;
689 knobrect
.MinX
= knob
->Left
;
690 knobrect
.MinY
= knob
->Top
;
691 knobrect
.MaxX
= knob
->Left
+ knob
->Width
- 1;
692 knobrect
.MaxY
= knob
->Top
+ knob
->Height
- 1;
694 msg
.MethodID
= WDM_DRAW_BORDERPROPKNOB
;
695 msg
.wdp_TrueColor
= (((struct IntScreen
*)window
->WScreen
)->DInfo
.dri
.dri_Flags
& DRIF_DIRECTCOLOR
);
696 msg
.wdp_UserBuffer
= ((struct IntWindow
*)window
)->DecorUserBuffer
;
697 msg
.wdp_Window
= window
;
699 msg
.wdp_Gadget
= gadget
;
700 msg
.wdp_RenderRect
= &knobrect
;
701 msg
.wdp_PropRect
= &brect
;
702 msg
.wdp_Flags
= hit
? WDF_DBPK_HIT
: 0;
705 DoMethodA(((struct IntScreen
*)(window
->WScreen
))->WinDecorObj
, (Msg
)&msg
);
707 } /* gadget inside window border */
710 struct Hook
*dhook
= NULL
;
712 if ((gadget
->Flags
& GFLG_EXTENDED
) != 0)
714 if ((((struct ExtGadget
*) gadget
)->MoreFlags
& GMORE_BOOPSIGADGET
) != 0)
716 GetAttr(PGA_DisplayHook
, (Object
*) gadget
, &dhook
);
720 struct wdpDrawBorderPropKnob msg
;
721 struct Rectangle knobrect
;
722 knobrect
.MinX
= knob
->Left
;
723 knobrect
.MinY
= knob
->Top
;
724 knobrect
.MaxX
= knob
->Left
+ knob
->Width
- 1;
725 knobrect
.MaxY
= knob
->Top
+ knob
->Height
- 1;
726 msg
.MethodID
= WDM_DRAW_BORDERPROPKNOB
;
727 msg
.wdp_TrueColor
= (((struct IntScreen
*)window
->WScreen
)->DInfo
.dri
.dri_Flags
& DRIF_DIRECTCOLOR
);
728 msg
.wdp_Window
= window
;
730 msg
.wdp_Gadget
= gadget
;
731 msg
.wdp_RenderRect
= &knobrect
;
732 msg
.wdp_PropRect
= &brect
;
733 msg
.wdp_Flags
= hit
? WDF_DBPK_HIT
: 0;
736 CallHookPkt(dhook
, (Object
*) gadget
, (Msg
)&msg
);
744 stdlook
= RenderPropKnob(window
,dri
,rp
,pi
,knob
,hit
,IntuitionBase
);
749 if (flags
& PROPBORDERLESS
)
751 SetAPen(rp
,dri
->dri_Pens
[SHADOWPEN
]);
753 /* paint black right and bottom edges */
755 RectFill(rp
,knob
->Left
+ knob
->Width
- 1,
757 knob
->Left
+ knob
->Width
- 1,
758 knob
->Top
+ knob
->Height
- 1);
760 RectFill(rp
,knob
->Left
,
761 knob
->Top
+ knob
->Height
- 1,
762 knob
->Left
+ knob
->Width
- 2,
763 knob
->Top
+ knob
->Height
- 1);
768 } /* propborderless */
771 SetAPen(rp
,dri
->dri_Pens
[SHADOWPEN
]);
773 if (flags
& FREEHORIZ
)
775 /* black line at the left and at the right */
777 RectFill(rp
,knob
->Left
,
780 knob
->Top
+ knob
->Height
- 1);
782 RectFill(rp
,knob
->Left
+ knob
->Width
- 1,
784 knob
->Left
+ knob
->Width
- 1,
785 knob
->Top
+ knob
->Height
- 1);
790 if (flags
& FREEVERT
)
792 /* black line at the top and at the bottom */
794 RectFill(rp
,knob
->Left
,
796 knob
->Left
+ knob
->Width
- 1,
799 RectFill(rp
,knob
->Left
,
800 knob
->Top
+ knob
->Height
- 1,
801 knob
->Left
+ knob
->Width
- 1,
802 knob
->Top
+ knob
->Height
- 1);
808 } /* not propborderless */
811 SetAPen(rp
, dri
->dri_Pens
[SHINEPEN
]);
814 RectFill(rp
,knob
->Left
,
816 knob
->Left
+ knob
->Width
- 1,
817 knob
->Top
+ knob
->Height
- 1);
819 } /* gadget has no display (render) hook */
820 } /* gadget not inside window border */
822 } /* if (flags & AUTOKNOB) */
825 struct Image
*image
= (struct Image
*)gadget
->GadgetRender
;
828 if (knob
->Top
+ image
->Height
<= bbox
.Top
+ bbox
.Height
&&
829 knob
->Left
+ image
->Width
<= bbox
.Left
+ bbox
.Width
)
833 image
->LeftEdge
= knob
->Left
- bbox
.Left
;
834 image
->TopEdge
= knob
->Top
- bbox
.Top
;
835 // image->Width = knob->Width;
836 // image->Height = knob->Height;
843 (struct DrawInfo
*)dri
);
853 (struct DrawInfo
*)dri
);
858 if (gadget
->Flags
& GFLG_DISABLED
)
860 RenderDisabledPattern(rp
, (struct DrawInfo
*)dri
,
861 brect
.MinX
, brect
.MinY
,
862 brect
.MaxX
, brect
.MaxY
, IntuitionBase
);
867 } /* if ((rp = ObtainGIRPort(&gi))) */
869 FreeScreenDrawInfo(window
->WScreen
, (struct DrawInfo
*)dri
);
871 } /* if ((dri = GetScreenDrawInfo(window->WScreen))) */
873 ReturnVoid("RefreshPropGadgetKnob");
875 } /* RefreshPropGadgetKnob */
877 BOOL
isonborder(struct Gadget
*gadget
, struct Window
*window
)
879 if ((window
->BorderBottom
> 2) && (gadget
->Flags
& GFLG_RELBOTTOM
))
880 if (window
->Height
+ gadget
->TopEdge
>= window
->Height
- window
->BorderBottom
) return TRUE
;
882 if ((window
->BorderRight
> 2) && (gadget
->Flags
& GFLG_RELRIGHT
))
883 if (window
->Width
+ gadget
->LeftEdge
>= window
->Width
- window
->BorderRight
) return TRUE
;