1,6 → 1,6 |
; ¬ ªà®á ¤«ï á¨á⥬®© ¡¨¡«¨®â¥ª¨ box_lib.obj |
; í«¥¬¥â TextEditor ¤«ï Kolibri OS |
; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 21.10.2018 IgorA |
; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 20.02.2016 IgorA |
; ª®¤ ¯à¨¬¥¥ GPL2 «¨æ¥§¨ï |
|
;input: |
275,10 → 275,6 |
jne @f |
stdcall ted_but_undo,edi |
@@: |
cmp ah,45 ;Ctrl+X |
jne @f |
stdcall ted_but_cut,edi |
@@: |
cmp ah,46 ;Ctrl+C |
jne @f |
stdcall ted_but_copy,edi |
613,13 → 609,13 |
proc ted_sel_start uses eax ecx |
mov eax,ted_scr_h |
mov ecx,ted_cur_x |
add ecx,[eax+sb_offs_position] |
add ecx,dword[eax+sb_offs_position] |
mov ted_sel_x0,ecx |
mov ted_sel_x1,ecx |
|
mov eax,ted_scr_w |
mov ecx,ted_cur_y |
add ecx,[eax+sb_offs_position] |
add ecx,dword[eax+sb_offs_position] |
mov ted_sel_y0,ecx |
mov ted_sel_y1,ecx |
ret |
634,12 → 630,12 |
push eax ecx |
mov ecx,ted_cur_x |
mov eax,ted_scr_h |
add ecx,[eax+sb_offs_position] |
add ecx,dword[eax+sb_offs_position] |
mov ted_sel_x1,ecx |
|
mov eax,ted_scr_w |
mov ecx,ted_cur_y |
add ecx,[eax+sb_offs_position] |
add ecx,dword[eax+sb_offs_position] |
mov ted_sel_y1,ecx |
pop ecx eax |
cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy) |
904,7 → 900,7 |
je .else |
push ebx |
@@: |
mov edx,[edx+2] |
mov edx,dword[edx+2] |
cmp edx,0 |
je @f |
imul edx,sizeof.symbol |
921,7 → 917,7 |
pop ebx |
ret |
.else: |
mov edx,[edx+2] |
mov edx,dword[edx+2] |
cmp edx,0 |
je @f |
imul edx,sizeof.symbol |
947,7 → 943,7 |
je .else |
push ebx |
@@: |
mov edx,[edx+6] |
mov edx,dword[edx+6] |
cmp edx,1 |
jle @f |
imul edx,sizeof.symbol |
965,7 → 961,7 |
pop ebx |
ret |
.else: |
mov edx,[edx+6] |
mov edx,dword[edx+6] |
cmp edx,1 |
jle @f |
imul edx,sizeof.symbol |
1092,7 → 1088,7 |
jl .no_add ;ª®£¤ ¤«¨ <1 ¯àë£ ¥¬ ª®¥æ äãªæ¨¨, ¢® ¨§¡¥¦ ¨¥ £«îª®¢ |
|
mov edi,[edit] |
mov esi,[text] |
mov esi,dword[text] |
|
call ted_get_pos_by_cursor |
call ted_get_text_perv_pos |
1103,19 → 1099,19 |
je @f |
push eax ;c_sp=cur[cn].x+Scroller->XPos-StrLen(cur[cn].y+Scroller->YPos); |
mov eax,ted_scr_h |
mov eax,[eax+sb_offs_position] |
mov eax,dword[eax+sb_offs_position] |
add eax,ted_cur_x ;eax - ®¬¥à ᨬ¢®« |
mov [new_spc],eax |
mov dword[new_spc],eax |
|
mov eax,ted_scr_w |
mov eax,[eax+sb_offs_position] |
mov eax,dword[eax+sb_offs_position] |
add eax,ted_cur_y ;eax - ®¬¥à áâப¨ |
call ted_strlen ;ebx = line len |
sub [new_spc],ebx ;®â ¯®§¨æ¨¨ ªãàá®à ®â¨¬ ¥¬ ¤«¨ã áâப¨, 㧠¥¬ ª®««¨ç¥á⢮ ¤®¡ ¢«ï¥¬ëå ¯à®¡¥«®¢ |
sub dword[new_spc],ebx ;®â ¯®§¨æ¨¨ ªãàá®à ®â¨¬ ¥¬ ¤«¨ã áâப¨, 㧠¥¬ ª®««¨ç¥á⢮ ¤®¡ ¢«ï¥¬ëå ¯à®¡¥«®¢ |
pop eax |
@@: |
|
mov ebx,[t_len] |
mov ebx,dword[t_len] |
|
mov dword[new_lin],0 |
cmp ted_gp_opt,0 |
1122,16 → 1118,16 |
jne @f |
push eax |
mov eax,ted_scr_w |
mov eax,[eax+sb_offs_position] |
mov eax,dword[eax+sb_offs_position] |
add eax,ted_cur_y |
inc eax |
mov [new_lin],eax |
mov dword[new_lin],eax |
|
call ted_get_num_lines |
sub [new_lin],eax |
sub dword[new_lin],eax |
;㢥«¨ç¨¢ ¥¬ «¨¨¨ ¢ áªà®««¨£¥ ç¨á«® ¤®¡ ¢«¥ëå ¤®¯®«¨â¥«ìëå áâப |
mov ecx,ted_scr_w |
add [ecx+sb_offs_max_area],eax ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¢¥à⨪ «ì®£® áªà®««¨£ |
add dword[ecx+sb_offs_max_area],eax ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¢¥à⨪ «ì®£® áªà®««¨£ |
pop eax |
@@: |
|
1306,11 → 1302,11 |
align 16 |
proc ted_but_convert_by_table uses eax edx edi esi, edit:dword, table:dword |
mov edi,[edit] |
mov esi,[table] |
mov esi,dword[table] |
mov edx,ted_tex |
.cycle: |
;¯¥à¥å®¤¨¬ á«¥¤ãî騩 ᨬ¢®« |
mov edx,[edx+6] |
mov edx,dword[edx+6] |
cmp edx,1 |
jle .end_text |
imul edx,sizeof.symbol |
1406,7 → 1402,7 |
align 16 |
proc ted_text_del uses ecx edx edi, edit:dword, del_opt:dword |
mov edi,[edit] |
mov ebx,[del_opt] |
mov ebx,dword[del_opt] |
|
xor cl,cl |
test ebx,ted_opt_ed_move_cursor |
1582,8 → 1578,8 |
ted_cur_move_down: |
push eax ebx |
mov ebx,ted_scr_w |
xor dl,dl |
mov eax,[ebx+sb_offs_cur_area] |
mov dl,0 |
mov eax,dword[ebx+sb_offs_cur_area] |
dec eax |
cmp ted_cur_y,eax |
jge @f |
1592,9 → 1588,9 |
jmp .ret_f |
@@: |
mov eax,ted_cur_y |
add eax,[ebx+sb_offs_position] |
add eax,dword[ebx+sb_offs_position] |
inc eax |
cmp [ebx+sb_offs_max_area],eax |
cmp dword[ebx+sb_offs_max_area],eax |
jle @f |
inc dword[ebx+sb_offs_position] |
mov dl,8 |
1613,11 → 1609,11 |
ted_cur_move_page_up: |
push eax ebx |
mov ebx,ted_scr_w |
mov eax,[ebx+sb_offs_cur_area] |
mov eax,dword[ebx+sb_offs_cur_area] |
xor dl,dl |
cmp eax,[ebx+sb_offs_position] |
cmp eax,dword[ebx+sb_offs_position] |
jg @f |
sub [ebx+sb_offs_position],eax |
sub dword[ebx+sb_offs_position],eax |
mov dl,1 |
@@: |
cmp dword[ebx+sb_offs_position],0 |
1638,17 → 1634,17 |
mov ecx,ted_scr_w |
|
xor dl,dl |
mov eax,[ecx+sb_offs_max_area] |
sub eax,[ecx+sb_offs_cur_area] |
cmp [ecx+sb_offs_position],eax |
mov eax,dword[ecx+sb_offs_max_area] |
sub eax,dword[ecx+sb_offs_cur_area] |
cmp dword[ecx+sb_offs_position],eax |
jge @f |
mov ebx,[ecx+sb_offs_cur_area] |
add [ecx+sb_offs_position],ebx |
mov ebx,dword[ecx+sb_offs_cur_area] |
add dword[ecx+sb_offs_position],ebx |
mov dl,1 |
mov dword[ecx+sb_offs_redraw],1 |
cmp [ecx+sb_offs_position],eax |
cmp dword[ecx+sb_offs_position],eax |
jle @f |
mov [ecx+sb_offs_position],eax |
mov dword[ecx+sb_offs_position],eax |
@@: |
pop ecx ebx eax |
ret |
1709,7 → 1705,7 |
push eax ebx |
mov eax,ted_scr_h |
xor dl,dl |
mov ebx,[eax+sb_offs_cur_area] |
mov ebx,dword[eax+sb_offs_cur_area] |
cmp ted_cur_x,ebx |
jge @f |
inc ted_cur_x |
1732,23 → 1728,23 |
push eax ebx ecx |
mov eax,ted_cur_y |
mov ecx,ted_scr_w |
add eax,[ecx+sb_offs_position] |
add eax,dword[ecx+sb_offs_position] |
call ted_strlen |
xor dl,dl |
|
mov ecx,ted_scr_h |
cmp ebx,[ecx+sb_offs_position] |
cmp ebx,dword[ecx+sb_offs_position] |
jge @f |
mov dl,8 |
mov [ecx+sb_offs_position],ebx |
mov dword[ecx+sb_offs_position],ebx |
@@: |
sub ebx,[ecx+sb_offs_position] |
sub ebx,dword[ecx+sb_offs_position] |
|
cmp ebx,[ecx+sb_offs_cur_area] |
cmp ebx,dword[ecx+sb_offs_cur_area] |
jle @f ; b---[---]---e |
add [ecx+sb_offs_position],ebx |
mov ebx,[ecx+sb_offs_cur_area] |
sub [ecx+sb_offs_position],ebx |
add dword[ecx+sb_offs_position],ebx |
mov ebx,dword[ecx+sb_offs_cur_area] |
sub dword[ecx+sb_offs_position],ebx |
mov dl,8 |
@@: |
mov ted_cur_x,ebx |
1802,7 → 1798,7 |
; edx = pointer to 'perv' struct |
align 16 |
ted_get_text_perv_pos: |
mov edx,[edx+2] |
mov edx,dword[edx+2] |
imul edx,sizeof.symbol |
add edx,ted_tex |
ret |
1813,7 → 1809,7 |
; edx = pointer to 'next' symbol struct |
align 16 |
ted_get_text_next_pos: |
mov edx,[edx+6] |
mov edx,dword[edx+6] |
imul edx,sizeof.symbol |
add edx,ted_tex |
ret |
1830,10 → 1826,10 |
push eax ecx esi |
mov esi,ted_cur_x |
mov eax,ted_scr_h |
add esi,[eax+sb_offs_position] |
add esi,dword[eax+sb_offs_position] |
mov ecx,ted_cur_y |
mov eax,ted_scr_w |
add ecx,[eax+sb_offs_position] |
add ecx,dword[eax+sb_offs_position] |
call ted_get_pos_by_coords |
pop esi ecx eax |
ret |
2057,15 → 2053,15 |
push eax |
mov eax,ted_scr_w |
mov ted_cur_x,ecx |
sub edx,[eax+sb_offs_position] |
sub edx,dword[eax+sb_offs_position] |
|
cmp edx,[eax+sb_offs_cur_area] ;ted_cur_y > [.cur_area] |
cmp edx,dword[eax+sb_offs_cur_area] ;ted_cur_y > [.cur_area] |
jl @f |
push ebx |
mov ebx,edx |
sub ebx,[eax+sb_offs_cur_area] |
sub ebx,dword[eax+sb_offs_cur_area] |
inc ebx |
add [eax+sb_offs_position],ebx |
add dword[eax+sb_offs_position],ebx |
sub edx,ebx |
pop ebx |
; ??? redrav |
2136,7 → 2132,7 |
mov al,byte[edx] |
shl ax,2 ;eax*=4 |
add eax,ted_arr_key_pos |
mov eax,[eax] |
mov eax,dword[eax] |
cmp eax,0 |
jl @b ;if( (word_n=ted_arr_key_pos[(unsigned char)tex[i].c])>-1 ){ |
|
2154,7 → 2150,7 |
jmp .wh_1b |
.wh_1e: |
|
mov [begPos],edx ;bP=i; |
mov dword[begPos],edx ;bP=i; |
mov esi,1 |
align 4 |
.wh_2b: ;while(1){ |
2178,18 → 2174,18 |
ColToIndexOffset eax,ebx |
cmp byte[ebx+esi],0 |
jne .if_0 ;if(Col[word_n].Text[pos]==0){ |
mov [endPos],edx ;eP=i; |
mov dword[endPos],edx ;eP=i; |
ColToIndexOffset eax,ebx |
mov bl,[ebx+MAX_COLOR_WORD_LEN+7] |
mov [f_color],bl ;f_color=Col[word_n].color; |
mov bl,byte[ebx+MAX_COLOR_WORD_LEN+7] |
mov byte[f_color],bl ;f_color=Col[word_n].color; |
|
mov byte[find],1 |
ColToIndexOffset eax,ebx ;... ebx = Col[word_n] |
mov bl,[ebx+MAX_COLOR_WORD_LEN+4] |
mov bl,byte[ebx+MAX_COLOR_WORD_LEN+4] |
cmp bl,0 ;if(Col[word_n].wwo) |
je .if_2n |
push edx |
mov edx,[begPos] |
mov edx,dword[begPos] |
call ted_iterat_perv |
|
btr bx,0 ;1-1 |
2209,7 → 2205,7 |
mov byte[find],0 |
.if_4e: |
|
mov edx,[endPos] |
mov edx,dword[endPos] |
;call ted_iterat_next |
|
btr bx,1 ;2-1 |
2275,7 → 2271,7 |
|
cmp byte[find],1 ;if(fnd)break; |
je @f |
mov edx,[begPos];i=bP; |
mov edx,dword[begPos];i=bP; |
jmp @b |
@@: |
|
2282,13 → 2278,13 |
cmp byte[find],1 |
jne .if_1e ;if(fnd){ // ¢ë¤¥«¥¨¥ ©¤¥®£® ⥪áâ |
;if(!mode_sf1 || (mode_sf1 && strlen(Col[word_n].f1->c_str())>0)){ |
mov eax,[begPos] |
mov bl,[f_color] |
mov [eax+1],bl ;tex[bP].col=f_color; |
mov eax,[endPos] |
mov eax,dword[begPos] |
mov bl,byte[f_color] |
mov byte[eax+1],bl ;tex[bP].col=f_color; |
mov eax,dword[endPos] |
mov byte[eax+1],0xff ;tex[eP].col=255; |
;return ItPoPerv(eP); // ¢®§¢à é ¥¬ ¯®§¨æ¨î ª®æ ¢å®¦¤¥¨ï |
mov edx,[endPos] |
mov edx,dword[endPos] |
call ted_get_text_perv_pos |
jmp @f |
.if_1e: |
2370,10 → 2366,10 |
|
push ebx ecx |
xor ebx,ebx |
mov bl,[edx] |
mov bl,byte[edx] |
shl bx,2 ;ebx*=4 |
add ebx,ted_arr_key_pos |
mov ecx,[ebx] |
mov ecx,dword[ebx] |
cmp ecx,0 |
jl .if_0e ;if( (word_n=ted_arr_key_pos[(unsigned char)tf[0]])>-1 ){ |
push esi eax |
2380,13 → 2376,13 |
mov ebx,ecx ;l_pos=word_n; |
ColToIndexOffset ecx,esi |
push cx |
mov cl,[esi] |
mov cl,byte[esi] |
@@: |
cmp ebx,ted_key_words_count ;while(l_pos<ted_key_words_count) |
jge @f |
;ColToIndexOffset ecx,esi |
ColToIndexOffset ebx,eax |
cmp cl,[eax] ;&& Col[l_pos].Text[0]==Col[word_n].Text[0]) |
cmp cl,byte[eax] ;&& Col[l_pos].Text[0]==Col[word_n].Text[0]) |
jne @f |
inc ebx ;l_pos++; |
jmp @b |
2424,7 → 2420,7 |
cmp ecx,ebx ;if(word_n==l_pos) break; |
je @f |
call ted_iterat_next ;pos++; |
cmp edx,[end_pos] ;for(...;i<strlen;...) |
cmp edx,dword[end_pos] ;for(...;i<strlen;...) |
je @f ;jge |
inc esi |
jmp @b |
2548,8 → 2544,6 |
ret |
endp |
|
;output: |
; al = 1 if delete |
align 16 |
proc ted_but_cut uses edi, edit:dword |
mov edi,[edit] |
2568,6 → 2562,8 |
ret |
endp |
|
;output: |
; al = 1 if copy text |
align 16 |
proc ted_but_copy, edit:dword |
pushad |
2648,7 → 2644,7 |
je .no_buf_r |
cmp eax,-1 |
je .no_buf_r |
mov ecx,[eax] |
mov ecx,dword[eax] |
cmp ecx,1 ;size |
jl .no_buf_r |
cmp dword[eax+4],0 ;text |
2867,12 → 2863,12 |
push eax ebx |
call ted_get_num_lines |
mov ebx,ted_scr_w |
mov [ebx+sb_offs_position],eax ;áâ ¢¨¬ ¯®«§ã®ª ¯®á«¥¤îî áâப㠤®ªã¬¥â |
cmp eax,[ebx+sb_offs_cur_area] |
mov dword[ebx+sb_offs_position],eax ;áâ ¢¨¬ ¯®«§ã®ª ¯®á«¥¤îî áâப㠤®ªã¬¥â |
cmp eax,dword[ebx+sb_offs_cur_area] |
jle @f |
mov eax,[ebx+sb_offs_cur_area] ;¯®«ãç ¥¬ ç¨á«® áâப ¢« §ïé¨å ¢ ®ª® |
mov eax,dword[ebx+sb_offs_cur_area] ;¯®«ãç ¥¬ ç¨á«® áâப ¢« §ïé¨å ¢ ®ª® |
@@: |
sub [ebx+sb_offs_position],eax ;®â¨¬ ¥¬ ®â ¯®«§ãª ç¨á«® áâப ¢« §ïé¨å ¢ ®ª® (® ¥ ¡®«ìè¥ â¥å, çâ® ¥áâì ¢ ¤®ªã¬¥â¥) |
sub dword[ebx+sb_offs_position],eax ;®â¨¬ ¥¬ ®â ¯®«§ãª ç¨á«® áâப ¢« §ïé¨å ¢ ®ª® (® ¥ ¡®«ìè¥ â¥å, çâ® ¥áâì ¢ ¤®ªã¬¥â¥) |
dec eax |
mov ted_cur_y,eax ;áâ ¢¨¬ ªãàá®à ¯®á«¥¤îî áâப㠤®ªã¬¥â |
pop ebx eax |
3084,7 → 3080,7 |
shl ax,2 ;㬮¦ ¥¬ ¨¤¥ªá 梥â 4 ¡ ©â |
mov ecx,ted_text_colors ;¯à¨¡ ¢«ï¥¬ ᬥ饨¥ 1-£® 梥â |
add ecx,eax |
mov ecx,[ecx] ;ãáâ ¢«¨¢ ¥¬ ⥪ã騩 梥â ⥪áâ ¯® ᬥ饨î |
mov ecx,dword[ecx] ;ãáâ ¢«¨¢ ¥¬ ⥪ã騩 梥â ⥪áâ ¯® ᬥ饨î |
.exit: |
or ecx,ted_font_size |
pop edx eax |
3145,7 → 3141,7 |
|
mov eax,SF_DRAW_TEXT |
mov ecx,ted_text_colors |
mov ecx,[ecx] |
mov ecx,dword[ecx] |
|
mov ebx,ted_wnd_l |
add ebx,ted_rec_l |
3776,7 → 3772,7 |
mov bx,dx |
jmp .no_wnd |
.in_wnd: |
xor bx,bx |
mov bx,0 |
.no_wnd: |
mov edx,ted_color_wnd_work |
int 0x40 |