2005-11-03 20:03:36 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2001-2005, Haiku.
|
|
|
|
* 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 {
|
2005-06-08 18:35:25 +04:00
|
|
|
public:
|
2005-11-03 20:03:36 +03:00
|
|
|
DefaultDecorator(DesktopSettings& settings, BRect frame,
|
|
|
|
int32 look, int32 feel, int32 flags);
|
2005-06-08 18:35:25 +04:00
|
|
|
virtual ~DefaultDecorator();
|
2005-11-03 20:03:36 +03:00
|
|
|
|
2005-11-14 21:16:01 +03:00
|
|
|
virtual void SetTitle(const char* string, BRegion* updateRegion = NULL);
|
|
|
|
|
2005-06-08 18:35:25 +04:00
|
|
|
virtual void MoveBy(float x, float y);
|
|
|
|
virtual void MoveBy(BPoint pt);
|
|
|
|
virtual void ResizeBy(float x, float y);
|
|
|
|
virtual void ResizeBy(BPoint pt);
|
2004-05-16 23:17:34 +04:00
|
|
|
|
2005-06-08 18:35:25 +04:00
|
|
|
virtual void Draw(BRect r);
|
|
|
|
virtual void Draw();
|
2005-06-03 23:50:30 +04:00
|
|
|
|
2005-06-08 18:35:25 +04:00
|
|
|
virtual void GetSizeLimits(float* minWidth, float* minHeight,
|
|
|
|
float* maxWidth, float* maxHeight) const;
|
2005-06-03 23:50:30 +04:00
|
|
|
|
2005-06-08 18:35:25 +04:00
|
|
|
virtual void GetFootprint(BRegion *region);
|
2005-06-03 23:50:30 +04:00
|
|
|
|
2005-06-08 18:35:25 +04:00
|
|
|
virtual click_type Clicked(BPoint pt, int32 buttons,
|
|
|
|
int32 modifiers);
|
2004-03-28 19:03:15 +04:00
|
|
|
|
2003-02-13 05:13:55 +03:00
|
|
|
protected:
|
2005-06-08 18:35:25 +04:00
|
|
|
virtual void _DoLayout();
|
2005-06-03 23:50:30 +04:00
|
|
|
|
2005-06-08 18:35:25 +04:00
|
|
|
virtual void _DrawFrame(BRect r);
|
|
|
|
virtual void _DrawTab(BRect r);
|
2005-06-03 23:50:30 +04:00
|
|
|
|
2005-06-08 18:35:25 +04:00
|
|
|
virtual void _DrawClose(BRect r);
|
|
|
|
virtual void _DrawTitle(BRect r);
|
|
|
|
virtual void _DrawZoom(BRect r);
|
2005-06-03 23:50:30 +04:00
|
|
|
|
2005-06-08 18:35:25 +04:00
|
|
|
virtual void _SetFocus();
|
|
|
|
virtual void _SetColors();
|
2005-06-03 23:50:30 +04:00
|
|
|
|
|
|
|
private:
|
2005-06-08 18:35:25 +04:00
|
|
|
void _DrawBlendedRect(BRect r, bool down);
|
|
|
|
void _GetButtonSizeAndOffset(const BRect& tabRect,
|
|
|
|
float* offset, float*size) const;
|
|
|
|
void _LayoutTabItems(const BRect& tabRect);
|
|
|
|
|
|
|
|
RGBColor fButtonHighColor;
|
|
|
|
RGBColor fButtonLowColor;
|
|
|
|
RGBColor fTextColor;
|
|
|
|
RGBColor fTabColor;
|
|
|
|
|
|
|
|
RGBColor* fFrameColors;
|
2003-07-24 23:38:24 +04:00
|
|
|
|
2005-06-03 23:50:30 +04:00
|
|
|
// Individual rects for handling window frame
|
|
|
|
// rendering the proper way
|
2005-06-08 18:35:25 +04:00
|
|
|
BRect fRightBorder;
|
|
|
|
BRect fLeftBorder;
|
|
|
|
BRect fTopBorder;
|
|
|
|
BRect fBottomBorder;
|
2005-06-03 23:50:30 +04:00
|
|
|
|
2005-06-08 18:35:25 +04:00
|
|
|
int32 fBorderWidth;
|
2005-06-03 23:50:30 +04:00
|
|
|
|
2005-06-16 16:32:42 +04:00
|
|
|
uint32 fTabOffset;
|
2005-06-08 18:35:25 +04:00
|
|
|
float fTextOffset;
|
2003-02-13 05:13:55 +03:00
|
|
|
|
2005-06-08 18:35:25 +04:00
|
|
|
float fMinTabWidth;
|
|
|
|
float fMaxTabWidth;
|
|
|
|
BString fTruncatedTitle;
|
|
|
|
int32 fTruncatedTitleLength;
|
2003-02-13 05:13:55 +03:00
|
|
|
};
|
|
|
|
|
2005-11-03 20:03:36 +03:00
|
|
|
#endif /* DEFAULT_DECORATOR_H */
|