2010-04-29 20:27:40 +02:00
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> box_lib.obj
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TextEditor <20><><EFBFBD> Kolibri OS
|
2018-10-21 22:10:31 +02:00
|
|
|
|
; 䠩<> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> ࠧ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 21.10.2018 IgorA
|
2010-04-29 20:27:40 +02:00
|
|
|
|
; <20><> <20><><EFBFBD> <20>ਬ<EFBFBD><E0A8AC><EFBFBD><EFBFBD><EFBFBD> GPL2 <20><>業<EFBFBD><E6A5AD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
; reg = index
|
|
|
|
|
;output:
|
|
|
|
|
; reg = pointer to 'tex' struct
|
|
|
|
|
macro ConvertIndexToPointer reg {
|
2014-06-27 23:34:57 +02:00
|
|
|
|
imul reg,sizeof.symbol
|
|
|
|
|
add reg,ted_tex
|
2010-04-29 20:27:40 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
;--- out_reg = ted_key_words_data[ind_reg].Text[0] ---
|
|
|
|
|
macro ColToIndexOffset ind_reg,out_reg {
|
|
|
|
|
mov out_reg,ind_reg
|
|
|
|
|
imul out_reg,sizeof.TexColViv
|
|
|
|
|
add out_reg,ted_key_words_data
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TED_PANEL_NULL equ 0 ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
TED_PANEL_FIND equ 1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>᪠
|
|
|
|
|
TED_PANEL_SYNTAX equ 2 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>롮<EFBFBD><EBA1AE> 䠩<><E4A0A9><EFBFBD> <20><><EFBFBD>ᢥ⪨
|
2019-01-21 12:39:35 +01:00
|
|
|
|
TED_PANEL_REPLACE equ 3 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
TED_PANEL_WIDTH equ 150 ;<3B><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
2014-06-27 23:34:57 +02:00
|
|
|
|
TED_LINES_IN_NEW_FILE equ 30 ;<3B><> <20><>ப <20> <20><><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
MAX_COLOR_WORD_LEN equ 40
|
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
|
struct TexSelect
|
2014-06-27 23:34:57 +02:00
|
|
|
|
x0 dd ?
|
|
|
|
|
y0 dd ?
|
|
|
|
|
x1 dd ?
|
|
|
|
|
y1 dd ?
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ends
|
|
|
|
|
|
|
|
|
|
struct TexColViv
|
2011-08-22 17:58:27 +02:00
|
|
|
|
Text rb MAX_COLOR_WORD_LEN ; <><E1ABAE> <20><><EFBFBD> <20><><EFBFBD>ᢥ⪨
|
|
|
|
|
f1 dd 0 ; <20><>ࠢ<EFBFBD><E0A0A2> <20><> <><E1ABAE>
|
|
|
|
|
flags db ? ; f1+4 䫠<><E4ABA0> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD>㥬<EFBFBD><E3A5AC> <20><><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
endc db ? ; f1+5 ᨬ<><E1A8AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> (<28>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> flags&4)
|
|
|
|
|
escc db ? ; f1+6 <20><>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD>騩 ᨬ<><E1A8AC><EFBFBD> (<28>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> flags&4)
|
|
|
|
|
color db ? ; f1+7 <20><><EFBFBD><EFBFBD><EFBFBD> 梥<><E6A2A5>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ends
|
|
|
|
|
|
|
|
|
|
struct symbol
|
2014-06-27 23:34:57 +02:00
|
|
|
|
c db ? ; +0 ᨬ<><E1A8AC><EFBFBD>
|
|
|
|
|
col db ? ; +1 梥<>
|
|
|
|
|
perv dd ? ; +2
|
|
|
|
|
next dd ? ; +6 㪠<><E3AAA0>⥫<EFBFBD>
|
|
|
|
|
tc dd ? ; +10 <20>६. ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
td dd ? ; +14 <20>६. 㤠<><E3A4A0><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ends
|
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
ted_symbol_space db 32 ;ascii <20><><EFBFBD> <20><EFBFBD><E0AEA1><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뢠<EFBFBD><EBA2A0> <20>㦥<EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
2010-05-17 18:49:58 +02:00
|
|
|
|
ted_symbol_tab db 26 ;ascii <20><><EFBFBD> <20><>५<EFBFBD><E0A5AB> <20><>ࠢ<EFBFBD>, <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> ⠡<><E2A0A1><EFBFBD>樨 <20> ०<><E0A5A6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD>
|
2010-05-03 17:12:50 +02:00
|
|
|
|
|
2010-04-29 20:27:40 +02:00
|
|
|
|
if lang eq ru
|
|
|
|
|
|
|
|
|
|
txtRow db '<27><>ப<EFBFBD>',0
|
|
|
|
|
txtCol db '<27><><EFBFBD><EFBFBD>',0
|
|
|
|
|
txtOtm db '<27>⬥<EFBFBD><E2ACA5>',0
|
|
|
|
|
txtBuf db '<27><><EFBFBD><EFBFBD><EFBFBD>:',0
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
txtRow db 'Rows',0
|
|
|
|
|
txtCol db 'Cols',0
|
|
|
|
|
txtOtm db 'Undo',0
|
|
|
|
|
txtBuf db 'Buffer:',0
|
|
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
2010-05-17 18:49:58 +02:00
|
|
|
|
;EvChar - ⠡<><E2A0A1><EFBFBD><EFBFBD> <20><><EFBFBD> 䨫<><E4A8AB><EFBFBD><E0AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞<EFBFBD><EFA5AC> ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>-<2D><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>譨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
2017-09-30 20:05:24 +02:00
|
|
|
|
align 16
|
2010-05-03 17:12:50 +02:00
|
|
|
|
EvChar db 0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0
|
2010-04-29 20:27:40 +02:00
|
|
|
|
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
|
|
|
|
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
|
|
|
|
|
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
|
|
|
|
|
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
|
|
|
|
|
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
|
|
|
|
|
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
|
|
|
|
|
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0
|
|
|
|
|
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
|
|
|
|
|
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
|
|
|
|
|
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
|
|
|
|
|
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
|
|
|
|
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
|
|
|
|
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
|
|
|
|
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
|
|
|
|
|
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_init uses eax ecx edi, edit:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov ecx,sizeof.symbol
|
|
|
|
|
imul ecx,ted_max_chars
|
2010-06-09 22:06:03 +02:00
|
|
|
|
invoke mem.alloc,ecx ;<3B>뤥<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov ted_tex,eax
|
|
|
|
|
mov ted_tex_1,eax
|
|
|
|
|
add ted_tex_1,sizeof.symbol
|
|
|
|
|
add eax,ecx
|
|
|
|
|
mov ted_tex_end,eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
stdcall ted_clear, edi,1
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;-------------------------------------------------
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov ecx,1024 ;1024 - <20><><EFBFBD> <20><><EFBFBD>ᨢ<EFBFBD> ted_arr_key_pos
|
|
|
|
|
add ecx,ted_syntax_file_size
|
2010-06-09 22:06:03 +02:00
|
|
|
|
invoke mem.alloc,ecx
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov ted_arr_key_pos,eax
|
|
|
|
|
add eax,1024
|
|
|
|
|
mov ted_syntax_file,eax
|
|
|
|
|
|
|
|
|
|
stdcall ted_init_scroll_bars,edi,3
|
|
|
|
|
ret
|
|
|
|
|
endp
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
MIN_W_SCRL_ARE equ 3 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭠<EFBFBD> <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
MIN_H_SCRL_ARE equ 3 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭠<EFBFBD> <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;input:
|
2010-05-05 21:38:25 +02:00
|
|
|
|
; opt = 1 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥<> <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 2 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>,
|
|
|
|
|
; 4 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-05-03 17:12:50 +02:00
|
|
|
|
proc ted_init_scroll_bars, edit:dword, opt:dword
|
|
|
|
|
pushad
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov esi,ted_scr_w
|
|
|
|
|
mov ebx,ted_scr_h
|
|
|
|
|
bt dword[opt],0
|
|
|
|
|
jae @f
|
|
|
|
|
mov ecx,ted_color_wnd_work
|
|
|
|
|
mov dword[esi+sb_offs_bckg_col],ecx
|
|
|
|
|
mov dword[ebx+sb_offs_bckg_col],ecx
|
|
|
|
|
mov ecx,ted_color_wnd_capt
|
|
|
|
|
mov dword[esi+sb_offs_frnt_col],ecx
|
|
|
|
|
mov dword[ebx+sb_offs_frnt_col],ecx
|
|
|
|
|
mov ecx,ted_color_wnd_bord
|
|
|
|
|
mov dword[esi+sb_offs_line_col],ecx
|
|
|
|
|
mov dword[ebx+sb_offs_line_col],ecx
|
|
|
|
|
@@:
|
2010-05-05 21:38:25 +02:00
|
|
|
|
bt dword[opt],2 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD> ?
|
|
|
|
|
jae .doc_resize
|
|
|
|
|
call ted_get_num_lines
|
2014-06-27 23:34:57 +02:00
|
|
|
|
cmp eax,TED_LINES_IN_NEW_FILE
|
2010-05-05 21:38:25 +02:00
|
|
|
|
jge @f
|
2014-06-27 23:34:57 +02:00
|
|
|
|
mov eax,TED_LINES_IN_NEW_FILE
|
2010-05-05 21:38:25 +02:00
|
|
|
|
@@:
|
|
|
|
|
mov dword[esi+sb_offs_max_area],eax
|
|
|
|
|
.doc_resize:
|
|
|
|
|
bt dword[opt],1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ?
|
2010-05-03 17:12:50 +02:00
|
|
|
|
jae .no_size
|
|
|
|
|
mov edx,ted_wnd_l
|
|
|
|
|
add edx,ted_rec_l
|
|
|
|
|
mov word[ebx+sb_offs_start_x],dx ;<3B><><EFBFBD>⠢<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mov eax,ted_wnd_h ;calculate lines in page
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov edx,ted_wnd_t
|
|
|
|
|
add edx,eax
|
|
|
|
|
mov word[ebx+sb_offs_start_y],dx ;<3B><><EFBFBD>⠢<EFBFBD>塞 <20><><EFBFBD>孨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
sub eax,ted_rec_t
|
|
|
|
|
xor edx,edx
|
|
|
|
|
mov ecx,ted_rec_h
|
|
|
|
|
div ecx
|
|
|
|
|
cmp eax,MIN_W_SCRL_ARE
|
|
|
|
|
jg @f
|
|
|
|
|
mov eax,MIN_W_SCRL_ARE
|
|
|
|
|
@@:
|
|
|
|
|
mov dword[esi+sb_offs_cur_area],eax
|
|
|
|
|
|
|
|
|
|
mov eax,ted_wnd_w ;calculate cols in page
|
|
|
|
|
mov edx,ted_wnd_l ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
add edx,eax ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <20><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
mov word[esi+sb_offs_start_x],dx ;<3B><><EFBFBD>⠢<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov edx,ted_wnd_t
|
|
|
|
|
mov word[esi+sb_offs_start_y],dx ;<3B><><EFBFBD>⠢<EFBFBD>塞 <20><><EFBFBD>孨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov edx,ted_wnd_h
|
|
|
|
|
mov word[esi+sb_offs_size_y],dx ;<3B><><EFBFBD>⠢<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
sub eax,ted_rec_l
|
|
|
|
|
mov word[ebx+sb_offs_size_x],ax ;<3B><><EFBFBD>⠢<EFBFBD>塞 <20><>ਭ<EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
xor edx,edx
|
|
|
|
|
mov ecx,ted_rec_w
|
|
|
|
|
div ecx
|
|
|
|
|
cmp eax,MIN_H_SCRL_ARE
|
|
|
|
|
jg @f
|
|
|
|
|
mov eax,MIN_H_SCRL_ARE
|
|
|
|
|
@@:
|
|
|
|
|
dec eax
|
|
|
|
|
mov dword[ebx+sb_offs_cur_area],eax ;<3B><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>࠭ <20><><EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
.no_size:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_delete uses edi, edit:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-06-09 22:06:03 +02:00
|
|
|
|
invoke mem.free,ted_tex
|
|
|
|
|
invoke mem.free,ted_arr_key_pos ;ted_syntax_file
|
2010-05-17 18:49:58 +02:00
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; eax = key kodes
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_key, edit:dword, table:dword, control:dword
|
|
|
|
|
pushad
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov esi,ted_el_focus
|
|
|
|
|
cmp dword[esi],edi
|
|
|
|
|
jne .end_key_fun ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20> 䮪<><E4AEAA><EFBFBD> <20><>室<EFBFBD><E5AEA4> <20><> <20>㭪樨
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov esi,dword[control]
|
|
|
|
|
|
|
|
|
|
cmp ah,KEY_F1 ;[F1]
|
|
|
|
|
jne @f
|
|
|
|
|
stdcall ted_show_help_f1,edi
|
|
|
|
|
jmp .end_key_fun
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah,KEY_F3 ;[F3]
|
|
|
|
|
jne @f
|
|
|
|
|
stdcall ted_but_find_next,edi
|
|
|
|
|
jmp .end_key_fun
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
test esi,KM_CTRL ;Ctrl+...
|
|
|
|
|
jz .key_Ctrl
|
2014-06-27 23:34:57 +02:00
|
|
|
|
; *** <20>맮<EFBFBD> <20><><EFBFBD>譨<EFBFBD> <20>㭪権 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ॡ<EFBFBD><E0A5A1><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD>/<2F><><EFBFBD>᪠/...
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp ah,24 ;Ctrl+O
|
|
|
|
|
jne @f
|
|
|
|
|
cmp ted_fun_on_key_ctrl_o,0
|
2019-01-08 17:22:08 +01:00
|
|
|
|
je .end_key_fun
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_fun_on_key_ctrl_o
|
|
|
|
|
@@:
|
2010-05-03 17:12:50 +02:00
|
|
|
|
cmp ah,31 ;Ctrl+S
|
2019-01-08 17:22:08 +01:00
|
|
|
|
jne .end_ctrl_s
|
2010-05-03 17:12:50 +02:00
|
|
|
|
cmp ted_fun_on_key_ctrl_s,0
|
2019-01-08 17:22:08 +01:00
|
|
|
|
je .end_key_fun
|
|
|
|
|
xor eax,eax
|
|
|
|
|
test esi,KM_SHIFT
|
|
|
|
|
jz @f
|
|
|
|
|
inc eax
|
|
|
|
|
@@:
|
2010-05-03 17:12:50 +02:00
|
|
|
|
call ted_fun_on_key_ctrl_s
|
2019-01-08 17:22:08 +01:00
|
|
|
|
jmp .end_key_fun
|
|
|
|
|
.end_ctrl_s:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp ah,33 ;Ctrl+F
|
|
|
|
|
jne @f
|
|
|
|
|
cmp ted_panel_id,TED_PANEL_FIND
|
|
|
|
|
je @f
|
|
|
|
|
cmp ted_fun_on_key_ctrl_f,0
|
2019-01-08 17:22:08 +01:00
|
|
|
|
je .end_key_fun
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_fun_on_key_ctrl_f
|
|
|
|
|
@@:
|
2014-06-27 23:34:57 +02:00
|
|
|
|
cmp ah,49 ;Ctrl+N
|
|
|
|
|
jne @f
|
|
|
|
|
cmp ted_fun_on_key_ctrl_n,0
|
2019-01-08 17:22:08 +01:00
|
|
|
|
je .end_key_fun
|
2014-06-27 23:34:57 +02:00
|
|
|
|
call ted_fun_on_key_ctrl_n
|
|
|
|
|
@@:
|
|
|
|
|
; *** <20>맮<EFBFBD> <20><><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD><EFBFBD> <20>㭪権
|
|
|
|
|
cmp ah,30 ;Ctrl+A
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_sel_all
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp ah,44 ;Ctrl+Z
|
|
|
|
|
jne @f
|
|
|
|
|
stdcall ted_but_undo,edi
|
|
|
|
|
@@:
|
2018-10-21 22:10:31 +02:00
|
|
|
|
cmp ah,45 ;Ctrl+X
|
|
|
|
|
jne @f
|
|
|
|
|
stdcall ted_but_cut,edi
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp ah,46 ;Ctrl+C
|
|
|
|
|
jne @f
|
|
|
|
|
stdcall ted_but_copy,edi
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah,47 ;Ctrl+V
|
|
|
|
|
jne @f
|
|
|
|
|
stdcall ted_but_paste,edi
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah,199 ;Ctrl+Home
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_key_ctrl_home
|
|
|
|
|
@@:
|
2014-06-27 23:34:57 +02:00
|
|
|
|
cmp ah,207 ;Ctrl+End
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_key_ctrl_end
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jmp .end_key_fun
|
|
|
|
|
.key_Ctrl:
|
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
test esi,KM_SHIFT ;Shift+...
|
|
|
|
|
jz .key_Shift
|
|
|
|
|
cmp ah,72 ;Shift+Up
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_sel_key_up
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah,75 ;Shift+Left
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_sel_key_left
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah,77 ;Shift+Right
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_sel_key_right
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah,80 ;Shift+Down
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_sel_key_down
|
|
|
|
|
@@:
|
|
|
|
|
;mov ted_drag_k,1 ;<3B><>稭<EFBFBD><E7A8AD><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jmp .key_MoveCur
|
|
|
|
|
.key_Shift:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
;-------------------------------------------------
|
2010-05-03 17:12:50 +02:00
|
|
|
|
cmp ah,72 ;178 ;Up
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_draw_cursor_sumb
|
|
|
|
|
call ted_cur_move_up
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne .no_red_0
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
jmp @f
|
|
|
|
|
.no_red_0:
|
|
|
|
|
call ted_draw_main_cursor
|
|
|
|
|
mov ted_drag_k,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@@:
|
2010-05-17 18:49:58 +02:00
|
|
|
|
cmp ah,80 ;177 ;Down
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_draw_cursor_sumb
|
|
|
|
|
call ted_cur_move_down
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne .no_red_1
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
jmp @f
|
|
|
|
|
.no_red_1:
|
|
|
|
|
call ted_draw_main_cursor
|
|
|
|
|
mov ted_drag_k,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@@:
|
2013-09-11 21:05:33 +02:00
|
|
|
|
cmp ah,75 ;176 ;Left
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_draw_cursor_sumb
|
|
|
|
|
call ted_cur_move_left
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne .no_red_2
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
jmp @f
|
|
|
|
|
.no_red_2:
|
|
|
|
|
call ted_draw_main_cursor
|
|
|
|
|
mov ted_drag_k,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah,77 ;179 ;Right
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_draw_cursor_sumb
|
|
|
|
|
call ted_cur_move_right
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne .no_red_3
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
jmp @f
|
|
|
|
|
.no_red_3:
|
|
|
|
|
call ted_draw_main_cursor
|
|
|
|
|
mov ted_drag_k,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah,71 ;180 ;Home
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_draw_cursor_sumb
|
|
|
|
|
call ted_cur_move_x_first_char
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne .no_red_4
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
jmp @f
|
|
|
|
|
.no_red_4:
|
|
|
|
|
call ted_draw_main_cursor
|
|
|
|
|
mov ted_drag_k,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah,79 ;181 ;End
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_draw_cursor_sumb
|
|
|
|
|
call ted_cur_move_x_last_char
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne .no_red_5
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
jmp @f
|
|
|
|
|
.no_red_5:
|
|
|
|
|
call ted_draw_main_cursor
|
|
|
|
|
mov ted_drag_k,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah,73 ;184 ;PageUp
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_cur_move_page_up
|
|
|
|
|
cmp dl,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah,81 ;183 ;PageDown
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_cur_move_page_down
|
|
|
|
|
cmp dl,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
mov ted_drag_k,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
;-------------------------------------------------
|
|
|
|
|
.key_MoveCur:
|
|
|
|
|
|
2013-09-11 21:05:33 +02:00
|
|
|
|
;<3B><><EFBFBD><EFBFBD> <20>ய<EFBFBD>᪠<EFBFBD><E1AAA0><EFBFBD><EFBFBD> <20><>㦥<EFBFBD><E3A6A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
cmp ah,42 ;[L Shift] <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>㣨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
je .end_key_fun
|
|
|
|
|
cmp ah,54 ;[R Shift] <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>㣨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
je .end_key_fun
|
|
|
|
|
cmp ah,58 ;[Caps Lock]
|
|
|
|
|
je .end_key_fun
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp ah,69 ;[Pause Break]
|
|
|
|
|
je .end_key_fun
|
|
|
|
|
cmp ah,120 ;[Fn]
|
|
|
|
|
je .end_key_fun
|
|
|
|
|
cmp ah,0x80 ;if key up
|
|
|
|
|
ja .end_key_fun
|
|
|
|
|
|
|
|
|
|
cmp dword[table],0
|
|
|
|
|
je @f
|
|
|
|
|
stdcall KeyConvertToASCII, dword[table]
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
;mov ted_drag_k,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
lea edx,[EvChar] ;<3B><>६ <20><><EFBFBD><EFBFBD><EFBFBD> ⠡<><E2A0A1><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>⨬묨 ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
add dl,ah
|
|
|
|
|
jae @f
|
|
|
|
|
add edx,0x100 ;<3B> <20>뫮 <20><>९<EFBFBD><E0A5AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
|
|
|
|
@@:
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp byte[edx],1
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jne @f
|
|
|
|
|
mov ted_key_new,ah
|
|
|
|
|
call ted_set_undo
|
|
|
|
|
mov edx,ted_opt_ed_change_time+ted_opt_ed_move_cursor
|
|
|
|
|
stdcall ted_sel_text_del,edx
|
|
|
|
|
cmp al,1
|
|
|
|
|
jne .del
|
|
|
|
|
mov edx,ted_opt_ed_move_cursor
|
|
|
|
|
.del:
|
|
|
|
|
cmp ted_cur_ins,1
|
|
|
|
|
je .no_ins_mod
|
|
|
|
|
stdcall ted_text_del,edi,ted_opt_ed_change_time
|
|
|
|
|
mov edx,ted_opt_ed_move_cursor
|
|
|
|
|
.no_ins_mod:
|
|
|
|
|
mov ecx,edi
|
|
|
|
|
add ecx,ted_offs_key_new
|
|
|
|
|
stdcall ted_text_add,edi,ecx,1,edx ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 ᨬ<><E1A8AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cmp ted_key_new,13
|
|
|
|
|
jne .dr_m_win
|
2012-06-11 00:19:58 +02:00
|
|
|
|
;<3B> <20><>⠢<EFBFBD><E2A0A2><EFBFBD> ᨬ<><E1A8AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|
|
|
|
mov ecx,ted_scr_w
|
|
|
|
|
inc dword[ecx+sb_offs_max_area] ;㢥<><E3A2A5>稢<EFBFBD><E7A8A2><EFBFBD> ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD>⨪<EFBFBD><E2A8AA>쭮<EFBFBD><ECADAE> <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov edx,ted_cur_y
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp edx,[ecx+sb_offs_cur_area]
|
2012-06-11 00:19:58 +02:00
|
|
|
|
jl .no_change
|
|
|
|
|
dec ted_cur_y ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>⠢<EFBFBD>塞 <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
inc dword[ecx+sb_offs_position] ;ᤢ<><E1A4A2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㭮<EFBFBD>
|
|
|
|
|
.no_change:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
jmp .dr_cur_l
|
|
|
|
|
.dr_m_win:
|
|
|
|
|
stdcall ted_draw_cur_line,edi
|
|
|
|
|
.dr_cur_l:
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
cmp ah,8 ;[<-]
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_set_undo
|
|
|
|
|
stdcall ted_sel_text_del,ted_opt_ed_change_time
|
|
|
|
|
cmp al,1
|
|
|
|
|
je .del_one_b
|
|
|
|
|
stdcall ted_text_del,edi,ted_opt_ed_change_time+ted_opt_ed_move_cursor
|
|
|
|
|
.del_one_b:
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
|
|
|
|
je .end_key_fun
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
jmp .end_key_fun
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 4
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
cmp ah,182 ;Delete
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_set_undo
|
|
|
|
|
stdcall ted_sel_text_del,ted_opt_ed_change_time
|
|
|
|
|
cmp al,1
|
|
|
|
|
je .del_one_d
|
|
|
|
|
stdcall ted_text_del,edi,ted_opt_ed_change_time
|
|
|
|
|
.del_one_d:
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
|
|
|
|
je .end_key_fun
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
jmp .end_key_fun
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
cmp ah,185 ;Ins
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_draw_cursor_sumb
|
|
|
|
|
xor ted_cur_ins,1
|
|
|
|
|
call ted_draw_main_cursor
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
.end_key_fun:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;output:
|
|
|
|
|
; al = 1 - can save
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_can_save uses ecx edi, edit:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
mov ecx,ted_tim_ch
|
|
|
|
|
sub ecx,ted_tim_undo
|
|
|
|
|
mov al,1
|
|
|
|
|
cmp ted_tim_ls,ecx
|
|
|
|
|
jne @f
|
|
|
|
|
dec al
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; al = 1 - selected
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_is_select uses ebx
|
2014-06-27 23:34:57 +02:00
|
|
|
|
xor al,al
|
|
|
|
|
cmp ted_drag_m,1
|
|
|
|
|
je @f
|
2019-01-21 12:39:35 +01:00
|
|
|
|
inc al
|
2014-06-27 23:34:57 +02:00
|
|
|
|
mov ebx,ted_sel_x0
|
|
|
|
|
cmp ebx,ted_sel_x1
|
|
|
|
|
jne @f
|
|
|
|
|
mov ebx,ted_sel_y0
|
|
|
|
|
cmp ebx,ted_sel_y1
|
|
|
|
|
jne @f
|
|
|
|
|
xor al,al
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_sel_normalize uses ecx esi
|
2010-04-29 20:27:40 +02:00
|
|
|
|
push edi
|
|
|
|
|
mov esi,edi
|
|
|
|
|
add esi,ted_offs_sel
|
|
|
|
|
add edi,ted_offs_seln
|
2019-01-21 12:39:35 +01:00
|
|
|
|
mov ecx,sizeof.TexSelect/4
|
|
|
|
|
rep movsd
|
2010-04-29 20:27:40 +02:00
|
|
|
|
pop edi
|
|
|
|
|
|
|
|
|
|
jmp @f
|
|
|
|
|
.swp_f:
|
|
|
|
|
mov ecx,ted_seln_x0
|
|
|
|
|
m2m ted_seln_x0,ted_seln_x1
|
|
|
|
|
mov ted_seln_x1,ecx
|
|
|
|
|
|
|
|
|
|
mov ecx,ted_seln_y0
|
|
|
|
|
cmp ecx,ted_seln_y1 ;(sel_y0>sel_y1)
|
|
|
|
|
jle .end_f
|
|
|
|
|
m2m ted_seln_y0,ted_seln_y1
|
|
|
|
|
mov ted_seln_y1,ecx
|
|
|
|
|
|
|
|
|
|
jmp .end_f
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 4
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
mov ecx,ted_seln_y0
|
|
|
|
|
cmp ecx,ted_seln_y1 ;(sel_y0>sel_y1)
|
|
|
|
|
jg .swp_f
|
|
|
|
|
|
|
|
|
|
cmp ecx,ted_seln_y1 ;(sel_y0==sel_y1)
|
|
|
|
|
jne .end_f
|
|
|
|
|
mov ecx,ted_seln_x0
|
|
|
|
|
cmp ecx,ted_seln_x1 ;(sel_x0>sel_x1)
|
|
|
|
|
jg .swp_f
|
|
|
|
|
|
|
|
|
|
.end_f:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>砫<EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_sel_start uses eax ecx
|
|
|
|
|
mov eax,ted_scr_h
|
|
|
|
|
mov ecx,ted_cur_x
|
2018-10-21 22:10:31 +02:00
|
|
|
|
add ecx,[eax+sb_offs_position]
|
2016-01-21 23:22:11 +01:00
|
|
|
|
mov ted_sel_x0,ecx
|
|
|
|
|
mov ted_sel_x1,ecx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
mov eax,ted_scr_w
|
|
|
|
|
mov ecx,ted_cur_y
|
2018-10-21 22:10:31 +02:00
|
|
|
|
add ecx,[eax+sb_offs_position]
|
2016-01-21 23:22:11 +01:00
|
|
|
|
mov ted_sel_y0,ecx
|
|
|
|
|
mov ted_sel_y1,ecx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>६<EFBFBD>饭<EFBFBD><E9A5AD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_sel_move
|
|
|
|
|
push eax ecx
|
|
|
|
|
mov ecx,ted_cur_x
|
|
|
|
|
mov eax,ted_scr_h
|
2018-10-21 22:10:31 +02:00
|
|
|
|
add ecx,[eax+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov ted_sel_x1,ecx
|
|
|
|
|
|
|
|
|
|
mov eax,ted_scr_w
|
|
|
|
|
mov ecx,ted_cur_y
|
2018-10-21 22:10:31 +02:00
|
|
|
|
add ecx,[eax+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov ted_sel_y1,ecx
|
|
|
|
|
pop ecx eax
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy)
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
2014-06-27 23:34:57 +02:00
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20>ᥣ<EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2014-06-27 23:34:57 +02:00
|
|
|
|
proc ted_sel_all
|
|
|
|
|
push eax
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov ted_sel_x0,eax
|
|
|
|
|
mov ted_sel_y0,eax
|
|
|
|
|
|
|
|
|
|
mov ted_sel_x1,eax ;???
|
|
|
|
|
call ted_get_num_lines
|
|
|
|
|
mov ted_sel_y1,eax
|
|
|
|
|
pop eax
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy)
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
2010-04-29 20:27:40 +02:00
|
|
|
|
;input:
|
|
|
|
|
; cl_al_mem = 1 - clear all memory
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_clear uses ecx edi, edit:dword, cl_al_mem:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-17 18:49:58 +02:00
|
|
|
|
mov ted_cur_x,0
|
|
|
|
|
mov ted_cur_y,0
|
|
|
|
|
mov ted_tim_ch,0
|
|
|
|
|
mov ted_tim_ls,0
|
|
|
|
|
mov ted_tim_co,0
|
|
|
|
|
mov ted_tim_undo,0
|
|
|
|
|
mov ted_help_id,-1
|
|
|
|
|
mov ecx,sizeof.symbol
|
|
|
|
|
shl ecx,1
|
|
|
|
|
add ecx,ted_tex
|
|
|
|
|
mov ted_ptr_free_symb,ecx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-17 18:49:58 +02:00
|
|
|
|
mov ecx,ted_scr_w
|
|
|
|
|
mov dword[ecx+sb_offs_position],0
|
|
|
|
|
mov dword[ecx+sb_offs_max_area],100 ;<3B><> <20><>ப <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD>
|
|
|
|
|
mov dword[ecx+sb_offs_redraw],1
|
|
|
|
|
mov ecx,ted_scr_h
|
|
|
|
|
mov dword[ecx+sb_offs_position],0
|
|
|
|
|
mov dword[ecx+sb_offs_max_area],100 ;<3B><> ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-17 18:49:58 +02:00
|
|
|
|
mov ted_sel_x0,0
|
|
|
|
|
mov ted_sel_y0,0
|
|
|
|
|
mov ted_sel_x1,0
|
|
|
|
|
mov ted_sel_y1,0
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-17 18:49:58 +02:00
|
|
|
|
cmp dword[cl_al_mem],0
|
|
|
|
|
je .exit
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-17 18:49:58 +02:00
|
|
|
|
push edx
|
|
|
|
|
mov ecx,sizeof.symbol
|
|
|
|
|
imul ecx,ted_max_chars
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
@@:
|
|
|
|
|
mov byte [edx],0
|
|
|
|
|
inc edx
|
|
|
|
|
loop @b
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
mov dword [edx+6],1
|
|
|
|
|
pop edx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-17 18:49:58 +02:00
|
|
|
|
.exit:
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2012-05-31 18:49:37 +02:00
|
|
|
|
proc ted_init_syntax_file, edit:dword
|
2010-04-29 20:27:40 +02:00
|
|
|
|
pushad
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
mov ecx,0x100
|
|
|
|
|
mov edx,ted_arr_key_pos
|
|
|
|
|
@@:
|
|
|
|
|
mov dword[edx],-1
|
|
|
|
|
add edx,4
|
|
|
|
|
loop @b
|
|
|
|
|
|
|
|
|
|
;init: ted_colors_text_count, ted_key_words_count, ...
|
|
|
|
|
mov ted_colors_text_count,1
|
|
|
|
|
mov ted_key_words_count,0
|
|
|
|
|
mov ted_help_text_f1,0
|
|
|
|
|
mov ted_help_id,-1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> <><E1ABAE> <20><><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2>
|
|
|
|
|
|
|
|
|
|
mov eax,edi ;<3B><><EFBFBD>࠭塞 <20><><EFBFBD>祭<EFBFBD><E7A5AD> edi
|
|
|
|
|
mov esi,ted_syntax_file
|
|
|
|
|
add edi,ted_offs_count_colors
|
2019-01-21 12:39:35 +01:00
|
|
|
|
mov ecx,9
|
|
|
|
|
rep movsd
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov edi,eax ;<3B><><EFBFBD>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>祭<EFBFBD><E7A5AD> edi
|
|
|
|
|
|
|
|
|
|
mov eax,ted_syntax_file
|
|
|
|
|
add eax,32
|
|
|
|
|
mov ted_text_colors,eax
|
|
|
|
|
|
|
|
|
|
mov eax,ted_colors_text_count ;init: count_colors_text (offset to key words)
|
2019-01-21 12:39:35 +01:00
|
|
|
|
lea eax,[4*eax+32]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
add eax,ted_syntax_file
|
|
|
|
|
mov ted_key_words_data,eax
|
|
|
|
|
|
|
|
|
|
mov ecx,ted_key_words_count ;init: ted_arr_key_pos (first key positions)
|
|
|
|
|
xor eax,eax
|
|
|
|
|
@@:
|
|
|
|
|
ColToIndexOffset eax,edx
|
2019-01-21 12:39:35 +01:00
|
|
|
|
movzx ebx,byte[edx]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov esi,ted_arr_key_pos
|
2019-01-21 12:39:35 +01:00
|
|
|
|
lea esi,[esi+4*ebx]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp dword[esi],-1
|
|
|
|
|
jne .no_ch_key
|
2019-01-21 12:39:35 +01:00
|
|
|
|
mov [esi],eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
.no_ch_key:
|
|
|
|
|
inc eax
|
|
|
|
|
loop @b
|
|
|
|
|
|
|
|
|
|
;init: ted_help_text_f1
|
2011-08-22 17:58:27 +02:00
|
|
|
|
mov ecx,ted_key_words_count ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <20><><EFBFBD>祢<EFBFBD><E7A5A2> <>
|
|
|
|
|
imul ecx,sizeof.TexColViv ;ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 1-<2D> <20><>. <20><>.
|
|
|
|
|
add ecx,ted_key_words_data ;<3B><>砫<EFBFBD> 䠩<><E4A0A9> <20> <20><>. <20><>.
|
|
|
|
|
mov ted_help_text_f1,ecx ;<3B><>⪠ <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><>稭<EFBFBD><E7A8AD><EFBFBD><EFBFBD> ⥪<><E2A5AA> <20><> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
stdcall ted_init_scroll_bars,edi,1 ;<3B><><EFBFBD>塞 梥<><E6A2A5> <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
.no_colors:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; ebx = file size
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⨨ 䠩<><E4A0A9>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_on_open_file
|
|
|
|
|
push eax ;destination
|
|
|
|
|
push ecx ;for cycle
|
|
|
|
|
push edx ;source
|
|
|
|
|
push esi
|
|
|
|
|
|
|
|
|
|
stdcall ted_clear,edi,0 ;<3B><><EFBFBD>⨬ <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><>⮬<EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20>㤥<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>묨 <20><><EFBFBD>묨
|
2013-11-18 14:08:09 +01:00
|
|
|
|
|
|
|
|
|
;<3B><><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><E8A5AD> <20><>ப<EFBFBD> ⮫쪮 10 (<28><><EFBFBD> 13)
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
mov ecx,ebx
|
|
|
|
|
@@:
|
|
|
|
|
cmp byte[edx],13
|
|
|
|
|
je .no_10 ;<3B> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD> 13, <20><> 10-<2D> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㥬
|
|
|
|
|
inc edx
|
|
|
|
|
loop @b
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
mov ecx,ebx
|
|
|
|
|
.s_10:
|
|
|
|
|
cmp byte[edx],10
|
|
|
|
|
jne @f
|
|
|
|
|
mov byte[edx],13 ;<3B><><EFBFBD>塞 10-<2D> ᨬ<><E1A8AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|
|
|
|
@@:
|
|
|
|
|
inc edx
|
|
|
|
|
loop .s_10
|
|
|
|
|
.no_10:
|
|
|
|
|
|
|
|
|
|
;<3B><>ॢ<EFBFBD><E0A5A2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> t_edit
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov eax,ebx
|
|
|
|
|
mov ecx,ebx
|
|
|
|
|
add eax,2
|
|
|
|
|
ConvertIndexToPointer eax
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
add edx,ebx
|
|
|
|
|
push ebx
|
|
|
|
|
@@:
|
|
|
|
|
mov ebx,[edx]
|
|
|
|
|
mov byte [eax],bl
|
|
|
|
|
mov dword [eax+2],ecx
|
|
|
|
|
inc dword [eax+2]
|
|
|
|
|
mov dword [eax+6],ecx
|
|
|
|
|
add dword [eax+6],3
|
|
|
|
|
;mov byte[eax+1],0 ;col=0
|
|
|
|
|
mov dword [eax+10],-1 ;tc=-1
|
|
|
|
|
mov dword [eax+14],0 ;td=0
|
|
|
|
|
|
|
|
|
|
cmp ecx,0
|
|
|
|
|
je @f
|
|
|
|
|
dec ecx
|
|
|
|
|
dec edx
|
|
|
|
|
sub eax,sizeof.symbol
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
pop ebx
|
|
|
|
|
add eax,2
|
|
|
|
|
mov dword [eax],0 ; first sumbol 'perv=0'
|
|
|
|
|
|
2012-02-13 12:46:40 +01:00
|
|
|
|
mov edx,ted_tex ; <20><><EFBFBD><EFBFBD>ன<EFBFBD><E0AEA9> <20><>砫쭮<E7A0AB><ECADAE> <20><>㦥<EFBFBD><E3A6A5><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
; begining sumbol 'perv=0' 'next=2'
|
|
|
|
|
mov dword [edx+2],0
|
|
|
|
|
mov dword [edx+6],2
|
|
|
|
|
|
2012-02-13 12:46:40 +01:00
|
|
|
|
add edx,sizeof.symbol ; <20><><EFBFBD><EFBFBD>ன<EFBFBD><E0AEA9> <20><><EFBFBD><EFBFBD>筮<EFBFBD><E7ADAE> <20><>㦥<EFBFBD><E3A6A5><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov dword [edx+6],0 ; last sumbol 'next=0'
|
|
|
|
|
mov dword [edx+2],ebx ; last sumbol 'perv=last'
|
|
|
|
|
inc dword [edx+2]
|
2012-02-13 12:46:40 +01:00
|
|
|
|
mov dword [edx+10],0 ; <20>⠢<EFBFBD><E2A0A2> <20>६<EFBFBD> ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD> ࠢ<><E0A0A2><EFBFBD> 0, <20><><EFBFBD> <20><> ᨬ<><E1A8AC><EFBFBD> <20>ࠢ<EFBFBD><E0A0A2>쭮 <20><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⨨ 䠩<><E4A0A9><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 28 <20><><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
mov edx,ebx
|
|
|
|
|
inc edx ;2 = rezerv sumbols
|
|
|
|
|
imul edx,sizeof.symbol
|
|
|
|
|
add edx,ted_tex
|
|
|
|
|
mov dword [edx+6],1 ; last sumbol 'next=1'
|
|
|
|
|
|
|
|
|
|
@@: ;clear memory, need if before was open big file
|
|
|
|
|
add edx,sizeof.symbol
|
|
|
|
|
cmp edx,ted_tex_end
|
|
|
|
|
jge @f
|
|
|
|
|
mov dword[edx+10],0
|
|
|
|
|
mov dword[edx+14],0
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
call ted_get_num_lines
|
2014-06-27 23:34:57 +02:00
|
|
|
|
cmp eax,TED_LINES_IN_NEW_FILE
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jge @f
|
2014-06-27 23:34:57 +02:00
|
|
|
|
mov eax,TED_LINES_IN_NEW_FILE
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
mov esi,ted_scr_w
|
|
|
|
|
mov dword[esi+sb_offs_max_area],eax
|
|
|
|
|
pop esi edx ecx eax
|
|
|
|
|
|
|
|
|
|
call ted_text_colored
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to symbol struct
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; edx = pointer to 'perv' visible symbol struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_iterat_perv:
|
2012-06-20 12:05:50 +02:00
|
|
|
|
cmp ted_tim_undo,0
|
|
|
|
|
je .else
|
|
|
|
|
push ebx
|
|
|
|
|
@@:
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov edx,[edx+2]
|
2019-01-21 12:39:35 +01:00
|
|
|
|
or edx,edx
|
|
|
|
|
jz @f
|
2012-06-20 12:05:50 +02:00
|
|
|
|
imul edx,sizeof.symbol
|
|
|
|
|
add edx,ted_tex
|
|
|
|
|
call ted_symbol_not_vis
|
|
|
|
|
cmp bl,1
|
|
|
|
|
je @b
|
|
|
|
|
cmp byte[edx],10 ;<3B>ய<EFBFBD><E0AEAF><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> 10
|
|
|
|
|
je @b
|
|
|
|
|
pop ebx
|
|
|
|
|
ret
|
|
|
|
|
@@:
|
|
|
|
|
mov edx,ted_tex ;<3B><>砫<EFBFBD> 䠩<><E4A0A9>
|
|
|
|
|
pop ebx
|
|
|
|
|
ret
|
|
|
|
|
.else:
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov edx,[edx+2]
|
2019-01-21 12:39:35 +01:00
|
|
|
|
or edx,edx
|
|
|
|
|
jz @f
|
2012-06-20 12:05:50 +02:00
|
|
|
|
imul edx,sizeof.symbol
|
|
|
|
|
add edx,ted_tex
|
|
|
|
|
cmp dword [edx+14],0
|
|
|
|
|
jne .else
|
|
|
|
|
cmp byte[edx],10 ;<3B>ய<EFBFBD><E0AEAF><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> 10
|
|
|
|
|
je .else
|
|
|
|
|
ret
|
|
|
|
|
@@:
|
|
|
|
|
mov edx,ted_tex ;<3B><>砫<EFBFBD> 䠩<><E4A0A9>
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to symbol struct
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; edx = pointer to 'next' visible symbol struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_iterat_next:
|
2012-06-20 12:05:50 +02:00
|
|
|
|
cmp ted_tim_undo,0
|
|
|
|
|
je .else
|
|
|
|
|
push ebx
|
|
|
|
|
@@:
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov edx,[edx+6]
|
2012-06-20 12:05:50 +02:00
|
|
|
|
cmp edx,1
|
|
|
|
|
jle @f
|
|
|
|
|
imul edx,sizeof.symbol
|
|
|
|
|
add edx,ted_tex
|
|
|
|
|
|
|
|
|
|
call ted_symbol_not_vis
|
|
|
|
|
cmp bl,1
|
|
|
|
|
je @b
|
|
|
|
|
cmp byte[edx],10 ;<3B>ய<EFBFBD><E0AEAF><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> 10
|
|
|
|
|
je @b
|
|
|
|
|
pop ebx
|
|
|
|
|
ret
|
|
|
|
|
@@:
|
|
|
|
|
mov edx,ted_tex_1 ;<3B><><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
|
|
|
|
pop ebx
|
|
|
|
|
ret
|
|
|
|
|
.else:
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov edx,[edx+6]
|
2012-06-20 12:05:50 +02:00
|
|
|
|
cmp edx,1
|
|
|
|
|
jle @f
|
|
|
|
|
imul edx,sizeof.symbol
|
|
|
|
|
add edx,ted_tex
|
|
|
|
|
|
|
|
|
|
cmp dword [edx+14],0
|
|
|
|
|
jne .else
|
|
|
|
|
cmp byte[edx],10 ;<3B>ய<EFBFBD><E0AEAF><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> 10
|
|
|
|
|
je .else
|
|
|
|
|
ret
|
|
|
|
|
@@:
|
|
|
|
|
mov edx,ted_tex_1 ;<3B><><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; bl = symbol end of select
|
2011-08-22 17:58:27 +02:00
|
|
|
|
; bh = <20><>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD>騩 ᨬ<><E1A8AC><EFBFBD> (= 0 <20> <20><><EFBFBD> <20><EFBFBD>ન <20><> <20><><EFBFBD>)
|
2010-04-29 20:27:40 +02:00
|
|
|
|
; edx = pointer to symbol struct
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;description:
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㪠<><E3AAA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_iterat_next_pos_char:
|
2011-08-22 17:58:27 +02:00
|
|
|
|
push ax
|
|
|
|
|
mov al,1 ;<3B>।<EFBFBD><E0A5A4><EFBFBD>騩 ᨬ<><E1A8AC><EFBFBD>, <20><>㦨<EFBFBD> <20><><EFBFBD> <20>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD> <20> ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> bh
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
cmp bl,byte[edx]
|
2011-08-22 17:58:27 +02:00
|
|
|
|
je .found
|
|
|
|
|
.no_found:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
2011-08-22 17:58:27 +02:00
|
|
|
|
mov al,byte[edx]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_iterat_next
|
|
|
|
|
jmp @b
|
2011-08-22 17:58:27 +02:00
|
|
|
|
.found:
|
|
|
|
|
cmp bh,al
|
|
|
|
|
je .no_found
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
call ted_iterat_next
|
2011-08-22 17:58:27 +02:00
|
|
|
|
pop ax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to symbol struct
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_iterat_perv_color_tag:
|
2014-06-27 23:34:57 +02:00
|
|
|
|
@@:
|
|
|
|
|
cmp byte[edx+1],0
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_iterat_perv
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
jmp @b
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 4
|
2014-06-27 23:34:57 +02:00
|
|
|
|
@@:
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to symbol struct
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_iterat_next_color_tag:
|
2014-06-27 23:34:57 +02:00
|
|
|
|
@@:
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
cmp byte[edx+1],0
|
|
|
|
|
jne @f
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
jmp @b
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 4
|
2014-06-27 23:34:57 +02:00
|
|
|
|
@@:
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to symbol struct
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; bl = 1 if sumbol not visible
|
|
|
|
|
; (tex[i].td+ted_tim_undo<=ted_tim_ch && tex[i].td) || (tex[i].tc>ted_tim_ch-ted_tim_undo)
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_symbol_not_vis:
|
2016-01-21 23:22:11 +01:00
|
|
|
|
push eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
xor bl,bl
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
cmp dword [edx+14],0
|
|
|
|
|
je @f
|
|
|
|
|
mov eax,[edx+14] ;eax=tex[i].td
|
|
|
|
|
add eax,ted_tim_undo
|
|
|
|
|
cmp eax,ted_tim_ch
|
|
|
|
|
jg @f
|
|
|
|
|
mov bl,1
|
|
|
|
|
pop eax
|
|
|
|
|
ret
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
mov eax,ted_tim_ch
|
|
|
|
|
sub eax,ted_tim_undo
|
|
|
|
|
cmp [edx+10],eax
|
|
|
|
|
jle @f
|
|
|
|
|
or bl,1
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
pop eax
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;input:
|
2019-01-21 12:39:35 +01:00
|
|
|
|
; text - pointer to text string
|
|
|
|
|
; add_opt - options
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_text_add, edit:dword, text:dword, t_len:dword, add_opt:dword
|
|
|
|
|
locals
|
|
|
|
|
new_spc dd ? ;count new spaces
|
|
|
|
|
new_lin dd ? ;count new lines
|
|
|
|
|
endl
|
|
|
|
|
;<3B>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD><EFBFBD> ॣ<><E0A5A3><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㭪樨:
|
|
|
|
|
;eax - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>⠢<EFBFBD><E2A0A2> ⥪<><E2A5AA><EFBFBD>
|
|
|
|
|
;ebx - <20><><EFBFBD> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20>㦤, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>⠢<EFBFBD>塞<EFBFBD><EFA5AC><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
|
|
|
|
;ecx - <20><><EFBFBD> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20>㦤
|
|
|
|
|
;edx - 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
|
|
|
|
pushad
|
2010-10-20 21:08:42 +02:00
|
|
|
|
cmp dword[t_len],1 ;<3B><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>塞<EFBFBD><EFA5AC><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
|
|
|
|
jl .no_add ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <1 <20><>룠<EFBFBD><EBA3A0> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20>㭪樨, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov esi,[text]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
call ted_get_pos_by_cursor
|
|
|
|
|
call ted_get_text_perv_pos
|
|
|
|
|
call ted_get_text_arr_index ;eax=po_t
|
|
|
|
|
|
|
|
|
|
mov dword[new_spc],0
|
|
|
|
|
cmp ted_gp_opt,2
|
|
|
|
|
je @f
|
|
|
|
|
push eax ;c_sp=cur[cn].x+Scroller->XPos-StrLen(cur[cn].y+Scroller->YPos);
|
|
|
|
|
mov eax,ted_scr_h
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov eax,[eax+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
add eax,ted_cur_x ;eax - <20><><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov [new_spc],eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
mov eax,ted_scr_w
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov eax,[eax+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
add eax,ted_cur_y ;eax - <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|
|
|
|
call ted_strlen ;ebx = line len
|
2018-10-21 22:10:31 +02:00
|
|
|
|
sub [new_spc],ebx ;<3B><> <20><><EFBFBD><EFBFBD>樨 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>, 㧭<><E3A7AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞<EFBFBD><EFA5AC> <20><EFBFBD><E0AEA1><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
pop eax
|
|
|
|
|
@@:
|
|
|
|
|
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov ebx,[t_len]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
mov dword[new_lin],0
|
|
|
|
|
cmp ted_gp_opt,0
|
|
|
|
|
jne @f
|
|
|
|
|
push eax
|
|
|
|
|
mov eax,ted_scr_w
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov eax,[eax+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
add eax,ted_cur_y
|
|
|
|
|
inc eax
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov [new_lin],eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
call ted_get_num_lines
|
2018-10-21 22:10:31 +02:00
|
|
|
|
sub [new_lin],eax
|
2014-06-27 13:52:25 +02:00
|
|
|
|
;㢥<><E3A2A5>稢<EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD><E2A5AB><EFBFBD><EFBFBD> <20><>ப
|
|
|
|
|
mov ecx,ted_scr_w
|
2018-10-21 22:10:31 +02:00
|
|
|
|
add [ecx+sb_offs_max_area],eax ;㢥<><E3A2A5>稢<EFBFBD><E7A8A2><EFBFBD> ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD>⨪<EFBFBD><E2A8AA>쭮<EFBFBD><ECADAE> <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
pop eax
|
|
|
|
|
@@:
|
|
|
|
|
|
2010-05-17 18:49:58 +02:00
|
|
|
|
mov edx,ted_ptr_free_symb
|
|
|
|
|
.beg_cycle: ;for(i=...;i<ted_max_chars;i++)
|
|
|
|
|
cmp dword [edx+10],0 ;if(!tex[i].tc && !tex[i].td)
|
|
|
|
|
jne .u1f
|
|
|
|
|
cmp dword [edx+14],0
|
|
|
|
|
jne .u1f
|
|
|
|
|
test dword[add_opt],ted_opt_ed_change_time ;if(n_tim) ted_tim_ch++;
|
|
|
|
|
jz .no_tim
|
|
|
|
|
inc ted_tim_ch
|
|
|
|
|
.no_tim:
|
|
|
|
|
test dword[add_opt],ted_opt_ed_move_cursor
|
|
|
|
|
jz .no_cur_mov
|
|
|
|
|
cmp dword[new_lin],0 ;<3B> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jg .no_cur_mov
|
|
|
|
|
cmp dword[new_spc],0 ;<3B> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA1><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⮦<> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jg .no_cur_mov
|
|
|
|
|
inc ted_cur_x ;move cursor
|
|
|
|
|
;call ted_go_to_pos
|
|
|
|
|
cmp byte [esi],13
|
|
|
|
|
jne .no_cur_mov
|
|
|
|
|
mov ted_cur_x,0
|
|
|
|
|
inc ted_cur_y
|
2014-06-27 13:52:25 +02:00
|
|
|
|
;㢥<><E3A2A5>稢<EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ⥪<><E2A5AA><EFBFBD> <20><>ப
|
|
|
|
|
mov ecx,ted_scr_w
|
|
|
|
|
inc dword[ecx+sb_offs_max_area] ;㢥<><E3A2A5>稢<EFBFBD><E7A8A2><EFBFBD> ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD>⨪<EFBFBD><E2A8AA>쭮<EFBFBD><ECADAE> <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
2010-05-17 18:49:58 +02:00
|
|
|
|
.no_cur_mov:
|
|
|
|
|
|
2014-06-27 13:52:25 +02:00
|
|
|
|
; *** <20><>⠢<EFBFBD><E2A0A2> ⥪<>饣<EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20><> <20><>ப<EFBFBD> ***
|
2010-05-17 18:49:58 +02:00
|
|
|
|
mov ecx,ted_opt_ed_change_time
|
|
|
|
|
not ecx
|
|
|
|
|
and dword[add_opt],ecx ;n_tim=false;
|
|
|
|
|
|
|
|
|
|
mov cl,byte [esi] ;tex[i].c=ta[ns];
|
|
|
|
|
mov byte [edx],cl
|
|
|
|
|
m2m dword [edx+10],ted_tim_ch ;tex[i].tc=ted_tim_ch;
|
|
|
|
|
mov [edx+2],eax ;tex[i].perv=po_t;
|
|
|
|
|
|
|
|
|
|
mov ecx,eax
|
|
|
|
|
imul ecx,sizeof.symbol
|
|
|
|
|
add ecx,ted_tex ; *** ecx = tex[po_t] ***
|
|
|
|
|
add ecx,6 ; *** ecx = tex[po_t].next ***
|
|
|
|
|
m2m dword [edx+6],dword [ecx] ;tex[i].next=tex[po_t].next;
|
|
|
|
|
|
|
|
|
|
call ted_get_text_arr_index ;*** eax = i ***
|
|
|
|
|
mov [ecx],eax ;tex[po_t].next=i; // <20><>뫪<EFBFBD> <20><>७<EFBFBD><E0A5AD>ࠢ<EFBFBD>塞
|
|
|
|
|
mov ecx,[edx+6] ; *** ecx = tex[i].next ***
|
|
|
|
|
imul ecx,sizeof.symbol
|
|
|
|
|
add ecx,ted_tex ; *** ecx = tex[tex[i].next] ***
|
|
|
|
|
mov [ecx+2],eax ;tex[tex[i].next].perv=i;
|
|
|
|
|
|
2014-06-27 13:52:25 +02:00
|
|
|
|
; *** <20><>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD><E2A5AB><EFBFBD><EFBFBD> <20><>ப <20> <20><EFBFBD><E0AEA1><EFBFBD><EFBFBD>
|
|
|
|
|
; <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>६<EFBFBD> <20><>⠢<EFBFBD><E2A0A2> <20><>室<EFBFBD><E5AEA4><EFBFBD><EFBFBD> <20><> ⥪<>⮬ ***
|
2010-05-17 18:49:58 +02:00
|
|
|
|
cmp dword[new_lin],0 ;add lines or text
|
|
|
|
|
jle .spc_add
|
|
|
|
|
dec dword[new_lin]
|
|
|
|
|
mov byte [edx],13
|
|
|
|
|
jmp .u1f
|
|
|
|
|
.spc_add:
|
|
|
|
|
cmp dword[new_spc],0 ;add spaces or text
|
|
|
|
|
jle .tex_add
|
|
|
|
|
dec dword[new_spc]
|
|
|
|
|
mov byte [edx],' '
|
|
|
|
|
jmp .u1f
|
|
|
|
|
.tex_add:
|
2014-06-27 13:52:25 +02:00
|
|
|
|
inc esi ; <20><><EFBFBD><EFBFBD>室 <20> <><E1ABA5><EFBFBD>饬<EFBFBD> <20><>⠢<EFBFBD>塞<EFBFBD><EFA5AC><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
2010-05-17 18:49:58 +02:00
|
|
|
|
dec ebx
|
|
|
|
|
.u1f:
|
|
|
|
|
add edx,sizeof.symbol
|
|
|
|
|
cmp edx,ted_tex_end
|
|
|
|
|
jge @f ;out of memory
|
|
|
|
|
cmp ebx,0
|
|
|
|
|
jne .beg_cycle
|
|
|
|
|
mov ted_ptr_free_symb,edx ;<3B><><EFBFBD>塞 㪠<><E3AAA0>⥫<EFBFBD> <20><> <><E1A2AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ண<EFBFBD> <20><><EFBFBD>᪠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jmp .add_all
|
|
|
|
|
@@:
|
|
|
|
|
cmp ted_increase_size,0
|
|
|
|
|
je .add_all
|
|
|
|
|
call ted_memory_increase
|
|
|
|
|
cmp ebx,0
|
|
|
|
|
jne .beg_cycle
|
|
|
|
|
.add_all: ;<3B><><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-17 18:49:58 +02:00
|
|
|
|
call ted_text_colored
|
2010-10-20 21:08:42 +02:00
|
|
|
|
.no_add:
|
2010-05-17 18:49:58 +02:00
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to sumbol, when insert
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; edx = new pointer to sumbol, when insert
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-05-17 18:49:58 +02:00
|
|
|
|
proc ted_memory_increase
|
|
|
|
|
cmp ted_increase_size,0
|
|
|
|
|
je @f
|
|
|
|
|
push eax ebx ecx
|
|
|
|
|
mov ecx,ted_increase_size
|
|
|
|
|
add ecx,ted_max_chars
|
|
|
|
|
mov ted_max_chars,ecx
|
|
|
|
|
imul ecx,sizeof.symbol
|
2010-06-09 22:06:03 +02:00
|
|
|
|
invoke mem.realloc, ted_tex,ecx
|
2010-05-17 18:49:58 +02:00
|
|
|
|
mov ebx,ted_tex
|
|
|
|
|
mov ted_tex,eax
|
|
|
|
|
mov ted_tex_1,eax
|
|
|
|
|
add ted_tex_1,sizeof.symbol
|
|
|
|
|
sub edx,ebx
|
|
|
|
|
add edx,eax
|
|
|
|
|
mov ted_ptr_free_symb,edx
|
|
|
|
|
add eax,ecx
|
|
|
|
|
mov ted_tex_end,eax
|
|
|
|
|
pop ecx ebx eax
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; ecx = position to free insert cell
|
|
|
|
|
; edx = pointer to sumbol, when insert
|
2011-12-15 23:00:21 +01:00
|
|
|
|
; esi = added symbol
|
2010-04-29 20:27:40 +02:00
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; ecx = position to inserted cell
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_char_add:
|
2016-02-19 17:00:48 +01:00
|
|
|
|
.loop_b:
|
|
|
|
|
cmp ecx,ted_tex_end
|
|
|
|
|
jge .end_f
|
|
|
|
|
cmp dword[ecx+10],0
|
|
|
|
|
jne @f
|
|
|
|
|
cmp dword[ecx+14],0
|
|
|
|
|
je .loop_e
|
|
|
|
|
@@:
|
|
|
|
|
add ecx,sizeof.symbol
|
|
|
|
|
jmp .loop_b
|
|
|
|
|
align 4
|
|
|
|
|
.loop_e:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
push eax ebx
|
|
|
|
|
mov eax,ted_tim_ch
|
|
|
|
|
mov dword[ecx+10],eax
|
|
|
|
|
mov ax,si
|
|
|
|
|
mov byte[ecx],al
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
call ted_get_text_arr_index ; *** eax=pos ***
|
|
|
|
|
mov [ecx+2],eax ;tex[i].perv=pos;
|
|
|
|
|
m2m dword[ecx+6],dword[edx+6] ;tex[i].next=tex[pos].next;
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
push edx
|
|
|
|
|
mov edx,ecx
|
|
|
|
|
call ted_get_text_arr_index ; *** eax=i ***
|
|
|
|
|
pop edx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mov [edx+6],eax ;tex[pos].next=i; // <20><>뫪<EFBFBD> <20><>७<EFBFBD><E0A5AD>ࠢ<EFBFBD>塞
|
|
|
|
|
mov ebx,[ecx+6]
|
|
|
|
|
ConvertIndexToPointer ebx
|
|
|
|
|
mov [ebx+2],eax ;tex[tex[i].next].perv=i; // ...
|
|
|
|
|
pop ebx eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
.end_f:
|
|
|
|
|
call ted_text_colored
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2013-11-28 11:35:07 +01:00
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD> ᬥ<><E1ACA5> <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2>
|
|
|
|
|
;input:
|
|
|
|
|
; table - ⠡<><E2A0A1><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>४<EFBFBD><E0A5AA><EFBFBD><EFBFBD><E0AEA2>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2013-11-28 11:35:07 +01:00
|
|
|
|
proc ted_but_convert_by_table uses eax edx edi esi, edit:dword, table:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov esi,[table]
|
2013-11-28 11:35:07 +01:00
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
.cycle:
|
|
|
|
|
;<3B><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4> <20><> <><E1ABA5><EFBFBD>騩 ᨬ<><E1A8AC><EFBFBD>
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov edx,[edx+6]
|
2013-11-28 11:35:07 +01:00
|
|
|
|
cmp edx,1
|
|
|
|
|
jle .end_text
|
|
|
|
|
imul edx,sizeof.symbol
|
|
|
|
|
add edx,ted_tex
|
|
|
|
|
|
|
|
|
|
movzx eax,byte[edx]
|
|
|
|
|
add eax,esi
|
|
|
|
|
mov al,byte[eax]
|
|
|
|
|
cmp al,0
|
|
|
|
|
je @f
|
|
|
|
|
mov byte[edx],al ;<3B><><EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
|
|
|
|
@@:
|
|
|
|
|
jmp .cycle
|
|
|
|
|
.end_text:
|
|
|
|
|
;cmp esi,0
|
|
|
|
|
;je @f
|
|
|
|
|
stdcall ted_draw,edi ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <20><><EFBFBD><EFBFBD>
|
|
|
|
|
;@@:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; esi = count converted symbols
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ᬥ<><E1ACA5> ॣ<><E0A5A3><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2011-12-15 23:00:21 +01:00
|
|
|
|
proc ted_convert_sel_text, conv_fun:dword
|
2019-01-21 12:39:35 +01:00
|
|
|
|
locals
|
|
|
|
|
conv_cou dd ?
|
|
|
|
|
endl
|
|
|
|
|
mov dword[conv_cou],0
|
|
|
|
|
pushad
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2019-01-21 12:39:35 +01:00
|
|
|
|
call ted_is_select
|
|
|
|
|
or al,al
|
|
|
|
|
jz .end_f
|
|
|
|
|
call ted_set_undo
|
|
|
|
|
call ted_sel_normalize
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2019-01-21 12:39:35 +01:00
|
|
|
|
mov esi,ted_seln_x0
|
|
|
|
|
mov ecx,ted_seln_y0
|
|
|
|
|
call ted_get_pos_by_coords
|
|
|
|
|
mov eax,edx
|
|
|
|
|
mov esi,ted_seln_x1
|
|
|
|
|
mov ecx,ted_seln_y1
|
|
|
|
|
call ted_get_pos_by_coords
|
|
|
|
|
;call ted_get_text_perv_pos
|
|
|
|
|
mov ebx,edx
|
|
|
|
|
|
|
|
|
|
cmp eax,ebx
|
|
|
|
|
je .end_f
|
|
|
|
|
|
|
|
|
|
inc ted_tim_ch
|
|
|
|
|
mov edx,eax ;i=p0;
|
|
|
|
|
mov ecx,ted_ptr_free_symb
|
|
|
|
|
@@:
|
|
|
|
|
push eax
|
|
|
|
|
mov al,byte[edx]
|
|
|
|
|
call dword[conv_fun] ;<3B>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
|
|
|
|
mov esi,eax
|
|
|
|
|
cmp byte[edx],al
|
|
|
|
|
pop eax
|
|
|
|
|
je .no_change
|
|
|
|
|
m2m dword [edx+14],ted_tim_ch
|
|
|
|
|
call ted_char_add ;b_pos=ted_char_add(tex[i].c^32,i,false,b_pos);
|
|
|
|
|
call ted_get_text_next_pos ;go to added symbol
|
|
|
|
|
inc dword[conv_cou]
|
|
|
|
|
.no_change:
|
|
|
|
|
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
cmp edx,ted_tex
|
|
|
|
|
je @f
|
|
|
|
|
cmp edx,ebx
|
|
|
|
|
jne @b
|
|
|
|
|
@@:
|
|
|
|
|
cmp dword[conv_cou],0
|
|
|
|
|
jne @f
|
|
|
|
|
dec ted_tim_ch
|
|
|
|
|
@@:
|
|
|
|
|
.end_f:
|
|
|
|
|
popad
|
|
|
|
|
mov esi,dword[conv_cou]
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;output:
|
|
|
|
|
; bl = 0 - no delete
|
|
|
|
|
; bl = 1 - delete
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-02-19 17:00:48 +01:00
|
|
|
|
proc ted_text_del uses ecx edx edi, edit:dword, del_opt:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov ebx,[del_opt]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
xor cl,cl
|
|
|
|
|
test ebx,ted_opt_ed_move_cursor
|
|
|
|
|
jz @f
|
|
|
|
|
call ted_cur_move_left
|
|
|
|
|
cmp dl,0
|
|
|
|
|
je .no_del
|
|
|
|
|
@@:
|
|
|
|
|
call ted_get_pos_by_cursor
|
|
|
|
|
cmp ted_gp_opt,1
|
|
|
|
|
je .no_del
|
|
|
|
|
test ebx,ted_opt_ed_change_time
|
|
|
|
|
jz @f
|
|
|
|
|
inc ted_tim_ch
|
|
|
|
|
@@:
|
|
|
|
|
m2m dword[edx+14], ted_tim_ch
|
|
|
|
|
mov cl,1
|
|
|
|
|
.no_del:
|
|
|
|
|
mov bl,cl
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; al = 1 if delete
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 㤠<><E3A4A0><EFBFBD><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_sel_text_del uses ebx ecx edx esi, del_opt:dword
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_is_select
|
2019-01-21 12:39:35 +01:00
|
|
|
|
or al,al
|
|
|
|
|
jz .end_f
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_sel_normalize
|
|
|
|
|
|
|
|
|
|
mov esi,ted_seln_x1
|
|
|
|
|
mov ecx,ted_seln_y1
|
|
|
|
|
call ted_get_pos_by_coords
|
|
|
|
|
mov ebx,edx
|
|
|
|
|
|
|
|
|
|
mov esi,ted_seln_x0
|
|
|
|
|
mov ecx,ted_seln_y0
|
|
|
|
|
call ted_get_pos_by_coords
|
|
|
|
|
|
|
|
|
|
test dword[del_opt],ted_opt_ed_change_time
|
|
|
|
|
jz @f
|
|
|
|
|
inc ted_tim_ch
|
|
|
|
|
@@:
|
|
|
|
|
cmp edx,ted_tex
|
|
|
|
|
je @f
|
|
|
|
|
cmp edx,ebx ;if(i==te)break;
|
|
|
|
|
je @f
|
|
|
|
|
m2m dword[edx+14],ted_tim_ch
|
|
|
|
|
mov esi,ted_opt_ed_change_time
|
|
|
|
|
not esi
|
|
|
|
|
and dword[del_opt],esi ;n_tim=false;
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
jmp @b
|
2016-02-19 17:00:48 +01:00
|
|
|
|
align 4
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
test dword[del_opt],ted_opt_ed_change_time
|
|
|
|
|
jz @f
|
|
|
|
|
dec ted_tim_ch
|
|
|
|
|
xor al,al
|
|
|
|
|
@@:
|
|
|
|
|
test dword[del_opt],ted_opt_ed_change_time
|
|
|
|
|
jnz @f
|
|
|
|
|
mov ecx,ted_seln_x0
|
|
|
|
|
mov edx,ted_seln_y0
|
|
|
|
|
call ted_go_to_pos
|
|
|
|
|
mov ted_sel_x0,0
|
|
|
|
|
mov ted_sel_y0,0
|
|
|
|
|
mov ted_sel_x1,0
|
|
|
|
|
mov ted_sel_y1,0
|
|
|
|
|
@@:
|
|
|
|
|
.end_f:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; eax = pointer to begin select
|
|
|
|
|
; ebx = pointer to end select
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_revers:
|
2016-01-21 23:22:11 +01:00
|
|
|
|
cmp eax,ebx
|
|
|
|
|
jne @f
|
|
|
|
|
ret
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
push ecx edx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
mov edx,ted_tex_1
|
|
|
|
|
cmp edx,ebx ;if(p1==1)p1=tex[1].perv;
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_get_text_perv_pos
|
|
|
|
|
mov ebx,edx
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
push esi
|
|
|
|
|
mov edx,[eax+2] ; *** edx = tex[p0].perv ***
|
|
|
|
|
ConvertIndexToPointer edx
|
|
|
|
|
add edx,6
|
|
|
|
|
mov ecx,[edx] ;tmp = tex[tex[p0].perv].next;
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
mov esi,[ebx+6] ; *** esi = tex[p1].next ***
|
|
|
|
|
ConvertIndexToPointer esi
|
|
|
|
|
add esi,2
|
|
|
|
|
m2m dword[edx],dword[esi] ;tex[tex[p0].perv].next = tex[tex[p1].next].perv;
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
mov [esi],ecx ;tex[tex[p1].next].perv = tmp;
|
|
|
|
|
pop esi
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
mov ecx,[eax+2] ;tmp = tex[p0].perv;
|
|
|
|
|
m2m dword[eax+2],dword[ebx+6] ;tex[p0].perv = tex[p1].next;
|
|
|
|
|
mov [ebx+6],ecx ;tex[p1].next = tmp;
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
mov edx,eax ;i=p0;
|
|
|
|
|
@@:
|
|
|
|
|
mov ecx,[edx+6] ;tmp = tex[i].next;
|
|
|
|
|
m2m dword[edx+6],dword[edx+2] ;tex[i].next = tex[i].perv;
|
|
|
|
|
mov [edx+2],ecx ;tex[i].perv = tmp;
|
|
|
|
|
cmp edx,ebx ;if(i==p1)break;
|
|
|
|
|
je @f
|
2010-04-29 20:27:40 +02:00
|
|
|
|
; ---
|
|
|
|
|
;cmp edx,ted_tex
|
|
|
|
|
;je @f
|
|
|
|
|
; ---
|
2016-01-21 23:22:11 +01:00
|
|
|
|
mov edx,ecx ;i = tmp;
|
|
|
|
|
ConvertIndexToPointer edx
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
pop edx ecx
|
|
|
|
|
call ted_text_colored
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; dl = 0 not move
|
|
|
|
|
; dl = 2 if move up
|
|
|
|
|
; dl = 8 if scroll move up
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_cur_move_up:
|
|
|
|
|
cmp ted_cur_y,0
|
|
|
|
|
je @f
|
|
|
|
|
dec ted_cur_y
|
|
|
|
|
mov dl,2
|
|
|
|
|
ret
|
|
|
|
|
@@:
|
|
|
|
|
push eax
|
|
|
|
|
mov eax,ted_scr_w
|
|
|
|
|
cmp dword[eax+sb_offs_position],0
|
|
|
|
|
je @f
|
|
|
|
|
dec dword[eax+sb_offs_position]
|
|
|
|
|
mov dl,8
|
|
|
|
|
jmp .ret_f
|
|
|
|
|
@@:
|
|
|
|
|
mov dl,0
|
|
|
|
|
.ret_f:
|
|
|
|
|
pop eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; dl = 0 not move
|
|
|
|
|
; dl = 2 if move down
|
|
|
|
|
; dl = 8 if scroll move down
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_cur_move_down:
|
|
|
|
|
push eax ebx
|
|
|
|
|
mov ebx,ted_scr_w
|
2018-10-21 22:10:31 +02:00
|
|
|
|
xor dl,dl
|
|
|
|
|
mov eax,[ebx+sb_offs_cur_area]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
dec eax
|
|
|
|
|
cmp ted_cur_y,eax
|
|
|
|
|
jge @f
|
|
|
|
|
inc ted_cur_y
|
|
|
|
|
mov dl,2
|
|
|
|
|
jmp .ret_f
|
|
|
|
|
@@:
|
|
|
|
|
mov eax,ted_cur_y
|
2018-10-21 22:10:31 +02:00
|
|
|
|
add eax,[ebx+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
inc eax
|
2018-10-21 22:10:31 +02:00
|
|
|
|
cmp [ebx+sb_offs_max_area],eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jle @f
|
|
|
|
|
inc dword[ebx+sb_offs_position]
|
|
|
|
|
mov dl,8
|
|
|
|
|
@@:
|
|
|
|
|
.ret_f:
|
|
|
|
|
pop ebx eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; dl = 0 not move
|
|
|
|
|
; dl = 1 if move up
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_cur_move_page_up:
|
2018-10-21 22:10:31 +02:00
|
|
|
|
push eax ebx
|
|
|
|
|
mov ebx,ted_scr_w
|
|
|
|
|
mov eax,[ebx+sb_offs_cur_area]
|
|
|
|
|
xor dl,dl
|
|
|
|
|
cmp eax,[ebx+sb_offs_position]
|
|
|
|
|
jg @f
|
|
|
|
|
sub [ebx+sb_offs_position],eax
|
|
|
|
|
mov dl,1
|
|
|
|
|
@@:
|
|
|
|
|
cmp dword[ebx+sb_offs_position],0
|
|
|
|
|
je @f
|
|
|
|
|
cmp dl,1
|
|
|
|
|
je @f
|
|
|
|
|
mov dword[ebx+sb_offs_position],0
|
|
|
|
|
mov dl,1
|
|
|
|
|
@@:
|
|
|
|
|
pop ebx eax
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_cur_move_page_down:
|
|
|
|
|
push eax ebx ecx
|
|
|
|
|
mov ecx,ted_scr_w
|
|
|
|
|
|
|
|
|
|
xor dl,dl
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov eax,[ecx+sb_offs_max_area]
|
|
|
|
|
sub eax,[ecx+sb_offs_cur_area]
|
|
|
|
|
cmp [ecx+sb_offs_position],eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jge @f
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov ebx,[ecx+sb_offs_cur_area]
|
|
|
|
|
add [ecx+sb_offs_position],ebx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov dl,1
|
|
|
|
|
mov dword[ecx+sb_offs_redraw],1
|
2018-10-21 22:10:31 +02:00
|
|
|
|
cmp [ecx+sb_offs_position],eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jle @f
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov [ecx+sb_offs_position],eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
pop ecx ebx eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; dl = 0 not move
|
|
|
|
|
; dl = 1 if move left
|
|
|
|
|
; dl = 3 if move left and up
|
|
|
|
|
; dl = 8 if scroll move up
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_cur_move_left:
|
|
|
|
|
cmp ted_cur_x,0
|
|
|
|
|
je @f
|
|
|
|
|
dec ted_cur_x
|
|
|
|
|
mov dl,1
|
|
|
|
|
ret
|
|
|
|
|
@@:
|
|
|
|
|
push eax
|
|
|
|
|
mov eax,ted_scr_h
|
|
|
|
|
cmp dword[eax+sb_offs_position],0
|
|
|
|
|
je @f
|
|
|
|
|
dec dword[eax+sb_offs_position]
|
|
|
|
|
mov dl,8
|
|
|
|
|
jmp .ret_f
|
|
|
|
|
@@:
|
|
|
|
|
cmp ted_cur_y,0
|
|
|
|
|
jne @f
|
|
|
|
|
mov eax,ted_scr_w
|
|
|
|
|
mov dl,0
|
|
|
|
|
cmp dword[eax+sb_offs_position],0
|
|
|
|
|
je .ret_f
|
|
|
|
|
dec dword[eax+sb_offs_position]
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
call ted_cur_move_x_last_char
|
|
|
|
|
mov dl,8
|
|
|
|
|
jmp .ret_f
|
|
|
|
|
@@:
|
|
|
|
|
cmp ted_cur_y,0
|
|
|
|
|
je @f
|
|
|
|
|
dec ted_cur_y
|
|
|
|
|
call ted_cur_move_x_last_char
|
|
|
|
|
cmp dl,8
|
|
|
|
|
je .ret_f
|
|
|
|
|
mov dl,3
|
|
|
|
|
jmp .ret_f
|
|
|
|
|
@@:
|
|
|
|
|
mov dl,0
|
|
|
|
|
.ret_f:
|
|
|
|
|
pop eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_cur_move_right:
|
|
|
|
|
push eax ebx
|
|
|
|
|
mov eax,ted_scr_h
|
|
|
|
|
xor dl,dl
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov ebx,[eax+sb_offs_cur_area]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp ted_cur_x,ebx
|
|
|
|
|
jge @f
|
|
|
|
|
inc ted_cur_x
|
|
|
|
|
mov dl,1
|
|
|
|
|
jmp .ret_f
|
|
|
|
|
@@:
|
|
|
|
|
inc dword[eax+sb_offs_position]
|
|
|
|
|
mov dl,8
|
|
|
|
|
.ret_f:
|
|
|
|
|
pop ebx eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_cur_move_x_last_char:
|
|
|
|
|
;[hScr.position]
|
|
|
|
|
;[hScr.cur_area]
|
|
|
|
|
;dl-???
|
|
|
|
|
push eax ebx ecx
|
|
|
|
|
mov eax,ted_cur_y
|
|
|
|
|
mov ecx,ted_scr_w
|
2018-10-21 22:10:31 +02:00
|
|
|
|
add eax,[ecx+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_strlen
|
|
|
|
|
xor dl,dl
|
|
|
|
|
|
|
|
|
|
mov ecx,ted_scr_h
|
2018-10-21 22:10:31 +02:00
|
|
|
|
cmp ebx,[ecx+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jge @f
|
|
|
|
|
mov dl,8
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov [ecx+sb_offs_position],ebx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
2018-10-21 22:10:31 +02:00
|
|
|
|
sub ebx,[ecx+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2018-10-21 22:10:31 +02:00
|
|
|
|
cmp ebx,[ecx+sb_offs_cur_area]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jle @f ; b---[---]---e
|
2018-10-21 22:10:31 +02:00
|
|
|
|
add [ecx+sb_offs_position],ebx
|
|
|
|
|
mov ebx,[ecx+sb_offs_cur_area]
|
|
|
|
|
sub [ecx+sb_offs_position],ebx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov dl,8
|
|
|
|
|
@@:
|
|
|
|
|
mov ted_cur_x,ebx
|
|
|
|
|
pop ecx ebx eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; dl = 0 not move
|
|
|
|
|
; dl = 1 move cursor
|
|
|
|
|
; dl = 8 move cursor and scroll
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_cur_move_x_first_char:
|
|
|
|
|
xor dl,dl
|
|
|
|
|
cmp ted_cur_x,0
|
|
|
|
|
je @f
|
|
|
|
|
mov ted_cur_x,0
|
|
|
|
|
mov dl,1
|
|
|
|
|
@@:
|
|
|
|
|
push eax
|
|
|
|
|
mov eax,ted_scr_h
|
|
|
|
|
cmp dword[eax+sb_offs_position],0
|
|
|
|
|
je @f
|
|
|
|
|
mov dword[eax+sb_offs_position],0
|
|
|
|
|
mov dl,8
|
|
|
|
|
@@:
|
|
|
|
|
pop eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to symbol struct
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; eax = array index
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_get_text_arr_index:
|
|
|
|
|
push ecx edx
|
|
|
|
|
mov eax,edx
|
|
|
|
|
sub eax,ted_tex
|
|
|
|
|
xor edx,edx
|
|
|
|
|
mov ecx,sizeof.symbol
|
|
|
|
|
div ecx
|
|
|
|
|
pop edx ecx
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to symbol struct
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; edx = pointer to 'perv' struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_get_text_perv_pos:
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov edx,[edx+2]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
imul edx,sizeof.symbol
|
|
|
|
|
add edx,ted_tex
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to symbol struct
|
|
|
|
|
;output:
|
|
|
|
|
; edx = pointer to 'next' symbol struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_get_text_next_pos:
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov edx,[edx+6]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
imul edx,sizeof.symbol
|
|
|
|
|
add edx,ted_tex
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; edx = symbol under cursor
|
|
|
|
|
; ted_gp_opt = 1,2
|
|
|
|
|
; edx = tex[1].perv if error
|
|
|
|
|
; ted_gp_opt = 0
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_get_pos_by_cursor:
|
|
|
|
|
push eax ecx esi
|
|
|
|
|
mov esi,ted_cur_x
|
|
|
|
|
mov eax,ted_scr_h
|
2018-10-21 22:10:31 +02:00
|
|
|
|
add esi,[eax+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov ecx,ted_cur_y
|
|
|
|
|
mov eax,ted_scr_w
|
2018-10-21 22:10:31 +02:00
|
|
|
|
add ecx,[eax+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_get_pos_by_coords
|
|
|
|
|
pop esi ecx eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; esi = XPos
|
|
|
|
|
; ecx = YPos
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; edx = symbol under cursor
|
|
|
|
|
; ted_gp_opt = 1 if found text line
|
|
|
|
|
; ted_gp_opt = 2 if found text line and column
|
|
|
|
|
; edx = tex[1] if error
|
|
|
|
|
; ted_gp_opt = 0 if text no found
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_get_pos_by_coords:
|
|
|
|
|
push eax ;Row
|
|
|
|
|
push ebx ;Col
|
|
|
|
|
|
|
|
|
|
xor eax,eax
|
|
|
|
|
xor ebx,ebx
|
|
|
|
|
mov ted_gp_opt,0
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
@@:
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
cmp ebx,esi
|
|
|
|
|
jne .u1_0 ;Col <> ted_cur_x
|
|
|
|
|
mov ted_gp_opt,1
|
|
|
|
|
cmp eax,ecx
|
|
|
|
|
jge @f ; Row >= ted_cur_y
|
|
|
|
|
.u1_0:
|
|
|
|
|
mov ted_gp_opt,0
|
|
|
|
|
inc ebx
|
|
|
|
|
cmp byte [edx],13
|
|
|
|
|
jne @b
|
|
|
|
|
cmp eax,ecx
|
|
|
|
|
jge @f ; Row >= ted_cur_y
|
|
|
|
|
inc eax
|
|
|
|
|
xor ebx,ebx
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
cmp eax,ecx
|
|
|
|
|
jne @f ; Row = ted_cur_y
|
|
|
|
|
inc ted_gp_opt
|
|
|
|
|
@@:
|
|
|
|
|
cmp ted_gp_opt,0
|
|
|
|
|
jne @f
|
|
|
|
|
mov edx,ted_tex_1
|
|
|
|
|
;call ted_get_text_perv_pos
|
|
|
|
|
@@:
|
|
|
|
|
pop ebx eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; eax = Row
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; ebx = str len
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_strlen:
|
|
|
|
|
push edx ecx
|
|
|
|
|
;ecx = Row, from cycle
|
|
|
|
|
|
|
|
|
|
xor ebx,ebx
|
|
|
|
|
xor ecx,ecx
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
@@:
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
inc ebx
|
|
|
|
|
cmp byte [edx],13
|
|
|
|
|
jne @b
|
|
|
|
|
dec ebx ;lenght minus 1 sumbol to paragraph
|
|
|
|
|
cmp eax,ecx
|
|
|
|
|
je @f
|
|
|
|
|
xor ebx,ebx
|
|
|
|
|
inc ecx
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
cmp eax,ecx
|
|
|
|
|
je @f
|
|
|
|
|
xor ebx,ebx
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
pop ecx edx
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = symbol position
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; eax = number of line
|
|
|
|
|
; ebx = symbol position in line
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_get_text_coords:
|
|
|
|
|
push edx
|
|
|
|
|
xor eax,eax
|
|
|
|
|
xor ebx,ebx
|
|
|
|
|
@@:
|
|
|
|
|
call ted_iterat_perv
|
|
|
|
|
|
|
|
|
|
cmp eax,0
|
|
|
|
|
jne .no_col_mov
|
|
|
|
|
inc ebx
|
|
|
|
|
.no_col_mov:
|
|
|
|
|
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
cmp byte [edx],13
|
|
|
|
|
jne @b
|
|
|
|
|
inc eax
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
dec ebx
|
|
|
|
|
pop edx
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; eax = num lines
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_get_num_lines:
|
2016-01-21 23:22:11 +01:00
|
|
|
|
push edx
|
|
|
|
|
mov eax,1
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
@@:
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
cmp byte [edx],13
|
|
|
|
|
jne @b
|
|
|
|
|
inc eax
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
;...
|
|
|
|
|
;dec eax
|
2016-01-21 23:22:11 +01:00
|
|
|
|
pop edx
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;description:
|
|
|
|
|
; <20>⬥<EFBFBD><E2ACA5><EFBFBD><EFBFBD> <20>⬥<EFBFBD><E2ACA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⢨<EFBFBD>, <20><>। <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_set_undo
|
2012-02-13 12:46:40 +01:00
|
|
|
|
mov ted_drag_k,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cmp ted_tim_undo,1
|
|
|
|
|
jl .no_work
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2012-02-13 12:46:40 +01:00
|
|
|
|
push eax ebx edx
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
call ted_get_text_next_pos ;long i=tex[0].next;
|
|
|
|
|
mov eax,ted_tim_undo
|
|
|
|
|
sub ted_tim_ch,eax ;ted_tim_ch-=ted_tim_undo;
|
|
|
|
|
mov eax,ted_tim_ch
|
|
|
|
|
cmp ted_tim_ls,eax ;if(ted_tim_ls>ted_tim_ch)
|
|
|
|
|
jle @f
|
|
|
|
|
mov ted_tim_ls,0
|
|
|
|
|
@@:
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2012-02-13 12:46:40 +01:00
|
|
|
|
;if(tex[i].tc>ted_tim_ch){ // <20> ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20>뫮 <20>⬥<EFBFBD><E2ACA5><EFBFBD><EFBFBD>
|
2017-09-30 20:05:24 +02:00
|
|
|
|
cmp [edx+symbol.tc],eax
|
2012-02-13 12:46:40 +01:00
|
|
|
|
jle .no_u1
|
2017-09-30 20:05:24 +02:00
|
|
|
|
mov dword [edx+symbol.tc],0
|
|
|
|
|
mov dword [edx+symbol.td],0
|
2012-02-13 12:46:40 +01:00
|
|
|
|
|
2017-09-30 20:05:24 +02:00
|
|
|
|
mov ebx,[edx+symbol.perv]
|
2012-02-13 12:46:40 +01:00
|
|
|
|
imul ebx,sizeof.symbol
|
|
|
|
|
add ebx,ted_tex ;ebx=tex[i].perv
|
2017-09-30 20:05:24 +02:00
|
|
|
|
m2m dword [ebx+symbol.next],dword [edx+symbol.next] ;tex[tex[i].perv].next=tex[i].next;
|
2012-02-13 12:46:40 +01:00
|
|
|
|
|
2017-09-30 20:05:24 +02:00
|
|
|
|
mov ebx,[edx+symbol.next]
|
2012-02-13 12:46:40 +01:00
|
|
|
|
imul ebx,sizeof.symbol
|
|
|
|
|
add ebx,ted_tex ;ebx=tex[i].next
|
2017-09-30 20:05:24 +02:00
|
|
|
|
m2m dword [ebx+symbol.perv],dword [edx+symbol.perv] ;tex[tex[i].next].perv=tex[i].perv;
|
2012-02-13 12:46:40 +01:00
|
|
|
|
|
|
|
|
|
cmp ted_ptr_free_symb,edx
|
|
|
|
|
jle .no_cor_free
|
|
|
|
|
mov ted_ptr_free_symb,edx ;<3B><><EFBFBD>塞 㪠<><E3AAA0>⥫<EFBFBD> <20><> <><E1A2AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ண<EFBFBD> <20><><EFBFBD>᪠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
.no_cor_free:
|
|
|
|
|
mov edx,ebx ;<3B><>⨬<EFBFBD><E2A8AC><EFBFBD><EFBFBD>㥬 <20><> <><E1AAAE><EFBFBD><EFBFBD><EFBFBD> (edx <20><> <20>맮<EFBFBD><EBA7AE> ted_get_text_next_pos <20>㤥<EFBFBD> ࠢ<><E0A0A2> ebx)
|
|
|
|
|
jmp @b
|
|
|
|
|
.no_u1:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2012-02-13 12:46:40 +01:00
|
|
|
|
;else if(tex[i].td>ted_tim_ch) tex[i].td=0; // <20> 㤠<><E3A4A0><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20>뫮 <20>⬥<EFBFBD><E2ACA5><EFBFBD><EFBFBD>
|
2017-09-30 20:05:24 +02:00
|
|
|
|
cmp [edx+symbol.td],eax
|
2012-02-13 12:46:40 +01:00
|
|
|
|
jle .no_u2
|
2017-09-30 20:05:24 +02:00
|
|
|
|
mov dword [edx+symbol.td],0
|
2012-02-13 12:46:40 +01:00
|
|
|
|
.no_u2:
|
|
|
|
|
|
|
|
|
|
call ted_get_text_next_pos
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
mov ted_tim_undo,0
|
|
|
|
|
mov eax,ted_tim_co
|
|
|
|
|
cmp ted_tim_ch,eax
|
|
|
|
|
jge @f
|
|
|
|
|
mov ted_tim_co,0
|
|
|
|
|
@@:
|
|
|
|
|
pop edx ebx eax
|
|
|
|
|
.no_work:
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; ecx = Col
|
|
|
|
|
; edx = Row
|
|
|
|
|
; edi = pointer to tedit struct
|
2019-01-21 12:39:35 +01:00
|
|
|
|
;output:
|
|
|
|
|
; ecx = cursor x
|
|
|
|
|
; edx = cursor y
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_go_to_pos:
|
2019-01-21 12:39:35 +01:00
|
|
|
|
push eax ebx
|
|
|
|
|
mov eax,ted_scr_h
|
|
|
|
|
sub ecx,[eax+sb_offs_position]
|
|
|
|
|
cmp ecx,0 ;ted_cur_y < 0
|
|
|
|
|
jge @f
|
|
|
|
|
add [eax+sb_offs_position],ecx ;<3B>ப<EFBFBD><E0AEAA>⪠ <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
xor ecx,ecx
|
|
|
|
|
@@:
|
|
|
|
|
mov ebx,5 ;5 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5>
|
|
|
|
|
cmp ecx,ebx
|
|
|
|
|
jge .end0
|
|
|
|
|
sub ebx,ecx ;ebx - <20><> <>쪮 ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20>㦭<EFBFBD> ᤢ<><E1A4A2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cmp [eax+sb_offs_position],ebx
|
|
|
|
|
jge @f
|
|
|
|
|
add ecx,[eax+sb_offs_position]
|
|
|
|
|
mov dword[eax+sb_offs_position],0
|
|
|
|
|
jmp .end0
|
|
|
|
|
@@:
|
|
|
|
|
sub [eax+sb_offs_position],ebx
|
|
|
|
|
add ecx,ebx
|
|
|
|
|
.end0:
|
|
|
|
|
cmp ecx,[eax+sb_offs_cur_area] ;ted_cur_x > [.cur_area]
|
|
|
|
|
jl .end1
|
|
|
|
|
mov ebx,ecx
|
|
|
|
|
sub ebx,[eax+sb_offs_cur_area]
|
|
|
|
|
inc ebx
|
|
|
|
|
add [eax+sb_offs_position],ebx ;<3B>ப<EFBFBD><E0AEAA>⪠ <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD> <20><>ࠢ<EFBFBD>
|
|
|
|
|
sub ecx,ebx
|
|
|
|
|
.end1:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov ted_cur_x,ecx
|
|
|
|
|
|
2019-01-21 12:39:35 +01:00
|
|
|
|
mov eax,ted_scr_w
|
|
|
|
|
sub edx,[eax+sb_offs_position]
|
|
|
|
|
cmp edx,0 ;ted_cur_y < 0
|
|
|
|
|
jge @f
|
|
|
|
|
add [eax+sb_offs_position],edx ;<3B>ப<EFBFBD><E0AEAA>⪠ <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
xor edx,edx
|
|
|
|
|
jmp .end2
|
|
|
|
|
@@:
|
2018-10-21 22:10:31 +02:00
|
|
|
|
cmp edx,[eax+sb_offs_cur_area] ;ted_cur_y > [.cur_area]
|
2019-01-21 12:39:35 +01:00
|
|
|
|
jl .end2
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov ebx,edx
|
2018-10-21 22:10:31 +02:00
|
|
|
|
sub ebx,[eax+sb_offs_cur_area]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
inc ebx
|
2019-01-21 12:39:35 +01:00
|
|
|
|
add [eax+sb_offs_position],ebx ;<3B>ப<EFBFBD><E0AEAA>⪠ <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
sub edx,ebx
|
2019-01-21 12:39:35 +01:00
|
|
|
|
.end2:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov ted_cur_y,edx
|
2019-01-21 12:39:35 +01:00
|
|
|
|
pop ebx eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_text_colored:
|
|
|
|
|
push eax edx
|
|
|
|
|
mov eax,ted_tim_ch
|
|
|
|
|
sub eax,ted_tim_undo
|
|
|
|
|
mov ted_tim_co,eax
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
@@:
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
mov byte[edx+1],0
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
cmp ted_key_words_count,1
|
|
|
|
|
jl .no_colors
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
@@:
|
|
|
|
|
call ted_text_find_sel_color
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle .no_colors
|
|
|
|
|
jmp @b
|
|
|
|
|
.no_colors:
|
|
|
|
|
pop edx eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to start symbol
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; edx = pointer to next symbol
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>᪠ <20> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ᢥ祭<E1A2A5><E7A5AD> <>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-20 19:34:38 +01:00
|
|
|
|
proc ted_text_find_sel_color uses eax ebx ecx esi
|
2010-04-29 20:27:40 +02:00
|
|
|
|
locals
|
2016-01-20 19:34:38 +01:00
|
|
|
|
begPos dd ? ;<3B><>砫쭠<E7A0AB> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
endPos dd ? ;<3B><><EFBFBD><EFBFBD>筠<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
find db ? ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> / <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
f_color db ? ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥<><E6A2A5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1ABAE>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endl
|
|
|
|
|
;eax = word_n ⥪<>騩 <20><><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><EFBFBD><E0AEA2>塞<EFBFBD><EFA5AC><EFBFBD> <><E1ABAE> <20> ᯨ᪥
|
|
|
|
|
;ebx = <20><><EFBFBD> ࠧ<><E0A0A7><EFBFBD> 楫<><E6A5AB>
|
|
|
|
|
;ecx = l_pos <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD>室<EFBFBD>饣<EFBFBD> <><E1ABAE> <20> ᯨ᪥
|
|
|
|
|
;esi = <20><><EFBFBD> ࠧ<><E0A0A7><EFBFBD> 楫<><E6A5AB>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA2>塞<EFBFBD><EFA5AC><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20> <><E1ABAE>
|
2016-01-20 19:34:38 +01:00
|
|
|
|
mov dword[begPos],1
|
|
|
|
|
mov dword[endPos],1
|
|
|
|
|
mov byte[find],0
|
|
|
|
|
mov byte[f_color],1
|
|
|
|
|
@@:
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-20 19:34:38 +01:00
|
|
|
|
xor eax,eax
|
|
|
|
|
mov al,byte[edx]
|
|
|
|
|
shl ax,2 ;eax*=4
|
|
|
|
|
add eax,ted_arr_key_pos
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov eax,[eax]
|
2016-01-20 19:34:38 +01:00
|
|
|
|
cmp eax,0
|
|
|
|
|
jl @b ;if( (word_n=ted_arr_key_pos[(unsigned char)tex[i].c])>-1 ){
|
|
|
|
|
|
|
|
|
|
mov ecx,eax
|
|
|
|
|
;while(l_pos<ted_key_words_count && Col[l_pos].Text[0]==Col[word_n].Text[0])
|
|
|
|
|
.wh_1b:
|
|
|
|
|
cmp ecx,ted_key_words_count
|
|
|
|
|
jge .wh_1e
|
|
|
|
|
ColToIndexOffset ecx,esi
|
|
|
|
|
mov bl,byte[esi]
|
|
|
|
|
ColToIndexOffset eax,esi
|
|
|
|
|
cmp bl,byte[esi]
|
|
|
|
|
jne .wh_1e
|
|
|
|
|
inc ecx
|
|
|
|
|
jmp .wh_1b
|
|
|
|
|
.wh_1e:
|
|
|
|
|
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov [begPos],edx ;bP=i;
|
2016-01-20 19:34:38 +01:00
|
|
|
|
mov esi,1
|
|
|
|
|
align 4
|
|
|
|
|
.wh_2b: ;while(1){
|
|
|
|
|
call ted_iterat_next
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-20 19:34:38 +01:00
|
|
|
|
;while(l_pos>word_n && Col[l_pos-1].Text[pos]!=tex[i].c)
|
|
|
|
|
.wh_3b:
|
|
|
|
|
cmp ecx,eax
|
|
|
|
|
jle .wh_3e
|
|
|
|
|
dec ecx
|
|
|
|
|
ColToIndexOffset ecx,ebx
|
|
|
|
|
inc ecx
|
|
|
|
|
;cmp byte[ebx+esi],byte[edx]
|
|
|
|
|
mov bl,byte[ebx+esi]
|
|
|
|
|
cmp bl,byte[edx]
|
|
|
|
|
je .wh_3e
|
|
|
|
|
dec ecx
|
|
|
|
|
jmp .wh_3b
|
|
|
|
|
.wh_3e:
|
|
|
|
|
|
|
|
|
|
ColToIndexOffset eax,ebx
|
|
|
|
|
cmp byte[ebx+esi],0
|
|
|
|
|
jne .if_0 ;if(Col[word_n].Text[pos]==0){
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov [endPos],edx ;eP=i;
|
2016-01-20 19:34:38 +01:00
|
|
|
|
ColToIndexOffset eax,ebx
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov bl,[ebx+MAX_COLOR_WORD_LEN+7]
|
|
|
|
|
mov [f_color],bl ;f_color=Col[word_n].color;
|
2016-01-20 19:34:38 +01:00
|
|
|
|
|
|
|
|
|
mov byte[find],1
|
|
|
|
|
ColToIndexOffset eax,ebx ;... ebx = Col[word_n]
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov bl,[ebx+MAX_COLOR_WORD_LEN+4]
|
2016-01-20 19:34:38 +01:00
|
|
|
|
cmp bl,0 ;if(Col[word_n].wwo)
|
|
|
|
|
je .if_2n
|
|
|
|
|
push edx
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov edx,[begPos]
|
2016-01-20 19:34:38 +01:00
|
|
|
|
call ted_iterat_perv
|
|
|
|
|
|
|
|
|
|
btr bx,0 ;1-1
|
|
|
|
|
jae .if_3e ;if(Col[word_n].wwo&1)
|
|
|
|
|
;u1= !(isalnum(cont_s)||cont_s=='_')
|
|
|
|
|
call isalnum
|
|
|
|
|
jae .if_3e
|
|
|
|
|
mov byte[find],0
|
|
|
|
|
jmp .if_4e
|
|
|
|
|
.if_3e:
|
|
|
|
|
|
|
|
|
|
btr bx,3 ;4-1
|
|
|
|
|
jae .if_4e ;if(Col[word_n].wwo&8)
|
|
|
|
|
;u1= !isalpha(cont_s);
|
|
|
|
|
call isalpha
|
|
|
|
|
jae .if_4e
|
|
|
|
|
mov byte[find],0
|
|
|
|
|
.if_4e:
|
|
|
|
|
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov edx,[endPos]
|
2016-01-20 19:34:38 +01:00
|
|
|
|
;call ted_iterat_next
|
|
|
|
|
|
|
|
|
|
btr bx,1 ;2-1
|
|
|
|
|
jae .if_5e ;if(Col[word_n].wwo&2)
|
|
|
|
|
;u1= !(isalnum(cont_s)||cont_s=='_')
|
|
|
|
|
call isalnum
|
|
|
|
|
jae .if_5e
|
|
|
|
|
mov byte[find],0
|
|
|
|
|
jmp .if_6e
|
|
|
|
|
.if_5e:
|
|
|
|
|
|
|
|
|
|
btr bx,4 ;5-1
|
|
|
|
|
jae .if_6e ;if(Col[word_n].wwo&16)
|
|
|
|
|
;u1= !isalpha(cont_s);
|
|
|
|
|
call isalpha
|
|
|
|
|
jae .if_6e
|
|
|
|
|
mov byte[find],0
|
|
|
|
|
.if_6e:
|
|
|
|
|
|
|
|
|
|
btr bx,2 ;3-1
|
|
|
|
|
jae .if_7e ;if(Col[word_n].wwo&4)
|
|
|
|
|
ColToIndexOffset eax,ebx
|
|
|
|
|
mov bx,word[ebx+MAX_COLOR_WORD_LEN+5]
|
|
|
|
|
call ted_iterat_next_pos_char
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle .if_7e
|
|
|
|
|
mov dword[endPos],edx
|
|
|
|
|
.if_7e:
|
|
|
|
|
|
|
|
|
|
pop edx
|
|
|
|
|
.if_2n:
|
|
|
|
|
;if(i!=1){ // <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD>
|
|
|
|
|
; cont_s=tex[eP].c;
|
|
|
|
|
; if(Col[word_n].wwo&2) u2= !(isalnum(cont_s)||cont_s=='_'); // <20><> <20>㪢.-<2D><><EFBFBD><EFBFBD>. ᨬ<><E1A8AC><EFBFBD>
|
|
|
|
|
; if(u2 && Col[word_n].wwo&16) u2= !isalpha(cont_s); // <20><> <20><><EFBFBD><EFBFBD>. ᨬ<><E1A8AC><EFBFBD>
|
|
|
|
|
; if(Col[word_n].wwo&4) eP=ted_iterat_next_pos_char(eP,Col[word_n].endc);
|
|
|
|
|
|
|
|
|
|
cmp eax,ecx
|
|
|
|
|
je .wh_2e ;if(word_n==l_pos) break; // do double - <20> <><E1ABAE> <20><>筮 <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD>
|
|
|
|
|
.if_0:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-20 19:34:38 +01:00
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle .wh_2e ;if(i==1) break;
|
|
|
|
|
|
|
|
|
|
;while(l_pos>word_n && Col[word_n].Text[pos]!=tex[i].c)
|
|
|
|
|
.wh_4b:
|
|
|
|
|
cmp ecx,eax
|
|
|
|
|
jle .wh_4e
|
|
|
|
|
ColToIndexOffset eax,ebx
|
|
|
|
|
;cmp byte[ebx+esi],byte[edx]
|
|
|
|
|
mov bl,byte[ebx+esi]
|
|
|
|
|
cmp bl,byte[edx]
|
|
|
|
|
je .wh_4e
|
|
|
|
|
inc eax
|
|
|
|
|
jmp .wh_4b
|
|
|
|
|
.wh_4e:
|
|
|
|
|
|
|
|
|
|
cmp eax,ecx
|
|
|
|
|
je .wh_2e;if(word_n==l_pos) break;
|
|
|
|
|
inc esi ;pos++;
|
|
|
|
|
jmp .wh_2b
|
|
|
|
|
.wh_2e:
|
|
|
|
|
|
|
|
|
|
cmp byte[find],1 ;if(fnd)break;
|
|
|
|
|
je @f
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov edx,[begPos];i=bP;
|
2016-01-20 19:34:38 +01:00
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-20 19:34:38 +01:00
|
|
|
|
cmp byte[find],1
|
|
|
|
|
jne .if_1e ;if(fnd){ // <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
|
|
|
|
;if(!mode_sf1 || (mode_sf1 && strlen(Col[word_n].f1->c_str())>0)){
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov eax,[begPos]
|
|
|
|
|
mov bl,[f_color]
|
|
|
|
|
mov [eax+1],bl ;tex[bP].col=f_color;
|
|
|
|
|
mov eax,[endPos]
|
2016-01-20 19:34:38 +01:00
|
|
|
|
mov byte[eax+1],0xff ;tex[eP].col=255;
|
|
|
|
|
;return ItPoPerv(eP); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>宦<EFBFBD><E5AEA6><EFBFBD><EFBFBD><EFBFBD>
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov edx,[endPos]
|
2016-01-20 19:34:38 +01:00
|
|
|
|
call ted_get_text_perv_pos
|
|
|
|
|
jmp @f
|
|
|
|
|
.if_1e:
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-20 19:34:38 +01:00
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to char (byte)
|
|
|
|
|
;output:
|
|
|
|
|
; cf=1 if symbol is...
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-20 19:34:38 +01:00
|
|
|
|
tab_all_num db 0,0,0,0,0,0,0xff,11b,11111110b,0xff,0xff,10000111b,11111110b,0xff,0xff,111b,0,0,0,0,0,0,0,0;,0,0,0,0,0,0,0,0 - tab_alpha_0,0,0,0,0,0,0,0
|
|
|
|
|
tab_alpha db 0,0,0,0,0,0,0,0,11111110b,0xff,0xff,10000111b,11111110b,0xff,0xff,111b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-20 19:34:38 +01:00
|
|
|
|
;output:
|
|
|
|
|
; cf=1 <20> <20> [edx] <20>㪢<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> '_'
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
isalnum:
|
2016-01-20 19:34:38 +01:00
|
|
|
|
push eax ebx
|
|
|
|
|
movzx eax,byte[edx] ;al=offset
|
|
|
|
|
shr eax,3
|
|
|
|
|
lea ebx,[tab_all_num]
|
|
|
|
|
add ebx,eax
|
|
|
|
|
movzx ax,byte[edx] ;al=bit
|
|
|
|
|
and ax,111b
|
|
|
|
|
bt word[ebx],ax
|
|
|
|
|
pop ebx eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;output:
|
|
|
|
|
; cf=1 <20> <20> [edx] <20>㪢<EFBFBD> <20><><EFBFBD> '_'
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
isalpha:
|
2016-01-20 19:34:38 +01:00
|
|
|
|
push eax ebx
|
|
|
|
|
movzx eax,byte[edx] ;al=offset
|
|
|
|
|
shr eax,3
|
|
|
|
|
lea ebx,[tab_alpha]
|
|
|
|
|
add ebx,eax
|
|
|
|
|
movzx ax,byte[edx] ;al=bit
|
|
|
|
|
and ax,111b
|
|
|
|
|
bt word[ebx],ax
|
|
|
|
|
pop ebx eax
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-20 19:34:38 +01:00
|
|
|
|
proc ted_show_help_f1 uses eax edx edi, edit:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-20 19:34:38 +01:00
|
|
|
|
call ted_get_pos_by_cursor
|
|
|
|
|
push edx
|
|
|
|
|
call ted_iterat_next_color_tag
|
|
|
|
|
mov eax,edx
|
|
|
|
|
pop edx
|
|
|
|
|
call ted_iterat_perv_color_tag
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-20 19:34:38 +01:00
|
|
|
|
cmp eax,ted_tex
|
|
|
|
|
jle @f
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
stdcall ted_find_help_id,eax
|
|
|
|
|
@@:
|
|
|
|
|
;call ted_draw_main_cursor
|
|
|
|
|
call ted_draw_help_f1
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = position begin 'symbol' struct
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
; end_pos = position end 'symbol' struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_find_help_id, end_pos:dword
|
|
|
|
|
; ecx = word_n
|
|
|
|
|
; ebx = l_pos
|
|
|
|
|
mov ted_help_id,-1
|
|
|
|
|
|
|
|
|
|
push ebx ecx
|
|
|
|
|
xor ebx,ebx
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov bl,[edx]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
shl bx,2 ;ebx*=4
|
|
|
|
|
add ebx,ted_arr_key_pos
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov ecx,[ebx]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp ecx,0
|
|
|
|
|
jl .if_0e ;if( (word_n=ted_arr_key_pos[(unsigned char)tf[0]])>-1 ){
|
|
|
|
|
push esi eax
|
|
|
|
|
mov ebx,ecx ;l_pos=word_n;
|
|
|
|
|
ColToIndexOffset ecx,esi
|
|
|
|
|
push cx
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov cl,[esi]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
cmp ebx,ted_key_words_count ;while(l_pos<ted_key_words_count)
|
|
|
|
|
jge @f
|
|
|
|
|
;ColToIndexOffset ecx,esi
|
|
|
|
|
ColToIndexOffset ebx,eax
|
2018-10-21 22:10:31 +02:00
|
|
|
|
cmp cl,[eax] ;&& Col[l_pos].Text[0]==Col[word_n].Text[0])
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jne @f
|
|
|
|
|
inc ebx ;l_pos++;
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
pop cx
|
|
|
|
|
call ted_iterat_next ;pos=1;
|
|
|
|
|
mov esi,1
|
|
|
|
|
@@:
|
|
|
|
|
push dx
|
|
|
|
|
push word[edx]
|
|
|
|
|
pop dx
|
|
|
|
|
.wh_0b:
|
|
|
|
|
cmp ebx,ecx ;while(l_pos>word_n
|
|
|
|
|
jle .wh_0e
|
|
|
|
|
dec ebx
|
|
|
|
|
ColToIndexOffset ebx,eax
|
|
|
|
|
inc ebx
|
|
|
|
|
cmp byte[eax+esi],dl ;&& Col[l_pos-1].Text[pos]!=tf[i])
|
|
|
|
|
je .wh_0e
|
|
|
|
|
dec ebx ;l_pos--;
|
|
|
|
|
jmp .wh_0b
|
|
|
|
|
.wh_0e:
|
|
|
|
|
|
|
|
|
|
.wh_1b:
|
|
|
|
|
cmp ebx,ecx ;while(l_pos>word_n
|
|
|
|
|
jle .wh_1e
|
|
|
|
|
ColToIndexOffset ecx,eax
|
|
|
|
|
cmp byte[eax+esi],dl
|
|
|
|
|
je .wh_1e
|
|
|
|
|
inc ecx ;word_n++;
|
|
|
|
|
jmp .wh_1b
|
|
|
|
|
.wh_1e:
|
|
|
|
|
pop dx
|
|
|
|
|
|
|
|
|
|
cmp ecx,ebx ;if(word_n==l_pos) break;
|
|
|
|
|
je @f
|
|
|
|
|
call ted_iterat_next ;pos++;
|
2018-10-21 22:10:31 +02:00
|
|
|
|
cmp edx,[end_pos] ;for(...;i<strlen;...)
|
2010-04-29 20:27:40 +02:00
|
|
|
|
je @f ;jge
|
|
|
|
|
inc esi
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
pop eax esi
|
|
|
|
|
|
|
|
|
|
mov ted_help_id,ecx
|
|
|
|
|
;return word_n;
|
|
|
|
|
|
|
|
|
|
.if_0e:
|
|
|
|
|
pop ecx ebx
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;output:
|
|
|
|
|
; eax = <20><><EFBFBD> <20>訡<EFBFBD><E8A8A1>
|
|
|
|
|
; ebx = <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <20><><EFBFBD><EFBFBD><EFBFBD>⠭<EFBFBD><E2A0AD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_open_file uses ecx edx edi, edit:dword, file:dword, f_name:dword ;<3B>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2012-06-19 14:20:54 +02:00
|
|
|
|
; *** <20><EFBFBD><E0AEA2>塞 ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20> <20><> 墠⠥<E5A2A0> <20><> 㢥<><E3A2A5>稢<EFBFBD><E7A8A2><EFBFBD> ***
|
|
|
|
|
;<3B>㥬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD> <20> 䠩<><E4A0A9>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov ebx,[file]
|
|
|
|
|
mov dword[ebx], SSF_GET_INFO
|
2012-06-19 14:20:54 +02:00
|
|
|
|
mov dword[ebx+4], 0
|
|
|
|
|
mov dword[ebx+8], 0
|
|
|
|
|
mov dword[ebx+12], 0
|
|
|
|
|
m2m dword[ebx+16], ted_tex
|
|
|
|
|
mov byte[ebx+20], 0
|
|
|
|
|
push dword[f_name]
|
|
|
|
|
pop dword[ebx+21]
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mcall SF_FILE
|
|
|
|
|
or eax,eax
|
|
|
|
|
jz .end_0
|
2012-06-19 14:20:54 +02:00
|
|
|
|
mov edx,ted_max_chars
|
|
|
|
|
cmp eax,2 ;<3B>㭪<EFBFBD><E3ADAA><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD>
|
|
|
|
|
je @f
|
|
|
|
|
jmp .ret_f
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 4
|
2012-06-19 14:20:54 +02:00
|
|
|
|
.end_0:
|
|
|
|
|
;<3B><EFBFBD><E0AEA2>塞 墠<><E5A2A0><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>㧪<EFBFBD> 䠩<><E4A0A9>
|
|
|
|
|
mov ecx,ted_max_chars
|
|
|
|
|
sub ecx,2 ;ecx = <20><><EFBFBD>ᨬ<EFBFBD><E1A8AC>쭮<EFBFBD> <20><> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뫠 <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov edx,ted_tex
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edx,[edx+32] ;+32 = +0x20: qword: ࠧ<><E0A0A7><EFBFBD> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-06-19 14:20:54 +02:00
|
|
|
|
cmp edx,ecx
|
|
|
|
|
jl @f
|
|
|
|
|
;㢥<><E3A2A5>稢<EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><> 墠⨫<E5A2A0>
|
|
|
|
|
mov ecx,edx ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
|
|
|
|
add ecx,2 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>㦥<EFBFBD><E3A6A5><EFBFBD><EFBFBD> <20><>砫쭮<E7A0AB><ECADAE> <20> <20><><EFBFBD><EFBFBD>筮<EFBFBD><E7ADAE> ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
add ecx,ted_increase_size ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
|
|
|
|
mov ted_max_chars,ecx
|
|
|
|
|
imul ecx,sizeof.symbol
|
|
|
|
|
invoke mem.realloc, ted_tex,ecx
|
|
|
|
|
mov ted_tex,eax
|
|
|
|
|
mov ted_tex_1,eax
|
|
|
|
|
add ted_tex_1,sizeof.symbol
|
|
|
|
|
add eax,ecx
|
|
|
|
|
mov ted_tex_end,eax
|
|
|
|
|
mov ecx,ted_tex_1
|
|
|
|
|
add ecx,sizeof.symbol
|
|
|
|
|
mov ted_ptr_free_symb,ecx
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
; *** <20>㥬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> ***
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov ebx,[file]
|
|
|
|
|
mov dword[ebx], SSF_READ_FILE
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov dword[ebx+4], 0
|
|
|
|
|
mov dword[ebx+8], 0
|
2012-06-19 14:20:54 +02:00
|
|
|
|
m2m dword[ebx+12], edx ;<3B><> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>⠭<EFBFBD> <20> 䠩<><E4A0A9> (<28><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 祬 ted_max_chars)
|
2010-04-29 20:27:40 +02:00
|
|
|
|
m2m dword[ebx+16], ted_tex
|
|
|
|
|
mov byte[ebx+20], 0
|
|
|
|
|
push dword[f_name]
|
|
|
|
|
pop dword[ebx+21]
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mcall SF_FILE
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
or eax,eax
|
|
|
|
|
jz @f
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp eax,6
|
|
|
|
|
je @f
|
|
|
|
|
jmp .ret_f
|
|
|
|
|
@@:
|
|
|
|
|
cmp ebx,-1
|
|
|
|
|
je .ret_f
|
|
|
|
|
;if open file
|
|
|
|
|
call ted_on_open_file
|
|
|
|
|
.ret_f:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_but_select_word, edit:dword
|
|
|
|
|
pushad
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
call ted_get_pos_by_cursor
|
|
|
|
|
push edx
|
|
|
|
|
call ted_iterat_perv_color_tag
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
call ted_get_text_coords
|
|
|
|
|
mov ted_sel_x0,ebx
|
|
|
|
|
mov ted_sel_y0,eax
|
|
|
|
|
@@:
|
|
|
|
|
pop edx
|
|
|
|
|
call ted_iterat_next_color_tag
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
call ted_get_text_coords
|
|
|
|
|
mov ted_sel_x1,ebx
|
|
|
|
|
mov ted_sel_y1,eax
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
@@:
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
2018-10-21 22:10:31 +02:00
|
|
|
|
;output:
|
|
|
|
|
; al = 1 if delete
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_but_cut uses edi, edit:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
stdcall ted_but_copy,edi
|
|
|
|
|
call ted_set_undo
|
|
|
|
|
stdcall ted_sel_text_del,ted_opt_ed_change_time
|
|
|
|
|
|
|
|
|
|
cmp al,1
|
|
|
|
|
jne @f
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_but_copy, edit:dword
|
|
|
|
|
pushad
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
call ted_is_select
|
2016-02-21 15:47:33 +01:00
|
|
|
|
or al,al
|
|
|
|
|
jz .end_f ;if not selected text
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_sel_normalize
|
|
|
|
|
|
|
|
|
|
mov esi,ted_seln_x1
|
|
|
|
|
mov ecx,ted_seln_y1
|
|
|
|
|
call ted_get_pos_by_coords
|
|
|
|
|
mov ebx,edx
|
|
|
|
|
mov esi,ted_seln_x0
|
|
|
|
|
mov ecx,ted_seln_y0
|
|
|
|
|
call ted_get_pos_by_coords
|
|
|
|
|
mov esi,ebx
|
|
|
|
|
|
2013-11-14 11:59:09 +01:00
|
|
|
|
mov ecx,12 ;system buffer header size
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov ebx,ted_buffer
|
2013-11-14 11:59:09 +01:00
|
|
|
|
mov dword[ebx+4],0 ;text data
|
|
|
|
|
mov dword[ebx+8],1 ;code 866
|
|
|
|
|
add ebx,ecx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
cmp edx,ted_tex_1 ;end of file
|
|
|
|
|
jle @f
|
|
|
|
|
cmp edx,esi ;end of select
|
|
|
|
|
je @f
|
|
|
|
|
inc ecx
|
|
|
|
|
cmp ecx,ted_buffer_size ;owerflow bufer
|
|
|
|
|
je @f
|
|
|
|
|
|
|
|
|
|
mov al,byte[edx]
|
|
|
|
|
mov byte[ebx],al
|
|
|
|
|
inc ebx
|
2015-09-16 16:21:53 +02:00
|
|
|
|
cmp al,13
|
|
|
|
|
jne .no_13
|
|
|
|
|
mov byte[ebx],10 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 13,10 <20><><EFBFBD> ᮢ<><E1AEA2><EFBFBD>⨬<EFBFBD><E2A8AC><EFBFBD><EFBFBD> <20> <20><>㣨<EFBFBD><E3A3A8> <20>ணࠬ<E0AEA3><E0A0AC><EFBFBD><EFBFBD>
|
|
|
|
|
inc ebx
|
|
|
|
|
inc ecx
|
|
|
|
|
.no_13:
|
|
|
|
|
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_iterat_next
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
mov byte[ebx],0
|
|
|
|
|
|
2014-01-28 12:55:07 +01:00
|
|
|
|
cmp ecx,12
|
2010-04-29 20:27:40 +02:00
|
|
|
|
je .end_f
|
2013-11-14 11:59:09 +01:00
|
|
|
|
mov ebx,ted_buffer
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov [ebx],ecx
|
|
|
|
|
mcall SF_CLIPBOARD,SSF_WRITE_CB,ecx,ted_buffer
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_draw_buffer
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
|
|
|
|
je .end_f
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
.end_f:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_but_paste, edit:dword
|
2013-11-14 11:59:09 +01:00
|
|
|
|
pushad
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mcall SF_CLIPBOARD,SSF_GET_SLOT_COUNT
|
2013-11-14 11:59:09 +01:00
|
|
|
|
cmp eax,1
|
|
|
|
|
jl .no_buf_r
|
|
|
|
|
|
|
|
|
|
mov esi,eax
|
|
|
|
|
.cycle: ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 横<> <20><> ⠬
|
|
|
|
|
dec esi ;<3B><><EFBFBD><EFBFBD><EFBFBD> ⥪<>饣<EFBFBD>, <20><EFBFBD><E0AEA2>塞<EFBFBD><EFA5AC><EFBFBD> <><E1ABAE>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mcall SF_CLIPBOARD,SSF_READ_CB,esi
|
2013-11-14 11:59:09 +01:00
|
|
|
|
cmp eax,1
|
|
|
|
|
je .no_buf_r
|
|
|
|
|
cmp eax,-1
|
|
|
|
|
je .no_buf_r
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov ecx,[eax]
|
2013-11-14 11:59:09 +01:00
|
|
|
|
cmp ecx,1 ;size
|
|
|
|
|
jl .no_buf_r
|
|
|
|
|
cmp dword[eax+4],0 ;text
|
|
|
|
|
je @f
|
|
|
|
|
cmp esi,1
|
|
|
|
|
jge .cycle ;<3B> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ⥪<><E2A5AA>, <20> ⮢ <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>쪮, <20>㥬 <20><>३<EFBFBD><E0A5A9> <20> <20><><EFBFBD>孥<EFBFBD><E5ADA5> <><E1ABAE>
|
|
|
|
|
jmp .no_buf_r
|
|
|
|
|
@@:
|
|
|
|
|
cmp dword[eax+8],1 ;866
|
|
|
|
|
je @f
|
|
|
|
|
cmp esi,1
|
|
|
|
|
jge .cycle ;<3B> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA> <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2> 866 ... <20>㥬 <20><>३<EFBFBD><E0A5A9> <20> <20><><EFBFBD>孥<EFBFBD><E5ADA5> <><E1ABAE>
|
|
|
|
|
jmp .no_buf_r
|
|
|
|
|
@@:
|
|
|
|
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD> <20><> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD><EFBFBD>
|
|
|
|
|
cmp ecx,ted_buffer_size
|
|
|
|
|
jle @f
|
|
|
|
|
mov ecx,ted_buffer_size
|
|
|
|
|
@@:
|
|
|
|
|
mov edi,ted_buffer
|
|
|
|
|
mov esi,eax
|
|
|
|
|
add esi,4 ;12
|
|
|
|
|
mov dword[edi],ecx
|
|
|
|
|
add edi,4 ;12
|
|
|
|
|
sub ecx,4 ;12
|
|
|
|
|
rep movsb
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2013-11-14 11:59:09 +01:00
|
|
|
|
|
|
|
|
|
mov esi,eax
|
|
|
|
|
add esi,12
|
|
|
|
|
jmp .buf_r
|
|
|
|
|
.no_buf_r:
|
|
|
|
|
|
|
|
|
|
;<3B> <20><> 㤠<><E3A4A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov esi,ted_buffer
|
2013-11-14 11:59:09 +01:00
|
|
|
|
cmp dword[esi],1 ;<3B><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jl .no_paste ;<3B> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>祣<EFBFBD> <20><> 㤠<><E3A4A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><>室
|
|
|
|
|
add esi,12 ;system buffer header size
|
|
|
|
|
.buf_r:
|
|
|
|
|
|
|
|
|
|
mov edx,esi
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call tl_strlen
|
|
|
|
|
cmp eax,1
|
2013-11-14 11:59:09 +01:00
|
|
|
|
jl .no_paste
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov esi,eax
|
|
|
|
|
call ted_set_undo
|
|
|
|
|
mov ebx,ted_opt_ed_change_time+ted_opt_ed_move_cursor
|
|
|
|
|
stdcall ted_sel_text_del,ebx
|
|
|
|
|
cmp al,1
|
|
|
|
|
jne .del
|
|
|
|
|
mov ebx,ted_opt_ed_move_cursor
|
|
|
|
|
.del:
|
2013-11-14 11:59:09 +01:00
|
|
|
|
stdcall ted_text_add,edi,edx,esi,ebx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
2013-11-14 11:59:09 +01:00
|
|
|
|
je .no_paste
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_fun_draw_panel_buttons
|
2013-11-14 11:59:09 +01:00
|
|
|
|
.no_paste:
|
|
|
|
|
popad
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2011-12-15 23:00:21 +01:00
|
|
|
|
proc ted_but_sumb_upper uses edi esi, edit:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2011-12-15 23:00:21 +01:00
|
|
|
|
stdcall ted_convert_sel_text,fb_char_toupper
|
2016-02-21 15:47:33 +01:00
|
|
|
|
or esi,esi
|
|
|
|
|
jz @f
|
2011-12-15 23:00:21 +01:00
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2011-12-15 23:00:21 +01:00
|
|
|
|
proc ted_but_sumb_lover uses edi esi, edit:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2011-12-15 23:00:21 +01:00
|
|
|
|
stdcall ted_convert_sel_text,fb_char_todown
|
2016-02-21 15:47:33 +01:00
|
|
|
|
or esi,esi
|
|
|
|
|
jz @f
|
2011-12-15 23:00:21 +01:00
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_but_reverse uses eax ebx edi, edit:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
call ted_is_select
|
2016-02-21 15:47:33 +01:00
|
|
|
|
or al,al
|
|
|
|
|
jz @f
|
2016-01-21 23:22:11 +01:00
|
|
|
|
call ted_sel_normalize
|
|
|
|
|
push esi ecx edx
|
|
|
|
|
mov esi,ted_seln_x0
|
|
|
|
|
mov ecx,ted_seln_y0
|
|
|
|
|
call ted_get_pos_by_coords
|
|
|
|
|
mov eax,edx
|
|
|
|
|
mov esi,ted_seln_x1
|
|
|
|
|
cmp esi,0
|
|
|
|
|
je .beg_str
|
|
|
|
|
dec esi
|
|
|
|
|
.beg_str:
|
|
|
|
|
mov ecx,ted_seln_y1
|
|
|
|
|
call ted_get_pos_by_coords
|
|
|
|
|
;call ted_get_text_perv_pos
|
|
|
|
|
mov ebx,edx
|
|
|
|
|
pop edx ecx esi
|
|
|
|
|
;cmp eax,...
|
|
|
|
|
;je @f
|
|
|
|
|
call ted_revers
|
|
|
|
|
@@:
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_but_undo uses eax edi, edit:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
mov eax,ted_tim_undo
|
|
|
|
|
cmp ted_tim_ch,eax
|
|
|
|
|
jbe @f
|
|
|
|
|
inc ted_tim_undo
|
|
|
|
|
;call ted_text_colored
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-01-21 23:22:11 +01:00
|
|
|
|
proc ted_but_redo uses edi, edit:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
cmp ted_tim_undo,1
|
|
|
|
|
jb @f
|
|
|
|
|
dec ted_tim_undo
|
|
|
|
|
;call ted_text_colored
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
2019-01-21 12:39:35 +01:00
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><>室<EFBFBD><E5AEA4> ⥪<><E2A5AA> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㪠<>뢠<EFBFBD><EBA2A0> ted_buffer_find
|
|
|
|
|
;input:
|
|
|
|
|
; f_opt = <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> <20><><EFBFBD>᪠:
|
|
|
|
|
; (0 - <20>᪠<EFBFBD><E1AAA0> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 1 - <20>᪠<EFBFBD><E1AAA0> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 2 - <20>᪠<EFBFBD><E1AAA0> <20><> <20><>砫<EFBFBD> 䠩<><E4A0A9>)
|
|
|
|
|
align 16
|
|
|
|
|
proc ted_but_find, edit:dword, f_opt:dword
|
|
|
|
|
push [edit]
|
|
|
|
|
cmp dword[f_opt],2
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_but_find_first
|
|
|
|
|
jmp .end_f
|
|
|
|
|
@@:
|
|
|
|
|
cmp dword[f_opt],0
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_but_find_next
|
|
|
|
|
jmp .end_f
|
|
|
|
|
@@:
|
|
|
|
|
cmp dword[f_opt],1
|
|
|
|
|
jne .end_f
|
|
|
|
|
call ted_but_find_perv
|
|
|
|
|
.end_f:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><>室<EFBFBD><E5AEA4> ⥪<><E2A5AA> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㪠<>뢠<EFBFBD><EBA2A0> ted_buffer_find
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> <20><> <20><>砫<EFBFBD> 䠩<><E4A0A9>, <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> ⥪<>饣<EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
align 16
|
|
|
|
|
proc ted_but_find_first, edit:dword
|
|
|
|
|
pushad
|
|
|
|
|
mov edi,[edit]
|
|
|
|
|
|
|
|
|
|
call ted_is_select
|
|
|
|
|
or al,al
|
|
|
|
|
jz @f
|
|
|
|
|
call ted_sel_normalize
|
|
|
|
|
mov edx,ted_sel_y1
|
|
|
|
|
mov ecx,ted_sel_x1
|
|
|
|
|
call ted_go_to_pos ;<3B><><EFBFBD><EFBFBD>室 <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call ted_get_pos_by_cursor
|
|
|
|
|
jmp .end0
|
|
|
|
|
@@:
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
.end0:
|
|
|
|
|
mov eax,ted_buffer_find
|
|
|
|
|
mov bl,byte[eax]
|
|
|
|
|
@@:
|
|
|
|
|
call ted_get_find_rezult
|
|
|
|
|
cmp bh,1
|
|
|
|
|
je @f ; find
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
call but_find
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><>室<EFBFBD><E5AEA4> ⥪<><E2A5AA> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㪠<>뢠<EFBFBD><EBA2A0> ted_buffer_find
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
align 16
|
|
|
|
|
proc ted_but_find_perv, edit:dword
|
|
|
|
|
pushad
|
|
|
|
|
mov edi,[edit]
|
|
|
|
|
call ted_is_select
|
|
|
|
|
or al,al
|
|
|
|
|
jz @f
|
|
|
|
|
call ted_sel_normalize
|
|
|
|
|
mov edx,ted_sel_y0
|
|
|
|
|
mov ecx,ted_sel_x0
|
|
|
|
|
call ted_go_to_pos ;<3B><><EFBFBD><EFBFBD>室 <20><> <20><>砫<EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call ted_get_pos_by_cursor
|
|
|
|
|
call ted_iterat_perv ;<3B><><EFBFBD><EFBFBD>室 <20><> 1-<2D> ᨬ<><E1A8AC><EFBFBD> <20><>। <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jmp .end0
|
|
|
|
|
@@:
|
|
|
|
|
call ted_get_pos_by_cursor
|
|
|
|
|
.end0:
|
|
|
|
|
mov eax,ted_buffer_find
|
|
|
|
|
mov bl,byte[eax]
|
|
|
|
|
@@:
|
|
|
|
|
call ted_get_find_rezult
|
|
|
|
|
cmp bh,1
|
|
|
|
|
je @f ; find
|
|
|
|
|
call ted_iterat_perv
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
call but_find
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><>室<EFBFBD><E5AEA4> ⥪<><E2A5AA> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㪠<>뢠<EFBFBD><EBA2A0> ted_buffer_find
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_but_find_next, edit:dword
|
|
|
|
|
pushad
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
call ted_get_pos_by_cursor
|
|
|
|
|
mov eax,ted_buffer_find
|
|
|
|
|
mov bl,byte[eax]
|
|
|
|
|
@@:
|
|
|
|
|
call ted_get_find_rezult
|
|
|
|
|
cmp bh,1
|
|
|
|
|
je @f ; find
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
2019-01-21 12:39:35 +01:00
|
|
|
|
call but_find
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; bh = <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E1AAAE><EFBFBD> ⥪<><E2A5AA> (0 - <20><><EFBFBD>, 1 - <20><>)
|
|
|
|
|
; esi = first symbol pointer
|
|
|
|
|
align 16
|
|
|
|
|
but_find:
|
|
|
|
|
or bh,bh
|
|
|
|
|
jz @f
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_get_text_coords
|
|
|
|
|
inc ebx ;move cursor right
|
|
|
|
|
mov ted_sel_x1,ebx
|
|
|
|
|
mov ted_sel_y1,eax
|
|
|
|
|
mov edx,eax
|
|
|
|
|
mov ecx,ebx
|
|
|
|
|
call ted_go_to_pos
|
2019-01-21 12:39:35 +01:00
|
|
|
|
mov edx,esi
|
2010-04-29 20:27:40 +02:00
|
|
|
|
call ted_get_text_coords
|
|
|
|
|
mov ted_sel_x0,ebx
|
|
|
|
|
mov ted_sel_y0,eax
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
jmp .end_find
|
|
|
|
|
@@:
|
|
|
|
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20> ⥪<><E2A5AA> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cmp ted_fun_find_err,0
|
|
|
|
|
je .end_find
|
|
|
|
|
call ted_fun_find_err ;<3B><><EFBFBD>짮<EFBFBD><ECA7AE>⥫<EFBFBD>᪠<EFBFBD> <20>㭪<EFBFBD><E3ADAA><EFBFBD>
|
|
|
|
|
.end_find:
|
2019-01-21 12:39:35 +01:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; rpl_text = ⥪<><E2A5AA> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; r_opt = <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> <20><><EFBFBD>᪠:
|
|
|
|
|
; (0 - <20>᪠<EFBFBD><E1AAA0> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 1 - <20>᪠<EFBFBD><E1AAA0> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 2 - <20>᪠<EFBFBD><E1AAA0> <20><> <20><>砫<EFBFBD> 䠩<><E4A0A9>)
|
|
|
|
|
; n_tim = 䨪<><E4A8AA><EFBFBD><E0AEA2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0 - <20><><EFBFBD>, 1 - <20><>)
|
|
|
|
|
;output:
|
|
|
|
|
; eax = 0 - <20><> 㤠筮, 1 - 㤠筮
|
|
|
|
|
align 16
|
|
|
|
|
proc ted_but_replace uses edx edi esi, edit:dword, rpl_text:dword, r_opt:dword, n_tim:dword
|
|
|
|
|
mov edi,[edit]
|
|
|
|
|
stdcall ted_but_find, edi,[r_opt]
|
|
|
|
|
|
|
|
|
|
xor edx,edx
|
|
|
|
|
cmp dword[n_tim],0
|
|
|
|
|
je @f
|
|
|
|
|
mov edx,ted_opt_ed_change_time
|
|
|
|
|
@@:
|
|
|
|
|
stdcall ted_sel_text_del, edx
|
|
|
|
|
or eax,0xff
|
|
|
|
|
jz @f
|
|
|
|
|
mov esi,[rpl_text]
|
|
|
|
|
stdcall tl_strlen
|
|
|
|
|
or eax,eax
|
|
|
|
|
jz @f
|
|
|
|
|
stdcall ted_text_add, edi,esi,eax,ted_opt_ed_move_cursor
|
|
|
|
|
xor eax,eax
|
|
|
|
|
inc eax
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_key_ctrl_home:
|
|
|
|
|
mov ted_cur_x,0
|
|
|
|
|
mov ted_cur_y,0
|
|
|
|
|
push eax
|
|
|
|
|
mov eax,ted_scr_w
|
|
|
|
|
mov dword[eax+sb_offs_position],0
|
|
|
|
|
mov eax,ted_scr_h
|
|
|
|
|
mov dword[eax+sb_offs_position],0
|
|
|
|
|
pop eax
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
|
|
|
|
|
2014-06-27 23:34:57 +02:00
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2014-06-27 23:34:57 +02:00
|
|
|
|
ted_key_ctrl_end:
|
|
|
|
|
push eax ebx
|
|
|
|
|
call ted_get_num_lines
|
|
|
|
|
mov ebx,ted_scr_w
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov [ebx+sb_offs_position],eax ;<3B>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD>㭮<EFBFBD> <20><> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD>
|
|
|
|
|
cmp eax,[ebx+sb_offs_cur_area]
|
2014-06-27 23:34:57 +02:00
|
|
|
|
jle @f
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov eax,[ebx+sb_offs_cur_area] ;<3B><><EFBFBD><EFBFBD>砥<EFBFBD> <20><> <20><>ப <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
2014-06-27 23:34:57 +02:00
|
|
|
|
@@:
|
2018-10-21 22:10:31 +02:00
|
|
|
|
sub [ebx+sb_offs_position],eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>㭪<EFBFBD> <20><> <20><>ப <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> (<28><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD>)
|
2014-06-27 23:34:57 +02:00
|
|
|
|
dec eax
|
|
|
|
|
mov ted_cur_y,eax ;<3B>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD>
|
|
|
|
|
pop ebx eax
|
|
|
|
|
call ted_cur_move_x_last_char
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
|
|
|
|
|
2010-04-29 20:27:40 +02:00
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_sel_key_up
|
|
|
|
|
cmp ted_drag_k,1
|
|
|
|
|
je @f
|
|
|
|
|
call ted_sel_start
|
|
|
|
|
mov ted_drag_k,1
|
|
|
|
|
@@:
|
|
|
|
|
push dx
|
|
|
|
|
call ted_cur_move_up
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
@@:
|
|
|
|
|
pop dx
|
|
|
|
|
call ted_sel_move
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_sel_key_down
|
|
|
|
|
cmp ted_drag_k,1
|
|
|
|
|
je @f
|
|
|
|
|
call ted_sel_start
|
|
|
|
|
mov ted_drag_k,1
|
|
|
|
|
@@:
|
|
|
|
|
push dx
|
|
|
|
|
call ted_cur_move_down
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
@@:
|
|
|
|
|
pop dx
|
|
|
|
|
call ted_sel_move
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_sel_key_left
|
|
|
|
|
cmp ted_drag_k,1
|
|
|
|
|
je @f
|
|
|
|
|
call ted_sel_start
|
|
|
|
|
@@:
|
|
|
|
|
push dx
|
|
|
|
|
call ted_cur_move_left
|
|
|
|
|
call ted_sel_move
|
|
|
|
|
cmp ted_drag_k,1
|
|
|
|
|
je @f
|
|
|
|
|
mov ted_drag_k,1
|
|
|
|
|
mov dl,8
|
|
|
|
|
@@:
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
jmp .end_f
|
|
|
|
|
@@:
|
|
|
|
|
stdcall ted_draw_cur_line,edi
|
|
|
|
|
.end_f:
|
|
|
|
|
pop dx
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_sel_key_right
|
|
|
|
|
cmp ted_drag_k,1
|
|
|
|
|
je @f
|
|
|
|
|
call ted_sel_start
|
|
|
|
|
@@:
|
|
|
|
|
push dx
|
|
|
|
|
call ted_cur_move_right
|
|
|
|
|
call ted_sel_move
|
|
|
|
|
cmp ted_drag_k,1
|
|
|
|
|
je @f
|
|
|
|
|
mov ted_drag_k,1
|
|
|
|
|
mov dl,8
|
|
|
|
|
@@:
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_scroll_set_redraw
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
jmp .end_f
|
|
|
|
|
@@:
|
|
|
|
|
stdcall ted_draw_cur_line,edi
|
|
|
|
|
.end_f:
|
|
|
|
|
pop dx
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;description:
|
|
|
|
|
; this function need to optimize output
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_draw_cursor_sumb
|
2016-02-19 17:00:48 +01:00
|
|
|
|
pushad
|
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
mov edx,ted_cur_x
|
|
|
|
|
imul edx,ted_rec_w
|
|
|
|
|
add ebx,edx
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,ted_rec_w
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mov ecx,ted_wnd_t ;calc rect -> y0,y1
|
|
|
|
|
add ecx,ted_rec_t
|
|
|
|
|
mov edx,ted_cur_y
|
|
|
|
|
imul edx,ted_rec_h
|
|
|
|
|
add ecx,edx
|
|
|
|
|
shl ecx,16
|
|
|
|
|
add ecx,ted_rec_h
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mov edx,ted_color_wnd_work
|
2016-02-21 15:47:33 +01:00
|
|
|
|
call ted_sel_normalize
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov esi,ted_scr_w
|
|
|
|
|
mov eax,[esi+sb_offs_position]
|
|
|
|
|
sub ted_seln_y0,eax
|
|
|
|
|
sub ted_seln_y1,eax
|
|
|
|
|
|
|
|
|
|
mov eax,ted_cur_y
|
|
|
|
|
cmp eax,ted_seln_y0
|
|
|
|
|
jl .no_cur_sel
|
|
|
|
|
cmp eax,ted_seln_y1
|
|
|
|
|
jg .no_cur_sel
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mov edx,ted_color_select ;<3B><><EFBFBD>塞 梥<> 䮭<> <20><> 梥<> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov esi,ted_scr_h
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp eax,ted_seln_y0
|
2016-02-19 17:00:48 +01:00
|
|
|
|
jne @f
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov eax,ted_cur_x
|
|
|
|
|
add eax,[esi+sb_offs_position]
|
|
|
|
|
cmp eax,ted_seln_x0
|
2016-02-19 17:00:48 +01:00
|
|
|
|
jge @f
|
|
|
|
|
mov edx,ted_color_wnd_work
|
|
|
|
|
@@:
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov eax,ted_cur_y
|
|
|
|
|
cmp eax,ted_seln_y1
|
2016-02-19 17:00:48 +01:00
|
|
|
|
jne .no_cur_sel
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov eax,ted_cur_x
|
|
|
|
|
add eax,[esi+sb_offs_position]
|
|
|
|
|
cmp eax,ted_seln_x1
|
2016-02-19 17:00:48 +01:00
|
|
|
|
jl .no_cur_sel
|
|
|
|
|
mov edx,ted_color_wnd_work
|
2016-02-21 15:47:33 +01:00
|
|
|
|
.no_cur_sel:
|
|
|
|
|
mcall SF_DRAW_RECT
|
2016-02-19 17:00:48 +01:00
|
|
|
|
|
|
|
|
|
call ted_get_pos_by_cursor ;<3B><>६ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
|
|
|
|
cmp ted_gp_opt,2
|
|
|
|
|
jne @f
|
|
|
|
|
mov esi,1
|
|
|
|
|
ror ecx,16
|
|
|
|
|
mov bx,cx
|
|
|
|
|
add ebx,0x10001
|
|
|
|
|
call ted_get_symb_color
|
|
|
|
|
call ted_convert_invis_symb
|
|
|
|
|
mcall SF_DRAW_TEXT ;<3B><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
|
|
|
|
@@:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx -> pointer to text
|
|
|
|
|
; edi -> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> tedit
|
|
|
|
|
;output:
|
|
|
|
|
; ecx = color
|
|
|
|
|
; if ted_mode_color=0 then ecx=ted_color_wnd_text
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_get_symb_color:
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mov ecx,ted_color_wnd_text ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥<> ⥪<><E2A5AA><EFBFBD> <20><> 㬮<>砭<EFBFBD><E7A0AD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
push eax edx
|
|
|
|
|
cmp ted_mode_color,0
|
|
|
|
|
je .exit
|
|
|
|
|
jmp .on_first
|
|
|
|
|
@@:
|
|
|
|
|
call ted_iterat_perv
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle .exit
|
|
|
|
|
.on_first:
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov al,byte[edx+1]
|
|
|
|
|
or al,al ;<3B> al=0 <20><> 梥<> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jz @b
|
|
|
|
|
|
|
|
|
|
cmp eax,ted_colors_text_count
|
|
|
|
|
jge .exit
|
|
|
|
|
|
|
|
|
|
shl ax,2 ;㬭<><E3ACAD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥<><E6A2A5> <20><> 4 <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ecx,ted_text_colors ;<3B>ਡ<EFBFBD><E0A8A1><EFBFBD>塞 ᬥ饭<E1ACA5><E9A5AD> 1-<2D><> 梥<><E6A2A5>
|
|
|
|
|
add ecx,eax
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov ecx,[ecx] ;<3B><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<>騩 梥<> ⥪<><E2A5AA><EFBFBD> <20><> ᬥ饭<E1ACA5><E9A5AD>
|
2016-02-19 17:00:48 +01:00
|
|
|
|
.exit:
|
|
|
|
|
or ecx,ted_font_size
|
|
|
|
|
pop edx eax
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to text
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>⠥<EFBFBD><E2A0A5><EFBFBD> <20><> <20><>࠭<EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_convert_invis_symb:
|
2010-05-03 17:12:50 +02:00
|
|
|
|
cmp ted_mode_invis,1
|
2016-02-21 15:47:33 +01:00
|
|
|
|
jne .else
|
2010-05-03 17:12:50 +02:00
|
|
|
|
cmp byte[edx],9
|
|
|
|
|
jne @f
|
|
|
|
|
lea edx,[ted_symbol_tab]
|
2016-02-21 15:47:33 +01:00
|
|
|
|
jmp .end_f
|
|
|
|
|
align 4
|
2010-05-03 17:12:50 +02:00
|
|
|
|
@@:
|
|
|
|
|
cmp byte[edx],13
|
|
|
|
|
jne @f
|
|
|
|
|
mov edx,edi
|
|
|
|
|
add edx,ted_offs_symbol_new_line
|
|
|
|
|
@@:
|
2016-02-21 15:47:33 +01:00
|
|
|
|
jmp .end_f
|
|
|
|
|
align 4
|
|
|
|
|
.else:
|
|
|
|
|
cmp byte[edx],9
|
|
|
|
|
je @f
|
|
|
|
|
cmp byte[edx],13
|
|
|
|
|
je @f
|
|
|
|
|
jmp .end_f
|
|
|
|
|
@@:
|
|
|
|
|
lea edx,[ted_symbol_space]
|
2010-05-03 17:12:50 +02:00
|
|
|
|
.end_f:
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_scroll_set_redraw:
|
|
|
|
|
push eax
|
|
|
|
|
mov eax,ted_scr_w
|
|
|
|
|
mov dword[eax+sb_offs_redraw],1
|
|
|
|
|
mov eax,ted_scr_h
|
|
|
|
|
mov dword[eax+sb_offs_redraw],1
|
|
|
|
|
pop eax
|
|
|
|
|
ret
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_draw, edit:dword
|
2010-05-03 17:12:50 +02:00
|
|
|
|
locals
|
|
|
|
|
line_num dd ?
|
|
|
|
|
endl
|
|
|
|
|
pushad
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mov eax,SF_DRAW_TEXT
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov ecx,ted_text_colors
|
2018-10-21 22:10:31 +02:00
|
|
|
|
mov ecx,[ecx]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,ted_wnd_t
|
|
|
|
|
add ebx,ted_rec_t
|
|
|
|
|
add ebx,0x10001 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㪢<EFBFBD> <20><> 業<><E6A5AD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
call ted_sel_normalize ;need before draw select
|
|
|
|
|
mov esi,ted_scr_w
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov esi,[esi+sb_offs_position]
|
|
|
|
|
mov [line_num],esi
|
2010-05-03 17:12:50 +02:00
|
|
|
|
|
|
|
|
|
stdcall ted_clear_line_before_draw, edi,ebx,1,esi
|
|
|
|
|
call ted_get_first_visible_pos
|
|
|
|
|
cmp edx,0
|
|
|
|
|
je .no_draw_text
|
|
|
|
|
mov esi,1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뢮<EFBFBD><EBA2AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD> <20><> 1-<2D><> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
|
|
|
|
@@:
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle .no_draw_text
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
; *** 梥⮢<E6A2A5><E2AEA2> ࠧ<><E0A0A7>⪠
|
|
|
|
|
cmp ted_mode_color,0
|
|
|
|
|
je .no_col_change
|
|
|
|
|
cmp byte[edx+1],0
|
|
|
|
|
je .no_col_change
|
|
|
|
|
call ted_get_symb_color
|
|
|
|
|
.no_col_change:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp byte[edx],13
|
2010-05-03 17:12:50 +02:00
|
|
|
|
jne .no_13
|
|
|
|
|
cmp ted_mode_invis,1
|
|
|
|
|
jne .no_invis
|
|
|
|
|
push edx
|
|
|
|
|
mov edx,edi
|
|
|
|
|
add edx,ted_offs_symbol_new_line
|
|
|
|
|
int 0x40
|
|
|
|
|
pop edx
|
|
|
|
|
.no_invis:
|
|
|
|
|
add ebx,ted_rec_h
|
|
|
|
|
;optimized output \/
|
|
|
|
|
mov eax,ted_wnd_h
|
|
|
|
|
add eax,ted_wnd_t
|
|
|
|
|
cmp bx,ax
|
|
|
|
|
jg .no_draw_text
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mov eax,SF_DRAW_TEXT
|
2010-05-03 17:12:50 +02:00
|
|
|
|
;optimized output /\
|
|
|
|
|
and ebx,0xffff
|
|
|
|
|
ror ebx,16
|
|
|
|
|
add ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
inc ebx
|
|
|
|
|
ror ebx,16
|
|
|
|
|
inc dword[line_num] ;increment line number
|
|
|
|
|
stdcall ted_clear_line_before_draw,edi,ebx,1,dword[line_num]
|
|
|
|
|
call ted_opt_draw_line_left
|
|
|
|
|
jmp @b
|
2016-02-19 17:00:48 +01:00
|
|
|
|
align 4
|
2010-05-03 17:12:50 +02:00
|
|
|
|
.no_13:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
int 0x40
|
|
|
|
|
ror ebx,16
|
|
|
|
|
add ebx,ted_rec_w
|
|
|
|
|
mov esi,ted_wnd_l
|
|
|
|
|
add esi,ted_wnd_w
|
|
|
|
|
cmp bx,si
|
|
|
|
|
jl .no_opt
|
|
|
|
|
call ted_opt_draw_line_right
|
|
|
|
|
.no_opt:
|
|
|
|
|
mov si,1
|
|
|
|
|
ror ebx,16
|
|
|
|
|
jmp @b
|
|
|
|
|
.no_draw_text:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2014-06-27 23:34:57 +02:00
|
|
|
|
inc dword[line_num]
|
2010-05-03 17:12:50 +02:00
|
|
|
|
stdcall ted_clear_line_before_draw,edi,ebx,0,dword[line_num]
|
|
|
|
|
call ted_draw_line_numbers
|
|
|
|
|
call ted_draw_main_cursor
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;---------------------------------------------
|
|
|
|
|
; set all_redraw flag for draw all ScrollBar
|
|
|
|
|
; In some cases it is necessity to draw only the area
|
|
|
|
|
; of moving of a "runner", for acceleration of output -
|
|
|
|
|
; in this case the flag needs to be reset to 0 (zero).
|
|
|
|
|
mov eax,ted_scr_h
|
|
|
|
|
mov esi,ted_scr_w
|
|
|
|
|
mov dword[eax+sb_offs_all_redraw],1
|
|
|
|
|
mov dword[esi+sb_offs_all_redraw],1
|
|
|
|
|
|
|
|
|
|
; <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>ப<EFBFBD><E0AEAA>⪨
|
|
|
|
|
stdcall scroll_bar_horizontal.draw,eax ;[scrollbar_hor_draw]
|
|
|
|
|
stdcall scroll_bar_vertical.draw,esi ;[scrollbar_ver_draw]
|
|
|
|
|
; reset all_redraw flag
|
|
|
|
|
mov dword[eax+sb_offs_all_redraw],0
|
|
|
|
|
mov dword[esi+sb_offs_all_redraw],0
|
|
|
|
|
;---------------------------------------------
|
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
;left-bottom square
|
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
mov ecx,ted_wnd_t
|
|
|
|
|
add ecx,ted_wnd_h
|
|
|
|
|
shl ecx,16
|
|
|
|
|
mov cx,word[eax+sb_offs_size_y]
|
|
|
|
|
inc cx
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mcall SF_DRAW_RECT,,,ted_color_wnd_capt ;[sc.work]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;right-bottom square
|
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_wnd_w
|
|
|
|
|
shl ebx,16
|
|
|
|
|
mov bx,word[esi+sb_offs_size_x]
|
|
|
|
|
inc bx
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
cmp ted_fun_draw_panel_find,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_draw_panel_find
|
|
|
|
|
@@:
|
|
|
|
|
cmp ted_fun_draw_panel_syntax,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_draw_panel_syntax
|
|
|
|
|
@@:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_draw_main_cursor
|
2016-02-21 15:47:33 +01:00
|
|
|
|
pushad
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov eax,SF_DRAW_RECT ;draw cursor
|
|
|
|
|
mov ecx,ted_wnd_t ;calc rect -> y0,y1
|
|
|
|
|
add ecx,ted_rec_t
|
|
|
|
|
mov edx,ted_cur_y
|
|
|
|
|
imul edx,ted_rec_h
|
|
|
|
|
add ecx,edx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp ted_cur_ins,1 ;<3B><EFBFBD>ઠ ०<><E0A5A6><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>⠢<EFBFBD><E2A0A2>)
|
|
|
|
|
jne @f
|
|
|
|
|
mov edx,ted_rec_h
|
|
|
|
|
inc edx ;1->1, 3->2, 5->3, ...
|
|
|
|
|
shr edx,1 ;edx = <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 2 (<28><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
add ecx,edx
|
|
|
|
|
@@:
|
|
|
|
|
shl ecx,16
|
|
|
|
|
add ecx,ted_rec_h
|
|
|
|
|
cmp ted_cur_ins,1
|
|
|
|
|
jne @f
|
|
|
|
|
shr cx,1 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 2
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov ebx,ted_wnd_l ;calc rect -> x0,x1
|
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
mov edx,ted_cur_x
|
|
|
|
|
imul edx,ted_rec_w
|
|
|
|
|
add ebx,edx
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,ted_rec_w
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edx,ted_color_cursor
|
|
|
|
|
int 0x40 ;<3B>뢮<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
call ted_get_pos_by_cursor
|
|
|
|
|
cmp ted_gp_opt,2
|
|
|
|
|
jne @f
|
|
|
|
|
mov esi,1
|
|
|
|
|
ror ecx,16
|
|
|
|
|
mov bx,cx
|
|
|
|
|
add ebx,0x10001
|
|
|
|
|
cmp ted_cur_ins,1
|
|
|
|
|
jne .no_up_tetx
|
|
|
|
|
mov ecx,ted_rec_h
|
|
|
|
|
inc cx ; 1->1, 3->2, 5->3, ...
|
|
|
|
|
shr cx,1
|
|
|
|
|
sub bx,cx
|
|
|
|
|
.no_up_tetx:
|
|
|
|
|
mov ecx,ted_color_cur_text
|
|
|
|
|
or ecx,ted_font_size
|
|
|
|
|
call ted_convert_invis_symb
|
|
|
|
|
mcall SF_DRAW_TEXT
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,ted_wnd_t
|
|
|
|
|
add ebx,3
|
|
|
|
|
mov ecx,ted_color_wnd_bord
|
|
|
|
|
or ecx,0x80000000
|
|
|
|
|
lea edx,[txtRow]
|
|
|
|
|
mcall SF_DRAW_TEXT ;<3B>뢮<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '<27><>ப<EFBFBD>'
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
add ebx,0x500000
|
|
|
|
|
lea edx,[txtCol]
|
|
|
|
|
int 0x40 ;<3B>뢮<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '<27><><EFBFBD><EFBFBD>'
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp ted_tim_undo,0
|
|
|
|
|
je @f
|
|
|
|
|
add ebx,0x500000
|
|
|
|
|
lea edx,[txtOtm]
|
|
|
|
|
int 0x40
|
|
|
|
|
sub ebx,0x500000
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
call ted_draw_buffer
|
|
|
|
|
call ted_draw_help_f1
|
|
|
|
|
|
|
|
|
|
mov eax,47 ;draw cursor coords
|
|
|
|
|
mov esi,ted_color_wnd_bord
|
|
|
|
|
or esi,0x40000000
|
|
|
|
|
|
|
|
|
|
mov edx,ebx
|
|
|
|
|
ror edx,16
|
|
|
|
|
sub edx,35
|
|
|
|
|
ror edx,16
|
|
|
|
|
;add edx,3
|
|
|
|
|
mov ebx,0x40000 ;Row=...
|
|
|
|
|
mov ecx,ted_scr_w
|
|
|
|
|
mov ecx,[ecx+sb_offs_position]
|
|
|
|
|
add ecx,ted_cur_y
|
|
|
|
|
inc ecx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
push edi
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,ted_color_wnd_work
|
|
|
|
|
int 0x40 ;<3B>뢮<EFBFBD> <20><> ⥪<>饩 <20><>ப<EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
pop edi
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
;mov ebx,0x40000 ;Col=...
|
|
|
|
|
mov ecx,ted_scr_h
|
|
|
|
|
mov ecx,[ecx+sb_offs_position]
|
|
|
|
|
add ecx,ted_cur_x
|
|
|
|
|
inc ecx
|
|
|
|
|
add edx,0x500000
|
2010-04-29 20:27:40 +02:00
|
|
|
|
push edi
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,ted_color_wnd_work
|
|
|
|
|
int 0x40 ;<3B>뢮<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
pop edi
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp ted_tim_undo,0
|
|
|
|
|
je @f
|
|
|
|
|
mov ecx,ted_tim_undo
|
|
|
|
|
add edx,0x500000
|
|
|
|
|
mov edi,ted_color_wnd_work ;<3B><><EFBFBD>⨬ ॣ<><E0A5A3><EFBFBD><EFBFBD> edi, <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20>㭪樨 <20><><EFBFBD> 㦥 <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int 0x40 ;<3B>뢮<EFBFBD> <20><> <20>⬥<EFBFBD><E2ACA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⢨<EFBFBD>
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
popad
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_draw_buffer
|
|
|
|
|
pushad
|
|
|
|
|
|
|
|
|
|
mov eax,ted_buffer
|
2013-11-14 11:59:09 +01:00
|
|
|
|
cmp dword[eax],1 ;ᬮ<>ਬ ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jl @f
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov ebx,ted_rec_l
|
2010-04-29 20:27:40 +02:00
|
|
|
|
add bx,300
|
2010-05-03 17:12:50 +02:00
|
|
|
|
cmp ebx,ted_wnd_w ;<3B>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD> <20>뢮<EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
|
|
|
|
jge @f ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
add ebx,ted_wnd_l
|
2010-04-29 20:27:40 +02:00
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,ted_wnd_t
|
|
|
|
|
add ebx,3
|
|
|
|
|
mov ecx,ted_color_wnd_bord
|
|
|
|
|
or ecx,0x40000000
|
|
|
|
|
|
|
|
|
|
mov edx,ted_buffer
|
2013-11-14 11:59:09 +01:00
|
|
|
|
add edx,12
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov esi,edx
|
|
|
|
|
mov edi,ted_color_wnd_work ;edi - destroy not pointer to tedit
|
|
|
|
|
call tl_strlen
|
|
|
|
|
;cmp eax,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
;je @f
|
|
|
|
|
cmp eax,20
|
|
|
|
|
jle .crop_buf
|
|
|
|
|
mov eax,20 ;<3B><>१<EFBFBD><E0A5A7> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 20 ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
.crop_buf:
|
|
|
|
|
mov esi,eax
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mcall SF_DRAW_TEXT ;<3B>뢮<EFBFBD> ᮤ<>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
sub ebx,50 shl 16
|
|
|
|
|
lea edx,[txtBuf]
|
|
|
|
|
mov esi,edx
|
|
|
|
|
call tl_strlen
|
|
|
|
|
mov esi,eax
|
|
|
|
|
xor ecx,0x40000000 ;㡨ࠥ<E3A1A8> 梥<> 䮭<>
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mcall SF_DRAW_TEXT ;<3B>뢮<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_draw_help_f1
|
2010-05-03 17:12:50 +02:00
|
|
|
|
pushad
|
|
|
|
|
cmp ted_rec_t,13 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭠<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2>
|
|
|
|
|
jle @f
|
2016-01-21 23:22:11 +01:00
|
|
|
|
;clear place before draw help
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,ted_wnd_w
|
|
|
|
|
sub ebx,ted_rec_l
|
|
|
|
|
mov ecx,ted_wnd_t
|
|
|
|
|
add ecx,13
|
|
|
|
|
shl ecx,16
|
2016-02-19 17:00:48 +01:00
|
|
|
|
add ecx,9 ;9 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>⠢<EFBFBD><E2A0A2><EFBFBD> ted_rec_h <20><><EFBFBD><EFBFBD> <20><><EFBFBD> ࠭<>
|
|
|
|
|
mcall SF_DRAW_RECT,,,ted_color_wnd_capt
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
cmp ted_help_id,-1
|
|
|
|
|
je @f
|
|
|
|
|
mov eax,ted_help_id
|
|
|
|
|
ColToIndexOffset eax,edx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
;SetCoordinates
|
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,ted_wnd_t
|
|
|
|
|
add ebx,13 ;=3+10
|
|
|
|
|
|
|
|
|
|
;SetTextColor
|
|
|
|
|
xor eax,eax
|
2011-08-22 17:58:27 +02:00
|
|
|
|
mov al,byte[edx+MAX_COLOR_WORD_LEN+7]
|
2010-05-03 17:12:50 +02:00
|
|
|
|
shl ax,2
|
|
|
|
|
mov ecx,ted_text_colors
|
|
|
|
|
add ecx,eax
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov ecx,[ecx]
|
2010-05-03 17:12:50 +02:00
|
|
|
|
or ecx,0xc0000000 ;SetTextStyles
|
|
|
|
|
mov esi,edi
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mcall SF_DRAW_TEXT,,,,,ted_color_wnd_work
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov edi,esi
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
mov esi,edx
|
|
|
|
|
call tl_strlen
|
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
;*** draw help string ***
|
|
|
|
|
mov ecx,ted_color_wnd_bord
|
|
|
|
|
or ecx,0x80000000
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edx,[edx+MAX_COLOR_WORD_LEN]
|
|
|
|
|
or edx,edx
|
|
|
|
|
jz @f
|
2010-05-03 17:12:50 +02:00
|
|
|
|
add edx,ted_help_text_f1
|
2016-01-21 23:22:11 +01:00
|
|
|
|
inc eax
|
|
|
|
|
imul eax,6 ;<3B><>ਭ<EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
shl eax,16
|
|
|
|
|
add ebx,eax
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mcall SF_DRAW_TEXT
|
2010-05-03 17:12:50 +02:00
|
|
|
|
@@:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_draw_line_numbers
|
2016-02-19 17:00:48 +01:00
|
|
|
|
pushad
|
|
|
|
|
;top panel with caption
|
|
|
|
|
mov ebx,ted_wnd_l
|
2016-02-21 15:47:33 +01:00
|
|
|
|
;add ebx,ted_rec_l
|
2016-02-19 17:00:48 +01:00
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,ted_wnd_w
|
2016-02-21 15:47:33 +01:00
|
|
|
|
;sub ebx,ted_rec_l
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mov edx,ted_color_wnd_work
|
|
|
|
|
mov ecx,ted_wnd_t
|
|
|
|
|
shl ecx,16
|
|
|
|
|
add ecx,ted_rec_t
|
|
|
|
|
mov edx,ted_color_wnd_capt
|
|
|
|
|
mcall SF_DRAW_RECT
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
;line numbers
|
|
|
|
|
mov ebx,0x40000 ;format
|
|
|
|
|
mov ecx,ted_scr_w
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov ecx,[ecx+sb_offs_position]
|
2016-02-19 17:00:48 +01:00
|
|
|
|
inc ecx
|
|
|
|
|
mov edx,3
|
|
|
|
|
add edx,ted_wnd_l
|
|
|
|
|
rol edx,16
|
|
|
|
|
add edx,ted_wnd_t
|
|
|
|
|
add edx,ted_rec_t
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
push ebx ecx edx
|
2016-02-19 17:00:48 +01:00
|
|
|
|
;left panel with numbers
|
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
mov ecx,ted_rec_h
|
|
|
|
|
rol ecx,16
|
|
|
|
|
mov cx,dx
|
|
|
|
|
rol ecx,16
|
|
|
|
|
mov edx,ted_color_wnd_capt
|
|
|
|
|
mcall SF_DRAW_RECT ;<3B><><EFBFBD>㥬 <20><>אַ㣮<EFACAE>쭨<EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
pop edx ecx ebx
|
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mov esi,ted_color_wnd_bord
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mcall SF_DRAW_NUMBER ;<3B><><EFBFBD>㥬 <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
2016-02-19 17:00:48 +01:00
|
|
|
|
inc ecx
|
|
|
|
|
add edx,ted_rec_h
|
|
|
|
|
sub edx,ted_wnd_t
|
|
|
|
|
mov esi,edx
|
|
|
|
|
and esi,0xffff
|
|
|
|
|
cmp esi,ted_wnd_h
|
|
|
|
|
jge @f
|
|
|
|
|
add edx,ted_wnd_t
|
|
|
|
|
jmp @b
|
|
|
|
|
align 4
|
|
|
|
|
@@:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;output:
|
|
|
|
|
; ah = symbol
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
|
|
|
|
proc KeyConvertToASCII uses ebx, table:dword
|
|
|
|
|
mov ebx,[table] ;convert scan to ascii
|
2010-05-17 18:49:58 +02:00
|
|
|
|
ror ax,8
|
|
|
|
|
xor ah,ah
|
|
|
|
|
add bx,ax ;? ebx,eax
|
|
|
|
|
mov ah,byte[ebx]
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_draw_cur_line, edit:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
pushad
|
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
shl ebx,16
|
|
|
|
|
mov eax,ted_cur_y
|
|
|
|
|
imul eax,ted_rec_h
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov bx,ax
|
2016-02-21 15:47:33 +01:00
|
|
|
|
add ebx,ted_wnd_t
|
|
|
|
|
add ebx,ted_rec_t ;ebx - <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>אַ㣮<EFACAE>쭨<EFBFBD><ECADA8> <20><><EFBFBD><EFBFBD>⪨ <20><><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
add ebx,0x10001 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㪢<EFBFBD> <20><> 業<><E6A5AD><EFBFBD>
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
call ted_sel_normalize ;need before draw select
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov ecx,ted_cur_y
|
|
|
|
|
mov eax,ted_scr_w
|
2016-02-21 15:47:33 +01:00
|
|
|
|
add ecx,[eax+sb_offs_position]
|
|
|
|
|
stdcall ted_clear_line_before_draw,edi,ebx,1,ecx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov eax,ted_scr_h
|
|
|
|
|
mov esi,[eax+sb_offs_position]
|
|
|
|
|
call ted_get_pos_by_coords
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp ted_gp_opt,2
|
|
|
|
|
jne .no_draw_text
|
|
|
|
|
call ted_get_symb_color
|
|
|
|
|
mov esi,1 ;draw 1 symbol
|
|
|
|
|
@@:
|
|
|
|
|
;call ted_iterat_next
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle .no_draw_text
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
; *** 梥⮢<E6A2A5><E2AEA2> ࠧ<><E0A0A7>⪠
|
|
|
|
|
cmp ted_mode_color,0
|
|
|
|
|
je .no_col_change
|
|
|
|
|
cmp byte[edx+1],0
|
|
|
|
|
je .no_col_change
|
|
|
|
|
call ted_get_symb_color
|
|
|
|
|
.no_col_change:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov eax,SF_DRAW_TEXT
|
|
|
|
|
cmp byte [edx],13
|
|
|
|
|
jne .no_13
|
|
|
|
|
cmp ted_mode_invis,1
|
|
|
|
|
jne .no_draw_text
|
|
|
|
|
push edx
|
|
|
|
|
mov edx,edi
|
|
|
|
|
add edx,ted_offs_symbol_new_line
|
|
|
|
|
int 0x40
|
|
|
|
|
pop edx
|
|
|
|
|
jmp .no_draw_text
|
|
|
|
|
align 4
|
|
|
|
|
.no_13:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
int 0x40
|
|
|
|
|
ror ebx,16
|
|
|
|
|
add ebx,ted_rec_w
|
|
|
|
|
mov eax,ted_wnd_w
|
|
|
|
|
add eax,ted_wnd_l ;ax = <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> x
|
|
|
|
|
cmp bx,ax
|
|
|
|
|
jge .no_draw_text ;Opt
|
|
|
|
|
ror ebx,16
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
jmp @b
|
|
|
|
|
align 4
|
|
|
|
|
.no_draw_text:
|
|
|
|
|
|
|
|
|
|
call ted_draw_main_cursor
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; eax - text need find
|
|
|
|
|
; bl - first symbol to find
|
|
|
|
|
; edx - first symbol pointer
|
|
|
|
|
; edi - pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; bh - rezult
|
|
|
|
|
; edx - last text position (if find sucess)
|
|
|
|
|
; esi - first symbol pointer
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> ᮢ<><E1AEA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ⥪<><E2A5AA> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> eax
|
|
|
|
|
; <20> ⥪<>⮬ ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 㪠<><E3AAA0>⥫<EFBFBD> edx.
|
|
|
|
|
; <20>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㭪樨 (<28><><EFBFBD><EFBFBD>. strcmp) <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><>⮬<EFBFBD> <20><><EFBFBD>
|
|
|
|
|
; <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA> ᮤ<>ন<EFBFBD><E0A6A8><EFBFBD> <20><> <20> <20><><EFBFBD><EFBFBD> ascii <20><>ப.
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_get_find_rezult:
|
2016-02-21 15:47:33 +01:00
|
|
|
|
push eax
|
|
|
|
|
mov bh,1
|
|
|
|
|
mov esi,edx ;copy edx
|
|
|
|
|
@@:
|
|
|
|
|
cmp byte[edx],bl
|
|
|
|
|
jne .no_text
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
inc eax ;*** get next symbol (in find text) ***
|
|
|
|
|
mov bl,byte[eax]
|
|
|
|
|
or bl,bl
|
|
|
|
|
jz @f ;end of find text
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
call ted_iterat_next ;*** get next symbol (in editor text) ***
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f ;end of editor text
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
jmp @b
|
|
|
|
|
align 4
|
|
|
|
|
.no_text:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
xor bh,bh
|
|
|
|
|
mov edx,esi ;restore edx
|
2016-02-21 15:47:33 +01:00
|
|
|
|
@@:
|
|
|
|
|
pop eax
|
|
|
|
|
mov bl,byte[eax] ;restore bl
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; clear_o - <20> =1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ப<EFBFBD>, =0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ப<EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword
|
|
|
|
|
pushad
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
|
|
|
|
mov ebx,[coords] ;ebx = x*2^16+y coords to left up point clear line
|
|
|
|
|
mov esi,[numb_lin] ;esi - number text line
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
sub ebx,0x10001 ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㪢<EFBFBD> <20><> 業<><E6A5AD><EFBFBD>
|
|
|
|
|
cmp dword[clear_o],0
|
|
|
|
|
jne @f
|
|
|
|
|
add ebx,ted_rec_h
|
|
|
|
|
ror ebx,16
|
|
|
|
|
xor bx,bx
|
|
|
|
|
add ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l ;bx = ted_wnd_l+ted_rec_l
|
|
|
|
|
ror ebx,16
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
mov eax,ted_wnd_h
|
|
|
|
|
add eax,ted_wnd_t
|
|
|
|
|
cmp ax,bx
|
|
|
|
|
jl .no_clear
|
|
|
|
|
sub ax,bx
|
|
|
|
|
|
|
|
|
|
mov cx,bx
|
|
|
|
|
shl ecx,16
|
|
|
|
|
|
|
|
|
|
xor bx,bx
|
|
|
|
|
add ebx,ted_wnd_w
|
|
|
|
|
sub ebx,ted_rec_l
|
|
|
|
|
xor cx,cx
|
|
|
|
|
add ecx,ted_rec_h
|
|
|
|
|
mov edx,ted_color_wnd_work
|
|
|
|
|
|
|
|
|
|
cmp dword[clear_o],0
|
|
|
|
|
je .pusto
|
|
|
|
|
cmp ax,cx
|
|
|
|
|
jge @f
|
|
|
|
|
.pusto:
|
|
|
|
|
mov cx,ax
|
2014-06-27 23:34:57 +02:00
|
|
|
|
jmp .no_select ;<3B> <20><><EFBFBD><EFBFBD>⪠ <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>, <20><> <20>ᥣ<EFBFBD><E1A5A3> 䮭<><E4AEAD><EFBFBD><EFBFBD> 梥⮬
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
call ted_is_select
|
2019-01-21 12:39:35 +01:00
|
|
|
|
or al,al
|
|
|
|
|
jz .no_select
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp ted_seln_y0,esi
|
2014-06-27 23:34:57 +02:00
|
|
|
|
jg .no_select
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp ted_seln_y1,esi
|
2014-06-27 23:34:57 +02:00
|
|
|
|
jl .no_select
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov edx,ted_color_select ;draw selected line
|
2014-06-27 23:34:57 +02:00
|
|
|
|
.no_select:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mcall SF_DRAW_RECT ;<3B><><EFBFBD><EFBFBD><EFBFBD>᪠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> 梥⮬ 䮭<> <20><><EFBFBD> 梥⮬ <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
call ted_is_select
|
2016-02-19 17:00:48 +01:00
|
|
|
|
or al,al
|
|
|
|
|
jz .no_clear
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mov al,SF_DRAW_RECT
|
2010-04-29 20:27:40 +02:00
|
|
|
|
xor cx,cx
|
|
|
|
|
add ecx,ted_rec_h
|
|
|
|
|
cmp ted_seln_y0,esi
|
|
|
|
|
jne @f
|
|
|
|
|
push bx esi
|
|
|
|
|
mov edx,ted_seln_x0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD>ࠥ<EFBFBD> <><E1ABA5>)
|
|
|
|
|
mov esi,ted_scr_h
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp edx,[esi+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jle .in_wnd
|
2016-02-21 15:47:33 +01:00
|
|
|
|
sub edx,[esi+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
imul edx,ted_rec_w
|
|
|
|
|
mov bx,dx
|
|
|
|
|
jmp .no_wnd
|
|
|
|
|
.in_wnd:
|
2018-10-21 22:10:31 +02:00
|
|
|
|
xor bx,bx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
.no_wnd:
|
|
|
|
|
mov edx,ted_color_wnd_work
|
|
|
|
|
int 0x40
|
|
|
|
|
pop esi bx
|
|
|
|
|
@@:
|
|
|
|
|
cmp ted_seln_y1,esi
|
|
|
|
|
jne @f
|
2014-06-27 23:34:57 +02:00
|
|
|
|
;push esi
|
|
|
|
|
;<3B> <20>뤥<EFBFBD><EBA4A5><EFBFBD> <20><><EFBFBD><EFBFBD> 䠩<> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ᤥ<><E1A4A5><EFBFBD><EFBFBD> <20><>室, <20><> ⮣<><E2AEA3> <20>㦭<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> jmp .no_select
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov edx,ted_seln_x1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD>ࠥ<EFBFBD> <20><>ࠢ<EFBFBD>)
|
|
|
|
|
mov esi,ted_scr_h
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp edx,[esi+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jle .in_wnd2
|
2016-02-21 15:47:33 +01:00
|
|
|
|
sub edx,[esi+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
imul edx,ted_rec_w
|
|
|
|
|
sub bx,dx
|
|
|
|
|
shl edx,16
|
|
|
|
|
add ebx,edx
|
|
|
|
|
.in_wnd2:
|
|
|
|
|
mov edx,ted_color_wnd_work
|
|
|
|
|
int 0x40
|
2014-06-27 23:34:57 +02:00
|
|
|
|
;pop esi
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
.no_clear:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; ecx = <20><><EFBFBD><EFBFBD><EFBFBD> 梥<> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
|
|
|
|
; edx = pointer to symbol
|
|
|
|
|
; edx = 0 if text not in screen
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_get_first_visible_pos:
|
|
|
|
|
push eax ecx
|
|
|
|
|
mov eax,ted_scr_w
|
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
xor ecx,ecx
|
|
|
|
|
@@:
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp ecx,[eax+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
je @f
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
2016-02-19 17:00:48 +01:00
|
|
|
|
cmp byte[edx],13
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jne @b
|
|
|
|
|
inc ecx
|
|
|
|
|
jmp @b
|
2016-02-19 17:00:48 +01:00
|
|
|
|
align 4
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp ecx,[eax+sb_offs_position]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
je @f
|
|
|
|
|
xor edx,edx
|
|
|
|
|
@@:
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp ecx,[eax+sb_offs_max_area]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jle @f
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov [eax+sb_offs_max_area],ecx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
@@:
|
|
|
|
|
pop ecx eax
|
|
|
|
|
call ted_opt_draw_line_left
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to symbol
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; ecx = 梥<> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
|
|
|
|
; edx = 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD>
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20>㦭<EFBFBD> <20><><EFBFBD> <20><>⨬<EFBFBD><E2A8AC><EFBFBD>樨 <20>뢮<EFBFBD><EBA2AE> ⥪<><E2A5AA><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2016-02-19 17:00:48 +01:00
|
|
|
|
proc ted_opt_draw_line_left uses ebx
|
|
|
|
|
mov ebx,ted_scr_h
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov ebx,[ebx+sb_offs_position]
|
2016-02-19 17:00:48 +01:00
|
|
|
|
or ebx,ebx
|
|
|
|
|
jz .ret_f
|
|
|
|
|
push eax
|
|
|
|
|
mov eax,edx
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
cmp edx,ted_tex
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
jmp .beg_cycle
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
or ebx,ebx
|
|
|
|
|
jz @f
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-19 17:00:48 +01:00
|
|
|
|
cmp byte[edx],13
|
|
|
|
|
jne @f
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
.beg_cycle:
|
|
|
|
|
@@:
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
cmp byte[edx],13
|
|
|
|
|
je @f
|
|
|
|
|
or ebx,ebx
|
|
|
|
|
jz @f
|
2010-04-29 20:27:40 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
xor eax,eax ;eax <20>㤥<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov al,byte[edx+1]
|
2016-02-19 17:00:48 +01:00
|
|
|
|
or al,al
|
|
|
|
|
jz .no_color
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp eax,ted_colors_text_count
|
|
|
|
|
jge .no_color
|
2016-02-19 17:00:48 +01:00
|
|
|
|
xor ecx,ecx
|
|
|
|
|
mov cl,byte[edx+1]
|
|
|
|
|
shl cx,2
|
|
|
|
|
add ecx,ted_text_colors
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov ecx,[ecx]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
.no_color:
|
|
|
|
|
;--------------------------------------
|
2016-02-19 17:00:48 +01:00
|
|
|
|
mov eax,edx
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
dec ebx
|
|
|
|
|
jmp @b
|
|
|
|
|
align 4
|
|
|
|
|
@@:
|
|
|
|
|
mov edx,eax
|
|
|
|
|
pop eax
|
|
|
|
|
.ret_f:
|
|
|
|
|
call ted_get_symb_color
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to symbol
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
;output:
|
|
|
|
|
; ecx = symbol color
|
|
|
|
|
; edx = pointer to 13 symbol
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20>㦭<EFBFBD> <20><><EFBFBD> <20><>⨬<EFBFBD><E2A8AC><EFBFBD>樨 <20>뢮<EFBFBD><EBA2AE> ⥪<><E2A5AA><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_opt_draw_line_right
|
|
|
|
|
push eax
|
|
|
|
|
mov eax,edx
|
|
|
|
|
@@:
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f
|
|
|
|
|
cmp byte[edx],13
|
|
|
|
|
je @f
|
|
|
|
|
mov eax,edx
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
mov edx,eax ;perv sumbol
|
|
|
|
|
call ted_get_symb_color
|
|
|
|
|
|
|
|
|
|
pop eax
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
proc ted_mouse, edit:dword
|
|
|
|
|
pushad
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;<3B><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0> <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov edx,ted_scr_h
|
|
|
|
|
mov ecx,ted_scr_w
|
|
|
|
|
|
|
|
|
|
cmp word[edx+sb_offs_delta2],0
|
|
|
|
|
jne .horizontal
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov eax,[ecx+sb_offs_max_area]
|
|
|
|
|
cmp eax,[ecx+sb_offs_cur_area]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jbe .horizontal
|
|
|
|
|
; mouse event for Vertical ScrollBar
|
|
|
|
|
stdcall scroll_bar_vertical.mouse,ecx ;[scrollbar_ver_mouse]
|
|
|
|
|
cmp dword[ecx+sb_offs_redraw],0
|
|
|
|
|
je @f
|
|
|
|
|
mov dword[ecx+sb_offs_redraw],0
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
jmp .no_in_wnd
|
|
|
|
|
@@:
|
|
|
|
|
cmp word[ecx+sb_offs_delta2],0
|
|
|
|
|
jne .no_in_wnd
|
|
|
|
|
.horizontal:
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov eax,[edx+sb_offs_max_area]
|
|
|
|
|
cmp eax,[edx+sb_offs_cur_area]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
jbe .other
|
|
|
|
|
; mouse event for Horizontal ScrollBar
|
|
|
|
|
stdcall scroll_bar_horizontal.mouse,edx ;[scrollbar_hor_mouse]
|
|
|
|
|
cmp dword[edx+sb_offs_redraw],0
|
|
|
|
|
je .other
|
|
|
|
|
mov dword[edx+sb_offs_redraw],0
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
jmp .no_in_wnd
|
|
|
|
|
.other:
|
|
|
|
|
cmp word[ecx+sb_offs_delta2],0
|
|
|
|
|
jne .no_in_wnd
|
|
|
|
|
cmp word[edx+sb_offs_delta2],0
|
|
|
|
|
jne .no_in_wnd
|
|
|
|
|
|
|
|
|
|
;<3B><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mcall SF_MOUSE_GET,SSF_BUTTON
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp al,1
|
|
|
|
|
jne @f
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov ebx,ted_wnd_t
|
|
|
|
|
add ebx,ted_rec_t
|
|
|
|
|
cmp ax,bx
|
|
|
|
|
jl @f ;y_mouse<y_wnd
|
|
|
|
|
|
|
|
|
|
sub ebx,ted_rec_t
|
|
|
|
|
add ebx,ted_wnd_h
|
|
|
|
|
cmp bx,ax
|
|
|
|
|
jl @f ;y_mouse>y_wnd
|
|
|
|
|
|
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
mov ecx,eax
|
|
|
|
|
shr ecx,16
|
|
|
|
|
cmp cx,bx
|
|
|
|
|
jl @f ;x_mouse<x_wnd
|
|
|
|
|
|
|
|
|
|
sub ebx,ted_rec_l
|
|
|
|
|
add ebx,ted_wnd_w
|
|
|
|
|
cmp bx,cx
|
|
|
|
|
jl @f ;x_mouse>x_wnd
|
|
|
|
|
|
|
|
|
|
call ted_draw_cursor_sumb
|
|
|
|
|
call ted_wnd_main_click
|
|
|
|
|
jmp .no_in_wnd
|
|
|
|
|
@@:
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov edx,ted_el_focus
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp [edx],edi
|
2010-05-03 17:12:50 +02:00
|
|
|
|
jne @f
|
|
|
|
|
call ted_wnd_main_mouse_scroll ;ᬮ<>ਬ <20><> <20>ப<EFBFBD><E0AEAA><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
cmp ted_drag_m,0
|
|
|
|
|
je .no_in_wnd
|
|
|
|
|
mov ted_drag_m,0
|
|
|
|
|
stdcall ted_draw,edi
|
|
|
|
|
cmp ted_fun_draw_panel_buttons,0
|
|
|
|
|
je .no_in_wnd
|
|
|
|
|
call ted_fun_draw_panel_buttons
|
|
|
|
|
.no_in_wnd:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; eax -> (x,y)
|
|
|
|
|
; edi -> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> tedit
|
|
|
|
|
;description:
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD>뢥<EFBFBD><EBA2A5><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⨨ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_wnd_main_click:
|
2010-05-03 17:12:50 +02:00
|
|
|
|
push ebx ecx edx
|
|
|
|
|
mov ebx,ted_el_focus
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov [ebx],edi ;<3B>⠢<EFBFBD><E2A0A2> 䮪<><E4AEAA>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
push eax
|
|
|
|
|
shr eax,16
|
|
|
|
|
sub eax,ted_wnd_l
|
|
|
|
|
sub eax,ted_rec_l
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
xor edx,edx
|
|
|
|
|
mov ecx,ted_rec_w
|
|
|
|
|
div cx
|
|
|
|
|
;inc eax
|
|
|
|
|
mov ebx,ted_scr_h
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp eax,[ebx+sb_offs_cur_area]
|
2016-01-21 23:22:11 +01:00
|
|
|
|
jle @f
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov eax,[ebx+sb_offs_cur_area]
|
2016-01-21 23:22:11 +01:00
|
|
|
|
@@:
|
|
|
|
|
;dec eax
|
|
|
|
|
mov ted_cur_x,eax
|
|
|
|
|
pop eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-01-21 23:22:11 +01:00
|
|
|
|
push eax
|
|
|
|
|
and eax,0xffff
|
|
|
|
|
sub eax,ted_wnd_t
|
|
|
|
|
sub eax,ted_rec_t
|
|
|
|
|
|
|
|
|
|
xor edx,edx
|
|
|
|
|
mov ecx,ted_rec_h
|
|
|
|
|
div cx
|
|
|
|
|
inc eax
|
|
|
|
|
mov ebx,ted_scr_w
|
2016-02-21 15:47:33 +01:00
|
|
|
|
cmp eax,[ebx+sb_offs_cur_area]
|
2016-01-21 23:22:11 +01:00
|
|
|
|
jle @f
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov eax,[ebx+sb_offs_cur_area]
|
2016-01-21 23:22:11 +01:00
|
|
|
|
@@:
|
|
|
|
|
dec eax
|
|
|
|
|
mov ted_cur_y,eax
|
|
|
|
|
pop eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
cmp ted_drag_m,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_sel_move
|
|
|
|
|
jmp .sel_move
|
|
|
|
|
@@:
|
|
|
|
|
mov ted_drag_m,1
|
|
|
|
|
call ted_sel_start
|
|
|
|
|
.sel_move:
|
|
|
|
|
pop edx ecx ebx
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2010-04-29 20:27:40 +02:00
|
|
|
|
ted_wnd_main_mouse_scroll:
|
|
|
|
|
push eax ebx ecx
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mcall SF_MOUSE_GET,SSF_SCROLL_DATA
|
|
|
|
|
or ax,ax
|
|
|
|
|
jz .no_scroll
|
2010-04-29 20:27:40 +02:00
|
|
|
|
mov ecx,ted_scr_w
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov ebx,[ecx+sb_offs_position] ;copy old scroll position
|
2010-04-29 20:27:40 +02:00
|
|
|
|
and eax,0xffff
|
|
|
|
|
btr ax,15
|
|
|
|
|
jae @f
|
|
|
|
|
or eax,0xffff8000
|
2010-05-03 17:12:50 +02:00
|
|
|
|
@@:
|
2016-02-21 15:47:33 +01:00
|
|
|
|
add [ecx+sb_offs_position],eax
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2010-05-03 17:12:50 +02:00
|
|
|
|
mov eax,[ecx+sb_offs_position]
|
|
|
|
|
cmp eax,[ecx+sb_offs_max_area]
|
|
|
|
|
jb @f
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov [ecx+sb_offs_position],ebx ;if scroll position out of range
|
2010-05-03 17:12:50 +02:00
|
|
|
|
jmp .no_scroll
|
|
|
|
|
@@:
|
|
|
|
|
stdcall ted_draw,edi
|
2010-04-29 20:27:40 +02:00
|
|
|
|
.no_scroll:
|
|
|
|
|
pop ecx ebx eax
|
|
|
|
|
ret
|
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
align 16
|
2013-11-28 11:35:07 +01:00
|
|
|
|
proc ted_save_file, edit:dword, file:dword, f_name:dword
|
2016-02-21 15:47:33 +01:00
|
|
|
|
pushad
|
|
|
|
|
mov edi,[edit]
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
stdcall ted_can_save,edi
|
|
|
|
|
;or al,al
|
|
|
|
|
;jz .no_save
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov ecx,ted_max_chars
|
|
|
|
|
invoke mem.alloc,ecx
|
|
|
|
|
push eax ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
mov edx,ted_tex
|
|
|
|
|
xor ecx,ecx
|
|
|
|
|
@@:
|
|
|
|
|
call ted_iterat_next
|
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f ;edx = ted_tex or edx = ted_tex+sizeof.symbol
|
|
|
|
|
mov bl,[edx]
|
|
|
|
|
mov byte[eax],bl
|
|
|
|
|
inc eax
|
|
|
|
|
inc ecx
|
|
|
|
|
jmp @b
|
|
|
|
|
align 4
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
or ecx,ecx
|
|
|
|
|
jz @f
|
|
|
|
|
mov ebx,[file]
|
|
|
|
|
pop eax ;<3B><><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov [ebx+16],eax
|
|
|
|
|
push eax ;<3B><><EFBFBD><EFBFBD>⭮ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov dword[ebx], SSF_CREATE_FILE
|
|
|
|
|
mov dword[ebx+4], 0
|
|
|
|
|
mov dword[ebx+8], 0
|
|
|
|
|
mov [ebx+12], ecx
|
|
|
|
|
mov byte[ebx+20], 0
|
|
|
|
|
push dword[f_name]
|
|
|
|
|
pop dword[ebx+21]
|
|
|
|
|
mcall SF_FILE
|
|
|
|
|
|
|
|
|
|
mov ted_err_save,al
|
|
|
|
|
|
|
|
|
|
or eax,eax
|
|
|
|
|
jz .no_msg
|
|
|
|
|
;cmp eax,6
|
|
|
|
|
;je @f
|
|
|
|
|
cmp ax,10
|
|
|
|
|
jl .zifra_0_9
|
|
|
|
|
mov al,'?'
|
|
|
|
|
sub ax,48
|
|
|
|
|
.zifra_0_9:
|
|
|
|
|
add ax,48
|
|
|
|
|
cmp ted_fun_save_err,0
|
|
|
|
|
je @f
|
|
|
|
|
call ted_fun_save_err
|
|
|
|
|
jmp @f
|
|
|
|
|
.no_msg:
|
|
|
|
|
m2m ted_tim_ls,ted_tim_ch
|
|
|
|
|
@@:
|
2010-04-29 20:27:40 +02:00
|
|
|
|
|
2016-02-21 15:47:33 +01:00
|
|
|
|
pop ecx ;<3B><><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
invoke mem.free,ecx
|
|
|
|
|
.no_save:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2010-04-29 20:27:40 +02:00
|
|
|
|
endp
|