aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorBrian Hinz <bphinz@users.sourceforge.net>2011-05-17 21:00:34 +0000
committerBrian Hinz <bphinz@users.sourceforge.net>2011-05-17 21:00:34 +0000
commite7681415dd2f910e7e93de41eb9a4269898cd6a6 (patch)
tree5f74dc276dc54295ac9fe9c35c70373272f3f3e2 /java
parentc2ca4c3214ff7d60728f91f7eee218e8c920455d (diff)
downloadtigervnc-e7681415dd2f910e7e93de41eb9a4269898cd6a6.tar.gz
tigervnc-e7681415dd2f910e7e93de41eb9a4269898cd6a6.zip
add support for SetDesktopSize to java viewer
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4427 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java')
-rw-r--r--java/src/com/tigervnc/rfb/CConnection.java12
-rw-r--r--java/src/com/tigervnc/rfb/CMsgReaderV3.java2
-rw-r--r--java/src/com/tigervnc/rfb/CMsgWriterV3.java29
-rw-r--r--java/src/com/tigervnc/rfb/ConnParams.java1
4 files changed, 35 insertions, 9 deletions
diff --git a/java/src/com/tigervnc/rfb/CConnection.java b/java/src/com/tigervnc/rfb/CConnection.java
index bca2e9df..5acae52b 100644
--- a/java/src/com/tigervnc/rfb/CConnection.java
+++ b/java/src/com/tigervnc/rfb/CConnection.java
@@ -252,10 +252,6 @@ abstract public class CConnection extends CMsgHandler {
serverPort = port;
}
- //public void setEncryptionType(String type) {
- // encryptionType = type;
- //}
-
public void initSecTypes() {
nSecTypes = 0;
}
@@ -311,8 +307,8 @@ abstract public class CConnection extends CMsgHandler {
// Other methods
- public CMsgReader reader() { return reader_; }
- public CMsgWriter writer() { return writer_; }
+ public CMsgReaderV3 reader() { return reader_; }
+ public CMsgWriterV3 writer() { return writer_; }
public InStream getInStream() { return is; }
public OutStream getOutStream() { return os; }
@@ -348,8 +344,8 @@ abstract public class CConnection extends CMsgHandler {
InStream is = null;
OutStream os = null;
- CMsgReader reader_ = null;
- CMsgWriter writer_ = null;
+ CMsgReaderV3 reader_ = null;
+ CMsgWriterV3 writer_ = null;
boolean shared = false;
public CSecurity csecurity;
public SecurityClient security;
diff --git a/java/src/com/tigervnc/rfb/CMsgReaderV3.java b/java/src/com/tigervnc/rfb/CMsgReaderV3.java
index b865a6c7..308d60d1 100644
--- a/java/src/com/tigervnc/rfb/CMsgReaderV3.java
+++ b/java/src/com/tigervnc/rfb/CMsgReaderV3.java
@@ -62,7 +62,7 @@ public class CMsgReaderV3 extends CMsgReader {
int y = is.readU16();
int w = is.readU16();
int h = is.readU16();
- int encoding = is.readU32();
+ int encoding = is.readS32();
switch (encoding) {
case Encodings.pseudoEncodingDesktopSize:
diff --git a/java/src/com/tigervnc/rfb/CMsgWriterV3.java b/java/src/com/tigervnc/rfb/CMsgWriterV3.java
index 24d47567..ec30a826 100644
--- a/java/src/com/tigervnc/rfb/CMsgWriterV3.java
+++ b/java/src/com/tigervnc/rfb/CMsgWriterV3.java
@@ -19,6 +19,7 @@
package com.tigervnc.rfb;
import com.tigervnc.rdr.*;
+import java.util.*;
public class CMsgWriterV3 extends CMsgWriter {
@@ -36,4 +37,32 @@ public class CMsgWriterV3 extends CMsgWriter {
public void endMsg() {
os.flush();
}
+
+ public void writeSetDesktopSize(int width, int height,
+ ScreenSet layout)
+ {
+ if (!cp.supportsSetDesktopSize)
+ throw new Exception("Server does not support SetDesktopSize");
+
+ startMsg(MsgTypes.msgTypeSetDesktopSize);
+ os.pad(1);
+
+ os.writeU16(width);
+ os.writeU16(height);
+
+ os.writeU8(layout.num_screens());
+ os.pad(1);
+
+ for (Iterator iter = layout.screens.iterator(); iter.hasNext(); ) {
+ Screen refScreen = (Screen)iter.next();
+ os.writeU32(refScreen.id);
+ os.writeU16(refScreen.dimensions.tl.x);
+ os.writeU16(refScreen.dimensions.tl.y);
+ os.writeU16(refScreen.dimensions.width());
+ os.writeU16(refScreen.dimensions.height());
+ os.writeU32(refScreen.flags);
+ }
+
+ endMsg();
+ }
}
diff --git a/java/src/com/tigervnc/rfb/ConnParams.java b/java/src/com/tigervnc/rfb/ConnParams.java
index 77acea0e..16c6ff48 100644
--- a/java/src/com/tigervnc/rfb/ConnParams.java
+++ b/java/src/com/tigervnc/rfb/ConnParams.java
@@ -34,6 +34,7 @@ public class ConnParams {
noJpeg = false; qualityLevel = -1;
name_ = null; nEncodings_ = 0; encodings_ = null;
currentEncoding_ = Encodings.encodingRaw; verStrPos = 0;
+ screenLayout = new ScreenSet();
setName("");
}