Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 7577 → Rev 7579

/programs/other/t_edit/strlen.inc
89,4 → 89,77
stosb
mov byte[edi],0 ;в конец строки ставим 0, что-бы не вылазил мусор
@@:
ret
ret
 
;input:
; buf - указатель на строку, число должно быть в 10 или 16 ричном виде
;output:
; eax - число
align 4
proc conv_str_to_int, buf:dword
xor eax,eax
push ebx ecx esi
xor ebx,ebx
mov esi,[buf]
;определение отрицательных чисел
xor ecx,ecx
inc ecx
cmp byte[esi],'-'
jne @f
dec ecx
inc esi
@@:
 
cmp word[esi],'0x'
je .load_digit_16
 
.load_digit_10: ;считывание 10-тичных цифр
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'9'
jg @f
sub bl,'0'
imul eax,10
add eax,ebx
inc esi
jmp .load_digit_10
jmp @f
 
.load_digit_16: ;считывание 16-ричных цифр
add esi,2
.cycle_16:
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'f'
jg @f
cmp bl,'9'
jle .us1
cmp bl,'A'
jl @f ;отсеиваем символы >'9' и <'A'
.us1: ;составное условие
cmp bl,'F'
jle .us2
cmp bl,'a'
jl @f ;отсеиваем символы >'F' и <'a'
sub bl,32 ;переводим символы в верхний регистр, для упрощения их последущей обработки
.us2: ;составное условие
sub bl,'0'
cmp bl,9
jle .cor1
sub bl,7 ;convert 'A' to '10'
.cor1:
shl eax,4
add eax,ebx
inc esi
jmp .cycle_16
@@:
cmp ecx,0 ;если число отрицательное
jne @f
sub ecx,eax
mov eax,ecx
@@:
pop esi ecx ebx
ret
endp
/programs/other/t_edit/t_button.inc
137,7 → 137,7
@@:
cmp ah,ID_BUT_SYNTAX_MODE
jne @f
stdcall but_panel_choose_syntax, tedit0
call but_panel_choose_syntax
jmp still
@@:
cmp ah,ID_BUT_CONVERT_1251_866
172,10 → 172,15
jmp still
.no_change:
cmp ah,203 ;§ ¬¥­¨âì ¢á¥
jne .no_change_a
jne @f
call but_replace_all
jmp still
.no_change_a:
@@:
cmp ah,204 ;¯¥à¥©â¨ ­  áâபã
jne @f
call but_goto_line
jmp still
@@:
 
cmp ah,1
jne @f
258,6 → 263,13
ret
endp
 
align 4
proc but_goto_line uses eax
stdcall conv_str_to_int, buf_goto
stdcall [ted_go_to_position], tedit0,eax,1
ret
endp
 
;input:
; al = ª®¤ ®è¨¡ª¨
align 4
367,6 → 379,44
endp
 
;description:
; äã­ªæ¨ï ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+N,O,F,S,H,G
align 4
proc ted_but_ctrl_all uses eax, opt_key:dword
mov eax,[opt_key]
cmp al,'N' ;Ctrl+N
jne @f
call ted_but_new_file
jmp .end0
@@:
cmp al,'O' ;Ctrl+O
jne @f
call ted_but_open_file
jmp .end0
@@:
cmp al,'S' ;Ctrl+S
jne @f
shr eax,8
call ted_but_save_file
jmp .end0
@@:
cmp al,'F' ;Ctrl+F
jne @f
call but_panel_find
jmp .end0
@@:
cmp al,'G' ;Ctrl+G
jne @f
call but_panel_goto
jmp .end0
@@:
cmp al,'H' ;Ctrl+H
jne .end0
call but_panel_replace
.end0:
ret
endp
 
;description:
; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  á ¢®§¬®¦­ë¬ ®ª­®¬ á®®¡é¥­¨ï (® ¢®§¬®¦­®á⨠®â¬¥­¨âì ®âªàë⨥)
align 4
ted_but_open_file:
598,20 → 648,18
;description:
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª 
align 4
proc but_panel_find uses edi
mov edi,tedit0
proc but_panel_find
stdcall on_panel_change, tedit0,TED_PANEL_FIND
;or word[edit_find.flags],ed_focus
ret
endp
 
cmp ted_panel_id,TED_PANEL_NULL
je @f
mov ted_panel_id,TED_PANEL_NULL
mov ted_wnd_l,0
jmp .e_if
@@:
mov ted_panel_id,TED_PANEL_FIND
mov ted_wnd_l,TED_PANEL_WIDTH
.e_if:
call EvSize
stdcall [ted_draw],edi
;description:
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯¥à¥å®¤ 
align 4
proc but_panel_goto
stdcall on_panel_change, tedit0,TED_PANEL_GOTO
;or word[edit_goto.flags],ed_focus
ret
endp
 
