2005-11-03 20:03:36 +03:00
|
|
|
/*
|
2006-03-07 18:23:35 +03:00
|
|
|
* Copyright 2001-2006, Haiku.
|
2005-11-03 20:03:36 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* DarkWyrm <bpmagic@columbus.rr.com>
|
|
|
|
* Stephan Aßmus <superstippi@gmx.de>
|
|
|
|
*/
|
|
|
|
#ifndef DEFAULT_DECORATOR_H
|
|
|
|
#define DEFAULT_DECORATOR_H
|
|
|
|
|
2003-02-13 05:13:55 +03:00
|
|
|
|
|
|
|
#include "Decorator.h"
|
|
|
|
#include <Region.h>
|
|
|
|
|
2005-11-03 20:03:36 +03:00
|
|
|
class Desktop;
|
|
|
|
|
|
|
|
|
2005-06-03 23:50:30 +04:00
|
|
|
class DefaultDecorator: public Decorator {
|
2006-05-25 16:01:28 +04:00
|
|
|
public:
|
|
|
|
DefaultDecorator(DesktopSettings& settings,
|
2007-08-17 16:56:20 +04:00
|
|
|
BRect frame, window_look look,
|
|
|
|
uint32 flags);
|
2006-05-25 16:01:28 +04:00
|
|
|
virtual ~DefaultDecorator();
|
|
|
|
|
|
|
|
virtual void SetTitle(const char* string,
|
2007-08-17 16:56:20 +04:00
|
|
|
BRegion* updateRegion = NULL);
|
2006-05-25 16:01:28 +04:00
|
|
|
virtual void SetLook(DesktopSettings& settings,
|
2007-08-17 16:56:20 +04:00
|
|
|
window_look look,
|
|
|
|
BRegion* updateRegion = NULL);
|
2006-05-25 16:01:28 +04:00
|
|
|
virtual void SetFlags(uint32 flags,
|
2007-08-17 16:56:20 +04:00
|
|
|
BRegion* updateRegion = NULL);
|
2006-05-25 16:01:28 +04:00
|
|
|
|
|
|
|
virtual void MoveBy(BPoint offset);
|
|
|
|
virtual void ResizeBy(BPoint offset, BRegion* dirty);
|
|
|
|
|
|
|
|
virtual bool SetTabLocation(float location,
|
2007-08-17 16:56:20 +04:00
|
|
|
BRegion* updateRegion = NULL);
|
2006-05-25 16:01:28 +04:00
|
|
|
virtual float TabLocation() const
|
|
|
|
{ return (float)fTabOffset; }
|
|
|
|
|
|
|
|
virtual bool SetSettings(const BMessage& settings,
|
2007-08-17 16:56:20 +04:00
|
|
|
BRegion* updateRegion = NULL);
|
2006-05-25 16:01:28 +04:00
|
|
|
virtual bool GetSettings(BMessage* settings) const;
|
|
|
|
|
|
|
|
virtual void Draw(BRect updateRect);
|
|
|
|
virtual void Draw();
|
|
|
|
|
2007-08-17 16:56:20 +04:00
|
|
|
virtual void GetSizeLimits(int32* minWidth, int32* minHeight,
|
|
|
|
int32* maxWidth, int32* maxHeight) const;
|
2006-05-25 16:01:28 +04:00
|
|
|
|
|
|
|
virtual void GetFootprint(BRegion* region);
|
|
|
|
|
|
|
|
virtual click_type Clicked(BPoint pt, int32 buttons,
|
2007-08-17 16:56:20 +04:00
|
|
|
int32 modifiers);
|
2006-05-25 16:01:28 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void _DoLayout();
|
|
|
|
|
|
|
|
virtual void _DrawFrame(BRect r);
|
|
|
|
virtual void _DrawTab(BRect r);
|
|
|
|
|
|
|
|
virtual void _DrawClose(BRect r);
|
|
|
|
virtual void _DrawTitle(BRect r);
|
|
|
|
virtual void _DrawZoom(BRect r);
|
|
|
|
|
|
|
|
virtual void _SetFocus();
|
|
|
|
virtual void _SetColors();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void _DrawBlendedRect(BRect r, bool down);
|
|
|
|
void _GetButtonSizeAndOffset(const BRect& tabRect,
|
2007-08-17 16:56:20 +04:00
|
|
|
float* offset, float* size,
|
|
|
|
float* inset) const;
|
2006-05-25 16:01:28 +04:00
|
|
|
void _LayoutTabItems(const BRect& tabRect);
|
|
|
|
|
2007-08-17 16:56:20 +04:00
|
|
|
rgb_color fButtonHighColor;
|
|
|
|
rgb_color fButtonLowColor;
|
|
|
|
rgb_color fTextColor;
|
|
|
|
rgb_color fTabColor;
|
|
|
|
rgb_color fTabColorLight;
|
|
|
|
rgb_color fTabColorShadow;
|
2007-08-04 15:18:21 +04:00
|
|
|
|
2007-08-17 16:56:20 +04:00
|
|
|
rgb_color fFrameColors[6];
|
2006-05-25 16:01:28 +04:00
|
|
|
|
|
|
|
// Individual rects for handling window frame
|
|
|
|
// rendering the proper way
|
|
|
|
BRect fRightBorder;
|
|
|
|
BRect fLeftBorder;
|
|
|
|
BRect fTopBorder;
|
|
|
|
BRect fBottomBorder;
|
|
|
|
|
|
|
|
int32 fBorderWidth;
|
|
|
|
|
|
|
|
uint32 fTabOffset;
|
2006-05-27 01:26:35 +04:00
|
|
|
float fTabLocation;
|
2006-05-25 16:01:28 +04:00
|
|
|
float fTextOffset;
|
|
|
|
|
|
|
|
float fMinTabSize;
|
|
|
|
float fMaxTabSize;
|
|
|
|
BString fTruncatedTitle;
|
|
|
|
int32 fTruncatedTitleLength;
|
|
|
|
|
|
|
|
bigtime_t fLastClicked;
|
|
|
|
bool fWasDoubleClick;
|
2003-02-13 05:13:55 +03:00
|
|
|
};
|
|
|
|
|
2006-05-25 16:01:28 +04:00
|
|
|
#endif // DEFAULT_DECORATOR_H
|