History log of /haiku/src/kits/storage/Mime.cpp
Revision Date Author Comments
# 9d06690e 11-Jul-2019 Augustin Cavalier <waddlesplash@gmail.com>

userland: Pass more sizes with ioctls where we can.

No "functional" change intended.


# 9effbd7e 15-Dec-2018 Augustin Cavalier <waddlesplash@gmail.com>

Remove some unused cruft from the early days.

These lines were added in 2002...


# a30a4a41 18-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to Storage Kit classes.

No functional changes intended.

* Some variable renaming for clarity and consistency.
* Pointer style fixes.
* Added private method documentation back to cpp files for some methods.


# 38fa81bf 03-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove B_COMMON*_DIRECTORY and kCommon*Directory constants

* This does intentionally break source compatibility, so that a review
of concerned code is forced.
* Binary compatibility should be maintained in most cases. The values
of the constants for the writable directories are now used for the
writable system directories. The values for the non-writable
directories are mapped to "/boot/system/data/empty/...", an empty or
non-existent directory, so that they will simply be skipped in search
paths. Only code that explicitly expects to find something in a
B_COMMON_* directory, will fail.


# 7f98c665 27-Jul-2013 Murai Takashi <tmurai01@gmail.com>

Fix double free

Signed-off-by: Ingo Weinhold <ingo_weinhold@gmx.de>


# b94857b3 07-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Refactor MIME DB access

* Add class DatabaseLocation. It contains a list of the MIME DB
directory paths plus methods to access type files.
* Move all low-level MIME DB access functions from
database_{support,access} to DatabaseLocation. All code that formerly
used those now requires a DatabaseLocation object. In BMimeType and in
the registrar the default object is used, but the low-level classes
can now be reused with different locations.
* Move get_icon_data() from database_access to database_support and
delete the former, which is now empty.


# b7733e06 31-Jan-2013 John Scipione <jscipione@gmail.com>

Move Mime.h documentation to the API docs.


# 1dfa5a7d 18-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

size is actually icon_size, not data size, thanks Axel for pointing out!


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


# 98667757 18-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

* Puh, there was quite a confusion with variable names here, Axel.
Don't we have this "blah shadows a parameter" warning enabled?
* data was leaked in the error code path when allocating the bitmaps
failed.
* I've added a check if the provided buffer even has the right
size before copying the B_CMAP8 bitmap data into it.


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


# 0d37df64 18-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* The old Be version of get_device_icon() now also supports retrieving the
vector icon in case B_GET_ICON is not supported by the device anymore.
(This makes B_GET_ICON deprecated API.)
* Use B_BITMAP_NO_SERVER_LINK flag, as our bitmap is only used internally.


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


# d9b93b82 18-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* The bitmap variant of get_device_icon() should now support getting all sizes
even if the icon is not available in that size (ie. is not a vector icon).


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


# aac75076 18-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

* r27001 left some parameter checks which need to be ommited
for vector icons. Simplified the checks and moved them to
where the old B_CMAP8 icon is retrieved. The bitmap is allowed
to have another color space, in which case the icon data is
converted (code was already in place).
* Added a NOTE comment to how the new B_GET_VECTOR_ICON ioctl
knows about the correct buffer size for the icon data.
I've tested setting the desktop icon size to something else than
16x16 or 32x32 and it works fine now.


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


# 8ce6cfc9 17-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Added two more public functions: get_named_icon().
* Implemented B_GET_ICON_NAME in get_device_icon().
* Comments welcome.


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


# 0eddadb9 17-Aug-2008 Maurice Kalinowski <mauricek@nowhere.fake>

fix gcc4 build

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


# 06ba3f0a 17-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Added two new ways to retrieve an icon from a device:
- B_GET_ICON_NAME: returns the name of an icon. This will then be read from
a predefined location on disk (not yet implemented). This would also allow
to add specifiers like "-boot", or "-fat|bfs|ntfs|...", and have special
icons for those.
- B_GET_VECTOR_ICON: retrieves the vector icon of a device, if any.
* get_device_icon(BBitmap*, ...) now supports other color spaces than B_CMAP8.
* Added get_device_icon(), BPartition::GetIcon(), and BVolume::GetIcon()
variants that can also retrieve the icon data directly (like
BNodeInfo::GetIcon()).
* Reenabled the previous BPartition::GetIcon(), based on a patch by
Justin O'Dell - this fixes #1391.
* Tracker's MountMenu class now uses B_RGBA32 icons, instead of B_CMAP8.
* Added vector icon to scsi_disk, and scsi_cd. The former doesn't have any
special removable icon, though.
* Header cleanup, added/updated license, whitespace cleanup.
* Marked deprecated/obsolete driver ioctls in Drivers.h.
* Removed OpenBeOS namespace in the headers I touched that still had them.


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


