Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6026 → Rev 6025

/programs/network/ircc/gui.inc
113,7 → 113,7
jne .not_channel
 
mov [scroll1.all_redraw], 1
call draw_user_list
call draw_channel_list
 
; draw a vertical separator line when there is no scrollbar
cmp [scroll2.all_redraw], 1
138,10 → 138,11
mov eax, [xsize]
mov [edit1.width], eax
 
invoke edit_box_draw, edit1
push dword edit1
call [edit_box_draw]
 
; draw tabs
call draw_window_tabs
call draw_windowtabs
.exit:
popa
149,7 → 150,7
 
 
 
draw_user_list:
draw_channel_list:
 
pusha
 
166,7 → 167,8
mov [scroll1.position], eax
@@:
; OK, draw the scrollbar
invoke scrollbar_draw, scroll1
push dword scroll1
call [scrollbar_draw]
 
; dont redraw scrollbar completely next time,
; unless draw_window asks us to by setting [scroll1.all_redraw] back to 1
209,7 → 211,7
pop ebx
mov bx, TEXT_Y
mov ecx, [colors.work_text]
or ecx, 0x90000000 ; 8x16 font, zero terminated string
or ecx, 0x80000000 ; ASCIIZ string
mov eax, 4 ; draw text
 
mov edi, [textbox_height] ; how many names will fit on screen
224,16 → 226,16
mov cx, bx
mov bx, USERLIST_WIDTH
shl ecx, 16
mov cx, FONT_HEIGHT
mov cx, 10 - 1
mov edx, 0x00000055 ; blue!
mcall 13
popa
 
mov ecx, 0x9000ffff ; cyan!
mov ecx, 0x8000ffff ; cyan!
mcall
 
mov ecx, [colors.work_text]
or ecx, 0x90000000 ; 8x16 font, zero terminated string
or ecx, 0x80000000 ; ASCIIZ string
jmp .next
 
.nothighlight:
251,7 → 253,7
ret
 
 
draw_window_tabs:
draw_windowtabs:
 
; Draw horizontal line
 
/programs/network/ircc/ircc.asm
13,7 → 13,7
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
version equ '0.25'
version equ '0.24'
 
; connection status
STATUS_DISCONNECTED = 0
43,9 → 43,9
USERCMD_MAX_SIZE = 400
 
WIN_MIN_X = 600
WIN_MIN_Y = 183
WIN_MIN_Y = 170
 
TEXT_X = 2
TEXT_X = 5
TEXT_Y = TOP_Y + 2
 
TOP_SPACE = 2
77,10 → 77,10
WINDOW_BTN_LIST = 3
 
SCROLLBAR_WIDTH = 14
USERLIST_WIDTH = 160
USERLIST_WIDTH = 100
 
FONT_WIDTH = 8
FONT_HEIGHT = 16
FONT_HEIGHT = 9
FONT_WIDTH = 6
 
format binary as ""
 
245,7 → 245,7
mov edi, [window_active]
cmp [edi + window.type], WINDOWTYPE_CHANNEL
jne .no_update
call draw_user_list
call draw_channel_list
.no_update:
call highlight_updated_tabs
 
280,7 → 280,7
mov ebx, [window_active]
mov [ebx + window.selected], eax
 
call draw_user_list
call draw_channel_list
 
pop eax
test eax, 1 shl 25 ; Right mouse button pressed?
378,7 → 378,8
mov [edit1.size], 0
mov [edit1.pos], 0
 
invoke edit_box_draw, edit1
push dword edit1
call [edit_box_draw]
 
call draw_channel_text
 
388,7 → 389,8
jmp mainloop
 
mouse:
invoke edit_box_mouse, edit1
push dword edit1
call [edit_box_mouse]
 
; mcall 37, 7
; movsx eax, ax
399,11 → 401,12
cmp [edi + window.type], WINDOWTYPE_CHANNEL
jne @f
push [scroll1.position]
invoke scrollbar_mouse, scroll1
push dword scroll1
call [scrollbar_mouse]
pop eax
cmp eax, [scroll1.position] ; did the scrollbar move?
je @f
call draw_user_list
call draw_channel_list
@@:
 
; TODO: check if scrollbar is active?
411,7 → 414,8
mov eax, [edi + window.text_lines]
cmp eax, [textbox_height]
jbe @f
invoke scrollbar_mouse, scroll2
push dword scroll2
call [scrollbar_mouse]
mov edi, [window_active]
and [edi+window.flags], not FLAG_SCROLL_LOW
mov edx, [scroll2.position]
502,8 → 506,10
db 3, '3| |', 3, '7| | \', 3, '6 \____', 3, '4 \ \___| |_| \ ___/| | \ |', 10
db 3, '3|___|', 3, '7|____|_ /', 3, '6\______ /', 3, '4 \___ >____/__|\___ >___| /__|', 10
db 3, '3 ', 3, '7 \/ ', 3, '6 \/ ', 3, '4 \/ \/ \/', 10
db 10
db 'Welcome to KolibriOS IRC client ', version, 10
db 'Type /help for help', 10, 0
db 10
db 'Type /help for help', 10, 10, 0
 
str_version db 'VERSION KolibriOS '
str_programname db 'IRC client ', version, 0
571,7 → 577,7
scrollbar_mouse,'scrollbar_v_mouse'
 
; width, left, top
edit1 edit_box 0, 0, 0, 0xffffff, 0x6f9480, 0, 0, 0x000000, USERCMD_MAX_SIZE, usercommand, mouse_dd, ed_always_focus, 25, 25
edit1 edit_box 0, 0, 0, 0xffffff, 0x6f9480, 0, 0, 0, USERCMD_MAX_SIZE, usercommand, mouse_dd, ed_always_focus, 25, 25
; xsize, xpos, ysize, ypos, btn_height, max, cur, pos, bgcol, frcol, linecol
scroll1 scrollbar SCROLLBAR_WIDTH, 0, 0, TOP_Y, SCROLLBAR_WIDTH, 0, 0, 0, 0, 0, 0, 1
scroll2 scrollbar SCROLLBAR_WIDTH, 0, 0, TOP_Y, SCROLLBAR_WIDTH, 0, 0, 0, 0, 0, 0, 1
/programs/network/ircc/textbox.inc
24,8 → 24,6
dec ecx
jz .end_of_line
lodsb ; get one character of the string
test al, 0x80
jnz .multiball!
test al, al ; end of string?
jz .almost_done
cmp al, ' ' ; it's a space! remember its position
54,20 → 52,6
 
ret
 
.multiball!:
add esi, 4
and al, 11111000b
cmp al, 11110000b
je .more
dec esi
and al, 11110000b
cmp al, 11100000b
je .more
dec esi
jmp .more
 
 
 
;----------------------------------
; scan untill next line is reached
;
261,45 → 245,11
.no_offset:
xor ebx, ebx
.draw_text:
 
; Prepare to actually draw some text
add ebx, TEXT_X shl 16 + TEXT_Y ; text coordinates
mov eax, [textbox_height] ; max number of lines to draw
add ebx, TEXT_X shl 16 + TEXT_Y
mov ecx, [colors.work_text] ; default text color
or ecx, 0x30000000
mov edx, [edi + window.text_print] ; start of text to print
 
; Scan backwards on line for color escape codes
mov esi, edx
push edx
std
@@:
lodsb
cmp al, 0 ; end of text
je @f
cmp al, 10 ; hard newline
je @f
cmp al, 3 ; mIRC escape code
jne @b
 
cld
lea edx, [esi+2]
call dec_to_esi
jz @f
mov ecx, [irc_colors + 4*esi]
or ecx, 0x30000000 ; UTF-8 text
 
cmp byte[edx], ',' ; background color?
jne @f
inc edx
call dec_to_esi
jz @f
mov edi, [irc_colors + 4*esi]
or ecx, 0x40000000 ; enable background color
@@:
cld
 
