[libpeas] Make the various loaders define static types.



commit f4b3f9836a79d95f49c145de101de64e0f2a3d2f
Author: Steve Frécinaux <code istique net>
Date:   Wed Aug 18 13:44:30 2010 +0200

    Make the various loaders define static types.
    
    The main reason for this change is that g_type_query() doesn't return
    correct values for dynamic types, and the next commit is going to
    introduce a requirement for it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=627338

 loaders/c/peas-extension-c.c               |   13 +------------
 loaders/c/peas-extension-c.h               |    1 -
 loaders/c/peas-plugin-loader-c.c           |   10 +---------
 loaders/python/peas-extension-python.c     |   13 +------------
 loaders/python/peas-extension-python.h     |    1 -
 loaders/python/peas-plugin-loader-python.c |   10 +---------
 loaders/seed/peas-extension-seed.c         |   13 +------------
 loaders/seed/peas-extension-seed.h         |    1 -
 loaders/seed/peas-plugin-loader-seed.c     |   10 +---------
 9 files changed, 6 insertions(+), 66 deletions(-)
---
diff --git a/loaders/c/peas-extension-c.c b/loaders/c/peas-extension-c.c
index 0fe4815..8a9fe5c 100644
--- a/loaders/c/peas-extension-c.c
+++ b/loaders/c/peas-extension-c.c
@@ -27,13 +27,7 @@
 #include <libpeas/peas-introspection.h>
 #include "peas-extension-c.h"
 
-G_DEFINE_DYNAMIC_TYPE (PeasExtensionC, peas_extension_c, PEAS_TYPE_EXTENSION);
-
-void
-peas_extension_c_register (GTypeModule *module)
-{
-  peas_extension_c_register_type (module);
-}
+G_DEFINE_TYPE (PeasExtensionC, peas_extension_c, PEAS_TYPE_EXTENSION);
 
 static void
 peas_extension_c_init (PeasExtensionC *cexten)
@@ -76,11 +70,6 @@ peas_extension_c_class_init (PeasExtensionCClass *klass)
   extension_class->call = peas_extension_c_call;
 }
 
-static void
-peas_extension_c_class_finalize (PeasExtensionCClass *klass)
-{
-}
-
 PeasExtension *
 peas_extension_c_new (GType    gtype,
                       GObject *instance)
diff --git a/loaders/c/peas-extension-c.h b/loaders/c/peas-extension-c.h
index 71dd045..a2f75f7 100644
--- a/loaders/c/peas-extension-c.h
+++ b/loaders/c/peas-extension-c.h
@@ -47,7 +47,6 @@ struct _PeasExtensionCClass {
 };
 
 GType            peas_extension_c_get_type  (void) G_GNUC_CONST;
-void             peas_extension_c_register  (GTypeModule *module);
 
 PeasExtension   *peas_extension_c_new       (GType        gtype,
                                              GObject     *instance);
diff --git a/loaders/c/peas-plugin-loader-c.c b/loaders/c/peas-plugin-loader-c.c
index 4f15b1e..1a20a47 100644
--- a/loaders/c/peas-plugin-loader-c.c
+++ b/loaders/c/peas-plugin-loader-c.c
@@ -36,14 +36,11 @@ struct _PeasPluginLoaderCPrivate
   GHashTable *loaded_plugins;
 };
 
-G_DEFINE_DYNAMIC_TYPE (PeasPluginLoaderC, peas_plugin_loader_c, PEAS_TYPE_PLUGIN_LOADER);
+G_DEFINE_TYPE (PeasPluginLoaderC, peas_plugin_loader_c, PEAS_TYPE_PLUGIN_LOADER);
 
 G_MODULE_EXPORT void
 peas_register_types (PeasObjectModule *module)
 {
-  peas_plugin_loader_c_register_type (G_TYPE_MODULE (module));
-  peas_extension_c_register (G_TYPE_MODULE (module));
-
   peas_object_module_register_extension_type (module,
                                               PEAS_TYPE_PLUGIN_LOADER,
                                               PEAS_TYPE_PLUGIN_LOADER_C);
@@ -231,8 +228,3 @@ peas_plugin_loader_c_class_init (PeasPluginLoaderCClass *klass)
 
   g_type_class_add_private (object_class, sizeof (PeasPluginLoaderCPrivate));
 }
-
-static void
-peas_plugin_loader_c_class_finalize (PeasPluginLoaderCClass *klass)
-{
-}
diff --git a/loaders/python/peas-extension-python.c b/loaders/python/peas-extension-python.c
index a667933..d104112 100644
--- a/loaders/python/peas-extension-python.c
+++ b/loaders/python/peas-extension-python.c
@@ -32,13 +32,7 @@
 #include <libpeas/peas-introspection.h>
 #include "peas-extension-python.h"
 
-G_DEFINE_DYNAMIC_TYPE (PeasExtensionPython, peas_extension_python, PEAS_TYPE_EXTENSION);
-
-void
-peas_extension_python_register (GTypeModule *module)
-{
-  peas_extension_python_register_type (module);
-}
+G_DEFINE_TYPE (PeasExtensionPython, peas_extension_python, PEAS_TYPE_EXTENSION);
 
 static void
 peas_extension_python_init (PeasExtensionPython *pyexten)
@@ -85,11 +79,6 @@ peas_extension_python_class_init (PeasExtensionPythonClass *klass)
   extension_class->call = peas_extension_python_call;
 }
 
-static void
-peas_extension_python_class_finalize (PeasExtensionPythonClass *klass)
-{
-}
-
 PeasExtension *
 peas_extension_python_new (GType     gtype,
                            PyObject *instance)
