Damn vi. I'll use nano next time. Sorry about my previous blank message.

Trying to make windows visible again. :-)) Made decorator until now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8033 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca
2004-06-17 14:39:21 +00:00
parent b9a86cb503
commit 0573400f8a
3 changed files with 35 additions and 38 deletions
+5 -22
View File
@@ -135,8 +135,10 @@ void Layer::AddChild(Layer *layer, ServerWindow *serverWin)
// if no RootLayer, there is no need to set any parameters. // 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 // they will be set when the root Layer for this tree will be added
// to the main tree structure. // to the main tree structure.
if (fRootLayer == NULL) if (fRootLayer == NULL){
STRACE(("Layer(%s)::AddChild(%s) END\n", GetName(), layer->GetName()));
return; return;
}
// 2) set some fields for this new layer and its children. // 2) set some fields for this new layer and its children.
Layer *c = layer; //c = short for: current Layer *c = layer; //c = short for: current
@@ -415,7 +417,7 @@ void Layer::Redraw(const BRegion& reg, Layer *startFrom)
if (pReg->CountRects() > 0) if (pReg->CountRects() > 0)
RequestDraw(reg, startFrom); RequestDraw(reg, startFrom);
STRACE(("Layer::Redraw ENDED\n")); STRACE(("Layer(%s)::Redraw() ENDED\n", GetName()));
} }
void Layer::RequestDraw(const BRegion &reg, Layer *startFrom) void Layer::RequestDraw(const BRegion &reg, Layer *startFrom)
@@ -433,33 +435,14 @@ void Layer::RequestDraw(const BRegion &reg, Layer *startFrom)
fUpdateReg.IntersectWith(&reg); fUpdateReg.IntersectWith(&reg);
if (fUpdateReg.CountRects() > 0){ if (fUpdateReg.CountRects() > 0){
if (fServerWin){
// clear background, *only IF* our view color is different to B_TRANSPARENT_COLOR!
// TODO: DO That!
// TODO: UNcomment!!!
// TODO !!! UPDATE code !!!
/*
BMessage msg;
msg.what = _UPDATE_;
msg.AddInt32("_token", fViewToken);
msg.AddRect("_rect", ConvertFromTop(reg.Frame()) );
// for test purposes only!
msg.AddRect("_rect2", reg.Frame());
fServerWin->SendMessageToClient( &msg );
*/
}
else{
// NOTE: do not clear background for internal server layers!
fDriver->ConstrainClippingRegion(&fUpdateReg); fDriver->ConstrainClippingRegion(&fUpdateReg);
Draw(fUpdateReg.Frame()); Draw(fUpdateReg.Frame());
fDriver->ConstrainClippingRegion(NULL); fDriver->ConstrainClippingRegion(NULL);
// TODO: (WARNING!): For the Update code is MUST not be emptied!!!
fUpdateReg.MakeEmpty(); fUpdateReg.MakeEmpty();
} }
} }
}
for (Layer *lay = VirtualBottomChild(); lay != NULL; lay = VirtualUpperSibling()) for (Layer *lay = VirtualBottomChild(); lay != NULL; lay = VirtualUpperSibling())
{ {
+9 -5
View File
@@ -277,7 +277,7 @@ void ServerWindow::Show(void)
if(!fWinBorder->IsHidden()) if(!fWinBorder->IsHidden())
return; return;
STRACE(("ServerWindow %s: Show\n",fTitle.String())); STRACE(("ServerWindow (%s): Show()\n",fTitle.String()));
if(fWinBorder) if(fWinBorder)
{ {
RootLayer *rl = fWinBorder->GetRootLayer(); RootLayer *rl = fWinBorder->GetRootLayer();
@@ -289,8 +289,8 @@ void ServerWindow::Show(void)
rl->fMainLock.Lock(); rl->fMainLock.Lock();
STRACE(("ServerWindow(%s)::Show() - Main lock acquired\n", fWinBorder->GetName())); STRACE(("ServerWindow(%s)::Show() - Main lock acquired\n", fWinBorder->GetName()));
// manually set fWinBorder->fHidden to false because Layer's version also calls FullInvalidate. // TODO: 'false' couldn't this be made otherwise???
fWinBorder->fHidden=false; fWinBorder->Show(false);
if ( (fFeel == B_FLOATING_SUBSET_WINDOW_FEEL || fFeel == B_MODAL_SUBSET_WINDOW_FEEL) if ( (fFeel == B_FLOATING_SUBSET_WINDOW_FEEL || fFeel == B_MODAL_SUBSET_WINDOW_FEEL)
&& fWinBorder->MainWinBorder() == NULL) && fWinBorder->MainWinBorder() == NULL)
@@ -319,6 +319,10 @@ void ServerWindow::Show(void)
desktop->fGeneralLock.Unlock(); desktop->fGeneralLock.Unlock();
STRACE(("ServerWindow(%s)::Show() - General lock released\n", fWinBorder->GetName())); STRACE(("ServerWindow(%s)::Show() - General lock released\n", fWinBorder->GetName()));
} }
else
{
debugger("WARNING: NULL fWinBorder\n");
}
} }
//! Hides the window's WinBorder //! Hides the window's WinBorder
@@ -1511,13 +1515,13 @@ void ServerWindow::DispatchMessage(int32 code)
} }
case AS_SHOW_WINDOW: case AS_SHOW_WINDOW:
{ {
STRACE(("ServerWindow %s: Message AS_SHOW\n",fTitle.String())); STRACE(("ServerWindow %s: Message AS_SHOW_WINDOW\n",fTitle.String()));
Show(); Show();
break; break;
} }
case AS_HIDE_WINDOW: case AS_HIDE_WINDOW:
{ {
STRACE(("ServerWindow %s: Message AS_HIDE\n",fTitle.String())); STRACE(("ServerWindow %s: Message AS_HIDE_WINDOW\n",fTitle.String()));
Hide(); Hide();
break; break;
} }
+16 -6
View File
@@ -46,7 +46,7 @@
// TODO: Document this file completely // TODO: Document this file completely
// Toggle general function call output // Toggle general function call output
//#define DEBUG_WINBORDER #define DEBUG_WINBORDER
// toggle // toggle
//#define DEBUG_WINBORDER_MOUSE //#define DEBUG_WINBORDER_MOUSE
@@ -344,9 +344,6 @@ void WinBorder::Draw(const BRect &r)
// if we have a visible region, it is decorator's one. // if we have a visible region, it is decorator's one.
if(fDecorator) if(fDecorator)
{ {
fUpdateReg = fVisible;
// restrict Decorator drawing to the update region only.
fDriver->ConstrainClippingRegion(&fUpdateReg);
/* /*
fUpdateReg.PrintToStream(); fUpdateReg.PrintToStream();
RGBColor c(128, 56, 98); RGBColor c(128, 56, 98);
@@ -355,9 +352,22 @@ void WinBorder::Draw(const BRect &r)
snooze(1000000); snooze(1000000);
*/ */
fDecorator->Draw(fUpdateReg.Frame()); fDecorator->Draw(fUpdateReg.Frame());
// remove the additional clipping region.
fDriver->ConstrainClippingRegion(NULL);
} }
// clear background, *only IF* our view color is different to B_TRANSPARENT_COLOR!
// TODO: DO That!
// TODO: UNcomment!!!
// TODO !!! UPDATE code !!!
/*
BMessage msg;
msg.what = _UPDATE_;
msg.AddInt32("_token", fViewToken);
msg.AddRect("_rect", ConvertFromTop(reg.Frame()) );
// for test purposes only!
msg.AddRect("_rect2", reg.Frame());
fServerWin->SendMessageToClient( &msg );
*/
} }
void WinBorder::MoveBy(float x, float y) void WinBorder::MoveBy(float x, float y)