[gedit/eggplugins: 4/6] Drop obsolete macros.
- From: Steve Frécinaux <sfre src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit/eggplugins: 4/6] Drop obsolete macros.
- Date: Fri, 9 Oct 2009 18:04:19 +0000 (UTC)
commit 647afa29fd196ea614ce5093779244f97d6d2e68
Author: Steve Frécinaux <code istique net>
Date: Fri Oct 9 12:11:07 2009 +0200
Drop obsolete macros.
- EGG_PLUGINS_DEFINE_TYPE is replaced by G_DEFINE_DYNAMIC_TYPE
- EGG_PLUGINS_IMPLEMENT_INTERFACE is replaced by G_IMPLEMENT_INTERFACE,
which can be always be used as long as the interface is not defined
in a loadable module (100% of our current use cases).
libplugins/egg-plugins-plugin.h | 95 +++------------------------------------
1 files changed, 6 insertions(+), 89 deletions(-)
---
diff --git a/libplugins/egg-plugins-plugin.h b/libplugins/egg-plugins-plugin.h
index 58fba35..5e50dba 100644
--- a/libplugins/egg-plugins-plugin.h
+++ b/libplugins/egg-plugins-plugin.h
@@ -115,14 +115,14 @@ GtkWidget *egg_plugins_plugin_create_configure_dialog
(EggPluginsPlugin *plugin);
/**
- * EGG_PLUGINS_PLUGIN_REGISTER_TYPE_WITH_CODE(PluginName, plugin_name, CODE):
+ * EGG_PLUGIN_REGISTER_TYPE_WITH_CODE(PARENT_TYPE, PluginName, plugin_name, CODE):
*
* Utility macro used to register plugins with additional code.
*/
-#define EGG_PLUGINS_PLUGIN_REGISTER_TYPE_WITH_CODE(PluginName, plugin_name, CODE) \
+#define EGG_PLUGIN_REGISTER_TYPE_WITH_CODE(PARENT_TYPE, PluginName, plugin_name, CODE) \
G_DEFINE_DYNAMIC_TYPE_EXTENDED (PluginName, \
plugin_name, \
- EGG_PLUGINS_TYPE_PLUGIN, \
+ PARENT_TYPE, \
0, \
GTypeModule *module G_GNUC_UNUSED = type_module; /* back compat */ \
CODE) \
@@ -144,95 +144,12 @@ register_egg_plugins_plugin (GTypeModule *type_module) \
}
/**
- * EGG_PLUGINS_REGISTER_TYPE(PluginName, plugin_name):
+ * EGG_PLUGINS_REGISTER_TYPE(PARENT_TYPE, PluginName, plugin_name):
*
* Utility macro used to register plugins.
*/
-#define EGG_PLUGINS_PLUGIN_REGISTER_TYPE(PluginName, plugin_name) \
- EGG_PLUGINS_PLUGIN_REGISTER_TYPE_WITH_CODE(PluginName, plugin_name, ;)
-
-/**
- * EGG_PLUGINS_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, CODE):
- *
- * Utility macro used to register gobject types in plugins with additional code.
- *
- * Deprecated: use G_DEFINE_DYNAMIC_TYPE_EXTENDED instead
- */
-#define EGG_PLUGINS_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, CODE) \
- \
-static GType g_define_type_id = 0; \
- \
-GType \
-object_name##_get_type (void) \
-{ \
- return g_define_type_id; \
-} \
- \
-static void object_name##_init (ObjectName *self); \
-static void object_name##_class_init (ObjectName##Class *klass); \
-static gpointer object_name##_parent_class = NULL; \
-static void object_name##_class_intern_init (gpointer klass) \
-{ \
- object_name##_parent_class = g_type_class_peek_parent (klass); \
- object_name##_class_init ((ObjectName##Class *) klass); \
-} \
- \
-GType \
-object_name##_register_type (GTypeModule *type_module) \
-{ \
- GTypeModule *module G_GNUC_UNUSED = type_module; /* back compat */ \
- static const GTypeInfo our_info = \
- { \
- sizeof (ObjectName##Class), \
- NULL, /* base_init */ \
- NULL, /* base_finalize */ \
- (GClassInitFunc) object_name##_class_intern_init, \
- NULL, \
- NULL, /* class_data */ \
- sizeof (ObjectName), \
- 0, /* n_preallocs */ \
- (GInstanceInitFunc) object_name##_init \
- }; \
- \
- g_define_type_id = g_type_module_register_type (type_module, \
- PARENT_TYPE, \
- #ObjectName, \
- &our_info, \
- 0); \
- \
- CODE \
- \
- return g_define_type_id; \
-}
-
-
-/**
- * EGG_PLUGINS_DEFINE_TYPE(ObjectName, object_name, PARENT_TYPE):
- *
- * Utility macro used to register gobject types in plugins.
- *
- * Deprecated: use G_DEFINE_DYNAMIC instead
- */
-#define EGG_PLUGINS_DEFINE_TYPE(ObjectName, object_name, PARENT_TYPE) \
- EGG_PLUGINS_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, ;)
-
-/**
- * EGG_PLUGINS_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init):
- *
- * Utility macro used to register interfaces for gobject types in plugins.
- */
-#define EGG_PLUGINS_IMPLEMENT_INTERFACE(object_name, TYPE_IFACE, iface_init) \
- const GInterfaceInfo object_name##_interface_info = \
- { \
- (GInterfaceInitFunc) iface_init, \
- NULL, \
- NULL \
- }; \
- \
- g_type_module_add_interface (type_module, \
- g_define_type_id, \
- TYPE_IFACE, \
- &object_name##_interface_info);
+#define EGG_PLUGIN_REGISTER_TYPE(PARENT_TYPE, PluginName, plugin_name) \
+ EGG_PLUGIN_REGISTER_TYPE_WITH_CODE(PARENT_TYPE, PluginName, plugin_name, ;)
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]