2 Copyright 1995-2005, The AROS Development Team. All rights reserved.
3 Copyright 2001-2003, The MorphOS Development Team. All Rights Reserved.
9 #include <dos/dosextens.h>
11 #include <intuition/intuition.h>
12 #include <intuition/intuitionbase.h>
13 #include <intuition/classes.h>
14 #include <intuition/classusr.h>
15 #include <intuition/windecorclass.h>
16 #include <intuition/cghooks.h>
17 #include <intuition/icclass.h>
18 #include <intuition/extensions.h>
20 #include <graphics/gfxbase.h>
21 #include <graphics/gfxmacros.h>
23 #include <utility/tagitem.h>
24 #include <utility/hooks.h>
26 #include <clib/macros.h>
30 #include <proto/exec.h>
31 #include <proto/intuition.h>
32 #include <proto/graphics.h>
33 #include <proto/utility.h>
35 #include <proto/alib.h>
37 #include "intuition_intern.h"
40 /**************************************************************************************************/
43 #define USE_AROS_DEFSIZE 1
45 #define USE_AROS_DEFSIZE 0
48 #define DEFSIZE_WIDTH 14
49 #define DEFSIZE_HEIGHT 14
54 * heuristics for smaller arrows used in apps
57 #define HSPACING_MIDDLE 2
58 #define VSPACING_MIDDLE 2
59 #define HSPACING_SMALL 1
60 #define VSPACING_SMALL 1
62 #define DRI(dri) ((struct DrawInfo *)(dri))
64 /**************************************************************************************************/
66 static void renderimageframe(struct RastPort
*rp
, ULONG which
, ULONG state
, UWORD
*pens
,
67 WORD left
, WORD top
, WORD width
, WORD height
,
68 struct IntuitionBase
*IntuitionBase
)
70 WORD right
= left
+ width
- 1;
71 WORD bottom
= top
+ height
- 1;
72 BOOL leftedgegodown
= FALSE
;
73 BOOL topedgegoright
= FALSE
;
79 /* draw separator line at the right side */
80 SetAPen(rp
, pens
[SHINEPEN
]);
81 RectFill(rp
, right
, top
, right
, bottom
- 1);
82 SetAPen(rp
, pens
[SHADOWPEN
]);
83 WritePixel(rp
, right
, bottom
);
91 /* draw separator line at the left side */
92 SetAPen(rp
, pens
[SHINEPEN
]);
93 WritePixel(rp
, left
, top
);
94 SetAPen(rp
, pens
[SHADOWPEN
]);
95 RectFill(rp
, left
, top
+ 1, left
, bottom
);
103 leftedgegodown
= TRUE
;
108 topedgegoright
= TRUE
;
112 if (left
== 0) leftedgegodown
= TRUE
;
113 if (top
== 0) topedgegoright
= TRUE
;
115 SetAPen(rp
, pens
[((state
== IDS_SELECTED
) || (state
== IDS_INACTIVESELECTED
)) ? SHADOWPEN
: SHINEPEN
]);
121 bottom
- (leftedgegodown
? 0 : 1));
124 RectFill(rp
, left
+ 1,
126 right
- (topedgegoright
? 0 : 1),
129 SetAPen(rp
, pens
[((state
== IDS_SELECTED
) || (state
== IDS_INACTIVESELECTED
)) ? SHINEPEN
: SHADOWPEN
]);
133 top
+ (topedgegoright
? 1 : 0),
138 RectFill(rp
, left
+ (leftedgegodown
? 1 : 0),
144 /**************************************************************************************************/
146 static UWORD
getbgpen(ULONG state
, UWORD
*pens
)
157 bg
= pens
[BACKGROUNDPEN
];
165 /**************************************************************************************************/
168 #define IntuitionBase ((struct IntuitionBase *)(cl->cl_UserData))
170 /**************************************************************************************************/
172 IPTR
WinDecorClass__OM_NEW(Class
*cl
, Object
*obj
, struct opSet
*msg
)
174 struct windecor_data
*data
;
176 obj
= (Object
*)DoSuperMethodA(cl
, obj
, (Msg
)msg
);
179 data
= INST_DATA(cl
, obj
);
180 data
->userbuffersize
= (ULONG
) GetTagData(WDA_UserBuffer
, 0, msg
->ops_AttrList
);
186 /**************************************************************************************************/
188 IPTR
WinDecorClass__OM_GET(Class
*cl
, Object
*obj
, struct opGet
*msg
)
190 struct windecor_data
*data
= INST_DATA(cl
, obj
);
192 switch(msg
->opg_AttrID
)
195 *msg
->opg_Storage
= (IPTR
) data
->userbuffersize
;
197 case WDA_TrueColorOnly
:
198 *msg
->opg_Storage
= FALSE
;
202 return DoSuperMethodA(cl
, obj
, (Msg
)msg
);
209 /**************************************************************************************************/
211 IPTR
WinDecorClass__WDM_GETDEFSIZE_SYSIMAGE(Class
*cl
, Object
*obj
, struct wdpGetDefSizeSysImage
*msg
)
213 ULONG def_low_width
= DEFSIZE_WIDTH
, def_low_height
= DEFSIZE_HEIGHT
;
214 ULONG def_med_width
= DEFSIZE_WIDTH
, def_med_height
= DEFSIZE_HEIGHT
;
215 ULONG def_high_width
= DEFSIZE_WIDTH
, def_high_height
= DEFSIZE_HEIGHT
;
217 #define REFHEIGHT (msg->wdp_ReferenceFont->tf_YSize)
218 #define REFWIDTH REFHEIGHT
220 switch(msg
->wdp_Which
)
225 def_low_width
= def_med_width
= def_high_width
= DEFSIZE_WIDTH
;
226 def_low_height
= def_med_height
= def_high_height
= DEFSIZE_HEIGHT
;
233 def_high_height
= 22;
240 def_low_width
= def_med_width
= def_high_width
= DEFSIZE_WIDTH
;
241 def_low_height
= def_med_height
= def_high_height
= DEFSIZE_HEIGHT
;
248 def_high_height
= 22;
261 def_low_width
= def_med_width
= def_high_width
= DEFSIZE_WIDTH
;
262 def_low_height
= def_med_height
= def_high_height
= DEFSIZE_HEIGHT
;
272 def_low_width
= def_med_width
= def_high_width
= DEFSIZE_WIDTH
;
273 def_low_height
= def_med_height
= def_high_height
= DEFSIZE_HEIGHT
;
283 def_low_width
= def_med_width
= def_high_width
= DEFSIZE_WIDTH
;
284 def_low_height
= def_med_height
= def_high_height
= DEFSIZE_HEIGHT
;
294 def_low_width
= def_med_width
= def_high_width
= DEFSIZE_WIDTH
;
295 def_low_height
= def_med_height
= def_high_height
= DEFSIZE_HEIGHT
;
302 def_high_height
= 10;
309 def_high_width
= REFWIDTH
/ 2 + 4; // reffont->tf_XSize * 3 / 2;
312 def_high_height
= REFHEIGHT
;
318 def_high_width
= (REFWIDTH
+ 1) * 2; // reffont->tf_XSize * 3 - 1;
321 def_high_height
= REFHEIGHT
+ 1;
325 def_low_width
= (REFWIDTH
+ 3) * 2;//reffont->tf_XSize * 2;
326 def_low_height
= REFHEIGHT
+ 3;
333 switch(msg
->wdp_SysiSize
)
335 case SYSISIZE_LOWRES
:
336 *msg
->wdp_Width
= def_low_width
;
337 *msg
->wdp_Height
= def_low_height
;
340 case SYSISIZE_MEDRES
:
341 *msg
->wdp_Width
= def_med_width
;
342 *msg
->wdp_Height
= def_med_height
;
347 *msg
->wdp_Width
= def_high_width
;
348 *msg
->wdp_Height
= def_high_height
;
355 /**************************************************************************************************/
357 IPTR
WinDecorClass__WDM_DRAW_SYSIMAGE(Class
*cl
, Object
*obj
, struct wdpDrawSysImage
*msg
)
359 struct RastPort
*rp
= msg
->wdp_RPort
;
360 UWORD
*pens
= DRI(msg
->wdp_Dri
)->dri_Pens
;
361 LONG state
= msg
->wdp_State
;
362 LONG left
= msg
->wdp_X
;
363 LONG top
= msg
->wdp_Y
;
364 LONG width
= msg
->wdp_Width
;
365 LONG height
= msg
->wdp_Height
;
366 LONG right
= left
+ width
- 1;
367 LONG bottom
= top
+ height
- 1;
368 LONG h_spacing
, v_spacing
;
372 switch(msg
->wdp_Which
)
377 renderimageframe(rp
, CLOSEIMAGE
, state
, pens
, left
, top
, width
, height
, IntuitionBase
);
383 renderimageframe(rp
, CLOSEIMAGE
, state
, pens
, left
, top
, width
, height
, IntuitionBase
);
384 /* code should be added later */
389 renderimageframe(rp
, CLOSEIMAGE
, state
, pens
, left
, top
, width
, height
, IntuitionBase
);
395 right
= left
+ width
- 1;
396 bottom
= top
+ height
- 1;
397 h_spacing
= width
* 4 / 10;
398 v_spacing
= height
* 3 / 10;
400 SetAPen(rp
, getbgpen(state
, pens
));
401 RectFill(rp
, left
, top
, right
, bottom
);
408 SetAPen(rp
, pens
[SHADOWPEN
]);
409 RectFill(rp
, left
, top
, right
, bottom
);
416 SetAPen(rp
, pens
[(state
== IDS_NORMAL
) ? SHINEPEN
: BACKGROUNDPEN
]);
417 RectFill(rp
, left
, top
, right
, bottom
);
428 renderimageframe(rp
, ZOOMIMAGE
, state
, pens
,
429 left
, top
, width
, height
, IntuitionBase
);
435 right
= left
+ width
- 1;
436 bottom
= top
+ height
- 1 ;
437 h_spacing
= width
/ 6;
438 v_spacing
= height
/ 6;
440 bg
= getbgpen(state
, pens
);
442 /* Clear background into correct color */
444 RectFill(rp
, left
, top
, right
, bottom
);
451 SetAPen(rp
, pens
[SHADOWPEN
]);
452 RectFill(rp
, left
, top
, right
, bottom
);
454 SetAPen(rp
, pens
[(state
== IDS_SELECTED
) ? SHINEPEN
:
455 (state
== IDS_NORMAL
) ? FILLPEN
: BACKGROUNDPEN
]);
456 RectFill(rp
, left
+ 1, top
+ 1, right
- 1, bottom
- 1);
458 right
= left
+ (right
- left
+ 1) / 2;
459 bottom
= top
+ (bottom
- top
+ 1) / 2;
461 if (right
- left
< 4) right
= left
+ 4;
463 SetAPen(rp
, pens
[SHADOWPEN
]);
464 RectFill(rp
, left
, top
, right
, bottom
);
471 SetAPen(rp
, pens
[(state
== IDS_SELECTED
) ? FILLPEN
:
472 (state
== IDS_NORMAL
) ? SHINEPEN
: BACKGROUNDPEN
]);
473 RectFill(rp
,left
, top
, right
, bottom
);
483 renderimageframe(rp
, DEPTHIMAGE
, state
, pens
,
484 left
, top
, width
, height
, IntuitionBase
);
492 h_spacing
= width
/ 6;
493 v_spacing
= height
/ 6;
495 bg
= getbgpen(state
, pens
);
497 /* Clear background into correct color */
499 RectFill(rp
, left
, top
, right
, bottom
);
501 /* Draw a image of two partly overlapped tiny windows,
507 width
-= h_spacing
* 2;
508 height
-= v_spacing
* 2;
510 right
= left
+ width
- 1;
511 bottom
= top
+ height
- 1;
513 /* Render top left window */
515 SetAPen(rp
, pens
[SHADOWPEN
]);
519 , right
- (width
/ 3 )
520 , bottom
- (height
/ 3)
524 /* Fill top left window (inside of the frame above) */
526 if ((state
!= IDS_INACTIVENORMAL
))
528 SetAPen(rp
, pens
[BACKGROUNDPEN
]);
529 RectFill(rp
, left
+ 1, top
+ 1,
530 right
- (width
/ 3) - 1, bottom
- (height
/ 3) - 1);
534 /* Render bottom right window */
535 SetAPen(rp
, pens
[SHADOWPEN
]);
536 drawrect(rp
, left
+ (width
/ 3), top
+ (height
/ 3),
537 right
, bottom
, IntuitionBase
);
539 /* Fill bottom right window (inside of the frame above) */
540 SetAPen(rp
, pens
[(state
== IDS_INACTIVENORMAL
) ? BACKGROUNDPEN
: SHINEPEN
]);
541 RectFill(rp
, left
+ (width
/ 3) + 1, top
+ (height
/ 3) + 1,
542 right
- 1, bottom
- 1);
544 if (state
== IDS_SELECTED
)
546 /* Re-Render top left window */
548 SetAPen(rp
, pens
[SHADOWPEN
]);
549 drawrect(rp
, left
, top
,
550 right
- (width
/ 3 ), bottom
- (height
/ 3), IntuitionBase
);
562 renderimageframe(rp
, SIZEIMAGE
, state
, pens
,
563 left
, top
, width
, height
, IntuitionBase
);
571 h_spacing
= width
/ 5;
572 v_spacing
= height
/ 5;
574 bg
= getbgpen(state
, pens
);
576 /* Clear background into correct color */
578 RectFill(rp
, left
, top
, right
, bottom
);
580 /* A triangle image */
585 right
= left
+ width
- 1 - (h_spacing
* 2);
586 bottom
= top
+ height
- 1 - (v_spacing
* 2);
588 width
= right
- left
+ 1;
589 height
= bottom
- top
+ 1;
591 if (state
!= IDS_INACTIVENORMAL
)
593 SetAPen(rp
, pens
[SHINEPEN
]);
595 for(y
= top
; y
<= bottom
; y
++)
597 x
= left
+ (bottom
- y
) * width
/ height
;
598 RectFill(rp
, x
, y
, right
, y
);
602 SetAPen(rp
, pens
[SHADOWPEN
]);
603 /* Draw triangle border */
604 Move(rp
, left
, bottom
);
605 Draw(rp
, right
, top
);
606 Draw(rp
, right
, bottom
);
607 Draw(rp
, left
, bottom
);
614 UWORD hspacing
,vspacing
;
622 hspacing
= HSPACING_MIDDLE
;
627 hspacing
= HSPACING_SMALL
;
632 vspacing
= VSPACING_MIDDLE
;
637 vspacing
= VSPACING_SMALL
;
640 renderimageframe(rp
, LEFTIMAGE
, state
, pens
,
641 left
, top
, width
, height
, IntuitionBase
);
649 SetAPen(rp
, getbgpen(state
, pens
));
650 RectFill(rp
, left
, top
, right
, bottom
);
654 width
-= hspacing
* 2;
655 height
-= vspacing
* 2;
657 right
= left
+ width
- 1;
658 bottom
= top
+ height
- 1;
660 cy
= (height
+ 1) / 2;
662 SetAPen(rp
, pens
[SHADOWPEN
]);
664 for(i
= 0; i
< cy
; i
++)
666 RectFill(rp
, left
+ (cy
- i
- 1) * width
/ cy
,
668 right
- i
* width
/ cy
/ 2,
670 RectFill(rp
, left
+ (cy
- i
- 1) * width
/ cy
,
672 right
- i
* width
/ cy
/ 2,
680 UWORD hspacing
,vspacing
;
688 hspacing
= HSPACING_MIDDLE
;
693 hspacing
= HSPACING_SMALL
;
698 vspacing
= VSPACING_MIDDLE
;
703 vspacing
= VSPACING_SMALL
;
706 renderimageframe(rp
, UPIMAGE
, state
, pens
,
707 left
, top
, width
, height
, IntuitionBase
);
715 SetAPen(rp
, getbgpen(state
, pens
));
716 RectFill(rp
, left
, top
, right
, bottom
);
720 width
-= hspacing
* 2;
721 height
-= vspacing
* 2;
723 right
= left
+ width
- 1;
724 bottom
= top
+ height
- 1;
726 cx
= (width
+ 1) / 2;
728 SetAPen(rp
, pens
[SHADOWPEN
]);
730 for(i
= 0; i
< cx
; i
++)
732 RectFill(rp
, left
+ i
,
733 top
+ (cx
- i
- 1) * height
/ cx
,
735 bottom
- i
* height
/ cx
/ 2);
736 RectFill(rp
, right
- i
,
737 top
+ (cx
- i
- 1) * height
/ cx
,
739 bottom
- i
* height
/ cx
/ 2);
747 UWORD hspacing
,vspacing
;
755 hspacing
= HSPACING_MIDDLE
;
760 hspacing
= HSPACING_SMALL
;
765 vspacing
= VSPACING_MIDDLE
;
770 vspacing
= VSPACING_SMALL
;
773 renderimageframe(rp
, RIGHTIMAGE
, state
, pens
,
774 left
, top
, width
, height
, IntuitionBase
);
783 SetAPen(rp
, getbgpen(state
, pens
));
784 RectFill(rp
, left
, top
, right
, bottom
);
788 width
-= hspacing
* 2;
789 height
-= vspacing
* 2;
791 right
= left
+ width
- 1;
792 bottom
= top
+ height
- 1;
794 cy
= (height
+ 1) / 2;
796 SetAPen(rp
, pens
[SHADOWPEN
]);
798 for(i
= 0; i
< cy
; i
++)
800 RectFill(rp
, left
+ i
* width
/ cy
/ 2,
802 right
- (cy
- i
- 1) * width
/ cy
,
804 RectFill(rp
, left
+ i
* width
/ cy
/ 2,
806 right
- (cy
- i
- 1) * width
/ cy
,
814 UWORD hspacing
,vspacing
;
822 hspacing
= HSPACING_MIDDLE
;
827 hspacing
= HSPACING_SMALL
;
832 vspacing
= VSPACING_MIDDLE
;
837 vspacing
= VSPACING_SMALL
;
840 renderimageframe(rp
, DOWNIMAGE
, state
, pens
,
841 left
, top
, width
, height
, IntuitionBase
);
849 SetAPen(rp
, getbgpen(state
, pens
));
850 RectFill(rp
, left
, top
, right
, bottom
);
854 width
-= hspacing
* 2;
855 height
-= vspacing
* 2;
857 right
= left
+ width
- 1;
858 bottom
= top
+ height
- 1;
860 cx
= (width
+ 1) / 2;
862 SetAPen(rp
, pens
[SHADOWPEN
]);
864 for(i
= 0; i
< cx
; i
++)
866 RectFill(rp
, left
+ i
,
867 top
+ i
* height
/ cx
/ 2,
869 bottom
- (cx
- i
- 1) * height
/ cx
);
870 RectFill(rp
, right
- i
,
871 top
+ i
* height
/ cx
/ 2,
873 bottom
- (cx
- i
- 1) * height
/ cx
);
887 /**************************************************************************************************/
889 static void findtitlearea(struct Window
*win
, LONG
*left
, LONG
*right
)
894 *right
= win
->Width
- 1;
896 for (g
= win
->FirstGadget
; g
; g
= g
->NextGadget
)
898 if (g
->Activation
& GACT_TOPBORDER
&& g
!= (struct Gadget
*)IW(win
)->sysgads
[DRAGBAR
])
900 if (!(g
->Flags
& GFLG_RELRIGHT
))
902 if (g
->LeftEdge
+ g
->Width
> *left
)
903 *left
= g
->LeftEdge
+ g
->Width
;
907 if (g
->LeftEdge
+ win
->Width
- 1 - 1 < *right
)
908 *right
= g
->LeftEdge
+ win
->Width
- 1 - 1;
915 /**************************************************************************************************/
917 IPTR
INTERNAL_WDM_DRAW_WINTITLE(Class
*cl
, Object
*obj
, struct wdpDrawWinBorder
*msg
)
919 struct RastPort
*rp
= msg
->wdp_RPort
;
920 struct Window
*window
= msg
->wdp_Window
;
921 UWORD
*pens
= DRI(msg
->wdp_Dri
)->dri_Pens
;
924 findtitlearea(window
, &left
, &right
);
927 SetAPen(rp
, pens
[(window
->Flags
& WFLG_WINDOWACTIVE
) ? FILLPEN
: BACKGROUNDPEN
]);
928 CheckRectFill(rp
, left
+ 1, 1, right
- 1, window
->BorderTop
- 2, IntuitionBase
);
930 if (right
- left
> 6)
932 ULONG textlen
, titlelen
, textpixellen
;
933 struct TextExtent te
;
935 SetFont(rp
, DRI(msg
->wdp_Dri
)->dri_Font
);
937 titlelen
= strlen(window
->Title
);
945 , window
->BorderTop
- 2);
948 textpixellen
= te
.te_Extent
.MaxX
- te
.te_Extent
.MinX
+ 1;
952 SetAPen(rp
, pens
[(window
->Flags
& WFLG_WINDOWACTIVE
) ? FILLTEXTPEN
: TEXTPEN
]);
954 Move(rp
, left
, DRI(msg
->wdp_Dri
)->dri_Font
->tf_Baseline
+ 2);
955 Text(rp
, window
->Title
, textlen
);
962 /**************************************************************************************************/
964 IPTR
WinDecorClass__WDM_DRAW_WINBORDER(Class
*cl
, Object
*obj
, struct wdpDrawWinBorder
*msg
)
966 struct RastPort
*rp
= msg
->wdp_RPort
;
967 struct Window
*window
= msg
->wdp_Window
;
968 UWORD
*pens
= DRI(msg
->wdp_Dri
)->dri_Pens
;
972 SetAPen(rp
, pens
[SHINEPEN
]);
974 if (window
->BorderTop
> 0)
976 /* Outer shine edge on top side */
978 CheckRectFill(rp
, 0, 0, window
->Width
- 1, 0, IntuitionBase
);
981 if (!(msg
->wdp_Flags
& WDF_DWB_TOP_ONLY
))
983 if (window
->BorderLeft
> 0)
985 /* Outer shine edge on left side */
987 CheckRectFill(rp
, 0, 0, 0, window
->Height
- 1, IntuitionBase
);
990 if (window
->BorderRight
> 1)
992 /* Inner shine edge on right side */
995 window
->Width
- window
->BorderRight
, window
->BorderTop
,
996 window
->Width
- window
->BorderRight
, window
->Height
- window
->BorderBottom
,
1000 if (window
->BorderBottom
> 1)
1002 /* Inner shine edge on bottom side */
1005 window
->BorderLeft
, window
->Height
- window
->BorderBottom
,
1006 window
->Width
- window
->BorderRight
, window
->Height
- window
->BorderBottom
,
1011 SetAPen(rp
, pens
[SHADOWPEN
]);
1013 if (!(msg
->wdp_Flags
& WDF_DWB_TOP_ONLY
))
1015 if (window
->BorderRight
> 0)
1017 /* Outer shadow edge on right side */
1019 CheckRectFill(rp
, window
->Width
- 1, 1,
1020 window
->Width
- 1, window
->Height
- 1, IntuitionBase
);
1023 if (window
->BorderBottom
> 0)
1025 /* Outer shadow edge on bottom side */
1027 CheckRectFill(rp
, 1, window
->Height
- 1,
1028 window
->Width
- 1, window
->Height
- 1, IntuitionBase
);
1031 if (window
->BorderLeft
> 1)
1033 /* Inner shadow edge on left side */
1035 CheckRectFill(rp
, window
->BorderLeft
- 1, window
->BorderTop
- 1,
1036 window
->BorderLeft
- 1, window
->Height
- window
->BorderBottom
,
1042 if (window
->BorderTop
> 1)
1044 /* Inner shadow edge on top side */
1046 CheckRectFill(rp
, window
->BorderLeft
- 1, window
->BorderTop
- 1,
1047 window
->Width
- window
->BorderRight
, window
->BorderTop
- 1,
1051 SetAPen(rp
, pens
[(window
->Flags
& WFLG_WINDOWACTIVE
) ? FILLPEN
: BACKGROUNDPEN
]);
1053 if (window
->BorderTop
> 2)
1055 /* Fill on top side */
1057 CheckRectFill(rp
, 1, 1, window
->Width
- 2, window
->BorderTop
- 2, IntuitionBase
);
1060 if (!(msg
->wdp_Flags
& WDF_DWB_TOP_ONLY
))
1062 if (window
->BorderLeft
> 2)
1064 /* Fill on left side */
1066 CheckRectFill(rp
, 1, 1, window
->BorderLeft
- 2, window
->Height
- 2, IntuitionBase
);
1070 if (window
->BorderRight
> 2)
1072 /* Fill on right side */
1074 CheckRectFill(rp
, window
->Width
- window
->BorderRight
+ 1, 1,
1075 window
->Width
- 2, window
->Height
- 2, IntuitionBase
);
1078 if (window
->BorderBottom
> 2)
1080 /* Fill on bottom side */
1082 CheckRectFill(rp
, 1, window
->Height
- window
->BorderBottom
+ 1,
1083 window
->Width
- 2, window
->Height
- 2, IntuitionBase
);
1087 findtitlearea(window
, &left
, &right
);
1091 /* Left edge of title area */
1093 SetAPen(rp
, pens
[SHINEPEN
]);
1095 Draw(rp
, left
, window
->BorderTop
- 2);
1098 if (right
!= window
->Width
- 1)
1100 /* Right edges of title area */
1102 SetAPen(rp
, pens
[SHADOWPEN
]);
1104 Draw(rp
, right
, window
->BorderTop
- 2);
1107 if (window
->Title
) INTERNAL_WDM_DRAW_WINTITLE(cl
, obj
, msg
);
1112 /**************************************************************************************************/
1114 IPTR
WinDecorClass__WDM_LAYOUT_BORDERGADGETS(Class
*cl
, Object
*obj
, struct wdpLayoutBorderGadgets
*msg
)
1116 //struct windecor_data *data = INST_DATA(cl, obj);
1117 //struct Window *window = msg->wdp_Window;
1118 struct Gadget
*gadget
= msg
->wdp_Gadgets
;
1120 if (!(msg
->wdp_Flags
& WDF_LBG_SYSTEMGADGET
)) return TRUE
;
1124 switch(gadget
->GadgetType
& GTYP_SYSTYPEMASK
)
1127 gadget
->LeftEdge
= 0;
1128 gadget
->Width
= gadget
->Height
;
1129 gadget
->Flags
&= ~(GFLG_RELRIGHT
| GFLG_RELWIDTH
);
1133 gadget
->LeftEdge
= -gadget
->Height
+ 1;
1134 gadget
->Width
= gadget
->Height
;
1135 gadget
->Flags
&= ~GFLG_RELWIDTH
;
1136 gadget
->Flags
|= GFLG_RELRIGHT
;
1140 gadget
->LeftEdge
= -gadget
->Height
* 2 + 1;
1141 gadget
->Width
= gadget
->Height
;
1142 gadget
->Flags
&= ~GFLG_RELWIDTH
;
1143 gadget
->Flags
|= GFLG_RELRIGHT
;
1146 case GTYP_WDRAGGING
:
1147 gadget
->LeftEdge
= 0;
1149 gadget
->Flags
&= ~GFLG_RELRIGHT
;
1150 gadget
->Flags
|= GFLG_RELWIDTH
;
1154 if (msg
->wdp_Flags
& WDF_LBG_MULTIPLE
)
1156 gadget
= gadget
->NextGadget
;
1167 /**************************************************************************************************/
1169 IPTR
WinDecorClass__WDM_DRAW_BORDERPROPBACK(Class
*cl
, Object
*obj
, struct wdpDrawBorderPropBack
*msg
)
1171 struct Window
*window
= msg
->wdp_Window
;
1172 struct RastPort
*rp
= msg
->wdp_RPort
;
1173 struct Gadget
*gadget
= msg
->wdp_Gadget
;
1174 struct Rectangle
*r
= msg
->wdp_RenderRect
;
1175 struct PropInfo
*pi
= ((struct PropInfo
*)gadget
->SpecialInfo
);
1176 UWORD
*pens
= DRI(msg
->wdp_Dri
)->dri_Pens
;
1180 if (pi
->Flags
& PROPNEWLOOK
)
1182 static UWORD pattern
[] = {0x5555,0xAAAA};
1184 SetAfPt(rp
, pattern
, 1);
1185 SetAPen(rp
, pens
[SHADOWPEN
]);
1186 SetBPen(rp
, pens
[(window
->Flags
& WFLG_WINDOWACTIVE
) ? FILLPEN
: BACKGROUNDPEN
]);
1187 RectFill(rp
, r
->MinX
, r
->MinY
, r
->MaxX
, r
->MaxY
);
1188 SetAfPt(rp
, NULL
, 0);
1192 SetAPen(rp
, pens
[BACKGROUNDPEN
]);
1193 RectFill(rp
, r
->MinX
, r
->MinY
, r
->MaxX
, r
->MaxY
);
1199 /**************************************************************************************************/
1201 IPTR
WinDecorClass__WDM_DRAW_BORDERPROPKNOB(Class
*cl
, Object
*obj
, struct wdpDrawBorderPropKnob
*msg
)
1203 struct Window
*window
= msg
->wdp_Window
;
1204 struct RastPort
*rp
= msg
->wdp_RPort
;
1205 struct Gadget
*gadget
= msg
->wdp_Gadget
;
1206 struct Rectangle
*r
= msg
->wdp_RenderRect
;
1207 struct PropInfo
*pi
= ((struct PropInfo
*)gadget
->SpecialInfo
);
1208 UWORD
*pens
= DRI(msg
->wdp_Dri
)->dri_Pens
;
1212 if (pi
->Flags
& PROPBORDERLESS
)
1214 SetAPen(rp
, pens
[SHINEPEN
]);
1217 RectFill(rp
, r
->MinX
, r
->MinY
, r
->MaxX
- 1, r
->MinY
);
1220 RectFill(rp
, r
->MinX
, r
->MinY
+ 1, r
->MinX
, r
->MaxY
- 1);
1222 SetAPen(rp
, pens
[SHADOWPEN
]);
1225 RectFill(rp
, r
->MaxX
, r
->MinY
, r
->MaxX
, r
->MaxY
);
1228 RectFill(rp
, r
->MinX
, r
->MaxY
, r
->MaxX
- 1, r
->MaxY
);
1235 } /* PROPBORDERLESS */
1238 SetAPen(rp
, pens
[SHADOWPEN
]);
1240 if (pi
->Flags
& FREEHORIZ
)
1242 /* black line at the left and at the right */
1244 RectFill(rp
, r
->MinX
, r
->MinY
, r
->MinX
, r
->MaxY
);
1245 RectFill(rp
, r
->MaxX
, r
->MinY
, r
->MaxX
, r
->MaxY
);
1252 if (pi
->Flags
& FREEVERT
)
1254 /* black line at the top and at the bottom */
1256 RectFill(rp
, r
->MinX
, r
->MinY
, r
->MaxX
, r
->MinY
);
1257 RectFill(rp
, r
->MinX
, r
->MaxY
, r
->MaxX
, r
->MaxY
);
1264 } /* not PROPBORDERLESS */
1267 SetAPen(rp
, pens
[(window
->Flags
& WFLG_WINDOWACTIVE
) ? FILLPEN
: BACKGROUNDPEN
]);
1270 RectFill(rp
, r
->MinX
, r
->MinY
, r
->MaxX
, r
->MaxY
);
1276 /**************************************************************************************************/
1278 IPTR
WinDecorClass__WDM_INITWINDOW(Class
*cl
, Object
*obj
, struct wdpInitWindow
*msg
)
1283 /**************************************************************************************************/
1285 IPTR
WinDecorClass__WDM_EXITWINDOW(Class
*cl
, Object
*obj
, struct wdpExitWindow
*msg
)
1290 /**************************************************************************************************/
1292 IPTR
WinDecorClass__WDM_WINDOWSHAPE(Class
*cl
, Object
*obj
, struct wdpWindowShape
*msg
)