Subversion Repositories Kolibri OS

Rev

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

Rev 1667 Rev 2102
Line 1... Line 1...
1
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
1
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
2
; í«¥¬¥­â TextEditor ¤«ï Kolibri OS
2
; í«¥¬¥­â TextEditor ¤«ï Kolibri OS
3
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 09.06.2010 IgorA
3
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 22.08.2011 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 37... Line 37...
37
ends
37
ends
Line 38... Line 38...
38
 
38
 
39
struct TexColViv
39
struct TexColViv
40
  Text rb MAX_COLOR_WORD_LEN ; á«®¢® ¤«ï ¯®¤á¢¥âª¨
40
	Text  rb MAX_COLOR_WORD_LEN ; á«®¢® ¤«ï ¯®¤á¢¥âª¨
41
  f1 dd 0 ; á¯à ¢ª  ¯® á«®¢ã
41
	f1    dd 0 ; á¯à ¢ª  ¯® á«®¢ã
42
  wwo db ? ; whole words only
42
	flags db ? ; f1+4 ä« £¨ ¨á¯®«ì§ã¥¬ë¥ ¯à¨ ¢ë¤¥«¥­¨¨
-
 
43
	endc  db ? ; f1+5 ᨬ¢®« ª®­æ  ¢ë¤¥«¥­¨ï (¨á¯®«ì§ã¥âáï ¯à¨ flags&4)
43
  endc db ? ; ᨬ¢®« ª®­æ  ¢ë¤¥«¥­¨ï (wwo&4)
44
	escc  db ? ; f1+6 íªà ­¨àãî騩 ᨬ¢®« (¨á¯®«ì§ã¥âáï ¯à¨ flags&4)
44
  color db ? ; ­®¬¥à 梥â 
45
	color db ? ; f1+7 ­®¬¥à 梥â 
Line 45... Line 46...
45
ends
46
ends
46
 
47
 
47
struct symbol
48
struct symbol
Line 805... Line 806...
805
		.no_ch_key:
806
		.no_ch_key:
806
		inc eax
807
		inc eax
807
	loop @b
808
	loop @b
Line 808... Line 809...
808
 
809
 
809
	;init: ted_help_text_f1
810
	;init: ted_help_text_f1
810
	mov ecx,ted_key_words_count
811
	mov ecx,ted_key_words_count ;ª®«¨ç¥á⢮ ª«î祢ëå á«®¢
811
	imul ecx,sizeof.TexColViv
812
	imul ecx,sizeof.TexColViv   ;à §¬¥à áâàãªâãàë á 1-¬ ª«. á«.
812
	add ecx,ted_key_words_data
813
	add ecx,ted_key_words_data  ;­ ç «® ä ©«  á ª«. á«.
Line 813... Line 814...
813
	mov ted_help_text_f1,ecx
814
	mov ted_help_text_f1,ecx    ;¬¥âª  ¢ ¯ ¬ïâ¨, £¤¥ ­ ç¨­¥âáï ⥪áâ á® á¯à ¢ª®©
814
 
815
 
815
	stdcall ted_init_scroll_bars,edi,1 ;¬¥­ï¥¬ æ¢¥â  áªà®««¨­£®¢
816
	stdcall ted_init_scroll_bars,edi,1 ;¬¥­ï¥¬ æ¢¥â  áªà®««¨­£®¢
816
	.no_colors:
817
	.no_colors:
Line 970... Line 971...
970
  .endif:
971
  .endif:
971
  ret
972
  ret
Line 972... Line 973...
972
 
973
 
973
;input:
974
;input:
-
 
975
; bl = symbol end of select
974
; bl = symbol end of select
976
; bh = íªà ­¨àãî騩 ᨬ¢®« (= 0 ¥á«¨ ­¥â ¯à®¢¥àª¨ ­  ­¨å)
975
; edx = pointer to symbol struct
977
; edx = pointer to symbol struct
976
; edi = pointer to tedit struct
978
; edi = pointer to tedit struct
977
;description:
979
;description:
978
; ­ ©â¨ á«¥¤ãîéãî ¯®§¨æ¨î 㪠§ ­­®£® ᨬ¢®« 
980
; ­ ©â¨ á«¥¤ãîéãî ¯®§¨æ¨î 㪠§ ­­®£® ᨬ¢®« 
979
align 4
981
align 4
-
 
982
ted_iterat_next_pos_char:
-
 
983
	push ax
980
ted_iterat_next_pos_char:
984
	mov al,1 ;¯à¥¤ë¤ã騩 ᨬ¢®«, á«ã¦¨â ¤«ï áà ¢­¥­¨ï á ᨬ¢®«®¬ bh
