Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7786 → Rev 7829

/programs/other/kpack/trunk/const_var.inc
1,19 → 1,19
;---------------------------------------------------------------------
aQuestion db '?'
caption_str db 'KPack',0
aQuestion db '?',0
caption_str db 'KPack - Kolibri Packer',0
buttons1names db ' InFile:'
db 'OutFile:'
db ' Path:'
aCompress db 'COMPRESS',0
aDecompress db 'DECOMPRESS',0
aCompress db ' Compress',0
aDecompress db 'Decompress',0
definoutname db 0
defpath db '/rd/1',0
;curedit dd 0
 
info_str db 'KPack - Kolibri Packer, version 0.20',10
info_str db 'KPack - Kolibri Packer, version 0.21',10
db 'Uses LZMA v4.32 compression library',10,10
info_len = $ - info_str
usage_str db 'Written by diamond in 2006, 2007, 2009 specially for KolibriOS',10
usage_str db 'Written by diamond in 2006-2009 specially for KolibriOS',10
db 'Disassembled code, using Box_Lib, Proc_Lib and OpenDialog',10
db ' by Mario79, 2010',10
db 'LZMA is copyright (c) 1999-2005 by Igor Pavlov',10
22,9 → 22,8
db ' path_to_infile with zero',10
db 10
db 'Window usage:',10
db 'Select file with PATH-button and press needed button',10
db ' or enter input and output file name,',10
db ' enter path and press needed button',10
db ' Select file with PATH-button or set all data in the',10
db ' text fileds manually, then press an appropriate button',10
usage_len = $ - usage_str
already_str db 'Already packed kernel.mnt file',10
already_len = $ - already_str
79,27 → 78,11
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
 
init_checkbox dd aInit_checkbox
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
 
;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
 
;menu_bar_draw dd aMenu_bar_draw
;menu_bar_mouse dd aMenu_bar_mouse
;version_menu_bar dd aVersion_menu_bar
 
dd 0
dd 0
 
106,26 → 89,11
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
 
aInit_checkbox db 'init_checkbox2',0
aCheck_box_draw db 'check_box_draw2',0
aCheck_box_mouse db 'check_box_mouse2',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
 
;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
 
;aMenu_bar_draw db 'menu_bar_draw',0
;aMenu_bar_mouse db 'menu_bar_mouse',0
;aVersion_menu_bar db 'version_menu_bar',0
;---------------------------------------------------------------------
head_f_i:
head_f_l db 'System error',0
192,19 → 160,31
.end:
db 0
 
WIN_W = 490
WIN_H = 350
LINE_H = 25
RIGHT_BTN_W = 103
EDIT_X = 76
LOG_Y = LINE_H*3+5
LOG_H = WIN_H-LOG_Y-9
 
start_temp_file_name: db 'temp.bin',0
 
;---------------------------------------------------------------------
align 4
edit1 edit_box 160, 60, 1, 0xffffff, 0xff, 0x80ff, 0, 0x8000, 256, inname, mouse_dd, 0, 11,11
edit2 edit_box 160, 60, 17, 0xffffff, 0xff, 0x80ff, 0, 0x8000,256, outname, mouse_dd, 0, 7,7
edit3 edit_box 160, 60, 33, 0xffffff, 0xff, 0x80ff, 0, 0x8000,256, path, mouse_dd, 0, 6,6
edit1 edit_box WIN_W-EDIT_X-RIGHT_BTN_W-12, EDIT_X, 3, 0xffffff,\
0xA4C4E4, 0x80ff, 0, 0x10000000, 256, inname, mouse_dd, 0, 11,11
edit2 edit_box WIN_W-EDIT_X-RIGHT_BTN_W-12, EDIT_X, LINE_H+3, 0xffffff,\
0xA4C4E4, 0x80ff, 0, 0x10000000, 256, outname, mouse_dd, 0, 7,7
edit3 edit_box WIN_W-EDIT_X-RIGHT_BTN_W-12, EDIT_X, LINE_H*2+3, 0xffffff,\
0xA4C4E4, 0x80ff, 0, 0x10000000, 256, path, mouse_dd, 0, 6,6
editboxes_end:
 
mouse_dd dd 0
;---------------------------------------------------------------------
 
check1 check_box2 (353 shl 16)+10, (39 shl 16)+10, 4, 0x80FFFFFF, 0, 0, check_text, ch_flag_bottom
check1 check_box2 ((WIN_W - RIGHT_BTN_W - 5) shl 16)+15, ((LINE_H*2+6) shl 16)+15, 6, 0xffffff,\
0x80ff, 0x10000000, check_text,ch_flag_top
check1_end:
 
check_text db 'Kernel',0
/programs/other/kpack/trunk/data.inc
2,7 → 2,7
params:
rb 256
;---------------------------------------------------------------------
color_table system_colors
sc system_colors
 
