summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2013-04-11 14:57:36 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2013-04-11 14:57:36 +0200
commit5bda83f9505aa2f9f063206c9a813b1285203a73 (patch)
tree157d495cbaf2f1e28ec0f89ebc87bf0b6301f67d
parent00ef4fc3ab22a8350f09330a058d69f18617fb50 (diff)
Add function to return list of supported channels
-rw-r--r--gtk/spice-channel-priv.h2
-rw-r--r--gtk/spice-channel.c20
-rw-r--r--gtk/spice-session.c15
3 files changed, 23 insertions, 14 deletions
diff --git a/gtk/spice-channel-priv.h b/gtk/spice-channel-priv.h
index b2d8a14..5584662 100644
--- a/gtk/spice-channel-priv.h
+++ b/gtk/spice-channel-priv.h
@@ -29,6 +29,7 @@
#include <sasl/sasl.h>
#endif
+#include "spice-channel.h"
#include "spice-util-priv.h"
#include "coroutine.h"
#include "gio-coroutine.h"
@@ -193,6 +194,7 @@ void spice_caps_set(GArray *caps, guint32 cap, const gchar *desc);
event, &((struct event) { args }), G_STRLOC); \
} G_STMT_END
+gchar *spice_channel_supported_string(void);
G_END_DECLS
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index 333dcf3..10ed892 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -1894,6 +1894,26 @@ const gchar* spice_channel_type_to_string(gint type)
return str ? str : "unknown channel type";
}
+G_GNUC_INTERNAL
+gchar *spice_channel_supported_string(void)
+{
+ return g_strjoin(", ",
+ spice_channel_type_to_string(SPICE_CHANNEL_MAIN),
+ spice_channel_type_to_string(SPICE_CHANNEL_DISPLAY),
+ spice_channel_type_to_string(SPICE_CHANNEL_INPUTS),
+ spice_channel_type_to_string(SPICE_CHANNEL_CURSOR),
+ spice_channel_type_to_string(SPICE_CHANNEL_PLAYBACK),
+ spice_channel_type_to_string(SPICE_CHANNEL_RECORD),
+#ifdef USE_SMARTCARD
+ spice_channel_type_to_string(SPICE_CHANNEL_SMARTCARD),
+#endif
+#ifdef USE_USBREDIR
+ spice_channel_type_to_string(SPICE_CHANNEL_USBREDIR),
+#endif
+ NULL);
+}
+
+
/**
* spice_channel_new:
* @s: the @SpiceSession the channel is linked to
diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 2deb86a..448ef15 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -155,20 +155,7 @@ static void spice_session_init(SpiceSession *session)
SPICE_DEBUG("New session (compiled from package " PACKAGE_STRING ")");
s = session->priv = SPICE_SESSION_GET_PRIVATE(session);
- channels = g_strjoin(", ",
- spice_channel_type_to_string(SPICE_CHANNEL_MAIN),
- spice_channel_type_to_string(SPICE_CHANNEL_DISPLAY),
- spice_channel_type_to_string(SPICE_CHANNEL_INPUTS),
- spice_channel_type_to_string(SPICE_CHANNEL_CURSOR),
- spice_channel_type_to_string(SPICE_CHANNEL_PLAYBACK),
- spice_channel_type_to_string(SPICE_CHANNEL_RECORD),
-#ifdef USE_SMARTCARD
- spice_channel_type_to_string(SPICE_CHANNEL_SMARTCARD),
-#endif
-#ifdef USE_USBREDIR
- spice_channel_type_to_string(SPICE_CHANNEL_USBREDIR),
-#endif
- NULL);
+ channels = spice_channel_supported_string();
SPICE_DEBUG("Supported channels: %s", channels);
g_free(channels);