[gtk-vnc/encoding: 1/4] Added get_last_encoding() in GVNC.



commit 3f327fb589698b3fb67337f1fb0f1ca4a24d7e49
Author: Jonh Wendell <jwendell gnome org>
Date:   Mon Aug 31 10:48:23 2009 -0300

    Added get_last_encoding() in GVNC.
    
    It returns the last encoding sent by the server.

 src/gvnc.c |   12 ++++++++++++
 src/gvnc.h |    1 +
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/gvnc.c b/src/gvnc.c
index 0f0e975..73dc41d 100644
--- a/src/gvnc.c
+++ b/src/gvnc.c
@@ -124,6 +124,7 @@ struct gvnc
 	int width;
 	int height;
 	char *name;
+	int32_t last_encoding;
 
 	int major;
 	int minor;
@@ -1062,6 +1063,11 @@ gboolean gvnc_set_encodings(struct gvnc *gvnc, int n_encoding, int32_t *encoding
 	return !gvnc_has_error(gvnc);
 }
 
+int32_t gvnc_get_last_encoding(struct gvnc *gvnc)
+{
+	return gvnc->last_encoding;
+}
+
 gboolean gvnc_framebuffer_update_request(struct gvnc *gvnc,
 					 uint8_t incremental,
 					 uint16_t x, uint16_t y,
@@ -2157,26 +2163,32 @@ static void gvnc_framebuffer_update(struct gvnc *gvnc, int32_t etype,
 	case GVNC_ENCODING_RAW:
 		gvnc_raw_update(gvnc, x, y, width, height);
 		gvnc_update(gvnc, x, y, width, height);
+		gvnc->last_encoding = GVNC_ENCODING_RAW;
 		break;
 	case GVNC_ENCODING_COPY_RECT:
 		gvnc_copyrect_update(gvnc, x, y, width, height);
 		gvnc_update(gvnc, x, y, width, height);
+		gvnc->last_encoding = GVNC_ENCODING_COPY_RECT;
 		break;
 	case GVNC_ENCODING_RRE:
 		gvnc_rre_update(gvnc, x, y, width, height);
 		gvnc_update(gvnc, x, y, width, height);
+		gvnc->last_encoding = GVNC_ENCODING_RRE;
 		break;
 	case GVNC_ENCODING_HEXTILE:
 		gvnc_hextile_update(gvnc, x, y, width, height);
 		gvnc_update(gvnc, x, y, width, height);
+		gvnc->last_encoding = GVNC_ENCODING_HEXTILE;
 		break;
 	case GVNC_ENCODING_ZRLE:
 		gvnc_zrle_update(gvnc, x, y, width, height);
 		gvnc_update(gvnc, x, y, width, height);
+		gvnc->last_encoding = GVNC_ENCODING_ZRLE;
 		break;
 	case GVNC_ENCODING_TIGHT:
 		gvnc_tight_update(gvnc, x, y, width, height);
 		gvnc_update(gvnc, x, y, width, height);
+		gvnc->last_encoding = GVNC_ENCODING_TIGHT;
 		break;
 	case GVNC_ENCODING_DESKTOP_RESIZE:
 		gvnc_resize(gvnc, width, height);
diff --git a/src/gvnc.h b/src/gvnc.h
index 1b4eefa..801fbd5 100644
--- a/src/gvnc.h
+++ b/src/gvnc.h
@@ -190,6 +190,7 @@ gboolean gvnc_framebuffer_update_request(struct gvnc *gvnc,
 					 uint16_t width, uint16_t height);
 
 gboolean gvnc_set_encodings(struct gvnc *gvnc, int n_encoding, int32_t *encoding);
+int32_t  gvnc_get_last_encoding(struct gvnc *gvnc);
 
 gboolean gvnc_set_pixel_format(struct gvnc *gvnc,
 			       const struct gvnc_pixel_format *fmt);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]