Subversion Repositories Kolibri OS

Rev

Rev 5722 | Rev 5755 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3618 hidnplayr 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                                 ;;
5663 hidnplayr 3
;; Copyright (C) KolibriOS team 2010-2015. All rights reserved.    ;;
3618 hidnplayr 4
;; Distributed under terms of the GNU General Public License       ;;
5
;;                                                                 ;;
5668 hidnplayr 6
;;  VNC client for KolibriOS                                       ;;
3618 hidnplayr 7
;;                                                                 ;;
8
;;  Written by hidnplayr@kolibrios.org                             ;;
9
;;                                                                 ;;
10
;;          GNU GENERAL PUBLIC LICENSE                             ;;
11
;;             Version 2, June 1991                                ;;
12
;;                                                                 ;;
13
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3545 hidnplayr 14
 
15
format binary as ""
16
 
3618 hidnplayr 17
__DEBUG__       = 1
5670 hidnplayr 18
__DEBUG_LEVEL__ = 2
3618 hidnplayr 19
 
5722 hidnplayr 20
BITS_PER_PIXEL  = 32            ; 8, 16, 24 or 32
5720 hidnplayr 21
SERVERADDRLEN   = 4096
5677 hidnplayr 22
 
3545 hidnplayr 23
use32
24
 
25
        org     0x0
26
 
5663 hidnplayr 27
        db      "MENUET01"      ; 8 byte id
3618 hidnplayr 28
        dd      0x01            ; header version
29
        dd      START           ; start of code
30
        dd      I_END           ; size of image
31
        dd      IM_END          ; memory for app
32
        dd      IM_END          ; esp
5720 hidnplayr 33
        dd      serveraddr, 0x0 ; I_Param , I_Path
3545 hidnplayr 34
 
5663 hidnplayr 35
include "../../macros.inc"
36
include "../../debug-fdo.inc"
37
include "../../proc32.inc"
38
include "../../dll.inc"
39
include "../../struct.inc"
40
include "../../develop/libraries/box_lib/trunk/box_lib.mac"
41
include "../../network.inc"
3545 hidnplayr 42
 
5722 hidnplayr 43
struct  PixelFormat
5663 hidnplayr 44
        bpp             db ?
45
        depth           db ?
46
        big_endian      db ?
47
        true_color      db ?
48
        red_max         dw ?
49
        green_max       dw ?
50
        blue_max        dw ?
51
        red_shift       db ?
52
        green_shift     db ?
53
        blue_shift      db ?
54
        padding         rb 3
55
ends
3545 hidnplayr 56
 
5722 hidnplayr 57
struct  ServerInit
5663 hidnplayr 58
        width           dw ?
59
        height          dw ?
5722 hidnplayr 60
        pixelformat     PixelFormat
5663 hidnplayr 61
        name_length     dd ?
5722 hidnplayr 62
        name            db ?
5663 hidnplayr 63
ends
64
 
5668 hidnplayr 65
xpos                    = 4
5670 hidnplayr 66
ypos                    = 21
5668 hidnplayr 67
 
68
TIMEOUT                 = 5             ; timeout in seconds
69
 
70
RECEIVE_BUFFER_SIZE     = 8*1024*1024   ; 8 Mib
71
 
5720 hidnplayr 72
STATUS_CONNECT          = 0
5668 hidnplayr 73
STATUS_CONNECTING       = 1
5670 hidnplayr 74
STATUS_REQ_LOGIN        = 2
75
STATUS_LOGIN            = 3
76
STATUS_CONNECTED        = 4
5680 hidnplayr 77
STATUS_CLOSED           = 5
5668 hidnplayr 78
 
79
STATUS_DISCONNECTED     = 10
80
STATUS_DNS_ERR          = 11
81
STATUS_SOCK_ERR         = 12
82
STATUS_CONNECT_ERR      = 13
83
STATUS_PROTO_ERR        = 14
84
STATUS_SECURITY_ERR     = 15
85
STATUS_LIB_ERR          = 16
86
STATUS_THREAD_ERR       = 17
5680 hidnplayr 87
STATUS_LOGIN_FAILED     = 18
5720 hidnplayr 88
STATUS_SECURITY_ERR_C   = 19
5668 hidnplayr 89
 
5750 hidnplayr 90
WORK_FRAMEBUFFER        = 1 shl 0
91
WORK_CURSOR             = 1 shl 1
92
WORK_GUI                = 1 shl 2
93
 
