10 WinBorder::WinBorder(BRect frame
, const char* name
,
11 uint32 rm
, uint32 flags
, rgb_color c
)
12 : Layer(frame
, name
, rm
, flags
, c
)
18 fRebuildDecRegion
= true;
21 WinBorder::~WinBorder()
25 void WinBorder::MovedByHook(float dx
, float dy
)
27 fDecRegion
.OffsetBy(dx
, dy
);
30 void WinBorder::ResizedByHook(float dx
, float dy
, bool automatic
)
32 fRebuildDecRegion
= true;
35 void WinBorder::set_decorator_region(BRect bounds
)
37 fRebuildDecRegion
= false;
39 fDecRegion
.MakeEmpty();
40 // NOTE: frame is in screen coords
41 fDecRegion
.Include(BRect(bounds
.left
-4, bounds
.top
-4, bounds
.right
+4, bounds
.top
-1));
42 fDecRegion
.Include(BRect(bounds
.left
-4, bounds
.bottom
+1, bounds
.right
+4, bounds
.bottom
+4));
43 fDecRegion
.Include(BRect(bounds
.left
-4, bounds
.top
, bounds
.left
-1, bounds
.bottom
));
44 fDecRegion
.Include(BRect(bounds
.right
+1, bounds
.top
, bounds
.right
+4, bounds
.bottom
));
47 fDecRegion
.Include(BRect(bounds
.left
-4, bounds
.top
-4-10, bounds
.left
+bounds
.Width()/2, bounds
.top
-4));
50 fDecRegion
.Include(BRect(bounds
.right
-10, bounds
.bottom
-10, bounds
.right
, bounds
.bottom
));
53 bool WinBorder::alter_visible_for_children(BRegion
®ion
)
55 region
.Exclude(&fDecRegion
);
59 void WinBorder::get_user_regions(BRegion
®
)
61 if (fRebuildDecRegion
)
63 set_decorator_region(Bounds());
64 ConvertToScreen2(&fDecRegion
);
67 BRect
screenFrame(Bounds());
68 ConvertToScreen2(&screenFrame
);
72 BRegion
screenReg(GetRootLayer()->Bounds());
74 reg
.IntersectWith(&screenReg
);
76 reg
.Include(&fDecRegion
);