618,20 → 666,9
;description:
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ § ¬¥­ë
align 4
proc but_panel_replace uses edi
mov edi,tedit0
 
cmp ted_panel_id,TED_PANEL_NULL
je @f
mov ted_panel_id,TED_PANEL_NULL
mov ted_wnd_l,0
jmp .e_if
@@:
mov ted_panel_id,TED_PANEL_REPLACE
mov ted_wnd_l,TED_PANEL_WIDTH
.e_if:
call EvSize
stdcall [ted_draw],edi
proc but_panel_replace
stdcall on_panel_change, tedit0,TED_PANEL_REPLACE
;or word[edit_find.flags],ed_focus
ret
endp
 
638,20 → 675,37
;description:
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ á ä ©« ¬¨ ᨭ⠪á¨á 
align 4
proc but_panel_choose_syntax uses edi, edit:dword
proc but_panel_choose_syntax
stdcall on_panel_change, tedit0,TED_PANEL_SYNTAX
ret
endp
 
align 4
proc on_panel_change uses eax edi, edit:dword, new_id:dword
mov edi,[edit]
mov eax,[new_id]
 
cmp ted_panel_id,TED_PANEL_NULL
je @f
;if(panel_id==new_id) panel_id=0, draw all
cmp ted_panel_id,al
jne @f
mov ted_panel_id,TED_PANEL_NULL
mov ted_wnd_l,0
jmp .e_if
@@:
mov ted_panel_id,TED_PANEL_SYNTAX
;elseif(panel_id==0) panel_id=new_id, draw all
cmp ted_panel_id,TED_PANEL_NULL
jne @f
mov ted_panel_id,al
mov ted_wnd_l,TED_PANEL_WIDTH
.e_if:
call EvSize
stdcall [ted_draw],edi
jmp .end0
;else panel_id=new_id, draw panel
@@:
mov ted_panel_id,al
stdcall draw_panels,edi
.end0:
ret
endp
 
692,7 → 746,7
jne @f
pushad
mcall SF_CREATE_THREAD,1,prop_start,thread_coords
mov dword[wnd_k_words_run],eax
mov [wnd_k_words_run],eax
popad
@@:
ret
701,7 → 755,7
; ¢ë¤¥«¥­¨¥/áªàë⨥ ­¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
align 4
proc but_sumb_invis uses edi, edit:dword
mov edi,dword[edit]
mov edi,[edit]
 
xor ted_mode_invis,1
call draw_but_toolbar
713,7 → 767,7
; ¢ë¤¥«¥­¨¥/áªàë⨥ ª«î祢ëå á«®¢
align 4
proc but_use_syntax uses edi, edit:dword
mov edi,dword[edit]
mov edi,[edit]
 
xor ted_mode_color,1
cmp ted_mode_color,0
/programs/other/t_edit/t_data.inc
@@ -212,6 +213,7 @@
@@ -350,8 +352,9 @@
@@ -411,16 +414,14 @@
@@ -517,6 +518,8 @@
@@ -589,6 +592,8 @@
/programs/other/t_edit/t_draw.inc
216,10 → 216,9
;txtBRi db 26
;txtBLe db 27
 
;input:
; edi = pointer to tedit struct
align 4
proc draw_panel_find
proc draw_panels uses edi, edit:dword
mov edi,[edit]
cmp ted_panel_id,TED_PANEL_FIND
jne @f
call p_find
230,10 → 229,22
call p_replace
jmp .end_f
@@:
cmp ted_panel_id,TED_PANEL_GOTO
jne @f
call p_goto
jmp .end_f
@@:
cmp ted_panel_id,TED_PANEL_SYNTAX
jne @f
call p_syntax
jmp .end_f
@@:
push eax edx
mcall SF_DEFINE_BUTTON,,,0x80000000+201
mcall SF_DEFINE_BUTTON,,,0x80000000+200
mcall ,,,0x80000000+201
mcall ,,,0x80000000+202
mcall ,,,0x80000000+203
mcall ,,,0x80000000+204
pop edx eax
.end_f:
ret
256,7 → 267,7
sub cx,20+15-1 ; 15 - height text box
mcall ,,,[sc.work]
 
stdcall [edit_box_draw], edit2
stdcall [edit_box_draw], edit_find
 
mov ecx,ted_wnd_t
shl ecx,16
296,8 → 307,8
sub cx,20+15-1 ; 15 - height text box
mcall ,,,[sc.work]
 
stdcall [edit_box_draw], edit1
stdcall [edit_box_draw], edit2
stdcall [edit_box_draw], edit_replace
stdcall [edit_box_draw], edit_find
 
mov ecx,ted_wnd_t
shl ecx,16
327,12 → 338,48
pop edx ecx ebx eax
ret
 
align 4
p_goto:
push eax ebx ecx edx
mov ecx,ted_wnd_t
shl ecx,16
mov cx,20
mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work]
 
mov ecx,ted_wnd_t
add cx,20+15 ; 15 - height text box
shl ecx,16
add ecx,ted_wnd_h
mov edx,ted_scr_h
add cx,word[edx+sb_offs_size_y]
sub cx,20+15-1 ; 15 - height text box
mcall ,,,[sc.work]
 
stdcall [edit_box_draw], edit_goto
 
mov ecx,ted_wnd_t
shl ecx,16
add ecx,(40 shl 16)+20
mcall SF_DEFINE_BUTTON,(5 shl 16)+85,,204,[sc.work_button]
 
mov ebx,(23 shl 16)+7
add ebx,ted_wnd_t
mov ecx,[sc.work_text]
or ecx,0x80000000
mcall SF_DRAW_TEXT,,,txtGotoCapt
 
mov ecx,[sc.work_button_text]
or ecx,0x80000000
mov ebx,(15 shl 16)+47
add ebx,ted_wnd_t
mcall ,,,txtGoto
pop edx ecx ebx eax
ret
 
;input:
; edi = pointer to tedit struct
align 4
proc draw_panel_syntax
cmp ted_panel_id,TED_PANEL_SYNTAX ;if not panel
jne @f
p_syntax:
pushad
 
mov ecx,ted_wnd_t
378,15 → 425,7
mcall ,,,txtFormatApply
 
popad
jmp .end_f
@@:
push eax edx
mov edx,0x80000000+200
mcall SF_DEFINE_BUTTON ;åñëè íåò ïàíåëè òî óäàëÿåì êíîïêó
pop edx eax
.end_f:
ret
endp
 
MIN_M_WND_H equ 100 ;ìèíèìàëüíàÿ âûñîòà ãëàâíîãî îêíà
;input:
421,10 → 460,12
mov tl_box_top,eax ;=ted_wnd_t
add tl_box_top,20
 
mov [edit2.top],eax ;=ted_wnd_t
add dword[edit2.top],20
mov [edit1.top],eax ;=ted_wnd_t
add dword[edit1.top],113
mov [edit_find.top],eax ;=ted_wnd_t
add dword[edit_find.top],20
mov [edit_replace.top],eax
add dword[edit_replace.top],113
mov [edit_goto.top],eax
add dword[edit_goto.top],20
popad
ret
 
/programs/other/t_edit/t_edit.asm
241,13 → 241,13
;¯à®¢¥àª  ¡®ª®¢ëå ¯ ­¥«¥©
cmp byte[tedit0.panel_id],TED_PANEL_FIND
jne @f
stdcall [edit_box_mouse], edit2
stdcall [edit_box_mouse], edit_find
stdcall [option_box_mouse], opt_grlist1
@@:
cmp byte[tedit0.panel_id],TED_PANEL_REPLACE
jne @f
stdcall [edit_box_mouse], edit2
stdcall [edit_box_mouse], edit1
stdcall [edit_box_mouse], edit_find
stdcall [edit_box_mouse], edit_replace
stdcall [option_box_mouse], opt_grlist1
@@:
cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX
254,6 → 254,10
jne @f
stdcall [tl_mouse], tree1
@@:
cmp byte[tedit0.panel_id],TED_PANEL_GOTO
jne @f
stdcall [edit_box_mouse], edit_goto
@@:
ret
;---------------------------------------------------------------------
 
262,8 → 266,7
align 16
proc KeyConvertToASCII uses ebx, table:dword
mov ebx,dword[table] ;convert scan to ascii
ror ax,8
xor ah,ah
shr ax,8
add bx,ax
mov ah,byte[ebx]
ret
274,7 → 277,7
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
xor esi,esi
mov ecx,1
test al,0x03 ;[Shift]
test al,3 ;[Shift]
jz @f
mov cl,2
or esi,KM_SHIFT
297,7 → 300,7
mcall SF_GET_KEY
stdcall [tl_key], tree1
 
test word [edit1.flags],10b ;ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
test word[edit_replace.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
313,10 → 316,10
je still
 
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], edit1
stdcall [edit_box_key], edit_replace
jmp still
@@:
test word [edit2.flags],10b ;ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
test word[edit_find.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
332,16 → 335,36
je still
 
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], edit2
stdcall [edit_box_key], edit_find
jmp still
@@:
test word[edit_goto.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
cmp ah,42 ;[Shift] (left)
je still
cmp ah,54 ;[Shift] (right)
je still
cmp ah,56 ;[Alt]
je still
cmp ah,29 ;[Ctrl]
je still
cmp ah,69 ;[Pause Break]
je still
 
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], edit_goto
jmp still
@@:
 
