Revision: 4427
http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4427&view=rev
Author: bphinz
Date: 2011-05-17 21:00:34 +0000 (Tue, 17 May 2011)
Log Message:
-----------
add support for SetDesktopSize to java viewer
Modified Paths:
--------------
trunk/java/src/com/tigervnc/rfb/CConnection.java
trunk/java/src/com/tigervnc/rfb/CMsgReaderV3.java
trunk/java/src/com/tigervnc/rfb/CMsgWriterV3.java
trunk/java/src/com/tigervnc/rfb/ConnParams.java
Modified: trunk/java/src/com/tigervnc/rfb/CConnection.java
===================================================================
--- trunk/java/src/com/tigervnc/rfb/CConnection.java 2011-05-17 20:59:45 UTC
(rev 4426)
+++ trunk/java/src/com/tigervnc/rfb/CConnection.java 2011-05-17 21:00:34 UTC
(rev 4427)
@@ -252,10 +252,6 @@
serverPort = port;
}
- //public void setEncryptionType(String type) {
- // encryptionType = type;
- //}
-
public void initSecTypes() {
nSecTypes = 0;
}
@@ -311,8 +307,8 @@
// 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 @@
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;
Modified: trunk/java/src/com/tigervnc/rfb/CMsgReaderV3.java
===================================================================
--- trunk/java/src/com/tigervnc/rfb/CMsgReaderV3.java 2011-05-17 20:59:45 UTC
(rev 4426)
+++ trunk/java/src/com/tigervnc/rfb/CMsgReaderV3.java 2011-05-17 21:00:34 UTC
(rev 4427)
@@ -62,7 +62,7 @@
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:
Modified: trunk/java/src/com/tigervnc/rfb/CMsgWriterV3.java
===================================================================
--- trunk/java/src/com/tigervnc/rfb/CMsgWriterV3.java 2011-05-17 20:59:45 UTC
(rev 4426)
+++ trunk/java/src/com/tigervnc/rfb/CMsgWriterV3.java 2011-05-17 21:00:34 UTC
(rev 4427)
@@ -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 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();
+ }
}
Modified: trunk/java/src/com/tigervnc/rfb/ConnParams.java
===================================================================
--- trunk/java/src/com/tigervnc/rfb/ConnParams.java 2011-05-17 20:59:45 UTC
(rev 4426)
+++ trunk/java/src/com/tigervnc/rfb/ConnParams.java 2011-05-17 21:00:34 UTC
(rev 4427)
@@ -34,6 +34,7 @@
noJpeg = false; qualityLevel = -1;
name_ = null; nEncodings_ = 0; encodings_ = null;
currentEncoding_ = Encodings.encodingRaw; verStrPos = 0;
+ screenLayout = new ScreenSet();
setName("");
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Tigervnc-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits