annotate src/main/java/com/glavsoft/rfb/encoding/decoder/AliceVNCMessage.java @ 25:bf9480332e72

reconnect New connection window can select expression
author sugi
date Sun, 09 Nov 2014 11:13:05 +0900
parents 419ac2f759d5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
1 package com.glavsoft.rfb.encoding.decoder;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
2
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
3 import org.msgpack.annotation.Message;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
4
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
5 import com.glavsoft.rfb.encoding.EncodingType;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
6 import com.glavsoft.rfb.encoding.PixelFormat;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
7 import com.glavsoft.rfb.encoding.ServerInitMessage;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
9 @Message
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
10 public class AliceVNCMessage {
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
11 public int x;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
12 public int y;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
13 public int width;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
14 public int height;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
15 public int encodingTypeId;
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
16 public String name;
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
17
11
f9e319a08111 add filed byte[] bitmask
YU
parents: 8
diff changeset
18 // use RichCursorDecoder
f9e319a08111 add filed byte[] bitmask
YU
parents: 8
diff changeset
19 public byte[] bitmask;
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
20
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
21 // pixel format info
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
22 public byte bitsPerPixel;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
23 public byte depth;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
24 public byte bigEndianFlag;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
25 public byte trueColourFlag;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
26 public short redMax;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
27 public short greenMax;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
28 public short blueMax;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
29 public byte redShift;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
30 public byte greenShift;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
31 public byte blueShift;
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
32
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
33 public AliceVNCMessage(){
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
34
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
35 }
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
36
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
37 public void setRectangle(FramebufferUpdateRectangle rect){
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
38 x = rect.x;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
39 y = rect.y;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
40 width = rect.width;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
41 height = rect.height;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
42 encodingTypeId = rect.getEncodingType().getId();
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
43 }
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
44
11
f9e319a08111 add filed byte[] bitmask
YU
parents: 8
diff changeset
45 public FramebufferUpdateRectangle getFramebufferUpdateRectangle(){
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
46 FramebufferUpdateRectangle rect =
11
f9e319a08111 add filed byte[] bitmask
YU
parents: 8
diff changeset
47 new FramebufferUpdateRectangle(x, y, width, height);
f9e319a08111 add filed byte[] bitmask
YU
parents: 8
diff changeset
48 rect.encodingType = EncodingType.byId(encodingTypeId);
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
49
11
f9e319a08111 add filed byte[] bitmask
YU
parents: 8
diff changeset
50 return rect;
f9e319a08111 add filed byte[] bitmask
YU
parents: 8
diff changeset
51 }
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
52
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
53 public EncodingType getEncodingType() {
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
54 return EncodingType.byId(encodingTypeId);
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
55 }
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
56
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
57 public void setPixelFormat(PixelFormat pixelFormat) {
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
58 bitsPerPixel = pixelFormat.bitsPerPixel;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
59 depth = pixelFormat.depth;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
60 bigEndianFlag = pixelFormat.bigEndianFlag;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
61 trueColourFlag = pixelFormat.trueColourFlag;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
62 redMax = pixelFormat.redMax;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
63 greenMax = pixelFormat.greenMax;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
64 blueMax = pixelFormat.blueMax;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
65 redShift = pixelFormat.redShift;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
66 greenShift = pixelFormat.greenShift;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
67 blueShift = pixelFormat.blueShift;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
68 }
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
69
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
70 public PixelFormat getPixelFormat(){
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
71 PixelFormat pixelFormat = new PixelFormat();
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
72
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
73 pixelFormat.bitsPerPixel = bitsPerPixel;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
74 pixelFormat.depth = depth;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
75 pixelFormat.bigEndianFlag = bigEndianFlag;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
76 pixelFormat.trueColourFlag = trueColourFlag;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
77 pixelFormat.redMax = redMax;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
78 pixelFormat.greenMax = greenMax;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
79 pixelFormat.blueMax = blueMax;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
80 pixelFormat.redShift = redShift;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
81 pixelFormat.greenShift = greenShift;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
82 pixelFormat.blueShift = blueShift;
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
83
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
84 return pixelFormat;
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
85 }
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
86
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
87 public void setServerInitMessage(ServerInitMessage serverInitMessage) {
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
88 setPixelFormat(serverInitMessage.getPixelFormat());
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
89 width = serverInitMessage.getFrameBufferWidth();
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
90 height = serverInitMessage.getFrameBufferHeight();
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
91 name = serverInitMessage.getName();
25
bf9480332e72 reconnect New connection window can select expression
sugi
parents: 20
diff changeset
92
8
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
93 }
136ee08cb788 use AliceVNCMessage for sending information with MessagePack
YU
parents:
diff changeset
94 }