Tracker: style fixes to PoseView class
This commit is contained in:
+392
-319
File diff suppressed because it is too large
Load Diff
+29
-20
@@ -73,7 +73,9 @@ template<>
|
|||||||
struct std::hash<node_ref>
|
struct std::hash<node_ref>
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
size_t operator()(node_ref ref) const {
|
size_t
|
||||||
|
operator()(node_ref ref) const
|
||||||
|
{
|
||||||
return ref.node;
|
return ref.node;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -103,7 +105,7 @@ const uint32 kListMode = 'Tlst';
|
|||||||
const uint32 kCheckTypeahead = 'Tcty';
|
const uint32 kCheckTypeahead = 'Tcty';
|
||||||
|
|
||||||
class BPoseView : public BView {
|
class BPoseView : public BView {
|
||||||
public:
|
public:
|
||||||
BPoseView(Model*, BRect, uint32 viewMode,
|
BPoseView(Model*, BRect, uint32 viewMode,
|
||||||
uint32 resizeMask = B_FOLLOW_ALL);
|
uint32 resizeMask = B_FOLLOW_ALL);
|
||||||
virtual ~BPoseView();
|
virtual ~BPoseView();
|
||||||
@@ -158,9 +160,9 @@ class BPoseView : public BView {
|
|||||||
virtual void Refresh();
|
virtual void Refresh();
|
||||||
|
|
||||||
// callbacks
|
// callbacks
|
||||||
virtual void MessageReceived(BMessage*);
|
virtual void MessageReceived(BMessage* message);
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
virtual void WindowActivated(bool);
|
virtual void WindowActivated(bool active);
|
||||||
virtual void MakeFocus(bool = true);
|
virtual void MakeFocus(bool = true);
|
||||||
virtual void Draw(BRect update_rect);
|
virtual void Draw(BRect update_rect);
|
||||||
virtual void DrawAfterChildren(BRect update_rect);
|
virtual void DrawAfterChildren(BRect update_rect);
|
||||||
@@ -338,7 +340,7 @@ class BPoseView : public BView {
|
|||||||
BPose* ActivePose() const;
|
BPose* ActivePose() const;
|
||||||
void CommitActivePose(bool saveChanges = true);
|
void CommitActivePose(bool saveChanges = true);
|
||||||
static bool PoseVisible(const Model*, const PoseInfo*);
|
static bool PoseVisible(const Model*, const PoseInfo*);
|
||||||
bool FrameForPose(BPose* targetpose, bool convert, BRect* poseRect);
|
bool FrameForPose(BPose* targetPose, bool convert, BRect* poseRect);
|
||||||
bool CreateSymlinkPoseTarget(Model* symlink);
|
bool CreateSymlinkPoseTarget(Model* symlink);
|
||||||
// used to complete a symlink pose; returns true if
|
// used to complete a symlink pose; returns true if
|
||||||
// target symlink should not be shown
|
// target symlink should not be shown
|
||||||
@@ -365,7 +367,7 @@ class BPoseView : public BView {
|
|||||||
// drag&drop handling
|
// drag&drop handling
|
||||||
virtual bool HandleMessageDropped(BMessage*);
|
virtual bool HandleMessageDropped(BMessage*);
|
||||||
static bool HandleDropCommon(BMessage* dragMessage, Model* target,
|
static bool HandleDropCommon(BMessage* dragMessage, Model* target,
|
||||||
BPose*, BView* view, BPoint dropPt);
|
BPose*, BView* view, BPoint dropPoint);
|
||||||
// used by pose views and info windows
|
// used by pose views and info windows
|
||||||
static bool CanHandleDragSelection(const Model* target,
|
static bool CanHandleDragSelection(const Model* target,
|
||||||
const BMessage* dragMessage, bool ignoreTypes);
|
const BMessage* dragMessage, bool ignoreTypes);
|
||||||
@@ -378,7 +380,7 @@ class BPoseView : public BView {
|
|||||||
BContainerWindow* srcWindow, BContainerWindow* destWindow,
|
BContainerWindow* srcWindow, BContainerWindow* destWindow,
|
||||||
uint32 buttons, BPoint loc, bool forceCopy,
|
uint32 buttons, BPoint loc, bool forceCopy,
|
||||||
bool forceMove = false, bool createLink = false,
|
bool forceMove = false, bool createLink = false,
|
||||||
bool relativeLink = false, BPoint clickPt = BPoint(0, 0),
|
bool relativeLink = false, BPoint clickPoint = BPoint(0, 0),
|
||||||
bool pinToGrid = false);
|
bool pinToGrid = false);
|
||||||
|
|
||||||
bool UpdateDropTarget(BPoint, const BMessage*,
|
bool UpdateDropTarget(BPoint, const BMessage*,
|
||||||
@@ -427,7 +429,7 @@ class BPoseView : public BView {
|
|||||||
|
|
||||||
void SetTextWidgetToCheck(BTextWidget*, BTextWidget* = NULL);
|
void SetTextWidgetToCheck(BTextWidget*, BTextWidget* = NULL);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// view setup
|
// view setup
|
||||||
virtual void SetUpDefaultColumnsIfNeeded();
|
virtual void SetUpDefaultColumnsIfNeeded();
|
||||||
|
|
||||||
@@ -475,10 +477,10 @@ class BPoseView : public BView {
|
|||||||
bool insertionSort, BPose* pose, BRect&viewBounds,
|
bool insertionSort, BPose* pose, BRect&viewBounds,
|
||||||
float& listViewScrollBy, bool forceDraw, int32* indexPtr = NULL);
|
float& listViewScrollBy, bool forceDraw, int32* indexPtr = NULL);
|
||||||
BPose* CreatePose(Model*, PoseInfo*, bool insertionSort = true,
|
BPose* CreatePose(Model*, PoseInfo*, bool insertionSort = true,
|
||||||
int32* index = 0, BRect* boundsPtr = 0, bool forceDraw = true);
|
int32* index = 0, BRect* boundsPointer = 0, bool forceDraw = true);
|
||||||
virtual void CreatePoses(Model**models, PoseInfo* poseInfoArray,
|
virtual void CreatePoses(Model**models, PoseInfo* poseInfoArray,
|
||||||
int32 count, BPose** resultingPoses, bool insertionSort = true,
|
int32 count, BPose** resultingPoses, bool insertionSort = true,
|
||||||
int32* lastPoseIndexPtr = 0, BRect* boundsPtr = 0,
|
int32* lastPoseIndexPointer = 0, BRect* boundsPointer = 0,
|
||||||
bool forceDraw = false);
|
bool forceDraw = false);
|
||||||
virtual bool ShouldShowPose(const Model*, const PoseInfo*);
|
virtual bool ShouldShowPose(const Model*, const PoseInfo*);
|
||||||
// filter, subclasses override to control which poses show up
|
// filter, subclasses override to control which poses show up
|
||||||
@@ -591,7 +593,7 @@ class BPoseView : public BView {
|
|||||||
static bool DragSelectionContains(const BPose* target,
|
static bool DragSelectionContains(const BPose* target,
|
||||||
const BMessage* dragMessage);
|
const BMessage* dragMessage);
|
||||||
static status_t CreateClippingFile(BPoseView* poseView, BFile&result,
|
static status_t CreateClippingFile(BPoseView* poseView, BFile&result,
|
||||||
char* resultingName, BDirectory* dir, BMessage* message,
|
char* resultingName, BDirectory* directory, BMessage* message,
|
||||||
const char* fallbackName, bool setLocation = false,
|
const char* fallbackName, bool setLocation = false,
|
||||||
BPoint dropPoint = BPoint(0, 0));
|
BPoint dropPoint = BPoint(0, 0));
|
||||||
|
|
||||||
@@ -682,12 +684,12 @@ class BPoseView : public BView {
|
|||||||
|
|
||||||
void ExcludeTrashFromSelection();
|
void ExcludeTrashFromSelection();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void DrawOpenAnimation(BRect);
|
void DrawOpenAnimation(BRect);
|
||||||
|
|
||||||
void MoveSelectionOrEntryToTrash(const entry_ref* ref, bool selectNext);
|
void MoveSelectionOrEntryToTrash(const entry_ref* ref, bool selectNext);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BHScrollBar* fHScrollBar;
|
BHScrollBar* fHScrollBar;
|
||||||
BScrollBar* fVScrollBar;
|
BScrollBar* fVScrollBar;
|
||||||
Model* fModel;
|
Model* fModel;
|
||||||
@@ -736,7 +738,12 @@ class BPoseView : public BView {
|
|||||||
|
|
||||||
struct SelectionRectInfo {
|
struct SelectionRectInfo {
|
||||||
SelectionRectInfo()
|
SelectionRectInfo()
|
||||||
: isDragging(false), selection(NULL) {};
|
:
|
||||||
|
isDragging(false),
|
||||||
|
selection(NULL)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
bool isDragging;
|
bool isDragging;
|
||||||
BRect rect;
|
BRect rect;
|
||||||
BRect lastRect;
|
BRect lastRect;
|
||||||
@@ -753,7 +760,8 @@ class BPoseView : public BView {
|
|||||||
bool fSelectionRectEnabled : 1;
|
bool fSelectionRectEnabled : 1;
|
||||||
bool fAlwaysAutoPlace : 1;
|
bool fAlwaysAutoPlace : 1;
|
||||||
bool fAllowPoseEditing : 1;
|
bool fAllowPoseEditing : 1;
|
||||||
bool fSelectionChangedHook : 1; // get rid of this
|
bool fSelectionChangedHook : 1;
|
||||||
|
// get rid of this
|
||||||
bool fSavePoseLocations : 1;
|
bool fSavePoseLocations : 1;
|
||||||
bool fShowHideSelection : 1;
|
bool fShowHideSelection : 1;
|
||||||
bool fOkToMapIcons : 1;
|
bool fOkToMapIcons : 1;
|
||||||
@@ -790,14 +798,14 @@ class BPoseView : public BView {
|
|||||||
|
|
||||||
|
|
||||||
class BHScrollBar : public BScrollBar {
|
class BHScrollBar : public BScrollBar {
|
||||||
public:
|
public:
|
||||||
BHScrollBar(BRect, const char*, BView*);
|
BHScrollBar(BRect, const char*, BView*);
|
||||||
void SetTitleView(BView*);
|
void SetTitleView(BView*);
|
||||||
|
|
||||||
// BScrollBar overrides
|
// BScrollBar overrides
|
||||||
virtual void ValueChanged(float);
|
virtual void ValueChanged(float);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BView* fTitleView;
|
BView* fTitleView;
|
||||||
|
|
||||||
typedef BScrollBar _inherited;
|
typedef BScrollBar _inherited;
|
||||||
@@ -805,13 +813,13 @@ class BHScrollBar : public BScrollBar {
|
|||||||
|
|
||||||
|
|
||||||
class TPoseViewFilter : public BMessageFilter {
|
class TPoseViewFilter : public BMessageFilter {
|
||||||
public:
|
public:
|
||||||
TPoseViewFilter(BPoseView* pose);
|
TPoseViewFilter(BPoseView* pose);
|
||||||
~TPoseViewFilter();
|
~TPoseViewFilter();
|
||||||
|
|
||||||
filter_result Filter(BMessage*, BHandler**);
|
filter_result Filter(BMessage*, BHandler**);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
filter_result ObjectDropFilter(BMessage*, BHandler**);
|
filter_result ObjectDropFilter(BMessage*, BHandler**);
|
||||||
|
|
||||||
BPoseView* fPoseView;
|
BPoseView* fPoseView;
|
||||||
@@ -878,7 +886,7 @@ BPoseView::SelectionList() const
|
|||||||
inline BObjectList<BString>*
|
inline BObjectList<BString>*
|
||||||
BPoseView::MimeTypesInSelection()
|
BPoseView::MimeTypesInSelection()
|
||||||
{
|
{
|
||||||
return&fMimeTypesInSelectionCache;
|
return &fMimeTypesInSelectionCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1281,4 +1289,5 @@ WhileEachTextWidget(BPose* pose, BPoseView* poseView,
|
|||||||
|
|
||||||
using namespace BPrivate;
|
using namespace BPrivate;
|
||||||
|
|
||||||
|
|
||||||
#endif // _POSE_VIEW_H
|
#endif // _POSE_VIEW_H
|
||||||
|
|||||||
Reference in New Issue
Block a user