Subversion Repositories Kolibri OS

Rev

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

Rev 1715 Rev 1717
Line 28... Line 28...
28
align 4
28
align 4
29
but_obj_paste:
29
but_obj_paste:
30
push eax ebx ecx edi
30
push eax ebx ecx edi
31
		mov eax,[tree2.data_info] ;¤ ­­ë¥ 0-£® 㧫 , ¨á¯®«ì§ã¥¬ ¤«ï ª®¯¨à®¢ ­¨ï
31
	mov eax,[tree2.data_info] ;¤ ­­ë¥ 0-£® 㧫 , ¨á¯®«ì§ã¥¬ ¤«ï ª®¯¨à®¢ ­¨ï
32
		mov bl,byte[eax]
32
	mov ebx,dword[eax]
33
		call find_obj_in_opt
33
	call find_obj_in_opt
34
		xor ecx,ecx
34
	xor ecx,ecx
35
		mov cx,word[edi+obj_opt.img-obj_opt] ;cx - ¨­¤¥ªá £« ¢­®© ¨ª®­ª¨ ¤®¡ ¢«ï¥¬®£® ®¡ê¥ªâ 
35
	mov cx,word[edi+obj_opt.img-obj_opt] ;cx - ¨­¤¥ªá £« ¢­®© ¨ª®­ª¨ ¤®¡ ¢«ï¥¬®£® ®¡ê¥ªâ 
36
		shl ecx,16
36
	shl ecx,16
37
		stdcall [tl_node_add], eax, ecx, tree2 ;¤®¡ ¢«ï¥¬ ®¡ê¥ªâ
37
	stdcall [tl_node_add], eax, ecx, tree2 ;¤®¡ ¢«ï¥¬ ®¡ê¥ªâ
38
		stdcall [tl_draw], tree2
38
	stdcall [tl_draw], tree2
Line 112... Line 112...
112
;  edx = 0 if not text
112
;  edx = 0 if not text
113
align 4
113
align 4
114
proc get_obj_text_col, obj:dword, ind:dword
114
proc get_obj_text_col, obj:dword, ind:dword
115
	mov edx,dword[obj]
115
	mov edx,dword[obj]
116
	inc edx ;goto text
116
	add edx,4 ;goto text
117
push ebx
117
push ebx ecx
118
	mov ebx,dword[ind]
118
	mov ecx,dword[ind]
119
	cmp bx,0
119
	cmp cx,0
120
	je .end_fun
120
	je .end_fun
121
 
121
 
Line 122... Line -...
122
	shl ebx,8 ;¢ bh ¯®¯ ¤ ¥â ­®¬¥à ¨áª®¬®© ª®«®­ª¨
-
 
123
	mov bl,byte[edx-1] ;¢ bl ¯®¯ ¤ ¥â ª®¤ ®¡ê¥ªâ 
122
	mov ebx,dword[edx-4] ;¢ ebx ¯®¯ ¤ ¥â ª®¤ ®¡ê¥ªâ 
Line 124... Line 123...
124
 
123
 
125
	push ecx edi
124
	push edi
Line 126... Line 125...
126
	call find_obj_in_opt ;¨é¥¬ áâàãªâãàã á ®¯æ¨ï¬¨ ®¡ê¥ªâ 
125
	call find_obj_in_opt ;¨é¥¬ áâàãªâãàã á ®¯æ¨ï¬¨ ®¡ê¥ªâ 
127
 
126
 
128
	add edi,obj_opt.Col-obj_opt
-
 
129
	dec bh
127
	add edi,obj_opt.Col-obj_opt
130
	and ebx,0xff00
128
	dec ecx
131
	shr ebx,7 ;ᤢ¨£ ¥¬ ­  7, â.ª. ­ã¦­® §­ ç¥­¨¥ bh 㬭®¦¥­­®¥ ­  2
129
	shl ecx,1 ;㬭®¦ ¥¬ ­  2
132
	add edi,ebx ;+ ¡ë¢è¥¥ bh*2
130
	add edi,ecx ;+ ind*2
133
	xor ecx,ecx
131
	xor ecx,ecx
Line 134... Line 132...
134
	mov cx,word[edi] ;ecx - ᤨ£ ¤«ï ¨áª®¬®£® ¯®«ï
132
	mov cx,word[edi] ;ecx - ᤨ£ ¤«ï ¨áª®¬®£® ¯®«ï
Line 142... Line 140...
142
	jl @f
140
	jl @f
143
		mov edx,0 ;not text
141
		mov edx,0 ;not text
144
	@@:
142
	@@:
145
 
143
 
Line 146... Line 144...
146
	pop edi ecx
144
	pop edi
147
	.end_fun:
145
	.end_fun:
148
pop ebx
146
pop ecx ebx
149
	ret
147
	ret
150
endp
148
endp
Line 151... Line 149...
151
 
149
 