981
	@@:
985
	@@:
982
		cmp bl,byte[edx]
986
		cmp bl,byte[edx]
-
 
987
		je .found
983
		je @f
988
		.no_found:
984
		cmp edx,ted_tex_1
989
		cmp edx,ted_tex_1
-
 
990
		jle @f
985
		jle @f
991
			mov al,byte[edx]
986
			call ted_iterat_next
992
			call ted_iterat_next
-
 
993
			jmp @b
-
 
994
	.found:
-
 
995
		cmp bh,al
987
			jmp @b
996
		je .no_found
988
	@@:
997
	@@:
-
 
998
	call ted_iterat_next
989
	call ted_iterat_next
999
	pop ax
Line 990... Line 1000...
990
	ret
1000
	ret
991
 
1001
 
992
;input:
1002
;input:
Line 2119... Line 2129...
2119
      ColToIndexOffset eax,ebx
2129
      ColToIndexOffset eax,ebx
2120
      cmp byte[ebx+esi],0
2130
      cmp byte[ebx+esi],0
2121
      jne .if_0 ;if(Col[word_n].Text[pos]==0){
2131
      jne .if_0 ;if(Col[word_n].Text[pos]==0){
2122
	mov dword[endPos],edx ;eP=i;
2132
	mov dword[endPos],edx ;eP=i;
2123
	ColToIndexOffset eax,ebx
2133
	ColToIndexOffset eax,ebx
2124
	mov bl,byte[ebx+MAX_COLOR_WORD_LEN+6]
2134
	mov bl,byte[ebx+MAX_COLOR_WORD_LEN+7]
2125
	mov byte[f_color],bl ;f_color=Col[word_n].color;
2135
	mov byte[f_color],bl ;f_color=Col[word_n].color;
Line 2126... Line 2136...
2126
 
2136
 
2127
mov byte[find],1
2137
mov byte[find],1
2128
	  ColToIndexOffset eax,ebx ;... ebx = Col[word_n]
2138
	  ColToIndexOffset eax,ebx ;... ebx = Col[word_n]
Line 2169... Line 2179...
2169
	    .if_6e:
2179
	    .if_6e:
Line 2170... Line 2180...
2170
 
2180
 
2171
	    btr bx,2 ;3-1
2181
	    btr bx,2 ;3-1
2172
	    jae .if_7e ;if(Col[word_n].wwo&4)
2182
	    jae .if_7e ;if(Col[word_n].wwo&4)
2173
	    ColToIndexOffset eax,ebx
2183
	    ColToIndexOffset eax,ebx
2174
	    mov bl,byte[ebx+MAX_COLOR_WORD_LEN+5]
2184
	    mov bx,word[ebx+MAX_COLOR_WORD_LEN+5]
2175
	    call ted_iterat_next_pos_char
2185
	    call ted_iterat_next_pos_char
2176
       cmp edx,ted_tex_1
2186
       cmp edx,ted_tex_1
2177
       jle .if_7e
2187
       jle .if_7e
2178
       mov dword[endPos],edx
2188
       mov dword[endPos],edx
Line 3306... Line 3316...
3306
		add ebx,ted_wnd_t
3316
		add ebx,ted_wnd_t
3307
		add ebx,13 ;=3+10
3317
		add ebx,13 ;=3+10
Line 3308... Line 3318...
3308
 
3318
 
3309
		;SetTextColor
3319
		;SetTextColor
3310
		xor eax,eax
3320
		xor eax,eax
3311
		mov al,byte[edx+MAX_COLOR_WORD_LEN+6]
3321
		mov al,byte[edx+MAX_COLOR_WORD_LEN+7]
3312
		shl ax,2
3322
		shl ax,2
3313
		mov ecx,ted_text_colors
3323
		mov ecx,ted_text_colors
3314
		add ecx,eax
3324
		add ecx,eax
3315
		mov ecx,dword[ecx]
3325
		mov ecx,dword[ecx]
Line 3945... Line 3955...
3945
  pushad
3955
  pushad
3946
  mov edi,dword[edit]
3956
  mov edi,dword[edit]
Line 3947... Line 3957...
3947
 
3957
 
3948
  stdcall ted_can_save,edi
3958
  stdcall ted_can_save,edi
3949
  cmp al,0
3959
  cmp al,0
Line 3950... Line 3960...
3950
  je .no_save
3960
;  je .no_save
3951
 
3961
 
3952
  mov ecx,ted_max_chars
3962
  mov ecx,ted_max_chars