Subversion Repositories Kolibri OS

Rev

Rev 6087 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6087 Rev 6256
Line 1... Line 1...
1
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
1
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
2
; í«¥¬¥­â TextEditor ¤«ï Kolibri OS
2
; í«¥¬¥­â TextEditor ¤«ï Kolibri OS
3
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 21.01.2016 IgorA
3
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 19.02.2016 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 167... Line 167...
167
	bt dword[opt],1 ; ¨§¬¥­¨«¨áì à §¬¥àë ®ª­  ?
167
	bt dword[opt],1 ; ¨§¬¥­¨«¨áì à §¬¥àë ®ª­  ?
168
	jae .no_size
168
	jae .no_size
169
			mov edx,ted_wnd_l
169
			mov edx,ted_wnd_l
170
			add edx,ted_rec_l
170
			add edx,ted_rec_l
171
			mov word[ebx+sb_offs_start_x],dx ;¢ëáâ ¢«ï¥¬ «¥¢ë© ®âáâ㯠£®à¨§. áªà®««¨­£ 
171
			mov word[ebx+sb_offs_start_x],dx ;¢ëáâ ¢«ï¥¬ «¥¢ë© ®âáâ㯠£®à¨§. áªà®««¨­£ 
172
		mov eax,ted_wnd_h ;calculate lines in page
172
			mov eax,ted_wnd_h ;calculate lines in page
173
			mov edx,ted_wnd_t
173
			mov edx,ted_wnd_t
174
			add edx,eax
174
			add edx,eax
175
			mov word[ebx+sb_offs_start_y],dx ;¢ëáâ ¢«ï¥¬ ¢¥àå­¨© ®âáâ㯠£®à¨§. áªà®««¨­£ 
175
			mov word[ebx+sb_offs_start_y],dx ;¢ëáâ ¢«ï¥¬ ¢¥àå­¨© ®âáâ㯠£®à¨§. áªà®««¨­£ 
176
		sub eax,ted_rec_t
176
		sub eax,ted_rec_t
177
		xor edx,edx
177
		xor edx,edx
Line 1252... Line 1252...
1252
;  edi = pointer to tedit struct
1252
;  edi = pointer to tedit struct
1253
;output:
1253
;output:
1254
;  ecx = position to inserted cell
1254
;  ecx = position to inserted cell
1255
align 4
1255
align 4
1256
ted_char_add:
1256
ted_char_add:
-
 
1257
	.loop_b:
-
 
1258
		cmp ecx,ted_tex_end
-
 
1259
		jge .end_f
-
 
1260
		cmp dword[ecx+10],0
-
 
1261
		jne @f
-
 
1262
			cmp dword[ecx+14],0
-
 
1263
			je .loop_e
-
 
1264
		@@:
-
 
1265
		add ecx,sizeof.symbol
-
 
1266
		jmp .loop_b
-
 
1267
align 4
-
 
1268
	.loop_e:
Line 1257... Line -...
1257
 
-
 
1258
  .loop_b:
-
 
1259
    cmp ecx,ted_tex_end
-
 
1260
    jge .end_f
-
 
1261
    cmp dword[ecx+10],0
-
 
1262
    jne @f
-
 
1263
      cmp dword[ecx+14],0
-
 
1264
      je .loop_e
-
 
1265
    @@:
-
 
1266
    add ecx,sizeof.symbol
-
 
1267
    jmp .loop_b
-
 
1268
  .loop_e:
-
 
1269
 
1269
 
1270
  push eax ebx
1270
	push eax ebx
1271
  mov eax,ted_tim_ch
1271
	mov eax,ted_tim_ch
1272
  mov dword[ecx+10],eax
1272
	mov dword[ecx+10],eax
1273
  mov ax,si
1273
	mov ax,si
1274
  mov byte[ecx],al
1274
	mov byte[ecx],al
1275
 
1275
 
1276
  call ted_get_text_arr_index ; *** eax=pos ***
1276
	call ted_get_text_arr_index ; *** eax=pos ***
1277
  mov [ecx+2],eax ;tex[i].perv=pos;
1277
	mov [ecx+2],eax ;tex[i].perv=pos;
Line 1278... Line 1278...
1278
  m2m dword[ecx+6],dword[edx+6] ;tex[i].next=tex[pos].next;
1278
	m2m dword[ecx+6],dword[edx+6] ;tex[i].next=tex[pos].next;
1279
 
1279
 
1280
  push edx
1280
	push edx
1281
    mov edx,ecx
1281
		mov edx,ecx
Line 1282... Line 1282...
1282
    call ted_get_text_arr_index ; *** eax=i ***
1282
		call ted_get_text_arr_index ; *** eax=i ***
1283
  pop edx
1283
	pop edx
1284
 
1284
 
1285
  mov [edx+6],eax ;tex[pos].next=i; // áá뫪¨ ¯¥à¥­ ¯à ¢«ï¥¬
1285
	mov [edx+6],eax ;tex[pos].next=i; // áá뫪¨ ¯¥à¥­ ¯à ¢«ï¥¬
1286
  mov ebx,[ecx+6]
1286
	mov ebx,[ecx+6]
Line 1287... Line 1287...
1287
  ConvertIndexToPointer ebx
1287
	ConvertIndexToPointer ebx
1288
  mov [ebx+2],eax ;tex[tex[i].next].perv=i; // ...
1288
	mov [ebx+2],eax ;tex[tex[i].next].perv=i; // ...
1289
  pop ebx eax
1289
	pop ebx eax
Line 1290... Line 1290...
1290
 
