![]() |
![]() |
![]() |
Thunar-VFS Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <thunar-vfs/thunar-vfs.h> ThunarVfsMimeInfo; ThunarVfsMimeInfo * thunar_vfs_mime_info_new (const gchar *name, gssize len); ThunarVfsMimeInfo * thunar_vfs_mime_info_ref (ThunarVfsMimeInfo *info); void thunar_vfs_mime_info_unref (ThunarVfsMimeInfo *info); const gchar * thunar_vfs_mime_info_get_comment (ThunarVfsMimeInfo *info); const gchar * thunar_vfs_mime_info_get_name (const ThunarVfsMimeInfo *info); gchar * thunar_vfs_mime_info_get_media (const ThunarVfsMimeInfo *info); gchar * thunar_vfs_mime_info_get_subtype (const ThunarVfsMimeInfo *info); guint thunar_vfs_mime_info_hash (gconstpointer info); gboolean thunar_vfs_mime_info_equal (gconstpointer a, gconstpointer b); const gchar * thunar_vfs_mime_info_lookup_icon_name (ThunarVfsMimeInfo *info, GtkIconTheme *icon_theme); void thunar_vfs_mime_info_list_free (GList *info_list);
typedef struct { } ThunarVfsMimeInfo;
The ThunarVfsMimeInfo struct contains private data only, and should be accessed using the functions below.
ThunarVfsMimeInfo * thunar_vfs_mime_info_new (const gchar *name, gssize len);
Allocates a new ThunarVfsMimeInfo object with an
initial reference count of one and sets it to the
given name
.
Note that no checking is performed on the given name
.
You should not normally use this function, but use
thunar_vfs_mime_database_get_info()
instead.
In addition, if you allocate ThunarVfsMimeInfos using this function, you cannot mix them with the objects allocated in a ThunarVfsMimeDatabase, because the ThunarVfsMimeDatabase and associated functions assume that ThunarVfsMimeInfo objects are unique.
|
the mime type name. |
|
the length of name or -1 if zero-terminated.
|
Returns : |
the newly allocated ThunarVfsMimeInfo. |
ThunarVfsMimeInfo * thunar_vfs_mime_info_ref (ThunarVfsMimeInfo *info);
Increments the reference count on info
and returns
the reference to info
.
|
a ThunarVfsMimeInfo. |
Returns : |
a reference to info .
|
void thunar_vfs_mime_info_unref (ThunarVfsMimeInfo *info);
Decrements the reference count on info
and releases
the resources allocated for info
once the reference
count drops to zero.
|
a ThunarVfsMimeInfo. |
const gchar * thunar_vfs_mime_info_get_comment (ThunarVfsMimeInfo *info);
Determines the description for the given info
.
Note that this method MUST NOT be called from threads other than the main thread, because it's not thread-safe!
|
a ThunarVfsMimeInfo. |
Returns : |
the comment associated with the info or the empty string
if no comment was provided.
|
const gchar * thunar_vfs_mime_info_get_name (const ThunarVfsMimeInfo *info);
Returns the full qualified name of the MIME type
described by the info
object.
|
a ThunarVfsMimeInfo. |
Returns : |
the name of info .
|
gchar * thunar_vfs_mime_info_get_media (const ThunarVfsMimeInfo *info);
Returns the media portion of the MIME type, e.g. if your ThunarVfsMimeInfo instance refers to "text/plain", invoking this method will return "text".
The caller is responsible to free the returned string
using g_free()
when no longer needed.
|
a ThunarVfsMimeInfo. |
Returns : |
the media portion of the MIME type. |
gchar * thunar_vfs_mime_info_get_subtype (const ThunarVfsMimeInfo *info);
Returns the subtype portion of the MIME type, e.g. if info
refers to "application/octect-stream", this method will
return "octect-stream".
The caller is responsible to free the returned string
using g_free()
when no longer needed.
|
a ThunarVfsMimeInfo. |
Returns : |
the subtype portion of info .
|
guint thunar_vfs_mime_info_hash (gconstpointer info);
Calculates a hash value for info
.
|
a ThunarVfsMimeInfo. |
Returns : |
a hash value for info .
|
gboolean thunar_vfs_mime_info_equal (gconstpointer a, gconstpointer b);
Compares a
and b
and returns TRUE
if both
are equal.
|
a ThunarVfsMimeInfo. |
|
a ThunarVfsMimeInfo. |
Returns : |
TRUE if a and b are equal.
|
const gchar * thunar_vfs_mime_info_lookup_icon_name (ThunarVfsMimeInfo *info, GtkIconTheme *icon_theme);
Tries to determine the name of a suitable icon for info
in icon_theme
. The returned icon name can then be used
in calls to gtk_icon_theme_lookup_icon()
or
gtk_icon_theme_load_icon()
.
The returned icon name is owned by info
and MUST NOT be freed
by the caller.
Note that this method MUST NOT be called from threads other than the main thread, because it's not thread-safe!
|
a ThunarVfsMimeInfo. |
|
the GtkIconTheme on which to perform the lookup. |
Returns : |
a suitable icon name for info in icon_theme .
|
void thunar_vfs_mime_info_list_free (GList *info_list);
Frees the list and all ThunarVfsMimeInfos contained within the list.
|
a GList of ThunarVfsMimeInfos |