changeset 29:7aee2a8dbe47

add Alice 1.1
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Tue, 29 Sep 2015 13:50:53 +0900
parents e2de671a155d
children
files build.gradle src/main/java/com/glavsoft/rfb/encoding/decoder/RichCursorDecoder.java src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java src/main/java/com/glavsoft/rfb/protocol/Protocol.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/com/glavsoft/rfb/protocol/state/InitState.java src/viewer_swing/java/com/glavsoft/viewer/Viewer.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java
diffstat 8 files changed, 49 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Mon Dec 08 15:55:38 2014 +0900
+++ b/build.gradle	Tue Sep 29 13:50:53 2015 +0900
@@ -4,7 +4,7 @@
 
 sourceCompatibility = 1.8
 targetCompatibility = 1.8
-version = '2.7.2'
+version = '2.7.3'
 
 project.ext.baseName = 'tightvnc-jviewer'
 def buildNo = processBuildNo(version)
@@ -33,7 +33,7 @@
 
 repositories {
     maven(){
-        url 'http://www.cr.ie.u-ryukyu.ac.jp/hg/maven/raw-file/ba8551c1a5c2/'
+        url 'http://www.cr.ie.u-ryukyu.ac.jp/hg/maven/raw-file/397cf26fcf58/'
     }
     flatDir {
         dirs 'src/libs/'
@@ -42,8 +42,8 @@
 
 dependencies {
     compile fileTree(dir: 'src/libs', include: '*.jar')
-    compile group: 'cr.ie.u_ryukyu.ac.jp', name: 'Alice', version: '1.0', ext: 'jar'
-    viewerSwingCompile group: 'cr.ie.u_ryukyu.ac.jp', name: 'Alice', version: '1.0', ext: 'jar'
+    compile group: 'cr.ie.u_ryukyu.ac.jp', name: 'Alice', version: '1.1', ext: 'jar'
+    viewerSwingCompile group: 'cr.ie.u_ryukyu.ac.jp', name: 'Alice', version: '1.1', ext: 'jar'
     viewerSwingCompile group: 'com.jcraft', name: 'jsch', version: '0.1.+', ext: 'jar'
     viewerSwingRuntime configurations.viewerSwingCompile
 }
@@ -82,7 +82,7 @@
 }
 
 ext {
-    mavenRepository = System.getenv()['HOME']+'/workspace/maven'
+    mavenRepository = System.getenv()['HOME']+'/Development/CR/maven'
 }
 
 uploadArchives {
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/RichCursorDecoder.java	Mon Dec 08 15:55:38 2014 +0900
+++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/RichCursorDecoder.java	Tue Sep 29 13:50:53 2015 +0900
@@ -24,6 +24,7 @@
 
 package com.glavsoft.rfb.encoding.decoder;
 
+import alice.daemon.AliceDaemon;
 import jp.ac.u_ryukyu.ie.cr.DecodeInfomation;
 import alice.datasegment.DataSegment;
 import alice.datasegment.ReceiveData;
@@ -38,6 +39,8 @@
 public class RichCursorDecoder extends Decoder {
 	private static RichCursorDecoder instance = new RichCursorDecoder();
 
+	private AliceDaemon aliceDaemon = new AliceDaemon();
+
 	private RichCursorDecoder() { /*empty*/ }
 
 	public static RichCursorDecoder getInstance() {
@@ -66,10 +69,10 @@
         message.setRectangle(rect);
         message.bitmask = bitmask.clone();
         
-        ReceiveData rData = new ReceiveData(buffer.clone(), false, false);
-        DataSegment.getLocal().put("pixelData", rData, null);
-        rData = new ReceiveData(message, false, false);
-        DataSegment.getLocal().put("updateRectangle", rData, null);
+        ReceiveData rData = new ReceiveData(buffer.clone());
+        aliceDaemon.dataSegment.getLocal().put("pixelData", rData, false);
+        rData = new ReceiveData(message);
+        aliceDaemon.dataSegment.getLocal().put("updateRectangle", rData, false);
 		
 		sb = new StringBuilder(" ");
 		for (int i=0; i<bitmask.length; ++i) {
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java	Mon Dec 08 15:55:38 2014 +0900
+++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java	Tue Sep 29 13:50:53 2015 +0900
@@ -27,6 +27,7 @@
 import java.util.zip.DataFormatException;
 import java.util.zip.Inflater;
 
+import alice.daemon.AliceDaemon;
 import jp.ac.u_ryukyu.ie.cr.DecodeInfomation;
 import alice.datasegment.DataSegment;
 import alice.datasegment.ReceiveData;
@@ -40,6 +41,7 @@
     private static final int MAX_TILE_SIZE = 64;
     private int[] decodedBitmap;
     private int[] palette;
+    private AliceDaemon aliceDaemon = new AliceDaemon();
 
     @Override
     public void decode(Reader reader, Renderer renderer,
@@ -53,10 +55,10 @@
         message.setRectangle(rect);
         message.encodingTypeId = EncodingType.ZRLEE.getId();
 
-        ReceiveData rData = new ReceiveData(bytes.clone(), false, false);
-        DataSegment.getLocal().put("pixelData", rData, null);
-        rData = new ReceiveData(message, false, false);
-        DataSegment.getLocal().put("updateRectangle", rData, null);
+        ReceiveData rData = new ReceiveData(bytes.clone());
+        aliceDaemon.dataSegment.getLocal().put("pixelData", rData, false);
+        rData = new ReceiveData(message);
+        aliceDaemon.dataSegment.getLocal().put("updateRectangle", rData, false);
         decode(renderer, rect, bytes, 0);
     }
 
--- a/src/main/java/com/glavsoft/rfb/protocol/Protocol.java	Mon Dec 08 15:55:38 2014 +0900
+++ b/src/main/java/com/glavsoft/rfb/protocol/Protocol.java	Tue Sep 29 13:50:53 2015 +0900
@@ -24,6 +24,7 @@
 
 package com.glavsoft.rfb.protocol;
 
+import alice.daemon.AliceDaemon;
 import alice.datasegment.DataSegment;
 import alice.datasegment.ReceiveData;
 
@@ -66,6 +67,8 @@
     private boolean isTight;
     private String protocolVersion;
 
+	private AliceDaemon aliceDaemon = new AliceDaemon();
+
     public Protocol(Reader reader, Writer writer,
 			IPasswordRetriever passwordRetriever, ProtocolSettings settings) {
 		this.reader = reader;
@@ -195,8 +198,8 @@
 		receiverThread = new Thread(receiverTask, "RfbReceiverTask");
 		receiverThread.start();
 		// add
-		ReceiveData rData = new ReceiveData(this, false, false);
-		DataSegment.getLocal().put("protocol", rData, null);
+		ReceiveData rData = new ReceiveData(this);
+		aliceDaemon.dataSegment.getLocal().put("protocol", rData, false);
 	}
 
     private void correctServerPixelFormat() {
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java	Mon Dec 08 15:55:38 2014 +0900
+++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java	Tue Sep 29 13:50:53 2015 +0900
@@ -24,6 +24,7 @@
 
 package com.glavsoft.rfb.protocol;
 
+import alice.daemon.AliceDaemon;
 import alice.datasegment.DataSegment;
 import alice.datasegment.ReceiveData;
 
@@ -68,6 +69,8 @@
 	private PixelFormat pixelFormat;
 	private boolean needSendPixelFormat;
 
+	private AliceDaemon aliceDaemon = new AliceDaemon();
+
 	public ReceiverTask(Reader reader,
 	                    IRepaintController repaintController, ClipboardController clipboardController,
 	                    DecodersContainer decoders, ProtocolContext context) {
@@ -186,10 +189,10 @@
 				message.setRectangle(rect);
 				message.setPixelFormat(context.getPixelFormat());
 
-				ReceiveData rData = new ReceiveData("dummy", false, false);
-                DataSegment.getLocal().put("pixelData", rData, null);
-				rData = new ReceiveData(message, false, false);
-		        DataSegment.getLocal().put("updateRectangle", rData, null);
+				ReceiveData rData = new ReceiveData("dummy");
+                aliceDaemon.dataSegment.getLocal().put("pixelData", rData, false);
+				rData = new ReceiveData(message);
+		        aliceDaemon.dataSegment.getLocal().put("updateRectangle", rData, false);
 
 				context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, false));
 //				repaintController.repaintCursor();
--- a/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java	Mon Dec 08 15:55:38 2014 +0900
+++ b/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java	Tue Sep 29 13:50:53 2015 +0900
@@ -24,6 +24,7 @@
 
 package com.glavsoft.rfb.protocol.state;
 
+import alice.daemon.AliceDaemon;
 import alice.datasegment.DataSegment;
 import alice.datasegment.ReceiveData;
 
@@ -64,6 +65,8 @@
  */
 public class InitState extends ProtocolState {
 
+	private AliceDaemon aliceDaemon = new AliceDaemon();
+
 	public InitState(ProtocolContext context) {
 		super(context);
 	}
@@ -85,15 +88,15 @@
 	protected void completeContextData(ServerInitMessage serverInitMessage) {
 	    DecodeInfomation mes = new DecodeInfomation();
 	    mes.setServerInitMessage(serverInitMessage);
-	    ReceiveData rData = new ReceiveData(mes, false, false);
-	    DataSegment.getLocal().put("initMessage", rData, null);
+	    ReceiveData rData = new ReceiveData(mes);
+	    aliceDaemon.dataSegment.getLocal().put("initMessage", rData, false);
 
-	    rData = new ReceiveData(mes, false, false);
+	    rData = new ReceiveData(mes);
 	    mes.encodingTypeId = EncodingType.DESKTOP_SIZE.getId();
-	    DataSegment.getLocal().put("updateRectangle", rData, null);
+	    aliceDaemon.dataSegment.getLocal().put("updateRectangle", rData, false);
 
-	    rData = new ReceiveData("dummy", false, false);
-	    DataSegment.getLocal().put("pixelData", rData, null);
+	    rData = new ReceiveData("dummy");
+	    aliceDaemon.dataSegment.getLocal().put("pixelData", rData, false);
 
 		context.setPixelFormat(serverInitMessage.getPixelFormat());
 		context.setFbWidth(serverInitMessage.getFrameBufferWidth());
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java	Mon Dec 08 15:55:38 2014 +0900
+++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java	Tue Sep 29 13:50:53 2015 +0900
@@ -24,6 +24,7 @@
 
 package com.glavsoft.viewer;
 
+import alice.daemon.AliceDaemon;
 import alice.datasegment.DataSegment;
 import alice.datasegment.ReceiveData;
 
@@ -65,6 +66,8 @@
     private boolean needReconnect = true;
     public boolean hideJFrame = false;
 
+    private AliceDaemon aliceDaemon = new AliceDaemon();
+
     public static void main(String[] args) {
 		Parser parser = new Parser();
 		ParametersHandler.completeParserOptions(parser);
@@ -110,8 +113,8 @@
             if ("localhost".equals(parser.getPlainOptionAt(0))) {
                 connectionParams.hostName = "localhost";
                 isApplet = true;
-                ReceiveData rData = new ReceiveData(this, false, false);
-                DataSegment.getLocal().put("viewer", rData, null);
+                ReceiveData rData = new ReceiveData(this);
+                aliceDaemon.dataSegment.getLocal().put("viewer", rData, false);
                 this.needReconnect = false;
                 this.hideJFrame = true;
             };
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java	Mon Dec 08 15:55:38 2014 +0900
+++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java	Tue Sep 29 13:50:53 2015 +0900
@@ -24,6 +24,7 @@
 
 package com.glavsoft.viewer.swing;
 
+import alice.daemon.AliceDaemon;
 import alice.datasegment.DataSegment;
 import alice.datasegment.ReceiveData;
 
@@ -85,6 +86,8 @@
     private boolean isZoomToFitSelected;
     private List<JComponent> kbdButtons;
 
+	private AliceDaemon aliceDaemon = new AliceDaemon();
+
     public SwingViewerWindow(Protocol workingProtocol, ProtocolSettings rfbSettings, UiSettings uiSettings, Surface surface,
                              boolean isSeparateFrame, boolean isApplet, Viewer viewer, String connectionString,
                              ConnectionPresenter presenter) {
@@ -807,8 +810,8 @@
         JButton shareButton = buttonsBar.createButton("share", "Share my screen", new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
-                ReceiveData rData = new ReceiveData("Request", false, false);
-                DataSegment.getLocal().put("Request", rData, null);
+                ReceiveData rData = new ReceiveData("Request");
+                aliceDaemon.dataSegment.getLocal().put("Request", rData, false);
             }
         });
         kbdButtons.add(shareButton);