Files
haiku-beta6/src/servers/app/WinBorder.h
T

159 lines
4.4 KiB
C++
Raw Normal View History

2003-02-15 15:28:22 +00:00
//------------------------------------------------------------------------------
2004-09-20 22:50:02 +00:00
// Copyright (c) 2001-2002, Haiku, Inc.
2003-02-15 15:28:22 +00:00
//
// 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 <[email protected]>
// Adi Oanca <[email protected]>
2003-02-15 15:28:22 +00:00
// Description: Layer subclass which handles window management
//
//------------------------------------------------------------------------------
2003-02-14 01:53:53 +00:00
#ifndef _WINBORDER_H_
#define _WINBORDER_H_
#include <Rect.h>
#include <String.h>
#include "Layer.h"
2005-02-28 20:23:51 +00:00
#include "FMWList.h"
2005-03-10 21:34:04 +00:00
#include "Decorator.h"
2005-02-28 20:23:51 +00:00
// these are used by window manager to properly place window.
enum {
B_SYSTEM_LAST = -10L,
B_FLOATING_APP = 0L,
B_MODAL_APP = 1L,
B_NORMAL = 2L,
B_FLOATING_ALL = 3L,
B_MODAL_ALL = 4L,
B_SYSTEM_FIRST = 10L,
};
2003-02-14 01:53:53 +00:00
class ServerWindow;
class Decorator;
class DisplayDriver;
class Desktop;
2003-02-14 01:53:53 +00:00
class PointerEvent
{
public:
int32 code; //B_MOUSE_UP, B_MOUSE_DOWN, B_MOUSE_MOVED
//B_MOUSE_WHEEL_CHANGED
bigtime_t when;
BPoint where;
float wheel_delta_x;
float wheel_delta_y;
int32 modifiers;
int32 buttons; //B_PRIMARY_MOUSE_BUTTON, B_SECONDARY_MOUSE_BUTTON
//B_TERTIARY_MOUSE_BUTTON
int32 clicks;
};
2003-02-14 01:53:53 +00:00
class WinBorder : public Layer
{
public:
2005-04-16 13:30:49 +00:00
WinBorder( const BRect &r,
const char *name,
const uint32 wlook,
const uint32 wfeel,
const uint32 wflags,
const uint32 wwksindex,
ServerWindow *win,
DisplayDriver *driver);
virtual ~WinBorder(void);
2005-04-16 13:30:49 +00:00
virtual void Draw(const BRect &r);
2005-04-16 13:30:49 +00:00
virtual void MoveBy(float x, float y);
virtual void ResizeBy(float x, float y);
2005-04-16 13:30:49 +00:00
virtual void RebuildFullRegion(void);
2004-03-28 14:58:19 +00:00
2005-04-16 13:30:49 +00:00
void SetSizeLimits( float minwidth,
float maxwidth,
float minheight,
float maxheight);
2004-08-07 20:30:58 +00:00
2005-04-16 13:30:49 +00:00
click_type TellWhat(PointerEvent& evt) const;
void MouseDown(click_type action);
void MouseMoved(click_type action);
void MouseUp(click_type action);
2005-04-16 13:30:49 +00:00
void UpdateColors(void);
void UpdateDecorator(void);
void UpdateFont(void);
void UpdateScreen(void);
2005-04-16 13:30:49 +00:00
virtual bool HasClient(void) { return false; }
inline Decorator* GetDecorator(void) const { return fDecorator; }
2005-04-16 13:30:49 +00:00
inline int32 Look(void) const { return fLook; }
inline int32 Feel(void) const { return fFeel; }
2005-04-21 18:57:34 +00:00
inline int32 Level() const { return fLevel; }
2005-04-16 13:30:49 +00:00
inline uint32 WindowFlags(void) const { return fWindowFlags; }
inline uint32 Workspaces(void) const { return fWorkspaces; }
void HighlightDecorator(const bool &active);
2005-04-16 13:30:49 +00:00
bool HasPoint(const BPoint &pt) const;
inline void QuietlySetWorkspaces(uint32 wks) { fWorkspaces = wks; }
2005-04-21 18:57:34 +00:00
void QuietlySetFeel(int32 feel);
2005-04-16 13:30:49 +00:00
FMWList fFMWList;
2005-02-28 20:23:51 +00:00
2003-02-14 01:53:53 +00:00
protected:
2004-03-28 14:58:19 +00:00
friend class Layer;
friend class ServerWindow;
friend class RootLayer;
2004-03-28 14:58:19 +00:00
2005-04-16 13:30:49 +00:00
Decorator* fDecorator;
Layer* fTopLayer;
BRegion zUpdateReg;
BRegion yUpdateReg;
BRegion fUpdateReg;
2005-04-16 13:30:49 +00:00
int32 fMouseButtons;
int32 fKeyModifiers;
BPoint fLastMousePosition;
2005-04-16 13:30:49 +00:00
bool fIsClosing;
bool fIsMinimizing;
bool fIsZooming;
2005-04-16 13:30:49 +00:00
bool fInUpdate;
bool fRequestSent;
2005-04-16 13:30:49 +00:00
int32 fLook;
int32 fFeel;
2005-04-21 18:57:34 +00:00
int32 fLevel;
2005-04-16 13:30:49 +00:00
int32 fWindowFlags;
uint32 fWorkspaces;
2005-04-16 13:30:49 +00:00
float fMinWidth,
fMaxWidth;
float fMinHeight,
fMaxHeight;
2005-04-16 13:30:49 +00:00
int cnt; // for debugging
2003-02-14 01:53:53 +00:00
};
#endif