X-Git-Url: http://pileus.org/git/?p=grits;a=blobdiff_plain;f=src%2Fplugin-example.c;h=f2ae95ed364715bd5bb230829108e2ca6ab0c743;hp=40606423319e2888c49f40479bb9f0b2955bc463;hb=5e979044ddae3f2e9d31f480dd103bfb0fa7103b;hpb=2cff8bb49022174ae7dba40c83dcecc94f5d2193 diff --git a/src/plugin-example.c b/src/plugin-example.c index 4060642..f2ae95e 100644 --- a/src/plugin-example.c +++ b/src/plugin-example.c @@ -26,27 +26,49 @@ /**************** * GObject code * ****************/ +/* Plugin init */ static void aweather_example_plugin_init(AWeatherPluginInterface *iface); static void aweather_example_expose(AWeatherPlugin *_example); G_DEFINE_TYPE_WITH_CODE(AWeatherExample, aweather_example, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(AWEATHER_TYPE_PLUGIN, aweather_example_plugin_init)); -static void aweather_example_class_init(AWeatherExampleClass *klass) -{ - GObjectClass *object_class = (GObjectClass*)klass; -} static void aweather_example_plugin_init(AWeatherPluginInterface *iface) { + g_debug("AWeatherExample: plugin_init"); /* Add methods to the interface */ iface->expose = aweather_example_expose; } +/* Class/Object init */ static void aweather_example_init(AWeatherExample *example) { + g_debug("AWeatherExample: init"); /* Set defaults */ example->gui = NULL; example->button = NULL; example->rotation = 30.0; } +static void aweather_example_dispose(GObject *gobject) +{ + g_debug("AWeatherExample: dispose"); + AWeatherExample *self = AWEATHER_EXAMPLE(gobject); + /* Drop references */ + G_OBJECT_CLASS(aweather_example_parent_class)->dispose(gobject); +} +static void aweather_example_finalize(GObject *gobject) +{ + g_debug("AWeatherExample: finalize"); + AWeatherExample *self = AWEATHER_EXAMPLE(gobject); + /* Free data */ + G_OBJECT_CLASS(aweather_example_parent_class)->finalize(gobject); + +} +static void aweather_example_class_init(AWeatherExampleClass *klass) +{ + g_debug("AWeatherExample: class_init"); + GObjectClass *gobject_class = (GObjectClass*)klass; + gobject_class->dispose = aweather_example_dispose; + gobject_class->finalize = aweather_example_finalize; +} /*********** * Helpers *