2
* Copyright (C) 2011 Jonathan Matthew <jonathan@d14n.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* The Rhythmbox authors hereby grant permission for non-GPL compatible
10
* GStreamer plugins to be used and distributed together with GStreamer
11
* and Rhythmbox. This permission is above and beyond the permissions granted
12
* by the GPL license by which Rhythmbox is covered. If you modify this code
13
* you may extend this exception to your version of the code, but you are not
14
* obligated to do so. If you do not wish to do so, delete this exception
15
* statement from your version.
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.
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 St, Fifth Floor,
25
* Boston, MA 02110-1301 USA.
28
#ifndef RB_PLUGIN_MACROS_H
29
#define RB_PLUGIN_MACROS_H
31
#include <libpeas/peas.h>
40
#define RB_DEFINE_PLUGIN(TYPE_NAME, TypeName, type_name, TYPE_CODE) \
41
GType type_name##_get_type (void) G_GNUC_CONST; \
42
static void impl_activate (PeasActivatable *plugin); \
43
static void impl_deactivate (PeasActivatable *plugin); \
44
static void peas_activatable_iface_init (PeasActivatableInterface *iface); \
46
G_DEFINE_DYNAMIC_TYPE_EXTENDED (TypeName, \
48
PEAS_TYPE_EXTENSION_BASE, \
50
G_IMPLEMENT_INTERFACE_DYNAMIC (PEAS_TYPE_ACTIVATABLE,\
51
peas_activatable_iface_init)\
54
static void peas_activatable_iface_init (PeasActivatableInterface *iface) \
56
iface->activate = impl_activate; \
57
iface->deactivate = impl_deactivate; \
60
static void set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) \
64
g_object_set_data_full (object, \
66
g_value_dup_object (value), \
70
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); \
74
static void get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) \
78
g_value_set_object (value, g_object_get_data (object, "rb-shell")); \
81
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); \
85
static void type_name##_class_init (TypeName##Class *klass) \
87
GObjectClass *object_class = G_OBJECT_CLASS (klass); \
88
object_class->set_property = set_property; \
89
object_class->get_property = get_property; \
90
g_object_class_override_property (object_class, PROP_OBJECT, "object"); \
92
static void type_name##_class_finalize (TypeName##Class *klass) \
99
#endif /* RB_PLUGIN_MACROS_H */