Subversion Repositories Kolibri OS

Compare Revisions

Ignore whitespace Rev 1097 → Rev 1098

/programs/media/scrshoot/macros.inc
File deleted
/programs/media/scrshoot/check.inc
File deleted
\ No newline at end of file
/programs/media/scrshoot/file_sys.inc
File deleted
\ No newline at end of file
/programs/media/scrshoot/label.inc
2,19 → 2,19
{
draw_label:
pusha
xor esi,esi
mov edx,[edi+8]
xor esi,esi
mov edx,[edi+8]
.check_next:
mov ah,[edx+esi]
inc esi
test ah,ah
jz @f
jmp .check_next
mov ah,[edx+esi]
inc esi
test ah,ah
jz @f
jmp .check_next
@@:
mov eax,4
mov ebx,[edi]
mov ecx,[edi+4]
int 0x40
mov eax,4
mov ebx,[edi]
mov ecx,[edi+4]
mcall
popa
ret
}
24,28 → 24,28
.top: dw top ; +0
.left: dw left ; +2
.color: dd color; +4
.text: dd text ; +8
.text: dd text ; +8
}
 
l_struc_size=12
macro draw_labels start,end
{
mov edi,start
mov ecx,((end-start)/l_struc_size)
mov edi,start
mov ecx,((end-start)/l_struc_size)
@@:
call draw_label
add edi,l_struc_size
loop @r
call draw_label
add edi,l_struc_size
loop @r
}
 
macro labels_set_sys_color start,end,color_table
{
mov edi,start
mov ecx,((end-start)/l_struc_size)
mov esi,color_table
mov edi,start
mov ecx,((end-start)/l_struc_size)
mov esi,color_table
@@:
push dword [esi+32]
pop dword [edi+4]
add edi,l_struc_size
loop @r
push dword [esi+32]
pop dword [edi+4]
add edi,l_struc_size
loop @r
}
/programs/media/scrshoot/readme.txt
1,3 → 1,7
<Lrz> - ¨á¯®«ì§ãîâáï ª®¬¯®­¥­âë ¨§ á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj.
Ž£à®¬­ ï ¡« £®¤ à­®áâì Mario79, §  ᮢ¥âë, â¥áâ¨à®¢ ­¨¥ ¨ subrutine ¯® á¡à®áã ¨§®¡à ¦¥­¨ï ¢ ¡ãä¥à, ¤«ï ¤ «ì­¥©è¥£® á®åà ­¥­¨ï
­  HDD.
 
€¢â®à ¤®ªã¬¥­â  ¨ ¯à®£à ¬¬ë: …¢â¨å®¢ Œ ªá¨¬ (Maxxxx32)
« £®¤ à­®áâ¨:
Œ à â㠇 ª¨ï­®¢ã (Mario79) §  ¯®¬®éì, ᮢ¥âë, ªà¨â¨ªã;
/programs/media/scrshoot/scrsavef.inc
1,208 → 1,203
save_file:
pusha
bt dword [flags],0
jnc .not_shooted
bt dword [flags],0
jnc .not_shooted
 
cmp byte [ed_buffer.1],0
je .no_file_name
cmp byte [ed_buffer.1],0
je .no_file_name
 
mov edi,sign_n_input
call zstr_to_int
mov [sign_n],al
mov edi,sign_n_input
call zstr_to_int
mov [sign_n],al
 
; £¥­¥à¨à㥬 ¨¬ï ä ©« 
xor eax,eax
mov ecx,1056
mov edi,file_name
rep stosb ; § ¯®«­ï¥¬ ­ã«ï¬¨
; £¥­¥à¨à㥬 ¨¬ï ä ©« 
xor eax,eax
mov ecx,1056
mov edi,file_name
rep stosb ; § ¯®«­ï¥¬ ­ã«ï¬¨
 
mov esi,ed_buffer.1
mov edi,file_name
mov esi,ed_buffer.1
mov edi,file_name
.next:
mov ah,[esi]
test ah,ah
jz .str_end
cmp ah,'*'
jne .no_insert_number
jmp .insert_number
mov ah,[esi]
test ah,ah
jz .str_end
cmp ah,'*'
jne .no_insert_number
jmp .insert_number
.no_insert_number:
mov [edi],ah
inc edi
inc esi
jmp .next
mov [edi],ah
inc edi
inc esi
jmp .next
.insert_number:
bt word [ch6.flags],1
jnc @f
mov eax,[cur_number]
;mov ebx,4
movsx ebx,byte [sign_n]
push ebx
call int_to_str
pop ebx
add edi,ebx
bt word [ch6.flags],1
jnc @f
mov eax,[cur_number]
;mov ebx,4
movsx ebx,byte [sign_n]
push ebx
call int_to_str
pop ebx
add edi,ebx
@@:
inc esi
jmp .next
inc esi
jmp .next
.str_end:
 
;;;;clean memory
 
mov ecx,dword [sf_buf.bmp_header]
mov ebx,13
mov eax,68
mcall
 
; ‚ëç¨á«ï¥¬, ᪮«ìª® ¡ ©â ­ã¦­® ¯à¨¡ ¢«ïâì ª ª ¦¤®© áâப¥,
; ç⮡ë á«¥¤ãîé ï ¡ë«  ¢ëà ¢­¥­  ­  4 ¡ ©â .
; ¥§ã«ìâ â ¯®¬¥é ¥¬ ¢ edi.
xor edx,edx
movzx eax,word [scr_buf.width] ; eax = è¨à¨­  ª à⨭ª¨
lea eax,[eax*3] ; eax = ¡ ©â ­  áâப㠪 à⨭ª¨
movr ebx,4 ; ebx = 4
mov edi,ebx ; edi = 4
div ebx ; eax = ¡ ©â ­  áâப㠪 à⨭ª¨ div 4 edx = ¡ ©â... mod 4
sub edi,edx ; edi = ª®«¨ç¥á⢮ ¡ ©â
test edx,edx
jnz @f
xor edi,edi
 
xor edx,edx
movzx eax,word [scr_buf.width] ; eax = è¨à¨­  ª à⨭ª¨
lea eax,[eax*3] ; eax = ¡ ©â ­  áâப㠪 à⨭ª¨
mov ebx,4 ; ebx = 4
mov edi,ebx ; edi = 4
div ebx ; eax = ¡ ©â ­  áâப㠪 à⨭ª¨ div 4 edx = ¡ ©â... mod 4
sub edi,edx ; edi = ª®«¨ç¥á⢮ ¡ ©â
test edx,edx
jnz @f
xor edi,edi
@@:
 
; ¢ë¤¥«ï¥¬ ¯ ¬ïâì
mov ecx,[scr_buf.end_ptr]
mov [sf_buf.bmp_header],ecx
add ecx,0x36
mov [sf_buf.bmp_area],ecx
movsx ebx,word [scr_buf.width]
movsx edx,word [scr_buf.height]
;imul ebx,edx
lea ebx,[ebx*3]
add ebx,edi
imul ebx,edx
add ecx,ebx
mov [sf_buf.end],ecx
add ecx,4096
xor ebx,ebx
inc ebx
movr eax,64
int 0x40
; ¢ë¤¥«ï¥¬ ¯ ¬ïâì
; mov ecx,[scr_buf.end_ptr]
; mov [sf_buf.bmp_header],ecx
 