1290
 
1291
  .end_f:
1291
	.end_f:
1292
  call ted_text_colored
1292
	call ted_text_colored
1293
  ret
1293
	ret
Line 1395... Line 1395...
1395
 
1395
 
1396
;output:
1396
;output:
1397
; bl = 0 - no delete
1397
; bl = 0 - no delete
1398
; bl = 1 - delete
1398
; bl = 1 - delete
1399
align 4
1399
align 4
1400
proc ted_text_del, edit:dword, del_opt:dword
-
 
1401
  push cx edx edi
1400
proc ted_text_del uses ecx edx edi, edit:dword, del_opt:dword
1402
  mov edi,dword[edit]
1401
	mov edi,dword[edit]
1403
  mov ebx,dword[del_opt]
1402
	mov ebx,dword[del_opt]
1404
 
1403
 
1405
  xor cl,cl
1404
	xor cl,cl
1406
  test ebx,ted_opt_ed_move_cursor
1405
	test ebx,ted_opt_ed_move_cursor
1407
  jz @f
1406
	jz @f
1408
    call ted_cur_move_left
1407
		call ted_cur_move_left
1409
    cmp dl,0
1408
		cmp dl,0
1410
    je .no_del
1409
		je .no_del
1411
  @@:
1410
	@@:
1412
  call ted_get_pos_by_cursor
1411
	call ted_get_pos_by_cursor
1413
  cmp ted_gp_opt,1
1412
	cmp ted_gp_opt,1
1414
  je .no_del
1413
	je .no_del
1415
    test ebx,ted_opt_ed_change_time
1414
		test ebx,ted_opt_ed_change_time
1416
    jz @f
1415
		jz @f
1417
      inc ted_tim_ch
1416
			inc ted_tim_ch
1418
    @@:
1417
		@@:
1419
    m2m dword [edx+14], ted_tim_ch
1418
		m2m dword[edx+14], ted_tim_ch
1420
    mov cl,1
1419
		mov cl,1
1421
  .no_del:
1420
	.no_del:
1422
  mov bl,cl
-
 
1423
  pop edi edx cx
1421
	mov bl,cl
1424
  ret
1422
	ret
Line 1425... Line 1423...
1425
endp
1423
endp
1426
 
1424
 
1427
;input:
1425
;input:
Line 1433... Line 1431...
1433
align 4
1431
align 4
1434
proc ted_sel_text_del uses ebx ecx edx esi, del_opt:dword
1432
proc ted_sel_text_del uses ebx ecx edx esi, del_opt:dword
1435
	call ted_is_select
1433
	call ted_is_select
1436
	cmp al,0
1434
	cmp al,0
1437
	je .end_f
1435
	je .end_f
1438
 
-
 
1439
		call ted_sel_normalize
1436
		call ted_sel_normalize
Line 1440... Line 1437...
1440
 
1437
 
1441
		mov esi,ted_seln_x1
1438
		mov esi,ted_seln_x1
1442
		mov ecx,ted_seln_y1
1439
		mov ecx,ted_seln_y1
Line 1459... Line 1456...
1459
			mov esi,ted_opt_ed_change_time
1456
			mov esi,ted_opt_ed_change_time
1460
			not esi
1457
			not esi
1461
			and dword[del_opt],esi ;n_tim=false;
1458
			and dword[del_opt],esi ;n_tim=false;
1462
			call ted_iterat_next
1459
			call ted_iterat_next
1463
			jmp @b
1460
			jmp @b
-
 
1461
align 4
1464
		@@:
1462
		@@:
1465
		test dword[del_opt],ted_opt_ed_change_time
1463
		test dword[del_opt],ted_opt_ed_change_time
1466
		jz @f
1464
		jz @f
1467
			dec ted_tim_ch
1465
			dec ted_tim_ch
1468
			xor al,al
1466
			xor al,al
Line 2983... Line 2981...
2983
; edi = pointer to tedit struct
2981
; edi = pointer to tedit struct
2984
;description:
2982
;description:
2985
; this function need to optimize output
2983
; this function need to optimize output
2986
align 4
2984
align 4
2987
proc ted_draw_cursor_sumb
2985
proc ted_draw_cursor_sumb
2988
  pushad
2986
pushad
-
 
2987
	mov eax,SF_DRAW_RECT
-
 
2988
	mov ebx,ted_wnd_l
-
 
2989
	add ebx,ted_rec_l
-
 
2990
	mov edx,ted_cur_x
-
 
2991
	imul edx,ted_rec_w
-
 
2992
	add ebx,edx
-
 
2993
	shl ebx,16
-
 
2994
	add ebx,ted_rec_w
Line 2989... Line -...
2989
 
-
 
2990
  mov eax,13 ;rect
2995
 
2991
  mov ebx,ted_wnd_l
2996
	mov ecx,ted_wnd_t ;calc rect -> y0,y1
2992
  add ebx,ted_rec_l
2997
	add ecx,ted_rec_t
2993
  mov edx,ted_cur_x
2998
	mov edx,ted_cur_y
2994
  imul edx,ted_rec_w
2999
	imul edx,ted_rec_h
2995
  add ebx,edx
3000
	add ecx,edx
2996
  shl ebx,16
3001
	shl ecx,16
Line 2997... Line -...
2997
  add ebx,ted_rec_w
-
 
2998
 
-
 
2999
  mov ecx,ted_wnd_t ;calc rect -> y0,y1
3002
	add ecx,ted_rec_h
3000
  add ecx,ted_rec_t
-
 
3001
  mov edx,ted_cur_y
