annotate src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java @ 248:e6abf4b0c92e

add numberOfRectangle in checkDelay
author Miwa Oshiro <e115747@ie.u-ryukyu.ac.jp>
date Fri, 24 Oct 2014 14:38:55 +0900
parents 8ab1f6905db4
children 7ef19658eb41
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
57
17b702648079 version2.7.2 original version.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1 // Copyright (C) 2010, 2011, 2012, 2013 GlavSoft LLC.
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 // All rights reserved.
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 //
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 //-------------------------------------------------------------------------
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 // This file is part of the TightVNC software. Please visit our Web site:
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 //
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 // http://www.tightvnc.com/
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 //
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 // This program is free software; you can redistribute it and/or modify
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 // it under the terms of the GNU General Public License as published by
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 // the Free Software Foundation; either version 2 of the License, or
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 // (at your option) any later version.
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 //
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 // This program is distributed in the hope that it will be useful,
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 // GNU General Public License for more details.
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 //
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 // You should have received a copy of the GNU General Public License along
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 // with this program; if not, write to the Free Software Foundation, Inc.,
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 //-------------------------------------------------------------------------
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 //
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 package com.glavsoft.rfb.protocol;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 import com.glavsoft.rfb.IPasswordRetriever;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 import com.glavsoft.rfb.client.ClientToServerMessage;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 import com.glavsoft.rfb.encoding.PixelFormat;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 import com.glavsoft.rfb.protocol.state.ProtocolState;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 import com.glavsoft.transport.Reader;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 import com.glavsoft.transport.Writer;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 public interface ProtocolContext {
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 void changeStateTo(ProtocolState state);
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 IPasswordRetriever getPasswordRetriever();
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 ProtocolSettings getSettings();
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41
57
17b702648079 version2.7.2 original version.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
42 Writer getWriter();
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 Reader getReader();
18
075fb190d5d4 modify protocol.java
one
parents: 0
diff changeset
44
075fb190d5d4 modify protocol.java
one
parents: 0
diff changeset
45 byte[] getInitData();
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 int getFbWidth();
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 void setFbWidth(int frameBufferWidth);
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 int getFbHeight();
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 void setFbHeight(int frameBufferHeight);
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 PixelFormat getPixelFormat();
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 void setPixelFormat(PixelFormat pixelFormat);
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 void setRemoteDesktopName(String name);
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 void sendMessage(ClientToServerMessage message);
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 String getRemoteDesktopName();
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 void sendRefreshMessage();
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 void cleanUpSession(String message);
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65
57
17b702648079 version2.7.2 original version.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
66 void setTight(boolean isTight);
17b702648079 version2.7.2 original version.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
67 boolean isTight();
17b702648079 version2.7.2 original version.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
68
17b702648079 version2.7.2 original version.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
69 void setProtocolVersion(String protocolVersion);
17b702648079 version2.7.2 original version.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
70 String getProtocolVersion();
17b702648079 version2.7.2 original version.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
71
18
075fb190d5d4 modify protocol.java
one
parents: 0
diff changeset
72 void setInitData(byte[] initData);
102
1f7ee648e1f6 inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 59
diff changeset
73
1f7ee648e1f6 inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 59
diff changeset
74 void resetDecoder();
1f7ee648e1f6 inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 59
diff changeset
75
1f7ee648e1f6 inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 59
diff changeset
76 void stopReceiverTask();
248
e6abf4b0c92e add numberOfRectangle in checkDelay
Miwa Oshiro <e115747@ie.u-ryukyu.ac.jp>
parents: 169
diff changeset
77
e6abf4b0c92e add numberOfRectangle in checkDelay
Miwa Oshiro <e115747@ie.u-ryukyu.ac.jp>
parents: 169
diff changeset
78 int getNumberOfRectangle();
e6abf4b0c92e add numberOfRectangle in checkDelay
Miwa Oshiro <e115747@ie.u-ryukyu.ac.jp>
parents: 169
diff changeset
79
124
214d4f206431 add TreeVNC command number.
oc
parents: 106
diff changeset
80 /**
214d4f206431 add TreeVNC command number.
oc
parents: 106
diff changeset
81 * TreeVNC expension command (server to client)
214d4f206431 add TreeVNC command number.
oc
parents: 106
diff changeset
82 * 0 : command byte
214d4f206431 add TreeVNC command number.
oc
parents: 106
diff changeset
83 * 1-3 : padding
214d4f206431 add TreeVNC command number.
oc
parents: 106
diff changeset
84 * 4 : length U32
214d4f206431 add TreeVNC command number.
oc
parents: 106
diff changeset
85 * length : text
214d4f206431 add TreeVNC command number.
oc
parents: 106
diff changeset
86 *
214d4f206431 add TreeVNC command number.
oc
parents: 106
diff changeset
87 */
159
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
88 public enum TreeCommand {
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
89 FIND_ROOT ( 220),
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
90 FIND_ROOT_REPLY (221),
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
91 WHERE_TO_CONNECT (222),
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
92 CONNECT_TO (223),
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
93 CONNECT_TO_AS_LEADER (224),
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
94 LOST_PARENT (225),
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
95 NOT_FOUND_PARENT (226),
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
96 NEW_NODE (227),
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
97 QUIT_LOOP (228);
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
98
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
99 public final int cmd;
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
100 TreeCommand(int cmd) {
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
101 this.cmd = cmd;
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
102 }
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
103
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
104 public static TreeCommand create(int i) {
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
105 switch (i) {
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
106 case 220: return FIND_ROOT ;
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
107 case 221: return FIND_ROOT_REPLY;
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
108 case 222: return WHERE_TO_CONNECT;
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
109 case 223: return CONNECT_TO ;
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
110 case 224: return CONNECT_TO_AS_LEADER ;
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
111 case 225: return LOST_PARENT ;
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
112 case 226: return NOT_FOUND_PARENT ;
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
113 case 227: return NEW_NODE ;
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
114 case 228: default:
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
115 return QUIT_LOOP;
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
116 }
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
117 }
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
118 }
1c9f6acdfeb2 TreeCommand enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
119
59
433c79184c05 merge version2.7.2
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents: 57 38
diff changeset
120 }