forked from KolibriOS/kolibrios
VNC client: small bugfixes, use text box from box_lib, refactoring.
git-svn-id: svn://kolibrios.org@5663 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
65fb1ce67e
commit
1fbde44c02
@ -1,257 +1,135 @@
|
||||
red_logon:
|
||||
call draw_window_logon ; at first, draw the window
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; VNC client for KolibriOS ;;
|
||||
;; ;;
|
||||
;; Written by hidnplayr@kolibrios.org ;;
|
||||
;; ;;
|
||||
;; GNU GENERAL PUBLIC LICENSE ;;
|
||||
;; Version 2, June 1991 ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
still_logon: ; main cycle of application begins here
|
||||
mov eax,10 ; wait here for event
|
||||
mcall
|
||||
logon:
|
||||
mcall 40, EVM_MOUSE + EVM_MOUSE_FILTER + EVM_REDRAW + EVM_BUTTON + EVM_KEY
|
||||
|
||||
checkevent_logon: ; Check what event was called _logon: this will be used to return from textbox focus
|
||||
.redraw:
|
||||
mcall 12, 1 ; start window draw
|
||||
pusha
|
||||
; DRAW WINDOW
|
||||
xor eax, eax ; function 0 _logon: define and draw window
|
||||
mov ebx, 160 shl 16 + 330 ; [x start]:[x size]
|
||||
mov ecx, 160 shl 16 + 100 ; [y start]:[y size]
|
||||
mov edx, 0x34DDDDDD ; color of work area RRGGBB
|
||||
mov edi, name ; WINDOW LABEL
|
||||
mcall
|
||||
|
||||
dec eax ; redraw request ?
|
||||
jz red_logon
|
||||
dec eax ; key in buffer ?
|
||||
jz key_logon
|
||||
dec eax ; button in buffer ?
|
||||
jz button_logon
|
||||
mov eax, 8 ; LOGON BUTTON
|
||||
mov ebx, 220 shl 16 + 85
|
||||
mov ecx, 47 shl 16 + 16
|
||||
mov edx, 2
|
||||
mov esi, 0xCCCCCC
|
||||
mcall
|
||||
|
||||
jmp still_logon
|
||||
cmp byte[mode], 0
|
||||
je .servermode
|
||||
|
||||
key_logon: ; key event handler
|
||||
mov al,2 ; eax was zero so will now be 2
|
||||
mcall ; just read it and ignore
|
||||
mov eax, 4 ; function 4 write text to window
|
||||
mov ebx, 25 shl 16 + 15 ; [x start]:[y start]
|
||||
xor ecx, ecx
|
||||
mov edx, userstr ; pointer to text beginning
|
||||
mov esi, passstr-userstr ; text length
|
||||
mcall
|
||||
|
||||
cmp ah,13
|
||||
jne still_logon ; return to main loop
|
||||
add bl, 19
|
||||
mov edx, passstr ; pointer to text beginning
|
||||
mov esi, connectstr-passstr ; text length
|
||||
mcall
|
||||
|
||||
ret ; enter key was pressed => return to logon
|
||||
jmp .drawtherest
|
||||
|
||||
button_logon: ; eax was zero so will now be 17
|
||||
mov al,17 ; get id
|
||||
mcall
|
||||
.servermode:
|
||||
mov eax, 4 ; function 4 write text to window
|
||||
mov ebx, 25 shl 16 + 15 ; [x start] *65536 + [y start]
|
||||
xor ecx, ecx
|
||||
mov edx, serverstr ; pointer to text beginning
|
||||
mov esi, userstr-serverstr ; text length
|
||||
mcall
|
||||
|
||||
cmp ah,1 ; close ?
|
||||
jz close_logon
|
||||
cmp ah,2 ; logon ?
|
||||
je connect_logon
|
||||
cmp ah,5 ; first ?
|
||||
jz dstbtn_logon
|
||||
invoke edit_box_draw, URLbox
|
||||
|
||||
srcbtn_logon:
|
||||
mov dword[addr],first
|
||||
jmp rk_logon
|
||||
.drawtherest:
|
||||
mov ebx, 240 shl 16 + 49 ; [x start] *65536 + [y start]
|
||||
mov edx, connectstr ; pointer to text beginning
|
||||
mov esi, connect_e-connectstr ; text length
|
||||
mcall
|
||||
|
||||
dstbtn_logon:
|
||||
mov dword[addr],second
|
||||
popa
|
||||
inc ebx
|
||||
mcall
|
||||
|
||||
rk_logon:
|
||||
mov edi,[addr] ; load the address of the string
|
||||
xor al,al ; mov al,0 ; the symbol we will search for
|
||||
mov ecx,STRLEN+1 ; length of the string (+1)
|
||||
cld ; search forward
|
||||
repne scasb ; do search now
|
||||
inc ecx ; we've found a zero or ecx became 0
|
||||
mov eax,STRLEN+1
|
||||
sub eax,ecx ; eax = address of <0> character
|
||||
mov [temp],eax ; position
|
||||
.loop:
|
||||
mcall 10 ; wait for event
|
||||
dec eax ; redraw request ?
|
||||
jz .redraw
|
||||
dec eax ; key in buffer ?
|
||||
jz .key
|
||||
dec eax ; button in buffer ?
|
||||
jz .btn
|
||||
sub eax, 3
|
||||
jz .mouse
|
||||
jmp .loop
|
||||
|
||||
cmp dword[addr],dword second
|
||||
jne @f
|
||||
mov dword [passlen],eax
|
||||
@@:
|
||||
.key: ; key event handler
|
||||
mcall 2 ; read key
|
||||
|
||||
call print_text_logon
|
||||
test [URLbox.flags], ed_focus
|
||||
jz mainloop
|
||||
cmp ah, 13 ; enter (return) key
|
||||
je .go
|
||||
invoke edit_box_key, URLbox
|
||||
jmp .loop
|
||||
|
||||
mov edi,[addr] ; address of string
|
||||
add edi,[temp] ; cursor position
|
||||
.go:
|
||||
mov eax, [URLbox.pos]
|
||||
mov byte[serveraddr+eax], 0
|
||||
ret
|
||||
|
||||
.waitev_logon:
|
||||
mov eax,10 ; wait for event
|
||||
mcall
|
||||
cmp eax,2 ; button presed ?
|
||||
jne checkevent_logon ; a key is pressed or redraw is nessesary, goto checkevent
|
||||
mcall ; eax = 2, read button
|
||||
shr eax,8
|
||||
cmp eax,8
|
||||
jnz .nobs_logon ; BACKSPACE
|
||||
cmp edi,[addr]
|
||||
jz .waitev_logon
|
||||
dec edi
|
||||
mov byte[edi],0
|
||||
.btn:
|
||||
mcall 17 ; get id
|
||||
|
||||
cmp dword[addr],second
|
||||
jne @f
|
||||
dec [passlen]
|
||||
@@:
|
||||
cmp ah, 1 ; close ?
|
||||
jz .close
|
||||
cmp ah, 2 ; logon ?
|
||||
je .go
|
||||
|
||||
call print_text_logon
|
||||
jmp .waitev_logon
|
||||
.nobs_logon:
|
||||
cmp eax,13 ; ENTER
|
||||
je still_logon
|
||||
cmp eax,192
|
||||
jne .noclear_logon
|
||||
xor al,al
|
||||
mov edi,[addr]
|
||||
mov ecx,STRLEN
|
||||
rep stosb
|
||||
mov edi,[addr]
|
||||
call print_text_logon
|
||||
jmp .waitev_logon
|
||||
jmp .loop
|
||||
|
||||
.noclear_logon:
|
||||
mov [edi],al
|
||||
.mouse:
|
||||
mcall 23
|
||||
invoke edit_box_mouse, URLbox
|
||||
|
||||
cmp dword[addr],second
|
||||
jne @f
|
||||
inc [passlen]
|
||||
@@:
|
||||
jmp .loop
|
||||
|
||||
call print_text_logon
|
||||
|
||||
inc edi
|
||||
mov esi,[addr]
|
||||
add esi,STRLEN
|
||||
cmp esi,edi
|
||||
jnz .waitev_logon
|
||||
|
||||
jmp still_logon
|
||||
|
||||
|
||||
; print strings (source & destination)
|
||||
print_text_logon:
|
||||
pusha
|
||||
|
||||
mov eax, 8
|
||||
mov ebx, 105*65536+200
|
||||
mov ecx, 31*65536+13
|
||||
mov edx, 4
|
||||
mov esi, 0xEBEBEB
|
||||
mcall
|
||||
|
||||
cmp byte[mode],0
|
||||
je @f
|
||||
|
||||
mov ecx, 49*65536+12
|
||||
inc edx
|
||||
mcall
|
||||
|
||||
@@:
|
||||
mov eax, 4 ; function 4 _logon: write text to window
|
||||
mov ebx, 107*65536+34 ; [x start] *65536 + [y start]
|
||||
xor ecx, ecx ; color of text RRGGBB
|
||||
mov edx, first ; pointer to text beginning
|
||||
mov esi, STRLEN ; text length
|
||||
mcall
|
||||
|
||||
cmp byte[mode],0
|
||||
je dont_draw_pass
|
||||
|
||||
add ebx,16
|
||||
mov edi,[passlen]
|
||||
|
||||
@@:
|
||||
cmp edi,0
|
||||
jle dont_draw_pass
|
||||
|
||||
dec edi
|
||||
mov edx, passchar
|
||||
mov esi, 1
|
||||
mcall
|
||||
add ebx,6*65536
|
||||
jmp @r
|
||||
|
||||
dont_draw_pass:
|
||||
|
||||
popa
|
||||
ret
|
||||
|
||||
close_logon:
|
||||
or eax,-1
|
||||
mcall
|
||||
|
||||
connect_logon:
|
||||
ret
|
||||
|
||||
draw_window_logon:
|
||||
|
||||
mcall 12, 1 ; start window draw
|
||||
pusha
|
||||
; DRAW WINDOW
|
||||
xor eax, eax ; function 0 _logon: define and draw window
|
||||
mov ebx, 160*65536+330 ; [x start] *65536 + [x size]
|
||||
mov ecx, 160*65536+100 ; [y start] *65536 + [y size]
|
||||
mov edx, 0x13DDDDDD ; color of work area RRGGBB
|
||||
mov edi, title ; WINDOW LABEL
|
||||
mcall
|
||||
|
||||
mov eax, 8 ; LOGON BUTTON
|
||||
mov ebx, 220*65536+85
|
||||
mov ecx, 63*65536+16
|
||||
mov edx, 2
|
||||
mov esi, 0xCCCCCC
|
||||
mcall
|
||||
|
||||
|
||||
call print_text_logon
|
||||
|
||||
cmp byte[mode], 0
|
||||
je servermode_
|
||||
|
||||
mov eax, 4 ; function 4 write text to window
|
||||
mov ebx, 25*65536+33 ; [x start] *65536 + [y start]
|
||||
xor ecx, ecx
|
||||
mov edx, userstr ; pointer to text beginning
|
||||
mov esi, passstr-userstr ; text length
|
||||
mcall
|
||||
|
||||
add bl,19
|
||||
mov edx, passstr ; pointer to text beginning
|
||||
mov esi, connectstr-passstr ; text length
|
||||
mcall
|
||||
|
||||
jmp drawtherest_
|
||||
|
||||
servermode_:
|
||||
|
||||
mov eax, 4 ; function 4 write text to window
|
||||
mov ebx, 25*65536+33 ; [x start] *65536 + [y start]
|
||||
xor ecx, ecx
|
||||
mov edx, serverstr ; pointer to text beginning
|
||||
mov esi, userstr-serverstr ; text length
|
||||
mcall
|
||||
|
||||
drawtherest_:
|
||||
|
||||
mov ebx, 240*65536+67 ; [x start] *65536 + [y start]
|
||||
mov edx, connectstr ; pointer to text beginning
|
||||
mov esi, connect_e-connectstr ; text length
|
||||
mcall
|
||||
|
||||
popa
|
||||
inc ebx
|
||||
mcall
|
||||
|
||||
ret
|
||||
.close:
|
||||
mcall -1
|
||||
|
||||
|
||||
; DATA AREA
|
||||
title db 'Kolibrios VNC client by HIDNPLAYR',0
|
||||
|
||||
first: db '192.168.1.5'
|
||||
rb STRLEN
|
||||
second: rb STRLEN
|
||||
|
||||
passchar db '*'
|
||||
passchar db "*"
|
||||
passlen dd 0
|
||||
|
||||
addr dd 0
|
||||
temp dd 0
|
||||
mode db 0 ; 0 = connection details, 1 = authentication
|
||||
mode db 0 ; 0 = connection details, 1 = authentication
|
||||
|
||||
serverstr: db 'server:'
|
||||
userstr: db 'username:'
|
||||
passstr: db 'password:'
|
||||
connectstr: db 'connect !'
|
||||
serverstr db "server:"
|
||||
userstr db "username:"
|
||||
passstr db "password:"
|
||||
connectstr db "connect !"
|
||||
connect_e:
|
||||
|
||||
I_END_logon:
|
||||
|
@ -1,153 +1,78 @@
|
||||
encoding_raw:
|
||||
DEBUGF 1,'RAW\n'
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; VNC client for KolibriOS ;;
|
||||
;; ;;
|
||||
;; Written by hidnplayr@kolibrios.org ;;
|
||||
;; ;;
|
||||
;; GNU GENERAL PUBLIC LICENSE ;;
|
||||
;; Version 2, June 1991 ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
mov ax,[frame.y] ;
|
||||
mov bx,[screen.width] ;
|
||||
mul bx ;
|
||||
shl edx,16 ;
|
||||
mov dx,ax ; [screen.width]*[frame.y]
|
||||
movzx eax,[frame.x]
|
||||
add edx,eax ; [screen.width]*[frame.y]+[frame.x]
|
||||
encoding_raw:
|
||||
|
||||
mov eax,3 ;
|
||||
mul edx ; ([screen.width]*[frame.y]+[frame.x])*3
|
||||
DEBUGF 1,"RAW\n"
|
||||
|
||||
add eax,framebuffer_data ;
|
||||
push eax ; framebuffer_data+([screen.width]*[frame.y]+[frame.x])*3
|
||||
movzx eax, [rectangle.width]
|
||||
movzx ebx, [rectangle.height]
|
||||
mul ebx
|
||||
add eax, esi
|
||||
@@:
|
||||
cmp [datapointer], eax
|
||||
jae @f
|
||||
push eax
|
||||
call read_data.more
|
||||
pop eax
|
||||
jmp @b
|
||||
@@:
|
||||
|
||||
mov ax,[frame.width] ;
|
||||
mov bx,3 ;
|
||||
mul bx ;
|
||||
shl edx,16 ;
|
||||
mov dx,ax ; [frame.width]*3
|
||||
movzx eax, [rectangle.y]
|
||||
movzx ebx, [screen.width]
|
||||
mul ebx ; [screen.width]*[rectangle.y]
|
||||
movzx ebx, [rectangle.x]
|
||||
add eax, ebx ; [screen.width]*[rectangle.y]+[rectangle.x]
|
||||
lea edi, [framebuffer_data+eax*3] ; edi = framebuffer_data+([screen.width]*[rectangle.y]+[rectangle.x])*3
|
||||
|
||||
pop eax ;
|
||||
add edx,eax ; framebuffer_data+([screen.width]*[frame.y]+[frame.x])*3+[frame.width]*3
|
||||
push eax ;
|
||||
push edx ;
|
||||
movzx eax, [screen.width]
|
||||
sub ax, [rectangle.width]
|
||||
lea ebp, [eax*3] ; ebp = ([screen.width]-[rectangle.width])*3
|
||||
|
||||
mov ax,[frame.height] ;
|
||||
dec ax ;
|
||||
mov bx,3 ;
|
||||
mul bx ;
|
||||
mov bx,[screen.width] ;
|
||||
mul bx ;
|
||||
shl edx,16 ;
|
||||
mov dx,ax ;
|
||||
mov ecx,edx ;
|
||||
pop edx ;
|
||||
add ecx,edx ; mov ecx,edx+([frame.height]-1)*[screen.width]*3
|
||||
pop ebx
|
||||
mov bl, 85
|
||||
|
||||
.pixelloop32:
|
||||
cmp ebx,ecx
|
||||
jge next_rectangle
|
||||
movzx edx, [rectangle.height]
|
||||
|
||||
; add esi,2 ; 32 bit code RAW - OK
|
||||
; mov al,[esi] ;
|
||||
; mov [ebx],al ;
|
||||
; inc ebx ;
|
||||
; dec esi ;
|
||||
; ;
|
||||
; mov al,[esi] ;
|
||||
; mov [ebx],al ;
|
||||
; inc ebx ;
|
||||
; dec esi ;
|
||||
; ;
|
||||
; mov al,[esi] ;
|
||||
; mov [ebx],al ;
|
||||
; inc ebx ;
|
||||
; add esi,4 ;
|
||||
.lineloop:
|
||||
movzx ecx, [rectangle.width]
|
||||
|
||||
; push ecx ; 16 bit code RAW
|
||||
; mov cl,51
|
||||
;
|
||||
; mov ax,[esi] ;
|
||||
; xchg al,ah
|
||||
; and al,00011111b ;
|
||||
; xchg al,ah
|
||||
; mul cl
|
||||
; mov [ebx],al ;
|
||||
; inc ebx ;
|
||||
;
|
||||
; mov ax,[esi] ;
|
||||
; xchg al,ah
|
||||
; shr ax,5 ;
|
||||
; xchg al,ah
|
||||
; and al,00011111b ;
|
||||
; mul cl
|
||||
; mov [ebx],al ;
|
||||
; inc ebx ;
|
||||
;
|
||||
; mov ax,[esi] ;
|
||||
; xchg al,ah
|
||||
; shr ax,10 ;
|
||||
; and al,00011111b ;
|
||||
; mul cl
|
||||
; mov [ebx],al ;
|
||||
; inc ebx ;
|
||||
;
|
||||
; inc esi ;
|
||||
; inc esi ;
|
||||
; pop ecx
|
||||
.pixelloop:
|
||||
mov al, [esi]
|
||||
shr al, 4
|
||||
and al, 3
|
||||
mul bl
|
||||
stosb
|
||||
|
||||
push ecx ; 8 bit code RAW - OK
|
||||
mov cl,85 ;
|
||||
;
|
||||
mov al,[esi] ;
|
||||
shr al,4 ;
|
||||
and al,3 ;
|
||||
mul cl ;
|
||||
mov [ebx],al ;
|
||||
inc ebx ;
|
||||
;
|
||||
mov al,[esi] ;
|
||||
shr al,2 ;
|
||||
and al,3 ;
|
||||
mul cl ;
|
||||
mov [ebx],al ;
|
||||
inc ebx ;
|
||||
;
|
||||
mov al,[esi] ;
|
||||
and al,3 ;
|
||||
mul cl ;
|
||||
mov byte[ebx],al ;
|
||||
inc ebx ;
|
||||
inc esi ;
|
||||
pop ecx ;
|
||||
mov al, [esi]
|
||||
shr al, 2
|
||||
and al, 3
|
||||
mul bl
|
||||
stosb
|
||||
|
||||
mov al, [esi]
|
||||
and al, 3
|
||||
mul bl
|
||||
stosb
|
||||
|
||||
cmp ebx,edx
|
||||
jl .pixelloop32
|
||||
inc esi
|
||||
dec ecx
|
||||
jnz .pixelloop
|
||||
|
||||
push edx
|
||||
push ebx
|
||||
mov ax,[screen.width]
|
||||
mov bx,3
|
||||
mul bx
|
||||
shl edx,16
|
||||
mov dx,ax
|
||||
mov eax,edx
|
||||
pop ebx
|
||||
pop edx
|
||||
|
||||
add ebx,eax ; eax = [screen.width]*3
|
||||
add edx,eax
|
||||
|
||||
push edx
|
||||
push ebx
|
||||
mov ax,[frame.width]
|
||||
mov bx,3
|
||||
mul bx
|
||||
shl edx,16
|
||||
mov dx,ax
|
||||
mov eax,edx
|
||||
pop ebx
|
||||
pop edx
|
||||
|
||||
sub ebx,eax ; eax = [frame.width]*3
|
||||
|
||||
jmp .pixelloop32
|
||||
add edi, ebp
|
||||
dec edx
|
||||
jnz .lineloop
|
||||
jmp next_rectangle
|
||||
|
||||
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
|
||||
struct pixel_format
|
||||
bpp db ?
|
||||
depth db ?
|
||||
big_endian db ?
|
||||
true_color db ?
|
||||
red_max dw ?
|
||||
green_max dw ?
|
||||
blue_max dw ?
|
||||
red_shift db ?
|
||||
green_shift db ?
|
||||
blue_shift db ?
|
||||
padding rb 3
|
||||
ends
|
||||
|
||||
struct framebuffer
|
||||
width dw ?
|
||||
height dw ?
|
||||
pixelformat pixel_format
|
||||
name_length dd ?
|
||||
name rb 256
|
||||
ends
|
@ -1,13 +1,26 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; VNC client for KolibriOS ;;
|
||||
;; ;;
|
||||
;; Written by hidnplayr@kolibrios.org ;;
|
||||
;; ;;
|
||||
;; GNU GENERAL PUBLIC LICENSE ;;
|
||||
;; Version 2, June 1991 ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
thread_start:
|
||||
|
||||
DEBUGF 1, 'I am the thread!\n'
|
||||
DEBUGF 1, "I am the thread!\n"
|
||||
|
||||
mcall 40, 0
|
||||
mcall 40, 0 ; disable all events
|
||||
|
||||
; resolve name
|
||||
push esp ; reserve stack place
|
||||
invoke getaddrinfo, first, 0, 0, esp
|
||||
invoke getaddrinfo, serveraddr, 0, 0, esp
|
||||
pop esi
|
||||
; test for error
|
||||
test eax, eax
|
||||
@ -17,215 +30,245 @@ thread_start:
|
||||
mov eax, [eax+sockaddr_in.sin_addr]
|
||||
mov [sockaddr1.ip], eax
|
||||
|
||||
; DEBUGF 1, 'Connecting to %u.%u.%u.%u:%u\n', \
|
||||
; [server_ip]:1, [server_ip+1]:1, \
|
||||
; [server_ip+2]:1, [server_ip+3]:1, \
|
||||
; [server_port]:2
|
||||
DEBUGF 1, "Connecting to %u.%u.%u.%u:%u\n", \
|
||||
[sockaddr1.ip]:1, [sockaddr1.ip+1]:1, \
|
||||
[sockaddr1.ip+2]:1, [sockaddr1.ip+3]:1, \
|
||||
[sockaddr1.port]:2
|
||||
|
||||
mcall socket, AF_INET4, SOCK_STREAM, 0
|
||||
test eax, eax
|
||||
jz exit
|
||||
;;; invoke freeaddrinfo, ??
|
||||
mov [socketnum], eax
|
||||
mcall connect, [socketnum], sockaddr1, 18
|
||||
;;; test eax, eax
|
||||
|
||||
; TODO: implement timeout
|
||||
call wait_for_data
|
||||
|
||||
cmp dword [receive_buffer], 'RFB '
|
||||
cmp dword[receive_buffer], "RFB "
|
||||
jne no_rfb
|
||||
DEBUGF 1, 'received: %s\n', receive_buffer
|
||||
DEBUGF 1, "received: %s\n", receive_buffer
|
||||
mcall send, [socketnum], handshake, 12, 0
|
||||
DEBUGF 1, 'Sending handshake: protocol version\n'
|
||||
DEBUGF 1, "Sending handshake: protocol version\n"
|
||||
|
||||
call wait_for_data
|
||||
|
||||
cmp dword [receive_buffer], 0x00000000
|
||||
cmp dword[receive_buffer], 0x00000000
|
||||
je invalid_security
|
||||
|
||||
cmp dword [receive_buffer], 0x01000000
|
||||
cmp dword[receive_buffer], 0x01000000
|
||||
je no_security
|
||||
|
||||
cmp dword [receive_buffer], 0x02000000
|
||||
cmp dword[receive_buffer], 0x02000000
|
||||
je vnc_security
|
||||
|
||||
DEBUGF 1, "Unknown security type\n"
|
||||
jmp exit
|
||||
|
||||
vnc_security:
|
||||
mov byte[mode], 1
|
||||
call red_logon
|
||||
call logon
|
||||
|
||||
no_security:
|
||||
mcall send, [socketnum], shared, 1, 0
|
||||
DEBUGF 1, 'Sending handshake: shared session?\n'
|
||||
mcall send, [socketnum], ClientInit, 1, 0
|
||||
DEBUGF 1, "ClientInit sent\n"
|
||||
|
||||
call wait_for_data ; now the server should send init message
|
||||
|
||||
DEBUGF 1, 'Serverinit: bpp: %u depth: %u bigendian: %u truecolor: %u\n', \
|
||||
[receive_buffer+framebuffer.pixelformat.bpp]:1, \
|
||||
[receive_buffer+framebuffer.pixelformat.depth]:1, \
|
||||
[receive_buffer+framebuffer.pixelformat.big_endian]:1, \
|
||||
[receive_buffer+framebuffer.pixelformat.true_color]:1
|
||||
DEBUGF 1, "Serverinit: bpp: %u depth: %u bigendian: %u truecolor: %u\n", \
|
||||
[receive_buffer+framebuffer.pixelformat.bpp]:1, \
|
||||
[receive_buffer+framebuffer.pixelformat.depth]:1, \
|
||||
[receive_buffer+framebuffer.pixelformat.big_endian]:1, \
|
||||
[receive_buffer+framebuffer.pixelformat.true_color]:1
|
||||
|
||||
mov eax, dword [receive_buffer]
|
||||
mov dword [fbur.width], eax
|
||||
mov eax, dword[receive_buffer+framebuffer.width]
|
||||
mov dword[fbur.width], eax
|
||||
bswap eax
|
||||
mov dword [screen], eax
|
||||
mov dword[screen], eax
|
||||
DEBUGF 1, "Screen width=%u, height=%u\n", [screen.width]:2, [screen.height]:2
|
||||
|
||||
mcall send, [socketnum], pixel_format8, 20, 0
|
||||
DEBUGF 1, 'Sending pixel format\n'
|
||||
call read_data
|
||||
DEBUGF 1, "Sending pixel format\n"
|
||||
|
||||
; eth.write_tcp [socket],8,encodings
|
||||
; DEBUGF 1,'Sending encoding info\n'
|
||||
; call read_data
|
||||
mcall send, [socketnum], encodings, 8, 0
|
||||
DEBUGF 1, "Sending encoding info\n"
|
||||
|
||||
mov byte [thread_ready], 1
|
||||
mov [thread_ready], 1
|
||||
|
||||
request_rfb:
|
||||
mov [fbur.inc], 2
|
||||
; Request initial update
|
||||
mov [fbur.inc], 0
|
||||
|
||||
request_fbu:
|
||||
DEBUGF 1, "Requesting framebuffer update\n"
|
||||
mcall send, [socketnum], fbur, 10, 0
|
||||
mov [fbur.inc], 1
|
||||
|
||||
thread_loop:
|
||||
call read_data ; Read the data into the buffer
|
||||
|
||||
; cmp eax, 2
|
||||
; jb mainloop
|
||||
|
||||
DEBUGF 1,'Data received, %u bytes\n', eax
|
||||
|
||||
cmp byte [receive_buffer],0
|
||||
lodsb
|
||||
cmp al, 0
|
||||
je framebufferupdate
|
||||
|
||||
cmp byte [receive_buffer],1
|
||||
cmp al, 1
|
||||
je setcolourmapentries
|
||||
|
||||
cmp byte [receive_buffer],2
|
||||
cmp al, 2
|
||||
je bell
|
||||
|
||||
cmp byte [receive_buffer],3
|
||||
cmp al, 3
|
||||
je servercuttext
|
||||
|
||||
|
||||
DEBUGF 1, "Unknown server command: %u\n", al
|
||||
jmp thread_loop
|
||||
|
||||
align 4
|
||||
framebufferupdate:
|
||||
|
||||
mov ax, word [receive_buffer+2]
|
||||
@@:
|
||||
lea eax, [esi+6]
|
||||
cmp [datapointer], eax
|
||||
jae @f
|
||||
call read_data.more
|
||||
jmp @b
|
||||
@@:
|
||||
|
||||
inc esi ; padding
|
||||
lodsw
|
||||
xchg al, ah
|
||||
mov di, ax
|
||||
DEBUGF 1, 'Framebufferupdate: %u frames\n', di
|
||||
mov esi, receive_buffer+4
|
||||
jmp rectangle_loop
|
||||
|
||||
|
||||
next_rectangle:
|
||||
call drawbuffer
|
||||
|
||||
dec di
|
||||
test di, di
|
||||
jz request_rfb
|
||||
mov [rectangles], ax
|
||||
DEBUGF 1, "Framebufferupdate: %u rectangles\n", ax
|
||||
|
||||
rectangle_loop:
|
||||
|
||||
mov edx, [esi]
|
||||
bswap edx
|
||||
mov ebx, edx
|
||||
shr edx, 16
|
||||
mov [frame.x], dx
|
||||
mov [frame.y], bx
|
||||
add esi, 4
|
||||
mov ecx, [esi]
|
||||
bswap ecx
|
||||
mov eax, ecx
|
||||
shr ecx, 16
|
||||
mov [frame.width], cx
|
||||
mov [frame.height], ax
|
||||
add esi, 4
|
||||
mov eax, [esi]
|
||||
add esi, 4
|
||||
@@:
|
||||
lea eax, [esi+12]
|
||||
cmp [datapointer], eax
|
||||
jae @f
|
||||
call read_data.more
|
||||
jmp @b
|
||||
@@:
|
||||
|
||||
mov ebx, esi
|
||||
sub ebx, receive_buffer+12
|
||||
DEBUGF 1, 'frame: width=%u height=%u x=%u y=%u offset:%u encoding:',\
|
||||
[frame.width]:2, [frame.height]:2, [frame.x]:2, [frame.y]:2, ebx
|
||||
lodsd ; position
|
||||
bswap eax
|
||||
mov [rectangle.y], ax
|
||||
shr eax, 16
|
||||
mov [rectangle.x], ax
|
||||
|
||||
lodsd ; size
|
||||
bswap eax
|
||||
mov [rectangle.height], ax
|
||||
shr eax, 16
|
||||
mov [rectangle.width], ax
|
||||
|
||||
lodsd ; encoding
|
||||
DEBUGF 1, "rectangle: width=%u height=%u x=%u y=%u encoding: ",\
|
||||
[rectangle.width]:2, [rectangle.height]:2, [rectangle.x]:2, [rectangle.y]:2
|
||||
|
||||
cmp eax, 0
|
||||
je encoding_raw
|
||||
; cmp eax, 1
|
||||
; je encoding_copyrect
|
||||
cmp eax, 2
|
||||
je encoding_RRE
|
||||
cmp eax, 5
|
||||
je encoding_hextile
|
||||
cmp eax, 16
|
||||
je encoding_ZRLE
|
||||
; cmp eax, 2
|
||||
; je encoding_RRE
|
||||
; cmp eax, 5
|
||||
; je encoding_hextile
|
||||
; cmp eax, 15
|
||||
; je encoding_TRLE
|
||||
; cmp eax, 16
|
||||
; je encoding_ZRLE
|
||||
|
||||
mov ebx, esi
|
||||
sub ebx, receive_buffer+8
|
||||
DEBUGF 1, '\nunknown encoding: %u (offset %u)\n', eax, ebx
|
||||
jmp bell
|
||||
DEBUGF 1, "\nunknown encoding: %u\n", eax
|
||||
jmp thread_loop
|
||||
|
||||
encoding_RRE:
|
||||
;; jmp rectangle_loop
|
||||
|
||||
DEBUGF 1, 'RRE\n'
|
||||
next_rectangle:
|
||||
push esi
|
||||
call drawbuffer
|
||||
pop esi
|
||||
|
||||
jmp next_rectangle
|
||||
dec [rectangles]
|
||||
jnz rectangle_loop
|
||||
jmp request_fbu
|
||||
|
||||
encoding_hextile:
|
||||
|
||||
DEBUGF 1, 'hextile\n'
|
||||
|
||||
jmp next_rectangle
|
||||
|
||||
encoding_ZRLE:
|
||||
|
||||
DEBUGF 1, 'ZRLE\n'
|
||||
|
||||
jmp next_rectangle
|
||||
|
||||
setcolourmapentries:
|
||||
|
||||
DEBUGF 1, 'Server sent SetColourMapEntries message\n'
|
||||
DEBUGF 1, "Server sent SetColourMapEntries message\n"
|
||||
|
||||
; TODO
|
||||
|
||||
jmp thread_loop
|
||||
|
||||
|
||||
bell:
|
||||
mcall 55, 55, , , beep
|
||||
|
||||
jmp thread_loop
|
||||
|
||||
|
||||
servercuttext:
|
||||
|
||||
DEBUGF 1, 'Server cut text\n'
|
||||
DEBUGF 1, "Server cut text\n"
|
||||
|
||||
@@:
|
||||
lea eax, [esi+7]
|
||||
cmp [datapointer], eax
|
||||
jae @f
|
||||
call read_data.more
|
||||
jmp @b
|
||||
@@:
|
||||
|
||||
add esi, 3
|
||||
lodsd
|
||||
bswap eax
|
||||
mov ecx, eax
|
||||
|
||||
@@:
|
||||
lea eax, [esi+ecx]
|
||||
cmp [datapointer], eax
|
||||
jae @f
|
||||
call read_data.more
|
||||
jmp @b
|
||||
@@:
|
||||
|
||||
; TODO: paste text to clipboard
|
||||
|
||||
DEBUGF 1, "%u bytes of text\n", ecx
|
||||
add esi, ecx
|
||||
jmp thread_loop
|
||||
|
||||
|
||||
read_data:
|
||||
mov [datapointer], receive_buffer
|
||||
.loop:
|
||||
mov esi, receive_buffer
|
||||
.more:
|
||||
push ebx ecx edx esi edi
|
||||
mcall recv, [socketnum], [datapointer], 4096, 0
|
||||
pop edi esi edx ecx ebx
|
||||
cmp eax, -1
|
||||
je .done
|
||||
|
||||
add [datapointer], eax
|
||||
|
||||
je .error
|
||||
add [datapointer], eax ; TODO: check for buffer overflow
|
||||
cmp eax, 4096
|
||||
je .loop
|
||||
je .more
|
||||
ret
|
||||
|
||||
.done:
|
||||
mov eax, [datapointer]
|
||||
sub eax, receive_buffer
|
||||
.error:
|
||||
DEBUGF 1, "Socket error!\n"
|
||||
mcall -1
|
||||
ret
|
||||
|
||||
|
||||
|
||||
wait_for_data:
|
||||
wait_for_data: ; FIXME: add timeout
|
||||
mcall recv, [socketnum], receive_buffer, 4096, 0
|
||||
cmp eax, -1
|
||||
je wait_for_data
|
||||
je .error
|
||||
test eax, eax
|
||||
jz wait_for_data
|
||||
|
||||
ret
|
||||
|
||||
.error:
|
||||
DEBUGF 1, "Socket error!\n"
|
||||
mcall -1
|
||||
ret
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;;
|
||||
;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; vncc.asm - VNC client for KolibriOS ;;
|
||||
@ -17,7 +17,6 @@ format binary as ""
|
||||
__DEBUG__ = 1
|
||||
__DEBUG_LEVEL__ = 1
|
||||
|
||||
STRLEN = 64 ; password and server max length
|
||||
xpos = 4 ; coordinates of image
|
||||
ypos = 22 ;
|
||||
|
||||
@ -27,7 +26,7 @@ use32
|
||||
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01' ; 8 byte id
|
||||
db "MENUET01" ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; start of code
|
||||
dd I_END ; size of image
|
||||
@ -36,17 +35,39 @@ use32
|
||||
dd 0x0 , 0x0 ; I_Param , I_Path
|
||||
|
||||
|
||||
include '../../macros.inc'
|
||||
include '../../debug-fdo.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../dll.inc'
|
||||
include '../../struct.inc'
|
||||
include '../../network.inc'
|
||||
include "../../macros.inc"
|
||||
include "../../debug-fdo.inc"
|
||||
include "../../proc32.inc"
|
||||
include "../../dll.inc"
|
||||
include "../../struct.inc"
|
||||
include "../../develop/libraries/box_lib/trunk/box_lib.mac"
|
||||
include "../../network.inc"
|
||||
|
||||
include 'structs.inc'
|
||||
include 'logon.inc'
|
||||
include 'raw.inc'
|
||||
include 'thread.inc'
|
||||
struct pixel_format
|
||||
bpp db ?
|
||||
depth db ?
|
||||
big_endian db ?
|
||||
true_color db ?
|
||||
red_max dw ?
|
||||
green_max dw ?
|
||||
blue_max dw ?
|
||||
red_shift db ?
|
||||
green_shift db ?
|
||||
blue_shift db ?
|
||||
padding rb 3
|
||||
ends
|
||||
|
||||
struct framebuffer
|
||||
width dw ?
|
||||
height dw ?
|
||||
pixelformat pixel_format
|
||||
name_length dd ?
|
||||
name rb 256
|
||||
ends
|
||||
|
||||
include "logon.inc"
|
||||
include "raw.inc"
|
||||
include "thread.inc"
|
||||
|
||||
START:
|
||||
|
||||
@ -57,23 +78,22 @@ START:
|
||||
test eax, eax
|
||||
jnz exit
|
||||
|
||||
call red_logon
|
||||
call logon
|
||||
|
||||
mcall 40, 0 ; no events
|
||||
mcall 40, 0 ; disable all events
|
||||
mcall 67, 0, 0, 0, 0 ; resize the window (hide it)
|
||||
mcall 51, 1, thread_start, thread_stack
|
||||
|
||||
DEBUGF 1,'Thread created: %u\n', eax
|
||||
DEBUGF 1,"Thread created: %u\n", eax
|
||||
|
||||
@@:
|
||||
mcall 5, 10
|
||||
cmp byte [thread_ready], 0
|
||||
cmp byte[thread_ready], 0
|
||||
je @r
|
||||
|
||||
mcall 40, 100111b ; mouse, button, key, redraw
|
||||
mcall 40, EVM_MOUSE + EVM_MOUSE_FILTER + EVM_KEY + EVM_REDRAW + EVM_BUTTON
|
||||
|
||||
|
||||
mov edx, dword [screen]
|
||||
mov edx, dword[screen]
|
||||
movzx esi, dx
|
||||
shr edx, 16
|
||||
add edx, 2*xpos
|
||||
@ -81,35 +101,31 @@ START:
|
||||
mcall 67, 10, 10 ; resize the window
|
||||
|
||||
mainloop:
|
||||
mcall 23, 50 ; wait for event, 0,5s timeout
|
||||
mcall 10 ; wait for event
|
||||
|
||||
dec eax
|
||||
jz redraw
|
||||
|
||||
dec eax
|
||||
jz key
|
||||
|
||||
dec eax
|
||||
jz button
|
||||
|
||||
sub eax, 3
|
||||
jz mouse
|
||||
|
||||
jmp mainloop
|
||||
|
||||
key:
|
||||
|
||||
DEBUGF 1,'Sending key event\n'
|
||||
; DEBUGF 1,"Sending key event\n"
|
||||
|
||||
mcall 2
|
||||
mov byte [keyevent.key+3], ah
|
||||
mov byte[keyevent.key+3], ah
|
||||
|
||||
mcall send, [socketnum], keyevent, 8, 0
|
||||
jmp mainloop
|
||||
|
||||
mouse:
|
||||
|
||||
DEBUGF 1,'Sending mouse event\n'
|
||||
; DEBUGF 1,"Sending mouse event\n"
|
||||
|
||||
mcall 37, 1 ; get mouse pos
|
||||
sub eax, xpos shl 16 + ypos
|
||||
@ -121,7 +137,7 @@ mouse:
|
||||
mcall 37, 2 ; get mouse buttons
|
||||
test al, 00000010b ; test if right button was pressed (bit 1 in kolibri)
|
||||
jz @f
|
||||
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
|
||||
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
|
||||
@@:
|
||||
mov [pointerevent.mask],al
|
||||
|
||||
@ -130,7 +146,7 @@ mouse:
|
||||
|
||||
redraw:
|
||||
|
||||
DEBUGF 1,'Drawing window\n'
|
||||
; DEBUGF 1,"Drawing window\n"
|
||||
|
||||
mcall 12, 1
|
||||
|
||||
@ -148,25 +164,23 @@ redraw:
|
||||
jmp mainloop
|
||||
|
||||
drawbuffer:
|
||||
|
||||
mcall 7, framebuffer_data, dword[screen], 0
|
||||
ret
|
||||
|
||||
|
||||
button:
|
||||
mcall 17 ; get id
|
||||
|
||||
exit:
|
||||
DEBUGF 1, 'Closing time!\n'
|
||||
DEBUGF 1, "Closing time!\n"
|
||||
mcall close, [socketnum]
|
||||
mcall -1
|
||||
|
||||
no_rfb:
|
||||
DEBUGF 1, 'This is no vnc server!\n'
|
||||
DEBUGF 1, "This is no vnc server!\n"
|
||||
jmp exit
|
||||
|
||||
invalid_security:
|
||||
DEBUGF 1, 'Security error: %s\n', receive_buffer+5
|
||||
DEBUGF 1, "Security error: %s\n", receive_buffer+5
|
||||
jmp exit
|
||||
|
||||
|
||||
@ -174,118 +188,143 @@ invalid_security:
|
||||
|
||||
include_debug_strings ; ALWAYS present in data section
|
||||
|
||||
handshake db 'RFB 003.003', 10
|
||||
shared db 0
|
||||
beep db 0x85,0x25,0x85,0x40,0
|
||||
handshake db "RFB 003.003", 10
|
||||
ClientInit db 0 ; not shared
|
||||
beep db 0x85, 0x25, 0x85, 0x40, 0
|
||||
|
||||
pixel_format32 db 0 ; setPixelformat
|
||||
rb 3 ; padding
|
||||
.bpp db 32 ; bits per pixel
|
||||
.depth db 32 ; depth
|
||||
.big_endian db 0 ; big-endian flag
|
||||
.true_color db 1 ; true-colour flag
|
||||
.red_max db 0,255 ; red-max
|
||||
.green_max db 0,255 ; green-max
|
||||
.blue_max db 0,255 ; blue-max
|
||||
.red_shif db 0 ; red-shift
|
||||
.green_shift db 8 ; green-shift
|
||||
.blue_shift db 16 ; blue-shift
|
||||
rb 3 ; padding
|
||||
pixel_format32 db 0 ; setPixelformat
|
||||
db 0, 0, 0 ; padding
|
||||
.bpp db 32 ; bits per pixel
|
||||
.depth db 32 ; depth
|
||||
.big_endian db 0 ; big-endian flag
|
||||
.true_color db 1 ; true-colour flag
|
||||
.red_max db 0, 255 ; red-max
|
||||
.green_max db 0, 255 ; green-max
|
||||
.blue_max db 0, 255 ; blue-max
|
||||
.red_shif db 0 ; red-shift
|
||||
.green_shift db 8 ; green-shift
|
||||
.blue_shift db 16 ; blue-shift
|
||||
db 0, 0, 0 ; padding
|
||||
|
||||
pixel_format16 db 0 ; setPixelformat
|
||||
rb 3 ; padding
|
||||
.bpp db 16 ; bits per pixel
|
||||
.depth db 15 ; depth
|
||||
.big_endian db 0 ; big-endian flag
|
||||
.true_color db 1 ; true-colour flag
|
||||
.red_max db 0,31 ; red-max
|
||||
.green_max db 0,31 ; green-max
|
||||
.blue_max db 0,31 ; blue-max
|
||||
.red_shif db 0 ; red-shift
|
||||
.green_shift db 5 ; green-shift
|
||||
.blue_shift db 10 ; blue-shift
|
||||
rb 3 ; padding
|
||||
pixel_format16 db 0 ; setPixelformat
|
||||
db 0, 0, 0 ; padding
|
||||
.bpp db 16 ; bits per pixel
|
||||
.depth db 15 ; depth
|
||||
.big_endian db 0 ; big-endian flag
|
||||
.true_color db 1 ; true-colour flag
|
||||
.red_max db 0, 31 ; red-max
|
||||
.green_max db 0, 31 ; green-max
|
||||
.blue_max db 0, 31 ; blue-max
|
||||
.red_shif db 0 ; red-shift
|
||||
.green_shift db 5 ; green-shift
|
||||
.blue_shift db 10 ; blue-shift
|
||||
db 0, 0, 0 ; padding
|
||||
|
||||
pixel_format8 db 0 ; setPixelformat
|
||||
rb 3 ; padding
|
||||
.bpp db 8 ; bits per pixel
|
||||
.depth db 6 ; depth
|
||||
.big_endian db 0 ; big-endian flag
|
||||
.true_color db 1 ; true-colour flag
|
||||
.red_max db 0,3 ; red-max
|
||||
.green_max db 0,3 ; green-max
|
||||
.blue_max db 0,3 ; blue-max
|
||||
.red_shif db 0 ; red-shift
|
||||
.green_shift db 2 ; green-shift
|
||||
.blue_shift db 4 ; blue-shift
|
||||
rb 3 ; padding
|
||||
pixel_format8 db 0 ; setPixelformat
|
||||
db 0, 0, 0 ; padding
|
||||
.bpp db 8 ; bits per pixel
|
||||
.depth db 6 ; depth
|
||||
.big_endian db 0 ; big-endian flag
|
||||
.true_color db 1 ; true-colour flag
|
||||
.red_max db 0, 3 ; red-max
|
||||
.green_max db 0, 3 ; green-max
|
||||
.blue_max db 0, 3 ; blue-max
|
||||
.red_shif db 0 ; red-shift
|
||||
.green_shift db 2 ; green-shift
|
||||
.blue_shift db 4 ; blue-shift
|
||||
db 0, 0, 0 ; padding
|
||||
|
||||
encodings db 2 ; setEncodings
|
||||
rb 1 ; padding
|
||||
db 1,0 ; number of encodings
|
||||
db 0,0,0,0 ; raw encoding (DWORD, Big endian order)
|
||||
db 1,0,0,0 ; Copyrect encoding
|
||||
encodings db 2 ; setEncodings
|
||||
db 0 ; padding
|
||||
db 0, 1 ; number of encodings
|
||||
db 0, 0, 0 ,0 ; raw encoding (DWORD, Big endian order)
|
||||
; db 1, 0, 0, 0 ; Copyrect encoding
|
||||
; db
|
||||
|
||||
fbur db 3 ; frame buffer update request
|
||||
.inc db 0 ; incremental
|
||||
fbur db 3 ; frame buffer update request
|
||||
.inc db 0 ; incremental
|
||||
.x dw 0
|
||||
.y dw 0
|
||||
.width dw 0
|
||||
.height dw 0
|
||||
|
||||
keyevent db 4 ; keyevent
|
||||
.down db 0 ; down-flag
|
||||
dw 0 ; padding
|
||||
.key dd 0 ; key
|
||||
keyevent db 4 ; keyevent
|
||||
.down db 0 ; down-flag
|
||||
dw 0 ; padding
|
||||
.key dd 0 ; key
|
||||
|
||||
pointerevent db 5 ; pointerevent
|
||||
.mask db 0 ; button-mask
|
||||
.x dw 0 ; x-position
|
||||
.y dw 0 ; y-position
|
||||
pointerevent db 5 ; pointerevent
|
||||
.mask db 0 ; button-mask
|
||||
.x dw 0 ; x-position
|
||||
.y dw 0 ; y-position
|
||||
|
||||
|
||||
sockaddr1:
|
||||
dw AF_INET4
|
||||
.port dw 0x0c17 ; 5900
|
||||
.port dw 0x0c17 ; 5900
|
||||
.ip dd 0
|
||||
rb 10
|
||||
|
||||
thread_ready db 0
|
||||
mouse_dd dd ?
|
||||
|
||||
URLbox edit_box 200, 25, 16, 0xffffff, 0x6f9480, 0, 0, 0, 65535, serveraddr, mouse_dd, ed_focus, 0, 0
|
||||
|
||||
; import
|
||||
align 4
|
||||
@IMPORT:
|
||||
|
||||
library network, 'network.obj'
|
||||
import network, \
|
||||
getaddrinfo, 'getaddrinfo', \
|
||||
freeaddrinfo, 'freeaddrinfo', \
|
||||
inet_ntoa, 'inet_ntoa'
|
||||
library network, "network.obj",\
|
||||
box_lib, "box_lib.obj",\
|
||||
archiver, "archiver.obj"
|
||||
|
||||
name db 'VNC client', 0
|
||||
import network,\
|
||||
getaddrinfo, "getaddrinfo", \
|
||||
freeaddrinfo, "freeaddrinfo", \
|
||||
inet_ntoa, "inet_ntoa"
|
||||
|
||||
import box_lib,\
|
||||
edit_box_draw, "edit_box",\
|
||||
edit_box_key, "edit_box_key",\
|
||||
edit_box_mouse, "edit_box_mouse",\
|
||||
scrollbar_v_draw, "scrollbar_v_draw",\
|
||||
scrollbar_v_mouse, "scrollbar_v_mouse",\
|
||||
scrollbar_h_draw, "scrollbar_h_draw",\
|
||||
scrollbar_h_mouse, "scrollbar_h_mouse"
|
||||
|
||||
import archiver,\
|
||||
deflate_unpack, "deflate_unpack"
|
||||
|
||||
name db "VNC client "
|
||||
name.dash db 0, " "
|
||||
|
||||
I_END:
|
||||
|
||||
socketnum dd ?
|
||||
datapointer dd ?
|
||||
servername rb 64+1
|
||||
|
||||
frame:
|
||||
.width dw ?
|
||||
.height dw ?
|
||||
.x dw ?
|
||||
.y dw ?
|
||||
socketnum dd ?
|
||||
datapointer dd ?
|
||||
rectangles dw ?
|
||||
|
||||
screen:
|
||||
.height dw ?
|
||||
.width dw ?
|
||||
rectangle:
|
||||
.width dw ?
|
||||
.height dw ?
|
||||
.x dw ?
|
||||
.y dw ?
|
||||
|
||||
receive_buffer rb 5*1024*1024 ; 5 mb buffer for received data (incoming frbupdate etc)
|
||||
framebuffer_data rb 1024*768*3 ; framebuffer
|
||||
screen: ; Remote screen resolution
|
||||
.height dw ?
|
||||
.width dw ?
|
||||
|
||||
serveraddr rb 65536
|
||||
receive_buffer rb 5*1024*1024 ; 5 mb buffer for received data (incoming frbupdate etc)
|
||||
framebuffer_data rb 1024*1024*3 ; framebuffer
|
||||
|
||||
rb 0x1000
|
||||
rb 0x1000
|
||||
thread_stack:
|
||||
|
||||
rb 0x1000
|
||||
rb 0x1000
|
||||
|
||||
IM_END:
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user