push edi
; § ¯®«­ï¥¬ áâàãªâãàã ¤«ï á®åà ­¥­¨ï ä ©« 
mov edi,fs_struc
mov [edi],dword 2
mov eax,[sf_buf.bmp_header]
mov ebx,[sf_buf.end]
sub ebx,eax
mov [edi+12],ebx
mov [edi+16],eax
mov [edi+21],dword file_name
; add ecx,0x36
; mov [sf_buf.bmp_area],ecx
movsx ebx,word [scr_buf.width]
movsx edx,word [scr_buf.height]
;imul ebx,edx
lea ebx,[ebx*3]
add ebx,edi
imul ebx,edx
mov ecx,ebx
 
; § ¯®«­ï¥¬ § £®«®¢®ª bmp
mov edi,[sf_buf.bmp_header]
mov [edi],word 'BM'
mov ebx,[sf_buf.end]
sub ebx,[sf_buf.bmp_area]
mov [edi+34],ebx ; à §¬¥à ª à⨭ª¨
mov [edi+10],dword 0x36 ; à §¬¥à § £®«®¢ª 
add ebx,0x36
mov [edi+2],ebx ; à §¬¥à ä ©« 
mov [edi+14],dword 0x28
movzx eax,word [scr_buf.width]
mov [edi+18],eax ; £®à¨§®­â «ì­ë© à §¬¥à
movzx eax,word [scr_buf.height]
mov [edi+22],eax ; ¢¥à⨪«ì­ë© à §¬¥à
mov [edi+26],word 1
mov [edi+28],word 24
; mov [sf_buf.end],ecx
add ecx,0x36
mov ebx,12
mov eax,68
mcall
 
; ª®¯¨à㥬 ¨ ¯¥à¥¢®à ç¨¢ ¥¬
; mov esi,[scr_buf.ptr]
; mov edi,[sf_buf.bmp_area]
; mov edx,[sf_buf.end]
; sub edx,edi
; movsx ecx,word [scr_buf.height]
;.next_str:
;push ecx
;
; movsx ecx,word [scr_buf.width]
; lea ecx,[ecx*3]
; mov ebx,ecx
;.next_byte:
; mov ah,[esi+ebx]
; mov [edi+edx],ah
; dec ebx
; dec edx
; loop .next_byte
; movsx ecx,word [scr_buf.width]
; lea ecx,[ecx*3]
; add esi,ecx
;pop ecx
; loop .next_str
mov [sf_buf.bmp_header],eax
add eax,0x36
mov [sf_buf.bmp_area],eax
add eax,ecx
sub eax,0x36
mov [sf_buf.end],eax
 
mov esi,[scr_buf.end_ptr]
mov edi,[sf_buf.bmp_area]
movzx ecx,word [scr_buf.height]
movzx ebx,word [scr_buf.width]
lea ebx,[ebx*3]
add edi,ebx
; push edi
; § ¯®«­ï¥¬ áâàãªâãàã ¤«ï á®åà ­¥­¨ï ä ©« 
mov ebp,fs_struc
mov [ebp],dword 2
 
mov eax,[sf_buf.bmp_header]
mov ebx,[sf_buf.end]
sub ebx,eax
mov [ebp+12],ebx
mov [ebp+16],eax
mov [ebp+21],dword file_name
 
; § ¯®«­ï¥¬ § £®«®¢®ª bmp
mov ebp,[sf_buf.bmp_header]
mov [ebp],word 'BM'
mov ebx,[sf_buf.end]
sub ebx,[sf_buf.bmp_area]
mov [ebp+34],ebx ; à §¬¥à ª à⨭ª¨
mov [ebp+10],dword 0x36 ; à §¬¥à § £®«®¢ª 
add ebx,0x36
mov [ebp+2],ebx ; à §¬¥à ä ©« 
mov [ebp+14],dword 0x28
movzx eax,word [scr_buf.width]
mov [ebp+18],eax ; £®à¨§®­â «ì­ë© à §¬¥à
movzx eax,word [scr_buf.height]
mov [ebp+22],eax ; ¢¥à⨪«ì­ë© à §¬¥à
mov [ebp+26],word 1
mov [ebp+28],word 24
 
; á®å࠭塞
mov esi,[scr_buf.ptr]
mov edi,[sf_buf.end]
movzx edx,word [scr_buf.height]
movzx ebx,word [scr_buf.width]
lea ebx,[ebx*3]
test ebx,11b
jz @f
shr ebx,2
inc ebx
shl ebx,2
@@:
cld
align 4
.next_str:
mov edx,ebx
.next_pixel:
mov ah,[esi]
mov [edi],ah
dec esi
dec edi
dec edx
jnz .next_pixel
lea edi,[2*ebx+edi]
add edi,[esp]
loop .next_str
sub edi,ebx
mov ecx,ebx
shr ecx,2
rep movsd
sub edi,ebx
dec edx
jnz .next_str
 
pop edi
draw_status saving
mov eax,70
mov ebx,fs_struc
mcall
 
; á®å࠭塞
draw_status saving
mov eax,70
mov ebx,fs_struc
int 0x40
test eax,eax
jne save_error
 
test eax,eax
jne save_error
inc dword [cur_number]
call draw_number
 
inc dword [cur_number]
call draw_number
draw_status saved_ok
 
draw_status saved_ok
 
popa
ret
 
.no_file_name:
draw_status no_file_name
draw_status no_file_name
popa
ret
 
.not_shooted:
draw_status not_shooted
draw_status not_shooted
popa
ret
 
save_error:
cmp al,5
jne @f
mov [status.text],dword bad_file_name
cmp al,5
jne @f
mov [status.text],dword bad_file_name
@@:
cmp al,8
jne @f
mov [status.text],dword disk_filled
cmp al,8
jne @f
mov [status.text],dword disk_filled
@@:
 
cmp al,9
jne @f
mov [status.text],dword bad_fat_table
cmp al,9
jne @f
mov [status.text],dword bad_fat_table
@@:
 
cmp al,10
jne @f
mov [status.text],dword ac_den
cmp al,10
jne @f
mov [status.text],dword ac_den
@@:
 
cmp al,11
jne @f
mov [status.text],dword device_er
cmp al,11
jne @f
mov [status.text],dword device_er
@@:
call send_draw_status
call send_draw_status
popa
ret
/programs/media/scrshoot/scrshoot.asm
1,29 → 1,60
; 01.06.09 - Š®¬¯®­¥­âë ¡¥àãâìáï ¨§ á¨á⥬­®© ¡¨¡«¨®â¥ª¨ <Lrz>
; €¢â®à ¯à®£à ¬¬ë …¢â¨å®¢ Œ ªá¨¬ (Maxxxx32)
; 24.07.2008 <Lrz> ®¡­®¢«¥­ editbox
; 01.02.07 - ®¡­®¢«ñ­ editbox
; 31.01.07 - ¢áñ ⥯¥àì à¨áã¥âáï ®â­®á¨â¥«ì­® ª«¨¥­â᪮© ®¡« áâ¨
macro draw_status text_ptr
{
mov [status.text],dword text_ptr
call send_draw_status
}
 
title equ 'Screenshooter v 0.91' ; ‡ £®«®¢®ª ®ª­ 
include '../../develop/libraries/box_lib/trunk/load_lib.mac'
include '../../develop/libraries/box_lib/trunk/editbox_ex.mac'
;include '../../develop/examples/editbox/trunk/editbox.inc'
include '../../macros.inc'
include 'scrshoot.mac'
include 'txtbut.inc'
include 'label.inc'
include 'textwork.inc'
 
