* Coding style cleanup.

* Made inline getters in SATDecorator const.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39626 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-11-25 14:42:28 +00:00
parent e29729e2a5
commit 638d9c8039
2 changed files with 39 additions and 32 deletions
@@ -6,6 +6,7 @@
* Clemens Zeidler <[email protected]> * Clemens Zeidler <[email protected]>
*/ */
#include "SATDecorator.h" #include "SATDecorator.h"
#include <new> #include <new>
@@ -468,7 +469,7 @@ SATDecorator::_DrawTab(BRect invalid)
// Draw the buttons if we're supposed to // Draw the buttons if we're supposed to
if (!(fFlags & B_NOT_CLOSABLE) && invalid.Intersects(fCloseRect)) if (!(fFlags & B_NOT_CLOSABLE) && invalid.Intersects(fCloseRect))
_DrawClose(fCloseRect); _DrawClose(fCloseRect);
if (fStackedMode) { if (fStackedMode) {
if (fStackedDrawZoom && invalid.Intersects(fZoomRect)) if (fStackedDrawZoom && invalid.Intersects(fZoomRect))
_DrawZoom(fZoomRect); _DrawZoom(fZoomRect);
@@ -541,4 +542,3 @@ extern "C" DecorAddOn* (instantiate_decor_addon)(image_id id, const char* name)
{ {
return new (std::nothrow)SATDecorAddOn(id, name); return new (std::nothrow)SATDecorAddOn(id, name);
} }
@@ -19,55 +19,62 @@ public:
SATDecorAddOn(image_id id, const char* name); SATDecorAddOn(image_id id, const char* name);
virtual status_t InitCheck() const; virtual status_t InitCheck() const;
float Version(); float Version();
protected: protected:
virtual Decorator* _AllocateDecorator(DesktopSettings& settings, virtual Decorator* _AllocateDecorator(DesktopSettings& settings,
BRect rect, window_look look, uint32 flags); BRect rect, window_look look, uint32 flags);
StackAndTile fStackAndTile; StackAndTile fStackAndTile;
}; };
class SATDecorator : public DefaultDecorator { class SATDecorator : public DefaultDecorator {
public: public:
SATDecorator(DesktopSettings& settings, SATDecorator(DesktopSettings& settings,
BRect frame, window_look look, uint32 flags); BRect frame, window_look look,
uint32 flags);
void HighlightTab(bool active, BRegion* dirty); void HighlightTab(bool active, BRegion* dirty);
void HighlightBorders(bool active, BRegion* dirty); void HighlightBorders(bool active, BRegion* dirty);
bool IsTabHighlighted() { return fTabHighlighted; } bool IsTabHighlighted() const
bool IsBordersHighlighted() { return fBordersHighlighted; } { return fTabHighlighted; }
bool IsBordersHighlighted() const
{ return fBordersHighlighted; }
/*! Indicates that window is stacked */ /*! Indicates that window is stacked */
void SetStackedMode(bool stacked, BRegion* dirty); void SetStackedMode(bool stacked, BRegion* dirty);
bool StackedMode() { return fStackedMode; }; bool StackedMode() const
{ return fStackedMode; };
/*! Set the tab length if the decorator is in stacked mode and if the /*! Set the tab length if the decorator is in stacked mode and if
tab is the last one in the tab bar. */ the tab is the last one in the tab bar. */
void SetStackedTabLength(float length, BRegion* dirty); void SetStackedTabLength(float length,
float StackedTabLength() { return fStackedTabLength; } BRegion* dirty);
float StackedTabLength() const
{ return fStackedTabLength; }
protected: protected:
void _DoLayout(); void _DoLayout();
void _DrawTab(BRect r); void _DrawTab(BRect r);
void _LayoutTabItems(const BRect& tabRect); void _LayoutTabItems(const BRect& tabRect);
bool _SetTabLocation(float location, bool _SetTabLocation(float location,
BRegion* updateRegion = NULL); BRegion* updateRegion = NULL);
void _SetFocus(); void _SetFocus();
private: private:
bool fTabHighlighted; bool fTabHighlighted;
bool fBordersHighlighted; bool fBordersHighlighted;
rgb_color fHighlightTabColor; rgb_color fHighlightTabColor;
rgb_color fNonHighlightFrameColors[4]; rgb_color fNonHighlightFrameColors[4];
rgb_color fHighlightFrameColors[6]; rgb_color fHighlightFrameColors[6];
bool fStackedMode; bool fStackedMode;
bool fStackedDrawZoom; bool fStackedDrawZoom;
float fStackedTabLength; float fStackedTabLength;
bool fStackedTabShifting; bool fStackedTabShifting;
}; };
#endif #endif