changeset 29131:e144a461cf3c

Added the ui-caps-changed signal to the media manager.
author maiku@pidgin.im
date Tue, 20 Oct 2009 00:11:44 +0000
parents c52dbc5503d0
children 44e949b676f0
files ChangeLog.API libpurple/marshallers.list libpurple/mediamanager.c
diffstat 3 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Tue Oct 20 00:10:14 2009 +0000
+++ b/ChangeLog.API	Tue Oct 20 00:11:44 2009 +0000
@@ -6,6 +6,7 @@
 		* purple_account_get_name_for_display
 		* purple_network_get_all_local_system_ips
 		* purple_uuid_random
+		* ui-caps-changed media manager signal
 	
 	Pidgin:
 		Added:
--- a/libpurple/marshallers.list	Tue Oct 20 00:10:14 2009 +0000
+++ b/libpurple/marshallers.list	Tue Oct 20 00:11:44 2009 +0000
@@ -4,3 +4,4 @@
 VOID:STRING,STRING,DOUBLE
 VOID:ENUM,STRING,STRING
 VOID:ENUM,STRING,STRING,BOOLEAN
+VOID:FLAGS,FLAGS
--- a/libpurple/mediamanager.c	Tue Oct 20 00:10:14 2009 +0000
+++ b/libpurple/mediamanager.c	Tue Oct 20 00:11:44 2009 +0000
@@ -100,6 +100,7 @@
 
 enum {
 	INIT_MEDIA,
+	UI_CAPS_CHANGED,
 	LAST_SIGNAL
 };
 static guint purple_media_manager_signals[LAST_SIGNAL] = {0};
@@ -148,6 +149,15 @@
 		purple_smarshal_BOOLEAN__OBJECT_POINTER_STRING,
 		G_TYPE_BOOLEAN, 3, PURPLE_TYPE_MEDIA,
 		G_TYPE_POINTER, G_TYPE_STRING);
+
+	purple_media_manager_signals[UI_CAPS_CHANGED] = g_signal_new ("ui-caps-changed",
+		G_TYPE_FROM_CLASS (klass),
+		G_SIGNAL_RUN_LAST,
+		0, NULL, NULL,
+		purple_smarshal_VOID__FLAGS_FLAGS,
+		G_TYPE_NONE, 2, PURPLE_MEDIA_TYPE_CAPS,
+		PURPLE_MEDIA_TYPE_CAPS);
+
 	g_type_class_add_private(klass, sizeof(PurpleMediaManagerPrivate));
 }
 
@@ -894,8 +904,17 @@
 		PurpleMediaCaps caps)
 {
 #ifdef USE_VV
+	PurpleMediaCaps oldcaps;
+
 	g_return_if_fail(PURPLE_IS_MEDIA_MANAGER(manager));
+
+	oldcaps = manager->priv->ui_caps;
 	manager->priv->ui_caps = caps;
+
+	if (caps != oldcaps)
+		g_signal_emit(manager,
+				purple_media_manager_signals[UI_CAPS_CHANGED],
+				0, caps, oldcaps);
 #endif
 }