Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6354 → Rev 6355

/programs/media/animage/trunk/events_of_mouse.inc
3,7 → 3,7
;---------------------------------------------
mouse:
or ecx,-1
mcall 9,procinfo
mcall SF_THREAD_INFO,procinfo
mov eax,[procinfo+70] ;staus of window
test eax,100b
210,47 → 210,28
cmp [Activate_instrument],0
jnz no_undo___
;------------begin copy for undo-------------
inc [number_undo]
cmp [number_undo],1
jne no_one__
 
mov edi,[PointerToCopyPicture]
 
no_one__:
cmp [number_undo],2
jne no_two__
 
;copy bufer number 2 to bufer number 0
mov edi,[PointerToCopyPicture2]
 
no_two__:
cmp [number_undo],3
jne no_three__
 
;copy bufer number two to bufer number one
mov esi,[PointerToCopyPicture2]
mov edi,[PointerToCopyPicture]
mov ecx,[Picture_SizeX]
imul ecx,[Picture_SizeY]
lea ecx,[ecx+ecx*2]
add ecx,4
shr ecx,2
inc ecx
cld
rep movsd
;end copy
dec [number_undo]
mov edi,[PointerToCopyPicture2]
 
no_three__:
mov esi,[PointerToPicture]
mov ecx,[Picture_SizeX]
imul ecx,[Picture_SizeY]
lea ecx,[ecx+ecx*2]
add ecx,4
mov ebx,ecx
shr ecx,2
inc ecx
cld
rep movsd
mov ecx,ebx
and ecx,3
rep movsb
;call MovePictureToWorkScreen
;rotate bufers +1
and [number_undo],0 ;erase all undo
mov eax,[PointerToPicture]
mov ebx,[PointerToCopyPicture]
mov ecx,[PointerToCopyPicture2]
mov [PointerToPicture],ecx
mov [PointerToCopyPicture],eax
mov [PointerToCopyPicture2],ebx
;--------------end copy for undo-------------
no_undo___:
call TakeButtonInstruments
263,7 → 244,7
;---------get mouse cordinats-------------------
;-----------------------------------------------
GetMouseCoordinats:
mcall 37,1
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
mov ebx,eax
shr eax,16
and ebx,0xffff
274,5 → 255,5
;-------get mouse attributs----------------------
;------------------------------------------------
GetMouseClick:
mcall 37,2
mcall SF_MOUSE_GET,SSF_BUTTON
ret
/programs/media/animage/trunk/icons_instruments.inc
95,6 → 95,61
jnz .next_color_save
}
 
macro draw_calc_pixels brush
{
local .next_pixel_put
local .vertical_width
local .horizontal_width
local .no_draw_pixel
 
mov ebx,[ReserveArray]
mov ecx,[ebx]
mov edx,[Color]
mov esi,[Color]
shr edx,16
add ebx,4
mov edi,[line_width]
dec edi
imul edi,25
add edi,brush
.next_pixel_put:
 
mov eax,[ebx]
push eax
push ecx
xor ebp,ebp
mov [counter2],5
 
.vertical_width:
mov [counter],5
 
.horizontal_width:
xor ecx,ecx
mov cl,byte[edi+ebp]
test cl,cl
jz .no_draw_pixel
mov [eax],si
mov [eax+2],dl
.no_draw_pixel:
add eax,3
inc ebp
dec [counter]
jnz .horizontal_width
 
mov ecx,[Picture_SizeX]
sub ecx,5
lea ecx,[ecx+ecx*2]
add eax,ecx
dec [counter2]
jnz .vertical_width
 
pop ecx
pop eax
add ebx,4
dec ecx
jnz .next_pixel_put
}
 