stdcall [ted_key], tedit0, conv_tabl,esi
jmp still
 
align 4
edit1 edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_replace, mouse_dd, 0
edit2 edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
edit_replace edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_replace, mouse_dd, 0
edit_find edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
edit_goto edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 10, buf_goto, mouse_dd, 0
 
unpac_mem dd 0
 
405,6 → 428,7
buf rb BUF_SIZE ;¡ãä¥à ¤«ï ª®¯¨à®¢ ­¨ï ¨ ¢áâ ¢ª¨
buf_find rb 302 ;¡ãä¥à ¤«ï ¯®¨áª  ⥪áâ 
buf_replace rb 302 ;¡ãä¥à ¤«ï § ¬¥­ë ⥪áâ 
buf_goto rb 12 ;¡ãä¥à ¤«ï ¯¥à室  ­  áâபã
sc system_colors
IncludeUGlobals
align 16
/programs/other/t_edit/t_edit.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/other/t_edit_synt/te_data.inc
130,6 → 130,7
sz_ted_but_reverse db 'ted_but_reverse',0
sz_ted_but_find db 'ted_but_find',0
sz_ted_text_colored db 'ted_text_colored',0
sz_ted_go_to_position db 'ted_go_to_position',0
 
sz_PathShow_prepare db 'PathShow_prepare',0
sz_PathShow_draw db 'PathShow_draw',0
223,16 → 224,14
.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
.fun_on_key_ctrl_all dd ted_but_ctrl_all ;+198 㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+N,O,S,F,G,H
dd 0,0,0
.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_draw_panels dd 0 ;+230 㪠§ â¥«ì ­  äã­ªæ¨î à¨á®¢ ­¨ï ¯ ­¥«¨ ¯®¨áª |...|ᨭ⠪á¨á 
dd 0
.fun_save_err dd 0 ;+238 㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¥á«¨ á®åà ­¥­¨¥ ä ©«  § ª®­ç¨«®áì ­¥ã¤ ç­®
.increase_size dd 1000 ;+242 ç¨á«® ᨬ¢®«®¢ ­  ª®â®àë¥ ¡ã¤¥â 㢥稢 âìáï ¯ ¬ïâì ¯à¨ ­¥å¢ âª¥
.ptr_free_symb dd ? ;+246 㪠§ â¥«ì ­  ᢮¡®¤­ãî ¯ ¬ïâì, ¢ ª®â®àãî ¬®¦­® ¤®¡ ¢«ïâì ᨬ¢®« (¨á¯®«ì§ã¥âáï ¢­ãâà¨ í«¥¬¥­â  ¤«ï ã᪮७¨ï ¢áâ ¢ª¨ ⥪áâ )
/programs/other/t_edit_synt/te_syntax.asm
198,8 → 198,7
proc KeyConvertToASCII, table:dword
push ebx
mov ebx,dword[table] ;convert scan to ascii
ror ax,8
xor ah,ah
shr ax,8
add bx,ax
mov ah,byte[ebx]
pop ebx
294,7 → 293,29
stdcall [ted_save_file], tedit0,run_file_70,[edit1.text]
ret
 
;description:
; äã­ªæ¨ï ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+N,O,F,S,H,G
align 4
proc ted_but_ctrl_all uses eax, opt_key:dword
mov eax,[opt_key]
cmp al,'N' ;Ctrl+N
jne @f
call but_ctrl_n
jmp .end0
@@:
cmp al,'O' ;Ctrl+O
jne @f
call but_ctrl_o
@@:
;cmp al,'S' ;Ctrl+S
;cmp al,'F' ;Ctrl+F
;cmp al,'G' ;Ctrl+G
;cmp al,'H' ;Ctrl+H
.end0:
ret
endp
 
align 4
but_ctrl_o:
push eax
call get_wnd_in_focus
332,7 → 353,7
;@@:
ret
 
hed db 'TextEditor syntax file converter 23.01.19',0 ;¯®¤¯¨áì ®ª­ 
hed db 'TextEditor syntax file converter 29.01.19',0 ;¯®¤¯¨áì ®ª­ 
conv_tabl rb 128 ; â ¡«¨æ  ¤«ï ª®­¢¥àâ¨à®¢ ­¨ï scan-ª®¤  ¢ ascii-ª®¤
 
txt_load_f db '‡ £à. ä ©«',0