Subversion Repositories Kolibri OS

Rev

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

Rev 5832 Rev 6086
Line 1... Line 1...
1
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
1
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
2
; í«¥¬¥­â TextEditor ¤«ï Kolibri OS
2
; í«¥¬¥­â TextEditor ¤«ï Kolibri OS
3
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 28.06.2014 IgorA
3
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 20.01.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 2122... Line 2122...
2122
;output:
2122
;output:
2123
; edx = pointer to next symbol
2123
; edx = pointer to next symbol
2124
;description:
2124
;description:
2125
; ”ã­ªæ¨ï ¤«ï ¯®¨áª  ¨ ¢ë¤¥«¥­¨ï ¯®¤á¢¥ç¥­ëå á«®¢
2125
; ”ã­ªæ¨ï ¤«ï ¯®¨áª  ¨ ¢ë¤¥«¥­¨ï ¯®¤á¢¥ç¥­ëå á«®¢
2126
align 4
2126
align 4
2127
proc ted_text_find_sel_color
2127
proc ted_text_find_sel_color uses eax ebx ecx esi
2128
locals
2128
locals
2129
  begPos dd ? ;­ ç «ì­ ï ¯®§¨æ¨ï
2129
	begPos dd ? ;­ ç «ì­ ï ¯®§¨æ¨ï
2130
  endPos dd ? ;ª®­¥ç­ ï ¯®§¨æ¨ï
2130
	endPos dd ? ;ª®­¥ç­ ï ¯®§¨æ¨ï
2131
  find db ? ;­ ©¤¥­® / ­¥ ­ ©¤¥­®
2131
	find db ? ;­ ©¤¥­® / ­¥ ­ ©¤¥­®
2132
  f_color db ? ;¨­¤¥ªá æ¢¥â  ­ ©¤¥­®£® á«®¢ 
2132
	f_color db ? ;¨­¤¥ªá æ¢¥â  ­ ©¤¥­®£® á«®¢ 
2133
endl
2133
endl
2134
  push eax ebx ecx esi
-
 
2135
;eax = word_n ⥪ã騩 ­®¬¥à (¯®§¨æ¨ï) ¯à®¢¥à塞®£® á«®¢  ¢ ᯨ᪥
2134
;eax = word_n ⥪ã騩 ­®¬¥à (¯®§¨æ¨ï) ¯à®¢¥à塞®£® á«®¢  ¢ ᯨ᪥
2136
;ebx = ¤«ï à §­ëå 楫¥©
2135
;ebx = ¤«ï à §­ëå 楫¥©
2137
;ecx = l_pos ¯®á«¥¤­¨© ­®¬¥à (¯®§¨æ¨ï) ¯®¤å®¤ï饣® á«®¢  ¢ ᯨ᪥
2136
;ecx = l_pos ¯®á«¥¤­¨© ­®¬¥à (¯®§¨æ¨ï) ¯®¤å®¤ï饣® á«®¢  ¢ ᯨ᪥
2138
;esi = ¤«ï à §­ëå 楫¥©, ­®¬¥à ¯à®¢¥à塞®£® ᨬ¢®«  ¢ á«®¢¥
2137
;esi = ¤«ï à §­ëå 楫¥©, ­®¬¥à ¯à®¢¥à塞®£® ᨬ¢®«  ¢ á«®¢¥
2139
  mov dword[begPos],1
2138
	mov dword[begPos],1
Line 2167... Line 2166...
2167
      jmp .wh_1b
2166
			jmp .wh_1b
2168
    .wh_1e:
2167
		.wh_1e:
Line 2169... Line 2168...
2169
 
2168
 
2170
    mov dword[begPos],edx ;bP=i;
2169
		mov dword[begPos],edx ;bP=i;
2171
    mov esi,1
2170
		mov esi,1
2172
 
