Mercurial > hg > Applications > TreeVNC
annotate src/main/java/jp/ac/u_ryukyu/treevnc/ChangeDesktopSize.java @ 448:344a35b7c47f
send both frame buffer size and selected screen size in Disktop size change (INIT_DATA)
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 18 Jun 2016 20:09:46 +0900 |
parents | 614057b86122 |
children |
rev | line source |
---|---|
440 | 1 package jp.ac.u_ryukyu.treevnc; |
2 | |
448
344a35b7c47f
send both frame buffer size and selected screen size in Disktop size change (INIT_DATA)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
442
diff
changeset
|
3 import com.glavsoft.rfb.encoding.EncodingType; |
344a35b7c47f
send both frame buffer size and selected screen size in Disktop size change (INIT_DATA)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
442
diff
changeset
|
4 |
440 | 5 import java.nio.ByteBuffer; |
6 import java.nio.ByteOrder; | |
7 | |
8 public class ChangeDesktopSize { | |
9 | |
10 private ByteBuffer msg; | |
11 | |
448
344a35b7c47f
send both frame buffer size and selected screen size in Disktop size change (INIT_DATA)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
442
diff
changeset
|
12 public ChangeDesktopSize(int fbwidth, int fbheight,int width, int height, |
441 | 13 int x, int y, EncodingType desktopSize, byte[] initData, short id) { |
448
344a35b7c47f
send both frame buffer size and selected screen size in Disktop size change (INIT_DATA)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
442
diff
changeset
|
14 msg = ByteBuffer.allocate(16+10+initData.length).order(ByteOrder.BIG_ENDIAN); |
440 | 15 msg.put((byte) 0); // FrameBufferUpdate |
16 msg.put((byte) 0); // padding | |
17 msg.putShort((short) 1); // number of rectangle | |
441 | 18 msg.putShort((short) x); |
19 msg.putShort((short) y); | |
448
344a35b7c47f
send both frame buffer size and selected screen size in Disktop size change (INIT_DATA)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
442
diff
changeset
|
20 msg.putShort((short) fbwidth); |
344a35b7c47f
send both frame buffer size and selected screen size in Disktop size change (INIT_DATA)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
442
diff
changeset
|
21 msg.putShort((short) fbheight); |
440 | 22 msg.putInt(desktopSize.getId()); |
448
344a35b7c47f
send both frame buffer size and selected screen size in Disktop size change (INIT_DATA)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
442
diff
changeset
|
23 msg.putInt(initData.length+6); |
441 | 24 msg.putShort(id); |
448
344a35b7c47f
send both frame buffer size and selected screen size in Disktop size change (INIT_DATA)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
442
diff
changeset
|
25 msg.putShort((short) width); |
344a35b7c47f
send both frame buffer size and selected screen size in Disktop size change (INIT_DATA)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
442
diff
changeset
|
26 msg.putShort((short)height); |
440 | 27 msg.put(initData); |
28 msg.flip(); | |
29 | |
30 } | |
31 | |
32 public ByteBuffer getMessage(){ | |
33 return msg; | |
34 } | |
35 | |
36 | |
37 } |