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
+1 -7
View File
@@ -29,7 +29,6 @@
#include "ServerApp.h" #include "ServerApp.h"
#include "ServerProtocol.h" #include "ServerProtocol.h"
#include "ServerWindow.h" #include "ServerWindow.h"
#include "WindowLayer.h"
#include "Layer.h" #include "Layer.h"
#include "ServerBitmap.h" #include "ServerBitmap.h"
@@ -1437,13 +1436,8 @@ Layer::_GetAllRebuildDirty(BRegion *totalReg)
void 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) { if (fVisible.CountRects() > 0) {
BRegion updateReg(fVisible); BRegion updateReg(fVisible);
updateReg.IntersectWith(&invalid); updateReg.IntersectWith(&invalid);
+3 -3
View File
@@ -205,8 +205,8 @@ class Layer {
void TriggerRebuild(); void TriggerRebuild();
void _GetAllRebuildDirty(BRegion *totalReg); void _GetAllRebuildDirty(BRegion *totalReg);
virtual void Draw(const BRect& r); virtual void Draw(const BRect& updateRect);
void _AllRedraw(const BRegion &invalid); virtual void _AllRedraw(const BRegion& invalid);
protected: protected:
friend class RootLayer; friend class RootLayer;
@@ -240,7 +240,7 @@ class Layer {
DrawingEngine* fDriver; DrawingEngine* fDriver;
RootLayer* fRootLayer; RootLayer* fRootLayer;
ServerWindow* fWindow; ServerWindow* fWindow;
WindowLayer* fOwner; WindowLayer* fOwner;
DrawState* fDrawState; DrawState* fDrawState;
+10
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 void
WindowLayer::SetTopLayer(Layer* layer) WindowLayer::SetTopLayer(Layer* layer)
{ {
+3 -2
View File
@@ -119,9 +119,10 @@ class WindowLayer : public Layer {
SubWindowList fSubWindowList; 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 inline Layer* TopLayer() const
{ return fTopLayer; } { return fTopLayer; }