Mercurial > hg > Applications > TreeVNC
changeset 267:5f697251860b
add --filterSingleDisplay option.
author | oc |
---|---|
date | Tue, 09 Dec 2014 10:50:26 +0900 |
parents | 17eb729d64be |
children | 4a0c97cfb774 |
files | src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java src/viewer_swing/java/com/glavsoft/viewer/Viewer.java src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java |
diffstat | 6 files changed, 38 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Tue Dec 09 09:47:57 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Tue Dec 09 10:50:26 2014 +0900 @@ -231,8 +231,8 @@ timer.schedule(new TimerTask() { @Override public void run() { - context.setFbWidth(rfb.fixingSizeWidth); - context.setFbHeight(rfb.fixingSizeHeight); + context.setFbWidth(rfb.fixingSizeWidth); + context.setFbHeight(rfb.fixingSizeHeight); context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, context.getFbWidth(), context.getFbHeight(), true)); } }, 0, 100); @@ -243,13 +243,6 @@ FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle(); rect.fill(reader); - /* - if(rect.x > 1920) { - reader.reset(); - return; - } - */ - long time = System.currentTimeMillis(); if(rfb.isTreeManager() && rfb.checkDelay) System.out.println(time + " : size : " + rect.width * rect.height); @@ -258,9 +251,12 @@ logger.finest(rect.toString() + (0 == numberOfRectangles ? "\n---" : "")); if (decoder != null) { decoder.decode(reader, renderer, rect); // TreeVNC processing here - if(!(rfb.getCuiVersion())) - if(rect.x < 1920) - repaintController.repaintBitmap(rect); + if(!(rfb.getCuiVersion())) { + if (rfb.filterSingleDisplay) { + if (rect.x < 1920) + repaintController.repaintBitmap(rect); + } + } } else if (rect.getEncodingType() == EncodingType.RICH_CURSOR) { RichCursorDecoder.getInstance().decode(reader, renderer, rect); if(repaintController!=null)
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Tue Dec 09 09:47:57 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Tue Dec 09 10:50:26 2014 +0900 @@ -40,34 +40,37 @@ private RequestScreenThread rThread; public int acceptPort = 0; private String myAddress; - protected boolean readyReconnect = false; - private boolean cuiVersion; private long counter = 0; // packet serial number public ServerSocket servSock; - private boolean permitChangeScreen = true; private static final int INFLATE_BUFSIZE = 1024 * 100; private Inflater inflater = new Inflater(); private Deflater deflater = new Deflater(); ViewerInterface viewer; private short id; // my tree node id ( = 0 in root ) - private boolean leader; private TreeVncCommandChannelListener acceptThread; - private boolean firstTime = true; private TreeRootFinderListener getCast; private CreateConnectionParam cp; - private boolean hasViewer = false; - public boolean showTreeNode = false; - private boolean reconnecting; private short reconnectingId; // Change Server Request to id's node VNC server private TreeVNCNetwork nets = new TreeVNCNetwork(); - private boolean normalTermination; private TreeVncRootSelectionPanel rootSelectionPanel; - private boolean isTreeManager; private String vncInterface; public LinkedList<TreeVNCNode> nodeList; + + protected boolean readyReconnect = false; + private boolean cuiVersion; + private boolean permitChangeScreen = true; + private boolean leader; + private boolean firstTime = true; + private boolean hasViewer = false; + private boolean reconnecting; + private boolean normalTermination; + private boolean isTreeManager; + public boolean showTreeNode = false; public boolean checkDelay = false; public boolean addSerialNum = false; public boolean fixingSize = false; + public boolean filterSingleDisplay = false; + public int frameSizeWidth; public int frameSizeHeight; public int fixingSizeWidth; @@ -620,8 +623,10 @@ bufs.addFirst(blen); bufs.addFirst(header); addSerialNumber(bufs); - if (rect.x < 1920) - multicastqueue.put(bufs); + if (filterSingleDisplay) { + if (rect.x < 1920) + multicastqueue.put(bufs); + } } catch (DataFormatException e) { throw new TransportException(e); } catch (IOException e) { @@ -789,4 +794,8 @@ public void setFixingSize(boolean fixingSize) { this.fixingSize = fixingSize; } + + public void setFilterSingleDisplay(boolean filterSingleDisplay) { + this.filterSingleDisplay = filterSingleDisplay; + } } \ No newline at end of file
--- a/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Tue Dec 09 09:47:57 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Tue Dec 09 10:50:26 2014 +0900 @@ -259,7 +259,7 @@ } @Override - public void proxyStart(String[] args, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize) { + public void proxyStart(String[] args, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize, boolean filterSingleDisplay) { }
--- a/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Tue Dec 09 09:47:57 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Tue Dec 09 10:50:26 2014 +0900 @@ -21,8 +21,8 @@ private boolean checkDelay = false; private boolean addSerialNum = false; private boolean fixingSizeDisplay = false; - private boolean logFile; - private boolean filteringSingleDisplay = false; + private boolean logFile = false; + private boolean filterSingleDisplay = false; public static void main(String[] args) { @@ -67,7 +67,7 @@ public void rootStart(String[] args, ViewerInterface v) { v.setNoConnection(noConnection); // should we accept host name here? - v.proxyStart(args,width,height, showTree, checkDelay, addSerialNum, fixingSizeDisplay); + v.proxyStart(args,width,height, showTree, checkDelay, addSerialNum, fixingSizeDisplay, filterSingleDisplay); v.getRfb().setHasViewer(viewer); if (!permitChangeScreen ) v.getRfb().setPermitChangeScreen(false); v.getRfb().getAcceptThread().waitForShutdown(); @@ -107,10 +107,10 @@ fixingSizeWidth = 1280; fixingSizeHeight = 800; fixingSizeDisplay = true; - } else if ("--SingleDisplay".equals(args[i])) { + } else if ("--filterSingleDisplay".equals(args[i])) { // retina display too large for TreeVNC. // restrict display size. - filteringSingleDisplay = true; + filterSingleDisplay = true; } else if ("--width".equals(args[i])) { width = Integer.parseInt(args[i+1]); i++;
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Tue Dec 09 09:47:57 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Tue Dec 09 10:50:26 2014 +0900 @@ -367,7 +367,7 @@ run(); } - public void proxyStart(String[] argv, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize) { + public void proxyStart(String[] argv, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize, boolean filterSingleDisplay) { fbWidth = width; this.showTree = showTree; // input into arguments Decision @@ -390,6 +390,7 @@ rfb.fixingSizeWidth = fixingSizeWidth; rfb.fixingSizeHeight = fixingSizeHeight; } + rfb.setFilterSingleDisplay(filterSingleDisplay); rfb.setViewer(this); rfb.setCuiVersion(false); rfb.setHasViewer(true); // this flag will be overwrited after this method. Do we have to set here?
--- a/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Tue Dec 09 09:47:57 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Tue Dec 09 10:50:26 2014 +0900 @@ -29,7 +29,7 @@ public void inhelitClients(ViewerInterface vncProxyService, String hostName); - public void proxyStart(String[] args, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize); + public void proxyStart(String[] args, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize, boolean filterSingleDisplay); public void setNoConnection(boolean noConnection);