Rev 6086 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6086 | Rev 6087 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ; ¬ ªà®á ¤«ï á¨á⥬®© ¡¨¡«¨®â¥ª¨ box_lib.obj |
1 | ; ¬ ªà®á ¤«ï á¨á⥬®© ¡¨¡«¨®â¥ª¨ box_lib.obj |
2 | ; í«¥¬¥â TextEditor ¤«ï Kolibri OS |
2 | ; í«¥¬¥â TextEditor ¤«ï Kolibri OS |
3 | ; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 20.01.2016 IgorA |
3 | ; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 21.01.2016 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 104... | Line 104... | ||
104 | KEY_F3 equ 0x0000003D |
104 | KEY_F3 equ 0x0000003D |
Line 105... | Line 105... | ||
105 | 105 | ||
106 | 106 | ||
107 | - | ||
108 | align 4 |
107 | |
Line 109... | Line 108... | ||
109 | proc ted_init, edit:dword |
108 | align 4 |
110 | push eax ecx edi |
109 | proc ted_init uses eax ecx edi, edit:dword |
111 | mov edi,dword[edit] |
110 | mov edi,dword[edit] |
Line 128... | Line 127... | ||
128 | mov ted_arr_key_pos,eax |
127 | mov ted_arr_key_pos,eax |
129 | add eax,1024 |
128 | add eax,1024 |
130 | mov ted_syntax_file,eax |
129 | mov ted_syntax_file,eax |
Line 131... | Line 130... | ||
131 | 130 | ||
132 | stdcall ted_init_scroll_bars,edi,3 |
- | |
133 | pop edi ecx eax |
131 | stdcall ted_init_scroll_bars,edi,3 |
134 | ret |
132 | ret |
Line 135... | Line 133... | ||
135 | endp |
133 | endp |
136 | 134 | ||
Line 208... | Line 206... | ||
208 | popad |
206 | popad |
209 | ret |
207 | ret |
210 | endp |
208 | endp |
Line 211... | Line 209... | ||
211 | 209 | ||
212 | align 4 |
210 | align 4 |
213 | proc ted_delete, edit:dword |
- | |
214 | push edi |
211 | proc ted_delete uses edi, edit:dword |
215 | mov edi,dword[edit] |
212 | mov edi,dword[edit] |
216 | invoke mem.free,ted_tex |
213 | invoke mem.free,ted_tex |
217 | invoke mem.free,ted_arr_key_pos ;ted_syntax_file |
- | |
218 | pop edi |
214 | invoke mem.free,ted_arr_key_pos ;ted_syntax_file |
219 | ret |
215 | ret |
Line 220... | Line 216... | ||
220 | endp |
216 | endp |
Line 527... | Line 523... | ||
527 | endp |
523 | endp |
Line 528... | Line 524... | ||
528 | 524 | ||
529 | ;output: |
525 | ;output: |
530 | ; al = 1 - can save |
526 | ; al = 1 - can save |
531 | align 4 |
527 | align 4 |
532 | proc ted_can_save, edit:dword |
- | |
533 | push ecx edi |
528 | proc ted_can_save uses ecx edi, edit:dword |
Line 534... | Line 529... | ||
534 | mov edi,dword[edit] |
529 | mov edi,dword[edit] |
535 | 530 | ||
536 | mov ecx,ted_tim_ch |
531 | mov ecx,ted_tim_ch |
537 | sub ecx,ted_tim_undo |
532 | sub ecx,ted_tim_undo |
538 | mov al,1 |
533 | mov al,1 |
539 | cmp ted_tim_ls,ecx |
534 | cmp ted_tim_ls,ecx |
540 | jne @f |
535 | jne @f |
541 | dec al |
- | |
542 | @@: |
536 | dec al |
543 | pop edi ecx |
537 | @@: |
Line 544... | Line 538... | ||
544 | ret |
538 | ret |
545 | endp |
539 | endp |
546 | 540 | ||
547 | ;input: |
541 | ;input: |
548 | ; edi = pointer to tedit struct |
542 | ; edi = pointer to tedit struct |
549 | ;output: |
543 | ;output: |
550 | ; al = 1 - selected |
- | |
551 | align 4 |
544 | ; al = 1 - selected |
552 | proc ted_is_select |
545 | align 4 |
553 | push ebx |
546 | proc ted_is_select uses ebx |
554 | xor al,al |
547 | xor al,al |
555 | cmp ted_drag_m,1 |
548 | cmp ted_drag_m,1 |
Line 561... | Line 554... | ||
561 | mov ebx,ted_sel_y0 |
554 | mov ebx,ted_sel_y0 |
562 | cmp ebx,ted_sel_y1 |
555 | cmp ebx,ted_sel_y1 |
563 | jne @f |
556 | jne @f |
564 | xor al,al |
557 | xor al,al |
565 | @@: |
558 | @@: |
566 | pop ebx |
- | |
567 | ret |
559 | ret |
568 | endp |
560 | endp |
Line 569... | Line 561... | ||
569 | 561 | ||
570 | ;input: |
562 | ;input: |
571 | ; edi = pointer to tedit struct |
563 | ; edi = pointer to tedit struct |
572 | align 4 |
564 | align 4 |
573 | proc ted_sel_normalize |
- | |
574 | push ecx esi |
565 | proc ted_sel_normalize uses ecx esi |
575 | push edi |
566 | push edi |
576 | mov esi,edi |
567 | mov esi,edi |
577 | add esi,ted_offs_sel |
568 | add esi,ted_offs_sel |
578 | add edi,ted_offs_seln |
569 | add edi,ted_offs_seln |
Line 604... | Line 595... | ||
604 | mov ecx,ted_seln_x0 |
595 | mov ecx,ted_seln_x0 |
605 | cmp ecx,ted_seln_x1 ;(sel_x0>sel_x1) |
596 | cmp ecx,ted_seln_x1 ;(sel_x0>sel_x1) |
606 | jg .swp_f |
597 | jg .swp_f |
Line 607... | Line 598... | ||
607 | 598 | ||
608 | .end_f: |
- | |
609 | pop esi ecx |
599 | .end_f: |
610 | ret |
600 | ret |
Line 611... | Line 601... | ||
611 | endp |
601 | endp |
612 | 602 | ||
613 | ;input: |
603 | ;input: |
614 | ; edi = pointer to tedit struct |
604 | ; edi = pointer to tedit struct |
615 | ;description: |
605 | ;description: |
616 | ; ãªæ¨ï ¢ë§ë¢ ¥¬ ï ¯à¨ ç «¥ ¢ë¤¥«¥¨ï |
606 | ; ãªæ¨ï ¢ë§ë¢ ¥¬ ï ¯à¨ ç «¥ ¢ë¤¥«¥¨ï |
617 | align 4 |
- | |
618 | proc ted_sel_start |
607 | align 4 |
619 | push eax ecx |
608 | proc ted_sel_start uses eax ecx |
620 | mov eax,ted_scr_h |
609 | mov eax,ted_scr_h |
621 | mov ecx,ted_cur_x |
610 | mov ecx,ted_cur_x |
622 | add ecx,dword[eax+sb_offs_position] |
611 | add ecx,dword[eax+sb_offs_position] |
Line 626... | Line 615... | ||
626 | mov eax,ted_scr_w |
615 | mov eax,ted_scr_w |
627 | mov ecx,ted_cur_y |
616 | mov ecx,ted_cur_y |
628 | add ecx,dword[eax+sb_offs_position] |
617 | add ecx,dword[eax+sb_offs_position] |
629 | mov ted_sel_y0,ecx |
618 | mov ted_sel_y0,ecx |
630 | mov ted_sel_y1,ecx |
619 | mov ted_sel_y1,ecx |
631 | pop ecx eax |
- | |
632 | ret |
620 | ret |
633 | endp |
621 | endp |
Line 634... | Line 622... | ||
634 | 622 | ||
635 | ;input: |
623 | ;input: |
Line 680... | Line 668... | ||
680 | endp |
668 | endp |
Line 681... | Line 669... | ||
681 | 669 | ||
682 | ;input: |
670 | ;input: |
683 | ; cl_al_mem = 1 - clear all memory |
671 | ; cl_al_mem = 1 - clear all memory |
684 | align 4 |
672 | align 4 |
685 | proc ted_clear, edit:dword, cl_al_mem:dword |
- | |
686 | push ecx edi |
673 | proc ted_clear uses ecx edi, edit:dword, cl_al_mem:dword |
Line 687... | Line 674... | ||
687 | mov edi,dword[edit] |
674 | mov edi,dword[edit] |
688 | 675 | ||
689 | mov ted_cur_x,0 |
676 | mov ted_cur_x,0 |
Line 725... | Line 712... | ||
725 | mov edx,ted_tex |
712 | mov edx,ted_tex |
726 | mov dword [edx+6],1 |
713 | mov dword [edx+6],1 |
727 | pop edx |
714 | pop edx |
Line 728... | Line 715... | ||
728 | 715 | ||
729 | .exit: |
- | |
730 | pop edi ecx |
716 | .exit: |
731 | ret |
717 | ret |
Line 732... | Line 718... | ||
732 | endp |
718 | endp |
Line 1443... | Line 1429... | ||
1443 | ;output: |
1429 | ;output: |
1444 | ; al = 1 if delete |
1430 | ; al = 1 if delete |
1445 | ;description: |
1431 | ;description: |
1446 | ; ãªæ¨ï 㤠«ï¥â ¢ë¤¥«¥ë© ⥪áâ |
1432 | ; ãªæ¨ï 㤠«ï¥â ¢ë¤¥«¥ë© ⥪áâ |
1447 | align 4 |
1433 | align 4 |
1448 | proc ted_sel_text_del, del_opt:dword |
1434 | proc ted_sel_text_del uses ebx ecx edx esi, del_opt:dword |
1449 | push ebx ecx edx esi |
- | |
1450 | - | ||
1451 | call ted_is_select |
1435 | call ted_is_select |
1452 | cmp al,0 |
1436 | cmp al,0 |
1453 | je .end_f |
1437 | je .end_f |
Line 1454... | Line 1438... | ||
1454 | 1438 | ||
Line 1492... | Line 1476... | ||
1492 | mov ted_sel_y0,0 |
1476 | mov ted_sel_y0,0 |
1493 | mov ted_sel_x1,0 |
1477 | mov ted_sel_x1,0 |
1494 | mov ted_sel_y1,0 |
1478 | mov ted_sel_y1,0 |
1495 | @@: |
1479 | @@: |
1496 | .end_f: |
1480 | .end_f: |
1497 | pop esi edx ecx ebx |
- | |
1498 | ret |
1481 | ret |
1499 | endp |
1482 | endp |
Line 1500... | Line 1483... | ||
1500 | 1483 | ||
Line 2453... | Line 2436... | ||
2453 | 2436 | ||
2454 | ;output: |
2437 | ;output: |
2455 | ; eax = ª®¤ ®è¨¡ª¨ |
2438 | ; eax = ª®¤ ®è¨¡ª¨ |
2456 | ; ebx = ª®««¨ç¥á⢮ ¯à®ç¨â ëå ¡ ©â |
2439 | ; ebx = ª®««¨ç¥á⢮ ¯à®ç¨â ëå ¡ ©â |
2457 | align 4 |
2440 | align 4 |
2458 | proc ted_open_file, edit:dword, file:dword, f_name:dword ;äãªæ¨ï ®âªàëâ¨ï ä ©« |
- | |
2459 | push ecx edx edi |
2441 | proc ted_open_file uses ecx edx edi, edit:dword, file:dword, f_name:dword ;äãªæ¨ï ®âªàëâ¨ï ä ©« |
Line 2460... | Line 2442... | ||
2460 | mov edi,dword[edit] |
2442 | mov edi,dword[edit] |
2461 | 2443 | ||
2462 | ; *** ¯à®¢¥à塞 à §¬¥à ¯ ¬ï⨠¨ ¥á«¨ ¥ å¢ â ¥â ⮠㢥«¨ç¨¢ ¥¬ *** |
2444 | ; *** ¯à®¢¥à塞 à §¬¥à ¯ ¬ï⨠¨ ¥á«¨ ¥ å¢ â ¥â ⮠㢥«¨ç¨¢ ¥¬ *** |
Line 2525... | Line 2507... | ||
2525 | cmp ebx,-1 |
2507 | cmp ebx,-1 |
2526 | je .ret_f |
2508 | je .ret_f |
2527 | ;if open file |
2509 | ;if open file |
2528 | call ted_on_open_file |
2510 | call ted_on_open_file |
2529 | .ret_f: |
2511 | .ret_f: |
2530 | pop edi edx ecx |
- | |
2531 | ret |
2512 | ret |
2532 | endp |
2513 | endp |
Line 2533... | Line 2514... | ||
2533 | 2514 | ||
2534 | align 4 |
2515 | align 4 |
Line 2562... | Line 2543... | ||
2562 | popad |
2543 | popad |
2563 | ret |
2544 | ret |
2564 | endp |
2545 | endp |
Line 2565... | Line 2546... | ||
2565 | 2546 | ||
2566 | align 4 |
2547 | align 4 |
2567 | proc ted_but_cut, edit:dword |
- | |
2568 | push edi |
2548 | proc ted_but_cut uses edi, edit:dword |
Line 2569... | Line 2549... | ||
2569 | mov edi,dword[edit] |
2549 | mov edi,dword[edit] |
2570 | 2550 | ||
2571 | stdcall ted_but_copy,edi |
2551 | stdcall ted_but_copy,edi |
Line 2577... | Line 2557... | ||
2577 | stdcall ted_draw,edi |
2557 | stdcall ted_draw,edi |
2578 | cmp ted_fun_draw_panel_buttons,0 |
2558 | cmp ted_fun_draw_panel_buttons,0 |
2579 | je @f |
2559 | je @f |
2580 | call ted_fun_draw_panel_buttons |
2560 | call ted_fun_draw_panel_buttons |
2581 | @@: |
2561 | @@: |
2582 | pop edi |
- | |
2583 | ret |
2562 | ret |
2584 | endp |
2563 | endp |
Line 2585... | Line 2564... | ||
2585 | 2564 | ||
2586 | ;output: |
2565 | ;output: |
Line 2752... | Line 2731... | ||
2752 | @@: |
2731 | @@: |
2753 | ret |
2732 | ret |
2754 | endp |
2733 | endp |
Line 2755... | Line 2734... | ||
2755 | 2734 | ||
2756 | align 4 |
2735 | align 4 |
2757 | proc ted_but_reverse, edit:dword |
- | |
2758 | push eax ebx edi |
2736 | proc ted_but_reverse uses eax ebx edi, edit:dword |
Line 2759... | Line 2737... | ||
2759 | mov edi,dword[edit] |
2737 | mov edi,dword[edit] |
2760 | 2738 | ||
2761 | call ted_is_select |
2739 | call ted_is_select |
Line 2780... | Line 2758... | ||
2780 | ;cmp eax,... |
2758 | ;cmp eax,... |
2781 | ;je @f |
2759 | ;je @f |
2782 | call ted_revers |
2760 | call ted_revers |
2783 | @@: |
2761 | @@: |
2784 | stdcall ted_draw,edi |
2762 | stdcall ted_draw,edi |
2785 | pop edi ebx eax |
- | |
2786 | ret |
2763 | ret |
2787 | endp |
2764 | endp |
Line 2788... | Line 2765... | ||
2788 | 2765 | ||
2789 | align 4 |
2766 | align 4 |
2790 | proc ted_but_undo, edit:dword |
- | |
2791 | push eax edi |
2767 | proc ted_but_undo uses eax edi, edit:dword |
Line 2792... | Line 2768... | ||
2792 | mov edi,dword[edit] |
2768 | mov edi,dword[edit] |
2793 | 2769 | ||
2794 | mov eax,ted_tim_undo |
2770 | mov eax,ted_tim_undo |
Line 2799... | Line 2775... | ||
2799 | stdcall ted_draw,edi |
2775 | stdcall ted_draw,edi |
2800 | cmp ted_fun_draw_panel_buttons,0 |
2776 | cmp ted_fun_draw_panel_buttons,0 |
2801 | je @f |
2777 | je @f |
2802 | call ted_fun_draw_panel_buttons |
2778 | call ted_fun_draw_panel_buttons |
2803 | @@: |
2779 | @@: |
2804 | pop edi eax |
- | |
2805 | ret |
2780 | ret |
2806 | endp |
2781 | endp |
Line 2807... | Line 2782... | ||
2807 | 2782 | ||
2808 | align 4 |
2783 | align 4 |
2809 | proc ted_but_redo, edit:dword |
- | |
2810 | push edi |
2784 | proc ted_but_redo uses edi, edit:dword |
Line 2811... | Line 2785... | ||
2811 | mov edi,dword[edit] |
2785 | mov edi,dword[edit] |
2812 | 2786 | ||
2813 | cmp ted_tim_undo,1 |
2787 | cmp ted_tim_undo,1 |
Line 2817... | Line 2791... | ||
2817 | stdcall ted_draw,edi |
2791 | stdcall ted_draw,edi |
2818 | cmp ted_fun_draw_panel_buttons,0 |
2792 | cmp ted_fun_draw_panel_buttons,0 |
2819 | je @f |
2793 | je @f |
2820 | call ted_fun_draw_panel_buttons |
2794 | call ted_fun_draw_panel_buttons |
2821 | @@: |
2795 | @@: |
2822 | pop edi |
- | |
2823 | ret |
2796 | ret |
2824 | endp |
2797 | endp |
Line 2825... | Line 2798... | ||
2825 | 2798 | ||
2826 | align 4 |
2799 | align 4 |
Line 3271... | Line 3244... | ||
3271 | mov ecx,ted_wnd_t |
3244 | mov ecx,ted_wnd_t |
3272 | add ecx,ted_wnd_h |
3245 | add ecx,ted_wnd_h |
3273 | shl ecx,16 |
3246 | shl ecx,16 |
3274 | mov cx,word[eax+sb_offs_size_y] |
3247 | mov cx,word[eax+sb_offs_size_y] |
3275 | inc cx |
3248 | inc cx |
3276 | mov edx,ted_color_wnd_capt ;[sc.work] |
3249 | mcall 13,,,ted_color_wnd_capt ;[sc.work] |
3277 | mov eax,13 |
- | |
3278 | int 0x40 |
- | |
Line 3279... | Line 3250... | ||
3279 | 3250 | ||
3280 | ;right-bottom square |
3251 | ;right-bottom square |
3281 | mov ebx,ted_wnd_l |
3252 | mov ebx,ted_wnd_l |
3282 | add ebx,ted_wnd_w |
3253 | add ebx,ted_wnd_w |
Line 3477... | Line 3448... | ||
3477 | align 4 |
3448 | align 4 |
3478 | proc ted_draw_help_f1 |
3449 | proc ted_draw_help_f1 |
3479 | pushad |
3450 | pushad |
3480 | cmp ted_rec_t,13 ;¬¨¨¬ «ì ï ¢ëá®â ¤«ï à¨á®¢ ¨ï á¯à ¢ª¨ |
3451 | cmp ted_rec_t,13 ;¬¨¨¬ «ì ï ¢ëá®â ¤«ï à¨á®¢ ¨ï á¯à ¢ª¨ |
3481 | jle @f |
3452 | jle @f |
3482 | mov eax,13 ;clear place before draw help |
3453 | ;clear place before draw help |
3483 | mov ebx,ted_wnd_l |
3454 | mov ebx,ted_wnd_l |
3484 | add ebx,ted_rec_l |
3455 | add ebx,ted_rec_l |
3485 | shl ebx,16 |
3456 | shl ebx,16 |
3486 | add ebx,ted_wnd_w |
3457 | add ebx,ted_wnd_w |
3487 | sub ebx,ted_rec_l |
3458 | sub ebx,ted_rec_l |
3488 | mov ecx,ted_wnd_t |
3459 | mov ecx,ted_wnd_t |
3489 | add ecx,13 |
3460 | add ecx,13 |
3490 | shl ecx,16 |
3461 | shl ecx,16 |
3491 | add ecx,ted_rec_h |
3462 | add ecx,ted_rec_h |
3492 | mov edx,ted_color_wnd_capt |
3463 | mcall 13,,,ted_color_wnd_capt |
3493 | int 0x40 |
- | |
Line 3494... | Line 3464... | ||
3494 | 3464 | ||
3495 | cmp ted_help_id,-1 |
3465 | cmp ted_help_id,-1 |
3496 | je @f |
3466 | je @f |
3497 | mov eax,ted_help_id |
3467 | mov eax,ted_help_id |
Line 3511... | Line 3481... | ||
3511 | mov ecx,ted_text_colors |
3481 | mov ecx,ted_text_colors |
3512 | add ecx,eax |
3482 | add ecx,eax |
3513 | mov ecx,dword[ecx] |
3483 | mov ecx,dword[ecx] |
3514 | or ecx,0xc0000000 ;SetTextStyles |
3484 | or ecx,0xc0000000 ;SetTextStyles |
3515 | mov esi,edi |
3485 | mov esi,edi |
3516 | mov edi,ted_color_wnd_work |
3486 | mcall 4,,,,,ted_color_wnd_work |
3517 | mov eax,4 |
- | |
3518 | int 0x40 |
- | |
3519 | mov edi,esi |
3487 | mov edi,esi |
Line -... | Line 3488... | ||
- | 3488 | ||
- | 3489 | mov esi,edx |
|
- | 3490 | call tl_strlen |
|
3520 | 3491 | ||
3521 | ;*** draw help string *** |
3492 | ;*** draw help string *** |
3522 | mov ecx,ted_color_wnd_bord |
3493 | mov ecx,ted_color_wnd_bord |
3523 | or ecx,0x80000000 |
3494 | or ecx,0x80000000 |
3524 | mov edx,dword[edx+MAX_COLOR_WORD_LEN] |
3495 | mov edx,dword[edx+MAX_COLOR_WORD_LEN] |
3525 | cmp edx,0 |
3496 | cmp edx,0 |
3526 | je @f |
3497 | je @f |
- | 3498 | add edx,ted_help_text_f1 |
|
- | 3499 | inc eax |
|
- | 3500 | imul eax,6 ;è¨à¨ ᨬ¢®« ¢ á¨áâ. èà¨ä⥠|
|
3527 | add edx,ted_help_text_f1 |
3501 | shl eax,16 |
3528 | add ebx,0x500000 |
3502 | add ebx,eax |
3529 | int 0x40 |
3503 | mcall 4 |
3530 | @@: |
3504 | @@: |
3531 | popad |
3505 | popad |
3532 | ret |
3506 | ret |