changeset 29524:c52dbc5503d0

Made the GLib flags structure for PurpleMediaCaps.
author maiku@pidgin.im
date Tue, 20 Oct 2009 00:10:14 +0000
parents ecd2136ff818
children e144a461cf3c
files libpurple/media.c libpurple/media.h
diffstat 2 files changed, 44 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Tue Oct 13 22:13:57 2009 +0000
+++ b/libpurple/media.c	Tue Oct 20 00:10:14 2009 +0000
@@ -289,6 +289,40 @@
 	return type;
 }
 
+GType
+purple_media_caps_get_type()
+{
+	static GType type = 0;
+	if (type == 0) {
+		static const GEnumValue values[] = {
+			{ PURPLE_MEDIA_CAPS_NONE,
+					"PURPLE_MEDIA_CAPS_NONE", "none" },
+			{ PURPLE_MEDIA_CAPS_AUDIO,
+					"PURPLE_MEDIA_CAPS_AUDIO", "audio" },
+			{ PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION,
+					"PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION",
+					"audio-single-direction" },
+			{ PURPLE_MEDIA_CAPS_VIDEO,
+					"PURPLE_MEDIA_CAPS_VIDEO", "video" },
+			{ PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION,
+					"PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION",
+					"video-single-direction" },
+			{ PURPLE_MEDIA_CAPS_AUDIO_VIDEO,
+					"PURPLE_MEDIA_CAPS_AUDIO_VIDEO",
+					"audio-video" },
+			{ PURPLE_MEDIA_CAPS_MODIFY_SESSION,
+					"PURPLE_MEDIA_CAPS_MODIFY_SESSION",
+					"modify-session" },
+			{ PURPLE_MEDIA_CAPS_CHANGE_DIRECTION,
+					"PURPLE_MEDIA_CAPS_CHANGE_DIRECTION",
+					"change-direction" },
+			{ 0, NULL, NULL }
+		};
+		type = g_enum_register_static("PurpleMediaCaps", values);
+	}
+	return type;
+}
+
 #ifdef USE_VV
 static void
 purple_media_class_init (PurpleMediaClass *klass)
--- a/libpurple/media.h	Tue Oct 13 22:13:57 2009 +0000
+++ b/libpurple/media.h	Tue Oct 20 00:10:14 2009 +0000
@@ -58,6 +58,7 @@
 #define PURPLE_TYPE_MEDIA_NETWORK_PROTOCOL (purple_media_network_protocol_get_type())
 #define PURPLE_MEDIA_TYPE_STATE      (purple_media_state_changed_get_type())
 #define PURPLE_MEDIA_TYPE_INFO_TYPE	(purple_media_info_type_get_type())
+#define PURPLE_MEDIA_TYPE_CAPS	     (purple_media_caps_get_type())
 
 /** An opaque structure representing a media call. */
 typedef struct _PurpleMedia PurpleMedia;
@@ -190,6 +191,15 @@
 GType purple_media_info_type_get_type(void);
 
 /**
+ * Gets the type of the media caps flags
+ *
+ * @return The media caps flags' GType
+ *
+ * @since 2.7.0
+ */
+GType purple_media_caps_get_type(void);
+
+/**
  * Gets the type of the media candidate structure.
  *
  * @return The media canditate's GType