Screenshooter:

1) select path for save with OpenDialog
2) bag fix for threads stacks

RDsave:
Small fix for OpenDialog filter data

git-svn-id: svn://kolibrios.org@1608 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2010-09-08 11:39:41 +00:00
parent ef4f2034b0
commit 96e81206f8
6 changed files with 326 additions and 72 deletions

View File

@ -1,5 +1,6 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm scrshoot.asm scrshoot
@kpack scrshoot
@erase lang.inc
@pause

View File

@ -1,5 +1,6 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm scrshoot.asm scrshoot
@kpack scrshoot
@erase lang.inc
@pause

View File

@ -3,7 +3,7 @@ pusha
bt dword [flags],0
jnc .not_shooted
cmp byte [ed_buffer.1],0
cmp byte [fname_buf],0
je .no_file_name
mov edi,sign_n_input
@ -16,7 +16,7 @@ pusha
mov edi,file_name
rep stosb ; § ¯®«­ï¥¬ ­ã«ï¬¨
mov esi,ed_buffer.1
mov esi,fname_buf
mov edi,file_name
.next:
mov ah,[esi]

View File

@ -1,10 +1,19 @@
;
; Screenshooter for Kolibri
;
; version: 1.0
; last update: 08/09/2010
; written by: Marat Zakiyanov aka Mario79, aka Mario
; changes: select path for save with OpenDialog,
; bag fix for threads stacks
;---------------------------------------------------------------------
; 01.06.09 - Š®¬¯®­¥­âë ¡¥àãâìáï ¨§ á¨á⥬­®© ¡¨¡«¨®â¥ª¨ <Lrz>
; €¢â®à ¯à®£à ¬¬ë …¢â¨å®¢ Œ ªá¨¬ (Maxxxx32)
; 24.07.2008 <Lrz> ®¡­®¢«¥­ editbox
; 01.02.07 - ®¡­®¢«ñ­ editbox
; 31.01.07 - ¢áñ ⥯¥àì à¨áã¥âáï ®â­®á¨â¥«ì­® ª«¨¥­â᪮© ®¡« áâ¨
title equ 'Screenshooter v 0.92' ; ‡ £®«®¢®ª ®ª­ 
title equ 'Screenshooter v 1.0' ; ‡ £®«®¢®ª ®ª­ 
include '../../develop/libraries/box_lib/load_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
;include '../../develop/examples/editbox/trunk/editbox.inc'
@ -21,9 +30,9 @@ use32
db 'MENUET01'
dd 0x1
dd start
dd IM_END
dd i_end
dd i_end
dd i_end
dd stacktop
dd cmdstr
dd cur_dir_path
@ -59,8 +68,11 @@ macro get_sys_colors col_buf
;--- ­ ç «® ¯à®£à ¬¬ë ---
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
;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
load_libraries l_libs_start,end_l_libs
;if return code =-1 then exit, else nornary work
; cmp eax,-1
inc eax
@ -73,6 +85,36 @@ err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i
test eax,eax
jz close
;---------------------------------------------------------------------
mov edi,filename_area
mov esi,start_temp_file_name
xor eax,eax
cld
@@:
lodsb
stosb
test eax,eax
jnz @b
mov edi,fname_buf
mov esi,ed_buffer.1
xor eax,eax
cld
@@:
lodsb
stosb
test eax,eax
jnz @b
;OpenDialog initialisation
push dword OpenDialog_data
call [OpenDialog_Init]
; prepare for PathShow
push dword PathShow_data_1
call [PathShow_prepare]
;---------------------------------------------------------------------
;mov al,[gs:1280*4*1024]
; ãáâ ­ ¢«¨¢ ¥¬ ipc ¡ãää¥à
push 60
@ -120,13 +162,15 @@ key:
cmp al,2
jne @f
cmp ah,55
jne @f
jne still
mov [PrintScreen],1
call shoot
mov [PrintScreen],0
jmp still
@@:
; key_edit_boxes editboxes,editboxes_end
push dword edit1
call [edit_box_key]
; push dword edit1
; call [edit_box_key]
push dword edit2
call [edit_box_key]
@ -149,8 +193,8 @@ mouse:
cmp eax,[slot_n]
jne still
;----------------------------------
push dword edit1
call [edit_box_mouse]
; push dword edit1
; call [edit_box_mouse]
push dword edit2
call [edit_box_mouse]
push dword edit3
@ -213,6 +257,15 @@ p_close:
close:
app_close
;---------------------------------------------------------------------
draw_PathShow:
pusha
mcall 13,<4,302>,<35,15>,0xffffff
; draw for PathShow
push dword PathShow_data_1
call [PathShow_draw]
popa
ret
;--------------------------------------------------------------------
;--- ¯à®®æ¥¤ãà  ¯¥à¥à¨á®¢ª¨ £« ¢­®£® ®ª­  ---------------------------
;--------------------------------------------------------------------
@ -263,8 +316,8 @@ start_draw_window ;
draw_labels labels,labels_end ; ¬¥âª¨
; draw_edit_boxes editboxes,editboxes_end ; edit_box
;------ show check editbox -----------
push dword edit1
call [edit_box_draw]
; push dword edit1
; call [edit_box_draw]
push dword edit2
call [edit_box_draw]
push dword edit3
@ -273,6 +326,8 @@ start_draw_window ;
call [edit_box_draw]
;------ end check all editbox -------
call draw_PathShow
draw_txt_buttons buttons,buttons_end ; ª­®¯ª¨
; draw_check_boxes check_boxes,check_boxes_end ; ä« ¦ª¨
;------ check all checkbox ---------
@ -324,10 +379,6 @@ shoot:
@@:
pop dword [scr_buf.size]
bt dword [ch5.flags],1 ; ¢ª«î祭® «¨  ¢â®á®åà ­¥­¨¥ ?
jnc @f
call save_file
@@:
draw_status shooted_ok
bt dword [flags],1
@ -337,10 +388,28 @@ shoot:
bt dword [ch2.flags],1 ; ¯®ª § âì ®ª­® ¯à¥¤¯à®á¬®âà  ?
jnc @f
cmp [PrintScreen],0
jne @f
call show_scr_window
ret
@@:
bt dword [ch5.flags],1 ; ¢ª«î祭® «¨  ¢â®á®åà ­¥­¨¥ ?
jnc @f
; invoke OpenDialog
push dword OpenDialog_data
call [OpenDialog_Start]
cmp [OpenDialog_data.status],1
je .1
ret
.1:
; prepare for PathShow
push dword PathShow_data_1
call [PathShow_prepare]
call save_file
@@:
bt word [ch3.flags],1 ; ¢®ááâ ­®¢¨âì ®ª­® ?
jnc @f
@ -507,6 +576,19 @@ one_shoot:
jmp @f
;--- ¯à®æ¥¤à , § ¯ã᪠îé ï ¯®â®ª, á®åà ­ïî騩 á­¨¬®ª ---
save_shoot:
; invoke OpenDialog
push dword OpenDialog_data
call [OpenDialog_Start]
cmp [OpenDialog_data.status],1
je .1
ret
.1:
; prepare for PathShow
push dword PathShow_data_1
call [PathShow_prepare]
call draw_PathShow
mov ecx,save_shoot_thread
mov edx,shoot_esp
@@:
@ -619,13 +701,24 @@ label10 label 5,185,0,text.10
status label 5,201,0,no_shoot
labels_end:
;---------------------------------------------------------------------
l_libs_start:
library01 l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \
err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i
library02 l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
end_l_libs:
;---------------------------------------------------------------------
editboxes:
edit1 edit_box 300,5,35,cl_white,0,0,0,0,300,ed_buffer.1,mouse_dd,ed_focus,10,10 ; ¯ãâì ª ä ©«ã
;edit1 edit_box 300,5,35,cl_white,0,0,0,0,300,ed_buffer.1,mouse_dd,ed_focus,10,10 ; ¯ãâì ª ä ©«ã
edit2 edit_box 35,75,134,cl_white,0,0,0,0,9,ed_buffer.2,mouse_dd,ed_figure_only,3,3 ; § ¤¥à¦ª 
edit3 edit_box 35,165,164,cl_white,0,0,0,0,9,ed_buffer.3,mouse_dd,ed_figure_only ;  ¢â®­ã¬¥à æ¨ï
edit4 edit_box 16,165,181,cl_white,0,0,0,0,1,sign_n_input,mouse_dd,ed_figure_only,1
editboxes_end:
;---------------------------------------------------------------------
buttons:
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 ; á®åà ­¨âì á­¨¬®ª
@ -635,18 +728,18 @@ 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,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)
ch5 check_box 5,150,5,11,cl_white,0,0,ch_text.5,(ch_text.6-ch_text.5),ch_flag_en
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:
;---------------------------------------------------------------------
if lang eq ru
text:
.2 db '‚ëá®â  íªà ­ :',0
@ -743,16 +836,84 @@ invalid_rect db 'Wrong area size',0
end if
;---------------------------------------------------------------------
PathShow_data_1:
.type dd 0 ;+0
.start_y dw 38 ;+4
.start_x dw 6 ;+6
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
.area_size_x dw 300 ;+10
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
.background_flag dd 0 ;+16
.font_color dd 0x0 ;+20
.background_color dd 0x0 ;+24
.text_pointer dd fname_buf ;+28
.work_area_pointer dd text_work_area ;+32
.temp_text_length dd 0 ;+36
;---------------------------------------------------------------------
OpenDialog_data:
.type dd 1 ; Save
.procinfo dd procinfo ;+4
.com_area_name dd communication_area_name ;+8
.com_area dd 0 ;+12
.opendir_pach dd temp_dir_pach ;+16
.dir_default_pach dd communication_area_default_pach ;+20
.start_path dd open_dialog_path ;+24
.draw_window dd draw_window ;+28
.status dd 0 ;+32
.openfile_pach dd fname_buf ;+36
.filename_area dd filename_area ;+40
.filter_area dd Filter
.x:
.x_size dw 420 ;+48 ; Window X size
.x_start dw 10 ;+50 ; Window X position
.y:
.y_size dw 320 ;+52 ; Window y size
.y_start dw 10 ;+54 ; Window Y position
communication_area_name:
db 'FFFFFFFF_open_dialog',0
open_dialog_path:
db '/sys/File Managers/opendial',0
communication_area_default_pach:
db '/sys',0
Filter:
dd Filter.end - Filter
.1:
db 'BMP',0
.end:
db 0
start_temp_file_name: db '1.bmp',0
;---------------------------------------------------------------------
sign_n_input:
db '2',0
PrintScreen db 0
app_ipc ipc_buffer 32
align 4
mouse_flag: dd 0x0
;---------------------------------------------------------------------
align 4
ed_buffer:
.1: db '/sys/1.bmp',0
;rb 287
.2:
db '100',0
rb 6
.3:
rb 10
;---------------------------------------------------------------------
IM_END:
;---------------------------------------------------------------------
structure_of_potock:
rb 100
;---------------------------------------------------------------------
align 4
cur_number dd ?
@ -785,17 +946,7 @@ sf_buf:
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
@ -804,7 +955,7 @@ rect_input_buffer:
.height rb 6
cmdstr rb 257
;---------------------------------------------------------------------
align 4
file_name:
@ -821,14 +972,42 @@ sc sys_color_table
app procinfo ; ¨­ä®à¬ æ¨ï ® £« ¢­®¬ ®ª­¥
active_app procinfo ; ¨­ä®à¬ æ¨ï ®¡  ªâ¨¢­®¬ ®ª­¥
set_rect_window_procinfo procinfo ; ¨­ä®à¬ æ¨ï ®¡ ®ª­¥ ®¡« áâ¨
shoot_esp rb 512 ; á⥪ ¯®â®ª  ä®âª ­ìï
set_rect_window_esp rb 512 ; á⥪ ®ª­  ®¡« áâ¨
;---------------------------------------------------------------------
rb 512 ; á⥪ ¯®â®ª  ä®âª ­ìï
shoot_esp:
;---------------------------------------------------------------------
rb 512 ; á⥪ ®ª­  ®¡« áâ¨
set_rect_window_esp:
;---------------------------------------------------------------------
; app_end ; ª®­¥æ ¯à®£à ¬¬ë
mouse_dd rd 1
;---------------------------------------------------------------------
align 4
cur_dir_path rb 4096
library_path rb 4096
cur_dir_path:
rb 4096
;---------------------------------------------------------------------
library_path:
rb 4096
;---------------------------------------------------------------------
temp_dir_pach:
rb 4096
;---------------------------------------------------------------------
text_work_area:
rb 1024
;---------------------------------------------------------------------
fname_buf:
rb 4096
;---------------------------------------------------------------------
procinfo:
rb 1024
;---------------------------------------------------------------------
filename_area:
rb 256
;---------------------------------------------------------------------
rb 1024
i_end_tread:
rb 1024
align 4
;---------------------------------------------------------------------
rb 1024
stacktop:
;---------------------------------------------------------------------
i_end:

