summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2011-02-05 00:36:27 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2011-02-19 00:01:29 +0100
commitf81010ebdaf5b8e489c19251572a05de7abe8320 (patch)
tree98271f3a6c635abe315c14d2300d44bc561b2b20
parenteea8f081b0d35bb91a4b8d47897e76941310cdb5 (diff)
common: add spice_channel_test_common_capability()
-rw-r--r--gtk/spice-channel.c23
-rw-r--r--gtk/spice-channel.h1
-rw-r--r--gtk/spice-client-gtk.defs9
3 files changed, 31 insertions, 2 deletions
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index 6140407..4ec0232 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -1590,9 +1590,9 @@ static gboolean test_capability(GArray *caps, guint32 cap)
* @self:
* @cap:
*
- * Test availability of specific channel-kind capability of the remote.
+ * Test availability of remote "channel kind capability".
*
- * Returns: %TRUE if @cap, a specific channel capability, is available.
+ * Returns: %TRUE if @cap (channel kind capability) is available.
**/
gboolean spice_channel_test_capability(SpiceChannel *self, guint32 cap)
{
@@ -1604,6 +1604,25 @@ gboolean spice_channel_test_capability(SpiceChannel *self, guint32 cap)
return test_capability(c->remote_caps, cap);
}
+/**
+ * spice_channel_test_common_capability:
+ * @self:
+ * @cap:
+ *
+ * Test availability of remote "common channel capability".
+ *
+ * Returns: %TRUE if @cap (common channel capability) is available.
+ **/
+gboolean spice_channel_test_common_capability(SpiceChannel *self, guint32 cap)
+{
+ spice_channel *c;
+
+ g_return_val_if_fail(SPICE_IS_CHANNEL(self), FALSE);
+
+ c = self->priv;
+ return test_capability(c->remote_common_caps, cap);
+}
+
static void set_capability(GArray *caps, guint32 cap)
{
guint word_index = cap / 32;
diff --git a/gtk/spice-channel.h b/gtk/spice-channel.h
index 9486047..cd16d8c 100644
--- a/gtk/spice-channel.h
+++ b/gtk/spice-channel.h
@@ -104,6 +104,7 @@ gboolean spice_channel_connect(SpiceChannel *channel);
gboolean spice_channel_open_fd(SpiceChannel *channel, int fd);
void spice_channel_disconnect(SpiceChannel *channel, SpiceChannelEvent event);
gboolean spice_channel_test_capability(SpiceChannel *channel, guint32 cap);
+gboolean spice_channel_test_common_capability(SpiceChannel *channel, guint32 cap);
void spice_channel_set_capability(SpiceChannel *channel, guint32 cap);
G_END_DECLS
diff --git a/gtk/spice-client-gtk.defs b/gtk/spice-client-gtk.defs
index 6a67dc1..7930318 100644
--- a/gtk/spice-client-gtk.defs
+++ b/gtk/spice-client-gtk.defs
@@ -384,6 +384,15 @@
)
)
+(define-method test_common_capability
+ (of-object "SpiceChannel")
+ (c-name "spice_channel_test_common_capability")
+ (return-type "gboolean")
+ (parameters
+ '("guint32" "cap")
+ )
+)
+
(define-method set_capability
(of-object "SpiceChannel")
(c-name "spice_channel_set_capability")