-
 
3002
  imul edx,ted_rec_h
3003
 
3003
  add ecx,edx
3004
	mov edx,ted_color_wnd_work
Line 3004... Line 3005...
3004
  shl ecx,16
3005
	push ecx
-
 
3006
		call ted_sel_normalize
3005
  add ecx,ted_rec_h
3007
 
3006
 
3008
		mov esi,ted_scr_w
Line 3007... Line -...
3007
  mov edx,ted_color_wnd_work
-
 
3008
  push ecx
-
 
3009
    call ted_sel_normalize
-
 
3010
 
-
 
3011
    mov esi,ted_scr_w
-
 
3012
	mov ecx,dword[esi+sb_offs_position]
3009
		mov ecx,dword[esi+sb_offs_position]
3013
    sub ted_seln_y0,ecx
3010
		sub ted_seln_y0,ecx
3014
    sub ted_seln_y1,ecx
3011
		sub ted_seln_y1,ecx
3015
 
3012
 
3016
    mov ecx,ted_cur_y
3013
		mov ecx,ted_cur_y
3017
    cmp ecx,ted_seln_y0
3014
		cmp ecx,ted_seln_y0
Line 3018... Line 3015...
3018
    jl .no_cur_sel
3015
		jl .no_cur_sel
3019
    cmp ecx,ted_seln_y1
3016
		cmp ecx,ted_seln_y1
3020
    jg .no_cur_sel
3017
		jg .no_cur_sel
3021
    mov edx,ted_color_select ;¬¥­ï¥¬ 梥â ä®­  ­  梥⠢뤥«¥­¨ï
3018
		mov edx,ted_color_select ;¬¥­ï¥¬ 梥â ä®­  ­  梥⠢뤥«¥­¨ï
3022
    
3019
    
3023
    mov esi,ted_scr_h
3020
		mov esi,ted_scr_h
3024
	cmp ecx,ted_seln_y0
3021
		cmp ecx,ted_seln_y0
3025
    jne @f
3022
		jne @f
3026
      mov ecx,ted_cur_x
3023
			mov ecx,ted_cur_x
3027
      add ecx,dword[esi+sb_offs_position]
-
 
3028
      cmp ecx,ted_seln_x0
3024
			add ecx,dword[esi+sb_offs_position]
3029
      jge @f
3025
			cmp ecx,ted_seln_x0
3030
      mov edx,ted_color_wnd_work
3026
			jge @f
3031
    @@:
3027
			mov edx,ted_color_wnd_work
3032
 
3028
		@@:
3033
    mov ecx,ted_cur_y
3029
		mov ecx,ted_cur_y
3034
    cmp ecx,ted_seln_y1
3030
		cmp ecx,ted_seln_y1
3035
    jne .no_cur_sel
3031
		jne .no_cur_sel
3036
      mov ecx,ted_cur_x
-
 
3037
      add ecx,dword[esi+sb_offs_position]
3032
			mov ecx,ted_cur_x
3038
      cmp ecx,ted_seln_x1
3033
			add ecx,dword[esi+sb_offs_position]
3039
      jl .no_cur_sel
3034
			cmp ecx,ted_seln_x1
3040
      mov edx,ted_color_wnd_work
-
 
3041
 
-
 
3042
    .no_cur_sel:
-
 
3043
  pop ecx
-
 
3044
  int 0x40 ;à¨á®¢ ­¨¥ ¯àאַ㣮«ì­¨ª 
-
 
3045
 
-
 
3046
  call ted_get_pos_by_cursor ;¡¥à¥¬ ¯®§¨æ¨î ᨬ¢®« 
-
 
3047
  cmp ted_gp_opt,2
-
 
3048
  jne @f
-
 
3049
    mov eax,4
-
 
3050
    mov esi,1
-
 
3051
    ror ecx,16
-
 
3052
    mov bx,cx
-
 
Line -... Line 3035...
-
 
3035
			jl .no_cur_sel
-
 
3036
			mov edx,ted_color_wnd_work
-
 
3037
		.no_cur_sel:
-
 
3038
	pop ecx
-
 
3039
	int 0x40 ;à¨á®¢ ­¨¥ ¯àאַ㣮«ì­¨ª 
-
 
3040
 
-
 
3041
	call ted_get_pos_by_cursor ;¡¥à¥¬ ¯®§¨æ¨î ᨬ¢®« 
-
 
3042
	cmp ted_gp_opt,2
-
 
3043
	jne @f
-
 
3044
		mov esi,1
-
 
3045
		ror ecx,16
3053
    add ebx,0x10001
3046
		mov bx,cx
3054
    call ted_get_symb_color
3047
		add ebx,0x10001
3055
    call ted_convert_invis_symb
3048
		call ted_get_symb_color
Line 3056... Line 3049...
3056
    int 0x40 ;à¨á®¢ ­¨¥ ᨬ¢®« 
3049
		call ted_convert_invis_symb
3057
  @@:
3050
		mcall SF_DRAW_TEXT ;à¨á®¢ ­¨¥ ᨬ¢®« 
3058
 
3051
	@@:
3059
  popad
3052
popad
3060
  ret
3053
	ret
3061
endp
3054
endp
3062
 
3055
 
3063
;input:
3056
;input:
3064
; edx -> pointer to text
3057
; edx -> pointer to text
Line 3065... Line 3058...
3065
; edi -> 㪠§ â¥«ì ­  áâàãªâãàã tedit
3058
; edi -> 㪠§ â¥«ì ­  áâàãªâãàã tedit
3066
;output:
3059
;output:
3067
; ecx = color
3060
; ecx = color
3068
; if ted_mode_color=0 then ecx=ted_color_wnd_text
3061
; if ted_mode_color=0 then ecx=ted_color_wnd_text
3069
align 4
3062
align 4
3070
ted_get_symb_color:
3063
ted_get_symb_color:
3071
  mov ecx,ted_color_wnd_text ;§ ¤ ¥¬ 梥â ⥪áâ  ¯® 㬮«ç ­¨î
3064
	mov ecx,ted_color_wnd_text ;§ ¤ ¥¬ 梥â ⥪áâ  ¯® 㬮«ç ­¨î
3072
 
3065
 
3073
  push eax edx
3066
	push eax edx
3074
  cmp ted_mode_color,0
3067
	cmp ted_mode_color,0
3075
  je .exit
3068
	je .exit
3076
    jmp .on_first
3069
		jmp .on_first
3077
    @@:
3070
		@@:
3078
      call ted_iterat_perv
3071
			call ted_iterat_perv
3079
      cmp edx,ted_tex_1
3072
			cmp edx,ted_tex_1
3080
      jle .exit
3073
			jle .exit
3081
    .on_first:
3074
		.on_first:
3082
      xor eax,eax
3075
			xor eax,eax
3083
      mov al,byte[edx+1]
3076
			mov al,byte[edx+1]
3084
      cmp al,0 ;¥á«¨ al=0 ⮠梥⠭¥ ¬¥­ï¥âáï
3077
			or al,al ;¥á«¨ al=0 ⮠梥⠭¥ ¬¥­ï¥âáï
3085
    je @b
3078
			jz @b
3086
 
3079
 
-
 
3080
		cmp eax,ted_colors_text_count
3087
    cmp eax,ted_colors_text_count
3081
		jge .exit
3088
    jge .exit
3082
 
Line 3089... Line 3083...
3089
 
3083
		shl ax,2 ;㬭®¦ ¥¬ ¨­¤¥ªá æ¢¥â  ­  4 ¡ ©â 
3090
    shl ax,2 ;㬭®¦ ¥¬ ¨­¤¥ªá æ¢¥â  ­  4 ¡ ©â 
3084
		mov ecx,ted_text_colors ;¯à¨¡ ¢«ï¥¬ ᬥ饭¨¥ 1-£® 梥â 
3091
    mov ecx,ted_text_colors ;¯à¨¡ ¢«ï¥¬ ᬥ饭¨¥ 1-£® 梥â 
3085
		add ecx,eax
3092
    add ecx,eax
3086
		mov ecx,dword[ecx] ;ãáâ ­ ¢«¨¢ ¥¬ ⥪ã騩 梥â ⥪áâ  ¯® ᬥ饭¨î
Line 3134... Line 3128...
3134
		line_num dd ?
3128
		line_num dd ?
3135
	endl
3129
	endl
3136
	pushad
3130
	pushad
3137
	mov edi,dword[edit]
3131
	mov edi,dword[edit]
Line 3138... Line 3132...
3138
 
3132
 
3139
	mov eax,4 ;draw text
3133
	mov eax,SF_DRAW_TEXT
3140
	mov ecx,ted_text_colors
3134
	mov ecx,ted_text_colors
Line 3141... Line 3135...
3141
	mov ecx,dword[ecx]
3135
	mov ecx,dword[ecx]
3142
 
3136
 
Line 3184... Line 3178...
3184
			;optimized output \/
3178
			;optimized output \/
3185
			mov eax,ted_wnd_h
3179
			mov eax,ted_wnd_h
3186
			add eax,ted_wnd_t
3180
			add eax,ted_wnd_t
3187
			cmp bx,ax
3181
			cmp bx,ax
3188
			jg .no_draw_text
3182
			jg .no_draw_text
3189
			mov eax,4
3183
			mov eax,SF_DRAW_TEXT
3190
			;optimized output /\        
3184
			;optimized output /\        
3191
			and ebx,0xffff
3185
			and ebx,0xffff
3192
			ror ebx,16
3186
			ror ebx,16
3193
			add ebx,ted_wnd_l
3187
			add ebx,ted_wnd_l
3194
			add ebx,ted_rec_l
3188
			add ebx,ted_rec_l
Line 3196... Line 3190...
3196
			ror ebx,16
3190
			ror ebx,16
3197
			inc dword[line_num] ;increment line number
3191
			inc dword[line_num] ;increment line number
3198
			stdcall ted_clear_line_before_draw,edi,ebx,1,dword[line_num]
3192
			stdcall ted_clear_line_before_draw,edi,ebx,1,dword[line_num]
3199
			call ted_opt_draw_line_left
3193
			call ted_opt_draw_line_left
3200
			jmp @b
3194
			jmp @b
-
 
3195
align 4
3201
		.no_13:
3196
		.no_13:
Line 3202... Line 3197...
3202
 
3197
 
3203
		int 0x40
3198
		int 0x40
3204
		ror ebx,16
3199
		ror ebx,16
Line 3244... Line 3239...
3244
	mov ecx,ted_wnd_t
3239
	mov ecx,ted_wnd_t
3245
	add ecx,ted_wnd_h
3240
	add ecx,ted_wnd_h
3246
	shl ecx,16
3241
	shl ecx,16
3247
	mov cx,word[eax+sb_offs_size_y]
3242
	mov cx,word[eax+sb_offs_size_y]
3248
	inc cx
3243
	inc cx
3249
	mcall 13,,,ted_color_wnd_capt ;[sc.work]
