Some of the recent improvements Adi made were inadvertantly removed by the BPortLink patch
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8534 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -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 <[email protected]>
|
||||||
|
// Adi Oanca <[email protected]>
|
||||||
|
// Description: Class used for rendering to the frame buffer. One layer per
|
||||||
|
// view on screen and also for window decorators
|
||||||
|
//
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
#ifndef _LAYER_H_
|
#ifndef _LAYER_H_
|
||||||
#define _LAYER_H_
|
#define _LAYER_H_
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ WinBorder::WinBorder(const BRect &r, const char *name, const int32 look, const i
|
|||||||
|
|
||||||
fMouseButtons = 0;
|
fMouseButtons = 0;
|
||||||
fKeyModifiers = 0;
|
fKeyModifiers = 0;
|
||||||
|
fServerHidden = false;
|
||||||
fMainWinBorder = NULL;
|
fMainWinBorder = NULL;
|
||||||
fDecorator = NULL;
|
fDecorator = NULL;
|
||||||
fTopLayer = NULL;
|
fTopLayer = NULL;
|
||||||
@@ -324,7 +325,7 @@ void WinBorder::HighlightDecorator(const bool &active)
|
|||||||
void WinBorder::Draw(const BRect &r)
|
void WinBorder::Draw(const BRect &r)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_WINBORDER
|
#ifdef DEBUG_WINBORDER
|
||||||
printf("WinBorder(%s)::Draw() : ", GetName()));
|
printf("WinBorder(%s)::Draw() : ", GetName());
|
||||||
r.PrintToStream();
|
r.PrintToStream();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -376,7 +377,22 @@ void WinBorder::ResizeBy(float x, float y)
|
|||||||
Layer::ResizeBy(x,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);
|
return fFullVisible.Contains(pt);
|
||||||
}
|
}
|
||||||
@@ -445,7 +461,7 @@ void WinBorder::AddToSubsetOf(WinBorder* main)
|
|||||||
{
|
{
|
||||||
// if the main window is hidden also hide this one.
|
// if the main window is hidden also hide this one.
|
||||||
if(main->IsHidden())
|
if(main->IsHidden())
|
||||||
fHidden = true;
|
Hide();//fHidden = true;
|
||||||
|
|
||||||
// add to main window's subset
|
// add to main window's subset
|
||||||
main->Window()->fWinFMWList.AddItem(this);
|
main->Window()->fWinFMWList.AddItem(this);
|
||||||
@@ -553,7 +569,7 @@ void WinBorder::PrintToStream()
|
|||||||
if (fLevel == B_NORMAL_FEEL)
|
if (fLevel == B_NORMAL_FEEL)
|
||||||
printf("\t%s", "B_NORMAL_WINDOW_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)
|
void WinBorder::UpdateColors(void)
|
||||||
|
|||||||
@@ -66,6 +66,10 @@ public:
|
|||||||
|
|
||||||
virtual void RebuildFullRegion(void);
|
virtual void RebuildFullRegion(void);
|
||||||
|
|
||||||
|
virtual bool IsHidden() const;
|
||||||
|
void ServerHide();
|
||||||
|
void ServerUnhide();
|
||||||
|
|
||||||
void MouseDown(PointerEvent& evt, bool sendMessage);
|
void MouseDown(PointerEvent& evt, bool sendMessage);
|
||||||
void MouseMoved(PointerEvent& evt);
|
void MouseMoved(PointerEvent& evt);
|
||||||
void MouseUp(PointerEvent& evt);
|
void MouseUp(PointerEvent& evt);
|
||||||
@@ -81,7 +85,7 @@ public:
|
|||||||
void SetLevel();
|
void SetLevel();
|
||||||
void HighlightDecorator(const bool &active);
|
void HighlightDecorator(const bool &active);
|
||||||
|
|
||||||
bool HasPoint(BPoint pt) const;
|
bool HasPoint(const BPoint &pt) const;
|
||||||
|
|
||||||
void AddToSubsetOf(WinBorder* main);
|
void AddToSubsetOf(WinBorder* main);
|
||||||
void RemoveFromSubsetOf(WinBorder* main);
|
void RemoveFromSubsetOf(WinBorder* main);
|
||||||
@@ -103,6 +107,7 @@ protected:
|
|||||||
int32 fKeyModifiers;
|
int32 fKeyModifiers;
|
||||||
BPoint fLastMousePosition;
|
BPoint fLastMousePosition;
|
||||||
|
|
||||||
|
bool fServerHidden;
|
||||||
WinBorder *fMainWinBorder;
|
WinBorder *fMainWinBorder;
|
||||||
bool fIsMoving;
|
bool fIsMoving;
|
||||||
bool fIsResizing;
|
bool fIsResizing;
|
||||||
|
|||||||
Reference in New Issue
Block a user