| |
1 /** |
| |
2 * @file plugins.h Plugins API |
| |
3 * @ingroup core |
| |
4 */ |
| |
5 |
| |
6 /* purple |
| |
7 * |
| |
8 * Purple is the legal property of its developers, whose names are too numerous |
| |
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
| |
10 * source distribution. |
| |
11 * |
| |
12 * This program is free software; you can redistribute it and/or modify |
| |
13 * it under the terms of the GNU General Public License as published by |
| |
14 * the Free Software Foundation; either version 2 of the License, or |
| |
15 * (at your option) any later version. |
| |
16 * |
| |
17 * This program is distributed in the hope that it will be useful, |
| |
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| |
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| |
20 * GNU General Public License for more details. |
| |
21 * |
| |
22 * You should have received a copy of the GNU General Public License |
| |
23 * along with this program; if not, write to the Free Software |
| |
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| |
25 */ |
| |
26 #ifndef _PURPLE_PLUGIN_H_ |
| |
27 #define _PURPLE_PLUGIN_H_ |
| |
28 |
| |
29 #include <gplugin.h> |
| |
30 |
| |
31 #define PURPLE_TYPE_PLUGIN (purple_plugin_get_type()) |
| |
32 #define PURPLE_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_PLUGIN, PurplePlugin)) |
| |
33 #define PURPLE_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_PLUGIN, PurplePluginClass)) |
| |
34 #define PURPLE_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_PLUGIN)) |
| |
35 #define PURPLE_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_PLUGIN)) |
| |
36 #define PURPLE_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_PLUGIN, PurplePluginClass)) |
| |
37 |
| |
38 /** @copydoc _PurplePlugin */ |
| |
39 typedef struct _PurplePlugin PurplePlugin; |
| |
40 /** @copydoc _PurplePluginClass */ |
| |
41 typedef struct _PurplePluginClass PurplePluginClass; |
| |
42 |
| |
43 #include "pluginpref.h" |
| |
44 |
| |
45 /** |
| |
46 * Represents a plugin that can be loaded/unloaded by libpurple. |
| |
47 * |
| |
48 * #PurplePlugin inherits #GPluginPluginImplementation, which holds the |
| |
49 * low-level details about the plugin in a #GPluginPlugin instance. |
| |
50 */ |
| |
51 struct _PurplePlugin { |
| |
52 /*< private >*/ |
| |
53 GPluginPluginImplementation parent; |
| |
54 }; |
| |
55 |
| |
56 /** |
| |
57 * PurplePluginClass: |
| |
58 * |
| |
59 * The base class for all #PurplePlugin's. |
| |
60 */ |
| |
61 struct _PurplePluginClass { |
| |
62 /*< private >*/ |
| |
63 GPluginPluginImplementationClass parent_class; |
| |
64 |
| |
65 void (*_purple_reserved1)(void); |
| |
66 void (*_purple_reserved2)(void); |
| |
67 void (*_purple_reserved3)(void); |
| |
68 void (*_purple_reserved4)(void); |
| |
69 }; |
| |
70 |
| |
71 G_BEGIN_DECLS |
| |
72 |
| |
73 /**************************************************************************/ |
| |
74 /** @name Plugin API */ |
| |
75 /**************************************************************************/ |
| |
76 /*@{*/ |
| |
77 |
| |
78 /** |
| |
79 * Returns the GType for the PurplePlugin object. |
| |
80 */ |
| |
81 GType purple_plugin_get_type(void); |
| |
82 |
| |
83 /*@}*/ |
| |
84 |
| |
85 /**************************************************************************/ |
| |
86 /** @name Plugins Subsystem API */ |
| |
87 /**************************************************************************/ |
| |
88 /*@{*/ |
| |
89 |
| |
90 /** |
| |
91 * Returns the plugin subsystem handle. |
| |
92 * |
| |
93 * @return The plugin sybsystem handle. |
| |
94 */ |
| |
95 void *purple_plugins_get_handle(void); |
| |
96 |
| |
97 /** |
| |
98 * Initializes the plugin subsystem |
| |
99 */ |
| |
100 void purple_plugins_init(void); |
| |
101 |
| |
102 /** |
| |
103 * Uninitializes the plugin subsystem |
| |
104 */ |
| |
105 void purple_plugins_uninit(void); |
| |
106 |
| |
107 /*@}*/ |
| |
108 |
| |
109 G_END_DECLS |
| |
110 |
| |
111 #endif /* _PURPLE_PLUGIN_H_ */ |