Mercurial > hg > Applications > AliceVNC
changeset 10:65d989192d63
change Protocol aliceVNCMessage
author | YU |
---|---|
date | Thu, 18 Sep 2014 21:07:46 +0900 |
parents | eeacdcc50551 |
children | aff2d0bb9c50 |
files | src/main/java/jp/ac/u_ryukyu/alicevnc/ReceiveUpdateRectangle.java |
diffstat | 1 files changed, 34 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/alicevnc/ReceiveUpdateRectangle.java Thu Sep 18 21:06:06 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/alicevnc/ReceiveUpdateRectangle.java Thu Sep 18 21:07:46 2014 +0900 @@ -4,7 +4,7 @@ import com.glavsoft.exceptions.TransportException; import com.glavsoft.rfb.encoding.EncodingType; -import com.glavsoft.rfb.encoding.decoder.DecodeInfo; +import com.glavsoft.rfb.encoding.decoder.AliceVNCMessage; import com.glavsoft.rfb.encoding.decoder.FramebufferUpdateRectangle; import com.glavsoft.rfb.encoding.decoder.ZRLEDecoder; @@ -20,38 +20,49 @@ public ReceiveUpdateRectangle(){ info.setKey("Holder"); - info1.setKey("decodeInfo"); + info1.setKey("aliceVNCMessage"); info2.setKey("_CLIST"); } - + @Override public void run() { - ZRLEDecoder decoder = new ZRLEDecoder(); - RenderAndControllerHolder holder = info.asClass(RenderAndControllerHolder.class); - DecodeInfo decodeInfo = info1.asClass(DecodeInfo.class); - try { - decoder.decode(decodeInfo, holder.renderer); - FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle( - decodeInfo.x, decodeInfo.y, decodeInfo.width, decodeInfo.height); + RenderAndControllerHolder holder = info.asClass(RenderAndControllerHolder.class); + AliceVNCMessage message = info1.asClass(AliceVNCMessage.class); + + if (message.getEncodingType() == EncodingType.ZRLE){ + ZRLEDecoder decoder = new ZRLEDecoder(); + decoder.decode(message, holder.getRenderer()); + FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle( + message.x, message.y, message.width, message.height); + + rect.encodingType = EncodingType.byId(message.encodingTypeId); + + holder.getRepaintController().repaintBitmap(rect); + + + } else if (message.getEncodingType() == EncodingType.DESKTOP_SIZE) { - rect.encodingType = EncodingType.byId(decodeInfo.encodingTypeId); + + holder.setRenderer( + holder.getRepaintController().createRenderer(null ,message.width, + message.height, holder.getRenderer().pixelFormat) + ); + + + } - holder.repaintController.repaintBitmap(rect); + @SuppressWarnings("unchecked") + ArrayList<String> clist = info2.asClass(ArrayList.class); + for (String node : clist){ + if (!"parent".equals(node)) + ods.put(node, "aliceVNCMessage", info1.getVal()); + } + new ReceiveUpdateRectangle(); + } catch (TransportException e) { e.printStackTrace(); } - - - @SuppressWarnings("unchecked") - ArrayList<String> clist = info2.asClass(ArrayList.class); - for (String node : clist){ - if (!"parent".equals(node)) - ods.put(node, "decodeInfo", info1.getVal()); - } - - new ReceiveUpdateRectangle(); - } }