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

View File

@ -85,7 +85,9 @@ Layer::Layer(BRect frame, const char* name, int32 token,
// all regions (fVisible, fFullVisible, fFull) start empty
fVisible(),
fFullVisible(),
#ifndef NEW_CLIPPING
fFull(),
#endif
fClipReg(&fVisible),
@ -103,7 +105,9 @@ Layer::Layer(BRect frame, const char* name, int32 token,
fAdFlags(0),
fClassID(AS_LAYER_CLASS),
#ifndef NEW_CLIPPING
fFrameAction(B_LAYER_ACTION_NONE),
#endif
fDriver(driver),
fLayerData(new LayerData()),
@ -290,7 +294,9 @@ Layer::RemoveChild(Layer *layer)
// 2.2) this Layer must know if it has a ServerWindow object attached.
c->fServerWin = NULL;
// 2.3) we were removed from the main tree so clear our full region.
#ifndef NEW_CLIPPING
c->fFull.MakeEmpty();
#endif
// 2.4) clear fullVisible region.
c->fFullVisible.MakeEmpty();
// 2.5) we don't have a visible region anymore.
@ -907,8 +913,10 @@ RebuildFullRegion();
#endif
SendViewCoordUpdateMsg();
#ifndef NEW_CLIPPING
if (invalidate)
GetRootLayer()->GoInvalidate(this, fFull);
#endif
}
/*!
@ -1318,8 +1326,6 @@ Layer::UpdateEnd()
void
Layer::move_layer(float x, float y)
{
fFrameAction = B_LAYER_ACTION_MOVE;
/* if (fClassID == AS_WINBORDER_CLASS) {
WinBorder *wb = (WinBorder*)this;
wb->zUpdateReg.OffsetBy(x, y);
@ -1328,13 +1334,17 @@ Layer::move_layer(float x, float y)
}*/
#ifndef NEW_CLIPPING
fFrameAction = B_LAYER_ACTION_MOVE;
BPoint pt(x, y);
BRect rect(fFull.Frame().OffsetByCopy(pt));
#endif
if (!fParent) {
printf("no parent in Layer::move_layer() (%s)\n", GetName());
#ifndef NEW_CLIPPING
fFrameAction = B_LAYER_ACTION_NONE;
#endif
return;
}
#ifndef NEW_CLIPPING
@ -1352,26 +1362,34 @@ return;
EmptyGlobals();
#ifndef NEW_CLIPPING
fFrameAction = B_LAYER_ACTION_NONE;
#endif
}
// resize_layer
void
Layer::resize_layer(float x, float y)
{
#ifndef NEW_CLIPPING
fFrameAction = B_LAYER_ACTION_RESIZE;
#ifndef NEW_CLIPPING
BPoint pt(x,y);
#endif
#ifndef NEW_CLIPPING
BRect rect(fFull.Frame());
#else
BRect rect(Frame());
#endif
rect.right += x;
rect.bottom += y;
if (!fParent) {
printf("no parent in Layer::resize_layer() (%s)\n", GetName());
#ifndef NEW_CLIPPING
fFrameAction = B_LAYER_ACTION_NONE;
#endif
return;
}
#ifndef NEW_CLIPPING
@ -1385,7 +1403,9 @@ return;
EmptyGlobals();
#ifndef NEW_CLIPPING
fFrameAction = B_LAYER_ACTION_NONE;
#endif
}
// FullInvalidate
@ -1449,7 +1469,11 @@ Layer::RequestDraw(const BRegion &reg, Layer *startFrom)
// a single message to the client.
BRegion updateReg(fFullVisible);
if (fFlags & B_FULL_UPDATE_ON_RESIZE
&& fFrameAction == B_LAYER_ACTION_RESIZE) {
#ifndef NEW_CLIPPING
&& fFrameAction == B_LAYER_ACTION_RESIZE
#endif
)
{
// do nothing
} else {
updateReg.IntersectWith(&reg);
@ -1472,7 +1496,11 @@ if (fOwner->cnt != 1)
BRegion updateReg(fVisible);
// calculate the update region
if (fFlags & B_FULL_UPDATE_ON_RESIZE
&& fFrameAction == B_LAYER_ACTION_RESIZE) {
#ifndef NEW_CLIPPING
&& fFrameAction == B_LAYER_ACTION_RESIZE
#endif
)
{
// do nothing
} else {
updateReg.IntersectWith(&reg);

View File

@ -271,8 +271,9 @@ class Layer {
BRegion fVisible;
BRegion fFullVisible;
#ifndef NEW_CLIPPING
BRegion fFull;
#endif
BRegion* fClipReg;
ServerWindow* fServerWin;
@ -286,7 +287,9 @@ class Layer {
bool fIsTopLayer;
uint16 fAdFlags;
int8 fClassID;
#ifndef NEW_CLIPPING
int8 fFrameAction;
#endif
DisplayDriver* fDriver;
LayerData* fLayerData;
@ -301,8 +304,6 @@ class Layer {
void SendUpdateMsg(BRegion& reg);
void AddToViewsWithInvalidCoords() const;
void SendViewCoordUpdateMsg() const;
// void SendViewMovedMsg();
// void SendViewResizedMsg();
RGBColor fViewColor;

View File

@ -2102,7 +2102,13 @@ RootLayer::show_final_scene(WinBorder *exFocus, WinBorder *exActive)
fHaveWinBorderList = false;
// TODO: should it be improved by calling with region of hidden 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);

View File

@ -480,7 +480,13 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
parent->AddChild(newLayer, this);
if (!newLayer->IsHidden()) {
myRootLayer->GoInvalidate(newLayer, newLayer->fFull);
myRootLayer->GoInvalidate(newLayer,
#ifndef NEW_CLIPPING
newLayer->fFull
#else
newLayer->Frame()
#endif
);
}
break;
}
@ -903,7 +909,13 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
fCurrentLayer->RebuildFullRegion();
#endif
if (!(fCurrentLayer->IsHidden()))
myRootLayer->GoInvalidate(fCurrentLayer, fCurrentLayer->fFull);
myRootLayer->GoInvalidate(fCurrentLayer,
#ifndef NEW_CLIPPING
fCurrentLayer->fFull
#else
fCurrentLayer->Frame()
#endif
);
break;
}
@ -972,7 +984,13 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
fCurrentLayer->RebuildFullRegion();
#endif
if (!(fCurrentLayer->IsHidden()))
myRootLayer->GoInvalidate(fCurrentLayer, fCurrentLayer->fFull);
myRootLayer->GoInvalidate(fCurrentLayer,
#ifndef NEW_CLIPPING
fCurrentLayer->fFull
#else
fCurrentLayer->Frame()
#endif
);
break;
}

View File

@ -218,7 +218,9 @@ fUpdateReg.OffsetBy(x, y);
// has not been added to fParent apperantly. So now
// you ask why fParent is even valid? Me too.
fFrame.OffsetBy(x, y);
#ifndef NEW_CLIPPING
fFull.OffsetBy(x, y);
#endif
fTopLayer->move_layer(x, y);
// ...and here we get really hacky...
fTopLayer->fFrame.OffsetTo(0.0, 0.0);