[vinagre] Added protocol-[added,removed] signal to PluginsEngine
- From: Jonh Wendell <jwendell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vinagre] Added protocol-[added,removed] signal to PluginsEngine
- Date: Wed, 13 Oct 2010 17:47:38 +0000 (UTC)
commit 45c297b49abdfd5a83d33564e94f70e8a9d07b8a
Author: Jonh Wendell <jwendell gnome org>
Date: Tue Oct 12 22:08:16 2010 -0300
Added protocol-[added,removed] signal to PluginsEngine
vinagre/vinagre-plugins-engine.c | 40 ++++++++++++++++++++++++++++++++++---
1 files changed, 36 insertions(+), 4 deletions(-)
---
diff --git a/vinagre/vinagre-plugins-engine.c b/vinagre/vinagre-plugins-engine.c
index e9dc2b7..75c4f19 100644
--- a/vinagre/vinagre-plugins-engine.c
+++ b/vinagre/vinagre-plugins-engine.c
@@ -35,6 +35,14 @@ struct _VinagrePluginsEnginePrivate
PeasExtensionSet *extensions;
};
+enum
+{
+ PROTOCOL_ADDED,
+ PROTOCOL_REMOVED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
VinagrePluginsEngine *default_engine = NULL;
static void
@@ -83,19 +91,21 @@ vinagre_plugins_engine_extension_added (PeasExtensionSet *extensions,
}
g_hash_table_insert (engine->priv->protocols, (gpointer)protocol, exten);
+ g_signal_emit (engine, signals[PROTOCOL_ADDED], 0, exten);
}
static void
-vinagre_plugins_engine_extension_removed (PeasExtensionSet *extensions,
- PeasPluginInfo *info,
- PeasExtension *exten,
- VinagrePluginsEngine *engine)
+vinagre_plugins_engine_extension_removed (PeasExtensionSet *extensions,
+ PeasPluginInfo *info,
+ PeasExtension *exten,
+ VinagrePluginsEngine *engine)
{
const gchar *protocol = NULL;
peas_extension_call (exten, "get_protocol", &protocol);
g_hash_table_remove (engine->priv->protocols, (gpointer)protocol);
+ g_signal_emit (engine, signals[PROTOCOL_REMOVED], 0, exten);
}
static void
@@ -235,6 +245,28 @@ vinagre_plugins_engine_class_init (VinagrePluginsEngineClass *klass)
engine_class->load_plugin = vinagre_plugins_engine_load_plugin;
engine_class->unload_plugin = vinagre_plugins_engine_unload_plugin;
+ signals[PROTOCOL_ADDED] =
+ g_signal_new ("protocol-added",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE,
+ 1,
+ PEAS_TYPE_EXTENSION);
+
+ signals[PROTOCOL_REMOVED] =
+ g_signal_new ("protocol-removed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE,
+ 1,
+ PEAS_TYPE_EXTENSION);
+
g_type_class_add_private (klass, sizeof (VinagrePluginsEnginePrivate));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]