[gtk-vnc] Add a 'connection' property to VncDisplay class
- From: Daniel P. Berrange <dberrange src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-vnc] Add a 'connection' property to VncDisplay class
- Date: Fri, 9 Dec 2011 17:40:59 +0000 (UTC)
commit d08f9f14b1ed5896d844ed85c079999c99b1da39
Author: Daniel P. Berrange <berrange redhat com>
Date: Fri Oct 29 15:10:09 2010 +0100
Add a 'connection' property to VncDisplay class
Allow apps access to the VncConnection behind the VncDisplay
instance, by adding a property and a getter API
* src/vncdisplay.c: Add a 'connection' property to allow
apps to get the VncConnection object
src/libgtk-vnc_sym.version | 2 ++
src/vncdisplay.c | 21 +++++++++++++++++++++
src/vncdisplay.h | 3 +++
3 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/src/libgtk-vnc_sym.version b/src/libgtk-vnc_sym.version
index 7b641ec..cdc69ab 100644
--- a/src/libgtk-vnc_sym.version
+++ b/src/libgtk-vnc_sym.version
@@ -10,6 +10,8 @@
vnc_display_is_open;
vnc_display_close;
+ vnc_display_get_connection;
+
vnc_display_send_pointer;
vnc_display_send_keys;
vnc_display_send_keys_ex;
diff --git a/src/vncdisplay.c b/src/vncdisplay.c
index f9dedad..e50de76 100644
--- a/src/vncdisplay.c
+++ b/src/vncdisplay.c
@@ -103,6 +103,7 @@ enum
PROP_FORCE_SIZE,
PROP_DEPTH,
PROP_GRAB_KEYS,
+ PROP_CONNECTION,
};
/* Signals */
@@ -215,6 +216,9 @@ vnc_display_get_property (GObject *object,
case PROP_GRAB_KEYS:
g_value_set_boxed(value, vnc->priv->vncgrabseq);
break;
+ case PROP_CONNECTION:
+ g_value_set_object(value, vnc->priv->conn);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1462,6 +1466,13 @@ void vnc_display_close(VncDisplay *obj)
}
+VncConnection * vnc_display_get_connection(VncDisplay *obj)
+{
+ VncDisplayPrivate *priv = obj->priv;
+ return priv->conn;
+}
+
+
void vnc_display_send_keys(VncDisplay *obj, const guint *keyvals, int nkeyvals)
{
vnc_display_send_keys_ex(obj, keyvals,
@@ -1747,6 +1758,16 @@ static void vnc_display_class_init(VncDisplayClass *klass)
G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB));
+ g_object_class_install_property (object_class,
+ PROP_CONNECTION,
+ g_param_spec_object("connection",
+ "Connection",
+ "The VNC connection",
+ VNC_TYPE_CONNECTION,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_NAME |
+ G_PARAM_STATIC_NICK |
+ G_PARAM_STATIC_BLURB));
signals[VNC_CONNECTED] =
g_signal_new ("vnc-connected",
diff --git a/src/vncdisplay.h b/src/vncdisplay.h
index 76f44d4..029f2ab 100644
--- a/src/vncdisplay.h
+++ b/src/vncdisplay.h
@@ -25,6 +25,7 @@
#include <gtk/gtk.h>
#include <glib.h>
#include <vncgrabsequence.h>
+#include <vncconnection.h>
G_BEGIN_DECLS
@@ -93,6 +94,8 @@ gboolean vnc_display_open_host(VncDisplay *obj, const char *host, const char *po
gboolean vnc_display_is_open(VncDisplay *obj);
void vnc_display_close(VncDisplay *obj);
+VncConnection * vnc_display_get_connection(VncDisplay *obj);
+
void vnc_display_send_keys(VncDisplay *obj, const guint *keyvals, int nkeyvals);
/* FIXME: can we just eliminate the old send_keys interface? */
void vnc_display_send_keys_ex(VncDisplay *obj, const guint *keyvals,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]