[libpeas] Make the extension wrapper a private class.



commit 18114f3a64b4380840b83af26719c1f2554189a2
Author: Steve FrÃcinaux <code istique net>
Date:   Fri Jun 24 00:51:21 2011 +0200

    Make the extension wrapper a private class.
    
    The previous PeasExtension class was copied into PeasExtensionWrapper.
    The PeasExtension class is now an alias to GObject, and the related API
    has been reimplemented on top of PeasExtensionWrapper.

 libpeas/Makefile.am                    |    3 +-
 libpeas/peas-extension-subclasses.c    |   15 ++--
 libpeas/peas-extension-wrapper.c       |  183 ++++++++++++++++++++++++++++++++
 libpeas/peas-extension-wrapper.h       |   76 +++++++++++++
 libpeas/peas-extension.c               |  112 ++------------------
 libpeas/peas-extension.h               |   22 +---
 loaders/c/peas-extension-c.c           |   18 ++--
 loaders/c/peas-extension-c.h           |    8 +-
 loaders/gjs/peas-extension-gjs.c       |   18 ++--
 loaders/gjs/peas-extension-gjs.h       |    8 +-
 loaders/python/peas-extension-python.c |   18 ++--
 loaders/python/peas-extension-python.h |    8 +-
 loaders/seed/peas-extension-seed.c     |   18 ++--
 loaders/seed/peas-extension-seed.h     |    8 +-
 14 files changed, 335 insertions(+), 180 deletions(-)
---
diff --git a/libpeas/Makefile.am b/libpeas/Makefile.am
index 3e744b7..101fdb5 100644
--- a/libpeas/Makefile.am
+++ b/libpeas/Makefile.am
@@ -32,7 +32,7 @@ NOINST_H_FILES =			\
 	peas-debug.h			\
 	peas-dirs.h			\
 	peas-engine-priv.h		\
-	peas-extension-priv.h		\
+	peas-extension-wrapper.h	\
 	peas-extension-subclasses.h	\
 	peas-helpers.h			\
 	peas-i18n.h			\
@@ -48,6 +48,7 @@ C_FILES =				\
 	peas-extension.c		\
 	peas-extension-base.c		\
 	peas-extension-set.c		\
+	peas-extension-wrapper.c	\
 	peas-extension-subclasses.c	\
 	peas-helpers.c			\
 	peas-i18n.c			\
diff --git a/libpeas/peas-extension-subclasses.c b/libpeas/peas-extension-subclasses.c
index 97e7f73..8caab59 100644
--- a/libpeas/peas-extension-subclasses.c
+++ b/libpeas/peas-extension-subclasses.c
@@ -26,8 +26,7 @@
 #include <string.h>
 #include <girepository.h>
 #include <girffi.h>
-#include "peas-extension.h"
-#include "peas-extension-priv.h"
+#include "peas-extension-wrapper.h"
 #include "peas-extension-subclasses.h"
 #include "peas-introspection.h"
 