3244
	mcall SF_DRAW_RECT,,,ted_color_wnd_capt ;[sc.work]
Line 3250... Line 3245...
3250
 
3245
 
3251
	;right-bottom square
3246
	;right-bottom square
3252
	mov ebx,ted_wnd_l
3247
	mov ebx,ted_wnd_l
3253
	add ebx,ted_wnd_w
3248
	add ebx,ted_wnd_w
Line 3272... Line 3267...
3272
; edi = pointer to tedit struct
3267
; edi = pointer to tedit struct
3273
align 4
3268
align 4
3274
proc ted_draw_main_cursor
3269
proc ted_draw_main_cursor
3275
  pushad
3270
  pushad
Line 3276... Line 3271...
3276
 
3271
 
3277
  mov eax,13 ;draw cursor
3272
  mov eax,SF_DRAW_RECT ;draw cursor
3278
  mov ecx,ted_wnd_t ;calc rect -> y0,y1
3273
  mov ecx,ted_wnd_t ;calc rect -> y0,y1
3279
  add ecx,ted_rec_t
3274
  add ecx,ted_rec_t
3280
  mov edx,ted_cur_y
3275
  mov edx,ted_cur_y
3281
  imul edx,ted_rec_h
3276
  imul edx,ted_rec_h
Line 3307... Line 3302...
3307
  int 0x40 ;¢ë¢®¤ ªãàá®à 
3302
  int 0x40 ;¢ë¢®¤ ªãàá®à 
Line 3308... Line 3303...
3308
 
3303
 
3309
  call ted_get_pos_by_cursor
3304
  call ted_get_pos_by_cursor
3310
  cmp ted_gp_opt,2
3305
  cmp ted_gp_opt,2
3311
  jne @f
-
 
3312
    mov eax,4 ;draw text
3306
  jne @f
3313
    mov esi,1
3307
    mov esi,1
3314
    ror ecx,16
3308
    ror ecx,16
3315
    mov bx,cx
3309
    mov bx,cx
3316
    add ebx,0x10001
3310
    add ebx,0x10001
Line 3320... Line 3314...
3320
      inc cx ; 1->1, 3->2, 5->3, ...
3314
      inc cx ; 1->1, 3->2, 5->3, ...
3321
      shr cx,1
3315
      shr cx,1
3322
      sub bx,cx
3316
      sub bx,cx
3323
    .no_up_tetx:
3317
    .no_up_tetx:
3324
    mov ecx,ted_color_cur_text
3318
    mov ecx,ted_color_cur_text
-
 
3319
	or ecx,ted_font_size
3325
    call ted_convert_invis_symb
3320
    call ted_convert_invis_symb
3326
    int 0x40
3321
    mcall SF_DRAW_TEXT
3327
  @@:
3322
  @@:
Line 3328... Line -...
3328
 
-
 
3329
  mov eax,4
3323
 
3330
  mov ebx,ted_wnd_l
3324
  mov ebx,ted_wnd_l
3331
  add ebx,ted_rec_l
3325
  add ebx,ted_rec_l
3332
  shl ebx,16
3326
  shl ebx,16
3333
  add ebx,ted_wnd_t
3327
  add ebx,ted_wnd_t
3334
  add ebx,3
3328
  add ebx,3
3335
  mov ecx,ted_color_wnd_bord
3329
  mov ecx,ted_color_wnd_bord
3336
  or  ecx,0x80000000
3330
  or  ecx,0x80000000
3337
  lea edx,[txtRow]
3331
  lea edx,[txtRow]
Line 3338... Line 3332...
3338
  int 0x40 ;¢ë¢®¤ ¯®¤¯¨á¨ '‘âப '
3332
  mcall SF_DRAW_TEXT ;¢ë¢®¤ ¯®¤¯¨á¨ '‘âப '
3339
 
3333
 
3340
  add ebx,0x500000
3334
  add ebx,0x500000
Line 3425... Line 3419...
3425
		cmp eax,20
3419
		cmp eax,20
3426
		jle .crop_buf
3420
		jle .crop_buf
3427
			mov eax,20 ;®¡à¥§ª  ¯®¤¯¨á¨ ¤® 20 ᨬ¢®«®¢
3421
			mov eax,20 ;®¡à¥§ª  ¯®¤¯¨á¨ ¤® 20 ᨬ¢®«®¢
3428
		.crop_buf:
3422
		.crop_buf:
3429
		mov esi,eax
3423
		mov esi,eax
3430
		mov eax,4
-
 
3431
		int 0x40 ;¢ë¢®¤ ᮤ¥à¦¨¬®£® ¡ãä¥à 
3424
		mcall SF_DRAW_TEXT ;¢ë¢®¤ ᮤ¥à¦¨¬®£® ¡ãä¥à 
Line 3432... Line 3425...
3432
 
3425
 
3433
		sub ebx,50 shl 16
3426
		sub ebx,50 shl 16
3434
		lea edx,[txtBuf]
3427
		lea edx,[txtBuf]
3435
		mov esi,edx
3428
		mov esi,edx
3436
		call tl_strlen
3429
		call tl_strlen
3437
		mov esi,eax
-
 
3438
		mov eax,4
3430
		mov esi,eax
3439
		xor ecx,0x40000000 ;㡨ࠥ¬ 梥â ä®­ 
3431
		xor ecx,0x40000000 ;㡨ࠥ¬ 梥â ä®­ 
3440
		int 0x40 ;¢ë¢®¤ ¯®¤¯¨á¨ ¤«ï ¡ãä¥à 
