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