title equ 'Screenshooter v 0.9' ; ‡ £®«®¢®ª ®ª­ 
include 'macros.inc' ; ¢áâ ¢«ï¥¬ ¬ ªà®áë
meos_header cmdstr ; ¢áâ ¢«ï¥¬ § £®«®¢®ª ¯à®£à ¬¬ë
;include 'macros.inc' ; ¢áâ ¢«ï¥¬ ¬ ªà®áë
; meos_header cmdstr ; ¢áâ ¢«ï¥¬ § £®«®¢®ª ¯à®£à ¬¬ë
use32
org 0x0
db 'MENUET01'
dd 0x1
dd start
dd i_end
dd i_end
dd i_end
dd cmdstr
dd cur_dir_path
 
align 4
include 'scrwin.inc' ; ¢áâ ¢«ï¥¬ ª®¤ ®ª­  ¯à¤¯à®á¬®âà 
include 'scrsavef.inc'; ¢áâ ¢«ï¥¬ ¯à®æ¥¤ãàã á®åà ­¥­¨ï ä ©« 
use_edit_box ; \
 
@use_library
use_txt_button ; |
use_label ; |-- GUI ª®¬¯®­¥­âë ¨ ­¥ª®â®àë¥ ¯à®æ¥¤ãàë
use_check_box ; |
use_text_work ; /
include 'gp.inc'
include 'srectwin.inc'
include 'lang.inc'
;--- ­ ç «® ¯à®£à ¬¬ë ---
app_start
align 4
start:
sys_load_library library_name, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i
;if return code =-1 then exit, else nornary work
; cmp eax,-1
inc eax
test eax,eax
jz close
;;;;;;;;;;;;;;;; init memory 68/11
mov eax,68
mov ebx,11
mcall
test eax,eax
jz close
 
;mov al,[gs:1280*4*1024]
; ãáâ ­ ¢«¨¢ ¥¬ ipc ¡ãää¥à
push 60
33,7 → 64,7
inc ebx
mov ecx,app_ipc
mov edx,32
int 0x40
mcall
 
push 66 ; ãáâ ­ ¢«¨¢ ¥¬ £«®¡ «ì­ãî £®àïçãî ª« ¢¨èã
pop eax
41,7 → 72,7
mov ebx,4
mov cl,55 ; 55 - PrintScrn
xor edx,edx
int 0x40
mcall
 
mov ebx,app
call get_slot_n
75,7 → 106,19
call shoot
jmp still
@@:
key_edit_boxes editboxes,editboxes_end
; key_edit_boxes editboxes,editboxes_end
push dword edit1
call [edit_box_key]
 
push dword edit2
call [edit_box_key]
 
push dword edit3
call [edit_box_key]
 
push dword edit4
call [edit_box_key]
 
jmp still
button:
get_pressed_button
87,8 → 130,33
get_active_window
cmp eax,[slot_n]
jne still
mouse_check_boxes check_boxes,check_boxes_end
mouse_edit_boxes editboxes,editboxes_end
;----------------------------------
push dword edit1
call [edit_box_mouse]
push dword edit2
call [edit_box_mouse]
push dword edit3
call [edit_box_mouse]
push dword edit4
call [edit_box_mouse]
;----------------------------------
push dword ch1
call [check_box_mouse]
push dword ch2
call [check_box_mouse]
push dword ch3
call [check_box_mouse]
push dword ch4
call [check_box_mouse]
push dword ch5
call [check_box_mouse]
push dword ch6
call [check_box_mouse]
push dword use_rect
call [check_box_mouse]
;-----------------------------------
; mouse_check_boxes check_boxes,check_boxes_end
; mouse_edit_boxes editboxes,editboxes_end
jmp still
ipc:
cmp word [app_ipc+8],2
103,7 → 171,7
.clear_ipc:
cld
xor eax,eax
movr ecx,32
mov ecx,32
mov edi,app_ipc
rep stosb
jmp still
113,10 → 181,10
 
bt dword [flags],3
jnc @f
movr eax,18
mov eax,18
mov ebx,eax
mov ecx,[set_rect_window_pid]
int 0x40
mcall
@@:
 
close:
133,14 → 201,14
mov ecx,100*65536+220
add cx,ax
mov edx,[sc.work]
add edx,0x34000000;0x33000000
or edx,0x34000000;0x33000000
xor esi,esi
;xor edi,edi
mov edi,grab_text
xor eax,eax
int 0x40
mcall
 
movr eax,47 ; ¢ë¢®¤¨¬ ç¨á«  ¢ ®ª­®
mov eax,47 ; ¢ë¢®¤¨¬ ç¨á«  ¢ ®ª­®
mov bx,4
shl ebx,16
movsx ecx,word [scr.width] ; è¨à¨­  íªà ­ 
149,10 → 217,10
mov dx,[label1.top]
push dx
mov esi,[sc.work_text]
int 0x40
mcall
movsx ecx,word [scr.height] ; ¢ëá®â  íªà ­ 
mov dx,[label2.top]
int 0x40
mcall
mov bx,2
shl ebx,16
movsx ecx,word [scr.bitspp] ; ¡¨â ­  ¯¨ªá¥«ì
159,20 → 227,48
mov dx,240
shl edx,16
pop dx
int 0x40
mcall
mov bx,6
shl ebx,16
mov ecx,[scr.bytesps] ; ¡ ©â ­  áâபã
mov dx,[label2.top]
int 0x40
mcall
 
call draw_number ; ¯à®à¨á®¢ë¢ ¥¬ ­®¬¥à á­¨¬ª 
call dr_st
 
draw_labels labels,labels_end ; ¬¥âª¨
draw_edit_boxes editboxes,editboxes_end ; edit_box
; draw_edit_boxes editboxes,editboxes_end ; edit_box
;------ show check editbox -----------
push dword edit1
call [edit_box_draw]
push dword edit2
call [edit_box_draw]
push dword edit3
call [edit_box_draw]
push dword edit4
call [edit_box_draw]
;------ end check all editbox -------
 
draw_txt_buttons buttons,buttons_end ; ª­®¯ª¨
draw_check_boxes check_boxes,check_boxes_end ; ä« ¦ª¨
; draw_check_boxes check_boxes,check_boxes_end ; ä« ¦ª¨
;------ check all checkbox ---------
push dword ch1
call [check_box_draw]
push dword ch2
call [check_box_draw]
push dword ch3
call [check_box_draw]
push dword ch4
call [check_box_draw]
push dword ch5
call [check_box_draw]
push dword ch6
call [check_box_draw]
push dword use_rect
call [check_box_draw]
;------ end check all checkbox ------
 
stop_draw_window ; ª®­¥æ ¯¥à¥à¨á®¢ª¨
ret
 
231,7 → 327,12
 
;--- ¯®«ãç¨âì ¯ ¬ïâì ¤«ï á­¨¬ª  ---
get_mem_for_shoot:
mov [scr_buf.ptr],dword __app_end
;clean memory
mov ecx,dword [scr_buf.ptr]
mov ebx,13
mov eax,68
mcall
 
