Subversion Repositories Kolibri OS

Rev

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

Rev 2045 Rev 6355
Line 1... Line 1...
1
;---------------------------------------------
1
;---------------------------------------------
2
;-------------interraction MOUSE--------------
2
;-------------interraction MOUSE--------------
3
;---------------------------------------------
3
;---------------------------------------------
4
mouse:
4
mouse:
5
	or	ecx,-1
5
	or	ecx,-1
6
	mcall	9,procinfo
6
	mcall SF_THREAD_INFO,procinfo
Line 7... Line 7...
7
	
7
	
8
	mov	eax,[procinfo+70] ;staus of window
8
	mov	eax,[procinfo+70] ;staus of window
9
	test	eax,100b
9
	test	eax,100b
Line 208... Line 208...
208
	jz	no_use_instruments
208
	jz	no_use_instruments
Line 209... Line 209...
209
 
209
 
210
	cmp	[Activate_instrument],0
210
	cmp	[Activate_instrument],0
211
	jnz	no_undo___
211
	jnz	no_undo___
212
;------------begin copy for undo-------------
-
 
213
	inc	[number_undo]
-
 
214
	cmp	[number_undo],1
-
 
215
	jne	no_one__
-
 
216
 
-
 
217
	mov	edi,[PointerToCopyPicture]
-
 
218
 
-
 
219
no_one__:
-
 
220
	cmp	[number_undo],2
-
 
221
	jne	no_two__
-
 
222
 
-
 
223
	mov	edi,[PointerToCopyPicture2]
-
 
224
 
-
 
225
no_two__:
-
 
226
	cmp	[number_undo],3
-
 
227
	jne	no_three__
-
 
228
 
212
;------------begin copy for undo-------------
229
;copy bufer number two to bufer number one
-
 
230
	mov	esi,[PointerToCopyPicture2]
-
 
231
	mov	edi,[PointerToCopyPicture]
-
 
232
	mov	ecx,[Picture_SizeX]
-
 
233
	imul	ecx,[Picture_SizeY]
-
 
234
	lea	ecx,[ecx+ecx*2]
-
 
235
	add	ecx,4
-
 
236
	shr	ecx,2
-
 
237
	inc	ecx
-
 
238
	cld
-
 
239
	rep	movsd
-
 
240
;end copy
-
 
241
	dec	[number_undo]
213
;copy bufer number 2 to bufer number 0
242
	mov	edi,[PointerToCopyPicture2]
-
 
243
 
-
 
244
no_three__:
214
	mov edi,[PointerToCopyPicture2]
245
	mov	esi,[PointerToPicture]
215
	mov esi,[PointerToPicture]
246
	mov	ecx,[Picture_SizeX]
216
	mov ecx,[Picture_SizeX]
247
	imul	ecx,[Picture_SizeY]
217
	imul ecx,[Picture_SizeY]
248
	lea	ecx,[ecx+ecx*2]
218
	lea ecx,[ecx+ecx*2]
249
	add	ecx,4
219
	mov ebx,ecx
250
	shr	ecx,2
-
 
251
	inc	ecx
220
	shr ecx,2
252
	cld
221
	cld
-
 
222
	rep movsd
-
 
223
	mov ecx,ebx
-
 
224
	and ecx,3
-
 
225
	rep movsb
-
 
226
	;call MovePictureToWorkScreen
-
 
227
;rotate bufers +1
-
 
228
	and	[number_undo],0 ;erase all undo
-
 
229
	mov eax,[PointerToPicture]
-
 
230
	mov ebx,[PointerToCopyPicture]
-
 
231
	mov ecx,[PointerToCopyPicture2]
-
 
232
	mov [PointerToPicture],ecx
-
 
233
	mov [PointerToCopyPicture],eax
253
	rep	movsd
234
	mov [PointerToCopyPicture2],ebx
254
;--------------end copy for undo-------------
235
;--------------end copy for undo-------------
255
no_undo___:
236
no_undo___:
Line 256... Line 237...
256
	call	TakeButtonInstruments
237
	call	TakeButtonInstruments
Line 261... Line 242...
261
	jmp	still
242
	jmp	still
262
;-----------------------------------------------
243
;-----------------------------------------------
263
;---------get mouse cordinats-------------------
244
;---------get mouse cordinats-------------------
264
;-----------------------------------------------
245
;-----------------------------------------------
265
GetMouseCoordinats:
246
GetMouseCoordinats:
266
	mcall	37,1
247
	mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
267
	mov	ebx,eax
248
	mov	ebx,eax
268
	shr	eax,16
249
	shr	eax,16
269
	and	ebx,0xffff
250
	and	ebx,0xffff
270
	mov	[MouseX],eax
251
	mov	[MouseX],eax
271
	mov	[MouseY],ebx
252
	mov	[MouseY],ebx
272
	ret
253
	ret
273
;------------------------------------------------
254
;------------------------------------------------
274
;-------get mouse attributs----------------------
255
;-------get mouse attributs----------------------
275
;------------------------------------------------
256
;------------------------------------------------
276
GetMouseClick:
257
GetMouseClick:
277
	mcall	37,2
258
	mcall SF_MOUSE_GET,SSF_BUTTON
278
	ret
259
	ret
279
260