1
/* $Id: thunar-vfs-mime-info.h 18843 2005-11-14 14:25:58Z benny $ */
3
* Copyright (c) 2005 Benedikt Meurer <benny@xfce.org>
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Library General Public
7
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Library General Public License for more details.
15
* You should have received a copy of the GNU Library General Public
16
* License along with this library; if not, write to the
17
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
* Boston, MA 02111-1307, USA.
21
#ifndef __THUNAR_VFS_MIME_INFO_H__
22
#define __THUNAR_VFS_MIME_INFO_H__
24
#include <thunar-vfs/thunar-vfs-config.h>
28
typedef struct _ThunarVfsMimeInfo ThunarVfsMimeInfo;
29
struct _ThunarVfsMimeInfo
38
#define THUNAR_VFS_TYPE_MIME_INFO (thunar_vfs_mime_info_get_type ())
40
GType thunar_vfs_mime_info_get_type (void) G_GNUC_CONST;
42
ThunarVfsMimeInfo *thunar_vfs_mime_info_new (const gchar *name,
43
gssize len) G_GNUC_MALLOC;
45
G_INLINE_FUNC ThunarVfsMimeInfo *thunar_vfs_mime_info_ref (ThunarVfsMimeInfo *info);
46
void thunar_vfs_mime_info_unref (ThunarVfsMimeInfo *info);
48
const gchar *thunar_vfs_mime_info_get_comment (ThunarVfsMimeInfo *info);
49
G_INLINE_FUNC const gchar *thunar_vfs_mime_info_get_name (const ThunarVfsMimeInfo *info);
51
gchar *thunar_vfs_mime_info_get_media (const ThunarVfsMimeInfo *info) G_GNUC_MALLOC;
52
gchar *thunar_vfs_mime_info_get_subtype (const ThunarVfsMimeInfo *info) G_GNUC_MALLOC;
54
guint thunar_vfs_mime_info_hash (gconstpointer info);
55
gboolean thunar_vfs_mime_info_equal (gconstpointer a,
58
const gchar *thunar_vfs_mime_info_lookup_icon_name (ThunarVfsMimeInfo *info,
59
GtkIconTheme *icon_theme);
61
G_INLINE_FUNC void thunar_vfs_mime_info_list_free (GList *info_list);
64
#if defined(THUNAR_VFS_COMPILATION)
65
void _thunar_vfs_mime_info_invalidate_icon_name (ThunarVfsMimeInfo *info) G_GNUC_INTERNAL;
69
/* inline function implementations */
70
#if defined(G_CAN_INLINE) || defined(__THUNAR_VFS_MIME_INFO_C__)
72
* thunar_vfs_mime_info_ref:
73
* @info : a #ThunarVfsMimeInfo.
75
* Increments the reference count on @info and returns
76
* the reference to @info.
78
* Return value: a reference to @info.
80
G_INLINE_FUNC ThunarVfsMimeInfo*
81
thunar_vfs_mime_info_ref (ThunarVfsMimeInfo *info)
83
exo_atomic_inc (&info->ref_count);
88
* thunar_vfs_mime_info_get_name:
89
* @info : a #ThunarVfsMimeInfo.
91
* Returns the full qualified name of the MIME type
92
* described by the @info object.
94
* Return value: the name of @info.
96
G_INLINE_FUNC const gchar*
97
thunar_vfs_mime_info_get_name (const ThunarVfsMimeInfo *info)
99
return ((const gchar *) info) + sizeof (*info);
103
* thunar_vfs_mime_info_list_free:
104
* @info_list : a #GList of #ThunarVfsMimeInfo<!---->s
106
* Frees the list and all #ThunarVfsMimeInfo<!---->s
107
* contained within the list.
110
thunar_vfs_mime_info_list_free (GList *info_list)
112
g_list_foreach (info_list, (GFunc) thunar_vfs_mime_info_unref, NULL);
113
g_list_free (info_list);
115
#endif /* G_CAN_INLINE || __THUNAR_VFS_MIME_INFO_C__ */
120
#endif /* !__THUNAR_VFS_MIME_INFO_H__ */