gplugin/gplugin

remove the seedjs loader itself refs #63
feature/remove-seed
2015-02-28, Gary Kramlich
a846dcd98196
Parents 465f0c128e11
Children fa3e9697aa8c
remove the seedjs loader itself refs #63
--- a/CMakeLists.txt Sat Feb 28 19:40:29 2015 -0600
+++ b/CMakeLists.txt Sat Feb 28 19:40:41 2015 -0600
@@ -185,7 +185,6 @@
add_subdirectory(lua)
add_subdirectory(perl)
add_subdirectory(python)
-add_subdirectory(seed)
###############################################################################
# Install stuff
--- a/seed/CMakeLists.txt Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-option(
- BUILD_SEED
- "Whether or not to build the seed JavaScript plugin loader"
- "On"
-)
-
-if(BUILD_SEED)
- if(NOT BUILD_GIR)
- message(FATAL_ERROR "Seed JavaScript plugin requires GObject Introspection.")
- endif(NOT BUILD_GIR)
-
- set(GPLUGIN_SEED_SOURCES
- gplugin-seed-core.c
- gplugin-seed-loader.c
- gplugin-seed-plugin.c
- )
-
- set(GPLUGIN_SEED_HEADERS
- gplugin-seed-loader.h
- gplugin-seed-plugin.h
- )
-
- pkg_check_modules(SEED REQUIRED seed>=3.0.0)
- add_library(gplugin-seed MODULE
- ${GPLUGIN_SEED_SOURCES}
- ${GPLUGIN_SEED_HEADERS}
- )
- set_target_properties(gplugin-seed PROPERTIES PREFIX "")
-
- include_directories(${SEED_INCLUDE_DIRS})
- target_link_libraries(gplugin-seed
- ${SEED_LIBRARIES}
- gplugin
- )
-
- install(TARGETS gplugin-seed DESTINATION lib/gplugin)
-endif(BUILD_SEED)
-
-if(TESTING_ENABLED)
- add_subdirectory(tests)
-endif(TESTING_ENABLED)
-
--- a/seed/gplugin-seed-core.c Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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 of the License, or (at your option) any later version.
- *
- * This library 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <gplugin.h>
-#include <gplugin-native.h>
-
-#include "gplugin-seed-loader.h"
-#include "gplugin-seed-plugin.h"
-
-G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(GPLUGIN_UNUSED GError **error) {
- const gchar * const authors[] = {
- "Gary Kramlich <grim@reaperworld.com>",
- NULL
- };
-
- return gplugin_plugin_info_new(
- "gplugin/seed-loader",
- GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
- "internal", TRUE,
- "load-on-query", TRUE,
- "name", "Seed JavaScript Plugin Loader",
- "version", GPLUGIN_VERSION,
- "license-id", "GPL3",
- "summary", "A plugin that can load seed JavaScript plugins",
- "description", "This plugin allows the loading of plugins written in "
- "Seed JavaScript.",
- "authors", authors,
- "website", GPLUGIN_WEBSITE,
- "category", "loaders",
- NULL
- );
-}
-
-G_MODULE_EXPORT gboolean
-gplugin_load(GPluginNativePlugin *plugin,
- GPLUGIN_UNUSED GError **error)
-{
- gplugin_seed_loader_register(plugin);
- gplugin_seed_plugin_register(plugin);
-
- gplugin_manager_register_loader(gplugin_seed_loader_get_type());
-
- return TRUE;
-}
-
-G_MODULE_EXPORT gboolean
-gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin,
- GPLUGIN_UNUSED GError **error)
-{
- return FALSE;
-}
-
--- a/seed/gplugin-seed-loader.c Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,330 +0,0 @@
-/*
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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 of the License, or (at your option) any later version.
- *
- * This library 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include "gplugin-seed-loader.h"
-#include "gplugin-seed-plugin.h"
-
-#include <glib/gi18n.h>
-
-#include <seed.h>
-
-/******************************************************************************
- * Globals
- *****************************************************************************/
-static GObjectClass *parent_class = NULL;
-static GType type_real = 0;
-static SeedEngine *engine = NULL;
-
-/******************************************************************************
- * Helpers
- *****************************************************************************/
-
-/******************************************************************************
- * GPluginLoaderInterface API
- *****************************************************************************/
-static GSList *
-gplugin_seed_loader_class_supported_extensions(GPLUGIN_UNUSED const GPluginLoaderClass *klass) {
- return g_slist_append(NULL, "js");
-}
-
-static GPluginPlugin *
-gplugin_seed_loader_query(GPluginLoader *loader, const gchar *filename,
- GError **error)
-{
- GPluginPluginInfo *info = NULL;
- SeedContext ctx = NULL;
- SeedException exp = NULL;
- SeedObject global = NULL, query = NULL, load = NULL, unload = NULL;
- SeedObject sinfo = NULL;
- SeedScript *script = NULL;
- gchar *contents = NULL;
-
- /* load the file */
- if(!g_file_get_contents(filename, &contents, NULL, error)) {
- return NULL;
- }
-
- /* create our context */
- ctx = seed_context_create(engine->group, NULL);
- seed_prepare_global_context(ctx);
-
- /* now create and evaluate the script object */
- script = seed_make_script(ctx, contents, filename, 0);
- g_free(contents);
-
- seed_evaluate(ctx, script, NULL);
- exp = seed_script_exception(script);
- seed_script_destroy(script);
-
- /* did we get any exceptions during evaluation? */
- if(exp) {
- if(error) {
- gchar *message = seed_exception_to_string(ctx, exp);
-
- *error = g_error_new(GPLUGIN_DOMAIN, 0, "Failed to load %s : %s",
- filename, message);
-
- g_free(message);
- }
-
- seed_context_unref(ctx);
-
- return NULL;
- }
-
- /* now get the global namespace from the context and use it to get the
- * GPlugin entry points.
- */
- global = seed_context_get_global_object(ctx);
- query = seed_object_get_property(ctx, global, "gplugin_query");
- load = seed_object_get_property(ctx, global, "gplugin_load");
- unload = seed_object_get_property(ctx, global, "gplugin_unload");
-
- /* now validate the entry points */
- if(!seed_value_is_function(ctx, query)) {
- if(error) {
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Failed to find the gplugin_query function");
- }
-
- seed_context_unref(ctx);
-
- return NULL;
- }
-
- if(!seed_value_is_function(ctx, load)) {
- if(error) {
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Failed to find the gplugin_load function");
- }
-
- seed_context_unref(ctx);
-
- return NULL;
- }
-
- if(!seed_value_is_function(ctx, unload)) {
- if(error) {
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Failed to find the gplugin_unload function");
- }
-
- seed_context_unref(ctx);
-
- return NULL;
- }
-
- /* now that we have all of our entry points, call the query method to get
- * the PluginInfo.
- */
- sinfo = seed_object_call(ctx, query, NULL, 0, NULL, &exp);
- if(exp != NULL) {
- if(error) {
- gchar *message = seed_exception_get_message(ctx, exp);
-
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Failed to query %s : %s", filename, message);
-
- g_free(message);
- }
-
- seed_context_unref(ctx);
-
- return NULL;
- }
-
- /* now convert the JavaScript PluginInfo into the C version */
- info = GPLUGIN_PLUGIN_INFO(seed_value_to_object(ctx, sinfo, &exp));
- if(exp != NULL) {
- if(error) {
- gchar *message = seed_exception_get_message(ctx, exp);
-
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Failed to query %s : %s", filename, message);
-
- g_free(message);
- }
-
- seed_context_unref(ctx);
-
- return NULL;
- }
-
- /* validate that the info we got is an instance of GPluginPluginInfo */
- if(!GPLUGIN_IS_PLUGIN_INFO(info)) {
- if(error) {
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Plugin %s did not return a PluginInfo",
- filename);
- }
-
- seed_context_unref(ctx);
-
- return NULL;
- }
-
- return g_object_new(GPLUGIN_TYPE_SEED_PLUGIN,
- "filename", filename,
- "loader", loader,
- "info", info,
- "context", ctx,
- "load", load,
- "unload", unload,
- NULL);
-}
-
-static gboolean
-gplugin_seed_loader_load_unload(GPLUGIN_UNUSED GPluginLoader *loader,
- GPluginPlugin *plugin,
- const gchar *function,
- GError **error)
-{
- SeedContext ctx = NULL;
- SeedException exp = NULL;
- SeedObject func = NULL;
- SeedValue args[1];
- SeedValue sret = NULL;
- gboolean ret = FALSE;
-
- g_return_val_if_fail(GPLUGIN_IS_SEED_PLUGIN(plugin), FALSE);
-
- g_object_get(G_OBJECT(plugin),
- "context", &ctx,
- function, &func,
- NULL);
-
- /* make sure we got the context and the function */
- if(ctx == NULL || func == NULL) {
- if(error) {
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Plugin is in an unknown state");
- }
-
- return FALSE;
- }
-
- /* convert the plugin into a SeedObject */
- args[0] = seed_value_from_object(ctx, G_OBJECT(plugin), exp);
- if(exp) {
- if(error) {
- gchar *message = seed_exception_get_message(ctx, exp);
-
- *error = g_error_new(GPLUGIN_DOMAIN, 0, "%s", message);
-
- g_free(message);
- }
-
- return FALSE;
- }
-
- /* now call the function */
- sret = seed_object_call(ctx, func, NULL, 1, args, exp);
- if(exp != NULL) {
- if(error) {
- gchar *message = seed_exception_get_message(ctx, exp);
-
- *error = g_error_new(GPLUGIN_DOMAIN, 0, "%s", message);
-
- g_free(message);
- }
-
- return FALSE;
- }
-
- /* finally check what the plugins function returned */
- ret = seed_value_to_boolean(ctx, sret, &exp);
- if(exp) {
- if(error) {
- gchar *message = seed_exception_get_message(ctx, exp);
-
- *error = g_error_new(GPLUGIN_DOMAIN, 0, "%s", message);
-
- g_free(message);
- }
-
- return FALSE;
- }
-
- return ret;
-}
-
-static gboolean
-gplugin_seed_loader_load(GPluginLoader *loader, GPluginPlugin *plugin,
- GError **error)
-{
- return gplugin_seed_loader_load_unload(loader, plugin, "load", error);
-}
-
-static gboolean
-gplugin_seed_loader_unload(GPluginLoader *loader, GPluginPlugin *plugin,
- GError **error)
-{
- return gplugin_seed_loader_load_unload(loader, plugin, "unload", error);
-}
-
-/******************************************************************************
- * GObject Stuff
- *****************************************************************************/
-static void
-gplugin_seed_loader_class_init(GPluginSeedLoaderClass *klass) {
- GPluginLoaderClass *loader_class = GPLUGIN_LOADER_CLASS(klass);
-
- parent_class = g_type_class_peek_parent(klass);
-
- loader_class->supported_extensions =
- gplugin_seed_loader_class_supported_extensions;
- loader_class->query = gplugin_seed_loader_query;
- loader_class->load = gplugin_seed_loader_load;
- loader_class->unload = gplugin_seed_loader_unload;
-}
-
-/******************************************************************************
- * API
- *****************************************************************************/
-void
-gplugin_seed_loader_register(GPluginNativePlugin *plugin) {
- if(g_once_init_enter(&type_real)) {
- GType type = 0;
-
- static const GTypeInfo info = {
- .class_size = sizeof(GPluginSeedLoaderClass),
- .class_init = (GClassInitFunc)gplugin_seed_loader_class_init,
- .instance_size = sizeof(GPluginSeedLoader),
- };
-
- type = gplugin_native_plugin_register_type(plugin,
- GPLUGIN_TYPE_LOADER,
- "GPluginSeedLoader",
- &info,
- 0);
-
- engine = seed_init(NULL, NULL);
-
- g_once_init_leave(&type_real, type);
- }
-}
-
-GType
-gplugin_seed_loader_get_type(void) {
- if(G_UNLIKELY(type_real == 0)) {
- g_warning("gplugin_seed_loader_get_type was called before "
- "the type was registered!\n");
- }
-
- return type_real;
-}
-
--- a/seed/gplugin-seed-loader.h Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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 of the License, or (at your option) any later version.
- *
- * This library 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, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef GPLUGIN_SEED_LOADER_H
-#define GPLUGIN_SEED_LOADER_H
-
-#define GPLUGIN_TYPE_SEED_LOADER (gplugin_seed_loader_get_type())
-#define GPLUGIN_SEED_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLUGIN_TYPE_SEED_LOADER, GPluginSeedLoader))
-#define GPLUGIN_SEED_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), GPLUGIN_TYPE_SEED_LOADER, GPluginSeedLoaderClass))
-#define GPLUGIN_IS_SEED_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLUGIN_TYPE_SEED_LOADER))
-#define GPLUGIN_IS_SEED_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((obj), GPLUGIN_TYPE_SEED_LOADER))
-#define GPLUGIN_SEED_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GPLUGIN_TYPE_SEED_LOADER, GPluginSeedLoaderClass))
-
-typedef struct _GPluginSeedLoader GPluginSeedLoader;
-typedef struct _GPluginSeedLoaderClass GPluginSeedLoaderClass;
-
-#include <gplugin.h>
-#include <gplugin-native.h>
-
-struct _GPluginSeedLoader {
- GPluginLoader parent;
-
- void (*_gplugin_reserved_1)(void);
- void (*_gplugin_reserved_2)(void);
- void (*_gplugin_reserved_3)(void);
- void (*_gplugin_reserved_4)(void);
-};
-
-struct _GPluginSeedLoaderClass {
- GPluginLoaderClass parent;
-
- void (*_gplugin_reserved_1)(void);
- void (*_gplugin_reserved_2)(void);
- void (*_gplugin_reserved_3)(void);
- void (*_gplugin_reserved_4)(void);
-};
-
-G_BEGIN_DECLS
-
-void gplugin_seed_loader_register(GPluginNativePlugin *plugin);
-GType gplugin_seed_loader_get_type(void);
-
-G_END_DECLS
-
-#endif /* GPLUGIN_SEED_LOADER_H */
-
--- a/seed/gplugin-seed-plugin.c Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +0,0 @@
-/*
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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 of the License, or (at your option) any later version.
- *
- * This library 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include "gplugin-seed-plugin.h"
-
-#include <seed.h>
-
-#define GPLUGIN_SEED_PLUGIN_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), GPLUGIN_TYPE_SEED_PLUGIN, GPluginSeedPluginPrivate))
-
-/******************************************************************************
- * Typedefs
- *****************************************************************************/
-typedef struct {
- SeedContext ctx;
- SeedObject load;
- SeedObject unload;
-} GPluginSeedPluginPrivate;
-
-/******************************************************************************
- * Enums
- *****************************************************************************/
-enum {
- PROP_ZERO,
- PROP_CONTEXT,
- PROP_LOAD,
- PROP_UNLOAD,
- PROP_LAST,
-};
-
-/******************************************************************************
- * Globals
- *****************************************************************************/
-static GObjectClass *parent_class = NULL;
-static GType type_real = 0;
-
-/******************************************************************************
- * Private Stuff
- *****************************************************************************/
-static void
-gplugin_seed_plugin_set_context(GPluginSeedPlugin *plugin, SeedContext ctx) {
- GPluginSeedPluginPrivate *priv = GPLUGIN_SEED_PLUGIN_GET_PRIVATE(plugin);
-
- priv->ctx = ctx;
-}
-
-static void
-gplugin_seed_plugin_set_load(GPluginSeedPlugin *plugin, SeedObject load) {
- GPluginSeedPluginPrivate *priv = GPLUGIN_SEED_PLUGIN_GET_PRIVATE(plugin);
-
- priv->load = load;
-}
-
-static void
-gplugin_seed_plugin_set_unload(GPluginSeedPlugin *plugin, SeedObject unload) {
- GPluginSeedPluginPrivate *priv = GPLUGIN_SEED_PLUGIN_GET_PRIVATE(plugin);
-
- priv->unload = unload;
-}
-
-/******************************************************************************
- * Object Stuff
- *****************************************************************************/
-static void
-gplugin_seed_plugin_get_property(GObject *obj, guint param_id, GValue *value,
- GParamSpec *pspec)
-{
- GPluginSeedPlugin *plugin = GPLUGIN_SEED_PLUGIN(obj);
-
- switch(param_id) {
- case PROP_CONTEXT:
- g_value_set_pointer(value,
- gplugin_seed_plugin_get_context(plugin));
- break;
- case PROP_LOAD:
- g_value_set_pointer(value,
- gplugin_seed_plugin_get_load_func(plugin));
- break;
- case PROP_UNLOAD:
- g_value_set_pointer(value,
- gplugin_seed_plugin_get_unload_func(plugin));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
- break;
- }
-}
-
-static void
-gplugin_seed_plugin_set_property(GObject *obj, guint param_id,
- const GValue *value, GParamSpec *pspec)
-{
- GPluginSeedPlugin *plugin = GPLUGIN_SEED_PLUGIN(obj);
-
- switch(param_id) {
- case PROP_CONTEXT:
- gplugin_seed_plugin_set_context(plugin,
- g_value_get_pointer(value));
- break;
- case PROP_LOAD:
- gplugin_seed_plugin_set_load(plugin,
- g_value_get_pointer(value));
- break;
- case PROP_UNLOAD:
- gplugin_seed_plugin_set_unload(plugin,
- g_value_get_pointer(value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
- break;
- }
-}
-
-static void
-gplugin_seed_plugin_finalize(GObject *obj) {
- GPluginSeedPluginPrivate *priv = GPLUGIN_SEED_PLUGIN_GET_PRIVATE(obj);
-
- if(priv->ctx)
- seed_context_unref(priv->ctx);
-
- G_OBJECT_CLASS(parent_class)->finalize(obj);
-}
-
-static void
-gplugin_seed_plugin_class_init(GPluginSeedPluginClass *klass) {
- GObjectClass *obj_class = G_OBJECT_CLASS(klass);
-
- parent_class = g_type_class_peek_parent(klass);
-
- g_type_class_add_private(klass, sizeof(GPluginSeedPluginPrivate));
-
- obj_class->get_property = gplugin_seed_plugin_get_property;
- obj_class->set_property = gplugin_seed_plugin_set_property;
- obj_class->finalize = gplugin_seed_plugin_finalize;
-
- g_object_class_install_property(obj_class, PROP_CONTEXT,
- g_param_spec_pointer("context", "context",
- "The seed context for the plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
- g_object_class_install_property(obj_class, PROP_LOAD,
- g_param_spec_pointer("load", "load",
- "The load function for the plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
- g_object_class_install_property(obj_class, PROP_UNLOAD,
- g_param_spec_pointer("unload", "unload",
- "The unload function for the plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-}
-
-/******************************************************************************
- * API
- *****************************************************************************/
-void
-gplugin_seed_plugin_register(GPluginNativePlugin *plugin) {
- if(g_once_init_enter(&type_real)) {
- GType type = 0;
-
- static const GTypeInfo info = {
- .class_size = sizeof(GPluginSeedPluginClass),
- .class_init = (GClassInitFunc)gplugin_seed_plugin_class_init,
- .instance_size = sizeof(GPluginSeedPlugin),
- };
-
- type = gplugin_native_plugin_register_type(plugin,
- GPLUGIN_TYPE_PLUGIN,
- "GPluginSeedPlugin",
- &info,
- 0);
-
- g_once_init_leave(&type_real, type);
- }
-}
-
-GType
-gplugin_seed_plugin_get_type(void) {
- if(G_UNLIKELY(type_real == 0)) {
- g_warning("gplugin_seed_plugin_get_type was called before "
- "the type was registered!\n");
- }
-
- return type_real;
-}
-
-SeedContext
-gplugin_seed_plugin_get_context(const GPluginSeedPlugin *plugin) {
- GPluginSeedPluginPrivate *priv = GPLUGIN_SEED_PLUGIN_GET_PRIVATE(plugin);
-
- return priv->ctx;
-}
-
-SeedObject
-gplugin_seed_plugin_get_load_func(const GPluginSeedPlugin *plugin) {
- GPluginSeedPluginPrivate *priv = GPLUGIN_SEED_PLUGIN_GET_PRIVATE(plugin);
-
- return priv->load;
-}
-
-SeedObject
-gplugin_seed_plugin_get_unload_func(const GPluginSeedPlugin *plugin) {
- GPluginSeedPluginPrivate *priv = GPLUGIN_SEED_PLUGIN_GET_PRIVATE(plugin);
-
- return priv->unload;
-}
-
--- a/seed/gplugin-seed-plugin.h Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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 of the License, or (at your option) any later version.
- *
- * This library 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, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef GPLUGIN_SEED_PLUGIN_H
-#define GPLUGIN_SEED_PLUGIN_H
-
-#define GPLUGIN_TYPE_SEED_PLUGIN (gplugin_seed_plugin_get_type())
-#define GPLUGIN_SEED_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLUGIN_TYPE_SEED_PLUGIN, GPluginSeedPlugin))
-#define GPLUGIN_SEED_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), GPLUGIN_TYPE_SEED_PLUGIN, GPluginSeedPluginClass))
-#define GPLUGIN_IS_SEED_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLUGIN_TYPE_SEED_PLUGIN))
-#define GPLUGIN_IS_SEED_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((obj), GPLUGIN_TYPE_SEED_PLUGIN))
-#define GPLUGIN_SEED_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GPLUGIN_TYPE_SEED_PLUGIN, GPluginSeedPluginClass))
-
-typedef struct _GPluginSeedPlugin GPluginSeedPlugin;
-typedef struct _GPluginSeedPluginClass GPluginSeedPluginClass;
-
-#include <gplugin.h>
-#include <gplugin-native.h>
-
-#include <seed.h>
-
-struct _GPluginSeedPlugin {
- GPluginPlugin parent;
-};
-
-struct _GPluginSeedPluginClass {
- GPluginPluginClass parent;
-
- void (*_gplugin_reserved_1)(void);
- void (*_gplugin_reserved_2)(void);
- void (*_gplugin_reserved_3)(void);
- void (*_gplugin_reserved_4)(void);
-};
-
-G_BEGIN_DECLS
-
-void gplugin_seed_plugin_register(GPluginNativePlugin *plugin);
-GType gplugin_seed_plugin_get_type(void);
-
-SeedContext gplugin_seed_plugin_get_context(const GPluginSeedPlugin *plugin);
-SeedObject gplugin_seed_plugin_get_load_func(const GPluginSeedPlugin *plugin);
-SeedObject gplugin_seed_plugin_get_unload_func(const GPluginSeedPlugin *plugin);
-
-G_END_DECLS
-
-#endif /* GPLUGIN_SEED_PLUGIN_H */
-
--- a/seed/tests/CMakeLists.txt Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-if(BUILD_SEED)
-
-macro(add_seed_gtest target)
- add_executable(${target} ${target}.c)
- target_link_libraries(${target}
- ${GLIB_LIBRARIES} ${SEED_LIBRARIES} gplugin
- )
- add_dependencies(${target} gplugin-seed)
-
- get_target_property(_output_name ${target} RUNTIME_OUTPUT_NAME)
- if(NOT ${_output_name})
- get_target_property(_output_name ${target} LOCATION)
- endif(NOT ${_output_name})
-
- list(APPEND SEED_TESTS ${_output_name})
-endmacro(add_seed_gtest)
-
-add_definitions(
- -DSEED_LOADER_DIR="${CMAKE_BINARY_DIR}/seed"
- -DSEED_PLUGIN_DIR="${CMAKE_CURRENT_SOURCE_DIR}/plugins"
-)
-
-add_seed_gtest(test-seed-loader)
-target_link_libraries(test-seed-loader gplugin-loader-tests)
-
-set(GTESTER_SEED_TESTS "${SEED_TESTS}")
-set(GTESTER_SEED_LOG "test-gplugin-seed.xml")
-set(GTESTER_SEED_JUNIT "test-gplugin-seed-junit.xml")
-
-add_custom_command(
- COMMAND ${GTESTER} -k --verbose -o ${GTESTER_SEED_LOG} ${SEED_TESTS}
- OUTPUT ${GTESTER_SEED_LOG}
- DEPENDS gplugin ${GPLUGIN_GIR_TARGETS} gplugin-seed
- ${SEED_TESTS} ${CMAKE_CURRENT_SOURCE_DIR}/plugins
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-add_custom_command(
- COMMAND ${XSLTPROC} -o ${GTESTER_SEED_JUNIT} --nonet
- ${CMAKE_SOURCE_DIR}/xsl/gtester-junit.xsl
- ${GTESTER_SEED_LOG}
- OUTPUT ${GTESTER_SEED_JUNIT}
- DEPENDS ${GTESTER_SEED_LOG}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-add_custom_target(seed-tests ALL
- DEPENDS ${GTESTER_SEED_LOG} ${GTESTER_SEED_JUNIT} ${SEED_TESTS}
-)
-
-endif(BUILD_SEED)
-
--- a/seed/tests/plugins/basic.js Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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 of the License, or (at your option) any later version.
- *
- * This library 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, see <http://www.gnu.org/licenses/>.
- */
-
-var GPlugin = imports.gi.GPlugin;
-
-function gplugin_query() {
- return new GPlugin.PluginInfo({
- id: "gplugin/seed-basic-plugin",
- abi_version: 0x01020304,
- name: "basic plugin",
- authors: ['author1'],
- category: 'test',
- version: 'version',
- license_id: 'license',
- summary: 'summary',
- website: 'website',
- description: 'description'
- });
-};
-
-function gplugin_load(plugin) {
- return true;
-};
-
-function gplugin_unload(plugin) {
- return true;
-};
-
-
--- a/seed/tests/plugins/dependent.js Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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 of the License, or (at your option) any later version.
- *
- * This library 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, see <http://www.gnu.org/licenses/>.
- */
-
-var GPlugin = imports.gi.GPlugin;
-
-function gplugin_query() {
- return new GPlugin.PluginInfo({
- id: "gplugin/seed-dependent-plugin",
- dependencies: ["dependency1", "dependency2"],
- });
-};
-
-function gplugin_load(plugin) {
- return false;
-};
-
-function gplugin_unload(plugin) {
- return false;
-};
-
--- a/seed/tests/plugins/load-exception.js Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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 of the License, or (at your option) any later version.
- *
- * This library 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, see <http://www.gnu.org/licenses/>.
- */
-
-var GPlugin = imports.gi.GPlugin;
-
-function gplugin_query() {
- return new GPlugin.PluginInfo({
- id: "gplugin/seed-load-exception"
- });
-};
-
-function gplugin_load(plugin) {
- throw "boom!";
-};
-
-function gplugin_unload(plugin) {
- return true;
-};
-
--- a/seed/tests/plugins/load-failed.js Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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 of the License, or (at your option) any later version.
- *
- * This library 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, see <http://www.gnu.org/licenses/>.
- */
-
-var GPlugin = imports.gi.GPlugin;
-
-function gplugin_query() {
- return new GPlugin.PluginInfo({
- id: "gplugin/seed-load-failed"
- });
-};
-
-function gplugin_load(plugin) {
- return false;
-};
-
-function gplugin_unload(plugin) {
- return true;
-};
-
--- a/seed/tests/plugins/unload-failed.js Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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 of the License, or (at your option) any later version.
- *
- * This library 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, see <http://www.gnu.org/licenses/>.
- */
-
-var GPlugin = imports.gi.GPlugin;
-
-function gplugin_query() {
- return new GPlugin.PluginInfo({
- id: "gplugin/seed-unload-failed"
- });
-};
-
-function gplugin_load(plugin) {
- return true;
-};
-
-function gplugin_unload(plugin) {
- return false;
-};
-
--- a/seed/tests/test-seed-loader.c Sat Feb 28 19:40:29 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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 of the License, or (at your option) any later version.
- *
- * This library 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glib.h>
-#include <gplugin.h>
-
-#include <gplugin/gplugin-loader-tests.h>
-
-gint
-main(gint argc, gchar **argv) {
- g_test_init(&argc, &argv, NULL);
-
- gplugin_loader_tests_main(SEED_LOADER_DIR, SEED_PLUGIN_DIR, "seed");
-
- return g_test_run();
-}
-