2171
align 4
2173
    .wh_2b: ;while(1){
2172
		.wh_2b: ;while(1){
Line 2174... Line 2173...
2174
      call ted_iterat_next
2173
		call ted_iterat_next
2175
 
2174
 
Line 2209... Line 2208...
2209
	    jae .if_3e ;if(Col[word_n].wwo&1)
2208
			jae .if_3e ;if(Col[word_n].wwo&1)
2210
	      ;u1= !(isalnum(cont_s)||cont_s=='_')
2209
				;u1= !(isalnum(cont_s)||cont_s=='_')
2211
	      call isalnum
2210
				call isalnum
2212
	      jae .if_3e
2211
				jae .if_3e
2213
		mov byte[find],0
2212
					mov byte[find],0
-
 
2213
					jmp .if_4e
2214
	    .if_3e:
2214
			.if_3e:
Line 2215... Line 2215...
2215
 
2215
 
2216
	    btr bx,3 ;4-1
2216
			btr bx,3 ;4-1
2217
	    jae .if_4e ;if(Col[word_n].wwo&8)
2217
			jae .if_4e ;if(Col[word_n].wwo&8)
Line 2228... Line 2228...
2228
	    jae .if_5e ;if(Col[word_n].wwo&2)
2228
			jae .if_5e ;if(Col[word_n].wwo&2)
2229
	      ;u1= !(isalnum(cont_s)||cont_s=='_')
2229
				;u1= !(isalnum(cont_s)||cont_s=='_')
2230
	      call isalnum
2230
				call isalnum
2231
	      jae .if_5e
2231
				jae .if_5e
2232
		mov byte[find],0
2232
					mov byte[find],0
-
 
2233
					jmp .if_6e
2233
	    .if_5e:
2234
			.if_5e:
Line 2234... Line 2235...
2234
 
2235
 
2235
	    btr bx,4 ;5-1
2236
			btr bx,4 ;5-1
2236
	    jae .if_6e ;if(Col[word_n].wwo&16)
2237
			jae .if_6e ;if(Col[word_n].wwo&16)
Line 2304... Line 2305...
2304
    jmp @f
2305
		jmp @f
2305
  .if_1e:
2306
	.if_1e:
2306
    mov edx,ted_tex
2307
		mov edx,ted_tex
2307
  @@:
2308
	@@:
Line 2308... Line -...
2308
 
-
 
2309
  pop esi ecx ebx eax
2309
 
2310
  ret
2310
	ret
Line 2311... Line 2311...
2311
endp
2311
endp
2312
 
2312
 
2313
;input:
2313
;input:
2314
; edx = pointer to char (byte)
2314
; edx = pointer to char (byte)
2315
;output:
2315
;output:
2316
; cf=1 if symbol is...
2316
; cf=1 if symbol is...
2317
align 4
2317
align 4
Line -... Line 2318...
-
 
2318
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
-
 
2319
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
2318
tab_all_num db 0,0,0,0,0,0,11111111b,11b,11111110b,0xff,0xff,111b,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
2320
 
2319
tab_alpha db 0,0,0,0,0,0,0,0,11111110b,0xff,0xff,111b,11111110b,0xff,0xff,111b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2321
;output:
2320
 
2322
; cf=1 ¥á«¨ ¢ [edx] ¡ãª¢ , æ¨äà  ¨«¨ '_'
2321
align 4
2323
align 4
2322
isalnum:
2324
isalnum:
2323
  push eax ebx
-
 
2324
  mov al,byte[edx] ;al=offset
2325
	push eax ebx
2325
  shr al,3
2326
	movzx eax,byte[edx] ;al=offset
2326
  and eax,11111b
-
 
2327
  lea ebx,[tab_all_num]
2327
	shr eax,3
2328
  add ebx,eax
2328
	lea ebx,[tab_all_num]
2329
  mov ah,byte[ebx]
2329
	add ebx,eax
2330
  mov al,byte[edx] ;al=bit
-
 
2331
  and ax,111b
2330
	movzx ax,byte[edx] ;al=bit
2332
  mov bx,word[ebx]
2331
	and ax,111b
-
 
2332
	bt word[ebx],ax
-
 
2333
	pop ebx eax
-
 
2334
	ret
2333
  btr bx,ax
2335
 
2334
  pop ebx eax
2336
;output:
2335
  ret
2337
; cf=1 ¥á«¨ ¢ [edx] ¡ãª¢  ¨«¨ '_'
2336
align 4
2338
align 4
2337
isalpha:
2339
isalpha:
2338
  push eax ebx
-
 
2339
  mov al,byte[edx] ;al=offset
2340
	push eax ebx
2340
  shr al,3
2341
	movzx eax,byte[edx] ;al=offset
2341
  and eax,11111b
-
 
2342
  lea ebx,[tab_alpha]
2342
	shr eax,3
2343
  add ebx,eax
2343
	lea ebx,[tab_alpha]
2344
  mov ah,byte[ebx]
2344
	add ebx,eax
2345
  mov al,byte[edx] ;al=bit
-
 
2346
  and ax,111b
2345
	movzx ax,byte[edx] ;al=bit
2347
  mov bx,word[ebx]
2346
	and ax,111b
Line 2348... Line 2347...
2348
  btr bx,ax
2347
	bt word[ebx],ax
2349
  pop ebx eax
2348
	pop ebx eax
2350
  ret
-
 
2351
 
2349
	ret
Line 2352... Line 2350...
2352
align 4
2350
 
2353
proc ted_show_help_f1, edit:dword
2351
align 4
2354
  push eax edx edi
2352
proc ted_show_help_f1 uses eax edx edi, edit:dword
Line 2367... Line 2365...
2367
  jle @f
2365
	jle @f
2368
    stdcall ted_find_help_id,eax
2366
		stdcall ted_find_help_id,eax
2369
  @@:
2367
	@@:
2370
  ;call ted_draw_main_cursor
2368
	;call ted_draw_main_cursor
2371
  call ted_draw_help_f1
2369
	call ted_draw_help_f1
2372
  pop edi edx eax
-
 
2373
  ret 
2370
	ret 
2374
endp
2371
endp
Line 2375... Line 2372...
2375
 
2372
 
2376
;input:
2373
;input: