2003-02-07 15:53:57 +03:00
|
|
|
#include <View.h>
|
2003-09-25 16:25:13 +04:00
|
|
|
#include <Message.h>
|
|
|
|
#include <AppDefs.h>
|
2004-01-13 03:56:36 +03:00
|
|
|
#include <Region.h>
|
2003-02-07 15:53:57 +03:00
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
2004-02-24 15:02:47 +03:00
|
|
|
#include <stdlib.h>
|
2003-01-24 18:19:27 +03:00
|
|
|
#include "Layer.h"
|
2003-02-07 15:53:57 +03:00
|
|
|
#include "ServerWindow.h"
|
2004-03-28 19:01:27 +04:00
|
|
|
#include "WinBorder.h"
|
2003-11-14 03:15:29 +03:00
|
|
|
#include "RGBColor.h"
|
2004-03-28 19:01:27 +04:00
|
|
|
#include "RootLayer.h"
|
2004-02-24 15:02:47 +03:00
|
|
|
#include "DisplayDriver.h"
|
|
|
|
#include "LayerData.h"
|
2004-06-03 00:44:46 +04:00
|
|
|
#include <stdio.h>
|
2003-02-07 15:53:57 +03:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
#define DEBUG_LAYER
|
2003-09-25 16:25:13 +04:00
|
|
|
#ifdef DEBUG_LAYER
|
|
|
|
# define STRACE(x) printf x
|
|
|
|
#else
|
|
|
|
# define STRACE(x) ;
|
|
|
|
#endif
|
|
|
|
|
2004-06-03 00:44:46 +04:00
|
|
|
//#define DEBUG_LAYER_REBUILD
|
|
|
|
#ifdef DEBUG_LAYER_REBUILD
|
|
|
|
# define RBTRACE(x) printf x
|
|
|
|
#else
|
|
|
|
# define RBTRACE(x) ;
|
|
|
|
#endif
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
BRegion gRedrawReg;
|
|
|
|
BList gCopyRegList;
|
|
|
|
BList gCopyList;
|
|
|
|
|
2003-09-25 21:25:14 +04:00
|
|
|
Layer::Layer(BRect frame, const char *name, int32 token, uint32 resize,
|
2004-02-24 15:02:47 +03:00
|
|
|
uint32 flags, DisplayDriver *driver)
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
// frame is in fParent coordinates
|
2003-01-24 18:19:27 +03:00
|
|
|
if(frame.IsValid())
|
2004-06-11 22:21:57 +04:00
|
|
|
fFrame = frame;
|
2003-01-24 18:19:27 +03:00
|
|
|
else
|
2003-11-14 03:15:29 +03:00
|
|
|
// TODO: Decorator class should have a method witch returns the minimum frame width.
|
2004-06-11 22:21:57 +04:00
|
|
|
fFrame.Set(0.0f, 0.0f, 5.0f, 5.0f);
|
2003-09-15 23:11:52 +04:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
fBoundsLeftTop.Set( 0.0f, 0.0f );
|
2003-01-24 18:19:27 +03:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
fName = new BString(name);
|
|
|
|
fLayerData = new LayerData();
|
2004-02-24 15:02:47 +03:00
|
|
|
|
|
|
|
// driver init
|
|
|
|
if (!driver)
|
|
|
|
debugger("You MUST have a valid driver to init a Layer object\n");
|
|
|
|
fDriver = driver;
|
2003-09-17 23:28:31 +04:00
|
|
|
|
2003-01-24 18:19:27 +03:00
|
|
|
// Layer does not start out as a part of the tree
|
2004-06-16 10:40:26 +04:00
|
|
|
fParent = NULL;
|
|
|
|
fUpperSibling = NULL;
|
|
|
|
fLowerSibling = NULL;
|
|
|
|
fTopChild = NULL;
|
|
|
|
fBottomChild = NULL;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
fCurrent = NULL;
|
|
|
|
fRootLayer = NULL;
|
2004-02-24 15:02:47 +03:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
fFlags = flags;
|
|
|
|
fAdFlags = 0;
|
|
|
|
fResizeMode = resize;
|
|
|
|
fHidden = false;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
fIsUpdating = false;
|
|
|
|
fIsTopLayer = false;
|
|
|
|
fLevel = 0;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
fViewToken = token;
|
2004-06-11 22:21:57 +04:00
|
|
|
fServerWin = NULL;
|
|
|
|
clipToPicture = NULL;
|
|
|
|
|
|
|
|
// NOW all regions (fVisible, fFullVisible, fFull) are empty
|
2004-06-03 00:44:46 +04:00
|
|
|
STRACE(("Layer(%s) successfuly created\n", GetName()));
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
2003-02-07 15:53:57 +03:00
|
|
|
//! Destructor frees all allocated heap space
|
2003-01-24 18:19:27 +03:00
|
|
|
Layer::~Layer(void)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
if(fLayerData)
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
delete fLayerData;
|
|
|
|
fLayerData = NULL;
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
if(fName)
|
2004-02-24 15:02:47 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
delete fName;
|
|
|
|
fName = NULL;
|
2004-02-24 15:02:47 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
// TODO: uncomment!
|
2004-02-24 15:02:47 +03:00
|
|
|
//PruneTree();
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
// fServerWin->RemoveChild(fDriver);
|
2004-02-24 15:02:47 +03:00
|
|
|
// delete fDriver;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2003-11-14 03:15:29 +03:00
|
|
|
if (clipToPicture)
|
|
|
|
{
|
|
|
|
delete clipToPicture;
|
|
|
|
clipToPicture = NULL;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
// TODO: allocate and release a ServerPicture Object.
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
void Layer::AddChild(Layer *layer, ServerWindow *serverWin)
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::AddChild(%s) START\n", GetName(), layer->GetName()));
|
|
|
|
|
|
|
|
if( layer->fParent != NULL )
|
|
|
|
{
|
|
|
|
printf("ERROR: AddChild(): Layer already has a parent\n");
|
2003-01-24 18:19:27 +03:00
|
|
|
return;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
// 1) attach layer to the tree structure
|
2004-06-11 22:21:57 +04:00
|
|
|
layer->fParent = this;
|
|
|
|
if( fBottomChild )
|
|
|
|
{
|
|
|
|
layer->fUpperSibling = fBottomChild;
|
|
|
|
fBottomChild->fLowerSibling = layer;
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
|
|
|
{
|
|
|
|
fTopChild = layer;
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
fBottomChild = layer;
|
2003-11-14 03:15:29 +03:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
// if no RootLayer, there is no need to set any parameters.
|
|
|
|
// they will be set when the root Layer for this tree will be added
|
|
|
|
// to the main tree structure.
|
2004-06-17 18:39:21 +04:00
|
|
|
if (fRootLayer == NULL){
|
|
|
|
STRACE(("Layer(%s)::AddChild(%s) END\n", GetName(), layer->GetName()));
|
2004-06-16 10:40:26 +04:00
|
|
|
return;
|
2004-06-17 18:39:21 +04:00
|
|
|
}
|
2003-11-14 03:15:29 +03:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
// 2) set some fields for this new layer and its children.
|
|
|
|
Layer *c = layer; //c = short for: current
|
|
|
|
Layer *stop = layer;
|
|
|
|
while( true ){
|
|
|
|
// action block
|
2004-06-11 22:21:57 +04:00
|
|
|
{
|
2004-06-16 10:40:26 +04:00
|
|
|
// 2.1) set the RootLayer for this object.
|
|
|
|
c->SetRootLayer(c->fParent->fRootLayer);
|
|
|
|
// 2.2) this Layer must know if it has a ServerWindow object attached.
|
|
|
|
c->SetServerWindow(serverWin);//c->fParent->fServerWin);
|
|
|
|
// 2.3) we are attached to the main tree so build our full region.
|
|
|
|
c->RebuildFullRegion();
|
|
|
|
}
|
|
|
|
|
|
|
|
// tree parsing algorithm
|
|
|
|
if( c->fTopChild ){ // go deep
|
|
|
|
c = c->fTopChild;
|
|
|
|
}
|
|
|
|
else{ // go right or up
|
|
|
|
if (c == stop) // out trip is over
|
|
|
|
break;
|
|
|
|
if( c->fLowerSibling ){ // go right
|
|
|
|
c = c->fLowerSibling;
|
2004-02-24 15:02:47 +03:00
|
|
|
}
|
2004-06-16 10:40:26 +04:00
|
|
|
else{ // go up
|
|
|
|
while( !c->fParent->fLowerSibling && c->fParent != stop )
|
|
|
|
c = c->fParent;
|
|
|
|
|
|
|
|
if( c->fParent == stop ) // that enough!
|
|
|
|
break;
|
|
|
|
|
|
|
|
c = c->fParent->fLowerSibling;
|
2004-06-11 22:21:57 +04:00
|
|
|
}
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
|
|
|
}
|
2004-06-16 10:40:26 +04:00
|
|
|
|
|
|
|
STRACE(("Layer(%s)::AddChild(%s) END\n", GetName(), layer->GetName()));
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
2003-11-14 03:15:29 +03:00
|
|
|
void Layer::RemoveChild(Layer *layer)
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::RemoveChild(%s) START\n", GetName(), layer->GetName()));
|
|
|
|
|
|
|
|
if( layer->fParent == NULL )
|
|
|
|
{
|
|
|
|
printf("ERROR: RemoveChild(): Layer doesn't have a fParent\n");
|
2003-01-24 18:19:27 +03:00
|
|
|
return;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
if( layer->fParent != this )
|
|
|
|
{
|
2004-01-13 03:56:36 +03:00
|
|
|
printf("ERROR: RemoveChild(): Layer is not a child of this layer\n");
|
2003-01-24 18:19:27 +03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
// 1) remove this layer the main tree.
|
2004-06-11 22:21:57 +04:00
|
|
|
// Take care of fParent
|
2004-06-16 10:40:26 +04:00
|
|
|
layer->fParent = NULL;
|
2004-06-11 22:21:57 +04:00
|
|
|
if( fTopChild == layer )
|
2004-06-16 10:40:26 +04:00
|
|
|
fTopChild = layer->fLowerSibling;
|
2004-06-11 22:21:57 +04:00
|
|
|
if( fBottomChild == layer )
|
2004-06-16 10:40:26 +04:00
|
|
|
fBottomChild = layer->fUpperSibling;
|
2003-01-24 18:19:27 +03:00
|
|
|
|
|
|
|
// Take care of siblings
|
2004-06-11 22:21:57 +04:00
|
|
|
if( layer->fUpperSibling != NULL )
|
|
|
|
layer->fUpperSibling->fLowerSibling = layer->fLowerSibling;
|
|
|
|
if( layer->fLowerSibling != NULL )
|
|
|
|
layer->fLowerSibling->fUpperSibling = layer->fUpperSibling;
|
2004-06-16 10:40:26 +04:00
|
|
|
layer->fUpperSibling = NULL;
|
|
|
|
layer->fLowerSibling = NULL;
|
|
|
|
|
|
|
|
// 2) clear some fields for this layer and its children.
|
|
|
|
Layer *c = layer; //c = short for: current
|
|
|
|
Layer *stop = layer;
|
|
|
|
while( true ){
|
|
|
|
// action block
|
2004-06-11 22:21:57 +04:00
|
|
|
{
|
2004-06-16 10:40:26 +04:00
|
|
|
// 2.1) set the RootLayer for this object.
|
|
|
|
c->SetRootLayer(NULL);
|
|
|
|
// 2.2) this Layer must know if it has a ServerWindow object attached.
|
|
|
|
c->SetServerWindow(NULL);
|
|
|
|
// 2.3) we were removed from the main tree so clear our full region.
|
|
|
|
c->fFull.MakeEmpty();
|
|
|
|
// 2.4) clear fullVisible region.
|
|
|
|
c->fFullVisible.MakeEmpty();
|
|
|
|
// 2.5) we don't have a visible region anymore.
|
|
|
|
c->fVisible.MakeEmpty();
|
|
|
|
}
|
2003-11-14 03:15:29 +03:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
// tree parsing algorithm
|
|
|
|
if( c->fTopChild ){ // go deep
|
|
|
|
c = c->fTopChild;
|
|
|
|
}
|
|
|
|
else{ // go right or up
|
|
|
|
if (c == stop) // out trip is over
|
|
|
|
break;
|
|
|
|
|
|
|
|
if( c->fLowerSibling ){ // go right
|
|
|
|
c = c->fLowerSibling;
|
2004-02-24 15:02:47 +03:00
|
|
|
}
|
2004-06-16 10:40:26 +04:00
|
|
|
else{ // go up
|
|
|
|
while( !c->fParent->fLowerSibling && c->fParent != stop )
|
|
|
|
c = c->fParent;
|
|
|
|
|
|
|
|
if( c->fParent == stop ) // that enough!
|
|
|
|
break;
|
|
|
|
|
|
|
|
c = c->fParent->fLowerSibling;
|
2004-06-11 22:21:57 +04:00
|
|
|
}
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
}
|
2004-06-16 10:40:26 +04:00
|
|
|
STRACE(("Layer(%s)::RemoveChild(%s) END\n", GetName(), layer->GetName()));
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
2003-11-14 03:15:29 +03:00
|
|
|
void Layer::RemoveSelf()
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2003-02-07 15:53:57 +03:00
|
|
|
// A Layer removes itself from the tree (duh)
|
2004-06-11 22:21:57 +04:00
|
|
|
if( fParent == NULL )
|
|
|
|
{
|
|
|
|
printf("ERROR: RemoveSelf(): Layer doesn't have a fParent\n");
|
2003-01-24 18:19:27 +03:00
|
|
|
return;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
fParent->RemoveChild(this);
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
bool Layer::HasChild(Layer* layer)
|
|
|
|
{
|
|
|
|
for(Layer *lay = VirtualTopChild(); lay; lay = VirtualLowerSibling())
|
|
|
|
{
|
2004-01-13 03:56:36 +03:00
|
|
|
if(lay == layer)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2004-01-12 01:12:55 +03:00
|
|
|
}
|
|
|
|
|
2004-01-13 03:56:36 +03:00
|
|
|
Layer* Layer::LayerAt(const BPoint &pt)
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
if (fVisible.Contains(pt))
|
2003-11-14 03:15:29 +03:00
|
|
|
return this;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
if (fFullVisible.Contains(pt))
|
|
|
|
{
|
|
|
|
Layer *lay = NULL;
|
|
|
|
for ( Layer* child = VirtualBottomChild(); child; child = VirtualUpperSibling() )
|
|
|
|
{
|
|
|
|
lay = child->LayerAt( pt );
|
|
|
|
if (lay)
|
2003-11-14 03:15:29 +03:00
|
|
|
return lay;
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2003-02-07 15:53:57 +03:00
|
|
|
return NULL;
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
2003-11-14 03:15:29 +03:00
|
|
|
BRect Layer::Bounds(void) const
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
BRect r(fFrame);
|
|
|
|
r.OffsetTo( fBoundsLeftTop );
|
2003-11-14 03:15:29 +03:00
|
|
|
return r;
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
2003-11-14 03:15:29 +03:00
|
|
|
BRect Layer::Frame(void) const
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
return fFrame;
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void Layer::PruneTree(void)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
Layer *lay;
|
|
|
|
Layer *nextlay;
|
|
|
|
|
|
|
|
lay = fTopChild;
|
|
|
|
fTopChild = NULL;
|
2003-01-24 18:19:27 +03:00
|
|
|
|
2003-11-14 03:15:29 +03:00
|
|
|
while(lay != NULL)
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
if(lay->fTopChild != NULL)
|
2003-01-24 18:19:27 +03:00
|
|
|
lay->PruneTree();
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
nextlay = lay->fLowerSibling;
|
|
|
|
lay->fLowerSibling = NULL;
|
|
|
|
|
2003-01-24 18:19:27 +03:00
|
|
|
delete lay;
|
2004-06-11 22:21:57 +04:00
|
|
|
lay = nextlay;
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
// Man, this thing is short. Elegant, ain't it? :P
|
|
|
|
}
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
Layer *Layer::FindLayer(const int32 token)
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2003-02-07 15:53:57 +03:00
|
|
|
// recursive search for a layer based on its view token
|
2004-06-11 22:21:57 +04:00
|
|
|
Layer *lay;
|
|
|
|
Layer *trylay;
|
|
|
|
|
2003-01-24 18:19:27 +03:00
|
|
|
// Search child layers first
|
2004-02-24 15:02:47 +03:00
|
|
|
for(lay = VirtualTopChild(); lay; lay = VirtualLowerSibling())
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
if(lay->fViewToken == token)
|
2003-01-24 18:19:27 +03:00
|
|
|
return lay;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hmmm... not in this layer's children. Try lower descendants
|
2004-02-24 15:02:47 +03:00
|
|
|
for(lay = VirtualTopChild(); lay != NULL; lay = VirtualLowerSibling())
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
trylay = lay->FindLayer(token);
|
2003-01-24 18:19:27 +03:00
|
|
|
if(trylay)
|
|
|
|
return trylay;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Well, we got this far in the function, so apparently there is no match to be found
|
2003-02-07 15:53:57 +03:00
|
|
|
return NULL;
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
void Layer::SetServerWindow(ServerWindow *win)
|
|
|
|
{
|
|
|
|
fServerWin = win;
|
2003-09-17 23:28:31 +04:00
|
|
|
}
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
ServerWindow* Layer::SearchForServerWindow() const
|
|
|
|
{
|
|
|
|
if (fServerWin)
|
|
|
|
return fServerWin;
|
2003-09-17 23:28:31 +04:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
if(fParent)
|
|
|
|
return fParent->SearchForServerWindow();
|
2003-09-17 23:28:31 +04:00
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
return NULL;
|
2003-09-17 23:28:31 +04:00
|
|
|
}
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
void Layer::FullInvalidate(const BRect &rect)
|
|
|
|
{
|
|
|
|
FullInvalidate( BRegion(rect) );
|
|
|
|
}
|
2003-11-14 03:15:29 +03:00
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
void Layer::FullInvalidate(const BRegion& region)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::FullInvalidate():\n", GetName()));
|
|
|
|
#ifdef DEBUG_LAYER
|
|
|
|
region.PrintToStream();
|
|
|
|
printf("\n");
|
|
|
|
#endif
|
2003-11-14 03:15:29 +03:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
BPoint pt(0,0);
|
2004-02-24 15:02:47 +03:00
|
|
|
StartRebuildRegions(region, NULL,/* B_LAYER_INVALIDATE, pt); */B_LAYER_NONE, pt);
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
Redraw(gRedrawReg);
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
EmptyGlobals();
|
|
|
|
}
|
2003-11-14 03:15:29 +03:00
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
void Layer::Invalidate(const BRegion& region)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::Invalidate():\n", GetName()));
|
|
|
|
#ifdef DEBUG_LAYER
|
|
|
|
region.PrintToStream();
|
|
|
|
printf("\n");
|
|
|
|
#endif
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
gRedrawReg = region;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
Redraw(gRedrawReg);
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
EmptyGlobals();
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
void Layer::Redraw(const BRegion& reg, Layer *startFrom)
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::Redraw();\n", GetName()));
|
2004-06-16 10:40:26 +04:00
|
|
|
if (IsHidden())
|
|
|
|
// this layer has nothing visible on screen, so bail out.
|
|
|
|
return;
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
BRegion *pReg = const_cast<BRegion*>(®);
|
2004-02-24 15:02:47 +03:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
if (pReg->CountRects() > 0)
|
|
|
|
RequestDraw(reg, startFrom);
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2004-06-17 18:39:21 +04:00
|
|
|
STRACE(("Layer(%s)::Redraw() ENDED\n", GetName()));
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
void Layer::RequestDraw(const BRegion ®, Layer *startFrom)
|
2004-06-11 22:21:57 +04:00
|
|
|
{
|
2004-06-16 10:40:26 +04:00
|
|
|
STRACE(("Layer(%s)::RequestDraw()\n", GetName()));
|
2003-11-14 03:15:29 +03:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
int redraw = false;
|
2003-01-24 18:19:27 +03:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
if (startFrom == NULL)
|
|
|
|
redraw = true;
|
|
|
|
|
|
|
|
if (fVisible.CountRects() > 0)
|
2004-06-11 22:21:57 +04:00
|
|
|
{
|
|
|
|
fUpdateReg = fVisible;
|
2004-02-24 15:02:47 +03:00
|
|
|
fUpdateReg.IntersectWith(®);
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
if (fUpdateReg.CountRects() > 0){
|
2004-06-17 18:39:21 +04:00
|
|
|
fDriver->ConstrainClippingRegion(&fUpdateReg);
|
|
|
|
Draw(fUpdateReg.Frame());
|
|
|
|
fDriver->ConstrainClippingRegion(NULL);
|
2004-06-16 10:40:26 +04:00
|
|
|
|
2004-06-17 18:39:21 +04:00
|
|
|
// TODO: (WARNING!): For the Update code is MUST not be emptied!!!
|
|
|
|
fUpdateReg.MakeEmpty();
|
2004-02-24 15:02:47 +03:00
|
|
|
}
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
for (Layer *lay = VirtualBottomChild(); lay != NULL; lay = VirtualUpperSibling())
|
2004-06-11 22:21:57 +04:00
|
|
|
{
|
2004-06-16 10:40:26 +04:00
|
|
|
if (lay == startFrom)
|
|
|
|
redraw = true;
|
|
|
|
|
|
|
|
if (redraw && !(lay->IsHidden()))
|
|
|
|
lay->RequestDraw(reg, NULL);
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
2003-03-31 01:09:39 +04:00
|
|
|
}
|
|
|
|
|
2003-11-14 03:15:29 +03:00
|
|
|
void Layer::Draw(const BRect &r)
|
2003-03-31 01:09:39 +04:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
// TODO/NOTE: this should be an empty method! the next lines are for testing only
|
|
|
|
|
|
|
|
STRACE(("Layer::Draw() Called\n"));
|
|
|
|
|
|
|
|
// RGBColor col(152,102,51);
|
|
|
|
// DRIVER->FillRect_(r, 1, col, &fUpdateReg);
|
|
|
|
//snooze(1000000);
|
|
|
|
fDriver->FillRect(r, fLayerData->viewcolor);
|
|
|
|
|
2003-11-14 03:15:29 +03:00
|
|
|
// empty HOOK function.
|
2003-03-31 01:09:39 +04:00
|
|
|
}
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
void Layer::Show(bool invalidate)
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::Show()\n", GetName()));
|
2004-02-24 15:02:47 +03:00
|
|
|
if( !IsHidden() )
|
2003-03-31 01:09:39 +04:00
|
|
|
return;
|
2003-09-09 01:18:39 +04:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
fHidden = false;
|
|
|
|
|
|
|
|
if(invalidate)
|
|
|
|
{
|
|
|
|
if(fParent)
|
2004-06-16 10:40:26 +04:00
|
|
|
fParent->FullInvalidate( BRegion(fFull) );
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
2004-06-16 10:40:26 +04:00
|
|
|
FullInvalidate( BRegion(fFull) );
|
2004-06-11 22:21:57 +04:00
|
|
|
}
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
void Layer::Hide(bool invalidate)
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::Hide()\n", GetName()));
|
2004-02-24 15:02:47 +03:00
|
|
|
if ( IsHidden() )
|
2003-09-09 01:18:39 +04:00
|
|
|
return;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
fHidden = true;
|
|
|
|
|
|
|
|
if(invalidate)
|
|
|
|
{
|
|
|
|
if(fParent)
|
2004-06-16 10:40:26 +04:00
|
|
|
fParent->FullInvalidate( BRegion(fFullVisible) );
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
2004-06-16 10:40:26 +04:00
|
|
|
FullInvalidate( BRegion(fFullVisible) );
|
2004-06-11 22:21:57 +04:00
|
|
|
}
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
2003-11-14 03:15:29 +03:00
|
|
|
bool Layer::IsHidden(void) const
|
2003-02-24 18:47:06 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
if (fHidden)
|
2004-02-24 15:02:47 +03:00
|
|
|
return true;
|
|
|
|
else
|
2004-06-11 22:21:57 +04:00
|
|
|
{
|
|
|
|
if (fParent)
|
|
|
|
return fParent->IsHidden();
|
|
|
|
}
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
return false;
|
2003-02-24 18:47:06 +03:00
|
|
|
}
|
|
|
|
|
2003-11-14 03:15:29 +03:00
|
|
|
uint32 Layer::CountChildren(void) const
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
uint32 i = 0;
|
|
|
|
Layer *lay = VirtualTopChild();
|
2004-02-24 15:02:47 +03:00
|
|
|
while(lay != NULL)
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
lay = VirtualLowerSibling();
|
2003-01-24 18:19:27 +03:00
|
|
|
i++;
|
|
|
|
}
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
void Layer::RebuildFullRegion( )
|
|
|
|
{
|
|
|
|
STRACE(("Layer(%s)::RebuildFullRegion()\n", GetName()));
|
|
|
|
|
|
|
|
if (fParent)
|
|
|
|
fFull.Set( fParent->ConvertToTop( fFrame ) );
|
2004-02-24 15:02:47 +03:00
|
|
|
else
|
2004-06-11 22:21:57 +04:00
|
|
|
fFull.Set( fFrame );
|
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
// TODO: restrict to screen coordinates!!!
|
2004-06-11 22:21:57 +04:00
|
|
|
// TODO: Convert to screen coordinates!
|
|
|
|
LayerData *ld;
|
|
|
|
ld = fLayerData;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
// clip to user region
|
2004-05-20 05:31:28 +04:00
|
|
|
if(ld->clipReg)
|
2004-06-11 22:21:57 +04:00
|
|
|
fFull.IntersectWith( ld->clipReg );
|
2004-02-24 15:02:47 +03:00
|
|
|
} while( (ld = ld->prevState) );
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
// clip to user picture region
|
2004-03-28 19:01:27 +04:00
|
|
|
if(clipToPicture)
|
2004-06-11 22:21:57 +04:00
|
|
|
{
|
|
|
|
if(clipToPictureInverse)
|
|
|
|
fFull.Exclude( clipToPicture );
|
|
|
|
else
|
|
|
|
fFull.IntersectWith( clipToPicture );
|
|
|
|
}
|
2004-02-24 15:02:47 +03:00
|
|
|
}
|
2003-09-04 01:43:09 +04:00
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOffset)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::RebuildRegions() START\n", GetName()));
|
|
|
|
|
|
|
|
//NOTE: this method must be executed as quickly as possible.
|
|
|
|
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
// Currently SendView[Moved/Resized]Msg() simply constructs a message and calls
|
2004-06-11 22:21:57 +04:00
|
|
|
// ServerWindow::SendMessageToClient(). This involves the alternative use of
|
|
|
|
// kernel and this code in the CPU, so there are a lot of context switches.
|
|
|
|
// This is NOT good at all!
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
// One alternative would be the use of a BMessageQueue per ServerWindows OR only
|
2004-06-11 22:21:57 +04:00
|
|
|
// one for app_server which will be emptied as soon as this critical operation ended.
|
2004-02-24 15:02:47 +03:00
|
|
|
// Talk to DW, Gabe.
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
BRegion oldRegion;
|
|
|
|
uint32 newAction = action;
|
|
|
|
BPoint newPt = pt;
|
|
|
|
BPoint newOffset = ptOffset; // used for resizing only
|
|
|
|
|
|
|
|
BPoint dummyNewLocation;
|
2004-02-24 15:02:47 +03:00
|
|
|
|
|
|
|
RRLabel1:
|
2004-06-11 22:21:57 +04:00
|
|
|
switch(action)
|
|
|
|
{
|
|
|
|
case B_LAYER_NONE:
|
|
|
|
{
|
|
|
|
RBTRACE(("1) Action B_LAYER_NONE\n"));
|
|
|
|
oldRegion = fVisible;
|
2004-02-24 15:02:47 +03:00
|
|
|
break;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
case B_LAYER_MOVE:
|
|
|
|
{
|
|
|
|
RBTRACE(("1) Action B_LAYER_MOVE\n"));
|
|
|
|
oldRegion = fFullVisible;
|
|
|
|
fFrame.OffsetBy(pt.x, pt.y);
|
|
|
|
fFull.OffsetBy(pt.x, pt.y);
|
|
|
|
|
|
|
|
// TODO: uncomment later when you'll implement a queue in ServerWindow::SendMessgeToClient()
|
2004-02-24 15:02:47 +03:00
|
|
|
//SendViewMovedMsg();
|
|
|
|
|
|
|
|
newAction = B_LAYER_SIMPLE_MOVE;
|
|
|
|
break;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
case B_LAYER_SIMPLE_MOVE:
|
|
|
|
{
|
|
|
|
RBTRACE(("1) Action B_LAYER_SIMPLE_MOVE\n"));
|
|
|
|
fFull.OffsetBy(pt.x, pt.y);
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
break;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
case B_LAYER_RESIZE:
|
|
|
|
{
|
|
|
|
RBTRACE(("1) Action B_LAYER_RESIZE\n"));
|
|
|
|
oldRegion = fVisible;
|
|
|
|
|
|
|
|
fFrame.right += pt.x;
|
|
|
|
fFrame.bottom += pt.y;
|
2004-02-24 15:02:47 +03:00
|
|
|
RebuildFullRegion();
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
// TODO: uncomment later when you'll implement a queue in ServerWindow::SendMessgeToClient()
|
2004-02-24 15:02:47 +03:00
|
|
|
//SendViewResizedMsg();
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
newAction = B_LAYER_MASK_RESIZE;
|
2004-02-24 15:02:47 +03:00
|
|
|
break;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
case B_LAYER_MASK_RESIZE:
|
|
|
|
{
|
|
|
|
RBTRACE(("1) Action B_LAYER_MASK_RESIZE\n"));
|
|
|
|
oldRegion = fVisible;
|
|
|
|
|
|
|
|
BPoint offset, rSize;
|
|
|
|
BPoint coords[2];
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
ResizeOthers(pt.x, pt.y, coords, NULL);
|
2004-06-11 22:21:57 +04:00
|
|
|
offset = coords[0];
|
|
|
|
rSize = coords[1];
|
|
|
|
newOffset = offset + ptOffset;
|
|
|
|
|
|
|
|
if(!(rSize.x == 0.0f && rSize.y == 0.0f))
|
|
|
|
{
|
|
|
|
fFrame.OffsetBy(offset);
|
|
|
|
fFrame.right += rSize.x;
|
|
|
|
fFrame.bottom += rSize.y;
|
2004-02-24 15:02:47 +03:00
|
|
|
RebuildFullRegion();
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
// TODO: uncomment later when you'll implement a queue in ServerWindow::SendMessgeToClient()
|
2004-02-24 15:02:47 +03:00
|
|
|
//SendViewResizedMsg();
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
newAction = B_LAYER_MASK_RESIZE;
|
|
|
|
newPt = rSize;
|
2004-02-24 15:02:47 +03:00
|
|
|
dummyNewLocation = newOffset;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!(offset.x == 0.0f && offset.y == 0.0f))
|
|
|
|
{
|
|
|
|
pt = newOffset;
|
|
|
|
action = B_LAYER_MOVE;
|
|
|
|
newPt = pt;
|
|
|
|
goto RRLabel1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pt = ptOffset;
|
|
|
|
action = B_LAYER_MOVE;
|
|
|
|
newPt = pt;
|
|
|
|
goto RRLabel1;
|
|
|
|
}
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
2004-02-24 15:02:47 +03:00
|
|
|
break;
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
|
|
|
}
|
2004-02-24 15:02:47 +03:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
if (!IsHidden())
|
|
|
|
{
|
2004-06-16 10:40:26 +04:00
|
|
|
fFullVisible.MakeEmpty();
|
2004-06-11 22:21:57 +04:00
|
|
|
fVisible = fFull;
|
2004-06-16 10:40:26 +04:00
|
|
|
if (fParent && fVisible.CountRects() >0){
|
|
|
|
// not the usual case, but support fot this is needed.
|
|
|
|
if (fParent->fAdFlags & B_LAYER_CHILDREN_DEPENDANT){
|
|
|
|
// because we're skipping one level, we need to do out
|
|
|
|
// parent business as well.
|
|
|
|
|
|
|
|
// our visible area is relative to our parent's parent.
|
|
|
|
if (fParent->fParent)
|
|
|
|
fVisible.IntersectWith(&(fParent->fParent->fVisible));
|
|
|
|
|
|
|
|
// exclude parent's visible area which could be composed by
|
|
|
|
// prior siblings' visible areas.
|
|
|
|
if (fVisible.CountRects() > 0)
|
|
|
|
fVisible.Exclude(&(fParent->fVisible));
|
|
|
|
|
|
|
|
// we have a final visible area. Include it to our parent's one,
|
|
|
|
// exclude from parent's parent.
|
|
|
|
if (fVisible.CountRects() > 0){
|
|
|
|
fParent->fFullVisible.Include(&fVisible);
|
|
|
|
if (fParent->fParent)
|
|
|
|
fParent->fParent->fVisible.Exclude(&fVisible);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// for 95+% of cases
|
|
|
|
else{
|
|
|
|
// the visible area is the one common with parent's one.
|
|
|
|
fVisible.IntersectWith(&(fParent->fVisible));
|
|
|
|
// exclude from parent's visible area. we're the owners now.
|
|
|
|
if (fVisible.CountRects() > 0)
|
|
|
|
fParent->fVisible.Exclude(&fVisible);
|
|
|
|
}
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
fFullVisible = fVisible;
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
// Rebuild regions for children...
|
2004-02-24 15:02:47 +03:00
|
|
|
for(Layer *lay = VirtualBottomChild(); lay != NULL; lay = VirtualUpperSibling())
|
2004-06-11 22:21:57 +04:00
|
|
|
lay->RebuildRegions(reg, newAction, newPt, newOffset);
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
if(!IsHidden())
|
2004-06-11 22:21:57 +04:00
|
|
|
{
|
|
|
|
switch(action)
|
|
|
|
{
|
|
|
|
case B_LAYER_NONE:
|
|
|
|
{
|
|
|
|
BRegion r(fVisible);
|
|
|
|
if (oldRegion.CountRects() > 0)
|
|
|
|
r.Exclude(&oldRegion);
|
|
|
|
|
|
|
|
if(r.CountRects() > 0)
|
|
|
|
gRedrawReg.Include(&r);
|
|
|
|
break;
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
case B_LAYER_MOVE:
|
|
|
|
{
|
|
|
|
BRegion redrawReg;
|
|
|
|
BRegion *copyReg = new BRegion();
|
|
|
|
BRegion screenReg(fRootLayer->Bounds());
|
|
|
|
|
|
|
|
oldRegion.OffsetBy(pt.x, pt.y);
|
|
|
|
oldRegion.IntersectWith(&fFullVisible);
|
|
|
|
|
|
|
|
*copyReg = oldRegion;
|
|
|
|
copyReg->IntersectWith(&screenReg);
|
|
|
|
if(copyReg->CountRects() > 0 && !(pt.x == 0.0f && pt.y == 0.0f) )
|
|
|
|
{
|
|
|
|
copyReg->OffsetBy(-pt.x, -pt.y);
|
|
|
|
BPoint *point = new BPoint(pt);
|
|
|
|
gCopyRegList.AddItem(copyReg);
|
|
|
|
gCopyList.AddItem(point);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
delete copyReg;
|
|
|
|
}
|
|
|
|
|
|
|
|
redrawReg = fFullVisible;
|
|
|
|
redrawReg.Exclude(&oldRegion);
|
|
|
|
if(redrawReg.CountRects() > 0 && !(pt.x == 0.0f && pt.y == 0.0f) )
|
|
|
|
{
|
|
|
|
gRedrawReg.Include(&redrawReg);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2003-07-05 20:03:54 +04:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
case B_LAYER_RESIZE:
|
|
|
|
{
|
|
|
|
BRegion redrawReg;
|
|
|
|
|
|
|
|
redrawReg = fVisible;
|
|
|
|
redrawReg.Exclude(&oldRegion);
|
|
|
|
if(redrawReg.CountRects() > 0)
|
|
|
|
gRedrawReg.Include(&redrawReg);
|
|
|
|
|
|
|
|
break;
|
2004-02-24 15:02:47 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
case B_LAYER_MASK_RESIZE:
|
2003-11-14 03:15:29 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
BRegion redrawReg;
|
|
|
|
BRegion *copyReg = new BRegion();
|
|
|
|
|
|
|
|
oldRegion.OffsetBy(dummyNewLocation.x, dummyNewLocation.y);
|
|
|
|
|
|
|
|
redrawReg = fVisible;
|
|
|
|
redrawReg.Exclude(&oldRegion);
|
|
|
|
if(redrawReg.CountRects() > 0)
|
|
|
|
{
|
|
|
|
gRedrawReg.Include(&redrawReg);
|
|
|
|
}
|
|
|
|
|
|
|
|
*copyReg = fVisible;
|
|
|
|
copyReg->IntersectWith(&oldRegion);
|
|
|
|
copyReg->OffsetBy(-dummyNewLocation.x, -dummyNewLocation.y);
|
|
|
|
if(copyReg->CountRects() > 0
|
|
|
|
&& !(dummyNewLocation.x == 0.0f && dummyNewLocation.y == 0.0f))
|
|
|
|
{
|
|
|
|
gCopyRegList.AddItem(copyReg);
|
|
|
|
gCopyList.AddItem(new BPoint(dummyNewLocation));
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
default:
|
2004-02-24 15:02:47 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
break;
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
2004-02-24 15:02:47 +03:00
|
|
|
}
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
/* if (IsHidden())
|
|
|
|
{
|
|
|
|
fFullVisible.MakeEmpty();
|
|
|
|
fVisible.MakeEmpty();
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef DEBUG_LAYER_REBUILD
|
|
|
|
printf("\n ======= Layer(%s)::RR finals ======\n", GetName());
|
|
|
|
oldRegion.PrintToStream();
|
|
|
|
fFull.PrintToStream();
|
|
|
|
fFullVisible.PrintToStream();
|
|
|
|
fVisible.PrintToStream();
|
|
|
|
printf("==========RedrawReg===========\n");
|
|
|
|
gRedrawReg.PrintToStream();
|
|
|
|
printf("=====================\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
STRACE(("Layer(%s)::RebuildRegions() END\n", GetName()));
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
void Layer::StartRebuildRegions( const BRegion& reg, Layer *target, uint32 action, BPoint& pt)
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::StartRebuildRegions() START\n", GetName()));
|
|
|
|
if(!fParent)
|
|
|
|
fFullVisible = fFull;
|
|
|
|
|
|
|
|
BRegion oldVisible = fVisible;
|
|
|
|
|
|
|
|
fVisible = fFullVisible;
|
|
|
|
|
|
|
|
// Rebuild regions for children...
|
2004-02-24 15:02:47 +03:00
|
|
|
for(Layer *lay = VirtualBottomChild(); lay != NULL; lay = VirtualUpperSibling())
|
2003-01-24 18:19:27 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
if (lay == target)
|
2004-02-24 15:02:47 +03:00
|
|
|
lay->RebuildRegions(reg, action, pt, BPoint(0.0f, 0.0f));
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
2004-02-24 15:02:47 +03:00
|
|
|
lay->RebuildRegions(reg, B_LAYER_NONE, pt, BPoint(0.0f, 0.0f));
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
#ifdef DEBUG_LAYER_REBUILD
|
|
|
|
printf("\n ===!=== Layer(%s)::SRR finals ===!===\n", GetName());
|
|
|
|
fFull.PrintToStream();
|
|
|
|
fFullVisible.PrintToStream();
|
|
|
|
fVisible.PrintToStream();
|
|
|
|
oldVisible.PrintToStream();
|
|
|
|
printf("=====!=====RedrawReg=====!=====\n");
|
|
|
|
gRedrawReg.PrintToStream();
|
|
|
|
printf("=====================\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
BRegion redrawReg(fVisible);
|
|
|
|
|
|
|
|
// if this is the first time
|
|
|
|
if (oldVisible.CountRects() > 0)
|
2004-02-24 15:02:47 +03:00
|
|
|
redrawReg.Exclude(&oldVisible);
|
2004-06-16 10:40:26 +04:00
|
|
|
|
|
|
|
if (redrawReg.CountRects() > 0)
|
|
|
|
gRedrawReg.Include(&redrawReg);
|
2004-06-03 00:44:46 +04:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
#ifdef DEBUG_LAYER_REBUILD
|
|
|
|
printf("Layer(%s)::StartRebuildREgions() ended! Redraw Region:\n", GetName());
|
|
|
|
gRedrawReg.PrintToStream();
|
|
|
|
printf("\n");
|
|
|
|
printf("Layer(%s)::StartRebuildREgions() ended! Copy Region:\n", GetName());
|
|
|
|
for(int32 k=0; k<gCopyRegList.CountItems(); k++)
|
|
|
|
{
|
|
|
|
((BRegion*)(gCopyRegList.ItemAt(k)))->PrintToStream();
|
|
|
|
((BPoint*)(gCopyList.ItemAt(k)))->PrintToStream();
|
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
#endif
|
2004-02-24 15:02:47 +03:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::StartRebuildRegions() END\n", GetName()));
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
void Layer::MoveBy(float x, float y)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::MoveBy() START\n", GetName()));
|
|
|
|
if(!fParent)
|
|
|
|
{
|
2004-02-24 15:02:47 +03:00
|
|
|
debugger("ERROR: in Layer::MoveBy()! - No parent!\n");
|
2003-11-14 03:15:29 +03:00
|
|
|
return;
|
|
|
|
}
|
2004-02-24 15:02:47 +03:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
BPoint pt(x,y);
|
|
|
|
BRect rect(fFull.Frame().OffsetByCopy(pt));
|
|
|
|
|
|
|
|
fParent->StartRebuildRegions(BRegion(rect), this, B_LAYER_MOVE, pt);
|
|
|
|
|
|
|
|
fDriver->CopyRegionList(&gCopyRegList, &gCopyList, gCopyRegList.CountItems(), &fFullVisible);
|
|
|
|
fParent->Redraw(gRedrawReg, this);
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
EmptyGlobals();
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
STRACE(("Layer(%s)::MoveBy() END\n", GetName()));
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
void Layer::EmptyGlobals()
|
|
|
|
{
|
|
|
|
void *item;
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
gRedrawReg.MakeEmpty();
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
while((item = gCopyRegList.RemoveItem((int32)0)))
|
2004-02-24 15:02:47 +03:00
|
|
|
delete (BRegion*)item;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
while((item = gCopyList.RemoveItem((int32)0)))
|
2004-02-24 15:02:47 +03:00
|
|
|
delete (BPoint*)item;
|
|
|
|
}
|
2003-11-14 03:15:29 +03:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
uint32 Layer::ResizeOthers(float x, float y, BPoint coords[], BPoint *ptOffset)
|
|
|
|
{
|
|
|
|
STRACE(("Layer(%s)::ResizeOthers() START\n", GetName()));
|
|
|
|
uint32 rmask = fResizeMode;
|
|
|
|
|
|
|
|
// offset
|
|
|
|
coords[0].x = 0.0f;
|
|
|
|
coords[0].y = 0.0f;
|
|
|
|
|
|
|
|
// resize by width/height
|
|
|
|
coords[1].x = 0.0f;
|
|
|
|
coords[1].y = 0.0f;
|
2004-02-24 15:02:47 +03:00
|
|
|
|
|
|
|
if ((rmask & 0x00000f00UL)>>8 == _VIEW_LEFT_
|
2004-06-11 22:21:57 +04:00
|
|
|
&& (rmask & 0x0000000fUL)>>0 == _VIEW_RIGHT_)
|
|
|
|
{
|
2004-02-24 15:02:47 +03:00
|
|
|
coords[1].x = x;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
|
|
|
if ((rmask & 0x00000f00UL)>>8 == _VIEW_LEFT_)
|
|
|
|
{
|
2004-02-24 15:02:47 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
|
|
|
if ((rmask & 0x0000000fUL)>>0 == _VIEW_RIGHT_)
|
|
|
|
{
|
2004-02-24 15:02:47 +03:00
|
|
|
coords[0].x = x;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
|
|
|
if ((rmask & 0x00000f00UL)>>8 == _VIEW_CENTER_)
|
|
|
|
{
|
2004-02-24 15:02:47 +03:00
|
|
|
coords[0].x = x/2;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// illegal flag. Do nothing.
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
|
|
|
|
if ((rmask & 0x0000f000UL)>>12 == _VIEW_TOP_
|
2004-06-11 22:21:57 +04:00
|
|
|
&& (rmask & 0x000000f0UL)>>4 == _VIEW_BOTTOM_)
|
|
|
|
{
|
2004-02-24 15:02:47 +03:00
|
|
|
coords[1].y = y;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
|
|
|
if ((rmask & 0x0000f000UL)>>12 == _VIEW_TOP_)
|
|
|
|
{
|
2004-02-24 15:02:47 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
|
|
|
if ((rmask & 0x000000f0UL)>>4 == _VIEW_BOTTOM_)
|
|
|
|
{
|
2004-02-24 15:02:47 +03:00
|
|
|
coords[0].y = y;
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
|
|
|
if ((rmask & 0x0000f000UL)>>12 == _VIEW_CENTER_)
|
|
|
|
{
|
2004-02-24 15:02:47 +03:00
|
|
|
coords[0].y = y/2;
|
|
|
|
}
|
2004-06-11 22:21:57 +04:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// illegal flag. Do nothing.
|
2004-02-24 15:02:47 +03:00
|
|
|
}
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::ResizeOthers() END\n", GetName()));
|
2004-02-24 15:02:47 +03:00
|
|
|
return 0UL;
|
2003-11-14 03:15:29 +03:00
|
|
|
}
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
void Layer::ResizeBy(float x, float y)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
STRACE(("Layer(%s)::ResizeBy() START\n", GetName()));
|
|
|
|
|
|
|
|
if(!fParent)
|
|
|
|
{
|
2004-02-24 15:02:47 +03:00
|
|
|
printf("ERROR: in Layer::MoveBy()! - No parent!\n");
|
|
|
|
return;
|
2004-01-13 03:56:36 +03:00
|
|
|
}
|
2004-02-24 15:02:47 +03:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
BPoint pt(x,y);
|
|
|
|
BRect rect(fFull.Frame());
|
|
|
|
rect.right += x;
|
|
|
|
rect.bottom += y;
|
|
|
|
|
|
|
|
fParent->StartRebuildRegions(BRegion(rect), this, B_LAYER_RESIZE, pt);
|
|
|
|
|
|
|
|
fDriver->CopyRegionList(&gCopyRegList, &gCopyList, gCopyRegList.CountItems(), &fFullVisible);
|
|
|
|
fParent->Redraw(gRedrawReg, this);
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
EmptyGlobals();
|
2004-06-11 22:21:57 +04:00
|
|
|
|
|
|
|
STRACE(("Layer(%s)::ResizeBy() END\n", GetName()));
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void Layer::PrintToStream(void)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
printf("\n----------- Layer %s -----------\n",fName->String());
|
|
|
|
printf("\t Parent: %s\n", fParent? fParent->GetName():"NULL");
|
2004-04-03 19:08:09 +04:00
|
|
|
printf("\t us: %s\t ls: %s\n",
|
2004-06-11 22:21:57 +04:00
|
|
|
fUpperSibling? fUpperSibling->GetName():"NULL",
|
|
|
|
fLowerSibling? fLowerSibling->GetName():"NULL");
|
2004-04-03 19:08:09 +04:00
|
|
|
printf("\t topChild: %s\t bottomChild: %s\n",
|
2004-06-11 22:21:57 +04:00
|
|
|
fTopChild? fTopChild->GetName():"NULL",
|
|
|
|
fBottomChild? fBottomChild->GetName():"NULL");
|
|
|
|
|
|
|
|
printf("Frame: (%f, %f, %f, %f)", fFrame.left, fFrame.top, fFrame.right, fFrame.bottom);
|
|
|
|
printf("Token: %ld\n",fViewToken);
|
|
|
|
printf("Hidden - direct: %s\n", fHidden?"true":"false");
|
2004-02-24 15:02:47 +03:00
|
|
|
printf("Hidden - indirect: %s\n", IsHidden()?"true":"false");
|
2004-06-11 22:21:57 +04:00
|
|
|
printf("ResizingMode: %lx\n", fResizeMode);
|
|
|
|
printf("Flags: %lx\n", fFlags);
|
|
|
|
|
|
|
|
if (fLayerData)
|
|
|
|
fLayerData->PrintToStream();
|
2004-04-03 19:08:09 +04:00
|
|
|
else
|
|
|
|
printf(" NO LayerData valid pointer\n");
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void Layer::PrintNode(void)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
printf("-----------\nLayer %s\n",fName->String());
|
|
|
|
if(fParent)
|
|
|
|
printf("Parent: %s (%p)\n",fParent->GetName(), fParent);
|
2003-01-24 18:19:27 +03:00
|
|
|
else
|
|
|
|
printf("Parent: NULL\n");
|
2004-06-11 22:21:57 +04:00
|
|
|
if(fUpperSibling)
|
|
|
|
printf("Upper sibling: %s (%p)\n",fUpperSibling->GetName(), fUpperSibling);
|
2003-01-24 18:19:27 +03:00
|
|
|
else
|
|
|
|
printf("Upper sibling: NULL\n");
|
2004-06-11 22:21:57 +04:00
|
|
|
if(fLowerSibling)
|
|
|
|
printf("Lower sibling: %s (%p)\n",fLowerSibling->GetName(), fLowerSibling);
|
2003-01-24 18:19:27 +03:00
|
|
|
else
|
|
|
|
printf("Lower sibling: NULL\n");
|
2004-06-11 22:21:57 +04:00
|
|
|
if(fTopChild)
|
|
|
|
printf("Top child: %s (%p)\n",fTopChild->GetName(), fTopChild);
|
2003-01-24 18:19:27 +03:00
|
|
|
else
|
|
|
|
printf("Top child: NULL\n");
|
2004-06-11 22:21:57 +04:00
|
|
|
if(fBottomChild)
|
|
|
|
printf("Bottom child: %s (%p)\n",fBottomChild->GetName(), fBottomChild);
|
2003-01-24 18:19:27 +03:00
|
|
|
else
|
|
|
|
printf("Bottom child: NULL\n");
|
2004-06-11 22:21:57 +04:00
|
|
|
printf("Visible Areas: "); fVisible.PrintToStream();
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
void Layer::PrintTree()
|
|
|
|
{
|
2004-02-24 15:02:47 +03:00
|
|
|
printf("\n Tree structure:\n");
|
|
|
|
printf("\t%s\t%s\n", GetName(), IsHidden()? "Hidden": "NOT hidden");
|
|
|
|
for(Layer *lay = VirtualBottomChild(); lay != NULL; lay = VirtualUpperSibling())
|
|
|
|
printf("\t%s\t%s\n", lay->GetName(), lay->IsHidden()? "Hidden": "NOT hidden");
|
2003-09-15 23:11:52 +04:00
|
|
|
}
|
|
|
|
|
2003-01-24 18:19:27 +03:00
|
|
|
BRect Layer::ConvertToParent(BRect rect)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
return (rect.OffsetByCopy(fFrame.LeftTop()));
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
BRegion Layer::ConvertToParent(BRegion *reg)
|
|
|
|
{
|
|
|
|
BRegion newreg;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2003-09-25 16:25:13 +04:00
|
|
|
for(int32 i=0; i<reg->CountRects(); i++)
|
2004-06-11 22:21:57 +04:00
|
|
|
newreg.Include( (reg->RectAt(i)).OffsetByCopy(fFrame.LeftTop()) );
|
|
|
|
|
2003-09-25 16:25:13 +04:00
|
|
|
return newreg;
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
BRect Layer::ConvertFromParent(BRect rect)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
return (rect.OffsetByCopy(fFrame.left*-1,fFrame.top*-1));
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
BRegion Layer::ConvertFromParent(BRegion *reg)
|
|
|
|
{
|
|
|
|
BRegion newreg;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2003-01-24 18:19:27 +03:00
|
|
|
for(int32 i=0; i<reg->CountRects();i++)
|
2004-06-11 22:21:57 +04:00
|
|
|
newreg.Include((reg->RectAt(i)).OffsetByCopy(fFrame.left*-1,fFrame.top*-1));
|
|
|
|
|
2003-09-25 16:25:13 +04:00
|
|
|
return newreg;
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
BRegion Layer::ConvertToTop(BRegion *reg)
|
|
|
|
{
|
|
|
|
BRegion newreg;
|
|
|
|
for(int32 i=0; i<reg->CountRects();i++)
|
|
|
|
newreg.Include(ConvertToTop(reg->RectAt(i)));
|
2003-11-14 03:15:29 +03:00
|
|
|
return newreg;
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
BRect Layer::ConvertToTop(BRect rect)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
if (fParent!=NULL)
|
|
|
|
return(fParent->ConvertToTop(rect.OffsetByCopy(fFrame.LeftTop())) );
|
2003-01-24 18:19:27 +03:00
|
|
|
else
|
|
|
|
return(rect);
|
|
|
|
}
|
|
|
|
|
|
|
|
BRegion Layer::ConvertFromTop(BRegion *reg)
|
|
|
|
{
|
|
|
|
BRegion newreg;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2003-01-24 18:19:27 +03:00
|
|
|
for(int32 i=0; i<reg->CountRects();i++)
|
|
|
|
newreg.Include(ConvertFromTop(reg->RectAt(i)));
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2003-11-14 03:15:29 +03:00
|
|
|
return newreg;
|
2003-01-24 18:19:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
BRect Layer::ConvertFromTop(BRect rect)
|
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
if (fParent!=NULL)
|
|
|
|
return(fParent->ConvertFromTop(rect.OffsetByCopy(fFrame.LeftTop().x*-1,
|
|
|
|
fFrame.LeftTop().y*-1)) );
|
2003-01-24 18:19:27 +03:00
|
|
|
else
|
|
|
|
return(rect);
|
|
|
|
}
|
2003-04-05 05:51:35 +04:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
void Layer::SendViewResizedMsg()
|
|
|
|
{
|
|
|
|
if( fServerWin && fFlags & B_FRAME_EVENTS )
|
2004-02-24 15:02:47 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
BMessage msg;
|
|
|
|
msg.what = B_VIEW_RESIZED;
|
2004-02-24 15:02:47 +03:00
|
|
|
msg.AddInt64( "when", real_time_clock_usecs() );
|
2004-06-11 22:21:57 +04:00
|
|
|
msg.AddInt32( "_token", fViewToken );
|
|
|
|
msg.AddFloat( "width", fFrame.Width() );
|
|
|
|
msg.AddFloat( "height", fFrame.Height() );
|
2004-02-24 15:02:47 +03:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
// no need for that... it's here because of backward compatibility
|
|
|
|
msg.AddPoint( "where", fFrame.LeftTop() );
|
|
|
|
|
|
|
|
fServerWin->SendMessageToClient( &msg );
|
2004-02-24 15:02:47 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
void Layer::SendViewMovedMsg()
|
|
|
|
{
|
|
|
|
if( fServerWin && fFlags & B_FRAME_EVENTS )
|
2004-02-24 15:02:47 +03:00
|
|
|
{
|
2004-06-11 22:21:57 +04:00
|
|
|
BMessage msg;
|
|
|
|
msg.what = B_VIEW_MOVED;
|
2004-02-24 15:02:47 +03:00
|
|
|
msg.AddInt64( "when", real_time_clock_usecs() );
|
2004-06-11 22:21:57 +04:00
|
|
|
msg.AddInt32( "_token", fViewToken );
|
|
|
|
msg.AddPoint( "where", fFrame.LeftTop() );
|
|
|
|
|
|
|
|
fServerWin->SendMessageToClient( &msg );
|
2004-02-24 15:02:47 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
Layer *Layer::VirtualTopChild() const
|
|
|
|
{
|
|
|
|
fCurrent = fTopChild;
|
2004-02-24 15:02:47 +03:00
|
|
|
return fCurrent;
|
2003-04-05 05:51:35 +04:00
|
|
|
}
|
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
Layer *Layer::VirtualLowerSibling() const
|
|
|
|
{
|
|
|
|
fCurrent = fCurrent->fLowerSibling;
|
2004-02-24 15:02:47 +03:00
|
|
|
return fCurrent;
|
2003-04-05 05:51:35 +04:00
|
|
|
}
|
2004-01-13 03:56:36 +03:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
Layer *Layer::VirtualUpperSibling() const
|
|
|
|
{
|
|
|
|
fCurrent = fCurrent->fUpperSibling;
|
2004-02-24 15:02:47 +03:00
|
|
|
return fCurrent;
|
|
|
|
}
|
2004-01-13 03:56:36 +03:00
|
|
|
|
2004-06-11 22:21:57 +04:00
|
|
|
Layer* Layer::VirtualBottomChild() const
|
|
|
|
{
|
|
|
|
fCurrent = fBottomChild;
|
2004-02-24 15:02:47 +03:00
|
|
|
return fCurrent;
|
|
|
|
}
|