Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6256 → Rev 6255

/programs/develop/libraries/box_lib/trunk/t_edit.mac
1,6 → 1,6
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
; í«¥¬¥­â TextEditor ¤«ï Kolibri OS
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 19.02.2016 IgorA
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 21.01.2016 IgorA
; ­  ª®¤ ¯à¨¬¥­¥­  GPL2 «¨æ¥­§¨ï
 
;input:
1254,6 → 1254,7
; ecx = position to inserted cell
align 4
ted_char_add:
 
.loop_b:
cmp ecx,ted_tex_end
jge .end_f
1264,7 → 1265,6
@@:
add ecx,sizeof.symbol
jmp .loop_b
align 4
.loop_e:
 
push eax ebx
1397,7 → 1397,8
; bl = 0 - no delete
; bl = 1 - delete
align 4
proc ted_text_del uses ecx edx edi, edit:dword, del_opt:dword
proc ted_text_del, edit:dword, del_opt:dword
push cx edx edi
mov edi,dword[edit]
mov ebx,dword[del_opt]
 
1419,6 → 1420,7
mov cl,1
.no_del:
mov bl,cl
pop edi edx cx
ret
endp
 
1433,6 → 1435,7
call ted_is_select
cmp al,0
je .end_f
 
call ted_sel_normalize
 
mov esi,ted_seln_x1
1458,7 → 1461,6
and dword[del_opt],esi ;n_tim=false;
call ted_iterat_next
jmp @b
align 4
@@:
test dword[del_opt],ted_opt_ed_change_time
jz @f
2984,7 → 2986,8
align 4
proc ted_draw_cursor_sumb
pushad
mov eax,SF_DRAW_RECT
 
mov eax,13 ;rect
mov ebx,ted_wnd_l
add ebx,ted_rec_l
mov edx,ted_cur_x
3026,6 → 3029,7
jge @f
mov edx,ted_color_wnd_work
@@:
 
mov ecx,ted_cur_y
cmp ecx,ted_seln_y1
jne .no_cur_sel
3034,6 → 3038,7
cmp ecx,ted_seln_x1
jl .no_cur_sel
mov edx,ted_color_wnd_work
 
.no_cur_sel:
pop ecx
int 0x40 ;à¨á®¢ ­¨¥ ¯àאַ㣮«ì­¨ª 
3041,6 → 3046,7
call ted_get_pos_by_cursor ;¡¥à¥¬ ¯®§¨æ¨î ᨬ¢®« 
cmp ted_gp_opt,2
jne @f
mov eax,4
mov esi,1
ror ecx,16
mov bx,cx
3047,8 → 3053,9
add ebx,0x10001
call ted_get_symb_color
call ted_convert_invis_symb
mcall SF_DRAW_TEXT ;à¨á®¢ ­¨¥ ᨬ¢®« 
int 0x40 ;à¨á®¢ ­¨¥ ᨬ¢®« 
@@:
 
popad
ret
endp
3074,8 → 3081,8
.on_first:
xor eax,eax
mov al,byte[edx+1]
or al,al ;¥á«¨ al=0 ⮠梥⠭¥ ¬¥­ï¥âáï
jz @b
cmp al,0 ;¥á«¨ al=0 ⮠梥⠭¥ ¬¥­ï¥âáï
je @b
 
cmp eax,ted_colors_text_count
jge .exit
3085,7 → 3092,6
add ecx,eax
mov ecx,dword[ecx] ;ãáâ ­ ¢«¨¢ ¥¬ ⥪ã騩 梥â ⥪áâ  ¯® ᬥ饭¨î
.exit:
or ecx,ted_font_size
pop edx eax
ret
 
3130,7 → 3136,7
pushad
mov edi,dword[edit]
 
mov eax,SF_DRAW_TEXT
mov eax,4 ;draw text
mov ecx,ted_text_colors
mov ecx,dword[ecx]
 
3180,7 → 3186,7
add eax,ted_wnd_t
cmp bx,ax
jg .no_draw_text
mov eax,SF_DRAW_TEXT
mov eax,4
;optimized output /\
and ebx,0xffff
ror ebx,16
3192,7 → 3198,6
stdcall ted_clear_line_before_draw,edi,ebx,1,dword[line_num]
call ted_opt_draw_line_left
jmp @b
align 4
.no_13:
 
int 0x40
3241,7 → 3246,7
shl ecx,16
mov cx,word[eax+sb_offs_size_y]
inc cx
mcall SF_DRAW_RECT,,,ted_color_wnd_capt ;[sc.work]
mcall 13,,,ted_color_wnd_capt ;[sc.work]
 
;right-bottom square
mov ebx,ted_wnd_l
3269,7 → 3274,7
proc ted_draw_main_cursor
pushad
 