bt dword [use_rect.flags],1 ; ä®âª âì ®¡« áâì íªà ­ 
jc .use_area
movzx ecx, word [scr.width]
244,12 → 345,13
@@:
imul ecx,ebx
lea ecx,[ecx*3]
add ecx,__app_end
; add ecx,i_end
mov ebx,12
mov eax,68
mcall
mov [scr_buf.ptr],eax
add eax,ecx
mov [scr_buf.end_ptr],ecx
xor ebx,ebx
inc ebx
mov eax,64
int 0x40
ret
 
;--- ᮤ âì ®ª­® ¯à®¥¤¯à®á¬®âà  ---
260,9 → 362,9
mov eax,51
xor ebx,ebx
inc ebx
movr ecx,scr_window
mov edx,__app_end-1000
int 0x40
mov ecx,scr_window
mov edx,i_end_tread-1000
mcall
@@:
popa
ret
280,14 → 382,14
mov edi,sign_n_input
call zstr_to_int
mov [sign_n],al
movr eax,13
mov eax,13
mov ebx,150*65536+96
mov cx,[label9.top]
shl ecx,16
mov cx,10
mov edx,[sc.work]
int 0x40
movr eax,47
mcall
mov eax,47
movsx bx,byte [sign_n]
shl ebx,16
mov ecx,[cur_number]
295,7 → 397,7
shl edx,16
mov dx,[label9.top]
mov esi,[sc.work_text]
int 0x40
mcall
ret
 
;--- ¯à®æ¥¤ãà , § ¯ã᪠îé ï ¯®â®ª  ¢â®áꥬª¨ ---
302,13 → 404,13
start_autoshoot:
bts dword [flags],1
jc @f
movr eax,51
mov eax,51
;mov ebx,1
xor ebx,ebx
inc ebx
mov ecx,autoshoot
mov edx,__app_end-512
int 0x40
mov edx,i_end_tread-512
mcall
@@:
ret
 
324,12 → 426,12
.next:
bt dword [flags],1
jnc close
movr eax,60
movr ebx,2
mov eax,60
mov ebx,2
mov ecx,[app.pid]
mov edx,messages.draw_number
mov esi,2
int 0x40
mcall
call shoot
jmp autoshoot.next
 
336,17 → 438,17
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ áâப¨ á®áâ®ï­¨ï ---
; (¤®«¦­  ¢ë§ë¢ âìáï ¯®â®ª®¬ £« ¢­®£® ®ª­ )
dr_st:
movr eax,38 ; ®â१®ª
mov eax,38 ; ®â१®ª
mov ebx,0*65536+310
mov ecx,198*65536+198
mov edx,[sc.work_graph]
int 0x40
mcall
 
movr eax,13 ; ¯®«®áª 
mov eax,13 ; ¯®«®áª 
mov bx,310
mov ecx,199*65536+15
mov edx,[sc.work]
int 0x40
mcall
 
mov edi,status
call draw_label
356,17 → 458,17
; ¢å®¤ ebx - ¡ãää¥à 1024 ¡ ©â
; ¢ë室 ecx - ­®¬¥à á«®â 
get_slot_n:
movr eax,9
mov eax,9
xor ecx,ecx
dec ecx
int 0x40
mcall
 
mov edx,[ebx+30]
xor ecx,ecx
@@:
movr eax,9
mov eax,9
inc ecx
int 0x40
mcall
cmp [ebx+30],edx
je @f
jmp @b
388,11 → 490,11
bt dword [flags],1
jc .running
 
movr eax,51
mov eax,51
;mov ebx,1
xor ebx,ebx
inc ebx
int 0x40
mcall
.running:
ret
 
402,12 → 504,12
activ_window
bt dword [ch1.flags],1 ; ¬¨­¨¬¨§¨à®¢ âì ®ª­® ?
jnc @f
movr eax,60
movr ebx,2
mov eax,60
mov ebx,2
mov ecx,[app.pid]
mov edx,messages.min_window
mov esi,2
int 0x40
mcall
@@:
call shoot
btr dword [flags],2
416,12 → 518,12
;--- ¯à®æ¥¤ãà , ®â¯à ¢«ïîé ï £« ¢­®¬ã ®ª­ã á®®¡é¥­¨¥ ® ¯¥à¥à¨á®¢ª¥
; áâப¨ á®áâ®ï­¨ï ---
send_draw_status:
movr eax,60
movr ebx,2
mov eax,60
mov ebx,2
mov ecx,[app.pid]
mov edx,messages.draw_status
mov esi,2
int 0x40
mcall
ret
 
;--- ¯®â®ª, á®åà ­ï ä ©« ---
436,34 → 538,34
show_set_rect_window:
bts dword [flags],3
jc @f
movr eax,51
mov eax,51
xor ebx,ebx
inc ebx
mov ecx,set_rect_window
mov edx,set_rect_window_esp
int 0x40
mcall
 
mov [set_rect_window_pid],eax
ret
 
@@:
movr eax,18
mov eax,18
mov ebx,eax
mov ecx,[set_rect_window_pid]
int 0x40
mcall
btr dword [flags],3
ret
 
;--- ¯®«ã祭¨¥ ¨­ä®à¬ æ¨¨ ®¡  ªâ¨¢­®¬ ®ª­¥ ---
get_active_window_info:
movr eax,18
movr ebx,7
int 0x40
mov eax,18
mov ebx,7
mcall
 
mov ecx,eax
movr eax,9
mov eax,9
mov ebx,active_app
int 0x40
mcall
ret
 
;====================================================================
493,30 → 595,30
labels_end:
 
editboxes:
edit1 edit_box 300,5,35,cl_white,0xaabbcc,0,0,0,1024,ed_buffer.1,ed_focus ; ¯ãâì ª ä ©«ã
edit2 edit_box 35,75,134,cl_white,0xaabbcc,0,0,0,9,ed_buffer.2,ed_figure_only ; § ¤¥à¦ª 
edit3 edit_box 35,165,164,cl_white,0xaabbcc,0,0,0,9,ed_buffer.3,ed_figure_only
edit1 edit_box 300,5,35,cl_white,0xaabbcc,0,0,0,300,ed_buffer.1,ed_focus,10,10 ; ¯ãâì ª ä ©«ã
edit2 edit_box 35,75,134,cl_white,0xaabbcc,0,0,0,9,ed_buffer.2,ed_figure_only,3,3 ; § ¤¥à¦ª 
edit3 edit_box 35,165,164,cl_white,0xaabbcc,0,0,0,9,ed_buffer.3,ed_figure_only ;  ¢â®­ã¬¥à æ¨ï
edit4 edit_box 16,165,181,cl_white,0xaabbcc,0,0,0,1,sign_n_input,ed_figure_only,1
editboxes_end:
 
buttons:
but1 txt_button 150,5,15,65,2,0,0,but_text.1,one_shoot ; ᤥ« âì á­¨¬®ª
but1 txt_button 150,5,15,65,2,0,0,but_text.1,one_shoot ; ᤥ« âì á­¨¬®ª
but2 txt_button 145,160,15,65,3,0,0,but_text.2,save_shoot ; á®åà ­¨âì á­¨¬®ª
but3 txt_button 140,115,12,120,4,0,0,but_text.3,show_scr_window ; ¯®ª § âì á­¨¬®ª
but4 txt_button 80,205,15,163,5,0,0,but_text.4,apply_number ; ¯à¨¬¥­¨âì ­®¬¥à
but5 txt_button 150,5,15,85,6,0,0,but_text.5,start_autoshoot ; ­ ç âì  ¢â®áêñ¬ªã
but6 txt_button 145,160,15,85,7,0,0,but_text.6,stop_autoshoot ; ®áâ ­®¢¨âì  ¢â®áêñ¬ªã
but5 txt_button 150,5,15,85,6,0,0,but_text.5,start_autoshoot ; ­ ç âì  ¢â®áêñ¬ªã
but6 txt_button 145,160,15,85,7,0,0,but_text.6,stop_autoshoot ; ®áâ ­®¢¨âì  ¢â®áêñ¬ªã
but7 txt_button 40,205,10,150,8,0,0,but_text.7,show_set_rect_window ; § ¤ âì ®¡« áâì
buttons_end:
 
