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