innamelen rd 1
inname rb 256 ;48
/programs/other/kpack/trunk/kpack.asm
1,34 → 1,9
; kpack = Kolibri Packer
;---------------------------------------------------------------------
; version: 0.20
; last update: 08/18/2011
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Checking for "rolled up" window
;---------------------------------------------------------------------
; version: 0.20
; last update: 07/12/2010
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Added code for packing the kernel.mnt
;---------------------------------------------------------------------
; version: 0.15
; last update: 06/11/2010
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: 1) Window Y=4, B=1
; 2) Refresh lenght of data after Editbox editing
; 3) Changed format of start parameter -
; longer path (total length 255 + zero).
;---------------------------------------------------------------------
; version: 0.14
; last update: 03/11/2010
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: select path with OpenDialog,
; using Box_Lib and Proc_Lib
;---------------------------------------------------------------------
; Kpack - Kolibri Packer
; Kolibri version
; Written by diamond in 2006, 2007 specially for KolibriOS
;
; Disassemled and corrected in 2010 specially for FASM
; Disassemled and corrected in 2010-2011 specially for FASM
; by Marat Zakiyanov aka Mario79, aka Mario
;
; Uses LZMA compression library by Igor Pavlov
49,6 → 24,7
;---------------------------------------------------------------------
include '../../../config.inc' ;for nightbuild
include '../../../macros.inc'
include '../../../gui_patterns.inc'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../develop/libraries/box_lib/load_lib.mac'
@use_library
397,10 → 373,10
x2:
mov [message_cur_pos],edx
; update window
mcall 13,<6,414>,<54,222>,[color_table+20]
call draw_log_area
;--------------------------------------
draw_messages:
mov ebx,12 shl 16+60
mov ebx,12 shl 16 + LOG_Y + 7
mov edi,message_mem
;--------------------------------------
@@:
413,8 → 389,8
neg ecx
mov esi,ecx
pop edi
mcall 4,,[color_table+32],edi
add ebx,10
mcall 4,,0xB0000000,edi
add ebx,16
add edi,80
cmp edi,message_cur_pos
jb @b
421,23 → 397,30
 
ret
;*********************************************************************
draw_log_area:
DrawRectangle 5, LOG_Y, WIN_W-12, LOG_H, [sc.work_graph]
mcall 13, <6,WIN_W-13>, <LOG_Y+1,LOG_H-1>, 0xFFFfff
ret
;*********************************************************************
draw_window:
; start redraw
mcall 12,1
mcall 48,3,color_table,40
mcall 48,3,sc,40
;--------------------------------------
edit_boxes_set_sys_color edit1,editboxes_end,color_table
check_boxes_set_sys_color2 check1,check1_end,color_table
edit_boxes_set_sys_color edit1,editboxes_end,sc
check_boxes_set_sys_color2 check1,check1_end,sc
;--------------------------------------
; define window
xor eax,eax
mov ecx,100 shl 16+306
mov edx,[color_table.work]
mcall 48,4
 
mov ecx,100 shl 16 + WIN_H
add ecx, eax
mov edx,[sc.work]
add edx,34000000h
xor esi,esi
xor edi,edi
mcall ,<100,436>,,,,caption_str
mcall 0,<250,WIN_W+10>,,,,caption_str
mcall 9,procinfo,-1
mov eax,[procinfo+70] ;status of window
445,18 → 428,12
jne .end
;--------------------------------------
; draw lines and frame
call draw_lines
call draw_log_area
; draw buttons
call draw_buttons
; draw messages
call draw_messages
; draw editbox's
mov eax,[procinfo+42]
sub eax,65+72+10
mov [edit1.width],eax
mov [edit2.width],eax
mov [edit3.width],eax
 
call draw_editbox
; end redraw
.end:
473,6 → 450,9
push dword edit3
call [edit_box_draw]
mov eax,[sc.work_text]
or eax, 0x90000000
mov [check1.text_color], eax
push dword check1
call [check_box_draw]
ret
491,64 → 471,52
mov [edi+52], eax ;ed_pos
ret
;*********************************************************************
draw_lines:
mov ecx,2 shl 16+12*3
; draw frame for messages data
push ecx
add ecx,50 shl 16+16
mcall 38,<3,423>,,[color_table.work_graph]
add ecx,224*(1 shl 16+1)
mcall
sub cx,224
mcall ,<3,3>
mcall ,<423,423>
pop ecx
ret
;*********************************************************************
draw_buttons:
; define compress button
mov cx,18
mcall 8,<351,73>,<1, 17>,2,[color_table.work_button]
mcall 8,<WIN_W - RIGHT_BTN_W - 5, RIGHT_BTN_W>, <3, 20>,2,[sc.work_button]
; uncompress button
add ecx,18 shl 16
inc edx
add ecx,LINE_H shl 16
mcall
;add ecx,-12h+0Ch+140000h
mov ecx, 38 shl 16 + 11
; question button
push esi
mov dl,7
mcall ,<413,11>
shr ecx,16
lea ebx,[ecx+1A00002h]
mcall 4,,[color_table.work_button_text],aQuestion,1
mcall ,<WIN_W-25,18>,<LINE_H*2+3,18>
mov ecx,[sc.work_button_text]
or ecx,0x90000000
mov edx,aQuestion
mcall 4,<WIN_W-19, LINE_H*2+5>
pop esi
; define settings buttons
mov ecx,16*2+2
shl ecx,16
mov cx,13
mcall 8,<6,50>,,4
; text on settings buttons
; define Path button
mcall 8,<6,64>,<LINE_H*2+3,20>,4
; text on Path button
mov ebx,8 shl 16+5
mov al,4
mov ecx,[color_table.work_text]
mov ecx,[sc.work_text]
push buttons1names
pop edx
push 8
pop esi
;--------------------------------------
mcall
; text on settings buttons
mov ecx, [sc.work_text]
or ecx, 0x10000000
mcall , <8, 5>, , buttons1names, 8
 
add edx,esi
add ebx,16
add ebx,LINE_H
mcall
add edx,esi
add ebx,16
mov ecx,[color_table.work_button_text]
add ebx,LINE_H
mov ecx,[sc.work_button_text]
or ecx, 0x10000000
sub ebx, 10 shl 16
mcall
; text on compress and decompress buttons
or ecx,0x80000000
mcall ,<364,6>,,aCompress
mcall ,<359,24>,,aDecompress
mcall ,<WIN_W - RIGHT_BTN_W+7,6>,,aCompress
mcall ,<WIN_W - RIGHT_BTN_W+7,LINE_H+6>,,aDecompress
ret
;*********************************************************************
;Pack procedures