Subversion Repositories Kolibri OS

Rev

Rev 7577 | Rev 7583 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7577 Rev 7579
Line 1... Line 1...
1
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
1
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
2
; í«¥¬¥­â TextEditor ¤«ï Kolibri OS
2
; í«¥¬¥­â TextEditor ¤«ï Kolibri OS
3
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 21.10.2018 IgorA
3
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 29.01.2019 IgorA
4
; ­  ª®¤ ¯à¨¬¥­¥­  GPL2 «¨æ¥­§¨ï
4
; ­  ª®¤ ¯à¨¬¥­¥­  GPL2 «¨æ¥­§¨ï
Line 5... Line 5...
5
 
5
 
6
;input:
6
;input:
7
; edi = pointer to tedit struct
7
; edi = pointer to tedit struct
Line 18... Line 18...
18
	mov out_reg,ind_reg
18
	mov out_reg,ind_reg
19
	imul out_reg,sizeof.TexColViv
19
	imul out_reg,sizeof.TexColViv
20
	add out_reg,ted_key_words_data
20
	add out_reg,ted_key_words_data
21
}
21
}
Line 22... Line -...
22
 
-
 
23
TED_PANEL_NULL	 equ 0 ;­¥â ®âªàë⮩ ¯ ­¥«¨
-
 
24
TED_PANEL_FIND	 equ 1 ;¯ ­¥«ì ¯®¨áª 
-
 
25
TED_PANEL_SYNTAX equ 2 ;¯ ­¥«ì ¢ë¡®à  ä ©«®¢ ¯®¤á¢¥âª¨
-
 
26
TED_PANEL_REPLACE equ 3 ;¯ ­¥«ì § ¬¥­ë
-
 
27
TED_PANEL_WIDTH  equ 150 ;è¨à¨­  ¯ ­¥«¨
-
 
28
 
22
 
29
TED_LINES_IN_NEW_FILE equ 30 ;ç¨á«® áâப ¢ ­®¢®¬ ä ©«¥
23
TED_LINES_IN_NEW_FILE equ 30 ;ç¨á«® áâப ¢ ­®¢®¬ ä ©«¥
30
MAX_COLOR_WORD_LEN equ 40
24
MAX_COLOR_WORD_LEN equ 40
31
;------------------------------------------------------------------------------
25
;------------------------------------------------------------------------------
32
struct TexSelect
26
struct TexSelect
Line 239... Line 233...
239
	@@:
233
	@@:
Line 240... Line 234...
240
 
234
 
241
	test esi,KM_CTRL ;Ctrl+...
235
	test esi,KM_CTRL ;Ctrl+...
242
	jz .key_Ctrl
236
	jz .key_Ctrl
-
 
237
		; *** ¢ë§®¢ ¢­¥è­¨å ä㭪権 ª®â®àë¥ âॡãîâ ®ª­  ®âªàëâ¨ï/á®åà ­¥­¨ï/¯®¨áª /...
-
 
238
		cmp ted_fun_on_key_ctrl_all,0
-
 
239
		je .end0
243
		; *** ¢ë§®¢ ¢­¥è­¨å ä㭪権 ª®â®àë¥ âॡãîâ ®ª­  ®âªàëâ¨ï/á®åà ­¥­¨ï/¯®¨áª /...
240
		xor al,al
244
		cmp ah,24 ;Ctrl+O
241
		cmp ah,24 ;Ctrl+O
245
		jne @f
-
 
246
			cmp ted_fun_on_key_ctrl_o,0
242
		jne @f
247
			je .end_key_fun
-
 
248
				call ted_fun_on_key_ctrl_o
243
			mov al,'O'
249
		@@:
244
		@@:
250
		cmp ah,31 ;Ctrl+S
-
 
251
		jne .end_ctrl_s
-
 
252
			cmp ted_fun_on_key_ctrl_s,0
-
 
253
			je .end_key_fun
-
 
254
				xor eax,eax
-
 
255
				test esi,KM_SHIFT
245
		cmp ah,31 ;Ctrl+S
256
				jz @f
246
		jne @f
257
					inc eax
