From 929ae6911347065740f16c6f9aeaa1f692f7dbf5 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 16 Mar 2023 17:27:11 -0700 Subject: janitorial: remove peas_engine_create_extensionv() This moves peas_engine_create_extensionv() to become private API in the form of _peas_engine_create_extensionv() for internal use. The ultimate goal here is the continued removal of deprecated GParameter use in the libpeas-2 public API. --- libpeas/peas-engine-priv.h | 12 ++++++++++++ libpeas/peas-engine.c | 39 +++++++++------------------------------ libpeas/peas-engine.h | 10 ---------- libpeas/peas-extension-set.c | 3 ++- 4 files changed, 23 insertions(+), 41 deletions(-) diff --git a/libpeas/peas-engine-priv.h b/libpeas/peas-engine-priv.h index a02c7c1..a6741c7 100644 --- a/libpeas/peas-engine-priv.h +++ b/libpeas/peas-engine-priv.h @@ -23,6 +23,10 @@ #pragma once +#include + +#include "peas-engine.h" +#include "peas-plugin-info.h" #include "peas-version-macros.h" G_BEGIN_DECLS @@ -30,4 +34,12 @@ G_BEGIN_DECLS PEAS_AVAILABLE_IN_ALL 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); +G_GNUC_END_IGNORE_DEPRECATIONS + G_END_DECLS diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c index 9d2f78c..d2ff71d 100644 --- a/libpeas/peas-engine.c +++ b/libpeas/peas-engine.c @@ -1357,35 +1357,13 @@ peas_engine_provides_extension (PeasEngine *engine, return peas_plugin_loader_provides_extension (loader, info, extension_type); } -/** - * peas_engine_create_extensionv: (skip) - * @engine: A #PeasEngine. - * @info: A loaded #PeasPluginInfo. - * @extension_type: The implemented extension #GType. - * @n_parameters: the length of the @parameters array. - * @parameters: (allow-none) (array length=n_parameters): - * an array of #GParameter. - * - * 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]. - * - * See [method@Engine.create_extension] for more information. - * - * Returns: (transfer full): a new instance of #PeasExtension wrapping - * the @extension_type instance, or %NULL. - */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS PeasExtension * -peas_engine_create_extensionv (PeasEngine *engine, - PeasPluginInfo *info, - GType extension_type, - guint n_parameters, - GParameter *parameters) +_peas_engine_create_extensionv (PeasEngine *engine, + PeasPluginInfo *info, + GType extension_type, + guint n_parameters, + GParameter *parameters) { PeasPluginLoader *loader; PeasExtension *extension; @@ -1535,8 +1513,8 @@ peas_engine_create_extension_valist (PeasEngine *engine, return NULL; } - exten = peas_engine_create_extensionv (engine, info, extension_type, - n_parameters, parameters); + exten = _peas_engine_create_extensionv (engine, info, extension_type, + n_parameters, parameters); while (n_parameters-- > 0) g_value_unset (¶meters[n_parameters].value); @@ -1544,6 +1522,7 @@ peas_engine_create_extension_valist (PeasEngine *engine, return exten; } +G_GNUC_END_IGNORE_DEPRECATIONS /** * peas_engine_create_extension: (skip) diff --git a/libpeas/peas-engine.h b/libpeas/peas-engine.h index 8baa15a..88b3745 100644 --- a/libpeas/peas-engine.h +++ b/libpeas/peas-engine.h @@ -131,16 +131,6 @@ gboolean peas_engine_provides_extension (PeasEngine *engine, PeasPluginInfo *info, GType extension_type); - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS -PEAS_AVAILABLE_IN_ALL -PeasExtension *peas_engine_create_extensionv (PeasEngine *engine, - PeasPluginInfo *info, - GType extension_type, - guint n_parameters, - GParameter *parameters); -G_GNUC_END_IGNORE_DEPRECATIONS - PEAS_AVAILABLE_IN_ALL PeasExtension *peas_engine_create_extension_with_properties (PeasEngine *engine, diff --git a/libpeas/peas-extension-set.c b/libpeas/peas-extension-set.c index 6a06a67..bb0b986 100644 --- a/libpeas/peas-extension-set.c +++ b/libpeas/peas-extension-set.c @@ -27,6 +27,7 @@ #include "peas-extension-set.h" +#include "peas-engine-priv.h" #include "peas-i18n-priv.h" #include "peas-introspection.h" #include "peas-plugin-info.h" @@ -227,7 +228,7 @@ add_extension (PeasExtensionSet *set, priv->exten_type)) return; - exten = peas_engine_create_extensionv (priv->engine, info, + exten = _peas_engine_create_extensionv (priv->engine, info, priv->exten_type, priv->n_parameters, priv->parameters); -- cgit v1.2.1