3432
		mcall SF_DRAW_TEXT ;¢ë¢®¤ ¯®¤¯¨á¨ ¤«ï ¡ãä¥à 
3441
	@@:
3433
	@@:
3442
	popad
3434
	popad
3443
	ret
3435
	ret
Line 3457... Line 3449...
3457
		add ebx,ted_wnd_w
3449
		add ebx,ted_wnd_w
3458
		sub ebx,ted_rec_l
3450
		sub ebx,ted_rec_l
3459
		mov ecx,ted_wnd_t
3451
		mov ecx,ted_wnd_t
3460
		add ecx,13
3452
		add ecx,13
3461
		shl ecx,16
3453
		shl ecx,16
3462
		add ecx,ted_rec_h
3454
		add ecx,9 ;9 - ¢ëá®â  0-£® èà¨äâ , áâ ¢¨âì ted_rec_h ¯®ª  ¥é¥ à ­®
3463
		mcall 13,,,ted_color_wnd_capt
3455
		mcall SF_DRAW_RECT,,,ted_color_wnd_capt
Line 3464... Line 3456...
3464
 
3456
 
3465
	cmp ted_help_id,-1
3457
	cmp ted_help_id,-1
3466
	je @f
3458
	je @f
3467
		mov eax,ted_help_id
3459
		mov eax,ted_help_id
Line 3481... Line 3473...
3481
		mov ecx,ted_text_colors
3473
		mov ecx,ted_text_colors
3482
		add ecx,eax
3474
		add ecx,eax
3483
		mov ecx,dword[ecx]
3475
		mov ecx,dword[ecx]
3484
		or	ecx,0xc0000000 ;SetTextStyles
3476
		or	ecx,0xc0000000 ;SetTextStyles
3485
		mov esi,edi
3477
		mov esi,edi
3486
		mcall 4,,,,,ted_color_wnd_work
3478
		mcall SF_DRAW_TEXT,,,,,ted_color_wnd_work
3487
		mov edi,esi
3479
		mov edi,esi
Line 3488... Line 3480...
3488
 
3480
 
3489
		mov esi,edx
3481
		mov esi,edx
Line 3498... Line 3490...
3498
			add edx,ted_help_text_f1
3490
			add edx,ted_help_text_f1
3499
			inc eax
3491
			inc eax
3500
			imul eax,6 ;è¨à¨­  ᨬ¢®«  ¢ á¨áâ. èà¨äâ¥
3492
			imul eax,6 ;è¨à¨­  ᨬ¢®«  ¢ á¨áâ. èà¨äâ¥
3501
			shl eax,16			
3493
			shl eax,16			
3502
			add ebx,eax
3494
			add ebx,eax
3503
			mcall 4
3495
			mcall SF_DRAW_TEXT
3504
	@@:
3496
	@@:
3505
	popad
3497
	popad
3506
	ret
3498
	ret
3507
endp
3499
endp
Line 3508... Line 3500...
3508
 
3500
 
3509
;input:
3501
;input:
3510
; edi = pointer to tedit struct
3502
; edi = pointer to tedit struct
3511
align 4
3503
align 4
3512
proc ted_draw_line_numbers
3504
proc ted_draw_line_numbers
3513
  pushad
-
 
3514
 
3505
pushad
3515
  ;top panel with caption
3506
	;top panel with caption
3516
  mov ebx,ted_wnd_l
3507
	mov ebx,ted_wnd_l
3517
;  add ebx,ted_rec_l
3508
;  add ebx,ted_rec_l
3518
  shl ebx,16
3509
	shl ebx,16
3519
  add ebx,ted_wnd_w
3510
	add ebx,ted_wnd_w
3520
;  sub ebx,ted_rec_l
3511
;  sub ebx,ted_rec_l
3521
  mov edx,ted_color_wnd_work
3512
	mov edx,ted_color_wnd_work
3522
  mov ecx,ted_wnd_t
3513
	mov ecx,ted_wnd_t
3523
  shl ecx,16
3514
	shl ecx,16
3524
  add ecx,ted_rec_t
-
 
3525
  mov eax,13
3515
	add ecx,ted_rec_t
3526
  mov edx,ted_color_wnd_capt
3516
	mov edx,ted_color_wnd_capt
Line 3527... Line 3517...
3527
  int 0x40
3517
	mcall SF_DRAW_RECT
3528
 
3518
 
3529
  ;line numbers
3519
	;line numbers
3530
  mov ebx,0x40000 ;format
3520
	mov ebx,0x40000 ;format
3531
  mov ecx,ted_scr_w
3521
	mov ecx,ted_scr_w
3532
  mov ecx,dword[ecx+sb_offs_position]
3522
	mov ecx,dword[ecx+sb_offs_position]
3533
  inc ecx
3523
	inc ecx
3534
  mov edx,3
3524
	mov edx,3
3535
  add edx,ted_wnd_l
3525
	add edx,ted_wnd_l
3536
  rol edx,16
3526
	rol edx,16
3537
  add edx,ted_wnd_t
3527
	add edx,ted_wnd_t
Line 3538... Line 3528...
3538
  add edx,ted_rec_t
3528
	add edx,ted_rec_t
3539
  @@:
3529
	@@:
3540
 
3530
 
3541
push ebx ecx edx
3531
push ebx ecx edx
3542
  ;left panel with numbers
3532
	;left panel with numbers
3543
  mov ebx,ted_wnd_l
3533
	mov ebx,ted_wnd_l
3544
  shl ebx,16
3534
	shl ebx,16
3545
  add ebx,ted_rec_l
