gplugin/gplugin

1dde3157546b
flow: Promoted 'trunk' (7c08161e01dc) to 'feature/osx-fixing'.
--- a/.hgignore Mon Feb 09 14:11:18 2015 -0600
+++ b/.hgignore Thu Mar 05 13:37:42 2015 -0600
@@ -1,5 +1,6 @@
syntax: glob
.*.swp
+*.cookies
*.debhelper
*.orig
*.pyc
--- a/CMakeLists.txt Mon Feb 09 14:11:18 2015 -0600
+++ b/CMakeLists.txt Thu Mar 05 13:37:42 2015 -0600
@@ -11,6 +11,14 @@
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Compatibility)
endif(${CMAKE_VERSION} VERSION_LESS "2.8.3")
+if(${CMAKE_VERSION} VERSION_GREATER "2.8.12")
+ # allow reading of the LOCATION property
+ cmake_policy(SET CMP0026 OLD)
+
+ # don't force target names to match a pattern
+ cmake_policy(SET CMP0037 OLD)
+endif(${CMAKE_VERSION} VERSION_GREATER "2.8.12")
+
###############################################################################
# Project Info
###############################################################################
@@ -18,7 +26,7 @@
set(GPLUGIN_MAJOR_VERSION 0)
set(GPLUGIN_MINOR_VERSION 0)
-set(GPLUGIN_MICRO_VERSION 17)
+set(GPLUGIN_MICRO_VERSION 19)
set(GPLUGIN_EXTRA_VERSION dev)
set(GPLUGIN_VERSION ${GPLUGIN_MAJOR_VERSION}.${GPLUGIN_MINOR_VERSION}.${GPLUGIN_MICRO_VERSION}${GPLUGIN_EXTRA_VERSION})
@@ -142,7 +150,7 @@
-std=c99
-g -g3
-DPREFIX="${CMAKE_INSTALL_PREFIX}"
- -DGPLUGIN_WEBSITE="http://bitbucket.org/rw_grim/gplugin/"
+ -DGPLUGIN_WEBSITE="http://bitbucket.org/gplugin/main"
-Wall
-Werror=format-security
-Wformat
@@ -181,11 +189,9 @@
add_subdirectory(plugins)
add_subdirectory(po)
-add_subdirectory(gjs)
add_subdirectory(lua)
add_subdirectory(perl)
add_subdirectory(python)
-add_subdirectory(seed)
###############################################################################
# Install stuff
@@ -193,3 +199,34 @@
# documentation
install(FILES ChangeLog INSTALL README HACKING DESTINATION share/doc/gplugin)
+###############################################################################
+# make dist
+###############################################################################
+set(ARCHIVES
+ gplugin-${GPLUGIN_VERSION}.tar.bz2
+ gplugin-${GPLUGIN_VERSION}.tar.gz
+ gplugin-${GPLUGIN_VERSION}.zip
+)
+
+set(SIGNATURES)
+
+foreach(ARCHIVE ${ARCHIVES})
+ add_custom_command(
+ COMMAND hg archive ${ARCHIVE}
+ OUTPUT ${ARCHIVE}
+ DEPENDS .
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ )
+
+ add_custom_command(
+ COMMAND gpg --yes -abs ${ARCHIVE}
+ OUTPUT ${ARCHIVE}.asc
+ DEPENDS . ${ARCHIVE}
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ )
+
+ list(APPEND SIGNATURES ${ARCHIVE}.asc)
+endforeach(ARCHIVE)
+
+add_custom_target(dist DEPENDS ${ARCHIVES} ${SIGNATURES})
+
--- a/ChangeLog Mon Feb 09 14:11:18 2015 -0600
+++ b/ChangeLog Thu Mar 05 13:37:42 2015 -0600
@@ -1,4 +1,14 @@
-0.0.17:
+0.0.19:
+ * Add debug packages to the Debian packaging
+ * Add libgplugin-loaders package to the Debian packaging
+ * Removed the Seed JavaScript loader (issue #63)
+ * Removed the GNOME JavaScript loader (issue #64)
+ * Fixed crash in gplugin-gtk-viewer (issue #25)
+
+0.0.18: 2015/02/22
+ * Add a dist target to build and sign source archives
+
+0.0.17: 2014/12/12
* Finished the gjs loader.
* Relicensed to LGPL2.
* Created the Debian packaging.
--- a/HACKING Mon Feb 09 14:11:18 2015 -0600
+++ b/HACKING Thu Mar 05 13:37:42 2015 -0600
@@ -7,7 +7,7 @@
fixes. When a release is deemed done, it's merged back into develop and into
default. hgflow takes care of all of this for us.
-To add a feature please fork https://bitbucket.org/rw_grim/gplugin. Then clone
+To add a feature please fork https://bitbucket.org/gplugin/main. Then clone
your fork. Once you have your fork cloned and hgflow setup and installed, type
hg flow feature start $NAME_OF_YOUR_FEATURE$
--- a/INSTALL Mon Feb 09 14:11:18 2015 -0600
+++ b/INSTALL Thu Mar 05 13:37:42 2015 -0600
@@ -11,7 +11,6 @@
gtk-3
python3-dev, python-gi-dev, python3-gi
liblua5.1-0-dev, lua-lgi
- libseed-gtk3-dev
xsltproc
All of these packages and their development headers need to be installed
@@ -19,7 +18,7 @@
Building
========
-GPlugin uses CMake (http://www.cmake.org) as it's build system. As such
+GPlugin uses CMake (http://www.cmake.org) as its build system. As such
compiling is a little bit different than your typical ./configure, make,
sudo make install. But luckily for you, not too much different.
--- a/gjs/CMakeLists.txt Mon Feb 09 14:11:18 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-option(
- BUILD_GJS
- "Whether or not to build the GJS JavaScript plugin loader"
- "On"
-)
-
-if(BUILD_GJS)
- set(GPLUGIN_GJS_SOURCES
- gplugin-gjs-core.c
- gplugin-gjs-loader.c
- gplugin-gjs-plugin.c
- )
-
- set(GPLUGIN_GJS_HEADERS
- gplugin-gjs-loader.h
- gplugin-gjs-plugin.h
- )
-
- pkg_check_modules(GJS REQUIRED gjs-1.0>=1.32.0)
- add_library(gplugin-gjs MODULE
- ${GPLUGIN_GJS_SOURCES}
- ${GPLUGIN_GJS_HEADERS}
- )
- set_target_properties(gplugin-gjs PROPERTIES PREFIX "")
-
- include_directories(${GJS_INCLUDE_DIRS})
- target_link_libraries(gplugin-gjs
- ${GJS_LIBRARIES}
- gplugin
- )
-
- install(TARGETS gplugin-gjs DESTINATION lib/gplugin)
-endif(BUILD_GJS)
-
-if(TESTING_ENABLED)
- add_subdirectory(tests)
-endif(TESTING_ENABLED)
-
--- a/gjs/gplugin-gjs-core.c Mon Feb 09 14:11:18 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-gjs-loader.h"
-#include "gplugin-gjs-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/gjs-loader",
- GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
- "internal", TRUE,
- "load-on-query", TRUE,
- "name", "Gjs JavaScript Plugin Loader",
- "version", GPLUGIN_VERSION,
- "license-id", "GPL3",
- "summary", "A plugin that can load Gjs JavaScript plugins",
- "description", "This plugin allows the loading of plugins written in "
- "Gjs JavaScript.",
- "authors", authors,
- "website", GPLUGIN_WEBSITE,
- "category", "loaders",
- NULL
- );
-}
-
-G_MODULE_EXPORT gboolean
-gplugin_load(GPluginNativePlugin *plugin,
- GPLUGIN_UNUSED GError **error)
-{
- gplugin_gjs_loader_register(plugin);
- gplugin_gjs_plugin_register(plugin);
-
- gplugin_manager_register_loader(gplugin_gjs_loader_get_type());
-
- return TRUE;
-}
-
-G_MODULE_EXPORT gboolean
-gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin,
- GPLUGIN_UNUSED GError **error)
-{
- return FALSE;
-}
-
--- a/gjs/gplugin-gjs-loader.c Mon Feb 09 14:11:18 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,277 +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-gjs-loader.h"
-#include "gplugin-gjs-plugin.h"
-
-#include <glib/gi18n.h>
-
-#include <gjs/gjs-module.h>
-#include <gi/object.h>
-
-/******************************************************************************
- * Globals
- *****************************************************************************/
-static GObjectClass *parent_class = NULL;
-static GType type_real = 0;
-
-/******************************************************************************
- * Helpers
- *****************************************************************************/
-static JSFunction *
-gplugin_gjs_loader_find_function(JSContext *jsctx, JSObject *parent,
- const gchar *name, GError **error)
-{
- jsval value;
-
- if(!JS_GetProperty(jsctx, parent, name, &value)) {
- if(error) {
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Failed to find the function '%s'", name);
- }
-
- return NULL;
- }
-
- if(!JSVAL_IS_OBJECT(value) || JSVAL_IS_NULL(value)) {
- if(error) {
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "'%s' is not a function", name);
- }
-
- return NULL;
- }
-
- return JS_ValueToFunction(jsctx, value);
-}
-
-/******************************************************************************
- * GPluginLoaderInterface API
- *****************************************************************************/
-static GSList *
-gplugin_gjs_loader_class_supported_extensions(GPLUGIN_UNUSED const GPluginLoaderClass *klass) {
- return g_slist_append(NULL, "js");
-}
-
-static GPluginPlugin *
-gplugin_gjs_loader_query(GPluginLoader *loader,
- const gchar *filename,
- GError **error)
-{
- GObject *gobj = NULL;
- GPluginPluginInfo *info = NULL;
- GjsContext *context = NULL;
- JSContext *jsctx = NULL;
- JSObject *global = NULL, *jsobj = NULL;
- JSFunction *query = NULL;
- jsval value;
-
- context = gjs_context_new();
-
- if(!gjs_context_eval_file(context, filename, NULL, error)) {
- g_object_unref(G_OBJECT(context));
-
- return NULL;
- }
-
- jsctx = gjs_context_get_native_context(context);
- global = JS_GetGlobalObject(jsctx);
-
- /* find the query function */
- query = gplugin_gjs_loader_find_function(jsctx, global, "gplugin_query",
- error);
- if(query == NULL) {
- g_object_unref(G_OBJECT(context));
-
- return NULL;
- }
-
- /* now call the query function */
- if(!JS_CallFunction(jsctx, global, query, 0, NULL, &value)) {
- if(error) {
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Failed to call the query function");
- }
-
- g_object_unref(G_OBJECT(context));
-
- return NULL;
- }
-
- /* now grab the plugin info */
- if(!JS_ValueToObject(jsctx, value, &jsobj)) {
- if(error) {
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Query function did not return a GObject");
- }
-
- g_object_unref(G_OBJECT(context));
-
- return NULL;
- }
-
- gobj = gjs_g_object_from_object(jsctx, jsobj);
- if(!GPLUGIN_IS_PLUGIN_INFO(gobj)) {
- if(error) {
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Query function did not return a "
- "GPluginPluginInfo object");
- }
-
- g_object_unref(G_OBJECT(context));
-
- return NULL;
- }
-
- info = GPLUGIN_PLUGIN_INFO(gobj);
-
- return g_object_new(GPLUGIN_TYPE_GJS_PLUGIN,
- "filename", filename,
- "loader", loader,
- "info", info,
- "context", context,
- "js-context", jsctx,
- "global", global,
- NULL);
-}
-
-static gboolean
-gplugin_gjs_loader_load_unload(GPLUGIN_UNUSED GPluginLoader *loader,
- GPluginPlugin *plugin,
- gboolean load,
- GPLUGIN_UNUSED GError **error)
-{
- JSContext *jsctx = NULL;
- JSFunction *func = NULL;
- JSObject *global = NULL, *js_plugin = NULL;
- JSBool ret = FALSE;
- jsval args[1];
- jsval rval;
- const gchar *func_name = (load) ? "gplugin_load" : "gplugin_unload";
- gchar *filename = NULL;
-
- g_object_get(G_OBJECT(plugin),
- "js-context", &jsctx,
- "global", &global,
- "filename", &filename,
- NULL);
-
- func = gplugin_gjs_loader_find_function(jsctx, global, func_name, error);
- if(func == NULL) {
- g_free(filename);
-
- return FALSE;
- }
-
- js_plugin = gjs_object_from_g_object(jsctx, G_OBJECT(plugin));
-
- args[0] = OBJECT_TO_JSVAL(js_plugin);
-
- if(!JS_CallFunction(jsctx, global, func, 1, args, &rval)) {
- if(error) {
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Failed to %s %s",
- (load) ? "load" : "unload", filename);
- }
-
- g_free(filename);
-
- return FALSE;
- }
-
- ret = JSVAL_TO_BOOLEAN(rval);
- if(!ret) {
- if(error) {
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- "Failed to %s %s",
- (load) ? "load" : "unload", filename);
- }
-
- g_free(filename);
-
- return FALSE;
- }
-
- g_free(filename);
-
- return TRUE;
-}
-
-static gboolean
-gplugin_gjs_loader_load(GPluginLoader *loader, GPluginPlugin *plugin,
- GError **error)
-{
- return gplugin_gjs_loader_load_unload(loader, plugin, TRUE, error);
-}
-
-static gboolean
-gplugin_gjs_loader_unload(GPluginLoader *loader, GPluginPlugin *plugin,
- GError **error)
-{
- return gplugin_gjs_loader_load_unload(loader, plugin, FALSE, error);
-}
-
-/******************************************************************************
- * GObject Stuff
- *****************************************************************************/
-static void
-gplugin_gjs_loader_class_init(GPluginGjsLoaderClass *klass) {
- GPluginLoaderClass *loader_class = GPLUGIN_LOADER_CLASS(klass);
-
- parent_class = g_type_class_peek_parent(klass);
-
- loader_class->supported_extensions =
- gplugin_gjs_loader_class_supported_extensions;
- loader_class->query = gplugin_gjs_loader_query;
- loader_class->load = gplugin_gjs_loader_load;
- loader_class->unload = gplugin_gjs_loader_unload;
-}
-
-/******************************************************************************
- * API
- *****************************************************************************/
-void
-gplugin_gjs_loader_register(GPluginNativePlugin *plugin) {
- if(g_once_init_enter(&type_real)) {
- GType type = 0;
-
- static const GTypeInfo info = {
- .class_size = sizeof(GPluginGjsLoaderClass),
- .class_init = (GClassInitFunc)gplugin_gjs_loader_class_init,
- .instance_size = sizeof(GPluginGjsLoader),
- };
-
- type = gplugin_native_plugin_register_type(plugin,
- GPLUGIN_TYPE_LOADER,
- "GPluginGjsLoader",
- &info,
- 0);
-
- g_once_init_leave(&type_real, type);
- }
-}
-
-GType
-gplugin_gjs_loader_get_type(void) {
- if(G_UNLIKELY(type_real == 0)) {
- g_warning("gplugin_gjs_loader_get_type was called before "
- "the type was registered!\n");
- }
-
- return type_real;
-}
-
--- a/gjs/gplugin-gjs-loader.h Mon Feb 09 14:11:18 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_GJS_LOADER_H
-#define GPLUGIN_GJS_LOADER_H
-
-#define GPLUGIN_TYPE_GJS_LOADER (gplugin_gjs_loader_get_type())
-#define GPLUGIN_GJS_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLUGIN_TYPE_GJS_LOADER, GPluginGjsLoader))
-#define GPLUGIN_GJS_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), GPLUGIN_TYPE_GJS_LOADER, GPluginGjsLoaderClass))
-#define GPLUGIN_IS_GJS_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLUGIN_TYPE_GJS_LOADER))
-#define GPLUGIN_IS_GJS_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((obj), GPLUGIN_TYPE_GJS_LOADER))
-#define GPLUGIN_GJS_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GPLUGIN_TYPE_GJS_LOADER, GPluginGjsLoaderClass))
-
-typedef struct _GPluginGjsLoader GPluginGjsLoader;
-typedef struct _GPluginGjsLoaderClass GPluginGjsLoaderClass;
-
-#include <gplugin.h>
-#include <gplugin-native.h>
-
-struct _GPluginGjsLoader {
- GPluginLoader parent;
-
- void (*_gplugin_reserved_1)(void);
- void (*_gplugin_reserved_2)(void);
- void (*_gplugin_reserved_3)(void);
- void (*_gplugin_reserved_4)(void);
-};
-
-struct _GPluginGjsLoaderClass {
- 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_gjs_loader_register(GPluginNativePlugin *plugin);
-GType gplugin_gjs_loader_get_type(void);
-
-G_END_DECLS
-
-#endif /* GPLUGIN_GJS_LOADER_H */
-
--- a/gjs/gplugin-gjs-plugin.c Mon Feb 09 14:11:18 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,236 +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-gjs-plugin.h"
-
-#define GPLUGIN_GJS_PLUGIN_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), GPLUGIN_TYPE_GJS_PLUGIN, GPluginGjsPluginPrivate))
-
-/******************************************************************************
- * Typedefs
- *****************************************************************************/
-typedef struct {
- GjsContext *context;
- JSObject *global;
- JSContext *js_context;
-} GPluginGjsPluginPrivate;
-
-/******************************************************************************
- * Enums
- *****************************************************************************/
-enum {
- PROP_ZERO,
- PROP_CONTEXT,
- PROP_GLOBAL,
- PROP_JS_CONTEXT,
- PROP_LAST,
-};
-
-/******************************************************************************
- * Globals
- *****************************************************************************/
-static GObjectClass *parent_class = NULL;
-static GType type_real = 0;
-
-/******************************************************************************
- * Private Stuff
- *****************************************************************************/
-static void
-gplugin_gjs_plugin_set_context(GPluginGjsPlugin *plugin, GjsContext *context) {
- GPluginGjsPluginPrivate *priv = GPLUGIN_GJS_PLUGIN_GET_PRIVATE(plugin);
-
- if(priv->context)
- g_object_unref(G_OBJECT(priv->context));
-
- priv->context = GJS_IS_CONTEXT(context) ? g_object_ref(G_OBJECT(context)) :
- NULL;
-}
-
-static void
-gplugin_gjs_plugin_set_global_scope(GPluginGjsPlugin *plugin, JSObject *global) {
- GPluginGjsPluginPrivate *priv = GPLUGIN_GJS_PLUGIN_GET_PRIVATE(plugin);
-
- priv->global = global;
-}
-
-static void
-gplugin_gjs_plugin_set_js_context(GPluginGjsPlugin *plugin, JSContext *jsctx) {
- GPluginGjsPluginPrivate *priv = GPLUGIN_GJS_PLUGIN_GET_PRIVATE(plugin);
-
- priv->js_context = jsctx;
-}
-
-/******************************************************************************
- * Object Stuff
- *****************************************************************************/
-static void
-gplugin_gjs_plugin_get_property(GObject *obj, guint param_id, GValue *value,
- GParamSpec *pspec)
-{
- GPluginGjsPlugin *plugin = GPLUGIN_GJS_PLUGIN(obj);
-
- switch(param_id) {
- case PROP_CONTEXT:
- g_value_set_object(value, gplugin_gjs_plugin_get_context(plugin));
- break;
- case PROP_GLOBAL:
- g_value_set_pointer(value,
- gplugin_gjs_plugin_get_global_scope(plugin));
- break;
- case PROP_JS_CONTEXT:
- g_value_set_pointer(value,
- gplugin_gjs_plugin_get_js_context(plugin));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
- break;
- }
-}
-
-static void
-gplugin_gjs_plugin_set_property(GObject *obj, guint param_id,
- const GValue *value, GParamSpec *pspec)
-{
- GPluginGjsPlugin *plugin = GPLUGIN_GJS_PLUGIN(obj);
-
- switch(param_id) {
- case PROP_CONTEXT:
- gplugin_gjs_plugin_set_context(plugin, g_value_get_object(value));
- break;
- case PROP_GLOBAL:
- gplugin_gjs_plugin_set_global_scope(plugin,
- g_value_get_pointer(value));
- break;
- case PROP_JS_CONTEXT:
- gplugin_gjs_plugin_set_js_context(plugin,
- g_value_get_pointer(value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
- break;
- }
-}
-
-static void
-gplugin_gjs_plugin_finalize(GObject *obj) {
- GPluginGjsPluginPrivate *priv = GPLUGIN_GJS_PLUGIN_GET_PRIVATE(obj);
-
- if(priv->context)
- g_object_unref(G_OBJECT(priv->context));
-
- G_OBJECT_CLASS(parent_class)->finalize(obj);
-}
-
-static void
-gplugin_gjs_plugin_class_init(GPluginGjsPluginClass *klass) {
- GObjectClass *obj_class = G_OBJECT_CLASS(klass);
-
- parent_class = g_type_class_peek_parent(klass);
-
- g_type_class_add_private(klass, sizeof(GPluginGjsPluginPrivate));
-
- obj_class->get_property = gplugin_gjs_plugin_get_property;
- obj_class->set_property = gplugin_gjs_plugin_set_property;
- obj_class->finalize = gplugin_gjs_plugin_finalize;
-
- g_object_class_install_property(obj_class, PROP_CONTEXT,
- g_param_spec_object("context", "context",
- "The Gjs Context for this plugin",
- GJS_TYPE_CONTEXT,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS));
-
- g_object_class_install_property(obj_class, PROP_GLOBAL,
- g_param_spec_pointer("global", "global",
- "The global scope for this plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS));
-
- g_object_class_install_property(obj_class, PROP_JS_CONTEXT,
- g_param_spec_pointer("js-context", "js-context",
- "The JSContext function for this plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS));
-}
-
-/******************************************************************************
- * API
- *****************************************************************************/
-void
-gplugin_gjs_plugin_register(GPluginNativePlugin *plugin) {
- if(g_once_init_enter(&type_real)) {
- GType type = 0;
-
- static const GTypeInfo info = {
- .class_size = sizeof(GPluginGjsPluginClass),
- .class_init = (GClassInitFunc)gplugin_gjs_plugin_class_init,
- .instance_size = sizeof(GPluginGjsPlugin),
- };
-
- type = gplugin_native_plugin_register_type(plugin,
- GPLUGIN_TYPE_PLUGIN,
- "GPluginGjsPlugin",
- &info,
- 0);
-
- g_once_init_leave(&type_real, type);
- }
-}
-
-GType
-gplugin_gjs_plugin_get_type(void) {
- if(G_UNLIKELY(type_real == 0)) {
- g_warning("gplugin_gjs_plugin_get_type was called before "
- "the type was registered!\n");
- }
-
- return type_real;
-}
-
-GjsContext *
-gplugin_gjs_plugin_get_context(const GPluginGjsPlugin *plugin) {
- GPluginGjsPluginPrivate *priv = NULL;
-
- g_return_val_if_fail(GPLUGIN_IS_GJS_PLUGIN(plugin), NULL);
-
- priv = GPLUGIN_GJS_PLUGIN_GET_PRIVATE(plugin);
-
- return priv->context;
-}
-
-JSObject *
-gplugin_gjs_plugin_get_global_scope(const GPluginGjsPlugin *plugin) {
- GPluginGjsPluginPrivate *priv = NULL;
-
- g_return_val_if_fail(GPLUGIN_IS_GJS_PLUGIN(plugin), NULL);
-
- priv = GPLUGIN_GJS_PLUGIN_GET_PRIVATE(plugin);
-
- return priv->global;
-}
-
-JSContext *
-gplugin_gjs_plugin_get_js_context(const GPluginGjsPlugin *plugin) {
- GPluginGjsPluginPrivate *priv = NULL;
-
- g_return_val_if_fail(GPLUGIN_IS_GJS_PLUGIN(plugin), NULL);
-
- priv = GPLUGIN_GJS_PLUGIN_GET_PRIVATE(plugin);
-
- return priv->js_context;
-}
-
--- a/gjs/gplugin-gjs-plugin.h Mon Feb 09 14:11:18 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_GJS_PLUGIN_H
-#define GPLUGIN_GJS_PLUGIN_H
-
-#define GPLUGIN_TYPE_GJS_PLUGIN (gplugin_gjs_plugin_get_type())
-#define GPLUGIN_GJS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLUGIN_TYPE_GJS_PLUGIN, GPluginGjsPlugin))
-#define GPLUGIN_GJS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), GPLUGIN_TYPE_GJS_PLUGIN, GPluginGjsPluginClass))
-#define GPLUGIN_IS_GJS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLUGIN_TYPE_GJS_PLUGIN))
-#define GPLUGIN_IS_GJS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((obj), GPLUGIN_TYPE_GJS_PLUGIN))
-#define GPLUGIN_GJS_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GPLUGIN_TYPE_GJS_PLUGIN, GPluginGjsPluginClass))
-
-typedef struct _GPluginGjsPlugin GPluginGjsPlugin;
-typedef struct _GPluginGjsPluginClass GPluginGjsPluginClass;
-
-#include <gplugin.h>
-#include <gplugin-native.h>
-
-#include <gjs/gjs-module.h>
-
-struct _GPluginGjsPlugin {
- GPluginPlugin parent;
-};
-
-struct _GPluginGjsPluginClass {
- 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_gjs_plugin_register(GPluginNativePlugin *plugin);
-GType gplugin_gjs_plugin_get_type(void);
-
-GjsContext *gplugin_gjs_plugin_get_context(const GPluginGjsPlugin *plugin);
-JSObject *gplugin_gjs_plugin_get_global_scope(const GPluginGjsPlugin *plugin);
-JSContext *gplugin_gjs_plugin_get_js_context(const GPluginGjsPlugin *plugin);
-
-G_END_DECLS
-
-#endif /* GPLUGIN_GJS_PLUGIN_H */
-
--- a/gjs/tests/CMakeLists.txt Mon Feb 09 14:11:18 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-if(BUILD_GJS)
-
-macro(add_gjs_gtest target)
- add_executable(${target} ${target}.c)
- target_link_libraries(${target}
- ${GLIB_LIBRARIES} ${GJS_LIBRARIES} gplugin
- )
- add_dependencies(${target} gplugin-gjs)
-
- 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 GJS_TESTS ${_output_name})
-endmacro(add_gjs_gtest)
-
-add_definitions(
- -DGJS_LOADER_DIR="${CMAKE_BINARY_DIR}/gjs"
- -DGJS_PLUGIN_DIR="${CMAKE_CURRENT_SOURCE_DIR}/plugins"
-)
-
-add_gjs_gtest(test-gjs-loader)
-target_link_libraries(test-gjs-loader gplugin-loader-tests)
-
-set(GTESTER_GJS_TESTS "${GJS_TESTS}")
-set(GTESTER_GJS_LOG "test-gplugin-gjs.xml")
-set(GTESTER_GJS_JUNIT "test-gplugin-gjs-junit.xml")
-
-add_custom_command(
- COMMAND ${GTESTER} -k --verbose -o ${GTESTER_GJS_LOG} ${GJS_TESTS}
- OUTPUT ${GTESTER_GJS_LOG}
- DEPENDS gplugin gplugin-gjs
- ${GJS_TESTS} ${CMAKE_CURRENT_SOURCE_DIR}/plugins
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-add_custom_command(
- COMMAND ${XSLTPROC} -o ${GTESTER_GJS_JUNIT} --nonet
- ${CMAKE_SOURCE_DIR}/xsl/gtester-junit.xsl
- ${GTESTER_GJS_LOG}
- OUTPUT ${GTESTER_GJS_JUNIT}
- DEPENDS ${GTESTER_GJS_LOG}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-add_custom_target(gjs-tests ALL
- DEPENDS ${GTESTER_GJS_LOG} ${GTESTER_GJS_JUNIT} ${GJS_TESTS}
-)
-
-endif(BUILD_GJS)
-
--- a/gjs/tests/plugins/basic.js Mon Feb 09 14:11:18 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/>.
- */
-
-const GPlugin = imports.gi.GPlugin;
-
-function gplugin_query() {
- return new GPlugin.PluginInfo({
- id: "gplugin/gjs-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/gjs/tests/plugins/dependent.js Mon Feb 09 14:11:18 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/>.
- */
-
-const GPlugin = imports.gi.GPlugin;
-
-function gplugin_query() {
- return new GPlugin.PluginInfo({
- id: "gplugin/gjs-dependent-plugin",
- dependencies: ["dependency1", "dependency2"],
- });
-};
-
-function gplugin_load(plugin) {
- return false;
-};
-
-function gplugin_unload(plugin) {
- return false;
-};
-
--- a/gjs/tests/plugins/load-exception.js Mon Feb 09 14:11:18 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/>.
- */
-
-const GPlugin = imports.gi.GPlugin;
-
-function gplugin_query() {
- return new GPlugin.PluginInfo({
- id: "gplugin/gjs-load-exception"
- });
-};
-
-function gplugin_load(plugin) {
- throw "boom!";
-};
-
-function gplugin_unload(plugin) {
- return true;
-};
-
--- a/gjs/tests/plugins/load-failed.js Mon Feb 09 14:11:18 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/>.
- */
-
-const GPlugin = imports.gi.GPlugin;
-
-function gplugin_query() {
- return new GPlugin.PluginInfo({
- id: "gplugin/gjs-load-failed"
- });
-};
-
-function gplugin_load(plugin) {
- return false;
-};
-
-function gplugin_unload(plugin) {
- return true;
-};
-
--- a/gjs/tests/plugins/unload-failed.js Mon Feb 09 14:11:18 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/>.
- */
-
-const GPlugin = imports.gi.GPlugin;
-
-function gplugin_query() {
- return new GPlugin.PluginInfo({
- id: "gplugin/gjs-unload-failed"
- });
-};
-
-function gplugin_load(plugin) {
- return true;
-};
-
-function gplugin_unload(plugin) {
- return false;
-};
-
--- a/gjs/tests/test-gjs-loader.c Mon Feb 09 14:11:18 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(GJS_LOADER_DIR, GJS_PLUGIN_DIR, "gjs");
-
- return g_test_run();
-}
-
--- a/gplugin-gtk/gplugin-gtk-plugin-info.c Mon Feb 09 14:11:18 2015 -0600
+++ b/gplugin-gtk/gplugin-gtk-plugin-info.c Thu Mar 05 13:37:42 2015 -0600
@@ -84,14 +84,14 @@
GPluginPluginInfo *plugin_info = gplugin_plugin_get_info(plugin);
GPluginLoader *plugin_loader = gplugin_plugin_get_loader(plugin);
- if(GPLUGIN_IS_LOADER(plugin_loader)) {
+ filename = gplugin_plugin_get_filename(plugin);
+
+ if(plugin_loader && GPLUGIN_IS_LOADER(plugin_loader)) {
const char *loader_name = G_OBJECT_TYPE_NAME(plugin_loader);
loader = g_strdup(loader_name);
g_object_unref(G_OBJECT(plugin_loader));
}
- filename = gplugin_plugin_get_filename(plugin);
-
g_object_get(G_OBJECT(plugin_info),
"abi_version", &abi_version_uint,
"authors", &authors,
@@ -139,7 +139,8 @@
for(i = 0; authors[i]; i++) {
widget = gtk_label_new(authors[i]);
- gtk_misc_set_alignment(GTK_MISC(widget), 0.0f, 0.0f);
+ gtk_widget_set_halign(widget, GTK_ALIGN_START);
+ gtk_widget_set_valign(widget, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(authors_grid), widget, 0, i, 1, 1);
gtk_widget_show(widget);
}
@@ -309,7 +310,7 @@
priv = GPLUGIN_GTK_PLUGIN_INFO_GET_PRIVATE(info);
- if(priv->plugin)
+ if(GPLUGIN_IS_PLUGIN(priv->plugin))
g_object_unref(G_OBJECT(priv->plugin));
if(GPLUGIN_IS_PLUGIN(plugin))
--- a/gplugin/gplugin-plugin.c Mon Feb 09 14:11:18 2015 -0600
+++ b/gplugin/gplugin-plugin.c Thu Mar 05 13:37:42 2015 -0600
@@ -130,10 +130,10 @@
g_value_set_string(value, gplugin_plugin_get_filename(plugin));
break;
case PROP_LOADER:
- g_value_set_object(value, gplugin_plugin_get_loader(plugin));
+ g_value_take_object(value, gplugin_plugin_get_loader(plugin));
break;
case PROP_INFO:
- g_value_set_object(value, gplugin_plugin_get_info(plugin));
+ g_value_take_object(value, gplugin_plugin_get_info(plugin));
break;
case PROP_STATE:
g_value_set_enum(value, gplugin_plugin_get_state(plugin));
@@ -306,7 +306,7 @@
* gplugin_plugin_get_loader:
* @plugin: #GPluginPlugin instance
*
- * Return Value: (transfer none): The #GPluginLoader that loaded @plugin
+ * Return Value: (transfer full): The #GPluginLoader that loaded @plugin
*/
GPluginLoader *
gplugin_plugin_get_loader(const GPluginPlugin *plugin) {
@@ -316,7 +316,7 @@
priv = GPLUGIN_PLUGIN_GET_PRIVATE(plugin);
- return priv->loader;
+ return (priv->info) ? g_object_ref(G_OBJECT(priv->loader)) : NULL;
}
/**
--- a/packaging/debian/changelog Mon Feb 09 14:11:18 2015 -0600
+++ b/packaging/debian/changelog Thu Mar 05 13:37:42 2015 -0600
@@ -1,4 +1,4 @@
-gplugin (0.0.17) UNRELEASED; urgency=medium
+gplugin (0.0.18) UNRELEASED; urgency=medium
* Initial release.
--- a/packaging/debian/control Mon Feb 09 14:11:18 2015 -0600
+++ b/packaging/debian/control Thu Mar 05 13:37:42 2015 -0600
@@ -6,17 +6,16 @@
xsltproc, gettext, help2man,
gobject-introspection, libgirepository1.0-dev,
libluajit-5.1-dev, lua-lgi,
- libseed-gtk3-dev,
- python3-dev, python-gi-dev, python3-gi,
- libgjs-dev
-Homepage: https://bitbucket.org/rw_grim/gplugin
-Vcs-Browser: https://bitbucket.org/rw_grim/gplugin/src
-Vcs-Hg: https://bitbucket.org/rw_grim/gplugin
-Standards-Version: 3.9.5
+ python3-dev, python-gi-dev, python3-gi
+Homepage: https://bitbucket.org/gplugin/main
+Vcs-Browser: https://bitbucket.org/gplugin/main/src
+Vcs-Hg: https://bitbucket.org/gplugin/main
+Standards-Version: 3.9.6
Package: libgplugin0
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, libglib-2.0
+Recommends: libgplugin-loaders
Description: GObject based plugin library
GPlugin is a GObject based library that implements a reusable plugin system
which supports loading plugins in other languages via loaders. It relies
@@ -24,17 +23,41 @@
.
This package contains the main library.
+Package: libgplugin0-dbg
+Architecture: any
+Section: debug
+Priority: extra
+Depends: ${misc:Depends}, libgplugin0 (= ${binary:Version})
+Description: debugging symbols for libgplugin0
+ GPlugin is a GObject based library that implements a reusable plugin system
+ which supports loading plugins in other languages via loaders. It relies
+ heavily on GObjectIntrospection to expose its API to the other languages.
+ .
+ This package contains the debugging symbols for libgplugin0.
+
Package: libgplugin-dev
Architecture: any
Section: libdevel
Depends: ${misc:Depends}, libgplugin0 (= ${binary:Version}), libglib2.0-dev
-Description: Development filesfor libgplugin
+Description: Development files for libgplugin
GPlugin is a GObject based library that implements a reusable plugin system
which supports loading plugins in other languages via loaders. It relies
heavily on GObjectIntrospection to expose its API to the other languages.
.
This package includes the files used for development against libgplugin.
+Package: libgplugin-loaders
+Architecture: all
+Depends: ${misc:Depends}, ${shlibs:Depends},
+ libgplugin-lua,
+ libgplugin-python
+Description: metapackage for all gplugin loaders
+ GPlugin is a GObject based library that implements a reusable plugin system
+ which supports loading plugins in other languages via loaders. It relies
+ heavily on GObjectIntrospection to expose its API to the other languages.
+ .
+ This package will install all of the gplugin loaders.
+
Package: libgplugin-gtk0
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, libgtk-3-0, libgplugin0
@@ -45,6 +68,18 @@
.
This library provides some default GTK+-3 widgets for GPlugin.
+Package: libgplugin-gtk0-dbg
+Architecture: any
+Section: debug
+Priority: extra
+Depends: ${misc:Depends}, libgplugin-gtk0 (= ${binary:Version})
+Description: debugging symbols for libgplugin-gtk0
+ GPlugin is a GObject based library that implements a reusable plugin system
+ which supports loading plugins in other languages via loaders. It relies
+ heavily on GObjectIntrospection to expose its API to the other languages.
+ .
+ This library provides the debugging symbols for libgplugin-gtk0
+
Package: libgplugin-gtk-dev
Architecture: any
Section: libdevel
@@ -103,27 +138,3 @@
This package allows GPlugin to load plugin written in the Python programming
language.
-Package: libgplugin-seed
-Architecture: any
-Depends: ${misc:Depends}, ${shlibs:Depends}, libseed-gtk3-0,
- libgplugin0, gir1.2-gplugin-0.0
-Description: GPlugin Seed JavaScript Loader
- GPlugin is a GObject based library that implements a reusable plugin system
- which supports loading plugins in other languages via loaders. It relies
- heavily on GObjectIntrospection to expose its API to the other languages.
- .
- This package allows GPlugin to load plugin written in the Seed JavaScript
- programming language.
-
-Package: libgplugin-gjs
-Architecture: any
-Depends: ${misc:Depends}, ${shlibs:Depends}, libgjs0c,
- libgplugin0, gir1.2-gplugin-0.0
-Description: GPlugin GNOME JavaScript Loader
- GPlugin is a GObject based library that implements a reusable plugin system
- which supports loading plugins in other languages via loaders. It relies
- heavily on GObjectIntrospection to expose its API to the other languages.
- .
- This package allows GPlugin to load plugin written in the GNOME JavaScript
- programming language.
-
--- a/packaging/debian/copyright Mon Feb 09 14:11:18 2015 -0600
+++ b/packaging/debian/copyright Thu Mar 05 13:37:42 2015 -0600
@@ -1,7 +1,7 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: gplugin
Upstream-Contact: grim@reaperworld.com
-Source: https://bitbucket.org/rw_grim/gplugin
+Source: https://bitbucket.org/gplugin/main
Files: *
Copyright: 2011-2014 Gary Kramlich <grim@reaperworld.com>
--- a/packaging/debian/libgplugin-gjs.install Mon Feb 09 14:11:18 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-usr/lib/gplugin/gplugin-gjs.so usr/lib/gplugin
-
--- a/packaging/debian/libgplugin-seed.install Mon Feb 09 14:11:18 2015 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-usr/lib/gplugin/gplugin-seed.so usr/lib/gplugin
-
--- a/packaging/debian/rules Mon Feb 09 14:11:18 2015 -0600
+++ b/packaging/debian/rules Thu Mar 05 13:37:42 2015 -0600
@@ -7,3 +7,8 @@
dh_makeshlibs -plibgplugin0
dh_makeshlibs -plibgplugin-gtk0
+override_dh_strip:
+ dh_strip -plibgplugin0 --dbg-package=libgplugin0-dbg
+ dh_strip -plibgplugin-gtk0 --dbg-package=libgplugin-gtk0-dbg
+ dh_strip
+
--- a/python/gplugin-python-loader.c Mon Feb 09 14:11:18 2015 -0600
+++ b/python/gplugin-python-loader.c Thu Mar 05 13:37:42 2015 -0600
@@ -315,14 +315,14 @@
program = g_get_prgname();
program = program ? program : "";
- len = __mbstowcs_chk(NULL, program, 0, 0);
+ len = mbstowcs(NULL, program, 0);
if(len == (size_t)-1) {
g_warning("Could not convert program name to wchar_t string.");
return FALSE;
}
argv[0] = g_new(wchar_t, len + 1);
- len = __mbstowcs_chk(argv[0], program, len + 1, len + 1);
+ len = mbstowcs(argv[0], program, len + 1);
if(len == (size_t)-1) {
g_warning("Could not convert program name to wchar_t string.");
return FALSE;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/bitbucket_upload Thu Mar 05 13:37:42 2015 -0600
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+CURL=$(which curl)
+GREP=$(which grep)
+AWK=$(which awk)
+
+OUTPUT=.bitbucket.cookies
+
+rm -f ${OUTPUT}
+
+PATH=${1}
+FILES=${@}
+
+if [ -z ${PATH} ] ; then
+ echo "You must provide a repository path"
+ exit 1
+fi
+
+if [ -z "${FILES}" ] ; then
+ echo "You must provide at least one file to upload"
+ exit 1
+fi
+
+BASE_URI=https://bitbucket.org
+LOGIN_URI=${BASE_URI}/account/signin/
+UPLOAD_URI=${BASE_URI}/${PATH}/downloads
+
+read -e -p "bitbucket username: " BB_USERNAME
+read -e -s -p "bitbucket password: " BB_PASSWORD
+echo
+echo
+
+# get the csrf token
+echo -n "getting login token ... "
+${CURL} -s -k -c ${OUTPUT} -o /dev/null ${LOGIN_URI}
+CSRF_TOKEN=$(${GREP} csrftoken ${OUTPUT} | ${AWK} '{print $7}')
+if [ -z ${CSRF_TOKEN} ] ; then
+ echo "failed."
+ rm -f ${OUTPUT}
+ exit 1
+else
+ echo "done"
+fi
+
+
+echo -n "logging in ... "
+${CURL} -s -k -c ${OUTPUT} -b ${OUTPUT} -o /dev/null -d "username=${BB_USERNAME}&password=${BB_PASSWORD}&csrfmiddlewaretoken=${CSRF_TOKEN}" --referer ${LOGIN_URI} -L ${LOGIN_URI}
+${GREP} -q bb_session ${OUTPUT}
+if [ $? -ne 0 ] ; then
+ echo "failed"
+ rm -f ${OUTPUT}
+ exit 1
+else
+ echo "done"
+fi
+
+for FILE in ${FILES} ; do
+ echo -n "uploading ${FILE} ... "
+ ${CURL} -s -k -c ${OUTPUT} -b ${OUTPUT} --referer ${UPLOAD_URI} -L --form csrfmiddlewaretoken=${CSRF_TOKEN} --form token= --form file=@"${FILE}" ${UPLOAD_URI}
+ if [ $? -ne 0 ] ; then
+ echo "failed"
+ rm -f ${OUTPUT}
+ exit 1
+ else
+ echo "done"
+ fi
+done
+
+exit 0
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/makeviz.sh Thu Mar 05 13:37:42 2015 -0600
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+gource \
+ --seconds-per-day .1 \
+ --auto-skip-seconds .1 \
+ --file-idle-time 0 \
+ --multi-sampling \
+ --highlight-users \
+ --stop-at-end \
+ --key \
+ --title "History of GPlugin" \
+ --font-size 26 \
+ -1280x720 \
+ --max-files 0 \
+ --hide filenames,mouse,progress \
+ --output-framerate 30 \
+ -o - \
+| ffmpeg \
+ -y \
+ -r 30 \
+ -f image2pipe \
+ -vcodec ppm \
+ -i - \
+ -vcodec libx264 \
+ -preset ultrafast \
+ -pix_fmt yuv420p \
+ -crf 1 \
+ -threads 0 \
+ -bf 0 \
+ gplugin.mp4
+
--- a/seed/CMakeLists.txt Mon Feb 09 14:11:18 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 Mon Feb 09 14:11:18 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 Mon Feb 09 14:11:18 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 Mon Feb 09 14:11:18 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 Mon Feb 09 14:11:18 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 Mon Feb 09 14:11:18 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 Mon Feb 09 14:11:18 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 Mon Feb 09 14:11:18 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 Mon Feb 09 14:11:18 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 Mon Feb 09 14:11:18 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 Mon Feb 09 14:11:18 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 Mon Feb 09 14:11:18 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 Mon Feb 09 14:11:18 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();
-}
-