Mercurial > hg > Applications > TreeVNC
diff src/main/java/com/glavsoft/rfb/protocol/Protocol.java @ 32:758d025ee24b
add TextBox.java
author | one |
---|---|
date | Mon, 03 Sep 2012 17:34:52 +0900 |
parents | 6a4312344a5a |
children | 1b81deb0abb3 |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Sat Sep 01 21:23:30 2012 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Mon Sep 03 17:34:52 2012 +0900 @@ -42,6 +42,7 @@ import java.util.logging.Logger; +import jp.ac.u_ryukyu.treevnc.MyRfbProto; import jp.ac.u_ryukyu.treevnc.server.MyRfbProtoProxy; import jp.ac.u_ryukyu.treevnc.server.VncProxyService; @@ -322,5 +323,35 @@ receiverThread = new Thread(receiverTask); receiverThread.start(); } + + public void startTreeClientHandling(IRfbSessionListener rfbSessionListener, + IRepaintController repaintController, ClipboardController clipboardController, MyRfbProto rfb) { + this.rfbSessionListener = rfbSessionListener; + this.repaintController = repaintController; +// if (settings.getBitsPerPixel() == 0) { +// settings.setBitsPerPixel(pixelFormat.bitsPerPixel); // the same the server sent when not initialized yet +// } + serverPixelFormat = pixelFormat; + serverPixelFormat.trueColourFlag = 1; // correct flag - we don't support color maps + setPixelFormat(createPixelFormat(settings)); + sendMessage(new SetPixelFormatMessage(pixelFormat)); + logger.fine("sent: "+pixelFormat); + + sendSupportedEncodingsMessage(settings); + settings.addListener(this); // to support pixel format (color depth), and encodings changes + settings.addListener(repaintController); + + sendRefreshMessage(); + senderTask = new SenderTask(messageQueue, writer, this); + senderThread = new Thread(senderTask); + senderThread.start(); + decoders.resetDecoders(); + receiverTask = new TreeTask( + reader, repaintController, + clipboardController, + decoders, this, rfb); + receiverThread = new Thread(receiverTask); + receiverThread.start(); + } }