History log of /haiku/src/kits/tracker/Attributes.h
Revision Date Author Comments
# 7f819534 05-Aug-2021 John Scipione <jscipione@gmail.com>

Tracker: Add thumbnail support

Define thumbnail attributes in Attributes.h:
Media:Thumbnail to store the thumbnail,
Media:Thumbnail:CreationTime to see if thumbs need to be regenerated.

Store 128x128 thumbnail in attribute, for icon sizes smaller than
128x128 down-scale the 128x128 thumbnail. Use B_FILTER_BITMAP_BILINEAR
to down-scale the image using the bilinear scaling algorithm which
creates nicer looking thumbnails than the default scaling algorithm.

Store thumbnails as WebP images which compress smaller than PNGs and
fit in the inode better at 128x128.

Check the file's modification time in GetFileIconFromAttr() and compare
it to the thumbnail creation time. If the file has not been modified
since the last time we generated thumbnails return the thumbnail from
the attribute, otherwise fetch a new thumbnail with GetThumbnailIcon().

Add "Generate image thumbnails" Tracker setting. Default is turned off
for now. To generate image thumbnails you must first turn this setting
on in Tracker Windows preferences.

Spawn a get_thumbnail() thread to generate thumbnails and retrieve them
later on from the window thread to fill out into the icon. This should
improve responsiveness of generating thumbnails from a folder with a
lot of images. The generator thread will write the thumbnail data to an
attribute if on writable BFS volume.

If not on writable BFS volume, the generator thread will send the data
back to the original thread through a port by calling write_port().

When the thread is finished creating the thumbnail it sends a message
back to the Tracker application thread to update the pose which
instructs the window thread to look for an thumbnail. It either finds a
thumbnail in an attribute, or picks up the thumbnail data that has been
sent through write_port() using read_port().

This works on both read-write and read-only BFS volumes but it still
depends on the presence of a BEOS:TYPE parameter to have been written
to the volume before it became read-only. Thumbnail generation does not
work on other read-only volumes for example an ISO-9660 CD, but it does
work on read-only BFS volumes for example the BeOS R5 CD.

Move BPrivate::CheckNodeIconHintPrivate() from BNodeInfo to Tracker
Model CheckNodeIconHint(). Create Model::CheckAppIconHint() and look
for a vector icon or mini and large icon in that method. Check that
the base type is directory, volume, trash, desktop, or if executable
call CheckAppIconHint().

Add 1 to temp_name to fix the following warning:
src/kits/tracker/FSUtils.cpp:2437:12: note: 'snprintf' output 3 or more
bytes (assuming 267) into a destination of size 266

Rename temp_name to tempName following our style guidelines. Use
strlcpy() and strlcat() instead of strcpy() to safely copy the string.
This fixes thumbnail generation on 64-bit Haiku.

Change-Id: I7f927a5a1f8cf65e4b1aa1e0eb55bbfae87fd969
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3163
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 9e168cf4 20-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes to Attributes.h


# 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


# 5987b2a3 07-Apr-2011 Jonas Sundström <jonas@kirilla.com>

Offer a 'Real name' column in Tracker list view mode, when set to show localized names. As discussed a while back. I honestly don't know if this is such a great idea after all. Name + real name is kind of silly. Ideally it would be labeled in a more logical way, or the feature should be dropped.

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


# 01dffd8e 14-Jan-2010 Rene Gollent <anevilyak@gmail.com>

More Tracker refactoring:
* relocated Trash dirs to volume roots by modifying find_directory() to report the trash location as volume/Trash.
* FSUtils no longer creates /home/Desktop on every volume.
* TrashWatcher now keeps icons in sync on all volumes.
* Simplified FSGetDeskDir since it no longer has to worry about getting the desk directory on any volume other than the root.
* Relocated trash context menu logic to BContainerWindow so it can also be used at the volume roots.
* DesktopPoseView now creates a virtual Trash pose representing the trash contents as before.
* Corrected typo: Model::WriteAttrKillForegin() -> Model::WriteAttrKillForeign().