diff --git a/loaders/python/peas-extension-python.h b/loaders/python/peas-extension-python.h
index d8699e0..476ae69 100644
--- a/loaders/python/peas-extension-python.h
+++ b/loaders/python/peas-extension-python.h
@@ -52,7 +52,6 @@ struct _PeasExtensionPythonClass {
 };
 
 GType            peas_extension_python_get_type (void) G_GNUC_CONST;
-void             peas_extension_python_register (GTypeModule *module);
 
 PeasExtension   *peas_extension_python_new      (GType        gtype,
                                                  PyObject    *instance);
diff --git a/loaders/python/peas-plugin-loader-python.c b/loaders/python/peas-plugin-loader-python.c
index 10c35b1..7f956bc 100644
--- a/loaders/python/peas-plugin-loader-python.c
+++ b/loaders/python/peas-plugin-loader-python.c
@@ -57,14 +57,11 @@ static PyObject *PyGObject_Type;
 static gboolean   peas_plugin_loader_python_add_module_path (PeasPluginLoaderPython *self,
                                                              const gchar            *module_path);
 
-G_DEFINE_DYNAMIC_TYPE (PeasPluginLoaderPython, peas_plugin_loader_python, PEAS_TYPE_PLUGIN_LOADER);
+G_DEFINE_TYPE (PeasPluginLoaderPython, peas_plugin_loader_python, PEAS_TYPE_PLUGIN_LOADER);
 
 G_MODULE_EXPORT void
 peas_register_types (PeasObjectModule *module)
 {
-  peas_plugin_loader_python_register_type (G_TYPE_MODULE (module));
-  peas_extension_python_register (G_TYPE_MODULE (module));
-
   peas_object_module_register_extension_type (module,
                                               PEAS_TYPE_PLUGIN_LOADER,
                                               PEAS_TYPE_PLUGIN_LOADER_PYTHON);
@@ -593,8 +590,3 @@ peas_plugin_loader_python_class_init (PeasPluginLoaderPythonClass *klass)
 
   g_type_class_add_private (object_class, sizeof (PeasPluginLoaderPythonPrivate));
 }
-
-static void
-peas_plugin_loader_python_class_finalize (PeasPluginLoaderPythonClass *klass)
-{
-}
diff --git a/loaders/seed/peas-extension-seed.c b/loaders/seed/peas-extension-seed.c
index 71094e7..50e3532 100644
--- a/loaders/seed/peas-extension-seed.c
+++ b/loaders/seed/peas-extension-seed.c
@@ -27,7 +27,7 @@
 #include <libpeas/peas-introspection.h>
 #include <girepository.h>
 
-G_DEFINE_DYNAMIC_TYPE (PeasExtensionSeed, peas_extension_seed, PEAS_TYPE_EXTENSION);
+G_DEFINE_TYPE (PeasExtensionSeed, peas_extension_seed, PEAS_TYPE_EXTENSION);
 
 enum {
   PROP_0,
@@ -394,17 +394,6 @@ peas_extension_seed_class_init (PeasExtensionSeedClass *klass)
                                                          G_PARAM_CONSTRUCT_ONLY));
 }
 
-static void
-peas_extension_seed_class_finalize (PeasExtensionSeedClass *klass)
-{
-}
-
-void
-peas_extension_seed_register (GTypeModule *type_module)
-{
-  peas_extension_seed_register_type (type_module);
-}
-
 PeasExtension *
 peas_extension_seed_new (GType       exten_type,
                          SeedContext js_context,
diff --git a/loaders/seed/peas-extension-seed.h b/loaders/seed/peas-extension-seed.h
index 862831f..43082a6 100644
--- a/loaders/seed/peas-extension-seed.h
+++ b/loaders/seed/peas-extension-seed.h
@@ -49,7 +49,6 @@ struct _PeasExtensionSeedClass {
 };
 
 GType            peas_extension_seed_get_type (void) G_GNUC_CONST;
-void             peas_extension_seed_register (GTypeModule    *type_module);
 
 PeasExtension   *peas_extension_seed_new      (GType           exten_type,
                                                SeedContext     js_context,
diff --git a/loaders/seed/peas-plugin-loader-seed.c b/loaders/seed/peas-plugin-loader-seed.c
index 5a184ad..0da91a6 100644
--- a/loaders/seed/peas-plugin-loader-seed.c
+++ b/loaders/seed/peas-plugin-loader-seed.c
@@ -32,7 +32,7 @@ SeedValue seed_value_from_gvalue (SeedContext    ctx,
 #include "peas-plugin-loader-seed.h"
 #include "peas-extension-seed.h"
 
-G_DEFINE_DYNAMIC_TYPE (PeasPluginLoaderSeed, peas_plugin_loader_seed, PEAS_TYPE_PLUGIN_LOADER);
+G_DEFINE_TYPE (PeasPluginLoaderSeed, peas_plugin_loader_seed, PEAS_TYPE_PLUGIN_LOADER);
 
 typedef struct {
   SeedContext context;
@@ -277,17 +277,9 @@ peas_plugin_loader_seed_class_init (PeasPluginLoaderSeedClass *klass)
   loader_class->garbage_collect = peas_plugin_loader_seed_garbage_collect;
 }
 
-static void
-peas_plugin_loader_seed_class_finalize (PeasPluginLoaderSeedClass *klass)
-{
-}
-
 G_MODULE_EXPORT void
 peas_register_types (PeasObjectModule *module)
 {
-  peas_plugin_loader_seed_register_type (G_TYPE_MODULE (module));
-  peas_extension_seed_register (G_TYPE_MODULE (module));
-
   peas_object_module_register_extension_type (module,
                                               PEAS_TYPE_PLUGIN_LOADER,
                                               PEAS_TYPE_PLUGIN_LOADER_SEED);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]