Rev 1458 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1458 | Rev 1459 | ||
---|---|---|---|
1 | ; ¬ ªà®á ¤«ï á¨á⥬®© ¡¨¡«¨®â¥ª¨ box_lib.obj |
1 | ; ¬ ªà®á ¤«ï á¨á⥬®© ¡¨¡«¨®â¥ª¨ box_lib.obj |
2 | ; í«¥¬¥â TextEditor ¤«ï Kolibri OS |
2 | ; í«¥¬¥â TextEditor ¤«ï Kolibri OS |
3 | ; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 03.05.2010 IgorA |
3 | ; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 05.05.2010 IgorA |
4 | ; ª®¤ ¯à¨¬¥¥ GPL2 «¨æ¥§¨ï |
4 | ; ª®¤ ¯à¨¬¥¥ GPL2 «¨æ¥§¨ï |
5 | 5 | ||
6 | ;input: |
6 | ;input: |
7 | ; edi = pointer to tedit struct |
7 | ; edi = pointer to tedit struct |
8 | ; reg = index |
8 | ; reg = index |
9 | ;output: |
9 | ;output: |
10 | ; reg = pointer to 'tex' struct |
10 | ; reg = pointer to 'tex' struct |
11 | macro ConvertIndexToPointer reg { |
11 | macro ConvertIndexToPointer reg { |
12 | imul reg,sizeof.symbol |
12 | imul reg,sizeof.symbol |
13 | add reg,ted_tex |
13 | add reg,ted_tex |
14 | } |
14 | } |
15 | 15 | ||
16 | ;--- out_reg = ted_key_words_data[ind_reg].Text[0] --- |
16 | ;--- out_reg = ted_key_words_data[ind_reg].Text[0] --- |
17 | macro ColToIndexOffset ind_reg,out_reg { |
17 | macro ColToIndexOffset ind_reg,out_reg { |
18 | mov out_reg,ind_reg |
18 | mov out_reg,ind_reg |
19 | imul out_reg,sizeof.TexColViv |
19 | imul out_reg,sizeof.TexColViv |
20 | add out_reg,ted_key_words_data |
20 | add out_reg,ted_key_words_data |
21 | } |
21 | } |
22 | 22 | ||
23 | macro use_text_edit |
23 | macro use_text_edit |
24 | { |
24 | { |
25 | TED_PANEL_NULL equ 0 ;¥â ®âªàë⮩ ¯ ¥«¨ |
25 | TED_PANEL_NULL equ 0 ;¥â ®âªàë⮩ ¯ ¥«¨ |
26 | TED_PANEL_FIND equ 1 ;¯ ¥«ì ¯®¨áª |
26 | TED_PANEL_FIND equ 1 ;¯ ¥«ì ¯®¨áª |
27 | TED_PANEL_SYNTAX equ 2 ;¯ ¥«ì ¢ë¡®à ä ©«®¢ ¯®¤á¢¥âª¨ |
27 | TED_PANEL_SYNTAX equ 2 ;¯ ¥«ì ¢ë¡®à ä ©«®¢ ¯®¤á¢¥âª¨ |
28 | TED_PANEL_WIDTH equ 150 ;è¨à¨ ¯ ¥«¨ |
28 | TED_PANEL_WIDTH equ 150 ;è¨à¨ ¯ ¥«¨ |
29 | 29 | ||
30 | MAX_COLOR_WORD_LEN equ 40 |
30 | MAX_COLOR_WORD_LEN equ 40 |
31 | ;------------------------------------------------------------------------------ |
31 | ;------------------------------------------------------------------------------ |
32 | struct TexSelect |
32 | struct TexSelect |
33 | x0 dd ? |
33 | x0 dd ? |
34 | y0 dd ? |
34 | y0 dd ? |
35 | x1 dd ? |
35 | x1 dd ? |
36 | y1 dd ? |
36 | y1 dd ? |
37 | ends |
37 | ends |
38 | 38 | ||
39 | struct TexColViv |
39 | struct TexColViv |
40 | Text rb MAX_COLOR_WORD_LEN ; á«®¢® ¤«ï ¯®¤á¢¥âª¨ |
40 | Text rb MAX_COLOR_WORD_LEN ; á«®¢® ¤«ï ¯®¤á¢¥âª¨ |
41 | f1 dd 0 ; á¯à ¢ª ¯® á«®¢ã |
41 | f1 dd 0 ; á¯à ¢ª ¯® á«®¢ã |
42 | wwo db ? ; whole words only |
42 | wwo db ? ; whole words only |
43 | endc db ? ; ᨬ¢®« ª®æ ¢ë¤¥«¥¨ï (wwo&4) |
43 | endc db ? ; ᨬ¢®« ª®æ ¢ë¤¥«¥¨ï (wwo&4) |
44 | color db ? ; ®¬¥à 梥â |
44 | color db ? ; ®¬¥à 梥â |
45 | ends |
45 | ends |
46 | 46 | ||
47 | struct symbol |
47 | struct symbol |
48 | c db ? ; +0 ᨬ¢®« |
48 | c db ? ; +0 ᨬ¢®« |
49 | col db ? ; +1 梥â |
49 | col db ? ; +1 梥â |
50 | perv dd ? ; +2 |
50 | perv dd ? ; +2 |
51 | next dd ? ; +6 㪠§ ⥫¨ |
51 | next dd ? ; +6 㪠§ ⥫¨ |
52 | tc dd ? ; +10 ¢à¥¬. ᮧ¤ ¨ï |
52 | tc dd ? ; +10 ¢à¥¬. ᮧ¤ ¨ï |
53 | td dd ? ; +14 ¢à¥¬. 㤠«¥¨ï |
53 | td dd ? ; +14 ¢à¥¬. 㤠«¥¨ï |
54 | ends |
54 | ends |
55 | ;------------------------------------------------------------------------------ |
55 | ;------------------------------------------------------------------------------ |
56 | 56 | ||
57 | ted_symbol_tab db 26 |
57 | ted_symbol_tab db 26 |
58 | 58 | ||
59 | if lang eq ru |
59 | if lang eq ru |
60 | 60 | ||
61 | txtFindCapt db '®¨áª',0 |
61 | txtFindCapt db '®¨áª',0 |
62 | txtFindNext db ' ©â¨ ¤ «¥¥',0 |
62 | txtFindNext db ' ©â¨ ¤ «¥¥',0 |
63 | txtFormatCapt db '®à¬ â',0 |
63 | txtFormatCapt db '®à¬ â',0 |
64 | txtFormatApply db 'ਬ¥¨âì',0 |
64 | txtFormatApply db 'ਬ¥¨âì',0 |
65 | txtRow db 'âப ',0 |
65 | txtRow db 'âப ',0 |
66 | txtCol db ' ª',0 |
66 | txtCol db ' ª',0 |
67 | txtOtm db '⬥ë',0 |
67 | txtOtm db '⬥ë',0 |
68 | txtBuf db 'ãä¥à:',0 |
68 | txtBuf db 'ãä¥à:',0 |
69 | 69 | ||
70 | else |
70 | else |
71 | 71 | ||
72 | txtFindCapt db 'Search',0 |
72 | txtFindCapt db 'Search',0 |
73 | txtFindNext db 'Find next',0 |
73 | txtFindNext db 'Find next',0 |
74 | txtFormatCapt db 'Format',0 |
74 | txtFormatCapt db 'Format',0 |
75 | txtFormatApply db 'Apply',0 |
75 | txtFormatApply db 'Apply',0 |
76 | txtRow db 'Rows',0 |
76 | txtRow db 'Rows',0 |
77 | txtCol db 'Cols',0 |
77 | txtCol db 'Cols',0 |
78 | txtOtm db 'Undo',0 |
78 | txtOtm db 'Undo',0 |
79 | txtBuf db 'Buffer:',0 |
79 | txtBuf db 'Buffer:',0 |
80 | 80 | ||
81 | end if |
81 | end if |
82 | 82 | ||
83 | ;------ |
83 | ;------ |
84 | align 4 |
84 | align 4 |
85 | EvChar db 0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0 |
85 | EvChar db 0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0 |
86 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
86 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
87 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
87 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
88 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
88 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
89 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
89 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
90 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
90 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
91 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
91 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
92 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 |
92 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 |
93 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
93 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
94 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
94 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
95 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
95 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
96 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
96 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
97 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
97 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
98 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
98 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
99 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
99 | db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
100 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
100 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
101 | 101 | ||
102 | EvUpper db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
102 | EvUpper db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
103 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
103 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
104 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
104 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
105 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
105 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
106 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
106 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
107 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
107 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
108 | db 0,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79 |
108 | db 0,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79 |
109 | db 80,81,82,83,84,85,86,87,88,89,90,0,0,0,0,0 |
109 | db 80,81,82,83,84,85,86,87,88,89,90,0,0,0,0,0 |
110 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
110 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
111 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
111 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
112 | db 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 |
112 | db 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 |
113 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
113 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
114 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
114 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
115 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
115 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
116 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
116 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
117 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
117 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
118 | EvLover db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
118 | EvLover db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
119 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
119 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
120 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
120 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
121 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
121 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
122 | db 0,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111 |
122 | db 0,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111 |
123 | db 112,113,114,115,116,117,118,119,120,121,122,0,0,0,0,0 |
123 | db 112,113,114,115,116,117,118,119,120,121,122,0,0,0,0,0 |
124 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
124 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
125 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
125 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
126 | db 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175 |
126 | db 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175 |
127 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
127 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
128 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
128 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
129 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
129 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
130 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
130 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
131 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
131 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
132 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
132 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
133 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
133 | db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
134 | conv_table dd 0 |
134 | conv_table dd 0 |
135 | 135 | ||
136 | 136 | ||
137 | KM_SHIFT equ 0x00010000 |
137 | KM_SHIFT equ 0x00010000 |
138 | KM_CTRL equ 0x00020000 |
138 | KM_CTRL equ 0x00020000 |
139 | KM_ALT equ 0x00040000 |
139 | KM_ALT equ 0x00040000 |
140 | KM_NUMLOCK equ 0x00080000 |
140 | KM_NUMLOCK equ 0x00080000 |
141 | 141 | ||
142 | ; KEY CODES |
142 | ; KEY CODES |
143 | KEY_F1 equ 0x0000003B |
143 | KEY_F1 equ 0x0000003B |
144 | KEY_F2 equ 0x0000003C |
144 | KEY_F2 equ 0x0000003C |
145 | KEY_F3 equ 0x0000003D |
145 | KEY_F3 equ 0x0000003D |
146 | 146 | ||
147 | 147 | ||
148 | 148 | ||
149 | align 4 |
149 | align 4 |
150 | proc ted_init, edit:dword |
150 | proc ted_init, edit:dword |
151 | push eax ecx edi |
151 | push eax ecx edi |
152 | mov edi,dword[edit] |
152 | mov edi,dword[edit] |
153 | 153 | ||
154 | mov ecx,sizeof.symbol |
154 | mov ecx,sizeof.symbol |
155 | imul ecx,ted_max_chars |
155 | imul ecx,ted_max_chars |
156 | call mem_Alloc ;¢ë¤¥«ï¥¬ ¯ ¬ïâì |
156 | call mem_Alloc ;¢ë¤¥«ï¥¬ ¯ ¬ïâì |
157 | mov ted_tex,eax |
157 | mov ted_tex,eax |
158 | mov ted_tex_1,eax |
158 | mov ted_tex_1,eax |
159 | add ted_tex_1,sizeof.symbol |
159 | add ted_tex_1,sizeof.symbol |
160 | add eax,ecx |
160 | add eax,ecx |
161 | mov ted_tex_end,eax |
161 | mov ted_tex_end,eax |
162 | 162 | ||
163 | stdcall ted_clear, edi,1 |
163 | stdcall ted_clear, edi,1 |
164 | 164 | ||
165 | ;------------------------------------------------- |
165 | ;------------------------------------------------- |
166 | mov ecx,1024 ;1024 - ¤«ï ¬ áᨢ ted_arr_key_pos |
166 | mov ecx,1024 ;1024 - ¤«ï ¬ áᨢ ted_arr_key_pos |
167 | add ecx,ted_syntax_file_size |
167 | add ecx,ted_syntax_file_size |
168 | call mem_Alloc |
168 | call mem_Alloc |
169 | mov ted_arr_key_pos,eax |
169 | mov ted_arr_key_pos,eax |
170 | add eax,1024 |
170 | add eax,1024 |
171 | mov ted_syntax_file,eax |
171 | mov ted_syntax_file,eax |
172 | 172 | ||
173 | stdcall ted_init_scroll_bars,edi,3 |
173 | stdcall ted_init_scroll_bars,edi,3 |
174 | pop edi ecx eax |
174 | pop edi ecx eax |
175 | ret |
175 | ret |
176 | endp |
176 | endp |
177 | 177 | ||
178 | MIN_W_SCRL_ARE equ 3 ;¬¨¨¬ «ì ï ®â®¡à ¦ ¥¬ ï ®¡« áâì ¤«ï ¢¥àâ. áªà®««¨£ |
178 | MIN_W_SCRL_ARE equ 3 ;¬¨¨¬ «ì ï ®â®¡à ¦ ¥¬ ï ®¡« áâì ¤«ï ¢¥àâ. áªà®««¨£ |
179 | MIN_H_SCRL_ARE equ 3 ;¬¨¨¬ «ì ï ®â®¡à ¦ ¥¬ ï ®¡« áâì ¤«ï £®à¨§. áªà®««¨£ |
179 | MIN_H_SCRL_ARE equ 3 ;¬¨¨¬ «ì ï ®â®¡à ¦ ¥¬ ï ®¡« áâì ¤«ï £®à¨§. áªà®««¨£ |
180 | ;input: |
180 | ;input: |
181 | ; opt = 1 - ¬¥ïâì 梥â áªà®««¨£®¢, 2 - ¬¥ïâì ¢¥è¨¥ à §¬¥àë |
181 | ; opt = 1 - ¬¥ïâì 梥â áªà®««¨£®¢, 2 - ¨§¬¥¨«¨áì à §¬¥àë ®ª , |
- | 182 | ; 4 - ¨§¬¥¨«¨áì à §¬¥àë ¤®ªã¬¥â |
|
182 | align 4 |
183 | align 4 |
183 | proc ted_init_scroll_bars, edit:dword, opt:dword |
184 | proc ted_init_scroll_bars, edit:dword, opt:dword |
184 | pushad |
185 | pushad |
- | 186 | mov edi,dword[edit] |
|
185 | mov esi,ted_scr_w |
187 | mov esi,ted_scr_w |
186 | mov ebx,ted_scr_h |
188 | mov ebx,ted_scr_h |
187 | bt dword[opt],0 |
189 | bt dword[opt],0 |
188 | jae @f |
190 | jae @f |
189 | mov ecx,ted_color_wnd_work |
191 | mov ecx,ted_color_wnd_work |
190 | mov dword[esi+sb_offs_bckg_col],ecx |
192 | mov dword[esi+sb_offs_bckg_col],ecx |
191 | mov dword[ebx+sb_offs_bckg_col],ecx |
193 | mov dword[ebx+sb_offs_bckg_col],ecx |
192 | mov ecx,ted_color_wnd_capt |
194 | mov ecx,ted_color_wnd_capt |
193 | mov dword[esi+sb_offs_frnt_col],ecx |
195 | mov dword[esi+sb_offs_frnt_col],ecx |
194 | mov dword[ebx+sb_offs_frnt_col],ecx |
196 | mov dword[ebx+sb_offs_frnt_col],ecx |
195 | mov ecx,ted_color_wnd_bord |
197 | mov ecx,ted_color_wnd_bord |
196 | mov dword[esi+sb_offs_line_col],ecx |
198 | mov dword[esi+sb_offs_line_col],ecx |
197 | mov dword[ebx+sb_offs_line_col],ecx |
199 | mov dword[ebx+sb_offs_line_col],ecx |
198 | @@: |
200 | @@: |
- | 201 | bt dword[opt],2 ; ¨§¬¥¨«¨áì à §¬¥àë ¤®ªã¬¥â ? |
|
199 | bt dword[opt],1 |
202 | jae .doc_resize |
- | 203 | call ted_get_num_lines |
|
- | 204 | cmp eax,100 |
|
- | 205 | jge @f |
|
- | 206 | mov eax,100 |
|
- | 207 | @@: |
|
- | 208 | mov dword[esi+sb_offs_max_area],eax |
|
- | 209 | .doc_resize: |
|
- | 210 | bt dword[opt],1 ; ¨§¬¥¨«¨áì à §¬¥àë ®ª ? |
|
200 | jae .no_size |
211 | jae .no_size |
201 | mov edx,ted_wnd_l |
212 | mov edx,ted_wnd_l |
202 | add edx,ted_rec_l |
213 | add edx,ted_rec_l |
203 | mov word[ebx+sb_offs_start_x],dx ;¢ëáâ ¢«ï¥¬ «¥¢ë© ®âáâ㯠£®à¨§. áªà®««¨£ |
214 | mov word[ebx+sb_offs_start_x],dx ;¢ëáâ ¢«ï¥¬ «¥¢ë© ®âáâ㯠£®à¨§. áªà®««¨£ |
204 | mov eax,ted_wnd_h ;calculate lines in page |
215 | mov eax,ted_wnd_h ;calculate lines in page |
205 | mov edx,ted_wnd_t |
216 | mov edx,ted_wnd_t |
206 | add edx,eax |
217 | add edx,eax |
207 | mov word[ebx+sb_offs_start_y],dx ;¢ëáâ ¢«ï¥¬ ¢¥à娩 ®âáâ㯠£®à¨§. áªà®««¨£ |
218 | mov word[ebx+sb_offs_start_y],dx ;¢ëáâ ¢«ï¥¬ ¢¥à娩 ®âáâ㯠£®à¨§. áªà®««¨£ |
208 | sub eax,ted_rec_t |
219 | sub eax,ted_rec_t |
209 | xor edx,edx |
220 | xor edx,edx |
210 | mov ecx,ted_rec_h |
221 | mov ecx,ted_rec_h |
211 | div ecx |
222 | div ecx |
212 | cmp eax,MIN_W_SCRL_ARE |
223 | cmp eax,MIN_W_SCRL_ARE |
213 | jg @f |
224 | jg @f |
214 | mov eax,MIN_W_SCRL_ARE |
225 | mov eax,MIN_W_SCRL_ARE |
215 | @@: |
226 | @@: |
216 | mov dword[esi+sb_offs_cur_area],eax |
227 | mov dword[esi+sb_offs_cur_area],eax |
217 | 228 | ||
218 | mov eax,ted_wnd_w ;calculate cols in page |
229 | mov eax,ted_wnd_w ;calculate cols in page |
219 | mov edx,ted_wnd_l ;«¥¢ë© ®âáâ㯠®ª |
230 | mov edx,ted_wnd_l ;«¥¢ë© ®âáâ㯠®ª |
220 | add edx,eax ;¤®¡ ¢«ï¥¬ è¨à¨ã ®ª |
231 | add edx,eax ;¤®¡ ¢«ï¥¬ è¨à¨ã ®ª |
221 | mov word[esi+sb_offs_start_x],dx ;¢ëáâ ¢«ï¥¬ «¥¢ë© ®âáâ㯠¢¥àâ. áªà®««¨£ |
232 | mov word[esi+sb_offs_start_x],dx ;¢ëáâ ¢«ï¥¬ «¥¢ë© ®âáâ㯠¢¥àâ. áªà®««¨£ |
222 | mov edx,ted_wnd_t |
233 | mov edx,ted_wnd_t |
223 | mov word[esi+sb_offs_start_y],dx ;¢ëáâ ¢«ï¥¬ ¢¥à娩 ®âáâ㯠¢¥àâ. áªà®««¨£ |
234 | mov word[esi+sb_offs_start_y],dx ;¢ëáâ ¢«ï¥¬ ¢¥à娩 ®âáâ㯠¢¥àâ. áªà®««¨£ |
224 | mov edx,ted_wnd_h |
235 | mov edx,ted_wnd_h |
225 | mov word[esi+sb_offs_size_y],dx ;¢ëáâ ¢«ï¥¬ ¢ëá®âã ¢¥àâ. áªà®««¨£ |
236 | mov word[esi+sb_offs_size_y],dx ;¢ëáâ ¢«ï¥¬ ¢ëá®âã ¢¥àâ. áªà®««¨£ |
226 | sub eax,ted_rec_l |
237 | sub eax,ted_rec_l |
227 | mov word[ebx+sb_offs_size_x],ax ;¢ëáâ ¢«ï¥¬ è¨à¨ã £®à¨§. áªà®««¨£ |
238 | mov word[ebx+sb_offs_size_x],ax ;¢ëáâ ¢«ï¥¬ è¨à¨ã £®à¨§. áªà®««¨£ |
228 | xor edx,edx |
239 | xor edx,edx |
229 | mov ecx,ted_rec_w |
240 | mov ecx,ted_rec_w |
230 | div ecx |
241 | div ecx |
231 | cmp eax,MIN_H_SCRL_ARE |
242 | cmp eax,MIN_H_SCRL_ARE |
232 | jg @f |
243 | jg @f |
233 | mov eax,MIN_H_SCRL_ARE |
244 | mov eax,MIN_H_SCRL_ARE |
234 | @@: |
245 | @@: |
235 | dec eax |
246 | dec eax |
236 | mov dword[ebx+sb_offs_cur_area],eax ;ãáâ ¢«¨¢ ¥¬ ç¨á«® ᨬ¢®«®¢, ª®â®àë¥ ¢« §ïâ ¢ íªà ¤«ï £®à¨§. áªà®««¨£ |
247 | mov dword[ebx+sb_offs_cur_area],eax ;ãáâ ¢«¨¢ ¥¬ ç¨á«® ᨬ¢®«®¢, ª®â®àë¥ ¢« §ïâ ¢ íªà ¤«ï £®à¨§. áªà®««¨£ |
237 | .no_size: |
248 | .no_size: |
238 | popad |
249 | popad |
239 | ret |
250 | ret |
240 | endp |
251 | endp |
241 | 252 | ||
242 | align 4 |
253 | align 4 |
243 | proc ted_delete, edit:dword |
254 | proc ted_delete, edit:dword |
244 | push ecx edi |
255 | push ecx edi |
245 | mov edi,dword[edit] |
256 | mov edi,dword[edit] |
246 | 257 | ||
247 | mov ecx,ted_tex |
258 | mov ecx,ted_tex |
248 | call mem_Free |
259 | call mem_Free |
249 | mov ecx,ted_arr_key_pos ;ted_syntax_file |
260 | mov ecx,ted_arr_key_pos ;ted_syntax_file |
250 | call mem_Free |
261 | call mem_Free |
251 | 262 | ||
252 | pop edi ecx |
263 | pop edi ecx |
253 | ret |
264 | ret |
254 | endp |
265 | endp |
255 | 266 | ||
256 | 267 | ||
257 | ;input: |
268 | ;input: |
258 | ; eax = key kodes |
269 | ; eax = key kodes |
259 | align 4 |
270 | align 4 |
260 | proc ted_key, edit:dword, table:dword, control:dword |
271 | proc ted_key, edit:dword, table:dword, control:dword |
261 | pushad |
272 | pushad |
262 | mov edi,dword[edit] |
273 | mov edi,dword[edit] |
263 | mov esi,ted_el_focus |
274 | mov esi,ted_el_focus |
264 | cmp dword[esi],edi |
275 | cmp dword[esi],edi |
265 | jne .end_key_fun ;í«¥¬¥â ¥ ¢ 䮪ãᥠ¢ë室¨¬ ¨§ äãªæ¨¨ |
276 | jne .end_key_fun ;í«¥¬¥â ¥ ¢ 䮪ãᥠ¢ë室¨¬ ¨§ äãªæ¨¨ |
266 | mov esi,dword[control] |
277 | mov esi,dword[control] |
267 | 278 | ||
268 | cmp ah,KEY_F1 ;[F1] |
279 | cmp ah,KEY_F1 ;[F1] |
269 | jne @f |
280 | jne @f |
270 | stdcall ted_show_help_f1,edi |
281 | stdcall ted_show_help_f1,edi |
271 | jmp .end_key_fun |
282 | jmp .end_key_fun |
272 | @@: |
283 | @@: |
273 | cmp ah,KEY_F3 ;[F3] |
284 | cmp ah,KEY_F3 ;[F3] |
274 | jne @f |
285 | jne @f |
275 | stdcall ted_but_find_next,edi |
286 | stdcall ted_but_find_next,edi |
276 | jmp .end_key_fun |
287 | jmp .end_key_fun |
277 | @@: |
288 | @@: |
278 | 289 | ||
279 | test esi,KM_CTRL ;Ctrl+... |
290 | test esi,KM_CTRL ;Ctrl+... |
280 | jz .key_Ctrl |
291 | jz .key_Ctrl |
281 | cmp ah,24 ;Ctrl+O |
292 | cmp ah,24 ;Ctrl+O |
282 | jne @f |
293 | jne @f |
283 | cmp ted_fun_on_key_ctrl_o,0 |
294 | cmp ted_fun_on_key_ctrl_o,0 |
284 | je @f |
295 | je @f |
285 | call ted_fun_on_key_ctrl_o |
296 | call ted_fun_on_key_ctrl_o |
286 | @@: |
297 | @@: |
287 | cmp ah,31 ;Ctrl+S |
298 | cmp ah,31 ;Ctrl+S |
288 | jne @f |
299 | jne @f |
289 | cmp ted_fun_on_key_ctrl_s,0 |
300 | cmp ted_fun_on_key_ctrl_s,0 |
290 | je @f |
301 | je @f |
291 | call ted_fun_on_key_ctrl_s |
302 | call ted_fun_on_key_ctrl_s |
292 | @@: |
303 | @@: |
293 | cmp ah,33 ;Ctrl+F |
304 | cmp ah,33 ;Ctrl+F |
294 | jne @f |
305 | jne @f |
295 | cmp ted_panel_id,TED_PANEL_FIND |
306 | cmp ted_panel_id,TED_PANEL_FIND |
296 | je @f |
307 | je @f |
297 | cmp ted_fun_on_key_ctrl_f,0 |
308 | cmp ted_fun_on_key_ctrl_f,0 |
298 | je @f |
309 | je @f |
299 | call ted_fun_on_key_ctrl_f |
310 | call ted_fun_on_key_ctrl_f |
300 | @@: |
311 | @@: |
301 | cmp ah,44 ;Ctrl+Z |
312 | cmp ah,44 ;Ctrl+Z |
302 | jne @f |
313 | jne @f |
303 | stdcall ted_but_undo,edi |
314 | stdcall ted_but_undo,edi |
304 | @@: |
315 | @@: |
305 | cmp ah,46 ;Ctrl+C |
316 | cmp ah,46 ;Ctrl+C |
306 | jne @f |
317 | jne @f |
307 | stdcall ted_but_copy,edi |
318 | stdcall ted_but_copy,edi |
308 | @@: |
319 | @@: |
309 | cmp ah,47 ;Ctrl+V |
320 | cmp ah,47 ;Ctrl+V |
310 | jne @f |
321 | jne @f |
311 | stdcall ted_but_paste,edi |
322 | stdcall ted_but_paste,edi |
312 | @@: |
323 | @@: |
313 | cmp ah,49 ;Ctrl+N |
324 | cmp ah,49 ;Ctrl+N |
314 | jne @f |
325 | jne @f |
315 | cmp ted_fun_on_key_ctrl_n,0 |
326 | cmp ted_fun_on_key_ctrl_n,0 |
316 | je @f |
327 | je @f |
317 | call ted_fun_on_key_ctrl_n |
328 | call ted_fun_on_key_ctrl_n |
318 | @@: |
329 | @@: |
319 | cmp ah,199 ;Ctrl+Home |
330 | cmp ah,199 ;Ctrl+Home |
320 | jne @f |
331 | jne @f |
321 | call ted_key_ctrl_home |
332 | call ted_key_ctrl_home |
322 | @@: |
333 | @@: |
323 | jmp .end_key_fun |
334 | jmp .end_key_fun |
324 | .key_Ctrl: |
335 | .key_Ctrl: |
325 | 336 | ||
326 | test esi,KM_SHIFT ;Shift+... |
337 | test esi,KM_SHIFT ;Shift+... |
327 | jz .key_Shift |
338 | jz .key_Shift |
328 | cmp ah,72 ;Shift+Up |
339 | cmp ah,72 ;Shift+Up |
329 | jne @f |
340 | jne @f |
330 | call ted_sel_key_up |
341 | call ted_sel_key_up |
331 | @@: |
342 | @@: |
332 | cmp ah,75 ;Shift+Left |
343 | cmp ah,75 ;Shift+Left |
333 | jne @f |
344 | jne @f |
334 | call ted_sel_key_left |
345 | call ted_sel_key_left |
335 | @@: |
346 | @@: |
336 | cmp ah,77 ;Shift+Right |
347 | cmp ah,77 ;Shift+Right |
337 | jne @f |
348 | jne @f |
338 | call ted_sel_key_right |
349 | call ted_sel_key_right |
339 | @@: |
350 | @@: |
340 | cmp ah,80 ;Shift+Down |
351 | cmp ah,80 ;Shift+Down |
341 | jne @f |
352 | jne @f |
342 | call ted_sel_key_down |
353 | call ted_sel_key_down |
343 | @@: |
354 | @@: |
344 | ;mov ted_drag_k,1 ; ç¨ ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
355 | ;mov ted_drag_k,1 ; ç¨ ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
345 | jmp .key_MoveCur |
356 | jmp .key_MoveCur |
346 | .key_Shift: |
357 | .key_Shift: |
347 | ;------------------------------------------------- |
358 | ;------------------------------------------------- |
348 | cmp ah,72 ;178 ;Up |
359 | cmp ah,72 ;178 ;Up |
349 | jne @f |
360 | jne @f |
350 | call ted_draw_cursor_sumb |
361 | call ted_draw_cursor_sumb |
351 | call ted_cur_move_up |
362 | call ted_cur_move_up |
352 | cmp dl,8 |
363 | cmp dl,8 |
353 | jne .no_red_0 |
364 | jne .no_red_0 |
354 | call ted_scroll_set_redraw |
365 | call ted_scroll_set_redraw |
355 | stdcall ted_draw,edi |
366 | stdcall ted_draw,edi |
356 | jmp @f |
367 | jmp @f |
357 | .no_red_0: |
368 | .no_red_0: |
358 | call ted_draw_main_cursor |
369 | call ted_draw_main_cursor |
359 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
370 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
360 | @@: |
371 | @@: |
361 | cmp ah,80 ;177 ;Down |
372 | cmp ah,80 ;177 ;Down |
362 | jne @f |
373 | jne @f |
363 | call ted_draw_cursor_sumb |
374 | call ted_draw_cursor_sumb |
364 | call ted_cur_move_down |
375 | call ted_cur_move_down |
365 | cmp dl,8 |
376 | cmp dl,8 |
366 | jne .no_red_1 |
377 | jne .no_red_1 |
367 | call ted_scroll_set_redraw |
378 | call ted_scroll_set_redraw |
368 | stdcall ted_draw,edi |
379 | stdcall ted_draw,edi |
369 | jmp @f |
380 | jmp @f |
370 | .no_red_1: |
381 | .no_red_1: |
371 | call ted_draw_main_cursor |
382 | call ted_draw_main_cursor |
372 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
383 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
373 | @@: |
384 | @@: |
374 | cmp ah,75 ;176 ;Left |
385 | cmp ah,75 ;176 ;Left |
375 | jne @f |
386 | jne @f |
376 | call ted_draw_cursor_sumb |
387 | call ted_draw_cursor_sumb |
377 | call ted_cur_move_left |
388 | call ted_cur_move_left |
378 | cmp dl,8 |
389 | cmp dl,8 |
379 | jne .no_red_2 |
390 | jne .no_red_2 |
380 | call ted_scroll_set_redraw |
391 | call ted_scroll_set_redraw |
381 | stdcall ted_draw,edi |
392 | stdcall ted_draw,edi |
382 | jmp @f |
393 | jmp @f |
383 | .no_red_2: |
394 | .no_red_2: |
384 | call ted_draw_main_cursor |
395 | call ted_draw_main_cursor |
385 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
396 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
386 | @@: |
397 | @@: |
387 | cmp ah,77 ;179 ;Right |
398 | cmp ah,77 ;179 ;Right |
388 | jne @f |
399 | jne @f |
389 | call ted_draw_cursor_sumb |
400 | call ted_draw_cursor_sumb |
390 | call ted_cur_move_right |
401 | call ted_cur_move_right |
391 | cmp dl,8 |
402 | cmp dl,8 |
392 | jne .no_red_3 |
403 | jne .no_red_3 |
393 | call ted_scroll_set_redraw |
404 | call ted_scroll_set_redraw |
394 | stdcall ted_draw,edi |
405 | stdcall ted_draw,edi |
395 | jmp @f |
406 | jmp @f |
396 | .no_red_3: |
407 | .no_red_3: |
397 | call ted_draw_main_cursor |
408 | call ted_draw_main_cursor |
398 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
409 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
399 | @@: |
410 | @@: |
400 | cmp ah,71 ;180 ;Home |
411 | cmp ah,71 ;180 ;Home |
401 | jne @f |
412 | jne @f |
402 | call ted_draw_cursor_sumb |
413 | call ted_draw_cursor_sumb |
403 | call ted_cur_move_x_first_char |
414 | call ted_cur_move_x_first_char |
404 | cmp dl,8 |
415 | cmp dl,8 |
405 | jne .no_red_4 |
416 | jne .no_red_4 |
406 | call ted_scroll_set_redraw |
417 | call ted_scroll_set_redraw |
407 | stdcall ted_draw,edi |
418 | stdcall ted_draw,edi |
408 | jmp @f |
419 | jmp @f |
409 | .no_red_4: |
420 | .no_red_4: |
410 | call ted_draw_main_cursor |
421 | call ted_draw_main_cursor |
411 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
422 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
412 | @@: |
423 | @@: |
413 | cmp ah,79 ;181 ;End |
424 | cmp ah,79 ;181 ;End |
414 | jne @f |
425 | jne @f |
415 | call ted_draw_cursor_sumb |
426 | call ted_draw_cursor_sumb |
416 | call ted_cur_move_x_last_char |
427 | call ted_cur_move_x_last_char |
417 | cmp dl,8 |
428 | cmp dl,8 |
418 | jne .no_red_5 |
429 | jne .no_red_5 |
419 | call ted_scroll_set_redraw |
430 | call ted_scroll_set_redraw |
420 | stdcall ted_draw,edi |
431 | stdcall ted_draw,edi |
421 | jmp @f |
432 | jmp @f |
422 | .no_red_5: |
433 | .no_red_5: |
423 | call ted_draw_main_cursor |
434 | call ted_draw_main_cursor |
424 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
435 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
425 | @@: |
436 | @@: |
426 | cmp ah,73 ;184 ;PageUp |
437 | cmp ah,73 ;184 ;PageUp |
427 | jne @f |
438 | jne @f |
428 | call ted_cur_move_page_up |
439 | call ted_cur_move_page_up |
429 | cmp dl,0 |
440 | cmp dl,0 |
430 | je @f |
441 | je @f |
431 | call ted_scroll_set_redraw |
442 | call ted_scroll_set_redraw |
432 | stdcall ted_draw,edi |
443 | stdcall ted_draw,edi |
433 | @@: |
444 | @@: |
434 | cmp ah,81 ;183 ;PageDown |
445 | cmp ah,81 ;183 ;PageDown |
435 | jne @f |
446 | jne @f |
436 | call ted_cur_move_page_down |
447 | call ted_cur_move_page_down |
437 | cmp dl,0 |
448 | cmp dl,0 |
438 | je @f |
449 | je @f |
439 | call ted_scroll_set_redraw |
450 | call ted_scroll_set_redraw |
440 | stdcall ted_draw,edi |
451 | stdcall ted_draw,edi |
441 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
452 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
442 | @@: |
453 | @@: |
443 | ;------------------------------------------------- |
454 | ;------------------------------------------------- |
444 | ; cmp esi,0 |
455 | ; cmp esi,0 |
445 | ; jne .end_key_fun |
456 | ; jne .end_key_fun |
446 | .key_MoveCur: |
457 | .key_MoveCur: |
447 | 458 | ||
448 | cmp ah,69 ;[Pause Break] |
459 | cmp ah,69 ;[Pause Break] |
449 | je .end_key_fun |
460 | je .end_key_fun |
450 | cmp ah,120 ;[Fn] |
461 | cmp ah,120 ;[Fn] |
451 | je .end_key_fun |
462 | je .end_key_fun |
452 | cmp ah,0x80 ;if key up |
463 | cmp ah,0x80 ;if key up |
453 | ja .end_key_fun |
464 | ja .end_key_fun |
454 | 465 | ||
455 | cmp dword[table],0 |
466 | cmp dword[table],0 |
456 | je @f |
467 | je @f |
457 | stdcall KeyConvertToASCII, dword[table] |
468 | stdcall KeyConvertToASCII, dword[table] |
458 | @@: |
469 | @@: |
459 | 470 | ||
460 | ;mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
471 | ;mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
461 | 472 | ||
462 | lea edx,[EvChar] ;¡¥à¥¬ ¤à¥á â ¡«¨æë á ¤®¯ãá⨬묨 ᨬ¢®« ¬¨ |
473 | lea edx,[EvChar] ;¡¥à¥¬ ¤à¥á â ¡«¨æë á ¤®¯ãá⨬묨 ᨬ¢®« ¬¨ |
463 | add dl,ah |
474 | add dl,ah |
464 | jae @f |
475 | jae @f |
465 | add edx,0x100 ;¥á«¨ ¡ë«® ¯¥à¥¯®«¥¨¥ ¯à¨ ¤®¡ ¢«¥¨¨ ª®¤ ᨬ¢®« |
476 | add edx,0x100 ;¥á«¨ ¡ë«® ¯¥à¥¯®«¥¨¥ ¯à¨ ¤®¡ ¢«¥¨¨ ª®¤ ᨬ¢®« |
466 | @@: |
477 | @@: |
467 | cmp byte [edx],1 |
478 | cmp byte [edx],1 |
468 | jne @f |
479 | jne @f |
469 | mov ted_key_new,ah |
480 | mov ted_key_new,ah |
470 | call ted_set_undo |
481 | call ted_set_undo |
471 | mov edx,ted_opt_ed_change_time+ted_opt_ed_move_cursor |
482 | mov edx,ted_opt_ed_change_time+ted_opt_ed_move_cursor |
472 | stdcall ted_sel_text_del,edx |
483 | stdcall ted_sel_text_del,edx |
473 | cmp al,1 |
484 | cmp al,1 |
474 | jne .del |
485 | jne .del |
475 | mov edx,ted_opt_ed_move_cursor |
486 | mov edx,ted_opt_ed_move_cursor |
476 | .del: |
487 | .del: |
477 | cmp ted_cur_ins,1 |
488 | cmp ted_cur_ins,1 |
478 | je .no_ins_mod |
489 | je .no_ins_mod |
479 | stdcall ted_text_del,edi,ted_opt_ed_change_time |
490 | stdcall ted_text_del,edi,ted_opt_ed_change_time |
480 | mov edx,ted_opt_ed_move_cursor |
491 | mov edx,ted_opt_ed_move_cursor |
481 | .no_ins_mod: |
492 | .no_ins_mod: |
482 | mov ecx,edi |
493 | mov ecx,edi |
483 | add ecx,ted_offs_key_new |
494 | add ecx,ted_offs_key_new |
484 | stdcall ted_text_add,edi,ecx,1,edx ;¤®¡ ¢«ï¥¬ ᨬ¢®« ¢¢¥¤¥ë© á ª« ¢¨ âãàë |
495 | stdcall ted_text_add,edi,ecx,1,edx ;¤®¡ ¢«ï¥¬ ᨬ¢®« ¢¢¥¤¥ë© á ª« ¢¨ âãàë |
485 | cmp ted_key_new,13 |
496 | cmp ted_key_new,13 |
486 | jne .dr_m_win |
497 | jne .dr_m_win |
487 | stdcall ted_draw,edi |
498 | stdcall ted_draw,edi |
488 | jmp .dr_cur_l |
499 | jmp .dr_cur_l |
489 | .dr_m_win: |
500 | .dr_m_win: |
490 | stdcall ted_draw_cur_line,edi |
501 | stdcall ted_draw_cur_line,edi |
491 | .dr_cur_l: |
502 | .dr_cur_l: |
492 | cmp ted_fun_draw_panel_buttons,0 |
503 | cmp ted_fun_draw_panel_buttons,0 |
493 | je @f |
504 | je @f |
494 | call ted_fun_draw_panel_buttons |
505 | call ted_fun_draw_panel_buttons |
495 | @@: |
506 | @@: |
496 | 507 | ||
497 | cmp ah,8 ;[<-] |
508 | cmp ah,8 ;[<-] |
498 | jne @f |
509 | jne @f |
499 | call ted_set_undo |
510 | call ted_set_undo |
500 | stdcall ted_sel_text_del,ted_opt_ed_change_time |
511 | stdcall ted_sel_text_del,ted_opt_ed_change_time |
501 | cmp al,1 |
512 | cmp al,1 |
502 | je .del_one_b |
513 | je .del_one_b |
503 | stdcall ted_text_del,edi,ted_opt_ed_change_time+ted_opt_ed_move_cursor |
514 | stdcall ted_text_del,edi,ted_opt_ed_change_time+ted_opt_ed_move_cursor |
504 | .del_one_b: |
515 | .del_one_b: |
505 | stdcall ted_draw,edi |
516 | stdcall ted_draw,edi |
506 | cmp ted_fun_draw_panel_buttons,0 |
517 | cmp ted_fun_draw_panel_buttons,0 |
507 | je .end_key_fun |
518 | je .end_key_fun |
508 | call ted_fun_draw_panel_buttons |
519 | call ted_fun_draw_panel_buttons |
509 | jmp .end_key_fun |
520 | jmp .end_key_fun |
510 | @@: |
521 | @@: |
511 | 522 | ||
512 | cmp ah,182 ;Delete |
523 | cmp ah,182 ;Delete |
513 | jne @f |
524 | jne @f |
514 | call ted_set_undo |
525 | call ted_set_undo |
515 | stdcall ted_sel_text_del,ted_opt_ed_change_time |
526 | stdcall ted_sel_text_del,ted_opt_ed_change_time |
516 | cmp al,1 |
527 | cmp al,1 |
517 | je .del_one_d |
528 | je .del_one_d |
518 | stdcall ted_text_del,edi,ted_opt_ed_change_time |
529 | stdcall ted_text_del,edi,ted_opt_ed_change_time |
519 | .del_one_d: |
530 | .del_one_d: |
520 | stdcall ted_draw,edi |
531 | stdcall ted_draw,edi |
521 | cmp ted_fun_draw_panel_buttons,0 |
532 | cmp ted_fun_draw_panel_buttons,0 |
522 | je .end_key_fun |
533 | je .end_key_fun |
523 | call ted_fun_draw_panel_buttons |
534 | call ted_fun_draw_panel_buttons |
524 | jmp .end_key_fun |
535 | jmp .end_key_fun |
525 | @@: |
536 | @@: |
526 | 537 | ||
527 | cmp ah,185 ;Ins |
538 | cmp ah,185 ;Ins |
528 | jne @f |
539 | jne @f |
529 | call ted_draw_cursor_sumb |
540 | call ted_draw_cursor_sumb |
530 | xor ted_cur_ins,1 |
541 | xor ted_cur_ins,1 |
531 | call ted_draw_main_cursor |
542 | call ted_draw_main_cursor |
532 | @@: |
543 | @@: |
533 | 544 | ||
534 | .end_key_fun: |
545 | .end_key_fun: |
535 | popad |
546 | popad |
536 | ret |
547 | ret |
537 | endp |
548 | endp |
538 | 549 | ||
539 | ;output: |
550 | ;output: |
540 | ; al = 1 - can save |
551 | ; al = 1 - can save |
541 | align 4 |
552 | align 4 |
542 | proc ted_can_save, edit:dword |
553 | proc ted_can_save, edit:dword |
543 | push ecx edi |
554 | push ecx edi |
544 | mov edi,dword[edit] |
555 | mov edi,dword[edit] |
545 | 556 | ||
546 | mov ecx,ted_tim_ch |
557 | mov ecx,ted_tim_ch |
547 | sub ecx,ted_tim_undo |
558 | sub ecx,ted_tim_undo |
548 | mov al,1 |
559 | mov al,1 |
549 | cmp ted_tim_ls,ecx |
560 | cmp ted_tim_ls,ecx |
550 | jne @f |
561 | jne @f |
551 | dec al |
562 | dec al |
552 | @@: |
563 | @@: |
553 | pop edi ecx |
564 | pop edi ecx |
554 | ret |
565 | ret |
555 | endp |
566 | endp |
556 | 567 | ||
557 | ;input: |
568 | ;input: |
558 | ; edi = pointer to tedit struct |
569 | ; edi = pointer to tedit struct |
559 | ;output: |
570 | ;output: |
560 | ; al = 1 - selected |
571 | ; al = 1 - selected |
561 | align 4 |
572 | align 4 |
562 | proc ted_is_select |
573 | proc ted_is_select |
563 | push ebx |
574 | push ebx |
564 | xor al,al |
575 | xor al,al |
565 | cmp ted_drag_m,1 |
576 | cmp ted_drag_m,1 |
566 | je @f |
577 | je @f |
567 | mov al,1 |
578 | mov al,1 |
568 | mov ebx,ted_sel_x0 |
579 | mov ebx,ted_sel_x0 |
569 | cmp ebx,ted_sel_x1 |
580 | cmp ebx,ted_sel_x1 |
570 | jne @f |
581 | jne @f |
571 | mov ebx,ted_sel_y0 |
582 | mov ebx,ted_sel_y0 |
572 | cmp ebx,ted_sel_y1 |
583 | cmp ebx,ted_sel_y1 |
573 | jne @f |
584 | jne @f |
574 | xor al,al |
585 | xor al,al |
575 | @@: |
586 | @@: |
576 | pop ebx |
587 | pop ebx |
577 | ret |
588 | ret |
578 | endp |
589 | endp |
579 | 590 | ||
580 | ;input: |
591 | ;input: |
581 | ; edi = pointer to tedit struct |
592 | ; edi = pointer to tedit struct |
582 | align 4 |
593 | align 4 |
583 | proc ted_sel_normalize |
594 | proc ted_sel_normalize |
584 | push ecx esi |
595 | push ecx esi |
585 | push edi |
596 | push edi |
586 | mov esi,edi |
597 | mov esi,edi |
587 | add esi,ted_offs_sel |
598 | add esi,ted_offs_sel |
588 | add edi,ted_offs_seln |
599 | add edi,ted_offs_seln |
589 | mov ecx,sizeof.TexSelect |
600 | mov ecx,sizeof.TexSelect |
590 | rep movsb |
601 | rep movsb |
591 | pop edi |
602 | pop edi |
592 | 603 | ||
593 | jmp @f |
604 | jmp @f |
594 | .swp_f: |
605 | .swp_f: |
595 | mov ecx,ted_seln_x0 |
606 | mov ecx,ted_seln_x0 |
596 | m2m ted_seln_x0,ted_seln_x1 |
607 | m2m ted_seln_x0,ted_seln_x1 |
597 | mov ted_seln_x1,ecx |
608 | mov ted_seln_x1,ecx |
598 | 609 | ||
599 | mov ecx,ted_seln_y0 |
610 | mov ecx,ted_seln_y0 |
600 | cmp ecx,ted_seln_y1 ;(sel_y0>sel_y1) |
611 | cmp ecx,ted_seln_y1 ;(sel_y0>sel_y1) |
601 | jle .end_f |
612 | jle .end_f |
602 | m2m ted_seln_y0,ted_seln_y1 |
613 | m2m ted_seln_y0,ted_seln_y1 |
603 | mov ted_seln_y1,ecx |
614 | mov ted_seln_y1,ecx |
604 | 615 | ||
605 | jmp .end_f |
616 | jmp .end_f |
606 | @@: |
617 | @@: |
607 | 618 | ||
608 | mov ecx,ted_seln_y0 |
619 | mov ecx,ted_seln_y0 |
609 | cmp ecx,ted_seln_y1 ;(sel_y0>sel_y1) |
620 | cmp ecx,ted_seln_y1 ;(sel_y0>sel_y1) |
610 | jg .swp_f |
621 | jg .swp_f |
611 | 622 | ||
612 | cmp ecx,ted_seln_y1 ;(sel_y0==sel_y1) |
623 | cmp ecx,ted_seln_y1 ;(sel_y0==sel_y1) |
613 | jne .end_f |
624 | jne .end_f |
614 | mov ecx,ted_seln_x0 |
625 | mov ecx,ted_seln_x0 |
615 | cmp ecx,ted_seln_x1 ;(sel_x0>sel_x1) |
626 | cmp ecx,ted_seln_x1 ;(sel_x0>sel_x1) |
616 | jg .swp_f |
627 | jg .swp_f |
617 | 628 | ||
618 | .end_f: |
629 | .end_f: |
619 | pop esi ecx |
630 | pop esi ecx |
620 | ret |
631 | ret |
621 | endp |
632 | endp |
622 | 633 | ||
623 | ;input: |
634 | ;input: |
624 | ; edi = pointer to tedit struct |
635 | ; edi = pointer to tedit struct |
625 | ;description: |
636 | ;description: |
626 | ; ãªæ¨ï ¢ë§ë¢ ¥¬ ï ¯à¨ ç «¥ ¢ë¤¥«¥¨ï |
637 | ; ãªæ¨ï ¢ë§ë¢ ¥¬ ï ¯à¨ ç «¥ ¢ë¤¥«¥¨ï |
627 | align 4 |
638 | align 4 |
628 | proc ted_sel_start |
639 | proc ted_sel_start |
629 | push eax ecx |
640 | push eax ecx |
630 | mov eax,ted_scr_h |
641 | mov eax,ted_scr_h |
631 | mov ecx,ted_cur_x |
642 | mov ecx,ted_cur_x |
632 | add ecx,dword[eax+sb_offs_position] |
643 | add ecx,dword[eax+sb_offs_position] |
633 | mov ted_sel_x0,ecx |
644 | mov ted_sel_x0,ecx |
634 | mov ted_sel_x1,ecx |
645 | mov ted_sel_x1,ecx |
635 | 646 | ||
636 | mov eax,ted_scr_w |
647 | mov eax,ted_scr_w |
637 | mov ecx,ted_cur_y |
648 | mov ecx,ted_cur_y |
638 | add ecx,dword[eax+sb_offs_position] |
649 | add ecx,dword[eax+sb_offs_position] |
639 | mov ted_sel_y0,ecx |
650 | mov ted_sel_y0,ecx |
640 | mov ted_sel_y1,ecx |
651 | mov ted_sel_y1,ecx |
641 | pop ecx eax |
652 | pop ecx eax |
642 | ret |
653 | ret |
643 | endp |
654 | endp |
644 | 655 | ||
645 | ;input: |
656 | ;input: |
646 | ; edi = pointer to tedit struct |
657 | ; edi = pointer to tedit struct |
647 | ;description: |
658 | ;description: |
648 | ; ãªæ¨ï ¢ë§ë¢ ¥¬ ï ¯à¨ ¯¥à¥¬¥é¥¨¨ ¢ë¤¥«¥¨ï |
659 | ; ãªæ¨ï ¢ë§ë¢ ¥¬ ï ¯à¨ ¯¥à¥¬¥é¥¨¨ ¢ë¤¥«¥¨ï |
649 | align 4 |
660 | align 4 |
650 | proc ted_sel_move |
661 | proc ted_sel_move |
651 | push eax ecx |
662 | push eax ecx |
652 | mov ecx,ted_cur_x |
663 | mov ecx,ted_cur_x |
653 | mov eax,ted_scr_h |
664 | mov eax,ted_scr_h |
654 | add ecx,dword[eax+sb_offs_position] |
665 | add ecx,dword[eax+sb_offs_position] |
655 | mov ted_sel_x1,ecx |
666 | mov ted_sel_x1,ecx |
656 | 667 | ||
657 | mov eax,ted_scr_w |
668 | mov eax,ted_scr_w |
658 | mov ecx,ted_cur_y |
669 | mov ecx,ted_cur_y |
659 | add ecx,dword[eax+sb_offs_position] |
670 | add ecx,dword[eax+sb_offs_position] |
660 | mov ted_sel_y1,ecx |
671 | mov ted_sel_y1,ecx |
661 | pop ecx eax |
672 | pop ecx eax |
662 | cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy) |
673 | cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy) |
663 | je @f |
674 | je @f |
664 | call ted_fun_draw_panel_buttons |
675 | call ted_fun_draw_panel_buttons |
665 | @@: |
676 | @@: |
666 | ret |
677 | ret |
667 | endp |
678 | endp |
668 | 679 | ||
669 | ;input: |
680 | ;input: |
670 | ; cl_al_mem = 1 - clear all memory |
681 | ; cl_al_mem = 1 - clear all memory |
671 | align 4 |
682 | align 4 |
672 | proc ted_clear, edit:dword, cl_al_mem:dword |
683 | proc ted_clear, edit:dword, cl_al_mem:dword |
673 | push ecx edi |
684 | push ecx edi |
674 | mov edi,dword[edit] |
685 | mov edi,dword[edit] |
675 | 686 | ||
676 | mov ted_cur_x,0 |
687 | mov ted_cur_x,0 |
677 | mov ted_cur_y,0 |
688 | mov ted_cur_y,0 |
678 | mov ted_tim_ch,0 |
689 | mov ted_tim_ch,0 |
679 | mov ted_tim_ls,0 |
690 | mov ted_tim_ls,0 |
680 | mov ted_tim_co,0 |
691 | mov ted_tim_co,0 |
681 | mov ted_tim_undo,0 |
692 | mov ted_tim_undo,0 |
682 | mov ted_help_id,-1 |
693 | mov ted_help_id,-1 |
683 | 694 | ||
684 | mov ecx,ted_scr_w |
695 | mov ecx,ted_scr_w |
685 | mov dword[ecx+sb_offs_position],0 |
696 | mov dword[ecx+sb_offs_position],0 |
686 | mov dword[ecx+sb_offs_max_area],100 ;ç¨á«® áâப ¢¨¤¨¬ëå ¢ ®¢®¬ ¤®ªã¬¥â¥ |
697 | mov dword[ecx+sb_offs_max_area],100 ;ç¨á«® áâப ¢¨¤¨¬ëå ¢ ®¢®¬ ¤®ªã¬¥â¥ |
687 | mov dword[ecx+sb_offs_redraw],1 |
698 | mov dword[ecx+sb_offs_redraw],1 |
688 | mov ecx,ted_scr_h |
699 | mov ecx,ted_scr_h |
689 | mov dword[ecx+sb_offs_position],0 |
700 | mov dword[ecx+sb_offs_position],0 |
690 | mov dword[ecx+sb_offs_max_area],100 ;ç¨á«® ᨬ¢®«®¢ ¢¨¤¨¬ëå ¢ ®¢®¬ ¤®ªã¬¥â¥ |
701 | mov dword[ecx+sb_offs_max_area],100 ;ç¨á«® ᨬ¢®«®¢ ¢¨¤¨¬ëå ¢ ®¢®¬ ¤®ªã¬¥â¥ |
691 | 702 | ||
692 | mov ted_sel_x0,0 |
703 | mov ted_sel_x0,0 |
693 | mov ted_sel_y0,0 |
704 | mov ted_sel_y0,0 |
694 | mov ted_sel_x1,0 |
705 | mov ted_sel_x1,0 |
695 | mov ted_sel_y1,0 |
706 | mov ted_sel_y1,0 |
696 | 707 | ||
697 | cmp dword[cl_al_mem],0 |
708 | cmp dword[cl_al_mem],0 |
698 | je .exit |
709 | je .exit |
699 | 710 | ||
700 | push edx |
711 | push edx |
701 | mov ecx,sizeof.symbol |
712 | mov ecx,sizeof.symbol |
702 | imul ecx,ted_max_chars |
713 | imul ecx,ted_max_chars |
703 | mov edx,ted_tex |
714 | mov edx,ted_tex |
704 | @@: |
715 | @@: |
705 | mov byte [edx],0 |
716 | mov byte [edx],0 |
706 | inc edx |
717 | inc edx |
707 | loop @b |
718 | loop @b |
708 | mov edx,ted_tex |
719 | mov edx,ted_tex |
709 | mov dword [edx+6],1 |
720 | mov dword [edx+6],1 |
710 | pop edx |
721 | pop edx |
711 | 722 | ||
712 | .exit: |
723 | .exit: |
713 | pop edi ecx |
724 | pop edi ecx |
714 | ret |
725 | ret |
715 | endp |
726 | endp |
716 | 727 | ||
717 | 728 | ||
718 | align 4 |
729 | align 4 |
719 | proc ted_init_syntax_file, edit:dword, file:dword, f_name:dword |
730 | proc ted_init_syntax_file, edit:dword, file:dword, f_name:dword |
720 | pushad |
731 | pushad |
721 | mov edi,dword[edit] |
732 | mov edi,dword[edit] |
722 | 733 | ||
723 | mov eax,70 |
734 | mov eax,70 |
724 | mov ebx,dword[file] |
735 | mov ebx,dword[file] |
725 | mov dword[ebx], 0 |
736 | mov dword[ebx], 0 |
726 | mov dword[ebx+4], 0 |
737 | mov dword[ebx+4], 0 |
727 | mov dword[ebx+8], 0 |
738 | mov dword[ebx+8], 0 |
728 | mov ecx,ted_syntax_file_size |
739 | mov ecx,ted_syntax_file_size |
729 | mov dword[ebx+12], ecx |
740 | mov dword[ebx+12], ecx |
730 | m2m dword[ebx+16], ted_syntax_file |
741 | m2m dword[ebx+16], ted_syntax_file |
731 | mov byte[ebx+20], 0 |
742 | mov byte[ebx+20], 0 |
732 | m2m dword[ebx+21], dword[f_name] |
743 | m2m dword[ebx+21], dword[f_name] |
733 | int 0x40 |
744 | int 0x40 |
734 | 745 | ||
735 | mov ecx,0x100 |
746 | mov ecx,0x100 |
736 | mov edx,ted_arr_key_pos |
747 | mov edx,ted_arr_key_pos |
737 | @@: |
748 | @@: |
738 | mov dword[edx],-1 |
749 | mov dword[edx],-1 |
739 | add edx,4 |
750 | add edx,4 |
740 | loop @b |
751 | loop @b |
741 | 752 | ||
742 | ;init: ted_colors_text_count, ted_key_words_count, ... |
753 | ;init: ted_colors_text_count, ted_key_words_count, ... |
743 | mov ted_colors_text_count,1 |
754 | mov ted_colors_text_count,1 |
744 | mov ted_key_words_count,0 |
755 | mov ted_key_words_count,0 |
745 | mov ted_help_text_f1,0 |
756 | mov ted_help_text_f1,0 |
746 | mov ted_help_id,-1 ;¨¤¥â¨ä¨ª â®à á«®¢ ¤«ï á¯à ¢ª¨ |
757 | mov ted_help_id,-1 ;¨¤¥â¨ä¨ª â®à á«®¢ ¤«ï á¯à ¢ª¨ |
747 | 758 | ||
748 | cmp eax,6 |
759 | cmp eax,6 |
749 | je @f |
760 | je @f |
750 | cmp eax,0 |
761 | cmp eax,0 |
751 | je @f |
762 | je @f |
752 | cmp ax,10 |
763 | cmp ax,10 |
753 | jl .zifra_0_9 |
764 | jl .zifra_0_9 |
754 | mov al,'?' |
765 | mov al,'?' |
755 | sub ax,48 |
766 | sub ax,48 |
756 | .zifra_0_9: |
767 | .zifra_0_9: |
757 | add ax,48 |
768 | add ax,48 |
758 | cmp ted_fun_init_synt_err,0 |
769 | cmp ted_fun_init_synt_err,0 |
759 | je .no_colors |
770 | je .no_colors |
760 | call ted_fun_init_synt_err |
771 | call ted_fun_init_synt_err |
761 | jmp .no_colors |
772 | jmp .no_colors |
762 | @@: |
773 | @@: |
763 | 774 | ||
764 | mov eax,edi ;á®åà 塞 § 票¥ edi |
775 | mov eax,edi ;á®åà 塞 § 票¥ edi |
765 | mov esi,ted_syntax_file |
776 | mov esi,ted_syntax_file |
766 | add edi,ted_offs_count_colors |
777 | add edi,ted_offs_count_colors |
767 | mov ecx,9*4 |
778 | mov ecx,9*4 |
768 | rep movsb |
779 | rep movsb |
769 | mov edi,eax ;¢®áâ ¢«¨¢ ¥¬ § 票¥ edi |
780 | mov edi,eax ;¢®áâ ¢«¨¢ ¥¬ § 票¥ edi |
770 | 781 | ||
771 | mov eax,ted_syntax_file |
782 | mov eax,ted_syntax_file |
772 | add eax,32 |
783 | add eax,32 |
773 | mov ted_text_colors,eax |
784 | mov ted_text_colors,eax |
774 | 785 | ||
775 | mov eax,ted_colors_text_count ;init: count_colors_text (offset to key words) |
786 | mov eax,ted_colors_text_count ;init: count_colors_text (offset to key words) |
776 | add eax,8 |
787 | add eax,8 |
777 | shl eax,2 |
788 | shl eax,2 |
778 | add eax,ted_syntax_file |
789 | add eax,ted_syntax_file |
779 | mov ted_key_words_data,eax |
790 | mov ted_key_words_data,eax |
780 | 791 | ||
781 | mov ecx,ted_key_words_count ;init: ted_arr_key_pos (first key positions) |
792 | mov ecx,ted_key_words_count ;init: ted_arr_key_pos (first key positions) |
782 | xor eax,eax |
793 | xor eax,eax |
783 | @@: |
794 | @@: |
784 | ColToIndexOffset eax,edx |
795 | ColToIndexOffset eax,edx |
785 | xor ebx,ebx |
796 | xor ebx,ebx |
786 | mov bl,byte[edx] |
797 | mov bl,byte[edx] |
787 | shl bx,2 |
798 | shl bx,2 |
788 | mov esi,ted_arr_key_pos |
799 | mov esi,ted_arr_key_pos |
789 | add esi,ebx |
800 | add esi,ebx |
790 | cmp dword[esi],-1 |
801 | cmp dword[esi],-1 |
791 | jne .no_ch_key |
802 | jne .no_ch_key |
792 | mov dword[esi],eax |
803 | mov dword[esi],eax |
793 | .no_ch_key: |
804 | .no_ch_key: |
794 | inc eax |
805 | inc eax |
795 | loop @b |
806 | loop @b |
796 | 807 | ||
797 | ;init: ted_help_text_f1 |
808 | ;init: ted_help_text_f1 |
798 | mov ecx,ted_key_words_count |
809 | mov ecx,ted_key_words_count |
799 | imul ecx,sizeof.TexColViv |
810 | imul ecx,sizeof.TexColViv |
800 | add ecx,ted_key_words_data |
811 | add ecx,ted_key_words_data |
801 | mov ted_help_text_f1,ecx |
812 | mov ted_help_text_f1,ecx |
802 | 813 | ||
803 | stdcall ted_init_scroll_bars,edi,1 ;¬¥ï¥¬ 梥â áªà®««¨£®¢ |
814 | stdcall ted_init_scroll_bars,edi,1 ;¬¥ï¥¬ 梥â áªà®««¨£®¢ |
804 | .no_colors: |
815 | .no_colors: |
805 | popad |
816 | popad |
806 | ret |
817 | ret |
807 | endp |
818 | endp |
808 | 819 | ||
809 | ;input: |
820 | ;input: |
810 | ; ebx = file size |
821 | ; ebx = file size |
811 | ; edi = pointer to tedit struct |
822 | ; edi = pointer to tedit struct |
812 | ;description: |
823 | ;description: |
813 | ; ãªæ¨ï ¢ë§ë¢ ¥âáï ¯à¨ ®âªàë⨨ ä ©« |
824 | ; ãªæ¨ï ¢ë§ë¢ ¥âáï ¯à¨ ®âªàë⨨ ä ©« |
814 | align 4 |
825 | align 4 |
815 | proc ted_on_open_file |
826 | proc ted_on_open_file |
816 | push eax ;destination |
827 | push eax ;destination |
817 | push ecx ;for cycle |
828 | push ecx ;for cycle |
818 | push edx ;source |
829 | push edx ;source |
819 | push esi |
830 | push esi |
820 | 831 | ||
821 | stdcall ted_clear,edi,0 ;ç¨á⨬ ¥ ¢áî ¯ ¬ïâì, ¯®â®¬ã çâ® ¨¦¥ ¡ã¤¥¬ ¥¥ § ¯®«ïâì ®¢ë¬¨ ¤ 묨 |
832 | stdcall ted_clear,edi,0 ;ç¨á⨬ ¥ ¢áî ¯ ¬ïâì, ¯®â®¬ã çâ® ¨¦¥ ¡ã¤¥¬ ¥¥ § ¯®«ïâì ®¢ë¬¨ ¤ 묨 |
822 | mov eax,ebx |
833 | mov eax,ebx |
823 | mov ecx,ebx |
834 | mov ecx,ebx |
824 | add eax,2 |
835 | add eax,2 |
825 | ConvertIndexToPointer eax |
836 | ConvertIndexToPointer eax |
826 | mov edx,ted_tex |
837 | mov edx,ted_tex |
827 | add edx,ebx |
838 | add edx,ebx |
828 | push ebx |
839 | push ebx |
829 | @@: |
840 | @@: |
830 | mov ebx,[edx] |
841 | mov ebx,[edx] |
831 | mov byte [eax],bl |
842 | mov byte [eax],bl |
832 | mov dword [eax+2],ecx |
843 | mov dword [eax+2],ecx |
833 | inc dword [eax+2] |
844 | inc dword [eax+2] |
834 | mov dword [eax+6],ecx |
845 | mov dword [eax+6],ecx |
835 | add dword [eax+6],3 |
846 | add dword [eax+6],3 |
836 | ;mov byte[eax+1],0 ;col=0 |
847 | ;mov byte[eax+1],0 ;col=0 |
837 | mov dword [eax+10],-1 ;tc=-1 |
848 | mov dword [eax+10],-1 ;tc=-1 |
838 | mov dword [eax+14],0 ;td=0 |
849 | mov dword [eax+14],0 ;td=0 |
839 | 850 | ||
840 | cmp ecx,0 |
851 | cmp ecx,0 |
841 | je @f |
852 | je @f |
842 | dec ecx |
853 | dec ecx |
843 | dec edx |
854 | dec edx |
844 | sub eax,sizeof.symbol |
855 | sub eax,sizeof.symbol |
845 | jmp @b |
856 | jmp @b |
846 | @@: |
857 | @@: |
847 | pop ebx |
858 | pop ebx |
848 | add eax,2 |
859 | add eax,2 |
849 | mov dword [eax],0 ; first sumbol 'perv=0' |
860 | mov dword [eax],0 ; first sumbol 'perv=0' |
850 | 861 | ||
851 | mov edx,ted_tex |
862 | mov edx,ted_tex |
852 | ; begining sumbol 'perv=0' 'next=2' |
863 | ; begining sumbol 'perv=0' 'next=2' |
853 | mov dword [edx+2],0 |
864 | mov dword [edx+2],0 |
854 | mov dword [edx+6],2 |
865 | mov dword [edx+6],2 |
855 | 866 | ||
856 | add edx,sizeof.symbol |
867 | add edx,sizeof.symbol |
857 | mov dword [edx+6],0 ; last sumbol 'next=0' |
868 | mov dword [edx+6],0 ; last sumbol 'next=0' |
858 | mov dword [edx+2],ebx ; last sumbol 'perv=last' |
869 | mov dword [edx+2],ebx ; last sumbol 'perv=last' |
859 | inc dword [edx+2] |
870 | inc dword [edx+2] |
860 | 871 | ||
861 | mov edx,ebx |
872 | mov edx,ebx |
862 | inc edx ;2 = rezerv sumbols |
873 | inc edx ;2 = rezerv sumbols |
863 | imul edx,sizeof.symbol |
874 | imul edx,sizeof.symbol |
864 | add edx,ted_tex |
875 | add edx,ted_tex |
865 | mov dword [edx+6],1 ; last sumbol 'next=1' |
876 | mov dword [edx+6],1 ; last sumbol 'next=1' |
866 | 877 | ||
867 | @@: ;clear memory, need if before was open big file |
878 | @@: ;clear memory, need if before was open big file |
868 | add edx,sizeof.symbol |
879 | add edx,sizeof.symbol |
869 | cmp edx,ted_tex_end |
880 | cmp edx,ted_tex_end |
870 | jge @f |
881 | jge @f |
871 | mov dword[edx+10],0 |
882 | mov dword[edx+10],0 |
872 | mov dword[edx+14],0 |
883 | mov dword[edx+14],0 |
873 | jmp @b |
884 | jmp @b |
874 | @@: |
885 | @@: |
875 | 886 | ||
876 | call ted_get_num_lines |
887 | call ted_get_num_lines |
877 | cmp eax,100 |
888 | cmp eax,100 |
878 | jge @f |
889 | jge @f |
879 | mov eax,100 |
890 | mov eax,100 |
880 | @@: |
891 | @@: |
881 | mov esi,ted_scr_w |
892 | mov esi,ted_scr_w |
882 | mov dword[esi+sb_offs_max_area],eax |
893 | mov dword[esi+sb_offs_max_area],eax |
883 | pop esi edx ecx eax |
894 | pop esi edx ecx eax |
884 | 895 | ||
885 | call ted_text_colored |
896 | call ted_text_colored |
886 | stdcall ted_draw,edi |
897 | stdcall ted_draw,edi |
887 | cmp ted_fun_draw_panel_buttons,0 |
898 | cmp ted_fun_draw_panel_buttons,0 |
888 | je @f |
899 | je @f |
889 | call ted_fun_draw_panel_buttons |
900 | call ted_fun_draw_panel_buttons |
890 | @@: |
901 | @@: |
891 | ret |
902 | ret |
892 | endp |
903 | endp |
893 | 904 | ||
894 | ;input: |
905 | ;input: |
895 | ; edx = pointer to symbol struct |
906 | ; edx = pointer to symbol struct |
896 | ; edi = pointer to tedit struct |
907 | ; edi = pointer to tedit struct |
897 | ;output: |
908 | ;output: |
898 | ; edx = pointer to 'perv' visible symbol struct |
909 | ; edx = pointer to 'perv' visible symbol struct |
899 | align 4 |
910 | align 4 |
900 | ted_iterat_perv: |
911 | ted_iterat_perv: |
901 | cmp ted_tim_undo,0 |
912 | cmp ted_tim_undo,0 |
902 | je .else |
913 | je .else |
903 | push ebx |
914 | push ebx |
904 | @@: |
915 | @@: |
905 | call ted_get_text_perv_pos |
916 | call ted_get_text_perv_pos |
906 | cmp edx,ted_tex |
917 | cmp edx,ted_tex |
907 | je @f |
918 | je @f |
908 | call ted_symbol_not_vis |
919 | call ted_symbol_not_vis |
909 | cmp bl,1 |
920 | cmp bl,1 |
910 | je @b |
921 | je @b |
911 | cmp byte[edx],10 ;¯à®¯ã᪠ᨬ¢®« á ª®¤®¬ 10 |
922 | cmp byte[edx],10 ;¯à®¯ã᪠ᨬ¢®« á ª®¤®¬ 10 |
912 | je @b |
923 | je @b |
913 | @@: |
924 | @@: |
914 | pop ebx |
925 | pop ebx |
915 | ret |
926 | ret |
916 | .else: |
927 | .else: |
917 | call ted_get_text_perv_pos |
928 | call ted_get_text_perv_pos |
918 | cmp edx,ted_tex |
929 | cmp edx,ted_tex |
919 | je .endif |
930 | je .endif |
920 | cmp dword [edx+14],0 |
931 | cmp dword [edx+14],0 |
921 | jne .else |
932 | jne .else |
922 | cmp byte[edx],10 ;¯à®¯ã᪠ᨬ¢®« á ª®¤®¬ 10 |
933 | cmp byte[edx],10 ;¯à®¯ã᪠ᨬ¢®« á ª®¤®¬ 10 |
923 | je .else |
934 | je .else |
924 | .endif: |
935 | .endif: |
925 | ret |
936 | ret |
926 | 937 | ||
927 | 938 | ||
928 | ;input: |
939 | ;input: |
929 | ; edx = pointer to symbol struct |
940 | ; edx = pointer to symbol struct |
930 | ; edi = pointer to tedit struct |
941 | ; edi = pointer to tedit struct |
931 | ;output: |
942 | ;output: |
932 | ; edx = pointer to 'next' visible symbol struct |
943 | ; edx = pointer to 'next' visible symbol struct |
933 | align 4 |
944 | align 4 |
934 | ted_iterat_next: |
945 | ted_iterat_next: |
935 | cmp ted_tim_undo,0 |
946 | cmp ted_tim_undo,0 |
936 | je .else |
947 | je .else |
937 | push ebx |
948 | push ebx |
938 | @@: |
949 | @@: |
939 | call ted_get_text_next_pos |
950 | call ted_get_text_next_pos |
940 | cmp edx,ted_tex_1 |
951 | cmp edx,ted_tex_1 |
941 | jle @f |
952 | jle @f |
942 | call ted_symbol_not_vis |
953 | call ted_symbol_not_vis |
943 | cmp bl,1 |
954 | cmp bl,1 |
944 | je @b |
955 | je @b |
945 | cmp byte[edx],10 ;¯à®¯ã᪠ᨬ¢®« á ª®¤®¬ 10 |
956 | cmp byte[edx],10 ;¯à®¯ã᪠ᨬ¢®« á ª®¤®¬ 10 |
946 | je @b |
957 | je @b |
947 | @@: |
958 | @@: |
948 | pop ebx |
959 | pop ebx |
949 | ret |
960 | ret |
950 | .else: |
961 | .else: |
951 | call ted_get_text_next_pos |
962 | call ted_get_text_next_pos |
952 | cmp edx,ted_tex_1 |
963 | cmp edx,ted_tex_1 |
953 | jle .endif |
964 | jle .endif |
954 | cmp dword [edx+14],0 |
965 | cmp dword [edx+14],0 |
955 | jne .else |
966 | jne .else |
956 | cmp byte[edx],10 ;¯à®¯ã᪠ᨬ¢®« á ª®¤®¬ 10 |
967 | cmp byte[edx],10 ;¯à®¯ã᪠ᨬ¢®« á ª®¤®¬ 10 |
957 | je .else |
968 | je .else |
958 | .endif: |
969 | .endif: |
959 | ret |
970 | ret |
960 | 971 | ||
961 | ;input: |
972 | ;input: |
962 | ; bl = symbol end of select |
973 | ; bl = symbol end of select |
963 | ; edx = pointer to symbol struct |
974 | ; edx = pointer to symbol struct |
964 | ; edi = pointer to tedit struct |
975 | ; edi = pointer to tedit struct |
965 | ;description: |
976 | ;description: |
966 | ; ©â¨ á«¥¤ãîéãî ¯®§¨æ¨î 㪠§ ®£® ᨬ¢®« |
977 | ; ©â¨ á«¥¤ãîéãî ¯®§¨æ¨î 㪠§ ®£® ᨬ¢®« |
967 | align 4 |
978 | align 4 |
968 | ted_iterat_next_pos_char: |
979 | ted_iterat_next_pos_char: |
969 | @@: |
980 | @@: |
970 | cmp bl,byte[edx] |
981 | cmp bl,byte[edx] |
971 | je @f |
982 | je @f |
972 | cmp edx,ted_tex_1 |
983 | cmp edx,ted_tex_1 |
973 | jle @f |
984 | jle @f |
974 | call ted_iterat_next |
985 | call ted_iterat_next |
975 | jmp @b |
986 | jmp @b |
976 | @@: |
987 | @@: |
977 | call ted_iterat_next |
988 | call ted_iterat_next |
978 | ret |
989 | ret |
979 | 990 | ||
980 | ;input: |
991 | ;input: |
981 | ; edx = pointer to symbol struct |
992 | ; edx = pointer to symbol struct |
982 | ; edi = pointer to tedit struct |
993 | ; edi = pointer to tedit struct |
983 | align 4 |
994 | align 4 |
984 | ted_iterat_perv_color_tag: |
995 | ted_iterat_perv_color_tag: |
985 | @@: |
996 | @@: |
986 | cmp byte[edx+1],0 |
997 | cmp byte[edx+1],0 |
987 | jne @f |
998 | jne @f |
988 | call ted_iterat_perv |
999 | call ted_iterat_perv |
989 | cmp edx,ted_tex_1 |
1000 | cmp edx,ted_tex_1 |
990 | jle @f |
1001 | jle @f |
991 | jmp @b |
1002 | jmp @b |
992 | @@: |
1003 | @@: |
993 | ret |
1004 | ret |
994 | 1005 | ||
995 | ;input: |
1006 | ;input: |
996 | ; edx = pointer to symbol struct |
1007 | ; edx = pointer to symbol struct |
997 | ; edi = pointer to tedit struct |
1008 | ; edi = pointer to tedit struct |
998 | align 4 |
1009 | align 4 |
999 | ted_iterat_next_color_tag: |
1010 | ted_iterat_next_color_tag: |
1000 | @@: |
1011 | @@: |
1001 | call ted_iterat_next |
1012 | call ted_iterat_next |
1002 | cmp byte[edx+1],0 |
1013 | cmp byte[edx+1],0 |
1003 | jne @f |
1014 | jne @f |
1004 | cmp edx,ted_tex_1 |
1015 | cmp edx,ted_tex_1 |
1005 | jle @f |
1016 | jle @f |
1006 | jmp @b |
1017 | jmp @b |
1007 | @@: |
1018 | @@: |
1008 | ;call ted_iterat_next |
1019 | ;call ted_iterat_next |
1009 | ret |
1020 | ret |
1010 | 1021 | ||
1011 | ;input: |
1022 | ;input: |
1012 | ; edx = pointer to symbol struct |
1023 | ; edx = pointer to symbol struct |
1013 | ; edi = pointer to tedit struct |
1024 | ; edi = pointer to tedit struct |
1014 | ;output: |
1025 | ;output: |
1015 | ; bl = 1 if sumbol not visible |
1026 | ; bl = 1 if sumbol not visible |
1016 | ; (tex[i].td+ted_tim_undo<=ted_tim_ch && tex[i].td) || (tex[i].tc>ted_tim_ch-ted_tim_undo) |
1027 | ; (tex[i].td+ted_tim_undo<=ted_tim_ch && tex[i].td) || (tex[i].tc>ted_tim_ch-ted_tim_undo) |
1017 | align 4 |
1028 | align 4 |
1018 | ted_symbol_not_vis: |
1029 | ted_symbol_not_vis: |
1019 | push eax |
1030 | push eax |
1020 | 1031 | ||
1021 | xor bl,bl |
1032 | xor bl,bl |
1022 | 1033 | ||
1023 | cmp dword [edx+14],0 |
1034 | cmp dword [edx+14],0 |
1024 | je @f |
1035 | je @f |
1025 | mov eax,[edx+14] ;eax=tex[i].td |
1036 | mov eax,[edx+14] ;eax=tex[i].td |
1026 | add eax,ted_tim_undo |
1037 | add eax,ted_tim_undo |
1027 | cmp eax,ted_tim_ch |
1038 | cmp eax,ted_tim_ch |
1028 | jg @f |
1039 | jg @f |
1029 | mov bl,1 |
1040 | mov bl,1 |
1030 | pop eax |
1041 | pop eax |
1031 | ret |
1042 | ret |
1032 | @@: |
1043 | @@: |
1033 | 1044 | ||
1034 | mov eax,ted_tim_ch |
1045 | mov eax,ted_tim_ch |
1035 | sub eax,ted_tim_undo |
1046 | sub eax,ted_tim_undo |
1036 | cmp [edx+10],eax |
1047 | cmp [edx+10],eax |
1037 | jle @f |
1048 | jle @f |
1038 | or bl,1 |
1049 | or bl,1 |
1039 | @@: |
1050 | @@: |
1040 | 1051 | ||
1041 | pop eax |
1052 | pop eax |
1042 | ret |
1053 | ret |
1043 | 1054 | ||
1044 | ;input: |
1055 | ;input: |
1045 | ; text:dword - pointer to text string |
1056 | ; text:dword - pointer to text string |
1046 | ; add_opt:dword - options |
1057 | ; add_opt:dword - options |
1047 | align 4 |
1058 | align 4 |
1048 | proc ted_text_add, edit:dword, text:dword, t_len:dword, add_opt:dword |
1059 | proc ted_text_add, edit:dword, text:dword, t_len:dword, add_opt:dword |
1049 | locals |
1060 | locals |
1050 | new_spc dd ? ;count new spaces |
1061 | new_spc dd ? ;count new spaces |
1051 | new_lin dd ? ;count new lines |
1062 | new_lin dd ? ;count new lines |
1052 | endl |
1063 | endl |
1053 | ;¨á¯®«ì§®¢ ¨¥ ॣ¨áâ஢ ¢ãâਠäãªæ¨¨: |
1064 | ;¨á¯®«ì§®¢ ¨¥ ॣ¨áâ஢ ¢ãâਠäãªæ¨¨: |
1054 | ;eax - ¯®§¨æ¨ï ¤«ï ¢áâ ¢ª¨ ⥪áâ |
1065 | ;eax - ¯®§¨æ¨ï ¤«ï ¢áâ ¢ª¨ ⥪áâ |
1055 | ;ebx - ¤«ï ¢à¥¬¥ëå 㦤, ¤«¨ ¢áâ ¢«ï¥¬®£® ⥪áâ |
1066 | ;ebx - ¤«ï ¢à¥¬¥ëå 㦤, ¤«¨ ¢áâ ¢«ï¥¬®£® ⥪áâ |
1056 | ;ecx - ¤«ï ¢à¥¬¥ëå 㦤 |
1067 | ;ecx - ¤«ï ¢à¥¬¥ëå 㦤 |
1057 | ;edx - 㪠§ ⥫ì áâàãªâãàã ᨬ¢®« |
1068 | ;edx - 㪠§ ⥫ì áâàãªâãàã ᨬ¢®« |
1058 | pushad |
1069 | pushad |
1059 | mov edi,dword[edit] |
1070 | mov edi,dword[edit] |
1060 | mov esi,dword[text] |
1071 | mov esi,dword[text] |
1061 | 1072 | ||
1062 | call ted_get_pos_by_cursor |
1073 | call ted_get_pos_by_cursor |
1063 | call ted_get_text_perv_pos |
1074 | call ted_get_text_perv_pos |
1064 | call ted_get_text_arr_index ;eax=po_t |
1075 | call ted_get_text_arr_index ;eax=po_t |
1065 | 1076 | ||
1066 | mov dword[new_spc],0 |
1077 | mov dword[new_spc],0 |
1067 | cmp ted_gp_opt,2 |
1078 | cmp ted_gp_opt,2 |
1068 | je @f |
1079 | je @f |
1069 | push eax ;c_sp=cur[cn].x+Scroller->XPos-StrLen(cur[cn].y+Scroller->YPos); |
1080 | push eax ;c_sp=cur[cn].x+Scroller->XPos-StrLen(cur[cn].y+Scroller->YPos); |
1070 | mov eax,ted_scr_h |
1081 | mov eax,ted_scr_h |
1071 | mov eax,dword[eax+sb_offs_position] |
1082 | mov eax,dword[eax+sb_offs_position] |
1072 | add eax,ted_cur_x ;eax - ®¬¥à ᨬ¢®« |
1083 | add eax,ted_cur_x ;eax - ®¬¥à ᨬ¢®« |
1073 | mov dword[new_spc],eax |
1084 | mov dword[new_spc],eax |
1074 | 1085 | ||
1075 | mov eax,ted_scr_w |
1086 | mov eax,ted_scr_w |
1076 | mov eax,dword[eax+sb_offs_position] |
1087 | mov eax,dword[eax+sb_offs_position] |
1077 | add eax,ted_cur_y ;eax - ®¬¥à áâப¨ |
1088 | add eax,ted_cur_y ;eax - ®¬¥à áâப¨ |
1078 | call ted_strlen ;ebx = line len |
1089 | call ted_strlen ;ebx = line len |
1079 | sub dword[new_spc],ebx ;®â ¯®§¨æ¨¨ ªãàá®à ®â¨¬ ¥¬ ¤«¨ã áâப¨, 㧠¥¬ ª®««¨ç¥á⢮ ¤®¡ ¢«ï¥¬ëå ¯à®¡¥«®¢ |
1090 | sub dword[new_spc],ebx ;®â ¯®§¨æ¨¨ ªãàá®à ®â¨¬ ¥¬ ¤«¨ã áâப¨, 㧠¥¬ ª®««¨ç¥á⢮ ¤®¡ ¢«ï¥¬ëå ¯à®¡¥«®¢ |
1080 | pop eax |
1091 | pop eax |
1081 | @@: |
1092 | @@: |
1082 | 1093 | ||
1083 | mov ebx,dword[t_len] |
1094 | mov ebx,dword[t_len] |
1084 | 1095 | ||
1085 | mov dword[new_lin],0 |
1096 | mov dword[new_lin],0 |
1086 | cmp ted_gp_opt,0 |
1097 | cmp ted_gp_opt,0 |
1087 | jne @f |
1098 | jne @f |
1088 | push eax |
1099 | push eax |
1089 | mov eax,ted_scr_w |
1100 | mov eax,ted_scr_w |
1090 | mov eax,dword[eax+sb_offs_position] |
1101 | mov eax,dword[eax+sb_offs_position] |
1091 | add eax,ted_cur_y |
1102 | add eax,ted_cur_y |
1092 | inc eax |
1103 | inc eax |
1093 | mov dword[new_lin],eax |
1104 | mov dword[new_lin],eax |
1094 | 1105 | ||
1095 | call ted_get_num_lines |
1106 | call ted_get_num_lines |
1096 | sub dword[new_lin],eax |
1107 | sub dword[new_lin],eax |
1097 | pop eax |
1108 | pop eax |
1098 | @@: |
1109 | @@: |
1099 | 1110 | ||
1100 | mov edx,sizeof.symbol |
1111 | mov edx,sizeof.symbol |
1101 | shl edx,1 |
1112 | shl edx,1 |
1102 | add edx,ted_tex |
1113 | add edx,ted_tex |
1103 | @@: ;for(i=2;i |
1114 | @@: ;for(i=2;i |
1104 | cmp dword [edx+10],0 ;if(!tex[i].tc && !tex[i].td) |
1115 | cmp dword [edx+10],0 ;if(!tex[i].tc && !tex[i].td) |
1105 | jne .u1f |
1116 | jne .u1f |
1106 | cmp dword [edx+14],0 |
1117 | cmp dword [edx+14],0 |
1107 | jne .u1f |
1118 | jne .u1f |
1108 | test dword[add_opt],ted_opt_ed_change_time ;if(n_tim) ted_tim_ch++; |
1119 | test dword[add_opt],ted_opt_ed_change_time ;if(n_tim) ted_tim_ch++; |
1109 | jz .no_tim |
1120 | jz .no_tim |
1110 | inc ted_tim_ch |
1121 | inc ted_tim_ch |
1111 | .no_tim: |
1122 | .no_tim: |
1112 | test dword[add_opt],ted_opt_ed_move_cursor |
1123 | test dword[add_opt],ted_opt_ed_move_cursor |
1113 | jz .no_cur_mov |
1124 | jz .no_cur_mov |
1114 | cmp dword[new_lin],0 ;¥á«¨ ¥áâì ¤®¡ ¢®çë¥ áâப¨, â® ªãàá®à ¥é¥ ¥ ¤¢¨£ ¥¬ |
1125 | cmp dword[new_lin],0 ;¥á«¨ ¥áâì ¤®¡ ¢®çë¥ áâப¨, â® ªãàá®à ¥é¥ ¥ ¤¢¨£ ¥¬ |
1115 | jg .no_cur_mov |
1126 | jg .no_cur_mov |
1116 | cmp dword[new_spc],0 ;¥á«¨ ¥â ¤®¡ ¢®çëå ¯à®¡¥«®¢, â® ªãàá®à ⮦¥ ¥ ¤¢¨£ ¥¬ |
1127 | cmp dword[new_spc],0 ;¥á«¨ ¥â ¤®¡ ¢®çëå ¯à®¡¥«®¢, â® ªãàá®à ⮦¥ ¥ ¤¢¨£ ¥¬ |
1117 | jg .no_cur_mov |
1128 | jg .no_cur_mov |
1118 | inc ted_cur_x ;move cursor |
1129 | inc ted_cur_x ;move cursor |
1119 | ;call ted_go_to_pos |
1130 | ;call ted_go_to_pos |
1120 | cmp byte [esi],13 |
1131 | cmp byte [esi],13 |
1121 | jne .no_cur_mov |
1132 | jne .no_cur_mov |
1122 | mov ted_cur_x,0 |
1133 | mov ted_cur_x,0 |
1123 | inc ted_cur_y |
1134 | inc ted_cur_y |
1124 | .no_cur_mov: |
1135 | .no_cur_mov: |
1125 | 1136 | ||
1126 | mov ecx,ted_opt_ed_change_time |
1137 | mov ecx,ted_opt_ed_change_time |
1127 | not ecx |
1138 | not ecx |
1128 | and dword[add_opt],ecx ;n_tim=false; |
1139 | and dword[add_opt],ecx ;n_tim=false; |
1129 | 1140 | ||
1130 | mov cl,byte [esi] ;tex[i].c=ta[ns]; |
1141 | mov cl,byte [esi] ;tex[i].c=ta[ns]; |
1131 | mov byte [edx],cl |
1142 | mov byte [edx],cl |
1132 | m2m dword [edx+10],ted_tim_ch ;tex[i].tc=ted_tim_ch; |
1143 | m2m dword [edx+10],ted_tim_ch ;tex[i].tc=ted_tim_ch; |
1133 | mov [edx+2],eax ;tex[i].perv=po_t; |
1144 | mov [edx+2],eax ;tex[i].perv=po_t; |
1134 | 1145 | ||
1135 | mov ecx,eax |
1146 | mov ecx,eax |
1136 | imul ecx,sizeof.symbol |
1147 | imul ecx,sizeof.symbol |
1137 | add ecx,ted_tex ; *** ecx = tex[po_t] *** |
1148 | add ecx,ted_tex ; *** ecx = tex[po_t] *** |
1138 | add ecx,6 ; *** ecx = tex[po_t].next *** |
1149 | add ecx,6 ; *** ecx = tex[po_t].next *** |
1139 | m2m dword [edx+6],dword [ecx] ;tex[i].next=tex[po_t].next; |
1150 | m2m dword [edx+6],dword [ecx] ;tex[i].next=tex[po_t].next; |
1140 | 1151 | ||
1141 | call ted_get_text_arr_index ;*** eax = i *** |
1152 | call ted_get_text_arr_index ;*** eax = i *** |
1142 | cmp eax,ted_max_chars |
1153 | cmp eax,ted_max_chars |
1143 | jge @f |
1154 | jge @f |
1144 | mov [ecx],eax ;tex[po_t].next=i; // áá뫪¨ ¯¥à¥ ¯à ¢«ï¥¬ |
1155 | mov [ecx],eax ;tex[po_t].next=i; // áá뫪¨ ¯¥à¥ ¯à ¢«ï¥¬ |
1145 | mov ecx,[edx+6] ; *** ecx = tex[i].next *** |
1156 | mov ecx,[edx+6] ; *** ecx = tex[i].next *** |
1146 | imul ecx,sizeof.symbol |
1157 | imul ecx,sizeof.symbol |
1147 | add ecx,ted_tex ; *** ecx = tex[tex[i].next] *** |
1158 | add ecx,ted_tex ; *** ecx = tex[tex[i].next] *** |
1148 | mov [ecx+2],eax ;tex[tex[i].next].perv=i; |
1159 | mov [ecx+2],eax ;tex[tex[i].next].perv=i; |
1149 | 1160 | ||
1150 | cmp dword[new_lin],0 ;add lines or text |
1161 | cmp dword[new_lin],0 ;add lines or text |
1151 | jle .spc_add |
1162 | jle .spc_add |
1152 | dec dword[new_lin] |
1163 | dec dword[new_lin] |
1153 | mov byte [edx],13 |
1164 | mov byte [edx],13 |
1154 | jmp .u1f |
1165 | jmp .u1f |
1155 | .spc_add: |
1166 | .spc_add: |
1156 | cmp dword[new_spc],0 ;add spaces or text |
1167 | cmp dword[new_spc],0 ;add spaces or text |
1157 | jle .tex_add |
1168 | jle .tex_add |
1158 | dec dword[new_spc] |
1169 | dec dword[new_spc] |
1159 | mov byte [edx],' ' |
1170 | mov byte [edx],' ' |
1160 | jmp .u1f |
1171 | jmp .u1f |
1161 | .tex_add: |
1172 | .tex_add: |
1162 | inc esi |
1173 | inc esi |
1163 | dec ebx |
1174 | dec ebx |
1164 | .u1f: |
1175 | .u1f: |
1165 | add edx,sizeof.symbol |
1176 | add edx,sizeof.symbol |
1166 | cmp edx,ted_tex_end |
1177 | cmp edx,ted_tex_end |
1167 | jge @f ;out of memory |
1178 | jge @f ;out of memory |
1168 | cmp ebx,0 |
1179 | cmp ebx,0 |
1169 | jne @b |
1180 | jne @b |
1170 | @@: |
1181 | @@: |
1171 | 1182 | ||
1172 | call ted_text_colored |
1183 | call ted_text_colored |
1173 | popad |
1184 | popad |
1174 | ret |
1185 | ret |
1175 | endp |
1186 | endp |
1176 | 1187 | ||
1177 | ;input: |
1188 | ;input: |
1178 | ; ecx = position to free insert cell |
1189 | ; ecx = position to free insert cell |
1179 | ; edx = pointer to sumbol, when insert |
1190 | ; edx = pointer to sumbol, when insert |
1180 | ; esi = pointer to added symbol |
1191 | ; esi = pointer to added symbol |
1181 | ; edi = pointer to tedit struct |
1192 | ; edi = pointer to tedit struct |
1182 | ;output: |
1193 | ;output: |
1183 | ; ecx = position to inserted cell |
1194 | ; ecx = position to inserted cell |
1184 | align 4 |
1195 | align 4 |
1185 | ted_char_add: |
1196 | ted_char_add: |
1186 | 1197 | ||
1187 | .loop_b: |
1198 | .loop_b: |
1188 | cmp ecx,ted_tex_end |
1199 | cmp ecx,ted_tex_end |
1189 | jge .end_f |
1200 | jge .end_f |
1190 | cmp dword[ecx+10],0 |
1201 | cmp dword[ecx+10],0 |
1191 | jne @f |
1202 | jne @f |
1192 | cmp dword[ecx+14],0 |
1203 | cmp dword[ecx+14],0 |
1193 | je .loop_e |
1204 | je .loop_e |
1194 | @@: |
1205 | @@: |
1195 | add ecx,sizeof.symbol |
1206 | add ecx,sizeof.symbol |
1196 | jmp .loop_b |
1207 | jmp .loop_b |
1197 | .loop_e: |
1208 | .loop_e: |
1198 | 1209 | ||
1199 | push eax ebx |
1210 | push eax ebx |
1200 | mov eax,ted_tim_ch |
1211 | mov eax,ted_tim_ch |
1201 | mov dword[ecx+10],eax |
1212 | mov dword[ecx+10],eax |
1202 | mov al,byte[esi] |
1213 | mov al,byte[esi] |
1203 | mov byte[ecx],al |
1214 | mov byte[ecx],al |
1204 | 1215 | ||
1205 | call ted_get_text_arr_index ; *** eax=pos *** |
1216 | call ted_get_text_arr_index ; *** eax=pos *** |
1206 | mov [ecx+2],eax ;tex[i].perv=pos; |
1217 | mov [ecx+2],eax ;tex[i].perv=pos; |
1207 | m2m dword[ecx+6],dword[edx+6] ;tex[i].next=tex[pos].next; |
1218 | m2m dword[ecx+6],dword[edx+6] ;tex[i].next=tex[pos].next; |
1208 | 1219 | ||
1209 | push edx |
1220 | push edx |
1210 | mov edx,ecx |
1221 | mov edx,ecx |
1211 | call ted_get_text_arr_index ; *** eax=i *** |
1222 | call ted_get_text_arr_index ; *** eax=i *** |
1212 | pop edx |
1223 | pop edx |
1213 | 1224 | ||
1214 | mov [edx+6],eax ;tex[pos].next=i; // áá뫪¨ ¯¥à¥ ¯à ¢«ï¥¬ |
1225 | mov [edx+6],eax ;tex[pos].next=i; // áá뫪¨ ¯¥à¥ ¯à ¢«ï¥¬ |
1215 | mov ebx,[ecx+6] |
1226 | mov ebx,[ecx+6] |
1216 | ConvertIndexToPointer ebx |
1227 | ConvertIndexToPointer ebx |
1217 | mov [ebx+2],eax ;tex[tex[i].next].perv=i; // ... |
1228 | mov [ebx+2],eax ;tex[tex[i].next].perv=i; // ... |
1218 | pop ebx eax |
1229 | pop ebx eax |
1219 | 1230 | ||
1220 | .end_f: |
1231 | .end_f: |
1221 | call ted_text_colored |
1232 | call ted_text_colored |
1222 | ret |
1233 | ret |
1223 | 1234 | ||
1224 | 1235 | ||
1225 | ;input: |
1236 | ;input: |
1226 | ; conv_table = pointert to convert table |
1237 | ; conv_table = pointert to convert table |
1227 | ; edi = pointer to tedit struct |
1238 | ; edi = pointer to tedit struct |
1228 | ;output: |
1239 | ;output: |
1229 | ; esi = count converted symbols |
1240 | ; esi = count converted symbols |
1230 | ;description: |
1241 | ;description: |
1231 | ; ãªæ¨ï ¨á¯®«ì§ã¥âáï ¤«ï ᬥë ॣ¨áâà ¢ë¡à ëå ᨬ¢®«®¢ |
1242 | ; ãªæ¨ï ¨á¯®«ì§ã¥âáï ¤«ï ᬥë ॣ¨áâà ¢ë¡à ëå ᨬ¢®«®¢ |
1232 | align 4 |
1243 | align 4 |
1233 | proc ted_convert_sel_text |
1244 | proc ted_convert_sel_text |
1234 | locals |
1245 | locals |
1235 | conv_cou dd ? |
1246 | conv_cou dd ? |
1236 | endl |
1247 | endl |
1237 | mov dword[conv_cou],0 |
1248 | mov dword[conv_cou],0 |
1238 | pushad |
1249 | pushad |
1239 | 1250 | ||
1240 | call ted_is_select |
1251 | call ted_is_select |
1241 | cmp al,0 |
1252 | cmp al,0 |
1242 | je .end_f |
1253 | je .end_f |
1243 | call ted_set_undo |
1254 | call ted_set_undo |
1244 | call ted_sel_normalize |
1255 | call ted_sel_normalize |
1245 | 1256 | ||
1246 | mov esi,ted_seln_x0 |
1257 | mov esi,ted_seln_x0 |
1247 | mov ecx,ted_seln_y0 |
1258 | mov ecx,ted_seln_y0 |
1248 | call ted_get_pos_by_coords |
1259 | call ted_get_pos_by_coords |
1249 | mov eax,edx |
1260 | mov eax,edx |
1250 | mov esi,ted_seln_x1 |
1261 | mov esi,ted_seln_x1 |
1251 | mov ecx,ted_seln_y1 |
1262 | mov ecx,ted_seln_y1 |
1252 | call ted_get_pos_by_coords |
1263 | call ted_get_pos_by_coords |
1253 | ;call ted_get_text_perv_pos |
1264 | ;call ted_get_text_perv_pos |
1254 | mov ebx,edx |
1265 | mov ebx,edx |
1255 | 1266 | ||
1256 | cmp eax,ebx |
1267 | cmp eax,ebx |
1257 | je .end_f |
1268 | je .end_f |
1258 | 1269 | ||
1259 | inc ted_tim_ch |
1270 | inc ted_tim_ch |
1260 | mov edx,eax ;i=p0; |
1271 | mov edx,eax ;i=p0; |
1261 | mov ecx,2 |
1272 | mov ecx,2 |
1262 | ConvertIndexToPointer ecx |
1273 | ConvertIndexToPointer ecx |
1263 | @@: |
1274 | @@: |
1264 | mov esi,[edx] |
1275 | mov esi,[edx] |
1265 | and esi,0xff |
1276 | and esi,0xff |
1266 | add esi,[conv_table] ;EvUpper |
1277 | add esi,[conv_table] ;EvUpper |
1267 | cmp byte [esi],0 |
1278 | cmp byte [esi],0 |
1268 | je .no_change |
1279 | je .no_change |
1269 | m2m dword [edx+14],ted_tim_ch |
1280 | m2m dword [edx+14],ted_tim_ch |
1270 | call ted_char_add ;b_pos=ted_char_add(tex[i].c^32,i,false,b_pos); |
1281 | call ted_char_add ;b_pos=ted_char_add(tex[i].c^32,i,false,b_pos); |
1271 | call ted_get_text_next_pos ;go to added symbol |
1282 | call ted_get_text_next_pos ;go to added symbol |
1272 | inc dword[conv_cou] |
1283 | inc dword[conv_cou] |
1273 | .no_change: |
1284 | .no_change: |
1274 | 1285 | ||
1275 | call ted_iterat_next |
1286 | call ted_iterat_next |
1276 | cmp edx,ted_tex |
1287 | cmp edx,ted_tex |
1277 | je @f |
1288 | je @f |
1278 | cmp edx,ebx |
1289 | cmp edx,ebx |
1279 | je @f |
1290 | je @f |
1280 | 1291 | ||
1281 | jmp @b |
1292 | jmp @b |
1282 | @@: |
1293 | @@: |
1283 | cmp dword[conv_cou],0 |
1294 | cmp dword[conv_cou],0 |
1284 | jne @f |
1295 | jne @f |
1285 | dec ted_tim_ch |
1296 | dec ted_tim_ch |
1286 | @@: |
1297 | @@: |
1287 | .end_f: |
1298 | .end_f: |
1288 | popad |
1299 | popad |
1289 | mov esi,dword[conv_cou] |
1300 | mov esi,dword[conv_cou] |
1290 | ret |
1301 | ret |
1291 | endp |
1302 | endp |
1292 | 1303 | ||
1293 | ;output: |
1304 | ;output: |
1294 | ; bl = 0 - no delete |
1305 | ; bl = 0 - no delete |
1295 | ; bl = 1 - delete |
1306 | ; bl = 1 - delete |
1296 | align 4 |
1307 | align 4 |
1297 | proc ted_text_del, edit:dword, del_opt:dword |
1308 | proc ted_text_del, edit:dword, del_opt:dword |
1298 | push cx edx edi |
1309 | push cx edx edi |
1299 | mov edi,dword[edit] |
1310 | mov edi,dword[edit] |
1300 | mov ebx,dword[del_opt] |
1311 | mov ebx,dword[del_opt] |
1301 | 1312 | ||
1302 | xor cl,cl |
1313 | xor cl,cl |
1303 | test ebx,ted_opt_ed_move_cursor |
1314 | test ebx,ted_opt_ed_move_cursor |
1304 | jz @f |
1315 | jz @f |
1305 | call ted_cur_move_left |
1316 | call ted_cur_move_left |
1306 | cmp dl,0 |
1317 | cmp dl,0 |
1307 | je .no_del |
1318 | je .no_del |
1308 | @@: |
1319 | @@: |
1309 | call ted_get_pos_by_cursor |
1320 | call ted_get_pos_by_cursor |
1310 | cmp ted_gp_opt,1 |
1321 | cmp ted_gp_opt,1 |
1311 | je .no_del |
1322 | je .no_del |
1312 | test ebx,ted_opt_ed_change_time |
1323 | test ebx,ted_opt_ed_change_time |
1313 | jz @f |
1324 | jz @f |
1314 | inc ted_tim_ch |
1325 | inc ted_tim_ch |
1315 | @@: |
1326 | @@: |
1316 | m2m dword [edx+14], ted_tim_ch |
1327 | m2m dword [edx+14], ted_tim_ch |
1317 | mov cl,1 |
1328 | mov cl,1 |
1318 | .no_del: |
1329 | .no_del: |
1319 | mov bl,cl |
1330 | mov bl,cl |
1320 | pop edi edx cx |
1331 | pop edi edx cx |
1321 | ret |
1332 | ret |
1322 | endp |
1333 | endp |
1323 | 1334 | ||
1324 | ;input: |
1335 | ;input: |
1325 | ; edi = pointer to tedit struct |
1336 | ; edi = pointer to tedit struct |
1326 | ;output: |
1337 | ;output: |
1327 | ; al = 1 if delete |
1338 | ; al = 1 if delete |
1328 | ;description: |
1339 | ;description: |
1329 | ; ãªæ¨ï 㤠«ï¥â ¢ë¤¥«¥ë© ⥪áâ |
1340 | ; ãªæ¨ï 㤠«ï¥â ¢ë¤¥«¥ë© ⥪áâ |
1330 | align 4 |
1341 | align 4 |
1331 | proc ted_sel_text_del, del_opt:dword |
1342 | proc ted_sel_text_del, del_opt:dword |
1332 | push ebx ecx edx esi |
1343 | push ebx ecx edx esi |
1333 | 1344 | ||
1334 | call ted_is_select |
1345 | call ted_is_select |
1335 | cmp al,0 |
1346 | cmp al,0 |
1336 | je .end_f |
1347 | je .end_f |
1337 | 1348 | ||
1338 | call ted_sel_normalize |
1349 | call ted_sel_normalize |
1339 | 1350 | ||
1340 | mov esi,ted_seln_x1 |
1351 | mov esi,ted_seln_x1 |
1341 | mov ecx,ted_seln_y1 |
1352 | mov ecx,ted_seln_y1 |
1342 | call ted_get_pos_by_coords |
1353 | call ted_get_pos_by_coords |
1343 | mov ebx,edx |
1354 | mov ebx,edx |
1344 | 1355 | ||
1345 | mov esi,ted_seln_x0 |
1356 | mov esi,ted_seln_x0 |
1346 | mov ecx,ted_seln_y0 |
1357 | mov ecx,ted_seln_y0 |
1347 | call ted_get_pos_by_coords |
1358 | call ted_get_pos_by_coords |
1348 | 1359 | ||
1349 | test dword[del_opt],ted_opt_ed_change_time |
1360 | test dword[del_opt],ted_opt_ed_change_time |
1350 | jz @f |
1361 | jz @f |
1351 | inc ted_tim_ch |
1362 | inc ted_tim_ch |
1352 | @@: |
1363 | @@: |
1353 | cmp edx,ted_tex |
1364 | cmp edx,ted_tex |
1354 | je @f |
1365 | je @f |
1355 | cmp edx,ebx ;if(i==te)break; |
1366 | cmp edx,ebx ;if(i==te)break; |
1356 | je @f |
1367 | je @f |
1357 | m2m dword[edx+14],ted_tim_ch |
1368 | m2m dword[edx+14],ted_tim_ch |
1358 | mov esi,ted_opt_ed_change_time |
1369 | mov esi,ted_opt_ed_change_time |
1359 | not esi |
1370 | not esi |
1360 | and dword[del_opt],esi ;n_tim=false; |
1371 | and dword[del_opt],esi ;n_tim=false; |
1361 | call ted_iterat_next |
1372 | call ted_iterat_next |
1362 | jmp @b |
1373 | jmp @b |
1363 | @@: |
1374 | @@: |
1364 | test dword[del_opt],ted_opt_ed_change_time |
1375 | test dword[del_opt],ted_opt_ed_change_time |
1365 | jz @f |
1376 | jz @f |
1366 | dec ted_tim_ch |
1377 | dec ted_tim_ch |
1367 | xor al,al |
1378 | xor al,al |
1368 | @@: |
1379 | @@: |
1369 | test dword[del_opt],ted_opt_ed_change_time |
1380 | test dword[del_opt],ted_opt_ed_change_time |
1370 | jnz @f |
1381 | jnz @f |
1371 | mov ecx,ted_seln_x0 |
1382 | mov ecx,ted_seln_x0 |
1372 | mov edx,ted_seln_y0 |
1383 | mov edx,ted_seln_y0 |
1373 | call ted_go_to_pos |
1384 | call ted_go_to_pos |
1374 | mov ted_sel_x0,0 |
1385 | mov ted_sel_x0,0 |
1375 | mov ted_sel_y0,0 |
1386 | mov ted_sel_y0,0 |
1376 | mov ted_sel_x1,0 |
1387 | mov ted_sel_x1,0 |
1377 | mov ted_sel_y1,0 |
1388 | mov ted_sel_y1,0 |
1378 | @@: |
1389 | @@: |
1379 | .end_f: |
1390 | .end_f: |
1380 | pop esi edx ecx ebx |
1391 | pop esi edx ecx ebx |
1381 | ret |
1392 | ret |
1382 | endp |
1393 | endp |
1383 | 1394 | ||
1384 | 1395 | ||
1385 | ;input: |
1396 | ;input: |
1386 | ; eax = pointer to begin select |
1397 | ; eax = pointer to begin select |
1387 | ; ebx = pointer to end select |
1398 | ; ebx = pointer to end select |
1388 | ; edi = pointer to tedit struct |
1399 | ; edi = pointer to tedit struct |
1389 | align 4 |
1400 | align 4 |
1390 | ted_revers: |
1401 | ted_revers: |
1391 | cmp eax,ebx |
1402 | cmp eax,ebx |
1392 | jne @f |
1403 | jne @f |
1393 | ret |
1404 | ret |
1394 | @@: |
1405 | @@: |
1395 | 1406 | ||
1396 | push ecx edx |
1407 | push ecx edx |
1397 | 1408 | ||
1398 | mov edx,ted_tex_1 |
1409 | mov edx,ted_tex_1 |
1399 | cmp edx,ebx ;if(p1==1)p1=tex[1].perv; |
1410 | cmp edx,ebx ;if(p1==1)p1=tex[1].perv; |
1400 | jne @f |
1411 | jne @f |
1401 | call ted_get_text_perv_pos |
1412 | call ted_get_text_perv_pos |
1402 | mov ebx,edx |
1413 | mov ebx,edx |
1403 | @@: |
1414 | @@: |
1404 | 1415 | ||
1405 | push esi |
1416 | push esi |
1406 | mov edx,[eax+2] ; *** edx = tex[p0].perv *** |
1417 | mov edx,[eax+2] ; *** edx = tex[p0].perv *** |
1407 | ConvertIndexToPointer edx |
1418 | ConvertIndexToPointer edx |
1408 | add edx,6 |
1419 | add edx,6 |
1409 | mov ecx,[edx] ;tmp = tex[tex[p0].perv].next; |
1420 | mov ecx,[edx] ;tmp = tex[tex[p0].perv].next; |
1410 | 1421 | ||
1411 | mov esi,[ebx+6] ; *** esi = tex[p1].next *** |
1422 | mov esi,[ebx+6] ; *** esi = tex[p1].next *** |
1412 | ConvertIndexToPointer esi |
1423 | ConvertIndexToPointer esi |
1413 | add esi,2 |
1424 | add esi,2 |
1414 | m2m dword[edx],dword[esi] ;tex[tex[p0].perv].next = tex[tex[p1].next].perv; |
1425 | m2m dword[edx],dword[esi] ;tex[tex[p0].perv].next = tex[tex[p1].next].perv; |
1415 | 1426 | ||
1416 | mov [esi],ecx ;tex[tex[p1].next].perv = tmp; |
1427 | mov [esi],ecx ;tex[tex[p1].next].perv = tmp; |
1417 | pop esi |
1428 | pop esi |
1418 | 1429 | ||
1419 | mov ecx,[eax+2] ;tmp = tex[p0].perv; |
1430 | mov ecx,[eax+2] ;tmp = tex[p0].perv; |
1420 | m2m dword[eax+2],dword[ebx+6] ;tex[p0].perv = tex[p1].next; |
1431 | m2m dword[eax+2],dword[ebx+6] ;tex[p0].perv = tex[p1].next; |
1421 | mov [ebx+6],ecx ;tex[p1].next = tmp; |
1432 | mov [ebx+6],ecx ;tex[p1].next = tmp; |
1422 | 1433 | ||
1423 | mov edx,eax ;i=p0; |
1434 | mov edx,eax ;i=p0; |
1424 | @@: |
1435 | @@: |
1425 | mov ecx,[edx+6] ;tmp = tex[i].next; |
1436 | mov ecx,[edx+6] ;tmp = tex[i].next; |
1426 | m2m dword[edx+6],dword[edx+2] ;tex[i].next = tex[i].perv; |
1437 | m2m dword[edx+6],dword[edx+2] ;tex[i].next = tex[i].perv; |
1427 | mov [edx+2],ecx ;tex[i].perv = tmp; |
1438 | mov [edx+2],ecx ;tex[i].perv = tmp; |
1428 | cmp edx,ebx ;if(i==p1)break; |
1439 | cmp edx,ebx ;if(i==p1)break; |
1429 | je @f |
1440 | je @f |
1430 | ; --- |
1441 | ; --- |
1431 | ;cmp edx,ted_tex |
1442 | ;cmp edx,ted_tex |
1432 | ;je @f |
1443 | ;je @f |
1433 | ; --- |
1444 | ; --- |
1434 | mov edx,ecx ;i = tmp; |
1445 | mov edx,ecx ;i = tmp; |
1435 | ConvertIndexToPointer edx |
1446 | ConvertIndexToPointer edx |
1436 | jmp @b |
1447 | jmp @b |
1437 | @@: |
1448 | @@: |
1438 | pop edx ecx |
1449 | pop edx ecx |
1439 | call ted_text_colored |
1450 | call ted_text_colored |
1440 | ret |
1451 | ret |
1441 | 1452 | ||
1442 | 1453 | ||
1443 | ;input: |
1454 | ;input: |
1444 | ; edi = pointer to tedit struct |
1455 | ; edi = pointer to tedit struct |
1445 | ;output: |
1456 | ;output: |
1446 | ; dl = 0 not move |
1457 | ; dl = 0 not move |
1447 | ; dl = 2 if move up |
1458 | ; dl = 2 if move up |
1448 | ; dl = 8 if scroll move up |
1459 | ; dl = 8 if scroll move up |
1449 | align 4 |
1460 | align 4 |
1450 | ted_cur_move_up: |
1461 | ted_cur_move_up: |
1451 | cmp ted_cur_y,0 |
1462 | cmp ted_cur_y,0 |
1452 | je @f |
1463 | je @f |
1453 | dec ted_cur_y |
1464 | dec ted_cur_y |
1454 | mov dl,2 |
1465 | mov dl,2 |
1455 | ret |
1466 | ret |
1456 | @@: |
1467 | @@: |
1457 | push eax |
1468 | push eax |
1458 | mov eax,ted_scr_w |
1469 | mov eax,ted_scr_w |
1459 | cmp dword[eax+sb_offs_position],0 |
1470 | cmp dword[eax+sb_offs_position],0 |
1460 | je @f |
1471 | je @f |
1461 | dec dword[eax+sb_offs_position] |
1472 | dec dword[eax+sb_offs_position] |
1462 | mov dl,8 |
1473 | mov dl,8 |
1463 | jmp .ret_f |
1474 | jmp .ret_f |
1464 | @@: |
1475 | @@: |
1465 | mov dl,0 |
1476 | mov dl,0 |
1466 | .ret_f: |
1477 | .ret_f: |
1467 | pop eax |
1478 | pop eax |
1468 | ret |
1479 | ret |
1469 | 1480 | ||
1470 | ;input: |
1481 | ;input: |
1471 | ; edi = pointer to tedit struct |
1482 | ; edi = pointer to tedit struct |
1472 | ;output: |
1483 | ;output: |
1473 | ; dl = 0 not move |
1484 | ; dl = 0 not move |
1474 | ; dl = 2 if move down |
1485 | ; dl = 2 if move down |
1475 | ; dl = 8 if scroll move down |
1486 | ; dl = 8 if scroll move down |
1476 | align 4 |
1487 | align 4 |
1477 | ted_cur_move_down: |
1488 | ted_cur_move_down: |
1478 | push eax ebx |
1489 | push eax ebx |
1479 | mov ebx,ted_scr_w |
1490 | mov ebx,ted_scr_w |
1480 | mov dl,0 |
1491 | mov dl,0 |
1481 | mov eax,dword[ebx+sb_offs_cur_area] |
1492 | mov eax,dword[ebx+sb_offs_cur_area] |
1482 | dec eax |
1493 | dec eax |
1483 | cmp ted_cur_y,eax |
1494 | cmp ted_cur_y,eax |
1484 | jge @f |
1495 | jge @f |
1485 | inc ted_cur_y |
1496 | inc ted_cur_y |
1486 | mov dl,2 |
1497 | mov dl,2 |
1487 | jmp .ret_f |
1498 | jmp .ret_f |
1488 | @@: |
1499 | @@: |
1489 | mov eax,ted_cur_y |
1500 | mov eax,ted_cur_y |
1490 | add eax,dword[ebx+sb_offs_position] |
1501 | add eax,dword[ebx+sb_offs_position] |
1491 | inc eax |
1502 | inc eax |
1492 | cmp dword[ebx+sb_offs_max_area],eax |
1503 | cmp dword[ebx+sb_offs_max_area],eax |
1493 | jle @f |
1504 | jle @f |
1494 | inc dword[ebx+sb_offs_position] |
1505 | inc dword[ebx+sb_offs_position] |
1495 | mov dl,8 |
1506 | mov dl,8 |
1496 | @@: |
1507 | @@: |
1497 | .ret_f: |
1508 | .ret_f: |
1498 | pop ebx eax |
1509 | pop ebx eax |
1499 | ret |
1510 | ret |
1500 | 1511 | ||
1501 | 1512 | ||
1502 | ;input: |
1513 | ;input: |
1503 | ; edi = pointer to tedit struct |
1514 | ; edi = pointer to tedit struct |
1504 | ;output: |
1515 | ;output: |
1505 | ; dl = 0 not move |
1516 | ; dl = 0 not move |
1506 | ; dl = 1 if move up |
1517 | ; dl = 1 if move up |
1507 | align 4 |
1518 | align 4 |
1508 | ted_cur_move_page_up: |
1519 | ted_cur_move_page_up: |
1509 | push eax ebx |
1520 | push eax ebx |
1510 | mov ebx,ted_scr_w |
1521 | mov ebx,ted_scr_w |
1511 | mov eax,dword[ebx+sb_offs_cur_area] |
1522 | mov eax,dword[ebx+sb_offs_cur_area] |
1512 | xor dl,dl |
1523 | xor dl,dl |
1513 | cmp eax,dword[ebx+sb_offs_position] |
1524 | cmp eax,dword[ebx+sb_offs_position] |
1514 | jg @f |
1525 | jg @f |
1515 | sub dword[ebx+sb_offs_position],eax |
1526 | sub dword[ebx+sb_offs_position],eax |
1516 | mov dl,1 |
1527 | mov dl,1 |
1517 | @@: |
1528 | @@: |
1518 | cmp dword[ebx+sb_offs_position],0 |
1529 | cmp dword[ebx+sb_offs_position],0 |
1519 | je @f |
1530 | je @f |
1520 | cmp dl,1 |
1531 | cmp dl,1 |
1521 | je @f |
1532 | je @f |
1522 | mov dword[ebx+sb_offs_position],0 |
1533 | mov dword[ebx+sb_offs_position],0 |
1523 | mov dl,1 |
1534 | mov dl,1 |
1524 | @@: |
1535 | @@: |
1525 | pop ebx eax |
1536 | pop ebx eax |
1526 | ret |
1537 | ret |
1527 | 1538 | ||
1528 | ;input: |
1539 | ;input: |
1529 | ; edi = pointer to tedit struct |
1540 | ; edi = pointer to tedit struct |
1530 | align 4 |
1541 | align 4 |
1531 | ted_cur_move_page_down: |
1542 | ted_cur_move_page_down: |
1532 | push eax ebx ecx |
1543 | push eax ebx ecx |
1533 | mov ecx,ted_scr_w |
1544 | mov ecx,ted_scr_w |
1534 | 1545 | ||
1535 | xor dl,dl |
1546 | xor dl,dl |
1536 | mov eax,dword[ecx+sb_offs_max_area] |
1547 | mov eax,dword[ecx+sb_offs_max_area] |
1537 | sub eax,dword[ecx+sb_offs_cur_area] |
1548 | sub eax,dword[ecx+sb_offs_cur_area] |
1538 | cmp dword[ecx+sb_offs_position],eax |
1549 | cmp dword[ecx+sb_offs_position],eax |
1539 | jge @f |
1550 | jge @f |
1540 | mov ebx,dword[ecx+sb_offs_cur_area] |
1551 | mov ebx,dword[ecx+sb_offs_cur_area] |
1541 | add dword[ecx+sb_offs_position],ebx |
1552 | add dword[ecx+sb_offs_position],ebx |
1542 | mov dl,1 |
1553 | mov dl,1 |
1543 | mov dword[ecx+sb_offs_redraw],1 |
1554 | mov dword[ecx+sb_offs_redraw],1 |
1544 | cmp dword[ecx+sb_offs_position],eax |
1555 | cmp dword[ecx+sb_offs_position],eax |
1545 | jle @f |
1556 | jle @f |
1546 | mov dword[ecx+sb_offs_position],eax |
1557 | mov dword[ecx+sb_offs_position],eax |
1547 | @@: |
1558 | @@: |
1548 | pop ecx ebx eax |
1559 | pop ecx ebx eax |
1549 | ret |
1560 | ret |
1550 | 1561 | ||
1551 | ;input: |
1562 | ;input: |
1552 | ; edi = pointer to tedit struct |
1563 | ; edi = pointer to tedit struct |
1553 | ;output: |
1564 | ;output: |
1554 | ; dl = 0 not move |
1565 | ; dl = 0 not move |
1555 | ; dl = 1 if move left |
1566 | ; dl = 1 if move left |
1556 | ; dl = 3 if move left and up |
1567 | ; dl = 3 if move left and up |
1557 | ; dl = 8 if scroll move up |
1568 | ; dl = 8 if scroll move up |
1558 | align 4 |
1569 | align 4 |
1559 | ted_cur_move_left: |
1570 | ted_cur_move_left: |
1560 | cmp ted_cur_x,0 |
1571 | cmp ted_cur_x,0 |
1561 | je @f |
1572 | je @f |
1562 | dec ted_cur_x |
1573 | dec ted_cur_x |
1563 | mov dl,1 |
1574 | mov dl,1 |
1564 | ret |
1575 | ret |
1565 | @@: |
1576 | @@: |
1566 | push eax |
1577 | push eax |
1567 | mov eax,ted_scr_h |
1578 | mov eax,ted_scr_h |
1568 | cmp dword[eax+sb_offs_position],0 |
1579 | cmp dword[eax+sb_offs_position],0 |
1569 | je @f |
1580 | je @f |
1570 | dec dword[eax+sb_offs_position] |
1581 | dec dword[eax+sb_offs_position] |
1571 | mov dl,8 |
1582 | mov dl,8 |
1572 | jmp .ret_f |
1583 | jmp .ret_f |
1573 | @@: |
1584 | @@: |
1574 | cmp ted_cur_y,0 |
1585 | cmp ted_cur_y,0 |
1575 | jne @f |
1586 | jne @f |
1576 | mov eax,ted_scr_w |
1587 | mov eax,ted_scr_w |
1577 | mov dl,0 |
1588 | mov dl,0 |
1578 | cmp dword[eax+sb_offs_position],0 |
1589 | cmp dword[eax+sb_offs_position],0 |
1579 | je .ret_f |
1590 | je .ret_f |
1580 | dec dword[eax+sb_offs_position] |
1591 | dec dword[eax+sb_offs_position] |
1581 | call ted_scroll_set_redraw |
1592 | call ted_scroll_set_redraw |
1582 | call ted_cur_move_x_last_char |
1593 | call ted_cur_move_x_last_char |
1583 | mov dl,8 |
1594 | mov dl,8 |
1584 | jmp .ret_f |
1595 | jmp .ret_f |
1585 | @@: |
1596 | @@: |
1586 | cmp ted_cur_y,0 |
1597 | cmp ted_cur_y,0 |
1587 | je @f |
1598 | je @f |
1588 | dec ted_cur_y |
1599 | dec ted_cur_y |
1589 | call ted_cur_move_x_last_char |
1600 | call ted_cur_move_x_last_char |
1590 | cmp dl,8 |
1601 | cmp dl,8 |
1591 | je .ret_f |
1602 | je .ret_f |
1592 | mov dl,3 |
1603 | mov dl,3 |
1593 | jmp .ret_f |
1604 | jmp .ret_f |
1594 | @@: |
1605 | @@: |
1595 | mov dl,0 |
1606 | mov dl,0 |
1596 | .ret_f: |
1607 | .ret_f: |
1597 | pop eax |
1608 | pop eax |
1598 | ret |
1609 | ret |
1599 | 1610 | ||
1600 | ;input: |
1611 | ;input: |
1601 | ; edi = pointer to tedit struct |
1612 | ; edi = pointer to tedit struct |
1602 | align 4 |
1613 | align 4 |
1603 | ted_cur_move_right: |
1614 | ted_cur_move_right: |
1604 | push eax ebx |
1615 | push eax ebx |
1605 | mov eax,ted_scr_h |
1616 | mov eax,ted_scr_h |
1606 | xor dl,dl |
1617 | xor dl,dl |
1607 | mov ebx,dword[eax+sb_offs_cur_area] |
1618 | mov ebx,dword[eax+sb_offs_cur_area] |
1608 | cmp ted_cur_x,ebx |
1619 | cmp ted_cur_x,ebx |
1609 | jge @f |
1620 | jge @f |
1610 | inc ted_cur_x |
1621 | inc ted_cur_x |
1611 | mov dl,1 |
1622 | mov dl,1 |
1612 | jmp .ret_f |
1623 | jmp .ret_f |
1613 | @@: |
1624 | @@: |
1614 | inc dword[eax+sb_offs_position] |
1625 | inc dword[eax+sb_offs_position] |
1615 | mov dl,8 |
1626 | mov dl,8 |
1616 | .ret_f: |
1627 | .ret_f: |
1617 | pop ebx eax |
1628 | pop ebx eax |
1618 | ret |
1629 | ret |
1619 | 1630 | ||
1620 | ;input: |
1631 | ;input: |
1621 | ; edi = pointer to tedit struct |
1632 | ; edi = pointer to tedit struct |
1622 | align 4 |
1633 | align 4 |
1623 | ted_cur_move_x_last_char: |
1634 | ted_cur_move_x_last_char: |
1624 | ;[hScr.position] |
1635 | ;[hScr.position] |
1625 | ;[hScr.cur_area] |
1636 | ;[hScr.cur_area] |
1626 | ;dl-??? |
1637 | ;dl-??? |
1627 | push eax ebx ecx |
1638 | push eax ebx ecx |
1628 | mov eax,ted_cur_y |
1639 | mov eax,ted_cur_y |
1629 | mov ecx,ted_scr_w |
1640 | mov ecx,ted_scr_w |
1630 | add eax,dword[ecx+sb_offs_position] |
1641 | add eax,dword[ecx+sb_offs_position] |
1631 | call ted_strlen |
1642 | call ted_strlen |
1632 | xor dl,dl |
1643 | xor dl,dl |
1633 | 1644 | ||
1634 | mov ecx,ted_scr_h |
1645 | mov ecx,ted_scr_h |
1635 | cmp ebx,dword[ecx+sb_offs_position] |
1646 | cmp ebx,dword[ecx+sb_offs_position] |
1636 | jge @f |
1647 | jge @f |
1637 | mov dl,8 |
1648 | mov dl,8 |
1638 | mov dword[ecx+sb_offs_position],ebx |
1649 | mov dword[ecx+sb_offs_position],ebx |
1639 | @@: |
1650 | @@: |
1640 | sub ebx,dword[ecx+sb_offs_position] |
1651 | sub ebx,dword[ecx+sb_offs_position] |
1641 | 1652 | ||
1642 | cmp ebx,dword[ecx+sb_offs_cur_area] |
1653 | cmp ebx,dword[ecx+sb_offs_cur_area] |
1643 | jle @f ; b---[---]---e |
1654 | jle @f ; b---[---]---e |
1644 | add dword[ecx+sb_offs_position],ebx |
1655 | add dword[ecx+sb_offs_position],ebx |
1645 | mov ebx,dword[ecx+sb_offs_cur_area] |
1656 | mov ebx,dword[ecx+sb_offs_cur_area] |
1646 | sub dword[ecx+sb_offs_position],ebx |
1657 | sub dword[ecx+sb_offs_position],ebx |
1647 | mov dl,8 |
1658 | mov dl,8 |
1648 | @@: |
1659 | @@: |
1649 | mov ted_cur_x,ebx |
1660 | mov ted_cur_x,ebx |
1650 | pop ecx ebx eax |
1661 | pop ecx ebx eax |
1651 | ret |
1662 | ret |
1652 | 1663 | ||
1653 | ;input: |
1664 | ;input: |
1654 | ; edi = pointer to tedit struct |
1665 | ; edi = pointer to tedit struct |
1655 | ;output: |
1666 | ;output: |
1656 | ; dl = 0 not move |
1667 | ; dl = 0 not move |
1657 | ; dl = 1 move cursor |
1668 | ; dl = 1 move cursor |
1658 | ; dl = 8 move cursor and scroll |
1669 | ; dl = 8 move cursor and scroll |
1659 | align 4 |
1670 | align 4 |
1660 | ted_cur_move_x_first_char: |
1671 | ted_cur_move_x_first_char: |
1661 | xor dl,dl |
1672 | xor dl,dl |
1662 | cmp ted_cur_x,0 |
1673 | cmp ted_cur_x,0 |
1663 | je @f |
1674 | je @f |
1664 | mov ted_cur_x,0 |
1675 | mov ted_cur_x,0 |
1665 | mov dl,1 |
1676 | mov dl,1 |
1666 | @@: |
1677 | @@: |
1667 | push eax |
1678 | push eax |
1668 | mov eax,ted_scr_h |
1679 | mov eax,ted_scr_h |
1669 | cmp dword[eax+sb_offs_position],0 |
1680 | cmp dword[eax+sb_offs_position],0 |
1670 | je @f |
1681 | je @f |
1671 | mov dword[eax+sb_offs_position],0 |
1682 | mov dword[eax+sb_offs_position],0 |
1672 | mov dl,8 |
1683 | mov dl,8 |
1673 | @@: |
1684 | @@: |
1674 | pop eax |
1685 | pop eax |
1675 | ret |
1686 | ret |
1676 | 1687 | ||
1677 | ;input: |
1688 | ;input: |
1678 | ; edx = pointer to symbol struct |
1689 | ; edx = pointer to symbol struct |
1679 | ; edi = pointer to tedit struct |
1690 | ; edi = pointer to tedit struct |
1680 | ;output: |
1691 | ;output: |
1681 | ; eax = array index |
1692 | ; eax = array index |
1682 | align 4 |
1693 | align 4 |
1683 | ted_get_text_arr_index: |
1694 | ted_get_text_arr_index: |
1684 | push ecx edx |
1695 | push ecx edx |
1685 | mov eax,edx |
1696 | mov eax,edx |
1686 | sub eax,ted_tex |
1697 | sub eax,ted_tex |
1687 | xor edx,edx |
1698 | xor edx,edx |
1688 | mov ecx,sizeof.symbol |
1699 | mov ecx,sizeof.symbol |
1689 | div ecx |
1700 | div ecx |
1690 | pop edx ecx |
1701 | pop edx ecx |
1691 | ret |
1702 | ret |
1692 | 1703 | ||
1693 | ;input: |
1704 | ;input: |
1694 | ; edx = pointer to symbol struct |
1705 | ; edx = pointer to symbol struct |
1695 | ; edi = pointer to tedit struct |
1706 | ; edi = pointer to tedit struct |
1696 | ;output: |
1707 | ;output: |
1697 | ; edx = pointer to 'perv' struct |
1708 | ; edx = pointer to 'perv' struct |
1698 | align 4 |
1709 | align 4 |
1699 | ted_get_text_perv_pos: |
1710 | ted_get_text_perv_pos: |
1700 | mov edx,dword[edx+2] |
1711 | mov edx,dword[edx+2] |
1701 | imul edx,sizeof.symbol |
1712 | imul edx,sizeof.symbol |
1702 | add edx,ted_tex |
1713 | add edx,ted_tex |
1703 | ret |
1714 | ret |
1704 | 1715 | ||
1705 | ;input: |
1716 | ;input: |
1706 | ; edx = pointer to symbol struct |
1717 | ; edx = pointer to symbol struct |
1707 | ;output: |
1718 | ;output: |
1708 | ; edx = pointer to 'next' symbol struct |
1719 | ; edx = pointer to 'next' symbol struct |
1709 | align 4 |
1720 | align 4 |
1710 | ted_get_text_next_pos: |
1721 | ted_get_text_next_pos: |
1711 | mov edx,dword[edx+6] |
1722 | mov edx,dword[edx+6] |
1712 | imul edx,sizeof.symbol |
1723 | imul edx,sizeof.symbol |
1713 | add edx,ted_tex |
1724 | add edx,ted_tex |
1714 | ret |
1725 | ret |
1715 | 1726 | ||
1716 | ;input: |
1727 | ;input: |
1717 | ; edi = pointer to tedit struct |
1728 | ; edi = pointer to tedit struct |
1718 | ;output: |
1729 | ;output: |
1719 | ; edx = symbol under cursor |
1730 | ; edx = symbol under cursor |
1720 | ; ted_gp_opt = 1,2 |
1731 | ; ted_gp_opt = 1,2 |
1721 | ; edx = tex[1].perv if error |
1732 | ; edx = tex[1].perv if error |
1722 | ; ted_gp_opt = 0 |
1733 | ; ted_gp_opt = 0 |
1723 | align 4 |
1734 | align 4 |
1724 | ted_get_pos_by_cursor: |
1735 | ted_get_pos_by_cursor: |
1725 | push eax ecx esi |
1736 | push eax ecx esi |
1726 | mov esi,ted_cur_x |
1737 | mov esi,ted_cur_x |
1727 | mov eax,ted_scr_h |
1738 | mov eax,ted_scr_h |
1728 | add esi,dword[eax+sb_offs_position] |
1739 | add esi,dword[eax+sb_offs_position] |
1729 | mov ecx,ted_cur_y |
1740 | mov ecx,ted_cur_y |
1730 | mov eax,ted_scr_w |
1741 | mov eax,ted_scr_w |
1731 | add ecx,dword[eax+sb_offs_position] |
1742 | add ecx,dword[eax+sb_offs_position] |
1732 | call ted_get_pos_by_coords |
1743 | call ted_get_pos_by_coords |
1733 | pop esi ecx eax |
1744 | pop esi ecx eax |
1734 | ret |
1745 | ret |
1735 | 1746 | ||
1736 | ;input: |
1747 | ;input: |
1737 | ; esi = XPos |
1748 | ; esi = XPos |
1738 | ; ecx = YPos |
1749 | ; ecx = YPos |
1739 | ; edi = pointer to tedit struct |
1750 | ; edi = pointer to tedit struct |
1740 | ;output: |
1751 | ;output: |
1741 | ; edx = symbol under cursor |
1752 | ; edx = symbol under cursor |
1742 | ; ted_gp_opt = 1 if found text line |
1753 | ; ted_gp_opt = 1 if found text line |
1743 | ; ted_gp_opt = 2 if found text line and column |
1754 | ; ted_gp_opt = 2 if found text line and column |
1744 | ; edx = tex[1] if error |
1755 | ; edx = tex[1] if error |
1745 | ; ted_gp_opt = 0 if text no found |
1756 | ; ted_gp_opt = 0 if text no found |
1746 | align 4 |
1757 | align 4 |
1747 | ted_get_pos_by_coords: |
1758 | ted_get_pos_by_coords: |
1748 | push eax ;Row |
1759 | push eax ;Row |
1749 | push ebx ;Col |
1760 | push ebx ;Col |
1750 | 1761 | ||
1751 | xor eax,eax |
1762 | xor eax,eax |
1752 | xor ebx,ebx |
1763 | xor ebx,ebx |
1753 | mov ted_gp_opt,0 |
1764 | mov ted_gp_opt,0 |
1754 | mov edx,ted_tex |
1765 | mov edx,ted_tex |
1755 | @@: |
1766 | @@: |
1756 | call ted_iterat_next |
1767 | call ted_iterat_next |
1757 | cmp edx,ted_tex_1 |
1768 | cmp edx,ted_tex_1 |
1758 | jle @f |
1769 | jle @f |
1759 | cmp ebx,esi |
1770 | cmp ebx,esi |
1760 | jne .u1_0 ;Col <> ted_cur_x |
1771 | jne .u1_0 ;Col <> ted_cur_x |
1761 | mov ted_gp_opt,1 |
1772 | mov ted_gp_opt,1 |
1762 | cmp eax,ecx |
1773 | cmp eax,ecx |
1763 | jge @f ; Row >= ted_cur_y |
1774 | jge @f ; Row >= ted_cur_y |
1764 | .u1_0: |
1775 | .u1_0: |
1765 | mov ted_gp_opt,0 |
1776 | mov ted_gp_opt,0 |
1766 | inc ebx |
1777 | inc ebx |
1767 | cmp byte [edx],13 |
1778 | cmp byte [edx],13 |
1768 | jne @b |
1779 | jne @b |
1769 | cmp eax,ecx |
1780 | cmp eax,ecx |
1770 | jge @f ; Row >= ted_cur_y |
1781 | jge @f ; Row >= ted_cur_y |
1771 | inc eax |
1782 | inc eax |
1772 | xor ebx,ebx |
1783 | xor ebx,ebx |
1773 | jmp @b |
1784 | jmp @b |
1774 | @@: |
1785 | @@: |
1775 | cmp eax,ecx |
1786 | cmp eax,ecx |
1776 | jne @f ; Row = ted_cur_y |
1787 | jne @f ; Row = ted_cur_y |
1777 | inc ted_gp_opt |
1788 | inc ted_gp_opt |
1778 | @@: |
1789 | @@: |
1779 | cmp ted_gp_opt,0 |
1790 | cmp ted_gp_opt,0 |
1780 | jne @f |
1791 | jne @f |
1781 | mov edx,ted_tex_1 |
1792 | mov edx,ted_tex_1 |
1782 | ;call ted_get_text_perv_pos |
1793 | ;call ted_get_text_perv_pos |
1783 | @@: |
1794 | @@: |
1784 | pop ebx eax |
1795 | pop ebx eax |
1785 | ret |
1796 | ret |
1786 | 1797 | ||
1787 | 1798 | ||
1788 | ;input: |
1799 | ;input: |
1789 | ; eax = Row |
1800 | ; eax = Row |
1790 | ; edi = pointer to tedit struct |
1801 | ; edi = pointer to tedit struct |
1791 | ;output: |
1802 | ;output: |
1792 | ; ebx = str len |
1803 | ; ebx = str len |
1793 | align 4 |
1804 | align 4 |
1794 | ted_strlen: |
1805 | ted_strlen: |
1795 | push edx ecx |
1806 | push edx ecx |
1796 | ;ecx = Row, from cycle |
1807 | ;ecx = Row, from cycle |
1797 | 1808 | ||
1798 | xor ebx,ebx |
1809 | xor ebx,ebx |
1799 | xor ecx,ecx |
1810 | xor ecx,ecx |
1800 | mov edx,ted_tex |
1811 | mov edx,ted_tex |
1801 | @@: |
1812 | @@: |
1802 | call ted_iterat_next |
1813 | call ted_iterat_next |
1803 | cmp edx,ted_tex_1 |
1814 | cmp edx,ted_tex_1 |
1804 | jle @f |
1815 | jle @f |
1805 | inc ebx |
1816 | inc ebx |
1806 | cmp byte [edx],13 |
1817 | cmp byte [edx],13 |
1807 | jne @b |
1818 | jne @b |
1808 | dec ebx ;lenght minus 1 sumbol to paragraph |
1819 | dec ebx ;lenght minus 1 sumbol to paragraph |
1809 | cmp eax,ecx |
1820 | cmp eax,ecx |
1810 | je @f |
1821 | je @f |
1811 | xor ebx,ebx |
1822 | xor ebx,ebx |
1812 | inc ecx |
1823 | inc ecx |
1813 | jmp @b |
1824 | jmp @b |
1814 | @@: |
1825 | @@: |
1815 | 1826 | ||
1816 | cmp eax,ecx |
1827 | cmp eax,ecx |
1817 | je @f |
1828 | je @f |
1818 | xor ebx,ebx |
1829 | xor ebx,ebx |
1819 | @@: |
1830 | @@: |
1820 | 1831 | ||
1821 | pop ecx edx |
1832 | pop ecx edx |
1822 | ret |
1833 | ret |
1823 | 1834 | ||
1824 | 1835 | ||
1825 | ;input: |
1836 | ;input: |
1826 | ; edx = symbol position |
1837 | ; edx = symbol position |
1827 | ; edi = pointer to tedit struct |
1838 | ; edi = pointer to tedit struct |
1828 | ;output: |
1839 | ;output: |
1829 | ; eax = number of line |
1840 | ; eax = number of line |
1830 | ; ebx = symbol position in line |
1841 | ; ebx = symbol position in line |
1831 | align 4 |
1842 | align 4 |
1832 | ted_get_text_coords: |
1843 | ted_get_text_coords: |
1833 | push edx |
1844 | push edx |
1834 | xor eax,eax |
1845 | xor eax,eax |
1835 | xor ebx,ebx |
1846 | xor ebx,ebx |
1836 | @@: |
1847 | @@: |
1837 | call ted_iterat_perv |
1848 | call ted_iterat_perv |
1838 | 1849 | ||
1839 | cmp eax,0 |
1850 | cmp eax,0 |
1840 | jne .no_col_mov |
1851 | jne .no_col_mov |
1841 | inc ebx |
1852 | inc ebx |
1842 | .no_col_mov: |
1853 | .no_col_mov: |
1843 | 1854 | ||
1844 | cmp edx,ted_tex_1 |
1855 | cmp edx,ted_tex_1 |
1845 | jle @f |
1856 | jle @f |
1846 | cmp byte [edx],13 |
1857 | cmp byte [edx],13 |
1847 | jne @b |
1858 | jne @b |
1848 | inc eax |
1859 | inc eax |
1849 | jmp @b |
1860 | jmp @b |
1850 | @@: |
1861 | @@: |
1851 | dec ebx |
1862 | dec ebx |
1852 | pop edx |
1863 | pop edx |
1853 | ret |
1864 | ret |
1854 | 1865 | ||
1855 | ;input: |
1866 | ;input: |
1856 | ; edi = pointer to tedit struct |
1867 | ; edi = pointer to tedit struct |
1857 | ;output: |
1868 | ;output: |
1858 | ; eax = num lines |
1869 | ; eax = num lines |
1859 | align 4 |
1870 | align 4 |
1860 | ted_get_num_lines: |
1871 | ted_get_num_lines: |
1861 | push edx |
1872 | push edx |
1862 | mov eax,1 |
1873 | mov eax,1 |
1863 | mov edx,ted_tex |
1874 | mov edx,ted_tex |
1864 | @@: |
1875 | @@: |
1865 | call ted_iterat_next |
1876 | call ted_iterat_next |
1866 | cmp edx,ted_tex_1 |
1877 | cmp edx,ted_tex_1 |
1867 | jle @f |
1878 | jle @f |
1868 | cmp byte [edx],13 |
1879 | cmp byte [edx],13 |
1869 | jne @b |
1880 | jne @b |
1870 | inc eax |
1881 | inc eax |
1871 | jmp @b |
1882 | jmp @b |
1872 | @@: |
1883 | @@: |
1873 | ;... |
1884 | ;... |
1874 | ;dec eax |
1885 | ;dec eax |
1875 | pop edx |
1886 | pop edx |
1876 | ret |
1887 | ret |
1877 | 1888 | ||
1878 | 1889 | ||
1879 | ;input: |
1890 | ;input: |
1880 | ; edi = pointer to tedit struct |
1891 | ; edi = pointer to tedit struct |
1881 | ;description: |
1892 | ;description: |
1882 | ; ®â¬¥ï¥â ®â¬¥¥ë¥ ¤¥©á⢨ï, ¯¥à¥¤ ¨§¬¥¥¨¥¬ ¤®ªã¬¥â |
1893 | ; ®â¬¥ï¥â ®â¬¥¥ë¥ ¤¥©á⢨ï, ¯¥à¥¤ ¨§¬¥¥¨¥¬ ¤®ªã¬¥â |
1883 | align 4 |
1894 | align 4 |
1884 | proc ted_set_undo |
1895 | proc ted_set_undo |
1885 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
1896 | mov ted_drag_k,0 ;§ ª 稢 ¥¬ ¢ë¤¥«¥¨¥ ®â ª« ¢¨ âãàë |
1886 | cmp ted_tim_undo,1 |
1897 | cmp ted_tim_undo,1 |
1887 | jl .no_work |
1898 | jl .no_work |
1888 | 1899 | ||
1889 | push eax ebx edx |
1900 | push eax ebx edx |
1890 | mov edx,ted_tex |
1901 | mov edx,ted_tex |
1891 | call ted_get_text_next_pos ;long i=tex[0].next; |
1902 | call ted_get_text_next_pos ;long i=tex[0].next; |
1892 | mov eax,ted_tim_undo |
1903 | mov eax,ted_tim_undo |
1893 | sub ted_tim_ch,eax ;ted_tim_ch-=ted_tim_undo; |
1904 | sub ted_tim_ch,eax ;ted_tim_ch-=ted_tim_undo; |
1894 | mov eax,ted_tim_ch |
1905 | mov eax,ted_tim_ch |
1895 | cmp ted_tim_ls,eax ;if(ted_tim_ls>ted_tim_ch) |
1906 | cmp ted_tim_ls,eax ;if(ted_tim_ls>ted_tim_ch) |
1896 | jle @f |
1907 | jle @f |
1897 | mov ted_tim_ls,0 |
1908 | mov ted_tim_ls,0 |
1898 | @@: |
1909 | @@: |
1899 | cmp edx,ted_tex |
1910 | cmp edx,ted_tex |
1900 | je @f |
1911 | je @f |
1901 | 1912 | ||
1902 | ;if(tex[i].tc>ted_tim_ch){ // ¥á«¨ ᮧ¤ ¨¥ ᨬ¢®« ¡ë«® ®â¬¥¥® |
1913 | ;if(tex[i].tc>ted_tim_ch){ // ¥á«¨ ᮧ¤ ¨¥ ᨬ¢®« ¡ë«® ®â¬¥¥® |
1903 | cmp [edx+10],eax |
1914 | cmp [edx+10],eax |
1904 | jle .no_u1 |
1915 | jle .no_u1 |
1905 | mov dword [edx+10],0 |
1916 | mov dword [edx+10],0 |
1906 | mov dword [edx+14],0 |
1917 | mov dword [edx+14],0 |
1907 | 1918 | ||
1908 | mov ebx,[edx+2] |
1919 | mov ebx,[edx+2] |
1909 | imul ebx,sizeof.symbol |
1920 | imul ebx,sizeof.symbol |
1910 | add ebx,ted_tex;.next |
1921 | add ebx,ted_tex;.next |
1911 | m2m dword [ebx+6],dword [edx+6] ;tex[tex[i].perv].next=tex[i].next; |
1922 | m2m dword [ebx+6],dword [edx+6] ;tex[tex[i].perv].next=tex[i].next; |
1912 | 1923 | ||
1913 | mov ebx,[edx+6] |
1924 | mov ebx,[edx+6] |
1914 | imul ebx,sizeof.symbol |
1925 | imul ebx,sizeof.symbol |
1915 | add ebx,ted_tex;.perv |
1926 | add ebx,ted_tex;.perv |
1916 | m2m dword [ebx+2],dword [edx+2] ;tex[tex[i].next].perv=tex[i].perv; |
1927 | m2m dword [ebx+2],dword [edx+2] ;tex[tex[i].next].perv=tex[i].perv; |
1917 | 1928 | ||
1918 | .no_u1: |
1929 | .no_u1: |
1919 | 1930 | ||
1920 | ;else if(tex[i].td>ted_tim_ch) tex[i].td=0; // ¥á«¨ 㤠«¥¨¥ ᨬ¢®« ¡ë«® ®â¬¥¥® |
1931 | ;else if(tex[i].td>ted_tim_ch) tex[i].td=0; // ¥á«¨ 㤠«¥¨¥ ᨬ¢®« ¡ë«® ®â¬¥¥® |
1921 | cmp [edx+14],eax |
1932 | cmp [edx+14],eax |
1922 | jle .no_u2 |
1933 | jle .no_u2 |
1923 | mov dword [edx+14],0 |
1934 | mov dword [edx+14],0 |
1924 | .no_u2: |
1935 | .no_u2: |
1925 | 1936 | ||
1926 | call ted_get_text_next_pos |
1937 | call ted_get_text_next_pos |
1927 | jmp @b |
1938 | jmp @b |
1928 | @@: |
1939 | @@: |
1929 | mov ted_tim_undo,0 |
1940 | mov ted_tim_undo,0 |
1930 | mov eax,ted_tim_co |
1941 | mov eax,ted_tim_co |
1931 | cmp ted_tim_ch,eax |
1942 | cmp ted_tim_ch,eax |
1932 | jge @f |
1943 | jge @f |
1933 | mov ted_tim_co,0 |
1944 | mov ted_tim_co,0 |
1934 | @@: |
1945 | @@: |
1935 | pop edx ebx eax |
1946 | pop edx ebx eax |
1936 | .no_work: |
1947 | .no_work: |
1937 | ret |
1948 | ret |
1938 | endp |
1949 | endp |
1939 | 1950 | ||
1940 | ;input: |
1951 | ;input: |
1941 | ; ecx = Col |
1952 | ; ecx = Col |
1942 | ; edx = Row |
1953 | ; edx = Row |
1943 | ; edi = pointer to tedit struct |
1954 | ; edi = pointer to tedit struct |
1944 | align 4 |
1955 | align 4 |
1945 | ted_go_to_pos: |
1956 | ted_go_to_pos: |
1946 | push eax |
1957 | push eax |
1947 | mov eax,ted_scr_w |
1958 | mov eax,ted_scr_w |
1948 | mov ted_cur_x,ecx |
1959 | mov ted_cur_x,ecx |
1949 | sub edx,dword[eax+sb_offs_position] |
1960 | sub edx,dword[eax+sb_offs_position] |
1950 | 1961 | ||
1951 | cmp edx,dword[eax+sb_offs_cur_area] ;ted_cur_y > [.cur_area] |
1962 | cmp edx,dword[eax+sb_offs_cur_area] ;ted_cur_y > [.cur_area] |
1952 | jl @f |
1963 | jl @f |
1953 | push ebx |
1964 | push ebx |
1954 | mov ebx,edx |
1965 | mov ebx,edx |
1955 | sub ebx,dword[eax+sb_offs_cur_area] |
1966 | sub ebx,dword[eax+sb_offs_cur_area] |
1956 | inc ebx |
1967 | inc ebx |
1957 | add dword[eax+sb_offs_position],ebx |
1968 | add dword[eax+sb_offs_position],ebx |
1958 | sub edx,ebx |
1969 | sub edx,ebx |
1959 | pop ebx |
1970 | pop ebx |
1960 | ; ??? redrav |
1971 | ; ??? redrav |
1961 | @@: |
1972 | @@: |
1962 | mov ted_cur_y,edx |
1973 | mov ted_cur_y,edx |
1963 | pop eax |
1974 | pop eax |
1964 | ret |
1975 | ret |
1965 | 1976 | ||
1966 | ;input: |
1977 | ;input: |
1967 | ; edi = pointer to tedit struct |
1978 | ; edi = pointer to tedit struct |
1968 | align 4 |
1979 | align 4 |
1969 | ted_text_colored: |
1980 | ted_text_colored: |
1970 | push eax edx |
1981 | push eax edx |
1971 | mov eax,ted_tim_ch |
1982 | mov eax,ted_tim_ch |
1972 | sub eax,ted_tim_undo |
1983 | sub eax,ted_tim_undo |
1973 | mov ted_tim_co,eax |
1984 | mov ted_tim_co,eax |
1974 | mov edx,ted_tex |
1985 | mov edx,ted_tex |
1975 | @@: |
1986 | @@: |
1976 | call ted_iterat_next |
1987 | call ted_iterat_next |
1977 | cmp edx,ted_tex_1 |
1988 | cmp edx,ted_tex_1 |
1978 | jle @f |
1989 | jle @f |
1979 | mov byte[edx+1],0 |
1990 | mov byte[edx+1],0 |
1980 | jmp @b |
1991 | jmp @b |
1981 | @@: |
1992 | @@: |
1982 | 1993 | ||
1983 | cmp ted_key_words_count,1 |
1994 | cmp ted_key_words_count,1 |
1984 | jl .no_colors |
1995 | jl .no_colors |
1985 | mov edx,ted_tex |
1996 | mov edx,ted_tex |
1986 | @@: |
1997 | @@: |
1987 | call ted_text_find_sel_color |
1998 | call ted_text_find_sel_color |
1988 | cmp edx,ted_tex_1 |
1999 | cmp edx,ted_tex_1 |
1989 | jle .no_colors |
2000 | jle .no_colors |
1990 | jmp @b |
2001 | jmp @b |
1991 | .no_colors: |
2002 | .no_colors: |
1992 | pop edx eax |
2003 | pop edx eax |
1993 | ret |
2004 | ret |
1994 | 2005 | ||
1995 | 2006 | ||
1996 | ;input: |
2007 | ;input: |
1997 | ; edx = pointer to start symbol |
2008 | ; edx = pointer to start symbol |
1998 | ; edi = pointer to tedit struct |
2009 | ; edi = pointer to tedit struct |
1999 | ;output: |
2010 | ;output: |
2000 | ; edx = pointer to next symbol |
2011 | ; edx = pointer to next symbol |
2001 | ;description: |
2012 | ;description: |
2002 | ; ãªæ¨ï ¤«ï ¯®¨áª ¨ ¢ë¤¥«¥¨ï ¯®¤á¢¥ç¥ëå á«®¢ |
2013 | ; ãªæ¨ï ¤«ï ¯®¨áª ¨ ¢ë¤¥«¥¨ï ¯®¤á¢¥ç¥ëå á«®¢ |
2003 | align 4 |
2014 | align 4 |
2004 | proc ted_text_find_sel_color |
2015 | proc ted_text_find_sel_color |
2005 | locals |
2016 | locals |
2006 | begPos dd ? ; ç «ì ï ¯®§¨æ¨ï |
2017 | begPos dd ? ; ç «ì ï ¯®§¨æ¨ï |
2007 | endPos dd ? ;ª®¥ç ï ¯®§¨æ¨ï |
2018 | endPos dd ? ;ª®¥ç ï ¯®§¨æ¨ï |
2008 | find db ? ; ©¤¥® / ¥ ©¤¥® |
2019 | find db ? ; ©¤¥® / ¥ ©¤¥® |
2009 | f_color db ? ;¨¤¥ªá 梥⠩¤¥®£® á«®¢ |
2020 | f_color db ? ;¨¤¥ªá 梥⠩¤¥®£® á«®¢ |
2010 | endl |
2021 | endl |
2011 | push eax ebx ecx esi |
2022 | push eax ebx ecx esi |
2012 | ;eax = word_n ⥪ã騩 ®¬¥à (¯®§¨æ¨ï) ¯à®¢¥à塞®£® á«®¢ ¢ ᯨ᪥ |
2023 | ;eax = word_n ⥪ã騩 ®¬¥à (¯®§¨æ¨ï) ¯à®¢¥à塞®£® á«®¢ ¢ ᯨ᪥ |
2013 | ;ebx = ¤«ï à §ëå 楫¥© |
2024 | ;ebx = ¤«ï à §ëå 楫¥© |
2014 | ;ecx = l_pos ¯®á«¥¤¨© ®¬¥à (¯®§¨æ¨ï) ¯®¤å®¤ï饣® á«®¢ ¢ ᯨ᪥ |
2025 | ;ecx = l_pos ¯®á«¥¤¨© ®¬¥à (¯®§¨æ¨ï) ¯®¤å®¤ï饣® á«®¢ ¢ ᯨ᪥ |
2015 | ;esi = ¤«ï à §ëå 楫¥©, ®¬¥à ¯à®¢¥à塞®£® ᨬ¢®« ¢ á«®¢¥ |
2026 | ;esi = ¤«ï à §ëå 楫¥©, ®¬¥à ¯à®¢¥à塞®£® ᨬ¢®« ¢ á«®¢¥ |
2016 | mov dword[begPos],1 |
2027 | mov dword[begPos],1 |
2017 | mov dword[endPos],1 |
2028 | mov dword[endPos],1 |
2018 | mov byte[find],0 |
2029 | mov byte[find],0 |
2019 | mov byte[f_color],1 |
2030 | mov byte[f_color],1 |
2020 | @@: |
2031 | @@: |
2021 | call ted_iterat_next |
2032 | call ted_iterat_next |
2022 | cmp edx,ted_tex_1 |
2033 | cmp edx,ted_tex_1 |
2023 | jle @f |
2034 | jle @f |
2024 | 2035 | ||
2025 | xor eax,eax |
2036 | xor eax,eax |
2026 | mov al,byte[edx] |
2037 | mov al,byte[edx] |
2027 | shl ax,2 ;eax*=4 |
2038 | shl ax,2 ;eax*=4 |
2028 | add eax,ted_arr_key_pos |
2039 | add eax,ted_arr_key_pos |
2029 | mov eax,dword[eax] |
2040 | mov eax,dword[eax] |
2030 | cmp eax,0 |
2041 | cmp eax,0 |
2031 | jl @b ;if( (word_n=ted_arr_key_pos[(unsigned char)tex[i].c])>-1 ){ |
2042 | jl @b ;if( (word_n=ted_arr_key_pos[(unsigned char)tex[i].c])>-1 ){ |
2032 | 2043 | ||
2033 | mov ecx,eax |
2044 | mov ecx,eax |
2034 | ;while(l_pos |
2045 | ;while(l_pos |
2035 | .wh_1b: |
2046 | .wh_1b: |
2036 | cmp ecx,ted_key_words_count |
2047 | cmp ecx,ted_key_words_count |
2037 | jge .wh_1e |
2048 | jge .wh_1e |
2038 | ColToIndexOffset ecx,esi |
2049 | ColToIndexOffset ecx,esi |
2039 | mov bl,byte[esi] |
2050 | mov bl,byte[esi] |
2040 | ColToIndexOffset eax,esi |
2051 | ColToIndexOffset eax,esi |
2041 | cmp bl,byte[esi] |
2052 | cmp bl,byte[esi] |
2042 | jne .wh_1e |
2053 | jne .wh_1e |
2043 | inc ecx |
2054 | inc ecx |
2044 | jmp .wh_1b |
2055 | jmp .wh_1b |
2045 | .wh_1e: |
2056 | .wh_1e: |
2046 | 2057 | ||
2047 | mov dword[begPos],edx ;bP=i; |
2058 | mov dword[begPos],edx ;bP=i; |
2048 | mov esi,1 |
2059 | mov esi,1 |
2049 | 2060 | ||
2050 | .wh_2b: ;while(1){ |
2061 | .wh_2b: ;while(1){ |
2051 | call ted_iterat_next |
2062 | call ted_iterat_next |
2052 | 2063 | ||
2053 | ;while(l_pos>word_n && Col[l_pos-1].Text[pos]!=tex[i].c) |
2064 | ;while(l_pos>word_n && Col[l_pos-1].Text[pos]!=tex[i].c) |
2054 | .wh_3b: |
2065 | .wh_3b: |
2055 | cmp ecx,eax |
2066 | cmp ecx,eax |
2056 | jle .wh_3e |
2067 | jle .wh_3e |
2057 | dec ecx |
2068 | dec ecx |
2058 | ColToIndexOffset ecx,ebx |
2069 | ColToIndexOffset ecx,ebx |
2059 | inc ecx |
2070 | inc ecx |
2060 | ;cmp byte[ebx+esi],byte[edx] |
2071 | ;cmp byte[ebx+esi],byte[edx] |
2061 | mov bl,byte[ebx+esi] |
2072 | mov bl,byte[ebx+esi] |
2062 | cmp bl,byte[edx] |
2073 | cmp bl,byte[edx] |
2063 | je .wh_3e |
2074 | je .wh_3e |
2064 | dec ecx |
2075 | dec ecx |
2065 | jmp .wh_3b |
2076 | jmp .wh_3b |
2066 | .wh_3e: |
2077 | .wh_3e: |
2067 | 2078 | ||
2068 | ColToIndexOffset eax,ebx |
2079 | ColToIndexOffset eax,ebx |
2069 | cmp byte[ebx+esi],0 |
2080 | cmp byte[ebx+esi],0 |
2070 | jne .if_0 ;if(Col[word_n].Text[pos]==0){ |
2081 | jne .if_0 ;if(Col[word_n].Text[pos]==0){ |
2071 | mov dword[endPos],edx ;eP=i; |
2082 | mov dword[endPos],edx ;eP=i; |
2072 | ColToIndexOffset eax,ebx |
2083 | ColToIndexOffset eax,ebx |
2073 | mov bl,byte[ebx+MAX_COLOR_WORD_LEN+6] |
2084 | mov bl,byte[ebx+MAX_COLOR_WORD_LEN+6] |
2074 | mov byte[f_color],bl ;f_color=Col[word_n].color; |
2085 | mov byte[f_color],bl ;f_color=Col[word_n].color; |
2075 | 2086 | ||
2076 | mov byte[find],1 |
2087 | mov byte[find],1 |
2077 | ColToIndexOffset eax,ebx ;... ebx = Col[word_n] |
2088 | ColToIndexOffset eax,ebx ;... ebx = Col[word_n] |
2078 | mov bl,byte[ebx+MAX_COLOR_WORD_LEN+4] |
2089 | mov bl,byte[ebx+MAX_COLOR_WORD_LEN+4] |
2079 | cmp bl,0 ;if(Col[word_n].wwo) |
2090 | cmp bl,0 ;if(Col[word_n].wwo) |
2080 | je .if_2n |
2091 | je .if_2n |
2081 | push edx |
2092 | push edx |
2082 | mov edx,dword[begPos] |
2093 | mov edx,dword[begPos] |
2083 | call ted_iterat_perv |
2094 | call ted_iterat_perv |
2084 | 2095 | ||
2085 | btr bx,0 ;1-1 |
2096 | btr bx,0 ;1-1 |
2086 | jae .if_3e ;if(Col[word_n].wwo&1) |
2097 | jae .if_3e ;if(Col[word_n].wwo&1) |
2087 | ;u1= !(isalnum(cont_s)||cont_s=='_') |
2098 | ;u1= !(isalnum(cont_s)||cont_s=='_') |
2088 | call isalnum |
2099 | call isalnum |
2089 | jae .if_3e |
2100 | jae .if_3e |
2090 | mov byte[find],0 |
2101 | mov byte[find],0 |
2091 | .if_3e: |
2102 | .if_3e: |
2092 | 2103 | ||
2093 | btr bx,3 ;4-1 |
2104 | btr bx,3 ;4-1 |
2094 | jae .if_4e ;if(Col[word_n].wwo&8) |
2105 | jae .if_4e ;if(Col[word_n].wwo&8) |
2095 | ;u1= !isalpha(cont_s); |
2106 | ;u1= !isalpha(cont_s); |
2096 | call isalpha |
2107 | call isalpha |
2097 | jae .if_4e |
2108 | jae .if_4e |
2098 | mov byte[find],0 |
2109 | mov byte[find],0 |
2099 | .if_4e: |
2110 | .if_4e: |
2100 | 2111 | ||
2101 | mov edx,dword[endPos] |
2112 | mov edx,dword[endPos] |
2102 | ; call ted_iterat_next |
2113 | ; call ted_iterat_next |
2103 | 2114 | ||
2104 | btr bx,1 ;2-1 |
2115 | btr bx,1 ;2-1 |
2105 | jae .if_5e ;if(Col[word_n].wwo&2) |
2116 | jae .if_5e ;if(Col[word_n].wwo&2) |
2106 | ;u1= !(isalnum(cont_s)||cont_s=='_') |
2117 | ;u1= !(isalnum(cont_s)||cont_s=='_') |
2107 | call isalnum |
2118 | call isalnum |
2108 | jae .if_5e |
2119 | jae .if_5e |
2109 | mov byte[find],0 |
2120 | mov byte[find],0 |
2110 | .if_5e: |
2121 | .if_5e: |
2111 | 2122 | ||
2112 | btr bx,4 ;5-1 |
2123 | btr bx,4 ;5-1 |
2113 | jae .if_6e ;if(Col[word_n].wwo&16) |
2124 | jae .if_6e ;if(Col[word_n].wwo&16) |
2114 | ;u1= !isalpha(cont_s); |
2125 | ;u1= !isalpha(cont_s); |
2115 | call isalpha |
2126 | call isalpha |
2116 | jae .if_6e |
2127 | jae .if_6e |
2117 | mov byte[find],0 |
2128 | mov byte[find],0 |
2118 | .if_6e: |
2129 | .if_6e: |
2119 | 2130 | ||
2120 | btr bx,2 ;3-1 |
2131 | btr bx,2 ;3-1 |
2121 | jae .if_7e ;if(Col[word_n].wwo&4) |
2132 | jae .if_7e ;if(Col[word_n].wwo&4) |
2122 | ColToIndexOffset eax,ebx |
2133 | ColToIndexOffset eax,ebx |
2123 | mov bl,byte[ebx+MAX_COLOR_WORD_LEN+5] |
2134 | mov bl,byte[ebx+MAX_COLOR_WORD_LEN+5] |
2124 | call ted_iterat_next_pos_char |
2135 | call ted_iterat_next_pos_char |
2125 | cmp edx,ted_tex_1 |
2136 | cmp edx,ted_tex_1 |
2126 | jle .if_7e |
2137 | jle .if_7e |
2127 | mov dword[endPos],edx |
2138 | mov dword[endPos],edx |
2128 | .if_7e: |
2139 | .if_7e: |
2129 | 2140 | ||
2130 | pop edx |
2141 | pop edx |
2131 | .if_2n: |
2142 | .if_2n: |
2132 | ; if(i!=1){ // ¥ ª®¥æ ¤®ªã¬¥â |
2143 | ; if(i!=1){ // ¥ ª®¥æ ¤®ªã¬¥â |
2133 | ; cont_s=tex[eP].c; |
2144 | ; cont_s=tex[eP].c; |
2134 | ; if(Col[word_n].wwo&2) u2= !(isalnum(cont_s)||cont_s=='_'); // ¥ ¡ãª¢.-ç¨á«. ᨬ¢®« |
2145 | ; if(Col[word_n].wwo&2) u2= !(isalnum(cont_s)||cont_s=='_'); // ¥ ¡ãª¢.-ç¨á«. ᨬ¢®« |
2135 | ; if(u2 && Col[word_n].wwo&16) u2= !isalpha(cont_s); // ¥ ç¨á«. ᨬ¢®« |
2146 | ; if(u2 && Col[word_n].wwo&16) u2= !isalpha(cont_s); // ¥ ç¨á«. ᨬ¢®« |
2136 | ; if(Col[word_n].wwo&4) eP=ted_iterat_next_pos_char(eP,Col[word_n].endc); |
2147 | ; if(Col[word_n].wwo&4) eP=ted_iterat_next_pos_char(eP,Col[word_n].endc); |
2137 | 2148 | ||
2138 | cmp eax,ecx |
2149 | cmp eax,ecx |
2139 | je .wh_2e ;if(word_n==l_pos) break; // do double - ¥á«¨ á«®¢® â®ç® ¯®á«¥¤¥¥ |
2150 | je .wh_2e ;if(word_n==l_pos) break; // do double - ¥á«¨ á«®¢® â®ç® ¯®á«¥¤¥¥ |
2140 | .if_0: |
2151 | .if_0: |
2141 | 2152 | ||
2142 | cmp edx,ted_tex_1 |
2153 | cmp edx,ted_tex_1 |
2143 | jle .wh_2e ;if(i==1) break; |
2154 | jle .wh_2e ;if(i==1) break; |
2144 | 2155 | ||
2145 | ;while(l_pos>word_n && Col[word_n].Text[pos]!=tex[i].c) |
2156 | ;while(l_pos>word_n && Col[word_n].Text[pos]!=tex[i].c) |
2146 | .wh_4b: |
2157 | .wh_4b: |
2147 | cmp ecx,eax |
2158 | cmp ecx,eax |
2148 | jle .wh_4e |
2159 | jle .wh_4e |
2149 | ColToIndexOffset eax,ebx |
2160 | ColToIndexOffset eax,ebx |
2150 | ;cmp byte[ebx+esi],byte[edx] |
2161 | ;cmp byte[ebx+esi],byte[edx] |
2151 | mov bl,byte[ebx+esi] |
2162 | mov bl,byte[ebx+esi] |
2152 | cmp bl,byte[edx] |
2163 | cmp bl,byte[edx] |
2153 | je .wh_4e |
2164 | je .wh_4e |
2154 | inc eax |
2165 | inc eax |
2155 | jmp .wh_4b |
2166 | jmp .wh_4b |
2156 | .wh_4e: |
2167 | .wh_4e: |
2157 | 2168 | ||
2158 | cmp eax,ecx |
2169 | cmp eax,ecx |
2159 | je .wh_2e;if(word_n==l_pos) break; |
2170 | je .wh_2e;if(word_n==l_pos) break; |
2160 | inc esi ;pos++; |
2171 | inc esi ;pos++; |
2161 | jmp .wh_2b |
2172 | jmp .wh_2b |
2162 | .wh_2e: |
2173 | .wh_2e: |
2163 | 2174 | ||
2164 | cmp byte[find],1 ;if(fnd)break; |
2175 | cmp byte[find],1 ;if(fnd)break; |
2165 | je @f |
2176 | je @f |
2166 | mov edx,dword[begPos];i=bP; |
2177 | mov edx,dword[begPos];i=bP; |
2167 | jmp @b |
2178 | jmp @b |
2168 | @@: |
2179 | @@: |
2169 | 2180 | ||
2170 | cmp byte[find],1 |
2181 | cmp byte[find],1 |
2171 | jne .if_1e ;if(fnd){ // ¢ë¤¥«¥¨¥ ©¤¥®£® ⥪áâ |
2182 | jne .if_1e ;if(fnd){ // ¢ë¤¥«¥¨¥ ©¤¥®£® ⥪áâ |
2172 | ; if(!mode_sf1 || (mode_sf1 && strlen(Col[word_n].f1->c_str())>0)){ |
2183 | ; if(!mode_sf1 || (mode_sf1 && strlen(Col[word_n].f1->c_str())>0)){ |
2173 | mov eax,dword[begPos] |
2184 | mov eax,dword[begPos] |
2174 | mov bl,byte[f_color] |
2185 | mov bl,byte[f_color] |
2175 | mov byte[eax+1],bl ;tex[bP].col=f_color; |
2186 | mov byte[eax+1],bl ;tex[bP].col=f_color; |
2176 | mov eax,dword[endPos] |
2187 | mov eax,dword[endPos] |
2177 | mov byte[eax+1],0xff ;tex[eP].col=255; |
2188 | mov byte[eax+1],0xff ;tex[eP].col=255; |
2178 | ; return ItPoPerv(eP); // ¢®§¢à é ¥¬ ¯®§¨æ¨î ª®æ ¢å®¦¤¥¨ï |
2189 | ; return ItPoPerv(eP); // ¢®§¢à é ¥¬ ¯®§¨æ¨î ª®æ ¢å®¦¤¥¨ï |
2179 | mov edx,dword[endPos] |
2190 | mov edx,dword[endPos] |
2180 | call ted_get_text_perv_pos |
2191 | call ted_get_text_perv_pos |
2181 | jmp @f |
2192 | jmp @f |
2182 | .if_1e: |
2193 | .if_1e: |
2183 | mov edx,ted_tex |
2194 | mov edx,ted_tex |
2184 | @@: |
2195 | @@: |
2185 | 2196 | ||
2186 | pop esi ecx ebx eax |
2197 | pop esi ecx ebx eax |
2187 | ret |
2198 | ret |
2188 | endp |
2199 | endp |
2189 | 2200 | ||
2190 | ;input: |
2201 | ;input: |
2191 | ; edx = pointer to char (byte) |
2202 | ; edx = pointer to char (byte) |
2192 | ;output: |
2203 | ;output: |
2193 | ; cf=1 if symbol is... |
2204 | ; cf=1 if symbol is... |
2194 | align 4 |
2205 | align 4 |
2195 | tab_all_num db 0,0,0,0,0,0,11111111b,11b,11111110b,0xff,0xff,111b,11111110b,0xff,0xff,111b,0,0,0,0,0,0,0,0;,0,0,0,0,0,0,0,0 - tab_alpha_0,0,0,0,0,0,0,0 |
2206 | tab_all_num db 0,0,0,0,0,0,11111111b,11b,11111110b,0xff,0xff,111b,11111110b,0xff,0xff,111b,0,0,0,0,0,0,0,0;,0,0,0,0,0,0,0,0 - tab_alpha_0,0,0,0,0,0,0,0 |
2196 | tab_alpha db 0,0,0,0,0,0,0,0,11111110b,0xff,0xff,111b,11111110b,0xff,0xff,111b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
2207 | tab_alpha db 0,0,0,0,0,0,0,0,11111110b,0xff,0xff,111b,11111110b,0xff,0xff,111b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
2197 | 2208 | ||
2198 | align 4 |
2209 | align 4 |
2199 | isalnum: |
2210 | isalnum: |
2200 | push eax ebx |
2211 | push eax ebx |
2201 | mov al,byte[edx] ;al=offset |
2212 | mov al,byte[edx] ;al=offset |
2202 | shr al,3 |
2213 | shr al,3 |
2203 | and eax,11111b |
2214 | and eax,11111b |
2204 | lea ebx,[tab_all_num] |
2215 | lea ebx,[tab_all_num] |
2205 | add ebx,eax |
2216 | add ebx,eax |
2206 | mov ah,byte[ebx] |
2217 | mov ah,byte[ebx] |
2207 | mov al,byte[edx] ;al=bit |
2218 | mov al,byte[edx] ;al=bit |
2208 | and ax,111b |
2219 | and ax,111b |
2209 | mov bx,word[ebx] |
2220 | mov bx,word[ebx] |
2210 | btr bx,ax |
2221 | btr bx,ax |
2211 | pop ebx eax |
2222 | pop ebx eax |
2212 | ret |
2223 | ret |
2213 | align 4 |
2224 | align 4 |
2214 | isalpha: |
2225 | isalpha: |
2215 | push eax ebx |
2226 | push eax ebx |
2216 | mov al,byte[edx] ;al=offset |
2227 | mov al,byte[edx] ;al=offset |
2217 | shr al,3 |
2228 | shr al,3 |
2218 | and eax,11111b |
2229 | and eax,11111b |
2219 | lea ebx,[tab_alpha] |
2230 | lea ebx,[tab_alpha] |
2220 | add ebx,eax |
2231 | add ebx,eax |
2221 | mov ah,byte[ebx] |
2232 | mov ah,byte[ebx] |
2222 | mov al,byte[edx] ;al=bit |
2233 | mov al,byte[edx] ;al=bit |
2223 | and ax,111b |
2234 | and ax,111b |
2224 | mov bx,word[ebx] |
2235 | mov bx,word[ebx] |
2225 | btr bx,ax |
2236 | btr bx,ax |
2226 | pop ebx eax |
2237 | pop ebx eax |
2227 | ret |
2238 | ret |
2228 | 2239 | ||
2229 | align 4 |
2240 | align 4 |
2230 | proc ted_show_help_f1, edit:dword |
2241 | proc ted_show_help_f1, edit:dword |
2231 | push eax edx edi |
2242 | push eax edx edi |
2232 | mov edi,dword[edit] |
2243 | mov edi,dword[edit] |
2233 | 2244 | ||
2234 | call ted_get_pos_by_cursor |
2245 | call ted_get_pos_by_cursor |
2235 | push edx |
2246 | push edx |
2236 | call ted_iterat_next_color_tag |
2247 | call ted_iterat_next_color_tag |
2237 | mov eax,edx |
2248 | mov eax,edx |
2238 | pop edx |
2249 | pop edx |
2239 | call ted_iterat_perv_color_tag |
2250 | call ted_iterat_perv_color_tag |
2240 | 2251 | ||
2241 | cmp eax,ted_tex |
2252 | cmp eax,ted_tex |
2242 | jle @f |
2253 | jle @f |
2243 | cmp edx,ted_tex_1 |
2254 | cmp edx,ted_tex_1 |
2244 | jle @f |
2255 | jle @f |
2245 | stdcall ted_find_help_id,eax |
2256 | stdcall ted_find_help_id,eax |
2246 | @@: |
2257 | @@: |
2247 | ;call ted_draw_main_cursor |
2258 | ;call ted_draw_main_cursor |
2248 | call ted_draw_help_f1 |
2259 | call ted_draw_help_f1 |
2249 | pop edi edx eax |
2260 | pop edi edx eax |
2250 | ret |
2261 | ret |
2251 | endp |
2262 | endp |
2252 | 2263 | ||
2253 | ;input: |
2264 | ;input: |
2254 | ; edx = position begin 'symbol' struct |
2265 | ; edx = position begin 'symbol' struct |
2255 | ; edi = pointer to tedit struct |
2266 | ; edi = pointer to tedit struct |
2256 | ; end_pos = position end 'symbol' struct |
2267 | ; end_pos = position end 'symbol' struct |
2257 | align 4 |
2268 | align 4 |
2258 | proc ted_find_help_id, end_pos:dword |
2269 | proc ted_find_help_id, end_pos:dword |
2259 | ; ecx = word_n |
2270 | ; ecx = word_n |
2260 | ; ebx = l_pos |
2271 | ; ebx = l_pos |
2261 | mov ted_help_id,-1 |
2272 | mov ted_help_id,-1 |
2262 | 2273 | ||
2263 | push ebx ecx |
2274 | push ebx ecx |
2264 | xor ebx,ebx |
2275 | xor ebx,ebx |
2265 | mov bl,byte[edx] |
2276 | mov bl,byte[edx] |
2266 | shl bx,2 ;ebx*=4 |
2277 | shl bx,2 ;ebx*=4 |
2267 | add ebx,ted_arr_key_pos |
2278 | add ebx,ted_arr_key_pos |
2268 | mov ecx,dword[ebx] |
2279 | mov ecx,dword[ebx] |
2269 | cmp ecx,0 |
2280 | cmp ecx,0 |
2270 | jl .if_0e ;if( (word_n=ted_arr_key_pos[(unsigned char)tf[0]])>-1 ){ |
2281 | jl .if_0e ;if( (word_n=ted_arr_key_pos[(unsigned char)tf[0]])>-1 ){ |
2271 | push esi eax |
2282 | push esi eax |
2272 | mov ebx,ecx ;l_pos=word_n; |
2283 | mov ebx,ecx ;l_pos=word_n; |
2273 | ColToIndexOffset ecx,esi |
2284 | ColToIndexOffset ecx,esi |
2274 | push cx |
2285 | push cx |
2275 | mov cl,byte[esi] |
2286 | mov cl,byte[esi] |
2276 | @@: |
2287 | @@: |
2277 | cmp ebx,ted_key_words_count ;while(l_pos |
2288 | cmp ebx,ted_key_words_count ;while(l_pos |
2278 | jge @f |
2289 | jge @f |
2279 | ;ColToIndexOffset ecx,esi |
2290 | ;ColToIndexOffset ecx,esi |
2280 | ColToIndexOffset ebx,eax |
2291 | ColToIndexOffset ebx,eax |
2281 | cmp cl,byte[eax] ;&& Col[l_pos].Text[0]==Col[word_n].Text[0]) |
2292 | cmp cl,byte[eax] ;&& Col[l_pos].Text[0]==Col[word_n].Text[0]) |
2282 | jne @f |
2293 | jne @f |
2283 | inc ebx ;l_pos++; |
2294 | inc ebx ;l_pos++; |
2284 | jmp @b |
2295 | jmp @b |
2285 | @@: |
2296 | @@: |
2286 | pop cx |
2297 | pop cx |
2287 | call ted_iterat_next ;pos=1; |
2298 | call ted_iterat_next ;pos=1; |
2288 | mov esi,1 |
2299 | mov esi,1 |
2289 | @@: |
2300 | @@: |
2290 | push dx |
2301 | push dx |
2291 | push word[edx] |
2302 | push word[edx] |
2292 | pop dx |
2303 | pop dx |
2293 | .wh_0b: |
2304 | .wh_0b: |
2294 | cmp ebx,ecx ;while(l_pos>word_n |
2305 | cmp ebx,ecx ;while(l_pos>word_n |
2295 | jle .wh_0e |
2306 | jle .wh_0e |
2296 | dec ebx |
2307 | dec ebx |
2297 | ColToIndexOffset ebx,eax |
2308 | ColToIndexOffset ebx,eax |
2298 | inc ebx |
2309 | inc ebx |
2299 | cmp byte[eax+esi],dl ;&& Col[l_pos-1].Text[pos]!=tf[i]) |
2310 | cmp byte[eax+esi],dl ;&& Col[l_pos-1].Text[pos]!=tf[i]) |
2300 | je .wh_0e |
2311 | je .wh_0e |
2301 | dec ebx ;l_pos--; |
2312 | dec ebx ;l_pos--; |
2302 | jmp .wh_0b |
2313 | jmp .wh_0b |
2303 | .wh_0e: |
2314 | .wh_0e: |
2304 | 2315 | ||
2305 | .wh_1b: |
2316 | .wh_1b: |
2306 | cmp ebx,ecx ;while(l_pos>word_n |
2317 | cmp ebx,ecx ;while(l_pos>word_n |
2307 | jle .wh_1e |
2318 | jle .wh_1e |
2308 | ColToIndexOffset ecx,eax |
2319 | ColToIndexOffset ecx,eax |
2309 | cmp byte[eax+esi],dl |
2320 | cmp byte[eax+esi],dl |
2310 | je .wh_1e |
2321 | je .wh_1e |
2311 | inc ecx ;word_n++; |
2322 | inc ecx ;word_n++; |
2312 | jmp .wh_1b |
2323 | jmp .wh_1b |
2313 | .wh_1e: |
2324 | .wh_1e: |
2314 | pop dx |
2325 | pop dx |
2315 | 2326 | ||
2316 | cmp ecx,ebx ;if(word_n==l_pos) break; |
2327 | cmp ecx,ebx ;if(word_n==l_pos) break; |
2317 | je @f |
2328 | je @f |
2318 | call ted_iterat_next ;pos++; |
2329 | call ted_iterat_next ;pos++; |
2319 | cmp edx,dword[end_pos] ;for(...;i |
2330 | cmp edx,dword[end_pos] ;for(...;i |
2320 | je @f ;jge |
2331 | je @f ;jge |
2321 | inc esi |
2332 | inc esi |
2322 | jmp @b |
2333 | jmp @b |
2323 | @@: |
2334 | @@: |
2324 | pop eax esi |
2335 | pop eax esi |
2325 | 2336 | ||
2326 | mov ted_help_id,ecx |
2337 | mov ted_help_id,ecx |
2327 | ;return word_n; |
2338 | ;return word_n; |
2328 | 2339 | ||
2329 | .if_0e: |
2340 | .if_0e: |
2330 | pop ecx ebx |
2341 | pop ecx ebx |
2331 | ret |
2342 | ret |
2332 | endp |
2343 | endp |
2333 | 2344 | ||
2334 | ;output: |
2345 | ;output: |
2335 | ; eax = ª®¤ ®è¨¡ª¨ |
2346 | ; eax = ª®¤ ®è¨¡ª¨ |
2336 | ; ebx = ª®««¨ç¥á⢮ ¯à®ç¨â ëå ¡ ©â |
2347 | ; ebx = ª®««¨ç¥á⢮ ¯à®ç¨â ëå ¡ ©â |
2337 | align 4 |
2348 | align 4 |
2338 | proc ted_open_file, edit:dword, file:dword, f_name:dword ;äãªæ¨ï ®âªàëâ¨ï ä ©« |
2349 | proc ted_open_file, edit:dword, file:dword, f_name:dword ;äãªæ¨ï ®âªàëâ¨ï ä ©« |
2339 | push edi |
2350 | push edi |
2340 | mov edi,dword[edit] |
2351 | mov edi,dword[edit] |
2341 | 2352 | ||
2342 | mov eax,70 |
2353 | mov eax,70 |
2343 | mov ebx,dword[file] |
2354 | mov ebx,dword[file] |
2344 | mov dword[ebx], 0 |
2355 | mov dword[ebx], 0 |
2345 | mov dword[ebx+4], 0 |
2356 | mov dword[ebx+4], 0 |
2346 | mov dword[ebx+8], 0 |
2357 | mov dword[ebx+8], 0 |
2347 | m2m dword[ebx+12], ted_max_chars ;ç¨á«® ¡ ©â, ª®â®àë¥ ¬®£ãâ ¡ëâì áç¨â ë á ä ©« |
2358 | m2m dword[ebx+12], ted_max_chars ;ç¨á«® ¡ ©â, ª®â®àë¥ ¬®£ãâ ¡ëâì áç¨â ë á ä ©« |
2348 | m2m dword[ebx+16], ted_tex |
2359 | m2m dword[ebx+16], ted_tex |
2349 | mov byte[ebx+20], 0 |
2360 | mov byte[ebx+20], 0 |
2350 | push dword[f_name] |
2361 | push dword[f_name] |
2351 | pop dword[ebx+21] |
2362 | pop dword[ebx+21] |
2352 | int 0x40 |
2363 | int 0x40 |
2353 | 2364 | ||
2354 | cmp eax,0 |
2365 | cmp eax,0 |
2355 | je @f |
2366 | je @f |
2356 | cmp eax,6 |
2367 | cmp eax,6 |
2357 | je @f |
2368 | je @f |
2358 | jmp .ret_f |
2369 | jmp .ret_f |
2359 | @@: |
2370 | @@: |
2360 | cmp ebx,-1 |
2371 | cmp ebx,-1 |
2361 | je .ret_f |
2372 | je .ret_f |
2362 | ;if open file |
2373 | ;if open file |
2363 | call ted_on_open_file |
2374 | call ted_on_open_file |
2364 | .ret_f: |
2375 | .ret_f: |
2365 | pop edi |
2376 | pop edi |
2366 | ret |
2377 | ret |
2367 | endp |
2378 | endp |
2368 | 2379 | ||
2369 | align 4 |
2380 | align 4 |
2370 | proc ted_but_select_word, edit:dword |
2381 | proc ted_but_select_word, edit:dword |
2371 | pushad |
2382 | pushad |
2372 | mov edi,dword[edit] |
2383 | mov edi,dword[edit] |
2373 | 2384 | ||
2374 | call ted_get_pos_by_cursor |
2385 | call ted_get_pos_by_cursor |
2375 | push edx |
2386 | push edx |
2376 | call ted_iterat_perv_color_tag |
2387 | call ted_iterat_perv_color_tag |
2377 | cmp edx,ted_tex_1 |
2388 | cmp edx,ted_tex_1 |
2378 | jle @f |
2389 | jle @f |
2379 | call ted_get_text_coords |
2390 | call ted_get_text_coords |
2380 | mov ted_sel_x0,ebx |
2391 | mov ted_sel_x0,ebx |
2381 | mov ted_sel_y0,eax |
2392 | mov ted_sel_y0,eax |
2382 | @@: |
2393 | @@: |
2383 | pop edx |
2394 | pop edx |
2384 | call ted_iterat_next_color_tag |
2395 | call ted_iterat_next_color_tag |
2385 | cmp edx,ted_tex_1 |
2396 | cmp edx,ted_tex_1 |
2386 | jle @f |
2397 | jle @f |
2387 | call ted_get_text_coords |
2398 | call ted_get_text_coords |
2388 | mov ted_sel_x1,ebx |
2399 | mov ted_sel_x1,ebx |
2389 | mov ted_sel_y1,eax |
2400 | mov ted_sel_y1,eax |
2390 | @@: |
2401 | @@: |
2391 | 2402 | ||
2392 | cmp ted_fun_draw_panel_buttons,0 |
2403 | cmp ted_fun_draw_panel_buttons,0 |
2393 | je @f |
2404 | je @f |
2394 | call ted_fun_draw_panel_buttons |
2405 | call ted_fun_draw_panel_buttons |
2395 | @@: |
2406 | @@: |
2396 | stdcall ted_draw,edi |
2407 | stdcall ted_draw,edi |
2397 | popad |
2408 | popad |
2398 | ret |
2409 | ret |
2399 | endp |
2410 | endp |
2400 | 2411 | ||
2401 | align 4 |
2412 | align 4 |
2402 | proc ted_but_cut, edit:dword |
2413 | proc ted_but_cut, edit:dword |
2403 | push edi |
2414 | push edi |
2404 | mov edi,dword[edit] |
2415 | mov edi,dword[edit] |
2405 | 2416 | ||
2406 | stdcall ted_but_copy,edi |
2417 | stdcall ted_but_copy,edi |
2407 | call ted_set_undo |
2418 | call ted_set_undo |
2408 | stdcall ted_sel_text_del,ted_opt_ed_change_time |
2419 | stdcall ted_sel_text_del,ted_opt_ed_change_time |
2409 | 2420 | ||
2410 | cmp al,1 |
2421 | cmp al,1 |
2411 | jne @f |
2422 | jne @f |
2412 | stdcall ted_draw,edi |
2423 | stdcall ted_draw,edi |
2413 | cmp ted_fun_draw_panel_buttons,0 |
2424 | cmp ted_fun_draw_panel_buttons,0 |
2414 | je @f |
2425 | je @f |
2415 | call ted_fun_draw_panel_buttons |
2426 | call ted_fun_draw_panel_buttons |
2416 | @@: |
2427 | @@: |
2417 | pop edi |
2428 | pop edi |
2418 | ret |
2429 | ret |
2419 | endp |
2430 | endp |
2420 | 2431 | ||
2421 | ;output: |
2432 | ;output: |
2422 | ; al = 1 if copy text |
2433 | ; al = 1 if copy text |
2423 | align 4 |
2434 | align 4 |
2424 | proc ted_but_copy, edit:dword |
2435 | proc ted_but_copy, edit:dword |
2425 | pushad |
2436 | pushad |
2426 | mov edi,dword[edit] |
2437 | mov edi,dword[edit] |
2427 | 2438 | ||
2428 | call ted_is_select |
2439 | call ted_is_select |
2429 | cmp al,0 |
2440 | cmp al,0 |
2430 | je .end_f ;if not selected text |
2441 | je .end_f ;if not selected text |
2431 | call ted_sel_normalize |
2442 | call ted_sel_normalize |
2432 | 2443 | ||
2433 | mov esi,ted_seln_x1 |
2444 | mov esi,ted_seln_x1 |
2434 | mov ecx,ted_seln_y1 |
2445 | mov ecx,ted_seln_y1 |
2435 | call ted_get_pos_by_coords |
2446 | call ted_get_pos_by_coords |
2436 | mov ebx,edx |
2447 | mov ebx,edx |
2437 | mov esi,ted_seln_x0 |
2448 | mov esi,ted_seln_x0 |
2438 | mov ecx,ted_seln_y0 |
2449 | mov ecx,ted_seln_y0 |
2439 | call ted_get_pos_by_coords |
2450 | call ted_get_pos_by_coords |
2440 | mov esi,ebx |
2451 | mov esi,ebx |
2441 | 2452 | ||
2442 | xor ecx,ecx |
2453 | xor ecx,ecx |
2443 | mov ebx,ted_buffer |
2454 | mov ebx,ted_buffer |
2444 | ;mov edx,ted_tex |
2455 | ;mov edx,ted_tex |
2445 | @@: |
2456 | @@: |
2446 | cmp edx,ted_tex_1 ;end of file |
2457 | cmp edx,ted_tex_1 ;end of file |
2447 | jle @f |
2458 | jle @f |
2448 | cmp edx,esi ;end of select |
2459 | cmp edx,esi ;end of select |
2449 | je @f |
2460 | je @f |
2450 | inc ecx |
2461 | inc ecx |
2451 | cmp ecx,ted_buffer_size ;owerflow bufer |
2462 | cmp ecx,ted_buffer_size ;owerflow bufer |
2452 | je @f |
2463 | je @f |
2453 | 2464 | ||
2454 | mov al,byte[edx] |
2465 | mov al,byte[edx] |
2455 | mov byte[ebx],al |
2466 | mov byte[ebx],al |
2456 | inc ebx |
2467 | inc ebx |
2457 | 2468 | ||
2458 | call ted_iterat_next |
2469 | call ted_iterat_next |
2459 | jmp @b |
2470 | jmp @b |
2460 | @@: |
2471 | @@: |
2461 | add ecx,ted_buffer |
2472 | add ecx,ted_buffer |
2462 | mov byte[ebx],0 |
2473 | mov byte[ebx],0 |
2463 | 2474 | ||
2464 | cmp ecx,0 |
2475 | cmp ecx,0 |
2465 | je .end_f |
2476 | je .end_f |
2466 | call ted_draw_buffer |
2477 | call ted_draw_buffer |
2467 | cmp ted_fun_draw_panel_buttons,0 |
2478 | cmp ted_fun_draw_panel_buttons,0 |
2468 | je .end_f |
2479 | je .end_f |
2469 | call ted_fun_draw_panel_buttons |
2480 | call ted_fun_draw_panel_buttons |
2470 | .end_f: |
2481 | .end_f: |
2471 | popad |
2482 | popad |
2472 | ret |
2483 | ret |
2473 | endp |
2484 | endp |
2474 | 2485 | ||
2475 | 2486 | ||
2476 | align 4 |
2487 | align 4 |
2477 | proc ted_but_paste, edit:dword |
2488 | proc ted_but_paste, edit:dword |
2478 | push eax ebx esi edi |
2489 | push eax ebx esi edi |
2479 | mov edi,dword[edit] |
2490 | mov edi,dword[edit] |
2480 | 2491 | ||
2481 | mov esi,ted_buffer |
2492 | mov esi,ted_buffer |
2482 | call tl_strlen |
2493 | call tl_strlen |
2483 | cmp eax,1 |
2494 | cmp eax,1 |
2484 | jl @f |
2495 | jl @f |
2485 | mov esi,eax |
2496 | mov esi,eax |
2486 | call ted_set_undo |
2497 | call ted_set_undo |
2487 | mov ebx,ted_opt_ed_change_time+ted_opt_ed_move_cursor |
2498 | mov ebx,ted_opt_ed_change_time+ted_opt_ed_move_cursor |
2488 | stdcall ted_sel_text_del,ebx |
2499 | stdcall ted_sel_text_del,ebx |
2489 | cmp al,1 |
2500 | cmp al,1 |
2490 | jne .del |
2501 | jne .del |
2491 | mov ebx,ted_opt_ed_move_cursor |
2502 | mov ebx,ted_opt_ed_move_cursor |
2492 | .del: |
2503 | .del: |
2493 | stdcall ted_text_add,edi,ted_buffer,esi,ebx |
2504 | stdcall ted_text_add,edi,ted_buffer,esi,ebx |
2494 | stdcall ted_draw,edi |
2505 | stdcall ted_draw,edi |
2495 | cmp ted_fun_draw_panel_buttons,0 |
2506 | cmp ted_fun_draw_panel_buttons,0 |
2496 | je @f |
2507 | je @f |
2497 | call ted_fun_draw_panel_buttons |
2508 | call ted_fun_draw_panel_buttons |
2498 | @@: |
2509 | @@: |
2499 | pop edi esi ebx eax |
2510 | pop edi esi ebx eax |
2500 | ret |
2511 | ret |
2501 | endp |
2512 | endp |
2502 | 2513 | ||
2503 | align 4 |
2514 | align 4 |
2504 | proc ted_but_sumb_upper, edit:dword |
2515 | proc ted_but_sumb_upper, edit:dword |
2505 | push edi esi |
2516 | push edi esi |
2506 | mov edi,dword[edit] |
2517 | mov edi,dword[edit] |
2507 | 2518 | ||
2508 | mov [conv_table],EvUpper |
2519 | mov [conv_table],EvUpper |
2509 | call ted_convert_sel_text |
2520 | call ted_convert_sel_text |
2510 | cmp esi,0 |
2521 | cmp esi,0 |
2511 | je @f |
2522 | je @f |
2512 | stdcall ted_draw,edi |
2523 | stdcall ted_draw,edi |
2513 | @@: |
2524 | @@: |
2514 | pop esi edi |
2525 | pop esi edi |
2515 | ret |
2526 | ret |
2516 | endp |
2527 | endp |
2517 | 2528 | ||
2518 | align 4 |
2529 | align 4 |
2519 | proc ted_but_sumb_lover, edit:dword |
2530 | proc ted_but_sumb_lover, edit:dword |
2520 | push edi esi |
2531 | push edi esi |
2521 | mov edi,dword[edit] |
2532 | mov edi,dword[edit] |
2522 | 2533 | ||
2523 | mov [conv_table],EvLover |
2534 | mov [conv_table],EvLover |
2524 | call ted_convert_sel_text |
2535 | call ted_convert_sel_text |
2525 | cmp esi,0 |
2536 | cmp esi,0 |
2526 | je @f |
2537 | je @f |
2527 | stdcall ted_draw,edi |
2538 | stdcall ted_draw,edi |
2528 | @@: |
2539 | @@: |
2529 | pop esi edi |
2540 | pop esi edi |
2530 | ret |
2541 | ret |
2531 | endp |
2542 | endp |
2532 | 2543 | ||
2533 | align 4 |
2544 | align 4 |
2534 | proc ted_but_reverse, edit:dword |
2545 | proc ted_but_reverse, edit:dword |
2535 | push eax ebx edi |
2546 | push eax ebx edi |
2536 | mov edi,dword[edit] |
2547 | mov edi,dword[edit] |
2537 | 2548 | ||
2538 | call ted_is_select |
2549 | call ted_is_select |
2539 | cmp al,0 |
2550 | cmp al,0 |
2540 | je @f |
2551 | je @f |
2541 | call ted_sel_normalize |
2552 | call ted_sel_normalize |
2542 | push esi ecx edx |
2553 | push esi ecx edx |
2543 | mov esi,ted_seln_x0 |
2554 | mov esi,ted_seln_x0 |
2544 | mov ecx,ted_seln_y0 |
2555 | mov ecx,ted_seln_y0 |
2545 | call ted_get_pos_by_coords |
2556 | call ted_get_pos_by_coords |
2546 | mov eax,edx |
2557 | mov eax,edx |
2547 | mov esi,ted_seln_x1 |
2558 | mov esi,ted_seln_x1 |
2548 | cmp esi,0 |
2559 | cmp esi,0 |
2549 | je .beg_str |
2560 | je .beg_str |
2550 | dec esi |
2561 | dec esi |
2551 | .beg_str: |
2562 | .beg_str: |
2552 | mov ecx,ted_seln_y1 |
2563 | mov ecx,ted_seln_y1 |
2553 | call ted_get_pos_by_coords |
2564 | call ted_get_pos_by_coords |
2554 | ;call ted_get_text_perv_pos |
2565 | ;call ted_get_text_perv_pos |
2555 | mov ebx,edx |
2566 | mov ebx,edx |
2556 | pop edx ecx esi |
2567 | pop edx ecx esi |
2557 | ;cmp eax,... |
2568 | ;cmp eax,... |
2558 | ;je @f |
2569 | ;je @f |
2559 | call ted_revers |
2570 | call ted_revers |
2560 | @@: |
2571 | @@: |
2561 | stdcall ted_draw,edi |
2572 | stdcall ted_draw,edi |
2562 | pop edi ebx eax |
2573 | pop edi ebx eax |
2563 | ret |
2574 | ret |
2564 | endp |
2575 | endp |
2565 | 2576 | ||
2566 | align 4 |
2577 | align 4 |
2567 | proc ted_but_undo, edit:dword |
2578 | proc ted_but_undo, edit:dword |
2568 | push eax edi |
2579 | push eax edi |
2569 | mov edi,dword[edit] |
2580 | mov edi,dword[edit] |
2570 | 2581 | ||
2571 | mov eax,ted_tim_undo |
2582 | mov eax,ted_tim_undo |
2572 | cmp ted_tim_ch,eax |
2583 | cmp ted_tim_ch,eax |
2573 | jbe @f |
2584 | jbe @f |
2574 | inc ted_tim_undo |
2585 | inc ted_tim_undo |
2575 | ;call ted_text_colored |
2586 | ;call ted_text_colored |
2576 | stdcall ted_draw,edi |
2587 | stdcall ted_draw,edi |
2577 | cmp ted_fun_draw_panel_buttons,0 |
2588 | cmp ted_fun_draw_panel_buttons,0 |
2578 | je @f |
2589 | je @f |
2579 | call ted_fun_draw_panel_buttons |
2590 | call ted_fun_draw_panel_buttons |
2580 | @@: |
2591 | @@: |
2581 | pop edi eax |
2592 | pop edi eax |
2582 | ret |
2593 | ret |
2583 | endp |
2594 | endp |
2584 | 2595 | ||
2585 | align 4 |
2596 | align 4 |
2586 | proc ted_but_redo, edit:dword |
2597 | proc ted_but_redo, edit:dword |
2587 | push edi |
2598 | push edi |
2588 | mov edi,dword[edit] |
2599 | mov edi,dword[edit] |
2589 | 2600 | ||
2590 | cmp ted_tim_undo,1 |
2601 | cmp ted_tim_undo,1 |
2591 | jb @f |
2602 | jb @f |
2592 | dec ted_tim_undo |
2603 | dec ted_tim_undo |
2593 | ;call ted_text_colored |
2604 | ;call ted_text_colored |
2594 | stdcall ted_draw,edi |
2605 | stdcall ted_draw,edi |
2595 | cmp ted_fun_draw_panel_buttons,0 |
2606 | cmp ted_fun_draw_panel_buttons,0 |
2596 | je @f |
2607 | je @f |
2597 | call ted_fun_draw_panel_buttons |
2608 | call ted_fun_draw_panel_buttons |
2598 | @@: |
2609 | @@: |
2599 | pop edi |
2610 | pop edi |
2600 | ret |
2611 | ret |
2601 | endp |
2612 | endp |
2602 | 2613 | ||
2603 | align 4 |
2614 | align 4 |
2604 | proc ted_but_find_next, edit:dword |
2615 | proc ted_but_find_next, edit:dword |
2605 | pushad |
2616 | pushad |
2606 | mov edi,dword[edit] |
2617 | mov edi,dword[edit] |
2607 | 2618 | ||
2608 | call ted_get_pos_by_cursor |
2619 | call ted_get_pos_by_cursor |
2609 | mov eax,ted_buffer_find |
2620 | mov eax,ted_buffer_find |
2610 | mov bl,byte[eax] |
2621 | mov bl,byte[eax] |
2611 | @@: |
2622 | @@: |
2612 | call ted_get_find_rezult |
2623 | call ted_get_find_rezult |
2613 | cmp bh,1 |
2624 | cmp bh,1 |
2614 | je @f ; find |
2625 | je @f ; find |
2615 | call ted_iterat_next |
2626 | call ted_iterat_next |
2616 | cmp edx,ted_tex_1 |
2627 | cmp edx,ted_tex_1 |
2617 | jle @f |
2628 | jle @f |
2618 | jmp @b |
2629 | jmp @b |
2619 | @@: |
2630 | @@: |
2620 | cmp bh,0 |
2631 | cmp bh,0 |
2621 | je @f |
2632 | je @f |
2622 | call ted_get_text_coords |
2633 | call ted_get_text_coords |
2623 | inc ebx ;move cursor right |
2634 | inc ebx ;move cursor right |
2624 | mov ted_sel_x1,ebx |
2635 | mov ted_sel_x1,ebx |
2625 | mov ted_sel_y1,eax |
2636 | mov ted_sel_y1,eax |
2626 | mov edx,eax |
2637 | mov edx,eax |
2627 | mov ecx,ebx |
2638 | mov ecx,ebx |
2628 | call ted_go_to_pos |
2639 | call ted_go_to_pos |
2629 | mov edx,esi ;esi ¡ë«® ãáâ ®¢«¥® ¢ ted_get_find_rezult |
2640 | mov edx,esi ;esi ¡ë«® ãáâ ®¢«¥® ¢ ted_get_find_rezult |
2630 | call ted_get_text_coords |
2641 | call ted_get_text_coords |
2631 | mov ted_sel_x0,ebx |
2642 | mov ted_sel_x0,ebx |
2632 | mov ted_sel_y0,eax |
2643 | mov ted_sel_y0,eax |
2633 | stdcall ted_draw,edi |
2644 | stdcall ted_draw,edi |
2634 | jmp .end_find |
2645 | jmp .end_find |
2635 | @@: |
2646 | @@: |
2636 | ;¯®¯ ¤ ¥¬ áî¤ ¥á«¨ ⥪áâ ¥ ©¤¥ |
2647 | ;¯®¯ ¤ ¥¬ áî¤ ¥á«¨ ⥪áâ ¥ ©¤¥ |
2637 | cmp ted_fun_find_err,0 |
2648 | cmp ted_fun_find_err,0 |
2638 | je .end_find |
2649 | je .end_find |
2639 | call ted_fun_find_err ;¯®«ì§®¢ ⥫ì᪠ï äãªæ¨ï |
2650 | call ted_fun_find_err ;¯®«ì§®¢ ⥫ì᪠ï äãªæ¨ï |
2640 | .end_find: |
2651 | .end_find: |
2641 | popad |
2652 | popad |
2642 | ret |
2653 | ret |
2643 | endp |
2654 | endp |
2644 | 2655 | ||
2645 | ;input: |
2656 | ;input: |
2646 | ; edi = pointer to tedit struct |
2657 | ; edi = pointer to tedit struct |
2647 | align 4 |
2658 | align 4 |
2648 | ted_key_ctrl_home: |
2659 | ted_key_ctrl_home: |
2649 | mov ted_cur_x,0 |
2660 | mov ted_cur_x,0 |
2650 | mov ted_cur_y,0 |
2661 | mov ted_cur_y,0 |
2651 | push eax |
2662 | push eax |
2652 | mov eax,ted_scr_w |
2663 | mov eax,ted_scr_w |
2653 | mov dword[eax+sb_offs_position],0 |
2664 | mov dword[eax+sb_offs_position],0 |
2654 | mov eax,ted_scr_h |
2665 | mov eax,ted_scr_h |
2655 | mov dword[eax+sb_offs_position],0 |
2666 | mov dword[eax+sb_offs_position],0 |
2656 | pop eax |
2667 | pop eax |
2657 | stdcall ted_draw,edi |
2668 | stdcall ted_draw,edi |
2658 | cmp ted_fun_draw_panel_buttons,0 |
2669 | cmp ted_fun_draw_panel_buttons,0 |
2659 | je @f |
2670 | je @f |
2660 | call ted_fun_draw_panel_buttons |
2671 | call ted_fun_draw_panel_buttons |
2661 | @@: |
2672 | @@: |
2662 | ret |
2673 | ret |
2663 | 2674 | ||
2664 | ;input: |
2675 | ;input: |
2665 | ; edi = pointer to tedit struct |
2676 | ; edi = pointer to tedit struct |
2666 | align 4 |
2677 | align 4 |
2667 | proc ted_sel_key_up |
2678 | proc ted_sel_key_up |
2668 | cmp ted_drag_k,1 |
2679 | cmp ted_drag_k,1 |
2669 | je @f |
2680 | je @f |
2670 | call ted_sel_start |
2681 | call ted_sel_start |
2671 | mov ted_drag_k,1 |
2682 | mov ted_drag_k,1 |
2672 | @@: |
2683 | @@: |
2673 | push dx |
2684 | push dx |
2674 | call ted_cur_move_up |
2685 | call ted_cur_move_up |
2675 | cmp dl,8 |
2686 | cmp dl,8 |
2676 | jne @f |
2687 | jne @f |
2677 | call ted_scroll_set_redraw |
2688 | call ted_scroll_set_redraw |
2678 | @@: |
2689 | @@: |
2679 | pop dx |
2690 | pop dx |
2680 | call ted_sel_move |
2691 | call ted_sel_move |
2681 | stdcall ted_draw,edi |
2692 | stdcall ted_draw,edi |
2682 | ret |
2693 | ret |
2683 | endp |
2694 | endp |
2684 | 2695 | ||
2685 | ;input: |
2696 | ;input: |
2686 | ; edi = pointer to tedit struct |
2697 | ; edi = pointer to tedit struct |
2687 | align 4 |
2698 | align 4 |
2688 | proc ted_sel_key_down |
2699 | proc ted_sel_key_down |
2689 | cmp ted_drag_k,1 |
2700 | cmp ted_drag_k,1 |
2690 | je @f |
2701 | je @f |
2691 | call ted_sel_start |
2702 | call ted_sel_start |
2692 | mov ted_drag_k,1 |
2703 | mov ted_drag_k,1 |
2693 | @@: |
2704 | @@: |
2694 | push dx |
2705 | push dx |
2695 | call ted_cur_move_down |
2706 | call ted_cur_move_down |
2696 | cmp dl,8 |
2707 | cmp dl,8 |
2697 | jne @f |
2708 | jne @f |
2698 | call ted_scroll_set_redraw |
2709 | call ted_scroll_set_redraw |
2699 | @@: |
2710 | @@: |
2700 | pop dx |
2711 | pop dx |
2701 | call ted_sel_move |
2712 | call ted_sel_move |
2702 | stdcall ted_draw,edi |
2713 | stdcall ted_draw,edi |
2703 | ret |
2714 | ret |
2704 | endp |
2715 | endp |
2705 | 2716 | ||
2706 | ;input: |
2717 | ;input: |
2707 | ; edi = pointer to tedit struct |
2718 | ; edi = pointer to tedit struct |
2708 | align 4 |
2719 | align 4 |
2709 | proc ted_sel_key_left |
2720 | proc ted_sel_key_left |
2710 | cmp ted_drag_k,1 |
2721 | cmp ted_drag_k,1 |
2711 | je @f |
2722 | je @f |
2712 | call ted_sel_start |
2723 | call ted_sel_start |
2713 | @@: |
2724 | @@: |
2714 | push dx |
2725 | push dx |
2715 | call ted_cur_move_left |
2726 | call ted_cur_move_left |
2716 | call ted_sel_move |
2727 | call ted_sel_move |
2717 | cmp ted_drag_k,1 |
2728 | cmp ted_drag_k,1 |
2718 | je @f |
2729 | je @f |
2719 | mov ted_drag_k,1 |
2730 | mov ted_drag_k,1 |
2720 | mov dl,8 |
2731 | mov dl,8 |
2721 | @@: |
2732 | @@: |
2722 | cmp dl,8 |
2733 | cmp dl,8 |
2723 | jne @f |
2734 | jne @f |
2724 | call ted_scroll_set_redraw |
2735 | call ted_scroll_set_redraw |
2725 | stdcall ted_draw,edi |
2736 | stdcall ted_draw,edi |
2726 | jmp .end_f |
2737 | jmp .end_f |
2727 | @@: |
2738 | @@: |
2728 | stdcall ted_draw_cur_line,edi |
2739 | stdcall ted_draw_cur_line,edi |
2729 | .end_f: |
2740 | .end_f: |
2730 | pop dx |
2741 | pop dx |
2731 | ret |
2742 | ret |
2732 | endp |
2743 | endp |
2733 | 2744 | ||
2734 | ;input: |
2745 | ;input: |
2735 | ; edi = pointer to tedit struct |
2746 | ; edi = pointer to tedit struct |
2736 | align 4 |
2747 | align 4 |
2737 | proc ted_sel_key_right |
2748 | proc ted_sel_key_right |
2738 | cmp ted_drag_k,1 |
2749 | cmp ted_drag_k,1 |
2739 | je @f |
2750 | je @f |
2740 | call ted_sel_start |
2751 | call ted_sel_start |
2741 | @@: |
2752 | @@: |
2742 | push dx |
2753 | push dx |
2743 | call ted_cur_move_right |
2754 | call ted_cur_move_right |
2744 | call ted_sel_move |
2755 | call ted_sel_move |
2745 | cmp ted_drag_k,1 |
2756 | cmp ted_drag_k,1 |
2746 | je @f |
2757 | je @f |
2747 | mov ted_drag_k,1 |
2758 | mov ted_drag_k,1 |
2748 | mov dl,8 |
2759 | mov dl,8 |
2749 | @@: |
2760 | @@: |
2750 | cmp dl,8 |
2761 | cmp dl,8 |
2751 | jne @f |
2762 | jne @f |
2752 | call ted_scroll_set_redraw |
2763 | call ted_scroll_set_redraw |
2753 | stdcall ted_draw,edi |
2764 | stdcall ted_draw,edi |
2754 | jmp .end_f |
2765 | jmp .end_f |
2755 | @@: |
2766 | @@: |
2756 | stdcall ted_draw_cur_line,edi |
2767 | stdcall ted_draw_cur_line,edi |
2757 | .end_f: |
2768 | .end_f: |
2758 | pop dx |
2769 | pop dx |
2759 | ret |
2770 | ret |
2760 | endp |
2771 | endp |
2761 | 2772 | ||
2762 | ;input: |
2773 | ;input: |
2763 | ; edi = pointer to tedit struct |
2774 | ; edi = pointer to tedit struct |
2764 | ;description: |
2775 | ;description: |
2765 | ; this function need to optimize output |
2776 | ; this function need to optimize output |
2766 | align 4 |
2777 | align 4 |
2767 | proc ted_draw_cursor_sumb |
2778 | proc ted_draw_cursor_sumb |
2768 | pushad |
2779 | pushad |
2769 | 2780 | ||
2770 | mov eax,13 ;rect |
2781 | mov eax,13 ;rect |
2771 | mov ebx,ted_wnd_l |
2782 | mov ebx,ted_wnd_l |
2772 | add ebx,ted_rec_l |
2783 | add ebx,ted_rec_l |
2773 | mov edx,ted_cur_x |
2784 | mov edx,ted_cur_x |
2774 | imul edx,ted_rec_w |
2785 | imul edx,ted_rec_w |
2775 | add ebx,edx |
2786 | add ebx,edx |
2776 | shl ebx,16 |
2787 | shl ebx,16 |
2777 | add ebx,ted_rec_w |
2788 | add ebx,ted_rec_w |
2778 | 2789 | ||
2779 | mov ecx,ted_wnd_t ;calc rect -> y0,y1 |
2790 | mov ecx,ted_wnd_t ;calc rect -> y0,y1 |
2780 | add ecx,ted_rec_t |
2791 | add ecx,ted_rec_t |
2781 | mov edx,ted_cur_y |
2792 | mov edx,ted_cur_y |
2782 | imul edx,ted_rec_h |
2793 | imul edx,ted_rec_h |
2783 | add ecx,edx |
2794 | add ecx,edx |
2784 | shl ecx,16 |
2795 | shl ecx,16 |
2785 | add ecx,ted_rec_h |
2796 | add ecx,ted_rec_h |
2786 | 2797 | ||
2787 | mov edx,ted_color_wnd_work |
2798 | mov edx,ted_color_wnd_work |
2788 | push ecx |
2799 | push ecx |
2789 | call ted_sel_normalize |
2800 | call ted_sel_normalize |
2790 | 2801 | ||
2791 | mov esi,ted_scr_w |
2802 | mov esi,ted_scr_w |
2792 | mov ecx,dword[esi+sb_offs_position] |
2803 | mov ecx,dword[esi+sb_offs_position] |
2793 | sub ted_seln_y0,ecx |
2804 | sub ted_seln_y0,ecx |
2794 | sub ted_seln_y1,ecx |
2805 | sub ted_seln_y1,ecx |
2795 | 2806 | ||
2796 | mov ecx,ted_cur_y |
2807 | mov ecx,ted_cur_y |
2797 | cmp ecx,ted_seln_y0 |
2808 | cmp ecx,ted_seln_y0 |
2798 | jl .no_cur_sel |
2809 | jl .no_cur_sel |
2799 | cmp ecx,ted_seln_y1 |
2810 | cmp ecx,ted_seln_y1 |
2800 | jg .no_cur_sel |
2811 | jg .no_cur_sel |
2801 | mov edx,ted_color_select ;¬¥ï¥¬ 梥â ä® æ¢¥â ¢ë¤¥«¥¨ï |
2812 | mov edx,ted_color_select ;¬¥ï¥¬ 梥â ä® æ¢¥â ¢ë¤¥«¥¨ï |
2802 | 2813 | ||
2803 | mov esi,ted_scr_h |
2814 | mov esi,ted_scr_h |
2804 | cmp ecx,ted_seln_y0 |
2815 | cmp ecx,ted_seln_y0 |
2805 | jne @f |
2816 | jne @f |
2806 | mov ecx,ted_cur_x |
2817 | mov ecx,ted_cur_x |
2807 | add ecx,dword[esi+sb_offs_position] |
2818 | add ecx,dword[esi+sb_offs_position] |
2808 | cmp ecx,ted_seln_x0 |
2819 | cmp ecx,ted_seln_x0 |
2809 | jge @f |
2820 | jge @f |
2810 | mov edx,ted_color_wnd_work |
2821 | mov edx,ted_color_wnd_work |
2811 | @@: |
2822 | @@: |
2812 | 2823 | ||
2813 | mov ecx,ted_cur_y |
2824 | mov ecx,ted_cur_y |
2814 | cmp ecx,ted_seln_y1 |
2825 | cmp ecx,ted_seln_y1 |
2815 | jne .no_cur_sel |
2826 | jne .no_cur_sel |
2816 | mov ecx,ted_cur_x |
2827 | mov ecx,ted_cur_x |
2817 | add ecx,dword[esi+sb_offs_position] |
2828 | add ecx,dword[esi+sb_offs_position] |
2818 | cmp ecx,ted_seln_x1 |
2829 | cmp ecx,ted_seln_x1 |
2819 | jl .no_cur_sel |
2830 | jl .no_cur_sel |
2820 | mov edx,ted_color_wnd_work |
2831 | mov edx,ted_color_wnd_work |
2821 | 2832 | ||
2822 | .no_cur_sel: |
2833 | .no_cur_sel: |
2823 | pop ecx |
2834 | pop ecx |
2824 | int 0x40 ;à¨á®¢ ¨¥ ¯àאַ㣮«ì¨ª |
2835 | int 0x40 ;à¨á®¢ ¨¥ ¯àאַ㣮«ì¨ª |
2825 | 2836 | ||
2826 | call ted_get_pos_by_cursor ;¡¥à¥¬ ¯®§¨æ¨î ᨬ¢®« |
2837 | call ted_get_pos_by_cursor ;¡¥à¥¬ ¯®§¨æ¨î ᨬ¢®« |
2827 | cmp ted_gp_opt,2 |
2838 | cmp ted_gp_opt,2 |
2828 | jne @f |
2839 | jne @f |
2829 | mov eax,4 |
2840 | mov eax,4 |
2830 | mov esi,1 |
2841 | mov esi,1 |
2831 | ror ecx,16 |
2842 | ror ecx,16 |
2832 | mov bx,cx |
2843 | mov bx,cx |
2833 | add ebx,0x10001 |
2844 | add ebx,0x10001 |
2834 | call ted_get_symb_color |
2845 | call ted_get_symb_color |
2835 | call ted_convert_invis_symb |
2846 | call ted_convert_invis_symb |
2836 | int 0x40 ;à¨á®¢ ¨¥ ᨬ¢®« |
2847 | int 0x40 ;à¨á®¢ ¨¥ ᨬ¢®« |
2837 | @@: |
2848 | @@: |
2838 | 2849 | ||
2839 | popad |
2850 | popad |
2840 | ret |
2851 | ret |
2841 | endp |
2852 | endp |
2842 | 2853 | ||
2843 | ;input: |
2854 | ;input: |
2844 | ; edx -> pointer to text |
2855 | ; edx -> pointer to text |
2845 | ; edi -> 㪠§ ⥫ì áâàãªâãàã tedit |
2856 | ; edi -> 㪠§ ⥫ì áâàãªâãàã tedit |
2846 | ;output: |
2857 | ;output: |
2847 | ; ecx = color |
2858 | ; ecx = color |
2848 | ; if ted_mode_color=0 then ecx=ted_color_wnd_text |
2859 | ; if ted_mode_color=0 then ecx=ted_color_wnd_text |
2849 | align 4 |
2860 | align 4 |
2850 | ted_get_symb_color: |
2861 | ted_get_symb_color: |
2851 | mov ecx,ted_color_wnd_text ;§ ¤ ¥¬ 梥â ⥪áâ ¯® 㬮«ç ¨î |
2862 | mov ecx,ted_color_wnd_text ;§ ¤ ¥¬ 梥â ⥪áâ ¯® 㬮«ç ¨î |
2852 | 2863 | ||
2853 | push eax edx |
2864 | push eax edx |
2854 | cmp ted_mode_color,0 |
2865 | cmp ted_mode_color,0 |
2855 | je .exit |
2866 | je .exit |
2856 | jmp .on_first |
2867 | jmp .on_first |
2857 | @@: |
2868 | @@: |
2858 | call ted_iterat_perv |
2869 | call ted_iterat_perv |
2859 | cmp edx,ted_tex_1 |
2870 | cmp edx,ted_tex_1 |
2860 | jle .exit |
2871 | jle .exit |
2861 | .on_first: |
2872 | .on_first: |
2862 | xor eax,eax |
2873 | xor eax,eax |
2863 | mov al,byte[edx+1] |
2874 | mov al,byte[edx+1] |
2864 | cmp al,0 ;¥á«¨ al=0 ⮠梥⠥ ¬¥ï¥âáï |
2875 | cmp al,0 ;¥á«¨ al=0 ⮠梥⠥ ¬¥ï¥âáï |
2865 | je @b |
2876 | je @b |
2866 | 2877 | ||
2867 | cmp eax,ted_colors_text_count |
2878 | cmp eax,ted_colors_text_count |
2868 | jge .exit |
2879 | jge .exit |
2869 | 2880 | ||
2870 | shl ax,2 ;㬮¦ ¥¬ ¨¤¥ªá 梥â 4 ¡ ©â |
2881 | shl ax,2 ;㬮¦ ¥¬ ¨¤¥ªá 梥â 4 ¡ ©â |
2871 | mov ecx,ted_text_colors ;¯à¨¡ ¢«ï¥¬ ᬥ饨¥ 1-£® 梥â |
2882 | mov ecx,ted_text_colors ;¯à¨¡ ¢«ï¥¬ ᬥ饨¥ 1-£® 梥â |
2872 | add ecx,eax |
2883 | add ecx,eax |
2873 | mov ecx,dword[ecx] ;ãáâ ¢«¨¢ ¥¬ ⥪ã騩 梥â ⥪áâ ¯® ᬥ饨î |
2884 | mov ecx,dword[ecx] ;ãáâ ¢«¨¢ ¥¬ ⥪ã騩 梥â ⥪áâ ¯® ᬥ饨î |
2874 | .exit: |
2885 | .exit: |
2875 | pop edx eax |
2886 | pop edx eax |
2876 | ret |
2887 | ret |
2877 | 2888 | ||
2878 | ;input: |
2889 | ;input: |
2879 | ; edx = pointer to text |
2890 | ; edx = pointer to text |
2880 | ; edi = pointer to tedit struct |
2891 | ; edi = pointer to tedit struct |
2881 | ;description: |
2892 | ;description: |
2882 | ; ãªæ¨ï ¯à¥®¡à §ã¥â ¥¢¨¤¨¬ë¥ ᨬ¢®«ë ¢ ¯¥ç â ¥¬ë¥ íªà ¥ |
2893 | ; ãªæ¨ï ¯à¥®¡à §ã¥â ¥¢¨¤¨¬ë¥ ᨬ¢®«ë ¢ ¯¥ç â ¥¬ë¥ íªà ¥ |
2883 | align 4 |
2894 | align 4 |
2884 | ted_convert_invis_symb: |
2895 | ted_convert_invis_symb: |
2885 | cmp ted_mode_invis,1 |
2896 | cmp ted_mode_invis,1 |
2886 | jne .end_f |
2897 | jne .end_f |
2887 | cmp byte[edx],9 |
2898 | cmp byte[edx],9 |
2888 | jne @f |
2899 | jne @f |
2889 | lea edx,[ted_symbol_tab] |
2900 | lea edx,[ted_symbol_tab] |
2890 | @@: |
2901 | @@: |
2891 | cmp byte[edx],13 |
2902 | cmp byte[edx],13 |
2892 | jne @f |
2903 | jne @f |
2893 | mov edx,edi |
2904 | mov edx,edi |
2894 | add edx,ted_offs_symbol_new_line |
2905 | add edx,ted_offs_symbol_new_line |
2895 | @@: |
2906 | @@: |
2896 | .end_f: |
2907 | .end_f: |
2897 | ret |
2908 | ret |
2898 | 2909 | ||
2899 | ;input: |
2910 | ;input: |
2900 | ; edi = pointer to tedit struct |
2911 | ; edi = pointer to tedit struct |
2901 | align 4 |
2912 | align 4 |
2902 | ted_scroll_set_redraw: |
2913 | ted_scroll_set_redraw: |
2903 | push eax |
2914 | push eax |
2904 | mov eax,ted_scr_w |
2915 | mov eax,ted_scr_w |
2905 | mov dword[eax+sb_offs_redraw],1 |
2916 | mov dword[eax+sb_offs_redraw],1 |
2906 | mov eax,ted_scr_h |
2917 | mov eax,ted_scr_h |
2907 | mov dword[eax+sb_offs_redraw],1 |
2918 | mov dword[eax+sb_offs_redraw],1 |
2908 | pop eax |
2919 | pop eax |
2909 | ret |
2920 | ret |
2910 | 2921 | ||
2911 | align 4 |
2922 | align 4 |
2912 | proc ted_draw, edit:dword |
2923 | proc ted_draw, edit:dword |
2913 | locals |
2924 | locals |
2914 | line_num dd ? |
2925 | line_num dd ? |
2915 | endl |
2926 | endl |
2916 | pushad |
2927 | pushad |
2917 | mov edi,dword[edit] |
2928 | mov edi,dword[edit] |
2918 | 2929 | ||
2919 | mov eax,4 ;draw text |
2930 | mov eax,4 ;draw text |
2920 | mov ecx,ted_text_colors |
2931 | mov ecx,ted_text_colors |
2921 | mov ecx,dword[ecx] |
2932 | mov ecx,dword[ecx] |
2922 | 2933 | ||
2923 | mov ebx,ted_wnd_l |
2934 | mov ebx,ted_wnd_l |
2924 | add ebx,ted_rec_l |
2935 | add ebx,ted_rec_l |
2925 | shl ebx,16 |
2936 | shl ebx,16 |
2926 | add ebx,ted_wnd_t |
2937 | add ebx,ted_wnd_t |
2927 | add ebx,ted_rec_t |
2938 | add ebx,ted_rec_t |
2928 | add ebx,0x10001 ;¤®¡ ¢«ï¥¬ ®âáâã¯ë ¤«ï ¢ëà ¢¨¢ ¨ï ¡ãª¢ë ¯® æ¥âàã |
2939 | add ebx,0x10001 ;¤®¡ ¢«ï¥¬ ®âáâã¯ë ¤«ï ¢ëà ¢¨¢ ¨ï ¡ãª¢ë ¯® æ¥âàã |
2929 | 2940 | ||
2930 | call ted_sel_normalize ;need before draw select |
2941 | call ted_sel_normalize ;need before draw select |
2931 | mov esi,ted_scr_w |
2942 | mov esi,ted_scr_w |
2932 | mov esi,dword[esi+sb_offs_position] |
2943 | mov esi,dword[esi+sb_offs_position] |
2933 | mov dword[line_num],esi |
2944 | mov dword[line_num],esi |
2934 | 2945 | ||
2935 | stdcall ted_clear_line_before_draw, edi,ebx,1,esi |
2946 | stdcall ted_clear_line_before_draw, edi,ebx,1,esi |
2936 | call ted_get_first_visible_pos |
2947 | call ted_get_first_visible_pos |
2937 | cmp edx,0 |
2948 | cmp edx,0 |
2938 | je .no_draw_text |
2949 | je .no_draw_text |
2939 | mov esi,1 ;¤«¨ ¢ë¢®¤¨¬®£® ⥪áâ ¯® 1-¬ã ᨬ¢®«ã |
2950 | mov esi,1 ;¤«¨ ¢ë¢®¤¨¬®£® ⥪áâ ¯® 1-¬ã ᨬ¢®«ã |
2940 | @@: |
2951 | @@: |
2941 | call ted_iterat_next |
2952 | call ted_iterat_next |
2942 | cmp edx,ted_tex_1 |
2953 | cmp edx,ted_tex_1 |
2943 | jle .no_draw_text |
2954 | jle .no_draw_text |
2944 | 2955 | ||
2945 | ; *** 梥⮢ ï à §¬¥âª |
2956 | ; *** 梥⮢ ï à §¬¥âª |
2946 | cmp ted_mode_color,0 |
2957 | cmp ted_mode_color,0 |
2947 | je .no_col_change |
2958 | je .no_col_change |
2948 | cmp byte[edx+1],0 |
2959 | cmp byte[edx+1],0 |
2949 | je .no_col_change |
2960 | je .no_col_change |
2950 | call ted_get_symb_color |
2961 | call ted_get_symb_color |
2951 | .no_col_change: |
2962 | .no_col_change: |
2952 | 2963 | ||
2953 | cmp byte [edx],13 |
2964 | cmp byte [edx],13 |
2954 | jne .no_13 |
2965 | jne .no_13 |
2955 | cmp ted_mode_invis,1 |
2966 | cmp ted_mode_invis,1 |
2956 | jne .no_invis |
2967 | jne .no_invis |
2957 | push edx |
2968 | push edx |
2958 | mov edx,edi |
2969 | mov edx,edi |
2959 | add edx,ted_offs_symbol_new_line |
2970 | add edx,ted_offs_symbol_new_line |
2960 | int 0x40 |
2971 | int 0x40 |
2961 | pop edx |
2972 | pop edx |
2962 | .no_invis: |
2973 | .no_invis: |
2963 | add ebx,ted_rec_h |
2974 | add ebx,ted_rec_h |
2964 | ;optimized output \/ |
2975 | ;optimized output \/ |
2965 | mov eax,ted_wnd_h |
2976 | mov eax,ted_wnd_h |
2966 | add eax,ted_wnd_t |
2977 | add eax,ted_wnd_t |
2967 | cmp bx,ax |
2978 | cmp bx,ax |
2968 | jg .no_draw_text |
2979 | jg .no_draw_text |
2969 | mov eax,4 |
2980 | mov eax,4 |
2970 | ;optimized output /\ |
2981 | ;optimized output /\ |
2971 | and ebx,0xffff |
2982 | and ebx,0xffff |
2972 | ror ebx,16 |
2983 | ror ebx,16 |
2973 | add ebx,ted_wnd_l |
2984 | add ebx,ted_wnd_l |
2974 | add ebx,ted_rec_l |
2985 | add ebx,ted_rec_l |
2975 | inc ebx |
2986 | inc ebx |
2976 | ror ebx,16 |
2987 | ror ebx,16 |
2977 | inc dword[line_num] ;increment line number |
2988 | inc dword[line_num] ;increment line number |
2978 | stdcall ted_clear_line_before_draw,edi,ebx,1,dword[line_num] |
2989 | stdcall ted_clear_line_before_draw,edi,ebx,1,dword[line_num] |
2979 | call ted_opt_draw_line_left |
2990 | call ted_opt_draw_line_left |
2980 | jmp @b |
2991 | jmp @b |
2981 | .no_13: |
2992 | .no_13: |
2982 | 2993 | ||
2983 | int 0x40 |
2994 | int 0x40 |
2984 | ror ebx,16 |
2995 | ror ebx,16 |
2985 | add ebx,ted_rec_w |
2996 | add ebx,ted_rec_w |
2986 | mov esi,ted_wnd_l |
2997 | mov esi,ted_wnd_l |
2987 | add esi,ted_wnd_w |
2998 | add esi,ted_wnd_w |
2988 | cmp bx,si |
2999 | cmp bx,si |
2989 | jl .no_opt |
3000 | jl .no_opt |
2990 | call ted_opt_draw_line_right |
3001 | call ted_opt_draw_line_right |
2991 | .no_opt: |
3002 | .no_opt: |
2992 | mov si,1 |
3003 | mov si,1 |
2993 | ror ebx,16 |
3004 | ror ebx,16 |
2994 | jmp @b |
3005 | jmp @b |
2995 | .no_draw_text: |
3006 | .no_draw_text: |
2996 | 3007 | ||
2997 | stdcall ted_clear_line_before_draw,edi,ebx,0,dword[line_num] |
3008 | stdcall ted_clear_line_before_draw,edi,ebx,0,dword[line_num] |
2998 | call ted_draw_line_numbers |
3009 | call ted_draw_line_numbers |
2999 | call ted_draw_main_cursor |
3010 | call ted_draw_main_cursor |
3000 | 3011 | ||
3001 | ;--------------------------------------------- |
3012 | ;--------------------------------------------- |
3002 | ; set all_redraw flag for draw all ScrollBar |
3013 | ; set all_redraw flag for draw all ScrollBar |
3003 | ; In some cases it is necessity to draw only the area |
3014 | ; In some cases it is necessity to draw only the area |
3004 | ; of moving of a "runner", for acceleration of output - |
3015 | ; of moving of a "runner", for acceleration of output - |
3005 | ; in this case the flag needs to be reset to 0 (zero). |
3016 | ; in this case the flag needs to be reset to 0 (zero). |
3006 | mov eax,ted_scr_h |
3017 | mov eax,ted_scr_h |
3007 | mov esi,ted_scr_w |
3018 | mov esi,ted_scr_w |
3008 | mov dword[eax+sb_offs_all_redraw],1 |
3019 | mov dword[eax+sb_offs_all_redraw],1 |
3009 | mov dword[esi+sb_offs_all_redraw],1 |
3020 | mov dword[esi+sb_offs_all_redraw],1 |
3010 | 3021 | ||
3011 | ; à¨á®¢ ¨¥ ¯®«®á ¯à®ªàã⪨ |
3022 | ; à¨á®¢ ¨¥ ¯®«®á ¯à®ªàã⪨ |
3012 | stdcall scroll_bar_horizontal.draw,eax ;[scrollbar_hor_draw] |
3023 | stdcall scroll_bar_horizontal.draw,eax ;[scrollbar_hor_draw] |
3013 | stdcall scroll_bar_vertical.draw,esi ;[scrollbar_ver_draw] |
3024 | stdcall scroll_bar_vertical.draw,esi ;[scrollbar_ver_draw] |
3014 | ; reset all_redraw flag |
3025 | ; reset all_redraw flag |
3015 | mov dword[eax+sb_offs_all_redraw],0 |
3026 | mov dword[eax+sb_offs_all_redraw],0 |
3016 | mov dword[esi+sb_offs_all_redraw],0 |
3027 | mov dword[esi+sb_offs_all_redraw],0 |
3017 | ;--------------------------------------------- |
3028 | ;--------------------------------------------- |
3018 | 3029 | ||
3019 | ;left-bottom square |
3030 | ;left-bottom square |
3020 | mov ebx,ted_wnd_l |
3031 | mov ebx,ted_wnd_l |
3021 | shl ebx,16 |
3032 | shl ebx,16 |
3022 | add ebx,ted_rec_l |
3033 | add ebx,ted_rec_l |
3023 | mov ecx,ted_wnd_t |
3034 | mov ecx,ted_wnd_t |
3024 | add ecx,ted_wnd_h |
3035 | add ecx,ted_wnd_h |
3025 | shl ecx,16 |
3036 | shl ecx,16 |
3026 | mov cx,word[eax+sb_offs_size_y] |
3037 | mov cx,word[eax+sb_offs_size_y] |
3027 | inc cx |
3038 | inc cx |
3028 | mov edx,ted_color_wnd_capt ;[sc.work] |
3039 | mov edx,ted_color_wnd_capt ;[sc.work] |
3029 | mov eax,13 |
3040 | mov eax,13 |
3030 | int 0x40 |
3041 | int 0x40 |
3031 | 3042 | ||
3032 | ;right-bottom square |
3043 | ;right-bottom square |
3033 | mov ebx,ted_wnd_l |
3044 | mov ebx,ted_wnd_l |
3034 | add ebx,ted_wnd_w |
3045 | add ebx,ted_wnd_w |
3035 | shl ebx,16 |
3046 | shl ebx,16 |
3036 | mov bx,word[esi+sb_offs_size_x] |
3047 | mov bx,word[esi+sb_offs_size_x] |
3037 | inc bx |
3048 | inc bx |
3038 | int 0x40 |
3049 | int 0x40 |
3039 | 3050 | ||
3040 | cmp ted_fun_draw_panel_find,0 |
3051 | cmp ted_fun_draw_panel_find,0 |
3041 | je @f |
3052 | je @f |
3042 | call ted_fun_draw_panel_find |
3053 | call ted_fun_draw_panel_find |
3043 | @@: |
3054 | @@: |
3044 | cmp ted_fun_draw_panel_syntax,0 |
3055 | cmp ted_fun_draw_panel_syntax,0 |
3045 | je @f |
3056 | je @f |
3046 | call ted_fun_draw_panel_syntax |
3057 | call ted_fun_draw_panel_syntax |
3047 | @@: |
3058 | @@: |
3048 | popad |
3059 | popad |
3049 | ret |
3060 | ret |
3050 | endp |
3061 | endp |
3051 | 3062 | ||
3052 | ;input: |
3063 | ;input: |
3053 | ; edi = pointer to tedit struct |
3064 | ; edi = pointer to tedit struct |
3054 | align 4 |
3065 | align 4 |
3055 | proc ted_draw_main_cursor |
3066 | proc ted_draw_main_cursor |
3056 | pushad |
3067 | pushad |
3057 | 3068 | ||
3058 | mov eax,13 ;draw cursor |
3069 | mov eax,13 ;draw cursor |
3059 | mov ecx,ted_wnd_t ;calc rect -> y0,y1 |
3070 | mov ecx,ted_wnd_t ;calc rect -> y0,y1 |
3060 | add ecx,ted_rec_t |
3071 | add ecx,ted_rec_t |
3061 | mov edx,ted_cur_y |
3072 | mov edx,ted_cur_y |
3062 | imul edx,ted_rec_h |
3073 | imul edx,ted_rec_h |
3063 | add ecx,edx |
3074 | add ecx,edx |
3064 | 3075 | ||
3065 | cmp ted_cur_ins,1 ;¯à®¢¥àª ०¨¬ à ¡®âë ªãàá®à (®¡ëçë© ¨«¨ ¢áâ ¢ª ) |
3076 | cmp ted_cur_ins,1 ;¯à®¢¥àª ०¨¬ à ¡®âë ªãàá®à (®¡ëçë© ¨«¨ ¢áâ ¢ª ) |
3066 | jne @f |
3077 | jne @f |
3067 | mov edx,ted_rec_h |
3078 | mov edx,ted_rec_h |
3068 | inc edx ;1->1, 3->2, 5->3, ... |
3079 | inc edx ;1->1, 3->2, 5->3, ... |
3069 | shr edx,1 ;edx = ¢ëá®â áâப¨ ¤¥«¥ ï 2 (ª®£¤ ªãàá®à ¥ ¯®«ë©) |
3080 | shr edx,1 ;edx = ¢ëá®â áâப¨ ¤¥«¥ ï 2 (ª®£¤ ªãàá®à ¥ ¯®«ë©) |
3070 | add ecx,edx |
3081 | add ecx,edx |
3071 | @@: |
3082 | @@: |
3072 | shl ecx,16 |
3083 | shl ecx,16 |
3073 | add ecx,ted_rec_h |
3084 | add ecx,ted_rec_h |
3074 | cmp ted_cur_ins,1 |
3085 | cmp ted_cur_ins,1 |
3075 | jne @f |
3086 | jne @f |
3076 | shr cx,1 ;¤¥«¨¬ ¢ëá®âã ªãàá®à 2 |
3087 | shr cx,1 ;¤¥«¨¬ ¢ëá®âã ªãàá®à 2 |
3077 | @@: |
3088 | @@: |
3078 | 3089 | ||
3079 | mov ebx,ted_wnd_l ;calc rect -> x0,x1 |
3090 | mov ebx,ted_wnd_l ;calc rect -> x0,x1 |
3080 | add ebx,ted_rec_l |
3091 | add ebx,ted_rec_l |
3081 | mov edx,ted_cur_x |
3092 | mov edx,ted_cur_x |
3082 | imul edx,ted_rec_w |
3093 | imul edx,ted_rec_w |
3083 | add ebx,edx |
3094 | add ebx,edx |
3084 | shl ebx,16 |
3095 | shl ebx,16 |
3085 | add ebx,ted_rec_w |
3096 | add ebx,ted_rec_w |
3086 | 3097 | ||
3087 | mov edx,ted_color_cursor |
3098 | mov edx,ted_color_cursor |
3088 | int 0x40 ;¢ë¢®¤ ªãàá®à |
3099 | int 0x40 ;¢ë¢®¤ ªãàá®à |
3089 | 3100 | ||
3090 | call ted_get_pos_by_cursor |
3101 | call ted_get_pos_by_cursor |
3091 | cmp ted_gp_opt,2 |
3102 | cmp ted_gp_opt,2 |
3092 | jne @f |
3103 | jne @f |
3093 | mov eax,4 ;draw text |
3104 | mov eax,4 ;draw text |
3094 | mov esi,1 |
3105 | mov esi,1 |
3095 | ror ecx,16 |
3106 | ror ecx,16 |
3096 | mov bx,cx |
3107 | mov bx,cx |
3097 | add ebx,0x10001 |
3108 | add ebx,0x10001 |
3098 | cmp ted_cur_ins,1 |
3109 | cmp ted_cur_ins,1 |
3099 | jne .no_up_tetx |
3110 | jne .no_up_tetx |
3100 | mov ecx,ted_rec_h |
3111 | mov ecx,ted_rec_h |
3101 | inc cx ; 1->1, 3->2, 5->3, ... |
3112 | inc cx ; 1->1, 3->2, 5->3, ... |
3102 | shr cx,1 |
3113 | shr cx,1 |
3103 | sub bx,cx |
3114 | sub bx,cx |
3104 | .no_up_tetx: |
3115 | .no_up_tetx: |
3105 | mov ecx,ted_color_cur_text |
3116 | mov ecx,ted_color_cur_text |
3106 | call ted_convert_invis_symb |
3117 | call ted_convert_invis_symb |
3107 | int 0x40 |
3118 | int 0x40 |
3108 | @@: |
3119 | @@: |
3109 | 3120 | ||
3110 | mov eax,4 |
3121 | mov eax,4 |
3111 | mov ebx,ted_wnd_l |
3122 | mov ebx,ted_wnd_l |
3112 | add ebx,ted_rec_l |
3123 | add ebx,ted_rec_l |
3113 | shl ebx,16 |
3124 | shl ebx,16 |
3114 | add ebx,ted_wnd_t |
3125 | add ebx,ted_wnd_t |
3115 | add ebx,3 |
3126 | add ebx,3 |
3116 | mov ecx,ted_color_wnd_bord |
3127 | mov ecx,ted_color_wnd_bord |
3117 | or ecx,0x80000000 |
3128 | or ecx,0x80000000 |
3118 | lea edx,[txtRow] |
3129 | lea edx,[txtRow] |
3119 | int 0x40 ;¢ë¢®¤ ¯®¤¯¨á¨ 'âப ' |
3130 | int 0x40 ;¢ë¢®¤ ¯®¤¯¨á¨ 'âப ' |
3120 | 3131 | ||
3121 | add ebx,0x500000 |
3132 | add ebx,0x500000 |
3122 | lea edx,[txtCol] |
3133 | lea edx,[txtCol] |
3123 | int 0x40 ;¢ë¢®¤ ¯®¤¯¨á¨ ' ª' |
3134 | int 0x40 ;¢ë¢®¤ ¯®¤¯¨á¨ ' ª' |
3124 | 3135 | ||
3125 | cmp ted_tim_undo,0 |
3136 | cmp ted_tim_undo,0 |
3126 | je @f |
3137 | je @f |
3127 | add ebx,0x500000 |
3138 | add ebx,0x500000 |
3128 | lea edx,[txtOtm] |
3139 | lea edx,[txtOtm] |
3129 | int 0x40 |
3140 | int 0x40 |
3130 | sub ebx,0x500000 |
3141 | sub ebx,0x500000 |
3131 | @@: |
3142 | @@: |
3132 | 3143 | ||
3133 | call ted_draw_buffer |
3144 | call ted_draw_buffer |
3134 | call ted_draw_help_f1 |
3145 | call ted_draw_help_f1 |
3135 | 3146 | ||
3136 | mov eax,47 ;draw cursor coords |
3147 | mov eax,47 ;draw cursor coords |
3137 | mov esi,ted_color_wnd_bord |
3148 | mov esi,ted_color_wnd_bord |
3138 | or esi,0x40000000 |
3149 | or esi,0x40000000 |
3139 | 3150 | ||
3140 | mov edx,ebx |
3151 | mov edx,ebx |
3141 | ror edx,16 |
3152 | ror edx,16 |
3142 | sub edx,35 |
3153 | sub edx,35 |
3143 | ror edx,16 |
3154 | ror edx,16 |
3144 | ;add edx,3 |
3155 | ;add edx,3 |
3145 | mov ebx,0x40000 ;Row=... |
3156 | mov ebx,0x40000 ;Row=... |
3146 | mov ecx,ted_scr_w |
3157 | mov ecx,ted_scr_w |
3147 | mov ecx,dword[ecx+sb_offs_position] |
3158 | mov ecx,dword[ecx+sb_offs_position] |
3148 | add ecx,ted_cur_y |
3159 | add ecx,ted_cur_y |
3149 | inc ecx |
3160 | inc ecx |
3150 | 3161 | ||
3151 | push edi |
3162 | push edi |
3152 | mov edi,ted_color_wnd_work |
3163 | mov edi,ted_color_wnd_work |
3153 | int 0x40 ;¢ë¢®¤ ç¨á« ⥪ã饩 áâப¨ |
3164 | int 0x40 ;¢ë¢®¤ ç¨á« ⥪ã饩 áâப¨ |
3154 | pop edi |
3165 | pop edi |
3155 | 3166 | ||
3156 | ;mov ebx,0x40000 ;Col=... |
3167 | ;mov ebx,0x40000 ;Col=... |
3157 | mov ecx,ted_scr_h |
3168 | mov ecx,ted_scr_h |
3158 | mov ecx,dword[ecx+sb_offs_position] |
3169 | mov ecx,dword[ecx+sb_offs_position] |
3159 | add ecx,ted_cur_x |
3170 | add ecx,ted_cur_x |
3160 | inc ecx |
3171 | inc ecx |
3161 | add edx,0x500000 |
3172 | add edx,0x500000 |
3162 | push edi |
3173 | push edi |
3163 | mov edi,ted_color_wnd_work |
3174 | mov edi,ted_color_wnd_work |
3164 | int 0x40 ;¢ë¢®¤ ç¨á« § ª®¢ |
3175 | int 0x40 ;¢ë¢®¤ ç¨á« § ª®¢ |
3165 | pop edi |
3176 | pop edi |
3166 | 3177 | ||
3167 | cmp ted_tim_undo,0 |
3178 | cmp ted_tim_undo,0 |
3168 | je @f |
3179 | je @f |
3169 | mov ecx,ted_tim_undo |
3180 | mov ecx,ted_tim_undo |
3170 | add edx,0x500000 |
3181 | add edx,0x500000 |
3171 | mov edi,ted_color_wnd_work ;¯®à⨬ ॣ¨áâà edi, ® ¢ ª®æ¥ äãªæ¨¨ í⮠㦥 ¥ ¢ ¦® |
3182 | mov edi,ted_color_wnd_work ;¯®à⨬ ॣ¨áâà edi, ® ¢ ª®æ¥ äãªæ¨¨ í⮠㦥 ¥ ¢ ¦® |
3172 | int 0x40 ;¢ë¢®¤ ç¨á« ®â¬¥¥ëå ¤¥©á⢨© |
3183 | int 0x40 ;¢ë¢®¤ ç¨á« ®â¬¥¥ëå ¤¥©á⢨© |
3173 | @@: |
3184 | @@: |
3174 | 3185 | ||
3175 | popad |
3186 | popad |
3176 | ret |
3187 | ret |
3177 | endp |
3188 | endp |
3178 | 3189 | ||
3179 | ;input: |
3190 | ;input: |
3180 | ; edi = pointer to tedit struct |
3191 | ; edi = pointer to tedit struct |
3181 | proc ted_draw_buffer |
3192 | proc ted_draw_buffer |
3182 | pushad |
3193 | pushad |
3183 | 3194 | ||
3184 | mov eax,ted_buffer |
3195 | mov eax,ted_buffer |
3185 | cmp byte[eax],0 ;ᬮâਬ 1-© ᨬ¢®« ¨§ ¡ãä¥à |
3196 | cmp byte[eax],0 ;ᬮâਬ 1-© ᨬ¢®« ¨§ ¡ãä¥à |
3186 | je @f |
3197 | je @f |
3187 | mov ebx,ted_rec_l |
3198 | mov ebx,ted_rec_l |
3188 | add bx,300 |
3199 | add bx,300 |
3189 | cmp ebx,ted_wnd_w ;áà ¢¨¢ ¥¬ ª®®à¤¨ âã ¤«ï ¢ë¢®¤ ⥪áâ |
3200 | cmp ebx,ted_wnd_w ;áà ¢¨¢ ¥¬ ª®®à¤¨ âã ¤«ï ¢ë¢®¤ ⥪áâ |
3190 | jge @f ;¯®¤¯¨áì ¥ ¢« §¨â ¢ ®ª® |
3201 | jge @f ;¯®¤¯¨áì ¥ ¢« §¨â ¢ ®ª® |
3191 | 3202 | ||
3192 | add ebx,ted_wnd_l |
3203 | add ebx,ted_wnd_l |
3193 | shl ebx,16 |
3204 | shl ebx,16 |
3194 | add ebx,ted_wnd_t |
3205 | add ebx,ted_wnd_t |
3195 | add ebx,3 |
3206 | add ebx,3 |
3196 | mov ecx,ted_color_wnd_bord |
3207 | mov ecx,ted_color_wnd_bord |
3197 | or ecx,0x40000000 |
3208 | or ecx,0x40000000 |
3198 | 3209 | ||
3199 | mov edx,ted_buffer |
3210 | mov edx,ted_buffer |
3200 | mov esi,edx |
3211 | mov esi,edx |
3201 | mov edi,ted_color_wnd_work ;edi - destroy not pointer to tedit |
3212 | mov edi,ted_color_wnd_work ;edi - destroy not pointer to tedit |
3202 | call tl_strlen |
3213 | call tl_strlen |
3203 | ;cmp eax,0 ;¡ãä¥à ¯ãáâ |
3214 | ;cmp eax,0 ;¡ãä¥à ¯ãáâ |
3204 | ;je @f |
3215 | ;je @f |
3205 | cmp eax,20 |
3216 | cmp eax,20 |
3206 | jle .crop_buf |
3217 | jle .crop_buf |
3207 | mov eax,20 ;®¡à¥§ª ¯®¤¯¨á¨ ¤® 20 ᨬ¢®«®¢ |
3218 | mov eax,20 ;®¡à¥§ª ¯®¤¯¨á¨ ¤® 20 ᨬ¢®«®¢ |
3208 | .crop_buf: |
3219 | .crop_buf: |
3209 | mov esi,eax |
3220 | mov esi,eax |
3210 | mov eax,4 |
3221 | mov eax,4 |
3211 | int 0x40 ;¢ë¢®¤ ᮤ¥à¦¨¬®£® ¡ãä¥à |
3222 | int 0x40 ;¢ë¢®¤ ᮤ¥à¦¨¬®£® ¡ãä¥à |
3212 | 3223 | ||
3213 | sub ebx,50 shl 16 |
3224 | sub ebx,50 shl 16 |
3214 | lea edx,[txtBuf] |
3225 | lea edx,[txtBuf] |
3215 | mov esi,edx |
3226 | mov esi,edx |
3216 | call tl_strlen |
3227 | call tl_strlen |
3217 | mov esi,eax |
3228 | mov esi,eax |
3218 | mov eax,4 |
3229 | mov eax,4 |
3219 | xor ecx,0x40000000 ;ã¡¨à ¥¬ 梥â ä® |
3230 | xor ecx,0x40000000 ;ã¡¨à ¥¬ 梥â ä® |
3220 | int 0x40 ;¢ë¢®¤ ¯®¤¯¨á¨ ¤«ï ¡ãä¥à |
3231 | int 0x40 ;¢ë¢®¤ ¯®¤¯¨á¨ ¤«ï ¡ãä¥à |
3221 | @@: |
3232 | @@: |
3222 | popad |
3233 | popad |
3223 | ret |
3234 | ret |
3224 | endp |
3235 | endp |
3225 | 3236 | ||
3226 | ;input: |
3237 | ;input: |
3227 | ; edi = pointer to tedit struct |
3238 | ; edi = pointer to tedit struct |
3228 | align 4 |
3239 | align 4 |
3229 | proc ted_draw_help_f1 |
3240 | proc ted_draw_help_f1 |
3230 | pushad |
3241 | pushad |
3231 | cmp ted_rec_t,13 ;¬¨¨¬ «ì ï ¢ëá®â ¤«ï à¨á®¢ ¨ï á¯à ¢ª¨ |
3242 | cmp ted_rec_t,13 ;¬¨¨¬ «ì ï ¢ëá®â ¤«ï à¨á®¢ ¨ï á¯à ¢ª¨ |
3232 | jle @f |
3243 | jle @f |
3233 | mov eax,13 ;clear place before draw help |
3244 | mov eax,13 ;clear place before draw help |
3234 | mov ebx,ted_wnd_l |
3245 | mov ebx,ted_wnd_l |
3235 | add ebx,ted_rec_l |
3246 | add ebx,ted_rec_l |
3236 | shl ebx,16 |
3247 | shl ebx,16 |
3237 | add ebx,ted_wnd_w |
3248 | add ebx,ted_wnd_w |
3238 | sub ebx,ted_rec_l |
3249 | sub ebx,ted_rec_l |
3239 | mov ecx,ted_wnd_t |
3250 | mov ecx,ted_wnd_t |
3240 | add ecx,13 |
3251 | add ecx,13 |
3241 | shl ecx,16 |
3252 | shl ecx,16 |
3242 | add ecx,ted_rec_h |
3253 | add ecx,ted_rec_h |
3243 | mov edx,ted_color_wnd_capt |
3254 | mov edx,ted_color_wnd_capt |
3244 | int 0x40 |
3255 | int 0x40 |
3245 | 3256 | ||
3246 | cmp ted_help_id,-1 |
3257 | cmp ted_help_id,-1 |
3247 | je @f |
3258 | je @f |
3248 | mov eax,ted_help_id |
3259 | mov eax,ted_help_id |
3249 | ColToIndexOffset eax,edx |
3260 | ColToIndexOffset eax,edx |
3250 | 3261 | ||
3251 | ;SetCoordinates |
3262 | ;SetCoordinates |
3252 | mov ebx,ted_wnd_l |
3263 | mov ebx,ted_wnd_l |
3253 | add ebx,ted_rec_l |
3264 | add ebx,ted_rec_l |
3254 | shl ebx,16 |
3265 | shl ebx,16 |
3255 | add ebx,ted_wnd_t |
3266 | add ebx,ted_wnd_t |
3256 | add ebx,13 ;=3+10 |
3267 | add ebx,13 ;=3+10 |
3257 | 3268 | ||
3258 | ;SetTextColor |
3269 | ;SetTextColor |
3259 | xor eax,eax |
3270 | xor eax,eax |
3260 | mov al,byte[edx+MAX_COLOR_WORD_LEN+6] |
3271 | mov al,byte[edx+MAX_COLOR_WORD_LEN+6] |
3261 | shl ax,2 |
3272 | shl ax,2 |
3262 | mov ecx,ted_text_colors |
3273 | mov ecx,ted_text_colors |
3263 | add ecx,eax |
3274 | add ecx,eax |
3264 | mov ecx,dword[ecx] |
3275 | mov ecx,dword[ecx] |
3265 | or ecx,0xc0000000 ;SetTextStyles |
3276 | or ecx,0xc0000000 ;SetTextStyles |
3266 | mov esi,edi |
3277 | mov esi,edi |
3267 | mov edi,ted_color_wnd_work |
3278 | mov edi,ted_color_wnd_work |
3268 | mov eax,4 |
3279 | mov eax,4 |
3269 | int 0x40 |
3280 | int 0x40 |
3270 | mov edi,esi |
3281 | mov edi,esi |
3271 | 3282 | ||
3272 | ;*** draw help string *** |
3283 | ;*** draw help string *** |
3273 | mov ecx,ted_color_wnd_bord |
3284 | mov ecx,ted_color_wnd_bord |
3274 | or ecx,0x80000000 |
3285 | or ecx,0x80000000 |
3275 | mov edx,dword[edx+MAX_COLOR_WORD_LEN] |
3286 | mov edx,dword[edx+MAX_COLOR_WORD_LEN] |
3276 | cmp edx,0 |
3287 | cmp edx,0 |
3277 | je @f |
3288 | je @f |
3278 | add edx,ted_help_text_f1 |
3289 | add edx,ted_help_text_f1 |
3279 | add ebx,0x500000 |
3290 | add ebx,0x500000 |
3280 | int 0x40 |
3291 | int 0x40 |
3281 | @@: |
3292 | @@: |
3282 | popad |
3293 | popad |
3283 | ret |
3294 | ret |
3284 | endp |
3295 | endp |
3285 | 3296 | ||
3286 | ;input: |
3297 | ;input: |
3287 | ; edi = pointer to tedit struct |
3298 | ; edi = pointer to tedit struct |
3288 | align 4 |
3299 | align 4 |
3289 | proc ted_draw_line_numbers |
3300 | proc ted_draw_line_numbers |
3290 | pushad |
3301 | pushad |
3291 | 3302 | ||
3292 | ;top panel with caption |
3303 | ;top panel with caption |
3293 | mov ebx,ted_wnd_l |
3304 | mov ebx,ted_wnd_l |
3294 | ; add ebx,ted_rec_l |
3305 | ; add ebx,ted_rec_l |
3295 | shl ebx,16 |
3306 | shl ebx,16 |
3296 | add ebx,ted_wnd_w |
3307 | add ebx,ted_wnd_w |
3297 | ; sub ebx,ted_rec_l |
3308 | ; sub ebx,ted_rec_l |
3298 | mov edx,ted_color_wnd_work |
3309 | mov edx,ted_color_wnd_work |
3299 | mov ecx,ted_wnd_t |
3310 | mov ecx,ted_wnd_t |
3300 | shl ecx,16 |
3311 | shl ecx,16 |
3301 | add ecx,ted_rec_t |
3312 | add ecx,ted_rec_t |
3302 | mov eax,13 |
3313 | mov eax,13 |
3303 | mov edx,ted_color_wnd_capt |
3314 | mov edx,ted_color_wnd_capt |
3304 | int 0x40 |
3315 | int 0x40 |
3305 | 3316 | ||
3306 | ;line numbers |
3317 | ;line numbers |
3307 | mov ebx,0x40000 ;format |
3318 | mov ebx,0x40000 ;format |
3308 | mov ecx,ted_scr_w |
3319 | mov ecx,ted_scr_w |
3309 | mov ecx,dword[ecx+sb_offs_position] |
3320 | mov ecx,dword[ecx+sb_offs_position] |
3310 | inc ecx |
3321 | inc ecx |
3311 | mov edx,3 |
3322 | mov edx,3 |
3312 | add edx,ted_wnd_l |
3323 | add edx,ted_wnd_l |
3313 | rol edx,16 |
3324 | rol edx,16 |
3314 | add edx,ted_wnd_t |
3325 | add edx,ted_wnd_t |
3315 | add edx,ted_rec_t |
3326 | add edx,ted_rec_t |
3316 | @@: |
3327 | @@: |
3317 | 3328 | ||
3318 | push ebx ecx edx |
3329 | push ebx ecx edx |
3319 | ;left panel with numbers |
3330 | ;left panel with numbers |
3320 | mov ebx,ted_wnd_l |
3331 | mov ebx,ted_wnd_l |
3321 | shl ebx,16 |
3332 | shl ebx,16 |
3322 | add ebx,ted_rec_l |
3333 | add ebx,ted_rec_l |
3323 | mov ecx,ted_rec_h |
3334 | mov ecx,ted_rec_h |
3324 | rol ecx,16 |
3335 | rol ecx,16 |
3325 | mov cx,dx |
3336 | mov cx,dx |
3326 | rol ecx,16 |
3337 | rol ecx,16 |
3327 | mov eax,13 |
3338 | mov eax,13 |
3328 | mov edx,ted_color_wnd_capt |
3339 | mov edx,ted_color_wnd_capt |
3329 | int 0x40 ;à¨á㥬 ¯àאַ㣮«ì¨ª ¯®¤ ®¬¥à®¬ áâப¨ |
3340 | int 0x40 ;à¨á㥬 ¯àאַ㣮«ì¨ª ¯®¤ ®¬¥à®¬ áâப¨ |
3330 | pop edx ecx ebx |
3341 | pop edx ecx ebx |
3331 | 3342 | ||
3332 | mov eax,47 |
3343 | mov eax,47 |
3333 | mov esi,ted_color_wnd_bord |
3344 | mov esi,ted_color_wnd_bord |
3334 | int 0x40 ;à¨á㥬 ®¬¥à áâப¨ |
3345 | int 0x40 ;à¨á㥬 ®¬¥à áâப¨ |
3335 | inc ecx |
3346 | inc ecx |
3336 | add edx,ted_rec_h |
3347 | add edx,ted_rec_h |
3337 | sub edx,ted_wnd_t |
3348 | sub edx,ted_wnd_t |
3338 | mov esi,edx |
3349 | mov esi,edx |
3339 | and esi,0xffff |
3350 | and esi,0xffff |
3340 | cmp esi,ted_wnd_h |
3351 | cmp esi,ted_wnd_h |
3341 | jge @f |
3352 | jge @f |
3342 | add edx,ted_wnd_t |
3353 | add edx,ted_wnd_t |
3343 | jmp @b |
3354 | jmp @b |
3344 | @@: |
3355 | @@: |
3345 | 3356 | ||
3346 | popad |
3357 | popad |
3347 | ret |
3358 | ret |
3348 | endp |
3359 | endp |
3349 | 3360 | ||
3350 | ;output: |
3361 | ;output: |
3351 | ; ah = symbol |
3362 | ; ah = symbol |
3352 | align 4 |
3363 | align 4 |
3353 | proc KeyConvertToASCII, table:dword |
3364 | proc KeyConvertToASCII, table:dword |
3354 | push ebx |
3365 | push ebx |
3355 | mov ebx,dword[table] ;convert scan to ascii |
3366 | mov ebx,dword[table] ;convert scan to ascii |
3356 | ror ax,8 |
3367 | ror ax,8 |
3357 | xor ah,ah |
3368 | xor ah,ah |
3358 | add bx,ax |
3369 | add bx,ax |
3359 | mov ah,byte[ebx] |
3370 | mov ah,byte[ebx] |
3360 | pop ebx |
3371 | pop ebx |
3361 | ret |
3372 | ret |
3362 | endp |
3373 | endp |
3363 | 3374 | ||
3364 | align 4 |
3375 | align 4 |
3365 | proc ted_draw_cur_line, edit:dword |
3376 | proc ted_draw_cur_line, edit:dword |
3366 | pushad |
3377 | pushad |
3367 | mov edi,dword[edit] |
3378 | mov edi,dword[edit] |
3368 | 3379 | ||
3369 | mov ebx,ted_wnd_l |
3380 | mov ebx,ted_wnd_l |
3370 | add ebx,ted_rec_l |
3381 | add ebx,ted_rec_l |
3371 | shl ebx,16 |
3382 | shl ebx,16 |
3372 | mov eax,ted_cur_y |
3383 | mov eax,ted_cur_y |
3373 | imul eax,ted_rec_h |
3384 | imul eax,ted_rec_h |
3374 | mov bx,ax |
3385 | mov bx,ax |
3375 | add ebx,ted_wnd_t |
3386 | add ebx,ted_wnd_t |
3376 | add ebx,ted_rec_t ;ebx - ª®®à¤¨ âë ¤«ï ¯àאַ㣮«ì¨ª ®ç¨á⪨ «¨¨¨ |
3387 | add ebx,ted_rec_t ;ebx - ª®®à¤¨ âë ¤«ï ¯àאַ㣮«ì¨ª ®ç¨á⪨ «¨¨¨ |
3377 | add ebx,0x10001 ;¤®¡ ¢«ï¥¬ ®âáâã¯ë ¤«ï ¢ëà ¢¨¢ ¨ï ¡ãª¢ë ¯® æ¥âàã |
3388 | add ebx,0x10001 ;¤®¡ ¢«ï¥¬ ®âáâã¯ë ¤«ï ¢ëà ¢¨¢ ¨ï ¡ãª¢ë ¯® æ¥âàã |
3378 | 3389 | ||
3379 | call ted_sel_normalize ;need before draw select |
3390 | call ted_sel_normalize ;need before draw select |
3380 | mov ecx,ted_cur_y |
3391 | mov ecx,ted_cur_y |
3381 | mov eax,ted_scr_w |
3392 | mov eax,ted_scr_w |
3382 | add ecx,dword[eax+sb_offs_position] |
3393 | add ecx,dword[eax+sb_offs_position] |
3383 | stdcall ted_clear_line_before_draw,edi,ebx,1,ecx |
3394 | stdcall ted_clear_line_before_draw,edi,ebx,1,ecx |
3384 | 3395 | ||
3385 | mov eax,ted_scr_h |
3396 | mov eax,ted_scr_h |
3386 | mov esi,dword[eax+sb_offs_position] |
3397 | mov esi,dword[eax+sb_offs_position] |
3387 | call ted_get_pos_by_coords |
3398 | call ted_get_pos_by_coords |
3388 | 3399 | ||
3389 | cmp ted_gp_opt,2 |
3400 | cmp ted_gp_opt,2 |
3390 | jne .no_draw_text |
3401 | jne .no_draw_text |
3391 | ; mov eax,4 ;draw text |
3402 | ; mov eax,4 ;draw text |
3392 | call ted_get_symb_color |
3403 | call ted_get_symb_color |
3393 | mov esi,1 ;draw 1 symbol |
3404 | mov esi,1 ;draw 1 symbol |
3394 | @@: |
3405 | @@: |
3395 | ;call ted_iterat_next |
3406 | ;call ted_iterat_next |
3396 | cmp edx,ted_tex_1 |
3407 | cmp edx,ted_tex_1 |
3397 | jle .no_draw_text |
3408 | jle .no_draw_text |
3398 | 3409 | ||
3399 | ; *** 梥⮢ ï à §¬¥âª |
3410 | ; *** 梥⮢ ï à §¬¥âª |
3400 | cmp ted_mode_color,0 |
3411 | cmp ted_mode_color,0 |
3401 | je .no_col_change |
3412 | je .no_col_change |
3402 | cmp byte[edx+1],0 |
3413 | cmp byte[edx+1],0 |
3403 | je .no_col_change |
3414 | je .no_col_change |
3404 | call ted_get_symb_color |
3415 | call ted_get_symb_color |
3405 | .no_col_change: |
3416 | .no_col_change: |
3406 | 3417 | ||
3407 | mov eax,4 ;draw text |
3418 | mov eax,4 ;draw text |
3408 | cmp byte [edx],13 |
3419 | cmp byte [edx],13 |
3409 | jne .no_13 |
3420 | jne .no_13 |
3410 | cmp ted_mode_invis,1 |
3421 | cmp ted_mode_invis,1 |
3411 | jne .no_draw_text |
3422 | jne .no_draw_text |
3412 | push edx |
3423 | push edx |
3413 | mov edx,edi |
3424 | mov edx,edi |
3414 | add edx,ted_offs_symbol_new_line |
3425 | add edx,ted_offs_symbol_new_line |
3415 | int 0x40 |
3426 | int 0x40 |
3416 | pop edx |
3427 | pop edx |
3417 | jmp .no_draw_text |
3428 | jmp .no_draw_text |
3418 | .no_13: |
3429 | .no_13: |
3419 | 3430 | ||
3420 | int 0x40 |
3431 | int 0x40 |
3421 | ror ebx,16 |
3432 | ror ebx,16 |
3422 | add ebx,ted_rec_w |
3433 | add ebx,ted_rec_w |
3423 | mov eax,ted_wnd_w |
3434 | mov eax,ted_wnd_w |
3424 | add eax,ted_wnd_l ;ax = ®âáâ㯠¯® ®á¨ x |
3435 | add eax,ted_wnd_l ;ax = ®âáâ㯠¯® ®á¨ x |
3425 | cmp bx,ax |
3436 | cmp bx,ax |
3426 | jge .no_draw_text ;Opt |
3437 | jge .no_draw_text ;Opt |
3427 | ror ebx,16 |
3438 | ror ebx,16 |
3428 | call ted_iterat_next |
3439 | call ted_iterat_next |
3429 | jmp @b |
3440 | jmp @b |
3430 | .no_draw_text: |
3441 | .no_draw_text: |
3431 | 3442 | ||
3432 | call ted_draw_main_cursor |
3443 | call ted_draw_main_cursor |
3433 | popad |
3444 | popad |
3434 | ret |
3445 | ret |
3435 | endp |
3446 | endp |
3436 | 3447 | ||
3437 | ;input: |
3448 | ;input: |
3438 | ; eax - text need find |
3449 | ; eax - text need find |
3439 | ; bl - first symbol to find |
3450 | ; bl - first symbol to find |
3440 | ; edx - first symbol pointer |
3451 | ; edx - first symbol pointer |
3441 | ; edi - pointer to tedit struct |
3452 | ; edi - pointer to tedit struct |
3442 | ;output: |
3453 | ;output: |
3443 | ; bh - rezult |
3454 | ; bh - rezult |
3444 | ; edx - last text position (if find sucess) |
3455 | ; edx - last text position (if find sucess) |
3445 | ; esi - first symbol pointer |
3456 | ; esi - first symbol pointer |
3446 | ;description: |
3457 | ;description: |
3447 | ; ãªæ¨ï ¯à®¢¥àï¥â ᮢ¯ ¤ ¥â «¨ ⥪áâ ¢ ¡ãä¥à¥ eax |
3458 | ; ãªæ¨ï ¯à®¢¥àï¥â ᮢ¯ ¤ ¥â «¨ ⥪áâ ¢ ¡ãä¥à¥ eax |
3448 | ; á ⥪á⮬ । ªâ®à ¯® 㪠§ ⥫î edx. |
3459 | ; á ⥪á⮬ । ªâ®à ¯® 㪠§ ⥫î edx. |
3449 | ; â ¤ àâë¥ äãªæ¨¨ ( ¯à. strcmp) âãâ ¥ ¯®¤®©¤ãâ, ¯®â®¬ã çâ® |
3460 | ; â ¤ àâë¥ äãªæ¨¨ ( ¯à. strcmp) âãâ ¥ ¯®¤®©¤ãâ, ¯®â®¬ã çâ® |
3450 | ; ¢ ¯ ¬ï⨠। ªâ®à ⥪áâ ᮤ¥à¦¨âáï ¥ ¢ ¢¨¤¥ ascii áâப. |
3461 | ; ¢ ¯ ¬ï⨠। ªâ®à ⥪áâ ᮤ¥à¦¨âáï ¥ ¢ ¢¨¤¥ ascii áâப. |
3451 | align 4 |
3462 | align 4 |
3452 | ted_get_find_rezult: |
3463 | ted_get_find_rezult: |
3453 | push eax |
3464 | push eax |
3454 | mov bh,1 |
3465 | mov bh,1 |
3455 | mov esi,edx ;copy edx |
3466 | mov esi,edx ;copy edx |
3456 | @@: |
3467 | @@: |
3457 | cmp byte[edx],bl |
3468 | cmp byte[edx],bl |
3458 | jne .no_text |
3469 | jne .no_text |
3459 | 3470 | ||
3460 | inc eax ;*** get next symbol (in find text) *** |
3471 | inc eax ;*** get next symbol (in find text) *** |
3461 | mov bl,byte[eax] |
3472 | mov bl,byte[eax] |
3462 | cmp bl,0 |
3473 | cmp bl,0 |
3463 | je @f ;end of find text |
3474 | je @f ;end of find text |
3464 | 3475 | ||
3465 | call ted_iterat_next ;*** get next symbol (in editor text) *** |
3476 | call ted_iterat_next ;*** get next symbol (in editor text) *** |
3466 | cmp edx,ted_tex_1 |
3477 | cmp edx,ted_tex_1 |
3467 | jle @f ;end of editor text |
3478 | jle @f ;end of editor text |
3468 | 3479 | ||
3469 | jmp @b |
3480 | jmp @b |
3470 | .no_text: |
3481 | .no_text: |
3471 | xor bh,bh |
3482 | xor bh,bh |
3472 | mov edx,esi ;restore edx |
3483 | mov edx,esi ;restore edx |
3473 | @@: |
3484 | @@: |
3474 | pop eax |
3485 | pop eax |
3475 | mov bl,byte[eax] ;restore bl |
3486 | mov bl,byte[eax] ;restore bl |
3476 | ret |
3487 | ret |
3477 | 3488 | ||
3478 | ;input: |
3489 | ;input: |
3479 | ; clear_o - ¥á«¨ =1 ®ç¨áâ¨âì ®¤ã áâபã, =0 ®ç¨áâ¨âì ¢á¥ áâப¨ ®ª ¤® ¨§ã |
3490 | ; clear_o - ¥á«¨ =1 ®ç¨áâ¨âì ®¤ã áâபã, =0 ®ç¨áâ¨âì ¢á¥ áâப¨ ®ª ¤® ¨§ã |
3480 | align 4 |
3491 | align 4 |
3481 | proc ted_clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword |
3492 | proc ted_clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword |
3482 | pushad |
3493 | pushad |
3483 | mov edi,dword[edit] |
3494 | mov edi,dword[edit] |
3484 | mov ebx,dword[coords] ;ebx = x*2^16+y coords to left up point clear line |
3495 | mov ebx,dword[coords] ;ebx = x*2^16+y coords to left up point clear line |
3485 | mov esi,dword[numb_lin] ;esi - number text line |
3496 | mov esi,dword[numb_lin] ;esi - number text line |
3486 | 3497 | ||
3487 | sub ebx,0x10001 ;®â¨¬ ¥¬ ®âáâã¯ë ¤«ï ¢ëà ¢¨¢ ¨ï ¡ãª¢ë ¯® æ¥âàã |
3498 | sub ebx,0x10001 ;®â¨¬ ¥¬ ®âáâã¯ë ¤«ï ¢ëà ¢¨¢ ¨ï ¡ãª¢ë ¯® æ¥âàã |
3488 | cmp dword[clear_o],0 |
3499 | cmp dword[clear_o],0 |
3489 | jne @f |
3500 | jne @f |
3490 | add ebx,ted_rec_h |
3501 | add ebx,ted_rec_h |
3491 | inc esi |
3502 | inc esi |
3492 | ror ebx,16 |
3503 | ror ebx,16 |
3493 | xor bx,bx |
3504 | xor bx,bx |
3494 | add ebx,ted_wnd_l |
3505 | add ebx,ted_wnd_l |
3495 | add ebx,ted_rec_l ;bx = ted_wnd_l+ted_rec_l |
3506 | add ebx,ted_rec_l ;bx = ted_wnd_l+ted_rec_l |
3496 | ror ebx,16 |
3507 | ror ebx,16 |
3497 | @@: |
3508 | @@: |
3498 | 3509 | ||
3499 | mov eax,ted_wnd_h |
3510 | mov eax,ted_wnd_h |
3500 | add eax,ted_wnd_t |
3511 | add eax,ted_wnd_t |
3501 | cmp ax,bx |
3512 | cmp ax,bx |
3502 | jl .no_clear |
3513 | jl .no_clear |
3503 | sub ax,bx |
3514 | sub ax,bx |
3504 | 3515 | ||
3505 | mov cx,bx |
3516 | mov cx,bx |
3506 | shl ecx,16 |
3517 | shl ecx,16 |
3507 | 3518 | ||
3508 | xor bx,bx |
3519 | xor bx,bx |
3509 | add ebx,ted_wnd_w |
3520 | add ebx,ted_wnd_w |
3510 | sub ebx,ted_rec_l |
3521 | sub ebx,ted_rec_l |
3511 | xor cx,cx |
3522 | xor cx,cx |
3512 | add ecx,ted_rec_h |
3523 | add ecx,ted_rec_h |
3513 | mov edx,ted_color_wnd_work |
3524 | mov edx,ted_color_wnd_work |
3514 | 3525 | ||
3515 | cmp dword[clear_o],0 |
3526 | cmp dword[clear_o],0 |
3516 | je .pusto |
3527 | je .pusto |
3517 | cmp ax,cx |
3528 | cmp ax,cx |
3518 | jge @f |
3529 | jge @f |
3519 | .pusto: |
3530 | .pusto: |
3520 | mov cx,ax |
3531 | mov cx,ax |
3521 | @@: |
3532 | @@: |
3522 | 3533 | ||
3523 | call ted_is_select |
3534 | call ted_is_select |
3524 | cmp al,0 |
3535 | cmp al,0 |
3525 | je @f |
3536 | je @f |
3526 | cmp ted_seln_y0,esi |
3537 | cmp ted_seln_y0,esi |
3527 | jg @f |
3538 | jg @f |
3528 | cmp ted_seln_y1,esi |
3539 | cmp ted_seln_y1,esi |
3529 | jl @f |
3540 | jl @f |
3530 | mov edx,ted_color_select ;draw selected line |
3541 | mov edx,ted_color_select ;draw selected line |
3531 | @@: |
3542 | @@: |
3532 | 3543 | ||
3533 | mov eax,13 ;rect |
3544 | mov eax,13 ;rect |
3534 | int 0x40 |
3545 | int 0x40 |
3535 | 3546 | ||
3536 | call ted_is_select |
3547 | call ted_is_select |
3537 | cmp al,0 |
3548 | cmp al,0 |
3538 | je .no_clear |
3549 | je .no_clear |
3539 | 3550 | ||
3540 | mov al,13 ;rect |
3551 | mov al,13 ;rect |
3541 | xor cx,cx |
3552 | xor cx,cx |
3542 | add ecx,ted_rec_h |
3553 | add ecx,ted_rec_h |
3543 | cmp ted_seln_y0,esi |
3554 | cmp ted_seln_y0,esi |
3544 | jne @f |
3555 | jne @f |
3545 | push bx esi |
3556 | push bx esi |
3546 | mov edx,ted_seln_x0 ; ¢¥àåïï ¯®«®á (§ â¨à ¥â á«¥¢ ) |
3557 | mov edx,ted_seln_x0 ; ¢¥àåïï ¯®«®á (§ â¨à ¥â á«¥¢ ) |
3547 | mov esi,ted_scr_h |
3558 | mov esi,ted_scr_h |
3548 | cmp edx,dword[esi+sb_offs_position] |
3559 | cmp edx,dword[esi+sb_offs_position] |
3549 | jle .in_wnd |
3560 | jle .in_wnd |
3550 | sub edx,dword[esi+sb_offs_position] |
3561 | sub edx,dword[esi+sb_offs_position] |
3551 | imul edx,ted_rec_w |
3562 | imul edx,ted_rec_w |
3552 | mov bx,dx |
3563 | mov bx,dx |
3553 | jmp .no_wnd |
3564 | jmp .no_wnd |
3554 | .in_wnd: |
3565 | .in_wnd: |
3555 | mov bx,0 |
3566 | mov bx,0 |
3556 | .no_wnd: |
3567 | .no_wnd: |
3557 | mov edx,ted_color_wnd_work |
3568 | mov edx,ted_color_wnd_work |
3558 | int 0x40 |
3569 | int 0x40 |
3559 | pop esi bx |
3570 | pop esi bx |
3560 | @@: |
3571 | @@: |
3561 | cmp ted_seln_y1,esi |
3572 | cmp ted_seln_y1,esi |
3562 | jne @f |
3573 | jne @f |
3563 | push esi |
3574 | push esi |
3564 | mov edx,ted_seln_x1 ; ¨¦ïï ¯®«®á (§ â¨à ¥â á¯à ¢ ) |
3575 | mov edx,ted_seln_x1 ; ¨¦ïï ¯®«®á (§ â¨à ¥â á¯à ¢ ) |
3565 | mov esi,ted_scr_h |
3576 | mov esi,ted_scr_h |
3566 | cmp edx,dword[esi+sb_offs_position] |
3577 | cmp edx,dword[esi+sb_offs_position] |
3567 | jle .in_wnd2 |
3578 | jle .in_wnd2 |
3568 | sub edx,dword[esi+sb_offs_position] |
3579 | sub edx,dword[esi+sb_offs_position] |
3569 | imul edx,ted_rec_w |
3580 | imul edx,ted_rec_w |
3570 | sub bx,dx |
3581 | sub bx,dx |
3571 | shl edx,16 |
3582 | shl edx,16 |
3572 | add ebx,edx |
3583 | add ebx,edx |
3573 | .in_wnd2: |
3584 | .in_wnd2: |
3574 | 3585 | ||
3575 | mov edx,ted_color_wnd_work |
3586 | mov edx,ted_color_wnd_work |
3576 | int 0x40 |
3587 | int 0x40 |
3577 | pop esi |
3588 | pop esi |
3578 | @@: |
3589 | @@: |
3579 | 3590 | ||
3580 | .no_clear: |
3591 | .no_clear: |
3581 | popad |
3592 | popad |
3582 | ret |
3593 | ret |
3583 | endp |
3594 | endp |
3584 | 3595 | ||
3585 | ;input: |
3596 | ;input: |
3586 | ; edi = pointer to tedit struct |
3597 | ; edi = pointer to tedit struct |
3587 | ;output: |
3598 | ;output: |
3588 | ; ecx = ®¢ë© 梥â ᨬ¢®« |
3599 | ; ecx = ®¢ë© 梥â ᨬ¢®« |
3589 | ; edx = pointer to symbol |
3600 | ; edx = pointer to symbol |
3590 | ; edx = 0 if text not in screen |
3601 | ; edx = 0 if text not in screen |
3591 | align 4 |
3602 | align 4 |
3592 | ted_get_first_visible_pos: |
3603 | ted_get_first_visible_pos: |
3593 | push eax ecx |
3604 | push eax ecx |
3594 | mov eax,ted_scr_w |
3605 | mov eax,ted_scr_w |
3595 | mov edx,ted_tex |
3606 | mov edx,ted_tex |
3596 | xor ecx,ecx |
3607 | xor ecx,ecx |
3597 | @@: |
3608 | @@: |
3598 | cmp ecx,dword[eax+sb_offs_position] |
3609 | cmp ecx,dword[eax+sb_offs_position] |
3599 | je @f |
3610 | je @f |
3600 | call ted_iterat_next |
3611 | call ted_iterat_next |
3601 | cmp edx,ted_tex_1 |
3612 | cmp edx,ted_tex_1 |
3602 | jle @f |
3613 | jle @f |
3603 | cmp byte [edx],13 |
3614 | cmp byte [edx],13 |
3604 | jne @b |
3615 | jne @b |
3605 | inc ecx |
3616 | inc ecx |
3606 | jmp @b |
3617 | jmp @b |
3607 | @@: |
3618 | @@: |
3608 | 3619 | ||
3609 | cmp ecx,dword[eax+sb_offs_position] |
3620 | cmp ecx,dword[eax+sb_offs_position] |
3610 | je @f |
3621 | je @f |
3611 | xor edx,edx |
3622 | xor edx,edx |
3612 | @@: |
3623 | @@: |
3613 | cmp ecx,dword[eax+sb_offs_max_area] |
3624 | cmp ecx,dword[eax+sb_offs_max_area] |
3614 | jle @f |
3625 | jle @f |
3615 | mov dword[eax+sb_offs_max_area],ecx |
3626 | mov dword[eax+sb_offs_max_area],ecx |
3616 | @@: |
3627 | @@: |
3617 | pop ecx eax |
3628 | pop ecx eax |
3618 | call ted_opt_draw_line_left |
3629 | call ted_opt_draw_line_left |
3619 | ret |
3630 | ret |
3620 | 3631 | ||
3621 | ;input: |
3632 | ;input: |
3622 | ; edx = pointer to symbol |
3633 | ; edx = pointer to symbol |
3623 | ; edi = pointer to tedit struct |
3634 | ; edi = pointer to tedit struct |
3624 | ;output: |
3635 | ;output: |
3625 | ; ecx = 梥â ᨬ¢®« |
3636 | ; ecx = 梥â ᨬ¢®« |
3626 | ; edx = 㪠§ â¥«ì ¯¥à¢ë© «¥¢ë© ᨬ¢®« |
3637 | ; edx = 㪠§ â¥«ì ¯¥à¢ë© «¥¢ë© ᨬ¢®« |
3627 | ;description: |
3638 | ;description: |
3628 | ; äãªæ¨ï 㦠¤«ï ®¯â¨¬¨§ 樨 ¢ë¢®¤ ⥪áâ |
3639 | ; äãªæ¨ï 㦠¤«ï ®¯â¨¬¨§ 樨 ¢ë¢®¤ ⥪áâ |
3629 | align 4 |
3640 | align 4 |
3630 | proc ted_opt_draw_line_left |
3641 | proc ted_opt_draw_line_left |
3631 | push ebx |
3642 | push ebx |
3632 | 3643 | ||
3633 | mov ebx,ted_scr_h |
3644 | mov ebx,ted_scr_h |
3634 | mov ebx,dword[ebx+sb_offs_position] |
3645 | mov ebx,dword[ebx+sb_offs_position] |
3635 | cmp ebx,0 |
3646 | cmp ebx,0 |
3636 | je .ret_f |
3647 | je .ret_f |
3637 | push eax |
3648 | push eax |
3638 | mov eax,edx |
3649 | mov eax,edx |
3639 | 3650 | ||
3640 | cmp edx,ted_tex |
3651 | cmp edx,ted_tex |
3641 | jne @f |
3652 | jne @f |
3642 | call ted_iterat_next |
3653 | call ted_iterat_next |
3643 | jmp .beg_cycle |
3654 | jmp .beg_cycle |
3644 | @@: |
3655 | @@: |
3645 | 3656 | ||
3646 | cmp ebx,0 |
3657 | cmp ebx,0 |
3647 | je @f |
3658 | je @f |
3648 | 3659 | ||
3649 | cmp byte[edx],13 |
3660 | cmp byte[edx],13 |
3650 | jne @f |
3661 | jne @f |
3651 | call ted_iterat_next |
3662 | call ted_iterat_next |
3652 | .beg_cycle: |
3663 | .beg_cycle: |
3653 | @@: |
3664 | @@: |
3654 | cmp edx,ted_tex_1 |
3665 | cmp edx,ted_tex_1 |
3655 | jle @f |
3666 | jle @f |
3656 | cmp byte[edx],13 |
3667 | cmp byte[edx],13 |
3657 | je @f |
3668 | je @f |
3658 | cmp ebx,0 |
3669 | cmp ebx,0 |
3659 | je @f |
3670 | je @f |
3660 | ;-------------------------------------- |
3671 | ;-------------------------------------- |
3661 | xor eax,eax ;eax ¡ã¤¥â ¬¥ïâìáï |
3672 | xor eax,eax ;eax ¡ã¤¥â ¬¥ïâìáï |
3662 | mov al,byte[edx+1] |
3673 | mov al,byte[edx+1] |
3663 | cmp al,0 |
3674 | cmp al,0 |
3664 | je .no_color |
3675 | je .no_color |
3665 | cmp eax,ted_colors_text_count |
3676 | cmp eax,ted_colors_text_count |
3666 | jge .no_color |
3677 | jge .no_color |
3667 | xor ecx,ecx |
3678 | xor ecx,ecx |
3668 | mov cl,byte[edx+1] |
3679 | mov cl,byte[edx+1] |
3669 | shl cx,2 |
3680 | shl cx,2 |
3670 | add ecx,ted_text_colors |
3681 | add ecx,ted_text_colors |
3671 | mov ecx,dword[ecx] |
3682 | mov ecx,dword[ecx] |
3672 | .no_color: |
3683 | .no_color: |
3673 | ;-------------------------------------- |
3684 | ;-------------------------------------- |
3674 | mov eax,edx |
3685 | mov eax,edx |
3675 | call ted_iterat_next |
3686 | call ted_iterat_next |
3676 | dec ebx |
3687 | dec ebx |
3677 | jmp @b |
3688 | jmp @b |
3678 | @@: |
3689 | @@: |
3679 | mov edx,eax |
3690 | mov edx,eax |
3680 | pop eax |
3691 | pop eax |
3681 | .ret_f: |
3692 | .ret_f: |
3682 | call ted_get_symb_color |
3693 | call ted_get_symb_color |
3683 | pop ebx |
3694 | pop ebx |
3684 | ret |
3695 | ret |
3685 | endp |
3696 | endp |
3686 | 3697 | ||
3687 | ;input: |
3698 | ;input: |
3688 | ; edx = pointer to symbol |
3699 | ; edx = pointer to symbol |
3689 | ; edi = pointer to tedit struct |
3700 | ; edi = pointer to tedit struct |
3690 | ;output: |
3701 | ;output: |
3691 | ; ecx = symbol color |
3702 | ; ecx = symbol color |
3692 | ; edx = pointer to 13 symbol |
3703 | ; edx = pointer to 13 symbol |
3693 | ;description: |
3704 | ;description: |
3694 | ; äãªæ¨ï 㦠¤«ï ®¯â¨¬¨§ 樨 ¢ë¢®¤ ⥪áâ |
3705 | ; äãªæ¨ï 㦠¤«ï ®¯â¨¬¨§ 樨 ¢ë¢®¤ ⥪áâ |
3695 | align 4 |
3706 | align 4 |
3696 | proc ted_opt_draw_line_right |
3707 | proc ted_opt_draw_line_right |
3697 | push eax |
3708 | push eax |
3698 | mov eax,edx |
3709 | mov eax,edx |
3699 | @@: |
3710 | @@: |
3700 | cmp edx,ted_tex_1 |
3711 | cmp edx,ted_tex_1 |
3701 | jle @f |
3712 | jle @f |
3702 | cmp byte[edx],13 |
3713 | cmp byte[edx],13 |
3703 | je @f |
3714 | je @f |
3704 | mov eax,edx |
3715 | mov eax,edx |
3705 | call ted_iterat_next |
3716 | call ted_iterat_next |
3706 | jmp @b |
3717 | jmp @b |
3707 | @@: |
3718 | @@: |
3708 | mov edx,eax ;perv sumbol |
3719 | mov edx,eax ;perv sumbol |
3709 | call ted_get_symb_color |
3720 | call ted_get_symb_color |
3710 | 3721 | ||
3711 | pop eax |
3722 | pop eax |
3712 | ret |
3723 | ret |
3713 | endp |
3724 | endp |
3714 | 3725 | ||
3715 | align 4 |
3726 | align 4 |
3716 | proc ted_mouse, edit:dword |
3727 | proc ted_mouse, edit:dword |
3717 | pushad |
3728 | pushad |
3718 | mov edi,dword[edit] |
3729 | mov edi,dword[edit] |
3719 | 3730 | ||
3720 | ;®¡à ¡ âë¢ ¥¬ áªà®««¨£¨ |
3731 | ;®¡à ¡ âë¢ ¥¬ áªà®««¨£¨ |
3721 | mov edx,ted_scr_h |
3732 | mov edx,ted_scr_h |
3722 | mov ecx,ted_scr_w |
3733 | mov ecx,ted_scr_w |
3723 | 3734 | ||
3724 | cmp word[edx+sb_offs_delta2],0 |
3735 | cmp word[edx+sb_offs_delta2],0 |
3725 | jne .horizontal |
3736 | jne .horizontal |
3726 | 3737 | ||
3727 | mov eax,dword[ecx+sb_offs_max_area] |
3738 | mov eax,dword[ecx+sb_offs_max_area] |
3728 | cmp eax,dword[ecx+sb_offs_cur_area] |
3739 | cmp eax,dword[ecx+sb_offs_cur_area] |
3729 | jbe .horizontal |
3740 | jbe .horizontal |
3730 | ; mouse event for Vertical ScrollBar |
3741 | ; mouse event for Vertical ScrollBar |
3731 | stdcall scroll_bar_vertical.mouse,ecx ;[scrollbar_ver_mouse] |
3742 | stdcall scroll_bar_vertical.mouse,ecx ;[scrollbar_ver_mouse] |
3732 | cmp dword[ecx+sb_offs_redraw],0 |
3743 | cmp dword[ecx+sb_offs_redraw],0 |
3733 | je @f |
3744 | je @f |
3734 | mov dword[ecx+sb_offs_redraw],0 |
3745 | mov dword[ecx+sb_offs_redraw],0 |
3735 | stdcall ted_draw,edi |
3746 | stdcall ted_draw,edi |
3736 | jmp .no_in_wnd |
3747 | jmp .no_in_wnd |
3737 | @@: |
3748 | @@: |
3738 | cmp word[ecx+sb_offs_delta2],0 |
3749 | cmp word[ecx+sb_offs_delta2],0 |
3739 | jne .no_in_wnd |
3750 | jne .no_in_wnd |
3740 | .horizontal: |
3751 | .horizontal: |
3741 | mov eax,dword[edx+sb_offs_max_area] |
3752 | mov eax,dword[edx+sb_offs_max_area] |
3742 | cmp eax,dword[edx+sb_offs_cur_area] |
3753 | cmp eax,dword[edx+sb_offs_cur_area] |
3743 | jbe .other |
3754 | jbe .other |
3744 | ; mouse event for Horizontal ScrollBar |
3755 | ; mouse event for Horizontal ScrollBar |
3745 | stdcall scroll_bar_horizontal.mouse,edx ;[scrollbar_hor_mouse] |
3756 | stdcall scroll_bar_horizontal.mouse,edx ;[scrollbar_hor_mouse] |
3746 | cmp dword[edx+sb_offs_redraw],0 |
3757 | cmp dword[edx+sb_offs_redraw],0 |
3747 | je .other |
3758 | je .other |
3748 | mov dword[edx+sb_offs_redraw],0 |
3759 | mov dword[edx+sb_offs_redraw],0 |
3749 | stdcall ted_draw,edi |
3760 | stdcall ted_draw,edi |
3750 | jmp .no_in_wnd |
3761 | jmp .no_in_wnd |
3751 | .other: |
3762 | .other: |
3752 | cmp word[ecx+sb_offs_delta2],0 |
3763 | cmp word[ecx+sb_offs_delta2],0 |
3753 | jne .no_in_wnd |
3764 | jne .no_in_wnd |
3754 | cmp word[edx+sb_offs_delta2],0 |
3765 | cmp word[edx+sb_offs_delta2],0 |
3755 | jne .no_in_wnd |
3766 | jne .no_in_wnd |
3756 | 3767 | ||
3757 | ;®¡à ¡ âë¢ ¥¬ ®ª® । ªâ®à |
3768 | ;®¡à ¡ âë¢ ¥¬ ®ª® । ªâ®à |
3758 | mcall 37,2 ;get mouse buttons |
3769 | mcall 37,2 ;get mouse buttons |
3759 | cmp al,1 |
3770 | cmp al,1 |
3760 | jne @f |
3771 | jne @f |
3761 | mcall 37,1 ;get mouse coords |
3772 | mcall 37,1 ;get mouse coords |
3762 | mov ebx,ted_wnd_t |
3773 | mov ebx,ted_wnd_t |
3763 | add ebx,ted_rec_t |
3774 | add ebx,ted_rec_t |
3764 | cmp ax,bx |
3775 | cmp ax,bx |
3765 | jl @f ;y_mouse |
3776 | jl @f ;y_mouse |
3766 | 3777 | ||
3767 | sub ebx,ted_rec_t |
3778 | sub ebx,ted_rec_t |
3768 | add ebx,ted_wnd_h |
3779 | add ebx,ted_wnd_h |
3769 | cmp bx,ax |
3780 | cmp bx,ax |
3770 | jl @f ;y_mouse>y_wnd |
3781 | jl @f ;y_mouse>y_wnd |
3771 | 3782 | ||
3772 | mov ebx,ted_wnd_l |
3783 | mov ebx,ted_wnd_l |
3773 | add ebx,ted_rec_l |
3784 | add ebx,ted_rec_l |
3774 | mov ecx,eax |
3785 | mov ecx,eax |
3775 | shr ecx,16 |
3786 | shr ecx,16 |
3776 | cmp cx,bx |
3787 | cmp cx,bx |
3777 | jl @f ;x_mouse |
3788 | jl @f ;x_mouse |
3778 | 3789 | ||
3779 | sub ebx,ted_rec_l |
3790 | sub ebx,ted_rec_l |
3780 | add ebx,ted_wnd_w |
3791 | add ebx,ted_wnd_w |
3781 | cmp bx,cx |
3792 | cmp bx,cx |
3782 | jl @f ;x_mouse>x_wnd |
3793 | jl @f ;x_mouse>x_wnd |
3783 | 3794 | ||
3784 | call ted_draw_cursor_sumb |
3795 | call ted_draw_cursor_sumb |
3785 | call ted_wnd_main_click |
3796 | call ted_wnd_main_click |
3786 | jmp .no_in_wnd |
3797 | jmp .no_in_wnd |
3787 | @@: |
3798 | @@: |
3788 | mov edx,ted_el_focus |
3799 | mov edx,ted_el_focus |
3789 | cmp dword[edx],edi |
3800 | cmp dword[edx],edi |
3790 | jne @f |
3801 | jne @f |
3791 | call ted_wnd_main_mouse_scroll ;ᬮâਬ ¯à®ªàãâªã ª®«¥á ¬ëè¨ |
3802 | call ted_wnd_main_mouse_scroll ;ᬮâਬ ¯à®ªàãâªã ª®«¥á ¬ëè¨ |
3792 | @@: |
3803 | @@: |
3793 | cmp ted_drag_m,0 |
3804 | cmp ted_drag_m,0 |
3794 | je .no_in_wnd |
3805 | je .no_in_wnd |
3795 | mov ted_drag_m,0 |
3806 | mov ted_drag_m,0 |
3796 | stdcall ted_draw,edi |
3807 | stdcall ted_draw,edi |
3797 | cmp ted_fun_draw_panel_buttons,0 |
3808 | cmp ted_fun_draw_panel_buttons,0 |
3798 | je .no_in_wnd |
3809 | je .no_in_wnd |
3799 | call ted_fun_draw_panel_buttons |
3810 | call ted_fun_draw_panel_buttons |
3800 | .no_in_wnd: |
3811 | .no_in_wnd: |
3801 | popad |
3812 | popad |
3802 | ret |
3813 | ret |
3803 | endp |
3814 | endp |
3804 | 3815 | ||
3805 | ;input: |
3816 | ;input: |
3806 | ; eax -> (x,y) |
3817 | ; eax -> (x,y) |
3807 | ; edi -> 㪠§ ⥫ì áâàãªâãàã tedit |
3818 | ; edi -> 㪠§ ⥫ì áâàãªâãàã tedit |
3808 | ;description: |
3819 | ;description: |
3809 | ; äãªæ¨ï ¢ë§ë¢¥âáï ¯à¨ ¦ ⨨ ª®¯ª®© ¬ëè¨ ¨ ¯®¯ ¤¥¨¨ ªãàá®à®¬ ¢ ®ª® । ªâ®à |
3820 | ; äãªæ¨ï ¢ë§ë¢¥âáï ¯à¨ ¦ ⨨ ª®¯ª®© ¬ëè¨ ¨ ¯®¯ ¤¥¨¨ ªãàá®à®¬ ¢ ®ª® । ªâ®à |
3810 | align 4 |
3821 | align 4 |
3811 | ted_wnd_main_click: |
3822 | ted_wnd_main_click: |
3812 | push ebx ecx edx |
3823 | push ebx ecx edx |
3813 | mov ebx,ted_el_focus |
3824 | mov ebx,ted_el_focus |
3814 | mov dword[ebx],edi ;áâ ¢¨¬ 䮪ãá |
3825 | mov dword[ebx],edi ;áâ ¢¨¬ 䮪ãá |
3815 | 3826 | ||
3816 | push eax |
3827 | push eax |
3817 | shr eax,16 |
3828 | shr eax,16 |
3818 | and eax,0xffff |
3829 | and eax,0xffff |
3819 | sub eax,ted_wnd_l |
3830 | sub eax,ted_wnd_l |
3820 | sub eax,ted_rec_l |
3831 | sub eax,ted_rec_l |
3821 | 3832 | ||
3822 | xor edx,edx |
3833 | xor edx,edx |
3823 | mov ecx,ted_rec_w |
3834 | mov ecx,ted_rec_w |
3824 | div cx |
3835 | div cx |
3825 | ;inc eax |
3836 | ;inc eax |
3826 | mov ebx,ted_scr_h |
3837 | mov ebx,ted_scr_h |
3827 | cmp eax,dword[ebx+sb_offs_cur_area] |
3838 | cmp eax,dword[ebx+sb_offs_cur_area] |
3828 | jle @f |
3839 | jle @f |
3829 | mov eax,dword[ebx+sb_offs_cur_area] |
3840 | mov eax,dword[ebx+sb_offs_cur_area] |
3830 | @@: |
3841 | @@: |
3831 | ;dec eax |
3842 | ;dec eax |
3832 | mov ted_cur_x,eax |
3843 | mov ted_cur_x,eax |
3833 | pop eax |
3844 | pop eax |
3834 | 3845 | ||
3835 | push eax |
3846 | push eax |
3836 | and eax,0xffff |
3847 | and eax,0xffff |
3837 | sub eax,ted_wnd_t |
3848 | sub eax,ted_wnd_t |
3838 | sub eax,ted_rec_t |
3849 | sub eax,ted_rec_t |
3839 | 3850 | ||
3840 | xor edx,edx |
3851 | xor edx,edx |
3841 | mov ecx,ted_rec_h |
3852 | mov ecx,ted_rec_h |
3842 | div cx |
3853 | div cx |
3843 | inc eax |
3854 | inc eax |
3844 | mov ebx,ted_scr_w |
3855 | mov ebx,ted_scr_w |
3845 | cmp eax,dword[ebx+sb_offs_cur_area] |
3856 | cmp eax,dword[ebx+sb_offs_cur_area] |
3846 | jle @f |
3857 | jle @f |
3847 | mov eax,dword[ebx+sb_offs_cur_area] |
3858 | mov eax,dword[ebx+sb_offs_cur_area] |
3848 | @@: |
3859 | @@: |
3849 | dec eax |
3860 | dec eax |
3850 | mov ted_cur_y,eax |
3861 | mov ted_cur_y,eax |
3851 | pop eax |
3862 | pop eax |
3852 | 3863 | ||
3853 | cmp ted_drag_m,0 |
3864 | cmp ted_drag_m,0 |
3854 | je @f |
3865 | je @f |
3855 | call ted_sel_move |
3866 | call ted_sel_move |
3856 | jmp .sel_move |
3867 | jmp .sel_move |
3857 | @@: |
3868 | @@: |
3858 | mov ted_drag_m,1 |
3869 | mov ted_drag_m,1 |
3859 | call ted_sel_start |
3870 | call ted_sel_start |
3860 | .sel_move: |
3871 | .sel_move: |
3861 | pop edx ecx ebx |
3872 | pop edx ecx ebx |
3862 | ret |
3873 | ret |
3863 | 3874 | ||
3864 | ;input: |
3875 | ;input: |
3865 | ; edi = pointer to tedit struct |
3876 | ; edi = pointer to tedit struct |
3866 | align 4 |
3877 | align 4 |
3867 | ted_wnd_main_mouse_scroll: |
3878 | ted_wnd_main_mouse_scroll: |
3868 | push eax ebx ecx |
3879 | push eax ebx ecx |
3869 | mcall 37,7 ;¯à®ªàã⪠ª®«¥á ¬ëè¨ |
3880 | mcall 37,7 ;¯à®ªàã⪠ª®«¥á ¬ëè¨ |
3870 | cmp ax,0 |
3881 | cmp ax,0 |
3871 | je .no_scroll |
3882 | je .no_scroll |
3872 | mov ecx,ted_scr_w |
3883 | mov ecx,ted_scr_w |
3873 | mov ebx,dword[ecx+sb_offs_position] ;copy old scroll position |
3884 | mov ebx,dword[ecx+sb_offs_position] ;copy old scroll position |
3874 | and eax,0xffff |
3885 | and eax,0xffff |
3875 | btr ax,15 |
3886 | btr ax,15 |
3876 | jae @f |
3887 | jae @f |
3877 | or eax,0xffff8000 |
3888 | or eax,0xffff8000 |
3878 | @@: |
3889 | @@: |
3879 | add dword[ecx+sb_offs_position],eax |
3890 | add dword[ecx+sb_offs_position],eax |
3880 | 3891 | ||
3881 | mov eax,[ecx+sb_offs_position] |
3892 | mov eax,[ecx+sb_offs_position] |
3882 | cmp eax,[ecx+sb_offs_max_area] |
3893 | cmp eax,[ecx+sb_offs_max_area] |
3883 | jb @f |
3894 | jb @f |
3884 | mov dword[ecx+sb_offs_position],ebx ;if scroll position out of range |
3895 | mov dword[ecx+sb_offs_position],ebx ;if scroll position out of range |
3885 | jmp .no_scroll |
3896 | jmp .no_scroll |
3886 | @@: |
3897 | @@: |
3887 | stdcall ted_draw,edi |
3898 | stdcall ted_draw,edi |
3888 | .no_scroll: |
3899 | .no_scroll: |
3889 | pop ecx ebx eax |
3900 | pop ecx ebx eax |
3890 | ret |
3901 | ret |
3891 | 3902 | ||
3892 | align 4 |
3903 | align 4 |
3893 | proc ted_but_save_file, edit:dword, file:dword, f_name:dword |
3904 | proc ted_but_save_file, edit:dword, file:dword, f_name:dword |
3894 | pushad |
3905 | pushad |
3895 | mov edi,dword[edit] |
3906 | mov edi,dword[edit] |
3896 | 3907 | ||
3897 | stdcall ted_can_save,edi |
3908 | stdcall ted_can_save,edi |
3898 | cmp al,0 |
3909 | cmp al,0 |
3899 | je .no_save |
3910 | je .no_save |
3900 | 3911 | ||
3901 | mov ecx,ted_max_chars |
3912 | mov ecx,ted_max_chars |
3902 | call mem_Alloc |
3913 | call mem_Alloc |
3903 | push eax ;§ ¯®¬¨ ¥¬ 㪠§ â¥«ì ¢ë¤¥«¥ãî ¯ ¬ïâì |
3914 | push eax ;§ ¯®¬¨ ¥¬ 㪠§ â¥«ì ¢ë¤¥«¥ãî ¯ ¬ïâì |
3904 | 3915 | ||
3905 | mov edx,ted_tex |
3916 | mov edx,ted_tex |
3906 | xor ecx,ecx |
3917 | xor ecx,ecx |
3907 | @@: |
3918 | @@: |
3908 | call ted_iterat_next |
3919 | call ted_iterat_next |
3909 | cmp edx,ted_tex_1 |
3920 | cmp edx,ted_tex_1 |
3910 | jle @f ;edx = ted_tex or edx = ted_tex+sizeof.symbol |
3921 | jle @f ;edx = ted_tex or edx = ted_tex+sizeof.symbol |
3911 | mov bl,[edx] |
3922 | mov bl,[edx] |
3912 | mov byte[eax],bl |
3923 | mov byte[eax],bl |
3913 | inc eax |
3924 | inc eax |
3914 | inc ecx |
3925 | inc ecx |
3915 | jmp @b |
3926 | jmp @b |
3916 | @@: |
3927 | @@: |
3917 | 3928 | ||
3918 | cmp ecx,0 |
3929 | cmp ecx,0 |
3919 | je @f |
3930 | je @f |
3920 | mov ebx,dword[file] |
3931 | mov ebx,dword[file] |
3921 | pop eax ;§ ¯¨áë¢ ¥¬ 㪠§ â¥«ì ¢ë¤¥«¥ãî ¯ ¬ïâì |
3932 | pop eax ;§ ¯¨áë¢ ¥¬ 㪠§ â¥«ì ¢ë¤¥«¥ãî ¯ ¬ïâì |
3922 | mov dword[ebx+16],eax |
3933 | mov dword[ebx+16],eax |
3923 | push eax ;®¡à â® § ¯®¬¨ ¥¬ 㪠§ â¥«ì ¢ë¤¥«¥ãî ¯ ¬ïâì |
3934 | push eax ;®¡à â® § ¯®¬¨ ¥¬ 㪠§ â¥«ì ¢ë¤¥«¥ãî ¯ ¬ïâì |
3924 | mov eax,70 |
3935 | mov eax,70 |
3925 | mov dword[ebx], 2 |
3936 | mov dword[ebx], 2 |
3926 | mov dword[ebx+4], 0 |
3937 | mov dword[ebx+4], 0 |
3927 | mov dword[ebx+8], 0 |
3938 | mov dword[ebx+8], 0 |
3928 | mov dword[ebx+12], ecx |
3939 | mov dword[ebx+12], ecx |
3929 | mov byte[ebx+20], 0 |
3940 | mov byte[ebx+20], 0 |
3930 | push dword[f_name] |
3941 | push dword[f_name] |
3931 | pop dword[ebx+21] |
3942 | pop dword[ebx+21] |
3932 | int 0x40 |
3943 | int 0x40 |
3933 | 3944 | ||
3934 | mov ted_err_save,al |
3945 | mov ted_err_save,al |
3935 | 3946 | ||
3936 | cmp eax,0 |
3947 | cmp eax,0 |
3937 | je .no_msg |
3948 | je .no_msg |
3938 | ; cmp eax,6 |
3949 | ; cmp eax,6 |
3939 | ; je @f |
3950 | ; je @f |
3940 | cmp ax,10 |
3951 | cmp ax,10 |
3941 | jl .zifra_0_9 |
3952 | jl .zifra_0_9 |
3942 | mov al,'?' |
3953 | mov al,'?' |
3943 | sub ax,48 |
3954 | sub ax,48 |
3944 | .zifra_0_9: |
3955 | .zifra_0_9: |
3945 | add ax,48 |
3956 | add ax,48 |
3946 | cmp ted_fun_save_err,0 |
3957 | cmp ted_fun_save_err,0 |
3947 | je @f |
3958 | je @f |
3948 | call ted_fun_save_err |
3959 | call ted_fun_save_err |
3949 | jmp @f |
3960 | jmp @f |
3950 | .no_msg: |
3961 | .no_msg: |
3951 | m2m ted_tim_ls,ted_tim_ch |
3962 | m2m ted_tim_ls,ted_tim_ch |
3952 | @@: |
3963 | @@: |
3953 | 3964 | ||
3954 | pop ecx ;§ ¯¨áë¢ ¥¬ 㪠§ â¥«ì ¢ë¤¥«¥ãî ¯ ¬ïâì |
3965 | pop ecx ;§ ¯¨áë¢ ¥¬ 㪠§ â¥«ì ¢ë¤¥«¥ãî ¯ ¬ïâì |
3955 | call mem_Free |
3966 | call mem_Free |
3956 | .no_save: |
3967 | .no_save: |
3957 | popad |
3968 | popad |
3958 | ret |
3969 | ret |
3959 | endp |
3970 | endp |
3960 | } |
3971 | } |
3961 | 3972 | ||
3962 | > |
3973 | > |
3963 | 3974 | ||
3964 | > |
3975 | > |
3965 | > |
3976 | > |
3966 | >> |
3977 | >> |
3967 | >=ted_tim_ch>-] |
3978 | >=ted_tim_ch>-] |
3968 | > |
3979 | > |