check_boxes:
ch1 check_box 5,105,cl_white,0,0,ch_text.1,(ch_text.2-ch_text.1) ; ᢥà­ãâì ®ª­®
ch2 check_box 5,120,cl_white,0,0,ch_text.2,(ch_text.3-ch_text.2) ; § â¥¬ ᤥ« âì  ªâ¨¢­ë¬
ch3 check_box 145,105,cl_white,0,0,ch_text.3,(ch_text.4-ch_text.3) ; ¯®ª § âì á­¨¬®ª
ch4 check_box 5,135,cl_white,0,0,ch_text.4,(ch_text.5-ch_text.4) ;
ch5 check_box 5,150,cl_white,0,0,ch_text.5,(ch_text.6-ch_text.5)
ch6 check_box 5,165,cl_white,0,0,ch_text.6,(ch_text.7-ch_text.6)
use_rect check_box 145,150,cl_white,0,0,ch_text.7,(ch_text.8-ch_text.7) ; ¨á¯. ®¡« áâì
ch1 check_box 5,105,5,11,cl_white,0,0,ch_text.1,(ch_text.2-ch_text.1),ch_flag_en ; ᢥà­ãâì ®ª­®
ch2 check_box 5,120,5,11,cl_white,0,0,ch_text.2,(ch_text.3-ch_text.2),ch_flag_en ; § â¥¬ ᤥ« âì  ªâ¨¢­ë¬
ch3 check_box 145,105,5,11,cl_white,0,0,ch_text.3,(ch_text.4-ch_text.3),ch_flag_en ; ¯®ª § âì á­¨¬®ª
ch4 check_box 5,135,5,11,cl_white,0,0,ch_text.4,(ch_text.5-ch_text.4),ch_flag_en ; § ¤¥à¦ª 
ch5 check_box 5,150,5,11,cl_white,0,0,ch_text.5,(ch_text.6-ch_text.5)
ch6 check_box 5,165,5,11,cl_white,0,0,ch_text.6,(ch_text.7-ch_text.6),ch_flag_en
use_rect check_box 145,150,5,11,cl_white,0,0,ch_text.7,(ch_text.8-ch_text.7) ; ¨á¯. ®¡« áâì
;  ¢â®­ã¬¥à æ¨ï
check_boxes_end:
 
610,7 → 712,7
bad_fat_table db 'FAT table destroyed',0
ac_den db 'Access denied',0
device_er db 'Device error',0
not_shooted db 'Make photo !!!',0
not_shooted db 'Make a photo !!!',0
no_file_name db 'Enter file name !!!',0
invalid_rect db 'Wrong area size',0
 
620,11 → 722,14
db '2',0
 
app_ipc ipc_buffer 32
align 4
 
mouse_flag: dd 0x0
structure_of_potock:
rb 100
 
align 4
 
cur_number dd ?
 
sign_n db ?
656,6 → 761,17
set_rect_window_pid dd ?
set_rect_window_slot dd ?
 
align 4
 
ed_buffer:
.1: db '/sys/*.bmp',0
rb 287
.2: db '100',0
rb 6
.3: rb 10
 
 
align 4
rect_input_buffer:
.left rb 6
.top rb 6
664,10 → 780,7
 
cmdstr rb 257
 
ed_buffer:
.1: rb 1025
.2: rb 10
.3: rb 10
align 4
 
file_name:
rb 1058
679,7 → 792,6
.height dw ?
.width dw ?
 
 
sc sys_color_table
app procinfo ; ¨­ä®à¬ æ¨ï ® £« ¢­®¬ ®ª­¥
active_app procinfo ; ¨­ä®à¬ æ¨ï ®¡  ªâ¨¢­®¬ ®ª­¥
686,4 → 798,11
set_rect_window_procinfo procinfo ; ¨­ä®à¬ æ¨ï ®¡ ®ª­¥ ®¡« áâ¨
shoot_esp rb 512 ; á⥪ ¯®â®ª  ä®âª ­ìï
set_rect_window_esp rb 512 ; á⥪ ®ª­  ®¡« áâ¨
app_end ; ª®­¥æ ¯à®£à ¬¬ë
; app_end ; ª®­¥æ ¯à®£à ¬¬ë
align 4
cur_dir_path rb 4096
library_path rb 4096
i_end_tread:
rb 1024
align 4
i_end:
/programs/media/scrshoot/scrshoot.mac
0,0 → 1,312
;In this file content a macros need for compilation the scrshoot
evm_redraw equ 1
evm_key equ 10b
evm_button equ 100b
evm_mouse equ 100000b
evm_ipc equ 1000000b
 
;--- ñîîáùèòü ñèñòåìå î íà÷àëå ïåðåðèñîâêè îêíà ---
macro draw_status text_ptr
{
mov [status.text],dword text_ptr
call send_draw_status
}
 
macro start_draw_window
{
;mov eax,12
push 12
pop eax
xor ebx,ebx
inc ebx
mcall
}
 
;--- ñîîáùèòü ñèñòåìå î çàâåðøåíèè ïåðåðèñîâêè îêíà ---
macro stop_draw_window
{
;mov eax,12
push 12
pop eax
;mov ebx,2
push 2
pop ebx
mcall
}
 
;--- óñòàíîâèòü ìàñêó îæèäàåìûõ ñîáûòèé ---
 
;--- îæèäàòü ñîáûòèÿ ---
macro wait_event redraw,key,button,mouse,ipc,other
{
mov eax,10
mcall
dec ax
if <redraw> eq <>
else
jz redraw
end if
dec ax
if <key> eq <>
else
jz key
end if
dec ax
if <button> eq <>
else
jz button
end if
dec ax
dec ax
dec ax
if <mouse> eq <>
else
jz mouse
end if
if <ipc> eq <>
else
dec ax
jz ipc
end if
if <other> eq <>
jmp still
else
jmp other
end if
}
;--- óñòàíîâèòü ìàñêó îæèäàåìûõ ñîáûòèé ---
macro set_events_mask mask
{
;mov eax,40
push 40
pop eax
;mov ebx,mask
push mask
pop ebx
mcall
}
 