247
			mov al,'S'
258
				@@:				
-
 
259
				call ted_fun_on_key_ctrl_s
-
 
260
				jmp .end_key_fun
-
 
261
		.end_ctrl_s:
248
		@@:
262
		cmp ah,33 ;Ctrl+F
249
		cmp ah,33 ;Ctrl+F
-
 
250
		jne @f
-
 
251
			mov al,'F'
263
		jne @f
252
		@@:
264
		cmp ted_panel_id,TED_PANEL_FIND
253
		cmp ah,34 ;Ctrl+G
-
 
254
		jne @f
-
 
255
			mov al,'G'
265
		je @f
256
		@@:
266
			cmp ted_fun_on_key_ctrl_f,0
257
		cmp ah,35 ;Ctrl+H
267
			je .end_key_fun
258
		jne @f
268
				call ted_fun_on_key_ctrl_f
259
			mov al,'H'
269
		@@:
260
		@@:
270
		cmp ah,49 ;Ctrl+N
261
		cmp ah,49 ;Ctrl+N
271
		jne @f
262
		jne @f
-
 
263
			mov al,'N'
-
 
264
		@@:
272
			cmp ted_fun_on_key_ctrl_n,0
265
		or al,al
-
 
266
		jz .end0
273
			je .end_key_fun
267
			and eax,0xff
-
 
268
			test esi,KM_SHIFT
-
 
269
			jz @f
274
				call ted_fun_on_key_ctrl_n
270
				or eax,0x100
-
 
271
			@@:
-
 
272
			stdcall ted_fun_on_key_ctrl_all, eax
-
 
273
			jmp .end_key_fun
-
 
274
		.end0:
275
		@@:
275
 
276
		; *** ¢ë§®¢ ¢­ãâ७­¨å ä㭪権
276
		; *** ¢ë§®¢ ¢­ãâ७­¨å ä㭪権
277
		cmp ah,30 ;Ctrl+A
277
		cmp ah,30 ;Ctrl+A
278
		jne @f
278
		jne @f
279
			call ted_sel_all
279
			call ted_sel_all
Line 439... Line 439...
439
	cmp ah,0x80 ;if key up
439
	cmp ah,0x80 ;if key up
440
	ja .end_key_fun
440
	ja .end_key_fun
Line 441... Line 441...
441
 
441
 
442
	cmp dword[table],0
442
	cmp dword[table],0
443
	je @f
443
	je @f
444
		stdcall KeyConvertToASCII, dword[table]
444
		stdcall KeyConvertToASCII, [table]
Line 445... Line 445...
445
	@@:
445
	@@:
Line 446... Line 446...
446
 
446
 
Line 1167... Line 1167...
1167
			.no_cur_mov:
1167
			.no_cur_mov:
Line 1168... Line 1168...
1168
 
1168
 
1169
			; *** ¢áâ ¢ª  ⥪ã饣® ᨬ¢®«  ¨§ áâப¨ ***
1169
			; *** ¢áâ ¢ª  ⥪ã饣® ᨬ¢®«  ¨§ áâப¨ ***
1170
			mov ecx,ted_opt_ed_change_time
1170
			mov ecx,ted_opt_ed_change_time
1171
			not ecx
1171
			not ecx
Line 1172... Line 1172...
1172
			and dword[add_opt],ecx ;n_tim=false;
1172
			and [add_opt],ecx ;n_tim=false;
1173
 
1173
 
1174
			mov cl,byte [esi] ;tex[i].c=ta[ns];
1174
			mov cl,byte[esi] ;tex[i].c=ta[ns];
1175
			mov byte [edx],cl
1175
			mov byte[edx],cl
Line 2044... Line 2044...
2044
	pop edx ebx eax
2044
	pop edx ebx eax
2045
	.no_work:
2045
	.no_work:
2046
	ret
2046
	ret
2047
endp
2047
endp
Line -... Line 2048...
-
 
2048
 
-
 
2049
;description:
-
 
2050
; ¯¥à¥å®¤ ­  㪠§ ­­ãî ¯®§¨æ¨î
-
 
2051
;input:
-
 
