1 /*
2 * Nautilus-Actions
3 * A Nautilus extension which offers configurable context menu actions.
4 *
5 * Copyright (C) 2005 The GNOME Foundation
6 * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS)
7 * Copyright (C) 2009-2014 Pierre Wieser and others (see AUTHORS)
8 *
9 * Nautilus-Actions is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
13 *
14 * Nautilus-Actions is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with Nautilus-Actions; see the file COPYING. If not, see
21 * <http://www.gnu.org/licenses/>.
22 *
23 * Authors:
24 * Frederic Ruaudel <grumz@grumz.net>
25 * Rodrigo Moya <rodrigo@gnome-db.org>
26 * Pierre Wieser <pwieser@trychlos.org>
27 * ... and many others (see AUTHORS)
28 */
29
30 #ifdef HAVE_CONFIG_H
31 #include <config.h>
32 #endif
33
34 #include <api/na-extension.h>
35
36 #include "nadp-desktop-provider.h"
37
38 /* the count of GType types provided by this extension
39 * each new GType type must
40 * - be registered in na_extension_startup()
41 * - be addressed in na_extension_list_types().
42 */
43 #define NADP_TYPES_COUNT 1
44
45 /*
46 * na_extension_startup:
47 *
48 * mandatory starting with API v. 1.
49 */
50 gboolean
na_extension_startup(GTypeModule * module)51 na_extension_startup( GTypeModule *module )
52 {
53 static const gchar *thisfn = "nadp_module_na_extension_startup";
54
55 g_debug( "%s: module=%p", thisfn, ( void * ) module );
56
57 nadp_desktop_provider_register_type( module );
58
59 return( TRUE );
60 }
61
62 /*
63 * na_extension_get_version:
64 *
65 * optional, defaults to 1.
66 */
67 guint
na_extension_get_version(void)68 na_extension_get_version( void )
69 {
70 static const gchar *thisfn = "nadp_module_na_extension_get_version";
71 guint version;
72
73 version = 1;
74
75 g_debug( "%s: version=%d", thisfn, version );
76
77 return( version );
78 }
79
80 /*
81 * na_extension_list_types:
82 *
83 * mandatory starting with v. 1.
84 */
85 guint
na_extension_list_types(const GType ** types)86 na_extension_list_types( const GType **types )
87 {
88 static const gchar *thisfn = "nadp_module_na_extension_list_types";
89 static GType types_list [1+NADP_TYPES_COUNT];
90
91 g_debug( "%s: types=%p", thisfn, ( void * ) types );
92
93 types_list[0] = NADP_TYPE_DESKTOP_PROVIDER;
94
95 types_list[NADP_TYPES_COUNT] = 0;
96 *types = types_list;
97
98 return( NADP_TYPES_COUNT );
99 }
100
101 /*
102 * na_extension_shutdown:
103 *
104 * mandatory starting with v. 1.
105 */
106 void
na_extension_shutdown(void)107 na_extension_shutdown( void )
108 {
109 static const gchar *thisfn = "nadp_module_na_extension_shutdown";
110
111 g_debug( "%s", thisfn );
112 }
113