Style fixes in BarView.h
This commit is contained in:
+111
-98
@@ -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,130 +75,142 @@ 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 MessageReceived(BMessage* message);
|
|
||||||
virtual void MouseMoved(BPoint where, uint32 transit,
|
|
||||||
const BMessage* dragMessage);
|
|
||||||
virtual void MouseDown(BPoint where);
|
|
||||||
|
|
||||||
void SaveSettings();
|
virtual void Draw(BRect updateRect);
|
||||||
void UpdatePlacement();
|
|
||||||
void ChangeState(int32 state, bool vertical, bool left, bool top,
|
|
||||||
bool aSync = false);
|
|
||||||
void RaiseDeskbar(bool raise);
|
|
||||||
void HideDeskbar(bool hide);
|
|
||||||
|
|
||||||
// window placement methods
|
virtual void MessageReceived(BMessage* message);
|
||||||
bool Vertical() const { return fVertical; };
|
|
||||||
bool Left() const { return fLeft; };
|
|
||||||
bool Top() const { return fTop; };
|
|
||||||
bool AcrossTop() const { return fTop && !fVertical; };
|
|
||||||
bool AcrossBottom() const { return !fTop && !fVertical; };
|
|
||||||
|
|
||||||
// window state methods
|
virtual void MouseMoved(BPoint where, uint32 transit,
|
||||||
bool ExpandoState() const { return fState == kExpandoState; };
|
const BMessage* dragMessage);
|
||||||
bool FullState() const { return fState == kFullState; };
|
virtual void MouseDown(BPoint where);
|
||||||
bool MiniState() const { return fState == kMiniState; };
|
|
||||||
int32 State() const { return fState; };
|
|
||||||
|
|
||||||
// drag and drop methods
|
void SaveSettings();
|
||||||
void CacheDragData(const BMessage* incoming);
|
|
||||||
status_t DragStart();
|
|
||||||
static bool MenuTrackingHook(BMenu* menu, void* castToThis);
|
|
||||||
void DragStop(bool full = false);
|
|
||||||
TrackingHookData* GetTrackingHookData();
|
|
||||||
bool Dragging() const;
|
|
||||||
const BMessage* DragMessage() const;
|
|
||||||
BObjectList<BString>*CachedTypesList() const;
|
|
||||||
bool AppCanHandleTypes(const char* signature);
|
|
||||||
void SetDragOverride(bool);
|
|
||||||
bool DragOverride();
|
|
||||||
bool InvokeItem(const char* signature);
|
|
||||||
|
|
||||||
void HandleDeskbarMenu(BMessage* targetmessage);
|
void UpdatePlacement();
|
||||||
|
void ChangeState(int32 state, bool vertical, bool left,
|
||||||
|
bool top, bool aSync = false);
|
||||||
|
|
||||||
status_t ItemInfo(int32 id, const char** name, DeskbarShelf* shelf);
|
void RaiseDeskbar(bool raise);
|
||||||
status_t ItemInfo(const char* name, int32* id, DeskbarShelf* shelf);
|
void HideDeskbar(bool hide);
|
||||||
|
|
||||||
bool ItemExists(int32 id, DeskbarShelf shelf);
|
// window placement methods
|
||||||
bool ItemExists(const char* name, DeskbarShelf shelf);
|
bool Vertical() const { return fVertical; };
|
||||||
|
bool Left() const { return fLeft; };
|
||||||
|
bool Top() const { return fTop; };
|
||||||
|
bool AcrossTop() const { return fTop && !fVertical; };
|
||||||
|
bool AcrossBottom() const
|
||||||
|
{ return !fTop && !fVertical; };
|
||||||
|
|
||||||
int32 CountItems(DeskbarShelf shelf);
|
// window state methods
|
||||||
|
bool ExpandoState() const
|
||||||
|
{ return fState == kExpandoState; };
|
||||||
|
bool FullState() const { return fState == kFullState; };
|
||||||
|
bool MiniState() const { return fState == kMiniState; };
|
||||||
|
int32 State() const { return fState; };
|
||||||
|
|
||||||
status_t AddItem(BMessage* archive, DeskbarShelf shelf, int32* id);
|
// drag and drop methods
|
||||||
status_t AddItem(BEntry* entry, DeskbarShelf shelf, int32* id);
|
void CacheDragData(const BMessage* incoming);
|
||||||
|
status_t DragStart();
|
||||||
|
static bool MenuTrackingHook(BMenu* menu, void* castToThis);
|
||||||
|
void DragStop(bool full = false);
|
||||||
|
TrackingHookData* GetTrackingHookData();
|
||||||
|
bool Dragging() const;
|
||||||
|
const BMessage* DragMessage() const;
|
||||||
|
BObjectList<BString>* CachedTypesList() const;
|
||||||
|
bool AppCanHandleTypes(const char* signature);
|
||||||
|
void SetDragOverride(bool);
|
||||||
|
bool DragOverride();
|
||||||
|
bool InvokeItem(const char* signature);
|
||||||
|
|
||||||
void RemoveItem(int32 id);
|
void HandleDeskbarMenu(BMessage* targetmessage);
|
||||||
void RemoveItem(const char* name, DeskbarShelf shelf);
|
|
||||||
|
|
||||||
BRect OffsetIconFrame(BRect rect) const;
|
status_t ItemInfo(int32 id, const char** name,
|
||||||
BRect IconFrame(int32 id) const;
|
DeskbarShelf* shelf);
|
||||||
BRect IconFrame(const char* name) const;
|
status_t ItemInfo(const char* name, int32* id,
|
||||||
|
DeskbarShelf* shelf);
|
||||||
|
|
||||||
void GetPreferredWindowSize(BRect screenFrame, float* width,
|
bool ItemExists(int32 id, DeskbarShelf shelf);
|
||||||
float* height);
|
bool ItemExists(const char* name, DeskbarShelf shelf);
|
||||||
void SizeWindow(BRect screenFrame);
|
|
||||||
void PositionWindow(BRect screenFrame);
|
|
||||||
void AddExpandedItem(const char* signature);
|
|
||||||
|
|
||||||
void CheckForScrolling();
|
int32 CountItems(DeskbarShelf shelf);
|
||||||
|
|
||||||
TExpandoMenuBar* ExpandoMenuBar() const;
|
status_t AddItem(BMessage* archive, DeskbarShelf shelf,
|
||||||
TBarMenuBar* BarMenuBar() const;
|
int32* id);
|
||||||
TDragRegion* DragRegion() const { return fDragRegion; }
|
status_t AddItem(BEntry* entry, DeskbarShelf shelf,
|
||||||
TReplicantTray* ReplicantTray() const { return fReplicantTray; }
|
int32* id);
|
||||||
|
|
||||||
private:
|
void RemoveItem(int32 id);
|
||||||
friend class TBarApp;
|
void RemoveItem(const char* name, DeskbarShelf shelf);
|
||||||
friend class TDeskbarMenu;
|
|
||||||
friend class PreferencesWindow;
|
|
||||||
|
|
||||||
status_t SendDragMessage(const char* signature, entry_ref* ref = NULL);
|
BRect OffsetIconFrame(BRect rect) const;
|
||||||
|
BRect IconFrame(int32 id) const;
|
||||||
|
BRect IconFrame(const char* name) const;
|
||||||
|
|
||||||
void PlaceDeskbarMenu();
|
void GetPreferredWindowSize(BRect screenFrame,
|
||||||
void PlaceTray(bool vertSwap, bool leftSwap);
|
float* width, float* height);
|
||||||
void PlaceApplicationBar();
|
void SizeWindow(BRect screenFrame);
|
||||||
void SaveExpandedItems();
|
void PositionWindow(BRect screenFrame);
|
||||||
void RemoveExpandedItems();
|
void AddExpandedItem(const char* signature);
|
||||||
void ExpandItems();
|
|
||||||
void _ChangeState(BMessage* message);
|
|
||||||
|
|
||||||
TBarApp* fBarApp;
|
void CheckForScrolling();
|
||||||
TInlineScrollView* fInlineScrollView;
|
|
||||||
TBarMenuBar* fBarMenuBar;
|
|
||||||
TExpandoMenuBar* fExpandoMenuBar;
|
|
||||||
|
|
||||||
int32 fTrayLocation;
|
TExpandoMenuBar* ExpandoMenuBar() const;
|
||||||
TDragRegion* fDragRegion;
|
TBarMenuBar* BarMenuBar() const;
|
||||||
TReplicantTray* fReplicantTray;
|
TDragRegion* DragRegion() const { return fDragRegion; }
|
||||||
|
TReplicantTray* ReplicantTray() const { return fReplicantTray; }
|
||||||
|
|
||||||
bool fVertical : 1;
|
private:
|
||||||
bool fTop : 1;
|
friend class TBarApp;
|
||||||
bool fLeft : 1;
|
friend class TDeskbarMenu;
|
||||||
|
friend class PreferencesWindow;
|
||||||
|
|
||||||
int32 fState;
|
status_t SendDragMessage(const char* signature,
|
||||||
|
entry_ref* ref = NULL);
|
||||||
|
|
||||||
bigtime_t fPulseRate;
|
void PlaceDeskbarMenu();
|
||||||
bool fRefsRcvdOnly;
|
void PlaceTray(bool vertSwap, bool leftSwap);
|
||||||
BMessage* fDragMessage;
|
void PlaceApplicationBar();
|
||||||
BObjectList<BString>*fCachedTypesList;
|
|
||||||
TrackingHookData fTrackingHookData;
|
|
||||||
|
|
||||||
uint32 fMaxRecentDocs;
|
void SaveExpandedItems();
|
||||||
uint32 fMaxRecentApps;
|
void RemoveExpandedItems();
|
||||||
|
void ExpandItems();
|
||||||
|
|
||||||
TTeamMenuItem* fLastDragItem;
|
void _ChangeState(BMessage* message);
|
||||||
BList fExpandedItems;
|
|
||||||
BMessageFilter* fMouseFilter;
|
TBarApp* fBarApp;
|
||||||
|
TInlineScrollView* fInlineScrollView;
|
||||||
|
TBarMenuBar* fBarMenuBar;
|
||||||
|
TExpandoMenuBar* fExpandoMenuBar;
|
||||||
|
|
||||||
|
int32 fTrayLocation;
|
||||||
|
TDragRegion* fDragRegion;
|
||||||
|
TReplicantTray* fReplicantTray;
|
||||||
|
|
||||||
|
bool fVertical : 1;
|
||||||
|
bool fTop : 1;
|
||||||
|
bool fLeft : 1;
|
||||||
|
int32 fState;
|
||||||
|
|
||||||
|
bigtime_t fPulseRate;
|
||||||
|
bool fRefsRcvdOnly;
|
||||||
|
BMessage* fDragMessage;
|
||||||
|
BObjectList<BString>* fCachedTypesList;
|
||||||
|
TrackingHookData fTrackingHookData;
|
||||||
|
|
||||||
|
uint32 fMaxRecentDocs;
|
||||||
|
uint32 fMaxRecentApps;
|
||||||
|
|
||||||
|
TTeamMenuItem* fLastDragItem;
|
||||||
|
BList fExpandedItems;
|
||||||
|
BMessageFilter* fMouseFilter;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user