[vinagre] Added fd (file descriptor) property in VncConnection class
- From: Jonh Wendell <jwendell src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vinagre] Added fd (file descriptor) property in VncConnection class
- Date: Wed, 23 Sep 2009 15:02:52 +0000 (UTC)
commit ad91b9a77ef6e80bd08fe381fc7d4e5b23d97969
Author: Jonh Wendell <jwendell gnome org>
Date: Wed Sep 23 11:56:50 2009 -0300
Added fd (file descriptor) property in VncConnection class
plugins/vnc/vinagre-vnc-connection.c | 42 ++++++++++++++++++++++++++++++++++
plugins/vnc/vinagre-vnc-connection.h | 4 +++
2 files changed, 46 insertions(+), 0 deletions(-)
---
diff --git a/plugins/vnc/vinagre-vnc-connection.c b/plugins/vnc/vinagre-vnc-connection.c
index d8f17d4..8417904 100644
--- a/plugins/vnc/vinagre-vnc-connection.c
+++ b/plugins/vnc/vinagre-vnc-connection.c
@@ -29,6 +29,7 @@ struct _VinagreVncConnectionPrivate
gboolean view_only;
gboolean scaling;
gint shared;
+ gint fd;
};
enum
@@ -38,6 +39,7 @@ enum
PROP_VIEW_ONLY,
PROP_SCALING,
PROP_SHARED,
+ PROP_FD
};
#define VINAGRE_VNC_CONNECTION_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VINAGRE_TYPE_VNC_CONNECTION, VinagreVncConnectionPrivate))
@@ -52,6 +54,7 @@ vinagre_vnc_connection_init (VinagreVncConnection *conn)
conn->priv->view_only = FALSE;
conn->priv->scaling = FALSE;
conn->priv->shared = -1;
+ conn->priv->fd = 0;
}
static void
@@ -97,6 +100,10 @@ vinagre_vnc_connection_set_property (GObject *object, guint prop_id, const GValu
vinagre_vnc_connection_set_shared (conn, g_value_get_int (value));
break;
+ case PROP_FD:
+ vinagre_vnc_connection_set_fd (conn, g_value_get_int (value));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -130,6 +137,10 @@ vinagre_vnc_connection_get_property (GObject *object, guint prop_id, GValue *val
g_value_set_int (value, conn->priv->shared);
break;
+ case PROP_FD:
+ g_value_set_int (value, conn->priv->fd);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -294,6 +305,20 @@ vinagre_vnc_connection_class_init (VinagreVncConnectionClass *klass)
G_PARAM_STATIC_NAME |
G_PARAM_STATIC_BLURB));
+ g_object_class_install_property (object_class,
+ PROP_FD,
+ g_param_spec_int ("fd",
+ "file descriptor",
+ "the file descriptor for this connection",
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_NICK |
+ G_PARAM_STATIC_NAME |
+ G_PARAM_STATIC_BLURB));
+
}
VinagreConnection *
@@ -368,4 +393,21 @@ vinagre_vnc_connection_get_scaling (VinagreVncConnection *conn)
return conn->priv->scaling;
}
+void
+vinagre_vnc_connection_set_fd (VinagreVncConnection *conn,
+ gint value)
+{
+ g_return_if_fail (VINAGRE_IS_VNC_CONNECTION (conn));
+ g_return_if_fail (value >= 0);
+
+ conn->priv->fd = value;
+}
+gint
+vinagre_vnc_connection_get_fd (VinagreVncConnection *conn)
+{
+ g_return_val_if_fail (VINAGRE_IS_VNC_CONNECTION (conn), 0);
+
+ return conn->priv->fd;
+}
+
/* vim: set ts=8: */
diff --git a/plugins/vnc/vinagre-vnc-connection.h b/plugins/vnc/vinagre-vnc-connection.h
index 5d82786..f0b3a4e 100644
--- a/plugins/vnc/vinagre-vnc-connection.h
+++ b/plugins/vnc/vinagre-vnc-connection.h
@@ -71,6 +71,10 @@ gint vinagre_vnc_connection_get_shared (VinagreVncConnection *conn);
void vinagre_vnc_connection_set_shared (VinagreVncConnection *conn,
gint value);
+gint vinagre_vnc_connection_get_fd (VinagreVncConnection *conn);
+void vinagre_vnc_connection_set_fd (VinagreVncConnection *conn,
+ gint value);
+
G_END_DECLS
#endif /* __VINAGRE_VNC_CONNECTION_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]