Commit Graph

26 Commits

Author SHA1 Message Date
Ingo Weinhold bc0693b219 * Construct the MIME data base directories lazily.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 08:52:13 +00:00
Michael Lotz f82c11c079 bonefish+mmlr:
* Move most of MIME database support out of libbe and into registrar
* Use the (async) MessageDeliverer instead of a synchronous SendMessage in _SendMonitorUpdate

This fixes a deadlock when the message port of a MIME database watching
application gets full as documented in bug #1311.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23423 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 22:45:06 +00:00
Axel Dörfler f6e4cbb952 * 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
2007-10-15 20:13:55 +00:00
Stephan Aßmus 7fb6186f3c * integration of vector icons with the registrar and the mime data base
* additional versions of SetIcon[ForType] and GetIcon[ForType] in BMimeType
  and BAppFileInfo, which handle flat vector icon data
* changes in Tracker to support scalable icons (currently broken for
non-vector icons and needs cleanup) and drawing icons correctly with alpha
channel (large parts of this work done by Michael Lotz)

If someone feels like looking over the changes, that would be much
appreciated! :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18699 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-29 17:06:23 +00:00
Ingo Weinhold 9ecf9d1c1d Merge from layout management branch.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18649 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-26 16:21:15 +00:00
Axel Dörfler 1b0c0ad7e9 * InstalledTypes did not preserve the case of the MIME types, and thus, Tracker queries
for some types (like "application/x-vnd.Be-elfexecutable") would fail. This fixes
  bug #666 (no, I'm not the exorcist :-)).
* Renamed private methods to have the '_' prefix.
* Cleanup, added license.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17832 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-14 09:30:55 +00:00
Ingo Weinhold e4f35acf7c * Added new (currently private) API class BMimeSnifferAddon,
representing the interface for, well, MIME sniffer add-ons.
* Implemented the respective add-on manager and make use of it in
  the MIME database code. Unfortunately the MIME DB code completely
  lives in libbe.so and hence I had to put my code there too.
  IMHO we should (one day) remove the direct (read-only) MIME DB
  access from libbe and move everything into the registrar.
  Currently the add-on manager supports built-in add-ons only; it
  doesn't really load anything from disk ATM.
* Added a built-in text sniffer add-on to the registrar. It's based
  upon the BSD file tool code.

This closes bug #250 (plain text files are identified as such, now).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17784 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-09 20:48:50 +00:00
Axel Dörfler 98d9f1b483 * Only allowed application hints of B_MIME_TYPE_LENGTH instead of B_PATH_NAME_LENGTH.
* Introduced a _SetStringValue() to avoid code duplication.
* The string types now check the original value, and don't write anything if the
  contents stay unchanged (with the current exception of the sniffer rules).
* The monitor notfication methods no longer "clobber" the status result.
* Major cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16432 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-16 19:27:39 +00:00
Ingo Weinhold 15424f3d37 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
2006-01-28 19:41:07 +00:00
shadow303 17e6de7a37 gcc 3 fixes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4227 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-08-04 00:46:53 +00:00
Ingo Weinhold 0cf8481dc7 Added newline at end of file.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1410 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-06 22:45:06 +00:00
Tyler Dauwalder 989772566f Added kMetaMimeType constant
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1327 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-01 07:29:32 +00:00
Tyler Dauwalder 09dad369d7 Updated filesystem traversal code to skip files/devices that don't
support attributes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1325 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-01 07:26:11 +00:00
Tyler Dauwalder b690150ecf Removed mime update code
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1271 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-29 07:12:42 +00:00
Tyler Dauwalder 162f340b21 UpdateMimeInfoThread class, which is a subclass of MimeUpdateThread
that implements updating specific to update_mime_info().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1268 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-29 07:09:50 +00:00
Tyler Dauwalder 56a452bb2c CreateAppMetaMimeThread class, which is a subclass of MimeUpdateThread
that implements updating specific to create_app_meta_mime().