pop edx
mov eax, [textbox_height] ; max number of lines to draw
mov edx, [edi + window.text_print]
.drawloop:
cmp byte[edx], 0
je .end_of_text
316,17 → 266,19
mcall 13 ; draw rectangle
popa
 
push eax
mov esi, [textbox_width]
mov esi, edx
add esi, [textbox_width]
.line:
cmp byte[edx], 0
je .end_of_text
 
cmp byte[edx], 13
je .newline_soft
 
cmp byte[edx], 10
je .newline_hard
 
push esi
push esi eax
cmp byte[edx], 3 ; escape code for mIRC colors
jne .no_colors
inc edx
333,7 → 285,6
call dec_to_esi
jz .no_colors
mov ecx, [irc_colors + 4*esi]
or ecx, 0x30000000
 
cmp byte[edx], ',' ; background color?
jne .no_colors
346,38 → 297,20
 
mov esi, 1
mcall 4 ; draw text
 
mov esi, 1
mov al, byte[edx]
test al, 10000000b
jz @f
mov esi, 4
and al, 11111000b
cmp al, 11110000b
je @f
dec esi
and al, 11110000b
cmp al, 11100000b
je @f
dec esi
@@:
 
add ebx, FONT_WIDTH shl 16
add edx, esi
pop esi
dec esi
jnz .line
inc edx
pop eax esi
cmp edx, esi
jb .line
jmp .line_full
 
.newline_hard:
mov ecx, [colors.work_text]
or ecx, 0x30000000
.newline_soft:
inc edx
.line_full:
and ebx, 0x0000ffff
add ebx, TEXT_X shl 16 + FONT_HEIGHT
pop eax
dec eax
jnz .drawloop
.end_of_text:
/programs/network/ircc/userparser.inc
440,7 → 440,6
cmd_usr_close_window:
 
mov esi, [window_active]
mov [window_print], esi
cmp [esi + window.type], WINDOWTYPE_SERVER
je .not_channel
 
/programs/network/ircc/window.inc
76,7 → 76,7
stosb
 
push esi ebx
call draw_window_tabs
call draw_windowtabs
pop ebx esi
 
ret
107,7 → 107,7
jne @f
sub edi, sizeof.window
mov [window_active], edi
mov [window_print], edi
mov [window_print], edi ;;;;;;;;
@@:
 
; At last, redraw everything
/programs/network/ircc/serverparser.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Written by hidnplayr@kolibrios.org ;;
961,7 → 961,7
jmp .add
 
.done:
call draw_user_list
call draw_channel_list
.fail:
 
ret
1059,7 → 1059,7
jz .fail
 
mov [window_active], ebx
call draw_window_tabs
call draw_windowtabs
pop esi
call print_asciiz
mov al, 10
/programs/network/ircc/socket.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Written by hidnplayr@kolibrios.org ;;
210,7 → 210,7
 
pusha
 
; FIXME: make this a proper stream!
; TODO: read more data if we receive one full packet
 
.nextpacket:
mcall recv, [socketnum], packetbuf, 1024, MSG_DONTWAIT ; read a packet
219,33 → 219,30
dec eax
jz .disconnected
 
; ok we have data, now feed it to the command splicer
; ok we have data, now feed it to the recoder
 
mov ecx, eax
lea edx, [packetbuf + eax] ; edx = end pointer
mov esi, packetbuf ; esi = start pointer
.nextcommand:
mov edi, servercommand
.byteloop:
lodsb
call get_next_byte ; reads byte from [esi] to al
jnc .nextpacket ; if CF is set, we need more data (TODO: dont throw away old data!!!)
cmp al, 10
je .got_command
cmp al, 13
je .got_command
stosb
dec ecx
jnz .byteloop
;;; FIXME
jmp .nextpacket
jmp .byteloop
 
; we have a command, call the serverparser
 
.got_command:
mov byte[edi], 0 ; mark the end of the command
push esi ecx
push esi edx
call server_parser
pop ecx esi
test ecx, ecx
jnz .nextcommand
pop edx esi
jmp .nextcommand
 
.done:
popa