diff --git a/src/add-ons/decorators/BeDecorator/BeDecorator.cpp b/src/add-ons/decorators/BeDecorator/BeDecorator.cpp index 405543233c..24885e570c 100644 --- a/src/add-ons/decorators/BeDecorator/BeDecorator.cpp +++ b/src/add-ons/decorators/BeDecorator/BeDecorator.cpp @@ -271,7 +271,7 @@ printf("BeDecorator: Move By (%.1f, %.1f)\n",pt.x,pt.y); _zoomrect.OffsetBy(pt); } -BRegion * BeDecorator::GetFootprint(void) +void BeDecorator::GetFootprint(BRegion *region) { #ifdef DEBUG_DECORATOR printf("BeDecorator: Get Footprint\n"); @@ -279,10 +279,11 @@ printf("BeDecorator: Get Footprint\n"); // This function calculates the decorator's footprint in coordinates // relative to the layer. This is most often used to set a WinBorder // object's visible region. + if(!region) + return; - BRegion *reg=new BRegion(_borderrect); - reg->Include(_tabrect); - return reg; + region->Set(_borderrect); + region->Include(_tabrect); } void BeDecorator::_DrawTitle(BRect r) diff --git a/src/add-ons/decorators/BeDecorator/BeDecorator.h b/src/add-ons/decorators/BeDecorator/BeDecorator.h index 44526ec09e..c683fcb35c 100644 --- a/src/add-ons/decorators/BeDecorator/BeDecorator.h +++ b/src/add-ons/decorators/BeDecorator/BeDecorator.h @@ -40,7 +40,7 @@ public: void MoveBy(BPoint pt); void Draw(BRect r); void Draw(void); - BRegion *GetFootprint(void); + void GetFootprint(BRegion *region); click_type Clicked(BPoint pt, int32 buttons, int32 modifiers); protected: void _DrawClose(BRect r); diff --git a/src/add-ons/decorators/MacDecorator/MacDecorator.cpp b/src/add-ons/decorators/MacDecorator/MacDecorator.cpp index e77ed421db..f1528cd3ff 100644 --- a/src/add-ons/decorators/MacDecorator/MacDecorator.cpp +++ b/src/add-ons/decorators/MacDecorator/MacDecorator.cpp @@ -175,6 +175,18 @@ void MacDecorator::_DrawTitle(BRect r) BPoint(_tabrect.left+textoffset,_closerect.bottom-1),&_layerdata); } +void MacDecorator::GetFootprint(BRegion *region) +{ + // This function calculates the decorator's footprint in coordinates + // relative to the layer. This is most often used to set a WinBorder + // object's visible region. + if(!region) + return; + + region->Set(_borderrect); + region->Include(_tabrect); +} + void MacDecorator::Draw(BRect update) { #ifdef DEBUG_DECOR diff --git a/src/add-ons/decorators/MacDecorator/MacDecorator.h b/src/add-ons/decorators/MacDecorator/MacDecorator.h index ffe5823a1e..9343bd41a1 100644 --- a/src/add-ons/decorators/MacDecorator/MacDecorator.h +++ b/src/add-ons/decorators/MacDecorator/MacDecorator.h @@ -15,7 +15,7 @@ public: // void ResizeBy(BPoint pt); void Draw(BRect r); void Draw(void); - //SRegion GetFootprint(void); + void GetFootprint(BRegion *region); click_type Clicked(BPoint pt, int32 buttons, int32 modifiers); protected: diff --git a/src/add-ons/decorators/WinDecorator/WinDecorator.cpp b/src/add-ons/decorators/WinDecorator/WinDecorator.cpp index 733b20b20a..1c4a830c71 100644 --- a/src/add-ons/decorators/WinDecorator/WinDecorator.cpp +++ b/src/add-ons/decorators/WinDecorator/WinDecorator.cpp @@ -126,18 +126,18 @@ void WinDecorator::MoveBy(BPoint pt) _zoomrect.OffsetBy(pt); _minimizerect.OffsetBy(pt); } -/* -SRegion * WinDecorator::GetFootprint(void) + +void WinDecorator::GetFootprint(BRegion *region) { // This function calculates the decorator's footprint in coordinates - // relative to the layer. This is most often used to set a WindowBorder + // relative to the layer. This is most often used to set a WinBorder // object's visible region. + if(!region) + return; - SRegion *reg=new SRegion(_borderrect); - reg->Include(_tabrect); - return reg; + region->Set(_borderrect); + region->Include(_tabrect); } -*/ void WinDecorator::_DrawTitle(BRect r) { diff --git a/src/add-ons/decorators/WinDecorator/WinDecorator.h b/src/add-ons/decorators/WinDecorator/WinDecorator.h index 12a1834361..844ef37cfd 100644 --- a/src/add-ons/decorators/WinDecorator/WinDecorator.h +++ b/src/add-ons/decorators/WinDecorator/WinDecorator.h @@ -15,7 +15,7 @@ public: // void ResizeBy(BPoint pt); void Draw(BRect r); void Draw(void); - //SRegion GetFootprint(void); + void GetFootprint(BRegion *region); click_type Clicked(BPoint pt, int32 buttons, int32 modifiers); protected: