Un-kludged Decorator::GetFootprint

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4731 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2003-09-17 17:13:52 +00:00
parent ec50f74f8d
commit 4ff18eccb5
6 changed files with 27 additions and 14 deletions
@@ -271,7 +271,7 @@ printf("BeDecorator: Move By (%.1f, %.1f)\n",pt.x,pt.y);
_zoomrect.OffsetBy(pt); _zoomrect.OffsetBy(pt);
} }
BRegion * BeDecorator::GetFootprint(void) void BeDecorator::GetFootprint(BRegion *region)
{ {
#ifdef DEBUG_DECORATOR #ifdef DEBUG_DECORATOR
printf("BeDecorator: Get Footprint\n"); printf("BeDecorator: Get Footprint\n");
@@ -279,10 +279,11 @@ printf("BeDecorator: Get Footprint\n");
// This function calculates the decorator's footprint in coordinates // This function calculates the decorator's footprint in coordinates
// relative to the layer. This is most often used to set a WinBorder // relative to the layer. This is most often used to set a WinBorder
// object's visible region. // object's visible region.
if(!region)
return;
BRegion *reg=new BRegion(_borderrect); region->Set(_borderrect);
reg->Include(_tabrect); region->Include(_tabrect);
return reg;
} }
void BeDecorator::_DrawTitle(BRect r) void BeDecorator::_DrawTitle(BRect r)
@@ -40,7 +40,7 @@ public:
void MoveBy(BPoint pt); void MoveBy(BPoint pt);
void Draw(BRect r); void Draw(BRect r);
void Draw(void); void Draw(void);
BRegion *GetFootprint(void); void GetFootprint(BRegion *region);
click_type Clicked(BPoint pt, int32 buttons, int32 modifiers); click_type Clicked(BPoint pt, int32 buttons, int32 modifiers);
protected: protected:
void _DrawClose(BRect r); void _DrawClose(BRect r);
@@ -175,6 +175,18 @@ void MacDecorator::_DrawTitle(BRect r)
BPoint(_tabrect.left+textoffset,_closerect.bottom-1),&_layerdata); 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) void MacDecorator::Draw(BRect update)
{ {
#ifdef DEBUG_DECOR #ifdef DEBUG_DECOR
@@ -15,7 +15,7 @@ public:
// void ResizeBy(BPoint pt); // void ResizeBy(BPoint pt);
void Draw(BRect r); void Draw(BRect r);
void Draw(void); void Draw(void);
//SRegion GetFootprint(void); void GetFootprint(BRegion *region);
click_type Clicked(BPoint pt, int32 buttons, int32 modifiers); click_type Clicked(BPoint pt, int32 buttons, int32 modifiers);
protected: protected:
@@ -126,18 +126,18 @@ void WinDecorator::MoveBy(BPoint pt)
_zoomrect.OffsetBy(pt); _zoomrect.OffsetBy(pt);
_minimizerect.OffsetBy(pt); _minimizerect.OffsetBy(pt);
} }
/*
SRegion * WinDecorator::GetFootprint(void) void WinDecorator::GetFootprint(BRegion *region)
{ {
// This function calculates the decorator's footprint in coordinates // 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. // object's visible region.
if(!region)
return;
SRegion *reg=new SRegion(_borderrect); region->Set(_borderrect);
reg->Include(_tabrect); region->Include(_tabrect);
return reg;
} }
*/
void WinDecorator::_DrawTitle(BRect r) void WinDecorator::_DrawTitle(BRect r)
{ {
@@ -15,7 +15,7 @@ public:
// void ResizeBy(BPoint pt); // void ResizeBy(BPoint pt);
void Draw(BRect r); void Draw(BRect r);
void Draw(void); void Draw(void);
//SRegion GetFootprint(void); void GetFootprint(BRegion *region);
click_type Clicked(BPoint pt, int32 buttons, int32 modifiers); click_type Clicked(BPoint pt, int32 buttons, int32 modifiers);
protected: protected: