Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2462 → Rev 2482

/programs/media/log_el/trunk/log_el.asm
47,7 → 47,7
include 'le_signal.inc'
 
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
caption db '‹®£¨ç¥áª¨¥ í«¥¬¥­âë 15.03.12',0 ;¯®¤¯¨áì ®ª­ 
caption db '‹®£¨ç¥áª¨¥ í«¥¬¥­âë 20.03.12',0 ;¯®¤¯¨áì ®ª­ 
 
panel_0_coord_top equ 5 ;¢¥àå­ïï ª®®à¤¨­ â  0-£® à鸞 ¯ ­¥«¨ ¨­áâà㬥­â®¢
panel_1_coord_top equ 35
127,11 → 127,13
time dd 0
tim_ch db 0
pen_mode dd 0 ;०¨¬ à¨á®¢ ­¨ï ¯à®¢®¤ 
pen_coord_x dd 0 ;ª®®à¤¨­ â  x ­ ç «ì­®© â®çª¨ à¨á®¢ ­¨ï
pen_coord_y dd 0
 
txt_set_0 db '0',0
txt_set_1 db '1',0
txt_mov_l db 27,0 ;<-
txt_mov_r db 26,0 ;->
;txt_mov_l db 27,0 ;<-
;txt_mov_r db 26,0 ;->
 
txt_size db 'size',0
txt_elements db 'elements',0
150,7 → 152,7
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
 
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*15
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*20
image_data_toolbar dd 0
 
TREE_ICON_SYS16_BMP_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*11+54 ;à §¬¥à bmp ä ©«  á á¨á⥬­ë¬¨ ¨ª®­ª ¬¨
161,6 → 163,9
IMAGE_FONT_SIZE equ 128*144*3
image_data_gray dd 0 ;¯ ¬ïâì á ¢à¥¬¥­­ë¬¨ á¥à묨 ¨§®¡à ¦¥­¨ï¬¨ ¢ ä®à¬ â¥ 24-bit, ¨§ ª®â®àëå ¡ã¤ãâ ᮧ¤ ¢ âìáï âà ä à¥âë
 
cursors_count equ 4
IMAGE_CURSORS_SIZE equ 4096*cursors_count ;à §¬¥à ª à⨭ª¨ á ªãàá®à ¬¨
 
macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
231,6 → 236,7
mov eax,dword[icon_toolbar]
mov dword[tree1.data_img],eax
 
;*** § £à㧪  èà¨äâ 
load_image_file 'font6x9.bmp', image_data_gray,IMAGE_FONT_SIZE
stdcall [buf2d_create_f_img], buf_font,[image_data_gray] ;ᮧ¤ ¥¬ ¡ãä¥à
stdcall mem.Free,[image_data_gray] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
238,6 → 244,18
stdcall [buf2d_conv_24_to_8], buf_font,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8 ¡¨â
stdcall [buf2d_convert_text_matrix], buf_font
 
;*** § £à㧪  ªãàá®à®¢
load_image_file 'cursors_gr.png',image_data_gray,IMAGE_CURSORS_SIZE
stdcall [buf2d_create_f_img], buf_curs_8,[image_data_gray] ;ᮧ¤ ¥¬ ¡ãä¥à
stdcall mem.Free,[image_data_gray] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
 
load_image_file 'cursors.png',image_data_gray, IMAGE_CURSORS_SIZE
stdcall [buf2d_create_f_img], buf_curs,[image_data_gray] ;ᮧ¤ ¥¬ ¡ãä¥à
stdcall mem.Free,[image_data_gray] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
 
stdcall [buf2d_conv_24_to_8], buf_curs_8,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8¡¨â
stdcall [buf2d_conv_24_to_32],buf_curs,buf_curs_8 ;¤¥« ¥¬ ¡ãä¥à rgba 32¡¨â
 
stdcall sign_init, 3000
 
mcall 26,9
304,7 → 322,12
push eax ebx ecx edx
mcall 37,2 ;­ ¦ âë¥ ª­®¯ª¨ ¬ëè¨
bt eax,0 ;«¥¢ ï ª­®¯ª  ­ ¦ â ?
jnc .end_buf_wnd
jc @f
xor eax,eax
mov [pen_coord_x],eax
mov [pen_coord_y],eax
jmp .end_buf_wnd
@@:
 
mcall 37,1 ;eax = (x shl 16) + y
cmp ax,word[buf_0.t]
340,8 → 363,43
jge .end_buf_wnd
 