# 26791a6b 04-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed the semantics of create_app_meta_mime(): Like update_mime_info()
it does now accept directories and doesn't ignore the "recursive"
parameter anymore.


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


# e1e2b03b 04-Nov-2006 Axel Dörfler <axeld@pinc-software.de>

* Added TODO comment about missing vector icon support
* Minor cleanup.


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


# 15424f3d 28-Jan-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Finally fixed update_mime_info(). As Be's version it understands two
different "force" levels now and updates the app file info attributes
for shared object files.


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


# 289adc04 17-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed due to moving RegistrarDefs.h stuff into the BPrivate namespace and replacing kRosterPortName.


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


# 3bc6d6c5 04-Jul-2003 shadow303 <shadow303@nowhere.fake>

gcc 3 fixes


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


# 2ed834e3 08-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Cleaned up BRoster's friends mess. All access to private BRoster functionality is now done through the newly added BRoster::Private class, which is BRoster's only friend (poor BRoster ;-).


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


# 11b62694 07-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a C++ version of get_device_icon() and make use of it in BVolume.


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


# 06d82133 29-Sep-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

Updated and unified update_mime_info() and create_app_meta_mime()
implementations to work with new, wholly-registrar-based mime update
system.


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


# 1bd963b6 23-Sep-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

+ Added file-extension based mime type guessing
+ Added sniffer rule based mime type guessing
+ Added get_device_icon()
+ Added complete (synchronous, asynchronous; recursive,
non-recursive; forcing, non-forcing; you name it we got it :-)
update_mime_info() implementation.


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


# 09d84e61 12-Aug-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

+ Changed StorageKit namespace to BPrivate::Storage
+ Changed Sniffer namespace to BPrivate::Storage::Sniffer


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


# 52a38012 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


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


# a30a4a41f948ebb03b95dab065a27a584ac0c97a 18-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to Storage Kit classes.

No functional changes intended.

* Some variable renaming for clarity and consistency.
* Pointer style fixes.
* Added private method documentation back to cpp files for some methods.


# 38fa81bf8f0ccc37a615a9f5bd333f9b781322b3 03-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove B_COMMON*_DIRECTORY and kCommon*Directory constants

* This does intentionally break source compatibility, so that a review
of concerned code is forced.
* Binary compatibility should be maintained in most cases. The values
of the constants for the writable directories are now used for the
writable system directories. The values for the non-writable
directories are mapped to "/boot/system/data/empty/...", an empty or
non-existent directory, so that they will simply be skipped in search
paths. Only code that explicitly expects to find something in a
B_COMMON_* directory, will fail.


# 7f98c6653ea4673eeb85431698dec09d0f3d4409 27-Jul-2013 Murai Takashi <tmurai01@gmail.com>

Fix double free

Signed-off-by: Ingo Weinhold <ingo_weinhold@gmx.de>


# b94857b322093c296230a18d47f6a98a2896b062 07-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Refactor MIME DB access

* Add class DatabaseLocation. It contains a list of the MIME DB
directory paths plus methods to access type files.
* Move all low-level MIME DB access functions from
database_{support,access} to DatabaseLocation. All code that formerly
used those now requires a DatabaseLocation object. In BMimeType and in
the registrar the default object is used, but the low-level classes
can now be reused with different locations.
* Move get_icon_data() from database_access to database_support and
delete the former, which is now empty.


# b7733e0655c1bb70a465f1255373494de3609365 31-Jan-2013 John Scipione <jscipione@gmail.com>

Move Mime.h documentation to the API docs.


# 1dfa5a7d2a08ff680e838c7433d5f509c09286fb 18-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

size is actually icon_size, not data size, thanks Axel for pointing out!


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


# 986677575dfae28fef6b3f0746a6a95a49ba324a 18-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

* Puh, there was quite a confusion with variable names here, Axel.
Don't we have this "blah shadows a parameter" warning enabled?
* data was leaked in the error code path when allocating the bitmaps
failed.
* I've added a check if the provided buffer even has the right
size before copying the B_CMAP8 bitmap data into it.


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


# 0d37df6412109893dd38e644010b97b7fc9d7ef2 18-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* The old Be version of get_device_icon() now also supports retrieving the
vector icon in case B_GET_ICON is not supported by the device anymore.
(This makes B_GET_ICON deprecated API.)
* Use B_BITMAP_NO_SERVER_LINK flag, as our bitmap is only used internally.


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


