Tracker: Privatize most members of BPoseView.

Greatly reduces what is available to inherited classes.
No functional change intended.
This commit is contained in:
Augustin Cavalier
2022-09-09 15:37:29 -04:00
parent f61067a023
commit 95ca8eefea
3 changed files with 32 additions and 27 deletions
+6 -6
View File
@@ -695,12 +695,12 @@ OpenWithPoseView::OpenSelection(BPose* pose, int32*)
{ {
OpenWithContainerWindow* window = ContainerWindow(); OpenWithContainerWindow* window = ContainerWindow();
int32 count = fSelectionList->CountItems(); int32 count = SelectionList()->CountItems();
if (count == 0) if (count == 0)
return; return;
if (pose == NULL) if (pose == NULL)
pose = fSelectionList->FirstItem(); pose = SelectionList()->FirstItem();
ASSERT(pose != NULL); ASSERT(pose != NULL);
@@ -764,7 +764,7 @@ OpenWithPoseView::Pulse()
OpenWithContainerWindow* window = ContainerWindow(); OpenWithContainerWindow* window = ContainerWindow();
if (!fSelectionList->CountItems()) { if (!SelectionList()->CountItems()) {
window->SetCanSetAppAsDefault(false); window->SetCanSetAppAsDefault(false);
window->SetCanOpen(false); window->SetCanOpen(false);
_inherited::Pulse(); _inherited::Pulse();
@@ -773,7 +773,7 @@ OpenWithPoseView::Pulse()
// if we selected a non-handling application, don't allow setting // if we selected a non-handling application, don't allow setting
// it as preferred // it as preferred
Model* firstSelected = fSelectionList->FirstItem()->TargetModel(); Model* firstSelected = SelectionList()->FirstItem()->TargetModel();
if (OpenWithRelation(firstSelected) == kNoRelation) { if (OpenWithRelation(firstSelected) == kNoRelation) {
window->SetCanSetAppAsDefault(false); window->SetCanSetAppAsDefault(false);
window->SetCanOpen(true); window->SetCanOpen(true);
@@ -789,11 +789,11 @@ OpenWithPoseView::Pulse()
return; return;
} }
ASSERT(fSelectionList->CountItems() == 1); ASSERT(SelectionList()->CountItems() == 1);
// enable the Open and make default if selected application different // enable the Open and make default if selected application different
// from preferred app ref // from preferred app ref
window->SetCanSetAppAsDefault((*fSelectionList->FirstItem()-> window->SetCanSetAppAsDefault((*SelectionList()->FirstItem()->
TargetModel()->EntryRef()) != fPreferredRef); TargetModel()->EntryRef()) != fPreferredRef);
_inherited::Pulse(); _inherited::Pulse();
+8 -8
View File
@@ -217,12 +217,19 @@ BPoseView::BPoseView(Model* model, uint32 viewMode)
: :
BView("PoseView", B_WILL_DRAW | B_PULSE_NEEDED), BView("PoseView", B_WILL_DRAW | B_PULSE_NEEDED),
fIsDrawingSelectionRect(false), fIsDrawingSelectionRect(false),
fViewState(new BViewState),
fStateNeedsSaving(false),
fSavePoseLocations(true),
fMultipleSelection(true),
fDragEnabled(true),
fDropEnabled(true),
fSelectionHandler(be_app),
fPoseList(new PoseList(40, true)),
fHScrollBar(NULL), fHScrollBar(NULL),
fVScrollBar(NULL), fVScrollBar(NULL),
fModel(model), fModel(model),
fActivePose(NULL), fActivePose(NULL),
fExtent(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN), fExtent(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN),
fPoseList(new PoseList(40, true)),
fFilteredPoseList(new PoseList()), fFilteredPoseList(new PoseList()),
fVSPoseList(new PoseList()), fVSPoseList(new PoseList()),
fSelectionList(new PoseList()), fSelectionList(new PoseList()),
@@ -232,14 +239,11 @@ BPoseView::BPoseView(Model* model, uint32 viewMode)
fMimeTypeList(new BObjectList<BString>(10, true)), fMimeTypeList(new BObjectList<BString>(10, true)),
fBrokenLinks(new BObjectList<Model>(10, false)), fBrokenLinks(new BObjectList<Model>(10, false)),
fMimeTypeListIsDirty(false), fMimeTypeListIsDirty(false),
fViewState(new BViewState),
fStateNeedsSaving(false),
fCountView(NULL), fCountView(NULL),
fListElemHeight(0.0f), fListElemHeight(0.0f),
fIconPoseHeight(0.0f), fIconPoseHeight(0.0f),
fDropTarget(NULL), fDropTarget(NULL),
fAlreadySelectedDropTarget(NULL), fAlreadySelectedDropTarget(NULL),
fSelectionHandler(be_app),
fLastClickPoint(INT32_MAX, INT32_MAX), fLastClickPoint(INT32_MAX, INT32_MAX),
fLastClickButtons(0), fLastClickButtons(0),
fLastClickedPose(NULL), fLastClickedPose(NULL),
@@ -255,14 +259,10 @@ BPoseView::BPoseView(Model* model, uint32 viewMode)
fTrackRightMouseUp(false), fTrackRightMouseUp(false),
fTrackMouseUp(false), fTrackMouseUp(false),
fSelectionVisible(true), fSelectionVisible(true),
fMultipleSelection(true),
fDragEnabled(true),
fDropEnabled(true),
fSelectionRectEnabled(true), fSelectionRectEnabled(true),
fAlwaysAutoPlace(false), fAlwaysAutoPlace(false),
fAllowPoseEditing(true), fAllowPoseEditing(true),
fSelectionChangedHook(false), fSelectionChangedHook(false),
fSavePoseLocations(true),
fShowHideSelection(true), fShowHideSelection(true),
fOkToMapIcons(false), fOkToMapIcons(false),
fEnsurePosesVisible(false), fEnsurePosesVisible(false),
+18 -13
View File
@@ -303,8 +303,7 @@ public:
void AddRemovePoseFromSelection(BPose* pose, int32 index, void AddRemovePoseFromSelection(BPose* pose, int32 index,
bool select); bool select);
BLooper* SelectionHandler(); void SetSelectionHandler(BLooper* looper);
void SetSelectionHandler(BLooper*);
BObjectList<BString>*MimeTypesInSelection(); BObjectList<BString>*MimeTypesInSelection();
@@ -397,7 +396,6 @@ public:
void HideBarberPole(); void HideBarberPole();
bool fShowSelectionWhenInactive; bool fShowSelectionWhenInactive;
bool fTransparentSelection;
bool fIsDrawingSelectionRect; bool fIsDrawingSelectionRect;
bool IsWatchingDateFormatChange(); bool IsWatchingDateFormatChange();
@@ -707,13 +705,28 @@ protected:
}; };
protected: protected:
BViewState* fViewState;
bool fStateNeedsSaving;
bool fSavePoseLocations : 1;
bool fMultipleSelection : 1;
bool fDragEnabled : 1;
bool fDropEnabled : 1;
BLooper* fSelectionHandler;
std::set<thread_id> fAddPosesThreads;
PoseList* fPoseList;
PendingNodeMonitorCache pendingNodeMonitorCache;
private:
TScrollBar* fHScrollBar; TScrollBar* fHScrollBar;
BScrollBar* fVScrollBar; BScrollBar* fVScrollBar;
Model* fModel; Model* fModel;
BPose* fActivePose; BPose* fActivePose;
BRect fExtent; BRect fExtent;
// the following should probably be just member lists, not pointers // the following should probably be just member lists, not pointers
PoseList* fPoseList;
PoseList* fFilteredPoseList; PoseList* fFilteredPoseList;
PoseList* fVSPoseList; PoseList* fVSPoseList;
PoseList* fSelectionList; PoseList* fSelectionList;
@@ -721,20 +734,16 @@ protected:
BObjectList<BString> fMimeTypesInSelectionCache; BObjectList<BString> fMimeTypesInSelectionCache;
// used for mime string based icon highliting during a drag // used for mime string based icon highliting during a drag
BObjectList<Model>* fZombieList; BObjectList<Model>* fZombieList;
PendingNodeMonitorCache pendingNodeMonitorCache;
BObjectList<BColumn>* fColumnList; BObjectList<BColumn>* fColumnList;
BObjectList<BString>* fMimeTypeList; BObjectList<BString>* fMimeTypeList;
BObjectList<Model>* fBrokenLinks; BObjectList<Model>* fBrokenLinks;
bool fMimeTypeListIsDirty; bool fMimeTypeListIsDirty;
BViewState* fViewState;
bool fStateNeedsSaving;
BCountView* fCountView; BCountView* fCountView;
float fListElemHeight; float fListElemHeight;
float fListOffset; float fListOffset;
float fIconPoseHeight; float fIconPoseHeight;
BPose* fDropTarget; BPose* fDropTarget;
BPose* fAlreadySelectedDropTarget; BPose* fAlreadySelectedDropTarget;
BLooper* fSelectionHandler;
BPoint fLastClickPoint; BPoint fLastClickPoint;
int32 fLastClickButtons; int32 fLastClickButtons;
const BPose* fLastClickedPose; const BPose* fLastClickedPose;
@@ -747,7 +756,6 @@ protected:
BPoint fHintLocation; BPoint fHintLocation;
float fAutoScrollInc; float fAutoScrollInc;
int32 fAutoScrollState; int32 fAutoScrollState;
std::set<thread_id> fAddPosesThreads;
bool fWidgetTextOutline; bool fWidgetTextOutline;
const BPose* fSelectionPivotPose; const BPose* fSelectionPivotPose;
const BPose* fRealPivotPose; const BPose* fRealPivotPose;
@@ -773,15 +781,12 @@ protected:
SelectionRectInfo fSelectionRectInfo; SelectionRectInfo fSelectionRectInfo;
bool fSelectionVisible : 1; bool fSelectionVisible : 1;
bool fMultipleSelection : 1;
bool fDragEnabled : 1;
bool fDropEnabled : 1;
bool fSelectionRectEnabled : 1; bool fSelectionRectEnabled : 1;
bool fTransparentSelection : 1;
bool fAlwaysAutoPlace : 1; bool fAlwaysAutoPlace : 1;
bool fAllowPoseEditing : 1; bool fAllowPoseEditing : 1;
bool fSelectionChangedHook : 1; bool fSelectionChangedHook : 1;
// get rid of this // get rid of this
bool fSavePoseLocations : 1;
bool fShowHideSelection : 1; bool fShowHideSelection : 1;
bool fOkToMapIcons : 1; bool fOkToMapIcons : 1;
bool fEnsurePosesVisible : 1; bool fEnsurePosesVisible : 1;