1 /*
2  *  nemo-module.h - Interface to nemo extensions
3  *
4  *  Copyright (C) 2003 Novell, Inc.
5  *
6  *  This library is free software; you can redistribute it and/or
7  *  modify it under the terms of the GNU Library General Public
8  *  License as published by the Free Software Foundation; either
9  *  version 2 of the License, or (at your option) any later version.
10  *
11  *  This library is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  *  Library General Public License for more details.
15  *
16  *  You should have received a copy of the GNU Library General Public
17  *  License along with this library; if not, write to the Free
18  *  Software Foundation, Inc., 51 Franklin Street, Suite 500, MA 02110-1335, USA.
19  *
20  *  Author: Dave Camp <dave@ximian.com>
21  *
22  */
23 
24 #ifndef NEMO_MODULE_H
25 #define NEMO_MODULE_H
26 
27 #include <glib-object.h>
28 #include <gmodule.h>
29 
30 
31 G_BEGIN_DECLS
32 
33 #define NEMO_TYPE_MODULE        (nemo_module_get_type ())
34 #define NEMO_MODULE(obj)        (G_TYPE_CHECK_INSTANCE_CAST ((obj), NEMO_TYPE_MODULE, NemoModule))
35 #define NEMO_MODULE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NEMO_TYPE_MODULE, NemoModule))
36 #define NEMO_IS_MODULE(obj)     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NEMO_TYPE_MODULE))
37 #define NEMO_IS_MODULE_CLASS(klass) (G_TYPE_CLASS_CHECK_CLASS_TYPE ((klass), NEMO_TYPE_MODULE))
38 
39 typedef struct _NemoModule        NemoModule;
40 typedef struct _NemoModuleClass   NemoModuleClass;
41 
42 struct _NemoModule {
43     GTypeModule parent;
44 
45     GModule *library;
46 
47     char *path;
48 
49     void (*initialize) (GTypeModule  *module);
50     void (*shutdown)   (void);
51 
52     void (*list_types) (const GType **types,
53                 int          *num_types);
54     void (*get_modules_name_and_desc) (gchar ***strings);
55 };
56 
57 struct _NemoModuleClass {
58     GTypeModuleClass parent;
59 };
60 
61 GType nemo_module_get_type (void);
62 
63 void   nemo_module_setup                   (void);
64 void   nemo_module_refresh                 (void);
65 GList *nemo_module_get_extensions_for_type (GType  type);
66 void   nemo_module_extension_list_free     (GList *list);
67 
68 /* Add a type to the module interface - allows nemo to add its own modules
69  * without putting them in separate shared libraries */
70 void   nemo_module_add_type                (GType  type);
71 
72 G_END_DECLS
73 
74 #endif
75