mov eax,SF_DRAW_RECT ;draw cursor
mov eax,13 ;draw cursor
mov ecx,ted_wnd_t ;calc rect -> y0,y1
add ecx,ted_rec_t
mov edx,ted_cur_y
3304,6 → 3309,7
call ted_get_pos_by_cursor
cmp ted_gp_opt,2
jne @f
mov eax,4 ;draw text
mov esi,1
ror ecx,16
mov bx,cx
3316,11 → 3322,11
sub bx,cx
.no_up_tetx:
mov ecx,ted_color_cur_text
or ecx,ted_font_size
call ted_convert_invis_symb
mcall SF_DRAW_TEXT
int 0x40
@@:
 
mov eax,4
mov ebx,ted_wnd_l
add ebx,ted_rec_l
shl ebx,16
3329,7 → 3335,7
mov ecx,ted_color_wnd_bord
or ecx,0x80000000
lea edx,[txtRow]
mcall SF_DRAW_TEXT ;¢ë¢®¤ ¯®¤¯¨á¨ '‘âப '
int 0x40 ;¢ë¢®¤ ¯®¤¯¨á¨ '‘âப '
 
add ebx,0x500000
lea edx,[txtCol]
3421,7 → 3427,8
mov eax,20 ;®¡à¥§ª  ¯®¤¯¨á¨ ¤® 20 ᨬ¢®«®¢
.crop_buf:
mov esi,eax
mcall SF_DRAW_TEXT ;¢ë¢®¤ ᮤ¥à¦¨¬®£® ¡ãä¥à 
mov eax,4
int 0x40 ;¢ë¢®¤ ᮤ¥à¦¨¬®£® ¡ãä¥à 
 
sub ebx,50 shl 16
lea edx,[txtBuf]
3428,8 → 3435,9
mov esi,edx
call tl_strlen
mov esi,eax
mov eax,4
xor ecx,0x40000000 ;㡨ࠥ¬ 梥â ä®­ 
mcall SF_DRAW_TEXT ;¢ë¢®¤ ¯®¤¯¨á¨ ¤«ï ¡ãä¥à 
int 0x40 ;¢ë¢®¤ ¯®¤¯¨á¨ ¤«ï ¡ãä¥à 
@@:
popad
ret
3451,8 → 3459,8
mov ecx,ted_wnd_t
add ecx,13
shl ecx,16
add ecx,9 ;9 - ¢ëá®â  0-£® èà¨äâ , áâ ¢¨âì ted_rec_h ¯®ª  ¥é¥ à ­®
mcall SF_DRAW_RECT,,,ted_color_wnd_capt
add ecx,ted_rec_h
mcall 13,,,ted_color_wnd_capt
 
cmp ted_help_id,-1
je @f
3475,7 → 3483,7
mov ecx,dword[ecx]
or ecx,0xc0000000 ;SetTextStyles
mov esi,edi
mcall SF_DRAW_TEXT,,,,,ted_color_wnd_work
mcall 4,,,,,ted_color_wnd_work
mov edi,esi
 
mov esi,edx
3492,7 → 3500,7
imul eax,6 ;è¨à¨­  ᨬ¢®«  ¢ á¨áâ. èà¨äâ¥
shl eax,16
add ebx,eax
mcall SF_DRAW_TEXT
mcall 4
@@:
popad
ret
3503,6 → 3511,7
align 4
proc ted_draw_line_numbers
pushad
 
;top panel with caption
mov ebx,ted_wnd_l
; add ebx,ted_rec_l
3513,8 → 3522,9
mov ecx,ted_wnd_t
shl ecx,16
add ecx,ted_rec_t
mov eax,13
mov edx,ted_color_wnd_capt
mcall SF_DRAW_RECT
int 0x40
 
;line numbers
mov ebx,0x40000 ;format
3537,8 → 3547,9
rol ecx,16
mov cx,dx
rol ecx,16
mov eax,13
mov edx,ted_color_wnd_capt
mcall SF_DRAW_RECT ;à¨á㥬 ¯àאַ㣮«ì­¨ª ¯®¤ ­®¬¥à®¬ áâப¨
int 0x40 ;à¨á㥬 ¯àאַ㣮«ì­¨ª ¯®¤ ­®¬¥à®¬ áâப¨
pop edx ecx ebx
 
mov eax,47
3553,8 → 3564,8
jge @f
add edx,ted_wnd_t
jmp @b
align 4
@@:
 
popad
ret
endp
3600,7 → 3611,7
 
cmp ted_gp_opt,2
jne .no_draw_text
; mov eax,SF_DRAW_TEXT
; mov eax,4 ;draw text
call ted_get_symb_color
mov esi,1 ;draw 1 symbol
@@:
3616,7 → 3627,7
call ted_get_symb_color
.no_col_change:
 
mov eax,SF_DRAW_TEXT
mov eax,4 ;draw text
cmp byte [edx],13
jne .no_13
cmp ted_mode_invis,1
3742,13 → 3753,14
mov edx,ted_color_select ;draw selected line
.no_select:
 
