diff options
author | Guido Günther <agx@sigxcpu.org> | 2010-09-29 17:36:22 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2010-09-29 17:36:22 +0200 |
commit | 2745b08d34f1bbb130abdd01e008c4f81c91efb9 (patch) | |
tree | e05deea55345915877a1bb023da3deaca976b519 /plugins/ka-plugin-dummy.c | |
parent | Imported Upstream version 0.16 (diff) | |
download | krb5-auth-dialog-2745b08d34f1bbb130abdd01e008c4f81c91efb9.tar.gz krb5-auth-dialog-2745b08d34f1bbb130abdd01e008c4f81c91efb9.tar.bz2 krb5-auth-dialog-2745b08d34f1bbb130abdd01e008c4f81c91efb9.zip |
New upstream version 0.17
Diffstat (limited to 'plugins/ka-plugin-dummy.c')
-rw-r--r-- | plugins/ka-plugin-dummy.c | 67 |
1 files changed, 32 insertions, 35 deletions
diff --git a/plugins/ka-plugin-dummy.c b/plugins/ka-plugin-dummy.c index 6485c0d..99bd739 100644 --- a/plugins/ka-plugin-dummy.c +++ b/plugins/ka-plugin-dummy.c @@ -20,17 +20,16 @@ #include <gmodule.h> G_DEFINE_TYPE (KaPluginDummy, ka_plugin_dummy, KA_TYPE_PLUGIN) - #define GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), KA_TYPE_PLUGIN_DUMMY, KaPluginDummyPrivate)) int ka_plugin_major_version = KA_PLUGIN_MAJOR_VERSION; int ka_plugin_minor_version = KA_PLUGIN_MINOR_VERSION; -G_MODULE_EXPORT KaPlugin* +G_MODULE_EXPORT KaPlugin * ka_plugin_create (void) { - return KA_PLUGIN (ka_plugin_dummy_new()); + return KA_PLUGIN (ka_plugin_dummy_new ()); } typedef struct _KaPluginDummyPrivate KaPluginDummyPrivate; @@ -39,57 +38,55 @@ struct _KaPluginDummyPrivate { gulong handlers[3]; }; -event_cb (gpointer* applet, gchar* princ, guint when, gpointer user_data) +static void +event_cb (gpointer *applet, gchar *princ, guint when, gpointer user_data) { - g_message("%s %s @%d", user_data, princ, when); + g_message ("%s %s @%d", user_data, princ, when); } static void ka_plugin_dummy_finalize (GObject *object) { - G_OBJECT_CLASS (ka_plugin_dummy_parent_class)->finalize (object); + G_OBJECT_CLASS (ka_plugin_dummy_parent_class)->finalize (object); } static void -ka_plugin_dummy_activate (KaPlugin *self, KaApplet* applet) +ka_plugin_dummy_activate (KaPlugin *self, KaApplet *applet) { - KaPluginDummyPrivate *priv = GET_PRIVATE (self); - - priv->handlers[0] = g_signal_connect (applet, - "krb-tgt-expired", - G_CALLBACK (event_cb), - "Expired"); - priv->handlers[1] = g_signal_connect (applet, - "krb-tgt-acquired", - G_CALLBACK (event_cb), - "Acquired"); - priv->handlers[2] = g_signal_connect (applet, - "krb-tgt-renewed", - G_CALLBACK (event_cb), - "Renewed"); + KaPluginDummyPrivate *priv = GET_PRIVATE (self); + + priv->handlers[0] = g_signal_connect (applet, + "krb-tgt-expired", + G_CALLBACK (event_cb), "Expired"); + priv->handlers[1] = g_signal_connect (applet, + "krb-tgt-acquired", + G_CALLBACK (event_cb), "Acquired"); + priv->handlers[2] = g_signal_connect (applet, + "krb-tgt-renewed", + G_CALLBACK (event_cb), "Renewed"); } static void -ka_plugin_dummy_deactivate (KaPlugin *self, KaApplet* applet) +ka_plugin_dummy_deactivate (KaPlugin *self, KaApplet *applet) { - int i; - KaPluginDummyPrivate *priv = GET_PRIVATE (self); + int i; + KaPluginDummyPrivate *priv = GET_PRIVATE (self); - for (i = 0; i < G_N_ELEMENTS(priv->handlers); i++) - g_signal_handler_disconnect (applet, priv->handlers[i]); + for (i = 0; i < G_N_ELEMENTS (priv->handlers); i++) + g_signal_handler_disconnect (applet, priv->handlers[i]); } static void ka_plugin_dummy_class_init (KaPluginDummyClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); - KaPluginClass *plugin_class = KA_PLUGIN_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + KaPluginClass *plugin_class = KA_PLUGIN_CLASS (klass); - g_type_class_add_private (klass, sizeof (KaPluginDummyPrivate)); + g_type_class_add_private (klass, sizeof (KaPluginDummyPrivate)); - plugin_class->activate = ka_plugin_dummy_activate; - plugin_class->deactivate = ka_plugin_dummy_deactivate; - object_class->finalize = ka_plugin_dummy_finalize; + plugin_class->activate = ka_plugin_dummy_activate; + plugin_class->deactivate = ka_plugin_dummy_deactivate; + object_class->finalize = ka_plugin_dummy_finalize; } static void @@ -97,9 +94,9 @@ ka_plugin_dummy_init (KaPluginDummy *self) { } -KaPluginDummy* +KaPluginDummy * ka_plugin_dummy_new (void) { - return g_object_new (KA_TYPE_PLUGIN_DUMMY, KA_PLUGIN_PROP_NAME, - "dummy", NULL); + return g_object_new (KA_TYPE_PLUGIN_DUMMY, KA_PLUGIN_PROP_NAME, + "dummy", NULL); } |