grim/guifications3

Parents b3a1154e0366
Children aff29e72f0bf
the start of the dummy plugin. I've only compile tested this, but we'll see how it goes ;)
--- a/gflib/gflib/CMakeLists.txt Mon May 16 20:46:27 2011 -0500
+++ b/gflib/gflib/CMakeLists.txt Mon May 16 23:28:03 2011 -0500
@@ -8,6 +8,7 @@
gf_connection_manager.h
gf_console_logger.h
gf_core.h
+ gf_dummy_plugin.h
gf_event.h
gf_event_info.h
gf_feed.h
@@ -53,6 +54,7 @@
gf_connection_manager.c
gf_console_logger.c
gf_core.c
+ gf_dummy_plugin.c
gf_enum.c
gf_event.c
gf_event_info.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gflib/gflib/gf_dummy_plugin.c Mon May 16 23:28:03 2011 -0500
@@ -0,0 +1,61 @@
+/*
+ * Guifications - The end-all, be-all notification framework
+ * Copyright (C) 2003-2011 Gary Kramlich <grim@reaperworld.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#include <gflib/gf_dummy_plugin.h>
+
+#include <gflib/gf_plugin_info.h>
+
+/******************************************************************************
+ * Globals
+ *****************************************************************************/
+static const GfPluginInfo info = {
+ .name = "Dummy Plugin",
+ .summary = "A Place holder plugin",
+ .description = "This plugin is used as a place holder for other plugins "
+ "before they're loaded.",
+};
+
+/******************************************************************************
+ * API
+ *****************************************************************************/
+GType
+gf_dummy_plugin_get_type(void) {
+ static GType type = 0;
+
+ if(G_UNLIKELY(type == 0)) {
+ static const GTypeInfo info = {
+ .class_size = sizeof(GfDummyPluginClass),
+ .instance_size = sizeof(GfDummyPlugin),
+ };
+
+ type = g_type_register_static(GF_TYPE_OBJECT,
+ "GfDummyPlugin",
+ &info, 0);
+ }
+
+ return type;
+}
+
+GfPlugin *
+gf_dummy_plugin_new(void) {
+ return g_object_new(GF_TYPE_DUMMY_PLUGIN,
+ "filename", NULL,
+ "info", &info,
+ "state", GF_PLUGIN_STATE_LOAD_FAILED,
+ NULL);
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gflib/gflib/gf_dummy_plugin.h Mon May 16 23:28:03 2011 -0500
@@ -0,0 +1,61 @@
+/*
+ * Guifications - The end-all, be-all notification framework
+ * Copyright (C) 2003-2011 Gary Kramlich <grim@reaperworld.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef GF_DUMMY_PLUGIN_H
+#define GF_DUMMY_PLUGIN_H
+
+#define GF_TYPE_DUMMY_PLUGIN (gf_dummy_plugin_get_type())
+#define GF_DUMMY_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GF_TYPE_DUMMY_PLUGIN, GfDummyPlugin))
+#define GF_DUMMY_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GF_TYPE_DUMMY_PLUGIN, GfDummyPluginClass))
+#define GF_IS_DUMMY_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GF_TYPE_DUMMY_PLUGIN))
+#define GF_IS_DUMMY_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GF_TYPE_DUMMY_PLUGIN))
+#define GF_DUMMY_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GF_TYPE_DUMMY_PLUGIN, GfDummyPluginClass))
+
+typedef struct _GfDummyPlugin GfDummyPlugin;
+typedef struct _GfDummyPluginClass GfDummyPluginClass;
+
+#include <gflib/gf_plugin.h>
+
+/**
+ * GfDummyPlugin:
+ *
+ * A #GfPlugin that can't be loaded and is used as a place holder for plugins
+ * that haven't been found yet.
+ */
+struct _GfDummyPlugin {
+ /*< private >*/
+ GfPlugin parent;
+};
+
+struct _GfDummyPluginClass {
+ GfPluginClass parent;
+
+ void (*_gf_reserved1)(void);
+ void (*_gf_reserved2)(void);
+ void (*_gf_reserved3)(void);
+ void (*_gf_reserved4)(void);
+};
+
+G_BEGIN_DECLS
+
+GType gf_dummy_plugin_get_type(void);
+
+GfPlugin *gf_dummy_plugin_new(void);
+
+G_END_DECLS
+
+#endif /* GF_DUMMY_PLUGIN_H */