forked from KolibriOS/kolibrios
377 lines
7.3 KiB
NASM
377 lines
7.3 KiB
NASM
|
use32
|
|||
|
org 0x0
|
|||
|
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
|||
|
dd 0x01
|
|||
|
dd start
|
|||
|
dd i_end ; ࠧ<><E0A0A7><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
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
|
|||
|
|
|||
|
;<3B><EFBFBD>ઠ <20><> <>쪮 㤠筮 <20><><EFBFBD>㧨<EFBFBD><E3A7A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
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
|
|||
|
@@:
|
|||
|
;---------------------------------------------------------------------
|
|||
|
; <20><>⠥<EFBFBD> bmp 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㧫<><E3A7AB>
|
|||
|
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 ;<3B><>६ <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
|||
|
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],'.' ;䨫<><E4A8AB><EFBFBD>㥬 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.' <20> '..'
|
|||
|
je .filter
|
|||
|
push dword tree1
|
|||
|
push dword 0x10000 ;1*2^16 - <20><><EFBFBD> 1 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
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 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
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 ;<3B><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
|||
|
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 ;<3B><><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
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 ;<3B> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><> ᭠砫<E1ADA0> ॠ<><E0A5A0><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
|||
|
; jne @f ;mouse.menu_bar_1
|
|||
|
; mov [menu_active],0
|
|||
|
; jmp still
|
|||
|
; @@:
|
|||
|
|
|||
|
mcall 17 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
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 ;<3B><>室 <20><> <20>ணࠬ<E0AEA3><E0A0AC>
|
|||
|
|
|||
|
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
|
|||
|
|
|||
|
;ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
|||
|
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
|
|||
|
|
|||
|
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 䮪<><E4AEAA><EFBFBD>
|
|||
|
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 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
txtErrOpen db '<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<>, <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20>ࠢ<EFBFBD><E0A0A2>쭮<EFBFBD><ECADAE><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>',0
|
|||
|
txtErrIni0 db '<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',0
|
|||
|
err_ini0 db 0
|
|||
|
|
|||
|
txt122 db '<27><><EFBFBD><EFBFBD>. 䠩<>',0
|
|||
|
txt148 db '<27><><EFBFBD><EFBFBD>. 䠩<>',0
|
|||
|
txt_out_file db '<27><><EFBFBD>. 䠩<>:',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: ;⥪<><E2A5AA> <20><><EFBFBD> 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:
|
|||
|
|
|||
|
;-----------------------------------------------------------------------------
|
|||
|
;<3B>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
;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
|
|||
|
;-----------------------------------------------------------------------------
|
|||
|
;<3B>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD> <20><EFBFBD><E1A2AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
;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:
|