Rev 3545 | Rev 5668 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5663 | hidnplayr | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
3 | ;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;; |
||
4 | ;; Distributed under terms of the GNU General Public License ;; |
||
5 | ;; ;; |
||
6 | ;; VNC client for KolibriOS ;; |
||
7 | ;; ;; |
||
8 | ;; Written by hidnplayr@kolibrios.org ;; |
||
9 | ;; ;; |
||
10 | ;; GNU GENERAL PUBLIC LICENSE ;; |
||
11 | ;; Version 2, June 1991 ;; |
||
12 | ;; ;; |
||
13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
3545 | hidnplayr | 14 | |
5663 | hidnplayr | 15 | logon: |
16 | mcall 40, EVM_MOUSE + EVM_MOUSE_FILTER + EVM_REDRAW + EVM_BUTTON + EVM_KEY |
||
3545 | hidnplayr | 17 | |
5663 | hidnplayr | 18 | .redraw: |
19 | mcall 12, 1 ; start window draw |
||
20 | pusha |
||
21 | ; DRAW WINDOW |
||
22 | xor eax, eax ; function 0 _logon: define and draw window |
||
23 | mov ebx, 160 shl 16 + 330 ; [x start]:[x size] |
||
24 | mov ecx, 160 shl 16 + 100 ; [y start]:[y size] |
||
25 | mov edx, 0x34DDDDDD ; color of work area RRGGBB |
||
26 | mov edi, name ; WINDOW LABEL |
||
27 | mcall |
||
3545 | hidnplayr | 28 | |
5663 | hidnplayr | 29 | mov eax, 8 ; LOGON BUTTON |
30 | mov ebx, 220 shl 16 + 85 |
||
31 | mov ecx, 47 shl 16 + 16 |
||
32 | mov edx, 2 |
||
33 | mov esi, 0xCCCCCC |
||
34 | mcall |
||
3545 | hidnplayr | 35 | |
5663 | hidnplayr | 36 | cmp byte[mode], 0 |
37 | je .servermode |
||
3545 | hidnplayr | 38 | |
5663 | hidnplayr | 39 | mov eax, 4 ; function 4 write text to window |
40 | mov ebx, 25 shl 16 + 15 ; [x start]:[y start] |
||
41 | xor ecx, ecx |
||
42 | mov edx, userstr ; pointer to text beginning |
||
43 | mov esi, passstr-userstr ; text length |
||
44 | mcall |
||
3545 | hidnplayr | 45 | |
5663 | hidnplayr | 46 | add bl, 19 |
47 | mov edx, passstr ; pointer to text beginning |
||
48 | mov esi, connectstr-passstr ; text length |
||
49 | mcall |
||
3545 | hidnplayr | 50 | |
5663 | hidnplayr | 51 | jmp .drawtherest |
3545 | hidnplayr | 52 | |
5663 | hidnplayr | 53 | .servermode: |
54 | mov eax, 4 ; function 4 write text to window |
||
55 | mov ebx, 25 shl 16 + 15 ; [x start] *65536 + [y start] |
||
56 | xor ecx, ecx |
||
57 | mov edx, serverstr ; pointer to text beginning |
||
58 | mov esi, userstr-serverstr ; text length |
||
59 | mcall |
||
3545 | hidnplayr | 60 | |
5663 | hidnplayr | 61 | invoke edit_box_draw, URLbox |
3545 | hidnplayr | 62 | |
5663 | hidnplayr | 63 | .drawtherest: |
64 | mov ebx, 240 shl 16 + 49 ; [x start] *65536 + [y start] |
||
65 | mov edx, connectstr ; pointer to text beginning |
||
66 | mov esi, connect_e-connectstr ; text length |
||
67 | mcall |
||
3545 | hidnplayr | 68 | |
5663 | hidnplayr | 69 | popa |
70 | inc ebx |
||
71 | mcall |
||
3545 | hidnplayr | 72 | |
5663 | hidnplayr | 73 | .loop: |
74 | mcall 10 ; wait for event |
||
75 | dec eax ; redraw request ? |
||
76 | jz .redraw |
||
77 | dec eax ; key in buffer ? |
||
78 | jz .key |
||
79 | dec eax ; button in buffer ? |
||
80 | jz .btn |
||
81 | sub eax, 3 |
||
82 | jz .mouse |
||
83 | jmp .loop |
||
3545 | hidnplayr | 84 | |
5663 | hidnplayr | 85 | .key: ; key event handler |
86 | mcall 2 ; read key |
||
3545 | hidnplayr | 87 | |
5663 | hidnplayr | 88 | test [URLbox.flags], ed_focus |
89 | jz mainloop |
||
90 | cmp ah, 13 ; enter (return) key |
||
91 | je .go |
||
92 | invoke edit_box_key, URLbox |
||
93 | jmp .loop |
||
3545 | hidnplayr | 94 | |
5663 | hidnplayr | 95 | .go: |
96 | mov eax, [URLbox.pos] |
||
97 | mov byte[serveraddr+eax], 0 |
||
98 | ret |
||
3545 | hidnplayr | 99 | |
5663 | hidnplayr | 100 | .btn: |
101 | mcall 17 ; get id |
||
3545 | hidnplayr | 102 | |
5663 | hidnplayr | 103 | cmp ah, 1 ; close ? |
104 | jz .close |
||
105 | cmp ah, 2 ; logon ? |
||
106 | je .go |
||
3545 | hidnplayr | 107 | |
5663 | hidnplayr | 108 | jmp .loop |
3545 | hidnplayr | 109 | |
5663 | hidnplayr | 110 | .mouse: |
111 | mcall 23 |
||
112 | invoke edit_box_mouse, URLbox |
||
3545 | hidnplayr | 113 | |
5663 | hidnplayr | 114 | jmp .loop |
3545 | hidnplayr | 115 | |
5663 | hidnplayr | 116 | .close: |
117 | mcall -1 |
||
3545 | hidnplayr | 118 | |
119 | |||
120 | ; DATA AREA |
||
121 | |||
5663 | hidnplayr | 122 | passchar db "*" |
3545 | hidnplayr | 123 | passlen dd 0 |
124 | |||
125 | addr dd 0 |
||
126 | temp dd 0 |
||
5663 | hidnplayr | 127 | mode db 0 ; 0 = connection details, 1 = authentication |
3545 | hidnplayr | 128 | |
5663 | hidnplayr | 129 | serverstr db "server:" |
130 | userstr db "username:" |
||
131 | passstr db "password:" |
||
132 | connectstr db "connect !" |
||
3545 | hidnplayr | 133 | connect_e: |
134 | |||
135 | I_END_logon: |