[libpeas] Remove everything the seed plugin loader used
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Remove everything the seed plugin loader used
- Date: Tue, 4 Nov 2014 13:50:38 +0000 (UTC)
commit dcb2247e6b338e093275db8292231bd6152ef8e1
Author: Garrett Regier <garrett regier riftio com>
Date: Tue Oct 28 09:37:17 2014 -0700
Remove everything the seed plugin loader used
This is no longer needed as the seed plugin
loader has been removed.
https://bugzilla.gnome.org/show_bug.cgi?id=739306
configure.ac | 9 -
docs/reference/Makefile.am | 2 -
libpeas/Makefile.am | 4 -
libpeas/peas-extension-subclasses.c | 394 --------------------
libpeas/peas-extension-subclasses.h | 34 --
libpeas/peas-extension-wrapper.c | 100 -----
libpeas/peas-extension-wrapper.h | 81 ----
libpeas/peas-extension.c | 39 +--
libpeas/peas-introspection.c | 168 ---------
libpeas/peas-introspection.h | 5 -
libpeas/peas-plugin-loader-c.c | 8 +-
loaders/python/peas-plugin-loader-python.c | 7 +-
tests/libpeas/introspection/Makefile.am | 4 -
.../introspection-properties-prerequisite.c | 52 ---
.../introspection-properties-prerequisite.h | 52 ---
.../introspection/introspection-properties.c | 57 ---
.../introspection/introspection-properties.h | 52 ---
.../plugins/extension-python/extension-py.py | 8 -
tests/libpeas/testing/testing-extension.c | 106 ------
tests/libpeas/testing/testing-extension.h | 4 +-
20 files changed, 14 insertions(+), 1172 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 23b17d1..2c9112f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -383,15 +383,6 @@ GNOME_COMPILE_WARNINGS([maximum])
# Use --enable-maintainer-mode to disabled deprecated symbols
GNOME_MAINTAINER_MODE_DEFINES
-AC_ARG_ENABLE([deprecation],
- AS_HELP_STRING([--disable-deprecation],[Disable deprecated libpeas features]),
- [enable_deprecation=$enableval],
- [enable_deprecation=$USE_MAINTAINER_MODE])
-if test "$enable_deprecation" = "yes"; then
- AC_MSG_NOTICE([disabling deprecated libpeas features])
- AC_DEFINE([PEAS_DISABLE_DEPRECATED_FEATURES],[1],[Disable deprecated features])
-fi
-
AC_CONFIG_FILES([
Makefile
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index bb5791b..63eb00a 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -48,8 +48,6 @@ IGNORE_HFILES= \
peas-debug.h \
peas-dirs.h \
peas-engine-priv.h \
- peas-extension-wrapper.h \
- peas-extension-subclasses.h \
peas-gtk-disable-plugins-dialog.h \
peas-gtk-plugin-manager-store.h \
peas-helpers.h \
diff --git a/libpeas/Makefile.am b/libpeas/Makefile.am
index ccf5b21..b9b9780 100644
--- a/libpeas/Makefile.am
+++ b/libpeas/Makefile.am
@@ -37,8 +37,6 @@ NOINST_H_FILES = \
peas-debug.h \
peas-dirs.h \
peas-engine-priv.h \
- peas-extension-wrapper.h \
- peas-extension-subclasses.h \
peas-helpers.h \
peas-i18n.h \
peas-introspection.h \
@@ -54,8 +52,6 @@ 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 \
peas-introspection.c \
diff --git a/libpeas/peas-extension.c b/libpeas/peas-extension.c
index 31e12b0..a100c93 100644
--- a/libpeas/peas-extension.c
+++ b/libpeas/peas-extension.c
@@ -24,7 +24,6 @@
#endif
#include "peas-extension.h"
-#include "peas-extension-wrapper.h"
#include "peas-introspection.h"
/**
@@ -76,7 +75,6 @@ get_method_info (PeasExtension *exten,
GType exten_type;
GType *interfaces;
GICallableInfo *method_info;
- gboolean must_free_interfaces = FALSE;
/* Must prioritize the initial GType */
exten_type = peas_extension_get_extension_type (exten);
@@ -90,15 +88,7 @@ get_method_info (PeasExtension *exten,
return method_info;
}
- if (PEAS_IS_EXTENSION_WRAPPER (exten))
- {
- interfaces = PEAS_EXTENSION_WRAPPER (exten)->interfaces;
- }
- else
- {
- must_free_interfaces = TRUE;
- interfaces = g_type_interfaces (G_TYPE_FROM_INSTANCE (exten), NULL);
- }
+ interfaces = g_type_interfaces (G_TYPE_FROM_INSTANCE (exten), NULL);
for (i = 0; interfaces[i] != G_TYPE_INVALID; ++i)
{
@@ -113,12 +103,10 @@ get_method_info (PeasExtension *exten,
}
}
- if (must_free_interfaces)
- g_free (interfaces);
-
if (method_info == NULL)
g_warning ("Could not find the interface for method '%s'", method_name);
+ g_free (interfaces);
return method_info;
}
@@ -135,14 +123,8 @@ get_method_info (PeasExtension *exten,
GType
peas_extension_get_extension_type (PeasExtension *exten)
{
- if (PEAS_IS_EXTENSION_WRAPPER (exten))
- {
- return peas_extension_wrapper_get_extension_type (PEAS_EXTENSION_WRAPPER (exten));
- }
- else
- {
- return (GType) g_object_get_data (G_OBJECT (exten), "peas-extension-type");
- }
+ return GPOINTER_TO_SIZE (g_object_get_data (G_OBJECT (exten),
+ "peas-extension-type"));
}
/**
@@ -277,17 +259,8 @@ peas_extension_callv (PeasExtension *exten,
if (method_info == NULL)
return FALSE;
- if (PEAS_IS_EXTENSION_WRAPPER (exten))
- {
- success = peas_extension_wrapper_callv (PEAS_EXTENSION_WRAPPER (exten),
- interface, method_info,
- method_name, args, return_value);
- }
- else
- {
- success = peas_gi_method_call (G_OBJECT (exten), method_info, interface,
- method_name, args, return_value);
- }
+ success = peas_gi_method_call (G_OBJECT (exten), method_info, interface,
+ method_name, args, return_value);
g_base_info_unref (method_info);
return success;
diff --git a/libpeas/peas-introspection.c b/libpeas/peas-introspection.c
index b9eb005..ddbcf7a 100644
--- a/libpeas/peas-introspection.c
+++ b/libpeas/peas-introspection.c
@@ -238,73 +238,6 @@ peas_gi_argument_to_pointer (GITypeInfo *type_info,
}
}
-void
-peas_gi_pointer_to_argument (GITypeInfo *type_info,
- gpointer ptr,
- GIArgument *arg)
-{
- g_return_if_fail (ptr != NULL);
-
- switch (g_type_info_get_tag (type_info))
- {
- case GI_TYPE_TAG_VOID:
- arg->v_pointer = *((gpointer **) ptr);
- break;
- case GI_TYPE_TAG_BOOLEAN:
- arg->v_boolean = *((gboolean *) ptr);
- break;
- case GI_TYPE_TAG_INT8:
- arg->v_int8 = *((gint8 *) ptr);
- break;
- case GI_TYPE_TAG_UINT8:
- arg->v_uint8 = *((guint8 *) ptr);
- break;
- case GI_TYPE_TAG_INT16:
- arg->v_int16 = *((gint16 *) ptr);
- break;
- case GI_TYPE_TAG_UINT16:
- arg->v_uint16 = *((guint16 *) ptr);
- break;
- case GI_TYPE_TAG_INT32:
- arg->v_int32 = *((gint32 *) ptr);
- break;
- case GI_TYPE_TAG_UNICHAR:
- case GI_TYPE_TAG_UINT32:
- arg->v_uint32 = *((guint32 *) ptr);
- break;
- case GI_TYPE_TAG_INT64:
- arg->v_int64 = *((gint64 *) ptr);
- break;
- case GI_TYPE_TAG_UINT64:
- arg->v_uint64 = *((guint64 *) ptr);
- break;
- case GI_TYPE_TAG_FLOAT:
- arg->v_float = *((gfloat *) ptr);
- break;
- case GI_TYPE_TAG_DOUBLE:
- arg->v_double = *((gdouble *) ptr);
- break;
- case GI_TYPE_TAG_GTYPE:
- /* apparently, GType is meant to be a gsize, from gobject/gtype.h in glib */
- arg->v_size = *((gsize *) ptr);
- break;
- case GI_TYPE_TAG_UTF8:
- case GI_TYPE_TAG_FILENAME:
- arg->v_string = *((gchar **) ptr);
- break;
- case GI_TYPE_TAG_ARRAY:
- case GI_TYPE_TAG_INTERFACE:
- case GI_TYPE_TAG_GLIST:
- case GI_TYPE_TAG_GSLIST:
- case GI_TYPE_TAG_GHASH:
- case GI_TYPE_TAG_ERROR:
- arg->v_pointer = *((gpointer **) ptr);
- break;
- default:
- g_return_if_reached ();
- }
-}
-
GICallableInfo *
peas_gi_get_method_info (GType iface_type,
const gchar *method_name)
@@ -340,107 +273,6 @@ peas_gi_get_method_info (GType iface_type,
return (GICallableInfo *) func_info;
}
-/* Only for interfaces! */
-GType
-peas_gi_get_type_from_name (const gchar *type_name)
-{
- guint i;
- gchar **ns;
- GType the_type = G_TYPE_INVALID;
-
- /* Hope for the best */
- the_type = g_type_from_name (type_name);
-
- if (the_type != G_TYPE_INVALID)
- return the_type;
-
- ns = g_irepository_get_loaded_namespaces (NULL);
-
- /* Attempt to find it via naming conventions */
- for (i = 0; ns[i] != NULL; ++i)
- {
- gsize len;
-
- /* Allow GLib, GObject and Gio Interfaces to use the fast path */
- if (g_strcmp0 (ns[i], "GLib") == 0 ||
- g_strcmp0 (ns[i], "GObject") == 0 ||
- g_strcmp0 (ns[i], "Gio") == 0)
- len = 1;
- else
- len = strlen (ns[i]);
-
- /* Only compare the prefix of the type name */
- if (strncmp (type_name, ns[i], len) == 0)
- {
- GIBaseInfo *info;
-
- info = g_irepository_find_by_name (NULL, ns[i], type_name + len);
-
- if (info != NULL)
- {
- if (!GI_IS_INTERFACE_INFO (info))
- {
- g_base_info_unref (info);
- }
- else
- {
- g_registered_type_info_get_g_type (info);
- g_base_info_unref (info);
-
- /* It might not be the correct interface */
- the_type = g_type_from_name (type_name);
-
- if (the_type != G_TYPE_INVALID)
- break;
- }
- }
-
- /* Cannot break here otherwise PeasGtk symbols would not be found */
- }
- }
-
- /* The all or nothing approach, on the upside this
- * will cause g_type_name() on many other types to work.
- */
- if (the_type == G_TYPE_INVALID)
- {
- for (i = 0; ns[i] != NULL; ++i)
- {
- gint j;
- gint n_infos;
-
- n_infos = g_irepository_get_n_infos (NULL, ns[i]);
-
- for (j = 0; j < n_infos; ++j)
- {
- GIBaseInfo *info;
-
- info = g_irepository_get_info (NULL, ns[i], j);
-
- if (!GI_IS_INTERFACE_INFO (info))
- {
- g_base_info_unref (info);
- }
- else
- {
- g_registered_type_info_get_g_type (info);
- g_base_info_unref (info);
-
- the_type = g_type_from_name (type_name);
-
- if (the_type != G_TYPE_INVALID)
- break;
- }
- }
- }
- }
-
- /* Seems they did not import it */
-
- g_strfreev (ns);
- return the_type;
-}
-
gboolean
peas_gi_method_call (GObject *instance,
GICallableInfo *func_info,
diff --git a/libpeas/peas-introspection.h b/libpeas/peas-introspection.h
index 802f645..c3c766b 100644
--- a/libpeas/peas-introspection.h
+++ b/libpeas/peas-introspection.h
@@ -30,8 +30,6 @@ G_BEGIN_DECLS
GICallableInfo *peas_gi_get_method_info (GType iface_type,
const gchar *method_name);
-GType peas_gi_get_type_from_name (const gchar *type_name);
-
void peas_gi_valist_to_arguments (GICallableInfo *callable_info,
va_list va_args,
GIArgument *arguments,
@@ -39,9 +37,6 @@ void peas_gi_valist_to_arguments (GICallableInfo *callable_info
void peas_gi_argument_to_pointer (GITypeInfo *type_info,
GIArgument *arg,
gpointer ptr);
-void peas_gi_pointer_to_argument (GITypeInfo *type_info,
- gpointer ptr,
- GIArgument *arg);
gboolean peas_gi_method_call (GObject *instance,
GICallableInfo *method_info,
GType iface_type,
diff --git a/libpeas/peas-plugin-loader-c.c b/libpeas/peas-plugin-loader-c.c
index a49ab3b..c5a488d 100644
--- a/libpeas/peas-plugin-loader-c.c
+++ b/libpeas/peas-plugin-loader-c.c
@@ -135,11 +135,11 @@ peas_plugin_loader_c_create_extension (PeasPluginLoader *loader,
g_return_val_if_fail (G_IS_OBJECT (instance), NULL);
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (instance, exten_type), NULL);
- /* As we do not instantiate a PeasExtensionWrapper, we have to remember
- * somehow which interface we are instantiating, to make it possible to use
- * the deprecated peas_extension_get_extension_type() method.
+ /* We have to remember which interface we are instantiating
+ * for the deprecated peas_extension_get_extension_type().
*/
- g_object_set_data (instance, "peas-extension-type", GUINT_TO_POINTER (exten_type));
+ g_object_set_data (instance, "peas-extension-type",
+ GSIZE_TO_POINTER (exten_type));
return instance;
}
diff --git a/loaders/python/peas-plugin-loader-python.c b/loaders/python/peas-plugin-loader-python.c
index e0f587e..0e8cd7e 100644
--- a/loaders/python/peas-plugin-loader-python.c
+++ b/loaders/python/peas-plugin-loader-python.c
@@ -188,12 +188,11 @@ peas_plugin_loader_python_create_extension (PeasPluginLoader *loader,
if (!object)
goto out;
- /* As we do not instantiate a PeasExtensionWrapper, we have to remember
- * somehow which interface we are instantiating, to make it possible to use
- * the deprecated peas_extension_get_extension_type() method.
+ /* We have to remember which interface we are instantiating
+ * for the deprecated peas_extension_get_extension_type().
*/
g_object_set_data (object, "peas-extension-type",
- GUINT_TO_POINTER (exten_type));
+ GSIZE_TO_POINTER (exten_type));
pyobject = pygobject_new (object);
pyplinfo = pyg_boxed_new (PEAS_TYPE_PLUGIN_INFO, info, TRUE, TRUE);
diff --git a/tests/libpeas/introspection/Makefile.am b/tests/libpeas/introspection/Makefile.am
index de334e7..fb51757 100644
--- a/tests/libpeas/introspection/Makefile.am
+++ b/tests/libpeas/introspection/Makefile.am
@@ -21,10 +21,6 @@ libintrospection_1_0_la_SOURCES = \
introspection-has-missing-prerequisite.h \
introspection-has-prerequisite.c \
introspection-has-prerequisite.h \
- introspection-properties.c \
- introspection-properties.h \
- introspection-properties-prerequisite.c \
- introspection-properties-prerequisite.h \
introspection-unimplemented.c \
introspection-unimplemented.h
diff --git a/tests/libpeas/plugins/extension-python/extension-py.py
b/tests/libpeas/plugins/extension-python/extension-py.py
index 83eceab..0a3f613 100644
--- a/tests/libpeas/plugins/extension-python/extension-py.py
+++ b/tests/libpeas/plugins/extension-python/extension-py.py
@@ -5,18 +5,10 @@ from gi.repository import GObject, Introspection, Peas
class ExtensionPythonPlugin(GObject.Object, Peas.Activatable,
Introspection.Base, Introspection.Callable,
- Introspection.PropertiesPrerequisite,
- Introspection.Properties,
Introspection.HasPrerequisite):
object = GObject.property(type=GObject.Object)
- construct_only = GObject.property(type=str)
- read_only = GObject.property(type=str, default="read-only")
- write_only = GObject.property(type=str)
- readwrite = GObject.property(type=str, default="readwrite")
- prerequisite = GObject.property(type=str)
-
def do_activate(self):
pass
diff --git a/tests/libpeas/testing/testing-extension.c b/tests/libpeas/testing/testing-extension.c
index 4a0bd72..12f1db3 100644
--- a/tests/libpeas/testing/testing-extension.c
+++ b/tests/libpeas/testing/testing-extension.c
@@ -37,7 +37,6 @@
#include "introspection-callable.h"
#include "introspection-has-missing-prerequisite.h"
#include "introspection-has-prerequisite.h"
-#include "introspection-properties.h"
#include "introspection-unimplemented.h"
typedef struct _TestFixture TestFixture;
@@ -373,101 +372,6 @@ test_extension_call_multi_args (PeasEngine *engine,
g_object_unref (extension);
}
-static void
-test_extension_properties_construct_only (PeasEngine *engine,
- PeasPluginInfo *info)
-{
- PeasExtension *extension;
- gchar *construct_only;
-
- extension = peas_engine_create_extension (engine, info,
- INTROSPECTION_TYPE_PROPERTIES,
- "construct-only", "my-construct-only",
- NULL);
-
- g_object_get (extension, "construct-only", &construct_only, NULL);
- g_assert_cmpstr (construct_only, ==, "my-construct-only");
- g_free (construct_only);
-
- g_object_unref (extension);
-}
-
-static void
-test_extension_properties_read_only (PeasEngine *engine,
- PeasPluginInfo *info)
-{
- PeasExtension *extension;
- gchar *read_only;
-
- extension = peas_engine_create_extension (engine, info,
- INTROSPECTION_TYPE_PROPERTIES,
- NULL);
-
- g_object_get (extension, "read-only", &read_only, NULL);
- g_assert_cmpstr (read_only, ==, "read-only");
- g_free (read_only);
-
- g_object_unref (extension);
-}
-
-static void
-test_extension_properties_write_only (PeasEngine *engine,
- PeasPluginInfo *info)
-{
- PeasExtension *extension;
-
- extension = peas_engine_create_extension (engine, info,
- INTROSPECTION_TYPE_PROPERTIES,
- NULL);
-
- g_object_set (extension, "write-only", "my-write-only", NULL);
-
- g_object_unref (extension);
-}
-
-static void
-test_extension_properties_readwrite (PeasEngine *engine,
- PeasPluginInfo *info)
-{
- PeasExtension *extension;
- gchar *readwrite;
-
- extension = peas_engine_create_extension (engine, info,
- INTROSPECTION_TYPE_PROPERTIES,
- NULL);
-
- g_object_get (extension, "readwrite", &readwrite, NULL);
- g_assert_cmpstr (readwrite, ==, "readwrite");
- g_free (readwrite);
-
- g_object_set (extension, "readwrite", "my-readwrite", NULL);
-
- g_object_get (extension, "readwrite", &readwrite, NULL);
- g_assert_cmpstr (readwrite, ==, "my-readwrite");
- g_free (readwrite);
-
- g_object_unref (extension);
-}
-
-static void
-test_extension_properties_prerequisite (PeasEngine *engine,
- PeasPluginInfo *info)
-{
- PeasExtension *extension;
- gchar *prerequisite;
-
- extension = peas_engine_create_extension (engine, info,
- INTROSPECTION_TYPE_PROPERTIES,
- "prerequisite", "prerequisite",
- NULL);
-
- g_object_get (extension, "prerequisite", &prerequisite, NULL);
- g_assert_cmpstr (prerequisite, ==, "prerequisite");
- g_free (prerequisite);
-
- g_object_unref (extension);
-}
-
#define _EXTENSION_TEST(loader, path, ftest) \
G_STMT_START { \
gchar *full_path = g_strdup_printf (EXTENSION_TEST_NAME (%s, "%s"), \
@@ -521,16 +425,6 @@ testing_extension_callable (const gchar *loader)
}
void
-testing_extension_properties (const gchar *loader)
-{
- _EXTENSION_TEST (loader, "properties-construct-only", properties_construct_only);
- _EXTENSION_TEST (loader, "properties-read-only", properties_read_only);
- _EXTENSION_TEST (loader, "properties-write-only", properties_write_only);
- _EXTENSION_TEST (loader, "properties-readwrite", properties_readwrite);
- _EXTENSION_TEST (loader, "properties-prerequisite", properties_prerequisite);
-}
-
-void
testing_extension_add (const gchar *path,
GTestDataFunc func)
{
diff --git a/tests/libpeas/testing/testing-extension.h b/tests/libpeas/testing/testing-extension.h
index 00a5b6e..2ccc072 100644
--- a/tests/libpeas/testing/testing-extension.h
+++ b/tests/libpeas/testing/testing-extension.h
@@ -30,7 +30,6 @@ G_BEGIN_DECLS
void testing_extension_basic (const gchar *loader);
void testing_extension_callable (const gchar *loader);
-void testing_extension_properties (const gchar *loader);
void testing_extension_add (const gchar *path,
GTestDataFunc func);
@@ -38,8 +37,7 @@ int testing_extension_run_tests (void);
#define testing_extension_all(loader) \
testing_extension_basic (loader); \
- testing_extension_callable (loader); \
- testing_extension_properties (loader)
+ testing_extension_callable (loader);
/* These macros are here to add loader-specific tests. */
#define EXTENSION_TEST_NAME(loader, path) \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]