1 /* 2 * Copyright 2001-2013 Haiku, Inc. All rights reserved. 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 * John Scipione, jscipione@gmail.com 9 * Clemens Zeidler, haiku@clemens-zeidler.de 10 */ 11 #ifndef BE_DECORATOR_H 12 #define BE_DECORATOR_H 13 14 15 #include "DecorManager.h" 16 #include "SATDecorator.h" 17 18 19 class Desktop; 20 class ServerBitmap; 21 22 23 class BeDecorAddOn : public DecorAddOn { 24 public: 25 BeDecorAddOn(image_id id, const char* name); 26 27 protected: 28 virtual Decorator* _AllocateDecorator(DesktopSettings& settings, 29 BRect rect, Desktop* desktop); 30 }; 31 32 33 class BeDecorator: public SATDecorator { 34 public: 35 BeDecorator(DesktopSettings& settings, 36 BRect frame, Desktop* desktop); 37 virtual ~BeDecorator(); 38 39 virtual void GetComponentColors(Component component, 40 uint8 highlight, ComponentColors _colors, 41 Decorator::Tab* tab = NULL); 42 43 protected: 44 virtual void _DrawFrame(BRect rect); 45 46 virtual void _DrawTab(Decorator::Tab* tab, BRect rect); 47 virtual void _DrawTitle(Decorator::Tab* tab, BRect rect); 48 virtual void _DrawClose(Decorator::Tab* tab, bool direct, 49 BRect rect); 50 virtual void _DrawZoom(Decorator::Tab* tab, bool direct, 51 BRect rect); 52 virtual void _DrawMinimize(Decorator::Tab* tab, bool direct, 53 BRect rect); 54 55 virtual void _GetButtonSizeAndOffset(const BRect& tabRect, 56 float* offset, float* size, 57 float* inset) const; 58 59 private: 60 void _DrawBevelRect(DrawingEngine* engine, 61 const BRect rect, bool down, 62 rgb_color light, rgb_color shadow); 63 void _DrawBlendedRect(DrawingEngine* engine, 64 const BRect rect, bool down, 65 rgb_color colorA, rgb_color colorB, 66 rgb_color colorC, rgb_color colorD); 67 void _DrawButtonBitmap(ServerBitmap* bitmap, 68 bool direct, BRect rect); 69 ServerBitmap* _GetBitmapForButton(Decorator::Tab* tab, 70 Component item, bool down, int32 width, 71 int32 height); 72 ServerBitmap* _CreateTemporaryBitmap(BRect bounds) const; 73 void _GetComponentColors(Component component, 74 ComponentColors _colors, 75 Decorator::Tab* tab = NULL); 76 77 private: 78 status_t fCStatus; 79 80 ServerBitmap* fCloseBitmap; 81 ServerBitmap* fBigZoomBitmap; 82 ServerBitmap* fSmallZoomBitmap; 83 ServerBitmap* fGlintBitmap; 84 }; 85 86 87 #endif // BE_DECORATOR_H 88