[gtk-vnc] Fix introspection of key grab APIs
- From: Daniel P. Berrange <dberrange src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-vnc] Fix introspection of key grab APIs
- Date: Fri, 27 Apr 2012 11:45:17 +0000 (UTC)
commit 247899fc1cf6c5e46b3d2c51b05d3beddf170cfe
Author: Daniel P. Berrange <berrange redhat com>
Date: Fri Apr 27 12:44:34 2012 +0100
Fix introspection of key grab APIs
src/vncdisplay.c | 24 +++++++++++++++++++++++-
src/vncgrabsequence.c | 25 +++++++++++++++++++++++++
2 files changed, 48 insertions(+), 1 deletions(-)
---
diff --git a/src/vncdisplay.c b/src/vncdisplay.c
index 2a84637..7b19c0b 100644
--- a/src/vncdisplay.c
+++ b/src/vncdisplay.c
@@ -2061,6 +2061,14 @@ void vnc_display_set_pointer_grab(VncDisplay *obj, gboolean enable)
do_pointer_ungrab(obj, FALSE);
}
+
+/**
+ * vnc_display_set_grab_keys:
+ * @obj: (transfer none): the vnc display object
+ * @seq: (transfer none): the new grab sequence
+ *
+ * Set the key grab sequence
+ */
void vnc_display_set_grab_keys(VncDisplay *obj, VncGrabSequence *seq)
{
if (obj->priv->vncgrabseq) {
@@ -2072,8 +2080,22 @@ void vnc_display_set_grab_keys(VncDisplay *obj, VncGrabSequence *seq)
else
obj->priv->vncgrabseq = vnc_grab_sequence_new_from_string("Control_L+Alt_L");
obj->priv->vncactiveseq = g_new0(gboolean, obj->priv->vncgrabseq->nkeysyms);
+ if (G_UNLIKELY(vnc_util_get_debug())) {
+ gchar *str = vnc_grab_sequence_as_string(obj->priv->vncgrabseq);
+ VNC_DEBUG("Grab sequence is now %s", str);
+ g_free(str);
+ }
}
+
+/**
+ * vnc_display_get_grab_keys:
+ * @obj: the vnc display object
+ *
+ * Get the current grab key sequence
+ *
+ * Returns: (transfer none): the current grab keys
+ */
VncGrabSequence *vnc_display_get_grab_keys(VncDisplay *obj)
{
return obj->priv->vncgrabseq;
@@ -2124,7 +2146,7 @@ static void vnc_display_convert_data(GdkPixbuf *pixbuf,
* Take a screenshot of the display.
*
* Returns: (transfer full): a #GdkPixbuf with the screenshot image buffer
- **/
+ */
GdkPixbuf *vnc_display_get_pixbuf(VncDisplay *obj)
{
VncDisplayPrivate *priv = obj->priv;
diff --git a/src/vncgrabsequence.c b/src/vncgrabsequence.c
index c2d7549..b85ebca 100644
--- a/src/vncgrabsequence.c
+++ b/src/vncgrabsequence.c
@@ -40,6 +40,15 @@ GType vnc_grab_sequence_get_type(void)
}
+/**
+ * vnc_grab_sequence_new:
+ * @nkeysyms: length of @keysyms
+ * @keysyms: (array length=nkeysyms): the keysym values
+ *
+ * Creates a new grab sequence from a list of keysym values
+ *
+ * Returns: (transfer full): a new grab sequence object
+ */
VncGrabSequence *vnc_grab_sequence_new(guint nkeysyms, guint *keysyms)
{
VncGrabSequence *sequence;
@@ -53,6 +62,14 @@ VncGrabSequence *vnc_grab_sequence_new(guint nkeysyms, guint *keysyms)
}
+/**
+ * vnc_grab_sequence_new_from_string:
+ * @str: string of keysym names
+ *
+ * Creates a new grab sequence from a list of keysym names
+ *
+ * Returns: (transfer full): a new grab sequence object
+ */
VncGrabSequence *vnc_grab_sequence_new_from_string(const gchar *str)
{
gchar **keysymstr;
@@ -98,6 +115,14 @@ void vnc_grab_sequence_free(VncGrabSequence *sequence)
}
+/**
+ * vnc_grab_sequence_as_string:
+ * @sequence: (transfer none): the grab sequence
+ *
+ * Convert the grab sequence to a string of keysym names
+ *
+ * Returns: (transfer full): the grab sequence as a string
+ */
gchar *vnc_grab_sequence_as_string(VncGrabSequence *sequence)
{
GString *str = g_string_new("");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]