~noskcaj/ubuntu/vivid/thunar/1.6.4

« back to all changes in this revision

Viewing changes to thunar-vfs/thunar-vfs-mime-action.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2010-12-04 16:46:20 UTC
  • mto: (2.1.3 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 69.
  • Revision ID: james.westby@ubuntu.com-20101204164620-h7p4t2e9z6hfhz6l
Tags: upstream-1.1.4
ImportĀ upstreamĀ versionĀ 1.1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id$ */
2
 
/*-
3
 
 * Copyright (c) 2005-2006 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
 
#ifdef HAVE_CONFIG_H
22
 
#include <config.h>
23
 
#endif
24
 
 
25
 
#include <thunar-vfs/thunar-vfs-mime-action-private.h>
26
 
#include <thunar-vfs/thunar-vfs-mime-action.h>
27
 
#include <thunar-vfs/thunar-vfs-alias.h>
28
 
 
29
 
 
30
 
 
31
 
GType
32
 
thunar_vfs_mime_action_get_type (void)
33
 
{
34
 
  static GType type = G_TYPE_INVALID;
35
 
 
36
 
  if (G_UNLIKELY (type == G_TYPE_INVALID))
37
 
    {
38
 
      static const GTypeInfo info =
39
 
      {
40
 
        sizeof (ThunarVfsMimeActionClass),
41
 
        NULL,
42
 
        NULL,
43
 
        NULL,
44
 
        NULL,
45
 
        NULL,
46
 
        sizeof (ThunarVfsMimeAction),
47
 
        0,
48
 
        NULL,
49
 
        NULL,
50
 
      };
51
 
 
52
 
      type = g_type_register_static (THUNAR_VFS_TYPE_MIME_HANDLER, I_("ThunarVfsMimeAction"), &info, 0);
53
 
    }
54
 
 
55
 
  return type;
56
 
}
57
 
 
58
 
 
59
 
 
60
 
/**
61
 
 * _thunar_vfs_mime_action_new:
62
 
 * @command : the command for the mime action.
63
 
 * @name    : the name for the mime action.
64
 
 * @icon    : the icon for the mime action or %NULL.
65
 
 * @flags   : the #ThunarVfsMimeHandlerFlags for the mime action.
66
 
 *
67
 
 * Allocates a new #ThunarVfsMimeAction with the given
68
 
 * parameters.
69
 
 *
70
 
 * Return value: the newly allocated #ThunarVfsMimeAction.
71
 
 **/
72
 
ThunarVfsMimeAction*
73
 
_thunar_vfs_mime_action_new (const gchar              *command,
74
 
                             const gchar              *name,
75
 
                             const gchar              *icon,
76
 
                             ThunarVfsMimeHandlerFlags flags)
77
 
{
78
 
  g_return_val_if_fail (g_utf8_validate (name, -1, NULL), NULL);
79
 
  g_return_val_if_fail (command != NULL, NULL);
80
 
 
81
 
  return g_object_new (THUNAR_VFS_TYPE_MIME_ACTION,
82
 
                       "command", command,
83
 
                       "flags", flags,
84
 
                       "icon", icon,
85
 
                       "name", name,
86
 
                       NULL);
87
 
}
88
 
 
89
 
 
90
 
 
91
 
#define __THUNAR_VFS_MIME_ACTION_C__
92
 
#include <thunar-vfs/thunar-vfs-aliasdef.c>