@@ -35,6 +35,28 @@ var RFB;
35
35
this . _rfb_tightvnc = false ;
36
36
this . _rfb_xvp_ver = 0 ;
37
37
38
+ // In preference order
39
+ this . _encodings = [
40
+ [ 'COPYRECT' , 0x01 ] ,
41
+ [ 'TIGHT' , 0x07 ] ,
42
+ [ 'TIGHT_PNG' , - 260 ] ,
43
+ [ 'HEXTILE' , 0x05 ] ,
44
+ [ 'RRE' , 0x02 ] ,
45
+ [ 'RAW' , 0x00 ] ,
46
+ [ 'DesktopSize' , - 223 ] ,
47
+ [ 'Cursor' , - 239 ] ,
48
+
49
+ // Psuedo-encoding settings
50
+ //['JPEG_quality_lo', -32 ],
51
+ [ 'JPEG_quality_med' , - 26 ] ,
52
+ //['JPEG_quality_hi', -23 ],
53
+ //['compress_lo', -255 ],
54
+ [ 'compress_hi' , - 247 ] ,
55
+ [ 'last_rect' , - 224 ] ,
56
+ [ 'xvp' , - 309 ] ,
57
+ [ 'ExtendedDesktopSize' , - 308 ]
58
+ ] ;
59
+
38
60
this . _encHandlers = { } ;
39
61
this . _encNames = { } ;
40
62
this . _encStats = { } ;
@@ -109,6 +131,7 @@ var RFB;
109
131
'wsProtocols' : [ 'binary' , 'base64' ] , // Protocols to use in the WebSocket connection
110
132
'repeaterID' : '' , // [UltraVNC] RepeaterID to connect to
111
133
'viewportDrag' : false , // Move the viewport on mouse drags
134
+
112
135
// Callback functions
113
136
'onUpdateState' : function ( ) { } , // onUpdateState(rfb, state, oldstate, statusMsg): state update/change
114
137
'onPasswordRequired' : function ( ) { } , // onPasswordRequired(rfb): VNC password is required
@@ -121,53 +144,6 @@ var RFB;
121
144
'onXvpInit' : function ( ) { } , // onXvpInit(version): XVP extensions active for this connection
122
145
} ) ;
123
146
124
- try {
125
- // Use my custom 'jpeg_quality'.
126
- this . _encodings = [
127
- // ['COPYRECT', 0x01 ],
128
- [ 'TIGHT' , 0x07 ] ,
129
- [ 'TIGHT_PNG' , - 260 ] ,
130
- [ 'HEXTILE' , 0x05 ] ,
131
- [ 'RRE' , 0x02 ] ,
132
- [ 'RAW' , 0x00 ] ,
133
- [ 'DesktopSize' , - 223 ] ,
134
- [ 'Cursor' , - 239 ] ,
135
-
136
- // Psuedo-encoding settings
137
- [ 'JPEG_quality_lo' , - 32 + jpeg_quality ] ,
138
- // ['JPEG_quality_med', -28 ],
139
- // ['JPEG_quality_hi', -23 ],
140
- // ['compress_lo', -255 ],
141
- [ 'compress_hi' , - 247 ] ,
142
- [ 'last_rect' , - 224 ] ,
143
- [ 'xvp' , - 309 ] ,
144
- [ 'ExtendedDesktopSize' , - 308 ]
145
- ] ;
146
- }
147
- catch ( e ) {
148
- // If my custom 'jpeg_quality' is not defined, just use default setting.
149
- this . _encodings = [
150
- [ 'COPYRECT' , 0x01 ] ,
151
- [ 'TIGHT' , 0x07 ] ,
152
- [ 'TIGHT_PNG' , - 260 ] ,
153
- [ 'HEXTILE' , 0x05 ] ,
154
- [ 'RRE' , 0x02 ] ,
155
- [ 'RAW' , 0x00 ] ,
156
- [ 'DesktopSize' , - 223 ] ,
157
- [ 'Cursor' , - 239 ] ,
158
-
159
- // Psuedo-encoding settings
160
- //['JPEG_quality_lo', -32 ],
161
- [ 'JPEG_quality_med' , - 26 ] ,
162
- //['JPEG_quality_hi', -23 ],
163
- //['compress_lo', -255 ],
164
- [ 'compress_hi' , - 247 ] ,
165
- [ 'last_rect' , - 224 ] ,
166
- [ 'xvp' , - 309 ] ,
167
- [ 'ExtendedDesktopSize' , - 308 ]
168
- ] ;
169
- }
170
-
171
147
// main setup
172
148
Util . Debug ( ">> RFB.constructor" ) ;
173
149
0 commit comments