summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpeas/libpeas.h1
-rw-r--r--libpeas/meson.build2
-rw-r--r--libpeas/peas-engine-priv.h13
-rw-r--r--libpeas/peas-engine.c65
-rw-r--r--libpeas/peas-engine.h7
-rw-r--r--libpeas/peas-extension-set.c12
-rw-r--r--libpeas/peas-extension-set.h4
-rw-r--r--libpeas/peas-extension.c58
-rw-r--r--libpeas/peas-extension.h52
-rw-r--r--libpeas/peas-object-module.c22
-rw-r--r--libpeas/peas-plugin-loader-c.c2
-rw-r--r--libpeas/peas-plugin-loader.c2
-rw-r--r--libpeas/peas-plugin-loader.h68
-rw-r--r--loaders/lua5.1/peas-plugin-loader-lua.c2
-rw-r--r--loaders/python/peas-plugin-loader-python.c2
-rw-r--r--tests/libpeas/extension-c.c12
-rw-r--r--tests/libpeas/extension-lua.c10
-rw-r--r--tests/libpeas/extension-py.c8
-rw-r--r--tests/libpeas/extension-set.c10
-rw-r--r--tests/libpeas/plugins/extension-c/extension-c.plugin2
-rw-r--r--tests/libpeas/plugins/extension-lua/extension-lua51.plugin2
-rw-r--r--tests/libpeas/plugins/extension-python/extension-py.plugin.in2
-rw-r--r--tests/libpeas/testing/testing-extension.c46
23 files changed, 115 insertions, 289 deletions
diff --git a/libpeas/libpeas.h b/libpeas/libpeas.h
index 5508f89..49ee369 100644
--- a/libpeas/libpeas.h
+++ b/libpeas/libpeas.h
@@ -23,7 +23,6 @@
#define LIBPEAS_INSIDE
# include "peas-engine.h"
-# include "peas-extension.h"
# include "peas-extension-base.h"
# include "peas-extension-set.h"
# include "peas-object-module.h"
diff --git a/libpeas/meson.build b/libpeas/meson.build
index ec6be40..9707303 100644
--- a/libpeas/meson.build
+++ b/libpeas/meson.build
@@ -15,7 +15,6 @@ peas_version_h = configure_file(
libpeas_public_h = files(
'peas-engine.h',
- 'peas-extension.h',
'peas-extension-base.h',
'peas-extension-set.h',
'peas-object-module.h',
@@ -28,7 +27,6 @@ libpeas_sources = files(
'peas-debug.c',
'peas-dirs.c',
'peas-engine.c',
- 'peas-extension.c',
'peas-extension-base.c',
'peas-extension-set.c',
'peas-i18n.c',
diff --git a/libpeas/peas-engine-priv.h b/libpeas/peas-engine-priv.h
index a6741c7..313f97a 100644
--- a/libpeas/peas-engine-priv.h
+++ b/libpeas/peas-engine-priv.h
@@ -32,14 +32,13 @@
G_BEGIN_DECLS
PEAS_AVAILABLE_IN_ALL
-void _peas_engine_shutdown (void);
-
+void _peas_engine_shutdown (void);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-PeasExtension *_peas_engine_create_extensionv (PeasEngine *engine,
- PeasPluginInfo *info,
- GType extension_type,
- guint n_parameters,
- GParameter *parameters);
+GObject *_peas_engine_create_extensionv (PeasEngine *engine,
+ PeasPluginInfo *info,
+ GType extension_type,
+ guint n_parameters,
+ GParameter *parameters);
G_GNUC_END_IGNORE_DEPRECATIONS
G_END_DECLS
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index 0d2a7a3..08448c7 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -32,7 +32,6 @@
#include "peas-dirs.h"
#include "peas-engine-priv.h"
#include "peas-engine.h"
-#include "peas-extension.h"
#include "peas-i18n-priv.h"
#include "peas-marshal.h"
#include "peas-object-module.h"
@@ -52,9 +51,6 @@
* from all the registered plugin directories;
* - it will provide you an API to load, control and unload your
* plugins and their extensions from within your application.
- *
- * Since libpeas 1.22, @extension_type can be an Abstract [alias@GObject.Type]
- * and not just an Interface [alias@GObject.Type].
**/
/* Signals */
@@ -532,8 +528,6 @@ peas_engine_add_search_path (PeasEngine *engine,
* Prepends a search path to the list of paths where to look for plugins.
*
* See Also: [method@Engine.add_search_path]
- *
- * Since: 1.6
*/
void
peas_engine_prepend_search_path (PeasEngine *engine,
@@ -758,8 +752,6 @@ peas_engine_class_init (PeasEngineClass *klass)
* If non-global plugin loaders should be used.
*
* See [ctor@Engine.new_with_nonglobal_loaders] for more information.
- *
- * Since: 1.14
*/
properties[PROP_NONGLOBAL_LOADERS] =
g_param_spec_boolean ("nonglobal-loaders",
@@ -1317,9 +1309,6 @@ peas_engine_unload_plugin (PeasEngine *engine,
*
* If the @info is not loaded than %FALSE will always be returned.
*
- * Since libpeas 1.22, @extension_type can be an Abstract [alias@GObject.Type]
- * and not just an Interface [alias@GObject.Type].
- *
* Returns: if @info provides an extension for @extension_type.
*/
gboolean
@@ -1342,7 +1331,7 @@ peas_engine_provides_extension (PeasEngine *engine,
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-PeasExtension *
+GObject *
_peas_engine_create_extensionv (PeasEngine *engine,
PeasPluginInfo *info,
GType extension_type,
@@ -1350,7 +1339,7 @@ _peas_engine_create_extensionv (PeasEngine *engine,
GParameter *parameters)
{
PeasPluginLoader *loader;
- PeasExtension *extension;
+ GObject *extension;
g_return_val_if_fail (PEAS_IS_ENGINE (engine), NULL);
g_return_val_if_fail (info != NULL, NULL);
@@ -1383,20 +1372,14 @@ _peas_engine_create_extensionv (PeasEngine *engine,
* @prop_values: (array length=n_properties): an array of property values.
*
* If the plugin identified by @info implements the @extension_type,
- * then this function will return a new instance of this implementation,
- * wrapped in a new [alias@Extension] instance. Otherwise, it will return %NULL.
- *
- * Since libpeas 1.22, @extension_type can be an Abstract [alias@GObject.Type]
- * and not just an Interface [alias@GObject.Type].
+ * then this function will return a new instance of this implementation.
*
* See [method@Engine.create_extension] for more information.
*
- * Returns: (transfer full): a new instance of #PeasExtension wrapping
- * the @extension_type instance, or %NULL.
- *
- * Since: 1.24
+ * Returns: (transfer full): a new instance of #GObject which meets the
+ * prerequisites of @extension_type, or %NULL.
*/
-PeasExtension *
+GObject *
peas_engine_create_extension_with_properties (PeasEngine *engine,
PeasPluginInfo *info,
GType extension_type,
@@ -1405,7 +1388,7 @@ peas_engine_create_extension_with_properties (PeasEngine *engine,
const GValue *prop_values)
{
PeasPluginLoader *loader;
- PeasExtension *extension;
+ GObject *extension;
GParameter *parameters = NULL;
g_return_val_if_fail (PEAS_IS_ENGINE (engine), NULL);
@@ -1460,18 +1443,14 @@ peas_engine_create_extension_with_properties (PeasEngine *engine,
* name/value pairs, followed by %NULL.
*
* If the plugin identified by @info implements the @extension_type,
- * then this function will return a new instance of this implementation,
- * wrapped in a new [alias@Extension] instance. Otherwise, it will return %NULL.
- *
- * Since libpeas 1.22, @extension_type can be an Abstract [alias@GObject.Type]
- * and not just an Interface [alias@GObject.Type].
+ * then this function will return a new instance of this implementation.
*
* See [method@Engine.create_extension] for more information.
*
- * Returns: a new instance of #PeasExtension wrapping
- * the @extension_type instance, or %NULL.
+ * Returns: a new instance of #GObject that meets the prerequisites of
+ * @extension_type, or %NULL.
*/
-PeasExtension *
+GObject *
peas_engine_create_extension_valist (PeasEngine *engine,
PeasPluginInfo *info,
GType extension_type,
@@ -1479,7 +1458,7 @@ peas_engine_create_extension_valist (PeasEngine *engine,
va_list var_args)
{
GParameter *parameters;
- PeasExtension *exten;
+ GObject *exten;
guint n_parameters;
g_return_val_if_fail (PEAS_IS_ENGINE (engine), NULL);
@@ -1517,25 +1496,15 @@ G_GNUC_END_IGNORE_DEPRECATIONS
* name/value pairs, followed by %NULL.
*
* If the plugin identified by @info implements the @extension_type,
- * then this function will return a new instance of this implementation,
- * wrapped in a new [alias@Extension] instance. Otherwise, it will return %NULL.
+ * then this function will return a new instance of this implementation.
*
* When creating the new instance of the @extension_type subtype, the
* provided construct properties will be passed to the extension construction
* handler (exactly like if you had called [ctor@GObject.Object.new] yourself).
*
- * The new extension instance produced by this function will always be
- * returned wrapped in a #PeasExtension proxy, following the current libpeas
- * principle of never giving you the actual object (also because it might as
- * well *not* be an actual object).
- *
- * Since libpeas 1.22, @extension_type can be an Abstract [alias@GObject.Type]
- * and not just an Interface [alias@GObject.Type].
- *
- * Returns: a new instance of #PeasExtension wrapping
- * the @extension_type instance, or %NULL.
+ * Returns: a new #GObject that implements @extension_type; or %NULL.
*/
-PeasExtension *
+GObject *
peas_engine_create_extension (PeasEngine *engine,
PeasPluginInfo *info,
GType extension_type,
@@ -1543,7 +1512,7 @@ peas_engine_create_extension (PeasEngine *engine,
...)
{
va_list var_args;
- PeasExtension *exten;
+ GObject *exten;
g_return_val_if_fail (PEAS_IS_ENGINE (engine), NULL);
g_return_val_if_fail (info != NULL, NULL);
@@ -1687,8 +1656,6 @@ peas_engine_new (void)
* plugin loaders are always global.
*
* Returns: a new instance of #PeasEngine that uses non-global loaders.
- *
- * Since: 1.14
*/
PeasEngine *
peas_engine_new_with_nonglobal_loaders (void)
diff --git a/libpeas/peas-engine.h b/libpeas/peas-engine.h
index da4cf24..2f90a0b 100644
--- a/libpeas/peas-engine.h
+++ b/libpeas/peas-engine.h
@@ -30,7 +30,6 @@
#include <glib-object.h>
#include "peas-plugin-info.h"
-#include "peas-extension.h"
#include "peas-version-macros.h"
G_BEGIN_DECLS
@@ -80,20 +79,20 @@ gboolean peas_engine_provides_extension (PeasEngine *
PeasPluginInfo *info,
GType extension_type);
PEAS_AVAILABLE_IN_ALL
-PeasExtension *peas_engine_create_extension_with_properties (PeasEngine *engine,
+GObject *peas_engine_create_extension_with_properties (PeasEngine *engine,
PeasPluginInfo *info,
GType extension_type,
guint n_properties,
const char **prop_names,
const GValue *prop_values);
PEAS_AVAILABLE_IN_ALL
-PeasExtension *peas_engine_create_extension_valist (PeasEngine *engine,
+GObject *peas_engine_create_extension_valist (PeasEngine *engine,
PeasPluginInfo *info,
GType extension_type,
const char *first_property,
va_list var_args);
PEAS_AVAILABLE_IN_ALL
-PeasExtension *peas_engine_create_extension (PeasEngine *engine,
+GObject *peas_engine_create_extension (PeasEngine *engine,
PeasPluginInfo *info,
GType extension_type,
const char *first_property,
diff --git a/libpeas/peas-extension-set.c b/libpeas/peas-extension-set.c
index 2a8ebdc..dafb73d 100644
--- a/libpeas/peas-extension-set.c
+++ b/libpeas/peas-extension-set.c
@@ -106,7 +106,7 @@ struct _PeasExtensionSet
typedef struct {
PeasPluginInfo *info;
- PeasExtension *exten;
+ GObject *exten;
} ExtensionItem;
typedef struct {
@@ -208,7 +208,7 @@ static void
add_extension (PeasExtensionSet *set,
PeasPluginInfo *info)
{
- PeasExtension *exten;
+ GObject *exten;
ExtensionItem *item;
guint position;
@@ -368,7 +368,7 @@ peas_extension_set_class_init (PeasExtensionSetClass *klass)
G_TYPE_NONE,
2,
PEAS_TYPE_PLUGIN_INFO | G_SIGNAL_TYPE_STATIC_SCOPE,
- PEAS_TYPE_EXTENSION);
+ G_TYPE_OBJECT);
g_signal_set_va_marshaller (signals[EXTENSION_ADDED],
G_TYPE_FROM_CLASS (klass),
peas_cclosure_marshal_VOID__OBJECT_OBJECTv);
@@ -400,7 +400,7 @@ peas_extension_set_class_init (PeasExtensionSetClass *klass)
G_TYPE_NONE,
2,
PEAS_TYPE_PLUGIN_INFO | G_SIGNAL_TYPE_STATIC_SCOPE,
- PEAS_TYPE_EXTENSION);
+ G_TYPE_OBJECT);
g_signal_set_va_marshaller (signals[EXTENSION_REMOVED],
G_TYPE_FROM_CLASS (klass),
peas_cclosure_marshal_VOID__OBJECT_OBJECTv);
@@ -443,9 +443,9 @@ peas_extension_set_class_init (PeasExtensionSetClass *klass)
*
* If the plugin doesn't provide such an extension, it returns %NULL.
*
- * Returns: (transfer none) (nullable): a reference to a #PeasExtension
+ * Returns: (transfer none) (nullable): a reference to a #GObject
*/
-PeasExtension *
+GObject *
peas_extension_set_get_extension (PeasExtensionSet *set,
PeasPluginInfo *info)
{
diff --git a/libpeas/peas-extension-set.h b/libpeas/peas-extension-set.h
index 76538e8..359300b 100644
--- a/libpeas/peas-extension-set.h
+++ b/libpeas/peas-extension-set.h
@@ -53,7 +53,7 @@ G_DECLARE_FINAL_TYPE (PeasExtensionSet, peas_extension_set, PEAS, EXTENSION_SET,
*/
typedef void (*PeasExtensionSetForeachFunc) (PeasExtensionSet *set,
PeasPluginInfo *info,
- PeasExtension *exten,
+ GObject *extension,
gpointer data);
PEAS_AVAILABLE_IN_ALL
@@ -61,7 +61,7 @@ void peas_extension_set_foreach (PeasExtensionSet
PeasExtensionSetForeachFunc func,
gpointer data);
PEAS_AVAILABLE_IN_ALL
-PeasExtension *peas_extension_set_get_extension (PeasExtensionSet *set,
+GObject *peas_extension_set_get_extension (PeasExtensionSet *set,
PeasPluginInfo *info);
PEAS_AVAILABLE_IN_ALL
PeasExtensionSet *peas_extension_set_new_with_properties (PeasEngine *engine,
diff --git a/libpeas/peas-extension.c b/libpeas/peas-extension.c
deleted file mode 100644
index 095591b..0000000
--- a/libpeas/peas-extension.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * peas-extension.c
- * This file is part of libpeas
- *
- * Copyright (C) 2010 Steve Frécinaux
- *
- * libpeas is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * libpeas 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- */
-
-#include "config.h"
-
-#include "peas-extension.h"
-
-/**
- * PeasExtension:
- *
- * #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 [alias@GObject.Type] you want to use as an extension point.
- * For instance, if you wish to use [iface@Activatable], you will need to
- * put the following code excerpt in the engine initialization code, in order
- * to load the required "Peas" typelib:
- *
- * ```c
- * g_irepository_require (g_irepository_get_default (),
- * "Peas", "2", 0, NULL);
- * ```
- *
- * You should proceed the same way for any namespace which provides types
- * 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.
- */
diff --git a/libpeas/peas-extension.h b/libpeas/peas-extension.h
deleted file mode 100644
index 4573bc0..0000000
--- a/libpeas/peas-extension.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * peas-extension.h
- * This file is part of libpeas
- *
- * Copyright (C) 2010 - Steve Frécinaux
- *
- * libpeas is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * libpeas 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- */
-
-#pragma once
-
-#if !defined (LIBPEAS_INSIDE) && !defined (LIBPEAS_COMPILATION)
-# error "Only <libpeas.h> can be included directly."
-#endif
-
-#include <glib-object.h>
-
-#include "peas-version-macros.h"
-
-G_BEGIN_DECLS
-
-/*
- * Type checking and casting macros
- */
-#define PEAS_TYPE_EXTENSION (G_TYPE_OBJECT)
-#define PEAS_EXTENSION(obj) (G_OBJECT(obj))
-#define PEAS_IS_EXTENSION(obj) (G_IS_OBJECT(obj))
-
-/**
- * PeasExtension:
- *
- * A proxy class to access the actual plugin.
- */
-typedef GObject PeasExtension;
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (PeasExtension, g_object_unref)
-
-G_END_DECLS
diff --git a/libpeas/peas-object-module.c b/libpeas/peas-object-module.c
index c43215e..ae41033 100644
--- a/libpeas/peas-object-module.c
+++ b/libpeas/peas-object-module.c
@@ -41,9 +41,6 @@
* registration of extensions. It will be used by C extensions implementors to
* register extension implementations from within the peas_register_types module
* function.
- *
- * Since libpeas 1.22, @extension_type can be an Abstract [alias@GObject.Type]
- * and not just an Interface [alias@GObject.Type].
**/
typedef void (*PeasObjectModuleRegisterFunc) (PeasObjectModule *module);
@@ -360,8 +357,6 @@ peas_object_module_class_init (PeasObjectModuleClass *klass)
* PeasObjectModule:local-linkage
*
* Whether the module is loaded with local linkage, i.e. #G_MODULE_BIND_LOCAL.
- *
- * Since 1.14
*/
properties[PROP_LOCAL_LINKAGE] =
g_param_spec_boolean ("local-linkage",
@@ -410,8 +405,6 @@ peas_object_module_new (const gchar *module_name,
* Creates a new #PeasObjectModule.
*
* Returns: a new #PeasObjectModule.
- *
- * Since 1.14
*/
PeasObjectModule *
peas_object_module_new_full (const gchar *module_name,
@@ -469,9 +462,6 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
* If @module does not provide a #PeasFactoryFunc for @exten_type then %NULL is
* returned.
*
- * Since libpeas 1.22, @exten_type can be an Abstract [alias@GObject.Type]
- * and not just an Interface [alias@GObject.Type].
- *
* Returns: (transfer full) (nullable): The created object
*/
GObject *
@@ -481,7 +471,6 @@ peas_object_module_create_object (PeasObjectModule *module,
GParameter *parameters)
{
PeasObjectModulePrivate *priv = peas_object_module_get_instance_private (module);
- guint i;
ExtensionImplementation *impls;
g_return_val_if_fail (PEAS_IS_OBJECT_MODULE (module), NULL);
@@ -489,7 +478,7 @@ peas_object_module_create_object (PeasObjectModule *module,
G_TYPE_IS_ABSTRACT (exten_type), NULL);
impls = (ExtensionImplementation *) priv->implementations->data;
- for (i = 0; i < priv->implementations->len; ++i)
+ for (guint i = 0; i < priv->implementations->len; i++)
{
if (impls[i].exten_type == exten_type)
return impls[i].func (n_parameters, parameters, impls[i].user_data);
@@ -506,9 +495,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS
*
* Determines if the module provides an extension for @exten_type.
*
- * Since libpeas 1.22, @exten_type can be an Abstract [alias@GObject.Type]
- * and not just an Interface [alias@GObject.Type].
- *
* Returns: if the module provides an extension for @exten_type.
*/
gboolean
@@ -624,9 +610,6 @@ peas_object_module_get_library (PeasObjectModule *module)
* creating native types which cannot be instantiated correctly using
* [ctor@GObject.Object.new]. For other uses, you will usually prefer relying on
* peas_object_module_register_extension_type().
- *
- * Since libpeas 1.22, @exten_type can be an Abstract [alias@GObject.Type]
- * and not just an Interface [alias@GObject.Type].
*/
void
peas_object_module_register_extension_factory (PeasObjectModule *module,
@@ -688,9 +671,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS
* @impl_type: The #GType of your implementation of @exten_type.
*
* Register @impl_type as an extension which implements @extension_type.
- *
- * Since libpeas 1.22, @exten_type can be an Abstract [alias@GObject.Type]
- * and not just an Interface [alias@GObject.Type].
*/
void
peas_object_module_register_extension_type (PeasObjectModule *module,
diff --git a/libpeas/peas-plugin-loader-c.c b/libpeas/peas-plugin-loader-c.c
index c4964f6..8155245 100644
--- a/libpeas/peas-plugin-loader-c.c
+++ b/libpeas/peas-plugin-loader-c.c
@@ -111,7 +111,7 @@ peas_plugin_loader_c_provides_extension (PeasPluginLoader *loader,
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-static PeasExtension *
+static GObject *
peas_plugin_loader_c_create_extension (PeasPluginLoader *loader,
PeasPluginInfo *info,
GType exten_type,
diff --git a/libpeas/peas-plugin-loader.c b/libpeas/peas-plugin-loader.c
index 414fb72..880810b 100644
--- a/libpeas/peas-plugin-loader.c
+++ b/libpeas/peas-plugin-loader.c
@@ -117,7 +117,7 @@ peas_plugin_loader_provides_extension (PeasPluginLoader *loader,
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-PeasExtension *
+GObject *
peas_plugin_loader_create_extension (PeasPluginLoader *loader,
PeasPluginInfo *info,
GType ext_type,
diff --git a/libpeas/peas-plugin-loader.h b/libpeas/peas-plugin-loader.h
index bf7ee0c..a61842c 100644
--- a/libpeas/peas-plugin-loader.h
+++ b/libpeas/peas-plugin-loader.h
@@ -26,7 +26,6 @@
#include <glib-object.h>
#include <gmodule.h>
#include "peas-plugin-info.h"
-#include "peas-extension.h"
G_BEGIN_DECLS
@@ -48,54 +47,49 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
struct _PeasPluginLoaderClass {
GObjectClass parent;
- gboolean (*initialize) (PeasPluginLoader *loader);
- gboolean (*is_global) (PeasPluginLoader *loader);
-
- gboolean (*load) (PeasPluginLoader *loader,
- PeasPluginInfo *info);
- void (*unload) (PeasPluginLoader *loader,
- PeasPluginInfo *info);
- gboolean (*provides_extension) (PeasPluginLoader *loader,
- PeasPluginInfo *info,
- GType ext_type);
- PeasExtension *(*create_extension) (PeasPluginLoader *loader,
- PeasPluginInfo *info,
- GType ext_type,
- guint n_parameters,
- GParameter *parameters);
-
- void (*garbage_collect) (PeasPluginLoader *loader);
+ gboolean (*initialize) (PeasPluginLoader *loader);
+ gboolean (*is_global) (PeasPluginLoader *loader);
+ gboolean (*load) (PeasPluginLoader *loader,
+ PeasPluginInfo *info);
+ void (*unload) (PeasPluginLoader *loader,
+ PeasPluginInfo *info);
+ gboolean (*provides_extension) (PeasPluginLoader *loader,
+ PeasPluginInfo *info,
+ GType ext_type);
+ GObject *(*create_extension) (PeasPluginLoader *loader,
+ PeasPluginInfo *info,
+ GType ext_type,
+ guint n_parameters,
+ GParameter *parameters);
+ void (*garbage_collect) (PeasPluginLoader *loader);
};
G_GNUC_END_IGNORE_DEPRECATIONS
PEAS_AVAILABLE_IN_ALL
-GType peas_plugin_loader_get_type (void) G_GNUC_CONST;
-
+GType peas_plugin_loader_get_type (void) G_GNUC_CONST;
PEAS_AVAILABLE_IN_ALL
-gboolean peas_plugin_loader_initialize (PeasPluginLoader *loader);
+gboolean peas_plugin_loader_initialize (PeasPluginLoader *loader);
PEAS_AVAILABLE_IN_ALL
-gboolean peas_plugin_loader_is_global (PeasPluginLoader *loader);
-
+gboolean peas_plugin_loader_is_global (PeasPluginLoader *loader);
PEAS_AVAILABLE_IN_ALL
-gboolean peas_plugin_loader_load (PeasPluginLoader *loader,
- PeasPluginInfo *info);
+gboolean peas_plugin_loader_load (PeasPluginLoader *loader,
+ PeasPluginInfo *info);
PEAS_AVAILABLE_IN_ALL
-void peas_plugin_loader_unload (PeasPluginLoader *loader,
- PeasPluginInfo *info);
-
+void peas_plugin_loader_unload (PeasPluginLoader *loader,
+ PeasPluginInfo *info);
PEAS_AVAILABLE_IN_ALL
-gboolean peas_plugin_loader_provides_extension (PeasPluginLoader *loader,
- PeasPluginInfo *info,
- GType ext_type);
+gboolean peas_plugin_loader_provides_extension (PeasPluginLoader *loader,
+ PeasPluginInfo *info,
+ GType ext_type);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
PEAS_AVAILABLE_IN_ALL
-PeasExtension *peas_plugin_loader_create_extension (PeasPluginLoader *loader,
- PeasPluginInfo *info,
- GType ext_type,
- guint n_parameters,
- GParameter *parameters);
+GObject *peas_plugin_loader_create_extension (PeasPluginLoader *loader,
+ PeasPluginInfo *info,
+ GType ext_type,
+ guint n_parameters,
+ GParameter *parameters);
G_GNUC_END_IGNORE_DEPRECATIONS
PEAS_AVAILABLE_IN_ALL
-void peas_plugin_loader_garbage_collect (PeasPluginLoader *loader);
+void peas_plugin_loader_garbage_collect (PeasPluginLoader *loader);
G_END_DECLS
diff --git a/loaders/lua5.1/peas-plugin-loader-lua.c b/loaders/lua5.1/peas-plugin-loader-lua.c
index 14a66ba..f794eef 100644
--- a/loaders/lua5.1/peas-plugin-loader-lua.c
+++ b/loaders/lua5.1/peas-plugin-loader-lua.c
@@ -155,7 +155,7 @@ peas_plugin_loader_lua_provides_extension (PeasPluginLoader *loader,
return the_type != G_TYPE_INVALID;
}
-static PeasExtension *
+static GObject *
peas_plugin_loader_lua_create_extension (PeasPluginLoader *loader,
PeasPluginInfo *info,
GType exten_type,
diff --git a/loaders/python/peas-plugin-loader-python.c b/loaders/python/peas-plugin-loader-python.c
index b589709..c51529f 100644
--- a/loaders/python/peas-plugin-loader-python.c
+++ b/loaders/python/peas-plugin-loader-python.c
@@ -101,7 +101,7 @@ peas_plugin_loader_python_provides_extension (PeasPluginLoader *loader,
return the_type != G_TYPE_INVALID;
}
-static PeasExtension *
+static GObject *
peas_plugin_loader_python_create_extension (PeasPluginLoader *loader,
PeasPluginInfo *info,
GType exten_type,
diff --git a/tests/libpeas/extension-c.c b/tests/libpeas/extension-c.c
index 78c56c0..c2e9a24 100644
--- a/tests/libpeas/extension-c.c
+++ b/tests/libpeas/extension-c.c
@@ -37,7 +37,7 @@ static void
test_extension_c_embedded (PeasEngine *engine)
{
PeasPluginInfo *info;
- PeasExtension *extension;
+ GObject *extension;
info = peas_engine_get_plugin_info (engine, "embedded");
@@ -93,13 +93,13 @@ static void
test_extension_c_instance_refcount (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
extension = peas_engine_create_extension (engine, info,
INTROSPECTION_TYPE_BASE,
NULL);
- g_assert (PEAS_IS_EXTENSION (extension));
+ g_assert (G_IS_OBJECT (extension));
/* The refcount of the returned object should be 1:
* - one ref for the PeasExtension
@@ -127,7 +127,7 @@ test_extension_c_local_linkage (PeasEngine *engine,
PeasPluginInfo *info)
{
PeasPluginInfo *loadable_info;
- PeasExtension *c_extension, *loadable_extension;
+ GObject *c_extension, *loadable_extension;
gpointer c_global_symbol, loadable_global_symbol;
loadable_info = peas_engine_get_plugin_info (engine, "loadable");
@@ -140,8 +140,8 @@ test_extension_c_local_linkage (PeasEngine *engine,
PEAS_TYPE_ACTIVATABLE,
NULL);
- g_assert (PEAS_IS_EXTENSION (c_extension));
- g_assert (PEAS_IS_EXTENSION (loadable_extension));
+ g_assert (G_IS_OBJECT (c_extension));
+ g_assert (G_IS_OBJECT (loadable_extension));
g_assert (c_extension != loadable_extension);
g_object_get (c_extension,
diff --git a/tests/libpeas/extension-lua.c b/tests/libpeas/extension-lua.c
index b5a21dd..1fbd09e 100644
--- a/tests/libpeas/extension-lua.c
+++ b/tests/libpeas/extension-lua.c
@@ -42,7 +42,7 @@ set_garbage_collector_state (PeasEngine *engine,
PeasPluginInfo *info,
gboolean start)
{
- PeasExtension *extension;
+ GObject *extension;
extension = peas_engine_create_extension (engine, info,
PEAS_TYPE_ACTIVATABLE,
@@ -66,7 +66,7 @@ static void
test_extension_lua_instance_refcount (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
set_garbage_collector_state (engine, info, FALSE);
@@ -75,7 +75,7 @@ test_extension_lua_instance_refcount (PeasEngine *engine,
NULL);
g_object_add_weak_pointer (extension, (gpointer *) &extension);
- g_assert (PEAS_IS_EXTENSION (extension));
+ g_assert (G_IS_OBJECT (extension));
/* The Lua wrapper created around the extension
* object should have increased its refcount by 1.
@@ -105,7 +105,7 @@ static void
test_extension_lua_activatable_subject_refcount (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
GObject *object;
set_garbage_collector_state (engine, info, FALSE);
@@ -125,7 +125,7 @@ test_extension_lua_activatable_subject_refcount (PeasEngine *engine,
NULL);
g_object_add_weak_pointer (extension, (gpointer *) &extension);
- g_assert (PEAS_IS_EXTENSION (extension));
+ g_assert (G_IS_OBJECT (extension));
/* The Lua wrapper created around our dummy
* object should have increased its refcount by 1.
diff --git a/tests/libpeas/extension-py.c b/tests/libpeas/extension-py.c
index 7adb7b9..4c6062f 100644
--- a/tests/libpeas/extension-py.c
+++ b/tests/libpeas/extension-py.c
@@ -49,13 +49,13 @@ static void
test_extension_py_instance_refcount (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
extension = peas_engine_create_extension (engine, info,
INTROSPECTION_TYPE_BASE,
NULL);
- g_assert (PEAS_IS_EXTENSION (extension));
+ g_assert (G_IS_OBJECT (extension));
g_object_add_weak_pointer (extension, (gpointer *) &extension);
@@ -69,7 +69,7 @@ static void
test_extension_py_activatable_subject_refcount (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
GObject *object;
PyObject *wrapper;
@@ -85,7 +85,7 @@ test_extension_py_activatable_subject_refcount (PeasEngine *engine,
"object", object,
NULL);
- g_assert (PEAS_IS_EXTENSION (extension));
+ g_assert (G_IS_OBJECT (extension));
/* The python wrapper created around our dummy object should have increased
* its refcount by 1.
diff --git a/tests/libpeas/extension-set.c b/tests/libpeas/extension-set.c
index 93ec32d..06aa318 100644
--- a/tests/libpeas/extension-set.c
+++ b/tests/libpeas/extension-set.c
@@ -47,7 +47,7 @@ static const gchar *loadable_plugins[] = {
static void
extension_added_cb (PeasExtensionSet *extension_set,
PeasPluginInfo *info,
- PeasExtension *extension,
+ GObject *extension,
gint *active)
{
++(*active);
@@ -56,7 +56,7 @@ extension_added_cb (PeasExtensionSet *extension_set,
static void
extension_removed_cb (PeasExtensionSet *extension_set,
PeasPluginInfo *info,
- PeasExtension *extension,
+ GObject *extension,
gint *active)
{
--(*active);
@@ -152,7 +152,7 @@ test_extension_set_create_valid (PeasEngine *engine)
static void
valid_extension_added_cb (PeasExtensionSet *extension_set,
PeasPluginInfo *info,
- PeasExtension *extension,
+ GObject *extension,
GObject **obj_ptr)
{
g_clear_object (obj_ptr);
@@ -330,7 +330,7 @@ static void
test_extension_set_get_extension (PeasEngine *engine)
{
PeasPluginInfo *info;
- PeasExtension *extension;
+ GObject *extension;
PeasExtensionSet *extension_set;
extension_set = testing_extension_set_new (engine, NULL);
@@ -369,7 +369,7 @@ test_extension_set_foreach (PeasEngine *engine)
static void
ordering_cb (PeasExtensionSet *set,
PeasPluginInfo *info,
- PeasExtension *extension,
+ GObject *extension,
GList **order)
{
const gchar *order_module_name = (const gchar *) (*order)->data;
diff --git a/tests/libpeas/plugins/extension-c/extension-c.plugin b/tests/libpeas/plugins/extension-c/extension-c.plugin
index 4e079fb..94871bf 100644
--- a/tests/libpeas/plugins/extension-c/extension-c.plugin
+++ b/tests/libpeas/plugins/extension-c/extension-c.plugin
@@ -1,6 +1,6 @@
[Plugin]
Module=extension-c
Name=Extension C
-Description=This plugin is for the C PeasExtension tests.
+Description=This plugin is for the C GObject tests.
Authors=Garrett Regier
Copyright=Copyright © 2010 Garrett Regier
diff --git a/tests/libpeas/plugins/extension-lua/extension-lua51.plugin b/tests/libpeas/plugins/extension-lua/extension-lua51.plugin
index ff4b51a..1b076d5 100644
--- a/tests/libpeas/plugins/extension-lua/extension-lua51.plugin
+++ b/tests/libpeas/plugins/extension-lua/extension-lua51.plugin
@@ -2,6 +2,6 @@
Module=extension-lua51
Loader=lua5.1
Name=Extension lua5.1
-Description=This plugin is for the lua5.1 PeasExtension tests.
+Description=This plugin is for the lua5.1 GObject tests.
Authors=Garrett Regier
Copyright=Copyright © 2014 Garrett Regier
diff --git a/tests/libpeas/plugins/extension-python/extension-py.plugin.in b/tests/libpeas/plugins/extension-python/extension-py.plugin.in
index 5258594..fc07603 100644
--- a/tests/libpeas/plugins/extension-python/extension-py.plugin.in
+++ b/tests/libpeas/plugins/extension-python/extension-py.plugin.in
@@ -2,6 +2,6 @@
Module=extension-@PY_LOADER@
Loader=@PY_LOADER@
Name=Extension @PY_LOADER@
-Description=This plugin is for the @PY_LOADER@ PeasExtension tests.
+Description=This plugin is for the @PY_LOADER@ GObject tests.
Authors=Garrett Regier
Copyright=Copyright © 2010 Garrett Regier
diff --git a/tests/libpeas/testing/testing-extension.c b/tests/libpeas/testing/testing-extension.c
index b34eef5..796bcc8 100644
--- a/tests/libpeas/testing/testing-extension.c
+++ b/tests/libpeas/testing/testing-extension.c
@@ -134,13 +134,13 @@ static void
test_extension_create_valid (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
extension = peas_engine_create_extension (engine, info,
INTROSPECTION_TYPE_CALLABLE,
NULL);
- g_assert (PEAS_IS_EXTENSION (extension));
+ g_assert (G_IS_OBJECT (extension));
g_assert (INTROSPECTION_IS_CALLABLE (extension));
g_object_unref (extension);
@@ -150,14 +150,14 @@ static void
test_extension_create_valid_without_properties (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
extension =
peas_engine_create_extension_with_properties (engine, info,
INTROSPECTION_TYPE_CALLABLE,
0, NULL, NULL);
- g_assert (PEAS_IS_EXTENSION (extension));
+ g_assert (G_IS_OBJECT (extension));
g_assert (INTROSPECTION_IS_CALLABLE (extension));
g_object_unref (extension);
@@ -167,7 +167,7 @@ static void
test_extension_create_valid_with_properties (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
IntrospectionAbstract *abstract;
GValue prop_values[1] = { G_VALUE_INIT };
const gchar *prop_names[1] = { "abstract-property" };
@@ -193,7 +193,7 @@ static void
test_extension_create_invalid (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
testing_util_push_log_hook ("*assertion*G_TYPE_IS_INTERFACE*failed");
testing_util_push_log_hook ("*does not provide a 'IntrospectionUnimplemented' extension");
@@ -202,40 +202,40 @@ test_extension_create_invalid (PeasEngine *engine,
/* Invalid GType */
extension = peas_engine_create_extension (engine, info, G_TYPE_INVALID, NULL);
- g_assert (!PEAS_IS_EXTENSION (extension));
+ g_assert (!G_IS_OBJECT (extension));
/* GObject but not a GInterface */
extension = peas_engine_create_extension (engine, info, PEAS_TYPE_ENGINE, NULL);
- g_assert (!PEAS_IS_EXTENSION (extension));
+ g_assert (!G_IS_OBJECT (extension));
/* Does not implement this GType */
extension = peas_engine_create_extension (engine, info,
INTROSPECTION_TYPE_UNIMPLEMENTED,
NULL);
- g_assert (!PEAS_IS_EXTENSION (extension));
+ g_assert (!G_IS_OBJECT (extension));
/* Interface does not have a specified property */
extension = peas_engine_create_extension (engine, info,
INTROSPECTION_TYPE_CALLABLE,
"does-not-exist", "",
NULL);
- g_assert (!PEAS_IS_EXTENSION (extension));
+ g_assert (!G_IS_OBJECT (extension));
/* Not loaded */
g_assert (peas_engine_unload_plugin (engine, info));
extension = peas_engine_create_extension (engine, info,
INTROSPECTION_TYPE_CALLABLE,
NULL);
- g_assert (!PEAS_IS_EXTENSION (extension));
+ g_assert (!G_IS_OBJECT (extension));
}
static void
test_extension_create_invalid_with_properties (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
GValue prop_values[1] = { G_VALUE_INIT };
const gchar *prop_names[1] = { NULL };
GValue prop_values2[1] = { G_VALUE_INIT };
@@ -254,20 +254,20 @@ test_extension_create_invalid_with_properties (PeasEngine *engine,
extension = peas_engine_create_extension_with_properties (engine, info,
G_TYPE_INVALID, 0,
NULL, NULL);
- g_assert (!PEAS_IS_EXTENSION (extension));
+ g_assert (!G_IS_OBJECT (extension));
/* GObject but not a GInterface */
extension = peas_engine_create_extension_with_properties (engine, info,
PEAS_TYPE_ENGINE, 0,
NULL, NULL);
- g_assert (!PEAS_IS_EXTENSION (extension));
+ g_assert (!G_IS_OBJECT (extension));
/* Does not implement this GType */
extension =
peas_engine_create_extension_with_properties (engine, info,
INTROSPECTION_TYPE_UNIMPLEMENTED,
0, NULL, NULL);
- g_assert (!PEAS_IS_EXTENSION (extension));
+ g_assert (!G_IS_OBJECT (extension));
/* Interface has a NULL property name*/
extension =
@@ -275,7 +275,7 @@ test_extension_create_invalid_with_properties (PeasEngine *engine,
INTROSPECTION_TYPE_CALLABLE,
G_N_ELEMENTS (prop_names2),
prop_names, prop_values);
- g_assert (!PEAS_IS_EXTENSION (extension));
+ g_assert (!G_IS_OBJECT (extension));
/* Interface has a not initialiazed GValue */
extension =
@@ -283,7 +283,7 @@ test_extension_create_invalid_with_properties (PeasEngine *engine,
INTROSPECTION_TYPE_CALLABLE,
G_N_ELEMENTS (prop_names2),
prop_names2, prop_values2);
- g_assert (!PEAS_IS_EXTENSION (extension));
+ g_assert (!G_IS_OBJECT (extension));
/* Not loaded */
g_assert (peas_engine_unload_plugin (engine, info));
@@ -291,7 +291,7 @@ test_extension_create_invalid_with_properties (PeasEngine *engine,
peas_engine_create_extension_with_properties (engine, info,
INTROSPECTION_TYPE_CALLABLE,
0, NULL, NULL);
- g_assert (!PEAS_IS_EXTENSION (extension));
+ g_assert (!G_IS_OBJECT (extension));
g_value_unset (&prop_values[0]);
@@ -301,7 +301,7 @@ static void
test_extension_create_with_prerequisite (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
gint prerequisite_property = -1;
extension = peas_engine_create_extension (engine, info,
@@ -337,7 +337,7 @@ static void
test_extension_plugin_info (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
IntrospectionBase *base;
g_assert (peas_engine_load_plugin (engine, info));
@@ -357,7 +357,7 @@ static void
test_extension_get_settings (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
IntrospectionBase *base;
GSettings *settings;
@@ -380,7 +380,7 @@ static void
test_extension_abstract (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
IntrospectionAbstract *abstract;
g_assert (peas_engine_load_plugin (engine, info));
@@ -490,7 +490,7 @@ static void
test_extension_multiple_threads_callbacks (PeasEngine *engine,
PeasPluginInfo *info)
{
- PeasExtension *extension;
+ GObject *extension;
gint n_threads, update_count;
extension = peas_engine_create_extension (engine, info,