5715 hidnplayr 94
BYTES_PER_PIXEL = (BITS_PER_PIXEL + 7) / 8
95
 
5750 hidnplayr 96
if BITS_PER_PIXEL = 32
97
        BYTES_PER_CPIXEL= 3
98
else
99
        BYTES_PER_CPIXEL= BYTES_PER_PIXEL
100
end if
101
 
5677 hidnplayr 102
include "keymap.inc"
5668 hidnplayr 103
include "gui.inc"
104
include "network.inc"
5663 hidnplayr 105
include "raw.inc"
5666 hidnplayr 106
include "copyrect.inc"
5668 hidnplayr 107
include "rre.inc"
5716 hidnplayr 108
include "trle.inc"
5717 hidnplayr 109
include "zrle.inc"
5750 hidnplayr 110
include "cursor.inc"
5680 hidnplayr 111
include "des.inc"
5663 hidnplayr 112
 
5750 hidnplayr 113
 
114
if BITS_PER_PIXEL = 8
115
create_lut:
116
        mov     edi, lut_8bpp   ; 332 format
117
        xor     eax, eax
118
        call    green
119
        add     eax, 0x240000
120
        call    green
121
        add     eax, 0x250000
122
        call    green
123
        add     eax, 0x240000
124
        call    green
125
        add     eax, 0x250000
126
        call    green
127
        add     eax, 0x240000
128
        call    green
129
        add     eax, 0x250000
130
        call    green
131
        add     eax, 0x240000
132
        call    green
133
        ret
134
 
135
green:
136
        mov     ah, 0
137
        call    blue
138
        mov     ah, 36
139
        call    blue
140
        add     ah, 37
141
        call    blue
142
        add     ah, 36
143
        call    blue
144
        add     ah, 37
145
        call    blue
146
        add     ah, 36
147
        call    blue
148
        add     ah, 37
149
        call    blue
150
        add     ah, 36
151
        call    blue
152
        ret
153
 
154
blue:
155
        mov     al, 0
156
        stosd
157
        mov     al, 85
158
        stosd
159
        mov     al, 170
160
        stosd
161
        mov     al, 255
162
        stosd
163
        ret
164
end if
165
 
166
 
3545 hidnplayr 167
START:
168
 
169
        mcall   68, 11                  ; init heap
170
 
5668 hidnplayr 171
; Load libraries
3545 hidnplayr 172
        stdcall dll.Load, @IMPORT
173
        test    eax, eax
5668 hidnplayr 174
        jz      @f
175
        mov     [status], STATUS_LIB_ERR
5750 hidnplayr 176
        jmp     draw_gui.first_time
5668 hidnplayr 177
  @@:
3545 hidnplayr 178
 
5750 hidnplayr 179
; When using 8BPP, create lookup table
180
if BITS_PER_PIXEL = 8
181
        call    create_lut
182
end if
183
 
5720 hidnplayr 184
; Check if we got a server address through parameters
185
        cmp     byte[serveraddr], 0
186
        je      @f
187
        xor     al, al
188
        mov     edi, serveraddr
189
        mov     ecx, SERVERADDRLEN
190
        repne scasb
191
        sub     edi, serveraddr+1
192
        mov     [URLbox.size], edi
193
        mov     [URLbox.pos], edi
194
        call    open_connection
195
  @@:
196
 
5668 hidnplayr 197
; Present the user with the GUI and wait for network connection
5750 hidnplayr 198
        call    draw_gui.first_time
3545 hidnplayr 199
 
5668 hidnplayr 200
; Create main window
201
        mcall   71, 1, name             ; reset window caption (add server name)
3545 hidnplayr 202
 
5663 hidnplayr 203
        mov     edx, dword[screen]
3545 hidnplayr 204
        movzx   esi, dx
205
        shr     edx, 16
206
        add     edx, 2*xpos
207
        add     esi, ypos+xpos
208
        mcall   67, 10, 10              ; resize the window
209
 
5668 hidnplayr 210
        mcall   40, EVM_MOUSE + EVM_MOUSE_FILTER + EVM_KEY + EVM_REDRAW + EVM_BUTTON
211
 
5670 hidnplayr 212
        mcall   66, 1, 1                ; Switch keyboard to scancode mode
213
 
5677 hidnplayr 214
        call    generate_keymap
215
 
5668 hidnplayr 216
redraw:
217
        mcall   12, 1
218
 
219
        mov     ebx, dword[screen]
220
        movzx   ecx, bx
221
        shr     ebx, 16
222
        mov     edx, 0x74ffffff
223
        mov     edi, name