mcall SF_DRAW_RECT ;§ ªà áª  ¯®«­®© áâப¨ 梥⮬ ä®­  ¨«¨ 梥⮬ ¢ë¤¥«¥­¨ï
mov eax,13 ;rect
int 0x40 ;§ ªà áª  ¯®«­®© áâப¨ 梥⮬ ä®­  ¨«¨ 梥⮬ ¢ë¤¥«¥­¨ï
 
call ted_is_select
or al,al
jz .no_clear
cmp al,0
je .no_clear
 
mov al,SF_DRAW_RECT
mov al,13 ;rect
xor cx,cx
add ecx,ted_rec_h
cmp ted_seln_y0,esi
3815,7 → 3827,6
jne @b
inc ecx
jmp @b
align 4
@@:
 
cmp ecx,dword[eax+sb_offs_position]
3839,11 → 3850,13
;description:
; äã­ªæ¨ï ­ã¦­  ¤«ï ®¯â¨¬¨§ æ¨¨ ¢ë¢®¤  ⥪áâ 
align 4
proc ted_opt_draw_line_left uses ebx
proc ted_opt_draw_line_left
push ebx
 
mov ebx,ted_scr_h
mov ebx,dword[ebx+sb_offs_position]
or ebx,ebx
jz .ret_f
cmp ebx,0
je .ret_f
push eax
mov eax,edx
 
3853,8 → 3866,8
jmp .beg_cycle
@@:
 
or ebx,ebx
jz @f
cmp ebx,0
je @f
 
cmp byte[edx],13
jne @f
3865,13 → 3878,13
jle @f
cmp byte[edx],13
je @f
or ebx,ebx
jz @f
cmp ebx,0
je @f
;--------------------------------------
xor eax,eax ;eax ¡ã¤¥â ¬¥­ïâìáï
mov al,byte[edx+1]
or al,al
jz .no_color
cmp al,0
je .no_color
cmp eax,ted_colors_text_count
jge .no_color
xor ecx,ecx
3885,12 → 3898,12
call ted_iterat_next
dec ebx
jmp @b
align 4
@@:
mov edx,eax
pop eax
.ret_f:
call ted_get_symb_color
pop ebx
ret
endp
 
4025,6 → 4038,7
 
push eax
shr eax,16
and eax,0xffff
sub eax,ted_wnd_l
sub eax,ted_rec_l
 
/programs/develop/libraries/box_lib/trunk/box_lib.mac
426,7 → 426,6
ted_fun_save_err equ dword[edi+238] ;㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¥á«¨ á®åà ­¥­¨¥ ä ©«  § ª®­ç¨«®áì ­¥ã¤ ç­®
ted_increase_size equ dword[edi+242] ;ç¨á«® ᨬ¢®«®¢ ­  ª®â®àë¥ ¡ã¤¥â 㢥稢 âìáï ¯ ¬ïâì ¯à¨ ­¥å¢ âª¥
ted_ptr_free_symb equ dword[edi+246] ;㪠§ â¥«ì ­  ᢮¡®¤­ãî ¯ ¬ïâì, ¢ ª®â®àãî ¬®¦­® ¤®¡ ¢«ïâì ᨬ¢®« (¨á¯®«ì§ã¥âáï ¢­ãâà¨ í«¥¬¥­â  ¤«ï ã᪮७¨ï ¢áâ ¢ª¨ ⥪áâ )
ted_font_size equ dword[edi+250] ;¬­®¦¨â¥«ì ¤«ï à §¬¥à  èà¨äâ  (¯à¨ ¨§¬¥­¥­¨¨ ­ã¦­® â ª¦¥ ¨§¬¥­ïâì ¯ à ¬¥âàë ted_rec_w, ted_rec_h)
;------------------------------------------------------------------------------
ted_opt_ed_move_cursor equ 1 ;¤¢¨£ âì ªãàá®à ¯®á«¥ ¤®¡ ¢«¥­¨ï ⥪áâ 
ted_opt_ed_change_time equ 2 ;¤®¡ ¢«ïâì ¨§¬¥­¥­¨ï ¯à¨ । ªâ¨à®¢ ­¨¨ ⥪áâ 
/programs/develop/libraries/box_lib/trunk/box_lib.asm
1,6 → 1,6
;*****************************************************************************
; Box_Lib - library of graphical components
; Copyright (C) KolibriOS team 2008-2016. All rights reserved.
; Copyright (C) KolibriOS team 2008-2013. All rights reserved.
;
; Authors:
; Alexey Teplov aka <Lrz>
18,7 → 18,6
section '.flat' code readable align 16
include '../../../../macros.inc'
include '../../../../proc32.inc'
include '../../../../KOSfuncs.inc'
include 'bl_sys.mac'
include 'box_lib.mac' ;macro which should make life easier :)
;include '../../../../debug.inc'
338,7 → 337,7
dd sz_ted_but_reverse, ted_but_reverse
dd sz_ted_but_find_next, ted_but_find_next
dd sz_ted_text_colored, ted_text_colored
dd sz_ted_version, 0x00000005
dd sz_ted_version, 0x00000004
 
dd sz_Frame_draw, frame.draw
dd szVersion_frame, 0x00010001