;-----------------------------------------------------------
;-----instruments of panel(icon's instruments)--------------
;-----------------------------------------------------------
723,56 → 778,9
square_width_save
 
;draw calculated pixels on work arrea
mov ebx,[ReserveArray]
mov ecx,[ebx]
mov edx,[Color]
mov esi,[Color]
shr edx,16
add ebx,4
mov edi,[line_width]
dec edi
imul edi,25
next_pixel_put_line:
draw_calc_pixels width_pixels
 
mov eax,[ebx]
push eax
push ecx
xor ebp,ebp
and [counter2],0
 
vertical_width:
and [counter],0
 
horizontal_width:
xor ecx,ecx
mov cl,byte[width_pixels+edi+ebp]
test cl,cl
jz no_draw_pixel_line
mov [eax],si
mov [eax+2],dl
no_draw_pixel_line:
add eax,3
inc ebp
inc [counter]
cmp [counter],5
jne horizontal_width
 
mov ecx,[Picture_SizeX]
sub ecx,5
lea ecx,[ecx+ecx*2]
add eax,ecx
inc [counter2]
cmp [counter2],5
jne vertical_width
 
pop ecx
pop eax
add ebx,4
dec ecx
jnz next_pixel_put_line
 
call MovePictureToWorkScreen
 
jmp still
no_line:
 
835,54 → 843,8
square_width_save
 
;draw calculated pixels on work arrea
mov ebx,[ReserveArray]
mov ecx,[ebx]
mov edx,[Color]
mov esi,[Color]
shr edx,16
add ebx,4
mov edi,[line_width]
dec edi
imul edi,25
next_pixel_put_rectangle:
draw_calc_pixels width_pixels_rectangle
 
mov eax,[ebx]
push eax
push ecx
xor ebp,ebp
and [counter2],0
 
vertical_width_rectangle:
and [counter],0
 
horizontal_width_rectangle:
xor ecx,ecx
mov cl,byte[width_pixels_rectangle+edi+ebp]
test cl,cl
jz no_draw_pixel_rectangle
mov [eax],si
mov [eax+2],dl
no_draw_pixel_rectangle:
add eax,3
inc ebp
inc [counter]
cmp [counter],5
jne horizontal_width_rectangle
 
mov ecx,[Picture_SizeX]
sub ecx,5
lea ecx,[ecx+ecx*2]
add eax,ecx
inc [counter2]
cmp [counter2],5
jne vertical_width_rectangle
 
pop ecx
pop eax
add ebx,4
dec ecx
jnz next_pixel_put_rectangle
 
call MovePictureToWorkScreen
jmp still
no_rectangle:
1033,54 → 995,8
square_width_save
 
;draw calculated pixels on work arrea
mov ebx,[ReserveArray]
mov ecx,[ebx]
mov edx,[Color]
mov esi,[Color]
shr edx,16
add ebx,4
mov edi,[line_width]
dec edi
imul edi,25
next_pixel_put_circle:
draw_calc_pixels width_pixels
 
mov eax,[ebx]
push eax
push ecx
xor ebp,ebp
and [counter2],0
 
vertical_width_circle:
and [counter],0
 
horizontal_width_circle:
xor ecx,ecx
mov cl,byte[width_pixels+edi+ebp]
test cl,cl
jz no_draw_pixel_circle
mov [eax],si
mov [eax+2],dl
no_draw_pixel_circle:
add eax,3
inc ebp
inc [counter]
cmp [counter],5
jne horizontal_width_circle
 
mov ecx,[Picture_SizeX]
sub ecx,5
lea ecx,[ecx+ecx*2]
add eax,ecx
inc [counter2]
cmp [counter2],5
jne vertical_width_circle
 
pop ecx
pop eax
add ebx,4
dec ecx
jnz next_pixel_put_circle
 
call MovePictureToWorkScreen
jmp still
no_circle:
1715,54 → 1631,8
square_width_save
 
;draw calculated pixels on work arrea
mov ebx,[ReserveArray]
mov ecx,[ebx]
mov edx,[Color]
mov esi,[Color]
shr edx,16
add ebx,4
mov edi,[line_width]
dec edi
imul edi,25
next_pixel_put_konture:
draw_calc_pixels width_pixels
 
mov eax,[ebx]
push eax
push ecx
xor ebp,ebp
and [counter2],0
 
vertical_width_konture:
and [counter],0
 
horizontal_width_konture:
xor ecx,ecx
mov cl,byte[width_pixels+edi+ebp]
test cl,cl
jz no_draw_pixel_konture
mov [eax],si
mov [eax+2],dl
no_draw_pixel_konture:
add eax,3
inc ebp
inc [counter]
cmp [counter],5
jne horizontal_width_konture
 
mov ecx,[Picture_SizeX]
sub ecx,5
lea ecx,[ecx+ecx*2]
add eax,ecx
inc [counter2]
cmp [counter2],5
jne vertical_width_konture
 
pop ecx
pop eax
add ebx,4
dec ecx
jnz next_pixel_put_konture
 
mov eax,[ScreenX]
mov ebx,[ScreenY]
add eax,[PosX]
1913,54 → 1783,8
square_width_save
 
;draw calculated pixels on work arrea
mov ebx,[ReserveArray]
mov ecx,[ebx]
mov edx,[Color]
mov esi,[Color]
shr edx,16
add ebx,4
mov edi,[line_width]
dec edi
imul edi,25
next_pixel_put_ellips:
draw_calc_pixels width_pixels
 
mov eax,[ebx]
push eax
push ecx
xor ebp,ebp
and [counter2],0
 
vertical_width_ellips:
and [counter],0
 
horizontal_width_ellips:
xor ecx,ecx
mov cl,byte[width_pixels+edi+ebp]
test cl,cl
jz no_draw_pixel_ellips
mov [eax],si
mov [eax+2],dl
no_draw_pixel_ellips:
add eax,3
inc ebp
inc [counter]
cmp [counter],5
jne horizontal_width_ellips
 
mov ecx,[Picture_SizeX]
sub ecx,5
lea ecx,[ecx+ecx*2]
add eax,ecx
inc [counter2]
cmp [counter2],5
jne vertical_width_ellips
 
pop ecx
pop eax
add ebx,4
dec ecx
jnz next_pixel_put_ellips
 
call MovePictureToWorkScreen
jmp still
no_ellips:
/programs/media/animage/trunk/menu_instruments.inc
255,8 → 255,7
cmp [number_menu],5
jne no_exit_program
 
mov eax,-1
mcall
mcall SF_TERMINATE_PROCESS
;---------------------------------------------------------------------
no_exit_program:
no_file:
268,34 → 267,19
cmp [number_menu],1
jne no_undo
 
cmp [number_undo],1
jne no_one____
cmp [number_undo],2 ;2 - maximum undo count
jge no_undo
 
mov esi,[PointerToCopyPicture]
;rotate bufers -1
inc [number_undo]
mov eax,[PointerToPicture]
mov ebx,[PointerToCopyPicture]
mov ecx,[PointerToCopyPicture2]
mov [PointerToPicture],ebx
mov [PointerToCopyPicture],ecx
mov [PointerToCopyPicture2],eax
 
no_one____:
cmp [number_undo],2
jne no_two____
 
mov esi,[PointerToCopyPicture2]
 
no_two____:
mov edi,[PointerToPicture]
mov ecx,[Picture_SizeX]
imul ecx,[Picture_SizeY]
lea ecx,[ecx+ecx*2]
add ecx,4
shr ecx,2
cld
rep movsd
call MovePictureToWorkScreen
 
dec [number_undo]
jnz no_null_undo
 
mov [number_undo],1
 
no_null_undo:
and [number_panel],0
and [number_menu],0
jmp still