Made Layer::_AllRedraw() virtual so that it doesn't need this ugly hack to

send _UPDATE_ messages (WindowLayer now overrides that method).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15129 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-11-24 17:54:14 +00:00
parent 4b813bf267
commit 14e1abfe7d
4 changed files with 18 additions and 13 deletions

View File

@ -29,7 +29,6 @@
#include "ServerApp.h"
#include "ServerProtocol.h"
#include "ServerWindow.h"
#include "WindowLayer.h"
#include "Layer.h"
#include "ServerBitmap.h"
@ -1437,13 +1436,8 @@ Layer::_GetAllRebuildDirty(BRegion *totalReg)
void
Layer::_AllRedraw(const BRegion &invalid)
Layer::_AllRedraw(const BRegion& invalid)
{
// couldn't find a simpler way to send _UPDATE_ message to client.
WindowLayer *windowLayer = dynamic_cast<WindowLayer*>(this);
if (windowLayer)
windowLayer->RequestClientRedraw(invalid);
if (fVisible.CountRects() > 0) {
BRegion updateReg(fVisible);
updateReg.IntersectWith(&invalid);

View File

@ -205,8 +205,8 @@ class Layer {
void TriggerRebuild();
void _GetAllRebuildDirty(BRegion *totalReg);
virtual void Draw(const BRect& r);
void _AllRedraw(const BRegion &invalid);
virtual void Draw(const BRect& updateRect);
virtual void _AllRedraw(const BRegion& invalid);
protected:
friend class RootLayer;
@ -240,7 +240,7 @@ class Layer {
DrawingEngine* fDriver;
RootLayer* fRootLayer;
ServerWindow* fWindow;
WindowLayer* fOwner;
WindowLayer* fOwner;
DrawState* fDrawState;

View File

@ -824,6 +824,16 @@ WindowLayer::RequestClientRedraw(const BRegion &invalid)
}
void
WindowLayer::_AllRedraw(const BRegion &invalid)
{
// send _UPDATE_ message to client
RequestClientRedraw(invalid);
Layer::_AllRedraw(invalid);
}
void
WindowLayer::SetTopLayer(Layer* layer)
{

View File

@ -113,15 +113,16 @@ class WindowLayer : public Layer {
float TabLocation() const;
void HighlightDecorator(bool active);
inline void QuietlySetWorkspaces(uint32 wks) { fWorkspaces = wks; }
void QuietlySetFeel(int32 feel);
SubWindowList fSubWindowList;
void RequestClientRedraw(const BRegion &invalid);
void RequestClientRedraw(const BRegion& invalid);
virtual void _AllRedraw(const BRegion& invalid);
virtual void SetTopLayer(Layer* layer);
void SetTopLayer(Layer* layer);
inline Layer* TopLayer() const
{ return fTopLayer; }