@@ -61,12 +60,12 @@ handle_method_impl (ffi_cif  *cif,
   GITypeInfo type_info;
   GITypeInfo return_type_info;
   gint n_args, i;
-  PeasExtension *instance;
+  PeasExtensionWrapper *instance;
   GIArgument *arguments;
   GIArgument return_value;
 
-  instance = *((PeasExtension **) args[0]);
-  g_assert (PEAS_IS_EXTENSION (instance));
+  instance = *((PeasExtensionWrapper **) args[0]);
+  g_assert (PEAS_IS_EXTENSION_WRAPPER (instance));
 
   n_args = g_callable_info_get_n_args (impl->info);
   g_return_if_fail (n_args >= 1);
@@ -83,7 +82,7 @@ handle_method_impl (ffi_cif  *cif,
         arguments[i-1].v_pointer = *((gpointer **) args[i]);
     }
 
-  peas_extension_callv (instance, impl->method_name, arguments, &return_value);
+  peas_extension_wrapper_callv (instance, impl->method_name, arguments, &return_value);
 
   g_callable_info_load_return_type (impl->info, &return_type_info);
   if (g_type_info_get_tag (&return_type_info) != GI_TYPE_TAG_VOID)
@@ -227,14 +226,14 @@ extension_subclass_set_property (GObject      *object,
                                  const GValue *value,
                                  GParamSpec   *pspec)
 {
-  PeasExtension *exten = PEAS_EXTENSION (object);
+  PeasExtensionWrapper *exten = PEAS_EXTENSION_WRAPPER (object);
 
   /* This will have already been set on the real instance */
   if ((pspec->flags & G_PARAM_CONSTRUCT_ONLY) != 0)
     return;
 
   /* Setting will fail if we are not constructed yet */
-  if ((pspec->flags & G_PARAM_CONSTRUCT) != 0 && !exten->priv->constructed)
+  if ((pspec->flags & G_PARAM_CONSTRUCT) != 0 && !exten->constructed)
     return;
 
   g_debug ("Setting '%s:%s'",
diff --git a/libpeas/peas-extension-wrapper.c b/libpeas/peas-extension-wrapper.c
new file mode 100644
index 0000000..88f4583
--- /dev/null
+++ b/libpeas/peas-extension-wrapper.c
@@ -0,0 +1,183 @@
+/*
+ * peas-extension.c
+ * This file is part of libpeas
+ *
+ * Copyright (C) 2010 Steve FrÃcinaux
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Library General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "peas-extension-wrapper.h"
+#include "peas-introspection.h"
+
+/**
+ * SECTION:peas-extension
+ * @short_description: Proxy for extensions.
+ * @see_also: #PeasExtensionSet
+ *
+ * #PeasExtension is a proxy class used to access actual extensions
+ * implemented using various languages.  As such, the application writer will
+ * use #PeasExtension instances to call methods on extension provided by
+ * loaded plugins.
+ *
+ * To properly use the proxy instances, you will need GObject-introspection
+ * data for the #GInterface or #GObjectClass you want to use as an extension
+ * point.  For instance, if you wish to use #PeasActivatable, you will need to
+ * put the following code excerpt in the engine initialization code, in order
+ * to load the required "Peas" typelib:
+ *
+ * |[
+ * g_irepository_require (g_irepository_get_default (),
+ *                        "Peas", "1.0", 0, NULL);
+ * ]|
+ *
+ * You should proceed the same way for any namespace which provides interfaces
+ * you want to use as extension points. GObject-introspection data is required
+ * for all the supported languages, even for C.
+ *
+ * #PeasExtension does not provide any way to access the underlying object.
+ * The main reason is that some loaders may not rely on proper GObject
+ * inheritance for the definition of extensions, and hence it would not be
+ * possible for libpeas to provide a functional GObject instance at all.
+ * Another reason is that it makes reference counting issues easier to deal
+ * with.
+ *
+ * See peas_extension_call() for more information.
+ **/
+
+G_DEFINE_ABSTRACT_TYPE (PeasExtensionWrapper, peas_extension_wrapper, G_TYPE_OBJECT);
+
+/* Properties */
+enum {
+  PROP_0,
+  PROP_EXTENSION_TYPE
+};
+
+static void
+peas_extension_wrapper_init (PeasExtensionWrapper *exten)
+{
+}
+
+static void
+peas_extension_wrapper_set_property (GObject      *object,
+                                     guint         prop_id,
+                                     const GValue *value,
+                                     GParamSpec   *pspec)
+{
+  PeasExtensionWrapper *exten = PEAS_EXTENSION_WRAPPER (object);
+
+  switch (prop_id)
+    {
+    case PROP_EXTENSION_TYPE:
+      exten->exten_type = g_value_get_gtype (value);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+peas_extension_wrapper_get_property (GObject    *object,
+                                     guint       prop_id,
+                                     GValue     *value,
+                                     GParamSpec *pspec)
+{
+  PeasExtensionWrapper *exten = PEAS_EXTENSION_WRAPPER (object);
+
+  switch (prop_id)
+    {
+    case PROP_EXTENSION_TYPE:
+      g_value_set_gtype (value, exten->exten_type);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+peas_extension_wrapper_constructed (GObject *object)
+{
+  PeasExtensionWrapper *exten = PEAS_EXTENSION_WRAPPER (object);
+
+  exten->constructed = TRUE;
+
+  if (G_OBJECT_CLASS (peas_extension_wrapper_parent_class)->constructed != NULL)
+    G_OBJECT_CLASS (peas_extension_wrapper_parent_class)->constructed (object);
+}
+
+static void
+peas_extension_wrapper_class_init (PeasExtensionWrapperClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->set_property = peas_extension_wrapper_set_property;
+  object_class->get_property = peas_extension_wrapper_get_property;
+  object_class->constructed = peas_extension_wrapper_constructed;
+
+  g_object_class_install_property (object_class, PROP_EXTENSION_TYPE,
+                                   g_param_spec_gtype ("extension-type",
+                                                       "Extension Type",
+                                                       "The GType of the interface being proxied",
+                                                       G_TYPE_NONE,
+                                                       G_PARAM_READWRITE |
+                                                       G_PARAM_CONSTRUCT_ONLY |
+                                                       G_PARAM_STATIC_STRINGS));
+}
+
+GType
+peas_extension_wrapper_get_extension_type (PeasExtensionWrapper *exten)
+{
+  g_return_val_if_fail (PEAS_IS_EXTENSION_WRAPPER (exten), G_TYPE_INVALID);
+
+  return exten->exten_type;
+}
+
+/**
+ * peas_extension_callv:
+ * @exten: A #PeasExtension.
+ * @method_name: the name of the method that should be called.
+ * @args: the arguments for the method.
+ * @return_value: the return falue for the method.
+ *
+ * Call a method of the object behind @extension, using @args as arguments.
+ *
+ * See peas_extension_call() for more information.
+ *
+ * Return value: (transfer full): %TRUE on successful call.
+ *
+ * Deprecated: 1.2. Use the dynamically implemented interface instead.
+ *
+ * Rename to: peas_extension_call
+ */
+gboolean
+peas_extension_wrapper_callv (PeasExtensionWrapper *exten,
+                              const gchar   *method_name,
+                              GIArgument    *args,
+                              GIArgument    *return_value)
+{
+  PeasExtensionWrapperClass *klass;
+
+  g_return_val_if_fail (PEAS_IS_EXTENSION_WRAPPER (exten), FALSE);
+  g_return_val_if_fail (method_name != NULL, FALSE);
+
+  klass = PEAS_EXTENSION_WRAPPER_GET_CLASS (exten);
+  return klass->call (exten, method_name, args, return_value);
+}
diff --git a/libpeas/peas-extension-wrapper.h b/libpeas/peas-extension-wrapper.h
new file mode 100644
index 0000000..6aa1738
--- /dev/null
+++ b/libpeas/peas-extension-wrapper.h
@@ -0,0 +1,76 @@
+/*
+ * peas-extension-wrapper.h
+ * This file is part of libpeas
+ *
+ * Copyright (C) 2010-2011 - Steve FrÃcinaux
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Library General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __PEAS_EXTENSION_WRAPPER_H__
+#define __PEAS_EXTENSION_WRAPPER_H__
+
+#include <glib-object.h>
+#include <girepository.h>
+
+G_BEGIN_DECLS
+
+/*
+ * Type checking and casting macros
+ */
+#define PEAS_TYPE_EXTENSION_WRAPPER             (peas_extension_wrapper_get_type ())
+#define PEAS_EXTENSION_WRAPPER(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), PEAS_TYPE_EXTENSION_WRAPPER, PeasExtensionWrapper))
+#define PEAS_IS_EXTENSION_WRAPPER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), PEAS_TYPE_EXTENSION_WRAPPER))
+#define PEAS_EXTENSION_WRAPPER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), PEAS_TYPE_EXTENSION_WRAPPER, PeasExtensionWrapperClass))
+#define PEAS_IS_EXTENSION_WRAPPER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), PEAS_TYPE_EXTENSION_WRAPPER))
+#define PEAS_EXTENSION_WRAPPER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), PEAS_TYPE_EXTENSION_WRAPPER, PeasExtensionWrapperClass))
+
+typedef struct _PeasExtensionWrapper      PeasExtensionWrapper;
+typedef struct _PeasExtensionWrapperClass PeasExtensionWrapperClass;
+
+struct _PeasExtensionWrapper {
+  GObject parent;
+
+  /*< private >*/
+  GType exten_type;
+  gboolean constructed;
+};
+
+struct _PeasExtensionWrapperClass {
+  GObjectClass parent_class;
+
+  /*< private >*/
+  gboolean   (*call)                      (PeasExtensionWrapper *exten,
+                                           const gchar          *method,
+                                           GIArgument           *args,
+                                           GIArgument           *return_value);
+};
+
+/*
+ * Public methods
+ */
+GType        peas_extension_wrapper_get_type    (void)  G_GNUC_CONST;
+
+GType        peas_extension_wrapper_get_extension_type
+                                                (PeasExtensionWrapper *exten);
+
+gboolean     peas_extension_wrapper_callv       (PeasExtensionWrapper *exten,
+                                                 const gchar          *method_name,
+                                                 GIArgument           *args,
+                                                 GIArgument           *return_value);
+
+G_END_DECLS
+
+#endif /* __PEAS_EXTENSION_WRAPPER_H__ */
diff --git a/libpeas/peas-extension.c b/libpeas/peas-extension.c
index ded2a10..31f2826 100644
--- a/libpeas/peas-extension.c
+++ b/libpeas/peas-extension.c
@@ -24,7 +24,7 @@
 #endif
 
 #include "peas-extension.h"
-#include "peas-extension-priv.h"
+#include "peas-extension-wrapper.h"
 #include "peas-introspection.h"
 
 /**
@@ -61,96 +61,10 @@
  *
  * See peas_extension_call() for more information.
  **/
-
-G_DEFINE_ABSTRACT_TYPE (PeasExtension, peas_extension, G_TYPE_OBJECT);
-
-/* Properties */
-enum {
-  PROP_0,
-  PROP_EXTENSION_TYPE
-};
-
-static void
-peas_extension_init (PeasExtension *exten)
-{
-  exten->priv = G_TYPE_INSTANCE_GET_PRIVATE (exten,
-                                             PEAS_TYPE_EXTENSION,
-                                             PeasExtensionPrivate);
-}
-
-static void
-peas_extension_set_property (GObject      *object,
-                             guint         prop_id,
-                             const GValue *value,
-                             GParamSpec   *pspec)
-{
-  PeasExtension *exten = PEAS_EXTENSION (object);
-
-  switch (prop_id)
-    {
-    case PROP_EXTENSION_TYPE:
-      exten->priv->exten_type = g_value_get_gtype (value);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-static void
-peas_extension_get_property (GObject    *object,
-                             guint       prop_id,
-                             GValue     *value,
-                             GParamSpec *pspec)
-{
-  PeasExtension *exten = PEAS_EXTENSION (object);
-
-  switch (prop_id)
-    {
-    case PROP_EXTENSION_TYPE:
-      g_value_set_gtype (value, exten->priv->exten_type);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-static void
-peas_extension_constructed (GObject *object)
+GType
+peas_extension_get_type ()
 {
-  PeasExtension *exten = PEAS_EXTENSION (object);
-
-  exten->priv->constructed = TRUE;
-
-  if (G_OBJECT_CLASS (peas_extension_parent_class)->constructed != NULL)
-    G_OBJECT_CLASS (peas_extension_parent_class)->constructed (object);
-}
-
-static void
-peas_extension_class_init (PeasExtensionClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-  object_class->set_property = peas_extension_set_property;
-  object_class->get_property = peas_extension_get_property;
-  object_class->constructed = peas_extension_constructed;
-
-  /**
-   * PeasExtension:extension-type:
-   *
-   * The GType of the interface being proxied.
-   */
-  g_object_class_install_property (object_class, PROP_EXTENSION_TYPE,
-                                   g_param_spec_gtype ("extension-type",
-                                                       "Extension Type",
-                                                       "The GType of the interface being proxied",
-                                                       G_TYPE_NONE,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT_ONLY |
-                                                       G_PARAM_STATIC_STRINGS));
-  
-  g_type_class_add_private (klass, sizeof (PeasExtensionPrivate));
+  return G_TYPE_OBJECT;
 }
 
 /**
@@ -164,9 +78,7 @@ peas_extension_class_init (PeasExtensionClass *klass)
 GType
 peas_extension_get_extension_type (PeasExtension *exten)
 {
-  g_return_val_if_fail (PEAS_IS_EXTENSION (exten), G_TYPE_INVALID);
-
-  return exten->priv->exten_type;
+  return peas_extension_wrapper_get_extension_type (PEAS_EXTENSION_WRAPPER (exten));
 }
 
 /**
@@ -243,7 +155,8 @@ peas_extension_call_valist (PeasExtension *exten,
   g_return_val_if_fail (PEAS_IS_EXTENSION (exten), FALSE);
   g_return_val_if_fail (method_name != NULL, FALSE);
 
-  callable_info = peas_gi_get_method_info (exten->priv->exten_type, method_name);
+  callable_info = peas_gi_get_method_info (peas_extension_get_extension_type (exten),
+                                           method_name);
 
   /* Already warned */
   if (callable_info == NULL)
@@ -290,11 +203,8 @@ peas_extension_callv (PeasExtension *exten,
                       GIArgument    *args,
                       GIArgument    *return_value)
 {
-  PeasExtensionClass *klass;
-
-  g_return_val_if_fail (PEAS_IS_EXTENSION (exten), FALSE);
-  g_return_val_if_fail (method_name != NULL, FALSE);
-
-  klass = PEAS_EXTENSION_GET_CLASS (exten);
-  return klass->call (exten, method_name, args, return_value);
+  return peas_extension_wrapper_callv (PEAS_EXTENSION_WRAPPER (exten),
+                                       method_name,
+                                       args,
+                                       return_value);
 }
diff --git a/libpeas/peas-extension.h b/libpeas/peas-extension.h
index d4e53dd..16abd67 100644
--- a/libpeas/peas-extension.h
+++ b/libpeas/peas-extension.h
@@ -30,25 +30,11 @@ G_BEGIN_DECLS
 /*
  * Type checking and casting macros
  */
-#define PEAS_TYPE_EXTENSION            (peas_extension_get_type())
-#define PEAS_EXTENSION(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), PEAS_TYPE_EXTENSION, PeasExtension))
-#define PEAS_IS_EXTENSION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), PEAS_TYPE_EXTENSION))
+#define PEAS_TYPE_EXTENSION            (G_TYPE_OBJECT)
+#define PEAS_EXTENSION(obj)            (G_OBJECT(obj))
+#define PEAS_IS_EXTENSION(obj)         (G_IS_OBJECT(obj))
 
-typedef struct _PeasExtension         PeasExtension;
-typedef struct _PeasExtensionPrivate  PeasExtensionPrivate;
-
-/**
- * PeasExtension:
- *
- * The #PeasExtension structure contains only private data and should only be
- * accessed using the provided API.
- */
-struct _PeasExtension {
-  GObject parent;
-
-  /*< private >*/
-  PeasExtensionPrivate *priv;
-};
+typedef GObject PeasExtension;
 
 /*
  * Public methods
diff --git a/loaders/c/peas-extension-c.c b/loaders/c/peas-extension-c.c
index 319738b..e82aac9 100644
--- a/loaders/c/peas-extension-c.c
+++ b/loaders/c/peas-extension-c.c
@@ -28,7 +28,7 @@
 #include <libpeas/peas-extension-subclasses.h>
 #include "peas-extension-c.h"
 
-G_DEFINE_TYPE (PeasExtensionC, peas_extension_c, PEAS_TYPE_EXTENSION);
+G_DEFINE_TYPE (PeasExtensionC, peas_extension_c, PEAS_TYPE_EXTENSION_WRAPPER);
 
 static void
 peas_extension_c_init (PeasExtensionC *cexten)
@@ -36,15 +36,15 @@ peas_extension_c_init (PeasExtensionC *cexten)
 }
 
 static gboolean
-peas_extension_c_call (PeasExtension *exten,
-                       const gchar   *method_name,
-                       GIArgument    *args,
-                       GIArgument    *retval)
+peas_extension_c_call (PeasExtensionWrapper *exten,
+                       const gchar          *method_name,
+                       GIArgument           *args,
+                       GIArgument           *retval)
 {
   PeasExtensionC *cexten = PEAS_EXTENSION_C (exten);
   GType gtype;
 
-  gtype = peas_extension_get_extension_type (exten);
+  gtype = peas_extension_wrapper_get_extension_type (exten);
 
   return peas_method_apply (cexten->instance, gtype, method_name, args, retval);
 }
@@ -93,7 +93,7 @@ static void
 peas_extension_c_class_init (PeasExtensionCClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  PeasExtensionClass *extension_class = PEAS_EXTENSION_CLASS (klass);
+  PeasExtensionWrapperClass *extension_class = PEAS_EXTENSION_WRAPPER_CLASS (klass);
 
   object_class->dispose = peas_extension_c_dispose;
   object_class->get_property = peas_extension_c_get_property;
@@ -102,7 +102,7 @@ peas_extension_c_class_init (PeasExtensionCClass *klass)
   extension_class->call = peas_extension_c_call;
 }
 
-PeasExtension *
+GObject *
 peas_extension_c_new (GType    gtype,
                       GObject *instance)
 {
@@ -116,5 +116,5 @@ peas_extension_c_new (GType    gtype,
 
   cexten->instance = instance;
 
-  return PEAS_EXTENSION (cexten);
+  return G_OBJECT (cexten);
 }
diff --git a/loaders/c/peas-extension-c.h b/loaders/c/peas-extension-c.h
index 1f133a4..aa6ddc0 100644
--- a/loaders/c/peas-extension-c.h
+++ b/loaders/c/peas-extension-c.h
@@ -22,7 +22,7 @@
 #ifndef __PEAS_EXTENSION_C_H__
 #define __PEAS_EXTENSION_C_H__
 
-#include <libpeas/peas-extension-priv.h>
+#include <libpeas/peas-extension-wrapper.h>
 
 G_BEGIN_DECLS
 
@@ -37,18 +37,18 @@ typedef struct _PeasExtensionC       PeasExtensionC;
 typedef struct _PeasExtensionCClass  PeasExtensionCClass;
 
 struct _PeasExtensionC {
-  PeasExtension parent;
+  PeasExtensionWrapper parent;
 
   GObject *instance;
 };
 
 struct _PeasExtensionCClass {
-  PeasExtensionClass parent_class;
+  PeasExtensionWrapperClass parent_class;
 };
 
 GType            peas_extension_c_get_type  (void) G_GNUC_CONST;
 
-PeasExtension   *peas_extension_c_new       (GType        gtype,
+GObject         *peas_extension_c_new       (GType        gtype,
                                              GObject     *instance);
 
 G_END_DECLS
diff --git a/loaders/gjs/peas-extension-gjs.c b/loaders/gjs/peas-extension-gjs.c
index 6e5c376..fd46b10 100644
--- a/loaders/gjs/peas-extension-gjs.c
+++ b/loaders/gjs/peas-extension-gjs.c
@@ -34,7 +34,7 @@
 
 #include "peas-extension-gjs.h"
 
-G_DEFINE_TYPE (PeasExtensionGjs, peas_extension_gjs, PEAS_TYPE_EXTENSION);
+G_DEFINE_TYPE (PeasExtensionGjs, peas_extension_gjs, PEAS_TYPE_EXTENSION_WRAPPER);
 
 typedef struct {
   GIArgInfo arg_info;
@@ -180,10 +180,10 @@ set_out_arg (JSContext      *js_context,
 }
 
 static gboolean
-peas_extension_gjs_call (PeasExtension *exten,
-                         const gchar   *method_name,
-                         GIArgument    *args,
-                         GIArgument    *retval)
+peas_extension_gjs_call (PeasExtensionWrapper *exten,
+                         const gchar          *method_name,
+                         GIArgument           *args,
+                         GIArgument           *retval)
 {
   PeasExtensionGjs *gexten = PEAS_EXTENSION_GJS (exten);
   GType exten_type;
@@ -197,7 +197,7 @@ peas_extension_gjs_call (PeasExtension *exten,
   gint n_out_args = 0;
   gint cached_args = 0;
 
-  exten_type = peas_extension_get_extension_type (exten);
+  exten_type = peas_extension_wrapper_get_extension_type (exten);
 
   /* Fetch the JS method we want to call */
   if (!JS_GetProperty (gexten->js_context, gexten->js_object,
@@ -389,7 +389,7 @@ static void
 peas_extension_gjs_class_init (PeasExtensionGjsClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  PeasExtensionClass *extension_class = PEAS_EXTENSION_CLASS (klass);
+  PeasExtensionWrapperClass *extension_class = PEAS_EXTENSION_WRAPPER_CLASS (klass);
 
   object_class->set_property = peas_extension_gjs_set_property;
   object_class->get_property = peas_extension_gjs_get_property;
@@ -398,7 +398,7 @@ peas_extension_gjs_class_init (PeasExtensionGjsClass *klass)
   extension_class->call = peas_extension_gjs_call;
 }
 
-PeasExtension *
+GObject *
 peas_extension_gjs_new (GType      exten_type,
                         JSContext *js_context,
                         JSObject  *js_object)
@@ -418,5 +418,5 @@ peas_extension_gjs_new (GType      exten_type,
   gexten->js_object = js_object;
   JS_AddObjectRoot (gexten->js_context, &gexten->js_object);
 
-  return PEAS_EXTENSION (gexten);
+  return G_OBJECT (gexten);
 }
diff --git a/loaders/gjs/peas-extension-gjs.h b/loaders/gjs/peas-extension-gjs.h
index 2f8ddfc..7c21900 100644
--- a/loaders/gjs/peas-extension-gjs.h
+++ b/loaders/gjs/peas-extension-gjs.h
@@ -22,7 +22,7 @@
 #ifndef __PEAS_EXTENSION_GJS_H__
 #define __PEAS_EXTENSION_GJS_H__
 
-#include <libpeas/peas-extension-priv.h>
+#include <libpeas/peas-extension-wrapper.h>
 #include <gjs/gjs-module.h>
 
 G_BEGIN_DECLS
@@ -38,19 +38,19 @@ typedef struct _PeasExtensionGjs       PeasExtensionGjs;
 typedef struct _PeasExtensionGjsClass  PeasExtensionGjsClass;
 
 struct _PeasExtensionGjs {
-  PeasExtension parent;
+  PeasExtensionWrapper parent;
 
   JSContext *js_context;
   JSObject *js_object;
 };
 
 struct _PeasExtensionGjsClass {
-  PeasExtensionClass parent_class;
+  PeasExtensionWrapperClass parent_class;
 };
 
 GType            peas_extension_gjs_get_type (void) G_GNUC_CONST;
 
-PeasExtension   *peas_extension_gjs_new      (GType      exten_type,
+GObject         *peas_extension_gjs_new      (GType      exten_type,
                                               JSContext *js_context,
                                               JSObject  *js_object);
 
diff --git a/loaders/python/peas-extension-python.c b/loaders/python/peas-extension-python.c
index 70ff896..e0e88b7 100644
--- a/loaders/python/peas-extension-python.c
+++ b/loaders/python/peas-extension-python.c
@@ -33,7 +33,7 @@
 #include <libpeas/peas-extension-subclasses.h>
 #include "peas-extension-python.h"
 
-G_DEFINE_TYPE (PeasExtensionPython, peas_extension_python, PEAS_TYPE_EXTENSION);
+G_DEFINE_TYPE (PeasExtensionPython, peas_extension_python, PEAS_TYPE_EXTENSION_WRAPPER);
 
 static void
 peas_extension_python_init (PeasExtensionPython *pyexten)
@@ -41,10 +41,10 @@ peas_extension_python_init (PeasExtensionPython *pyexten)
 }
 
 static gboolean
-peas_extension_python_call (PeasExtension *exten,
-                            const gchar   *method_name,
-                            GIArgument    *args,
-                            GIArgument    *retval)
+peas_extension_python_call (PeasExtensionWrapper *exten,
+                            const gchar          *method_name,
+                            GIArgument           *args,
+                            GIArgument           *retval)
 {
   PeasExtensionPython *pyexten = PEAS_EXTENSION_PYTHON (exten);
   GType gtype;
@@ -52,7 +52,7 @@ peas_extension_python_call (PeasExtension *exten,
   GObject *instance;
   gboolean success;
 
-  gtype = peas_extension_get_extension_type (exten);
+  gtype = peas_extension_wrapper_get_extension_type (exten);
 
   state = pyg_gil_state_ensure ();
 
@@ -125,7 +125,7 @@ static void
 peas_extension_python_class_init (PeasExtensionPythonClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  PeasExtensionClass *extension_class = PEAS_EXTENSION_CLASS (klass);
+  PeasExtensionWrapperClass *extension_class = PEAS_EXTENSION_WRAPPER_CLASS (klass);
 
   object_class->dispose = peas_extension_python_dispose;
   object_class->get_property = peas_extension_python_get_property;
@@ -134,7 +134,7 @@ peas_extension_python_class_init (PeasExtensionPythonClass *klass)
   extension_class->call = peas_extension_python_call;
 }
 
-PeasExtension *
+GObject *
 peas_extension_python_new (GType     gtype,
                            PyObject *instance)
 {
@@ -149,5 +149,5 @@ peas_extension_python_new (GType     gtype,
   pyexten->instance = instance;
   Py_INCREF (instance);
 
-  return PEAS_EXTENSION (pyexten);
+  return G_OBJECT (pyexten);
 }
diff --git a/loaders/python/peas-extension-python.h b/loaders/python/peas-extension-python.h
index 5f8ab41..1f60620 100644
--- a/loaders/python/peas-extension-python.h
+++ b/loaders/python/peas-extension-python.h
@@ -22,7 +22,7 @@
 #ifndef __PEAS_EXTENSION_PYTHON_H__
 #define __PEAS_EXTENSION_PYTHON_H__
 
-#include <libpeas/peas-extension-priv.h>
+#include <libpeas/peas-extension-wrapper.h>
 /* _POSIX_C_SOURCE is defined in Python.h and in limits.h included by
  * <libpeas/peas-extension.h>, so we unset it here to avoid a warning.
  * Yep, that's bad. */
@@ -42,18 +42,18 @@ typedef struct _PeasExtensionPython       PeasExtensionPython;
 typedef struct _PeasExtensionPythonClass  PeasExtensionPythonClass;
 
 struct _PeasExtensionPython {
-  PeasExtension parent;
+  PeasExtensionWrapper parent;
 
   PyObject *instance;
 };
 
 struct _PeasExtensionPythonClass {
-  PeasExtensionClass parent_class;
+  PeasExtensionWrapperClass parent_class;
 };
 
 GType            peas_extension_python_get_type (void) G_GNUC_CONST;
 
-PeasExtension   *peas_extension_python_new      (GType        gtype,
+GObject         *peas_extension_python_new      (GType        gtype,
                                                  PyObject    *instance);
 
 G_END_DECLS
diff --git a/loaders/seed/peas-extension-seed.c b/loaders/seed/peas-extension-seed.c
index 147c4cd..28622bf 100644
--- a/loaders/seed/peas-extension-seed.c
+++ b/loaders/seed/peas-extension-seed.c
@@ -28,7 +28,7 @@
 #include <libpeas/peas-extension-subclasses.h>
 #include <girepository.h>
 
-G_DEFINE_TYPE (PeasExtensionSeed, peas_extension_seed, PEAS_TYPE_EXTENSION);
+G_DEFINE_TYPE (PeasExtensionSeed, peas_extension_seed, PEAS_TYPE_EXTENSION_WRAPPER);
 
 typedef struct {
   GITypeInfo type_info;
@@ -144,10 +144,10 @@ peas_extension_seed_dispose (GObject *object)
 }
 
 static gboolean
-peas_extension_seed_call (PeasExtension *exten,
-                          const gchar   *method_name,
-                          GIArgument    *args,
-                          GIArgument    *retval)
+peas_extension_seed_call (PeasExtensionWrapper *exten,
+                          const gchar          *method_name,
+                          GIArgument           *args,
+                          GIArgument           *retval)
 {
   PeasExtensionSeed *sexten = PEAS_EXTENSION_SEED (exten);
   GType exten_type;
@@ -166,7 +166,7 @@ peas_extension_seed_call (PeasExtension *exten,
   g_return_val_if_fail (sexten->js_context != NULL, FALSE);
   g_return_val_if_fail (sexten->js_object != NULL, FALSE);
 
-  exten_type = peas_extension_get_extension_type (exten);
+  exten_type = peas_extension_wrapper_get_extension_type (exten);
 
   /* Fetch the JS method we want to call */
   js_method = seed_object_get_property (sexten->js_context,
@@ -293,7 +293,7 @@ static void
 peas_extension_seed_class_init (PeasExtensionSeedClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  PeasExtensionClass *extension_class = PEAS_EXTENSION_CLASS (klass);
+  PeasExtensionWrapperClass *extension_class = PEAS_EXTENSION_WRAPPER_CLASS (klass);
 
   object_class->set_property = peas_extension_seed_set_property;
   object_class->get_property = peas_extension_seed_get_property;
@@ -302,7 +302,7 @@ peas_extension_seed_class_init (PeasExtensionSeedClass *klass)
   extension_class->call = peas_extension_seed_call;
 }
 
-PeasExtension *
+GObject *
 peas_extension_seed_new (GType       exten_type,
                          SeedContext js_context,
                          SeedObject  js_object)
@@ -324,5 +324,5 @@ peas_extension_seed_new (GType       exten_type,
   seed_context_ref (sexten->js_context);
   seed_value_protect (sexten->js_context, sexten->js_object);
 
-  return PEAS_EXTENSION (sexten);
+  return G_OBJECT (sexten);
 }
diff --git a/loaders/seed/peas-extension-seed.h b/loaders/seed/peas-extension-seed.h
index 568716e..68c1a12 100644
--- a/loaders/seed/peas-extension-seed.h
+++ b/loaders/seed/peas-extension-seed.h
@@ -22,7 +22,7 @@
 #ifndef __PEAS_EXTENSION_SEED_H__
 #define __PEAS_EXTENSION_SEED_H__
 
-#include <libpeas/peas-extension-priv.h>
+#include <libpeas/peas-extension-wrapper.h>
 #include <seed.h>
 
 G_BEGIN_DECLS
@@ -38,19 +38,19 @@ typedef struct _PeasExtensionSeed       PeasExtensionSeed;
 typedef struct _PeasExtensionSeedClass  PeasExtensionSeedClass;
 
 struct _PeasExtensionSeed {
-  PeasExtension parent;
+  PeasExtensionWrapper parent;
 
   SeedContext js_context;
   SeedObject js_object;
 };
 
 struct _PeasExtensionSeedClass {
-  PeasExtensionClass parent_class;
+  PeasExtensionWrapperClass parent_class;
 };
 
 GType            peas_extension_seed_get_type (void) G_GNUC_CONST;
 
-PeasExtension   *peas_extension_seed_new      (GType           exten_type,
+GObject         *peas_extension_seed_new      (GType           exten_type,
                                                SeedContext     js_context,
                                                SeedObject      js_object);
 



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