Tracker: style fixes to PoseView class

This commit is contained in:
John Scipione
2014-06-20 21:29:14 -04:00
parent fdb62486ef
commit 38181640e9
2 changed files with 1137 additions and 1055 deletions
File diff suppressed because it is too large Load Diff
+20 -11
View File
@@ -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;
} }
}; };
@@ -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*,
@@ -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));
@@ -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;
@@ -1281,4 +1289,5 @@ WhileEachTextWidget(BPose* pose, BPoseView* poseView,
using namespace BPrivate; using namespace BPrivate;
#endif // _POSE_VIEW_H #endif // _POSE_VIEW_H