[Spice-devel] [PATCH spice-gtk 3/6] Add function to return list of supported channels
Marc-André Lureau
marcandre.lureau at gmail.com
Thu Apr 11 06:09:57 PDT 2013
---
gtk/spice-channel-priv.h | 2 ++
gtk/spice-channel.c | 20 ++++++++++++++++++++
gtk/spice-session.c | 15 +--------------
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);
--
1.8.2.1.342.gfa7285d
More information about the Spice-devel
mailing list