224
        mcall   0                       ; draw window
225
 
226
        mcall   12, 2
227
 
5670 hidnplayr 228
draw_framebuffer:
5720 hidnplayr 229
        DEBUGF  1, "Drawing framebuffer\n"
5722 hidnplayr 230
        mcall   7, framebuffer, dword[screen], 0
5750 hidnplayr 231
        and     [work], not WORK_FRAMEBUFFER
5670 hidnplayr 232
 
3545 hidnplayr 233
mainloop:
5668 hidnplayr 234
        cmp     [status], STATUS_CONNECTED
235
        jne     draw_gui
5750 hidnplayr 236
        test    [work], WORK_FRAMEBUFFER
237
        jnz     draw_framebuffer
238
        test    [work], WORK_CURSOR
239
        jnz     update_cursor
3545 hidnplayr 240
 
5750 hidnplayr 241
        mcall   23, 10          ; Check for event with 0,1s timeout
5668 hidnplayr 242
 
3545 hidnplayr 243
        dec     eax
244
        jz      redraw
245
        dec     eax
246
        jz      key
247
        dec     eax
248
        jz      button
249
        sub     eax, 3
250
        jz      mouse
251
        jmp     mainloop
252
 
253
key:
5677 hidnplayr 254
        mcall   66, 3
5693 hidnplayr 255
        mov     ebx, eax        ; get modifier keys
5677 hidnplayr 256
 
5693 hidnplayr 257
        mcall   2               ; get key scancode
258
        cmp     ah, 224         ; extended keycode?
259
        je      .extended
3545 hidnplayr 260
 
5670 hidnplayr 261
        xor     al, al
262
        test    ah, 0x80        ; key up?
263
        jnz     @f
264
        inc     al
265
  @@:
266
        mov     byte[KeyEvent.down], al
267
 
5693 hidnplayr 268
        movzx   eax, ah
5670 hidnplayr 269
 
5677 hidnplayr 270
        test    ebx, 100000b    ; alt?
5693 hidnplayr 271
        jz      .no_alt
272
        mov     ax, [keymap_alt+eax*2]
5677 hidnplayr 273
        jmp     .key
5693 hidnplayr 274
  .no_alt:
275
 
5677 hidnplayr 276
        test    ebx, 11b        ; shift?
5693 hidnplayr 277
        jz      .no_shift
278
        mov     ax, [keymap_shift+eax*2]
279
        jmp     .key
280
  .no_shift:
281
 
282
        test    ebx, 10000000b  ; numlock ?
283
        jz      .no_numlock
284
        cmp     al, 71
285
        jb      .no_numlock
286
        cmp     al, 83
287
        ja      .no_numlock
288
        mov     ah, [keymap_numlock+eax-71]
289
        xor     al, al
290
        jmp     .key
291
 
292
  .extended:                    ; extended keys always use regular keymap
293
        mcall   2
294
        shr     eax, 8
295
        jz      mainloop
296
  .no_numlock:
297
        mov     ax, [keymap+eax*2]
5677 hidnplayr 298
  .key:
5693 hidnplayr 299
        test    ax, ax
300
        jz      mainloop
5677 hidnplayr 301
        mov     word[KeyEvent.key+2], ax
302
        DEBUGF  1, "Sending key: 0x%x\n", ax
5668 hidnplayr 303
        mcall   send, [socketnum], KeyEvent, 8, 0
3545 hidnplayr 304
        jmp     mainloop
305
 
5677 hidnplayr 306
 
5693 hidnplayr 307
 
3545 hidnplayr 308
mouse:
5677 hidnplayr 309
;        DEBUGF  1, "Sending pointer event\n"
3545 hidnplayr 310
 
311
        mcall   37, 1           ; get mouse pos
312
        bswap   eax
5668 hidnplayr 313
        mov     [PointerEvent.x], ax
3545 hidnplayr 314
        shr     eax, 16
5668 hidnplayr 315
        mov     [PointerEvent.y], ax
3545 hidnplayr 316
 
317
        mcall   37, 2           ; get mouse buttons
318
        test    al, 00000010b   ; test if right button was pressed  (bit 1 in kolibri)
319
        jz      @f
5663 hidnplayr 320
        add     al, 00000010b   ; in RFB protocol it is bit 2, so if we add bit 2 again, we"ll get bit 3 and bit 1 will remain the same
3545 hidnplayr 321
      @@:
5668 hidnplayr 322
        mov     [PointerEvent.mask], al
3545 hidnplayr 323
 
