Style fixes in BarView.h

This commit is contained in:
John Scipione
2013-04-14 02:49:37 -04:00
parent 777fffe8f7
commit 251ece3c74
+28 -15
View File
@@ -65,6 +65,7 @@ const float kStatusHeight = 22.0f;
const float kHiddenDimension = 1.0f; const float kHiddenDimension = 1.0f;
const float kMaxPreventHidingDist = 80.0f; const float kMaxPreventHidingDist = 80.0f;
class BShelf; class BShelf;
class TBarApp; class TBarApp;
class TBarMenuBar; class TBarMenuBar;
@@ -74,25 +75,29 @@ class TDragRegion;
class TInlineScrollView; class TInlineScrollView;
class TTeamMenuItem; class TTeamMenuItem;
class TBarView : public BView { class TBarView : public BView {
public: public:
TBarView(BRect frame, bool vertical, bool left, bool top, TBarView(BRect frame, bool vertical, bool left,
int32 state, float width); bool top, int32 state, float width);
~TBarView(); ~TBarView();
virtual void AttachedToWindow(); virtual void AttachedToWindow();
virtual void DetachedFromWindow(); virtual void DetachedFromWindow();
virtual void Draw(BRect updateRect); virtual void Draw(BRect updateRect);
virtual void MessageReceived(BMessage* message); virtual void MessageReceived(BMessage* message);
virtual void MouseMoved(BPoint where, uint32 transit, virtual void MouseMoved(BPoint where, uint32 transit,
const BMessage* dragMessage); const BMessage* dragMessage);
virtual void MouseDown(BPoint where); virtual void MouseDown(BPoint where);
void SaveSettings(); void SaveSettings();
void UpdatePlacement(); void UpdatePlacement();
void ChangeState(int32 state, bool vertical, bool left, bool top, void ChangeState(int32 state, bool vertical, bool left,
bool aSync = false); bool top, bool aSync = false);
void RaiseDeskbar(bool raise); void RaiseDeskbar(bool raise);
void HideDeskbar(bool hide); void HideDeskbar(bool hide);
@@ -101,10 +106,12 @@ class TBarView : public BView {
bool Left() const { return fLeft; }; bool Left() const { return fLeft; };
bool Top() const { return fTop; }; bool Top() const { return fTop; };
bool AcrossTop() const { return fTop && !fVertical; }; bool AcrossTop() const { return fTop && !fVertical; };
bool AcrossBottom() const { return !fTop && !fVertical; }; bool AcrossBottom() const
{ return !fTop && !fVertical; };
// window state methods // window state methods
bool ExpandoState() const { return fState == kExpandoState; }; bool ExpandoState() const
{ return fState == kExpandoState; };
bool FullState() const { return fState == kFullState; }; bool FullState() const { return fState == kFullState; };
bool MiniState() const { return fState == kMiniState; }; bool MiniState() const { return fState == kMiniState; };
int32 State() const { return fState; }; int32 State() const { return fState; };
@@ -125,16 +132,20 @@ class TBarView : public BView {
void HandleDeskbarMenu(BMessage* targetmessage); void HandleDeskbarMenu(BMessage* targetmessage);
status_t ItemInfo(int32 id, const char** name, DeskbarShelf* shelf); status_t ItemInfo(int32 id, const char** name,
status_t ItemInfo(const char* name, int32* id, DeskbarShelf* shelf); DeskbarShelf* shelf);
status_t ItemInfo(const char* name, int32* id,
DeskbarShelf* shelf);
bool ItemExists(int32 id, DeskbarShelf shelf); bool ItemExists(int32 id, DeskbarShelf shelf);
bool ItemExists(const char* name, DeskbarShelf shelf); bool ItemExists(const char* name, DeskbarShelf shelf);
int32 CountItems(DeskbarShelf shelf); int32 CountItems(DeskbarShelf shelf);
status_t AddItem(BMessage* archive, DeskbarShelf shelf, int32* id); status_t AddItem(BMessage* archive, DeskbarShelf shelf,
status_t AddItem(BEntry* entry, DeskbarShelf shelf, int32* id); int32* id);
status_t AddItem(BEntry* entry, DeskbarShelf shelf,
int32* id);
void RemoveItem(int32 id); void RemoveItem(int32 id);
void RemoveItem(const char* name, DeskbarShelf shelf); void RemoveItem(const char* name, DeskbarShelf shelf);
@@ -143,8 +154,8 @@ class TBarView : public BView {
BRect IconFrame(int32 id) const; BRect IconFrame(int32 id) const;
BRect IconFrame(const char* name) const; BRect IconFrame(const char* name) const;
void GetPreferredWindowSize(BRect screenFrame, float* width, void GetPreferredWindowSize(BRect screenFrame,
float* height); float* width, float* height);
void SizeWindow(BRect screenFrame); void SizeWindow(BRect screenFrame);
void PositionWindow(BRect screenFrame); void PositionWindow(BRect screenFrame);
void AddExpandedItem(const char* signature); void AddExpandedItem(const char* signature);
@@ -161,14 +172,17 @@ class TBarView : public BView {
friend class TDeskbarMenu; friend class TDeskbarMenu;
friend class PreferencesWindow; friend class PreferencesWindow;
status_t SendDragMessage(const char* signature, entry_ref* ref = NULL); status_t SendDragMessage(const char* signature,
entry_ref* ref = NULL);
void PlaceDeskbarMenu(); void PlaceDeskbarMenu();
void PlaceTray(bool vertSwap, bool leftSwap); void PlaceTray(bool vertSwap, bool leftSwap);
void PlaceApplicationBar(); void PlaceApplicationBar();
void SaveExpandedItems(); void SaveExpandedItems();
void RemoveExpandedItems(); void RemoveExpandedItems();
void ExpandItems(); void ExpandItems();
void _ChangeState(BMessage* message); void _ChangeState(BMessage* message);
TBarApp* fBarApp; TBarApp* fBarApp;
@@ -183,7 +197,6 @@ class TBarView : public BView {
bool fVertical : 1; bool fVertical : 1;
bool fTop : 1; bool fTop : 1;
bool fLeft : 1; bool fLeft : 1;
int32 fState; int32 fState;
bigtime_t fPulseRate; bigtime_t fPulseRate;