Lines Matching refs:pose

195 OneMatches(BPose* pose, BPoseView*, void* castToPose)
197 return pose == (const BPose*)castToPose;
776 BPose* pose = fPoseList->ItemAt(index);
777 if (pose->NeedsSaveLocation() && pose->HasLocation()) {
778 Model* model = pose->TargetModel();
786 poseInfo.fLocation = pose->Location(this);
794 // if saving desktop icons, save an extended pose info too
812 extendedPoseInfo->SetLocationForFrame(pose->Location(this),
825 // and Trash pose on Desktop directory
1150 BPoseView::SetActivePose(BPose* pose)
1152 if (pose != ActivePose()) {
1154 fActivePose = pose;
1173 BPose* pose = fActivePose;
1175 if (fFiltering && !FilterPose(pose))
1176 RemoveFilteredPose(pose, index);
1383 // the pose placing and drawing routine.
1465 // before we access the pose view, lock down the window
1492 // failed to init pose, model is a zombie, add to zombie
1622 BPose* pose = fPoseList->ItemAt(index);
1623 if (pose != NULL) {
1624 Model* model = pose->TargetModel();
1724 BPose* pose = EntryCreated(&dirNode, &itemNode, ref.name, 0);
1725 if (pose != NULL && watchIndividually) {
1728 pose->TargetModel()->WatchVolumeAndMountPoint(B_WATCH_NAME
1797 BPose* pose, BRect &viewBounds, float &listViewScrollBy, bool forceDraw,
1808 int32 orientation = BSearchList(list, pose, &poseIndex, poseIndex);
1815 poseBounds = CalcPoseRectList(pose, poseIndex);
1818 // Simple optimization: if the new pose bounds is completely below
1823 // The new pose may need to be placed where another pose already
1826 // rect where the new pose is.
1833 // special case the addition of a pose that scrolls
1860 // if new pose above current view bounds, cache up
1866 list->AddItem(pose, poseIndex);
1890 list->AddItem(pose, poseIndex);
1896 poseBounds = CalcPoseRectList(pose, poseIndex);
1927 // pose adopts model and deletes it when done
1947 BPose* pose = new BPose(model, this, clipboardMode);
1950 resultingPoses[modelIndex] = pose;
1955 pose->SetLocation(poseInfo->fLocation, this);
1956 AddToVSList(pose);
1964 AddPoseToList(fPoseList, !fFiltering, insertionSort, pose,
1967 if (fFiltering && FilterPose(pose)) {
1968 AddPoseToList(fFilteredPoseList, true, insertionSort, pose,
1978 if (pose->HasLocation())
1979 RemoveFromVSList(pose);
1981 PlacePose(pose, viewBounds);
1983 // we set a flag in the pose here to signify that we were
1989 pose->SetAutoPlaced(true);
1991 AddToVSList(pose);
1995 fPoseList->AddItem(pose);
1998 poseBounds = pose->CalcRect(this);
2002 RemoveFromVSList(pose);
2003 BPoint loc(pose->Location(this));
2005 pose->SetLocation(loc, this);
2006 pose->SetSaveLocation();
2007 AddToVSList(pose);
2008 poseBounds = pose->CalcRect(this);
2104 BPose* pose = PoseAtIndex(index);
2105 if (pose == NULL)
2108 Model* targetModel = pose->TargetModel();
2116 BPoseView::InsertPoseAfter(BPose* pose, int32* index, int32 orientation,
2127 srcRect.top = CalcPoseRectList(pose, *index).top;
2465 BPose* pose = fSelectionList->FirstItem();
2466 if (pose != NULL) {
2468 CurrentPoseList()->IndexOf(pose) * fListElemHeight);
2469 pose->EditFirstWidget(where, this);
2787 BPose* pose = fFilteredPoseList->ItemAt(i);
2788 if (!FilterPose(pose))
2789 RemoveFilteredPose(pose, i);
2828 BPose* pose = poseList->ItemAt(index);
2829 if (pose->WidgetFor(newColumn->AttrHash()) == NULL)
2830 pose->AddWidget(this, newColumn);
2975 // pose info to properly place the icon
2983 //PRINT(("retrying to read pose info for %s, %d\n",
3082 // Try to lock the center of the pose view when scaling icons, but not
3144 BPose* pose = fPoseList->ItemAt(index);
3145 if (pose->HasLocation() == false) {
3146 newPoseList.AddItem(pose);
3147 } else if (checkLocations && !IsValidLocation(pose)) {
3150 RemoveFromVSList(pose);
3151 newPoseList.AddItem(pose);
3153 // The pose location is still changed in view coordinates,
3155 pose->SetSaveLocation();
3157 MapToNewIconMode(pose, oldGrid, oldOffset);
3183 BPose* pose = newPoseList.ItemAt(index);
3184 PlacePose(pose, bounds);
3185 AddToVSList(pose);
3200 BPoseView::MapToNewIconMode(BPose* pose, BPoint oldGrid, BPoint oldOffset)
3205 poseLoc = PinToGrid(pose->Location(this), oldGrid, oldOffset);
3206 delta = pose->Location(this) - poseLoc;
3234 pose->SetLocation(poseLoc, this);
3235 pose->SetSaveLocation();
3248 BPose* pose = poseList->ItemAt(index);
3249 if (pose->ClipboardMode() != clipboardMode) {
3250 pose->SetClipboardMode(clipboardMode);
3251 Invalidate(pose->CalcRect(loc, this, false));
3258 BPose* pose = fPoseList->ItemAt(index);
3259 if (pose->ClipboardMode() != clipboardMode) {
3260 pose->SetClipboardMode(clipboardMode);
3261 BRect poseRect(pose->CalcRect(this));
3288 BPose* pose = fPoseList->ItemAt(index);
3289 pose->Select(false);
3290 pose->SetClipboardMode(0);
3306 BPose* pose = fPoseList->FindPose(&clipNode->node, &foundNodeIndex);
3307 if (pose == NULL)
3310 if (clipNode->moveMode != pose->ClipboardMode() || pose->IsSelected()) {
3311 pose->SetClipboardMode(clipNode->moveMode);
3312 pose->Select(false);
3317 pose = fFilteredPoseList->FindPose(&clipNode->node,
3321 if (pose != NULL) {
3324 Invalidate(pose->CalcRect(loc, this, false));
3327 BRect poseRect(pose->CalcRect(this));
3448 BPose* pose = EntryCreated(targetModel->NodeRef(), &destNodeRef,
3451 if (pose != NULL) {
3452 WatchNewNode(pose->TargetModel()->NodeRef());
3455 SelectPose(pose, index);
3456 pose->EditFirstWidget(BPoint(0, index * fListElemHeight), this);
3476 BPose* pose = EntryCreated(targetModel->NodeRef(), &nodeRef, ref.name,
3483 AddPoseToList(fFilteredPoseList, true, true, pose, bounds,
3488 if (pose != NULL) {
3491 SelectPose(pose, index);
3492 pose->EditFirstWidget(BPoint(0, index * fListElemHeight), this);
3527 BPose* pose = fPoseList->ItemAt(index);
3528 PlacePose(pose, viewBounds);
3529 AddToVSList(pose);
3552 BPose* pose = fPoseList->ItemAt(index);
3553 BPoint location(pose->Location(this));
3556 bool intersectsDesktopElements = !IsValidLocation(pose);
3558 // do we need to move pose to a grid location?
3560 // remove pose from VSlist so it doesn't "bump" into itself
3561 RemoveFromVSList(pose);
3564 BRect oldBounds(pose->CalcRect(this));
3566 pose->MoveTo(newLocation, this);
3570 PlacePose(pose, viewBounds);
3571 poseBounds = pose->CalcRect(this);
3574 AddToVSList(pose);
3588 BPoseView::PlacePose(BPose* pose, BRect &viewBounds)
3590 // move pose to probable location
3591 pose->SetLocation(fHintLocation, this);
3592 BRect rect(pose->CalcRect(this));
3595 // make pose rect a little bigger to ensure space between poses
3600 // find an empty slot to put pose into
3604 NextSlot(pose, rect, viewBounds);
3609 pose->SetLocation(fHintLocation, this);
3610 rect = pose->CalcRect(this);
3617 fHintLocation = pose->Location(this) + BPoint(fGrid.x, 0);
3619 pose->SetLocation(rect.LeftTop() + deltaFromBounds, this);
3620 pose->SetSaveLocation();
3625 BPoseView::IsValidLocation(const BPose* pose)
3630 BRect rect(pose->CalcRect(this));
3695 BPose* pose = fPoseList->ItemAt(index);
3696 if (pose->WasAutoPlaced()) {
3697 RemoveFromVSList(pose);
3698 fHintLocation = pose->Location(this);
3699 BRect oldBounds(pose->CalcRect(this));
3700 PlacePose(pose, viewBounds);
3702 BRect newBounds(pose->CalcRect(this));
3703 AddToVSList(pose);
3704 pose->SetAutoPlaced(false);
3732 BPose* pose = fPoseList->ItemAt(index);
3733 BPoint newLocation(pose->Location(this));
3739 Model* model = pose->TargetModel();
3747 Invalidate(pose->CalcRect(this));
3749 RemoveFromVSList(pose);
3750 pose->SetLocation(newLocation, this);
3758 BRect rect(pose->CalcRect(this));
3760 // pose doesn't fit on screen
3764 RemoveFromVSList(pose);
3766 BPoint loc(pose->Location(this));
3770 pose->SetLocation(loc, this);
3776 // pose got reposition by one or both of the above
3777 pose->SetSaveLocation();
3778 AddToVSList(pose);
3780 Invalidate(pose->CalcRect(this));
3781 // make sure the new pose location updates properly
3820 BPoseView::NextSlot(BPose* pose, BRect &poseRect, BRect viewBounds)
3830 pose->SetLocation(fHintLocation, this);
3831 poseRect = pose->CalcRect(this);
3840 // This method performs a binary search on the vertically sorted pose list
3841 // and returns either the index of the first pose at a given y location or
3842 // the proper index to insert a new pose into the list.
3858 // compare turned out equal, find first pose
3866 // didn't find pose AT location y - bump index to proper insert point
3883 BPoseView::AddToVSList(BPose* pose)
3885 int32 index = FirstIndexAtOrBelow((int32)pose->Location(this).y, false);
3886 fVSPoseList->AddItem(pose, index);
3891 BPoseView::RemoveFromVSList(const BPose* pose)
3893 //int32 index = FirstIndexAtOrBelow((int32)pose->Location(this).y);
3895 // than the actual index of the pose we search, thus missing it
3908 if (pose == matchingPose) {
3967 BPose* pose = poseList->ItemAt(index);
3968 fSelectionList->AddItem(pose);
3970 fSelectionPivotPose = pose;
3971 if (!pose->IsSelected()) {
3972 pose->Select(true);
3975 poseRect = pose->CalcRect(this);
3977 poseRect = pose->CalcRect(loc, this, false);
4011 BPose* pose = poseList->ItemAt(index);
4012 if (pose != NULL && pose->IsSelected() != select)
4013 AddRemovePoseFromSelection(pose, index, select);
4024 BPoseView::ScrollIntoView(BPose* pose, int32 index)
4026 ScrollIntoView(CalcPoseRect(pose, index, true));
4059 BPoseView::SelectPose(BPose* pose, int32 index, bool scrollIntoView)
4061 if (pose == NULL || CountSelected() > 1 || !pose->IsSelected())
4064 AddPoseToSelection(pose, index, scrollIntoView);
4066 if (pose != NULL)
4067 fSelectionPivotPose = pose;
4072 BPoseView::AddPoseToSelection(BPose* pose, int32 index, bool scrollIntoView)
4074 // TODO: need to check if pose is member of selection list
4075 if (pose != NULL && !pose->IsSelected()) {
4076 pose->Select(true);
4077 fSelectionList->AddItem(pose);
4079 BRect poseRect = CalcPoseRect(pose, index);
4092 BPoseView::RemovePoseFromSelection(BPose* pose)
4094 if (fSelectionPivotPose == pose)
4097 if (fRealPivotPose == pose)
4100 if (!fSelectionList->RemoveItem(pose)) {
4105 pose->Select(false);
4113 if (pose == poseList->ItemAt(index)) {
4114 Invalidate(pose->CalcRect(loc, this));
4120 Invalidate(pose->CalcRect(this));
4144 BPose* pose = selectionList->ItemAt(index);
4145 if (func(pose, poseView, passThru))
4476 // tenatively figure out the pose we dropped the file onto
4515 // the targetDirectory to it, else set it to this pose view
4924 AddOneToLaunchMessage(BPose* pose, BPoseView*, void* castToParams)
4928 ThrowOnAssert(pose != NULL);
4929 ThrowOnAssert(pose->TargetModel() != NULL);
4932 ? pose->TargetModel() : NULL, true)) {
4933 params->refsMessage->AddRef("refs", pose->TargetModel()->EntryRef());
5049 BPose* pose = targetView->SelectionList()->ItemAt(index);
5051 // remove pose from VSlist before changing location
5052 // so that we "find" the correct pose to remove
5053 // need to do this because bsearch uses top of pose
5054 // to locate pose to remove
5055 targetView->RemoveFromVSList(pose);
5056 BPoint location(pose->Location(targetView) + delta);
5057 BRect oldBounds(pose->CalcRect(targetView));
5065 pose->MoveTo(location, targetView);
5068 targetView->AddToExtent(pose->CalcRect(targetView));
5070 // remove and reinsert pose to keep VSlist sorted
5071 targetView->AddToVSList(pose);
5206 UpdateWasBrokenSymlinkBinder(BPose* pose, Model* model, int32 index,
5213 pose->UpdateWasBrokenSymlink(loc, poseView);
5242 BPoseView::PoseHandleDeviceUnmounted(BPose* pose, Model* model, int32 index,
5250 pose, index);
5256 OneMetaMimeChanged(BPose* pose, Model* model, int32 index,
5268 pose->UpdateIcon(poseLoc, poseView);
5487 BPose* pose = fPoseList->FindPose(&itemNode, &index);
5488 if (pose == NULL) {
5489 // couldn't find pose, first check if the node might be
5490 // target of a symlink pose;
5498 pose = fPoseList->DeepFindPose(&itemNode, &index);
5499 if (pose != NULL) {
5500 DeleteSymLinkPoseTarget(&itemNode, pose, index);
5601 // reject notification if pose already exists
5699 BPose* pose = fPoseList->FindPose(&itemNode, &index);
5705 if (pose != NULL) {
5706 Model* poseModel = pose->TargetModel();
5714 return DeletePose(&itemNode, pose, index);
5723 pose->UpdateAllWidgets(index, loc, this);
5725 _CheckPoseSortOrder(fPoseList, pose, poseListIndex);
5727 if (!visible && FilterPose(pose)) {
5730 AddPoseToList(fFilteredPoseList, true, true, pose,
5732 } else if (visible && !FilterPose(pose))
5733 RemoveFilteredPose(pose, index);
5735 _CheckPoseSortOrder(fFilteredPoseList, pose, index);
5744 pose = ConvertZombieToPose(zombie, index);
5748 if (pose != NULL)
5749 pendingNodeMonitorCache.PoseCreatedOrMoved(this, pose);
5868 BPose* pose = posesFound->ItemAt(i);
5869 Model* poseModel = pose->TargetModel();
5907 pose->UpdateWidgetAndModel(poseModel, attrName, info.type, index,
5912 pose->UpdateWidgetAndModel(poseModel, 0, 0, index, loc, this,
5917 if (!visible && FilterPose(pose)) {
5921 AddPoseToList(fFilteredPoseList, true, true, pose, bounds,
5924 } else if (visible && !FilterPose(pose)) {
5925 RemoveFilteredPose(pose, index);
5935 _CheckPoseSortOrder(fPoseList, pose, poseListIndex);
5937 _CheckPoseSortOrder(fFilteredPoseList, pose, index);
5949 _CheckPoseSortOrder(fPoseList, pose, poseListIndex);
5951 _CheckPoseSortOrder(fFilteredPoseList, pose, index);
5969 PRINT(("model has no pose but is not a zombie either!\n"));
5979 BPoseView::UpdateIcon(BPose* pose)
5983 // need to find the index of the pose in the pose list
5988 if (poseList->ItemAt(index) == pose) {
5999 pose->UpdateIcon(location, this);
6035 BPose* pose = poses->ItemAt(index);
6040 poseLoc = dropEnd + (pose->Location(this) - dropStart);
6059 BPose* pose = (BPose*)fSelectionList->ItemAt(index);
6060 Model* poseModel = pose->TargetModel();
6067 if (fSelectionPivotPose == pose)
6070 if (fRealPivotPose == pose)
6100 BPose* pose = FindPose(point, &index);
6101 if (pose != NULL)
6102 SelectPose(pose, index);
6128 BPose* pose = fSelectionList->ItemAt(0);
6130 // find a point in the pose
6132 int32 index = IndexOfPose(pose);
6163 // see if pose's device has a trash
6182 CopyPoseOneAsEntry(BPose* pose, BObjectList<entry_ref>* trashList,
6185 CopyOneTrashedRefAsEntry(pose->TargetModel()->EntryRef(), trashList,
6350 BPose* pose = fSelectionList->ItemAt(0);
6352 // find a point in the pose
6354 int32 index = IndexOfPose(pose);
6393 BPose* pose = fSelectionList->ItemAt(0);
6395 // find a point in the pose
6397 int32 index = IndexOfPose(pose);
6474 BPose* pose = poseList->ItemAt(index);
6475 fSelectionList->AddItem(pose);
6477 fSelectionPivotPose = pose;
6479 if (!pose->IsSelected()) {
6480 pose->Select(true);
6484 poseRect = pose->CalcRect(this);
6486 poseRect = pose->CalcRect(loc, this);
6489 pose->Draw(poseRect, bounds, this, false);
6523 BPose* pose = poseList->ItemAt(index);
6525 if (pose->IsSelected()) {
6526 fSelectionList->RemoveItem(pose);
6527 pose->Select(false);
6530 fSelectionPivotPose = pose;
6532 fSelectionList->AddItem(pose);
6533 pose->Select(true);
6538 poseRect = pose->CalcRect(this);
6540 poseRect = pose->CalcRect(loc, this);
6602 BPose* pose = poseList->ItemAt(index);
6603 name = pose->TargetModel()->Name();
6607 AddPoseToSelection(pose, index);
6639 BPose* pose = FindNearbyPose(key, &index);
6640 if (pose == NULL)
6644 if (pose->IsSelected()) {
6646 fSelectionPivotPose = pose;
6647 ScrollIntoView(pose, index);
6649 AddPoseToSelection(pose, index, true);
6651 SelectPose(pose, index);
6687 // Select first visible pose
6705 // Select last visible pose
6733 BPose* pose = fSelectionList->FirstItem();
6734 sMatchString.SetTo(pose->TargetModel()->Name());
6741 BPose* pose = FindNextMatch(&index, reverse);
6742 if (pose == NULL) {
6749 pose = FindNextMatch(&index, reverse);
6752 SelectPose(pose, index);
6792 BPose* pose = FindBestMatch(&index);
6793 if (pose == NULL)
6796 SelectPose(pose, index);
6865 BPose* pose = FindBestMatch(&index);
6866 if (pose == NULL)
6869 SelectPose(pose, index);
6885 BPose* pose = fPoseList->ItemAt(index);
6888 if (sMatchString.ICompare(pose->TargetModel()->Name()) > 0) {
6889 if (strcasecmp(pose->TargetModel()->Name(), bestSoFar) >= 0
6891 strlcpy(bestSoFar, pose->TargetModel()->Name(),
6893 poseToSelect = pose;
6897 } else if (sMatchString.ICompare(pose->TargetModel()->Name()) < 0) {
6898 if (strcasecmp(pose->TargetModel()->Name(), bestSoFar) <= 0
6900 strlcpy(bestSoFar, pose->TargetModel()->Name(),
6902 poseToSelect = pose;
6924 BPose* pose = fPoseList->ItemAt(i);
6928 ModelNodeLazyOpener modelOpener(pose->TargetModel());
6929 BTextWidget* widget = pose->WidgetFor(column, this,
6938 score = ComputeTypeAheadScore(pose->TargetModel()->Name(),
6943 poseToSelect = pose;
7020 // find the upper-left pose (I know it's ugly!)
7023 BPose* pose = fVSPoseList->ItemAt(++index);
7024 if (pose == NULL)
7030 BRect poseRect(pose->CalcRect(this));
7036 poseToSelect = pose;
7049 // we're not in list mode so scan visually for pose to select
7052 BPose* pose = fPoseList->ItemAt(index);
7053 BRect poseRect(pose->CalcRect(this));
7063 poseToSelect = pose;
7074 poseToSelect = pose;
7085 poseToSelect = pose;
7096 poseToSelect = pose;
7116 // handle pose selection
7118 BPose* pose = FindPose(where, &index);
7119 if (pose != NULL) {
7120 if (!pose->IsSelected()) {
7122 pose->Select(true);
7123 fSelectionList->AddItem(pose);
7124 DrawPose(pose, index, false);
7131 window->ShowContextMenu(where, pose == NULL ? NULL
7132 : pose->TargetModel()->EntryRef());
7165 AddIfPoseSelected(BPose* pose, PoseList* list)
7167 if (pose->IsSelected())
7168 list->AddItem(pose);
7264 // we now need to update the pose view's selection list by clearing it
7265 // and then polling each pose for selection state and rebuilding list
7342 BPose* pose = FindPose(where, &index);
7343 if (pose != NULL)
7344 DragSelectedPoses(pose, where);
7416 BPose* pose = FindPose(where, &index);
7417 if (pose != NULL) {
7418 if (!pose->IsSelected() || !secondaryMouseButtonDown)
7419 AddRemoveSelectionRange(where, extendSelection, pose);
7422 && (pose != fLastClickedPose || secondaryMouseButtonDown)) {
7426 if (!extendSelection && WasDoubleClick(pose, where, buttons)
7433 if (!WasClickInPath(pose, index, where))
7434 OpenSelection(pose, &index);
7437 // click was not in any pose
7474 BPose* pose = FindPose(where, &index);
7476 if (pose != NULL && fLastClickedPose != NULL && fAllowPoseEditing
7482 pose->MouseUp(BPoint(0, index * fListElemHeight), this, where, index);
7485 // Showing the pose context menu is done on mouse up (or long click)
7487 if (pose != NULL && fTrackRightMouseUp
7489 if (!pose->IsSelected()) {
7491 pose->Select(true);
7492 fSelectionList->AddItem(pose);
7493 DrawPose(pose, index, false);
7507 BPoseView::WasClickInPath(const BPose* pose, int32 index,
7510 if (pose == NULL || (ViewMode() != kListMode))
7515 if (!pose->PointInPose(loc, this, mouseLocation, &widget) || !widget)
7540 BPoseView::WasDoubleClick(const BPose* pose, BPoint point, int32 buttons)
7549 && pose == fLastClickedPose) {
7559 fLastClickedPose = pose;
7587 BPoseView::DragSelectedPoses(const BPose* pose, BPoint clickPoint)
7592 ASSERT(pose);
7594 // make sure pose is selected, it could have been deselected as part of
7596 if (!pose->IsSelected())
7599 // setup tracking rect by unioning all selected pose rects
7620 int32 index = CurrentPoseList()->IndexOf(pose);
7722 BPose* pose = poseList->ItemAt(index);
7723 if (pose->IsSelected()) {
7724 BRect poseRect(pose->CalcRect(loc, this, true));
7727 pose->Draw(poseRect, poseRect, this, view, true, offsetBy,
7742 BPose* pose = fVSPoseList->ItemAt(index);
7743 if (pose != NULL && pose->IsSelected()) {
7744 BRect poseRect(pose->CalcRect(this));
7749 pose->Draw(poseRect, poseRect, this, view, true, offsetBy,
7791 BPose* pose = poseList->ItemAt(clickedPoseIndex);
7793 // get starting rect of clicked pose
7794 result = CalcPoseRectList(pose, clickedPoseIndex, true);
7802 pose = poseList->ItemAt(index);
7803 if (pose->IsSelected())
7804 result = result | pose->CalcRect(loc, this, true);
7811 // get starting rect of clicked pose
7812 result = pose->CalcRect(this);
7819 BPose* pose = fVSPoseList->ItemAt(index);
7820 if (pose != NULL) {
7821 if (pose->IsSelected())
7822 result = result | pose->CalcRect(this);
7824 if (pose->Location(this).y > bounds.bottom)
7837 // TODO: This is a mess due to pose rect calculation and list management
7863 BPose* pose = poseList->ItemAt(index);
7864 if (pose == NULL)
7869 poseRect = pose->CalcRect(listLoc, this);
7871 poseRect = pose->CalcRect(this);
7874 bool selected = pose->IsSelected();
7875 pose->Select(!fSelectionList->HasItem(pose));
7880 if ((selected != pose->IsSelected())
7887 fSelectionPivotPose = pose;
7895 if (pose->Location(this).y > selectionRect.bottom)
7907 BPose* pose = poseList->ItemAt(oldIndex);
7908 pose->Select(!pose->IsSelected());
7913 poseRect = pose->CalcRect(listLoc, this);
7915 poseRect = pose->CalcRect(this);
7930 BPose* pose)
7932 ASSERT(pose != NULL);
7934 if (pose == fSelectionPivotPose && !extendSelection)
7938 // multi pose extend/shrink current selection
7939 bool select = !pose->IsSelected() || !extendSelection;
7955 int32 currentSelectedIndex = poseList->IndexOf(pose);
8000 int32 index = CurrentPoseList()->IndexOf(pose);
8002 if (!pose->IsSelected()) {
8005 AddRemovePoseFromSelection(pose, index, true);
8006 fSelectionPivotPose = pose;
8010 AddRemovePoseFromSelection(pose, index, !pose->IsSelected());
8014 // If the list is empty, there cannot be a pivot pose,
8016 // pose.
8021 fSelectionPivotPose = pose;
8022 fRealPivotPose = pose;
8028 BPoseView::DeleteSymLinkPoseTarget(const node_ref* itemNode, BPose* pose,
8031 ASSERT(pose->TargetModel()->IsSymLink());
8036 WatchParentOf(pose->TargetModel()->EntryRef());
8039 pose->TargetModel()->SetLinkTo(NULL);
8040 pose->UpdateBrokenSymLink(loc, this);
8045 BPoseView::DeletePose(const node_ref* itemNode, BPose* pose, int32 index)
8049 if (pose == NULL)
8050 pose = fPoseList->FindPose(itemNode, &index);
8052 if (pose != NULL) {
8054 if (pose->TargetModel()->IsSymLink()) {
8055 fBrokenLinks->RemoveItem(pose->TargetModel());
8056 StopWatchingParentsOf(pose->TargetModel()->EntryRef());
8057 Model* target = pose->TargetModel()->LinkTo();
8064 if (pose == fDropTarget)
8067 if (pose == ActivePose())
8074 fSelectionList->RemoveItem(pose);
8075 if (fSelectionPivotPose == pose)
8077 if (fRealPivotPose == pose)
8080 if (pose->IsSelected() && fSelectionChangedHook)
8095 if (pose->HasLocation())
8096 RemoveFromVSList(pose);
8101 invalidRect = CalcPoseRectList(pose, index);
8103 invalidRect = pose->CalcRect(this);
8118 BPose* pose = CurrentPoseList()->ItemAt(index);
8120 if (pose == NULL && bounds.top > 0) {
8128 delete pose;
8161 // return pose at location h,v (search list starting from bottom so
8162 // drawing and hit detection reflect the same pose ordering)
8172 BPose* pose = CurrentPoseList()->ItemAt(index);
8173 if (pose != NULL && pose->PointInPose(loc, this, point))
8174 return pose;
8178 BPose* pose = fPoseList->ItemAt(index);
8179 if (pose->PointInPose(this, point)) {
8183 return pose;
8205 BPose* pose = FindPose(BPoint(fListOffset, Bounds().top + Frame().Height()
8207 if (pose == NULL) {
8209 pose = CurrentPoseList()->LastItem();
8213 return pose;
8223 // get first selected pose in selection if none was clicked
8270 BPose* pose = fSelectionList->ItemAt(index);
8271 message.AddRef("refs", pose->TargetModel()->EntryRef());
8353 BPose* pose = fSelectionList->ItemAt(index);
8354 if (pose == NULL)
8357 Model* model = pose->TargetModel();
8381 // clear all pose lists
8569 BPose* pose = fSelectionList->ItemAt(index);
8571 // to check if pose is a query, follow any symlink first
8572 BEntry resolvedEntry(pose->TargetModel()->EntryRef(), true);
8581 message.AddRef("refs", pose->TargetModel()->EntryRef());
8687 BPose* pose = fSelectionList->ItemAt(index);
8688 BEntry entry(pose->TargetModel()->ResolveIfLink()->EntryRef());
8716 BPose* pose = poseList->ItemAt(index);
8717 if (pose->IsSelected()) {
8718 pose->Select(false);
8719 Invalidate(pose->CalcRect(loc, this, false));
8731 BPose* pose = fVSPoseList->ItemAt(index);
8732 if (pose != NULL) {
8733 if (pose->IsSelected()) {
8734 pose->Select(false);
8735 Invalidate(pose->CalcRect(this));
8738 if (pose->Location(this).y > bounds.bottom)
8777 BPose* pose = poseList->ItemAt(index);
8778 if (fSelectionList->HasItem(pose))
8779 if (pose->IsSelected() != show
8782 pose->Select(show);
8784 pose->Draw(BRect(pose->CalcRect(loc, this, false)),
8797 BPose* pose = fVSPoseList->ItemAt(index);
8798 if (pose != NULL) {
8799 if (fSelectionList->HasItem(pose))
8800 if (pose->IsSelected() != show
8803 pose->Select(show);
8805 Invalidate(pose->CalcRect(this));
8808 if (pose->Location(this).y > bounds.bottom)
8817 BPose* pose = fSelectionList->ItemAt(index);
8818 if (pose->IsSelected() != show && !fShowSelectionWhenInactive)
8819 pose->Select(show);
8836 BPoseView::AddRemovePoseFromSelection(BPose* pose, int32 index, bool select)
8839 if (select == pose->IsSelected())
8842 pose->Select(select);
8846 Invalidate(pose->CalcRect(BPoint(0, index * fListElemHeight),
8849 Invalidate(pose->CalcRect(this));
8852 fSelectionList->AddItem(pose);
8854 fSelectionList->RemoveItem(pose, false);
8855 if (fSelectionPivotPose == pose)
8858 if (fRealPivotPose == pose)
8877 BPose* pose = fSelectionList->ItemAt(i);
8878 if (pose == NULL || pose->TargetModel() == NULL)
8881 entry.SetTo(pose->TargetModel()->EntryRef());
8939 BPose* pose;
8942 pose = fSelectionList->ItemAt(i);
8943 selected = pose->TargetModel();
8944 if (pose == NULL || selected == NULL)
9112 BPoseView::DrawPose(BPose* pose, int32 index, bool fullDraw)
9114 BRect rect = CalcPoseRect(pose, index, fullDraw);
9117 && pose->TargetModel()->IsVolume()) {
9120 pose->Draw(rect, rect, this, fullDraw);
9247 BPose* pose = poseList->ItemAt(index);
9248 BRect poseRect(pose->CalcRect(location, this, true));
9249 pose->Draw(poseRect, updateRect, this, true);
9257 BPose* pose = fPoseList->ItemAt(index);
9258 BRect poseRect(pose->CalcRect(this));
9260 pose->Draw(poseRect, updateRect, this, true);
9302 BPose* pose = poseList->ItemAt(index);
9312 pose->Draw(dstRect, updateRect, this, offscreenView, true,
9313 offsetBy, pose->IsSelected());
9352 BPoseView::CheckPoseSortOrder(BPose* pose, int32 oldIndex)
9354 _CheckPoseSortOrder(CurrentPoseList(), pose, oldIndex);
9359 BPoseView::_CheckPoseSortOrder(PoseList* poseList, BPose* pose, int32 oldIndex)
9366 // take pose out of list for BSearch
9369 int32 orientation = BSearchList(poseList, pose, &afterIndex, oldIndex);
9378 poseList->AddItem(pose, oldIndex);
9383 poseList->AddItem(pose, newIndex);
9387 BRect invalidRect(CalcPoseRectList(pose, oldIndex));
9391 InsertPoseAfter(pose, &afterIndex, orientation, &invalidRect);
9392 poseList->AddItem(pose, newIndex);
9400 // pose comparison and lazy text widget adding
9479 BPoseView::BSearchList(PoseList* poseList, const BPose* pose,
9487 if (PoseCompareAddWidget(pose, firstPose, this) < 0) {
9496 valid = valid && PoseCompareAddWidget(pose,
9499 valid = valid && PoseCompareAddWidget(pose,
9509 const BPose* searchResult = BSearch(poseList, pose, this,
9518 int32 result = PoseCompareAddWidget(pose, poseList->ItemAt(index),
9589 DumpOne(BPose* pose, void*)
9591 pose->TargetModel()->PrintToStream(0);
9604 // PRINT(("pose list count %d\n", fPoseList->CountItems()));
9873 BPose* pose = fVSPoseList->ItemAt(index);
9874 if (pose != NULL) {
9875 if (pose == fDropTarget) {
9876 *poseRect = pose->CalcRect(this);
9881 if (pose->Location(this).y > bounds.bottom) {
10019 BPose* pose = fVSPoseList->ItemAt(index);
10020 if (pose != NULL) {
10021 if (pose == fDropTarget) {
10022 BRect poseRect = pose->CalcRect(this);
10028 pose->DeselectWithoutErasingBackground(poseRect, this);
10030 pose->Draw(poseRect, poseRect, this, false);
10034 if (pose->Location(this).y > bounds.bottom)
10221 BPoseView::CalcPoseRect(const BPose* pose, int32 index,
10225 return CalcPoseRectList(pose, index, firstColumnOnly);
10227 return CalcPoseRectIcon(pose);
10232 BPoseView::CalcPoseRectIcon(const BPose* pose) const
10234 return pose->CalcRect(this);
10239 BPoseView::CalcPoseRectList(const BPose* pose, int32 index,
10242 return pose->CalcRect(BPoint(0, index * fListElemHeight), this,
10360 BPoseView::EnsurePoseUnselected(BPose* pose)
10362 if (pose == fDropTarget)
10365 if (pose == ActivePose())
10368 fSelectionList->RemoveItem(pose);
10369 if (fSelectionPivotPose == pose)
10372 if (fRealPivotPose == pose)
10375 if (pose->IsSelected()) {
10376 pose->Select(false);
10384 BPoseView::RemoveFilteredPose(BPose* pose, int32 index)
10386 EnsurePoseUnselected(pose);
10389 BRect invalidRect = CalcPoseRectList(pose, index);
10422 BPose* pose = fFilteredPoseList->ItemAt(i);
10423 if (!FilterPose(pose))
10424 RemoveFilteredPose(pose, i);
10440 BPose* pose = fFilteredPoseList->LastItem();
10441 if (pose == NULL)
10455 BPoseView::FilterPose(BPose* pose)
10457 if (!fFiltering || pose == NULL)
10462 ReadPoseInfo(pose->TargetModel(), &poseInfo);
10463 if (pose->TargetModel()->OpenNode() != B_OK)
10465 if (!ShouldShowPose(pose->TargetModel(), &poseInfo))
10475 ModelNodeLazyOpener modelOpener(pose->TargetModel());
10477 BTextWidget* widget = pose->WidgetFor(ColumnAt(i), this, modelOpener);
10512 BPose* pose = fPoseList->ItemAt(i);
10513 if (FilterPose(pose))
10514 fFilteredPoseList->AddItem(pose);
10516 EnsurePoseUnselected(pose);
10568 BPose* pose = fSelectionList->ItemAt(index);
10569 if (CanTrashForeignDrag(pose->TargetModel())) {
10570 RemovePoseFromSelection(pose);
10603 TPoseViewFilter::TPoseViewFilter(BPoseView* pose)
10606 fPoseView(pose)