Rev 1714 | Rev 1720 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1698 | IgorA | 1 | ; |
2 | ; в этом файле собраны функции создающие програмный код |
||
3 | ; |
||
4 | u_object object ;временный объект для задания смещений |
||
5 | |||
6 | macro insert_coma |
||
7 | { |
||
8 | stdcall [ted_text_add], tedit0,txt_coma,1,ted_opt_ed_move_cursor |
||
9 | } |
||
10 | macro insert_nl |
||
11 | { |
||
12 | stdcall [ted_text_add], tedit0,txt_nl,1,ted_opt_ed_move_cursor |
||
13 | } |
||
14 | macro insert_com |
||
15 | { |
||
16 | stdcall [ted_text_add], tedit0,txt_com,1,ted_opt_ed_move_cursor |
||
17 | } |
||
18 | macro insert_sp |
||
19 | { |
||
20 | stdcall [ted_text_add], tedit0,txt_sp,1,ted_opt_ed_move_cursor |
||
21 | } |
||
22 | |||
23 | ;функция вставляет текстовую строку в текстовый редактор |
||
24 | align 4 |
||
25 | proc insert_text, txt:dword |
||
26 | push eax |
||
27 | stdcall str_len,dword[txt] |
||
28 | cmp eax,1 |
||
29 | jl @f |
||
30 | stdcall [ted_text_add], tedit0,dword[txt],eax,ted_opt_ed_move_cursor |
||
31 | @@: |
||
32 | pop eax |
||
33 | ret |
||
34 | endp |
||
35 | |||
36 | ;вставляет указанное свойство из объекта в текстовый редактор |
||
37 | align 4 |
||
38 | proc insert_text_prop, p_obj:dword,index:dword |
||
39 | push eax edx |
||
40 | mov eax,[p_obj] |
||
41 | mov edx,[index] |
||
42 | stdcall get_obj_text_col,eax,edx |
||
43 | stdcall str_len,edx |
||
44 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
45 | pop edx eax |
||
46 | ret |
||
47 | endp |
||
48 | |||
49 | macro insert_tab |
||
50 | { |
||
51 | stdcall [ted_text_add], tedit0,txt_tab,1,ted_opt_ed_move_cursor |
||
52 | } |
||
53 | macro insert_br |
||
54 | { |
||
55 | stdcall [ted_text_add], tedit0,txt_br,3,ted_opt_ed_move_cursor |
||
56 | } |
||
57 | macro insert_a_met |
||
58 | { |
||
59 | stdcall [ted_text_add], tedit0,txt_a_met,3,ted_opt_ed_move_cursor |
||
60 | } |
||
61 | macro insert_0 |
||
62 | { |
||
63 | stdcall [ted_text_add], tedit0,txt_0,1,ted_opt_ed_move_cursor |
||
64 | } |
||
65 | macro insert_plus |
||
66 | { |
||
67 | stdcall [ted_text_add], tedit0,txt_plus,1,ted_opt_ed_move_cursor |
||
68 | } |
||
69 | macro insert_xor |
||
70 | { |
||
71 | stdcall [ted_text_add], tedit0,txt_xor,4,ted_opt_ed_move_cursor |
||
72 | } |
||
73 | macro insert_cmp |
||
74 | { |
||
75 | stdcall [ted_text_add], tedit0,txt_cmp,4,ted_opt_ed_move_cursor |
||
76 | } |
||
77 | macro insert_reg reg_name |
||
78 | { |
||
79 | stdcall [ted_text_add], tedit0,reg_name,3,ted_opt_ed_move_cursor |
||
80 | } |
||
81 | macro insert_reg8 reg_name |
||
82 | { |
||
83 | stdcall [ted_text_add], tedit0,reg_name,2,ted_opt_ed_move_cursor |
||
84 | } |
||
85 | macro insert_i65p |
||
86 | { |
||
87 | stdcall [ted_text_add], tedit0,txt_i65p,7,ted_opt_ed_move_cursor |
||
88 | } |
||
89 | |||
90 | |||
91 | ; |
||
92 | macro insert_but_beg |
||
93 | { |
||
94 | stdcall [ted_text_add], tedit0,txt_but_1,txt_but_2-txt_but_1,ted_opt_ed_move_cursor |
||
95 | } |
||
96 | macro insert_but_end |
||
97 | { |
||
98 | stdcall [ted_text_add], tedit0,txt_but_2,txt_but_3-txt_but_2,ted_opt_ed_move_cursor |
||
99 | } |
||
100 | ; |
||
101 | macro insert_key_beg |
||
102 | { |
||
103 | stdcall [ted_text_add], tedit0,txt_key_1,txt_key_2-txt_key_1,ted_opt_ed_move_cursor |
||
104 | } |
||
105 | macro insert_key_end |
||
106 | { |
||
107 | stdcall [ted_text_add], tedit0,txt_key_2,txt_key_3-txt_key_2,ted_opt_ed_move_cursor |
||
108 | } |
||
109 | |||
110 | macro insert_d_poi |
||
111 | { |
||
112 | stdcall [ted_text_add], tedit0,txt_d_poi,1,ted_opt_ed_move_cursor |
||
113 | } |
||
114 | macro insert_ret |
||
115 | { |
||
116 | stdcall [ted_text_add], tedit0,txt_ret,4,ted_opt_ed_move_cursor |
||
117 | } |
||
118 | |||
119 | |||
120 | align 4 |
||
1711 | IgorA | 121 | but_update: |
122 | call draw_constructor |
||
123 | cmp byte[show_mode],0 ;условие видимости окна конструктора |
||
124 | jne @f |
||
125 | stdcall [buf2d_draw], buf_fon |
||
126 | @@: |
||
1698 | IgorA | 127 | call code_gen |
128 | cmp byte[show_mode],1 ;условие видимости текстового окна |
||
129 | jne @f |
||
130 | stdcall [ted_draw], tedit0 |
||
131 | @@: |
||
132 | ret |
||
133 | |||
134 | ;функция создающая код всего файла |
||
135 | align 4 |
||
136 | code_gen: |
||
137 | stdcall [ted_clear], tedit0,1 |
||
138 | pushad |
||
139 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
140 | pop esi |
||
141 | xor bl,bl |
||
142 | call code_gen_obj |
||
143 | stdcall [ted_text_add], tedit0,\ |
||
144 | txt_nl,1,ted_opt_ed_move_cursor+ted_opt_ed_change_time ;добавляем символ новой строки с опцией ted_opt_ed_change_time для возможности сохранения файла |
||
145 | stdcall [ted_init_scroll_bars], tedit0, 4 ;меняем размеры скроллингов |
||
146 | popad |
||
147 | ret |
||
148 | |||
149 | ;input: |
||
150 | ; bl - уровень объекта |
||
151 | ; esi - указатель на узел |
||
152 | align 4 |
||
153 | code_gen_obj: |
||
154 | push ebx |
||
155 | .beg_iterat: |
||
156 | cmp esi,0 |
||
157 | je .find_no |
||
158 | |||
159 | cmp byte[esi+2],bl ;lev |
||
160 | jl .find_no |
||
161 | |||
162 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
163 | pop eax ;получаем данные узла |
||
164 | cmp eax,0 |
||
165 | je .find_no |
||
166 | |||
1717 | IgorA | 167 | cmp dword[eax],C_STR |
1698 | IgorA | 168 | jne @f |
1717 | IgorA | 169 | stdcall insert_text,txt_struct |
170 | stdcall insert_text_prop, eax,0 |
||
171 | insert_nl |
||
172 | |||
1698 | IgorA | 173 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
1711 | IgorA | 174 | pop esi ;переходим к следущему узлу |
175 | cmp esi,0 |
||
176 | je .end_st |
||
177 | cmp byte[esi+2],bl ;lev |
||
1698 | IgorA | 178 | jle .end_st |
179 | push bx |
||
180 | mov bl,byte[esi+2] |
||
181 | call code_gen_obj ;рекурсивный вызов дочерних объектов |
||
182 | pop bx |
||
183 | .end_st: |
||
1717 | IgorA | 184 | stdcall insert_text,txt_ends |
1698 | IgorA | 185 | jmp .beg_iterat |
186 | @@: |
||
1717 | IgorA | 187 | cmp dword[eax],C_TXT |
1698 | IgorA | 188 | jne @f |
189 | stdcall get_code_text,eax ;обработка объекта |
||
190 | @@: |
||
1717 | IgorA | 191 | cmp dword[eax],C_INC |
1698 | IgorA | 192 | jne @f |
193 | stdcall get_code_incl,eax ;обработка объекта |
||
194 | @@: |
||
1717 | IgorA | 195 | cmp dword[eax],C_COM |
1698 | IgorA | 196 | jne @f |
197 | stdcall get_code_comment,eax ;обработка объекта |
||
198 | @@: |
||
1717 | IgorA | 199 | cmp dword[eax],C_VAR |
1698 | IgorA | 200 | jne @f |
201 | stdcall get_code_variable,eax,ebx ;обработка объекта |
||
202 | @@: |
||
1717 | IgorA | 203 | cmp dword[eax],C_WND |
1698 | IgorA | 204 | jne @f |
205 | stdcall get_code_window,eax ;обработка объекта |
||
206 | @@: |
||
1717 | IgorA | 207 | cmp dword[eax],C_ACO |
1698 | IgorA | 208 | jne @f |
209 | stdcall get_code_auto,eax ;обработка объекта |
||
210 | @@: |
||
1717 | IgorA | 211 | cmp dword[eax],C_KEY ;клавиатура |
1698 | IgorA | 212 | jne @f |
213 | stdcall get_code_key,eax ;обработка объекта |
||
214 | @@: |
||
215 | |||
216 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
217 | pop esi ;переходим к следущему узлу |
||
218 | |||
219 | jmp .beg_iterat |
||
220 | .find_no: |
||
221 | pop ebx |
||
222 | ret |
||
223 | |||
1717 | IgorA | 224 | ;добавление объекта с програмным кодом (текстом) |
1698 | IgorA | 225 | align 4 |
226 | proc get_code_text, p_obj:dword |
||
1717 | IgorA | 227 | ;pushad |
1698 | IgorA | 228 | insert_nl |
1717 | IgorA | 229 | stdcall insert_text_prop, dword[p_obj],0 |
1698 | IgorA | 230 | insert_nl |
1717 | IgorA | 231 | ;popad |
1698 | IgorA | 232 | ret |
233 | endp |
||
234 | |||
1706 | IgorA | 235 | ;обработка объекта создающего автоматичексие коды |
1698 | IgorA | 236 | align 4 |
237 | proc get_code_auto, p_obj:dword |
||
238 | pushad |
||
239 | insert_nl |
||
240 | mov ebx,dword[p_obj] |
||
1717 | IgorA | 241 | test_bool_prop ebx,BIT_MOD_ACM |
1698 | IgorA | 242 | jae @f |
243 | ;автоматические события от мыши |
||
244 | call get_code_auto_m |
||
245 | @@: |
||
1717 | IgorA | 246 | test_bool_prop ebx,BIT_MOD_ABU |
1698 | IgorA | 247 | jae @f |
248 | ;создание функции button |
||
249 | insert_but_beg |
||
250 | call get_code_auto_but ;коды вызова кнопок |
||
251 | insert_but_end |
||
252 | call get_code_a_but_fun ;коды функций, вызываемых при нажатии кнопок |
||
253 | @@: |
||
1717 | IgorA | 254 | test_bool_prop ebx,BIT_MOD_ACD |
1698 | IgorA | 255 | jae @f |
256 | call get_code_auto_data_el |
||
257 | call get_code_auto_data_dop |
||
1706 | IgorA | 258 | |
1717 | IgorA | 259 | mov edx,C_LIB |
1706 | IgorA | 260 | stdcall find_obj_in_file,edx ;eax - указатель на структуру библиотеки |
261 | cmp eax,0 |
||
262 | je @f |
||
263 | stdcall insert_text, txt_head_i |
||
264 | stdcall insert_text, txt_d_poi |
||
265 | insert_nl |
||
266 | stdcall insert_text, txt_head_l |
||
267 | stdcall insert_text, txt_db |
||
268 | stdcall insert_text, txt_str_beg |
||
269 | stdcall insert_text, txt_sys_err |
||
270 | stdcall insert_text, txt_str_end |
||
271 | insert_nl |
||
272 | |||
273 | call get_code_auto_data_libs_param |
||
274 | stdcall insert_text, txt_ll_start |
||
275 | call get_code_auto_data_libs_struc |
||
276 | stdcall insert_text, txt_ll_end |
||
277 | call get_code_auto_data_libs ;таблицы импорта библиотек |
||
1698 | IgorA | 278 | @@: |
279 | insert_nl |
||
280 | popad |
||
281 | ret |
||
282 | endp |
||
283 | |||
284 | |||
285 | align 4 |
||
286 | proc get_code_auto_m |
||
287 | pushad |
||
288 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
289 | pop esi |
||
290 | .beg_iterat: |
||
291 | cmp esi,0 |
||
292 | je .find_no |
||
293 | |||
294 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
295 | pop ebx ;получаем данные узла |
||
296 | cmp ebx,0 |
||
297 | je .find_no |
||
298 | |||
1717 | IgorA | 299 | cmp dword[ebx],C_EDB |
1698 | IgorA | 300 | jne @f |
301 | stdcall insert_text, txt_std_mouse_ed |
||
302 | ;insert_sp |
||
303 | stdcall get_obj_text_col,ebx,0 |
||
304 | stdcall str_len,edx |
||
305 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
306 | insert_nl |
||
307 | @@: |
||
1717 | IgorA | 308 | cmp dword[ebx],C_CHB |
1698 | IgorA | 309 | jne @f |
310 | stdcall insert_text, txt_std_mouse_cb |
||
311 | ;insert_sp |
||
312 | stdcall get_obj_text_col,ebx,0 |
||
313 | stdcall str_len,edx |
||
314 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
315 | insert_nl |
||
316 | @@: |
||
317 | |||
318 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
319 | pop esi ;переходим к следущему узлу |
||
320 | |||
321 | jmp .beg_iterat |
||
322 | .find_no: |
||
323 | popad |
||
324 | ret |
||
325 | endp |
||
326 | |||
327 | ;создание данных (структур объектов) |
||
328 | align 4 |
||
329 | proc get_code_auto_data_el |
||
330 | pushad |
||
331 | insert_nl ;отступ для форматирования |
||
332 | |||
333 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
334 | pop esi |
||
335 | .beg_iterat: |
||
336 | cmp esi,0 |
||
337 | je .find_no |
||
338 | |||
339 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
340 | pop ebx ;получаем данные узла |
||
341 | cmp ebx,0 |
||
342 | je .find_no |
||
343 | |||
1717 | IgorA | 344 | cmp dword[ebx],C_EDB |
1698 | IgorA | 345 | jne @f |
346 | ;1,2,3,4,...,6,...8,...,10 - w,x,y,col_fon,...,col_frame,...,col_txt,...,txt |
||
1705 | IgorA | 347 | stdcall insert_text_prop, ebx,0 |
1698 | IgorA | 348 | stdcall insert_text, txt_ebox |
349 | |||
350 | mov ecx,1 |
||
351 | .prop: |
||
352 | insert_sp |
||
1705 | IgorA | 353 | stdcall insert_text_prop, ebx,ecx |
1698 | IgorA | 354 | insert_coma |
355 | inc ecx |
||
356 | cmp ecx,10 |
||
357 | jl .prop |
||
358 | |||
359 | insert_br |
||
360 | stdcall insert_text, txt_txt |
||
361 | |||
362 | mov edx,fp_icon |
||
1714 | IgorA | 363 | stdcall get_obj_id_str, ebx,edx |
1706 | IgorA | 364 | stdcall insert_text,edx |
1698 | IgorA | 365 | |
366 | stdcall insert_text, txt_mouse_dd |
||
1711 | IgorA | 367 | |
368 | stdcall insert_text, txt_0 ;тут будут свойства editbox а пока просто ставим 0 |
||
369 | xchg eax,edx ;сохраняем значение edx |
||
370 | stdcall get_obj_text_col,ebx,10 |
||
371 | cmp byte[edx],0 ;проверяем пустая ли строка при запуске editbox |
||
372 | je .null_string |
||
373 | xchg eax,edx ;востанавливаем значение edx |
||
374 | stdcall insert_text, txt_coma |
||
375 | |||
376 | stdcall insert_text, txt_txt |
||
377 | stdcall insert_text,edx |
||
378 | stdcall insert_text,txt_met_end |
||
379 | stdcall insert_text,txt_minus |
||
380 | stdcall insert_text, txt_txt |
||
381 | stdcall insert_text,edx |
||
382 | stdcall insert_text,txt_minus |
||
383 | stdcall insert_text, txt_1 |
||
384 | stdcall insert_text, txt_coma |
||
385 | |||
386 | stdcall insert_text, txt_txt |
||
387 | stdcall insert_text,edx |
||
388 | stdcall insert_text,txt_met_end |
||
389 | stdcall insert_text,txt_minus |
||
390 | stdcall insert_text, txt_txt |
||
391 | stdcall insert_text,edx |
||
392 | stdcall insert_text,txt_minus |
||
393 | stdcall insert_text, txt_1 |
||
394 | .null_string: |
||
1698 | IgorA | 395 | insert_nl |
396 | @@: |
||
1717 | IgorA | 397 | cmp dword[ebx],C_DTT |
1711 | IgorA | 398 | jne @f |
399 | stdcall insert_text, txt_txt |
||
400 | mov edx,fp_icon |
||
1714 | IgorA | 401 | stdcall get_obj_id_str, ebx,edx |
1711 | IgorA | 402 | stdcall insert_text,edx |
403 | stdcall insert_text, txt_db |
||
404 | stdcall insert_text_prop, ebx,0 |
||
405 | insert_nl |
||
406 | @@: |
||
1698 | IgorA | 407 | |
408 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
409 | pop esi ;переходим к следущему узлу |
||
410 | |||
411 | jmp .beg_iterat |
||
412 | .find_no: |
||
413 | popad |
||
414 | ret |
||
415 | endp |
||
416 | |||
1705 | IgorA | 417 | ;данные для библиотек |
418 | align 4 |
||
1706 | IgorA | 419 | proc get_code_auto_data_libs_param |
420 | pushad |
||
421 | insert_nl ;отступ для форматирования |
||
422 | |||
423 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
424 | pop esi |
||
425 | .beg_iterat: |
||
426 | cmp esi,0 |
||
427 | je .find_no |
||
428 | |||
429 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
430 | pop ebx ;получаем данные узла |
||
431 | cmp ebx,0 |
||
432 | je .find_no |
||
433 | |||
1717 | IgorA | 434 | cmp dword[ebx],C_LIB |
1706 | IgorA | 435 | jne @f |
436 | ;0,1,2,3,4,5 - l_nam,s_dir,i_met,... |
||
437 | |||
438 | stdcall insert_text, txt_sys_dir |
||
439 | ;object code |
||
440 | mov edx,fp_icon |
||
1714 | IgorA | 441 | stdcall get_obj_id_str, ebx,edx |
1706 | IgorA | 442 | stdcall insert_text,edx |
443 | stdcall insert_text,txt_db |
||
444 | ;stdcall insert_text, txt_str_beg |
||
445 | stdcall insert_text_prop, ebx,1 |
||
446 | ;stdcall insert_text, txt_str_end |
||
447 | insert_nl |
||
448 | |||
449 | stdcall insert_text, txt_lib_name |
||
450 | stdcall insert_text,edx |
||
451 | stdcall insert_text,txt_db |
||
452 | stdcall insert_text, txt_str_beg |
||
453 | stdcall insert_text_prop, ebx,0 |
||
454 | stdcall insert_text, txt_str_end |
||
455 | insert_nl |
||
456 | |||
457 | stdcall insert_text,txt_err_m_f_lib |
||
458 | stdcall insert_text,edx |
||
459 | stdcall insert_text,txt_db |
||
460 | stdcall insert_text, txt_str_beg |
||
461 | stdcall insert_text_prop, ebx,4 |
||
462 | stdcall insert_text, txt_str_end |
||
463 | insert_nl |
||
464 | |||
465 | stdcall insert_text,txt_err_m_i_lib |
||
466 | stdcall insert_text,edx |
||
467 | stdcall insert_text,txt_db |
||
468 | stdcall insert_text, txt_str_beg |
||
469 | stdcall insert_text_prop, ebx,5 |
||
470 | stdcall insert_text, txt_str_end |
||
471 | insert_nl |
||
472 | |||
473 | insert_nl |
||
474 | @@: |
||
475 | |||
476 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
477 | pop esi ;переходим к следущему узлу |
||
478 | |||
479 | jmp .beg_iterat |
||
480 | .find_no: |
||
481 | popad |
||
482 | ret |
||
483 | endp |
||
484 | |||
485 | ;данные для библиотек |
||
486 | align 4 |
||
487 | proc get_code_auto_data_libs_struc |
||
488 | pushad |
||
489 | ;insert_nl ;отступ для форматирования |
||
490 | |||
491 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
492 | pop esi |
||
493 | .beg_iterat: |
||
494 | cmp esi,0 |
||
495 | je .find_no |
||
496 | |||
497 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
498 | pop ebx ;получаем данные узла |
||
499 | cmp ebx,0 |
||
500 | je .find_no |
||
501 | |||
1717 | IgorA | 502 | cmp dword[ebx],C_LIB |
1706 | IgorA | 503 | jne @f |
504 | ;0,1,2,3,4,5 - l_nam,s_dir,i_met,... |
||
505 | |||
506 | stdcall insert_text, txt_lib |
||
507 | ;object code |
||
508 | mov edx,fp_icon |
||
1714 | IgorA | 509 | stdcall get_obj_id_str, ebx,edx |
1706 | IgorA | 510 | stdcall insert_text,edx |
511 | insert_sp |
||
512 | stdcall insert_text, txt_ll |
||
513 | stdcall insert_text, txt_lib_name |
||
514 | stdcall insert_text,edx |
||
515 | stdcall insert_text,txt_coma |
||
516 | |||
517 | stdcall insert_text, txt_lib_path |
||
518 | |||
519 | stdcall insert_text, txt_sys_dir |
||
520 | stdcall insert_text,edx |
||
521 | stdcall insert_text,txt_coma |
||
522 | stdcall insert_text,txt_br |
||
523 | stdcall insert_text,txt_tab |
||
524 | |||
525 | stdcall insert_text,txt_err_m_f_lib |
||
526 | stdcall insert_text,edx |
||
527 | stdcall insert_text,txt_coma |
||
528 | stdcall insert_text,txt_head_l |
||
529 | stdcall insert_text,txt_coma |
||
530 | |||
531 | stdcall insert_text_prop, ebx,2 |
||
532 | stdcall insert_text,txt_coma |
||
533 | |||
534 | stdcall insert_text,txt_err_m_i_lib |
||
535 | stdcall insert_text,edx |
||
536 | stdcall insert_text,txt_coma |
||
537 | stdcall insert_text,txt_head_i |
||
538 | |||
539 | insert_nl |
||
540 | @@: |
||
541 | |||
542 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
543 | pop esi ;переходим к следущему узлу |
||
544 | |||
545 | jmp .beg_iterat |
||
546 | .find_no: |
||
547 | popad |
||
548 | ret |
||
549 | endp |
||
550 | |||
551 | ;данные для библиотек |
||
552 | align 4 |
||
1705 | IgorA | 553 | proc get_code_auto_data_libs |
554 | pushad |
||
555 | insert_nl ;отступ для форматирования |
||
556 | |||
557 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
558 | pop esi |
||
559 | .beg_iterat: |
||
560 | cmp esi,0 |
||
561 | je .find_no |
||
562 | |||
563 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
564 | pop ebx ;получаем данные узла |
||
565 | cmp ebx,0 |
||
566 | je .find_no |
||
567 | |||
1717 | IgorA | 568 | cmp dword[ebx],C_LIB |
1705 | IgorA | 569 | jne @f |
570 | ;0,1,2,3,4,5 - l_nam,s_dir,i_met,... |
||
571 | stdcall insert_text, txt_align_4 |
||
572 | stdcall insert_text_prop, ebx,2 |
||
573 | stdcall insert_text, txt_d_poi |
||
574 | insert_nl |
||
575 | |||
576 | call get_code_lib_table |
||
577 | @@: |
||
578 | |||
579 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
580 | pop esi ;переходим к следущему узлу |
||
581 | |||
582 | jmp .beg_iterat |
||
583 | .find_no: |
||
584 | popad |
||
585 | ret |
||
586 | endp |
||
587 | |||
588 | ;input: |
||
589 | ; esi |
||
590 | align 4 |
||
591 | get_code_lib_table: |
||
592 | pushad |
||
593 | mov bl,byte[esi+2] |
||
594 | mov edi,esi |
||
595 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
596 | pop edx ;получение данных родительского объекта |
||
597 | cmp edx,0 |
||
598 | je @f |
||
599 | @@: |
||
600 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
601 | pop esi ;переходим к следущему узлу |
||
602 | cmp esi,0 |
||
603 | je @f |
||
604 | cmp byte[esi+2],bl ;lev |
||
605 | jle @f |
||
606 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
607 | pop ecx ;получаем данные узла |
||
608 | cmp ecx,0 |
||
609 | je @f |
||
1717 | IgorA | 610 | cmp dword[ecx],C_IFN |
1705 | IgorA | 611 | jne @b |
612 | ;вставка указателя на функцию |
||
613 | insert_tab |
||
614 | stdcall insert_text_prop, ecx,0 |
||
615 | stdcall insert_text, txt_dd |
||
616 | stdcall insert_text_prop, edx,3 ;приставка к функции |
||
617 | stdcall insert_text_prop, ecx,0 |
||
618 | insert_nl |
||
619 | jmp @b |
||
620 | @@: |
||
621 | stdcall insert_text, txt_dd_0_0 |
||
622 | mov esi,edi |
||
623 | @@: |
||
624 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
625 | pop esi ;переходим к следущему узлу |
||
626 | cmp esi,0 |
||
627 | je @f |
||
628 | cmp byte[esi+2],bl ;lev |
||
629 | jle @f |
||
630 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
631 | pop ecx ;получаем данные узла |
||
632 | cmp ecx,0 |
||
633 | je @f |
||
1717 | IgorA | 634 | cmp dword[ecx],C_IFN |
1705 | IgorA | 635 | jne @b |
636 | ;вставка имени импортированной функции |
||
637 | insert_tab |
||
638 | stdcall insert_text_prop, edx,3 ;приставка к функции |
||
639 | stdcall insert_text_prop, ecx,0 |
||
640 | stdcall insert_text, txt_db |
||
641 | stdcall insert_text, txt_str_beg |
||
642 | stdcall insert_text_prop, ecx,1 |
||
643 | stdcall insert_text, txt_str_end |
||
644 | insert_nl |
||
645 | jmp @b |
||
646 | @@: |
||
647 | popad |
||
648 | ret |
||
649 | |||
1698 | IgorA | 650 | ; |
651 | align 4 |
||
652 | proc get_code_auto_data_dop |
||
653 | pushad |
||
654 | insert_nl ;отступ для форматирования |
||
655 | |||
656 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
657 | pop esi |
||
658 | .beg_iterat: |
||
659 | cmp esi,0 |
||
660 | je .find_no |
||
661 | |||
662 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
663 | pop ebx ;получаем данные узла |
||
664 | cmp ebx,0 |
||
665 | je .find_no |
||
666 | |||
1717 | IgorA | 667 | cmp dword[ebx],C_EDB |
1698 | IgorA | 668 | jne @f |
669 | ;1,2,3,4,...,6,...8,...,10 - w,x,y,col_fon,...,col_frame,...,col_txt,...,txt |
||
670 | stdcall insert_text, txt_txt |
||
671 | mov edx,fp_icon |
||
1714 | IgorA | 672 | stdcall get_obj_id_str, ebx,edx |
1711 | IgorA | 673 | stdcall insert_text,edx |
1698 | IgorA | 674 | |
1711 | IgorA | 675 | stdcall get_obj_text_col,ebx,10 |
676 | cmp byte[edx],0 |
||
677 | je .no_text |
||
678 | stdcall insert_text, txt_d_poi |
||
679 | stdcall insert_text, txt_db |
||
680 | stdcall insert_text, txt_str_beg |
||
681 | stdcall str_len,edx |
||
682 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
683 | stdcall insert_text, txt_str_end |
||
684 | insert_nl |
||
1698 | IgorA | 685 | |
1711 | IgorA | 686 | insert_tab |
687 | stdcall insert_text, txt_met_end |
||
688 | stdcall insert_text, txt_rb |
||
689 | stdcall insert_text, txt_txt |
||
690 | mov edx,fp_icon |
||
1714 | IgorA | 691 | stdcall get_obj_id_str, ebx,edx |
1711 | IgorA | 692 | stdcall insert_text,edx |
693 | |||
694 | stdcall insert_text, txt_minus |
||
695 | stdcall insert_text, txt_txt |
||
696 | stdcall insert_text,edx |
||
697 | stdcall insert_text, txt_met_end |
||
698 | |||
699 | insert_plus |
||
700 | stdcall insert_text_prop,ebx,9 |
||
701 | insert_plus |
||
702 | stdcall insert_text, txt_3 |
||
703 | |||
704 | insert_nl |
||
705 | |||
706 | jmp @f |
||
707 | |||
708 | .no_text: ;первоначально текст не задан |
||
709 | stdcall insert_text, txt_times |
||
710 | |||
711 | stdcall insert_text_prop,ebx,9 |
||
712 | insert_plus |
||
713 | stdcall insert_text, txt_2 |
||
714 | stdcall insert_text, txt_db |
||
715 | insert_0 |
||
716 | insert_nl |
||
1698 | IgorA | 717 | @@: |
718 | |||
719 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
720 | pop esi ;переходим к следущему узлу |
||
721 | |||
722 | jmp .beg_iterat |
||
723 | .find_no: |
||
724 | popad |
||
725 | ret |
||
726 | endp |
||
727 | |||
728 | ;связываем кнопки с функциями |
||
729 | align 4 |
||
730 | proc get_code_auto_but |
||
731 | pushad |
||
732 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
733 | pop esi |
||
734 | .beg_iterat: |
||
735 | cmp esi,0 |
||
736 | je .find_no |
||
737 | |||
738 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
739 | pop ebx ;получаем данные узла |
||
740 | cmp ebx,0 |
||
741 | je .find_no |
||
742 | |||
1717 | IgorA | 743 | cmp dword[ebx],C_BUT |
1698 | IgorA | 744 | jne @f |
745 | insert_tab |
||
746 | insert_cmp |
||
747 | insert_reg8 txt_ah |
||
748 | insert_coma |
||
749 | stdcall get_obj_text_col,ebx,0 |
||
750 | stdcall str_len,edx |
||
751 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
752 | insert_nl |
||
753 | insert_tab |
||
754 | stdcall insert_text, txt_jne_f |
||
755 | insert_nl |
||
756 | insert_tab |
||
757 | insert_tab |
||
758 | stdcall insert_text, txt_call |
||
759 | stdcall get_obj_text_col,ebx,6 |
||
760 | stdcall str_len,edx |
||
761 | cmp eax,1 |
||
762 | jl .c_fun |
||
763 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
764 | .c_fun: |
||
765 | insert_nl |
||
766 | insert_tab |
||
767 | insert_a_met ;@@: |
||
768 | insert_nl |
||
769 | @@: |
||
770 | |||
771 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
772 | pop esi ;переходим к следущему узлу |
||
773 | |||
774 | jmp .beg_iterat |
||
775 | .find_no: |
||
776 | popad |
||
777 | ret |
||
778 | endp |
||
779 | |||
780 | ;берем коды для функций нажатий на кнопки |
||
781 | align 4 |
||
782 | proc get_code_a_but_fun |
||
783 | pushad |
||
784 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
785 | pop esi |
||
786 | .beg_iterat: |
||
787 | cmp esi,0 |
||
788 | je .find_no |
||
789 | |||
790 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
791 | pop ebx ;получаем данные узла |
||
792 | cmp ebx,0 |
||
793 | je .find_no |
||
794 | |||
1717 | IgorA | 795 | cmp dword[ebx],C_BUT |
1698 | IgorA | 796 | jne @f |
797 | stdcall get_obj_text_col,ebx,6 |
||
798 | stdcall str_len,edx |
||
799 | cmp eax,1 |
||
800 | jl .c_fun |
||
801 | insert_nl |
||
802 | stdcall insert_text, txt_align_4 |
||
803 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
804 | insert_d_poi |
||
805 | insert_nl |
||
806 | insert_tab |
||
807 | insert_ret |
||
808 | .c_fun: |
||
809 | @@: |
||
810 | |||
811 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
812 | pop esi ;переходим к следущему узлу |
||
813 | |||
814 | jmp .beg_iterat |
||
815 | .find_no: |
||
816 | popad |
||
817 | ret |
||
818 | endp |
||
819 | |||
820 | align 4 |
||
821 | proc get_code_key, p_obj:dword |
||
822 | pushad |
||
823 | insert_nl |
||
824 | mov ebx,dword[p_obj] |
||
825 | |||
826 | insert_key_beg |
||
827 | call get_code_funct_key ;коды вызова кнопок |
||
828 | insert_key_end |
||
829 | |||
830 | insert_nl |
||
831 | popad |
||
832 | ret |
||
833 | endp |
||
834 | |||
835 | align 4 |
||
836 | proc get_code_funct_key |
||
837 | pushad |
||
838 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
839 | pop esi |
||
840 | .beg_iterat: |
||
841 | cmp esi,0 |
||
842 | je .find_no |
||
843 | |||
844 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
845 | pop ebx ;получаем данные узла |
||
846 | cmp ebx,0 |
||
847 | je .find_no |
||
848 | |||
1717 | IgorA | 849 | cmp dword[ebx],C_EDB |
1698 | IgorA | 850 | jne @f |
851 | stdcall insert_text, txt_std_key_ed |
||
852 | stdcall insert_text_prop,ebx,0 |
||
853 | insert_nl |
||
854 | @@: |
||
855 | |||
856 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
857 | pop esi ;переходим к следущему узлу |
||
858 | |||
859 | jmp .beg_iterat |
||
860 | .find_no: |
||
861 | popad |
||
862 | ret |
||
863 | endp |
||
864 | |||
865 | ;объекты подключения файлов 'include ...' |
||
866 | align 4 |
||
867 | proc get_code_incl, p_obj:dword |
||
868 | pushad |
||
869 | stdcall insert_text, txt_incl |
||
870 | mov ebx,dword[p_obj] |
||
871 | stdcall insert_text_prop,ebx,0 |
||
872 | |||
873 | stdcall get_obj_text_col,ebx,1 |
||
874 | stdcall str_len,edx |
||
875 | cmp eax,1 |
||
876 | jl @f |
||
877 | insert_sp |
||
878 | insert_com |
||
879 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
880 | @@: |
||
881 | |||
882 | insert_nl |
||
883 | popad |
||
884 | ret |
||
885 | endp |
||
886 | |||
887 | align 4 |
||
888 | proc get_code_comment, p_obj:dword |
||
889 | insert_com |
||
890 | stdcall insert_text_prop, dword[p_obj],0 |
||
891 | insert_nl |
||
892 | ret |
||
893 | endp |
||
894 | |||
895 | ;создаем код задания окна |
||
896 | align 4 |
||
897 | proc get_code_window, p_obj:dword |
||
898 | pushad |
||
899 | mov ebx,dword[p_obj] |
||
900 | ;2,3,4,5,6 - x,y,w,h,col_bkg |
||
901 | |||
902 | stdcall insert_text, txt_draw_wb |
||
903 | |||
904 | insert_tab |
||
905 | insert_xor |
||
906 | insert_reg txt_eax |
||
907 | insert_coma |
||
908 | insert_reg txt_eax |
||
909 | insert_nl |
||
910 | |||
911 | ;mov ebx,... |
||
912 | insert_tab |
||
913 | stdcall insert_text, txt_mov |
||
914 | insert_reg txt_ebx |
||
915 | insert_coma |
||
916 | stdcall insert_text_prop, ebx,2 |
||
917 | insert_i65p |
||
918 | stdcall insert_text_prop, ebx,4 |
||
919 | insert_nl |
||
920 | |||
921 | ;mov ecx,... |
||
922 | insert_tab |
||
923 | stdcall insert_text, txt_mov |
||
924 | insert_reg txt_ecx |
||
925 | insert_coma |
||
926 | stdcall insert_text_prop, ebx,3 |
||
927 | insert_i65p |
||
928 | stdcall insert_text_prop, ebx,5 |
||
929 | insert_nl |
||
930 | |||
931 | ;mov edx,... |
||
932 | insert_tab |
||
933 | stdcall insert_text, txt_mov |
||
934 | insert_reg txt_edx |
||
935 | insert_coma |
||
936 | stdcall insert_text_prop, ebx,6 |
||
937 | insert_nl |
||
938 | |||
939 | ;or edx,0x33000000 |
||
1705 | IgorA | 940 | insert_tab |
1698 | IgorA | 941 | stdcall insert_text, txt_or |
942 | insert_reg txt_edx |
||
943 | insert_coma |
||
944 | stdcall insert_text, txt_0x33000000 |
||
945 | insert_nl |
||
946 | |||
947 | ;mov edi,... |
||
948 | insert_tab |
||
949 | stdcall insert_text, txt_mov |
||
950 | insert_reg txt_edi |
||
951 | insert_coma |
||
952 | stdcall insert_text_prop, ebx,0 |
||
953 | insert_nl |
||
954 | |||
955 | insert_tab |
||
956 | stdcall insert_text, txt_i_40 |
||
1705 | IgorA | 957 | insert_nl |
1698 | IgorA | 958 | |
959 | call get_code_draw_obj |
||
960 | |||
1705 | IgorA | 961 | stdcall insert_text, txt_draw_we ;код завершающий функцию рисования |
1698 | IgorA | 962 | popad |
963 | ret |
||
964 | endp |
||
965 | |||
966 | |||
967 | ;формируем вызов функций для рисования объектов |
||
968 | align 4 |
||
969 | proc get_code_draw_obj |
||
970 | pushad |
||
971 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
972 | pop esi |
||
973 | .beg_iterat: |
||
974 | cmp esi,0 |
||
975 | je .find_no |
||
976 | |||
977 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
978 | pop ebx ;получаем данные узла |
||
979 | cmp ebx,0 |
||
980 | je .find_no |
||
981 | |||
1717 | IgorA | 982 | cmp dword[ebx],C_EDB |
1698 | IgorA | 983 | jne @f |
984 | stdcall insert_text, txt_editb_draw |
||
985 | stdcall insert_text_prop, ebx,0 |
||
986 | insert_nl |
||
987 | @@: |
||
1717 | IgorA | 988 | cmp dword[ebx],C_CHB |
1698 | IgorA | 989 | jne @f |
990 | stdcall insert_text, txt_cbox_draw |
||
991 | stdcall insert_text_prop, ebx,0 |
||
992 | insert_nl |
||
993 | @@: |
||
1717 | IgorA | 994 | cmp dword[ebx],C_BUT |
995 | jne .ob_draw_but |
||
1698 | IgorA | 996 | insert_tab |
997 | stdcall insert_text, txt_mov |
||
998 | insert_reg txt_eax |
||
999 | insert_coma |
||
1000 | stdcall insert_text, txt_8 |
||
1001 | insert_nl |
||
1002 | |||
1003 | insert_tab |
||
1004 | stdcall insert_text, txt_mov |
||
1005 | insert_reg txt_ebx |
||
1006 | insert_coma |
||
1007 | stdcall insert_text_prop, ebx,1 |
||
1008 | insert_i65p |
||
1009 | stdcall insert_text_prop, ebx,3 |
||
1010 | insert_nl |
||
1011 | |||
1012 | insert_tab |
||
1013 | stdcall insert_text, txt_mov |
||
1014 | insert_reg txt_ecx |
||
1015 | insert_coma |
||
1016 | stdcall insert_text_prop, ebx,2 |
||
1017 | insert_i65p |
||
1018 | stdcall insert_text_prop, ebx,4 |
||
1019 | insert_nl |
||
1020 | |||
1021 | insert_tab |
||
1022 | stdcall insert_text, txt_mov |
||
1023 | insert_reg txt_edx |
||
1024 | insert_coma |
||
1025 | stdcall insert_text_prop, ebx,0 |
||
1717 | IgorA | 1026 | test_bool_prop ebx,BIT_MOD_BUT_NFON |
1027 | jnc @f |
||
1028 | stdcall insert_text, txt_plus |
||
1029 | stdcall insert_text, txt_bit_30 |
||
1030 | @@: |
||
1031 | test_bool_prop ebx,BIT_MOD_BUT_NBORD |
||
1032 | jnc @f |
||
1033 | stdcall insert_text, txt_plus |
||
1034 | stdcall insert_text, txt_bit_29 |
||
1035 | @@: |
||
1698 | IgorA | 1036 | insert_nl |
1037 | |||
1038 | insert_tab |
||
1039 | stdcall insert_text, txt_mov |
||
1040 | insert_reg txt_esi |
||
1041 | insert_coma |
||
1042 | stdcall insert_text_prop, ebx,5 ;button color |
||
1043 | insert_nl |
||
1044 | |||
1045 | insert_tab |
||
1046 | stdcall insert_text, txt_i_40 |
||
1047 | insert_nl |
||
1717 | IgorA | 1048 | .ob_draw_but: |
1049 | cmp dword[ebx],C_REC |
||
1698 | IgorA | 1050 | jne @f |
1051 | insert_tab |
||
1052 | stdcall insert_text, txt_mov |
||
1053 | insert_reg txt_eax |
||
1054 | insert_coma |
||
1055 | stdcall insert_text, txt_1 |
||
1056 | stdcall insert_text, txt_3 |
||
1057 | insert_nl |
||
1058 | |||
1059 | insert_tab |
||
1060 | stdcall insert_text, txt_mov |
||
1061 | insert_reg txt_ebx |
||
1062 | insert_coma |
||
1063 | stdcall insert_text_prop, ebx,1 |
||
1064 | insert_i65p |
||
1065 | stdcall insert_text_prop, ebx,3 |
||
1066 | insert_nl |
||
1067 | |||
1068 | insert_tab |
||
1069 | stdcall insert_text, txt_mov |
||
1070 | insert_reg txt_ecx |
||
1071 | insert_coma |
||
1072 | stdcall insert_text_prop, ebx,2 |
||
1073 | insert_i65p |
||
1074 | stdcall insert_text_prop, ebx,4 |
||
1075 | insert_nl |
||
1076 | |||
1077 | insert_tab |
||
1078 | stdcall insert_text, txt_mov |
||
1079 | insert_reg txt_edx |
||
1080 | insert_coma |
||
1081 | stdcall insert_text_prop, ebx,0 ;rect color |
||
1082 | insert_nl |
||
1083 | |||
1084 | insert_tab |
||
1085 | stdcall insert_text, txt_i_40 |
||
1086 | insert_nl |
||
1087 | @@: |
||
1717 | IgorA | 1088 | cmp dword[ebx],C_DTT ;рисование текста через сист. ф. 4 |
1089 | jne .ob_draw_text |
||
1711 | IgorA | 1090 | insert_tab |
1091 | stdcall insert_text, txt_mov |
||
1092 | insert_reg txt_eax |
||
1093 | insert_coma |
||
1094 | stdcall insert_text, txt_4 |
||
1095 | insert_nl |
||
1698 | IgorA | 1096 | |
1711 | IgorA | 1097 | insert_tab |
1098 | stdcall insert_text, txt_mov |
||
1099 | insert_reg txt_ebx |
||
1100 | insert_coma |
||
1101 | stdcall insert_text_prop, ebx,1 |
||
1102 | insert_i65p |
||
1103 | stdcall insert_text_prop, ebx,2 |
||
1104 | insert_nl |
||
1105 | |||
1106 | insert_tab |
||
1107 | stdcall insert_text, txt_mov |
||
1108 | insert_reg txt_ecx |
||
1109 | insert_coma |
||
1110 | stdcall insert_text_prop, ebx,3 |
||
1717 | IgorA | 1111 | test_bool_prop ebx,BIT_MOD_TXT_ASCII_0 |
1112 | jnc @f |
||
1113 | ;or ecx,0x80000000 - бит для строки ASCIIZ |
||
1114 | stdcall insert_text,txt_plus |
||
1115 | stdcall insert_text,txt_bit_31 |
||
1116 | @@: |
||
1117 | test_bool_prop ebx,BIT_MOD_TXT_NO_TRAN |
||
1118 | jnc @f |
||
1119 | ;or ecx,0x40000000 - бит для не прозрачного текста |
||
1120 | stdcall insert_text,txt_plus |
||
1121 | stdcall insert_text,txt_bit_30 |
||
1122 | @@: |
||
1123 | test_bool_prop ebx,BIT_MOD_TXT_CHAR2 |
||
1124 | jnc @f |
||
1125 | ;or ecx,0x40000000 - бит для 2-го сист. шрифта |
||
1126 | stdcall insert_text,txt_plus |
||
1127 | stdcall insert_text,txt_bit_28 |
||
1128 | @@: |
||
1711 | IgorA | 1129 | insert_nl |
1130 | |||
1131 | insert_tab |
||
1132 | stdcall insert_text, txt_mov |
||
1133 | insert_reg txt_edx |
||
1134 | insert_coma |
||
1135 | stdcall insert_text, txt_txt |
||
1136 | mov edx,fp_icon |
||
1714 | IgorA | 1137 | stdcall get_obj_id_str, ebx,edx |
1711 | IgorA | 1138 | stdcall insert_text,edx |
1139 | insert_nl |
||
1140 | |||
1141 | ;mov esi,... |
||
1717 | IgorA | 1142 | test_bool_prop ebx,BIT_MOD_TXT_NO_TRAN |
1143 | jnc @f |
||
1144 | insert_tab |
||
1145 | stdcall insert_text, txt_mov |
||
1146 | insert_reg txt_edi |
||
1147 | insert_coma |
||
1148 | stdcall insert_text_prop, ebx,4 ;цвет фона |
||
1149 | insert_nl |
||
1150 | @@: |
||
1711 | IgorA | 1151 | |
1152 | insert_tab |
||
1153 | stdcall insert_text, txt_i_40 |
||
1154 | insert_nl |
||
1717 | IgorA | 1155 | .ob_draw_text: |
1711 | IgorA | 1156 | |
1698 | IgorA | 1157 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
1158 | pop esi ;переходим к следущему узлу |
||
1159 | |||
1160 | jmp .beg_iterat |
||
1161 | .find_no: |
||
1162 | popad |
||
1163 | ret |
||
1164 | endp |
||
1165 | |||
1166 | ;создать код объявления переменной |
||
1167 | align 4 |
||
1168 | proc get_code_variable, p_obj:dword,o_lev:dword |
||
1169 | pushad |
||
1170 | mov ebx,dword[p_obj] |
||
1171 | ;0,1,2 - name,value,comment |
||
1172 | |||
1173 | mov ecx,dword[o_lev] |
||
1174 | cmp cl,0 |
||
1175 | je .no_tab ;избегаем зацикливания (0-1 = 2^32-1) |
||
1717 | IgorA | 1176 | and ecx,0xff |
1698 | IgorA | 1177 | cld |
1178 | @@: |
||
1179 | insert_tab ;формирование отступа перед переменной |
||
1180 | loop @b |
||
1181 | .no_tab: |
||
1182 | |||
1705 | IgorA | 1183 | stdcall insert_text_prop, ebx,0 ;имя переменной |
1698 | IgorA | 1184 | insert_sp |
1185 | |||
1186 | mov ecx,dword[ebx+u_object.typid-u_object] ;ecx - относительный индекс родительского объекта (в памяти) |
||
1187 | xor eax,eax |
||
1188 | mov ax,[tree2.info_size] |
||
1189 | imul ecx,eax ;умножаем индекс на размер структуры |
||
1190 | add ecx,[tree2.data_info] ;ecx - указатель данные родительского узла |
||
1191 | |||
1192 | ;проверку на правильность ecx ??? |
||
1193 | |||
1705 | IgorA | 1194 | stdcall insert_text_prop, ecx,0 ;тип переменной |
1698 | IgorA | 1195 | insert_sp |
1705 | IgorA | 1196 | stdcall insert_text_prop, ebx,1 ;значение |
1698 | IgorA | 1197 | |
1705 | IgorA | 1198 | stdcall get_obj_text_col,ebx,2 ;комментарий |
1698 | IgorA | 1199 | stdcall str_len,edx |
1200 | cmp eax,1 |
||
1201 | jl @f |
||
1202 | insert_sp |
||
1203 | insert_com |
||
1204 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
1205 | @@: |
||
1206 | insert_nl |
||
1207 | |||
1208 | popad |
||
1209 | ret |
||
1210 | endp |
||
1211 | |||
1212 | |||
1213 | |||
1214 | ;--- текстовые константы --- |
||
1705 | IgorA | 1215 | txt_str_beg db 39,0 |
1216 | txt_str_end db 39,',0',0 |
||
1698 | IgorA | 1217 | txt_coma db ',',0 |
1218 | txt_i_40 db 'int 0x40',13,0 |
||
1219 | txt_0 db '0',0 |
||
1220 | txt_1 db '1',0 |
||
1221 | txt_2 db '2',0 |
||
1222 | txt_3 db '3',0 |
||
1223 | txt_4 db '4',0 |
||
1224 | txt_8 db '8',0 |
||
1225 | txt_plus db '+',0 |
||
1711 | IgorA | 1226 | txt_minus db '-',0 |
1227 | ;txt_dol db '$',0 |
||
1698 | IgorA | 1228 | txt_nl db 13,0 |
1229 | txt_com db ';',0 |
||
1230 | txt_sp db ' ',0 |
||
1231 | txt_tab db 9,0 |
||
1232 | txt_br db '\',13,9,0 |
||
1705 | IgorA | 1233 | txt_txt db 'txt_',0 |
1234 | txt_db db ' db ',0 |
||
1235 | txt_dd db ' dd ',0 |
||
1711 | IgorA | 1236 | txt_rb db ' rb ',0 |
1705 | IgorA | 1237 | txt_dd_0_0 db 9,'dd 0,0',13,0 |
1238 | txt_mouse_dd db ', mouse_dd, ',0 |
||
1239 | txt_times db ':',13,9,'times ',0 |
||
1698 | IgorA | 1240 | txt_draw_wb: |
1241 | db 13,'align 4',13,'draw_window:',13,'pushad',13,9,'mcall 12,1',13,0 |
||
1242 | txt_draw_we: |
||
1243 | db 9,'mcall 12,2',13,'popad',13,9,'ret',13,0 |
||
1706 | IgorA | 1244 | txt_sys_dir db 'system_dir_',0 |
1245 | txt_lib_name db 'lib_name_',0 |
||
1246 | txt_lib_path db ' sys_path, library_path, ',0 |
||
1247 | txt_sys_err db '‘Ёб⥬ п ®иЁЎЄ ',0 |
||
1248 | txt_ll_start db 'l_libs_start:',13,0 |
||
1249 | txt_lib db 9,'lib_',0 |
||
1250 | txt_ll db 'l_libs ',0 |
||
1251 | txt_err_m_f_lib db 'err_msg_found_lib_',0 |
||
1252 | txt_head_l db 'head_f_l',0 |
||
1253 | txt_err_m_i_lib db 'err_msg_import_',0 |
||
1254 | txt_head_i db 'head_f_i',0 |
||
1255 | txt_ll_end db 'l_libs_end:',13,0 |
||
1717 | IgorA | 1256 | txt_bit_28 db '0x10000000',0 |
1257 | txt_bit_29 db '0x20000000',0 |
||
1258 | txt_bit_30 db '0x40000000',0 |
||
1259 | txt_bit_31 db '0x80000000',0 |
||
1698 | IgorA | 1260 | txt_0x33000000 db '0x33000000',0 ;tmp |
1261 | txt_struct db 'struct ',0 |
||
1711 | IgorA | 1262 | txt_met_end db '.end',0 |
1698 | IgorA | 1263 | txt_ends db 'ends',13,13,0 |
1264 | txt_mov db 'mov ',0 |
||
1265 | txt_xor db 'xor ',0 |
||
1266 | txt_or db 'or ',0 |
||
1267 | txt_cmp db 'cmp ',0 |
||
1268 | txt_call db 'call ',0 |
||
1269 | txt_jne_f db 'jne @f',0 |
||
1270 | txt_a_met db '@@:',0 |
||
1271 | txt_ah db 'ah',0 |
||
1272 | txt_eax db 'eax',0 |
||
1273 | txt_ebx db 'ebx',0 |
||
1274 | txt_ecx db 'ecx',0 |
||
1275 | txt_edx db 'edx',0 |
||
1276 | txt_edi db 'edi',0 |
||
1277 | txt_esi db 'esi',0 |
||
1278 | txt_align_4 db 'align 4',13,0 |
||
1279 | txt_d_poi db ':',0 |
||
1280 | txt_ret db 'ret',13,0 |
||
1281 | txt_i65p db '*65536+',0 |
||
1282 | txt_std_mouse_ed: |
||
1283 | db 9,'stdcall [edit_box_mouse], ',0 |
||
1284 | txt_std_mouse_cb: |
||
1285 | db 9,'stdcall [check_box_mouse], ',0 |
||
1286 | txt_std_key_ed: |
||
1287 | db 9,'stdcall [edit_box_key], ',0 |
||
1288 | txt_incl: |
||
1289 | db 'include ',0 |
||
1706 | IgorA | 1290 | txt_ebox db ' edit_box',0 |
1698 | IgorA | 1291 | txt_editb_draw: |
1292 | db 9,'stdcall [edit_box_draw], ',0 |
||
1293 | txt_cbox_draw: |
||
1294 | db 9,'stdcall [check_box_draw], ',0 |
||
1295 | |||
1296 | txt_but_1: |
||
1297 | db 'align 4',13,'button:',13,9,'mcall 17',13 |
||
1298 | txt_but_2: |
||
1299 | db 9,'cmp ah,1',13,9,'jne still',13,'.exit:',13,9,'mcall -1',13 |
||
1300 | txt_but_3: |
||
1301 | |||
1302 | txt_key_1: |
||
1303 | db 'align 4',13,'key:',13,9,'mcall 2',13 |
||
1304 | txt_key_2: |
||
1305 | db 9,'jmp still',13 |
||
1306 | txt_key_3: |
||
1307 | |||
1714 | IgorA | 1308 | ;получаем порядковый номер объекта относительно памяти элемента tree2 |
1309 | ;output: |
||
1310 | ; txt_buf - строка с номером объекта |
||
1698 | IgorA | 1311 | align 4 |
1714 | IgorA | 1312 | proc get_obj_id_str, p_obj:dword, txt_buf:dword |
1698 | IgorA | 1313 | push eax ecx edx |
1314 | mov eax,dword[p_obj] |
||
1315 | sub eax,[tree2.data_info] |
||
1316 | xor edx,edx |
||
1317 | xor ecx,ecx |
||
1318 | mov cx,word[tree2.info_size] |
||
1319 | div ecx |
||
1320 | |||
1321 | mov edx,dword[txt_buf] |
||
1322 | mov byte[edx],0 |
||
1323 | stdcall str_cat_value,edx,eax |
||
1324 | pop edx ecx eax |
||
1325 | ret |
||
1326 | endp |
||
1327 | |||
1714 | IgorA | 1328 | ;получаем порядковый номер объекта относительно памяти элемента tree2 |
1329 | ;output: |
||
1330 | ; eax - номер объекта |
||
1331 | align 4 |
||
1332 | proc get_obj_id, p_obj:dword |
||
1333 | push ecx edx |
||
1334 | mov eax,dword[p_obj] |
||
1335 | sub eax,[tree2.data_info] |
||
1336 | xor edx,edx |
||
1337 | xor ecx,ecx |
||
1338 | mov cx,word[tree2.info_size] |
||
1339 | div ecx |
||
1340 | pop edx ecx |
||
1341 | ret |
||
1342 | endp |
||
1343 | |||
1698 | IgorA | 1344 | ;--- текстовые функции --- |
1345 | |||
1346 | align 4 |
||
1347 | proc mem_clear, mem:dword, len:dword |
||
1348 | push eax ecx edi |
||
1349 | cld |
||
1350 | xor al,al |
||
1351 | mov edi, dword[mem] |
||
1352 | mov ecx, dword[len] |
||
1353 | repne stosb |
||
1354 | pop edi ecx eax |
||
1355 | ret |
||
1356 | endp |
||
1357 | |||
1358 | align 4 |
||
1359 | proc str_cat, str1:dword, str2:dword |
||
1360 | push eax ecx edi esi |
||
1361 | mov esi,dword[str2] |
||
1362 | stdcall str_len,esi |
||
1363 | mov ecx,eax |
||
1364 | inc ecx |
||
1365 | mov edi,dword[str1] |
||
1366 | stdcall str_len,edi |
||
1367 | add edi,eax |
||
1368 | cld |
||
1369 | repne movsb |
||
1370 | pop esi edi ecx eax |
||
1371 | ret |
||
1372 | endp |
||
1373 | |||
1374 | align 4 |
||
1375 | proc str_cat_value, str1:dword, value:dword |
||
1376 | pushad |
||
1377 | mov edi,[str1] |
||
1378 | stdcall str_len,edi |
||
1379 | add edi,eax |
||
1380 | mov eax,[value] |
||
1381 | call tl_convert_to_str |
||
1382 | popad |
||
1383 | ret |
||
1384 | endp |
||
1385 | |||
1386 | ;output: |
||
1387 | ; eax = strlen |
||
1388 | align 4 |
||
1389 | proc str_len, str1:dword |
||
1390 | mov eax,[str1] |
||
1391 | @@: |
||
1392 | cmp byte[eax],0 |
||
1393 | je @f |
||
1394 | inc eax |
||
1395 | jmp @b |
||
1396 | @@: |
||
1397 | sub eax,[str1] |
||
1398 | ret |
||
1399 | endp |
||
1400 | |||
1401 | ;input: |
||
1402 | ; eax = value |
||
1403 | ; edi = string buffer |
||
1404 | align 4 |
||
1405 | tl_convert_to_str: |
||
1406 | pushad |
||
1407 | stdcall mem_clear,edi,12 |
||
1408 | call .str |
||
1409 | popad |
||
1410 | ret |
||
1411 | |||
1412 | align 4 |
||
1413 | .str: |
||
1414 | mov ecx,0x0a ;задается система счисления изменяются регистры ebx,eax,ecx,edx входные параметры eax - число |
||
1415 | ;преревод числа в ASCII строку входные данные ecx=система счисленя edi адрес куда записывать, будем строку, причем конец переменной |
||
1416 | cmp eax,ecx ;сравнить если в eax меньше чем в ecx то перейти на @@-1 т.е. на pop eax |
||
1417 | jb @f |
||
1418 | xor edx,edx ;очистить edx |
||
1419 | div ecx ;разделить - остаток в edx |
||
1420 | push edx ;положить в стек |
||
1421 | ;dec edi ;смещение необходимое для записи с конца строки |
||
1422 | call .str ;перейти на саму себя т.е. вызвать саму себя и так до того момента пока в eax не станет меньше чем в ecx |
||
1423 | pop eax |
||
1424 | @@: ;cmp al,10 ;проверить не меньше ли значение в al чем 10 (для системы счисленя 10 данная команда - лишная)) |
||
1425 | or al,0x30 ;данная команда короче чем две выше |
||
1426 | stosb ;записать элемент из регистра al в ячеку памяти es:edi |
||
1427 | ret |