yes, yes... removing unneeded methods/members.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13188 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca
2005-06-16 19:44:55 +00:00
parent 8095208973
commit e0911bbb29
5 changed files with 67 additions and 12 deletions
+33 -5
View File
@@ -85,7 +85,9 @@ Layer::Layer(BRect frame, const char* name, int32 token,
// all regions (fVisible, fFullVisible, fFull) start empty // all regions (fVisible, fFullVisible, fFull) start empty
fVisible(), fVisible(),
fFullVisible(), fFullVisible(),
#ifndef NEW_CLIPPING
fFull(), fFull(),
#endif
fClipReg(&fVisible), fClipReg(&fVisible),
@@ -103,7 +105,9 @@ Layer::Layer(BRect frame, const char* name, int32 token,
fAdFlags(0), fAdFlags(0),
fClassID(AS_LAYER_CLASS), fClassID(AS_LAYER_CLASS),
#ifndef NEW_CLIPPING
fFrameAction(B_LAYER_ACTION_NONE), fFrameAction(B_LAYER_ACTION_NONE),
#endif
fDriver(driver), fDriver(driver),
fLayerData(new LayerData()), fLayerData(new LayerData()),
@@ -290,7 +294,9 @@ Layer::RemoveChild(Layer *layer)
// 2.2) this Layer must know if it has a ServerWindow object attached. // 2.2) this Layer must know if it has a ServerWindow object attached.
c->fServerWin = NULL; c->fServerWin = NULL;
// 2.3) we were removed from the main tree so clear our full region. // 2.3) we were removed from the main tree so clear our full region.
#ifndef NEW_CLIPPING
c->fFull.MakeEmpty(); c->fFull.MakeEmpty();
#endif
// 2.4) clear fullVisible region. // 2.4) clear fullVisible region.
c->fFullVisible.MakeEmpty(); c->fFullVisible.MakeEmpty();
// 2.5) we don't have a visible region anymore. // 2.5) we don't have a visible region anymore.
@@ -907,8 +913,10 @@ RebuildFullRegion();
#endif #endif
SendViewCoordUpdateMsg(); SendViewCoordUpdateMsg();
#ifndef NEW_CLIPPING
if (invalidate) if (invalidate)
GetRootLayer()->GoInvalidate(this, fFull); GetRootLayer()->GoInvalidate(this, fFull);
#endif
} }
/*! /*!
@@ -1318,8 +1326,6 @@ Layer::UpdateEnd()
void void
Layer::move_layer(float x, float y) Layer::move_layer(float x, float y)
{ {
fFrameAction = B_LAYER_ACTION_MOVE;
/* if (fClassID == AS_WINBORDER_CLASS) { /* if (fClassID == AS_WINBORDER_CLASS) {
WinBorder *wb = (WinBorder*)this; WinBorder *wb = (WinBorder*)this;
wb->zUpdateReg.OffsetBy(x, y); wb->zUpdateReg.OffsetBy(x, y);
@@ -1328,13 +1334,17 @@ Layer::move_layer(float x, float y)
}*/ }*/
#ifndef NEW_CLIPPING #ifndef NEW_CLIPPING
fFrameAction = B_LAYER_ACTION_MOVE;
BPoint pt(x, y); BPoint pt(x, y);
BRect rect(fFull.Frame().OffsetByCopy(pt)); BRect rect(fFull.Frame().OffsetByCopy(pt));
#endif #endif
if (!fParent) { if (!fParent) {
printf("no parent in Layer::move_layer() (%s)\n", GetName()); printf("no parent in Layer::move_layer() (%s)\n", GetName());
#ifndef NEW_CLIPPING
fFrameAction = B_LAYER_ACTION_NONE; fFrameAction = B_LAYER_ACTION_NONE;
#endif
return; return;
} }
#ifndef NEW_CLIPPING #ifndef NEW_CLIPPING
@@ -1352,26 +1362,34 @@ return;
EmptyGlobals(); EmptyGlobals();
#ifndef NEW_CLIPPING
fFrameAction = B_LAYER_ACTION_NONE; fFrameAction = B_LAYER_ACTION_NONE;
#endif
} }
// resize_layer // resize_layer
void void
Layer::resize_layer(float x, float y) Layer::resize_layer(float x, float y)
{ {
#ifndef NEW_CLIPPING
fFrameAction = B_LAYER_ACTION_RESIZE; fFrameAction = B_LAYER_ACTION_RESIZE;
#ifndef NEW_CLIPPING
BPoint pt(x,y); BPoint pt(x,y);
#endif #endif
#ifndef NEW_CLIPPING
BRect rect(fFull.Frame()); BRect rect(fFull.Frame());
#else
BRect rect(Frame());
#endif
rect.right += x; rect.right += x;
rect.bottom += y; rect.bottom += y;
if (!fParent) { if (!fParent) {
printf("no parent in Layer::resize_layer() (%s)\n", GetName()); printf("no parent in Layer::resize_layer() (%s)\n", GetName());
#ifndef NEW_CLIPPING
fFrameAction = B_LAYER_ACTION_NONE; fFrameAction = B_LAYER_ACTION_NONE;
#endif
return; return;
} }
#ifndef NEW_CLIPPING #ifndef NEW_CLIPPING
@@ -1385,7 +1403,9 @@ return;
EmptyGlobals(); EmptyGlobals();
#ifndef NEW_CLIPPING
fFrameAction = B_LAYER_ACTION_NONE; fFrameAction = B_LAYER_ACTION_NONE;
#endif
} }
// FullInvalidate // FullInvalidate
@@ -1449,7 +1469,11 @@ Layer::RequestDraw(const BRegion &reg, Layer *startFrom)
// a single message to the client. // a single message to the client.
BRegion updateReg(fFullVisible); BRegion updateReg(fFullVisible);
if (fFlags & B_FULL_UPDATE_ON_RESIZE if (fFlags & B_FULL_UPDATE_ON_RESIZE
&& fFrameAction == B_LAYER_ACTION_RESIZE) { #ifndef NEW_CLIPPING
&& fFrameAction == B_LAYER_ACTION_RESIZE
#endif
)
{
// do nothing // do nothing
} else { } else {
updateReg.IntersectWith(&reg); updateReg.IntersectWith(&reg);
@@ -1472,7 +1496,11 @@ if (fOwner->cnt != 1)
BRegion updateReg(fVisible); BRegion updateReg(fVisible);
// calculate the update region // calculate the update region
if (fFlags & B_FULL_UPDATE_ON_RESIZE if (fFlags & B_FULL_UPDATE_ON_RESIZE
&& fFrameAction == B_LAYER_ACTION_RESIZE) { #ifndef NEW_CLIPPING
&& fFrameAction == B_LAYER_ACTION_RESIZE
#endif
)
{
// do nothing // do nothing
} else { } else {
updateReg.IntersectWith(&reg); updateReg.IntersectWith(&reg);
+4 -3
View File
@@ -271,8 +271,9 @@ class Layer {
BRegion fVisible; BRegion fVisible;
BRegion fFullVisible; BRegion fFullVisible;
#ifndef NEW_CLIPPING
BRegion fFull; BRegion fFull;
#endif
BRegion* fClipReg; BRegion* fClipReg;
ServerWindow* fServerWin; ServerWindow* fServerWin;
@@ -286,7 +287,9 @@ class Layer {
bool fIsTopLayer; bool fIsTopLayer;
uint16 fAdFlags; uint16 fAdFlags;
int8 fClassID; int8 fClassID;
#ifndef NEW_CLIPPING
int8 fFrameAction; int8 fFrameAction;
#endif
DisplayDriver* fDriver; DisplayDriver* fDriver;
LayerData* fLayerData; LayerData* fLayerData;
@@ -301,8 +304,6 @@ class Layer {
void SendUpdateMsg(BRegion& reg); void SendUpdateMsg(BRegion& reg);
void AddToViewsWithInvalidCoords() const; void AddToViewsWithInvalidCoords() const;
void SendViewCoordUpdateMsg() const; void SendViewCoordUpdateMsg() const;
// void SendViewMovedMsg();
// void SendViewResizedMsg();
RGBColor fViewColor; RGBColor fViewColor;
+7 -1
View File
@@ -2102,7 +2102,13 @@ RootLayer::show_final_scene(WinBorder *exFocus, WinBorder *exActive)
fHaveWinBorderList = false; fHaveWinBorderList = false;
// TODO: should it be improved by calling with region of hidden windows // TODO: should it be improved by calling with region of hidden windows
// plus the full regions of new windows??? // plus the full regions of new windows???
invalidate_layer(this, fFull); invalidate_layer(this,
#ifndef NEW_CLIPPING
fFull
#else
Frame()
#endif
);
} }
draw_window_tab(exFocus); draw_window_tab(exFocus);
+21 -3
View File
@@ -480,7 +480,13 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
parent->AddChild(newLayer, this); parent->AddChild(newLayer, this);
if (!newLayer->IsHidden()) { if (!newLayer->IsHidden()) {
myRootLayer->GoInvalidate(newLayer, newLayer->fFull); myRootLayer->GoInvalidate(newLayer,
#ifndef NEW_CLIPPING
newLayer->fFull
#else
newLayer->Frame()
#endif
);
} }
break; break;
} }
@@ -903,7 +909,13 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
fCurrentLayer->RebuildFullRegion(); fCurrentLayer->RebuildFullRegion();
#endif #endif
if (!(fCurrentLayer->IsHidden())) if (!(fCurrentLayer->IsHidden()))
myRootLayer->GoInvalidate(fCurrentLayer, fCurrentLayer->fFull); myRootLayer->GoInvalidate(fCurrentLayer,
#ifndef NEW_CLIPPING
fCurrentLayer->fFull
#else
fCurrentLayer->Frame()
#endif
);
break; break;
} }
@@ -972,7 +984,13 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
fCurrentLayer->RebuildFullRegion(); fCurrentLayer->RebuildFullRegion();
#endif #endif
if (!(fCurrentLayer->IsHidden())) if (!(fCurrentLayer->IsHidden()))
myRootLayer->GoInvalidate(fCurrentLayer, fCurrentLayer->fFull); myRootLayer->GoInvalidate(fCurrentLayer,
#ifndef NEW_CLIPPING
fCurrentLayer->fFull
#else
fCurrentLayer->Frame()
#endif
);
break; break;
} }
+2
View File
@@ -218,7 +218,9 @@ fUpdateReg.OffsetBy(x, y);
// has not been added to fParent apperantly. So now // has not been added to fParent apperantly. So now
// you ask why fParent is even valid? Me too. // you ask why fParent is even valid? Me too.
fFrame.OffsetBy(x, y); fFrame.OffsetBy(x, y);
#ifndef NEW_CLIPPING
fFull.OffsetBy(x, y); fFull.OffsetBy(x, y);
#endif
fTopLayer->move_layer(x, y); fTopLayer->move_layer(x, y);
// ...and here we get really hacky... // ...and here we get really hacky...
fTopLayer->fFrame.OffsetTo(0.0, 0.0); fTopLayer->fFrame.OffsetTo(0.0, 0.0);