diff --git a/programs/develop/libraries/box_lib/trunk/box_lib.mac b/programs/develop/libraries/box_lib/trunk/box_lib.mac index 4f35751da6..8034c427ac 100644 --- a/programs/develop/libraries/box_lib/trunk/box_lib.mac +++ b/programs/develop/libraries/box_lib/trunk/box_lib.mac @@ -168,6 +168,18 @@ op_flag_en=10b .flags: dd flags+0 ; 䫠 } +option_group equ [edi] +op_left equ [edi+4] ;न 砫 ᮢ +op_top equ [edi+6] ;न 砫 ᮢ +op_text_margin equ [edi+8] ;=4 ﭨ אַ㣮쭨 祪 +op_size equ [edi+12] ;12 ࠧ 祪 +op_color equ [edi+16] +op_border_color equ [edi+20] ; or [edi+4] ;梥 ࠬ checkbox ᠬ⥫쭮 +op_text_color equ [edi+24];[edi+4] ;梥 ⥪ +op_text_ptr equ [edi+28] ;㪠⥫ 砫 ⥪⮢ ப +op_text_length equ [edi+32] +op_flags equ [edi+36] ;䫠 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Basic macros for use TreeList ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/programs/develop/libraries/box_lib/trunk/checkbox.mac b/programs/develop/libraries/box_lib/trunk/checkbox.mac index 99ada116ff..19424bccb5 100644 --- a/programs/develop/libraries/box_lib/trunk/checkbox.mac +++ b/programs/develop/libraries/box_lib/trunk/checkbox.mac @@ -2,20 +2,6 @@ ; box_lib.obj ;Checkbox -ch_struc_size=36 -ch_flag_en=10b ; - -ch_left equ [edi] ; -ch_top equ [edi+2] ; -ch_text_margin equ [edi+4] ;=4 -ch_size equ [edi+8] ;12 -ch_color equ [edi+12] ; checkbox -ch_border_color equ [edi+16] ; or [edi+4] ; checkbox -ch_text_color equ [edi+20] ;[edi+4] ; -ch_text_ptr equ [edi+24] ; -ch_text_length equ [edi+28] -ch_flags equ [edi+32] ; - macro use_checkbox_draw { check_box_draw: diff --git a/programs/develop/libraries/box_lib/trunk/doc/t_edit/t_edit.htm b/programs/develop/libraries/box_lib/trunk/doc/t_edit/t_edit.htm index 88668441b7..98ee2d4dd1 100644 --- a/programs/develop/libraries/box_lib/trunk/doc/t_edit/t_edit.htm +++ b/programs/develop/libraries/box_lib/trunk/doc/t_edit/t_edit.htm @@ -41,27 +41,18 @@

tedit

-

text_editor , .

+

text_editor , .

, text_editor.

-

+

-

- - -

+

( ), , .

@@ -81,10 +72,10 @@ ends , ( "" ).

'td' - , , , .

-

'col' - .

+

'col' - , ted_text_colors.

-

:

+

:

ted_but_copy

Ctrl+C. ted_buffer, ted_buffer_size.

@@ -280,7 +271,7 @@ stdcall [ted_text_add], tedit0,text_buffer,30,ebx call [ted_text_colored] pop edi -

:

+

:

ted_get_text_perv_pos - ( 'perv')

ted_get_text_next_pos - ( 'next')

ted_symbol_not_vis - ( @@ -383,7 +374,7 @@ tedit0: ; .increase_size dd 225 ;+242 .ptr_free_symb dd ? ;+246 , ( )


-

17.05.10.

+

30.05.10.

\ No newline at end of file diff --git a/programs/develop/libraries/box_lib/trunk/editbox.mac b/programs/develop/libraries/box_lib/trunk/editbox.mac index 10a94db0d1..dbe29980de 100644 --- a/programs/develop/libraries/box_lib/trunk/editbox.mac +++ b/programs/develop/libraries/box_lib/trunk/editbox.mac @@ -1,27 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Basic macros for use editbox ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -ed_width equ [edi] ;ਭ -ed_left equ [edi+4] ; -ed_top equ [edi+8] ; -ed_color equ [edi+12] ;梥 䮭 -shift_color equ [edi+16] ;=0x6a9480 ਬ 쥬 梥 -ed_focus_border_color equ [edi+20] ;梥 ࠬ -ed_blur_border_color equ [edi+24] ;梥 ⨢ -ed_text_color equ [edi+28] ;梥 ⥪ -ed_max equ [edi+32] ;- ᨬ ᨬ쭮 -ed_text equ [edi+36] ;㪠⥫ -ed_mouse_variable equ [edi+40] ; 㪠⥫ ६ /㯯 -ed_flags equ [edi+44] ;䫠 -bp_flags equ [ebp+44] ; 楤 edi ᯮ, 㪠⥫ ࠭ ebp -ed_size equ [edi+48] ;- ᨬ -bp_size equ [ebp+48] ;- ᨬ, 樨 ᯫ ebp edi -ed_pos equ [edi+52] ; -ed_offset equ [edi+56] ;ᬥ饭 -cl_curs_x equ [edi+60] ;।饥 न -cl_curs_y equ [edi+64] ;।饥 न -ed_shift_pos equ [edi+68] ; -ed_shift_pos_old equ [edi+72] ;஥ macro init_editbox { @@ -1334,29 +1313,4 @@ struc edit_box width,left,top,color,shift_color,focus_border_color,\ .cl_curs_y dd 0 .shift dd 0 .shift_old dd 0 -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;Bit mask from editbox -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -ed_figure_only= 1000000000000000b ; ᨬ -ed_always_focus= 100000000000000b -ed_focus= 10b ;䮪 ਫ -ed_shift_on= 1000b ;᫨ ⠭ - shift,᫨ ⠭, 㦥 - 㤥ন shift -ed_shift_on_off=1111111111110111b -ed_shift= 100b ;砥 ⨨ shift .. ᫨ -ed_shift_off= 1111111111111011b -ed_shift_bac= 10000b ; ⪨ 뤥 shift .. ⠭ 뤥 -ed_shift_bac_cl=1111111111101111b ;⪠ 㤠 뤥 -ed_shift_cl= 1111111111100011b -ed_shift_mcl= 1111111111111011b -ed_left_fl= 100000b -ed_right_fl= 1111111111011111b -ed_offset_fl= 1000000b -ed_offset_cl= 1111111110111111b -ed_insert= 10000000b -ed_insert_cl= 1111111101111111b -ed_mouse_on = 100000000b -ed_mous_adn_b= 100011000b -ed_mouse_on_off=1111111011111111b -ed_height=14 ; - } diff --git a/programs/develop/libraries/box_lib/trunk/optionbox.mac b/programs/develop/libraries/box_lib/trunk/optionbox.mac index 43e38e6dfd..b217da84d6 100644 --- a/programs/develop/libraries/box_lib/trunk/optionbox.mac +++ b/programs/develop/libraries/box_lib/trunk/optionbox.mac @@ -65,18 +65,6 @@ option_box_mouse: macro use_optionbox_draw { option_box_draw_box: -option_group equ [edi] -op_left equ [edi+4] ;न 砫 ᮢ -op_top equ [edi+6] ;न 砫 ᮢ -op_text_margin equ [edi+8] ;=4 ﭨ אַ㣮쭨 祪 -op_size equ [edi+12] ;12 ࠧ 祪 -op_color equ [edi+16] -op_border_color equ [edi+20] ; or [edi+4] ;梥 ࠬ checkbox ᠬ⥫쭮 -op_text_color equ [edi+24];[edi+4] ;梥 ⥪ -op_text_ptr equ [edi+28] ;㪠⥫ 砫 ⥪⮢ ப -op_text_length equ [edi+32] -op_flags equ [edi+36] ;䫠 - pusha ;࠭ ॣ movzx ebx,word op_left diff --git a/programs/develop/libraries/box_lib/trunk/readme.txt b/programs/develop/libraries/box_lib/trunk/readme.txt index d0bef2ca60..b3e5e0416e 100644 --- a/programs/develop/libraries/box_lib/trunk/readme.txt +++ b/programs/develop/libraries/box_lib/trunk/readme.txt @@ -1,25 +1,20 @@ , . editbox , EditBox . - 14.10.2009 - . edit_box mouse_dd dd ? + +21.09.2007 - stdcall. + , , . + box_lib.obj editbox_ex, /sys/lib/? ini_file . , +24.09.2007 - checkbox. , :( + +25.06.2008 - 2- +1. /sys/lib/box_lib.obj . + +08.05.2009 - +15.04.2009 - load_lib.mac - /. +13.09.2009 - NUM, Caps,Scroll Lock. , . +14.10.2009 - . edit_box mouse_dd dd ? 1 < mouse_dd> ed_struc_size=76 struc edit_box width,left,top,color,shift_color,focus_border_color,\ blur_border_color,text_color,max,text,< mouse_dd>,flags,size,pos - - - - 25.06.2008 - 2- -1. /sys/lib/box_lib.obj . - - 21.09.2007 - stdcall. - , , . - box_lib.obj editbox_ex, /sys/lib/? ini_file -. , -08.05.2009 - -15.04.2009 - load_lib.mac - /. -13.09.2009 - NUM, Caps,Scroll Lock. , . -24.09.2007 - checkbox. , :( \ No newline at end of file diff --git a/programs/other/t_edit/info/ini_files.syn b/programs/other/t_edit/info/ini_files.syn new file mode 100644 index 0000000000..096d290089 Binary files /dev/null and b/programs/other/t_edit/info/ini_files.syn differ diff --git a/programs/other/t_edit_synt/build.bat b/programs/other/t_edit_synt/build.bat new file mode 100644 index 0000000000..8b8cd29449 --- /dev/null +++ b/programs/other/t_edit_synt/build.bat @@ -0,0 +1,12 @@ +if not exist bin mkdir bin +if not exist bin\tl_sys_16.bmp @copy ..\..\develop\libraries\box_lib\trunk\tl_sys_16.bmp bin\tl_sys_16.bmp +if not exist bin\tl_nod_16.bmp @copy ..\..\develop\libraries\box_lib\trunk\tl_nod_16.bmp bin\tl_nod_16.bmp +if not exist bin\info mkdir bin\info +copy ..\t_edit\info\* bin\info\* + +if not exist bin\box_lib.obj @fasm.exe -m 16384 ..\..\develop\libraries\box_lib\trunk\box_lib.asm bin\box_lib.obj +@kpack bin\box_lib.obj + +@fasm.exe -m 16384 te_syntax.asm bin\te_syntax.kex +@kpack bin\te_syntax.kex +pause \ No newline at end of file diff --git a/programs/other/t_edit_synt/readme.htm b/programs/other/t_edit_synt/readme.htm new file mode 100644 index 0000000000..2abe479263 --- /dev/null +++ b/programs/other/t_edit_synt/readme.htm @@ -0,0 +1,153 @@ + + + + + + + + +

TextEditor syntax file converter 31.05.2010

+

+

*.syn.

+

+

.

+ +

+

te_synt.kex t_edit.kex.

+

1) .syn

+

2) .asm

+

3) .asm , :

+ +

4) fasm

+

5) .bin .syn

