Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 360:c43593064805
add ExtendetDesktopSize
author | one@firefly.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Thu, 06 Aug 2015 19:43:27 +0900 |
parents | 62a6c779fd7f |
children | df063169b0b1 |
files | src/main/java/com/glavsoft/rfb/encoding/EncodingType.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java |
diffstat | 2 files changed, 33 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/EncodingType.java Tue Mar 10 12:20:44 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/EncodingType.java Thu Aug 06 19:43:27 2015 +0900 @@ -90,6 +90,11 @@ */ DESKTOP_SIZE(0xFFFFFF21, "DesktopSize"), /** + * Desktop Size Pseudo encoding allows to notificate client about + * remote screen resolution changed. + */ + EXTENDED_DESKTOP_SIZE(0xFFFFFECC, "ExtendedDesktopSize"), + /** * Cursor position encoding allows to transfer remote cursor position to * client side. */ @@ -148,6 +153,7 @@ pseudoEncodings.add(RICH_CURSOR); pseudoEncodings.add(CURSOR_POS); pseudoEncodings.add(DESKTOP_SIZE); + pseudoEncodings.add(EXTENDED_DESKTOP_SIZE); } public static LinkedHashSet<EncodingType> compressionEncodings = new LinkedHashSet<EncodingType>();
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Tue Mar 10 12:20:44 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Thu Aug 06 19:43:27 2015 +0900 @@ -40,6 +40,7 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.io.UnsupportedEncodingException; +import java.util.LinkedList; import java.util.Timer; import java.util.TimerTask; import java.util.logging.Logger; @@ -251,10 +252,35 @@ } else if (rect.getEncodingType() == EncodingType.CURSOR_POS) { renderer.decodeCursorPosition(rect); repaintController.repaintCursor(); - } else if (rect.getEncodingType() == EncodingType.DESKTOP_SIZE || rect.getEncodingType() == EncodingType.INIT_DATA ) { + } else if (rect.getEncodingType() == EncodingType.DESKTOP_SIZE || rect.getEncodingType() == EncodingType.INIT_DATA + || rect.getEncodingType() == EncodingType.EXTENDED_DESKTOP_SIZE) { + if (rect.getEncodingType() == EncodingType.EXTENDED_DESKTOP_SIZE){ + int numberOfScreen = reader.readByte(); + reader.readBytes(3); + LinkedList<FramebufferUpdateRectangle> screens = new LinkedList<FramebufferUpdateRectangle>(); + for (int i = 0; i < numberOfScreen; i++){ + long id = reader.readUInt32(); + int x = reader.readUInt16(); + int y = reader.readUInt16(); + int width = reader.readUInt16(); + int height = reader.readUInt16(); + long flag = reader.readUInt32(); + + + FramebufferUpdateRectangle screen = new FramebufferUpdateRectangle(x, y, width, height); + screen.port = (int) id; + screen.time = flag; + screens.add(screen); + System.out.println("screen " + id + ":" + "x=" + x + " y=" + y + "width=" + width + "height=" + height); + + } + + return; + } fullscreenFbUpdateIncrementalRequest = new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, false); rfb.setCuiVersion(false); boolean visible = true; + if (rect.getEncodingType() == EncodingType.INIT_DATA) { // VNCServer is changed, initiarize new screen. int length = reader.readInt32();