't_edit' can use packed syntax files

git-svn-id: svn://kolibrios.org@2708 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2012-05-31 21:54:13 +00:00
parent 9b63edd2e9
commit 896eb433ec
4 changed files with 87 additions and 58 deletions

View File

@ -1,10 +1,17 @@
@fasm.exe -m 16384 %1asm_syn.asm %2asm.syn
@kpack %2asm.syn
@fasm.exe -m 16384 %1cpp_kol_cla_syn.asm %2cpp_kol_cla.syn
@kpack %2cpp_kol_cla.syn
@fasm.exe -m 16384 %1cpp_kol_dar_syn.asm %2cpp_kol_dar.syn
@kpack %2cpp_kol_dar.syn
@fasm.exe -m 16384 %1cpp_kol_def_syn.asm %2cpp_kol_def.syn
@fasm.exe -m 16384 %1cpp_win_dar_syn.asm %2cpp_win_dar.syn
@kpack %2cpp_kol_def.syn
@fasm.exe -m 16384 %1default_syn.asm %2default.syn
@kpack %2default.syn
@fasm.exe -m 16384 %1html_syn.asm %2html.syn
@kpack %2html.syn
@fasm.exe -m 16384 %1ini_files_syn.asm %2ini_files.syn
@fasm.exe -m 16384 %1voc_eng_rus_syn.asm %2voc_eng_rus.syn
@kpack %2voc_eng_rus.syn
@fasm.exe -m 16384 %1win_const_syn.asm %2win_const.syn
@kpack %2win_const.syn

File diff suppressed because one or more lines are too long

View File

@ -18,10 +18,9 @@ struct symbol
ends
hed db 'TextEditor 31.05.12',0 ;¯®¤¯¨áì ®ª­ 
hed db 'TextEditor 1.06.12',0 ;¯®¤¯¨áì ®ª­ 
sc system_colors
;fn_icon db 'te_icon.bmp',0
bmp_icon dd 0
run_file_70 FileInfoBlock
@ -207,28 +206,60 @@ proc ted_but_open_syntax uses eax ebx ecx edi, edit:dword
copy_path ebx,fn_syntax_dir,file_name_rez,0x0
copy_path file_name_rez,sys_path,file_name,0x0
mov ebx,run_file_70
mov dword[ebx], 0
mov dword[ebx+4], 0
mov dword[ebx+8], 0
mov ecx, ted_syntax_file_size
mov dword[ebx+12], ecx
m2m dword[ebx+16], ted_syntax_file
mov byte[ebx+20], 0
m2m dword[ebx+21], file_name
mcall 70
cmp eax,0
jne .end_0
call ted_on_init_synt_err
jmp @f
.end_0:
stdcall [ted_init_syntax_file],edi
call open_unpac_synt_file
cmp ebx,-1
je @f
call [ted_text_colored]
stdcall [ted_draw],edi
@@:
ret
endp
;®âªàë⨥ ¨ à á¯ ª®¢ª  ä ©«  ¯®¤á¢¥âª¨ ᨭ⠪á¨á 
;output:
; ebx - ç¨á«® ¯à®ç¨â ­­ëå ¡ ©â ¨§ ä ©« 
align 4
open_unpac_synt_file:
push eax edi esi
mov edi, tedit0
mov [run_file_70.Function], 0
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov ecx, ted_syntax_file_size
mov dword[run_file_70.Count], ecx
m2m dword[run_file_70.Buffer], ted_syntax_file
mov byte[run_file_70+20], 0
mov [run_file_70.FileName], file_name
mcall 70, run_file_70
cmp ebx,-1
jne .end_0
call ted_on_init_synt_err
jmp @f
.end_0:
mov eax,ted_syntax_file
cmp dword[eax],'KPCK'
jne .end_unpack
cmp dword[eax+4],ecx
jg @f ;¥á«¨ ¤«ï à á¯ ª®¢ ­®£® ä ©«  ­¥ 墠⠥⠢뤥«¥­­®© ¯ ¬ïâ¨
cmp dword[unpac_mem],0
jne .end_1
;¢ë¤¥«¥­¨¥ ¯ ¬ï⨠¤«ï à á¯ ª®¢ª¨ ä ©« 
stdcall mem.Alloc,ecx
mov [unpac_mem],eax
.end_1:
stdcall unpack,ted_syntax_file,[unpac_mem]
mov edi,ted_syntax_file
mov esi,[unpac_mem]
mov ecx,[edi+4]
cld
rep movsb
.end_unpack:
stdcall [ted_init_syntax_file], tedit0
@@:
pop esi edi eax
ret
;description:
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª 
align 4

View File

@ -20,11 +20,14 @@ BUF_SIZE equ 1000 ;buffer for copy|paste
maxSyntaxFileSize equ 410000
include '../../proc32.inc'
;include '../../config.inc'
include '../../macros.inc'
include 'mem.inc'
include 'dll.inc'
include '../../develop/libraries/box_lib/load_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../system/desktop/trunk/kglobals.inc'
include '../../system/desktop/trunk/unpacker.inc'
include 'lang.inc'
include 't_data.inc'
@ -91,7 +94,6 @@ start:
jz button.exit
mcall 66,1,1 ;scan code
;mcall 26,2,1,conv_tabl
mcall 40,0x27
mov esi,file_name
@ -169,32 +171,16 @@ mov ecx,ebx
mov ebx,dword[fn_col_option]
copy_path ebx,fn_syntax_dir,file_name_rez,0x0
copy_path file_name_rez,sys_path,file_name,0x0
mov edi, tedit0
mov ebx,run_file_70
mov dword[ebx], 0
mov dword[ebx+4], 0
mov dword[ebx+8], 0
mov ecx, ted_syntax_file_size
mov dword[ebx+12], ecx
m2m dword[ebx+16], ted_syntax_file
mov byte[ebx+20], 0
m2m dword[ebx+21], file_name
mcall 70
cmp eax,0
jne .end_0
call ted_on_init_synt_err
jmp @f
.end_0:
stdcall [ted_init_syntax_file], edi
call open_unpac_synt_file
;--- get cmd line ---
cmp byte[openfile_path+3],0 ;openfile_path
je @f ;if file names exist
mov esi,openfile_path
call strlen ;eax=strlen
mov [edit1.size],eax
call but_no_msg_OpenFile
@@:
cmp byte[openfile_path+3],0 ;openfile_path
je @f ;if file names exist
mov esi,openfile_path
call strlen ;eax=strlen
mov [edit1.size],eax
call but_no_msg_OpenFile
@@:
align 4
red_win:
@ -476,22 +462,27 @@ button:
cmp ah,1
jne still
.exit:
stdcall [ted_can_save], tedit0
cmp al,1
jne @f
stdcall [mb_create],msgbox_8,thread ;message: save changes in file?
jmp still
@@:
stdcall mem.Free,[bmp_icon]
stdcall [ted_can_save], tedit0
cmp al,1
jne @f
stdcall [mb_create],msgbox_8,thread ;message: save changes in file?
jmp still
@@:
stdcall mem.Free,[bmp_icon]
cmp dword[unpac_mem],0
je @f
stdcall mem.Free,[unpac_mem]
@@:
stdcall [ted_delete], tedit0
stdcall dword[tl_data_clear], tree1
mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
stdcall [ted_delete], tedit0
stdcall dword[tl_data_clear], tree1
mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
edit1 edit_box 250, 220, 5, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 4090, openfile_path, mouse_dd, 0
edit2 edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
unpac_mem dd 0
buf_find db 302 dup(0)
if lang eq ru
@ -530,8 +521,9 @@ l_libs_start:
err_message_found_lib_3, head_f_l, import_libimg, err_message_import_3, head_f_i
load_lib_end:
IncludeIGlobals
i_end:
IncludeUGlobals
rb 1024
align 16
procinfo process_information