5668 hidnplayr 324
        mcall   send, [socketnum], PointerEvent, 6, 0
3545 hidnplayr 325
        jmp     mainloop
326
 
327
button:
328
        mcall   17              ; get id
5680 hidnplayr 329
        mov     [status], STATUS_CLOSED
5677 hidnplayr 330
        mcall   close, [socketnum]
3545 hidnplayr 331
        mcall   -1
332
 
333
 
5750 hidnplayr 334
update_cursor:
335
 
336
; load cursor
337
        mov     dx, word[cursor.y]
338
        shl     edx, 16
339
        mov     dx, 2
340
        mcall   37, 4, cursor.image
341
        test    eax, eax
342
        jz      .fail
343
 
344
; set cursor
345
        mov     ecx, eax
346
        mcall   37, 5
347
 
348
; delete previously set cursor
349
        mov     ecx, eax
350
        mcall   37, 6
351
 
352
.fail:
353
        and     [work], not WORK_CURSOR
354
        jmp     mainloop
355
 
356
 
5668 hidnplayr 357
; DATA AREA
3545 hidnplayr 358
 
5668 hidnplayr 359
include_debug_strings
3545 hidnplayr 360
 
5693 hidnplayr 361
keymap_numlock:
362
        db      '7', '8', '9', '-'
363
        db      '4', '5', '6', '+'
364
        db      '1', '2', '3'
365
        db      '0', '.'
366
 
5668 hidnplayr 367
HandShake               db "RFB 003.003", 10
3545 hidnplayr 368
 
5668 hidnplayr 369
ClientInit              db 0            ; not shared
3545 hidnplayr 370
 
5750 hidnplayr 371
if BITS_PER_PIXEL = 32
372
 
373
SetPixelFormat          db 0            ; setPixelformat
5668 hidnplayr 374
                        db 0, 0, 0      ; padding
375
.bpp                    db 32           ; bits per pixel
5722 hidnplayr 376
.depth                  db 24           ; depth
5668 hidnplayr 377
.big_endian             db 0            ; big-endian flag
378
.true_color             db 1            ; true-colour flag
379
.red_max                db 0, 255       ; red-max
380
.green_max              db 0, 255       ; green-max
381
.blue_max               db 0, 255       ; blue-max
5722 hidnplayr 382
.red_shift              db 16           ; red-shift
5668 hidnplayr 383
.green_shift            db 8            ; green-shift
5722 hidnplayr 384
.blue_shift             db 0            ; blue-shift
5668 hidnplayr 385
                        db 0, 0, 0      ; padding
3545 hidnplayr 386
 
5750 hidnplayr 387
else if BITS_PER_PIXEL = 24
388
 
389
SetPixelFormat          db 0            ; setPixelformat
5677 hidnplayr 390
                        db 0, 0, 0      ; padding
391
.bpp                    db 24           ; bits per pixel
392
.depth                  db 24           ; depth
393
.big_endian             db 0            ; big-endian flag
394
.true_color             db 1            ; true-colour flag
395
.red_max                db 0, 255       ; red-max
396
.green_max              db 0, 255       ; green-max
397
.blue_max               db 0, 255       ; blue-max
398
.red_shift              db 16           ; red-shift
399
.green_shift            db 8            ; green-shift
400
.blue_shift             db 0            ; blue-shift
401
                        db 0, 0, 0      ; padding
402
 
5750 hidnplayr 403
else if BITS_PER_PIXEL = 16
404
 
405
SetPixelFormat          db 0            ; setPixelformat
5668 hidnplayr 406
                        db 0, 0, 0      ; padding
407
.bpp                    db 16           ; bits per pixel
5677 hidnplayr 408
.depth                  db 16           ; depth
5668 hidnplayr 409
.big_endian             db 0            ; big-endian flag
410
.true_color             db 1            ; true-colour flag
411
.red_max                db 0, 31        ; red-max
5677 hidnplayr 412
.green_max              db 0, 63        ; green-max
5668 hidnplayr 413
.blue_max               db 0, 31        ; blue-max
5677 hidnplayr 414
.red_shift              db 11           ; red-shift
5668 hidnplayr 415
.green_shift            db 5            ; green-shift
5677 hidnplayr 416
.blue_shift             db 0            ; blue-shift
5668 hidnplayr 417
                        db 0, 0, 0      ; padding
3545 hidnplayr 418
 
5750 hidnplayr 419
else if BITS_PER_PIXEL = 8
420
 