macro check_boxes_set_sys_color start,end,color_table
{
ch_left equ [edi] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî õ
ch_top equ [edi+2] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî ó
ch_text_margin equ [edi+4] ;=4 ðàññòîÿíèå îò ïðÿìîóãîëüíèêà ÷åê áîêñà äî íàäïèñè
ch_size equ [edi+8] ;12 ðàçìåð êâàäðàòà ÷åê áîêñà
ch_color equ [edi+12] ;öâåò âíóòðè checkbox
ch_border_color equ [edi+16] ; or [edi+4] ;öâåò ðàìêè checkbox åå ìîæíî çàäàòü ñàìîñòîÿòåëüíî
ch_text_color equ [edi+20];[edi+4] ;öâåò òåêñòà
ch_text_ptr equ [edi+24] ;óêàçàòåëü íà íà÷àëî òåêñòîâîé ñòðîêè
ch_text_length equ [edi+28]
ch_flags equ [edi+32] ;ôëàãè
 
 
;ch_left equ [edi] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî õ
;ch_top equ [edi+2] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî ó
;ch_color equ [edi+4] ;öâåò âíóòðè checkbox
;ch_border_color equ [edi+8] ;öâåò ðàìêè checkbox
;ch_text_color equ [edi+12] ;öâåò òåêñòà
;ch_text_ptr equ [edi+16] ;óêàçàòåëü íà íà÷àëî òåêñòîâîé ñòðîêè
;ch_text_length equ [edi+20] ;äëèíà íàäïèñè (2^64 òàêîé äëèíû ìîæåò áûòü òåêñò)
;ch_flags equ [edi+24] ;ôëàãè
 
mov edi,start
mov ecx,((end-start)/ch_struc_size)
mov esi,color_table
@@:
push dword [esi+32]
pop dword ch_text_color
push dword [esi+36]
pop dword ch_border_color
add edi,ch_struc_size
loop @b
}
macro get_key
{
;mov eax,2
push 2
pop eax
mcall
}
macro edit_boxes_set_sys_color start,end,color_table
{
 
ed_focus_border_color equ [edi+20] ;öâåò ðàìêè êîìïîíåíòà
ed_blur_border_color equ [edi+24] ;öâåò íå àêòèâíîãî êîìïîíåíòà
mov edi,start
mov ecx,((end-start)/ed_struc_size)
mov esi,color_table
@@:
mov eax,[esi+36]
mov ebx,[esi+20]
mov dword ed_focus_border_color,eax
shr bh,1
shr bl,1
shr ah,1
shr al,1
add ah,bh
add al,bl
ror eax,16
ror ebx,16
shr bl,1
shr al,1
add al,bl
ror eax,16
mov dword ed_blur_border_color,eax
add edi,ed_struc_size
loop @b
}
;--- ïîëó÷èòü êîä íàæàòîé êíîïêè ---
macro get_pressed_button
{
;mov eax,17
push 17
pop eax
mcall
}
macro get_active_window
{
mov eax,18
mov ebx,7
mcall
}
;--- ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ¯à®æ¥áᥠ---
macro get_procinfo proc_inf_buf,slot_num
{
;mov eax,9
push 9
pop eax
;mov ebx,proc_inf_buf
push proc_inf_buf
pop ebx
if <slot_num> eq <>
xor ecx,ecx
dec ecx
else
;mov ecx,slot_num
push slot_num
pop ecx
end if
mcall
}
macro get_sys_colors col_buf
{
;mov eax,48
push 48
pop eax
;mov ebx,3
push 3
pop ebx
;mov ecx,col_buf
push col_buf
pop ecx
;mov edx,40
push 40
pop edx
mcall
}
macro get_screen_prop struc_ptr
{
mov eax,61
push eax eax
xor ebx,ebx
inc ebx
mcall
mov [struc_ptr],eax
pop eax
inc ebx
mcall
mov [struc_ptr+4],ax
pop eax
inc ebx
mcall
mov [struc_ptr+6],eax
}
macro min_window
{
mov eax,18
mov ebx,10
mcall
}
macro app_close
{
or eax,-1
mcall
}
macro get_skin_height
{
mov eax,48
mov ebx,4
mcall
}
macro delay time
{
mov eax,5
if <time> eq <>
else
mov ebx,time
end if
mcall
}
macro activ_window slot_n
{
mov eax,18
mov ebx,3
if <slot_n> eq <>
else
mov ecx,slot_n
end if
mcall
}
struc screen_prop
{
.height: dw ? ;+0
.width: dw ? ;+2
.bitspp: dw ? ;+4
.bytesps: dd ?;+6
}
struc sys_color_table
{
.frames: dd ? ;+0
.grab: dd ? ;+4
.grab_button: dd ? ;+8
.grab_button_text: dd ? ;+12
.grab_text: dd ? ;+16
.work: dd ? ;+20
.work_button: dd ?;+24
.work_button_text: dd ? ;+28
.work_text: dd ? ;+32
.work_graph: dd ? ;+36
}
struc procinfo
{
.takts_per_second: dd ?
.window_stack_pos: dw ?
.slot_number: dw ?
dw ?
.name: rb 11
.align: db ?
.addres: dd ?
.use_mem: dd ?
.pid: dd ?
.left: dd ?
.top: dd ?
.width: dd ?
.height: dd ?
.slot_state: dw ?
rb (1024-56)
}
 
 
 
struc ipc_buffer size
{
.block: dd ?
.in_use: dd ?
.messages: rb size
}
 
;--- æ¢¥â  ---
cl_white=0xffffff
cl_black=0x000000
 
ch_struc_size=36
/programs/media/scrshoot/scrwin.inc
4,38 → 4,39
scr_window:
.start:
.red:
call .draw_window
call .draw_window
.still:
wait_event .red,close
jmp .still
wait_event .red,close
jmp .still
 
.draw_window:
start_draw_window
xor eax,eax
movsx ebx,word [scr.width]
movsx ecx,word [scr.height]
;xor edx,edx
mov edx,0x01000000
xor esi,esi
xor edi,edi
int 0x40
start_draw_window
xor eax,eax
movsx ebx,word [scr.width]
movsx ecx,word [scr.height]
;xor edx,edx
mov edx,0x01000000
xor esi,esi
xor edi,edi
mcall
 
movr eax,7
mov ebx,[scr_buf.ptr]
mov ecx,[scr_buf.size]
xor edx,edx
int 0x40
mov eax,7
mov ebx,dword [scr_buf.ptr]
mov ecx,dword [scr_buf.size]
xor edx,edx
mcall
 
movr eax,13
mov ebx,19*65536+231
mov ecx,19*65536+10
mov edx,0x00FF00
int 0x40
mov eax,13
mov ebx,19*65536+231
mov ecx,19*65536+10
mov edx,0x00FF00
mcall
 
mov edi,.label
call draw_label
mov edi,.label
call draw_label
 
stop_draw_window
stop_draw_window
ret
.label label 20,20,0x80000000,$+4
db 'â® ¢ è á­¨¬®ª. ‚ë室 - «î¡ ï ª« ¢¨è .',0
db 'â® ¢ è á­¨¬®ª. ‚ë室 - «î¡ ï ª« ¢¨è .',0
 
/programs/media/scrshoot/srectwin.inc
1,71 → 1,111
set_rect_window:
mov ebx,set_rect_window_procinfo
call get_slot_n
mov ebx,set_rect_window_procinfo
call get_slot_n
 
mov [set_rect_window_slot],ecx
mov [set_rect_window_slot],ecx
 
set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse)
set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse)
.red:
edit_boxes_set_sys_color rect_input,rect_input_end,sc
labels_set_sys_color rect_input_labels,rect_input_labels_end,sc
check_boxes_set_sys_color riw_check_boxes,riw_check_boxes_end,sc
call .draw_window
edit_boxes_set_sys_color rect_input,rect_input_end,sc
labels_set_sys_color rect_input_labels,rect_input_labels_end,sc
check_boxes_set_sys_color riw_check_boxes,riw_check_boxes_end,sc
call .draw_window
.still:
wait_event .red,.key,.button,.mouse
wait_event .red,.key,.button,.mouse
 
