2003-02-15 18:28:22 +03:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// 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: WinBorder.h
|
|
|
|
// Author: DarkWyrm <bpmagic@columbus.rr.com>
|
2004-02-24 14:56:03 +03:00
|
|
|
// Adi Oanca <adioanca@mymail.ro>
|
2003-02-15 18:28:22 +03:00
|
|
|
// Description: Layer subclass which handles window management
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------
|
2003-02-14 04:53:53 +03:00
|
|
|
#ifndef _WINBORDER_H_
|
|
|
|
#define _WINBORDER_H_
|
|
|
|
|
|
|
|
#include <Rect.h>
|
|
|
|
#include <String.h>
|
|
|
|
#include "Layer.h"
|
|
|
|
|
|
|
|
class ServerWindow;
|
|
|
|
class Decorator;
|
|
|
|
class DisplayDriver;
|
2004-06-11 06:46:48 +04:00
|
|
|
class PortMessage;
|
2004-06-21 00:02:32 +04:00
|
|
|
class Desktop;
|
2003-02-14 04:53:53 +03:00
|
|
|
|
|
|
|
class WinBorder : public Layer
|
|
|
|
{
|
|
|
|
public:
|
2004-06-11 06:46:48 +04:00
|
|
|
WinBorder(const BRect &r, const char *name, const int32 look,const int32 feel,
|
|
|
|
const int32 flags, ServerWindow *win, DisplayDriver *driver);
|
|
|
|
virtual ~WinBorder(void);
|
2004-01-21 05:58:39 +03:00
|
|
|
|
2004-06-11 06:46:48 +04:00
|
|
|
virtual void Draw(const BRect &r);
|
2004-01-21 05:58:39 +03:00
|
|
|
|
2004-06-11 06:46:48 +04:00
|
|
|
virtual void MoveBy(float x, float y);
|
|
|
|
virtual void ResizeBy(float x, float y);
|
2004-02-24 14:56:03 +03:00
|
|
|
|
2004-06-11 06:46:48 +04:00
|
|
|
virtual void RebuildFullRegion(void);
|
2004-03-28 18:58:19 +04:00
|
|
|
|
2004-06-21 00:02:32 +04:00
|
|
|
void MouseDown(PortMessage *msg, bool sendMessage);
|
2004-06-11 06:46:48 +04:00
|
|
|
void MouseMoved(PortMessage *msg);
|
|
|
|
void MouseUp(PortMessage *msg);
|
2004-01-21 05:58:39 +03:00
|
|
|
|
2004-06-11 06:46:48 +04:00
|
|
|
void UpdateColors(void);
|
|
|
|
void UpdateDecorator(void);
|
|
|
|
void UpdateFont(void);
|
|
|
|
void UpdateScreen(void);
|
2004-01-21 05:58:39 +03:00
|
|
|
|
2004-06-11 06:46:48 +04:00
|
|
|
Decorator *GetDecorator(void) const { return fDecorator; }
|
|
|
|
WinBorder *MainWinBorder() const;
|
|
|
|
|
|
|
|
void SetLevel();
|
|
|
|
void HighlightDecorator(const bool &active);
|
|
|
|
|
2004-07-10 14:54:20 +04:00
|
|
|
bool HasPoint(const BPoint &pt) const;
|
2004-01-21 05:58:39 +03:00
|
|
|
|
2004-06-11 06:46:48 +04:00
|
|
|
void AddToSubsetOf(WinBorder* main);
|
|
|
|
void RemoveFromSubsetOf(WinBorder* main);
|
2004-01-21 05:58:39 +03:00
|
|
|
|
2004-06-11 06:46:48 +04:00
|
|
|
void PrintToStream();
|
2004-01-21 05:58:39 +03:00
|
|
|
|
|
|
|
// Server "private" :-) - should not be used
|
2004-06-11 06:46:48 +04:00
|
|
|
void SetMainWinBorder(WinBorder *newMain);
|
2004-02-24 14:56:03 +03:00
|
|
|
|
2003-02-14 04:53:53 +03:00
|
|
|
protected:
|
2004-03-28 18:58:19 +04:00
|
|
|
friend class Layer;
|
|
|
|
friend class ServerWindow;
|
2004-06-21 00:02:32 +04:00
|
|
|
friend class Desktop;
|
2004-03-28 18:58:19 +04:00
|
|
|
|
2004-06-11 06:46:48 +04:00
|
|
|
Decorator *fDecorator;
|
2004-06-21 00:02:32 +04:00
|
|
|
Layer *fTopLayer;
|
|
|
|
|
2004-06-11 06:46:48 +04:00
|
|
|
int32 fMouseButtons;
|
|
|
|
int32 fKeyModifiers;
|
|
|
|
BPoint fLastMousePosition;
|
2004-01-21 05:58:39 +03:00
|
|
|
|
2004-06-11 06:46:48 +04:00
|
|
|
WinBorder *fMainWinBorder;
|
|
|
|
bool fIsMoving;
|
|
|
|
bool fIsResizing;
|
|
|
|
bool fIsClosing;
|
|
|
|
bool fIsMinimizing;
|
|
|
|
bool fIsZooming;
|
2003-02-14 04:53:53 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|