Rev 8532 | Rev 8852 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8532 | Rev 8533 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ; ¬ ªà®á ¤«ï á¨á⥬®© ¡¨¡«¨®â¥ª¨ box_lib.obj |
1 | ; ¬ ªà®á ¤«ï á¨á⥬®© ¡¨¡«¨®â¥ª¨ box_lib.obj |
2 | ; í«¥¬¥â TextEditor ¤«ï Kolibri OS |
2 | ; í«¥¬¥â TextEditor ¤«ï Kolibri OS |
3 | ; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 10.06.2020 IgorA |
3 | ; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 12.01.2021 IgorA |
4 | ; ª®¤ ¯à¨¬¥¥ GPL2 «¨æ¥§¨ï |
4 | ; ª®¤ ¯à¨¬¥¥ GPL2 «¨æ¥§¨ï |
Line 5... | Line 5... | ||
5 | 5 | ||
6 | ;input: |
6 | ;input: |
7 | ; edi = pointer to tedit struct |
7 | ; edi = pointer to tedit struct |
Line 2199... | Line 2199... | ||
2199 | align 16 |
2199 | align 16 |
2200 | proc ted_text_find_sel_color uses eax ebx ecx esi |
2200 | proc ted_text_find_sel_color uses eax ebx ecx esi |
2201 | locals |
2201 | locals |
2202 | begPos dd ? ; ç «ì ï ¯®§¨æ¨ï |
2202 | begPos dd ? ; ç «ì ï ¯®§¨æ¨ï |
2203 | endPos dd ? ;ª®¥ç ï ¯®§¨æ¨ï |
2203 | endPos dd ? ;ª®¥ç ï ¯®§¨æ¨ï |
2204 | find db ? ; ©¤¥® / ¥ ©¤¥® |
2204 | find db ? ;0 - ¥ ©¤¥®, 1 - ©¤¥®, 2 - ©¤¥® ¢ ª®æ¥ ä ©« |
2205 | f_color db ? ;¨¤¥ªá 梥⠩¤¥®£® á«®¢ |
2205 | f_color db ? ;¨¤¥ªá 梥⠩¤¥®£® á«®¢ |
2206 | endl |
2206 | endl |
2207 | ;eax = word_n ⥪ã騩 ®¬¥à (¯®§¨æ¨ï) ¯à®¢¥à塞®£® á«®¢ ¢ ᯨ᪥ |
2207 | ;eax = word_n ⥪ã騩 ®¬¥à (¯®§¨æ¨ï) ¯à®¢¥à塞®£® á«®¢ ¢ ᯨ᪥ |
2208 | ;ebx = ¤«ï à §ëå 楫¥© |
2208 | ;ebx = ¤«ï à §ëå 楫¥© |
2209 | ;ecx = l_pos ¯®á«¥¤¨© ®¬¥à (¯®§¨æ¨ï) ¯®¤å®¤ï饣® á«®¢ ¢ ᯨ᪥ |
2209 | ;ecx = l_pos ¯®á«¥¤¨© ®¬¥à (¯®§¨æ¨ï) ¯®¤å®¤ï饣® á«®¢ ¢ ᯨ᪥ |
Line 2215... | Line 2215... | ||
2215 | .cycle0: |
2215 | .cycle0: |
2216 | call ted_iterat_next |
2216 | call ted_iterat_next |
2217 | cmp edx,ted_tex_1 |
2217 | cmp edx,ted_tex_1 |
2218 | jle .cycle0end |
2218 | jle .cycle0end |
Line 2219... | Line -... | ||
2219 | - | ||
2220 | xor eax,eax |
2219 | |
2221 | mov al,byte[edx] |
2220 | movzx eax,byte[edx] |
2222 | shl ax,2 ;eax*=4 |
2221 | shl eax,2 ;eax*=4 |
2223 | add eax,ted_arr_key_pos |
2222 | add eax,ted_arr_key_pos |
2224 | mov eax,[eax] |
2223 | mov eax,[eax] |
2225 | cmp eax,0 |
2224 | cmp eax,0 |
Line 2321... | Line 2320... | ||
2321 | call ted_iterat_next_pos_char |
2320 | call ted_iterat_next_pos_char |
2322 | cmp edx,ted_tex_1 |
2321 | cmp edx,ted_tex_1 |
2323 | jg @f |
2322 | jg @f |
2324 | ;¥á«¨ ¤®è«¨ ¤® ª®æ ä ©« ¨ ¥ 諨 ᨬ¢®« ª®æ à §¬¥âª¨ |
2323 | ;¥á«¨ ¤®è«¨ ¤® ª®æ ä ©« ¨ ¥ 諨 ᨬ¢®« ª®æ à §¬¥âª¨ |
2325 | call ted_iterat_perv |
2324 | call ted_iterat_perv |
- | 2325 | mov byte[find],2 |
|
2326 | @@: |
2326 | @@: |
2327 | mov dword[endPos],edx |
2327 | mov dword[endPos],edx |
2328 | .if_7e: |
2328 | .if_7e: |
Line 2329... | Line 2329... | ||
2329 | 2329 | ||
Line 2359... | Line 2359... | ||
2359 | je .wh_2e;if(word_n==l_pos) break; |
2359 | je .wh_2e;if(word_n==l_pos) break; |
2360 | inc esi ;pos++; |
2360 | inc esi ;pos++; |
2361 | jmp .wh_2b |
2361 | jmp .wh_2b |
2362 | .wh_2e: |
2362 | .wh_2e: |
Line 2363... | Line 2363... | ||
2363 | 2363 | ||
2364 | cmp byte[find],1 ;if(fnd)break; |
2364 | cmp byte[find],0 ;if(fnd)break; |
2365 | je .cycle0end |
2365 | jne .cycle0end |
2366 | mov edx,[begPos];i=bP; |
2366 | mov edx,[begPos];i=bP; |
2367 | jmp .cycle0 |
2367 | jmp .cycle0 |
Line 2368... | Line 2368... | ||
2368 | .cycle0end: |
2368 | .cycle0end: |
2369 | 2369 | ||
2370 | cmp byte[find],1 |
2370 | cmp byte[find],0 |
2371 | jne .if_1e ;if(fnd){ // ¢ë¤¥«¥¨¥ ©¤¥®£® ⥪áâ |
2371 | je .if_1e ;if(fnd){ // ¢ë¤¥«¥¨¥ ©¤¥®£® ⥪áâ |
2372 | ;if(!mode_sf1 || (mode_sf1 && strlen(Col[word_n].f1->c_str())>0)){ |
2372 | ;if(!mode_sf1 || (mode_sf1 && strlen(Col[word_n].f1->c_str())>0)){ |
2373 | mov eax,[begPos] |
2373 | mov eax,[begPos] |
2374 | mov bl,[f_color] |
2374 | mov bl,[f_color] |
2375 | mov [eax+1],bl ;tex[bP].col=f_color; |
2375 | mov [eax+1],bl ;tex[bP].col=f_color; |
- | 2376 | mov eax,[endPos] |
|
- | 2377 | mov byte[eax+1],0xff ;tex[eP].col=255; |
|
2376 | mov eax,[endPos] |
2378 | cmp byte[find],2 |
2377 | mov byte[eax+1],0xff ;tex[eP].col=255; |
2379 | je .if_1e |
2378 | ;return ItPoPerv(eP); // ¢®§¢à é ¥¬ ¯®§¨æ¨î ª®æ ¢å®¦¤¥¨ï |
2380 | ;return ItPoPerv(eP); // ¢®§¢à é ¥¬ ¯®§¨æ¨î ª®æ ¢å®¦¤¥¨ï |
2379 | mov edx,[endPos] |
2381 | mov edx,[endPos] |
2380 | call ted_get_text_perv_pos |
2382 | call ted_get_text_perv_pos |
Line 2454... | Line 2456... | ||
2454 | proc ted_find_help_id uses ebx ecx, end_pos:dword |
2456 | proc ted_find_help_id uses ebx ecx, end_pos:dword |
2455 | ; ecx = word_n |
2457 | ; ecx = word_n |
2456 | ; ebx = l_pos |
2458 | ; ebx = l_pos |
2457 | mov ted_help_id,-1 |
2459 | mov ted_help_id,-1 |
Line 2458... | Line -... | ||
2458 | - | ||
2459 | xor ebx,ebx |
2460 | |
2460 | mov bl,[edx] |
2461 | movzx ebx,byte[edx] |
2461 | shl bx,2 ;ebx*=4 |
2462 | shl ebx,2 ;ebx*=4 |
2462 | add ebx,ted_arr_key_pos |
2463 | add ebx,ted_arr_key_pos |
2463 | mov ecx,[ebx] |
2464 | mov ecx,[ebx] |
2464 | cmp ecx,0 |
2465 | cmp ecx,0 |
2465 | jl .if_0e ;if( (word_n=ted_arr_key_pos[(unsigned char)tf[0]])>-1 ){ |
2466 | jl .if_0e ;if( (word_n=ted_arr_key_pos[(unsigned char)tf[0]])>-1 ){ |
Line 3384... | Line 3385... | ||
3384 | @@: |
3385 | @@: |
3385 | call ted_iterat_perv |
3386 | call ted_iterat_perv |
3386 | cmp edx,ted_tex_1 |
3387 | cmp edx,ted_tex_1 |
3387 | jle .exit |
3388 | jle .exit |
3388 | .on_first: |
3389 | .on_first: |
3389 | xor eax,eax |
- | |
3390 | mov al,byte[edx+1] |
3390 | movzx eax,byte[edx+1] |
3391 | or al,al ;¥á«¨ al=0 ⮠梥⠥ ¬¥ï¥âáï |
3391 | or eax,eax ;¥á«¨ al=0 ⮠梥⠥ ¬¥ï¥âáï |
3392 | jz @b |
3392 | jz @b |
Line 3393... | Line 3393... | ||
3393 | 3393 | ||
3394 | cmp eax,ted_colors_text_count |
3394 | cmp eax,ted_colors_text_count |
Line 3395... | Line -... | ||
3395 | jge .exit |
- | |
3396 | 3395 | jge .exit |
|
3397 | shl ax,2 ;㬮¦ ¥¬ ¨¤¥ªá 梥â 4 ¡ ©â |
3396 | |
3398 | mov ecx,ted_text_colors ;¯à¨¡ ¢«ï¥¬ ᬥ饨¥ 1-£® 梥â |
3397 | mov ecx,ted_text_colors ;¯à¨¡ ¢«ï¥¬ ᬥ饨¥ 1-£® 梥â |
3399 | add ecx,eax |
3398 | lea ecx,[ecx+4*eax] |
3400 | mov ecx,[ecx] ;ãáâ ¢«¨¢ ¥¬ ⥪ã騩 梥â ⥪áâ ¯® ᬥ饨î |
3399 | mov ecx,[ecx] ;ãáâ ¢«¨¢ ¥¬ ⥪ã騩 梥â ⥪áâ ¯® ᬥ饨î |
3401 | .exit: |
3400 | .exit: |
3402 | or ecx,ted_font_size |
3401 | or ecx,ted_font_size |
Line 3772... | Line 3771... | ||
3772 | shl ebx,16 |
3771 | shl ebx,16 |
3773 | add ebx,ted_wnd_t |
3772 | add ebx,ted_wnd_t |
3774 | add ebx,13 ;=3+10 |
3773 | add ebx,13 ;=3+10 |
Line 3775... | Line 3774... | ||
3775 | 3774 | ||
3776 | ;SetTextColor |
- | |
3777 | xor eax,eax |
3775 | ;SetTextColor |
3778 | mov al,byte[edx+MAX_COLOR_WORD_LEN+7] |
3776 | movzx eax,byte[edx+MAX_COLOR_WORD_LEN+7] |
3779 | shl ax,2 |
3777 | shl eax,2 |
3780 | mov ecx,ted_text_colors |
3778 | mov ecx,ted_text_colors |
3781 | add ecx,eax |
3779 | add ecx,eax |
3782 | mov ecx,[ecx] |
3780 | mov ecx,[ecx] |
3783 | or ecx,0xc0000000 ;SetTextStyles |
3781 | or ecx,0xc0000000 ;SetTextStyles |
Line 4129... | Line 4127... | ||
4129 | cmp byte[edx],13 |
4127 | cmp byte[edx],13 |
4130 | je @f |
4128 | je @f |
4131 | or ebx,ebx |
4129 | or ebx,ebx |
4132 | jz @f |
4130 | jz @f |
4133 | ;-------------------------------------- |
4131 | ;-------------------------------------- |
4134 | xor eax,eax ;eax ¡ã¤¥â ¬¥ïâìáï |
4132 | ;eax ¡ã¤¥â ¬¥ïâìáï |
4135 | mov al,byte[edx+1] |
4133 | movzx eax,byte[edx+1] |
4136 | or al,al |
4134 | or eax,eax |
4137 | jz .no_color |
4135 | jz .no_color |
4138 | cmp eax,ted_colors_text_count |
4136 | cmp eax,ted_colors_text_count |
4139 | jge .no_color |
4137 | jge .no_color |
4140 | xor ecx,ecx |
- | |
4141 | mov cl,byte[edx+1] |
4138 | movzx ecx,byte[edx+1] |
4142 | shl cx,2 |
4139 | shl ecx,2 |
4143 | add ecx,ted_text_colors |
4140 | add ecx,ted_text_colors |
4144 | mov ecx,[ecx] |
4141 | mov ecx,[ecx] |
4145 | .no_color: |
4142 | .no_color: |
4146 | ;-------------------------------------- |
4143 | ;-------------------------------------- |
4147 | mov eax,edx |
4144 | mov eax,edx |