1 /* 2 * Copyright 2001-2020 Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus, superstippi@gmx.de 7 * DarkWyrm, bpmagic@columbus.rr.com 8 * Ryan Leavengood, leavengood@gmail.com 9 * Philippe Saint-Pierre, stpere@gmail.com 10 * John Scipione, jscipione@gmail.com 11 * Ingo Weinhold, ingo_weinhold@gmx.de 12 * Clemens Zeidler, haiku@clemens-zeidler.de 13 * Joseph Groover, looncraz@looncraz.net 14 * Tri-Edge AI 15 * Jacob Secunda, secundja@gmail.com 16 */ 17 #ifndef DEFAULT_DECORATOR_H 18 #define DEFAULT_DECORATOR_H 19 20 21 #include "TabDecorator.h" 22 23 24 class Desktop; 25 class ServerBitmap; 26 27 28 class DefaultDecorator: public TabDecorator { 29 public: 30 DefaultDecorator(DesktopSettings& settings, 31 BRect frame, Desktop* desktop); 32 virtual ~DefaultDecorator(); 33 34 virtual void GetComponentColors(Component component, 35 uint8 highlight, ComponentColors _colors, 36 Decorator::Tab* tab = NULL); 37 38 virtual void UpdateColors(DesktopSettings& settings); 39 40 protected: 41 virtual void _DrawFrame(BRect rect); 42 43 virtual void _DrawTab(Decorator::Tab* tab, BRect r); 44 virtual void _DrawTitle(Decorator::Tab* tab, BRect r); 45 virtual void _DrawClose(Decorator::Tab* tab, bool direct, 46 BRect rect); 47 virtual void _DrawZoom(Decorator::Tab* tab, bool direct, 48 BRect rect); 49 virtual void _DrawMinimize(Decorator::Tab* tab, bool direct, 50 BRect rect); 51 virtual void _DrawResizeKnob(BRect r, bool full, 52 const ComponentColors& color); 53 54 private: 55 void _DrawButtonBitmap(ServerBitmap* bitmap, 56 bool direct, BRect rect); 57 void _DrawBlendedRect(DrawingEngine *engine, 58 const BRect rect, bool down, 59 const ComponentColors& colors); 60 ServerBitmap* _GetBitmapForButton(Decorator::Tab* tab, 61 Component item, bool down, int32 width, 62 int32 height); 63 64 void _GetComponentColors(Component component, 65 ComponentColors _colors, 66 Decorator::Tab* tab = NULL); 67 }; 68 69 70 #endif // DEFAULT_DECORATOR_H 71