Bunch of random updates, mostly G_DEFINE_TYPE stuff and cleaning up reserved pointers in structs
--- a/gplugin-gtk-viewer/gplugin-gtk-viewer-window.h Sat Nov 24 02:35:36 2018 -0600
+++ b/gplugin-gtk-viewer/gplugin-gtk-viewer-window.h Sat Nov 24 22:07:46 2018 -0600
@@ -39,19 +39,13 @@
struct _GPluginGtkViewerWindow {
- void (*_gplugin_gtk_reserved1)(void);
- void (*_gplugin_gtk_reserved2)(void);
- void (*_gplugin_gtk_reserved3)(void);
- void (*_gplugin_gtk_reserved4)(void);
struct _GPluginGtkViewerWindowClass {
- void (*_gplugin_gtk_reserved1)(void);
- void (*_gplugin_gtk_reserved2)(void);
- void (*_gplugin_gtk_reserved3)(void);
- void (*_gplugin_gtk_reserved4)(void);
--- a/gplugin-gtk/gplugin-gtk-plugin-info.h Sat Nov 24 02:35:36 2018 -0600
+++ b/gplugin-gtk/gplugin-gtk-plugin-info.h Sat Nov 24 22:07:46 2018 -0600
@@ -43,15 +43,14 @@
struct _GPluginGtkPluginInfo {
struct _GPluginGtkPluginInfoClass {
- void (*_gplugin_reserved1)(void);
- void (*_gplugin_reserved2)(void);
- void (*_gplugin_reserved3)(void);
- void (*_gplugin_reserved4)(void);
--- a/gplugin-gtk/gplugin-gtk-store.h Sat Nov 24 02:35:36 2018 -0600
+++ b/gplugin-gtk/gplugin-gtk-store.h Sat Nov 24 22:07:46 2018 -0600
@@ -42,19 +42,13 @@
struct _GPluginGtkStore {
- void (*_gplugin_reserved1)(void);
- void (*_gplugin_reserved2)(void);
- void (*_gplugin_reserved3)(void);
- void (*_gplugin_reserved4)(void);
struct _GPluginGtkStoreClass {
GtkListStoreClass parent;
- void (*_gplugin_reserved1)(void);
- void (*_gplugin_reserved2)(void);
- void (*_gplugin_reserved3)(void);
- void (*_gplugin_reserved4)(void);
--- a/gplugin/gplugin-loader.c Sat Nov 24 02:35:36 2018 -0600
+++ b/gplugin/gplugin-loader.c Sat Nov 24 22:07:46 2018 -0600
@@ -29,29 +29,21 @@
/******************************************************************************
+ *****************************************************************************/ +G_DEFINE_ABSTRACT_TYPE(GPluginLoader, gplugin_loader, G_TYPE_OBJECT); +gplugin_loader_init(GPluginLoader *loader) { +gplugin_loader_class_init(GPluginLoaderClass *klass) { +/****************************************************************************** *****************************************************************************/
-gplugin_loader_get_type(void) {
- static volatile gsize type_volatile = 0;
- if(g_once_init_enter(&type_volatile)) {
- static const GTypeInfo info = {
- .class_size = sizeof(GPluginLoaderClass),
- .instance_size = sizeof(GPluginLoader),
- type = g_type_register_static(G_TYPE_OBJECT,
- &info, G_TYPE_FLAG_ABSTRACT);
- g_once_init_leave(&type_volatile, type);
* gplugin_loader_query_plugin:
--- a/gplugin/gplugin-loader.h Sat Nov 24 02:35:36 2018 -0600
+++ b/gplugin/gplugin-loader.h Sat Nov 24 22:07:46 2018 -0600
@@ -42,10 +42,7 @@
- void (*_gplugin_reserved_1)(void);
- void (*_gplugin_reserved_2)(void);
- void (*_gplugin_reserved_3)(void);
- void (*_gplugin_reserved_4)(void);
struct _GPluginLoaderClass {
@@ -58,10 +55,7 @@
gboolean (*load)(GPluginLoader *loader, GPluginPlugin *plugin, GError **error);
gboolean (*unload)(GPluginLoader *loader, GPluginPlugin *plugin, GError **error);
- void (*_gplugin_reserved_1)(void);
- void (*_gplugin_reserved_2)(void);
- void (*_gplugin_reserved_3)(void);
- void (*_gplugin_reserved_4)(void);
--- a/gplugin/gplugin-native-loader.c Sat Nov 24 02:35:36 2018 -0600
+++ b/gplugin/gplugin-native-loader.c Sat Nov 24 22:07:46 2018 -0600
@@ -38,6 +38,15 @@
* Basic API for the native plugin loader.
+ * GPLUGIN_NATIVE_PLUGIN_ABI_VERSION: + * The ABI version of the #GPluginNativeLoader. Your plugin should use this + * as the value for %abi_version when call #gplugin_plugin_info_new. +G_DEFINE_TYPE(GPluginNativeLoader, gplugin_native_loader, GPLUGIN_TYPE_LOADER); /******************************************************************************
*****************************************************************************/
@@ -272,6 +281,10 @@
+gplugin_native_loader_init(GPluginNativeLoader *loader) { gplugin_native_loader_class_init(GPluginNativeLoaderClass *klass) {
GPluginLoaderClass *loader_class =
GPLUGIN_LOADER_CLASS(klass);
@@ -282,39 +295,3 @@
loader_class->load = gplugin_native_loader_load;
loader_class->unload = gplugin_native_loader_unload;
-/******************************************************************************
- *****************************************************************************/
- * GPLUGIN_NATIVE_PLUGIN_ABI_VERSION:
- * The ABI version of the #GPluginNativeLoader. Your plugin should use this
- * as the value for %abi_version when call #gplugin_plugin_info_new.
-gplugin_native_loader_get_type(void) {
- static volatile gsize type_volatile = 0;
- if(g_once_init_enter(&type_volatile)) {
- static const GTypeInfo info = {
- .class_size = sizeof(GPluginNativeLoaderClass),
- .class_init = (GClassInitFunc)gplugin_native_loader_class_init,
- .instance_size = sizeof(GPluginNativeLoader),
- type = g_type_register_static(GPLUGIN_TYPE_LOADER,
- g_once_init_leave(&type_volatile, type);
--- a/gplugin/gplugin-native-loader.h Sat Nov 24 02:35:36 2018 -0600
+++ b/gplugin/gplugin-native-loader.h Sat Nov 24 22:07:46 2018 -0600
@@ -43,15 +43,14 @@
struct _GPluginNativeLoader {
struct _GPluginNativeLoaderClass {
GPluginLoaderClass parent;
- void (*_gplugin_reserved_1)(void);
- void (*_gplugin_reserved_2)(void);
- void (*_gplugin_reserved_3)(void);
- void (*_gplugin_reserved_4)(void);
--- a/gplugin/gplugin-native-plugin.c Sat Nov 24 02:35:36 2018 -0600
+++ b/gplugin/gplugin-native-plugin.c Sat Nov 24 22:07:46 2018 -0600
@@ -67,45 +67,19 @@
static GParamSpec *properties[N_PROPERTIES] = {NULL,};
-/* I hate forward declarations... */
-static void gplugin_native_plugin_iface_init(GPluginPluginInterface *iface);
-G_DEFINE_TYPE_WITH_CODE(
- G_ADD_PRIVATE(GPluginNativePlugin)
- G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_native_plugin_iface_init)
/******************************************************************************
* GPluginPlugin Implementation
*****************************************************************************/
gplugin_native_plugin_iface_init(GPluginPluginInterface *iface) {
+ /* we just override properites from GPluginPlugin */ /******************************************************************************
- * GPluginPlugin Implementation
+ * GTypeModule Implementation *****************************************************************************/
gplugin_native_plugin_load(GTypeModule *module) {
- // GPluginNativePlugin *native = GPLUGIN_NATIVE_PLUGIN(module);
- // GPluginNativePluginPrivate *priv = gplugin_native_plugin_get_instance_private(native);
- // GError *error = NULL;
- // GPluginNativePluginLoadFunc func;
- // gboolean ret = FALSE;
- // func = (GPluginNativePluginLoadFunc)priv->load_func;
- // ret = func(native, &error);
- // g_warning("failed to load plugin: %s", error->message);
@@ -116,6 +90,14 @@
/******************************************************************************
*****************************************************************************/
+G_DEFINE_TYPE_WITH_CODE( + G_ADD_PRIVATE(GPluginNativePlugin) + G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_native_plugin_iface_init) gplugin_native_plugin_get_property(GObject *obj, guint param_id, GValue *value,
--- a/lua/gplugin-lua-test-lgi.c Sat Nov 24 02:35:36 2018 -0600
+++ b/lua/gplugin-lua-test-lgi.c Sat Nov 24 22:07:46 2018 -0600
@@ -33,7 +33,7 @@
memset(buff, 0, sizeof(buff));
snprintf(buff, sizeof(buff), "%s;%s", pkg_path, path);
lua_pop(L, 1); // pop off the path field
lua_pushstring(L, buff); // push the new one
lua_setfield(L, -2, "path"); // set the field "path" in table at -2 with value at top of stack