.key:
get_key
get_key
 
key_edit_boxes rect_input,rect_input_end
push dword rect_input.left
call [edit_box_key]
 
call read_rect
call draw_rect_on_screen
push dword rect_input.top
call [edit_box_key]
 
jmp .still
push dword rect_input.width
call [edit_box_key]
 
push dword rect_input.height
call [edit_box_key]
; key_edit_boxes rect_input,rect_input_end
 
call read_rect
call draw_rect_on_screen
 
jmp .still
 
.button:
get_pressed_button
get_pressed_button
 
cmp ah,1
jne @f
btr dword [flags],3
jmp close
cmp ah,1
jne @f
btr dword [flags],3
jmp close
@@:
 
jmp .still
jmp .still
 
.mouse:
get_active_window
cmp eax,[set_rect_window_slot]
jne .still
get_active_window
cmp eax,[set_rect_window_slot]
jne .still
 
mouse_edit_boxes rect_input,rect_input_end
mouse_check_boxes riw_check_boxes,riw_check_boxes_end
push dword rect_input.left
call [edit_box_mouse]
 
jmp .still
push dword rect_input.top
call [edit_box_mouse]
 
push dword rect_input.width
call [edit_box_mouse]
 
push dword rect_input.height
call [edit_box_mouse]
 
;;;;;;;;;;;;;;;;;;;;;;
push dword use_rect_active_window
call [check_box_mouse]
 
; mouse_edit_boxes rect_input,rect_input_end
; mouse_check_boxes riw_check_boxes,riw_check_boxes_end
 
jmp .still
 
.draw_window:
start_draw_window
start_draw_window
 
xor eax,eax
mov ebx,100*65536+250
mov ecx,100*65536+130
mov edx,[sc.work]
add edx,0x33000000
mov edi,riw_grab_text
xor esi,esi
int 0x40
xor eax,eax
mov ebx,100*65536+250
mov ecx,100*65536+130
mov edx,[sc.work]
add edx,0x33000000
mov edi,riw_grab_text
xor esi,esi
mcall
 
draw_labels rect_input_labels,rect_input_labels_end
draw_labels rect_input_labels,rect_input_labels_end
 
draw_edit_boxes rect_input,rect_input_end
push dword rect_input.left
call [edit_box_draw]
 
draw_check_boxes riw_check_boxes,riw_check_boxes_end
push dword rect_input.top
call [edit_box_draw]
 
call read_rect
call draw_rect_on_screen
push dword rect_input.width
call [edit_box_draw]
 
stop_draw_window
push dword rect_input.height
call [edit_box_draw]
;;;;;;;;;;;;;;;;;;;;;;
push dword use_rect_active_window
call [check_box_draw]
; draw_edit_boxes rect_input,rect_input_end
; draw_check_boxes riw_check_boxes,riw_check_boxes_end
 
call read_rect
call draw_rect_on_screen
 
stop_draw_window
ret
 
;--------------------------------------------------------------------
72,119 → 112,162
;--- ‘ç¨â뢠­¨¥ ®¡« â¨ ----------------------------------------------
;--------------------------------------------------------------------
read_rect:
bt dword [use_rect_active_window.flags],1
jc read_rect_from_active_window
bt dword [use_rect_active_window.flags],1
jc read_rect_from_active_window
 
mov edi,rect_input_buffer.left
call zstr_to_int
cmp ax,[scr.width]
jb @f
mov ax,[scr.width]
mov edi,rect_input_buffer.left
call zstr_to_int
cmp ax,[scr.width]
jb @f
mov ax,[scr.width]
@@:
mov [rect.left],ax
mov [rect.left],ax
 
mov edi,rect_input_buffer.top
call zstr_to_int
cmp ax,[scr.height]
jb @f
mov ax,[scr.height]
mov edi,rect_input_buffer.top
call zstr_to_int
cmp ax,[scr.height]
jb @f
mov ax,[scr.height]
@@:
mov [rect.top],ax
mov [rect.top],ax
 
mov edi,rect_input_buffer.width
call zstr_to_int
mov bx,[scr.width]
sub bx,[rect.left]
cmp ax,bx
jb @f
mov ax,bx
mov edi,rect_input_buffer.width
call zstr_to_int
mov bx,[scr.width]
sub bx,[rect.left]
cmp ax,bx
jb @f
mov ax,bx
@@:
mov [rect.width],ax
mov [rect.width],ax
 
mov edi,rect_input_buffer.height
call zstr_to_int
mov bx,[scr.height]
sub bx,[rect.top]
cmp ax,bx
jb @f
mov ax,bx
mov edi,rect_input_buffer.height
call zstr_to_int
mov bx,[scr.height]
sub bx,[rect.top]
cmp ax,bx
jb @f
mov ax,bx
@@:
mov [rect.height],ax
mov [rect.height],ax
ret
 
read_rect_from_active_window:
call get_active_window_info
call get_active_window_info
 
mov eax,[active_app.left]
mov [rect.left],ax
mov eax,[active_app.top]
mov [rect.top],ax
mov eax,[active_app.width]
inc eax
mov [rect.width],ax
mov eax,[active_app.height]
inc eax
mov [rect.height],ax
mov eax,[active_app.left]
mov [rect.left],ax
mov eax,[active_app.top]
mov [rect.top],ax
mov eax,[active_app.width]
inc eax
mov [rect.width],ax
mov eax,[active_app.height]
inc eax
mov [rect.height],ax
ret
 
draw_rect_on_screen:
 
mov eax,13
mov ebx,150*65536+80
mov ecx,5*65536+60
xor edx,edx
int 0x40
mov eax,13
mov ebx,150*65536+80
mov ecx,5*65536+60
xor edx,edx
mcall
 
;movzx eax,word [rect.left]
;mul word [scr.width]
xor edx,edx
movzx eax,word [scr.width]
mov ebx,80
div ebx
mov ebx,eax
;movzx eax,word [rect.left]
;mul word [scr.width]
xor edx,edx
movzx eax,word [scr.width]
mov ebx,80
div ebx
mov ebx,eax
 
xor edx,edx
movzx eax,word [rect.height]
div ebx
push ax
xor edx,edx
movzx eax,word [rect.height]
div ebx
push ax
 
xor edx,edx
movzx eax,word [rect.width]
div ebx
push ax
xor edx,edx
movzx eax,word [rect.width]
div ebx
push ax
 
xor edx,edx
movzx eax,word [rect.top]
div ebx
push ax
xor edx,edx
movzx eax,word [rect.top]
div ebx
push ax
 
xor edx,edx
movzx eax,word [rect.left]
div ebx
push ax
xor edx,edx
movzx eax,word [rect.left]
div ebx
push ax
 
pop bx
add bx,150
shl ebx,16
pop bx
add bx,150
shl ebx,16
 
pop cx
add cx,5
shl ecx,16
pop cx
add cx,5
shl ecx,16
 
pop bx
pop cx
pop bx
pop cx
 
mov edx,0xffffff
mov eax,13
int 0x40
mov edx,0xffffff
mov eax,13
mcall
ret
 
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;DATA ¤ ­­ë¥
;‚ᥣ¤  ᮡ«î¤ âì ¯®á«¥¤®¢ â¥«ì­®áâì ¢ ¨¬¥­¨.
system_path db '/sys/lib/'
library_name db 'box_lib.obj',0
err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0
head_f_i:
head_f_l db 'System error',0
err_message_import db 'Error on load import library box_lib.obj',0
 
