-/****************
- * GObject code *
- ****************/
-/* Plugin init */
-static gboolean rotate(gpointer _self);
-static void gis_plugin_example_plugin_init(GisPluginInterface *iface);
-static void gis_plugin_example_expose(GisPlugin *_self);
-static GtkWidget *gis_plugin_example_get_config(GisPlugin *_self);
-G_DEFINE_TYPE_WITH_CODE(GisPluginExample, gis_plugin_example, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE(GIS_TYPE_PLUGIN,
- gis_plugin_example_plugin_init));
-static void gis_plugin_example_plugin_init(GisPluginInterface *iface)
-{
- g_debug("GisPluginExample: plugin_init");
- /* Add methods to the interface */
- iface->expose = gis_plugin_example_expose;
- iface->get_config = gis_plugin_example_get_config;
-}
-/* Class/Object init */
-static void gis_plugin_example_init(GisPluginExample *self)
-{
- g_debug("GisPluginExample: init");
- /* Set defaults */
- self->button = GTK_TOGGLE_BUTTON(gtk_toggle_button_new_with_label("Rotate"));
- self->rotate_id = g_timeout_add(1000/60, rotate, self);
- self->rotation = 30.0;
- self->opengl = NULL;
-}
-static void gis_plugin_example_dispose(GObject *gobject)
-{
- g_debug("GisPluginExample: dispose");
- GisPluginExample *self = GIS_PLUGIN_EXAMPLE(gobject);
- g_source_remove(self->rotate_id);
- /* Drop references */
- G_OBJECT_CLASS(gis_plugin_example_parent_class)->dispose(gobject);
-}
-static void gis_plugin_example_finalize(GObject *gobject)
-{
- g_debug("GisPluginExample: finalize");
- GisPluginExample *self = GIS_PLUGIN_EXAMPLE(gobject);
- /* Free data */
- G_OBJECT_CLASS(gis_plugin_example_parent_class)->finalize(gobject);
-
-}
-static void gis_plugin_example_class_init(GisPluginExampleClass *klass)
-{
- g_debug("GisPluginExample: class_init");
- GObjectClass *gobject_class = (GObjectClass*)klass;
- gobject_class->dispose = gis_plugin_example_dispose;
- gobject_class->finalize = gis_plugin_example_finalize;
-}
-