+

3- , , .

+ +

*.asm

+

count_colors_text -

+

count_key_words -

+

:

+

color_cursor -

+

color_wnd_capt -

+

color_wnd_work -

+

color_wnd_bord -

+

color_select -

+

color_cur_text -

+

color_wnd_text -

+ +

text - . wo:

+
macro wo txt,lf1,p1,p2,p3{
+@@: db txt
+rb @b+40-$
+dd lf1
+db p1,p2+0,p3
+}
+

:

+

txt -

+

lf1 - f1

+

p1 - . 5 , :

+ +

p2 - ascii . , , : , . 2- 4 = 22.

+

p3 - color_wnd_text,

+ +

1. or, - , : form, color p2 0 1 3 = 20+21 = 1+2.

+

2. , :

+
wo<'word'>,f1.600-f1,3,,8
+wo<'xadd'>,0,3,,1
+wo<'xchg'>,f1.602-f1,3,,1
+wo<'xlat'>,0,3,,1
+wo<'xlatb'>,0,3,,1
+wo<'xmm0'>,0,3,,2
+wo<'xmm1'>,0,3,,2
+wo<'xmm2'>,0,3,,2
+wo<'xmm3'>,0,3,,2
+wo<'xmm4'>,0,3,,2
+wo<'xmm5'>,0,3,,2
+wo<'xmm6'>,0,3,,2
+wo<'xmm7'>,0,3,,2
+wo<'xor'>,f1.613-f1,3,,1
+wo<'zf'>,f1.614-f1,3,,2
+wo<'||'>,0,0,,1
+

p2 3-, 0, .

+ +

*.syn

+ + + + + + + + + + + + + + + + +
()
4
4
4*6
4*(. . )
sizeof(TexColViv)*(. )
, ( 0)
1 
( 0- )
(   + 1)
+

.

+ + +
+

+

. (IgorA) - .

