Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6362 → Rev 6360

/programs/media/animage/trunk/events_of_buttons.inc
13,7 → 13,6
jne @f
mov [finishing_crossing],1
call TakeButtonInstruments
jmp still
@@:
 
mcall SF_GET_BUTTON
93,4 → 92,5
no_kontur__:
 
call TakeButtonInstruments
 
jmp still
/programs/media/animage/trunk/events_of_mouse.inc
233,7 → 233,6
;--------------end copy for undo-------------
no_undo___:
call TakeButtonInstruments
jmp still
 
no_use_instruments:
mov eax,[Current_instrument]
/programs/media/animage/trunk/icons_instruments.inc
153,39 → 153,8
;-----------------------------------------------------------
;-----instruments of panel(icon's instruments)--------------
;-----------------------------------------------------------
;input:
; [Current_instrument] - instrument code
;
; *** instrument codes ***
;10 - pensil
;11 - draw brush
;12 - spray
;13 - lastik
;14 - flood fill
;15 - pipetka
;16 - draw line
;17 - draw rectangle
;18 - draw circle
;19 - draw ellips
;20 - draw hard contour
;21 - allocation of a countour
;23 - reflection from left to right
;24 - reflection from up to down
;40 - brush 1
;41 - brush 2
;42 - brush 3
;43 - brush 4
;44 - brush 5
;45 - zoom 1
;46 - zoom 2
;47 - zoom 3
;48 - zoom 4
;49 - zoom 8
;50 - zoom 16
;51 - palette
TakeButtonInstruments:
 
align 4
TakeButtonInstruments:
mov eax,[Current_instrument]
 
;*************************brush 1***********************
199,7 → 168,8
mov [Current_instrument],ebx
 
mov [line_width],1
ret
 
jmp still
no_brush1:
 
;*************************brush 2***********************
213,7 → 183,8
mov [Current_instrument],ebx
 
mov [line_width],2
ret
 
jmp still
no_brush2:
 
;*************************brush 3***********************
227,7 → 198,8
mov [Current_instrument],ebx
 
mov [line_width],3
ret
 
jmp still
no_brush3:
 
;*************************brush 4***********************
241,7 → 213,8
mov [Current_instrument],ebx
 
mov [line_width],4
ret
 
jmp still
no_brush4:
 
;*************************brush 5***********************
255,7 → 228,8
mov [Current_instrument],ebx
 
mov [line_width],5
ret
 
jmp still
no_brush5:
 
;*************************pensil************************
287,6 → 261,9
 
no_activated_later:
 
; mov eax,[MaxWorkScreen_SizeX] ???
; mov ebx,[MaxWorkScreen_SizeY] ???
 
mov eax,[PointerToPicture]
mov ebx,[ReserveArray]
mov ecx,[Picture_SizeX]
325,9 → 302,31
 
call MovePictureToWorkScreen
mov [Activate_instrument],1
ret
jmp still
no_pensil:
 
;*************************pipetka***********************
cmp eax,15
jne no_pipetka
 
mov eax,[ScreenY]
mov ebx,[Picture_SizeX]
add eax,[PosY]
imul eax,ebx
add eax,[ScreenX]
add eax,[PosX]
lea eax,[eax+eax*2]
add eax,[PointerToPicture]
mov ebx,[eax]
and ebx,0xffffff
mov [Color],ebx
 
mcall SF_DRAW_RECT, ((ci_panel_x_pos+130) shl 16)+21,\
((ci_panel_y_pos+28) shl 16)+21, [Color]
 
jmp still
no_pipetka:
 
;*************************draw brush********************
cmp eax,11
jne no_brush
476,40 → 475,9
mov eax,[Current_instrument]
mov [Last_instrument],eax
 
ret
jmp still
no_brush:
 
;*************************pipetka***********************
cmp eax,15
jne no_pipetka
 
mov eax,[ScreenY]
mov ebx,[Picture_SizeX]
add eax,[PosY]
imul eax,ebx
add eax,[ScreenX]
add eax,[PosX]
lea eax,[eax+eax*2]
add eax,[PointerToPicture]
mov ebx,[eax]
and ebx,0xffffff
mov [Color],ebx
 
mcall SF_DRAW_RECT, ((ci_panel_x_pos+130) shl 16)+21,\
((ci_panel_y_pos+28) shl 16)+21, [Color]
 
ret
no_pipetka:
 
;************************lastik*************************
cmp eax,13
jne no_lastik
 
mov [Last_instrument],eax
mov [lastik_is_active],1
jmp lastik_in
no_lastik:
 
;************************Flood Fill*********************
cmp eax,14
jne no_FloodFill
545,10 → 513,21
 
call flood_fill
call MovePictureToWorkScreen
ret
 
jmp still
no_FloodFill:
 
;************************spray**************************
;************************lastik*************************
cmp eax,13
jne no_lastik
 
mov [Last_instrument],eax
mov [lastik_is_active],1
jmp lastik_in
 
no_lastik:
 
;*******************************************************
cmp eax,12
jne no_spray
 
555,7 → 534,7
cmp [Activate_instrument],0
jne no_null_spray
mov [Activate_instrument],1
ret
jmp still
no_null_spray:
 
mov eax,[ScreenX]
631,7 → 610,8
jl brush_y_spray
 
call MovePictureToWorkScreen
ret
jmp still
 
no_spray:
 
;************************palette************************
669,22 → 649,24
jnz next_rectangle
 
wait_events:
mcall SF_WAIT_EVENT
call event
 
cmp eax,1
jne @f
ret
@@:
je still
 
cmp eax,2
jne no_keys
 
mcall SF_GET_KEY
jmp wait_events
 
no_keys:
 
cmp eax,3
jne no_buttons
mcall SF_GET_BUTTON
jmp wait_events
 
no_buttons:
 
cmp eax,6
jne wait_events
 
734,7 → 716,8
 
mov eax,[Last_instrument]
mov [Current_instrument],eax
ret
 
jmp still
no_palette:
 
;************************draw line**********************
756,9 → 739,8
xor eax,eax
mov ecx,mem_flood_f/4
mov edi,[ReserveArray]
cld
rep stosd
ret
jmp still
no_new_line_xy:
 
;put saved pixels
800,7 → 782,7
draw_calc_pixels width_pixels
 
call MovePictureToWorkScreen
ret
jmp still
no_line:
 
;************************draw rectangle*****************
822,9 → 804,8
xor eax,eax
mov ecx,mem_flood_f/4
mov edi,[ReserveArray]
cld
rep stosd
ret
jmp still
no_new_rectangle_xy:
 
;put saved pixels
866,7 → 847,7
draw_calc_pixels width_pixels_rectangle
 
call MovePictureToWorkScreen
ret
jmp still
no_rectangle:
 
;************************draw circle********************
888,9 → 869,8
xor eax,eax
mov ecx,mem_flood_f/4
mov edi,[ReserveArray]
cld
rep stosd
ret
jmp still
no_new_circle_xy:
 
;put saved pixels
1019,7 → 999,7
draw_calc_pixels width_pixels
 
call MovePictureToWorkScreen
ret
jmp still
no_circle:
 
;************************zoom 1*************************
1029,7 → 1009,7
call scrollbar_move_00
and [Current_instrument],0
call drawwin
ret
jmp still
no_1_:
 
;************************zoom 2*************************
1039,9 → 1019,10
call drawwin
call scrollbar_move_00
and [Current_instrument],0
ret
jmp still
no_2_:
 
 
;************************zoom 3*************************
cmp eax,47
jne no_3_
1049,7 → 1030,7
call drawwin
call scrollbar_move_00
and [Current_instrument],0
ret
jmp still
no_3_:
 
;************************zoom 4*************************
1059,7 → 1040,7
call drawwin
call scrollbar_move_00
and [Current_instrument],0
ret
jmp still
no_4_:
 
;************************zoom 8*************************
1069,7 → 1050,7
call drawwin
call scrollbar_move_00
and [Current_instrument],0
ret
jmp still
no_8_:
 
;************************zoom 16************************
1079,7 → 1060,7
call drawwin
call scrollbar_move_00
and [Current_instrument],0
ret
jmp still
no_16_:
 
;***************allocation of a countour****************
1109,9 → 1090,8
xor eax,eax
mov ecx,mem_flood_f/4
mov edi,[ReserveArray]
cld
rep stosd
ret
jmp still
no_new_allocation_xy:
instrument_not_finished_work:
 
1206,8 → 1186,8
mov edi,[SpriteSizeY]
add ecx,[PosX]
add edx,[PosY]
inc esi
inc edi
inc esi;eax
inc edi;ebx
call columnus
 
test eax,eax
1336,7 → 1316,7
and [instrument_used],0
and [DrawSprite_flag],0
call MovePictureToWorkScreen
ret
jmp still
not_finish_from_instrument_crossing:
 
;calculate line
1430,7 → 1410,7
no_save_shades:
 
call MovePictureToWorkScreen
ret
jmp still
no_allocation:
 
;*************reflection from left to right*************
1513,7 → 1493,7
jnz next_line_reflection_x
 
call MovePictureToWorkScreen
ret
jmp still
no_reflection_from_left_to_right:
 
;*************reflection from up to down****************
1565,7 → 1545,7
jnz next_lines_reflection
 
call MovePictureToWorkScreen
ret
jmp still
no_reflection_from_up_to_down:
 
;*********************draw hard contour*****************
1656,9 → 1636,10
mov [used_OldY],ebx
 
call MovePictureToWorkScreen
ret
 
jmp still
 
no_kontur_:
 
;************************draw ellips********************
cmp eax,19
jne no_ellips
1678,9 → 1659,8
xor eax,eax
mov ecx,mem_flood_f/4
mov edi,[ReserveArray]
cld
rep stosd
ret
jmp still
no_new_ellips_xy:
 
;put saved pixels
1801,7 → 1781,9
draw_calc_pixels width_pixels
 
call MovePictureToWorkScreen
;ret
jmp still
no_ellips:
 
 
jmp still
ret
/programs/media/animage/trunk/menu.inc
2,18 → 2,6
KMENUITEM_SUBMENU equ 1
KMENUITEM_SEPARATOR equ 2
 
macro menu_set code, m_group, m_number
{
local no_set
 
cmp eax, code
jne no_set
mov [number_panel], m_group
mov [number_menu], m_number
jmp TakeInstruments
no_set:
}
 
init_main_menu:
stdcall [kmenu_init], syscolors
70,28 → 58,6
; init 'Edit' menu
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Instr_Pencil, 0x51
stdcall [ksubmenu_add], [main_menu_instr], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Instr_Brush, 0x52
stdcall [ksubmenu_add], [main_menu_instr], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Instr_Spray, 0x53
stdcall [ksubmenu_add], [main_menu_instr], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Instr_Lastik, 0x54
stdcall [ksubmenu_add], [main_menu_instr], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Instr_Flood_fill, 0x55
stdcall [ksubmenu_add], [main_menu_instr], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Instr_Pipetka, 0x56
stdcall [ksubmenu_add], [main_menu_instr], eax
stdcall [kmenuitem_new], KMENUITEM_SEPARATOR, 0, 0
stdcall [ksubmenu_add], [main_menu_instr], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Instr_Line, 0x57
stdcall [ksubmenu_add], [main_menu_instr], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Instr_Rectangle, 0x58
stdcall [ksubmenu_add], [main_menu_instr], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Instr_Circle, 0x59
stdcall [ksubmenu_add], [main_menu_instr], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Instr_Ellips, 0x5a
stdcall [ksubmenu_add], [main_menu_instr], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Instr_Hard_contour, 0x5b
stdcall [ksubmenu_add], [main_menu_instr], eax
 
; add 'Instruments' menu to main
stdcall [kmenuitem_new], KMENUITEM_SUBMENU, sz_main_menu_Instr, [main_menu_instr]
104,28 → 70,78
ret
 
button_handler_main_menu:
menu_set 0x71, 7,1
menu_set 0x72, 7,2
menu_set 0x73, 7,3
menu_set 0x74, 7,4
menu_set 0x75, 7,5
menu_set 0x61, 6,1
menu_set 0x62, 6,2
menu_set 0x63, 6,3
menu_set 0x64, 6,4
menu_set 0x65, 6,5
menu_set 0x66, 6,6
menu_set 0x51, 5,1
menu_set 0x52, 5,2
menu_set 0x53, 5,3
menu_set 0x54, 5,4
menu_set 0x55, 5,5
menu_set 0x56, 5,6
menu_set 0x57, 5,7
menu_set 0x58, 5,8
menu_set 0x59, 5,9
menu_set 0x5a, 5,10
menu_set 0x5b, 5,11
cmp eax, 0x71
jne @f
mov [number_panel], 7
mov [number_menu], 1
jmp TakeInstruments
@@:
cmp eax, 0x72
jne @f
mov [number_panel], 7
mov [number_menu], 2
jmp TakeInstruments
@@:
cmp eax, 0x73
jne @f
mov [number_panel], 7
mov [number_menu], 3
jmp TakeInstruments
@@:
cmp eax, 0x74
jne @f
mov [number_panel], 7
mov [number_menu], 4
jmp TakeInstruments
@@:
cmp eax, 0x75
jne @f
mov [number_panel], 7
mov [number_menu], 5
jmp TakeInstruments
@@:
cmp eax, 0x61
jne @f
mov [number_panel], 6
mov [number_menu], 1
jmp TakeInstruments
@@:
cmp eax, 0x62
jne @f
mov [number_panel], 6
mov [number_menu], 2
jmp TakeInstruments
@@:
cmp eax, 0x63
jne @f
mov [number_panel], 6
mov [number_menu], 3
jmp TakeInstruments
@@:
cmp eax, 0x64
jne @f
mov [number_panel], 6
mov [number_menu], 4
jmp TakeInstruments
@@:
cmp eax, 0x65
jne @f
mov [number_panel], 6
mov [number_menu], 5
jmp TakeInstruments
@@:
cmp eax, 0x66
jne @f
mov [number_panel], 6
mov [number_menu], 6
jmp TakeInstruments
@@:
cmp eax, 0x51
jne @f
mov [number_panel], 5
mov [number_menu], 1
jmp TakeInstruments
@@:
.end_handler:
ret
 
150,14 → 166,4
sz_main_menu_Edit_ClS db 'Clear screen', 0
 
sz_main_menu_Instr db 'Instruments', 0
sz_main_menu_Instr_Pencil db 'Pencil', 0
sz_main_menu_Instr_Brush db 'Brush', 0
sz_main_menu_Instr_Spray db 'Spray', 0
sz_main_menu_Instr_Lastik db 'Lastik', 0
sz_main_menu_Instr_Flood_fill db 'Flood fill', 0
sz_main_menu_Instr_Pipetka db 'Pipetka', 0
sz_main_menu_Instr_Line db 'Line', 0
sz_main_menu_Instr_Rectangle db 'Rectangle', 0
sz_main_menu_Instr_Circle db 'Circle', 0
sz_main_menu_Instr_Ellips db 'Ellips', 0
sz_main_menu_Instr_Hard_contour db 'Hard contour', 0
sz_main_menu_Instr_Pencil db 'Pencil', 0
/programs/media/animage/trunk/menu_instruments.inc
1,18 → 1,6
macro instrument_set m_num, code
{
local no_instrument
cmp [number_menu],m_num
jne no_instrument
mov [Current_instrument],code
call TakeButtonInstruments
jmp end_menu
no_instrument:
}
 
;-----------------------------------------------------------
;-----------instruments of menu-----------------------------
;-----------------------------------------------------------
align 4
TakeInstruments:
;|||||||||||||||||||FILE||||||||||||||||||||||
cmp [number_panel],7
111,10 → 99,12
call GetMemory
 
and [save_flag],0
and [number_panel],0
and [number_menu],0
 
call cleare_work_arrea
call drawwin
jmp end_menu
jmp still
;---------------------------------------------------------------------
no_new:
; <<< Open >>>
128,13 → 118,16
call [OpenDialog_Start]
cmp [OpenDialog_data.status],1
jne end_menu
jne still
;---------------------------------------------------------------------
mcall SF_SET_EVENTS_MASK,0x80000027 ;100111b
 
call load_picture
call drawwin
jmp end_menu
 
and [number_panel],0
and [number_menu],0
jmp still
;---------------------------------------------------------------------
no_open:
; <<< Save >>>
143,9 → 136,14
 
mov al,[save_flag]
test al,al
jz end_menu
jz no_save_file
jmp save_enter
;---------------------------------------------------------------------
no_save_file:
and [number_panel],0
and [number_menu],0
jmp still
;---------------------------------------------------------------------
no_save_:
; <<< Save as >>>
cmp [number_menu],4
173,7 → 171,7
stdcall [OpenDialog_Start],OpenDialog_data
 
cmp [OpenDialog_data.status],1
jne end_menu
jne still
;---------------------------------------------------------------------
save1:
save_enter:
197,9 → 195,16
call save_file
 
mov [save_flag],1
and [number_panel],0
and [number_menu],0
call drawwin
jmp end_menu
jmp still
;---------------------------------------------------------------------
;save2:
; and [number_panel],0
; and [number_menu],0
; jmp still
;---------------------------------------------------------------------
no_save:
; <<< Exit >>>
cmp [number_menu],5
230,7 → 235,9
mov [PointerToCopyPicture2],eax
 
call MovePictureToWorkScreen
jmp end_menu
and [number_panel],0
and [number_menu],0
jmp still
;---------------------------------------------------------------------
no_undo:
; <<< Redo >>>
250,7 → 257,9
mov [PointerToCopyPicture2],ebx
 
call MovePictureToWorkScreen
jmp end_menu
and [number_panel],0
and [number_menu],0
jmp still
;---------------------------------------------------------------------
no_redo:
; <<< Copy >>>
346,8 → 355,11
jl loop_fill_rectangle_y_copy
 
call MovePictureToWorkScreen
 
and [number_panel],0
and [number_menu],0
mov [DrawSprite_flag],1
jmp end_menu
jmp still
;---------------------------------------------------------------------
no_copy:
; <<< Paste >>>
439,8 → 451,10
jl loop_fill_rectangle_y_paste
 
call MovePictureToWorkScreen
and [number_panel],0
and [number_menu],0
mov [Paste_flag],1
jmp end_menu
jmp still
;---------------------------------------------------------------------
no_paste:
; <<< Cut >>>
530,7 → 544,10
jl loop_fill_rectangle_y
 
call MovePictureToWorkScreen
jmp end_menu
 
and [number_panel],0
and [number_menu],0
jmp still
;---------------------------------------------------------------------
no_cut:
; <<< Cleare all >>>
539,12 → 556,15
 
call cleare_work_arrea
call MovePictureToWorkScreen
jmp end_menu
 
and [number_panel],0
and [number_menu],0
jmp still
;---------------------------------------------------------------------
no_cleare_all:
; <<< To allocate all >>>
cmp [number_menu],7
jne end_menu ;no_to_allocate_all
jne still ;no_to_allocate_all
 
mov [OldX],1
mov [OldY],1
558,9 → 578,11
mov [Activate_instrument],1
mov [Current_instrument],30
mov [crossing],0
and [number_panel],0
and [number_menu],0
; call TakeButtonInstruments
; call MovePictureToWorkScreen
jmp end_menu
jmp still
;---------------------------------------------------------------------
;no_to_allocate_all:
no_edit:
567,23 → 589,15
;|||||||||||||||||||||||||INSTRUMENTS||||||||||||||||||||||
cmp [number_panel],5
jne no_instruments
; <<< Pencil >>>
cmp [number_menu],1
jne no_pencil
 
instrument_set 1,10 ; pensil
instrument_set 2,11 ; draw brush
instrument_set 3,12 ; spray
instrument_set 4,13 ; lastik
instrument_set 5,14 ; flood fill
instrument_set 6,15 ; pipetka
instrument_set 7,16 ; draw line
instrument_set 8,17 ; draw rectangle
instrument_set 9,18 ; draw circle
instrument_set 10,19 ; draw ellips
instrument_set 11,20 ; draw hard contour
; ... todo ...
 
no_instruments:
 
end_menu:
and [number_panel],0
and [number_menu],0
no_pencil:
no_instruments:
jmp still
;---------------------------------------------------------------------