Subversion Repositories Kolibri OS

Rev

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

  1. files_information:
  2.         xor     eax,eax
  3.         mov     [alt_flag],al
  4.         mov     [files_counter],eax
  5.         mov     [directories_counter],eax
  6.         mov     [files_size.low],eax
  7.         mov     [files_size.high],eax
  8.         call    get_files_information
  9.         call    start_files_information_thread
  10.         jmp     still
  11. ;------------------------------------------------------------------------------
  12. start_files_information_thread:
  13.         mcall   9,procinfo,-1
  14.         mov     eax,[ebx+46]
  15.         shr     eax,1
  16.         add     eax,[ebx+38]
  17.         sub     eax,150
  18.         mov     [files_information_window_y+2],ax
  19.         mov     eax,[ebx+42]
  20.         shr     eax,1
  21.         add     eax,[ebx+34]
  22.         sub     eax,125
  23.         mov     [files_information_window_x+2],ax
  24.         mcall   51,1,thread_files_information_start,thread_stack
  25.         ret
  26. ;------------------------------------------------------------------------------
  27. draw_files_information_window:
  28.         mcall   12,1
  29.         mcall   0,[files_information_window_x],[files_information_window_y],0x03ffffcc
  30.         mov     edx,100 shl 16+50
  31.         mov     ebx,0x800a0000
  32.         mov     esi,0x10000000
  33.         cmp     [inf_marked_yes],1
  34.         je      .continue_4
  35.  
  36.         cmp     [nesting_direction],1
  37.         je      @f
  38.  
  39.         add     edx,15
  40. ;--------------------------------------
  41. .continue_4:
  42. ; show files counter
  43.         mcall   47,,[files_counter]
  44. ;--------------------------------------
  45. @@:
  46.         cmp     [inf_marked_yes],1
  47.         je      .continue_2
  48.  
  49.         cmp     [nesting_direction],0
  50.         je      .continue_2
  51.  
  52.         cmp     [directories_counter],0
  53.         je      @f
  54. ;--------------------------------------
  55. .continue_2:
  56. ; show directories counter
  57.         add     edx,15
  58.         mcall   ,,[directories_counter]
  59. ;--------------------------------------
  60. @@:
  61. ; show file or directory size
  62.         add     edx,15
  63.         mcall   47,0x80140001,files_size
  64. ;--------------------------------------
  65.         mov     ebp,date.create
  66.         call    show_date_and_time_of_files_information
  67. ;--------------------------------------
  68.         mov     ebp,date.change
  69.         call    show_date_and_time_of_files_information
  70. ;--------------------------------------
  71.         mov     ebp,date.access
  72.         call    show_date_and_time_of_files_information
  73. ;--------------------------------------
  74.         cmp     [select_panel_counter],0
  75.         jne     .right_1
  76.  
  77.         mov     edx,read_folder_name
  78.         jmp     @f
  79. ;--------------------------------------
  80. .right_1:
  81.         mov     edx,read_folder_1_name
  82. ;--------------------------------------
  83. @@:
  84.         mcall   4,<75,35>,0x80000000,   ;file_name
  85.         mcall   ,<10,35>,0x90000000,type_location
  86.         cmp     [inf_marked_yes],1
  87.         je      .continue
  88.  
  89.         mcall   ,<90,50>,0x80000000,type_name
  90.         mov     ecx,0x90000000
  91.         cmp     [nesting_direction],1
  92.         je      @f
  93.  
  94.         mcall   ,<10,50>,,type_dir_name
  95.         jmp     .continue
  96. ;--------------------------------------
  97. @@:
  98.         mcall   ,<10,50>,,type_file_name
  99. ;--------------------------------------
  100. .continue:
  101.         cmp     [inf_marked_yes],1
  102.         je      .continue_3
  103.  
  104.         cmp     [nesting_direction],1
  105.         je      @f
  106. ;--------------------------------------
  107. .continue_3:
  108.         add     ebx,15
  109.         mcall   ,,,type_files
  110. ;--------------------------------------
  111. @@:
  112.         cmp     [inf_marked_yes],1
  113.         je      .continue_1
  114.  
  115.         cmp     [nesting_direction],0
  116.         je      .continue_1
  117.  
  118.         cmp     [directories_counter],0
  119.         je      @f
  120. ;--------------------------------------
  121. .continue_1:
  122.         add     ebx,15
  123.         mcall   ,,,type_dir
  124. ;--------------------------------------
  125. @@:
  126.         add     ebx,15
  127.         mcall   ,,,type_size
  128.         add     ebx,15
  129.         mcall   ,,,type_create
  130.         add     ebx,15
  131.         mcall   ,,,type_change
  132.         add     ebx,15
  133.         mcall   ,,,type_access
  134.         sub     ebx,30
  135.         add     ebx,107 shl 16
  136.         mcall   ,,0x80000000,type_limiters_data_time
  137.         add     ebx,15
  138.         mcall
  139.         add     ebx,15
  140.         mcall
  141.  
  142.         mcall   12,2
  143.         ret
  144. ;------------------------------------------------------------------------------
  145. show_date_and_time_of_files_information:
  146. ; show date
  147.         add     edx,15
  148.         push    edx
  149.         movzx   ecx,byte [ebp+0]
  150.         mcall   ,0x00020000
  151.         add     edx,24 shl 16
  152.         movzx   ecx,byte [ebp+1]
  153.         mcall
  154.         add     edx,23 shl 16
  155.         movzx   ecx,word [ebp+2]
  156.         mcall   ,0x00040000
  157.         sub     ebp,12
  158. ; show time
  159.         add     edx,37 shl 16
  160.         movzx   ecx,byte [ebp+2]
  161.         mcall   ,0x00020000
  162.         add     edx,24 shl 16
  163.         movzx   ecx,byte [ebp+1]
  164.         mcall
  165.         add     edx,23 shl 16
  166.         movzx   ecx,byte [ebp+0]
  167.         mcall
  168.         pop     edx
  169.         ret
  170. ;------------------------------------------------------------------------------
  171. thread_files_information_start:
  172. .red:
  173.         call    draw_files_information_window
  174. ;--------------------------------------
  175. .still:
  176.         mcall   10
  177.         cmp     eax,1
  178.         je      .red
  179.  
  180.         cmp     eax,2
  181.         je      .key
  182.  
  183.         cmp     eax,3
  184.         je      .button
  185.  
  186.         jmp     .still
  187. ;--------------------------------------
  188. .key:
  189.         mcall   2
  190. ;--------------------------------------
  191. .button:
  192.         mcall   -1
  193.         jmp     .still
  194. ;------------------------------------------------------------------------------
  195. ; äåëåíèå 64-áèòíîãî ÷èñëà divident íà 16-áèòíîå ÷èñëî divisor.
  196. ; ×àñòíîå ïîìåùàåòñÿ â 64-áèòíóþ ïåðåìåííóþ quotent,
  197. ; à îñòàòîê - â 16-áèòíóþ ïåðåìåííóþ modulo
  198. Division_64bit:
  199.         mov     ax,[ebp+6]
  200.         xor     dx,dx
  201.         mov     bx,[divisor]
  202.         div     bx
  203.         mov     [quotent+6],ax
  204.         mov     ax,[ebp+4]
  205.         div     bx
  206.         mov     [quotent+4],ax
  207.         mov     ax,[ebp+2]
  208.         div     bx
  209.         mov     [quotent+2],ax
  210.         mov     ax,[ebp]
  211.         div     bx
  212.         mov     [quotent],ax
  213. ;       mov     [modulo],dx
  214.         ret
  215. ;--------------------------------------      
  216. ;divident:
  217. ;      rb 8
  218. divisor:
  219.       rb 2
  220. quotent:
  221.       rb 8
  222. ;modulo:
  223. ;      rb 2
  224. ;------------------------------------------------------------------------------
  225. copy_type_name:
  226.         push    esi
  227.         mov     esi,ebx
  228.         mov     edi,type_name
  229.         cld
  230. ;--------------------------------------
  231. @@:
  232.         lodsb
  233.         stosb
  234.         test    al,al
  235.         jnz     @b
  236.  
  237.         pop     esi
  238.         ret
  239. ;------------------------------------------------------------------------------
  240. get_files_information:
  241.         call    get_information_marked_files
  242.         cmp     [inf_marked_yes],1
  243.         je      .end_2
  244.  
  245.         xor     eax,eax
  246.         xor     edx,edx
  247.         cmp     [select_panel_counter],0
  248.         jne     .right_1
  249.  
  250.         mov     ax,[left_start_draw_cursor_line]
  251.         mov     ebx,10
  252.         div     ebx
  253.         mov     ebx,[left_start_draw_line]
  254.         add     ebx,eax
  255.         imul    ebx,304
  256.         add     ebx,[left_folder_data]
  257.         call    prepare_data_8
  258.         mov     esi,read_folder_name
  259.         jmp     .end
  260. ;--------------------------------------
  261. .right_1:
  262.         mov     ax,[right_start_draw_cursor_line]
  263.         mov     ebx,10
  264.         div     ebx
  265.         mov     ebx,[right_start_draw_line]
  266.         add     ebx,eax
  267.         imul    ebx,304
  268.         add     ebx,[right_folder_data]
  269.         call    prepare_data_8
  270.         mov     esi,read_folder_1_name
  271. ;--------------------------------------
  272. .end:
  273.         mov     [error_pointer],ebx
  274. ;--------------------------------------
  275.         push    eax ebx
  276.         sub     ebx,40
  277. ; âðåìÿ ñîçäàíèÿ ôàéëà
  278.         mov     eax,[ebx+8]
  279.         mov     [time.create],eax
  280. ; äàòà ñîçäàíèÿ ôàéëà
  281.         mov     eax,[ebx+12]
  282.         mov     [date.create],eax  
  283. ; âðåìÿ ïîñëåäíåãî äîñòóïà (÷òåíèå èëè çàïèñü)
  284.         mov     eax,[ebx+16]
  285.         mov     [time.access],eax
  286. ; äàòà ïîñëåäíåãî äîñòóïà
  287.         mov     eax,[ebx+20]
  288.         mov     [date.access],eax    
  289. ; âðåìÿ ïîñëåäíåé ìîäèôèêàöèè
  290.         mov     eax,[ebx+24]
  291.         mov     [time.change],eax
  292. ; äàòà ïîñëåäíåé ìîäèôèêàöèè
  293.         mov     eax,[ebx+28]
  294.         mov     [date.change],eax
  295.         pop     ebx eax
  296. ;--------------------------------------
  297.         call    copy_type_name
  298.         mov     edi,file_name
  299.         call    copy_path_1
  300.  
  301.         test    [ebx-40],byte 0x10
  302.         jz      @f
  303.  
  304.         push    eax ebx
  305.         call    get_inf_dir
  306.         mov     [nesting_direction],0
  307.         pop     ebx eax
  308.         dec     [directories_counter]
  309.         jmp     .end_2
  310. ;--------------------------------------
  311. @@:
  312.         mov     [nesting_direction],1
  313.         call    get_file_size
  314.         test    eax,eax
  315.         jz      .end_1
  316.  
  317.         call    start_error_window_thread
  318.         add     esp,4
  319.         jmp     reload_dir_all
  320. ;--------------------------------------
  321. .end_1:
  322.         mov     eax,[file_features_temp_area+32]
  323.         add     [files_size.low],eax
  324.         mov     eax,[file_features_temp_area+32+4]
  325.         adc     [files_size.high],eax
  326. ;--------------------------------------
  327. .end_2:
  328.         ret
  329. ;------------------------------------------------------------------------------
  330. get_information_marked_files:
  331.         xor     eax,eax
  332.         mov     [inf_marked_yes],al
  333.         cmp     [select_panel_counter],al
  334.         jne     .right_1
  335.  
  336.         mov     ebp,[left_folder_block]
  337. ;--------------------------------------
  338. .start:
  339.         mov     ebx,ebp
  340.         dec     ebx
  341.         imul    ebx,304
  342.         add     ebx,[left_folder_data]
  343.         add     ebx,32+40
  344.         cmp     [ebx+299-40],byte 0
  345.         je      @f
  346.  
  347.         cmp     [ebx],word '..'
  348.         jne     .continue
  349.  
  350.         cmp     [ebx+2],byte 0
  351.         je      .continue_1
  352. ;--------------------------------------
  353. .continue:
  354.         mov     esi,read_folder_name
  355.         call    prepare_data_9
  356. ;--------------------------------------
  357. .continue_1:
  358.         mov     [inf_marked_yes],1
  359. ;--------------------------------------
  360. @@:
  361.         dec     ebp
  362.         jnz     .start
  363.  
  364.         ret
  365. ;--------------------------------------
  366. .right_1:
  367.         mov     ebp,[right_folder_block]
  368. ;--------------------------------------
  369. .start_1:
  370.         mov     ebx,ebp
  371.         dec     ebx
  372.         imul    ebx,304
  373.         add     ebx,[right_folder_data]
  374.         add     ebx,32+40
  375.         cmp     [ebx+299-40],byte 0
  376.         je      @f
  377.  
  378.         cmp     [ebx],word '..'
  379.         jne     .continue_2
  380.  
  381.         cmp     [ebx+2],byte 0
  382.         je      .continue_3
  383. ;--------------------------------------
  384. .continue_2:
  385.         mov     esi,read_folder_1_name
  386.         call    prepare_data_9
  387. ;--------------------------------------
  388. .continue_3:
  389.         mov     [inf_marked_yes],1
  390. ;--------------------------------------
  391. @@:
  392.         dec     ebp
  393.         jnz     .start_1
  394.  
  395.         ret
  396. ;------------------------------------------------------------------------------
  397. prepare_data_9:
  398.         mov     [error_pointer],ebx
  399.         mov     edi,file_name
  400.         call    copy_path_1
  401.         test    [ebx-40],byte 0x10
  402.         jz      @f
  403.  
  404.         call    get_inf_dir
  405.         ret
  406. ;--------------------------------------
  407. @@:
  408.         inc     [files_counter]
  409.         call    get_file_size
  410.         test    eax,eax
  411.         jz      .continue
  412.  
  413.         call    start_error_window_thread
  414.         add     esp,8+4
  415.         ret
  416. ;--------------------------------------
  417. .continue:
  418.         mov     eax,[file_features_temp_area+32]
  419.         add     [files_size.low],eax
  420.         mov     eax,[file_features_temp_area+32+4]
  421.         adc     [files_size.high],eax
  422. ;--------------------------------------
  423. .continue_1:
  424.         ret
  425. ;------------------------------------------------------------------------------
  426. prepare_data_8:
  427.         add     ebx,32+40
  428.         cmp     [ebx],word '..'
  429.         jne     .continue
  430.  
  431.         cmp     [ebx+2],byte 0
  432.         jne     .continue
  433.  
  434.         add     esp,4+4
  435.         jmp     reload_dir
  436. ;--------------------------------------
  437. .continue:
  438.         ret
  439. ;------------------------------------------------------------------------------
  440. get_inf_dir:
  441.         mov     [nesting_direction],0
  442.         pusha
  443.         mov     [recursive_pointer],0
  444.         mov     eax,[appl_memory]
  445.         mov     [appl_memory_old],eax
  446. ;--------------------------------------
  447. .1:
  448.         mov     [read_delete_dir_data.size],0
  449.         mov     [read_delete_dir_data.return],delete_dir_data
  450.         call    read_delete_dir
  451.         test    eax,eax
  452.         jz      @f
  453.  
  454.         mov     [error_pointer],file_name
  455.         call    start_error_window_thread
  456.         popa
  457.         add     esp,8+8
  458.         ret
  459. ;--------------------------------------
  460. @@:
  461.         mov     eax,[delete_dir_data+8]
  462.         imul    eax,304
  463.         add     eax,32
  464.         mov     ebx,eax
  465.         add     ebx,[appl_memory_old]
  466.         cmp     ebx,[appl_memory]
  467.         jbe     @f
  468.  
  469.         mov     ecx,[appl_memory]
  470.         mov     ecx,ebx
  471.         mov     [appl_memory],ecx
  472.         mcall   64,1
  473. ;--------------------------------------
  474. @@:
  475.         mov     eax,[delete_dir_data+8]
  476.         mov     [read_delete_dir_data.size],eax
  477.         mov     eax,[appl_memory_old]
  478.         mov     [read_delete_dir_data.return],eax
  479.         call    read_delete_dir
  480.         test    eax,eax
  481.         jz      @f
  482.  
  483.         mov     [error_pointer],file_name
  484.         call    start_error_window_thread
  485.         popa
  486.         add     esp,8+8
  487.         ret
  488. ;--------------------------------------
  489. @@:
  490.         cmp     [nesting_direction],0
  491.         je      @f
  492.  
  493.         call    get_inf_dir_2
  494.         jnc     .end
  495.  
  496.         dec     ebp
  497.         push    ebp
  498.         jmp     .1
  499. ;--------------------------------------
  500. @@:
  501.         call    get_inf_dir_1
  502.         jnc     .end
  503.         dec     ebp
  504.         push    ebp
  505.         jmp     .1
  506. ;--------------------------------------
  507. .end:
  508.         call    return_delete_path
  509.         dec     [recursive_pointer]
  510.         cmp     [recursive_pointer],0
  511.         jge     .1
  512.  
  513.         mov     ecx,[appl_memory_old]
  514.         cmp     [appl_memory],ecx
  515.         je      @f
  516.  
  517.         mov     [appl_memory],ecx
  518.         mcall   64,1
  519. ;--------------------------------------
  520. @@:
  521.         popa
  522.         ret
  523. ;------------------------------------------------------------------------------
  524. get_inf_dir_2:
  525.         pop     eax
  526.         pop     ebp
  527.         push    eax
  528.         jmp     get_inf_dir_1.start
  529. ;--------------------------------------
  530. get_inf_dir_1:
  531.         inc     [directories_counter]
  532.         mov     ebp,[appl_memory_old]
  533.         mov     ebp,[ebp+8]
  534. ;--------------------------------------
  535. .start:
  536.         mov     ebx,ebp
  537.         dec     ebx
  538.         imul    ebx,304
  539.         add     ebx,[appl_memory_old]
  540.         add     ebx,32+40
  541.         cmp     [ebx],byte '.'
  542.         jne     @f
  543.  
  544.         cmp     [ebx+1],byte 0
  545.         je      .continue_4
  546. ;--------------------------------------
  547. @@:
  548.         cmp     [ebx],word '..'
  549.         jne     .continue
  550.  
  551.         cmp     [ebx+2],byte 0
  552.         je      .continue_4
  553. ;--------------------------------------
  554. .continue:
  555.         mov     esi,file_name
  556.         inc     [recursive_pointer]
  557.         call    copy_path_2
  558.         test    [ebx-40],byte 0x10
  559.         jnz     .continue_3
  560. ;--------------------------------------
  561. @@:
  562.         inc     [files_counter]
  563. ;--------------------------------------
  564. .continue_1:
  565.         mov     eax,[ebx+32-40]
  566.         add     [files_size.low],eax
  567.         mov     eax,[ebx+32+4-40]
  568.         adc     [files_size.high],eax
  569.         dec     [recursive_pointer]
  570.         call    return_delete_path
  571.         dec     ebp
  572.         jnz     .start
  573. ;--------------------------------------
  574. .continue_4:
  575.         clc
  576.         mov     [nesting_direction],1
  577.         ret
  578. ;--------------------------------------
  579. .continue_3:
  580.         stc
  581.         mov     [nesting_direction],0
  582.         ret
  583. ;------------------------------------------------------------------------------
  584. ;type_patch_test:
  585. ;       pusha
  586. ;       mcall   5,200
  587. ;       mcall   13,<290,300>,<3,13>,0x0
  588. ;       mcall   4,<300,5>,0x80FFFFFF,file_name  ;[error_pointer]
  589. ;       mcall   47,0x160100,[recursive_pointer],<300,5>,0xffffff
  590. ;       mcall   47,0x160100,ebp,<300,5>,0xffffff
  591. ;       mcall   5,1
  592. ;       popa
  593. ;       ret
  594. ;temp_value_1   db '1',0
  595. ;temp_value_2   db '2',0
  596. ;temp_value_3   db '3',0
  597. ;temp_value_4   db '4',0
  598. ;temp_value_5   db '5',0
  599. ;------------------------------------------------------------------------------