Note that the implementation is not 100% correct yet, and the
OBOS::BMimeType::create_app_meta_mime() tests still fail.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1267 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-29 07:08:21 +00:00
Tyler Dauwalder 4707046cec MimeUpdateThread class, which is a RegistrarThread subclass that
implements the functionality common to both mime update calls
(update_mime_info() and create_app_meta_mime()), namely walking
through the filesystem and performing updates.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1266 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-29 07:05:39 +00:00
Tyler Dauwalder 1bd963b6c2 + 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
2002-09-24 05:36:03 +00:00
Tyler Dauwalder 4494844f12 Initial checkin. BPrivate::Storage::Mime::SnifferRules class, which is
responsible for managing sniffer rules and sniffing files and data
streams.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1147 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-24 05:22:40 +00:00
Tyler Dauwalder 09b4d458da Initial checkin. BPrivate::Storage::Mime::AssociatedTypes class, which
is responsible for managing associations between mime types and
file extensions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1146 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-24 05:20:30 +00:00
Tyler Dauwalder e3a2f2069e + Added SetSupportedTypes() test
+ Modified BMimeType::SetSupportedTypes functionality so it keeps track of
stranded types (i.e. previously supported types that have not had the now
unsupporting app signature removed from their supporting apps list yet due
to a false fullSync parameter) over consecutive SetSupportedTypes(...,
false) calls and updates all appropriate stranded types on the next
SetSupportedTypes(..., true) call.
+ Added fullSync parameter to BMimeType::DeleteSupportedTypes
+ Made BMimeType::Delete() do a DeleteSupportedTypes(..., true) call to
properly update the supporting apps lists when a mime type is deleted.
+ Added initial BMimeType::Get/SetSnifferRule
+ Updated BMimeType::CheckSnifferRule() to return B_BAD_VALUE when passed
a NULL rule string.
+ Brought CheckSnifferRule() tests up to date
+ Added lots of Mime::Database doxygen
+ Added any missing mime monitor notifications in Mime::Database
+ Possibly made some other changes as well... :-)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1004 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-09 08:12:03 +00:00
Tyler Dauwalder b86972c240 Added GetSupportingApps() message field constants
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@924 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-28 23:58:08 +00:00
Tyler Dauwalder 41b9ba9155 Added GetSupportingApps()/SetSupportedTypes() functionality
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-28 23:57:30 +00:00
Tyler Dauwalder ee0cf10184 Handles supporting application management. This is an
initial, theoretically fully functional implementation.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@919 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-28 23:52:52 +00:00
Tyler Dauwalder 32f45afc26 + Added GetInstalled[Super]Types functionality
+ Cleaned up warnings
+ Added documentation


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@899 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-27 08:26:11 +00:00
Tyler Dauwalder e20a514ae9 After implementing the BMimeType::GetInstalled[Super]Types()
functionality, it became apparent that some restructuring was
needed if I wanted to keep things clean and managble.
storage/MimeDatabase.{h,cpp} have been broken into:

storage/mime/database_support.{h,cpp}
+ MIME database constants
+ high-level database access functions like open_type(),
  read_mime_attr(), etc.

storage/mime/database_access.{h,cpp}
+ atomic read functions
+ is_installed()
+ get_icon_data()

storage/mime/Database.{h,cpp}
+ Mime::Database class, which is responsible for all write,
  non-atomic read, and mime monitor functionality.

storage/mime/InstalledTypes.{h,cpp}
+ Helper class for Mime::Database::GetInstalled[Super]Types()

storage/mime/Supertype.{h,cpp}
+ Helper class for Mime::InstalledTypes

I haven't merged my intial, somewhat cludgy GetInstalled[Super]Types
implementation into the new setup yet. That comes next, and it ought
to be a more graceful implementation now.

I also implemented BMimeType::Get/SetSupportingTypes(), though
they haven't been tested yet (sorry).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@862 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-24 05:04:02 +00:00