152
;input:
150
;input:
Line 156... Line 154...
156
;  eax - ¤«¨­­  ⥪á⮢®£® ¯®«ï ¢­ãâਠ®¡ê¥ªâ 
154
;  eax - ¤«¨­­  ⥪á⮢®£® ¯®«ï ¢­ãâਠ®¡ê¥ªâ 
157
align 4
155
align 4
158
proc get_obj_text_len_col, obj:dword, ind:dword
156
proc get_obj_text_len_col, obj:dword, ind:dword
159
	xor eax,eax
157
	xor eax,eax
160
push ebx
158
push ebx ecx edi
161
	mov ebx,dword[ind]
159
	mov ecx,dword[ind]
162
	shl ebx,8 ;¢ bh ¯®¯ ¤ ¥â ­®¬¥à ¨áª®¬®© ª®«®­ª¨
160
	mov eax,dword[obj]
163
	mov eax,dword[obj]
-
 
164
	mov bl,byte[eax] ;¢ bl ¯®¯ ¤ ¥â ª®¤ ®¡ê¥ªâ 
161
	mov ebx,dword[eax] ;¢ ebx ¯®¯ ¤ ¥â ª®¤ ®¡ê¥ªâ 
165
	xor eax,eax
162
	xor eax,eax
166
 
163
 
Line 167... Line -...
167
	push edi
-
 
168
	call find_obj_in_opt ;¨é¥¬ áâàãªâãàã á ®¯æ¨ï¬¨ ®¡ê¥ªâ 
164
	call find_obj_in_opt ;¨é¥¬ áâàãªâãàã á ®¯æ¨ï¬¨ ®¡ê¥ªâ 
Line 169... Line 165...
169
 
165
 
170
	add edi,obj_opt.Col-obj_opt
-
 
171
	and ebx,0xff00
166
	add edi,obj_opt.Col-obj_opt
172
	shr ebx,7 ;ᤢ¨£ ¥¬ ­  7, â.ª. ­ã¦­® §­ ç¥­¨¥ bh 㬭®¦¥­­®¥ ­  2
167
	shl ecx,1 ;㬭®¦ ¥¬ ­  2
Line 173... Line 168...
173
	add edi,ebx ;+ ¡ë¢è¥¥ bh*2
168
	add edi,ecx ;+ ind*2
174
 
169
 
175
	mov ax,word[edi] ;eax - ᤨ£ ¤«ï á«¥¤ã饣® ¯®«ï
170
	mov ax,word[edi] ;eax - ᤨ£ ¤«ï á«¥¤ã饣® ¯®«ï
176
	cmp ax,0
171
	cmp ax,0
Line 189... Line 184...
189
	jl @f
184
	jl @f
190
		mov eax,0 ;not text
185
		mov eax,0 ;not text
191
	@@:
186
	@@:
192
 
187
 
Line 193... Line -...
193
	pop edi
-
 
194
	.end_fun:
188
	.end_fun:
195
pop ebx
189
pop edi ecx ebx
196
	ret
190
	ret
197
endp
191
endp
Line 198... Line 192...
198
 
192
 
199
align 4
193
align 4
200
proc draw_obj_icon, o_type:dword,n_col:dword, coord_y:dword
194
proc draw_obj_icon, o_type:dword,n_col:dword, coord_y:dword
201
	pushad
195
	pushad
202
	xor ebx,ebx
196
	xor ebx,ebx
203
	mov bl,byte[o_type]
197
	mov ebx,dword[o_type]
Line 204... Line 198...
204
	call find_obj_in_opt
198
	call find_obj_in_opt
205
 
199
 
206
	add edi,obj_opt.img-obj_opt ;get index (+0)
200
	add edi,obj_opt.img-obj_opt ;get index (+0)
Line 229... Line 223...
229
	popad
223
	popad
230
	ret
224
	ret
231
endp
225
endp
232
 
226
 
Line 233... Line -...
233
;¢ë¢®¤ ⥪áâ  á ¯®¤¯¨áìî
-
 
234
align 4
-
 
235
proc draw_obj_caption, o_type:dword,n_col:dword, coord_y:dword
-
 
236
	pushad
-
 
237
	stdcall get_obj_text_len_col, [foc_obj], [n_col] ;eax - ¤«¨­­  ¯®«ï
-
 
238
	cmp eax,1
-
 
239
	jl .no_draw
-
 
240
 
-
 
241
	xor ebx,ebx
-
 
242
	mov bl,byte[o_type]
-
 
243
	call find_obj_in_opt
-
 
244
 
-
 
245
	mov edx,edi
-
 
246
	add edx,obj_opt.caption-obj_opt
-
 
247
 
-
 
248
	mov eax,[n_col]
-
 
249
	mov ebx,150
-
 
250
	shl ebx,16
-
 
251
	add ebx,dword[coord_y]
-
 
252
	add ebx,3
-
 
253
	mov ecx,0 ;text color
-
 
254
 
-
 
255
	mov esi,edx
-
 
256
	.beg_found:
-
 
