[gedit/eggplugins] [libplugins] Fix some mistakes in macros.



commit 5b6b1d7524e5d3e739f266172e385829840b9b99
Author: Steve Frécinaux <code istique net>
Date:   Sun Oct 11 23:23:51 2009 +0200

    [libplugins] Fix some mistakes in macros.

 Makefile.am                     |    2 +-
 gedit/gedit-plugin.h            |   45 ++++++--------------------------------
 libplugins/egg-plugins-plugin.h |   12 ++++------
 3 files changed, 13 insertions(+), 46 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a06488b..10bfb1d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = libplugins gedit pixmaps po help data plugin-loaders docs win32
+SUBDIRS = libplugins gedit plugins pixmaps po help data plugin-loaders docs win32
 
 distuninstallcheck_listfiles = find . -type f -print | grep -v scrollkeeper
 
diff --git a/gedit/gedit-plugin.h b/gedit/gedit-plugin.h
index 848b7c7..77c4a24 100644
--- a/gedit/gedit-plugin.h
+++ b/gedit/gedit-plugin.h
@@ -42,11 +42,11 @@ G_BEGIN_DECLS
  * Type checking and casting macros
  */
 #define GEDIT_TYPE_PLUGIN              (egg_plugins_plugin_get_type())
-#define GEDIT_PLUGIN(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_PLUGIN_TYPE_PLUGIN, GeditPlugin))
-#define GEDIT_PLUGIN_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_PLUGIN_TYPE_PLUGIN, GeditPluginClass))
-#define GEDIT_IS_PLUGIN(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_PLUGIN_TYPE_PLUGIN))
-#define GEDIT_IS_PLUGIN_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_PLUGIN_TYPE_PLUGIN))
-#define GEDIT_PLUGIN_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_PLUGIN_TYPE_PLUGIN, GeditPluginClass))
+#define GEDIT_PLUGIN(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_PLUGIN, GeditPlugin))
+#define GEDIT_PLUGIN_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_PLUGIN, GeditPluginClass))
+#define GEDIT_IS_PLUGIN(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_PLUGIN))
+#define GEDIT_IS_PLUGIN_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PLUGIN))
+#define GEDIT_PLUGIN_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_PLUGIN, GeditPluginClass))
 
 /*
  * Main object structure
@@ -87,39 +87,8 @@ GType 		 gedit_plugin_get_type 		(void) G_GNUC_CONST;
  *
  * Utility macro used to register plugins.
  */
-#define GEDIT_PLUGINS_REGISTER_TYPE(PluginName, plugin_name) \
-	EGG_PLUGINS_PLUGIN_REGISTER_TYPE(GEDIT_TYPE_PLUGIN, PluginName, plugin_name)
-
-/**
- * GEDIT_PLUGIN_DEFINE_TYPE_WITH_CODE(TypeName, type_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(TypeName, type_name, PARENT_TYPE, CODE) \
-	G_DEFINE_DYNAMIC_TYPE_EXTENDED(TypeName, type_name, PARENT_TYPE, 0, CODE)
-
-
-/**
- * GEDIT_PLUGIN_DEFINE_TYPE(TypeName, type_name, PARENT_TYPE):
- *
- * Utility macro used to register gobject types in plugins.
- *
- * Deprecated: use G_DEFINE_DYNAMIC_TYPE instead
- */
-#define GEDIT_DEFINE_TYPE(TypeName, type_name, PARENT_TYPE) \
-	G_DEFINE_DYNAMIC_TYPE(TypeName, type_name, PARENT_TYPE)
-
-/**
- * GEDIT_PLUGIN_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init):
- *
- * Utility macro used to register interfaces for gobject types in plugins.
- *
- * Deprecated: use G_IMPLEMENT_INTERFACE instead.
- */
-#define GEDIT_PLUGIN_IMPLEMENT_INTERFACE(type_name, TYPE_IFACE, iface_init) \
-	G_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init)
+#define GEDIT_PLUGIN_REGISTER_TYPE(PluginName, plugin_name) \
+	EGG_PLUGINS_REGISTER_TYPE(GEDIT_TYPE_PLUGIN, PluginName, plugin_name)
 
 G_END_DECLS
 
diff --git a/libplugins/egg-plugins-plugin.h b/libplugins/egg-plugins-plugin.h
index d25a98f..9de08b8 100644
--- a/libplugins/egg-plugins-plugin.h
+++ b/libplugins/egg-plugins-plugin.h
@@ -115,16 +115,15 @@ GtkWidget	*egg_plugins_plugin_create_configure_dialog
 							(EggPluginsPlugin *plugin);
 
 /**
- * EGG_PLUGIN_REGISTER_TYPE_WITH_CODE(PARENT_TYPE, PluginName, plugin_name, CODE):
+ * EGG_PLUGINS_REGISTER_TYPE_WITH_CODE(PARENT_TYPE, PluginName, plugin_name, CODE):
  *
  * Utility macro used to register plugins with additional code.
  */
-#define EGG_PLUGIN_REGISTER_TYPE_WITH_CODE(PARENT_TYPE, PluginName, plugin_name, CODE) 	\
+#define EGG_PLUGINS_REGISTER_TYPE_WITH_CODE(PARENT_TYPE, PluginName, plugin_name, CODE) 	\
 	G_DEFINE_DYNAMIC_TYPE_EXTENDED (PluginName,				\
 					plugin_name,				\
 					PARENT_TYPE,				\
 					0,					\
-					GTypeModule *module G_GNUC_UNUSED = type_module; /* back compat */	\
 					CODE)					\
 										\
 /* This is not very nice, but G_DEFINE_DYNAMIC wants it and our old macro	\
@@ -134,9 +133,8 @@ plugin_name##_class_finalize (PluginName##Class *klass)				\
 {										\
 }										\
 										\
-										\
 G_MODULE_EXPORT GType								\
-register_egg_plugins_plugin (GTypeModule *type_module)				\
+register_gedit_plugin (GTypeModule *type_module)				\
 {										\
 	plugin_name##_register_type (type_module);				\
 										\
@@ -148,8 +146,8 @@ register_egg_plugins_plugin (GTypeModule *type_module)				\
  *
  * Utility macro used to register plugins.
  */
-#define EGG_PLUGIN_REGISTER_TYPE(PARENT_TYPE, PluginName, plugin_name)		\
-	EGG_PLUGIN_REGISTER_TYPE_WITH_CODE(PARENT_TYPE, PluginName, plugin_name, ;)
+#define EGG_PLUGINS_REGISTER_TYPE(PARENT_TYPE, PluginName, plugin_name)		\
+	EGG_PLUGINS_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]