Experiment with plugin configuration screen
authorPhilip Chimento <philip.chimento@gmail.com>
Sat, 6 Oct 2012 16:50:41 +0000 (09:50 -0700)
committerPhilip Chimento <philip.chimento@gmail.com>
Sat, 6 Oct 2012 16:50:41 +0000 (09:50 -0700)
configure.ac
interpreters/chimara-frotz-plugin.c

index 2e8c380c7151fecbca4af856efba2587a31eeb13..06bb494b7d16e8845ac24364cd23851e0f2eff09 100644 (file)
@@ -125,7 +125,9 @@ PKG_CHECK_MODULES([PLAYER], [
 # Libraries needed to build interpreter plugins
 PKG_CHECK_MODULES([PLUGIN], [
        glib-2.0  dnl Any version will do
+       gtk+-3.0
        libpeas-1.0
+       libpeas-gtk-1.0
 ])
 # Libraries needed to build test programs
 PKG_CHECK_MODULES([TEST], [
index 9c5510a340cb8ea2976f77a39533d75ba6a068ed..527d5471d9969d608de2fe3f74c4adf14167ed6e 100644 (file)
@@ -1,15 +1,20 @@
 #include <glib-object.h>
+#include <gtk/gtk.h>
 #include <libpeas/peas.h>
+#include <libpeas-gtk/peas-gtk.h>
 #include "chimara-frotz-plugin.h"
 
-G_DEFINE_DYNAMIC_TYPE(ChimaraFrotzPlugin, chimara_frotz_plugin, PEAS_TYPE_EXTENSION_BASE);
+static void chimara_frotz_plugin_configurable_init(PeasGtkConfigurableInterface *);
+static GtkWidget *chimara_frotz_plugin_create_configure_widget(PeasGtkConfigurable *);
+
+G_DEFINE_DYNAMIC_TYPE_EXTENDED(ChimaraFrotzPlugin, chimara_frotz_plugin, PEAS_TYPE_EXTENSION_BASE, 0,
+       G_IMPLEMENT_INTERFACE_DYNAMIC(PEAS_GTK_TYPE_CONFIGURABLE, chimara_frotz_plugin_configurable_init));
 
 G_MODULE_EXPORT void
 peas_register_types(PeasObjectModule *module)
 {
        chimara_frotz_plugin_register_type(G_TYPE_MODULE(module));
-
-       //peas_object_module_register_extension_type(module, PEAS_GTK_TYPE_CONFIGURABLE, CHIMARA_TYPE_BOCFEL_PLUGIN);
+       peas_object_module_register_extension_type(module, PEAS_GTK_TYPE_CONFIGURABLE, CHIMARA_TYPE_FROTZ_PLUGIN);
 }
 
 static void
@@ -25,4 +30,16 @@ chimara_frotz_plugin_class_init(ChimaraFrotzPluginClass *klass)
 static void
 chimara_frotz_plugin_class_finalize(ChimaraFrotzPluginClass *klass)
 {
-}
\ No newline at end of file
+}
+
+static void
+chimara_frotz_plugin_configurable_init(PeasGtkConfigurableInterface *iface)
+{
+       iface->create_configure_widget = chimara_frotz_plugin_create_configure_widget;
+}
+
+static GtkWidget *
+chimara_frotz_plugin_create_configure_widget(PeasGtkConfigurable *self)
+{
+       return gtk_label_new("Configure Widget");
+}