Top | ![]() |
![]() |
![]() |
![]() |
ThunarVfsMimeInfo * | thunar_vfs_mime_info_new () |
ThunarVfsMimeInfo * | thunar_vfs_mime_info_ref () |
void | thunar_vfs_mime_info_unref () |
const gchar * | thunar_vfs_mime_info_get_comment () |
const gchar * | thunar_vfs_mime_info_get_name () |
gchar * | thunar_vfs_mime_info_get_media () |
gchar * | thunar_vfs_mime_info_get_subtype () |
guint | thunar_vfs_mime_info_hash () |
gboolean | thunar_vfs_mime_info_equal () |
const gchar * | thunar_vfs_mime_info_lookup_icon_name () |
void | thunar_vfs_mime_info_list_free () |
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.
ThunarVfsMimeInfo *
thunar_vfs_mime_info_ref (ThunarVfsMimeInfo *info
);
Increments the reference count on info
and returns
the 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.
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!
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.
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.
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.
guint
thunar_vfs_mime_info_hash (gconstpointer info
);
Calculates 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.
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!
void
thunar_vfs_mime_info_list_free (GList *info_list
);
Frees the list and all ThunarVfsMimeInfos contained within the list.
struct ThunarVfsMimeInfo { };
The ThunarVfsMimeInfo struct contains private data only, and should be accessed using the functions below.