+ + + \ No newline at end of file diff --git a/programs/other/t_edit_synt/te_data.inc b/programs/other/t_edit_synt/te_data.inc new file mode 100644 index 0000000000..61333f32bf --- /dev/null +++ b/programs/other/t_edit_synt/te_data.inc @@ -0,0 +1,393 @@ +fn_col_option dd def_col_file +fn_syntax_dir db 'info/',0 +def_col_file db 'default.syn',0 + +system_dir0 db '/sys/lib/' +boxlib_name db 'box_lib.obj',0 + +fn_icon_tl_sys db 'tl_sys_16.bmp',0 +fn_icon_tl_nod db 'tl_nod_16.bmp',0 +;--------------------------------------------------------------------- + +align 4 +myimport: +edit_box_draw dd aEdit_box_draw +edit_box_key dd aEdit_box_key +edit_box_mouse dd aEdit_box_mouse +version_ed dd aVersion_ed + +;check_box_draw dd aCheck_box_draw +;check_box_mouse dd aCheck_box_mouse +;version_ch dd aVersion_ch + +;option_box_draw dd aOption_box_draw +;option_box_mouse dd aOption_box_mouse +;version_op dd aVersion_op + +scrollbar_ver_draw dd aScrollbar_ver_draw +scrollbar_ver_mouse dd aScrollbar_ver_mouse +scrollbar_hor_draw dd aScrollbar_hor_draw +scrollbar_hor_mouse dd aScrollbar_hor_mouse +version_scrollbar dd aVersion_scrollbar + +;dinamic_button_draw dd aDbutton_draw +;dinamic_button_mouse dd aDbutton_mouse +;version_dbutton dd aVersion_dbutton + +tl_data_init dd sz_tl_data_init +tl_data_clear dd sz_tl_data_clear +tl_info_clear dd sz_tl_info_clear +tl_key dd sz_tl_key +tl_mouse dd sz_tl_mouse +tl_draw dd sz_tl_draw +tl_info_undo dd sz_tl_info_undo +tl_info_redo dd sz_tl_info_redo +tl_node_add dd sz_tl_node_add +tl_node_set_data dd sz_tl_node_set_data +tl_node_get_data dd sz_tl_node_get_data +tl_node_delete dd sz_tl_node_delete +tl_cur_beg dd sz_tl_cur_beg +tl_cur_next dd sz_tl_cur_next +tl_cur_perv dd sz_tl_cur_perv +tl_node_close_open dd sz_tl_node_close_open +tl_node_lev_inc dd sz_tl_node_lev_inc +tl_node_lev_dec dd sz_tl_node_lev_dec +tl_node_move_down dd sz_tl_node_move_down +tl_save_mem dd sz_tl_save_mem +tl_load_mem dd sz_tl_load_mem + +ted_but_save_file dd sz_ted_but_save_file +ted_but_sumb_upper dd sz_ted_but_sumb_upper +ted_but_sumb_lover dd sz_ted_but_sumb_lover +ted_can_save dd sz_ted_can_save +ted_clear dd sz_ted_clear +ted_delete dd sz_ted_delete +ted_draw dd sz_ted_draw +ted_init dd sz_ted_init +ted_init_scroll_bars dd sz_ted_init_scroll_bars +ted_init_syntax_file dd sz_ted_init_syntax_file +ted_is_select dd sz_ted_is_select +ted_key dd sz_ted_key +ted_mouse dd sz_ted_mouse +ted_open_file dd sz_ted_open_file +ted_text_add dd sz_ted_text_add +ted_but_select_word dd sz_ted_but_select_word +ted_but_cut dd sz_ted_but_cut +ted_but_copy dd sz_ted_but_copy +ted_but_paste dd sz_ted_but_paste +ted_but_undo dd sz_ted_but_undo +ted_but_redo dd sz_ted_but_redo +ted_but_reverse dd sz_ted_but_reverse +ted_but_find_next dd sz_ted_but_find_next +ted_text_colored dd sz_ted_text_colored +;version_text_edit dd sz_ted_version + +dd 0,0 + +aEdit_box_draw db 'edit_box',0 +aEdit_box_key db 'edit_box_key',0 +aEdit_box_mouse db 'edit_box_mouse',0 +aVersion_ed db 'version_ed',0 + +;aCheck_box_draw db 'check_box_draw',0 +;aCheck_box_mouse db 'check_box_mouse',0 +;aVersion_ch db 'version_ch',0 + +;aOption_box_draw db 'option_box_draw',0 +;aOption_box_mouse db 'option_box_mouse',0 +;aVersion_op db 'version_op',0 + +aScrollbar_ver_draw db 'scrollbar_v_draw',0 +aScrollbar_ver_mouse db 'scrollbar_v_mouse',0 +aScrollbar_hor_draw db 'scrollbar_h_draw',0 +aScrollbar_hor_mouse db 'scrollbar_h_mouse',0 +aVersion_scrollbar db 'version_scrollbar',0 + +;aDbutton_draw db 'dbutton_draw',0 +;aDbutton_mouse db 'dbutton_mouse',0 +;aVersion_dbutton db 'version_dbutton',0 + +sz_tl_data_init db 'tl_data_init',0 +sz_tl_data_clear db 'tl_data_clear',0 +sz_tl_info_clear db 'tl_info_clear',0 +sz_tl_key db 'tl_key',0 +sz_tl_mouse db 'tl_mouse',0 +sz_tl_draw db 'tl_draw',0 +sz_tl_info_undo db 'tl_info_undo',0 +sz_tl_info_redo db 'tl_info_redo',0 +sz_tl_node_add db 'tl_node_add',0 +sz_tl_node_set_data db 'tl_node_set_data',0 +sz_tl_node_get_data db 'tl_node_get_data',0 +sz_tl_node_delete db 'tl_node_delete',0 +sz_tl_cur_beg db 'tl_cur_beg',0 +sz_tl_cur_next db 'tl_cur_next',0 +sz_tl_cur_perv db 'tl_cur_perv',0 +sz_tl_node_close_open db 'tl_node_close_open',0 +sz_tl_node_lev_inc db 'tl_node_lev_inc',0 +sz_tl_node_lev_dec db 'tl_node_lev_dec',0 +sz_tl_node_move_down db 'tl_node_move_down',0 +sz_tl_save_mem db 'tl_save_mem',0 +sz_tl_load_mem db 'tl_load_mem',0 + +sz_ted_but_save_file db 'ted_but_save_file',0 +sz_ted_but_sumb_upper db 'ted_but_sumb_upper',0 +sz_ted_but_sumb_lover db 'ted_but_sumb_lover',0 +sz_ted_can_save db 'ted_can_save',0 +sz_ted_clear db 'ted_clear',0 +sz_ted_delete db 'ted_delete',0 +sz_ted_draw db 'ted_draw',0 +sz_ted_init db 'ted_init',0 +sz_ted_init_scroll_bars db 'ted_init_scroll_bars',0 +sz_ted_init_syntax_file db 'ted_init_syntax_file',0 +sz_ted_is_select db 'ted_is_select',0 +sz_ted_key db 'ted_key',0 +sz_ted_mouse db 'ted_mouse',0 +sz_ted_open_file db 'ted_open_file',0 +sz_ted_text_add db 'ted_text_add',0 +sz_ted_but_select_word db 'ted_but_select_word',0 +sz_ted_but_cut db 'ted_but_cut',0 +sz_ted_but_copy db 'ted_but_copy',0 +sz_ted_but_paste db 'ted_but_paste',0 +sz_ted_but_undo db 'ted_but_undo',0 +sz_ted_but_redo db 'ted_but_redo',0 +sz_ted_but_reverse db 'ted_but_reverse',0 +sz_ted_but_find_next db 'ted_but_find_next',0 +sz_ted_text_colored db 'ted_text_colored',0 +;sz_ted_version db 'version_text_edit',0 +;--------------------------------------------------------------------- +align 4 +ws_dir_lbox: ; ListBox +.x: +.size_x dw 16 ;+0 +.start_x dw 0 ;+2 +.y: +.size_y dw 30 ;+4 +.start_y dw 70 ;+6 +.btn_high dd 15 ;+8 +.type dd 1 ;+12 +.max_area dd 100 ;+16 +.cur_area dd 30 ;+20 +.position dd 0 ;+24 +.bckg_col dd 0xeeeeee ;+28 +.frnt_col dd 0xbbddff ;+32 +.line_col dd 0 ;+36 +.redraw dd 0 ;+40 +.delta dw 0 ;+44 +.delta2 dw 0 ;+46 +.run_x: +.r_size_x dw 0 ;+48 +.r_start_x dw 0 ;+50 +.run_y: +.r_size_y dw 0 ;+52 +.r_start_y dw 0 ;+54 +.m_pos dd 0 ;+56 +.m_pos_2 dd 0 ;+60 +.m_keys dd 0 ;+64 +.run_size dd 0 ;+68 +.position2 dd 0 ;+72 +.work_size dd 0 ;+76 +.all_redraw dd 0 ;+80 +.ar_offset dd 1 ;+84 +;--------------------------------------------------------------------- + +count_of_dir_list_files equ 15 + +el_focus dd 0 +mouse_dd dd 0 + +tree1 tree_list 264,count_of_dir_list_files+2, tl_key_no_edit+tl_draw_par_line+tl_list_box_mode,\ + 16,16, 0x8080ff,0x0000ff,0xffffff, 5,5,180-17,185, 12,0,0, el_focus,\ + ws_dir_lbox,0 + +;dir_list memory +tree_file_struct: + dd 1 + dd 0,0,count_of_dir_list_files + dd dir_mem + db 0 + dd file_name ;sys_path + +dir_mem rb 32+304*count_of_dir_list_files + +;------------------------------------------------------------------------------ +struct TexSelect + x0 dd ? + y0 dd ? + x1 dd ? + y1 dd ? +ends +;------------------------------------------------------------------------------ +align 4 +tedit0: ; ⥪⮢ । + .wnd BOX 195,5+20,325,260 ;+ 0 + .rec BOX 30,13,7,10 ;+16 + .drag_m db 0 ;+32 뤥 + .drag_k db 0 ;+33 뤥 + .sel TexSelect 0,0,0,0 ;+34 뤥 + .seln TexSelect ;+50 ⥫쭠 뤥 + .tex dd 0 ;+66 text memory pointer + .tex_1 dd 0 ;+70 text first symbol pointer + .tex_end dd 0 ;+74 text end memory pointer + .cur_x dd 0 ;+78 न x + .cur_y dd 0 ;+82 न y + .max_chars dd 25002 ;+86 ᨬ쭮 ᫮ ᨬ 㬥 + .count_colors_text dd 1 ;+90 ⢮ 梥⮢ ⥪ + .count_key_words dd 0 ;+94 ⢮ 祢 ᫮ + .color_cursor dd 0xff0000 ;+98 梥 + .color_wnd_capt dd 0x0080c0 ;+102 梥 + .color_wnd_work dd 0x0 ;+106 梥 䮭 + .color_wnd_bord dd 0xffffff ;+110 梥 ⥪ + .color_select dd 0x0000ff ;+114 梥 뤥 + .color_cur_text dd 0xffff00 ;+118 梥 ᨬ ஬ + .color_wnd_text dd 0x80ffff ;+122 梥 ⥪ + .syntax_file dd 0 ;+126 㪠⥫ 砫 䠩 ᨭ⠪ + .syntax_file_size dd 500 ;+130 ᨬ ࠧ 䠩 ᨭ⠪ + .text_colors dd 0 ;+134 㪠⥫ ᨢ 梥⮢ ⥪ + .help_text_f1 dd 0 ;+138 㪠⥫ ⥪ ࠢ ( ⨨ F1) + .help_id dd -1 ;+142 䨪 ࠢ + .key_words_data dd 0 ;+146 㪠⥫ 祢 ᫮ TexColViv + .tim_ch dd ? ;+150 ⢮ 䠩 + .tim_undo dd ? ;+154 ⢮ ⬥ ⢨ + .tim_ls dd ? ;+158 ६ ᫥ ࠭ + .tim_co dd ? ;+162 ६ ᫥ 梥⮢ ࠧ⪨ + .el_focus dd el_focus ;+166 㪠⥫ ६ 䮪 + .err_save db 0 ;+170 訡 ࠭ 䠩 + .panel_id db 0 ;+171 ⮩ + .key_new db 0 ;+172 ᨬ, 㤥 + .symbol_new_line db 20 ;+173 ᨬ 襭 ப + .scr_w dd scrol_w1 ;+174 ⨪ ஫ + .scr_h dd scrol_h1 ;+178 ਧ⠫ ஫ + .arr_key_pos dd 0 ;+182 㪠⥫ ᨢ 権 祢 ᫮ + .buffer dd buf ;+186 㪠⥫ ஢/⠢ + .buffer_find dd 0 ;+190 㪠⥫ ᪠ + .cur_ins db 1 ;+194 ० ࠡ ( ) + .mode_color db 1 ;+195 ० 뤥 ᫮ 梥⮬ (0-몫. 1-.) + .mode_invis db 0 ;+196 ० ⠥ ᨬ + .gp_opt db 0 ;+197 樨 頥 㭪樥 ted_get_pos_by_cursor + .fun_on_key_ctrl_o dd but_ctrl_o ;+198 㪠⥫ 㭪 뢠 ⨨ Ctrl+O (⨥ 䠩) + .fun_on_key_ctrl_f dd 0 ;+202 ... Ctrl+F (맮/ ᪠) + .fun_on_key_ctrl_n dd but_ctrl_n ;+206 ... Ctrl+N (ᮧ 㬥) + .fun_on_key_ctrl_s dd 0 ;+210 ... Ctrl+S + .buffer_size dd BUF_SIZE ;+214 ࠧ ஢/⠢ + .fun_find_err dd 0 ;+218 㪠⥫ 㭪 뢠 ᫨ 稫 㤠筮 + .fun_init_synt_err dd 0 ;+222 㪠⥫ 㭪 뢠 訡筮 ⨨ 䠩 ᨭ⠪ + .fun_draw_panel_buttons dd 0 ;+226 㪠⥫ 㭪 ᮢ + .fun_draw_panel_find dd 0 ;+230 㪠⥫ 㭪 ᮢ ᪠ + .fun_draw_panel_syntax dd 0 ;+234 㪠⥫ 㭪 ᮢ ᨭ⠪ + .fun_save_err dd 0 ;+238 㪠⥫ 㭪 뢠 ᫨ ࠭ 䠩 稫 㤠筮 + .increase_size dd 1000 ;+242 ᫮ ᨬ 㤥 㢥稢 墠⪥ + .ptr_free_symb dd ? ;+246 㪠⥫ ᢮ , ᨬ (ᯮ ᪮७ ⠢ ⥪) +;------------------------------------------------------------------------------ +align 4 +scrol_w1: +.x: +.size_x dw 16 ;+0 +.start_x dw 85 ;+2 +.y: +.size_y dw 100 ; +4 +.start_y dw 15 ; +6 +.btn_high dd 15 ; +8 +.type dd 1 ;+12 +.max_area dd 100 ;+16 +.cur_area dd 30 ;+20 +.position dd 0 ;+24 +.bckg_col dd 0xeeeeee ;+28 +.frnt_col dd 0xbbddff ;+32 +.line_col dd 0x808080 ;+36 +.redraw dd 0 ;+40 +.delta dw 0 ;+44 +.delta2 dw 0 ;+46 +.run_x: +.r_size_x dw 0 ;+48 +.r_start_x dw 0 ;+50 +.run_y: +.r_size_y dw 0 ;+52 +.r_start_y dw 0 ;+54 +.m_pos dd 0 ;+56 +.m_pos_2 dd 0 ;+60 +.m_keys dd 0 ;+64 +.run_size dd 0 ;+68 +.position2 dd 0 ;+72 +.work_size dd 0 ;+76 +.all_redraw dd 0 ;+80 +.ar_offset dd 1 ;+84 +;--------------------------------------------------------------------- +align 4 +scrol_h1: +.x: +.size_x dw 85 ;+0 +.start_x dw 30 ;+2 +.y: +.size_y dw 16 ;+4 +.start_y dw 100 ;+6 +.btn_high dd 15 ;+8 +.type dd 1 ;+12 +.max_area dd 100 ;+16 +.cur_area dd 30 ;+20 +.position dd 0 ;+24 +.bckg_col dd 0xeeeeee ;+28 +.frnt_col dd 0xbbddff ;+32 +.line_col dd 0x808080 ;+36 +.redraw dd 0 ;+40 +.delta dw 0 ;+44 +.delta2 dw 0 ;+46 +.run_x: +.r_size_x dw 0 ;+48 +.r_start_x dw 0 ;+50 +.run_y: +.r_size_y dw 0 ;+52 +.r_start_y dw 0 ;+54 +.m_pos dd 0 ;+56 +.m_pos_2 dd 0 ;+60 +.m_keys dd 0 ;+64 +.run_size dd 0 ;+68 +.position2 dd 0 ;+72 +.work_size dd 0 ;+76 +.all_redraw dd 0 ;+80 +.ar_offset dd 1 ;+84 +;--------------------------------------------------------------------- + +align 4 +str_file_70: + rb (5*4+1+4) ; ࠡ 䠩 (. 70) + +text_buffer db 500 dup(0) + +align 4 +;conv_tabl rb 128 ;⠡ ஢ scan- ascii- +buf db BUF_SIZE dup(0) ; ஢ | ⠢ + +capt_header db 'macro wo txt,lf1,p1,p2,p3{',13 + db '@@: db txt',13,'rb @b+40-$',13,'dd lf1',13,'db p1,p2+0,p3',13,'}',13 + db 'count_colors_text dd (text-color_wnd_text)/4',13 + db 'count_key_words dd (f1-text)/47',13,0 +col_1 db 'color_cursor dd ',0 ;+ 98 梥 +col_2 db 'color_wnd_capt dd ',0 ;+102 梥 +col_3 db 'color_wnd_work dd ',0 ;+106 梥 䮭 +col_4 db 'color_wnd_bord dd ',0 ;+110 梥 ⥪ +col_5 db 'color_select dd ',0 ;+114 梥 뤥 +col_6 db 'color_cur_text dd ',0 ;+118 梥 ᨬ ஬ +col_7 db 'color_wnd_text:',13,0 ;+122 梥 ⥪ + +capt_lbl_wo db 'text:',13,0 +capt_beg_word db 'wo<',39,0 +capt_beg_db db ':db ',39,0 +capt_end_word db 39,'>,',0 +capt_type_dd db 9,'dd ',0 +capt_lbl_f1 db 'f1: db 0',13,0 +capt_end_word_f1 db 39,',0',13,0 +capt_calc_f1 db 'f1' +capt_point db '.',0 +capt_lbl_f1_use db '-f1',0 +capt_null db '0',0 + +KM_SHIFT equ 0x00010000 +KM_CTRL equ 0x00020000 +KM_ALT equ 0x00040000 +KM_NUMLOCK equ 0x00080000 + +; KEY CODES +KEY_F1 equ 0x0000003B +KEY_F2 equ 0x0000003C +KEY_F3 equ 0x0000003D + diff --git a/programs/other/t_edit_synt/te_syntax.asm b/programs/other/t_edit_synt/te_syntax.asm new file mode 100644 index 0000000000..8c34d046be --- /dev/null +++ b/programs/other/t_edit_synt/te_syntax.asm @@ -0,0 +1,376 @@ +use32 + org 0x0 + db 'MENUET01' ;. ᯮ塞 䠩 ᥣ 8 + dd 0x01 + dd start + dd i_end ; ࠧ ਫ + dd mem + dd stacktop + dd file_name;buf_cmd_lin + dd sys_path + +MAX_COLOR_WORD_LEN equ 40 +BUF_SIZE equ 1000 ;buffer for copy|paste +maxSyntaxFileSize equ 310000 + +include '../../macros.inc' +include '../../proc32.inc' +include '../../develop/libraries/box_lib/load_lib.mac' +include '../../develop/libraries/box_lib/trunk/box_lib.mac' + +include 'te_data.inc' +include 'te_work.inc' ;text work functions + +@use_library + +align 4 +start: + mov eax,48 + mov ebx,3 + mov ecx,sc + mov edx,sizeof.system_colors + mcall + + mcall 68,11 + or eax,eax + jz button.exit + + mcall 40,0x27 + +;------------------------------------------------- + mov ecx,maxSyntaxFileSize + call mem_Alloc + mov [options_file],eax + mov [options_file_end],eax + add [options_file_end],ecx + + +load_libraries l_libs_start,load_lib_end + +;஢ઠ ᪮쪮 㤠筮 㧨 + mov ebp,lib0 + cmp dword [ebp+ll_struc_size-4],0 + jz @f + mcall -1 ;exit not correct +@@: + +;--------------------------------------------------------------------- + stdcall dword[tl_data_init],dword tree1 + copy_path fn_icon_tl_sys,sys_path,file_name,0 + + mov ecx,3*256*13 + call mem_Alloc + mov dword[tree1.data_img_sys],eax + + mov [run_file_70.Function], 0 + mov [run_file_70.Position], 54 + mov [run_file_70.Flags], 0 + mov [run_file_70.Count], 3*256*13 + mov [run_file_70.Buffer], eax + mov byte[run_file_70+20], 0 + mov [run_file_70.FileName], file_name + + mov eax,70 ;load icon file + mov ebx,run_file_70 + int 0x40 + cmp ebx,0 + jg @f + mov dword[tree1.data_img_sys],0 + @@: +;--------------------------------------------------------------------- +; ⠥ bmp 䠩 㧫 + copy_path fn_icon_tl_nod,sys_path,file_name,0 + + mov ecx,3*256*2 + call mem_Alloc + mov dword[tree1.data_img],eax + +; mov [run_file_70.Function], 0 +; mov [run_file_70.Position], 54 +; mov [run_file_70.Flags], 0 + mov [run_file_70.Count], 3*256*2 + mov [run_file_70.Buffer], eax +; mov byte[run_file_70+20], 0 +; mov [run_file_70.FileName], file_name + + mov eax,70 ;load icon file + mov ebx,run_file_70 + int 0x40 + cmp ebx,0 + jg @f + mov dword[tree1.data_img],0 + @@: +;------------------------------------------------------------------------------ + copy_path fn_syntax_dir,sys_path,file_name,0 ;६ 䠩 ᨭ⠪ + mov eax,70 + mov ebx,tree_file_struct + int 0x40 + +cmp ebx,-1 +je .end_dir_init + + mov eax,dir_mem + add eax,32+4+1+3+4*6+8 +mov ecx,ebx +@@: + cmp byte[eax],'.' ;䨫㥬 䠩 '.' '..' + je .filter + push dword tree1 + push dword 0x10000 ;1*2^16 - 1 + push dword eax + call dword[tl_node_add] + + stdcall dword[tl_cur_next],tree1 + .filter: + add eax,304 + loop @b +.end_dir_init: + +;--- load color option file --- +stdcall [ted_init], tedit0 + +align 4 +red_win: + pushad + mcall 12,1 + + xor eax,eax + mov ebx,10*65536+555 + mov ecx,10*65536+333 + mov edx,[sc.work] + or edx,0x33000000 + mov edi,hed + mcall + + mcall 9,procinfo,-1 + + mov eax,8 ; + mov ebx,5*65536+90 + mov ecx,195*65536+20 + mov edx,200 + mov esi,[sc.work_button];0xd0 + mcall + +; mov eax,8 + mov ebx,100*65536+85 + mov ecx,195*65536+20 + mov edx,201 + mov esi,0xd00000 + mcall + + mov eax,4 ;ᮢ ⥪ + mov ebx,10*65536+200 + mov ecx,[sc.work_button_text] + or ecx,0x80000000 + mov edx,txt122 + mcall + + mov ebx,105*65536+200 + mov ecx,0xffff00 + or ecx,0x80000000 + mov edx,txt148 + mcall + + mov ebx,195*65536+10 + mov ecx,[sc.work_text] + or ecx,0x80000000 + mov edx,txt_out_file + mcall + + stdcall [edit_box_draw],dword edit1 + stdcall [tl_draw],dword tree1 + + ;scroll 1 + mov [ws_dir_lbox.all_redraw],1 + stdcall [scrollbar_ver_draw],dword ws_dir_lbox + stdcall [ted_draw], tedit0 + + mcall 12,2 + popad + +align 4 +still: + mcall 10 + + cmp al,1 ;. + jz red_win + cmp al,2 + jz key + cmp al,3 + jz button + cmp al,6 + jz mouse + + jmp still + + +align 4 +mouse: + stdcall [tl_mouse],tree1 + stdcall [edit_box_mouse],edit1 + stdcall [ted_mouse], tedit0 + jmp still + + +align 4 +key: + mcall 2 + stdcall [tl_key],tree1 + stdcall [edit_box_key],edit1 +;;;stdcall [ted_key], tedit0, conv_tabl,esi + jmp still + +align 4 +button: +; cmp [menu_active],1 ;᫨ , ᭠砫 ॠ +; jne @f ;mouse.menu_bar_1 +; mov [menu_active],0 +; jmp still +; @@: + + mcall 17 ; ⮩ + + cmp ah,200 + jne @f + call but_OpenSyntax + @@: + cmp ah,201 + jne @f + call but_SaveSyntax + @@: + + cmp ah,1 + jne still +.exit: + ;push eax + + mov ecx,[options_file] + call mem_Free + + stdcall [tl_data_clear], tree1 + stdcall [ted_delete], tedit0 + mcall -1 ;室 ணࠬ + +align 4 +but_OpenSyntax: + stdcall [tl_node_get_data],tree1 + pop dword [fn_col_option] + call InitColText + ret + +align 4 +but_SaveSyntax: + stdcall [ted_but_save_file], tedit0,run_file_70,[edit1.text] + ret + +align 4 +but_ctrl_o: + push eax + call get_wnd_in_focus + cmp eax,0 + je @f + stdcall [ted_open_file], eax,str_file_70,[edit1.text] + @@: + pop eax + ret + +;ᮧ 䠩 +align 4 +but_ctrl_n: + push eax + call get_wnd_in_focus + cmp eax,0 + je @f + stdcall [ted_clear], eax,1 + stdcall [ted_draw], eax + @@: + pop eax + ret + +;।塞 । 䮪 +align 4 +get_wnd_in_focus: + xor eax,eax + cmp dword[el_focus],tedit0 + jne @f + mov eax,tedit0 + @@: + ;cmp dword[el_focus],tedit1 + ;jne @f + ; mov eax,tedit1 + ;@@: + ret + +hed db 'TextEditor syntax file converter 31.05.10',0 ; + +txtErrOpen db ' 䠩, ஢ ࠢ쭮 ',0 +txtErrIni0 db ' 䠩 ',0 +err_ini0 db 0 + +txt122 db '. 䠩',0 +txt148 db '. 䠩',0 +txt_out_file db '. 䠩:',0 + +CAPT_PATH_WIDTH equ 50 +edit1 edit_box 305+16-CAPT_PATH_WIDTH, 215+CAPT_PATH_WIDTH, 5, 0xffffff, 0xff, 0xff0000, 0, 0x80, MAX_COLOR_WORD_LEN, ed_buffer.127, mouse_dd, 0 + +ed_buffer: ;⥪ edit + .127: rb MAX_COLOR_WORD_LEN+2 + +err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0 +head_f_i0: +head_f_l0 db 'System error',0 +err_message_import0 db 'Error on load import library box_lib.obj',0 +err_message_found_lib1 db 'Sorry I cannot found library msgbox.obj',0 + +;library structures +l_libs_start: + lib0 l_libs boxlib_name, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l0, myimport,err_message_import0, head_f_i0 +load_lib_end: + +;----------------------------------------------------------------------------- +;㭪 뤥 +;input: +; ecx = size data +;otput: +; eax = pointer to memory +align 4 +mem_Alloc: + push ebx + mov eax,68 + mov ebx,12 + int 0x40 + pop ebx + ret +;----------------------------------------------------------------------------- +;㭪 ᢮ +;input: +; ecx = pointer to memory +align 4 +mem_Free: + push eax ebx + cmp ecx,0 + jz @f + mov eax,68 + mov ebx,13 + int 0x40 + @@: + pop ebx eax + ret + +i_end: + rb 1024 + align 16 + procinfo process_information + thread: + rb 1024 +stacktop: + sys_path: + rb 4096 + file_name: + rb 4096 + file_name_rez: + rb 4096 + file_info: + rb 40 +mem: diff --git a/programs/other/t_edit_synt/te_syntax.png b/programs/other/t_edit_synt/te_syntax.png new file mode 100644 index 0000000000..5c85a91a46 Binary files /dev/null and b/programs/other/t_edit_synt/te_syntax.png differ diff --git a/programs/other/t_edit_synt/te_work.inc b/programs/other/t_edit_synt/te_work.inc new file mode 100644 index 0000000000..66e77fcec9 --- /dev/null +++ b/programs/other/t_edit_synt/te_work.inc @@ -0,0 +1,428 @@ +struct FileInfoBlock + Function dd ? + Position dd ? + Flags dd ? + Count dd ? + Buffer dd ? + db ? + FileName dd ? +ends + +struct TexColViv + Text rb MAX_COLOR_WORD_LEN ; + f1 dd 0 + wwo db ? ; whole words only + endc db ? ; (wwo&4) + color db ? ; +ends + +count_colors_text dd 1 +ColWords dd 0 +color_cursor dd ? +color_wnd_capt dd ? +color_wnd_work dd ? +color_wnd_bord dd ? +color_select dd ? +color_cur_text dd ? +color_wnd_text dd ? + +options_file dd 0 +options_file_end dd 0 +tex_colors dd 0 +tex_help_f1 dd 0 + +Col dd 0 ; TexColViv + +keyUpr dd 0 +err_opn db 0 ; +err_sav db 0 ; + +sc system_colors + +run_file_70 FileInfoBlock + +align 4 +InitColText: + pushad + + mov ebx,dword[fn_col_option] + copy_path ebx,fn_syntax_dir,file_name_rez,0 + copy_path file_name_rez,sys_path,file_name,0 + + mov eax,70 + mov [run_file_70.Function], 0 + mov [run_file_70.Position], 0 + mov [run_file_70.Flags], 0 + mov ebx,[options_file_end] + sub ebx,[options_file] + mov [run_file_70.Count], ebx + m2m [run_file_70.Buffer], [options_file] + mov byte[run_file_70+20], 0 + mov [run_file_70.FileName], file_name + mov ebx,run_file_70 + int 0x40 + + + ;init: count_colors_text, ColWords, ... + mov dword[count_colors_text],1 + mov dword[ColWords],0 + mov dword[tex_help_f1],0 + + cmp eax,6 + je @f + cmp eax,0 + je @f + cmp ax,10 + jl .zifra_0_9 + mov al,'?' + sub ax,48 + .zifra_0_9: + add ax,48 + + jmp .no_colors + @@: + + mov esi,[options_file] + mov edi,count_colors_text + mov ecx,9*4 + rep movsb + + mov eax,[options_file] + add eax,32 + mov dword[tex_colors],eax + + mov eax,dword[count_colors_text] ;init: Col (offset to key words) + add eax,8 + shl eax,2 + add eax,[options_file] + mov dword[Col],eax + + ;init: tex_help_f1 + mov ecx,dword[ColWords] + imul ecx,sizeof.TexColViv + add ecx,dword[Col] + mov dword[tex_help_f1],ecx + + ; + stdcall [ted_clear], tedit0,1 + + stdcall print_capt,capt_header + + stdcall print_capt,col_1 + stdcall print_color,[color_cursor] + stdcall print_capt,col_2 + stdcall print_color,[color_wnd_capt] + stdcall print_capt,col_3 + stdcall print_color,[color_wnd_work] + stdcall print_capt,col_4 + stdcall print_color,[color_wnd_bord] + stdcall print_capt,col_5 + stdcall print_color,[color_select] + stdcall print_capt,col_6 + stdcall print_color,[color_cur_text] + + stdcall print_capt,col_7 + mov ecx,[count_colors_text] ; + mov eax,[tex_colors] + @@: + stdcall print_capt,capt_type_dd + stdcall print_color,[eax] + add eax,4 + loop @b + + stdcall print_capt,capt_lbl_wo + mov ecx,dword[ColWords] + mov eax,[Col] + xor ebx,ebx + @@: + inc ebx + stdcall print_word,eax,ebx + add eax,sizeof.TexColViv + loop @b + + stdcall print_capt,capt_lbl_f1 + mov ecx,dword[ColWords] + mov eax,[Col] + xor ebx,ebx + @@: + inc ebx + stdcall print_word_f1,eax,ebx + add eax,sizeof.TexColViv + loop @b + + stdcall [ted_init_scroll_bars], tedit0,4 + stdcall [ted_draw], tedit0 + + .no_colors: + popad + ret + +align 4 +proc print_color, color:dword + pushad + mov eax,dword[color] + + mov ebx,eax ; red blue + shr ebx,16 + xchg al,bl + and eax,0xffff + and ebx,0xff + shl ebx,16 + or eax,ebx + + ror al,4 + ror eax,8 + ror al,4 + ror eax,8 + ror al,4 + rol eax,16 + mov edi,text_buffer + mov word[edi],'0x' + add edi,2 + mov ecx,6 + @@: + mov ebx,eax + and ebx,0xf + cmp bx,9 + jle .cifra + add bx,39 + .cifra: + add bx,48 + mov byte[edi],bl + inc edi + shr eax,4 + loop @b + mov byte[edi],13 + mov ebx,ted_opt_ed_change_time+ted_opt_ed_move_cursor + stdcall [ted_text_add], tedit0,text_buffer,9,ebx + popad + ret +endp + +align 4 +proc print_capt, capt:dword + pushad + mov esi,dword[capt] + stdcall str_len,esi + stdcall [ted_text_add], tedit0,esi,eax,ted_opt_ed_change_time+ted_opt_ed_move_cursor + popad + ret +endp + +align 4 +proc print_word, text:dword, index:dword + pushad + mov esi,text_buffer + mov byte[esi],0 + stdcall str_cat,esi,capt_beg_word + stdcall str_len,esi + add esi,eax + + mov edi,dword[text] + stdcall code_string,edi,esi ; + stdcall str_cat,esi,capt_end_word + + cmp dword[edi+MAX_COLOR_WORD_LEN],0 ;f1 + je @f + stdcall str_cat,esi,capt_calc_f1 + stdcall str_cat_value,esi,[index] + stdcall str_cat,esi,capt_lbl_f1_use + jmp .end_f1_calc + @@: + stdcall str_cat,esi,capt_null + .end_f1_calc: + + mov esi,text_buffer + stdcall str_len,esi ; + stdcall [ted_text_add], tedit0,esi,eax,ted_opt_ed_change_time+ted_opt_ed_move_cursor + +mov ecx,edi +mov edi,text_buffer +mov byte[edi],',' +inc edi +mov byte[edi],0 + xor eax,eax + mov al,byte[ecx+MAX_COLOR_WORD_LEN+4] ;wwo + stdcall str_cat_value,edi,eax + stdcall str_len,edi + add edi,eax + mov byte[edi],',' + inc edi + + xor eax,eax + mov al,byte[ecx+MAX_COLOR_WORD_LEN+4+1] ;endc + cmp al,0 + je @f + stdcall str_cat_value,edi,eax + stdcall str_len,edi + add edi,eax + @@: + mov byte[edi],',' + inc edi + + xor eax,eax + mov al,byte[ecx+MAX_COLOR_WORD_LEN+4+2] ;color + stdcall str_cat_value,edi,eax + stdcall str_len,edi + add edi,eax + mov byte[edi],13 + inc edi + mov byte[edi],0 + + mov esi,text_buffer + stdcall str_len,esi + stdcall [ted_text_add], tedit0,esi,eax,ted_opt_ed_move_cursor + + popad + ret +endp + +align 4 +proc print_word_f1, text:dword, index:dword + pushad + mov edi,dword[text] + mov esi,dword[edi+MAX_COLOR_WORD_LEN] ;f1 + cmp esi,0 + je @f + mov ebx,text_buffer + mov byte[ebx],0 + stdcall str_cat,ebx,capt_point + stdcall str_cat_value,ebx,[index] + stdcall str_cat,ebx,capt_beg_db + stdcall str_len,ebx + add ebx,eax + + add esi,dword[tex_help_f1] + stdcall code_string,esi,ebx ; + stdcall str_cat,ebx,capt_end_word_f1 + + mov ebx,text_buffer + stdcall str_len,ebx + stdcall [ted_text_add], tedit0,ebx,eax,ted_opt_ed_move_cursor + @@: + popad + ret +endp + +align 4 +proc code_string, text:dword, out_text:dword + pushad + mov esi,dword[text] + stdcall str_len,esi + mov ecx,eax + mov edi,dword[out_text] + + .copy: + mov al,byte[esi] + inc esi + cmp al,9 + je @f + cmp al,13 + je @f + cmp al,39 + je @f + mov byte[edi],al + inc edi + loop .copy + jmp .end_copy + @@: + mov byte[edi],39 + mov byte[edi+1],',' + add edi,2 + and eax,0xff + mov dword[edi],0 + call tl_convert_to_str + stdcall str_len,edi + add edi,eax + mov byte[edi],',' + mov byte[edi+1],39 + add edi,2 + loop .copy + .end_copy: + mov byte[edi],0 + popad + ret +endp + +align 4 +proc mem_clear, mem:dword, len:dword + push eax ecx edi + cld + xor al,al + mov edi, dword[mem] + mov ecx, dword[len] + repne stosb + pop edi ecx eax + ret +endp + +align 4 +proc str_cat, str1:dword, str2:dword + push eax ecx edi esi + mov esi,dword[str2] + stdcall str_len,esi + mov ecx,eax + inc ecx + mov edi,dword[str1] + stdcall str_len,edi + add edi,eax + cld + repne movsb + pop esi edi ecx eax + ret +endp + +align 4 +proc str_cat_value, str1:dword, value:dword + pushad + mov edi,[str1] + stdcall str_len,edi + add edi,eax + mov eax,[value] + call tl_convert_to_str + popad + ret +endp + +;output: +; eax = strlen +align 4 +proc str_len, str1:dword + mov eax,[str1] + @@: + cmp byte[eax],0 + je @f + inc eax + jmp @b + @@: + sub eax,[str1] + ret +endp + +;input: +; eax = value +; edi = string buffer +align 4 +tl_convert_to_str: + pushad + stdcall mem_clear,edi,12 + call .str + popad + ret + +align 4 +.str: + mov ecx,0x0a ; ebx,eax,ecx,edx eax - + ; ASCII ecx= edi , , + cmp eax,ecx ; eax ecx @@-1 .. pop eax + jb @f + xor edx,edx ; edx + div ecx ; - edx + push edx ; + ;dec edi ; + call .str ; .. eax ecx + pop eax + @@: ;cmp al,10 ; al 10 ( 10 - )) + or al,0x30 ; + stosb ; al es:edi + ret