View File

@ -222,43 +222,116 @@ 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
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
system_dir_ProcLib db '/sys/lib/proc_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:
err_message_found_lib1 db 'box_lib.obj - Not found!',0
err_message_found_lib2 db 'proc_lib.obj - Not found!',0
err_message_import1 db 'box_lib.obj - Wrong import!',0
err_message_import2 db 'proc_lib.obj - Wrong import!',0
;---------------------------------------------------------------------
align 4
ProcLib_import:
OpenDialog_Init dd aOpenDialog_Init
OpenDialog_Start dd aOpenDialog_Start
;OpenDialog__Version dd aOpenDialog_Version
dd 0
dd 0
aOpenDialog_Init db 'OpenDialog_init',0
aOpenDialog_Start db 'OpenDialog_start',0
;aOpenDialog_Version db 'Version_OpenDialog',0
;---------------------------------------------------------------------
align 4
Box_lib_import:
;init_lib dd a_init
;version_lib dd a_version
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
;version_ed dd aVersion_ed
check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse
version_ch dd aVersion_ch
;version_ch dd aVersion_ch
option_box_draw dd aOption_box_draw
option_box_mouse dd aOption_box_mouse
version_op dd aVersion_op
;version_op dd aVersion_op
;scrollbar_ver_draw dd aScrollbar_ver_draw
;scrollbar_ver_mouse dd aScrollbar_ver_mouse
;scrollbar_hor_draw dd aScrollbar_hor_draw
;scrollbar_hor_mouse dd aScrollbar_hor_mouse
;version_scrollbar dd aVersion_scrollbar
;dinamic_button_draw dd aDbutton_draw
;dinamic_button_mouse dd aDbutton_mouse
;version_dbutton dd aVersion_dbutton
;menu_bar_draw dd aMenu_bar_draw
;menu_bar_mouse dd aMenu_bar_mouse
;menu_bar_activate dd aMenu_bar_activate
;version_menu_bar dd aVersion_menu_bar
;FileBrowser_draw dd aFileBrowser_draw
;FileBrowser_mouse dd aFileBrowser_mouse
;FileBrowser_key dd aFileBrowser_key
;Version_FileBrowser dd aVersion_FileBrowser
PathShow_prepare dd sz_PathShow_prepare
PathShow_draw dd sz_PathShow_draw
;Version_path_show dd szVersion_path_show
dd 0
dd 0
;a_init db 'lib_init',0
;a_version db 'version',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
;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
;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
;aVersion_op db 'version_op',0
;aScrollbar_ver_draw db 'scrollbar_v_draw',0
;aScrollbar_ver_mouse db 'scrollbar_v_mouse',0
;aScrollbar_hor_draw db 'scrollbar_h_draw',0
;aScrollbar_hor_mouse db 'scrollbar_h_mouse',0
;aVersion_scrollbar db 'version_scrollbar',0
;aDbutton_draw db 'dbutton_draw',0
;aDbutton_mouse db 'dbutton_mouse',0
;aVersion_dbutton db 'version_dbutton',0
;aMenu_bar_draw db 'menu_bar_draw',0
;aMenu_bar_mouse db 'menu_bar_mouse',0
;aMenu_bar_activate db 'menu_bar_activate',0
;aVersion_menu_bar db 'version_menu_bar',0
;aFileBrowser_draw db 'FileBrowser_draw',0
;aFileBrowser_mouse db 'FileBrowser_mouse',0
;aFileBrowser_key db 'FileBrowser_key',0
;aVersion_FileBrowser db 'version_FileBrowser',0
sz_PathShow_prepare db 'PathShow_prepare',0
sz_PathShow_draw db 'PathShow_draw',0
;szVersion_path_show db 'version_PathShow',0
;---------------------------------------------------------------------
;width,left,top,color,shift_color,focus_border_color,\
; blur_border_color,text_color,max,text,mouse_variable,flags,size,pos

View File

@ -455,7 +455,7 @@ communication_area_default_pach:
db '/hd0/1/kolibri',0
Filter:
dd Filter.end - Filter.1
dd Filter.end - Filter
.1:
db 'IMG',0
db 'IMA',0