Rev 7036 | Rev 7571 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7036 | Rev 7497 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ; ¬ ªà®á ¤«ï á¨á⥬®© ¡¨¡«¨®â¥ª¨ box_lib.obj |
1 | ; ¬ ªà®á ¤«ï á¨á⥬®© ¡¨¡«¨®â¥ª¨ box_lib.obj |
2 | ; í«¥¬¥â TextEditor ¤«ï Kolibri OS |
2 | ; í«¥¬¥â TextEditor ¤«ï Kolibri OS |
3 | ; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 20.02.2016 IgorA |
3 | ; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 21.10.2018 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 273... | Line 273... | ||
273 | @@: |
273 | @@: |
274 | cmp ah,44 ;Ctrl+Z |
274 | cmp ah,44 ;Ctrl+Z |
275 | jne @f |
275 | jne @f |
276 | stdcall ted_but_undo,edi |
276 | stdcall ted_but_undo,edi |
277 | @@: |
277 | @@: |
- | 278 | cmp ah,45 ;Ctrl+X |
|
- | 279 | jne @f |
|
- | 280 | stdcall ted_but_cut,edi |
|
- | 281 | @@: |
|
278 | cmp ah,46 ;Ctrl+C |
282 | cmp ah,46 ;Ctrl+C |
279 | jne @f |
283 | jne @f |
280 | stdcall ted_but_copy,edi |
284 | stdcall ted_but_copy,edi |
281 | @@: |
285 | @@: |
282 | cmp ah,47 ;Ctrl+V |
286 | cmp ah,47 ;Ctrl+V |
Line 607... | Line 611... | ||
607 | ; ãªæ¨ï ¢ë§ë¢ ¥¬ ï ¯à¨ ç «¥ ¢ë¤¥«¥¨ï |
611 | ; ãªæ¨ï ¢ë§ë¢ ¥¬ ï ¯à¨ ç «¥ ¢ë¤¥«¥¨ï |
608 | align 16 |
612 | align 16 |
609 | proc ted_sel_start uses eax ecx |
613 | proc ted_sel_start uses eax ecx |
610 | mov eax,ted_scr_h |
614 | mov eax,ted_scr_h |
611 | mov ecx,ted_cur_x |
615 | mov ecx,ted_cur_x |
612 | add ecx,dword[eax+sb_offs_position] |
616 | add ecx,[eax+sb_offs_position] |
613 | mov ted_sel_x0,ecx |
617 | mov ted_sel_x0,ecx |
614 | mov ted_sel_x1,ecx |
618 | mov ted_sel_x1,ecx |
Line 615... | Line 619... | ||
615 | 619 | ||
616 | mov eax,ted_scr_w |
620 | mov eax,ted_scr_w |
617 | mov ecx,ted_cur_y |
621 | mov ecx,ted_cur_y |
618 | add ecx,dword[eax+sb_offs_position] |
622 | add ecx,[eax+sb_offs_position] |
619 | mov ted_sel_y0,ecx |
623 | mov ted_sel_y0,ecx |
620 | mov ted_sel_y1,ecx |
624 | mov ted_sel_y1,ecx |
621 | ret |
625 | ret |
Line 628... | Line 632... | ||
628 | align 16 |
632 | align 16 |
629 | proc ted_sel_move |
633 | proc ted_sel_move |
630 | push eax ecx |
634 | push eax ecx |
631 | mov ecx,ted_cur_x |
635 | mov ecx,ted_cur_x |
632 | mov eax,ted_scr_h |
636 | mov eax,ted_scr_h |
633 | add ecx,dword[eax+sb_offs_position] |
637 | add ecx,[eax+sb_offs_position] |
634 | mov ted_sel_x1,ecx |
638 | mov ted_sel_x1,ecx |
Line 635... | Line 639... | ||
635 | 639 | ||
636 | mov eax,ted_scr_w |
640 | mov eax,ted_scr_w |
637 | mov ecx,ted_cur_y |
641 | mov ecx,ted_cur_y |
638 | add ecx,dword[eax+sb_offs_position] |
642 | add ecx,[eax+sb_offs_position] |
639 | mov ted_sel_y1,ecx |
643 | mov ted_sel_y1,ecx |
640 | pop ecx eax |
644 | pop ecx eax |
641 | cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy) |
645 | cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy) |
642 | je @f |
646 | je @f |
Line 898... | Line 902... | ||
898 | ted_iterat_perv: |
902 | ted_iterat_perv: |
899 | cmp ted_tim_undo,0 |
903 | cmp ted_tim_undo,0 |
900 | je .else |
904 | je .else |
901 | push ebx |
905 | push ebx |
902 | @@: |
906 | @@: |
903 | mov edx,dword[edx+2] |
907 | mov edx,[edx+2] |
904 | cmp edx,0 |
908 | cmp edx,0 |
905 | je @f |
909 | je @f |
906 | imul edx,sizeof.symbol |
910 | imul edx,sizeof.symbol |
907 | add edx,ted_tex |
911 | add edx,ted_tex |
908 | call ted_symbol_not_vis |
912 | call ted_symbol_not_vis |
Line 915... | Line 919... | ||
915 | @@: |
919 | @@: |
916 | mov edx,ted_tex ; ç «® ä ©« |
920 | mov edx,ted_tex ; ç «® ä ©« |
917 | pop ebx |
921 | pop ebx |
918 | ret |
922 | ret |
919 | .else: |
923 | .else: |
920 | mov edx,dword[edx+2] |
924 | mov edx,[edx+2] |
921 | cmp edx,0 |
925 | cmp edx,0 |
922 | je @f |
926 | je @f |
923 | imul edx,sizeof.symbol |
927 | imul edx,sizeof.symbol |
924 | add edx,ted_tex |
928 | add edx,ted_tex |
925 | cmp dword [edx+14],0 |
929 | cmp dword [edx+14],0 |
Line 941... | Line 945... | ||
941 | ted_iterat_next: |
945 | ted_iterat_next: |
942 | cmp ted_tim_undo,0 |
946 | cmp ted_tim_undo,0 |
943 | je .else |
947 | je .else |
944 | push ebx |
948 | push ebx |
945 | @@: |
949 | @@: |
946 | mov edx,dword[edx+6] |
950 | mov edx,[edx+6] |
947 | cmp edx,1 |
951 | cmp edx,1 |
948 | jle @f |
952 | jle @f |
949 | imul edx,sizeof.symbol |
953 | imul edx,sizeof.symbol |
950 | add edx,ted_tex |
954 | add edx,ted_tex |
Line 959... | Line 963... | ||
959 | @@: |
963 | @@: |
960 | mov edx,ted_tex_1 ;ª®¥æ ä ©« |
964 | mov edx,ted_tex_1 ;ª®¥æ ä ©« |
961 | pop ebx |
965 | pop ebx |
962 | ret |
966 | ret |
963 | .else: |
967 | .else: |
964 | mov edx,dword[edx+6] |
968 | mov edx,[edx+6] |
965 | cmp edx,1 |
969 | cmp edx,1 |
966 | jle @f |
970 | jle @f |
967 | imul edx,sizeof.symbol |
971 | imul edx,sizeof.symbol |
968 | add edx,ted_tex |
972 | add edx,ted_tex |
Line 1086... | Line 1090... | ||
1086 | pushad |
1090 | pushad |
1087 | cmp dword[t_len],1 ;¯à®¢¥à塞 ¤«¨ã ¤®¡¢«ï¥¬®£® ⥪áâ |
1091 | cmp dword[t_len],1 ;¯à®¢¥à塞 ¤«¨ã ¤®¡¢«ï¥¬®£® ⥪áâ |
1088 | jl .no_add ;ª®£¤ ¤«¨ <1 ¯àë£ ¥¬ ª®¥æ äãªæ¨¨, ¢® ¨§¡¥¦ ¨¥ £«îª®¢ |
1092 | jl .no_add ;ª®£¤ ¤«¨ <1 ¯àë£ ¥¬ ª®¥æ äãªæ¨¨, ¢® ¨§¡¥¦ ¨¥ £«îª®¢ |
Line 1089... | Line 1093... | ||
1089 | 1093 | ||
1090 | mov edi,[edit] |
1094 | mov edi,[edit] |
Line 1091... | Line 1095... | ||
1091 | mov esi,dword[text] |
1095 | mov esi,[text] |
1092 | 1096 | ||
1093 | call ted_get_pos_by_cursor |
1097 | call ted_get_pos_by_cursor |
Line 1094... | Line 1098... | ||
1094 | call ted_get_text_perv_pos |
1098 | call ted_get_text_perv_pos |
1095 | call ted_get_text_arr_index ;eax=po_t |
1099 | call ted_get_text_arr_index ;eax=po_t |
1096 | 1100 | ||
1097 | mov dword[new_spc],0 |
1101 | mov dword[new_spc],0 |
1098 | cmp ted_gp_opt,2 |
1102 | cmp ted_gp_opt,2 |
1099 | je @f |
1103 | je @f |
1100 | push eax ;c_sp=cur[cn].x+Scroller->XPos-StrLen(cur[cn].y+Scroller->YPos); |
1104 | push eax ;c_sp=cur[cn].x+Scroller->XPos-StrLen(cur[cn].y+Scroller->YPos); |
1101 | mov eax,ted_scr_h |
1105 | mov eax,ted_scr_h |
Line 1102... | Line 1106... | ||
1102 | mov eax,dword[eax+sb_offs_position] |
1106 | mov eax,[eax+sb_offs_position] |
1103 | add eax,ted_cur_x ;eax - ®¬¥à ᨬ¢®« |
1107 | add eax,ted_cur_x ;eax - ®¬¥à ᨬ¢®« |
1104 | mov dword[new_spc],eax |
1108 | mov [new_spc],eax |
1105 | 1109 | ||
1106 | mov eax,ted_scr_w |
1110 | mov eax,ted_scr_w |
1107 | mov eax,dword[eax+sb_offs_position] |
1111 | mov eax,[eax+sb_offs_position] |
1108 | add eax,ted_cur_y ;eax - ®¬¥à áâப¨ |
1112 | add eax,ted_cur_y ;eax - ®¬¥à áâப¨ |
Line 1109... | Line 1113... | ||
1109 | call ted_strlen ;ebx = line len |
1113 | call ted_strlen ;ebx = line len |
Line 1110... | Line 1114... | ||
1110 | sub dword[new_spc],ebx ;®â ¯®§¨æ¨¨ ªãàá®à ®â¨¬ ¥¬ ¤«¨ã áâப¨, 㧠¥¬ ª®««¨ç¥á⢮ ¤®¡ ¢«ï¥¬ëå ¯à®¡¥«®¢ |
1114 | sub [new_spc],ebx ;®â ¯®§¨æ¨¨ ªãàá®à ®â¨¬ ¥¬ ¤«¨ã áâப¨, 㧠¥¬ ª®««¨ç¥á⢮ ¤®¡ ¢«ï¥¬ëå ¯à®¡¥«®¢ |
1111 | pop eax |
1115 | pop eax |
1112 | @@: |
1116 | @@: |
1113 | 1117 | ||
1114 | mov ebx,dword[t_len] |
1118 | mov ebx,[t_len] |
1115 | 1119 | ||
1116 | mov dword[new_lin],0 |
1120 | mov dword[new_lin],0 |
1117 | cmp ted_gp_opt,0 |
1121 | cmp ted_gp_opt,0 |
1118 | jne @f |
1122 | jne @f |
Line 1119... | Line 1123... | ||
1119 | push eax |
1123 | push eax |
1120 | mov eax,ted_scr_w |
1124 | mov eax,ted_scr_w |
1121 | mov eax,dword[eax+sb_offs_position] |
1125 | mov eax,[eax+sb_offs_position] |
1122 | add eax,ted_cur_y |
1126 | add eax,ted_cur_y |
1123 | inc eax |
1127 | inc eax |
1124 | mov dword[new_lin],eax |
1128 | mov [new_lin],eax |
1125 | 1129 | ||
Line 1126... | Line 1130... | ||
1126 | call ted_get_num_lines |
1130 | call ted_get_num_lines |
1127 | sub dword[new_lin],eax |
1131 | sub [new_lin],eax |
Line 1300... | Line 1304... | ||
1300 | ;input: |
1304 | ;input: |
1301 | ; table - â ¡«¨æ ¤«ï ¯¥à¥ª®¤¨à®¢ª¨ |
1305 | ; table - â ¡«¨æ ¤«ï ¯¥à¥ª®¤¨à®¢ª¨ |
1302 | align 16 |
1306 | align 16 |
1303 | proc ted_but_convert_by_table uses eax edx edi esi, edit:dword, table:dword |
1307 | proc ted_but_convert_by_table uses eax edx edi esi, edit:dword, table:dword |
1304 | mov edi,[edit] |
1308 | mov edi,[edit] |
1305 | mov esi,dword[table] |
1309 | mov esi,[table] |
1306 | mov edx,ted_tex |
1310 | mov edx,ted_tex |
1307 | .cycle: |
1311 | .cycle: |
1308 | ;¯¥à¥å®¤¨¬ á«¥¤ãî騩 ᨬ¢®« |
1312 | ;¯¥à¥å®¤¨¬ á«¥¤ãî騩 ᨬ¢®« |
1309 | mov edx,dword[edx+6] |
1313 | mov edx,[edx+6] |
1310 | cmp edx,1 |
1314 | cmp edx,1 |
1311 | jle .end_text |
1315 | jle .end_text |
1312 | imul edx,sizeof.symbol |
1316 | imul edx,sizeof.symbol |
1313 | add edx,ted_tex |
1317 | add edx,ted_tex |
Line 1400... | Line 1404... | ||
1400 | ; bl = 0 - no delete |
1404 | ; bl = 0 - no delete |
1401 | ; bl = 1 - delete |
1405 | ; bl = 1 - delete |
1402 | align 16 |
1406 | align 16 |
1403 | proc ted_text_del uses ecx edx edi, edit:dword, del_opt:dword |
1407 | proc ted_text_del uses ecx edx edi, edit:dword, del_opt:dword |
1404 | mov edi,[edit] |
1408 | mov edi,[edit] |
1405 | mov ebx,dword[del_opt] |
1409 | mov ebx,[del_opt] |
Line 1406... | Line 1410... | ||
1406 | 1410 | ||
1407 | xor cl,cl |
1411 | xor cl,cl |
1408 | test ebx,ted_opt_ed_move_cursor |
1412 | test ebx,ted_opt_ed_move_cursor |
1409 | jz @f |
1413 | jz @f |
Line 1576... | Line 1580... | ||
1576 | ; dl = 8 if scroll move down |
1580 | ; dl = 8 if scroll move down |
1577 | align 16 |
1581 | align 16 |
1578 | ted_cur_move_down: |
1582 | ted_cur_move_down: |
1579 | push eax ebx |
1583 | push eax ebx |
1580 | mov ebx,ted_scr_w |
1584 | mov ebx,ted_scr_w |
1581 | mov dl,0 |
1585 | xor dl,dl |
1582 | mov eax,dword[ebx+sb_offs_cur_area] |
1586 | mov eax,[ebx+sb_offs_cur_area] |
1583 | dec eax |
1587 | dec eax |
1584 | cmp ted_cur_y,eax |
1588 | cmp ted_cur_y,eax |
1585 | jge @f |
1589 | jge @f |
1586 | inc ted_cur_y |
1590 | inc ted_cur_y |
1587 | mov dl,2 |
1591 | mov dl,2 |
1588 | jmp .ret_f |
1592 | jmp .ret_f |
1589 | @@: |
1593 | @@: |
1590 | mov eax,ted_cur_y |
1594 | mov eax,ted_cur_y |
1591 | add eax,dword[ebx+sb_offs_position] |
1595 | add eax,[ebx+sb_offs_position] |
1592 | inc eax |
1596 | inc eax |
1593 | cmp dword[ebx+sb_offs_max_area],eax |
1597 | cmp [ebx+sb_offs_max_area],eax |
1594 | jle @f |
1598 | jle @f |
1595 | inc dword[ebx+sb_offs_position] |
1599 | inc dword[ebx+sb_offs_position] |
1596 | mov dl,8 |
1600 | mov dl,8 |
1597 | @@: |
1601 | @@: |
1598 | .ret_f: |
1602 | .ret_f: |
Line 1607... | Line 1611... | ||
1607 | ; dl = 1 if move up |
1611 | ; dl = 1 if move up |
1608 | align 16 |
1612 | align 16 |
1609 | ted_cur_move_page_up: |
1613 | ted_cur_move_page_up: |
1610 | push eax ebx |
1614 | push eax ebx |
1611 | mov ebx,ted_scr_w |
1615 | mov ebx,ted_scr_w |
1612 | mov eax,dword[ebx+sb_offs_cur_area] |
1616 | mov eax,[ebx+sb_offs_cur_area] |
1613 | xor dl,dl |
1617 | xor dl,dl |
1614 | cmp eax,dword[ebx+sb_offs_position] |
1618 | cmp eax,[ebx+sb_offs_position] |
1615 | jg @f |
1619 | jg @f |
1616 | sub dword[ebx+sb_offs_position],eax |
1620 | sub [ebx+sb_offs_position],eax |
1617 | mov dl,1 |
1621 | mov dl,1 |
1618 | @@: |
1622 | @@: |
1619 | cmp dword[ebx+sb_offs_position],0 |
1623 | cmp dword[ebx+sb_offs_position],0 |
1620 | je @f |
1624 | je @f |
1621 | cmp dl,1 |
1625 | cmp dl,1 |
Line 1632... | Line 1636... | ||
1632 | ted_cur_move_page_down: |
1636 | ted_cur_move_page_down: |
1633 | push eax ebx ecx |
1637 | push eax ebx ecx |
1634 | mov ecx,ted_scr_w |
1638 | mov ecx,ted_scr_w |
Line 1635... | Line 1639... | ||
1635 | 1639 | ||
1636 | xor dl,dl |
1640 | xor dl,dl |
1637 | mov eax,dword[ecx+sb_offs_max_area] |
1641 | mov eax,[ecx+sb_offs_max_area] |
1638 | sub eax,dword[ecx+sb_offs_cur_area] |
1642 | sub eax,[ecx+sb_offs_cur_area] |
1639 | cmp dword[ecx+sb_offs_position],eax |
1643 | cmp [ecx+sb_offs_position],eax |
1640 | jge @f |
1644 | jge @f |
1641 | mov ebx,dword[ecx+sb_offs_cur_area] |
1645 | mov ebx,[ecx+sb_offs_cur_area] |
1642 | add dword[ecx+sb_offs_position],ebx |
1646 | add [ecx+sb_offs_position],ebx |
1643 | mov dl,1 |
1647 | mov dl,1 |
1644 | mov dword[ecx+sb_offs_redraw],1 |
1648 | mov dword[ecx+sb_offs_redraw],1 |
1645 | cmp dword[ecx+sb_offs_position],eax |
1649 | cmp [ecx+sb_offs_position],eax |
1646 | jle @f |
1650 | jle @f |
1647 | mov dword[ecx+sb_offs_position],eax |
1651 | mov [ecx+sb_offs_position],eax |
1648 | @@: |
1652 | @@: |
1649 | pop ecx ebx eax |
1653 | pop ecx ebx eax |
Line 1650... | Line 1654... | ||
1650 | ret |
1654 | ret |
Line 1703... | Line 1707... | ||
1703 | align 16 |
1707 | align 16 |
1704 | ted_cur_move_right: |
1708 | ted_cur_move_right: |
1705 | push eax ebx |
1709 | push eax ebx |
1706 | mov eax,ted_scr_h |
1710 | mov eax,ted_scr_h |
1707 | xor dl,dl |
1711 | xor dl,dl |
1708 | mov ebx,dword[eax+sb_offs_cur_area] |
1712 | mov ebx,[eax+sb_offs_cur_area] |
1709 | cmp ted_cur_x,ebx |
1713 | cmp ted_cur_x,ebx |
1710 | jge @f |
1714 | jge @f |
1711 | inc ted_cur_x |
1715 | inc ted_cur_x |
1712 | mov dl,1 |
1716 | mov dl,1 |
1713 | jmp .ret_f |
1717 | jmp .ret_f |
Line 1726... | Line 1730... | ||
1726 | ;[hScr.cur_area] |
1730 | ;[hScr.cur_area] |
1727 | ;dl-??? |
1731 | ;dl-??? |
1728 | push eax ebx ecx |
1732 | push eax ebx ecx |
1729 | mov eax,ted_cur_y |
1733 | mov eax,ted_cur_y |
1730 | mov ecx,ted_scr_w |
1734 | mov ecx,ted_scr_w |
1731 | add eax,dword[ecx+sb_offs_position] |
1735 | add eax,[ecx+sb_offs_position] |
1732 | call ted_strlen |
1736 | call ted_strlen |
1733 | xor dl,dl |
1737 | xor dl,dl |
Line 1734... | Line 1738... | ||
1734 | 1738 | ||
1735 | mov ecx,ted_scr_h |
1739 | mov ecx,ted_scr_h |
1736 | cmp ebx,dword[ecx+sb_offs_position] |
1740 | cmp ebx,[ecx+sb_offs_position] |
1737 | jge @f |
1741 | jge @f |
1738 | mov dl,8 |
1742 | mov dl,8 |
1739 | mov dword[ecx+sb_offs_position],ebx |
1743 | mov [ecx+sb_offs_position],ebx |
1740 | @@: |
1744 | @@: |
Line 1741... | Line 1745... | ||
1741 | sub ebx,dword[ecx+sb_offs_position] |
1745 | sub ebx,[ecx+sb_offs_position] |
1742 | 1746 | ||
1743 | cmp ebx,dword[ecx+sb_offs_cur_area] |
1747 | cmp ebx,[ecx+sb_offs_cur_area] |
1744 | jle @f ; b---[---]---e |
1748 | jle @f ; b---[---]---e |
1745 | add dword[ecx+sb_offs_position],ebx |
1749 | add [ecx+sb_offs_position],ebx |
1746 | mov ebx,dword[ecx+sb_offs_cur_area] |
1750 | mov ebx,[ecx+sb_offs_cur_area] |
1747 | sub dword[ecx+sb_offs_position],ebx |
1751 | sub [ecx+sb_offs_position],ebx |
1748 | mov dl,8 |
1752 | mov dl,8 |
1749 | @@: |
1753 | @@: |
1750 | mov ted_cur_x,ebx |
1754 | mov ted_cur_x,ebx |
Line 1796... | Line 1800... | ||
1796 | ; edi = pointer to tedit struct |
1800 | ; edi = pointer to tedit struct |
1797 | ;output: |
1801 | ;output: |
1798 | ; edx = pointer to 'perv' struct |
1802 | ; edx = pointer to 'perv' struct |
1799 | align 16 |
1803 | align 16 |
1800 | ted_get_text_perv_pos: |
1804 | ted_get_text_perv_pos: |
1801 | mov edx,dword[edx+2] |
1805 | mov edx,[edx+2] |
1802 | imul edx,sizeof.symbol |
1806 | imul edx,sizeof.symbol |
1803 | add edx,ted_tex |
1807 | add edx,ted_tex |
1804 | ret |
1808 | ret |
Line 1805... | Line 1809... | ||
1805 | 1809 | ||
1806 | ;input: |
1810 | ;input: |
1807 | ; edx = pointer to symbol struct |
1811 | ; edx = pointer to symbol struct |
1808 | ;output: |
1812 | ;output: |
1809 | ; edx = pointer to 'next' symbol struct |
1813 | ; edx = pointer to 'next' symbol struct |
1810 | align 16 |
1814 | align 16 |
1811 | ted_get_text_next_pos: |
1815 | ted_get_text_next_pos: |
1812 | mov edx,dword[edx+6] |
1816 | mov edx,[edx+6] |
1813 | imul edx,sizeof.symbol |
1817 | imul edx,sizeof.symbol |
1814 | add edx,ted_tex |
1818 | add edx,ted_tex |
Line 1815... | Line 1819... | ||
1815 | ret |
1819 | ret |
Line 1824... | Line 1828... | ||
1824 | align 16 |
1828 | align 16 |
1825 | ted_get_pos_by_cursor: |
1829 | ted_get_pos_by_cursor: |
1826 | push eax ecx esi |
1830 | push eax ecx esi |
1827 | mov esi,ted_cur_x |
1831 | mov esi,ted_cur_x |
1828 | mov eax,ted_scr_h |
1832 | mov eax,ted_scr_h |
1829 | add esi,dword[eax+sb_offs_position] |
1833 | add esi,[eax+sb_offs_position] |
1830 | mov ecx,ted_cur_y |
1834 | mov ecx,ted_cur_y |
1831 | mov eax,ted_scr_w |
1835 | mov eax,ted_scr_w |
1832 | add ecx,dword[eax+sb_offs_position] |
1836 | add ecx,[eax+sb_offs_position] |
1833 | call ted_get_pos_by_coords |
1837 | call ted_get_pos_by_coords |
1834 | pop esi ecx eax |
1838 | pop esi ecx eax |
1835 | ret |
1839 | ret |
Line 1836... | Line 1840... | ||
1836 | 1840 | ||
Line 2051... | Line 2055... | ||
2051 | align 16 |
2055 | align 16 |
2052 | ted_go_to_pos: |
2056 | ted_go_to_pos: |
2053 | push eax |
2057 | push eax |
2054 | mov eax,ted_scr_w |
2058 | mov eax,ted_scr_w |
2055 | mov ted_cur_x,ecx |
2059 | mov ted_cur_x,ecx |
2056 | sub edx,dword[eax+sb_offs_position] |
2060 | sub edx,[eax+sb_offs_position] |
Line 2057... | Line 2061... | ||
2057 | 2061 | ||
2058 | cmp edx,dword[eax+sb_offs_cur_area] ;ted_cur_y > [.cur_area] |
2062 | cmp edx,[eax+sb_offs_cur_area] ;ted_cur_y > [.cur_area] |
2059 | jl @f |
2063 | jl @f |
2060 | push ebx |
2064 | push ebx |
2061 | mov ebx,edx |
2065 | mov ebx,edx |
2062 | sub ebx,dword[eax+sb_offs_cur_area] |
2066 | sub ebx,[eax+sb_offs_cur_area] |
2063 | inc ebx |
2067 | inc ebx |
2064 | add dword[eax+sb_offs_position],ebx |
2068 | add [eax+sb_offs_position],ebx |
2065 | sub edx,ebx |
2069 | sub edx,ebx |
2066 | pop ebx |
2070 | pop ebx |
2067 | ; ??? redrav |
2071 | ; ??? redrav |
2068 | @@: |
2072 | @@: |
Line 2130... | Line 2134... | ||
2130 | 2134 | ||
2131 | xor eax,eax |
2135 | xor eax,eax |
2132 | mov al,byte[edx] |
2136 | mov al,byte[edx] |
2133 | shl ax,2 ;eax*=4 |
2137 | shl ax,2 ;eax*=4 |
2134 | add eax,ted_arr_key_pos |
2138 | add eax,ted_arr_key_pos |
2135 | mov eax,dword[eax] |
2139 | mov eax,[eax] |
2136 | cmp eax,0 |
2140 | cmp eax,0 |
Line 2137... | Line 2141... | ||
2137 | jl @b ;if( (word_n=ted_arr_key_pos[(unsigned char)tex[i].c])>-1 ){ |
2141 | jl @b ;if( (word_n=ted_arr_key_pos[(unsigned char)tex[i].c])>-1 ){ |
2138 | 2142 | ||
Line 2148... | Line 2152... | ||
2148 | jne .wh_1e |
2152 | jne .wh_1e |
2149 | inc ecx |
2153 | inc ecx |
2150 | jmp .wh_1b |
2154 | jmp .wh_1b |
2151 | .wh_1e: |
2155 | .wh_1e: |
Line 2152... | Line 2156... | ||
2152 | 2156 | ||
2153 | mov dword[begPos],edx ;bP=i; |
2157 | mov [begPos],edx ;bP=i; |
2154 | mov esi,1 |
2158 | mov esi,1 |
2155 | align 4 |
2159 | align 4 |
2156 | .wh_2b: ;while(1){ |
2160 | .wh_2b: ;while(1){ |
Line 2172... | Line 2176... | ||
2172 | .wh_3e: |
2176 | .wh_3e: |
Line 2173... | Line 2177... | ||
2173 | 2177 | ||
2174 | ColToIndexOffset eax,ebx |
2178 | ColToIndexOffset eax,ebx |
2175 | cmp byte[ebx+esi],0 |
2179 | cmp byte[ebx+esi],0 |
2176 | jne .if_0 ;if(Col[word_n].Text[pos]==0){ |
2180 | jne .if_0 ;if(Col[word_n].Text[pos]==0){ |
2177 | mov dword[endPos],edx ;eP=i; |
2181 | mov [endPos],edx ;eP=i; |
2178 | ColToIndexOffset eax,ebx |
2182 | ColToIndexOffset eax,ebx |
2179 | mov bl,byte[ebx+MAX_COLOR_WORD_LEN+7] |
2183 | mov bl,[ebx+MAX_COLOR_WORD_LEN+7] |
Line 2180... | Line 2184... | ||
2180 | mov byte[f_color],bl ;f_color=Col[word_n].color; |
2184 | mov [f_color],bl ;f_color=Col[word_n].color; |
2181 | 2185 | ||
2182 | mov byte[find],1 |
2186 | mov byte[find],1 |
2183 | ColToIndexOffset eax,ebx ;... ebx = Col[word_n] |
2187 | ColToIndexOffset eax,ebx ;... ebx = Col[word_n] |
2184 | mov bl,byte[ebx+MAX_COLOR_WORD_LEN+4] |
2188 | mov bl,[ebx+MAX_COLOR_WORD_LEN+4] |
2185 | cmp bl,0 ;if(Col[word_n].wwo) |
2189 | cmp bl,0 ;if(Col[word_n].wwo) |
2186 | je .if_2n |
2190 | je .if_2n |
2187 | push edx |
2191 | push edx |
Line 2188... | Line 2192... | ||
2188 | mov edx,dword[begPos] |
2192 | mov edx,[begPos] |
2189 | call ted_iterat_perv |
2193 | call ted_iterat_perv |
2190 | 2194 | ||
Line 2203... | Line 2207... | ||
2203 | call isalpha |
2207 | call isalpha |
2204 | jae .if_4e |
2208 | jae .if_4e |
2205 | mov byte[find],0 |
2209 | mov byte[find],0 |
2206 | .if_4e: |
2210 | .if_4e: |
Line 2207... | Line 2211... | ||
2207 | 2211 | ||
2208 | mov edx,dword[endPos] |
2212 | mov edx,[endPos] |
Line 2209... | Line 2213... | ||
2209 | ;call ted_iterat_next |
2213 | ;call ted_iterat_next |
2210 | 2214 | ||
2211 | btr bx,1 ;2-1 |
2215 | btr bx,1 ;2-1 |
Line 2269... | Line 2273... | ||
2269 | jmp .wh_2b |
2273 | jmp .wh_2b |
2270 | .wh_2e: |
2274 | .wh_2e: |
Line 2271... | Line 2275... | ||
2271 | 2275 | ||
2272 | cmp byte[find],1 ;if(fnd)break; |
2276 | cmp byte[find],1 ;if(fnd)break; |
2273 | je @f |
2277 | je @f |
2274 | mov edx,dword[begPos];i=bP; |
2278 | mov edx,[begPos];i=bP; |
2275 | jmp @b |
2279 | jmp @b |
Line 2276... | Line 2280... | ||
2276 | @@: |
2280 | @@: |
2277 | 2281 | ||
2278 | cmp byte[find],1 |
2282 | cmp byte[find],1 |
2279 | jne .if_1e ;if(fnd){ // ¢ë¤¥«¥¨¥ ©¤¥®£® ⥪áâ |
2283 | jne .if_1e ;if(fnd){ // ¢ë¤¥«¥¨¥ ©¤¥®£® ⥪áâ |
2280 | ;if(!mode_sf1 || (mode_sf1 && strlen(Col[word_n].f1->c_str())>0)){ |
2284 | ;if(!mode_sf1 || (mode_sf1 && strlen(Col[word_n].f1->c_str())>0)){ |
2281 | mov eax,dword[begPos] |
2285 | mov eax,[begPos] |
2282 | mov bl,byte[f_color] |
2286 | mov bl,[f_color] |
2283 | mov byte[eax+1],bl ;tex[bP].col=f_color; |
2287 | mov [eax+1],bl ;tex[bP].col=f_color; |
2284 | mov eax,dword[endPos] |
2288 | mov eax,[endPos] |
2285 | mov byte[eax+1],0xff ;tex[eP].col=255; |
2289 | mov byte[eax+1],0xff ;tex[eP].col=255; |
2286 | ;return ItPoPerv(eP); // ¢®§¢à é ¥¬ ¯®§¨æ¨î ª®æ ¢å®¦¤¥¨ï |
2290 | ;return ItPoPerv(eP); // ¢®§¢à é ¥¬ ¯®§¨æ¨î ª®æ ¢å®¦¤¥¨ï |
2287 | mov edx,dword[endPos] |
2291 | mov edx,[endPos] |
2288 | call ted_get_text_perv_pos |
2292 | call ted_get_text_perv_pos |
2289 | jmp @f |
2293 | jmp @f |
2290 | .if_1e: |
2294 | .if_1e: |
Line 2364... | Line 2368... | ||
2364 | ; ebx = l_pos |
2368 | ; ebx = l_pos |
2365 | mov ted_help_id,-1 |
2369 | mov ted_help_id,-1 |
Line 2366... | Line 2370... | ||
2366 | 2370 | ||
2367 | push ebx ecx |
2371 | push ebx ecx |
2368 | xor ebx,ebx |
2372 | xor ebx,ebx |
2369 | mov bl,byte[edx] |
2373 | mov bl,[edx] |
2370 | shl bx,2 ;ebx*=4 |
2374 | shl bx,2 ;ebx*=4 |
2371 | add ebx,ted_arr_key_pos |
2375 | add ebx,ted_arr_key_pos |
2372 | mov ecx,dword[ebx] |
2376 | mov ecx,[ebx] |
2373 | cmp ecx,0 |
2377 | cmp ecx,0 |
2374 | jl .if_0e ;if( (word_n=ted_arr_key_pos[(unsigned char)tf[0]])>-1 ){ |
2378 | jl .if_0e ;if( (word_n=ted_arr_key_pos[(unsigned char)tf[0]])>-1 ){ |
2375 | push esi eax |
2379 | push esi eax |
2376 | mov ebx,ecx ;l_pos=word_n; |
2380 | mov ebx,ecx ;l_pos=word_n; |
2377 | ColToIndexOffset ecx,esi |
2381 | ColToIndexOffset ecx,esi |
2378 | push cx |
2382 | push cx |
2379 | mov cl,byte[esi] |
2383 | mov cl,[esi] |
2380 | @@: |
2384 | @@: |
2381 | cmp ebx,ted_key_words_count ;while(l_pos |
2385 | cmp ebx,ted_key_words_count ;while(l_pos |
2382 | jge @f |
2386 | jge @f |
2383 | ;ColToIndexOffset ecx,esi |
2387 | ;ColToIndexOffset ecx,esi |
2384 | ColToIndexOffset ebx,eax |
2388 | ColToIndexOffset ebx,eax |
2385 | cmp cl,byte[eax] ;&& Col[l_pos].Text[0]==Col[word_n].Text[0]) |
2389 | cmp cl,[eax] ;&& Col[l_pos].Text[0]==Col[word_n].Text[0]) |
2386 | jne @f |
2390 | jne @f |
2387 | inc ebx ;l_pos++; |
2391 | inc ebx ;l_pos++; |
2388 | jmp @b |
2392 | jmp @b |
2389 | @@: |
2393 | @@: |
Line 2418... | Line 2422... | ||
2418 | pop dx |
2422 | pop dx |
Line 2419... | Line 2423... | ||
2419 | 2423 | ||
2420 | cmp ecx,ebx ;if(word_n==l_pos) break; |
2424 | cmp ecx,ebx ;if(word_n==l_pos) break; |
2421 | je @f |
2425 | je @f |
2422 | call ted_iterat_next ;pos++; |
2426 | call ted_iterat_next ;pos++; |
2423 | cmp edx,dword[end_pos] ;for(...;i |
2427 | cmp edx,[end_pos] ;for(...;i |
2424 | je @f ;jge |
2428 | je @f ;jge |
2425 | inc esi |
2429 | inc esi |
2426 | jmp @b |
2430 | jmp @b |
2427 | @@: |
2431 | @@: |
Line 2542... | Line 2546... | ||
2542 | stdcall ted_draw,edi |
2546 | stdcall ted_draw,edi |
2543 | popad |
2547 | popad |
2544 | ret |
2548 | ret |
2545 | endp |
2549 | endp |
Line -... | Line 2550... | ||
- | 2550 | ||
- | 2551 | ;output: |
|
2546 | 2552 | ; al = 1 if delete |
|
2547 | align 16 |
2553 | align 16 |
2548 | proc ted_but_cut uses edi, edit:dword |
2554 | proc ted_but_cut uses edi, edit:dword |
Line 2549... | Line 2555... | ||
2549 | mov edi,[edit] |
2555 | mov edi,[edit] |
Line 2560... | Line 2566... | ||
2560 | call ted_fun_draw_panel_buttons |
2566 | call ted_fun_draw_panel_buttons |
2561 | @@: |
2567 | @@: |
2562 | ret |
2568 | ret |
2563 | endp |
2569 | endp |
Line 2564... | Line -... | ||
2564 | - | ||
2565 | ;output: |
- | |
2566 | ; al = 1 if copy text |
2570 | |
2567 | align 16 |
2571 | align 16 |
2568 | proc ted_but_copy, edit:dword |
2572 | proc ted_but_copy, edit:dword |
2569 | pushad |
2573 | pushad |
Line 2642... | Line 2646... | ||
2642 | mcall SF_CLIPBOARD,SSF_READ_CB,esi |
2646 | mcall SF_CLIPBOARD,SSF_READ_CB,esi |
2643 | cmp eax,1 |
2647 | cmp eax,1 |
2644 | je .no_buf_r |
2648 | je .no_buf_r |
2645 | cmp eax,-1 |
2649 | cmp eax,-1 |
2646 | je .no_buf_r |
2650 | je .no_buf_r |
2647 | mov ecx,dword[eax] |
2651 | mov ecx,[eax] |
2648 | cmp ecx,1 ;size |
2652 | cmp ecx,1 ;size |
2649 | jl .no_buf_r |
2653 | jl .no_buf_r |
2650 | cmp dword[eax+4],0 ;text |
2654 | cmp dword[eax+4],0 ;text |
2651 | je @f |
2655 | je @f |
2652 | cmp esi,1 |
2656 | cmp esi,1 |
Line 2861... | Line 2865... | ||
2861 | align 16 |
2865 | align 16 |
2862 | ted_key_ctrl_end: |
2866 | ted_key_ctrl_end: |
2863 | push eax ebx |
2867 | push eax ebx |
2864 | call ted_get_num_lines |
2868 | call ted_get_num_lines |
2865 | mov ebx,ted_scr_w |
2869 | mov ebx,ted_scr_w |
2866 | mov dword[ebx+sb_offs_position],eax ;áâ ¢¨¬ ¯®«§ã®ª ¯®á«¥¤îî áâப㠤®ªã¬¥â |
2870 | mov [ebx+sb_offs_position],eax ;áâ ¢¨¬ ¯®«§ã®ª ¯®á«¥¤îî áâப㠤®ªã¬¥â |
2867 | cmp eax,dword[ebx+sb_offs_cur_area] |
2871 | cmp eax,[ebx+sb_offs_cur_area] |
2868 | jle @f |
2872 | jle @f |
2869 | mov eax,dword[ebx+sb_offs_cur_area] ;¯®«ãç ¥¬ ç¨á«® áâப ¢« §ïé¨å ¢ ®ª® |
2873 | mov eax,[ebx+sb_offs_cur_area] ;¯®«ãç ¥¬ ç¨á«® áâப ¢« §ïé¨å ¢ ®ª® |
2870 | @@: |
2874 | @@: |
2871 | sub dword[ebx+sb_offs_position],eax ;®â¨¬ ¥¬ ®â ¯®«§ãª ç¨á«® áâப ¢« §ïé¨å ¢ ®ª® (® ¥ ¡®«ìè¥ â¥å, çâ® ¥áâì ¢ ¤®ªã¬¥â¥) |
2875 | sub [ebx+sb_offs_position],eax ;®â¨¬ ¥¬ ®â ¯®«§ãª ç¨á«® áâப ¢« §ïé¨å ¢ ®ª® (® ¥ ¡®«ìè¥ â¥å, çâ® ¥áâì ¢ ¤®ªã¬¥â¥) |
2872 | dec eax |
2876 | dec eax |
2873 | mov ted_cur_y,eax ;áâ ¢¨¬ ªãàá®à ¯®á«¥¤îî áâப㠤®ªã¬¥â |
2877 | mov ted_cur_y,eax ;áâ ¢¨¬ ªãàá®à ¯®á«¥¤îî áâப㠤®ªã¬¥â |
2874 | pop ebx eax |
2878 | pop ebx eax |
2875 | call ted_cur_move_x_last_char |
2879 | call ted_cur_move_x_last_char |
2876 | stdcall ted_draw,edi |
2880 | stdcall ted_draw,edi |
Line 3078... | Line 3082... | ||
3078 | jge .exit |
3082 | jge .exit |
Line 3079... | Line 3083... | ||
3079 | 3083 | ||
3080 | shl ax,2 ;㬮¦ ¥¬ ¨¤¥ªá 梥â 4 ¡ ©â |
3084 | shl ax,2 ;㬮¦ ¥¬ ¨¤¥ªá 梥â 4 ¡ ©â |
3081 | mov ecx,ted_text_colors ;¯à¨¡ ¢«ï¥¬ ᬥ饨¥ 1-£® 梥â |
3085 | mov ecx,ted_text_colors ;¯à¨¡ ¢«ï¥¬ ᬥ饨¥ 1-£® 梥â |
3082 | add ecx,eax |
3086 | add ecx,eax |
3083 | mov ecx,dword[ecx] ;ãáâ ¢«¨¢ ¥¬ ⥪ã騩 梥â ⥪áâ ¯® ᬥ饨î |
3087 | mov ecx,[ecx] ;ãáâ ¢«¨¢ ¥¬ ⥪ã騩 梥â ⥪áâ ¯® ᬥ饨î |
3084 | .exit: |
3088 | .exit: |
3085 | or ecx,ted_font_size |
3089 | or ecx,ted_font_size |
3086 | pop edx eax |
3090 | pop edx eax |
Line 3139... | Line 3143... | ||
3139 | pushad |
3143 | pushad |
3140 | mov edi,[edit] |
3144 | mov edi,[edit] |
Line 3141... | Line 3145... | ||
3141 | 3145 | ||
3142 | mov eax,SF_DRAW_TEXT |
3146 | mov eax,SF_DRAW_TEXT |
3143 | mov ecx,ted_text_colors |
3147 | mov ecx,ted_text_colors |
Line 3144... | Line 3148... | ||
3144 | mov ecx,dword[ecx] |
3148 | mov ecx,[ecx] |
3145 | 3149 | ||
3146 | mov ebx,ted_wnd_l |
3150 | mov ebx,ted_wnd_l |
3147 | add ebx,ted_rec_l |
3151 | add ebx,ted_rec_l |
Line 3770... | Line 3774... | ||
3770 | sub edx,[esi+sb_offs_position] |
3774 | sub edx,[esi+sb_offs_position] |
3771 | imul edx,ted_rec_w |
3775 | imul edx,ted_rec_w |
3772 | mov bx,dx |
3776 | mov bx,dx |
3773 | jmp .no_wnd |
3777 | jmp .no_wnd |
3774 | .in_wnd: |
3778 | .in_wnd: |
3775 | mov bx,0 |
3779 | xor bx,bx |
3776 | .no_wnd: |
3780 | .no_wnd: |
3777 | mov edx,ted_color_wnd_work |
3781 | mov edx,ted_color_wnd_work |
3778 | int 0x40 |
3782 | int 0x40 |
3779 | pop esi bx |
3783 | pop esi bx |
3780 | @@: |
3784 | @@: |