cmp byte[pen_mode],1
jne .end_mode_1
;०¨¬ à¨á®¢ ­¨ï ¯à®¢®¤ 
cmp dword[pen_coord_x],0
jne @f
;०¨¬ à¨á®¢ ­¨ï ¯à®¢®¤ 
cmp dword[pen_coord_y],0
jne @f
mov [pen_coord_x],eax
mov [pen_coord_y],ebx
@@:
 
cmp dword[pen_coord_x],eax
je .beg_draw
cmp dword[pen_coord_y],ebx
je .beg_draw
 
mov ecx,eax
sub ecx,[pen_coord_x]
bt ecx,31
jnc @f
neg ecx
inc ecx
@@:
mov edx,ebx
sub edx,[pen_coord_y]
bt edx,31
jnc @f
neg edx
inc edx
@@:
cmp ecx,edx
jl @f
mov ebx,[pen_coord_y] ;¯à¨¢ï§ª  ª ª®®à¤¨­ â¥ y
jmp .beg_draw
@@:
mov eax,[pen_coord_x] ;¯à¨¢ï§ª  ª ª®®à¤¨­ â¥ x
 
.beg_draw:
stdcall pole_cell_creat, pole,eax,ebx,0
;­¨ç¥£® ­¥ ã¡à «®áì redraw_pole ­¥ ¯®¤å®¤¨â, â. ª. ç¨áâ¨âì ¯®«¥ ­¥ ­ã¦­®
stdcall pole_paint, pole
348,7 → 406,7
stdcall [buf2d_draw], buf_0
;stdcall but_test_pole, pole
jmp .end_buf_wnd
@@:
.end_mode_1:
cmp byte[pen_mode],2
jne @f
;०¨¬ à¨á®¢ ­¨ï ¨§®«ï樨 ¤«ï ¯à®¢®¤ 
366,6 → 424,14
;stdcall but_test_pole, pole
jmp .end_buf_wnd
@@:
cmp byte[pen_mode],4
jne @f
;०¨¬ ᮧ¤ ­¨ï í«¥¬¥­â®¢
stdcall shem_element_creat, eax,ebx
stdcall pole_paint, pole
stdcall [buf2d_draw], buf_0
jmp .end_buf_wnd
@@:
 
.end_buf_wnd:
pop edx ecx ebx eax
519,14 → 585,27
mov edx,txt_set_1
int 0x40
 
add ebx,35 shl 16
mov edx,txt_mov_l
; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
mov eax,7
mov ebx,[image_data_toolbar]
mov ecx,(16 shl 16)+16
mov edx,(62 shl 16)+panel_1_coord_top+2
 
add ebx,IMAGE_TOOLBAR_ICON_SIZE*16
int 0x40
 
add ebx,25 shl 16
mov edx,txt_mov_r
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16)
int 0x40
 
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16)
int 0x40
 
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16)
int 0x40
 
; *** ᮧ¤ ­¨¥ ª­®¯®ª à¨á®¢ ­¨ï ¯à®¢®¤  ***
mov eax,8
mov ebx,(5 shl 16)+20
547,6 → 626,10
mov edx,33
int 0x40
 
add ebx,25 shl 16
mov edx,34
int 0x40
 
; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
mov eax,7
mov ebx,[image_data_toolbar]
568,6 → 651,10
add edx,(25 shl 16) ;icon pen 3
int 0x40
 
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16) ;icon add elemet
int 0x40
 
mcall 12,2
popad
ret
656,33 → 743,49
@@:
cmp ah,31
jne @f
call but_set_pen_1
stdcall set_pen_mode,1,0 ;ãáâ ­®¢ª  ०¨¬  à¨á®¢ ­¨ï ¯à®¢®¤ 
@@:
cmp ah,32
jne @f
call but_set_pen_2
stdcall set_pen_mode,2,1
@@:
cmp ah,33
jne @f
call but_set_pen_3
stdcall set_pen_mode,3,2 ;ãáâ ­®¢ª  ०¨¬  áâ¨à ­¨ï ¯à®¢®¤ 
@@:
cmp ah,34
jne @f
stdcall set_pen_mode,4,3 ;ãáâ ­®¢ª  ०¨¬  ᮧ¤ ­¨ï í«¥¬¥­â®¢
@@:
cmp ah,1
jne still
.exit:
stdcall [buf2d_delete],buf_0
stdcall [buf2d_delete],buf_font
stdcall [buf2d_delete],buf_curs
stdcall mem.Free,[image_data_toolbar]
stdcall pole_delete, pole
call sign_delete
stdcall [tl_data_clear], tree1
cmp [cursor_pointer],0
je @f
mcall 37,6,[cursor_pointer]
@@:
mcall -1
 
 
;ᮧ¤ ­¨¥ ­®¢®© á奬ë
align 4
but_new_file:
proc but_new_file uses eax
call but_set_none
stdcall [tl_info_clear],tree1
stdcall [tl_draw],tree1
xor eax,eax
mov [shem_elems],eax
mov [shem_captions],eax
stdcall pole_clear, pole
call redraw_pole
ret
endp
 