3535
	add ebx,ted_rec_l
3546
  mov ecx,ted_rec_h
3536
	mov ecx,ted_rec_h
3547
  rol ecx,16
-
 
3548
  mov cx,dx
3537
	rol ecx,16
3549
  rol ecx,16
3538
	mov cx,dx
3550
  mov eax,13
3539
	rol ecx,16
Line 3551... Line 3540...
3551
  mov edx,ted_color_wnd_capt
3540
	mov edx,ted_color_wnd_capt
3552
  int 0x40 ;à¨á㥬 ¯àאַ㣮«ì­¨ª ¯®¤ ­®¬¥à®¬ áâப¨
3541
	mcall SF_DRAW_RECT ;à¨á㥬 ¯àאַ㣮«ì­¨ª ¯®¤ ­®¬¥à®¬ áâப¨
3553
pop edx ecx ebx
3542
pop edx ecx ebx
3554
 
3543
 
3555
    mov eax,47
3544
		mov eax,47
3556
    mov esi,ted_color_wnd_bord
3545
		mov esi,ted_color_wnd_bord
3557
    int 0x40 ;à¨á㥬 ­®¬¥à áâப¨
3546
		int 0x40 ;à¨á㥬 ­®¬¥à áâப¨
3558
    inc ecx
3547
		inc ecx
3559
    add edx,ted_rec_h
3548
		add edx,ted_rec_h
3560
    sub edx,ted_wnd_t
3549
		sub edx,ted_wnd_t
3561
	mov esi,edx
3550
		mov esi,edx
3562
	and esi,0xffff
3551
		and esi,0xffff
3563
    cmp esi,ted_wnd_h
3552
		cmp esi,ted_wnd_h
3564
    jge @f
3553
		jge @f
3565
    add edx,ted_wnd_t
3554
		add edx,ted_wnd_t
3566
    jmp @b
3555
		jmp @b
3567
  @@:
3556
align 4
Line 3568... Line 3557...
3568
 
3557
	@@:
3569
  popad
3558
popad
3570
  ret
3559
	ret
Line 3609... Line 3598...
3609
	mov esi,dword[eax+sb_offs_position]
3598
	mov esi,dword[eax+sb_offs_position]
3610
    call ted_get_pos_by_coords
3599
    call ted_get_pos_by_coords
Line 3611... Line 3600...
3611
 
3600
 
3612
  cmp ted_gp_opt,2
3601
  cmp ted_gp_opt,2
3613
  jne .no_draw_text
3602
  jne .no_draw_text
3614
;  mov eax,4 ;draw text
3603
;  mov eax,SF_DRAW_TEXT
3615
  call ted_get_symb_color
3604
  call ted_get_symb_color
3616
  mov esi,1 ;draw 1 symbol
3605
  mov esi,1 ;draw 1 symbol
3617
  @@:
3606
  @@:
3618
    ;call ted_iterat_next
3607
    ;call ted_iterat_next
Line 3625... Line 3614...
3625
    cmp byte[edx+1],0
3614
    cmp byte[edx+1],0
3626
    je .no_col_change
3615
    je .no_col_change
3627
      call ted_get_symb_color
3616
      call ted_get_symb_color
3628
    .no_col_change:
3617
    .no_col_change:
Line 3629... Line 3618...
3629
 
3618
 
3630
    mov eax,4 ;draw text
3619
    mov eax,SF_DRAW_TEXT
3631
    cmp byte [edx],13
3620
    cmp byte [edx],13
3632
    jne .no_13
3621
    jne .no_13
3633
      cmp ted_mode_invis,1
3622
      cmp ted_mode_invis,1
3634
      jne .no_draw_text
3623
      jne .no_draw_text
Line 3751... Line 3740...
3751
	cmp ted_seln_y1,esi
3740
	cmp ted_seln_y1,esi
3752
	jl .no_select
3741
	jl .no_select
3753
		mov edx,ted_color_select ;draw selected line
3742
		mov edx,ted_color_select ;draw selected line
3754
	.no_select:
3743
	.no_select:
Line 3755... Line -...
3755
 
-
 
3756
	mov eax,13 ;rect
3744
 
Line 3757... Line 3745...
3757
	int 0x40 ;§ ªà áª  ¯®«­®© áâப¨ 梥⮬ ä®­  ¨«¨ 梥⮬ ¢ë¤¥«¥­¨ï
3745
	mcall SF_DRAW_RECT ;§ ªà áª  ¯®«­®© áâப¨ 梥⮬ ä®­  ¨«¨ 梥⮬ ¢ë¤¥«¥­¨ï
3758
 
3746
 
3759
	call ted_is_select
3747
	call ted_is_select
Line 3760... Line 3748...
3760
	cmp al,0
3748
	or al,al
3761
	je .no_clear
3749
	jz .no_clear
3762
 
3750
 
3763
	mov al,13 ;rect
3751
	mov al,SF_DRAW_RECT
3764
	xor cx,cx
3752
	xor cx,cx
3765
	add ecx,ted_rec_h
3753
	add ecx,ted_rec_h
Line 3821... Line 3809...
3821
		cmp ecx,dword[eax+sb_offs_position]
3809
		cmp ecx,dword[eax+sb_offs_position]
3822
		je @f
3810
		je @f
3823
		call ted_iterat_next
3811
		call ted_iterat_next
3824
		cmp edx,ted_tex_1
3812
		cmp edx,ted_tex_1
3825
		jle @f
3813
		jle @f
3826
		cmp byte [edx],13
3814
		cmp byte[edx],13
3827
		jne @b