421
SetPixelFormat          db 0            ; setPixelformat
5668 hidnplayr 422
                        db 0, 0, 0      ; padding
423
.bpp                    db 8            ; bits per pixel
5677 hidnplayr 424
.depth                  db 8            ; depth
5668 hidnplayr 425
.big_endian             db 0            ; big-endian flag
426
.true_color             db 1            ; true-colour flag
5677 hidnplayr 427
.red_max                db 0, 7         ; red-max
428
.green_max              db 0, 7         ; green-max
5668 hidnplayr 429
.blue_max               db 0, 3         ; blue-max
5750 hidnplayr 430
.red_shift              db 5            ; red-shift
431
.green_shift            db 2            ; green-shift
432
.blue_shift             db 0            ; blue-shift
5668 hidnplayr 433
                        db 0, 0, 0      ; padding
3545 hidnplayr 434
 
5750 hidnplayr 435
end if
436
 
5668 hidnplayr 437
SetEncodings            db 2            ; setEncodings
438
                        db 0            ; padding
5750 hidnplayr 439
                        db 0, 5         ; number of encodings
5720 hidnplayr 440
;                        db 0, 0, 0, 16  ; ZRLE
441
                        db 0, 0, 0, 15  ; TRLE
442
                        db 0, 0, 0, 2   ; RRE
5668 hidnplayr 443
                        db 0, 0, 0, 1   ; Copyrect encoding
5750 hidnplayr 444
                        db 0xff, 0xff, 0xff, 0x11       ; Cursor pseudo encoding
5715 hidnplayr 445
                        db 0, 0, 0, 0   ; raw encoding
5708 hidnplayr 446
  .length = $ - SetEncodings
3545 hidnplayr 447
 
5668 hidnplayr 448
FramebufferUpdateRequest        db 3
449
.inc                            db 0    ; incremental
450
.x                              dw 0
451
.y                              dw 0
452
.width                          dw 0
453
.height                         dw 0
3545 hidnplayr 454
 
5668 hidnplayr 455
KeyEvent                db 4            ; keyevent
456
.down                   db 0            ; down-flag
457
                        dw 0            ; padding
458
.key                    dd 0            ; key
3545 hidnplayr 459
 
5668 hidnplayr 460
PointerEvent            db 5            ; pointerevent
461
.mask                   db 0            ; button-mask
462
.x                      dw 0            ; x-position
463
.y                      dw 0            ; y-position
3545 hidnplayr 464
 
465
 
466
sockaddr1:
5668 hidnplayr 467
                dw AF_INET4
468
.port           dw 0x0c17               ; 5900
469
.ip             dd 0
470
                rb 10
3545 hidnplayr 471
 
5668 hidnplayr 472
beep            db 0x85, 0x25, 0x85, 0x40, 0
5663 hidnplayr 473
 
5720 hidnplayr 474
status                  dd STATUS_CONNECT
5750 hidnplayr 475
work                    dd 0
5670 hidnplayr 476
mouse_dd                dd 0
5720 hidnplayr 477
thread_id               dd 0
5668 hidnplayr 478
 
5717 hidnplayr 479
deflate_buffer          dd 0
480
deflate_length          dd ?
481
deflate_str             dd ?
482
 
5720 hidnplayr 483
URLbox          edit_box 235, 70, 20, 0xffffff, 0x6f9480, 0, 0, 0, SERVERADDRLEN, serveraddr, mouse_dd, ed_focus, 0, 0
5693 hidnplayr 484
USERbox         edit_box 215, 90, 10, 0xffffff, 0x6f9480, 0, 0, 0, 127, username, mouse_dd, ed_focus, 0, 0
485
PASSbox         edit_box 215, 90, 30, 0xffffff, 0x6f9480, 0, 0, 0, 127, password, mouse_dd, ed_pass, 0, 0
5663 hidnplayr 486
 
5668 hidnplayr 487
serverstr       db "server:"
488
userstr         db "username:"
489
passstr         db "password:"
5670 hidnplayr 490
connectstr      db "Connect"
491
loginstr        db "Log in"
5720 hidnplayr 492
cancelstr       db "Cancel"
493
okstr           db "OK"
494
okstr_e:
5668 hidnplayr 495
 
