forked from KolibriOS/kolibrios
kol_f_edit:
1) add unpack code 2) fix when icon index -1 git-svn-id: svn://kolibrios.org@3475 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -14,12 +14,14 @@ include '../../proc32.inc'
|
|||||||
include '../../develop/libraries/box_lib/load_lib.mac'
|
include '../../develop/libraries/box_lib/load_lib.mac'
|
||||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||||
include '../../dll.inc'
|
include '../../dll.inc'
|
||||||
|
include '../../system/desktop/trunk/kglobals.inc'
|
||||||
|
include '../../system/desktop/trunk/unpacker.inc'
|
||||||
include 'strlen.inc'
|
include 'strlen.inc'
|
||||||
include 'obj_codes.inc'
|
include 'obj_codes.inc'
|
||||||
|
|
||||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
|
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
|
||||||
|
|
||||||
hed db 'kol_f_edit 11.04.13',0
|
hed db 'kol_f_edit 17.04.13',0
|
||||||
|
|
||||||
sizeof.TreeList equ 20 ;need for element 'tree_list'
|
sizeof.TreeList equ 20 ;need for element 'tree_list'
|
||||||
|
|
||||||
@@ -325,19 +327,8 @@ start:
|
|||||||
mov ted_syntax_file,eax
|
mov ted_syntax_file,eax
|
||||||
|
|
||||||
;<3B>㥬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
;<3B>㥬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||||
mov ebx,run_file_70
|
call open_unpac_synt_file
|
||||||
mov dword[ebx], 0
|
jmp .end_0
|
||||||
mov dword[ebx+4], 0
|
|
||||||
mov dword[ebx+8], 0
|
|
||||||
mov dword[ebx+12], ecx
|
|
||||||
mov dword[ebx+16], eax ;ted_syntax_file
|
|
||||||
mov byte[ebx+20], 0
|
|
||||||
m2m dword[ebx+21], file_name
|
|
||||||
mcall 70
|
|
||||||
cmp eax,0
|
|
||||||
jne @f
|
|
||||||
stdcall [ted_init_syntax_file],edi
|
|
||||||
jmp .end_0
|
|
||||||
@@:
|
@@:
|
||||||
notify_window_run txt_not_syntax_file
|
notify_window_run txt_not_syntax_file
|
||||||
.end_0:
|
.end_0:
|
||||||
@@ -638,6 +629,10 @@ button:
|
|||||||
stdcall [buf2d_delete],buf_skin2
|
stdcall [buf2d_delete],buf_skin2
|
||||||
stdcall [buf2d_delete],buf_skin3
|
stdcall [buf2d_delete],buf_skin3
|
||||||
stdcall [ted_delete], tedit0
|
stdcall [ted_delete], tedit0
|
||||||
|
cmp dword[unpac_mem],0
|
||||||
|
je @f
|
||||||
|
stdcall mem.Free,[unpac_mem]
|
||||||
|
@@:
|
||||||
mcall -1
|
mcall -1
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
@@ -868,6 +863,13 @@ push eax ebx ecx
|
|||||||
je @f
|
je @f
|
||||||
xor ecx,ecx
|
xor ecx,ecx
|
||||||
mov cx,word[eax+obj_opt.img-obj_opt] ;cx - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞<EFBFBD><EFA5AC><EFBFBD> <20><>ꥪ<EFBFBD><EAA5AA>
|
mov cx,word[eax+obj_opt.img-obj_opt] ;cx - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞<EFBFBD><EFA5AC><EFBFBD> <20><>ꥪ<EFBFBD><EAA5AA>
|
||||||
|
|
||||||
|
cmp ecx,count_main_icons ;<3B> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ecx <20><><EFBFBD><EFBFBD><EFBFBD> 0, <20><>⮬<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD><E2A5AB><EFBFBD><EFBFBD> <20><> ⮦<> <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
jl .end_0
|
||||||
|
;<3B> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>, <20><> 㬮<>砭<EFBFBD><E7A0AD> <20><>६ 0-<2D>
|
||||||
|
xor cx,cx
|
||||||
|
.end_0:
|
||||||
|
|
||||||
shl ecx,16
|
shl ecx,16
|
||||||
stdcall mem_clear, u_object,sizeof.object
|
stdcall mem_clear, u_object,sizeof.object
|
||||||
mov ebx,dword[eax]
|
mov ebx,dword[eax]
|
||||||
@@ -888,6 +890,84 @@ align 4
|
|||||||
but_ctrl_s:
|
but_ctrl_s:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
;<3B><><EFBFBD><EFBFBD><EFBFBD>⨥ <20> <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20><><EFBFBD>ᢥ⪨ ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||||
|
;input:
|
||||||
|
; ted_syntax_file - <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||||
|
; ted_syntax_file_size - ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||||
|
;output:
|
||||||
|
; ebx - <20><> <20><><EFBFBD><EFBFBD><EFBFBD>⠭<EFBFBD><E2A0AD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> 䠩<><E4A0A9>
|
||||||
|
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
|
||||||
|
;<3B> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>訡<EFBFBD><E8A8A1> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⨨ 䠩<><E4A0A9> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||||
|
mov byte[txt_not_syntax_file.err],'0'
|
||||||
|
add byte[txt_not_syntax_file.err],al
|
||||||
|
notify_window_run txt_not_syntax_file ;Can-t open color options file!
|
||||||
|
jmp @f
|
||||||
|
.end_0:
|
||||||
|
|
||||||
|
mov eax,ted_syntax_file
|
||||||
|
cmp dword[eax],'KPCK'
|
||||||
|
jne .end_unpack
|
||||||
|
|
||||||
|
mov ecx,dword[eax+4] ;ecx - ࠧ<><E0A0A7><EFBFBD> 䠩<><E4A0A9> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD> <20><> <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
cmp dword[unpac_mem],0
|
||||||
|
jne .end_1
|
||||||
|
;<3B><>ࢮ<EFBFBD><E0A2AE>砫쭮<E7A0AB> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||||
|
stdcall mem.Alloc,ecx
|
||||||
|
mov [unpac_mem],eax
|
||||||
|
mov [unpac_mem_size],ecx
|
||||||
|
.end_1:
|
||||||
|
cmp dword[unpac_mem_size],ecx
|
||||||
|
jge .end_2
|
||||||
|
;<3B> <20><><EFBFBD> <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20><> 墠⠥<E5A2A0> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
stdcall mem.ReAlloc,[unpac_mem],ecx ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뤥<EFBFBD>塞 <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
mov [unpac_mem],eax
|
||||||
|
mov [unpac_mem_size],ecx
|
||||||
|
.end_2:
|
||||||
|
|
||||||
|
;<3B><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
stdcall unpack,ted_syntax_file,[unpac_mem]
|
||||||
|
|
||||||
|
cmp ted_syntax_file_size,ecx
|
||||||
|
jge .end_3
|
||||||
|
;<3B> <20><><EFBFBD> <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20><> 墠⠥<E5A2A0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
stdcall mem.ReAlloc,ted_syntax_file,ecx ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뤥<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
mov ted_syntax_file,eax
|
||||||
|
mov ted_syntax_file_size,ecx
|
||||||
|
.end_3:
|
||||||
|
|
||||||
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
mov edi,ted_syntax_file
|
||||||
|
mov esi,[unpac_mem]
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
|
||||||
|
.end_unpack:
|
||||||
|
;<3B>ਬ<EFBFBD><E0A8AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20><><EFBFBD>ᢥ⪨
|
||||||
|
stdcall [ted_init_syntax_file], tedit0
|
||||||
|
@@:
|
||||||
|
pop esi edi eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
align 4
|
||||||
|
txt_not_syntax_file:
|
||||||
|
db '<27>訡<EFBFBD><E8A8A1> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⨨ 䠩<><E4A0A9> <20> 梥⮢묨 <20><><EFBFBD><EFBFBD>ன<EFBFBD><E0AEA9><EFBFBD><EFBFBD>! (<28><><EFBFBD> <20>訡<EFBFBD><E8A8A1> ='
|
||||||
|
.err: db '?'
|
||||||
|
db ')',0
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
buf_fon: ;䮭<><E4AEAD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
buf_fon: ;䮭<><E4AEAD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||||
dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||||
@@ -942,6 +1022,8 @@ txtErrIni1 db '
|
|||||||
err_opn db 0 ;१. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
err_opn db 0 ;१. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
err_ini0 db 0 ;१. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
err_ini0 db 0 ;१. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
err_ini1 db 0 ;१. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD>ﬨ
|
err_ini1 db 0 ;१. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD>ﬨ
|
||||||
|
unpac_mem dd 0
|
||||||
|
unpac_mem_size dd 0
|
||||||
|
|
||||||
edit1 edit_box 210, 10, 5, 0xffffff, 0xff80, 0xff, 0xff0000, 0x4080, 300, ed_text1, mouse_dd, 0, 7, 7
|
edit1 edit_box 210, 10, 5, 0xffffff, 0xff80, 0xff, 0xff0000, 0x4080, 300, ed_text1, mouse_dd, 0, 7, 7
|
||||||
|
|
||||||
@@ -1094,17 +1176,7 @@ rb 4+4
|
|||||||
.delta dw 0 ;+44
|
.delta dw 0 ;+44
|
||||||
.delta2 dw 0 ;+46
|
.delta2 dw 0 ;+46
|
||||||
.run_x:
|
.run_x:
|
||||||
.r_size_x dw 0 ;+48
|
rb 32
|
||||||
.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
|
.all_redraw dd 0 ;+80
|
||||||
.ar_offset dd 1 ;+84
|
.ar_offset dd 1 ;+84
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
@@ -1127,17 +1199,7 @@ rb 4+4
|
|||||||
.delta dw 0 ;+44
|
.delta dw 0 ;+44
|
||||||
.delta2 dw 0 ;+46
|
.delta2 dw 0 ;+46
|
||||||
.run_x:
|
.run_x:
|
||||||
.r_size_x dw 0 ;+48
|
rb 32
|
||||||
.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
|
.all_redraw dd 0 ;+80
|
||||||
.ar_offset dd 1 ;+84
|
.ar_offset dd 1 ;+84
|
||||||
|
|
||||||
@@ -1156,7 +1218,7 @@ rb 4+4
|
|||||||
.line_col dd 0 ;+36
|
.line_col dd 0 ;+36
|
||||||
rb 4+2+2
|
rb 4+2+2
|
||||||
.run_x:
|
.run_x:
|
||||||
rb 2+2+2+2+4+4+4+4+4+4
|
rb 32
|
||||||
.all_redraw dd 0 ;+80
|
.all_redraw dd 0 ;+80
|
||||||
.ar_offset dd 1 ;+84
|
.ar_offset dd 1 ;+84
|
||||||
|
|
||||||
@@ -1173,7 +1235,7 @@ rb 4+4
|
|||||||
.line_col dd 0 ;+36
|
.line_col dd 0 ;+36
|
||||||
rb 4+2+2
|
rb 4+2+2
|
||||||
.run_x:
|
.run_x:
|
||||||
rb 2+2+2+2+4+4+4+4+4+4
|
rb 32
|
||||||
.all_redraw dd 0 ;+80
|
.all_redraw dd 0 ;+80
|
||||||
.ar_offset dd 1 ;+84
|
.ar_offset dd 1 ;+84
|
||||||
|
|
||||||
@@ -1197,8 +1259,6 @@ foc_obj dd 0 ;
|
|||||||
obj_count_txt_props dd 0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <20>ᯮ<EFBFBD><E1AFAE><EFBFBD>㥬<EFBFBD><E3A5AC> ⥪<>⮢<EFBFBD><E2AEA2> <><E1A2AE><EFBFBD><EFBFBD>
|
obj_count_txt_props dd 0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <20>ᯮ<EFBFBD><E1AFAE><EFBFBD>㥬<EFBFBD><E3A5AC> ⥪<>⮢<EFBFBD><E2AEA2> <><E1A2AE><EFBFBD><EFBFBD>
|
||||||
obj_m_win dd 0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
obj_m_win dd 0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
txt_not_syntax_file db '<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> <20><><EFBFBD> <20><><EFBFBD>ᢥ⪨ ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>.',0
|
|
||||||
|
|
||||||
;
|
;
|
||||||
if 1 ;lang eq ru
|
if 1 ;lang eq ru
|
||||||
|
|
||||||
@@ -1508,7 +1568,9 @@ procinfo process_information
|
|||||||
run_file_70 FileInfoBlock
|
run_file_70 FileInfoBlock
|
||||||
open_b rb 560
|
open_b rb 560
|
||||||
|
|
||||||
|
IncludeIGlobals
|
||||||
i_end:
|
i_end:
|
||||||
|
IncludeUGlobals
|
||||||
buf_cmd_lin rb 1024
|
buf_cmd_lin rb 1024
|
||||||
file_name rb 1024 ;icon file path
|
file_name rb 1024 ;icon file path
|
||||||
fp_obj_opt rb 1024 ;obj options file patch
|
fp_obj_opt rb 1024 ;obj options file patch
|
||||||
|
Reference in New Issue
Block a user