~ubuntu-branches/debian/experimental/thunar/experimental

« back to all changes in this revision

Viewing changes to thunar-vfs/thunar-vfs-mime-info.h

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez
  • Date: 2006-01-02 23:42:32 UTC
  • Revision ID: james.westby@ubuntu.com-20060102234232-8xeq0lqhyn70syr0
Tags: upstream-0.1.4svn+r18850
ImportĀ upstreamĀ versionĀ 0.1.4svn+r18850

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: thunar-vfs-mime-info.h 18843 2005-11-14 14:25:58Z benny $ */
 
2
/*-
 
3
 * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org>
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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.
 
19
 */
 
20
 
 
21
#ifndef __THUNAR_VFS_MIME_INFO_H__
 
22
#define __THUNAR_VFS_MIME_INFO_H__
 
23
 
 
24
#include <thunar-vfs/thunar-vfs-config.h>
 
25
 
 
26
G_BEGIN_DECLS;
 
27
 
 
28
typedef struct _ThunarVfsMimeInfo ThunarVfsMimeInfo;
 
29
struct _ThunarVfsMimeInfo
 
30
{
 
31
  /*< private >*/
 
32
  gint          ref_count;
 
33
  gchar        *comment;
 
34
  gchar        *icon_name;
 
35
};
 
36
 
 
37
 
 
38
#define THUNAR_VFS_TYPE_MIME_INFO (thunar_vfs_mime_info_get_type ())
 
39
 
 
40
GType                            thunar_vfs_mime_info_get_type         (void) G_GNUC_CONST;
 
41
 
 
42
ThunarVfsMimeInfo               *thunar_vfs_mime_info_new              (const gchar             *name,
 
43
                                                                        gssize                   len) G_GNUC_MALLOC;
 
44
 
 
45
G_INLINE_FUNC ThunarVfsMimeInfo *thunar_vfs_mime_info_ref              (ThunarVfsMimeInfo       *info);
 
46
void                             thunar_vfs_mime_info_unref            (ThunarVfsMimeInfo       *info);
 
47
 
 
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);
 
50
 
 
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;
 
53
 
 
54
guint                            thunar_vfs_mime_info_hash             (gconstpointer            info);
 
55
gboolean                         thunar_vfs_mime_info_equal            (gconstpointer            a,
 
56
                                                                        gconstpointer            b);
 
57
 
 
58
const gchar                     *thunar_vfs_mime_info_lookup_icon_name (ThunarVfsMimeInfo       *info,
 
59
                                                                        GtkIconTheme            *icon_theme);
 
60
 
 
61
G_INLINE_FUNC void               thunar_vfs_mime_info_list_free        (GList                   *info_list);
 
62
 
 
63
 
 
64
#if defined(THUNAR_VFS_COMPILATION)
 
65
void _thunar_vfs_mime_info_invalidate_icon_name (ThunarVfsMimeInfo *info) G_GNUC_INTERNAL;
 
66
#endif
 
67
 
 
68
 
 
69
/* inline function implementations */
 
70
#if defined(G_CAN_INLINE) || defined(__THUNAR_VFS_MIME_INFO_C__)
 
71
/**
 
72
 * thunar_vfs_mime_info_ref:
 
73
 * @info : a #ThunarVfsMimeInfo.
 
74
 *
 
75
 * Increments the reference count on @info and returns
 
76
 * the reference to @info.
 
77
 *
 
78
 * Return value: a reference to @info.
 
79
 **/
 
80
G_INLINE_FUNC ThunarVfsMimeInfo*
 
81
thunar_vfs_mime_info_ref (ThunarVfsMimeInfo *info)
 
82
{
 
83
  exo_atomic_inc (&info->ref_count);
 
84
  return info;
 
85
}
 
86
 
 
87
/**
 
88
 * thunar_vfs_mime_info_get_name:
 
89
 * @info : a #ThunarVfsMimeInfo.
 
90
 *
 
91
 * Returns the full qualified name of the MIME type
 
92
 * described by the @info object.
 
93
 *
 
94
 * Return value: the name of @info.
 
95
 **/
 
96
G_INLINE_FUNC const gchar*
 
97
thunar_vfs_mime_info_get_name (const ThunarVfsMimeInfo *info)
 
98
{
 
99
  return ((const gchar *) info) + sizeof (*info);
 
100
}
 
101
 
 
102
/**
 
103
 * thunar_vfs_mime_info_list_free:
 
104
 * @info_list : a #GList of #ThunarVfsMimeInfo<!---->s
 
105
 *
 
106
 * Frees the list and all #ThunarVfsMimeInfo<!---->s
 
107
 * contained within the list.
 
108
 **/
 
109
G_INLINE_FUNC void
 
110
thunar_vfs_mime_info_list_free (GList *info_list)
 
111
{
 
112
  g_list_foreach (info_list, (GFunc) thunar_vfs_mime_info_unref, NULL);
 
113
  g_list_free (info_list);
 
114
}
 
115
#endif /* G_CAN_INLINE || __THUNAR_VFS_MIME_INFO_C__ */
 
116
 
 
117
 
 
118
G_END_DECLS;
 
119
 
 
120
#endif /* !__THUNAR_VFS_MIME_INFO_H__ */