2052
; row = ­®¬¥à áâப¨
-
 
2053
; col = ᨬ¢®«
-
 
2054
align 16
-
 
2055
proc ted_go_to_position uses ecx edx edi, edit:dword, row:dword, col:dword
-
 
2056
	mov edi,[edit]
-
 
2057
	; ¯®¤£®â®¢ª  áâப¨
-
 
2058
	mov edx,[row]
-
 
2059
	call ted_get_num_lines
-
 
2060
	cmp edx,eax
-
 
2061
	jle @f
-
 
2062
		mov edx,eax ;®£à ­¨ç¥­¨¥ ¯® áâப¥ max
-
 
2063
	@@:
-
 
2064
	dec edx
-
 
2065
	cmp edx,0
-
 
2066
	jge @f
-
 
2067
		xor edx,edx ;®£à ­¨ç¥­¨¥ ¯® áâப¥ min
-
 
2068
	@@:
-
 
2069
	; ¯®¤£®â®¢ª  ᨬ¢®« 
-
 
2070
	mov ecx,[col]
-
 
2071
	dec ecx
-
 
2072
	cmp ecx,0
-
 
2073
	jge @f
-
 
2074
		xor ecx,ecx
-
 
2075
	@@:
-
 
2076
	call ted_go_to_pos
-
 
2077
	stdcall ted_draw,edi
-
 
2078
	ret
-
 
2079
endp
2048
 
2080
 
2049
;input:
2081
;input:
2050
; ecx = Col
2082
; ecx = Col
2051
; edx = Row
2083
; edx = Row
2052
; edi = pointer to tedit struct
2084
; edi = pointer to tedit struct
Line 3496... Line 3528...
3496
	shl ebx,16
3528
	shl ebx,16
3497
	mov bx,word[esi+sb_offs_size_x]
3529
	mov bx,word[esi+sb_offs_size_x]
3498
	inc bx
3530
	inc bx
3499
	int 0x40
3531
	int 0x40
Line 3500... Line 3532...
3500
 
3532
 
3501
	cmp ted_fun_draw_panel_find,0
3533
	cmp ted_fun_draw_panels,0
3502
	je @f
3534
	je @f
3503
		call ted_fun_draw_panel_find
-
 
3504
	@@:
-
 
3505
	cmp ted_fun_draw_panel_syntax,0
-
 
3506
	je @f
-
 
3507
		call ted_fun_draw_panel_syntax
3535
		stdcall ted_fun_draw_panels, edi
3508
	@@:
3536
	@@:
3509
	popad
3537
	popad
3510
	ret
3538
	ret
Line 3511... Line 3539...
3511
endp
3539
endp
3512
 
3540
 
3513
;input:
3541
;input:
3514
; edi = pointer to tedit struct
3542
; edi = pointer to tedit struct
3515
align 16
3543
align 16
3516
proc ted_draw_main_cursor
-
 
3517
pushad
3544
proc ted_draw_main_cursor
3518
 
3545
pushad
3519
	mov eax,SF_DRAW_RECT ;draw cursor
3546
	mov eax,SF_DRAW_RECT ;draw cursor
3520
	mov ecx,ted_wnd_t ;calc rect -> y0,y1
3547
	mov ecx,ted_wnd_t ;calc rect -> y0,y1
3521
	add ecx,ted_rec_t
3548
	add ecx,ted_rec_t
Line 3809... Line 3836...
3809
;output:
3836
;output:
3810
; ah = symbol
3837
; ah = symbol
3811
align 16
3838
align 16
3812
proc KeyConvertToASCII uses ebx, table:dword
3839
proc KeyConvertToASCII uses ebx, table:dword
3813
	mov ebx,[table] ;convert scan to ascii
3840
	mov ebx,[table] ;convert scan to ascii
3814
	ror ax,8
3841
	shr ax,8
3815
	xor ah,ah
-
 
3816
	add bx,ax ;? ebx,eax
3842
	add bx,ax ;? ebx,eax
3817
	mov ah,byte[ebx]
3843
	mov ah,byte[ebx]
3818
	ret
3844
	ret
3819
endp
3845
endp