align 4
f_size dd 0 ;à §¬¥à ®âªà뢠¥¬®£® ä ©« 
1026,6 → 1129,7
 
;---
call but_center ;業â஢ª  á奬ë á ãç¥â®¬ shem_w ¨ shem_h
call but_set_none
.end_open_file:
popad
ret
1460,6 → 1564,31
ret
endp
 
;¤®¡ ¢«¥­¨¥ ­®¢®£® í«¥¬¥­â  ã¯à ¢«¥­¨ï ­  á奬ã
;¯à¨ ¤®¡ ¢«¥­¨¨ ¨á¯®«ì§ãîâáï áâ ­¤ àâ­ë¥ ­ áâனª¨
align 4
proc shem_element_creat uses eax ebx, coord_x:dword, coord_y:dword
mov eax,dword[coord_x]
mov dword[txt_buf],eax ;ª®®à¤¨­ â  x
mov eax,dword[coord_y]
mov dword[txt_buf+4],eax ;ª®®à¤¨­ â  y
 
xor eax,eax
mov byte[txt_buf+8],al ;­ ¯à ¢«¥­¨¥
;¯®  ¤à¥áã edi ­ §¢ ­¨¥ í«¥¬¥­â 
;stdcall el_get_name, edi
mov byte[txt_buf+sp_offs_el_type],al ;⨯ í«¥¬¥­â 
 
movzx ebx,al
imul ebx,size_el_opt
add ebx,el_opt_beg+el_offs_nam
stdcall make_list_capts,txt_buf,ebx
stdcall [tl_node_add], txt_buf,(el_icon_elems shl 16)+1, tree1
stdcall [tl_cur_next], tree1
stdcall [tl_draw], tree1
ret
endp
 
;output:
; eax - ⨯ í«¥¬¥­â 
align 4
1842,30 → 1971,36
align 4
proc but_set_none
mov byte[pen_mode],0
cmp [cursor_pointer],0
je @f
push eax ebx ecx
mcall 37,6,[cursor_pointer]
pop ecx ebx eax
@@:
ret
endp
 
;ãáâ ­®¢ª  ०¨¬  à¨á®¢ ­¨ï ¯à®¢®¤ 
align 4
proc but_set_pen_1
mov byte[pen_mode],1
ret
endp
proc set_pen_mode uses eax ebx ecx edx, mode:dword, icon:dword
mov eax,[mode]
cmp byte[pen_mode],al
je @f
mov byte[pen_mode],al
;mov edx,((cx shl 8) + cy) shl 16
mov edx,2 ;LOAD_INDIRECT
mov ecx,[icon]
shl ecx,12 ;㬭®¦ ¥¬ ­  4 ª¡
add ecx,[buf_curs.data]
mcall 37,4
 
;
align 4
proc but_set_pen_2
mov byte[pen_mode],2
cmp eax,0
je @f
mov [cursor_pointer],eax
mcall 37,5,[cursor_pointer]
@@:
ret
endp
 
;ãáâ ­®¢ª  ०¨¬  áâ¨à ­¨ï ¯à®¢®¤ 
align 4
proc but_set_pen_3
mov byte[pen_mode],3
ret
endp
 
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
align 4
OpenDialog_data:
1935,6 → 2070,28
dd 0 ;+16 color
db 24 ;+20 bit in pixel
 
align 4
buf_curs: ;¡ãä¥à á ªãàá®à ¬¨
.data: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
dw 0 ;+4 left
dw 0 ;+6 top
dd 32 ;+8 w
dd 32*cursors_count ;+12 h
dd 0 ;+16 color
db 24 ;+20 bit in pixel
 
align 4
buf_curs_8: ;¡ãä¥à á ªãàá®à ¬¨
.data: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
dw 0 ;+4 left
dw 0 ;+6 top
dd 32 ;+8 w
dd 32*cursors_count ;+12 h
dd 0 ;+16 color
db 24 ;+20 bit in pixel
 
cursor_pointer dd 0 ;㪠§ â¥«ì ­  ¤ ­­ë¥ ¤«ï ªãàá®à 
 
el_focus dd 0
tree1 tree_list 32,points_max+2, tl_key_no_edit, 16,16,\
0x8080ff,0x0000ff,0xffffff, 5,panel_3_coord_top,145,250, 0,capt_offs,0,\