257
		cmp byte[esi],0
-
 
258
		je .end_found
-
 
259
		cmp byte[esi],'*'
-
 
260
		je @f
-
 
261
		inc esi
-
 
262
		jmp .beg_found
-
 
263
	@@:
-
 
264
	cmp eax,0
-
 
265
	je .end_found
-
 
266
		dec eax
-
 
267
		inc esi
-
 
268
		mov edx,esi ;¯¥à¥ª«îç ¥¬ ­ ç «® áâப¨ ­  á«¥¤. ¯®¤¯¨áì
-
 
269
		jmp .beg_found
-
 
270
	.end_found:
-
 
271
	cmp esi,edx
-
 
272
	jle .no_draw
-
 
273
		sub esi,edx ;esi = text len
-
 
274
		mov eax,4
-
 
275
		int 0x40
-
 
276
	.no_draw:
-
 
277
	popad
-
 
278
	ret
-
 
279
endp
-
 
280
 
-
 
281
align 4
227
align 4
282
proc draw_icon, ind:dword,coord_x:dword,coord_y:dword
228
proc draw_icon, ind:dword,coord_x:dword,coord_y:dword
283
	pushad
229
	pushad
284
	mov ecx,[ind]
230
	mov ecx,[ind]
285
	cmp ecx,0
231
	cmp ecx,0
Line 299... Line 245...
299
	ret
245
	ret
300
endp
246
endp
301
 
247
 
Line 302... Line 248...
302
;input
248
;input
303
;  bl = cod object
249
;  ebx = cod object
304
;output:
250
;output:
305
;  edi = pointer to option struct
251
;  edi = pointer to option struct
306
align 4
252
align 4
307
find_obj_in_opt:
253
find_obj_in_opt:
308
	push ecx
254
	push ecx
309
	xor ecx,ecx ;find 'bl' in options
255
	xor ecx,ecx ;find 'ebx' in options
310
	mov edi,obj_opt
256
	mov edi,obj_opt
311
	@@:
257
	@@:
312
		cmp bl,[edi] ;find
258
		cmp ebx,dword[edi] ;find
313
		je @f
259
		je @f
314
		inc ecx
260
		inc ecx
315
		cmp ecx,MAX_OBJ_TYPES
261
		cmp ecx,MAX_OBJ_TYPES
316
		je @f ;not find
262
		je @f ;not find
317
		add edi,sizeof.ObjOpt
263
		add edi,sizeof.ObjOpt
Line 341... Line 287...
341
		pop eax ;¯®«ãç ¥¬ ¤ ­­ë¥ 㧫 
287
		pop eax ;¯®«ãç ¥¬ ¤ ­­ë¥ 㧫 
342
		cmp eax,0
288
		cmp eax,0
343
		je .find_no
289
		je .find_no
344
 
290
 
Line 345... Line 291...
345
		cmp byte[eax],bl ;ᬮâਬ ®¯¨á ­ «¨ ¨áª®¬ë© ®¡ê¥ªâ ¢ 㧫¥
291
		cmp dword[eax],ebx ;ᬮâਬ ®¯¨á ­ «¨ ¨áª®¬ë© ®¡ê¥ªâ ¢ 㧫¥
346
		je .find_yes
292
		je .find_yes
Line 347... Line 293...
347
 
293
 
348
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
294
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
Line 368... Line 314...
368
push ebx esi
314
push ebx esi
369
	cmp dword[obj_find_last],0
315
	cmp dword[obj_find_last],0
370
	je .find_no
316
	je .find_no
371
 
317
 
Line 372... Line 318...
372
	mov ebx,[o_type]
318
	mov ebx,dword[o_type]
Line 373... Line 319...
373
 
319
 
374
	stdcall dword[tl_node_poi_get_next_info], dword[obj_find_last],tree2
320
	stdcall dword[tl_node_poi_get_next_info], dword[obj_find_last],tree2
Line 375... Line 321...
375
	pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
321
	pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
Line 382... Line 328...
382
		pop eax ;¯®«ãç ¥¬ ¤ ­­ë¥ 㧫 
328
		pop eax ;¯®«ãç ¥¬ ¤ ­­ë¥ 㧫 
383
		cmp eax,0
329
		cmp eax,0
384
		je .find_no
330
		je .find_no
385
 
331
 
Line 386... Line 332...
386
		cmp byte[eax],bl ;ᬮâਬ ®¯¨á ­ «¨ ¨áª®¬ë© ®¡ê¥ªâ ¢ 㧫¥
332
		cmp dword[eax],ebx ;ᬮâਬ ®¯¨á ­ «¨ ¨áª®¬ë© ®¡ê¥ªâ ¢ 㧫¥
387
		je .find_yes
333
		je .find_yes
Line 388... Line 334...
388
 
334
 
389
		stdcall dword[tl_node_poi_get_next_info], esi, tree2
335
		stdcall dword[tl_node_poi_get_next_info], esi, tree2