1/*
2 * Copyright 2009-2010, Haiku.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _MAC_DECORATOR_H_
6#define _MAC_DECORATOR_H_
7
8
9#include "DecorManager.h"
10#include "RGBColor.h"
11
12
13class MacDecorAddOn : public DecorAddOn {
14public:
15								MacDecorAddOn(image_id id, const char* name);
16
17protected:
18	virtual Decorator*			_AllocateDecorator(DesktopSettings& settings,
19									BRect rect);
20};
21
22
23class MacDecorator: public Decorator {
24public:
25								MacDecorator(DesktopSettings& settings,
26									BRect frame);
27	virtual						~MacDecorator();
28
29			void				Draw(BRect updateRect);
30			void				Draw();
31
32	virtual	Region				RegionAt(BPoint where, int32& tab) const;
33
34protected:
35			void				_DoLayout();
36
37			void				_DrawFrame(BRect r);
38			void				_DrawTab(BRect r);
39
40			void				_DrawClose(BRect r);
41			void				_DrawTitle(BRect r);
42			void				_DrawZoom(BRect r);
43			void				_DrawMinimize(BRect r);
44
45			void				_SetTitle(Tab* tab, const char* string,
46									BRegion* updateRegion = NULL);
47
48			void				_FontsChanged(DesktopSettings& settings,
49									BRegion* updateRegion);
50			void				_SetLook(DesktopSettings& settings,
51									window_look look,
52									BRegion* updateRegion = NULL);
53			void				_SetFlags(uint32 flags,
54									BRegion* updateRegion = NULL);
55
56			void				_MoveBy(BPoint offset);
57			void				_ResizeBy(BPoint offset, BRegion* dirty);
58
59			void				_GetFootprint(BRegion *region);
60
61			// TODO
62			Tab*				_AllocateNewTab();
63			bool				_AddTab(DesktopSettings&, long int, BRegion*);
64			bool				_RemoveTab(long int, BRegion*);
65			bool				_MoveTab(long int, long int, bool, BRegion*);
66private:
67			void				_UpdateFont(DesktopSettings& settings);
68			void				_DrawBlendedRect(DrawingEngine* engine,
69									BRect r, bool down);
70
71			rgb_color			fButtonHighColor;
72			rgb_color			fButtonLowColor;
73			rgb_color			frame_highcol;
74			rgb_color			frame_midcol;
75			rgb_color			frame_lowcol;
76			rgb_color			frame_lowercol;
77			rgb_color			fFocusTextColor;
78			rgb_color			fNonFocusTextColor;
79
80			uint64 solidhigh, solidlow;
81
82			BString				fTruncatedTitle;
83			int32				fTruncatedTitleLength;
84
85			int32 				fBorderWidth;
86
87			bool slidetab;
88			int textoffset;
89			float titlepixelwidth;
90};
91
92#endif
93