Closes ticket #5245.



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


# 671dd808 12-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Various cleanups:
* Removed dead/obsolete Integrate Non-boot Desktops code.
* Modified PoseView to ignore the fInvisible attribute of BPoseInfo for now.
This has the net effect that the Desktop folder and /boot/var are no longer
hidden from the user. To go with this change, Tracker no longer forcibly
writes that hidden setting to those folders on access. This feature might
be useful again in the future (especially in conjunction with relocating
the Trash folder somewhere such as the disk root), but is currently somewhat
problematic because those dual-booting with BeOS will still have a Tracker
that force writes those attributes which would bring us back to square one
with respect to showing the Desktop folder when we start respecting the
attribute again. Suggestions welcome. Haiku-only users can remove the
_trk/pinfo_le attribute on those folders to remove the invisibility
in any case.
* TrackerSettings: Removed obsolete desktop integration settings. Also
modified TrackerSettings parser to skip unrecognized settings instead
of aborting the settings file parsing process entirely.

Closes ticket #2872.



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


# 9ecf9d1c 26-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Merge from layout management branch.


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


# 12104c2e 26-May-2006 Stephan Aßmus <superstippi@gmx.de>

synced with OT repository - I guess you knew what was comming,
Tracker saves and restores the window decorator settings on
Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17602 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


# 9e168cf49d7b876f3e5575c786a24864eefee7bb 20-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes to Attributes.h


# 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


# 5987b2a380151a1ddc4e168114f2df52873f8b3e 07-Apr-2011 Jonas Sundström <jonas@kirilla.com>

Offer a 'Real name' column in Tracker list view mode, when set to show localized names. As discussed a while back. I honestly don't know if this is such a great idea after all. Name + real name is kind of silly. Ideally it would be labeled in a more logical way, or the feature should be dropped.

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


# 01dffd8edd94699ac1e6f2cc4322555f2171da14 14-Jan-2010 Rene Gollent <anevilyak@gmail.com>

More Tracker refactoring:
* relocated Trash dirs to volume roots by modifying find_directory() to report the trash location as volume/Trash.
* FSUtils no longer creates /home/Desktop on every volume.
* TrashWatcher now keeps icons in sync on all volumes.
* Simplified FSGetDeskDir since it no longer has to worry about getting the desk directory on any volume other than the root.
* Relocated trash context menu logic to BContainerWindow so it can also be used at the volume roots.
* DesktopPoseView now creates a virtual Trash pose representing the trash contents as before.
* Corrected typo: Model::WriteAttrKillForegin() -> Model::WriteAttrKillForeign().

Closes ticket #5245.



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


# 671dd808619ef6043eca11b09a193d877181d10f 12-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Various cleanups:
* Removed dead/obsolete Integrate Non-boot Desktops code.
* Modified PoseView to ignore the fInvisible attribute of BPoseInfo for now.
This has the net effect that the Desktop folder and /boot/var are no longer
hidden from the user. To go with this change, Tracker no longer forcibly
writes that hidden setting to those folders on access. This feature might
be useful again in the future (especially in conjunction with relocating
the Trash folder somewhere such as the disk root), but is currently somewhat
problematic because those dual-booting with BeOS will still have a Tracker
that force writes those attributes which would bring us back to square one
with respect to showing the Desktop folder when we start respecting the
attribute again. Suggestions welcome. Haiku-only users can remove the
_trk/pinfo_le attribute on those folders to remove the invisibility
in any case.
* TrackerSettings: Removed obsolete desktop integration settings. Also
modified TrackerSettings parser to skip unrecognized settings instead
of aborting the settings file parsing process entirely.

Closes ticket #2872.



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


# 9ecf9d1c1d4888d341a6eac72112c72d1ae3a4cb 26-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Merge from layout management branch.


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


# 12104c2eab2bc57f3632a3fe62f34678b39dd14f 26-May-2006 Stephan Aßmus <superstippi@gmx.de>

synced with OT repository - I guess you knew what was comming,
Tracker saves and restores the window decorator settings on
Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17602 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