Tracker: Add thumbnail supportDefine thumbnail attributes in Attributes.h: Media:Thumbnail to store the thumbnail, Media:Thumbnail:CreationTime to see if thumbs need to be regenerated.Store 1
Tracker: Add thumbnail supportDefine 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 than128x128 down-scale the 128x128 thumbnail. Use B_FILTER_BITMAP_BILINEARto down-scale the image using the bilinear scaling algorithm whichcreates nicer looking thumbnails than the default scaling algorithm.Store thumbnails as WebP images which compress smaller than PNGs andfit in the inode better at 128x128.Check the file's modification time in GetFileIconFromAttr() and compareit to the thumbnail creation time. If the file has not been modifiedsince the last time we generated thumbnails return the thumbnail fromthe attribute, otherwise fetch a new thumbnail with GetThumbnailIcon().Add "Generate image thumbnails" Tracker setting. Default is turned offfor now. To generate image thumbnails you must first turn this settingon in Tracker Windows preferences.Spawn a get_thumbnail() thread to generate thumbnails and retrieve themlater on from the window thread to fill out into the icon. This shouldimprove responsiveness of generating thumbnails from a folder with alot of images. The generator thread will write the thumbnail data to anattribute if on writable BFS volume.If not on writable BFS volume, the generator thread will send the databack to the original thread through a port by calling write_port().When the thread is finished creating the thumbnail it sends a messageback to the Tracker application thread to update the pose whichinstructs the window thread to look for an thumbnail. It either finds athumbnail in an attribute, or picks up the thumbnail data that has beensent through write_port() using read_port().This works on both read-write and read-only BFS volumes but it stilldepends on the presence of a BEOS:TYPE parameter to have been writtento the volume before it became read-only. Thumbnail generation does notwork on other read-only volumes for example an ISO-9660 CD, but it doeswork on read-only BFS volumes for example the BeOS R5 CD.Move BPrivate::CheckNodeIconHintPrivate() from BNodeInfo to TrackerModel CheckNodeIconHint(). Create Model::CheckAppIconHint() and lookfor a vector icon or mini and large icon in that method. Check thatthe base type is directory, volume, trash, desktop, or if executablecall CheckAppIconHint().Add 1 to temp_name to fix the following warning:src/kits/tracker/FSUtils.cpp:2437:12: note: 'snprintf' output 3 or morebytes (assuming 267) into a destination of size 266Rename temp_name to tempName following our style guidelines. Usestrlcpy() and strlcat() instead of strcpy() to safely copy the string.This fixes thumbnail generation on 64-bit Haiku.Change-Id: I7f927a5a1f8cf65e4b1aa1e0eb55bbfae87fd969Reviewed-on: https://review.haiku-os.org/c/haiku/+/3163Reviewed-by: John Scipione <jscipione@gmail.com>Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
show more ...
TranslationErrors.h: document as deprecated.TranslationDefs.h: SupportDefs.h already includes Errors.h, remove TranslationErrors.h.
Minor cleanup of translator roster commit, updated copyright.
Make sure images containing BTranslators are not unloaded earlyWhen a translator is uninstalled, BTranslatorPrivate::_RemoveTranslators iscalled. This method used to unload the image containing th
Make sure images containing BTranslators are not unloaded earlyWhen a translator is uninstalled, BTranslatorPrivate::_RemoveTranslators iscalled. This method used to unload the image containing the translator aftercalling Release() on it resulting in several problems:- If the translator was still busy, e.g. translating something while being installed, it crashed since the image was unloaded even though its refcount was larger than 0.- Applications using code from one of the translators (e.g. its config view) would crash when the translator is uninstalled (this is bug #12005).This problem is now fixed. The roster keeps track of all translators whoseimage it manages (even if the translator was already removed from the roster).It also keeps a refcount to all images. When a translator's refcount drops tozero and it belonged to a roster at some point, it does not delete itself, butnotifies the roster that it is ready to destruct, which then removes it fromthe roster if the translator is still in it, destroys the translator, decrementsthe refcount of the image and if the new refcount is zero, unloads the image.All of this is done in a message handler, since if the translator calledTranslatorDeleted like before, the unloaded image would be referenced whenthe stack is walked up.Finally, the DataTranslations preflet is required to Acquire() the translatorwhose config view it is showing, because otherwise its refcount could be reducedto 0 and the image unloaded. BTranslatorRoster now enables users to acquire atranslator by ID. By the time the translator has to be released, it might notbe part of the roster anymore though. Since BTranslatorRoster tries not to giveout raw pointers to the translators it manages, users who acquire a translatorthrough a roster now are given a BTranslatorReleaseDelegate, which allows forreleasing the BTranslator exactly once and then self-destructs.Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
Actually sort the translator menu used in ShowImage.There were two problems with the last commit:* the list needed to be outside of the top-level loop.* BList was just broken for sorting transla
Actually sort the translator menu used in ShowImage.There were two problems with the last commit:* the list needed to be outside of the top-level loop.* BList was just broken for sorting translation_format pointers.I fixed this by moving the loop outside and converting the translation_formatsto translator_info, which has the translator_id, since that is needed to createthe menu item, and would otherwise be unavailable outside the loop.I tried to get this working with BList, but the sorting was completely broken,and converting to BObjectList made the code much, much better and worked great.Screw BList and casting, hurray templated BObjectList.Really fixes #6782.
Sort the translation formats in AddTranslationItems by name.This is used by ShowImage and CodyCam to create a list of image formats which afile can be saved as. Tracker sorts the image MIME types
Sort the translation formats in AddTranslationItems by name.This is used by ShowImage and CodyCam to create a list of image formats which afile can be saved as. Tracker sorts the image MIME types used in the Findwindow by name, so this makes these Save As menus match that (minus the iconswhich I think are superfluous.)Fixes #6782.If the use of BList is no longer recommended, I welcome better suggestionsfor sorting which will work in both GCC2 and GCC4. But this works ;)
* Obviously, the GraphicsDefs.h header is needed as well.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32760 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Rewrote last Translation Kit header.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32757 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Rewrote headers as needed.* Cleaned up our own headers.* Moved translator errors into Errors.h.* Removed extra TranslationKit.h.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32755 a9524
* Rewrote headers as needed.* Cleaned up our own headers.* Moved translator errors into Errors.h.* Removed extra TranslationKit.h.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32755 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Rewrote header.* Cleaned up sources.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32752 a95241bf-73f2-0310-859d-f6bbb57e9c96
Style cleanup.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30855 a95241bf-73f2-0310-859d-f6bbb57e9c96
The 'extern "C"' was missing for the C function replacement of the Version()method. Rather reintroduced the method (private) instead.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30854 a952
The 'extern "C"' was missing for the C function replacement of the Version()method. Rather reintroduced the method (private) instead.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30854 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Rewrote BeBuild.h which had "a few" consequences (got rid of all those class definitions).* Minor cleanup here and there.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 a95241bf-73f
* Rewrote BeBuild.h which had "a few" consequences (got rid of all those class definitions).* Minor cleanup here and there.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added another GetStyledText() function to force a specific encoding.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19847 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added WriteStyledEditFile() variant that gets an encoding argument; it will automaticallyencode the text in the BTextView accordingly.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19841 a95
Added WriteStyledEditFile() variant that gets an encoding argument; it will automaticallyencode the text in the BTextView accordingly.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19841 a95241bf-73f2-0310-859d-f6bbb57e9c96
Some more GCC 4 and PPC fixes.* Mesa doesn't compile yet, as some PPC specific stuff seems to be missing, Philippe?* Cortex and some other stuff has been marked x86-only, although it's more of
Some more GCC 4 and PPC fixes.* Mesa doesn't compile yet, as some PPC specific stuff seems to be missing, Philippe?* Cortex and some other stuff has been marked x86-only, although it's more of a "GCC 2.95.3"-only.* I'm not sure if it's a bug in GCC 4, or if that's what the C standard demands, but sizeof(some_type::some_field) is not valid anymore :-/git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17515 a95241bf-73f2-0310-859d-f6bbb57e9c96
* More or less rewrote BTranslatorRoster - it now has a private implementation class, and only wraps around that one.* Translating is no longer serialized, you can translate more than one object
* More or less rewrote BTranslatorRoster - it now has a private implementation class, and only wraps around that one.* Translating is no longer serialized, you can translate more than one object at a time now.* A BTranslator that is released (ie. deleted) will no longer let its BTranslatorRoster crash.* Removed BTranslatorRoster::Version() - this kind of call definitely makes no sense at all. It's still exported from the sources, though, for backwards compatibility.* Simplified and improved code.* Images are now unloaded only once.* Added new method IsTranslator() that will be used by the DataTranslations preferences application.* Began implementing new methods StartWatching()/StopWatching() that will notify you if new translators are installed or old ones removed (this will also be used by DataTranslations once it's ready).* The private BTranslatorRoster class will now add itself to the existing BApplication, in order to provide automatic updating of the translators if needed (not yet implemented though).* Not heavily tested yet, there might be some regressions.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17247 a95241bf-73f2-0310-859d-f6bbb57e9c96
Moved FuncTranslator.h to private headers since it is not intended for the user.git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11357 a95241bf-73f2-0310-859d-f6bbb57e9c96
Moved translator_data struct to FuncTranslator private header because this struct is not intended to be used by the user.git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11356 a95241bf-73f2-0
Moved translator_data struct to FuncTranslator private header because this struct is not intended to be used by the user.git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11356 a95241bf-73f2-0310-859d-f6bbb57e9c96
Changed TranslationKit version macros to make them more readable.git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11256 a95241bf-73f2-0310-859d-f6bbb57e9c96
"Fixed" BTranslatorRoster so that it no longer stores the list of translators backwards. This is the order that applications assume, so this must be done to prevent inconsistent behavior between the
"Fixed" BTranslatorRoster so that it no longer stores the list of translators backwards. This is the order that applications assume, so this must be done to prevent inconsistent behavior between the R5 translation kit and the Haiku version.git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9490 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed & / | mixupgit-svn-id: file:///srv/svn/repos/haiku/trunk/current@6808 a95241bf-73f2-0310-859d-f6bbb57e9c96
Changed version macros to use Be naming schemegit-svn-id: file:///srv/svn/repos/haiku/trunk/current@6798 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added version macros to be used by the translation kit / translators for making and decoding version numbersgit-svn-id: file:///srv/svn/repos/haiku/trunk/current@6794 a95241bf-73f2-0310-859d-f6bbb
Added version macros to be used by the translation kit / translators for making and decoding version numbersgit-svn-id: file:///srv/svn/repos/haiku/trunk/current@6794 a95241bf-73f2-0310-859d-f6bbb57e9c96
Changed the quality/capability comments to more clearly explain what they are forgit-svn-id: file:///srv/svn/repos/haiku/trunk/current@6123 a95241bf-73f2-0310-859d-f6bbb57e9c96
12