Subversion Repositories Kolibri OS

Rev

Rev 1373 | Rev 1610 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;
  2. ;   Screenshooter for Kolibri
  3. ;
  4. ; version:      1.0
  5. ; last update:  08/09/2010
  6. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  7. ; changes:      select path for save with OpenDialog,
  8. ;               bag fix for threads stacks
  9. ;---------------------------------------------------------------------
  10. ; 01.06.09 - Š®¬¯®­¥­âë ¡¥àãâìáï ¨§ á¨á⥬­®© ¡¨¡«¨®â¥ª¨ <Lrz>
  11. ; €¢â®à ¯à®£à ¬¬ë …¢â¨å®¢ Œ ªá¨¬ (Maxxxx32)
  12. ; 24.07.2008 <Lrz> ®¡­®¢«¥­ editbox
  13. ; 01.02.07 - ®¡­®¢«ñ­ editbox
  14. ; 31.01.07 - ¢áñ ⥯¥àì à¨áã¥âáï ®â­®á¨â¥«ì­® ª«¨¥­â᪮© ®¡« áâ¨
  15.  
  16. title equ 'Screenshooter v 1.0' ; ‡ £®«®¢®ª ®ª­ 
  17. include '../../develop/libraries/box_lib/load_lib.mac'
  18. include '../../develop/libraries/box_lib/trunk/box_lib.mac'
  19. ;include '../../develop/examples/editbox/trunk/editbox.inc'
  20. include '../../macros.inc'
  21. include 'txtbut.inc'
  22. include 'label.inc'
  23. include 'textwork.inc'
  24. include 'scrshoot.mac'
  25.  
  26. ;include 'macros.inc'  ; ¢áâ ¢«ï¥¬ ¬ ªà®áë
  27. ;        meos_header  cmdstr ; ¢áâ ¢«ï¥¬ § £®«®¢®ª ¯à®£à ¬¬ë
  28. use32                
  29.     org 0x0
  30.     db 'MENUET01'
  31.     dd 0x1
  32.     dd start
  33.     dd IM_END
  34.     dd i_end
  35.     dd stacktop
  36.     dd cmdstr
  37.     dd cur_dir_path
  38.  
  39. align 4
  40.         @use_library
  41.         use_txt_button                          ;  |
  42.         use_label                               ;  |-- GUI ª®¬¯®­¥­âë ¨ ­¥ª®â®àë¥ ¯à®æ¥¤ãàë
  43.         use_text_work                           ; /
  44. include 'scrwin.inc'  ; ¢áâ ¢«ï¥¬ ª®¤ ®ª­  ¯à¤¯à®á¬®âà 
  45. include 'scrsavef.inc'; ¢áâ ¢«ï¥¬ ¯à®æ¥¤ãàã á®åà ­¥­¨ï ä ©« 
  46.  
  47. include 'gp.inc'
  48. include 'srectwin.inc'
  49. include 'lang.inc'
  50.  
  51. macro get_sys_colors col_buf
  52. {
  53.         ;mov     eax,48
  54.         push    48
  55.         pop     eax
  56.         ;mov     ebx,3
  57.         push    3
  58.         pop     ebx
  59.         ;mov     ecx,col_buf
  60.         push    col_buf
  61.         pop     ecx
  62.         ;mov     edx,40
  63.         push    40
  64.         pop     edx
  65.         mcall
  66. }
  67.  
  68. ;--- ­ ç «® ¯à®£à ¬¬ë ---
  69. align 4
  70. start:
  71. ;sys_load_library  library_name, cur_dir_path, library_path, system_path, \
  72. ;err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i
  73.  
  74. load_libraries l_libs_start,end_l_libs
  75.  
  76. ;if return code =-1 then exit, else nornary work
  77. ;        cmp     eax,-1
  78.         inc     eax
  79.         test    eax,eax
  80.         jz      close
  81. ;;;;;;;;;;;;;;;; init memory 68/11
  82.         mov     eax,68
  83.         mov     ebx,11
  84.         mcall
  85.         test    eax,eax
  86.         jz      close
  87.  
  88. ;--------------------------------------------------------------------- 
  89.         mov     edi,filename_area
  90.         mov     esi,start_temp_file_name
  91.         xor     eax,eax
  92.         cld
  93. @@:
  94.         lodsb
  95.         stosb
  96.         test    eax,eax
  97.         jnz     @b
  98.  
  99.  
  100.         mov     edi,fname_buf
  101.         mov     esi,ed_buffer.1
  102.         xor     eax,eax
  103.         cld
  104. @@:
  105.         lodsb
  106.         stosb
  107.         test    eax,eax
  108.         jnz     @b
  109.        
  110. ;OpenDialog     initialisation
  111.         push    dword OpenDialog_data
  112.         call    [OpenDialog_Init]
  113.  
  114. ; prepare for PathShow
  115.         push    dword PathShow_data_1
  116.         call    [PathShow_prepare]
  117. ;--------------------------------------------------------------------- 
  118.         ;mov     al,[gs:1280*4*1024]
  119.                     ; ãáâ ­ ¢«¨¢ ¥¬ ipc ¡ãää¥à
  120.         push    60
  121.         pop     eax
  122.         ;mov     ebx,1
  123.         xor     ebx,ebx
  124.         inc     ebx
  125.         mov     ecx,app_ipc
  126.         mov     edx,32
  127.         mcall
  128.  
  129.         push    66   ; ãáâ ­ ¢«¨¢ ¥¬ £«®¡ «ì­ãî £®àïçãî ª« ¢¨èã
  130.         pop     eax
  131.         push    eax
  132.         mov     ebx,4
  133.         mov     cl,55    ; 55 - PrintScrn
  134.         xor     edx,edx
  135.         mcall
  136.  
  137.         mov     ebx,app
  138.         call    get_slot_n
  139.         mov     [slot_n],ecx
  140.  
  141.         ; ãáâ ­ ¢«¨¢ ¥¬ ¬ áªã ᮡë⨩
  142.         set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse+evm_ipc)
  143.  
  144. ; á ¯à룠¥¬ ¯à¨ ª ¦¤®© ¯¥à¥à¨á®¢ª¥
  145. red:
  146.         get_procinfo app   ; ¯®«ãç ¥¬ ¨­ä®à¬ æ¨î ® ¯à®æ¥áá¥
  147.         get_sys_colors sc  ; ¯®«ãç ¥¬ á¨á⥬­ë¥ 梥â 
  148.  
  149.         ; ãáâ ­ ¢«¨¢ ¥¬ á¨á⥬­ë¥ æ¢¥â  ã GUI ª®¬¯®­¥­â®¢
  150.         txt_but_set_sys_color buttons,buttons_end,sc             ; \
  151.         labels_set_sys_color labels,labels_end,sc                ; |
  152.         check_boxes_set_sys_color check_boxes,check_boxes_end,sc ; |
  153.         edit_boxes_set_sys_color editboxes,editboxes_end,sc      ; /
  154.  
  155.         get_screen_prop scr ; ¯®«ãç ¥¬ ¨­ä®à¬ æ¨î ®¡ íªà ­¥
  156.         call    draw_window ; ¯¥à¥à¨á®¢ë¢ ¥¬ ®ª­®
  157. still:
  158.         wait_event red,key,button,mouse,ipc,still ; ¦¤¥¬ ᮡë⨩
  159.  
  160. key:
  161.         get_key
  162.         cmp     al,2
  163.         jne     @f
  164.         cmp     ah,55
  165.         jne     still
  166.         mov     [PrintScreen],1
  167.         call    shoot
  168.         mov     [PrintScreen],0
  169.         jmp     still
  170. @@:
  171. ;        key_edit_boxes editboxes,editboxes_end
  172. ;       push    dword edit1
  173. ;       call    [edit_box_key]
  174.  
  175.         push    dword edit2
  176.         call    [edit_box_key]
  177.  
  178.         push    dword edit3
  179.         call    [edit_box_key]
  180.  
  181.         push    dword edit4
  182.         call    [edit_box_key]
  183.  
  184.         jmp     still
  185. button:
  186.         get_pressed_button
  187.         cmp     ah,1
  188.         je      p_close
  189.         txt_but_ev buttons,buttons_end
  190.         jmp     still
  191. mouse:
  192.         get_active_window
  193.         cmp     eax,[slot_n]
  194.         jne     still
  195. ;----------------------------------
  196. ;       push    dword edit1
  197. ;       call    [edit_box_mouse]
  198.         push    dword edit2
  199.         call    [edit_box_mouse]
  200.         push    dword edit3
  201.         call    [edit_box_mouse]
  202.         push    dword edit4
  203.         call    [edit_box_mouse]
  204. ;----------------------------------
  205.         push    dword ch1
  206.         call    [check_box_mouse]
  207.         push    dword ch2
  208.         call    [check_box_mouse]
  209.         push    dword ch3
  210.         call    [check_box_mouse]
  211.         push    dword ch4
  212.         call    [check_box_mouse]
  213.         push    dword ch5
  214.         call    [check_box_mouse]
  215.         push    dword ch6
  216.         call    [check_box_mouse]
  217.         push    dword use_rect
  218.         call    [check_box_mouse]
  219. ;-----------------------------------
  220. ;        mouse_check_boxes check_boxes,check_boxes_end
  221. ;        mouse_edit_boxes editboxes,editboxes_end
  222.         jmp     still
  223. ipc:
  224.         cmp     word [app_ipc+8],2
  225.         jne     @f
  226.         min_window
  227.         jmp     .clear_ipc
  228. @@:
  229.         cmp     word [app_ipc+8],3
  230.         jne     @f
  231.         mov     ecx,[slot_n]
  232.         activ_window
  233.         jmp     .clear_ipc
  234. @@:
  235.         call    draw_number
  236.         call    dr_st
  237.  
  238. .clear_ipc:
  239.         cld
  240.         xor     eax,eax
  241.         mov     ecx,32/4
  242.         mov     edi,app_ipc
  243.         rep     stosd
  244.         jmp     still
  245.  
  246. p_close:
  247.         btr     dword [flags],1
  248.  
  249.         bt      dword [flags],3
  250.         jnc     @f
  251.         mov    eax,18
  252.         mov     ebx,eax
  253.         mov     ecx,[set_rect_window_pid]
  254.         mcall
  255. @@:
  256.  
  257. close:
  258.         app_close
  259.  
  260. ;---------------------------------------------------------------------
  261. draw_PathShow:
  262.         pusha
  263.         mcall   13,<4,302>,<35,15>,0xffffff
  264. ; draw for PathShow
  265.         push    dword PathShow_data_1
  266.         call    [PathShow_draw]
  267.         popa
  268.         ret
  269. ;--------------------------------------------------------------------
  270. ;--- ¯à®®æ¥¤ãà  ¯¥à¥à¨á®¢ª¨ £« ¢­®£® ®ª­  ---------------------------
  271. ;--------------------------------------------------------------------
  272. draw_window:
  273. start_draw_window        ; ­ ç «® ¯¥à¥à¨á®¢ª¨
  274.         ; ®¯à¥¤¥«ï¥¬ ®ª­®
  275.         get_skin_height
  276.         mov     ebx,100*65536+320
  277.         mov     ecx,100*65536+220
  278.         add     cx,ax
  279.         mov     edx,[sc.work]
  280.         or      edx,0x34000000;0x33000000
  281.         xor     esi,esi
  282.         ;xor     edi,edi
  283.         mov     edi,grab_text
  284.         xor     eax,eax
  285.         mcall
  286.  
  287.         mov     eax,47             ; ¢ë¢®¤¨¬ ç¨á«  ¢ ®ª­®
  288.         mov     bx,4
  289.         shl     ebx,16
  290.         movsx   ecx,word [scr.width] ; è¨à¨­  íªà ­ 
  291.         mov     dx,95
  292.         shl     edx,16
  293.         mov     dx,[label1.top]
  294.         push    dx
  295.         mov     esi,[sc.work_text]
  296.         mcall
  297.         movsx   ecx,word [scr.height]   ; ¢ëá®â  íªà ­ 
  298.         mov     dx,[label2.top]
  299.         mcall
  300.         mov     bx,2
  301.         shl     ebx,16
  302.         movsx   ecx,word [scr.bitspp]   ; ¡¨â ­  ¯¨ªá¥«ì
  303.         mov     dx,240
  304.         shl     edx,16
  305.         pop     dx
  306.         mcall
  307.         mov     bx,6
  308.         shl     ebx,16
  309.         mov     ecx,[scr.bytesps]       ; ¡ ©â ­  áâபã
  310.         mov     dx,[label2.top]
  311.         mcall
  312.  
  313.         call    draw_number      ; ¯à®à¨á®¢ë¢ ¥¬ ­®¬¥à á­¨¬ª 
  314.         call    dr_st
  315.  
  316.         draw_labels labels,labels_end            ; ¬¥âª¨
  317. ;        draw_edit_boxes editboxes,editboxes_end  ; edit_box
  318. ;------ show check editbox -----------
  319. ;       push    dword edit1
  320. ;       call    [edit_box_draw]
  321.         push    dword edit2                                                                                                  
  322.         call    [edit_box_draw]
  323.         push    dword edit3
  324.         call    [edit_box_draw]
  325.         push    dword edit4
  326.         call    [edit_box_draw]
  327. ;------ end check all editbox -------
  328.  
  329.         call    draw_PathShow
  330.  
  331.         draw_txt_buttons buttons,buttons_end     ; ª­®¯ª¨
  332. ;        draw_check_boxes check_boxes,check_boxes_end ; ä« ¦ª¨
  333. ;------ check all checkbox ---------
  334.         push    dword ch1
  335.         call    [check_box_draw]
  336.         push    dword ch2
  337.         call    [check_box_draw]       
  338.         push    dword ch3
  339.         call    [check_box_draw]
  340.         push    dword ch4
  341.         call    [check_box_draw]
  342.         push    dword ch5
  343.         call    [check_box_draw]
  344.         push    dword ch6
  345.         call    [check_box_draw]
  346.         push    dword use_rect
  347.         call    [check_box_draw]
  348. ;------ end check all checkbox ------
  349.  
  350. stop_draw_window      ; ª®­¥æ ¯¥à¥à¨á®¢ª¨
  351. ret
  352.  
  353. shoot:
  354.         bt      dword [ch4.flags],1   ; ¢ª«î祭  «¨ § ¤¥à¦ª  ?
  355.         jnc     @f
  356.         draw_status delay_now
  357.         mov     edi,ed_buffer.2
  358.         call    zstr_to_int
  359.         mov     ebx,eax
  360.         delay
  361. @@:
  362.         call    get_mem_for_shoot; ¯®«ãç ¥¬ ¯ ¬ïâì ¤«ï á­¨¬ª 
  363.  
  364.  
  365.         bts     dword [flags],0       ; ­ã«¥¢®© ä« £ - á­¨¬®ª ¥áâì ¢ ¯ ¬ïâ¨
  366.  
  367.         ; ¤¥« ¥¬ á­¨¬®ª
  368.         draw_status shooting
  369.         mov     esi,scr
  370.         mov     edi,[scr_buf.ptr]
  371.         call    copy_screen_to_image
  372.  
  373.         bt      dword [use_rect.flags],1
  374.         jc      .use_rect
  375.         push    dword [scr]
  376.         jmp     @f
  377. .use_rect:
  378.         push    dword [rect.height]
  379. @@:
  380.         pop     dword [scr_buf.size]
  381.  
  382.         draw_status     shooted_ok
  383.  
  384.         bt      dword [flags],1
  385.         jnc     @f
  386.         ret
  387. @@:
  388.  
  389.         bt      dword [ch2.flags],1  ; ¯®ª § âì ®ª­® ¯à¥¤¯à®á¬®âà  ?
  390.         jnc     @f
  391.         cmp             [PrintScreen],0
  392.         jne     @f
  393.         call    show_scr_window
  394.         ret
  395. @@:
  396.         bt      dword [ch5.flags],1  ; ¢ª«î祭® «¨  ¢â®á®åà ­¥­¨¥ ?
  397.         jnc     @f
  398.        
  399. ; invoke OpenDialog
  400.         push    dword OpenDialog_data
  401.         call    [OpenDialog_Start]
  402.         cmp     [OpenDialog_data.status],1
  403.         je      .1
  404.         ret
  405. .1:
  406. ; prepare for PathShow
  407.         push    dword PathShow_data_1
  408.         call    [PathShow_prepare]
  409.  
  410.         call    save_file
  411. @@:
  412.        
  413.         bt      word [ch3.flags],1   ; ¢®ááâ ­®¢¨âì ®ª­® ?
  414.         jnc     @f
  415.  
  416.         delay 100
  417.         mov     ecx,[slot_n]
  418.         activ_window
  419. @@:
  420. ret
  421.  
  422. ;--- ¯®«ãç¨âì ¯ ¬ïâì ¤«ï á­¨¬ª  ---
  423. get_mem_for_shoot:
  424. ;clean memory
  425.         mov     ecx,dword [scr_buf.ptr]
  426.         mov     ebx,13
  427.         mov     eax,68
  428.         mcall
  429.  
  430.         bt      dword [use_rect.flags],1 ; ä®âª âì ®¡« áâì íªà ­ 
  431.         jc      .use_area
  432.         movzx   ecx, word [scr.width]
  433.         movzx   ebx, word [scr.height]
  434.         jmp     @f
  435. .use_area:
  436.         call    read_rect
  437.         movzx   ecx, word [rect.width]
  438.         movzx   ebx, word [rect.height]
  439. @@:
  440.         imul    ecx,ebx
  441.         lea     ecx,[ecx*3]
  442. ;        add     ecx,i_end
  443.         mov     ebx,12
  444.         mov     eax,68
  445.         mcall
  446.         mov     [scr_buf.ptr],eax
  447.         add     eax,ecx
  448.         mov     [scr_buf.end_ptr],ecx
  449. ret
  450.  
  451. ;--- ᮤ âì ®ª­® ¯à®¥¤¯à®á¬®âà  ---
  452. show_scr_window:
  453. pusha
  454.         bt      dword [flags],0
  455.         jnc     @f
  456.         mov     eax,51
  457.         xor     ebx,ebx
  458.         inc     ebx
  459.         mov     ecx,scr_window
  460.         mov     edx,i_end_tread-1000
  461.         mcall
  462. @@:
  463. popa
  464. ret
  465.  
  466. ;--- ¯à®ç¨â âì ¨ ­ à¨á®¢ âì ⥪ã騩 ­®¬¥à ---
  467. apply_number:
  468.         mov     edi,ed_buffer.3
  469.         call    zstr_to_int
  470.         mov     [cur_number],eax
  471.         call    draw_number
  472. ret
  473.  
  474. ;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ⥪ã饣® ­®¬¥à  ---
  475. draw_number:
  476.         mov     edi,sign_n_input
  477.         call    zstr_to_int
  478.         mov     [sign_n],al
  479.         mov     eax,13
  480.         mov     ebx,150*65536+96
  481.         mov     cx,[label9.top]
  482.         shl     ecx,16
  483.         mov     cx,10
  484.         mov     edx,[sc.work]
  485.         mcall
  486.         mov     eax,47
  487.         movsx   bx,byte [sign_n]
  488.         shl     ebx,16
  489.         mov     ecx,[cur_number]
  490.         mov     dx,150
  491.         shl     edx,16
  492.         mov     dx,[label9.top]
  493.         mov     esi,[sc.work_text]
  494.         mcall
  495. ret
  496.  
  497. ;--- ¯à®æ¥¤ãà , § ¯ã᪠îé ï ¯®â®ª  ¢â®áꥬª¨ ---
  498. start_autoshoot:
  499.         bts     dword [flags],1
  500.         jc      @f
  501.         mov     eax,51
  502.         ;mov     ebx,1
  503.         xor     ebx,ebx
  504.         inc     ebx
  505.         mov     ecx,autoshoot
  506.         mov     edx,i_end_tread-512
  507.         mcall
  508. @@:
  509. ret
  510.  
  511. ;--- ®áâ ­ ¢«¨¢ ¥â íâ®â ¯®â®ª ---
  512. stop_autoshoot:
  513.         btr     dword [flags],1
  514. ret
  515.  
  516. ;--- 横« ¯®â®ª   ¢â®áꥬª¨ ---
  517. autoshoot:
  518.         mov     ecx,[slot_n]
  519.         activ_window
  520. .next:
  521.         bt      dword [flags],1
  522.         jnc     close
  523.         mov     eax,60
  524.         mov     ebx,2
  525.         mov     ecx,[app.pid]
  526.         mov     edx,messages.draw_number
  527.         mov     esi,2
  528.         mcall
  529.         call    shoot
  530.         jmp     autoshoot.next
  531.  
  532. ;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ áâப¨ á®áâ®ï­¨ï ---
  533. ; (¤®«¦­  ¢ë§ë¢ âìáï ¯®â®ª®¬ £« ¢­®£® ®ª­ )
  534. dr_st:
  535.         mov     eax,38              ; ®â१®ª
  536.         mov     ebx,0*65536+310
  537.         mov     ecx,198*65536+198
  538.         mov     edx,[sc.work_graph]
  539.         mcall
  540.  
  541.         mov     eax,13              ; ¯®«®áª 
  542.         mov     bx,310
  543.         mov     ecx,199*65536+15
  544.         mov     edx,[sc.work]
  545.         mcall
  546.  
  547.         mov     edi,status
  548.         call    draw_label
  549. ret
  550.  
  551. ;--- ¯à®æ¥¤ãà  ¯®«ã祭¨ï ­®¬¥à  á«®â  ¯®â®ª  ---
  552. ; ¢å®¤ ebx - ¡ãää¥à 1024 ¡ ©â
  553. ; ¢ë室 ecx - ­®¬¥à á«®â 
  554. get_slot_n:
  555.         mov     eax,9
  556.         xor     ecx,ecx
  557.         dec     ecx
  558.         mcall
  559.  
  560.         mov     edx,[ebx+30]
  561.         xor     ecx,ecx
  562. @@:
  563.         mov     eax,9
  564.         inc     ecx
  565.         mcall
  566.         cmp     [ebx+30],edx
  567.         je      @f
  568.         jmp     @b
  569. @@:
  570. ret
  571.  
  572. ;--- ¯à®æ¥¤ãà , § ¯ã᪠îé ï ¯®â®ª, ¤¥« î騩 1 á­¨¬®ª ---
  573. one_shoot:
  574.         mov     ecx,one_shoot_thread
  575.         mov     edx,shoot_esp
  576.         jmp     @f
  577. ;--- ¯à®æ¥¤à , § ¯ã᪠îé ï ¯®â®ª, á®åà ­ïî騩 á­¨¬®ª ---
  578. save_shoot:
  579. ; invoke OpenDialog
  580.         push    dword OpenDialog_data
  581.         call    [OpenDialog_Start]
  582.         cmp     [OpenDialog_data.status],1
  583.         je      .1
  584.         ret
  585. .1:
  586. ; prepare for PathShow
  587.         push    dword PathShow_data_1
  588.         call    [PathShow_prepare]
  589.  
  590.         call    draw_PathShow
  591.  
  592.         mov     ecx,save_shoot_thread
  593.         mov     edx,shoot_esp
  594. @@:
  595.         bts     dword [flags],2
  596.         jc      .running
  597.         bt      dword [flags],1
  598.         jc      .running
  599.  
  600.         mov     eax,51
  601.         ;mov     ebx,1
  602.         xor     ebx,ebx
  603.         inc     ebx
  604.         mcall
  605. .running:
  606. ret
  607.  
  608. ;--- ¯®â®ª, ¤¥« î騩 1 á­¨¬®ª ---
  609. one_shoot_thread:
  610.         mov     ecx,[slot_n]
  611.         activ_window
  612.         bt      dword [ch1.flags],1   ; ¬¨­¨¬¨§¨à®¢ âì ®ª­® ?
  613.         jnc      @f
  614.         mov     eax,60
  615.         mov     ebx,2
  616.         mov     ecx,[app.pid]
  617.         mov     edx,messages.min_window
  618.         mov     esi,2
  619.         mcall
  620. @@:
  621.         call    shoot
  622.         btr     dword [flags],2
  623.         jmp     close
  624.  
  625. ;--- ¯à®æ¥¤ãà , ®â¯à ¢«ïîé ï £« ¢­®¬ã ®ª­ã á®®¡é¥­¨¥ ® ¯¥à¥à¨á®¢ª¥
  626. ; áâப¨ á®áâ®ï­¨ï ---
  627. send_draw_status:
  628.         mov     eax,60
  629.         mov     ebx,2
  630.         mov     ecx,[app.pid]
  631.         mov     edx,messages.draw_status
  632.         mov     esi,2
  633.         mcall
  634. ret
  635.  
  636. ;--- ¯®â®ª, á®åà ­ï ä ©« ---
  637. save_shoot_thread:
  638.         mov     ecx,[slot_n]
  639.         activ_window
  640.         call    save_file
  641.         btr     dword [flags],2
  642.         jmp     close
  643.  
  644. ;--- ¯à®æ¥¤ãà , § ¯ã᪠îé ï ¯®â®ª ®ª­  ãáâ ­®¢ª¨ ®¡« á⨠áꥬª¨ ---
  645. show_set_rect_window:
  646.         bts     dword [flags],3
  647.         jc      @f
  648.         mov     eax,51
  649.         xor     ebx,ebx
  650.         inc     ebx
  651.         mov     ecx,set_rect_window
  652.         mov     edx,set_rect_window_esp
  653.         mcall
  654.  
  655.         mov     [set_rect_window_pid],eax
  656. ret
  657.  
  658. @@:
  659.         mov     eax,18
  660.         mov     ebx,eax
  661.         mov     ecx,[set_rect_window_pid]
  662.         mcall
  663.         btr     dword [flags],3
  664. ret
  665.  
  666. ;--- ¯®«ã祭¨¥ ¨­ä®à¬ æ¨¨ ®¡  ªâ¨¢­®¬ ®ª­¥ ---
  667. get_active_window_info:
  668.         mov    eax,18
  669.         mov    ebx,7
  670.         mcall
  671.  
  672.         mov     ecx,eax
  673.         mov     eax,9
  674.         mov     ebx,active_app
  675.         mcall
  676. ret
  677.  
  678. ;====================================================================
  679. ;=== ¤ ­­ë¥ ¯à®£à ¬¬ë ===============================================
  680. ;====================================================================
  681. messages:
  682. .draw_number dw 0
  683. .draw_status dw 1
  684. .min_window  dw 2
  685. .act_window  dw 3
  686.  
  687. grab_text:
  688.         db      title,0
  689.  
  690. labels:
  691. label1 label 5,5,0,text.1   ; è¨à¨­  íªà ­ 
  692. label2 label 5,15,0,text.2   ; ¢ëá®â  íªà ­ 
  693. label3 label 5,25,0,text.3   ; ¢¢¥¤¨â¥ ¨¬ï ä ©« 
  694. label4 label 150,5,0,text.4  ; ¡¨â ­  ¯¨ªá¥«ì
  695. label5 label 150,15,0,text.5  ; ¡ ©â ­  áâபã
  696. label6 label 115,138,0,text.6  ; 100 = 1 ᥪ.
  697. ;label7 label 10,190,0,text.7
  698. ;label8 label 10,225,0,text.8
  699. label9 label 5,52,0,text.9   ; ­®¬¥à ⥪ã饣® ᨬª 
  700. label10 label 5,185,0,text.10
  701. status label 5,201,0,no_shoot
  702. labels_end:
  703.  
  704. ;---------------------------------------------------------------------
  705. l_libs_start:
  706.  
  707. library01  l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \
  708. err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i
  709.  
  710. library02  l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \
  711. err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
  712.  
  713. end_l_libs:
  714. ;---------------------------------------------------------------------
  715. editboxes:
  716. ;edit1 edit_box 300,5,35,cl_white,0,0,0,0,300,ed_buffer.1,mouse_dd,ed_focus,10,10       ; ¯ãâì ª ä ©«ã
  717. edit2 edit_box 35,75,134,cl_white,0,0,0,0,9,ed_buffer.2,mouse_dd,ed_figure_only,3,3         ; § ¤¥à¦ª 
  718. edit3 edit_box 35,165,164,cl_white,0,0,0,0,9,ed_buffer.3,mouse_dd,ed_figure_only    ;  ¢â®­ã¬¥à æ¨ï
  719. edit4 edit_box 16,165,181,cl_white,0,0,0,0,1,sign_n_input,mouse_dd,ed_figure_only,1
  720. editboxes_end:
  721. ;---------------------------------------------------------------------
  722. buttons:
  723. but1 txt_button 150,5,15,65,2,0,0,but_text.1,one_shoot             ; ᤥ« âì á­¨¬®ª
  724. but2 txt_button 145,160,15,65,3,0,0,but_text.2,save_shoot          ; á®åà ­¨âì á­¨¬®ª
  725. but3 txt_button 140,115,12,120,4,0,0,but_text.3,show_scr_window    ; ¯®ª § âì á­¨¬®ª
  726. but4 txt_button 80,205,15,163,5,0,0,but_text.4,apply_number        ; ¯à¨¬¥­¨âì ­®¬¥à
  727. but5 txt_button 150,5,15,85,6,0,0,but_text.5,start_autoshoot       ; ­ ç âì  ¢â®áêñ¬ªã
  728. but6 txt_button 145,160,15,85,7,0,0,but_text.6,stop_autoshoot      ; ®áâ ­®¢¨âì  ¢â®áêñ¬ªã
  729. but7 txt_button 40,205,10,150,8,0,0,but_text.7,show_set_rect_window ; § ¤ âì ®¡« áâì
  730. buttons_end:
  731. ;---------------------------------------------------------------------
  732. check_boxes:
  733. ch1 check_box 5,105,5,11,cl_white,0,0,ch_text.1,(ch_text.2-ch_text.1),ch_flag_en  ; ᢥà­ãâì ®ª­®
  734. ch2 check_box 5,120,5,11,cl_white,0,0,ch_text.2,(ch_text.3-ch_text.2),ch_flag_en  ; § â¥¬ ᤥ« âì  ªâ¨¢­ë¬
  735. ch3 check_box 145,105,5,11,cl_white,0,0,ch_text.3,(ch_text.4-ch_text.3),ch_flag_en ; ¯®ª § âì á­¨¬®ª
  736. ch4 check_box 5,135,5,11,cl_white,0,0,ch_text.4,(ch_text.5-ch_text.4),ch_flag_en   ; § ¤¥à¦ª 
  737. ch5 check_box 5,150,5,11,cl_white,0,0,ch_text.5,(ch_text.6-ch_text.5),ch_flag_en
  738. ch6 check_box 5,165,5,11,cl_white,0,0,ch_text.6,(ch_text.7-ch_text.6),ch_flag_en
  739. use_rect check_box 145,150,5,11,cl_white,0,0,ch_text.7,(ch_text.8-ch_text.7) ; ¨á¯. ®¡« áâì
  740. ;  ¢â®­ã¬¥à æ¨ï
  741. check_boxes_end:
  742. ;---------------------------------------------------------------------
  743. if lang eq ru
  744. text:
  745. .2 db '‚ëá®â  íªà ­ :',0
  746. .1 db '˜¨à¨­  íªà ­ :',0
  747. .3 db '‚¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ä ©«ã:',0
  748. .4 db '¨â ­  ¯¨ªá¥«ì:',0
  749. .5 db ' ©â ­  áâபã:',0
  750. .6 db '100 = 1 ᥪ㭤 ',0
  751. ;.7: db '‚¢¥¤¨â¥ ¨¬ï ä ©« :',0
  752. ;.8: db '‚¬¥áâ® "*" ¢ ¨¬¥­¨ ä ©«  ¡ã¤¥â ¢áâ ¢«ïâìáï ­®¬¥à.',0
  753. .9 db '®¬¥à ⥪ã饣® á­¨¬ª :',0
  754. .10 db 'Š®«¨ç¥á⢮ §­ ª®¢ ¢ ­®¬¥à¥:',0
  755.  
  756. but_text:
  757. .1 db '‘¤¥« âì á­¨¬®ª íªà ­ ',0
  758. .2 db '‘®åà ­¨âì á­¨¬®ª íªà ­ ',0
  759. .3 db '®ª § âì á­¨¬®ª ᥩç á',0
  760. .4 db 'à¨¬¥­¨âì',0
  761. .5 db ' ç âì  ¢â®áꥬªã',0
  762. .6 db 'Žáâ ­®¢¨âì  ¢â®áꥬªã',0
  763. .7 db '§ ¤ âì',0
  764.  
  765. ch_text:
  766. .1 db '‘¢¥à­ãâì ®ª­®';,0
  767. .2 db '®ª § âì á­¨¬®ª';,0
  768. .3 db '§ â¥¬ ᤥ« âì  ªâ¨¢­ë¬';,0
  769. .4 db '‡ ¤¥à¦ª :';,0
  770. .5 db '€¢â®á®åà ­¥­¨¥';,0
  771. .6 db '€¢â®­ã¬¥à æ¨ï, ­ ç¨­ ï á';,0
  772. .7 db 'Ž¡« áâì'
  773. .8:
  774.  
  775. no_shoot db '‘­¨¬®ª ­¥ ᤥ« ­',0
  776. shooting db '”®â®£à ä¨à®¢ ­¨¥...',0
  777. shooted_ok db '‘­¨¬®ª ᤥ« ­',0
  778. saving db '‘®åà ­¥­¨¥...',0
  779. saved_ok db '‘­¨¬®ª á®åà ­¥­',0
  780. delay_now db '‡ ¤¥à¦ª ...',0
  781. bad_file_name db 'ˆ¬ï ä ©«  ¢¢¥¤¥­® ­¥¢¥à­®',0
  782. disk_filled db '„¨áª § ¯®«­¥­',0
  783. bad_fat_table db '’ ¡«¨æ  FAT à §àã襭 ',0
  784. ac_den db '„®áâ㯠§ ¯à¥é¥­',0
  785. device_er db 'Žè¨¡ª  ãáâனá⢠',0
  786. not_shooted db '‘¤¥« ©â¥ á­¨¬®ª !!!',0
  787. no_file_name db '‚¢¥¤¨â¥ ¨¬ï ä ©«  !!!',0
  788. invalid_rect db '¥¤®¯ãáâ¨¬ë¥ à §¬¥àë ®¡« áâ¨',0
  789.  
  790. else
  791. text:
  792. .2 db 'Screen width:',0
  793. .1 db 'Screen height:',0
  794. .3 db 'Enter full path to the file:',0
  795. .4 db 'Bits per pixel:',0
  796. .5 db 'Bytes per line:',0
  797. .6 db '100 = 1 second',0
  798. ;.7: db 'Enter name of file:',0
  799. ;.8: db 'Instead of "*" in filename the number will be included.',0
  800. .9 db 'Current photo number:',0
  801. .10 db 'Amount of digits in number:',0
  802.  
  803. but_text:
  804. .1 db 'Make screen photo',0
  805. .2 db 'Save screen photo',0
  806. .3 db 'Show photo now',0
  807. .4 db 'Apply',0
  808. .5 db 'Start autoshooting',0
  809. .6 db 'Stop autoshooting',0
  810. .7 db 'Set',0
  811.  
  812. ch_text:
  813. .1 db 'Minimize window';,0
  814. .2 db 'Show photo';,0
  815. .3 db 'then make active';,0
  816. .4 db 'Delay:';,0
  817. .5 db 'Autosave';,0
  818. .6 db 'Start numeration from';,0
  819. .7 db 'Area'
  820. .8:
  821.  
  822. no_shoot db 'There is no photo',0
  823. shooting db 'Photographing...',0
  824. shooted_ok db 'Photo created',0
  825. saving db 'Saving...',0
  826. saved_ok db 'Photo saved',0
  827. delay_now db 'Delay...',0
  828. bad_file_name db 'File name is wrong',0
  829. disk_filled db 'Disk is full',0
  830. bad_fat_table db 'FAT table destroyed',0
  831. ac_den db 'Access denied',0
  832. device_er db 'Device error',0
  833. not_shooted db 'Make a photo !!!',0
  834. no_file_name db 'Enter file name !!!',0
  835. invalid_rect db 'Wrong area size',0
  836.  
  837. end if
  838.  
  839. ;---------------------------------------------------------------------
  840. PathShow_data_1:
  841. .type                   dd 0    ;+0
  842. .start_y                dw 38   ;+4
  843. .start_x                dw 6    ;+6
  844. .font_size_x            dw 6    ;+8     ; 6 - for font 0, 8 - for font 1
  845. .area_size_x            dw 300  ;+10
  846. .font_number            dd 0    ;+12    ; 0 - monospace, 1 - variable
  847. .background_flag        dd 0    ;+16
  848. .font_color             dd 0x0  ;+20
  849. .background_color       dd 0x0  ;+24
  850. .text_pointer           dd fname_buf    ;+28
  851. .work_area_pointer      dd text_work_area       ;+32
  852. .temp_text_length       dd 0    ;+36
  853. ;---------------------------------------------------------------------
  854. OpenDialog_data:
  855. .type                   dd 1    ; Save
  856. .procinfo               dd procinfo     ;+4
  857. .com_area_name          dd communication_area_name      ;+8
  858. .com_area               dd 0    ;+12
  859. .opendir_pach           dd temp_dir_pach        ;+16
  860. .dir_default_pach       dd communication_area_default_pach      ;+20
  861. .start_path             dd open_dialog_path     ;+24
  862. .draw_window            dd draw_window  ;+28
  863. .status                 dd 0    ;+32
  864. .openfile_pach          dd fname_buf    ;+36
  865. .filename_area          dd filename_area        ;+40
  866. .filter_area            dd Filter
  867. .x:
  868. .x_size                 dw 420 ;+48 ; Window X size
  869. .x_start                dw 10 ;+50 ; Window X position
  870. .y:
  871. .y_size                 dw 320 ;+52 ; Window y size
  872. .y_start                dw 10 ;+54 ; Window Y position
  873.  
  874. communication_area_name:
  875.         db 'FFFFFFFF_open_dialog',0
  876. open_dialog_path:
  877.         db '/sys/File Managers/opendial',0
  878. communication_area_default_pach:
  879.         db '/sys',0
  880.  
  881. Filter:
  882. dd      Filter.end - Filter
  883. .1:
  884. db      'BMP',0
  885. .end:
  886. db      0
  887.  
  888. start_temp_file_name:   db '1.bmp',0
  889.  
  890. ;---------------------------------------------------------------------
  891. sign_n_input:
  892.         db      '2',0
  893.  
  894. PrintScreen     db  0
  895.        
  896. app_ipc ipc_buffer 32
  897. align 4
  898.  
  899. mouse_flag: dd 0x0
  900. ;---------------------------------------------------------------------
  901. align 4
  902.  
  903. ed_buffer:
  904. .1: db '/sys/1.bmp',0
  905. ;rb 287
  906. .2:
  907.         db '100',0
  908.         rb 6
  909. .3:
  910.         rb 10
  911. ;--------------------------------------------------------------------- 
  912. IM_END:
  913. ;---------------------------------------------------------------------
  914. structure_of_potock:
  915. rb 100
  916. ;---------------------------------------------------------------------
  917. align 4
  918.  
  919. cur_number        dd      ?
  920.  
  921. sign_n        db      ?
  922.  
  923. slot_n        dd ?
  924.  
  925. flags        dd ?
  926.  
  927. scr_buf:
  928. .ptr        dd      ?
  929. .end_ptr        dd      ?
  930. .size:
  931. .height        dw      ?
  932. .width        dw      ?
  933.  
  934. fs_struc:
  935. .funk_n        dd      ?
  936.         dd      ?
  937.         dd      ?
  938. .bytes_to_write  dd      ?
  939. .data_ptr        dd    ?,?
  940. .fn_ptr        dd      ?
  941.  
  942. sf_buf:
  943. .bmp_header   dd      ?
  944. .bmp_area     dd      ?
  945. .end          dd      ?
  946.  
  947. set_rect_window_pid dd ?
  948. set_rect_window_slot dd ?
  949. ;---------------------------------------------------------------------
  950. align 4
  951. rect_input_buffer:
  952. .left rb 6
  953. .top  rb 6
  954. .width  rb 6
  955. .height rb 6
  956.  
  957. cmdstr rb 257
  958. ;---------------------------------------------------------------------
  959. align 4
  960.  
  961. file_name:
  962.         rb      1058
  963.  
  964. scr screen_prop
  965. rect:
  966. .left dw ?
  967. .top dw ?
  968. .height dw ?
  969. .width dw ?
  970.  
  971. sc sys_color_table
  972. app procinfo        ; ¨­ä®à¬ æ¨ï ® £« ¢­®¬ ®ª­¥
  973. active_app procinfo ; ¨­ä®à¬ æ¨ï ®¡  ªâ¨¢­®¬ ®ª­¥
  974. set_rect_window_procinfo procinfo  ; ¨­ä®à¬ æ¨ï ®¡ ®ª­¥ ®¡« áâ¨
  975. ;---------------------------------------------------------------------
  976.         rb 512             ; á⥪ ¯®â®ª  ä®âª ­ìï
  977. shoot_esp:
  978. ;---------------------------------------------------------------------
  979.         rb 512     ; á⥪ ®ª­  ®¡« áâ¨
  980. set_rect_window_esp:
  981. ;---------------------------------------------------------------------
  982. ;        app_end    ; ª®­¥æ ¯à®£à ¬¬ë
  983. mouse_dd        rd 1
  984. ;---------------------------------------------------------------------
  985. align 4
  986. cur_dir_path:
  987.         rb 4096
  988. ;---------------------------------------------------------------------
  989. library_path:
  990.         rb 4096
  991. ;---------------------------------------------------------------------
  992. temp_dir_pach:
  993.         rb 4096
  994. ;---------------------------------------------------------------------
  995. text_work_area:
  996.         rb 1024
  997. ;---------------------------------------------------------------------
  998. fname_buf:
  999.         rb 4096
  1000. ;---------------------------------------------------------------------
  1001. procinfo:
  1002.         rb 1024
  1003. ;---------------------------------------------------------------------
  1004. filename_area:
  1005.         rb 256
  1006. ;---------------------------------------------------------------------
  1007.         rb 1024
  1008. i_end_tread:
  1009. ;---------------------------------------------------------------------
  1010.         rb 1024
  1011. stacktop:
  1012. ;---------------------------------------------------------------------
  1013. i_end: