History log of /haiku/src/kits/tracker/Pose.h
Revision Date Author Comments
# 8446d3b9 13-Dec-2023 John Scipione <jscipione@gmail.com>

Tracker: Miscellaneous cleanup

Move DraggableContainerIcon out of ContainerWindow.cpp into new.
Move CompareLabels to Utilities.cpp

Rename fContainerWindowFlags to fOpenFlags. These are the flags set
by OpenContainerWindow to save and restore state and should not be
confused with the windowFlags that are passed to BWindow. There are
two sets of flags, which I'm calling openFlags and windowFlags.

Rename fUseLayouts to fUsesLayout and useLayouts to useLayout. Put
all the constructor created flags at the top.

"window" variable name is ok, we don't need to say "containerWindow".

Rename Addons to AddOns everywhere with a capital O.
Rename BuildAddOnMenu() to BuildAddOnsMenu() with an s.
Rename AttributeMenu...() methods to AttributesMenu...() with an s.
Rename SetUp...() methods to Setup...() with a lowercase u.

Replace a few instances of fPoseView with PoseView() inline in
BContainerWindow and BDeskWindow.

A few more minor fixes in BDeskWindow.

Replace BPoint(0, 0) with B_ORIGIN in Pose.h

Change-Id: If30803753b63b19e35f14c0f0c4e08111d0d0980
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7240
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# a63a6739 23-Apr-2023 John Scipione <jscipione@gmail.com>

Tracker: Whitespace, alphabetize style fixes

No functional change intended.

Change-Id: Ib47f6b04e372923a5d2a1774ce4e3f56d8b05792
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6370
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 0c973c94 26-Aug-2022 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: Refactor IconCache size handling and usages.

* Instead of taking an icon_size, which we were having to cast
random integers to anyway, just take a BSize and convert internally
as needed. This simplifies a lot of usages of IconCache methods.

* Compute what B_MINI_ICON size will be at startup. This way,
we do not wind up caching "mini" icons in the fLarge*Icon variables
under HiDPI.

This does have a downside that if anything actually
does try to fetch "true mini" (16x16) icons when the real
ComposeIconSize(B_MINI_ICON) is larger than that, it will wind up
(confusingly) in fLarge*Icon, but that should not cause problems
and after this commit should not happen at all, anyway.

* Make mini-icon-mode use ComposeSize instead of the hardcoded 16x16,
and adjust metrics computations around it.

* Fetch larger icons in MountMenu logic. Also use BString::SetToFormat.

* Remove an unused, deprecated method from BPoseView.

* Rename variables in thumbnail generation code to match new behavior.


# 46dd7d50 09-Sep-2015 Axel Dörfler <axeld@pinc-software.de>

Tracker: Fixed vertical list icon position.

* Instead of drawing it at the bottom of the line, draw it in the
middle of it.


# f13a47d2 14-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: Pose style fixes kind => which


# d7e68211 04-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: miscellaneous style fixes


# 6b1b5709 20-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes to Pose class


# a51764c5 27-Jul-2012 John Scipione <jscipione@gmail.com>

WIP: Yet more style fixes, mostly 80 char violations.


# b05aa8b5 27-Jul-2012 John Scipione <jscipione@gmail.com>

Style changes in Tracker, no functional change.

Manual whitespace cleanup
Change instances of const char * to const char*
Convert /* */ C style comments to // C++ style comments


# 545ebde0 30-Jan-2010 Michael Lotz <mmlr@mlotz.ch>

Implement type ahead filtering (this time for real and without abusing the
vertically sorted pose list). When enabled typing will filter based on the
currently visible attribute columns. Using shift-space as a delimiter
independent filtering strings can be typed, so you can filter based on multiple
attributes at once to refine results while you type. Filtering stays active
until you cancel it using the escape key. While the filtered result is displayed
all normal file operations can be used. Using the return key while filtering
auto-selects and opens the first filter result, allowing for fast traversal
through directories and directly opening the topmost result.

* Introduces fFilteredPoseList which stores the active filter result. The list
is only used when filtering is currently active, so no syncing is required
otherwise.
* Some minor adjustments to leave out invalidations where non-visible poses are
updated.
* Account for the now possible multiple lists throughout BPoseView.
* Add filter string output to the CountView and made that one a bit wider.
* Added all the settings-cruft for type ahead filtering (defaults to off).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35339 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 50f1b82d 19-Aug-2009 Alexandre Deckner <alex@zappotek.com>

* Rewrote rename-click detection to be more usable. The code is much smaller
and is based on the pose selection time, not on click time. It is more
robust and since the selection might have been by click, keyboard or
selection rect, it makes the behavior very pleasant (in my opinion) for
multiselections. Try and tell me!
* Disabled the modifiers (first click editing). Too many of them, and
conflicting with other usages, i'd like your opinions/preferences.
* Removed old, hackish and now unused DelayedEdit/SetDelayedEdit stuff.

Fixes #3617



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32529 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6a71afb0 08-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Sorry for mixing some cleanups into this patch...
* When changing icon sizes, invalidate before scrolling. This causes silent
scrolling in app_server and avoids a visual jerk. Everything needs to be
re-drawn at the new icon size anyways.
* Removed the fUpdateRegion member from BPoseView. It was supposed to make
drawing quicker, but it only made it slower. Checking for intersection with
the update rect passed to Draw() should be much more straight forward and
does not involve app_server communication...
* Refactored some misnamed methods, ScrollIntoView() would always draw and
only sometimes scroll - I couldn't agree with that.
* There is a very confusing mix of "fullDraw" and "minimalRect" booleans which
seem to be used with wrong semantics. The minimalRect flag passed to BPose::
CalcRect() means to get the pose rect for the icon and the first column only,
not all columns. Contrary to that, some pose rect calculation happens with
minimalRect == fullDraw... I tried to fix some of that.
* The visible changes of this patch are when adding poses. The
SynchronousUpate() wasn't working so well, I made it work reliably by invoking
Invalidate() and Window()->UpdateIfNeeded(), which also takes care of any
drawing that the app_server has to do for the background. And it's flicker
free in double buffered mode...
-> This fixes poses being drawn multiple times and the text getting darker.
* And there was another bug when adding poses. The extent (bottom of last item
in list view for example) can be just above the current view bounds. When the
next item is added above the view bounds, then the extent scrolls into view,
but there is nothing to be scrolled in this case. srcRect is still invalid
and so is dstRect. But destRect should be valid in this case.
-> This fixes some poses being cut off at the bottom when opening Tracker
windows.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30033 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 96da4b41 07-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

* Fix the completely broken desktop icon size changing which I introduced
yesterday. It needs to auto-place icons which go out of view or underneath
the deskbar or a replicant. Also it obviously cannot scroll to keep the
view "centered" as normal Tracker windows.
* Fix/improve the desktop context menu with regards to icon size options. It
also displays the shortcuts, which now work on the desktop too.
* When doing an icon cleanup on the desktop, not only the deskbar is avoided,
but also replicant views.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30009 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7cdbeb0e 06-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

* Changing the icon size will now work more like simply scaling/zooming the
view. BPose converts the scale in SetLocation() and Location(), which does
_not_ affect performance for list mode, BTW. So that should be fine.
* The center of the pose view is now locked when changing the icon size.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29974 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 95da0645 14-Feb-2009 Rene Gollent <anevilyak@gmail.com>

Some pose performance improvements by aldeck and myself:
1) We don't need to call FindPose() on every pose as we're freshly adding it,
and a duplicate should never happen in this circumstance (the FindPose() is still there if
Tracker is compiled in debug mode however.
2) Adjust the FSClipboard calls such that the locking is optional. This allows us to lock
once per CreatePoses group rather than once per pose.

Together these changes make for a significant performance improvement when it comes to
populating a large folder.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29198 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e9842421 31-Oct-2008 Alexandre Deckner <alex@zappotek.com>

* On date format change, remove the need for the synchronous call to
DrawViewCommon(), simply invalidate since the logic is simplified now,
see below.
* Reworked the way TimeAttributeText was updated when date format is
changed. Got rid of the recalculatText flag propagation, it was broken
since forever anyway (was here on r5 max4.1): It was only updating
visible poses and wasn't robust in certain cases. Besides, it was
cluttering the code on several layers upfront only for date format changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28402 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 687e327b 19-Jun-2007 Michael Lotz <mmlr@mlotz.ch>

Reworked the handling of periodically updated poses (currently only ones with a volume space bar):

* Addad global list where poses that need periodic updates can be registered with a callback
* Use this mechanism for poses with a volume space bar
* Create only one BVolume when the BPose is created for a volume, instead of every time the free space is calculated
* On Pulse() the global list is used to update all of the registered periodic update poses
* As the poses know their volume, it is no longer necessary to use a BVolumeRoster to loop through each volume on each Pulse()
* Removed the now superfluous SendNotices() mechanism
* Removed corresponding watching / handling of these notices in BPoseView

The BPoseView did a linear search for each volume pose on each Pulse() before. What's more it did this once for each mounted volume as it did get one individual notice for each of them. To get these volumes a BVolumeRoster was used to loop through the volumes, but then the BPose did still create a new BVolume to actually calculate the free space! I'm surprised that it did not suck away more performance with this method...

Anyway, this should bring down BVolume construction and update overhead down to a minimum and hopefully fix ticket #1247.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21462 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 693f381e 31-May-2006 Stephan Aßmus <superstippi@gmx.de>

Fixed a weird Tracker bug, fOkToMapIcons was initialized to "true", but
I have no idea what sense this makes. When switching from list mode to
icon mode, some poses had their locations set to location "infinity",
because MapToNewIconMode did a division by zero. This resulted in feeding
the scrollbars a totally insane range.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17673 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6d01b66d 13-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

GCC 4 fixes by Ingo Weinhold.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14893 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 02be5353 22-May-2005 Axel Dörfler <axeld@pinc-software.de>

Added libtracker.so to the repository and the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12772 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 46dd7d5077c0ef26d079ae007f158abdec06de83 09-Sep-2015 Axel Dörfler <axeld@pinc-software.de>

Tracker: Fixed vertical list icon position.

* Instead of drawing it at the bottom of the line, draw it in the
middle of it.


# f13a47d22483f23f0dd9cc9ce043c25ba73bd073 14-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: Pose style fixes kind => which


# d7e682113776632e5c04a6558eca0c5650a164e4 04-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: miscellaneous style fixes


# 6b1b5709a62ce2eb583c3f111e18bb64447f5ca7 20-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes to Pose class


# a51764c53eecd8ca5f6312b92d8baccda89d5b1d 27-Jul-2012 John Scipione <jscipione@gmail.com>

WIP: Yet more style fixes, mostly 80 char violations.


# b05aa8b5b16e5b4f420a35c37805c6387df98737 27-Jul-2012 John Scipione <jscipione@gmail.com>

Style changes in Tracker, no functional change.

Manual whitespace cleanup
Change instances of const char * to const char*
Convert /* */ C style comments to // C++ style comments


# 545ebde00c3d50510a5236de1c5eef25ac21d757 30-Jan-2010 Michael Lotz <mmlr@mlotz.ch>

Implement type ahead filtering (this time for real and without abusing the
vertically sorted pose list). When enabled typing will filter based on the
currently visible attribute columns. Using shift-space as a delimiter
independent filtering strings can be typed, so you can filter based on multiple
attributes at once to refine results while you type. Filtering stays active
until you cancel it using the escape key. While the filtered result is displayed
all normal file operations can be used. Using the return key while filtering
auto-selects and opens the first filter result, allowing for fast traversal
through directories and directly opening the topmost result.

* Introduces fFilteredPoseList which stores the active filter result. The list
is only used when filtering is currently active, so no syncing is required
otherwise.
* Some minor adjustments to leave out invalidations where non-visible poses are
updated.
* Account for the now possible multiple lists throughout BPoseView.
* Add filter string output to the CountView and made that one a bit wider.
* Added all the settings-cruft for type ahead filtering (defaults to off).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35339 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 50f1b82d5b7fe9b4d37fd4b56039ce921941fb70 19-Aug-2009 Alexandre Deckner <alex@zappotek.com>

* Rewrote rename-click detection to be more usable. The code is much smaller
and is based on the pose selection time, not on click time. It is more
robust and since the selection might have been by click, keyboard or
selection rect, it makes the behavior very pleasant (in my opinion) for
multiselections. Try and tell me!
* Disabled the modifiers (first click editing). Too many of them, and
conflicting with other usages, i'd like your opinions/preferences.
* Removed old, hackish and now unused DelayedEdit/SetDelayedEdit stuff.

Fixes #3617



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32529 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6a71afb0d1c29bfa1fcc45e0d6aa191e2f09e028 08-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Sorry for mixing some cleanups into this patch...
* When changing icon sizes, invalidate before scrolling. This causes silent
scrolling in app_server and avoids a visual jerk. Everything needs to be
re-drawn at the new icon size anyways.
* Removed the fUpdateRegion member from BPoseView. It was supposed to make
drawing quicker, but it only made it slower. Checking for intersection with
the update rect passed to Draw() should be much more straight forward and
does not involve app_server communication...
* Refactored some misnamed methods, ScrollIntoView() would always draw and
only sometimes scroll - I couldn't agree with that.
* There is a very confusing mix of "fullDraw" and "minimalRect" booleans which
seem to be used with wrong semantics. The minimalRect flag passed to BPose::
CalcRect() means to get the pose rect for the icon and the first column only,
not all columns. Contrary to that, some pose rect calculation happens with
minimalRect == fullDraw... I tried to fix some of that.
* The visible changes of this patch are when adding poses. The
SynchronousUpate() wasn't working so well, I made it work reliably by invoking
Invalidate() and Window()->UpdateIfNeeded(), which also takes care of any
drawing that the app_server has to do for the background. And it's flicker
free in double buffered mode...
-> This fixes poses being drawn multiple times and the text getting darker.
* And there was another bug when adding poses. The extent (bottom of last item
in list view for example) can be just above the current view bounds. When the
next item is added above the view bounds, then the extent scrolls into view,
but there is nothing to be scrolled in this case. srcRect is still invalid
and so is dstRect. But destRect should be valid in this case.
-> This fixes some poses being cut off at the bottom when opening Tracker
windows.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30033 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 96da4b41b0baadab6c3f9b2fcdfe6573df564d4c 07-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