# d9b93b821a56d83dfd2760ad92fd2748b75d2ef7 18-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* The bitmap variant of get_device_icon() should now support getting all sizes
even if the icon is not available in that size (ie. is not a vector icon).


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


# aac7507616fad7b43d22a981347ac585ed879609 18-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

* r27001 left some parameter checks which need to be ommited
for vector icons. Simplified the checks and moved them to
where the old B_CMAP8 icon is retrieved. The bitmap is allowed
to have another color space, in which case the icon data is
converted (code was already in place).
* Added a NOTE comment to how the new B_GET_VECTOR_ICON ioctl
knows about the correct buffer size for the icon data.
I've tested setting the desktop icon size to something else than
16x16 or 32x32 and it works fine now.


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


# 8ce6cfc99957fe048604bbdb48784287cf5f7ad1 17-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Added two more public functions: get_named_icon().
* Implemented B_GET_ICON_NAME in get_device_icon().
* Comments welcome.


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


# 0eddadb92297f4f9858a140556e6f32e8f05be49 17-Aug-2008 Maurice Kalinowski <mauricek@nowhere.fake>

fix gcc4 build

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


# 06ba3f0acb06fd0a5818f2609886fe1d35fbfbd3 17-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Added two new ways to retrieve an icon from a device:
- B_GET_ICON_NAME: returns the name of an icon. This will then be read from
a predefined location on disk (not yet implemented). This would also allow
to add specifiers like "-boot", or "-fat|bfs|ntfs|...", and have special
icons for those.
- B_GET_VECTOR_ICON: retrieves the vector icon of a device, if any.
* get_device_icon(BBitmap*, ...) now supports other color spaces than B_CMAP8.
* Added get_device_icon(), BPartition::GetIcon(), and BVolume::GetIcon()
variants that can also retrieve the icon data directly (like
BNodeInfo::GetIcon()).
* Reenabled the previous BPartition::GetIcon(), based on a patch by
Justin O'Dell - this fixes #1391.
* Tracker's MountMenu class now uses B_RGBA32 icons, instead of B_CMAP8.
* Added vector icon to scsi_disk, and scsi_cd. The former doesn't have any
special removable icon, though.
* Header cleanup, added/updated license, whitespace cleanup.
* Marked deprecated/obsolete driver ioctls in Drivers.h.
* Removed OpenBeOS namespace in the headers I touched that still had them.


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


# 26791a6b964b22762a4375ea2e50ba59802efc5b 04-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed the semantics of create_app_meta_mime(): Like update_mime_info()
it does now accept directories and doesn't ignore the "recursive"
parameter anymore.


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


# e1e2b03bb713abb5535391937df1ad1003924528 04-Nov-2006 Axel Dörfler <axeld@pinc-software.de>

* Added TODO comment about missing vector icon support
* Minor cleanup.


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


# 15424f3d37665c19370cc5af241f1a37ece82e85 28-Jan-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Finally fixed update_mime_info(). As Be's version it understands two
different "force" levels now and updates the app file info attributes
for shared object files.


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


# 289adc045d3aa7860aae3b1959d28a4d4c440ae2 17-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed due to moving RegistrarDefs.h stuff into the BPrivate namespace and replacing kRosterPortName.


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


# 3bc6d6c59a84213259bf4179c6296400a1e4cfe9 04-Jul-2003 shadow303 <shadow303@nowhere.fake>

gcc 3 fixes


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


# 2ed834e3f6f94d48d8671f8379040f4e8cc70238 08-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Cleaned up BRoster's friends mess. All access to private BRoster functionality is now done through the newly added BRoster::Private class, which is BRoster's only friend (poor BRoster ;-).


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


# 11b626948250e67db6d8f8cd289745bbb283bb43 07-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a C++ version of get_device_icon() and make use of it in BVolume.


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


# 06d82133c7ff792b9a2741a329f95bc596b372a8 29-Sep-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

Updated and unified update_mime_info() and create_app_meta_mime()
implementations to work with new, wholly-registrar-based mime update
system.


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


# 1bd963b6c27017324c3589c8ea29d635e1552b7f 23-Sep-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

+ Added file-extension based mime type guessing
+ Added sniffer rule based mime type guessing
+ Added get_device_icon()
+ Added complete (synchronous, asynchronous; recursive,
non-recursive; forcing, non-forcing; you name it we got it :-)
update_mime_info() implementation.


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


# 09d84e61b6c2629d253dce1e7d7e944943d3e40e 12-Aug-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

+ Changed StorageKit namespace to BPrivate::Storage
+ Changed Sniffer namespace to BPrivate::Storage::Sniffer


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


# 52a380120846174213ccce9c4aab0dda17c72083 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


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