Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3214 → Rev 3215

/kernel/branches/net/applications/ircc/gui.inc
51,7 → 51,7
jne .not_channel
 
mov ebx, [xsize]
sub ebx, 100
sub ebx, USERLIST_X + SCROLLBAR_WIDTH + 3
push bx
shl ebx, 16
pop bx
74,7 → 74,6
mov [edit1.top], eax
 
mov eax, [xsize]
sub eax, 10 ;;;;;;
mov [edit1.width], eax
 
push dword edit1
110,30 → 109,43
mov eax, 13 ; draw rectangle (clear list)
 
mov ebx, [xsize]
sub ebx, 95
sub ebx, USERLIST_X + SCROLLBAR_WIDTH
shl ebx, 16
push ebx
mov bx, 90 ; x size ;;; FIXME
mov ecx, TEXT_Y shl 16 + 12*10 ; y size ;;; FIXME
mov bx, USERLIST_X
mov ecx, [ysize]
add ecx, TEXT_Y shl 16 - (TEXT_Y + 35 + 10 ) ;;;;;
mov edx, [colors.work]
mcall
 
mov eax, 4 ; draw text
mov eax, [scroll1.position]
xor edx, edx
mov ecx, MAX_NICK_LEN
mul ecx
mov edx, eax
mov eax, [window_open]
add edx, [eax + window.data_ptr]
add edx, window_data.names
 
pop ebx
mov bx, TEXT_Y
mov ecx, [colors.work_text]
or ecx, 0x80000000 ; ASCIIZ string
mov edx, [window_open]
mov edx, [edx + window.data_ptr]
add edx, window_data.names
mov edi, MAX_CHANNELS
mov eax, 4 ; draw text
 
mov edi, [ysize] ; Calculate how many names will fit on screen
sub edi, TEXT_Y + 35 + 10 ;;;;;
.loop:
; TODO: check if name is selected and highlight background color if so
cmp byte[edx], ' ' ; end of list?
je .done
mcall
 
add edx, MAX_NICK_LEN ; next name
add ebx, 10 ; height distance between lines
dec edi
jnz .loop
sub edi, 10
ja .loop
.done:
 
popa
 
/kernel/branches/net/applications/ircc/ircc.asm
67,7 → 67,9
 
SCROLLBAR_WIDTH = 12
 
USERLIST_X = 98
 
 
format binary as ""
 
use32
95,6 → 97,8
flags db ?
type db ?
name rb MAX_WINDOWNAME_LEN
users dd ?
users_scroll dd ?
ends
 
struct window_data
101,7 → 105,6
text rb 120*60
title rb 256
names rb 1200
namespos dd ?
usertext rb 256
usertextlen dd ?
ends
284,6 → 287,9
push dword scroll1
call [scrollbar_v_mouse]
 
; TODO: check if scrollbar moved
call print_channel_list ;;;
 
jmp still
 
 
407,7 → 413,7
I_END:
 
; width, left, top
edit1 edit_box 0, 5, 0, 0xffffff, 0x6f9480, 0, 0, 0, USERCMD_MAX_SIZE, usercommand, mouse_dd, ed_focus, 25, 25
edit1 edit_box 0, 0, 0, 0xffffff, 0x6f9480, 0, 0, 0, USERCMD_MAX_SIZE, usercommand, mouse_dd, ed_focus, 25, 25
; xsize, xpos, ysize, ypos, max, cur, pos, bgcol, frcol, linecol
scroll1 scrollbar SCROLLBAR_WIDTH, 300, 150, TOP_Y, 10, 100, 0, 0, 0, 0, 0, 5
 
/kernel/branches/net/applications/ircc/serverparser.inc
431,6 → 431,7
 
 
cmd_part:
add esi, 5 ; skip 'PART '
 
; Is it me who parted?
mov edi, servercommand+1
460,11 → 461,19
pop esi
call print_text2
 
mov esi, str_newline
call print_text2
 
;;; TODO: dec [window.users], remove username from the userlist
 
 
ret
 
 
 
cmd_join:
add esi, 5 ; skip 'JOIN '
 
; compare nick: did we join a channel?
mov edi, servercommand+1
call compare_to_nick
493,7 → 502,6
mov [ebx + window.type], WINDOWTYPE_CHANNEL
mov [ebx + window.flags], 0
 
add esi, 5 ; skip 'JOIN ' ; FIXME: perhaps scan for spaces instead?
call window_set_name
 
mov [window_open], ebx
538,6 → 546,8
mov esi, str_newline
call print_text2
 
;;; TODO: inc [window.users], add username to the userlist
 
ret
 
 
545,6 → 555,8
 
cmd_nick: ; FIXME
 
add esi, 5 ; skip 'NICK '
 
push esi
; test for change of my nick
mov esi, servercommand+1
699,6 → 711,7
 
 
cmd_kick:
add esi, 5 ; skip 'KICK '
; Is it me who got kicked?
mov edi, servercommand+1
call compare_to_nick
722,6 → 735,8
pop esi
call print_text2
 
;;; TODO: dec [window.users], remove username from the userlist
 
ret
 
 
738,6 → 753,8
mov esi, has_quit_irc
call print_text2
 
;;; TODO: dec [window.users], remove username from the userlist
 
ret
 
 
744,6 → 761,8
 
cmd_mode:
 
add esi, 5 ; skip 'MODE '
 
push esi
mov esi, action_header_short
call print_text2
761,11 → 780,15
mov esi, str_newline
call print_text2
 
;;; TODO: change username if needed
 
ret
 
 
cmd_353: ; channel usernames reply
 
add esi, 4 ; skip '353 '
 
; TODO: mark a bit that we are receiving names
 
; first, find the channel name
781,8 → 804,9
.got_channel:
; call find_channel ;;;; ASSUME current channel for now
mov ebx, [window_print]
mov ebx, [ebx + window.data_ptr]
lea edi, [ebx + window_data.names]
mov [ebx + window.users], 0 ;;; FIXME: Only if we have just set the receiving names bit
mov eax, [ebx + window.data_ptr]
lea edi, [eax + window_data.names]
lea edx, [edi + MAX_NICK_LEN]
 
; now find the semicolon separating channelname and usernames
806,20 → 830,39
jmp .namesloop
 
.next:
inc [ebx + window.users]
mov edi, edx
add edx, MAX_NICK_LEN
 
;;; cmp edi, .. ; Check for buffer overflow
;;; cmp edi, .. ; TODO: Check for buffer overflow
jmp .namesloop
 
.done:
call users_calculate
call print_channel_list
 
ret
 
 
users_calculate:
 
mov eax, [ysize]
sub eax, TEXT_Y + 35 + 10 ;;;;
xor edx, edx
mov ecx, 10
div ecx
mov [scroll1.max_area], eax
 
mov ebx, [window_print]
mov eax, [ebx + window.users]
mov [scroll1.max_area], eax
; TODO: check if cur pos isnt greater then max
ret
 
 
 
 
 
cmd_366: ; channel usernames end
 
; TODO: clear the bit that we are receiving names
830,6 → 873,8
 
cmd_topic:
 
add esi, 4 ; skip '332 '
 
.loop:
lodsb
test al, al
856,6 → 901,8
 
cmd_333:
 
add esi, 4 ; skip '333 '
 
; TODO: check channelname and change pointer accordingly
 
mov ecx, 3 ; number of spaces to find