* Fix the completely broken desktop icon size changing which I introduced
yesterday. It needs to auto-place icons which go out of view or underneath
the deskbar or a replicant. Also it obviously cannot scroll to keep the
view "centered" as normal Tracker windows.
* Fix/improve the desktop context menu with regards to icon size options. It
also displays the shortcuts, which now work on the desktop too.
* When doing an icon cleanup on the desktop, not only the deskbar is avoided,
but also replicant views.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30009 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7cdbeb0e13344e4ac5d504c1bdec50e668bbe000 06-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

* Changing the icon size will now work more like simply scaling/zooming the
view. BPose converts the scale in SetLocation() and Location(), which does
_not_ affect performance for list mode, BTW. So that should be fine.
* The center of the pose view is now locked when changing the icon size.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29974 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 95da064570eefc4815a20f8e547f1fc58a7565fc 14-Feb-2009 Rene Gollent <anevilyak@gmail.com>

Some pose performance improvements by aldeck and myself:
1) We don't need to call FindPose() on every pose as we're freshly adding it,
and a duplicate should never happen in this circumstance (the FindPose() is still there if
Tracker is compiled in debug mode however.
2) Adjust the FSClipboard calls such that the locking is optional. This allows us to lock
once per CreatePoses group rather than once per pose.

Together these changes make for a significant performance improvement when it comes to
populating a large folder.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29198 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e9842421554da064c665301a10b6a6b3f69ac818 31-Oct-2008 Alexandre Deckner <alex@zappotek.com>

* On date format change, remove the need for the synchronous call to
DrawViewCommon(), simply invalidate since the logic is simplified now,
see below.
* Reworked the way TimeAttributeText was updated when date format is
changed. Got rid of the recalculatText flag propagation, it was broken
since forever anyway (was here on r5 max4.1): It was only updating
visible poses and wasn't robust in certain cases. Besides, it was
cluttering the code on several layers upfront only for date format changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28402 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 687e327bace5d8abca3e75ce74a8f532fac5c151 19-Jun-2007 Michael Lotz <mmlr@mlotz.ch>

Reworked the handling of periodically updated poses (currently only ones with a volume space bar):

* Addad global list where poses that need periodic updates can be registered with a callback
* Use this mechanism for poses with a volume space bar
* Create only one BVolume when the BPose is created for a volume, instead of every time the free space is calculated
* On Pulse() the global list is used to update all of the registered periodic update poses
* As the poses know their volume, it is no longer necessary to use a BVolumeRoster to loop through each volume on each Pulse()
* Removed the now superfluous SendNotices() mechanism
* Removed corresponding watching / handling of these notices in BPoseView

The BPoseView did a linear search for each volume pose on each Pulse() before. What's more it did this once for each mounted volume as it did get one individual notice for each of them. To get these volumes a BVolumeRoster was used to loop through the volumes, but then the BPose did still create a new BVolume to actually calculate the free space! I'm surprised that it did not suck away more performance with this method...

Anyway, this should bring down BVolume construction and update overhead down to a minimum and hopefully fix ticket #1247.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21462 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 693f381e833e2bc6021764ee0610af1b4c67b0ad 31-May-2006 Stephan Aßmus <superstippi@gmx.de>

Fixed a weird Tracker bug, fOkToMapIcons was initialized to "true", but
I have no idea what sense this makes. When switching from list mode to
icon mode, some poses had their locations set to location "infinity",
because MapToNewIconMode did a division by zero. This resulted in feeding
the scrollbars a totally insane range.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17673 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6d01b66d300c2841dba033705f120a7f6e709696 13-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

GCC 4 fixes by Ingo Weinhold.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14893 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 02be5353fd41ea40007a382e13f007eaf6b5a3a0 22-May-2005 Axel Dörfler <axeld@pinc-software.de>

Added libtracker.so to the repository and the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12772 a95241bf-73f2-0310-859d-f6bbb57e9c96