3815
		jne @b
3828
		inc ecx
3816
		inc ecx
3829
		jmp @b
3817
		jmp @b
-
 
3818
align 4
3830
	@@:
3819
	@@:
Line 3831... Line 3820...
3831
 
3820
 
3832
	cmp ecx,dword[eax+sb_offs_position]
3821
	cmp ecx,dword[eax+sb_offs_position]
3833
	je @f
3822
	je @f
Line 3848... Line 3837...
3848
; ecx = 梥â ᨬ¢®« 
3837
; ecx = 梥â ᨬ¢®« 
3849
; edx = 㪠§ â¥«ì ­  ¯¥à¢ë© «¥¢ë© ᨬ¢®«
3838
; edx = 㪠§ â¥«ì ­  ¯¥à¢ë© «¥¢ë© ᨬ¢®«
3850
;description:
3839
;description:
3851
; äã­ªæ¨ï ­ã¦­  ¤«ï ®¯â¨¬¨§ æ¨¨ ¢ë¢®¤  ⥪áâ 
3840
; äã­ªæ¨ï ­ã¦­  ¤«ï ®¯â¨¬¨§ æ¨¨ ¢ë¢®¤  ⥪áâ 
3852
align 4
3841
align 4
3853
proc ted_opt_draw_line_left
3842
proc ted_opt_draw_line_left uses ebx
3854
  push ebx
-
 
3855
 
-
 
3856
  mov ebx,ted_scr_h
3843
	mov ebx,ted_scr_h
3857
  mov ebx,dword[ebx+sb_offs_position]
3844
	mov ebx,dword[ebx+sb_offs_position]
3858
  cmp ebx,0
3845
	or ebx,ebx
3859
  je .ret_f
3846
	jz .ret_f
3860
  push eax
3847
	push eax
3861
  mov eax,edx
3848
	mov eax,edx
Line 3862... Line 3849...
3862
 
3849
 
3863
  cmp edx,ted_tex
3850
	cmp edx,ted_tex
3864
  jne @f
3851
	jne @f
3865
    call ted_iterat_next
3852
		call ted_iterat_next
3866
    jmp .beg_cycle
3853
		jmp .beg_cycle
Line 3867... Line 3854...
3867
  @@:
3854
	@@:
3868
 
3855
 
Line 3869... Line 3856...
3869
  cmp ebx,0
3856
	or ebx,ebx
3870
  je @f
3857
	jz @f
3871
 
3858
 
3872
  cmp byte[edx],13
3859
	cmp byte[edx],13
3873
  jne @f
3860
	jne @f
3874
    call ted_iterat_next
3861
		call ted_iterat_next
3875
    .beg_cycle:
3862
		.beg_cycle:
3876
  @@:
3863
	@@:
3877
    cmp edx,ted_tex_1
3864
		cmp edx,ted_tex_1
3878
    jle @f
3865
		jle @f
3879
    cmp byte[edx],13
3866
		cmp byte[edx],13
3880
    je @f
3867
		je @f
3881
    cmp ebx,0
3868
		or ebx,ebx
3882
    je @f
3869
		jz @f
3883
;--------------------------------------
3870
;--------------------------------------
3884
xor eax,eax ;eax ¡ã¤¥â ¬¥­ïâìáï
3871
xor eax,eax ;eax ¡ã¤¥â ¬¥­ïâìáï
3885
mov al,byte[edx+1]
3872
mov al,byte[edx+1]
3886
cmp al,0
3873
or al,al
3887
je .no_color
3874
jz .no_color
3888
cmp eax,ted_colors_text_count
3875
cmp eax,ted_colors_text_count
3889
jge .no_color
3876
jge .no_color
3890
  xor ecx,ecx
3877
	xor ecx,ecx
3891
  mov cl,byte[edx+1]
3878
	mov cl,byte[edx+1]
3892
  shl cx,2
3879
	shl cx,2
3893
  add ecx,ted_text_colors
3880
	add ecx,ted_text_colors
3894
  mov ecx,dword[ecx]
3881
	mov ecx,dword[ecx]
3895
.no_color:
3882
.no_color:
3896
;--------------------------------------
3883
;--------------------------------------
3897
    mov eax,edx
3884
		mov eax,edx
-
 
3885
		call ted_iterat_next
3898
    call ted_iterat_next
3886
		dec ebx
3899
    dec ebx
3887
		jmp @b
3900
    jmp @b
3888
align 4
3901
  @@:
3889
	@@:
3902
    mov edx,eax
3890
		mov edx,eax
3903
  pop eax
-
 
3904
  .ret_f:
3891
	pop eax
3905
  call ted_get_symb_color
3892
	.ret_f:
Line 3906... Line 3893...
3906
  pop ebx
3893
	call ted_get_symb_color
3907
  ret
3894
	ret
3908
endp
3895
endp
Line 4036... Line 4023...
4036
	mov ebx,ted_el_focus
4023
	mov ebx,ted_el_focus
4037
	mov dword[ebx],edi ;áâ ¢¨¬ 䮪ãá
4024
	mov dword[ebx],edi ;áâ ¢¨¬ 䮪ãá
Line 4038... Line 4025...
4038
 
4025
 
4039
	push eax
4026
	push eax
4040
		shr eax,16
-
 
4041
		and eax,0xffff
4027
		shr eax,16
4042
		sub eax,ted_wnd_l
4028
		sub eax,ted_wnd_l
Line 4043... Line 4029...
4043
		sub eax,ted_rec_l
4029
		sub eax,ted_rec_l
4044
 
4030