5720 hidnplayr 496
sz_err_disconnected     db "The server has closed the connection unexpectedly.", 0
5668 hidnplayr 497
sz_err_dns              db "Could not resolve hostname.", 0
498
sz_err_sock             db "Could not open socket.", 0
499
sz_err_connect          db "Could not connect to the server.", 0
500
sz_err_proto            db "A protocol error has occured.", 0
5720 hidnplayr 501
sz_err_security         db "An authentication problem has occured.", 0
5668 hidnplayr 502
sz_err_library          db "Could not load needed libraries.", 0
503
sz_err_thread           db "Could not create thread.", 0
5680 hidnplayr 504
sz_err_login_failed     db "Login failed.", 0
5668 hidnplayr 505
 
506
err_msg         dd sz_err_disconnected
507
                dd sz_err_dns
508
                dd sz_err_sock
509
                dd sz_err_connect
510
                dd sz_err_proto
511
                dd sz_err_security
512
                dd sz_err_library
513
                dd sz_err_thread
5680 hidnplayr 514
                dd sz_err_login_failed
5720 hidnplayr 515
                dd sz_err_security_c
5668 hidnplayr 516
 
3545 hidnplayr 517
; import
518
align 4
519
@IMPORT:
520
 
5663 hidnplayr 521
library network,                "network.obj",\
522
        box_lib,                "box_lib.obj",\
523
        archiver,               "archiver.obj"
3545 hidnplayr 524
 
5663 hidnplayr 525
import  network,\
526
        getaddrinfo,            "getaddrinfo",  \
527
        freeaddrinfo,           "freeaddrinfo", \
528
        inet_ntoa,              "inet_ntoa"
3545 hidnplayr 529
 
5663 hidnplayr 530
import  box_lib,\
531
        edit_box_draw,          "edit_box",\
532
        edit_box_key,           "edit_box_key",\
533
        edit_box_mouse,         "edit_box_mouse",\
534
        scrollbar_v_draw,       "scrollbar_v_draw",\
535
        scrollbar_v_mouse,      "scrollbar_v_mouse",\
536
        scrollbar_h_draw,       "scrollbar_h_draw",\
537
        scrollbar_h_mouse,      "scrollbar_h_mouse"
538
 
539
import  archiver,\
5717 hidnplayr 540
        deflate_unpack2,        "deflate_unpack2"
5663 hidnplayr 541
 
5668 hidnplayr 542
name                    db "VNC viewer "
543
.dash                   db 0, " "
5663 hidnplayr 544
 
3545 hidnplayr 545
I_END:
546
 
5663 hidnplayr 547
servername              rb 64+1
3545 hidnplayr 548
 
5720 hidnplayr 549
serveraddr              db 0
550
                        rb SERVERADDRLEN
551
 
5663 hidnplayr 552
socketnum               dd ?
553
datapointer             dd ?
5668 hidnplayr 554
 
5663 hidnplayr 555
rectangles              dw ?
3545 hidnplayr 556
 
5663 hidnplayr 557
rectangle:
5668 hidnplayr 558
.x                      dd ?
559
.y                      dd ?
560
.width                  dd ?
561
.height                 dd ?
3545 hidnplayr 562
 
5668 hidnplayr 563
subrectangles           dd ?
564
 
565
subrectangle:
566
.x                      dd ?
567
.y                      dd ?
568
.width                  dd ?
569
.height                 dd ?
570
 
5663 hidnplayr 571
screen:                 ; Remote screen resolution
572
.height                 dw ?
573
.width                  dw ?
3545 hidnplayr 574
 
5716 hidnplayr 575
palette                 rd 128  ; TRLE/ZRLE
576
palettesize             db ?    ; TRLE/ZRLE
577
 
5677 hidnplayr 578
keymap                  rw 128
579
keymap_shift            rw 128
580
keymap_alt              rw 128
5670 hidnplayr 581
username                rb 128
582
password                rb 128
5750 hidnplayr 583
keys                    rd 32*2 ; DES keys for VNC authentication
5680 hidnplayr 584
 
5750 hidnplayr 585
cursor:
586
.y                      db ?
587
.x                      db ?
588
.image                  rd 32*32
589
 
590
align 4
591
if BITS_PER_PIXEL = 8
592
lut_8bpp                rd 256
593
end if
594
 
5720 hidnplayr 595
sz_err_security_c       rb 512+1
596
 
5668 hidnplayr 597
receive_buffer          rb RECEIVE_BUFFER_SIZE
5722 hidnplayr 598
framebuffer             rb 1280*1024*3  ; framebuffer
3545 hidnplayr 599
 
5663 hidnplayr 600
                        rb 0x1000
3545 hidnplayr 601
thread_stack:
5663 hidnplayr 602
                        rb 0x1000
3545 hidnplayr 603
IM_END:
604