ServerApp now maintains a list of all windows, ServerWindow's AS_DELETE_WINDOW

will update it automatically.
Renamed ServerWindow::fName to fTitle, made it a pointer - it will now just
adopt the title pointer that came from AS_CREATE_WINDOW.
Just another cleanup round: renamed Layer::GetName() to Name(), no
more layer->fName->String() accesses.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13239 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-06-23 18:48:10 +00:00
parent fcb006dcf5
commit a38e46a046
10 changed files with 322 additions and 341 deletions
+2 -2
View File
@@ -518,13 +518,13 @@ Desktop::PrintToStream(void)
printf("RootLayer List:\n=======\n"); printf("RootLayer List:\n=======\n");
for (int32 i = 0; i < fRootLayerList.CountItems(); i++) { for (int32 i = 0; i < fRootLayerList.CountItems(); i++) {
printf("\t%s\n", ((RootLayer*)fRootLayerList.ItemAt(i))->GetName()); printf("\t%s\n", ((RootLayer*)fRootLayerList.ItemAt(i))->Name());
((RootLayer*)fRootLayerList.ItemAt(i))->PrintToStream(); ((RootLayer*)fRootLayerList.ItemAt(i))->PrintToStream();
printf("-------\n"); printf("-------\n");
} }
printf("=======\nActive RootLayer: %s\n", printf("=======\nActive RootLayer: %s\n",
fActiveRootLayer ? fActiveRootLayer->GetName() : "NULL"); fActiveRootLayer ? fActiveRootLayer->Name() : "NULL");
// printf("Active WinBorder: %s\n", fActiveWinBorder? fActiveWinBorder->Name(): "NULL"); // printf("Active WinBorder: %s\n", fActiveWinBorder? fActiveWinBorder->Name(): "NULL");
printf("Screen List:\n"); printf("Screen List:\n");
+77 -72
View File
@@ -99,7 +99,7 @@ Layer::Layer(BRect frame, const char* name, int32 token,
fClipReg(&fVisible2), fClipReg(&fVisible2),
#endif #endif
fServerWin(NULL), fServerWin(NULL),
fName(new BString(name)), fName(name),
fViewToken(token), fViewToken(token),
fFlags(flags), fFlags(flags),
@@ -132,14 +132,13 @@ CRITICAL(helper);
if (!fDriver) if (!fDriver)
CRITICAL("You MUST have a valid driver to init a Layer object\n"); CRITICAL("You MUST have a valid driver to init a Layer object\n");
STRACE(("Layer(%s) successfuly created\n", GetName())); STRACE(("Layer(%s) successfuly created\n", Name()));
} }
//! Destructor frees all allocated heap space //! Destructor frees all allocated heap space
Layer::~Layer() Layer::~Layer()
{ {
delete fLayerData; delete fLayerData;
delete fName;
// TODO: uncomment! // TODO: uncomment!
//PruneTree(); //PruneTree();
@@ -159,7 +158,7 @@ Layer::~Layer()
void void
Layer::AddChild(Layer* layer, ServerWindow* serverWin) Layer::AddChild(Layer* layer, ServerWindow* serverWin)
{ {
STRACE(("Layer(%s)::AddChild(%s) START\n", GetName(), layer->GetName())); STRACE(("Layer(%s)::AddChild(%s) START\n", Name(), layer->Name()));
if (layer->fParent != NULL) { if (layer->fParent != NULL) {
printf("ERROR: AddChild(): Layer already has a parent\n"); printf("ERROR: AddChild(): Layer already has a parent\n");
@@ -183,7 +182,7 @@ Layer::AddChild(Layer* layer, ServerWindow* serverWin)
// they will be set when the RootLayer for this tree will be added // they will be set when the RootLayer for this tree will be added
// to the main tree structure. // to the main tree structure.
if (!fRootLayer) { if (!fRootLayer) {
STRACE(("Layer(%s)::AddChild(%s) END\n", GetName(), layer->GetName())); STRACE(("Layer(%s)::AddChild(%s) END\n", Name(), layer->Name()));
return; return;
} }
@@ -233,7 +232,7 @@ Layer::AddChild(Layer* layer, ServerWindow* serverWin)
} }
} }
STRACE(("Layer(%s)::AddChild(%s) END\n", GetName(), layer->GetName())); STRACE(("Layer(%s)::AddChild(%s) END\n", Name(), layer->Name()));
} }
/*! /*!
@@ -246,7 +245,7 @@ Layer::AddChild(Layer* layer, ServerWindow* serverWin)
void void
Layer::RemoveChild(Layer *layer) Layer::RemoveChild(Layer *layer)
{ {
STRACE(("Layer(%s)::RemoveChild(%s) START\n", GetName(), layer->GetName())); STRACE(("Layer(%s)::RemoveChild(%s) START\n", Name(), layer->Name()));
if (!layer->fParent) { if (!layer->fParent) {
printf("ERROR: RemoveChild(): Layer doesn't have a fParent\n"); printf("ERROR: RemoveChild(): Layer doesn't have a fParent\n");
@@ -330,7 +329,7 @@ Layer::RemoveChild(Layer *layer)
} }
} }
} }
STRACE(("Layer(%s)::RemoveChild(%s) END\n", GetName(), layer->GetName())); STRACE(("Layer(%s)::RemoveChild(%s) END\n", Name(), layer->Name()));
} }
//! Removes the calling layer from the tree //! Removes the calling layer from the tree
@@ -476,7 +475,7 @@ Layer::BottomChild() const
void void
Layer::RebuildFullRegion(void) Layer::RebuildFullRegion(void)
{ {
STRACE(("Layer(%s)::RebuildFullRegion()\n", GetName())); STRACE(("Layer(%s)::RebuildFullRegion()\n", Name()));
if (fParent) if (fParent)
fFull.Set(fParent->ConvertToTop(fFrame )); fFull.Set(fParent->ConvertToTop(fFrame ));
@@ -501,8 +500,8 @@ Layer::RebuildFullRegion(void)
void void
Layer::StartRebuildRegions( const BRegion& reg, Layer *target, uint32 action, BPoint& pt) Layer::StartRebuildRegions( const BRegion& reg, Layer *target, uint32 action, BPoint& pt)
{ {
STRACE(("Layer(%s)::StartRebuildRegions() START\n", GetName())); STRACE(("Layer(%s)::StartRebuildRegions() START\n", Name()));
RBTRACE(("\n\nLayer(%s)::StartRebuildRegions() START\n", GetName())); RBTRACE(("\n\nLayer(%s)::StartRebuildRegions() START\n", Name()));
if (!fParent) if (!fParent)
fFullVisible = fFull; fFullVisible = fFull;
@@ -519,7 +518,7 @@ Layer::StartRebuildRegions( const BRegion& reg, Layer *target, uint32 action, BP
} }
#ifdef DEBUG_LAYER_REBUILD #ifdef DEBUG_LAYER_REBUILD
printf("\nSRR: Layer(%s) ALMOST done regions:\n", GetName()); printf("\nSRR: Layer(%s) ALMOST done regions:\n", Name());
printf("\tVisible Region:\n"); printf("\tVisible Region:\n");
fVisible.PrintToStream(); fVisible.PrintToStream();
printf("\tFull Visible Region:\n"); printf("\tFull Visible Region:\n");
@@ -536,7 +535,7 @@ Layer::StartRebuildRegions( const BRegion& reg, Layer *target, uint32 action, BP
fRootLayer->fRedrawReg.Include(&redrawReg); fRootLayer->fRedrawReg.Include(&redrawReg);
#ifdef DEBUG_LAYER_REBUILD #ifdef DEBUG_LAYER_REBUILD
printf("\nLayer(%s)::StartRebuildRegions() DONE. Results:\n", GetName()); printf("\nLayer(%s)::StartRebuildRegions() DONE. Results:\n", Name());
printf("\tRedraw Region:\n"); printf("\tRedraw Region:\n");
fRootLayer->fRedrawReg.PrintToStream(); fRootLayer->fRedrawReg.PrintToStream();
printf("\tCopy Region:\n"); printf("\tCopy Region:\n");
@@ -547,15 +546,15 @@ Layer::StartRebuildRegions( const BRegion& reg, Layer *target, uint32 action, BP
printf("\n"); printf("\n");
#endif #endif
STRACE(("Layer(%s)::StartRebuildRegions() END\n", GetName())); STRACE(("Layer(%s)::StartRebuildRegions() END\n", Name()));
RBTRACE(("Layer(%s)::StartRebuildRegions() END\n", GetName())); RBTRACE(("Layer(%s)::StartRebuildRegions() END\n", Name()));
} }
// RebuildRegions // RebuildRegions
void void
Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOffset) Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOffset)
{ {
STRACE(("Layer(%s)::RebuildRegions() START\n", GetName())); STRACE(("Layer(%s)::RebuildRegions() START\n", Name()));
// TODO:/NOTE: this method must be executed as quickly as possible. // TODO:/NOTE: this method must be executed as quickly as possible.
@@ -578,14 +577,14 @@ Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOf
RRLabel1: RRLabel1:
switch(action) { switch(action) {
case B_LAYER_NONE: { case B_LAYER_NONE: {
RBTRACE(("1) Layer(%s): Action B_LAYER_NONE\n", GetName())); RBTRACE(("1) Layer(%s): Action B_LAYER_NONE\n", Name()));
STRACE(("1) Layer(%s): Action B_LAYER_NONE\n", GetName())); STRACE(("1) Layer(%s): Action B_LAYER_NONE\n", Name()));
oldRegion = fVisible; oldRegion = fVisible;
break; break;
} }
case B_LAYER_MOVE: { case B_LAYER_MOVE: {
RBTRACE(("1) Layer(%s): Action B_LAYER_MOVE\n", GetName())); RBTRACE(("1) Layer(%s): Action B_LAYER_MOVE\n", Name()));
STRACE(("1) Layer(%s): Action B_LAYER_MOVE\n", GetName())); STRACE(("1) Layer(%s): Action B_LAYER_MOVE\n", Name()));
oldRegion = fFullVisible; oldRegion = fFullVisible;
fFrame.OffsetBy(pt.x, pt.y); fFrame.OffsetBy(pt.x, pt.y);
fFull.OffsetBy(pt.x, pt.y); fFull.OffsetBy(pt.x, pt.y);
@@ -598,15 +597,15 @@ Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOf
break; break;
} }
case B_LAYER_SIMPLE_MOVE: { case B_LAYER_SIMPLE_MOVE: {
RBTRACE(("1) Layer(%s): Action B_LAYER_SIMPLE_MOVE\n", GetName())); RBTRACE(("1) Layer(%s): Action B_LAYER_SIMPLE_MOVE\n", Name()));
STRACE(("1) Layer(%s): Action B_LAYER_SIMPLE_MOVE\n", GetName())); STRACE(("1) Layer(%s): Action B_LAYER_SIMPLE_MOVE\n", Name()));
fFull.OffsetBy(pt.x, pt.y); fFull.OffsetBy(pt.x, pt.y);
break; break;
} }
case B_LAYER_RESIZE: { case B_LAYER_RESIZE: {
RBTRACE(("1) Layer(%s): Action B_LAYER_RESIZE\n", GetName())); RBTRACE(("1) Layer(%s): Action B_LAYER_RESIZE\n", Name()));
STRACE(("1) Layer(%s): Action B_LAYER_RESIZE\n", GetName())); STRACE(("1) Layer(%s): Action B_LAYER_RESIZE\n", Name()));
oldRegion = fVisible; oldRegion = fVisible;
fFrame.right += pt.x; fFrame.right += pt.x;
@@ -621,8 +620,8 @@ Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOf
break; break;
} }
case B_LAYER_MASK_RESIZE: { case B_LAYER_MASK_RESIZE: {
RBTRACE(("1) Layer(%s): Action B_LAYER_MASK_RESIZE\n", GetName())); RBTRACE(("1) Layer(%s): Action B_LAYER_MASK_RESIZE\n", Name()));
STRACE(("1) Layer(%s): Action B_LAYER_MASK_RESIZE\n", GetName())); STRACE(("1) Layer(%s): Action B_LAYER_MASK_RESIZE\n", Name()));
oldRegion = fVisible; oldRegion = fVisible;
BPoint offset, rSize; BPoint offset, rSize;
@@ -665,7 +664,7 @@ Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOf
if (!IsHidden()) { if (!IsHidden()) {
#ifdef DEBUG_LAYER_REBUILD #ifdef DEBUG_LAYER_REBUILD
printf("Layer(%s) real action START\n", GetName()); printf("Layer(%s) real action START\n", Name());
fFull.PrintToStream(); fFull.PrintToStream();
#endif #endif
fFullVisible.MakeEmpty(); fFullVisible.MakeEmpty();
@@ -721,7 +720,7 @@ Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOf
lay->RebuildRegions(reg, newAction, newPt, newOffset); lay->RebuildRegions(reg, newAction, newPt, newOffset);
#ifdef DEBUG_LAYER_REBUILD #ifdef DEBUG_LAYER_REBUILD
printf("\nLayer(%s) ALMOST done regions:\n", GetName()); printf("\nLayer(%s) ALMOST done regions:\n", Name());
printf("\tVisible Region:\n"); printf("\tVisible Region:\n");
fVisible.PrintToStream(); fVisible.PrintToStream();
printf("\tFull Visible Region:\n"); printf("\tFull Visible Region:\n");
@@ -731,7 +730,7 @@ Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOf
if(!IsHidden()) { if(!IsHidden()) {
switch(action) { switch(action) {
case B_LAYER_NONE: { case B_LAYER_NONE: {
RBTRACE(("2) Layer(%s): Action B_LAYER_NONE\n", GetName())); RBTRACE(("2) Layer(%s): Action B_LAYER_NONE\n", Name()));
BRegion r(fVisible); BRegion r(fVisible);
if (oldRegion.CountRects() > 0) if (oldRegion.CountRects() > 0)
r.Exclude(&oldRegion); r.Exclude(&oldRegion);
@@ -741,7 +740,7 @@ Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOf
break; break;
} }
case B_LAYER_MOVE: { case B_LAYER_MOVE: {
RBTRACE(("2) Layer(%s): Action B_LAYER_MOVE\n", GetName())); RBTRACE(("2) Layer(%s): Action B_LAYER_MOVE\n", Name()));
BRegion redrawReg; BRegion redrawReg;
BRegion *copyReg = new BRegion(); BRegion *copyReg = new BRegion();
BRegion screenReg(fRootLayer->Bounds()); BRegion screenReg(fRootLayer->Bounds());
@@ -769,7 +768,7 @@ Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOf
break; break;
} }
case B_LAYER_RESIZE: { case B_LAYER_RESIZE: {
RBTRACE(("2) Layer(%s): Action B_LAYER_RESIZE\n", GetName())); RBTRACE(("2) Layer(%s): Action B_LAYER_RESIZE\n", Name()));
BRegion redrawReg; BRegion redrawReg;
redrawReg = fVisible; redrawReg = fVisible;
@@ -780,7 +779,7 @@ Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOf
break; break;
} }
case B_LAYER_MASK_RESIZE: { case B_LAYER_MASK_RESIZE: {
RBTRACE(("2) Layer(%s): Action B_LAYER_MASK_RESIZE\n", GetName())); RBTRACE(("2) Layer(%s): Action B_LAYER_MASK_RESIZE\n", Name()));
BRegion redrawReg; BRegion redrawReg;
BRegion *copyReg = new BRegion(); BRegion *copyReg = new BRegion();
@@ -803,7 +802,7 @@ Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOf
break; break;
} }
default: default:
RBTRACE(("2) Layer(%s): Action default\n", GetName())); RBTRACE(("2) Layer(%s): Action default\n", Name()));
break; break;
} }
} }
@@ -813,14 +812,14 @@ Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint ptOf
} }
*/ */
STRACE(("Layer(%s)::RebuildRegions() END\n", GetName())); STRACE(("Layer(%s)::RebuildRegions() END\n", Name()));
} }
// ResizeOthers // ResizeOthers
uint32 uint32
Layer::ResizeOthers(float x, float y, BPoint coords[], BPoint *ptOffset) Layer::ResizeOthers(float x, float y, BPoint coords[], BPoint *ptOffset)
{ {
STRACE(("Layer(%s)::ResizeOthers() START\n", GetName())); STRACE(("Layer(%s)::ResizeOthers() START\n", Name()));
uint32 rmask = fResizeMode; uint32 rmask = fResizeMode;
// offset // offset
@@ -856,7 +855,7 @@ Layer::ResizeOthers(float x, float y, BPoint coords[], BPoint *ptOffset)
// illegal flag. Do nothing. // illegal flag. Do nothing.
} }
STRACE(("Layer(%s)::ResizeOthers() END\n", GetName())); STRACE(("Layer(%s)::ResizeOthers() END\n", Name()));
return 0UL; return 0UL;
} }
@@ -866,7 +865,7 @@ Layer::ResizeOthers(float x, float y, BPoint coords[], BPoint *ptOffset)
void void
Layer::Redraw(const BRegion& reg, Layer *startFrom) Layer::Redraw(const BRegion& reg, Layer *startFrom)
{ {
STRACE(("Layer(%s)::Redraw();\n", GetName())); STRACE(("Layer(%s)::Redraw();\n", Name()));
if (IsHidden()) if (IsHidden())
// this layer has nothing visible on screen, so bail out. // this layer has nothing visible on screen, so bail out.
return; return;
@@ -876,7 +875,7 @@ Layer::Redraw(const BRegion& reg, Layer *startFrom)
if (pReg->CountRects() > 0) if (pReg->CountRects() > 0)
RequestDraw(reg, startFrom); RequestDraw(reg, startFrom);
STRACE(("Layer(%s)::Redraw() ENDED\n", GetName())); STRACE(("Layer(%s)::Redraw() ENDED\n", Name()));
} }
// Draw // Draw
@@ -884,7 +883,7 @@ void
Layer::Draw(const BRect &rect) Layer::Draw(const BRect &rect)
{ {
#ifdef DEBUG_LAYER #ifdef DEBUG_LAYER
printf("Layer(%s)::Draw: ", GetName()); printf("Layer(%s)::Draw: ", Name());
rect.PrintToStream(); rect.PrintToStream();
#endif #endif
@@ -916,7 +915,7 @@ Layer::EmptyGlobals()
void void
Layer::Show(bool invalidate) Layer::Show(bool invalidate)
{ {
STRACE(("Layer(%s)::Show()\n", GetName())); STRACE(("Layer(%s)::Show()\n", Name()));
if(!IsHidden()) if(!IsHidden())
return; return;
@@ -942,7 +941,7 @@ SendViewCoordUpdateMsg();
void void
Layer::Hide(bool invalidate) Layer::Hide(bool invalidate)
{ {
STRACE(("Layer(%s)::Hide()\n", GetName())); STRACE(("Layer(%s)::Hide()\n", Name()));
if (IsHidden()) if (IsHidden())
return; return;
@@ -980,7 +979,7 @@ void
Layer::PopState() Layer::PopState()
{ {
if (fLayerData->prevState == NULL) { if (fLayerData->prevState == NULL) {
fprintf(stderr, "WARNING: User called BView(%s)::PopState(), but there is NO state on stack!\n", fName->String()); fprintf(stderr, "WARNING: User called BView(%s)::PopState(), but there is NO state on stack!\n", Name());
return; return;
} }
@@ -1012,7 +1011,7 @@ Layer::Frame(void) const
void void
Layer::MoveBy(float x, float y) Layer::MoveBy(float x, float y)
{ {
STRACE(("Layer(%s)::MoveBy() START\n", GetName())); STRACE(("Layer(%s)::MoveBy() START\n", Name()));
if (!fParent) { if (!fParent) {
CRITICAL("ERROR: in Layer::MoveBy()! - No parent!\n"); CRITICAL("ERROR: in Layer::MoveBy()! - No parent!\n");
return; return;
@@ -1025,14 +1024,14 @@ Layer::MoveBy(float x, float y)
msg.Attach<float>(y); msg.Attach<float>(y);
GetRootLayer()->EnqueueMessage(msg); GetRootLayer()->EnqueueMessage(msg);
STRACE(("Layer(%s)::MoveBy() END\n", GetName())); STRACE(("Layer(%s)::MoveBy() END\n", Name()));
} }
//! Resize the layer by the specified amount, complete with redraw //! Resize the layer by the specified amount, complete with redraw
void void
Layer::ResizeBy(float x, float y) Layer::ResizeBy(float x, float y)
{ {
STRACE(("Layer(%s)::ResizeBy() START\n", GetName())); STRACE(("Layer(%s)::ResizeBy() START\n", Name()));
if (!fParent) { if (!fParent) {
printf("ERROR: in Layer::ResizeBy()! - No parent!\n"); printf("ERROR: in Layer::ResizeBy()! - No parent!\n");
@@ -1046,7 +1045,7 @@ Layer::ResizeBy(float x, float y)
msg.Attach<float>(y); msg.Attach<float>(y);
GetRootLayer()->EnqueueMessage(msg); GetRootLayer()->EnqueueMessage(msg);
STRACE(("Layer(%s)::ResizeBy() END\n", GetName())); STRACE(("Layer(%s)::ResizeBy() END\n", Name()));
} }
// BoundsOrigin // BoundsOrigin
@@ -1241,17 +1240,19 @@ Layer::PruneTree(void)
void void
Layer::PrintToStream() Layer::PrintToStream()
{ {
printf("\n----------- Layer %s -----------\n",fName->String()); printf("\n----------- Layer %s -----------\n", Name());
printf("\t Parent: %s\n", fParent? fParent->GetName():"NULL"); printf("\t Parent: %s\n", fParent ? fParent->Name() : "<no parent>");
printf("\t us: %s\t ls: %s\n", printf("\t us: %s\t ls: %s\n",
fUpperSibling? fUpperSibling->GetName():"NULL", fUpperSibling ? fUpperSibling->Name() : "<none>",
fLowerSibling? fLowerSibling->GetName():"NULL"); fLowerSibling ? fLowerSibling->Name() : "<none>");
printf("\t topChild: %s\t bottomChild: %s\n", printf("\t topChild: %s\t bottomChild: %s\n",
fTopChild? fTopChild->GetName():"NULL", fTopChild ? fTopChild->Name() : "<none>",
fBottomChild? fBottomChild->GetName():"NULL"); fBottomChild ? fBottomChild->Name() : "<none>");
printf("Frame: (%f, %f, %f, %f)", fFrame.left, fFrame.top, fFrame.right, fFrame.bottom); printf("Frame: (%f, %f, %f, %f)", fFrame.left, fFrame.top, fFrame.right, fFrame.bottom);
printf("Token: %ld\n",fViewToken); printf("Token: %ld\n", fViewToken);
printf("Hidden - direct: %s\n", fHidden?"true":"false"); printf("Hidden - direct: %s\n", fHidden?"true":"false");
printf("Hidden - indirect: %s\n", IsHidden()?"true":"false"); printf("Hidden - indirect: %s\n", IsHidden()?"true":"false");
printf("ResizingMode: %lx\n", fResizeMode); printf("ResizingMode: %lx\n", fResizeMode);
@@ -1267,25 +1268,29 @@ Layer::PrintToStream()
void void
Layer::PrintNode() Layer::PrintNode()
{ {
printf("-----------\nLayer %s\n",fName->String()); printf("-----------\nLayer %s\n", Name());
if(fParent) if (fParent)
printf("Parent: %s (%p)\n",fParent->GetName(), fParent); printf("Parent: %s (%p)\n", fParent->Name(), fParent);
else else
printf("Parent: NULL\n"); printf("Parent: NULL\n");
if(fUpperSibling)
printf("Upper sibling: %s (%p)\n",fUpperSibling->GetName(), fUpperSibling); if (fUpperSibling)
printf("Upper sibling: %s (%p)\n", fUpperSibling->Name(), fUpperSibling);
else else
printf("Upper sibling: NULL\n"); printf("Upper sibling: NULL\n");
if(fLowerSibling)
printf("Lower sibling: %s (%p)\n",fLowerSibling->GetName(), fLowerSibling); if (fLowerSibling)
printf("Lower sibling: %s (%p)\n", fLowerSibling->Name(), fLowerSibling);
else else
printf("Lower sibling: NULL\n"); printf("Lower sibling: NULL\n");
if(fTopChild)
printf("Top child: %s (%p)\n",fTopChild->GetName(), fTopChild); if (fTopChild)
printf("Top child: %s (%p)\n", fTopChild->Name(), fTopChild);
else else
printf("Top child: NULL\n"); printf("Top child: NULL\n");
if(fBottomChild)
printf("Bottom child: %s (%p)\n",fBottomChild->GetName(), fBottomChild); if (fBottomChild)
printf("Bottom child: %s (%p)\n", fBottomChild->Name(), fBottomChild);
else else
printf("Bottom child: NULL\n"); printf("Bottom child: NULL\n");
#ifndef NEW_CLIPPING #ifndef NEW_CLIPPING
@@ -1298,9 +1303,9 @@ void
Layer::PrintTree() Layer::PrintTree()
{ {
printf("\n Tree structure:\n"); printf("\n Tree structure:\n");
printf("\t%s\t%s\n", GetName(), IsHidden()? "Hidden": "NOT hidden"); printf("\t%s\t%s\n", Name(), IsHidden()? "Hidden": "NOT hidden");
for(Layer *lay = BottomChild(); lay != NULL; lay = UpperSibling()) for(Layer *lay = BottomChild(); lay != NULL; lay = UpperSibling())
printf("\t%s\t%s\n", lay->GetName(), lay->IsHidden()? "Hidden": "NOT hidden"); printf("\t%s\t%s\n", lay->Name(), lay->IsHidden()? "Hidden": "NOT hidden");
} }
// UpdateStart // UpdateStart
@@ -1362,7 +1367,7 @@ Layer::move_layer(float x, float y)
BRect rect(fFull.Frame().OffsetByCopy(pt)); BRect rect(fFull.Frame().OffsetByCopy(pt));
if (!fParent) { if (!fParent) {
printf("no parent in Layer::move_layer() (%s)\n", GetName()); printf("no parent in Layer::move_layer() (%s)\n", Name());
fFrameAction = B_LAYER_ACTION_NONE; fFrameAction = B_LAYER_ACTION_NONE;
return; return;
} }
@@ -1396,7 +1401,7 @@ Layer::resize_layer(float x, float y)
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", Name());
fFrameAction = B_LAYER_ACTION_NONE; fFrameAction = B_LAYER_ACTION_NONE;
return; return;
} }
@@ -1426,7 +1431,7 @@ Layer::FullInvalidate(const BRect &rect)
void void
Layer::FullInvalidate(const BRegion& region) Layer::FullInvalidate(const BRegion& region)
{ {
STRACE(("Layer(%s)::FullInvalidate():\n", GetName())); STRACE(("Layer(%s)::FullInvalidate():\n", Name()));
#ifdef DEBUG_LAYER #ifdef DEBUG_LAYER
region.PrintToStream(); region.PrintToStream();
@@ -1445,7 +1450,7 @@ Layer::FullInvalidate(const BRegion& region)
void void
Layer::Invalidate(const BRegion& region) Layer::Invalidate(const BRegion& region)
{ {
STRACE(("Layer(%s)::Invalidate():\n", GetName())); STRACE(("Layer(%s)::Invalidate():\n", Name()));
#ifdef DEBUG_LAYER #ifdef DEBUG_LAYER
region.PrintToStream(); region.PrintToStream();
printf("\n"); printf("\n");
@@ -1464,8 +1469,8 @@ Layer::Invalidate(const BRegion& region)
void void
Layer::RequestDraw(const BRegion &reg, Layer *startFrom) Layer::RequestDraw(const BRegion &reg, Layer *startFrom)
{ {
STRACE(("Layer(%s)::RequestDraw()\n", GetName())); STRACE(("Layer(%s)::RequestDraw()\n", Name()));
printf("Layer(%s)::RequestDraw()\n", GetName()); printf("Layer(%s)::RequestDraw()\n", Name());
//if (fClassID == AS_ROOTLAYER_CLASS) //if (fClassID == AS_ROOTLAYER_CLASS)
// debugger("z"); // debugger("z");
// do not redraw any child until you must // do not redraw any child until you must
+4 -3
View File
@@ -92,8 +92,9 @@ class Layer {
virtual Layer* UpperSibling() const; virtual Layer* UpperSibling() const;
virtual Layer* BottomChild() const; virtual Layer* BottomChild() const;
const char* GetName() const const char* Name() const
{ return (fName) ? fName->String() : NULL; } { return fName.String(); }
#ifndef NEW_CLIPPING #ifndef NEW_CLIPPING
virtual void RebuildFullRegion(); virtual void RebuildFullRegion();
void StartRebuildRegions(const BRegion& reg, void StartRebuildRegions(const BRegion& reg,
@@ -291,7 +292,7 @@ class Layer {
BRegion* fClipReg; BRegion* fClipReg;
ServerWindow* fServerWin; ServerWindow* fServerWin;
BString* fName; BString fName;
int32 fViewToken; int32 fViewToken;
uint32 fFlags; uint32 fFlags;
uint32 fResizeMode; uint32 fResizeMode;
+5 -5
View File
@@ -239,7 +239,7 @@ RootLayer::WorkingThread(void *data)
#endif #endif
oneRootLayer->Unlock(); oneRootLayer->Unlock();
STRACE(("info: RootLayer(%s)::WorkingThread listening on port %ld.\n", oneRootLayer->GetName(), oneRootLayer->fListenPort)); STRACE(("info: RootLayer(%s)::WorkingThread listening on port %ld.\n", oneRootLayer->Name(), oneRootLayer->fListenPort));
for (;;) { for (;;) {
err = messageQueue.GetNextMessage(code); err = messageQueue.GetNextMessage(code);
if (err < B_OK) { if (err < B_OK) {
@@ -381,7 +381,7 @@ printf("Adi: new message\n");
break; break;
} }
default: default:
printf("RootLayer(%s)::WorkingThread received unexpected code %lx\n", oneRootLayer->GetName(), code); printf("RootLayer(%s)::WorkingThread received unexpected code %lx\n", oneRootLayer->Name(), code);
break; break;
} }
@@ -410,7 +410,7 @@ RootLayer::GoInvalidate(const Layer *layer, const BRegion &region)
void RootLayer::invalidate_layer(Layer *layer, const BRegion &region) void RootLayer::invalidate_layer(Layer *layer, const BRegion &region)
{ {
// NOTE: our thread (WorkingThread) is locked here. // NOTE: our thread (WorkingThread) is locked here.
STRACE(("RootLayer::invalidate_layer(%s)\n", layer->GetName())); STRACE(("RootLayer::invalidate_layer(%s)\n", layer->Name()));
if (layer->fParent) if (layer->fParent)
layer = layer->fParent; layer = layer->fParent;
@@ -641,7 +641,7 @@ void RootLayer::RemoveSubsetWinBorder(WinBorder *winBorder, WinBorder *fromWinBo
// NOTE: This must be called by RootLayer's thread!!!! // NOTE: This must be called by RootLayer's thread!!!!
bool RootLayer::SetActiveWorkspace(int32 index) bool RootLayer::SetActiveWorkspace(int32 index)
{ {
STRACE(("RootLayer(%s)::SetActiveWorkspace(%ld)\n", GetName(), index)); STRACE(("RootLayer(%s)::SetActiveWorkspace(%ld)\n", Name(), index));
// nice try! // nice try!
if (index >= fWsCount || index == fActiveWksIndex || index < 0) if (index >= fWsCount || index == fActiveWksIndex || index < 0)
@@ -1900,7 +1900,7 @@ RootLayer::DragMessage(void) const
void void
RootLayer::PrintToStream() RootLayer::PrintToStream()
{ {
printf("\nRootLayer '%s' internals:\n", GetName()); printf("\nRootLayer '%s' internals:\n", Name());
printf("Screen list:\n"); printf("Screen list:\n");
for(int32 i=0; i<fScreenPtrList.CountItems(); i++) for(int32 i=0; i<fScreenPtrList.CountItems(); i++)
printf("\t%ld\n", ((Screen*)fScreenPtrList.ItemAt(i))->ScreenNumber()); printf("\t%ld\n", ((Screen*)fScreenPtrList.ItemAt(i))->ScreenNumber());
+33 -19
View File
@@ -14,11 +14,10 @@
#include <AppDefs.h> #include <AppDefs.h>
#include <List.h> #include <List.h>
#include <String.h> #include <String.h>
#include <Autolock.h>
#include <SysCursor.h> #include <SysCursor.h>
#include <ColorSet.h> #include <ColorSet.h>
#include <RGBColor.h> #include <RGBColor.h>
#include <stdio.h>
#include <string.h>
#include <ScrollBar.h> #include <ScrollBar.h>
#include <Shape.h> #include <Shape.h>
#include <ServerProtocol.h> #include <ServerProtocol.h>
@@ -45,10 +44,12 @@
#include "LayerData.h" #include "LayerData.h"
#include "Utils.h" #include "Utils.h"
#include <stdio.h>
#include <string.h>
//#define DEBUG_SERVERAPP //#define DEBUG_SERVERAPP
#ifdef DEBUG_SERVERAPP #ifdef DEBUG_SERVERAPP
# include <stdio.h>
# define STRACE(x) printf x # define STRACE(x) printf x
#else #else
# define STRACE(x) ; # define STRACE(x) ;
@@ -57,7 +58,6 @@
//#define DEBUG_SERVERAPP_FONT //#define DEBUG_SERVERAPP_FONT
#ifdef DEBUG_SERVERAPP_FONT #ifdef DEBUG_SERVERAPP_FONT
# include <stdio.h>
# define FTRACE(x) printf x # define FTRACE(x) printf x
#else #else
# define FTRACE(x) ; # define FTRACE(x) ;
@@ -77,13 +77,13 @@ static const uint32 kMsgAppQuit = 'appQ';
ServerApp::ServerApp(port_id clientReplyPort, port_id clientLooperPort, ServerApp::ServerApp(port_id clientReplyPort, port_id clientLooperPort,
team_id clientTeam, int32 handlerID, const char* signature) team_id clientTeam, int32 handlerID, const char* signature)
: :
fLockSem(-1),
fClientReplyPort(clientReplyPort), fClientReplyPort(clientReplyPort),
fMessagePort(-1), fMessagePort(-1),
fClientLooperPort(clientLooperPort), fClientLooperPort(clientLooperPort),
fSignature(signature), fSignature(signature),
fThread(-1), fThread(-1),
fClientTeam(clientTeam), fClientTeam(clientTeam),
fWindowListLock("window list"),
fAppCursor(NULL), fAppCursor(NULL),
fCursorHidden(false), fCursorHidden(false),
fIsActive(false), fIsActive(false),
@@ -94,11 +94,10 @@ ServerApp::ServerApp(port_id clientReplyPort, port_id clientLooperPort,
if (fSignature == "") if (fSignature == "")
fSignature = "application/no-signature"; fSignature = "application/no-signature";
fLockSem = create_sem(1, Signature()); char name[B_OS_NAME_LENGTH];
if (fLockSem < B_OK) snprintf(name, sizeof(name), "a<%s", Signature());
return;
fMessagePort = create_port(DEFAULT_MONITOR_PORT_SIZE, Signature()); fMessagePort = create_port(DEFAULT_MONITOR_PORT_SIZE, name);
if (fMessagePort < B_OK) if (fMessagePort < B_OK)
return; return;
@@ -154,7 +153,6 @@ ServerApp::~ServerApp(void)
// there should be a way that this ServerApp be attached to a particular // there should be a way that this ServerApp be attached to a particular
// RootLayer to know which RootLayer's cursor to modify. // RootLayer to know which RootLayer's cursor to modify.
gDesktop->ActiveRootLayer()->GetCursorManager().RemoveAppCursors(fClientTeam); gDesktop->ActiveRootLayer()->GetCursorManager().RemoveAppCursors(fClientTeam);
delete_sem(fLockSem);
STRACE(("#ServerApp %s:~ServerApp()\n", fSignature.String())); STRACE(("#ServerApp %s:~ServerApp()\n", fSignature.String()));
@@ -176,8 +174,8 @@ ServerApp::InitCheck()
if (fClientReplyPort < B_OK) if (fClientReplyPort < B_OK)
return fClientReplyPort; return fClientReplyPort;
if (fLockSem < B_OK) if (fWindowListLock.Sem() < B_OK)
return fLockSem; return fWindowListLock.Sem();
return B_OK; return B_OK;
} }
@@ -390,7 +388,7 @@ ServerApp::_MessageLooper()
uint32 look; uint32 look;
uint32 feel; uint32 feel;
uint32 flags; uint32 flags;
uint32 wkspaces; uint32 workspaces;
int32 token = B_NULL_TOKEN; int32 token = B_NULL_TOKEN;
port_id sendPort = -1; port_id sendPort = -1;
port_id looperPort = -1; port_id looperPort = -1;
@@ -400,24 +398,31 @@ ServerApp::_MessageLooper()
receiver.Read<uint32>(&look); receiver.Read<uint32>(&look);
receiver.Read<uint32>(&feel); receiver.Read<uint32>(&feel);
receiver.Read<uint32>(&flags); receiver.Read<uint32>(&flags);
receiver.Read<uint32>(&wkspaces); receiver.Read<uint32>(&workspaces);
receiver.Read<int32>(&token); receiver.Read<int32>(&token);
receiver.Read<port_id>(&sendPort); receiver.Read<port_id>(&sendPort);
receiver.Read<port_id>(&looperPort); receiver.Read<port_id>(&looperPort);
if (receiver.ReadString(&title) != B_OK) if (receiver.ReadString(&title) != B_OK)
break; break;
STRACE(("ServerApp %s: Got 'New Window' message, trying to do smething...\n", Signature())); STRACE(("ServerApp %s: Got 'New Window' message, trying to do smething...\n",
Signature()));
// ServerWindow constructor will reply with port_id of a newly created port // ServerWindow constructor will reply with port_id of a newly created port
ServerWindow *sw = new ServerWindow(title, this, sendPort, looperPort, token); ServerWindow *window = new ServerWindow(title, this, sendPort, looperPort,
sw->Init(frame, look, feel, flags, wkspaces); token);
window->Init(frame, look, feel, flags, workspaces);
if (fWindowListLock.Lock()) {
fWindowList.AddItem(window);
fWindowListLock.Unlock();
}
STRACE(("\nServerApp %s: New Window %s (%.1f,%.1f,%.1f,%.1f)\n", STRACE(("\nServerApp %s: New Window %s (%.1f,%.1f,%.1f,%.1f)\n",
app->fSignature.String(), title, frame.left, frame.top, app->fSignature.String(), title, frame.left, frame.top,
frame.right, frame.bottom)); frame.right, frame.bottom));
free(title); // We don't have to free the title, as it's owned by the ServerWindow now
break; break;
} }
@@ -467,7 +472,7 @@ ServerApp::_MessageLooper()
void void
ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link) ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
{ {
LayerData ld; // LayerData ld;
switch (code) { switch (code) {
case AS_UPDATE_COLORS: case AS_UPDATE_COLORS:
@@ -1916,6 +1921,15 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
} }
void
ServerApp::RemoveWindow(ServerWindow* window)
{
BAutolock locker(fWindowListLock);
fWindowList.RemoveItem(window);
}
int32 int32
ServerApp::CountBitmaps() const ServerApp::CountBitmaps() const
{ {
+7 -12
View File
@@ -43,14 +43,8 @@ public:
status_t InitCheck(); status_t InitCheck();
bool Run(); bool Run();
void Quit(); void Quit();
/*
TODO: These aren't even implemented...
void Lock(void);
void Unlock(void);
bool IsLocked(void);
*/
/*! /*!
\brief Determines whether the application is the active one \brief Determines whether the application is the active one
\return true if active, false if not. \return true if active, false if not.
@@ -61,7 +55,7 @@ public:
bool PingTarget(void); bool PingTarget(void);
void PostMessage(int32 code); void PostMessage(int32 code);
void SendMessageToClient( const BMessage* msg ) const; void SendMessageToClient(const BMessage* msg) const;
void SetAppCursor(void); void SetAppCursor(void);
@@ -70,6 +64,8 @@ public:
const char *Signature() const { return fSignature.String(); } const char *Signature() const { return fSignature.String(); }
void RemoveWindow(ServerWindow* window);
int32 CountBitmaps() const; int32 CountBitmaps() const;
ServerBitmap *FindBitmap(int32 token) const; ServerBitmap *FindBitmap(int32 token) const;
@@ -86,9 +82,6 @@ private:
static int32 _message_thread(void *data); static int32 _message_thread(void *data);
// TODO: Not used.
sem_id fLockSem;
// our BApplication's event port // our BApplication's event port
port_id fClientReplyPort; port_id fClientReplyPort;
// port we receive messages from our BApplication // port we receive messages from our BApplication
@@ -106,10 +99,12 @@ private:
BPrivate::PortLink fLink; BPrivate::PortLink fLink;
BLocker fWindowListLock;
BList fWindowList;
// TODO: // TODO:
// - Are really Bitmaps and Pictures stored per application and not globally ? // - Are really Bitmaps and Pictures stored per application and not globally ?
// - As we reference these stuff by token, what about putting them in hash tables ? // - As we reference these stuff by token, what about putting them in hash tables ?
BList fWindowList;
BList fBitmapList; BList fBitmapList;
BList fPictureList; BList fPictureList;
File diff suppressed because it is too large Load Diff
+5 -9
View File
@@ -51,7 +51,7 @@ class ServerPicture;
coordinating and linking a window's WinBorder half with its messaging half, dispatching coordinating and linking a window's WinBorder half with its messaging half, dispatching
mouse and key events from the server to its window, and other such things. mouse and key events from the server to its window, and other such things.
*/ */
class ServerWindow { class ServerWindow : public BLocker {
public: public:
ServerWindow( const char *string, ServerWindow( const char *string,
ServerApp *winapp, ServerApp *winapp,
@@ -68,10 +68,6 @@ public:
void Show(void); void Show(void);
void Hide(void); void Hide(void);
status_t Lock(void);
void Unlock(void);
bool IsLocked(void) const;
// methods for sending various messages to client. // methods for sending various messages to client.
void Quit(void); void Quit(void);
void Minimize(bool status); void Minimize(bool status);
@@ -90,7 +86,7 @@ public:
// to who we belong. who do we own. our title. // to who we belong. who do we own. our title.
inline ServerApp* App() const { return fServerApp; } inline ServerApp* App() const { return fServerApp; }
inline const WinBorder* GetWinBorder() const { return fWinBorder; } inline const WinBorder* GetWinBorder() const { return fWinBorder; }
inline const char* Title() const { return fName; } inline const char* Title() const { return fTitle; }
// related thread/team_id(s). // related thread/team_id(s).
inline team_id ClientTeam() const { return fClientTeam; } inline team_id ClientTeam() const { return fClientTeam; }
@@ -127,7 +123,9 @@ private:
BRegion &, BRegion &,
bool inverse, bool inverse,
BPoint where); BPoint where);
char fName[50];
private:
const char* fTitle;
ServerApp* fServerApp; ServerApp* fServerApp;
WinBorder* fWinBorder; WinBorder* fWinBorder;
@@ -144,8 +142,6 @@ private:
BMessage fClientViewsWithInvalidCoords; BMessage fClientViewsWithInvalidCoords;
BLocker fLocker;
int32 fHandlerToken; int32 fHandlerToken;
Layer* fCurrentLayer; Layer* fCurrentLayer;
+1 -1
View File
@@ -89,7 +89,7 @@ SubWindowList::PrintToStream() const
for (int32 i=0; i<CountItems(); i++) { for (int32 i=0; i<CountItems(); i++) {
wb = (WinBorder*)ItemAt(i); wb = (WinBorder*)ItemAt(i);
printf("\t%s", wb->GetName()); printf("\t%s", wb->Name());
if (wb->Feel() == B_FLOATING_SUBSET_WINDOW_FEEL) if (wb->Feel() == B_FLOATING_SUBSET_WINDOW_FEEL)
printf("\t%s\n", "B_FLOATING_SUBSET_WINDOW_FEEL"); printf("\t%s\n", "B_FLOATING_SUBSET_WINDOW_FEEL");
+13 -13
View File
@@ -151,7 +151,7 @@ STRACE(("~Workspace(%ld) - say bye bye\n", fID));
*/ */
void Workspace::AddWinBorder(WinBorder *winBorder) void Workspace::AddWinBorder(WinBorder *winBorder)
{ {
STRACE(("W(%ld)::AddWinBorder(%s)\n", fID, winBorder?winBorder->GetName():"NULL")); STRACE(("W(%ld)::AddWinBorder(%s)\n", fID, winBorder?winBorder->Name():"NULL"));
if (winBorder->Level() == B_FLOATING_APP) if (winBorder->Level() == B_FLOATING_APP)
{ {
// floating windows are automaticaly added when needed // floating windows are automaticaly added when needed
@@ -180,7 +180,7 @@ STRACE(("W(%ld)::AddWinBorder(%s)\n", fID, winBorder?winBorder->GetName():"NULL"
*/ */
void Workspace::RemoveWinBorder(WinBorder *winBorder) void Workspace::RemoveWinBorder(WinBorder *winBorder)
{ {
STRACE(("W(%ld)::RemoveWinBorder(%s)\n", fID, winBorder?winBorder->GetName():"NULL")); STRACE(("W(%ld)::RemoveWinBorder(%s)\n", fID, winBorder?winBorder->Name():"NULL"));
ListData *item = HasItem(winBorder); ListData *item = HasItem(winBorder);
if (item) if (item)
{ {
@@ -272,7 +272,7 @@ window will be shown in front.
*/ */
bool Workspace::MoveToFront(WinBorder *newFront, bool doNotDisturb) bool Workspace::MoveToFront(WinBorder *newFront, bool doNotDisturb)
{ {
STRACE(("\nWks(%ld)::MoveToFront ~%s~ \n", fID, newFront?newFront->GetName():"NULL")); STRACE(("\nWks(%ld)::MoveToFront ~%s~ \n", fID, newFront?newFront->Name():"NULL"));
if (!newFront) if (!newFront)
return false; return false;
@@ -313,7 +313,7 @@ B_NORMAL window in front of which they appear.
*/ */
bool Workspace::MoveToBack(WinBorder *newLast) bool Workspace::MoveToBack(WinBorder *newLast)
{ {
STRACE(("Wks(%ld)::MoveToBack(%s) \n", fID, newLast? newLast->GetName(): "NULL")); STRACE(("Wks(%ld)::MoveToBack(%s) \n", fID, newLast? newLast->Name(): "NULL"));
if (newLast->IsHidden()) if (newLast->IsHidden())
return false; return false;
@@ -478,7 +478,7 @@ chosen. Same goes for focus.
*/ */
bool Workspace::HideWinBorder(WinBorder *winBorder) bool Workspace::HideWinBorder(WinBorder *winBorder)
{ {
STRACE(("W(%ld)::HideWinBorder(%s) \n", fID, winBorder? winBorder->GetName(): "NULL")); STRACE(("W(%ld)::HideWinBorder(%s) \n", fID, winBorder? winBorder->Name(): "NULL"));
bool returnValue = false; bool returnValue = false;
int32 level = winBorder->Level(); int32 level = winBorder->Level();
bool changeFront = false; bool changeFront = false;
@@ -641,7 +641,7 @@ unless a modal windows steals both.
*/ */
bool Workspace::ShowWinBorder(WinBorder *winBorder, bool userBusy) bool Workspace::ShowWinBorder(WinBorder *winBorder, bool userBusy)
{ {
STRACE(("W(%ld)::ShowWinBorder(%s) \n", fID, winBorder? winBorder->GetName(): "NULL")); STRACE(("W(%ld)::ShowWinBorder(%s) \n", fID, winBorder? winBorder->Name(): "NULL"));
bool returnValue = false; bool returnValue = false;
int32 level = winBorder->Level(); int32 level = winBorder->Level();
if (level > B_SYSTEM_FIRST) if (level > B_SYSTEM_FIRST)
@@ -1151,7 +1151,7 @@ void Workspace::PutDefaultSettings(BMessage *msg, const uint8 &index)
// Just in case... // Just in case...
msg->RemoveName(fieldname); msg->RemoveName(fieldname);
msg->AddMessage(fieldname,&container); msg->AddMessage(fieldname, &container);
} }
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
@@ -1162,7 +1162,7 @@ void Workspace::PrintToStream() const
for (ListData *item = fTopItem; item != NULL; item = item->lowerItem) for (ListData *item = fTopItem; item != NULL; item = item->lowerItem)
{ {
WinBorder *wb = (WinBorder*)item->layerPtr; WinBorder *wb = (WinBorder*)item->layerPtr;
printf("\tName: %s\t%s", wb->GetName(), wb->IsHidden()?"Hidden\t": "Visible\t"); printf("\tName: %s\t%s", wb->Name(), wb->IsHidden()?"Hidden\t": "Visible\t");
if(wb->Feel() == B_FLOATING_SUBSET_WINDOW_FEEL) if(wb->Feel() == B_FLOATING_SUBSET_WINDOW_FEEL)
printf("\t%s\n", "B_FLOATING_SUBSET_WINDOW_FEEL"); printf("\t%s\n", "B_FLOATING_SUBSET_WINDOW_FEEL");
if(wb->Feel() == B_FLOATING_APP_WINDOW_FEEL) if(wb->Feel() == B_FLOATING_APP_WINDOW_FEEL)
@@ -1183,8 +1183,8 @@ void Workspace::PrintToStream() const
printf("\t%s\n", "B_SYSTEM_FIRST"); printf("\t%s\n", "B_SYSTEM_FIRST");
} }
printf("Focus Layer:\t%s\n", fFocusItem? fFocusItem->layerPtr->GetName(): "NULL"); printf("Focus Layer:\t%s\n", fFocusItem? fFocusItem->layerPtr->Name(): "NULL");
printf("Front Layer:\t%s\n\n", fFrontItem? fFrontItem->layerPtr->GetName(): "NULL"); printf("Front Layer:\t%s\n\n", fFrontItem? fFrontItem->layerPtr->Name(): "NULL");
} }
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
@@ -1194,9 +1194,9 @@ void Workspace::PrintItem(ListData *item) const
printf("ListData members:\n"); printf("ListData members:\n");
if(item) if(item)
{ {
printf("WinBorder:\t%s\n", item->layerPtr? item->layerPtr->GetName(): "NULL"); printf("WinBorder:\t%s\n", item->layerPtr? item->layerPtr->Name(): "NULL");
printf("UpperItem:\t%s\n", item->upperItem? item->upperItem->layerPtr->GetName(): "NULL"); printf("UpperItem:\t%s\n", item->upperItem? item->upperItem->layerPtr->Name(): "NULL");
printf("LowerItem:\t%s\n", item->lowerItem? item->lowerItem->layerPtr->GetName(): "NULL"); printf("LowerItem:\t%s\n", item->lowerItem? item->lowerItem->layerPtr->Name(): "NULL");
} }
else else
{ {