diff --git a/src/servers/app/server/Layer.h b/src/servers/app/server/Layer.h index 82b08a654e..c6287b5d67 100644 --- a/src/servers/app/server/Layer.h +++ b/src/servers/app/server/Layer.h @@ -1,3 +1,31 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2002, OpenBeOS +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// File Name: Layer.h +// Author: DarkWyrm +// Adi Oanca +// Description: Class used for rendering to the frame buffer. One layer per +// view on screen and also for window decorators +// +//------------------------------------------------------------------------------ #ifndef _LAYER_H_ #define _LAYER_H_ diff --git a/src/servers/app/server/WinBorder.cpp b/src/servers/app/server/WinBorder.cpp index 26297306c8..678bd64f06 100644 --- a/src/servers/app/server/WinBorder.cpp +++ b/src/servers/app/server/WinBorder.cpp @@ -90,6 +90,7 @@ WinBorder::WinBorder(const BRect &r, const char *name, const int32 look, const i fMouseButtons = 0; fKeyModifiers = 0; + fServerHidden = false; fMainWinBorder = NULL; fDecorator = NULL; fTopLayer = NULL; @@ -324,7 +325,7 @@ void WinBorder::HighlightDecorator(const bool &active) void WinBorder::Draw(const BRect &r) { #ifdef DEBUG_WINBORDER - printf("WinBorder(%s)::Draw() : ", GetName())); + printf("WinBorder(%s)::Draw() : ", GetName()); r.PrintToStream(); #endif @@ -376,7 +377,22 @@ void WinBorder::ResizeBy(float x, float y) Layer::ResizeBy(x,y); } -bool WinBorder::HasPoint(BPoint pt) const +bool WinBorder::IsHidden() const{ + if (fServerHidden) + return true; + + return Layer::IsHidden(); +} + +void WinBorder::ServerHide(){ + fServerHidden = true; +} + +void WinBorder::ServerUnhide(){ + fServerHidden = false; +} + +bool WinBorder::HasPoint(const BPoint& pt) const { return fFullVisible.Contains(pt); } @@ -445,7 +461,7 @@ void WinBorder::AddToSubsetOf(WinBorder* main) { // if the main window is hidden also hide this one. if(main->IsHidden()) - fHidden = true; + Hide();//fHidden = true; // add to main window's subset main->Window()->fWinFMWList.AddItem(this); @@ -553,7 +569,7 @@ void WinBorder::PrintToStream() if (fLevel == B_NORMAL_FEEL) printf("\t%s", "B_NORMAL_WINDOW_FEEL"); - printf("\t%s\n", fHidden?"hidden" : "not hidden"); + printf("\t%s\n", IsHidden() ? "hidden" : "not hidden"); } void WinBorder::UpdateColors(void) diff --git a/src/servers/app/server/WinBorder.h b/src/servers/app/server/WinBorder.h index cc064a9625..691412f202 100644 --- a/src/servers/app/server/WinBorder.h +++ b/src/servers/app/server/WinBorder.h @@ -66,6 +66,10 @@ public: virtual void RebuildFullRegion(void); + virtual bool IsHidden() const; + void ServerHide(); + void ServerUnhide(); + void MouseDown(PointerEvent& evt, bool sendMessage); void MouseMoved(PointerEvent& evt); void MouseUp(PointerEvent& evt); @@ -81,7 +85,7 @@ public: void SetLevel(); void HighlightDecorator(const bool &active); - bool HasPoint(BPoint pt) const; + bool HasPoint(const BPoint &pt) const; void AddToSubsetOf(WinBorder* main); void RemoveFromSubsetOf(WinBorder* main); @@ -103,6 +107,7 @@ protected: int32 fKeyModifiers; BPoint fLastMousePosition; + bool fServerHidden; WinBorder *fMainWinBorder; bool fIsMoving; bool fIsResizing;