myimport:
 
edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key
edit_box_mouse dd aEdit_box_mouse
version_ed dd aVersion_ed
 
check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse
version_ch dd aVersion_ch
 
option_box_draw dd aOption_box_draw
option_box_mouse dd aOption_box_mouse
version_op dd aVersion_op
 
dd 0
dd 0
 
aEdit_box_draw db 'edit_box',0
aEdit_box_key db 'edit_box_key',0
aEdit_box_mouse db 'edit_box_mouse',0
aVersion_ed db 'version_ed',0
 
aCheck_box_draw db 'check_box_draw',0
aCheck_box_mouse db 'check_box_mouse',0
aVersion_ch db 'version_ch',0
 
aOption_box_draw db 'option_box_draw',0
aOption_box_mouse db 'option_box_mouse',0
aVersion_op db 'version_op',0
 
 
 
rect_input:
.left edit_box 35,95,5,cl_white,0,0,0,5,rect_input_buffer.left,\
.left edit_box 35,95,5,cl_white,0,0,0,5,rect_input_buffer.left,\
ed_figure_only+ed_focus
.top edit_box 35,95,25,cl_white,0,0,0,5,rect_input_buffer.top,\
.top edit_box 35,95,25,cl_white,0,0,0,5,rect_input_buffer.top,\
ed_figure_only
.width edit_box 35,95,45,cl_white,0,0,0,5,rect_input_buffer.width,\
.width edit_box 35,95,45,cl_white,0,0,0,5,rect_input_buffer.width,\
ed_figure_only
.height edit_box 35,95,65,cl_white,0,0,0,5,rect_input_buffer.height,\
ed_figure_only
200,11 → 283,11
rect_input_labels_text:
.left db 'Žâáâ㯠᫥¢ :',0
.top db 'Žâáâ㯠ᢥàåã:',0
.width db '˜¨à¨­ :',0
.width db '˜¨à¨­ :',0
.height db '‚ëá®â :',0
 
riw_check_boxes:
use_rect_active_window check_box 10,85,cl_white,0,0,\
use_rect_active_window check_box 10,85,5,11,cl_white,0,0,\
riw_check_boxes_text.1,\
riw_check_boxes_text.2-riw_check_boxes_text.1
riw_check_boxes_end:
/programs/media/scrshoot/txtbut.inc
7,45 → 7,45
.draw:
pusha
;--- ¯à®à¨á®¢ª  á ¬®© ª­®¯ª¨ ---
mov eax,8
mov ebx,[edi] ; [but.width]
mov ecx,[edi+4] ;[but.height]
mov edx,[edi+8];[but.id]
mov esi,[edi+12];[but.color]
int 0x40
mov eax,8
mov ebx,[edi] ; [but.width]
mov ecx,[edi+4] ;[but.height]
mov edx,[edi+8];[but.id]
mov esi,[edi+12];[but.color]
mcall
;--- ⥪áâ ­  ­¥© ---
; áç¨â ¥¬ ª®«¨ç¥á⢮ ᨬ¢®«®¢
mov edx,[edi+20]
xor esi,esi
; áç¨â ¥¬ ª®«¨ç¥á⢮ ᨬ¢®«®¢
mov edx,[edi+20]
xor esi,esi
.check_next_symbol:
cmp [edx+esi],byte 0
je .str_end
inc esi ; ¢ esi ¤«¨­  áâப¨ ¢ ᨬ¢®« å
jmp .check_next_symbol
cmp [edx+esi],byte 0
je .str_end
inc esi ; ¢ esi ¤«¨­  áâப¨ ¢ ᨬ¢®« å
jmp .check_next_symbol
.str_end:
 
; ¢ëç¨á«ï¥¬ ª®®à¤¨­ âë
lea ebx,[esi*2+esi]
lea ebx,[ebx*2] ; ¢ ebx ¤«¨­  áâப¨ ¢ ¯¨ªá¥«ïå
; ¢ëç¨á«ï¥¬ ª®®à¤¨­ âë
lea ebx,[esi*2+esi]
lea ebx,[ebx*2] ; ¢ ebx ¤«¨­  áâப¨ ¢ ¯¨ªá¥«ïå
 
;not ebx
neg ebx
add bx,[edi] ; [but.width]
sar bx,1
inc bx
add bx,[edi+2];[but.left] ; ¢ bx ¯®§¨æ¨ï á«¥¢ 
shl ebx,16
;not ebx
neg ebx
add bx,[edi] ; [but.width]
sar bx,1
inc bx
add bx,[edi+2];[but.left] ; ¢ bx ¯®§¨æ¨ï á«¥¢ 
shl ebx,16
 
 
mov bx,[edi+4];[but.height]
sub bx,8
sar bx,1
add bx,[edi+6];[but.top] ; ¢ bx ¯®§¨æ¨ï ᢥàåã
mov bx,[edi+4];[but.height]
sub bx,8
sar bx,1
add bx,[edi+6];[but.top] ; ¢ bx ¯®§¨æ¨ï ᢥàåã
 
; à¨á㥬 áâபã ⥪áâ 
mov ecx,[edi+16] ;[but.text_color]
shr eax,1
int 0x40
; à¨á㥬 áâபã ⥪áâ 
mov ecx,[edi+16] ;[but.text_color]
shr eax,1
mcall
popa
ret
}
54,53 → 54,53
proc_addres
{
.width dw width ;+0
.left dw left ;+2
.left dw left ;+2
.height dw height ;+4
.top dw top ;+6
.id dd id ;+8
.top dw top ;+6
.id dd id ;+8
.color dd color ;+12
.text_color dd text_color ;+16
.text_ptr dd text_ptr ;+20
.text_ptr dd text_ptr ;+20
.proc_addres dd proc_addres+0 ;+24
}
but_struc_size=24+4
macro draw_txt_buttons start,end
{
mov edi,start
mov ecx,((end-start)/but_struc_size)
mov edi,start
mov ecx,((end-start)/but_struc_size)
@@:
call txt_button.draw
add edi,but_struc_size
loop @b
call txt_button.draw
add edi,but_struc_size
loop @b
}
 
macro txt_but_set_sys_color start,end,color_table
{
mov edi,start
mov esi,color_table
mov ecx,((end-start)/but_struc_size)
mov edi,start
mov esi,color_table
mov ecx,((end-start)/but_struc_size)
@@:
push dword [esi+24]
pop dword [edi+12]
push dword [esi+28]
pop dword [edi+16]
add edi,but_struc_size
loop @b
push dword [esi+24]
pop dword [edi+12]
push dword [esi+28]
pop dword [edi+16]
add edi,but_struc_size
loop @b
}
 
macro txt_but_ev start,end
{
mov edi,start
mov ecx,((end-start)/but_struc_size)
mov edi,start
mov ecx,((end-start)/but_struc_size)
.txt_but_next:
cmp ah,[edi+8]
jne @f
cmp dword [edi+24],0
je @f
pusha
call dword [edi+24]
popa
cmp ah,[edi+8]
jne @f
cmp dword [edi+24],0
je @f
pusha
call dword [edi+24]
popa
@@:
add edi,but_struc_size
loop .txt_but_next
add edi,but_struc_size
loop .txt_but_next
}