Subversion Repositories Kolibri OS

Rev

Rev 3545 | Blame | Last modification | View Log | Download | RSS feed

  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. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  14.  
  15. logon:
  16.         mcall   40, EVM_MOUSE + EVM_MOUSE_FILTER + EVM_REDRAW + EVM_BUTTON + EVM_KEY
  17.  
  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
  28.  
  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
  35.  
  36.         cmp     byte[mode], 0
  37.         je      .servermode
  38.  
  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
  45.  
  46.         add     bl, 19
  47.         mov     edx, passstr                    ; pointer to text beginning
  48.         mov     esi, connectstr-passstr         ; text length
  49.         mcall
  50.  
  51.         jmp     .drawtherest
  52.  
  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
  60.  
  61.         invoke  edit_box_draw, URLbox
  62.  
  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
  68.  
  69.         popa
  70.         inc     ebx
  71.         mcall
  72.  
  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
  84.  
  85.   .key:                         ; key event handler
  86.         mcall   2               ; read key
  87.  
  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
  94.  
  95.   .go:
  96.         mov     eax, [URLbox.pos]
  97.         mov     byte[serveraddr+eax], 0
  98.         ret
  99.  
  100.   .btn:
  101.         mcall   17              ; get id
  102.  
  103.         cmp     ah, 1           ; close ?
  104.         jz      .close
  105.         cmp     ah, 2           ; logon ?
  106.         je      .go
  107.  
  108.         jmp     .loop
  109.  
  110.   .mouse:
  111.         mcall   23
  112.         invoke  edit_box_mouse, URLbox
  113.  
  114.         jmp     .loop
  115.  
  116.   .close:
  117.         mcall   -1
  118.  
  119.  
  120. ; DATA AREA
  121.  
  122. passchar      db "*"
  123. passlen       dd 0
  124.  
  125. addr          dd 0
  126. temp          dd 0
  127. mode          db 0              ; 0 = connection details, 1 = authentication
  128.  
  129. serverstr     db "server:"
  130. userstr       db "username:"
  131. passstr       db "password:"
  132. connectstr    db "connect !"
  133. connect_e:
  134.  
  135. I_END_logon:
  136.