Subversion Repositories Kolibri OS

Rev

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

  1. ;---------------------------------------------------------------------
  2. aQuestion       db '?'
  3. caption_str     db 'KPack',0
  4. buttons1names   db ' InFile:'
  5.                 db 'OutFile:'
  6.                 db '   Path:'
  7. aCompress       db 'COMPRESS',0
  8. aDecompress     db 'DECOMPRESS',0
  9. definoutname    db 0
  10. defpath         db '/RD/1/'
  11. ;curedit                dd 0
  12.  
  13. info_str        db 'KPack - Kolibri Packer, version 0.13',10
  14.                 db 'Uses LZMA v4.32 compression library',10,10
  15. info_len        = $ - info_str
  16. usage_str       db 'Written by diamond in 2006, 2007, 2009 specially for KolibriOS',10
  17.                 db 'LZMA  is copyright (c) 1999-2005 by Igor Pavlov',10
  18.                 db 10
  19.                 db 'Command-line usage:',10
  20.                 db ' kpack infile [outfile]',10
  21.                 db 'If no output file is specified,',10
  22.                 db '    packed data will be written back to input file',10
  23.                 db 10
  24.                 db 'Window usage:',10
  25.                 db " enter input file name, output file name and press needed button",10
  26. usage_len       = $ - usage_str
  27. errload_str     db 'Cannot load input file',10
  28. errload_len     = $ - errload_str
  29. outfileerr_str  db 'Cannot save output file',10
  30. outfileerr_len  = $ - outfileerr_str
  31. nomem_str       db 'No memory',10
  32. nomem_len       = $ - nomem_str
  33. too_big_str     db 'failed, output is greater than input.',10
  34. too_big_len     = $ - too_big_str
  35. compressing_str db 'Compressing ... '
  36. compressing_len = $ - compressing_str
  37. lzma_memsmall_str db    'Warning: not enough memory for default LZMA settings,',10
  38.                 db '         will use less dictionary size',10
  39. lzma_memsmall_len = $ - lzma_memsmall_str
  40. notpacked_str   db 'Input file is not packed with KPack!',10
  41. notpacked_len   = $ - notpacked_str
  42. unpacked_ok     db 'Unpacked successful',10
  43. unpacked_len    = $ - unpacked_ok
  44.  
  45. done_str        db 'OK! Compression ratio: '
  46. ratio           dw      '00'
  47.                 db '%',10
  48. done_len        = $ - done_str
  49. ;---------------------------------------------------------------------
  50. align 4
  51. LiteralNextStates:
  52. db 0,0,0,0,1,2,3,4,5,6,4,5
  53. MatchNextStates:
  54. db 7,7,7,7,7,7,7,10,10,10,10,10
  55. RepNextStates:
  56. db 8,8,8,8,8,8,8,11,11,11,11,11
  57. ShortRepNextStates:
  58. db 9,9,9,9,9,9,9,11,11,11,11,11
  59. ;---------------------------------------------------------------------
  60. align 4
  61. ProcLib_import:
  62. OpenDialog_Init         dd aOpenDialog_Init
  63. OpenDialog_Start        dd aOpenDialog_Start
  64. ;OpenDialog__Version    dd aOpenDialog_Version
  65.         dd      0
  66.         dd      0
  67. aOpenDialog_Init        db 'OpenDialog_init',0
  68. aOpenDialog_Start       db 'OpenDialog_start',0
  69. ;aOpenDialog_Version    db 'Version_OpenDialog',0
  70. ;---------------------------------------------------------------------
  71. align   4
  72. Box_lib_import:
  73. edit_box_draw           dd aEdit_box_draw
  74. edit_box_key            dd aEdit_box_key
  75. edit_box_mouse          dd aEdit_box_mouse
  76. version_ed              dd aVersion_ed
  77.  
  78. option_box_draw         dd aOption_box_draw
  79. option_box_mouse        dd aOption_box_mouse
  80. version_op              dd aVersion_op
  81.  
  82. scrollbar_ver_draw      dd aScrollbar_ver_draw
  83. scrollbar_ver_mouse     dd aScrollbar_ver_mouse
  84. scrollbar_hor_draw      dd aScrollbar_hor_draw
  85. scrollbar_hor_mouse     dd aScrollbar_hor_mouse
  86. version_scrollbar       dd aVersion_scrollbar
  87.  
  88. menu_bar_draw           dd aMenu_bar_draw
  89. menu_bar_mouse          dd aMenu_bar_mouse
  90. version_menu_bar        dd aVersion_menu_bar
  91.  
  92.         dd 0
  93.         dd 0
  94.  
  95. aEdit_box_draw          db 'edit_box',0
  96. aEdit_box_key           db 'edit_box_key',0
  97. aEdit_box_mouse         db 'edit_box_mouse',0
  98. aVersion_ed             db 'version_ed',0
  99.  
  100. aOption_box_draw        db 'option_box_draw',0
  101. aOption_box_mouse       db 'option_box_mouse',0
  102. aVersion_op             db 'version_op',0
  103.  
  104. aScrollbar_ver_draw     db 'scrollbar_v_draw',0
  105. aScrollbar_ver_mouse    db 'scrollbar_v_mouse',0
  106. aScrollbar_hor_draw     db 'scrollbar_h_draw',0
  107. aScrollbar_hor_mouse    db 'scrollbar_h_mouse',0
  108. aVersion_scrollbar      db 'version_scrollbar',0
  109.  
  110. aMenu_bar_draw          db 'menu_bar_draw',0
  111. aMenu_bar_mouse         db 'menu_bar_mouse',0
  112. aVersion_menu_bar       db 'version_menu_bar',0
  113. ;---------------------------------------------------------------------
  114. head_f_i:
  115. head_f_l        db 'System error',0
  116.  
  117. err_message_found_lib1  db 'box_lib.obj - Not found!',0
  118. err_message_found_lib2  db 'proc_lib.obj - Not found!',0
  119.  
  120. err_message_import1     db 'box_lib.obj - Wrong import!',0
  121. err_message_import2     db 'proc_lib.obj - Wrong import!',0
  122.  
  123. system_dir_Boxlib       db '/sys/lib/box_lib.obj',0
  124. system_dir_ProcLib      db '/sys/lib/proc_lib.obj',0
  125. ;---------------------------------------------------------------------
  126. align 4
  127. l_libs_start:
  128. ;       load_library    boxlib_name,cur_dir_path,buf_cmd_lin,system_path,\
  129. ;       err_message_found_lib,head_f_l,myimport,err_message_import,head_f_i
  130.  
  131. library01  l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \
  132. err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i
  133.  
  134. library02  l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \
  135. err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
  136.  
  137. load_lib_end:
  138. ;---------------------------------------------------------------------
  139. align 4
  140. OpenDialog_data:
  141. .type                   dd 0
  142. .procinfo               dd procinfo     ;+4
  143. .com_area_name          dd communication_area_name      ;+8
  144. .com_area               dd 0    ;+12
  145. .opendir_pach           dd temp_dir_pach        ;+16
  146. .dir_default_pach       dd communication_area_default_pach      ;+20
  147. .start_path             dd open_dialog_path     ;+24
  148. .draw_window            dd draw_window  ;+28
  149. .status                 dd 0    ;+32
  150. .openfile_pach          dd fname_buf    ;+36
  151. .filename_area          dd filename_area        ;+40
  152. .filter_area            dd Filter
  153. .x:
  154. .x_size                 dw 420 ;+48 ; Window X size
  155. .x_start                dw 10 ;+50 ; Window X position
  156. .y:
  157. .y_size                 dw 320 ;+52 ; Window y size
  158. .y_start                dw 10 ;+54 ; Window Y position
  159.  
  160. communication_area_name:
  161.         db 'FFFFFFFF_open_dialog',0
  162. open_dialog_path:
  163.         db '/sys/File Managers/opendial',0
  164. communication_area_default_pach:
  165.         db '/rd/1',0
  166.  
  167. path4   db '/rd/1/temp',0
  168.  
  169. Filter:
  170. dd      Filter.end - Filter.1
  171. .1:
  172. ;db     'BIN',0
  173. ;db     'DAT',0
  174. .end:
  175. db      0
  176.  
  177. start_temp_file_name:   db 'temp.bin',0
  178.  
  179. ;---------------------------------------------------------------------
  180. align 4
  181. edit1 edit_box 160, 62, 1+22, 0xffffff, 0xff, 0x80ff, 0, 0x8000, 256, inname, mouse_dd, 0, 11,11
  182. edit2 edit_box 160, 62, 17+22, 0xffffff, 0xff, 0x80ff, 0, 0x8000,256, outname, mouse_dd, 0, 7,7
  183. edit3 edit_box 160, 62, 33+22, 0xffffff, 0xff, 0x80ff, 0, 0x8000,256, path, mouse_dd, 0, 6,6
  184. editboxes_end:
  185.  
  186. mouse_dd dd 0
  187. ;---------------------------------------------------------------------