/programs/system/desktop/trunk/desktop.asm |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/system/desktop/trunk/Tupfile.lua |
---|
File deleted |
/programs/system/desktop/trunk/build_en.sh |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/system/desktop/trunk/idata.inc |
---|
File deleted |
/programs/system/desktop/trunk/drawskin.inc |
---|
File deleted |
/programs/system/desktop/trunk/build_et.bat |
---|
File deleted |
\ No newline at end of file |
/programs/system/desktop/trunk/build_et.sh |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/system/desktop/trunk/build_it.bat |
---|
File deleted |
\ No newline at end of file |
/programs/system/desktop/trunk/udata.inc |
---|
File deleted |
\ No newline at end of file |
/programs/system/desktop/trunk/build_sp.bat |
---|
File deleted |
\ No newline at end of file |
/programs/system/desktop/trunk/kglobals.inc |
---|
File deleted |
/programs/system/desktop/trunk/build_sp.sh |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/system/desktop/trunk/build_ru.bat |
---|
File deleted |
\ No newline at end of file |
/programs/system/desktop/trunk/makefile |
---|
File deleted |
/programs/system/desktop/trunk/build_ru.sh |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programs/system/desktop/trunk/unpacker.inc |
---|
File deleted |
/programs/system/desktop/trunk/build_en.bat |
---|
File deleted |
\ No newline at end of file |
/programs/system/icon_new/icon.ini |
---|
1,6 → 1,6 |
[rbmenu] |
¨á¯¥âç¥à ¯à®æ¥áᮢ=cpu |
¯à ¢«¥¨¥ ⥬®©=desktop |
¯à ¢«¥¨¥ ⥬®©=skincfg |
áâனª ä® =/sys/media/palitra |
áâனª ãáâனáâ¢=setup |
®á®«ì=/rd/1/shell |
/programs/system/skincfg/trunk/Tupfile.lua |
---|
0,0 → 1,3 |
if tup.getconfig("NO_FASM") ~= "" then return end |
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en" or tup.getconfig("LANG")) .. " > lang.inc", {"lang.inc"}) |
tup.rule({"skincfg.asm", extra_inputs = {"lang.inc"}}, "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "skincfg") |
/programs/system/skincfg/trunk/build_en.bat |
---|
0,0 → 1,6 |
@erase lang.inc |
@echo lang fix en >lang.inc |
@fasm skincfg.asm skincfg |
@kpack skincfg |
@erase lang.inc |
@pause |
/programs/system/skincfg/trunk/build_en.sh |
---|
0,0 → 1,13 |
#!/bin/bash |
# This script does for linux the same as build.bat for DOS, |
# it compiles the KoOS kernel, hopefully ;-) |
echo "lang fix en" |
echo "lang fix en" > lang.inc |
fasm -m 16384 skincfg.asm skincfg |
rm -f lang.inc |
exit 0 |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programs/system/skincfg/trunk/build_et.bat |
---|
0,0 → 1,6 |
@erase lang.inc |
@echo lang fix et >lang.inc |
@fasm skincfg.asm skincfg |
@kpack skincfg |
@erase lang.inc |
@pause |
/programs/system/skincfg/trunk/build_et.sh |
---|
0,0 → 1,13 |
#!/bin/bash |
# This script does for linux the same as build.bat for DOS, |
# it compiles the KoOS kernel, hopefully ;-) |
echo "lang fix et" |
echo "lang fix et" > lang.inc |
fasm -m 16384 skincfg.asm skincfg |
rm -f lang.inc |
exit 0 |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programs/system/skincfg/trunk/build_it.bat |
---|
0,0 → 1,6 |
@erase lang.inc |
@echo lang fix it >lang.inc |
@fasm skincfg.asm skincfg |
@kpack skincfg |
@erase lang.inc |
@pause |
/programs/system/skincfg/trunk/build_ru.bat |
---|
0,0 → 1,6 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm skincfg.asm skincfg |
@kpack skincfg |
@erase lang.inc |
@pause |
/programs/system/skincfg/trunk/build_ru.sh |
---|
0,0 → 1,13 |
#!/bin/bash |
# This script does for linux the same as build.bat for DOS, |
# it compiles the KoOS kernel, hopefully ;-) |
echo "lang fix ru" |
echo "lang fix ru" > lang.inc |
fasm -m 16384 skincfg.asm skincfg |
rm -f lang.inc |
exit 0 |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programs/system/skincfg/trunk/build_sp.bat |
---|
0,0 → 1,6 |
@erase lang.inc |
@echo lang fix sp >lang.inc |
@fasm skincfg.asm skincfg |
@kpack skincfg |
@erase lang.inc |
@pause |
/programs/system/skincfg/trunk/build_sp.sh |
---|
0,0 → 1,13 |
#!/bin/bash |
# This script does for linux the same as build.bat for DOS, |
# it compiles the KoOS kernel, hopefully ;-) |
echo "lang fix sp" |
echo "lang fix sp" > lang.inc |
fasm -m 16384 skincfg.asm skincfg |
rm -f lang.inc |
exit 0 |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programs/system/skincfg/trunk/makefile |
---|
0,0 → 1,28 |
#!gmake |
# Macro |
FASM=/opt/bin/fasm |
KPACK=/opt/bin/kpack |
LANG=lang.inc |
FILE=skincfg |
SOURCE=${FILE}.asm |
OUT=${FILE}.bin |
en: |
echo "lang fix en" > ${LANG} |
${FASM} ${SOURCE} ${OUT} |
et: |
echo "lang fix et" > ${LANG} |
${FASM} ${SOURCE} ${OUT} |
ru: |
echo "lang fix ru" > ${LANG} |
${FASM} ${SOURCE} ${OUT} |
sp: |
echo "lang fix sp" > ${LANG} |
${FASM} ${SOURCE} ${OUT} |
it: |
echo "lang fix it" > ${LANG} |
${FASM} ${SOURCE} ${OUT} |
clean: |
rm -f ${LANG} ${OUT} |
/programs/system/skincfg/trunk/skincfg.asm |
---|
0,0 → 1,584 |
; |
; UNIFORM WINDOW COLOURS & SKIN |
; |
; Compile with FASM for Menuet |
; |
; < russian edition by Ivan Poddubny > |
; < skin selection by Mike Semenyako > |
;****************************************************************************** |
; last update: 01/04/2013 |
; written by: Marat Zakiyanov aka Mario79, aka Mario |
; changes: select colors with ColorDialog |
; some redesign of the look of the program |
;****************************************************************************** |
; last update: 10/09/2010 |
; written by: Marat Zakiyanov aka Mario79, aka Mario |
; changes: select path with OpenDialog |
;****************************************************************************** |
use32 |
org 0 |
db 'MENUET01' ; identifier |
dd 1 ; header version |
dd START ; start address |
dd IM_END ; file size |
dd I_END ; memory |
dd stacktop ; stack pointer |
dd skin_info ; parameters |
dd cur_dir_path ; path to file |
include 'lang.inc' |
include '../../../config.inc' ;for nightbuild |
include '../../../macros.inc' |
include 'kglobals.inc' |
include 'unpacker.inc' |
include '../../../develop/libraries/box_lib/load_lib.mac' |
@use_library |
;****************************************************************************** |
;-------------------------------------- |
struct SKIN_HEADER |
ident dd ? |
version dd ? |
params dd ? |
buttons dd ? |
bitmaps dd ? |
ends |
;-------------------------------------- |
struct SKIN_PARAMS |
skin_height dd ? |
margin.right dw ? |
margin.left dw ? |
margin.bottom dw ? |
margin.top dw ? |
colors.inner dd ? |
colors.outer dd ? |
colors.frame dd ? |
colors_1.inner dd ? |
colors_1.outer dd ? |
colors_1.frame dd ? |
dtp.size dd ? |
dtp.data db 40 dup (?) |
ends |
;-------------------------------------- |
struct SKIN_BUTTONS |
type dd ? |
pos: |
left dw ? |
top dw ? |
size: |
width dw ? |
height dw ? |
ends |
;-------------------------------------- |
struct SKIN_BITMAPS |
kind dw ? |
type dw ? |
_data dd ? |
ends |
;-------------------------------------- |
frame_1: |
.x = 5 |
.y = 220 |
.width = 420 |
.height = 50 |
;-------------------------------------- |
frame_2: |
.x = 5 |
.y = 280 |
.width = 420 |
.height = 50 |
;--------------------------------------------------------------------- |
START: ; start of execution |
;--------------------------------------------------------------------- |
mcall 68,11 |
test eax,eax |
jz close |
load_libraries l_libs_start,end_l_libs |
;if return code =-1 then exit, else nornary work |
inc eax |
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 |
mov esi,default_dtp |
xor eax,eax |
cld |
@@: |
lodsb |
stosb |
test eax,eax |
jnz @b |
;--------------------------------------------------------------------- |
mov edi,skin_info |
cmp byte [edi], 0 |
jne skin_path_ready |
mov esi,default_skin |
xor eax,eax |
cld |
@@: |
lodsb |
stosb |
test eax,eax |
jnz @b |
skin_path_ready: |
;--------------------------------------------------------------------- |
;OpenDialog initialisation |
push dword OpenDialog_data |
call [OpenDialog_Init] |
push dword OpenDialog_data2 |
call [OpenDialog_Init] |
;-------------------------------------------------------------------- |
;init_ColorDialog ColorDialog_data |
push dword ColorDialog_data |
call [ColorDialog_Init] |
;-------------------------------------------------------------------- |
; prepare for PathShow |
push dword PathShow_data_1 |
call [PathShow_prepare] |
push dword PathShow_data_2 |
call [PathShow_prepare] |
;--------------------------------------------------------------------- |
mcall 48,3,color_table,4*10 ; get current colors |
call load_skin_file.2 |
;--------------------------------------------------------------------- |
red: |
call draw_window ; at first, draw the window |
;--------------------------------------------------------------------- |
still: |
mcall 10 ; wait here for event |
dec eax ; redraw request ? |
jz red |
dec eax ; key in buffer ? |
jz key |
dec eax ; button in buffer ? |
jz button |
jmp still |
;--------------------------------------------------------------------- |
key: ; key |
mcall 2 ; just read it and ignore |
jmp still |
;--------------------------------------------------------------------- |
button: ; button |
mcall 17 ; get id |
cmp ah,12 ; load file |
jne no_load |
call load_file |
call draw_window |
jmp still |
;-------------------------------------- |
no_load: |
cmp ah,13 ; save file |
jne no_save |
call save_file |
jmp still |
;-------------------------------------- |
no_save: |
cmp ah,14 ; set 3d buttons |
jne no_3d |
mcall 48,1,1 |
jmp doapply |
;-------------------------------------- |
no_3d: |
cmp ah,15 ; set flat buttons |
jne no_flat |
mcall 48, 1, 0 |
;-------------------------------------- |
doapply: |
mcall 48, 0, 0 |
jmp still |
;-------------------------------------- |
no_flat: |
cmp ah,16 ; apply |
jne no_apply |
;-------------------------------------- |
apply_direct: |
mcall 48,2,color_table,10*4 |
jmp doapply |
;-------------------------------------- |
no_apply: |
cmp ah,17 ; load skin file |
jne no_load_skin |
call load_skin_file |
call draw_window |
jmp still |
;-------------------------------------- |
no_load_skin: |
cmp ah,18 ; apply skin |
jne no_apply_skin |
cmp [skin_info],0 |
je no_apply_skin |
mcall 48,8,skin_info |
call draw_window |
jmp still |
;-------------------------------------- |
no_apply_skin: |
cmp ah,31 |
jb no_new_colour |
cmp ah,41 |
jg no_new_colour |
;--------------------------------------------------------------------- |
.start_ColorDialog: |
push dword ColorDialog_data |
call [ColorDialog_Start] |
; 2 - use another method/not found program |
cmp [ColorDialog_data.status],2 |
je still |
; 1 - OK, color selected |
cmp [ColorDialog_data.status],1 |
jne still |
;--------------------------------------------------------------------- |
shr eax,8 |
sub eax,31 |
shl eax,2 |
mov ebx,[ColorDialog_data.color] |
and ebx,0xffffff ; temporary for ColorDialog!!!!!!!!!! |
mov [eax+color_table],ebx |
cmp dword[not_packed_area+SKIN_HEADER.ident],'SKIN' |
jne @f |
mov edi,[not_packed_area+SKIN_HEADER.params] |
mov dword[edi+not_packed_area+SKIN_PARAMS.dtp.data+eax],ebx |
call draw_skin |
;-------------------------------------- |
@@: |
call draw_colours |
jmp still |
;-------------------------------------- |
no_new_colour: |
cmp ah,1 ; terminate |
jnz noid1 |
;-------------------------------------- |
close: |
or eax,-1 |
mcall |
;-------------------------------------- |
noid1: |
jmp still |
;--------------------------------------------------------------------- |
load_file: |
;--------------------------------------------------------------------- |
; invoke OpenDialog |
mov [OpenDialog_data.type],dword 0 |
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 |
;--------------------------------------------------------------------- |
xor eax, eax |
mov ebx, read_info |
mov dword [ebx], eax ; subfunction: read |
mov dword [ebx+4], eax ; offset (low dword) |
mov dword [ebx+8], eax ; offset (high dword) |
mov dword [ebx+12], 40 ; read colors file: 4*10 bytes |
mov dword [ebx+16], color_table ; address |
mcall 70 |
ret |
;--------------------------------------------------------------------- |
load_skin_file: |
;--------------------------------------------------------------------- |
; invoke OpenDialog |
push dword OpenDialog_data2 |
call [OpenDialog_Start] |
cmp [OpenDialog_data2.status],1 |
je .1 |
ret |
.1: |
; prepare for PathShow |
push dword PathShow_data_2 |
call [PathShow_prepare] |
call draw_PathShow |
;--------------------------------------------------------------------- |
.2: |
xor eax,eax |
mov ebx,read_info2 |
mov dword [ebx], eax ; subfunction: read |
mov dword [ebx+4], eax ; offset (low dword) |
mov dword [ebx+8], eax ; offset (high dword) |
mov dword [ebx+12], 32*1024 ; read: max 32 KBytes |
mov dword [ebx+16], file_load_area ; address |
mcall 70 |
mov esi, file_load_area |
cmp dword [esi], 'KPCK' |
jnz notpacked |
cmp dword [esi+4], 32*1024 ; max 32 KBytes |
ja doret |
push unpack_area |
push esi |
call unpack |
mov esi,unpack_area |
;-------------------------------------- |
notpacked: |
cmp [esi+SKIN_HEADER.ident],dword 'SKIN' |
jne doret |
mov edi,not_packed_area |
mov ecx,0x8000/4 |
rep movsd |
mov ebp,not_packed_area |
mov esi,[ebp+SKIN_HEADER.params] |
add esi,ebp |
lea esi,[esi+SKIN_PARAMS.dtp.data] |
mov edi,color_table |
mov ecx,10 |
rep movsd |
;-------------------------------------- |
doret: |
ret |
;--------------------------------------------------------------------- |
save_file: |
;--------------------------------------------------------------------- |
; invoke OpenDialog |
mov [OpenDialog_data.type],dword 1 |
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 |
;--------------------------------------------------------------------- |
xor eax,eax |
mov ebx,write_info |
mov [ebx],dword 2 ; subfunction: write |
and [ebx+4],eax ; (reserved) |
and [ebx+8],eax ; (reserved) |
mov [ebx+12],dword 10*4 ; bytes to write |
mov [ebx+16],dword color_table ; address |
mcall 70 |
ret |
;--------------------------------------------------------------------- |
draw_button_row: |
mov edx,0x60000000 + 31 ; BUTTON ROW |
mov ebx,220*65536+14 |
mov ecx,10*65536+14 |
mov eax,8 |
;----------------------------------- |
.newb: |
mcall |
add ecx,20*65536 |
inc edx |
cmp edx,0x60000000 + 40 |
jbe .newb |
ret |
;--------------------------------------------------------------------- |
draw_button_row_of_texts: |
mov ebx,240*65536+13 ; ROW OF TEXTS |
mov ecx,[w_work_text] |
mov edx,text |
mov esi,32 |
mov eax,4 |
;----------------------------------- |
.newline: |
mcall |
add ebx,20 |
add edx,32 |
cmp [edx],byte 'x' |
jne .newline |
ret |
;--------------------------------------------------------------------- |
draw_colours: |
pusha |
mov esi,color_table |
mov ebx,220*65536+14 |
mov ecx,10*65536+14 |
mov eax,13 |
mov [frame_data.draw_text_flag],dword 0 |
;-------------------------------------- |
newcol: |
mov edx,[esi] |
mcall |
push ebx ecx |
sub ebx,2 shl 16 |
add bx,4 |
sub ecx,2 shl 16 |
add cx,4 |
mov [frame_data.x],ebx |
mov [frame_data.y],ecx |
push dword frame_data |
call [Frame_draw] |
pop ecx ebx |
add ecx,20*65536 |
add esi,4 |
cmp esi,color_table+4*9 |
jbe newcol |
popa |
ret |
;---------------------------------------------------------------------- |
draw_PathShow: |
pusha |
mcall 13,<frame_1.x+5,frame_1.width-15>,<frame_1.y+7,15>,0xffffff |
mcall 13,<frame_2.x+5,frame_2.width-15>,<frame_2.y+7,15>,0xffffff |
; draw for PathShow |
push dword PathShow_data_1 |
call [PathShow_draw] |
push dword PathShow_data_2 |
call [PathShow_draw] |
popa |
ret |
;--------------------------------------------------------------------- |
; ********************************************* |
; ******* WINDOW DEFINITIONS AND DRAW ******** |
; ********************************************* |
draw_window: |
mcall 12,1 |
mcall 48,3,app_colours,10*4 |
mcall 14 |
mcall 48,4 |
mov [current_skin_high],eax |
; DRAW WINDOW |
xor eax,eax ; function 0 : define and draw window |
xor esi,esi |
mov edx,[w_work] ; color of work area RRGGBB,8->color |
or edx,0x34000000 |
mov ecx,50 shl 16 + 346 |
add ecx,[current_skin_high] |
mcall ,<110,440>,,,,title |
mcall 9,procinfo,-1 |
mov eax,[procinfo+70] ;status of window |
test eax,100b |
jne .end |
;if lang eq ru |
load_w = (5*2+6*9) |
save_w = (5*2+6*9) |
flat_w = (5*2+6*7) |
apply_w = (5*2+6*9) |
;else |
; load_w = (5*2+6*6) |
; save_w = (5*2+6*8) |
; flat_w = (5*2+6*4) |
; apply_w = (5*2+6*7) |
;end if |
;----------------------------------- |
; select color DTP frame |
; LOAD BUTTON ; button 12 |
mcall 8,<frame_1.x+10,load_w>,<frame_1.y+25,18>,12,[w_work_button] |
; SAVE BUTTON |
add ebx,(load_w+2)*65536-load_w+save_w |
inc edx |
mcall ; button 13 |
; APPLY BUTTON |
mov ebx,(frame_1.x + frame_1.width - apply_w - 15)*65536+apply_w |
mcall 8,,,16 ; button 17 |
; select color DTP button text |
mcall 4,<frame_1.x+16,frame_1.y+31>,[w_work_button_text],t1,t1.size |
;----------------------------------- |
; select skin frame |
; LOAD SKIN BUTTON ; button 17 |
mcall 8,<frame_2.x+10,load_w>,<frame_2.y+25,18>,17,[w_work_button] |
; 3D |
mov ebx,(frame_2.x+155)*65536+34 |
mcall ,,,14 ; button 14 |
; FLAT |
add ebx,36*65536-34+flat_w |
inc edx |
mcall ; button 15 |
; APPLY SKIN BUTTON |
mov ebx,(frame_2.x + frame_2.width - apply_w -15)*65536+apply_w |
mcall ,,,18 ; button 18 |
; select skin button text |
mcall 4,<frame_2.x+16,frame_2.y+31>,[w_work_button_text],t2,t2.size |
;----------------------------------- |
call draw_button_row |
call draw_button_row_of_texts |
call draw_colours |
;----------------------------------- |
mov [frame_data.x],dword frame_1.x shl 16+frame_1.width |
mov [frame_data.y],dword frame_1.y shl 16+frame_1.height |
mov [frame_data.text_pointer],dword select_dtp_text |
mov eax,[w_work] |
mov [frame_data.font_backgr_color],eax |
mov eax,[w_work_text] |
mov [frame_data.font_color],eax |
mov [frame_data.draw_text_flag],dword 1 |
push dword frame_data |
call [Frame_draw] |
;----------------------------------- |
mov [frame_data.x],dword frame_2.x shl 16+frame_2.width |
mov [frame_data.y],dword frame_2.y shl 16+frame_2.height |
mov [frame_data.text_pointer],dword select_skin_text |
push dword frame_data |
call [Frame_draw] |
;----------------------------------- |
call draw_PathShow |
;----------------------------------- |
cmp dword[not_packed_area+SKIN_HEADER.ident],'SKIN' |
jne @f |
call draw_skin |
@@: |
.end: |
mcall 12,2 |
ret |
;----------------------------------------------------------------------------- |
include 'drawskin.inc' |
;----------------------------------------------------------------------------- |
; DATA AREA |
;----------------------------------------------------------------------------- |
include 'idata.inc' |
;----------------------------------------------------------------------------- |
IM_END: |
;----------------------------------------------------------------------------- |
include 'udata.inc' |
;----------------------------------------------------------------------------- |
I_END: |
;----------------------------------------------------------------------------- |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
/programs/system/skincfg/trunk/idata.inc |
---|
0,0 → 1,388 |
;----------------------------------------------------------------------------- |
text: |
if lang eq ru |
db ' ' |
db ' ' |
db ' ' |
db ' ' |
db ' ' |
db ' ' |
db ' ' |
db ' ' |
db ' ' |
db ' ' |
db 'x' |
else if lang eq et |
db ' AKNA RAAM ' |
db ' AKNA HAARAMISE RIBA ' |
db ' AKNA HAARAMISE NUPP ' |
db ' AKNA HAARAMISE NUPU TEKST ' |
db ' AKNA HAARAMISE PEALKIRI ' |
db ' AKNA TÖÖPIIRKOND ' |
db ' AKNA TÖÖPIIRKONNA NUPP ' |
db ' AKNA TÖÖPIIRKONNA NUPPU TEKST ' |
db ' AKNA TÖÖPIIRKONNA TEKST ' |
db ' AKNA TÖÖPIIRKONNA GRAAFIKA ' |
db 'x' |
else |
db ' WINDOW FRAME ' |
db ' WINDOW GRAB BAR ' |
db ' WINDOW GRAB BUTTON ' |
db ' WINDOW GRAB BUTTON TEXT ' |
db ' WINDOW GRAB TITLE ' |
db ' WINDOW WORK AREA ' |
db ' WINDOW WORK AREA BUTTON ' |
db ' WINDOW WORK AREA BUTTON TEXT ' |
db ' WINDOW WORK AREA TEXT ' |
db ' WINDOW WORK AREA GRAPH ' |
db 'x' |
end if |
;----------------------------------------------------------------------------- |
if lang eq ru |
sz t1,' ' |
else if lang eq et |
sz t1,' LAADI SALVESTA KINNITA' |
else |
sz t1,' LOAD SAVE APPLY' |
end if |
;----------------------------------------------------------------------------- |
if lang eq ru |
sz t2,' 3D ' |
else if lang eq et |
sz t2,' LAADI 3D LAME KINNITA' |
else |
sz t2,' LOAD 3D FLAT APPLY' |
end if |
;----------------------------------------------------------------------------- |
select_dtp_text: |
if lang eq ru |
db ' : ',0 |
else if lang eq et |
db ' VALIK VARVISKEEME: ',0 |
else |
db ' CHOICE OF COLOR SCHEMES: ',0 |
end if |
;----------------------------------------------------------------------------- |
select_skin_text: |
if lang eq ru |
db ' : ',0 |
else if lang eq et |
db ' VALIK NAHAD: ',0 |
else |
db ' CHOICE OF SKINS: ',0 |
end if |
;----------------------------------------------------------------------------- |
if lang eq ru |
sz caption_text,' £®«®¢®ª' |
else if lang eq et |
sz caption_text,'Pealkiri' |
else |
sz caption_text,'Caption' |
end if |
;----------------------------------------------------------------------------- |
sz close_text,'x' |
;----------------------------------------------------------------------------- |
if lang eq ru |
sz window_text,'¥ªáâ ¢ ®ª¥' |
else if lang eq et |
sz window_text,'Akna tekst' |
else |
sz window_text,'Window text' |
end if |
;----------------------------------------------------------------------------- |
if lang eq ru |
sz button_text,'¥ªáâ ª®¯ª¥' |
else if lang eq et |
sz button_text,'Nupu tekst' |
else |
sz button_text,'Button text' |
end if |
;----------------------------------------------------------------------------- |
if lang eq ru |
title db ' áâனª ®ª®',0 |
else if lang eq et |
title db 'Akna seaded',0 |
else if lang eq it |
title db 'Impostazioni',0 |
else |
title db 'Windows settings',0 |
end if |
;--------------------------------------------------------------------- |
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: |
;--------------------------------------------------------------------- |
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_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 |
ColorDialog_Init dd aColorDialog_Init |
ColorDialog_Start dd aColorDialog_Start |
;OpenDialog__Version dd aOpenDialog_Version |
dd 0 |
dd 0 |
aOpenDialog_Init db 'OpenDialog_init',0 |
aOpenDialog_Start db 'OpenDialog_start',0 |
aColorDialog_Init db 'ColorDialog_init',0 |
aColorDialog_Start db 'ColorDialog_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 |
;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 |
;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 |
Frame_draw dd sz_Frame_draw |
;Version_frame dd szVersion_frame |
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 |
;aCheck_box_draw db 'check_box_draw',0 |
;aCheck_box_mouse db 'check_box_mouse',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 |
;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 |
sz_Frame_draw db 'frame_draw',0 |
;szVersion_frame db 'version_frame',0 |
;--------------------------------------------------------------------- |
PathShow_data_1: |
.type dd 0 ;+0 |
.start_y dw frame_1.y+10 ;+4 |
.start_x dw frame_1.x+7 ;+6 |
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1 |
.area_size_x dw frame_1.width-20 ;+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 ;+28 |
.work_area_pointer dd text_work_area ;+32 |
.temp_text_length dd 0 ;+36 |
;--------------------------------------------------------------------- |
PathShow_data_2: |
.type dd 0 ;+0 |
.start_y dw frame_2.y+10 ;+4 |
.start_x dw frame_2.x+7 ;+6 |
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1 |
.area_size_x dw frame_2.width-20 ;+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 skin_info ;+28 |
.work_area_pointer dd text_work_area2 ;+32 |
.temp_text_length dd 0 ;+36 |
;--------------------------------------------------------------------- |
OpenDialog_data: |
.type dd 0 |
.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 ;+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 |
OpenDialog_data2: |
.type dd 0 |
.procinfo dd procinfo ;+4 |
.com_area_name dd communication_area_name2 ;+8 |
.com_area dd 0 ;+12 |
.opendir_pach dd temp_dir_pach2 ;+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 skin_info ;+36 |
.filename_area dd filename_area2 ;+40 |
.filter_area dd Filter2 |
.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_name2: |
db 'FFFFFFFF_open_dialog',0 |
communication_area_name: |
db 'FFFFFFFF_open_dialog2',0 |
open_dialog_path: |
if __nightbuild eq yes |
db '/sys/MANAGERS/opendial',0 |
else |
db '/sys/File Managers/opendial',0 |
end if |
communication_area_default_pach: |
db '/sys',0 |
Filter: |
dd Filter.end - Filter |
.1: |
db 'DTP',0 |
.end: |
db 0 |
Filter2: |
dd Filter.end - Filter |
.1: |
db 'SKN',0 |
.end: |
db 0 |
start_temp_file_name: |
db 'default.dtp',0 |
default_skin: |
db '/sys/default.skn',0 |
default_dtp: |
db '/sys/default.dtp',0 |
;--------------------------------------------------------------------- |
ColorDialog_data: |
.type dd 0 |
.procinfo dd procinfo ;+4 |
.com_area_name dd cd_communication_area_name ;+8 |
.com_area dd 0 ;+12 |
.start_path dd colordialog_path ;+16 |
.draw_window dd draw_window ;+20 |
.status dd 0 ;+24 |
.x: |
.x_size dw 510 ;+28 ; Window X size |
.x_start dw 10 ;+30 ; Window X position |
.y: |
.y_size dw 310 ;+32 ; Window y size |
.y_start dw 10 ;+34 ; Window Y position |
.color_type dd 0 ;+36 ; 0- RGB, 1 or other - reserved |
.color dd 0 ;+40 ; Selected color |
cd_communication_area_name: |
db 'FFFFFFFF_color_dialog',0 |
colordialog_path: |
db '/rd/1/colrdial',0 |
;--------------------------------------------------------------------- |
frame_data: |
.type dd 0 ;+0 |
.x: |
.x_size dw 0 ;+4 |
.x_start dw 0 ;+6 |
.y: |
.y_size dw 0 ;+8 |
.y_start dw 0 ;+10 |
.ext_fr_col dd 0x0 ;+12 |
.int_fr_col dd 0xffffff ;+16 |
.draw_text_flag dd 1 ;+20 |
.text_pointer dd 0 ;+24 |
.text_position dd 0 ;+28 |
.font_number dd 0 ;+32 |
.font_size_y dd 9 ;+36 |
.font_color dd 0x0 ;+40 |
.font_backgr_color dd 0xffffff ;+44 |
;--------------------------------------------------------------------- |
IncludeIGlobals |
/programs/system/skincfg/trunk/drawskin.inc |
---|
0,0 → 1,341 |
;---------------------------------------------------------------------- |
area: |
.x = 5 ;345 |
.y = 5 ;20 |
.width = 206 |
.height = 191 |
;-------------------------------------- |
wnd1: |
.x = area.x+49 |
.y = area.y+5 |
.width = 150 |
.height = 90 |
;-------------------------------------- |
wnd2: |
.x = area.x+35 |
.y = area.y+35 |
.width = 150 |
.height = 90 |
;-------------------------------------- |
wnd3: |
.x = area.x+21 |
.y = area.y+65 |
.width = 150 |
.height = 90 |
;-------------------------------------- |
wnd4: |
.x = area.x+7 |
.y = area.y+95 |
.width = 150 |
.height = 90 |
;-------------------------------------- |
virtual at edi+SKIN_PARAMS.dtp.data |
dtp system_colors |
end virtual |
;---------------------------------------------------------------------- |
draw_skin: |
mcall 13,<area.x,area.width>,<area.y+2,area.height>,0x00FFFFFF |
mov ebp,not_packed_area |
mov edi,[ebp+SKIN_HEADER.params] |
add edi,ebp |
mpack ebx,wnd1.x,wnd1.width |
mpack ecx,wnd1.y,wnd1.height |
mov edx,[dtp.frame] |
call draw_framerect |
mcall 13,<wnd1.x+1,wnd1.width-2>,<wnd1.y+1,wnd1.height-2>,dword[dtp.work] |
mov eax,38 |
mpack ebx,wnd1.x+1,wnd1.x+wnd1.width-2 |
mpack ecx,wnd1.y+1,wnd1.y+1 |
mov edx,[dtp.grab] |
mov esi,20 |
;-------------------------------------- |
@@: |
mcall |
call dec_edx |
add ecx,0x00010001 |
dec esi |
jnz @b |
mov edi,[ebp+SKIN_HEADER.params] |
add edi,ebp |
mcall 4,<wnd1.x+6,wnd1.y+7>,dword[dtp.grab_text],caption_text,caption_text.size |
mcall 8,<wnd1.x+wnd1.width-18,12>,<wnd1.y+4,12>,0,[dtp.grab_button] |
mcall 4,<wnd1.x+wnd1.width-18+4,wnd1.y+4+2>,dword[dtp.grab_button_text],close_text,close_text.size |
;---------------------------------------------------------------------- |
mov edi,[ebp+SKIN_HEADER.params] |
add edi,ebp |
mpack ebx,wnd2.x,wnd2.width |
mpack ecx,wnd2.y,wnd2.height |
mov edx,[dtp.frame] |
shr edx,1 |
and edx,0x007F7F7F |
call draw_framerect |
mpack ebx,wnd2.x+4,wnd2.width-8 |
mpack ecx,wnd2.y+4,wnd2.height-8 |
call draw_framerect |
mcall 13,<wnd2.x+1,wnd2.width-2>,<wnd2.y+1,3>,[dtp.frame] |
add ecx,(wnd2.height-5)*65536 |
mcall |
mcall ,<wnd2.x+1,3>,<wnd2.y+1,wnd2.height-2> |
add ebx,(wnd2.width-5)*65536 |
mcall |
mcall ,<wnd2.x+5,wnd2.width-10>,<wnd2.y+5,wnd2.height-10>,dword[dtp.work] |
mov eax,38 |
mpack ebx,wnd2.x+4,wnd2.x+wnd2.width-5 |
mpack ecx,wnd2.y+4,wnd2.y+4 |
mov edx,[dtp.grab] |
mov esi,16 |
;-------------------------------------- |
@@: |
mcall |
call dec_edx |
add ecx,0x00010001 |
dec esi |
jnz @b |
mov edi,[ebp+SKIN_HEADER.params] |
add edi,ebp |
mcall 4,<wnd2.x+8,wnd2.y+7>,dword[dtp.grab_text],caption_text,caption_text.size |
mcall 8,<wnd2.x+wnd2.width-20,12>,<wnd2.y+4,12>,0,[dtp.grab_button] |
mcall 4,<wnd2.x+wnd2.width-20+4,wnd2.y+4+2>,dword[dtp.grab_button_text],close_text,close_text.size |
;---------------------------------------------------------------------- |
mov edi,[ebp+SKIN_HEADER.params] |
add edi,ebp |
mpack ebx,wnd3.x,wnd3.width |
mpack ecx,wnd3.y,wnd3.height |
mov edx,[edi+SKIN_PARAMS.colors_1.outer] |
call draw_framerect |
mpack ebx,wnd3.x+4,wnd3.width-8 |
mpack ecx,wnd3.y+4,wnd3.height-8 |
mov edx,[edi+SKIN_PARAMS.colors_1.inner] |
call draw_framerect |
mcall 13,<wnd3.x+1,wnd3.width-2>,<wnd3.y+1,3>,[edi+SKIN_PARAMS.colors_1.frame] |
add ecx,(wnd3.height-5)*65536 |
mcall |
mcall ,<wnd3.x+1,3>,<wnd3.y+1,wnd3.height-2> |
add ebx,(wnd3.width-5)*65536 |
mcall |
mcall ,<wnd3.x+5,wnd3.width-10>,<wnd3.y+5,wnd3.height-10>,dword[dtp.work] |
mov eax,0x00000001 ; left, inactive |
call find_bitmap |
mcall 7,,,<wnd3.x,wnd3.y> |
pushd [ebx-8] |
mov eax,0x00000003 ; base, inactive |
call find_bitmap |
pop edx |
mov esi,wnd3.x+wnd3.width-1 |
sub esi,edx |
shl edx,16 |
add edx,wnd3.x*65536+wnd3.y |
mcall 7 |
;-------------------------------------- |
@@: |
rol edx,16 |
add dx,[ebx-8] |
cmp dx,si |
ja @f |
rol edx,16 |
mcall 7 |
jmp @b |
;-------------------------------------- |
@@: |
mov eax,0x00000002 ; oper, inactive |
call find_bitmap |
mov edx,ecx |
shr edx,16 |
neg edx |
shl edx,16 |
add edx,(wnd3.x+wnd3.width)*65536+wnd3.y |
mcall 7 |
mov ebp,not_packed_area |
mov edi,[ebp+SKIN_HEADER.params] |
add edi,ebp |
mov eax,dword[edi+SKIN_PARAMS.margin.left-2] |
mov ax,word[edi+SKIN_PARAMS.skin_height] |
sub ax,[edi+SKIN_PARAMS.margin.bottom] |
shr ax,1 |
add ax,[edi+SKIN_PARAMS.margin.top] |
add ax,-4 |
push eax |
lea ebx,[eax+wnd3.x*65536+wnd3.y] |
mcall 4,,dword[dtp.grab_text],caption_text,caption_text.size |
;--------------------------------------------------------- |
mov edi,[ebp+SKIN_HEADER.params] |
add edi,ebp |
mpack ebx,wnd4.x,wnd4.width |
mpack ecx,wnd4.y,wnd4.height |
mov edx,[edi+SKIN_PARAMS.colors.outer] |
call draw_framerect |
mpack ebx,wnd4.x+4,wnd4.width-8 |
mpack ecx,wnd4.y+4,wnd4.height-8 |
mov edx,[edi+SKIN_PARAMS.colors.inner] |
call draw_framerect |
mcall 13,<wnd4.x+1,wnd4.width-2>,<wnd4.y+1,3>,[edi+SKIN_PARAMS.colors.frame] |
add ecx,(wnd4.height-5)*65536 |
mcall |
mcall ,<wnd4.x+1,3>,<wnd4.y+1,wnd4.height-2> |
add ebx,(wnd4.width-5)*65536 |
mcall |
mcall ,<wnd4.x+5,wnd4.width-10>,<wnd4.y+5,wnd4.height-10>,dword[dtp.work] |
mov eax,0x00010001 ; left, inactive |
call find_bitmap |
mcall 7,,,<wnd4.x,wnd4.y> |
pushd [ebx-8] |
mov eax,0x00010003 ; base, inactive |
call find_bitmap |
pop edx |
mov esi,wnd4.x+wnd4.width-1 |
sub esi,edx |
shl edx,16 |
add edx,wnd4.x*65536+wnd4.y |
mcall 7 |
;-------------------------------------- |
@@: |
rol edx,16 |
add dx,[ebx-8] |
cmp dx,si |
ja @f |
rol edx,16 |
mcall 7 |
jmp @b |
;-------------------------------------- |
@@: |
mov eax,0x00010002 ; oper, inactive |
call find_bitmap |
mov edx,ecx |
shr edx,16 |
neg edx |
shl edx,16 |
add edx,(wnd4.x+wnd4.width)*65536+wnd4.y |
mcall 7 |
mov ebp,not_packed_area |
mov edi,[ebp+SKIN_HEADER.params] |
add edi,ebp |
pop eax |
lea ebx,[eax+wnd4.x*65536+wnd4.y] |
mcall 4,,dword[dtp.grab_text],caption_text,caption_text.size |
;---------------------------------------------------------------------- |
mov edi,[ebp+SKIN_HEADER.buttons] |
add edi,ebp |
;-------------------------------------- |
.lp1: |
cmp dword[edi],0 |
je .lp2 |
mov ebx,dword[edi+SKIN_BUTTONS.left-2] |
mov bx,[edi+SKIN_BUTTONS.width] |
mov ecx,dword[edi+SKIN_BUTTONS.top-2] |
mov cx,[edi+SKIN_BUTTONS.height] |
add ebx,(wnd4.x+wnd4.width)*65536 |
add ecx,wnd4.y*65536 |
dec ebx |
dec ecx |
mcall 8,,,0x40000000 |
add edi,12 |
jmp .lp1 |
;-------------------------------------- |
.lp2: |
mov edi,[ebp+SKIN_HEADER.params] |
add edi,ebp |
mpack ebx,wnd4.x+10,wnd4.y+10 |
add bx,word[edi+SKIN_PARAMS.skin_height] |
mcall 4,,[dtp.work_text],window_text,window_text.size |
mov ecx,[edi+SKIN_PARAMS.skin_height] |
shl ecx,16 |
add ecx,(wnd4.y+8)*65536+10 |
mcall 13,<wnd4.x+window_text.size*6+20,wnd4.x+wnd4.width-10-\ |
(wnd4.x+window_text.size*6+20)>,,[dtp.work_graph] |
add ecx,25*65536+8 |
mcall 8,<wnd4.x+wnd4.width/2-button_text.size*3-6,\ |
button_text.size*6+11>,,0,[dtp.work_button] |
shr ecx,16 |
mov bx,cx |
add ebx,0x00060006 |
mcall 4,,[dtp.work_button_text],button_text,button_text.size |
ret |
;--------------------------------------------------------------------- |
find_bitmap: |
mov edi,[ebp+SKIN_HEADER.bitmaps] |
add edi,ebp |
xor ebx,ebx |
;-------------------------------------- |
.lp1: |
cmp dword[edi],0 |
je .lp2 |
cmp dword[edi+0],eax |
jne @f |
;-------------------------------------- |
mov ebx,[edi+SKIN_BITMAPS._data] |
add ebx,ebp |
mov ecx,[ebx-2] |
mov cx,[ebx+4] |
add ebx,8 |
;-------------------------------------- |
.lp2: |
ret |
;-------------------------------------- |
@@: |
add edi,8 |
jmp .lp1 |
;---------------------------------------------------------------------- |
dec_edx: |
sub dl,4 |
jnc @f |
xor dl,dl |
;-------------------------------------- |
@@: |
sub dh,4 |
jnc @f |
xor dh,dh |
;-------------------------------------- |
@@: |
rol edx,16 |
sub dl,4 |
jnc @f |
xor dl,dl |
;-------------------------------------- |
@@: |
rol edx,16 |
ret |
;--------------------------------------------------------------------- |
draw_framerect: ; ebx,ecx |
push ebx ecx |
add bx,[esp+6] |
mov cx,[esp+2] |
dec ebx |
mcall 38 |
add cx,[esp] |
rol ecx,16 |
add cx,[esp] |
sub ecx,0x00010001 |
mcall |
mov ebx,[esp+4] |
mov ecx,[esp] |
mov bx,[esp+6] |
add cx,[esp+2] |
dec ecx |
mcall |
add bx,[esp+4] |
rol ebx,16 |
add bx,[esp+4] |
sub ebx,0x00010001 |
mcall |
add esp,8 |
ret |
;---------------------------------------------------------------------- |
/programs/system/skincfg/trunk/udata.inc |
---|
0,0 → 1,89 |
IncludeUGlobals |
read_info: |
.mode dd ? ; read |
.start_block dd ? ; first block |
.blocks dd ? ; 512 bytes |
.address dd ? |
.workarea dd ? |
fname rb 4096 ; filename |
virtual at read_info |
write_info: |
.mode dd ? |
rd 1 |
.bytes2write dd ? |
.address dd ? |
.workarea dd ? |
end virtual |
read_info2: |
.mode dd ? ; read |
.start_block dd ? ; first block |
.blocks dd ? ; 512 bytes |
.address dd ? |
.workarea dd ? |
skin_info rb 4096 |
;param rb 257 |
align 4 |
app_colours: |
w_frame dd ? |
w_grab dd ? |
w_grab_button dd ? |
w_grab_button_text dd ? |
w_grab_text dd ? |
w_work dd ? |
w_work_button dd ? |
w_work_button_text dd ? |
w_work_text dd ? |
w_work_graph dd ? |
color_table: |
times 10 dd ? |
current_skin_high rd 1 |
;--------------------------------------------------------------------- |
align 4 |
cur_dir_path: |
rb 4096 |
;--------------------------------------------------------------------- |
library_path: |
rb 4096 |
;--------------------------------------------------------------------- |
temp_dir_pach: |
rb 4096 |
;--------------------------------------------------------------------- |
temp_dir_pach2: |
rb 4096 |
;--------------------------------------------------------------------- |
text_work_area: |
rb 1024 |
;--------------------------------------------------------------------- |
text_work_area2: |
rb 1024 |
;--------------------------------------------------------------------- |
procinfo: |
rb 1024 |
;--------------------------------------------------------------------- |
filename_area: |
rb 256 |
;--------------------------------------------------------------------- |
filename_area2: |
rb 256 |
;--------------------------------------------------------------------- |
rb 4096 |
stacktop: |
;--------------------------------------------------------------------- |
file_load_area: ; old 0x10000 |
rb 32*1024 |
;--------------------------------------------------------------------- |
not_packed_area: ; old 0x18000 |
rb 32*1024 |
;--------------------------------------------------------------------- |
unpack_area: ; old 0x20000 |
rb 32*1024 |
;--------------------------------------------------------------------- |
/programs/system/skincfg/trunk/kglobals.inc |
---|
0,0 → 1,59 |
;------------------------------------------------------------------ |
; use "iglobal" for inserting initialized global data definitions. |
;------------------------------------------------------------------ |
macro iglobal { |
IGlobals equ IGlobals, |
macro __IGlobalBlock { } |
macro iglobal_nested { |
IGlobals equ IGlobals, |
macro __IGlobalBlock \{ } |
;------------------------------------------------------------- |
; use 'uglobal' for inserting uninitialized global definitions. |
; even when you define some data values, these variables |
; will be stored as uninitialized data. |
;------------------------------------------------------------- |
macro uglobal { |
UGlobals equ UGlobals, |
macro __UGlobalBlock { } |
macro uglobal_nested { |
UGlobals equ UGlobals, |
macro __UGlobalBlock \{ } |
endg fix } ; Use endg for ending iglobal and uglobal blocks. |
endg_nested fix \} |
macro IncludeIGlobals{ |
macro IGlobals dummy,[n] \{ __IGlobalBlock |
purge __IGlobalBlock \} |
match I, IGlobals \{ I \} } |
macro IncludeUGlobals{ |
macro UGlobals dummy,[n] \{ |
\common |
\local begin, size |
begin = $ |
virtual at $ |
\forward |
__UGlobalBlock |
purge __UGlobalBlock |
\common |
size = $ - begin |
end virtual |
rb size |
\} |
match U, UGlobals \{ U \} } |
macro IncludeAllGlobals { |
IncludeIGlobals |
IncludeUGlobals |
} |
iglobal |
endg |
uglobal |
endg |
/programs/system/skincfg/trunk/unpacker.inc |
---|
0,0 → 1,504 |
; void __stdcall unpack(void* packed_data, void* unpacked_data); |
unpack: |
pushad |
mov esi, [esp+32+4] |
mov edi, [esp+32+8] |
mov eax, [esi+8] |
and al, 0xC0 |
cmp al, 0xC0 |
jz .failed |
mov eax, [esi+8] |
push eax |
add esi, 12 |
and al, not 0xC0 |
dec eax |
jz .lzma |
.failed: |
pop eax |
popad |
ret 8 |
.lzma: |
call .lzma_unpack |
.common: |
pop eax |
test al, 0x80 |
jnz .ctr1 |
test al, 0x40 |
jz .ok |
lodsd |
mov ecx, eax |
jecxz .ok |
mov dl, [esi] |
mov esi, [esp+32+8] |
.c1: |
lodsb |
sub al, 0E8h |
cmp al, 1 |
ja .c1 |
cmp byte [esi], dl |
jnz .c1 |
lodsd |
; "bswap eax" is not supported on i386 |
shr ax, 8 |
ror eax, 16 |
xchg al, ah |
sub eax, esi |
add eax, [esp+32+8] |
mov [esi-4], eax |
loop .c1 |
.ok: |
popad |
ret 8 |
.ctr1: |
lodsd |
mov ecx, eax |
jecxz .ok |
mov dl, [esi] |
mov esi, [esp+32+8] |
.c2: |
lodsb |
@@: |
cmp al, 0xF |
jnz .f |
lodsb |
cmp al, 80h |
jb @b |
cmp al, 90h |
jb @f |
.f: |
sub al, 0E8h |
cmp al, 1 |
ja .c2 |
@@: |
cmp byte [esi], dl |
jnz .c2 |
lodsd |
shr ax, 8 |
ror eax, 16 |
xchg al, ah |
sub eax, esi |
add eax, [esp+32+8] |
mov [esi-4], eax |
loop .c2 |
jmp .ok |
.lzma_unpack: |
.pb = 2 ; pos state bits |
.lp = 0 ; literal pos state bits |
.lc = 3 ; literal context bits |
.posStateMask = ((1 shl .pb)-1) |
.literalPosMask = ((1 shl .lp)-1) |
.kNumPosBitsMax = 4 |
.kNumPosStatesMax = (1 shl .kNumPosBitsMax) |
.kLenNumLowBits = 3 |
.kLenNumLowSymbols = (1 shl .kLenNumLowBits) |
.kLenNumMidBits = 3 |
.kLenNumMidSymbols = (1 shl .kLenNumMidBits) |
.kLenNumHighBits = 8 |
.kLenNumHighSymbols = (1 shl .kLenNumHighBits) |
.LenChoice = 0 |
.LenChoice2 = 1 |
.LenLow = 2 |
.LenMid = (.LenLow + (.kNumPosStatesMax shl .kLenNumLowBits)) |
.LenHigh = (.LenMid + (.kNumPosStatesMax shl .kLenNumMidBits)) |
.kNumLenProbs = (.LenHigh + .kLenNumHighSymbols) |
.kNumStates = 12 |
.kNumLitStates = 7 |
.kStartPosModelIndex = 4 |
.kEndPosModelIndex = 14 |
.kNumFullDistances = (1 shl (.kEndPosModelIndex/2)) |
.kNumPosSlotBits = 6 |
.kNumLenToPosStates = 4 |
.kNumAlignBits = 4 |
.kAlignTableSize = (1 shl .kNumAlignBits) |
.kMatchMinLen = 2 |
.IsMatch = 0 |
.IsRep = (.IsMatch + (.kNumStates shl .kNumPosBitsMax)) |
.IsRepG0 = (.IsRep + .kNumStates) |
.IsRepG1 = (.IsRepG0 + .kNumStates) |
.IsRepG2 = (.IsRepG1 + .kNumStates) |
.IsRep0Long = (.IsRepG2 + .kNumStates) |
.PosSlot = (.IsRep0Long + (.kNumStates shl .kNumPosBitsMax)) |
.SpecPos = (.PosSlot + (.kNumLenToPosStates shl .kNumPosSlotBits)) |
.Align_ = (.SpecPos + .kNumFullDistances - .kEndPosModelIndex) |
.Lencoder = (.Align_ + .kAlignTableSize) |
.RepLencoder = (.Lencoder + .kNumLenProbs) |
.Literal = (.RepLencoder + .kNumLenProbs) |
.LZMA_BASE_SIZE = 1846 ; must be ==Literal |
.LZMA_LIT_SIZE = 768 |
.kNumTopBits = 24 |
.kTopValue = (1 shl .kNumTopBits) |
.kNumBitModelTotalBits = 11 |
.kBitModelTotal = (1 shl .kNumBitModelTotalBits) |
.kNumMoveBits = 5 |
push edi |
; int state=0; |
xor ebx, ebx |
mov [.previousByte], bl |
; unsigned rep0=1,rep1=1,rep2=1,rep3=1; |
mov eax, 1 |
mov edi, .rep0 |
stosd |
stosd |
stosd |
stosd |
; int len=0; |
; result=0; |
mov ecx, .Literal + (.LZMA_LIT_SIZE shl (.lc+.lp)) |
mov eax, .kBitModelTotal/2 |
mov edi, .p |
rep stosd |
; RangeDecoderInit |
; rd->ExtraBytes = 0 |
; rd->Buffer = stream |
; rd->BufferLim = stream+bufferSize |
; rd->Range = 0xFFFFFFFF |
pop edi |
mov ebp, [esi-8] ; dest_length |
add ebp, edi ; ebp = destination limit |
lodsd |
; rd->code_ = eax |
mov [.code_], eax |
or [.range], -1 |
.main_loop: |
cmp edi, ebp |
jae .main_loop_done |
mov edx, edi |
and edx, .posStateMask |
mov eax, ebx |
shl eax, .kNumPosBitsMax+2 |
lea eax, [.p + .IsMatch*4 + eax + edx*4] |
call .RangeDecoderBitDecode |
jc .1 |
movzx eax, [.previousByte] |
if .literalPosMask |
mov ah, dl |
and ah, .literalPosMask |
end if |
shr eax, 8-.lc |
imul eax, .LZMA_LIT_SIZE*4 |
add eax, .p+.Literal*4 |
cmp ebx, .kNumLitStates |
jb .literal |
xor edx, edx |
sub edx, [.rep0] |
mov dl, [edi + edx] |
call .LzmaLiteralDecodeMatch |
jmp @f |
.literal: |
call .LzmaLiteralDecode |
@@: |
mov [.previousByte], al |
stosb |
mov al, bl |
cmp bl, 4 |
jb @f |
mov al, 3 |
cmp bl, 10 |
jb @f |
mov al, 6 |
@@: sub bl, al |
jmp .main_loop |
.1: |
lea eax, [.p + .IsRep*4 + ebx*4] |
call .RangeDecoderBitDecode |
jnc .10 |
lea eax, [.p + .IsRepG0*4 + ebx*4] |
call .RangeDecoderBitDecode |
jc .111 |
mov eax, ebx |
shl eax, .kNumPosBitsMax+2 |
lea eax, [.p + .IsRep0Long*4 + eax + edx*4] |
call .RangeDecoderBitDecode |
jc .1101 |
cmp bl, 7 |
setae bl |
lea ebx, [9 + ebx + ebx] |
xor edx, edx |
sub edx, [.rep0] |
mov al, [edi + edx] |
stosb |
mov [.previousByte], al |
jmp .main_loop |
.111: |
lea eax, [.p + .IsRepG1*4 + ebx*4] |
call .RangeDecoderBitDecode |
mov eax, [.rep1] |
jnc .l3 |
.l1: |
lea eax, [.p + .IsRepG2*4 + ebx*4] |
call .RangeDecoderBitDecode |
mov eax, [.rep2] |
jnc .l2 |
xchg [.rep3], eax |
.l2: |
push [.rep1] |
pop [.rep2] |
.l3: |
xchg eax, [.rep0] |
mov [.rep1], eax |
.1101: |
mov eax, .p + .RepLencoder*4 |
call .LzmaLenDecode |
cmp bl, 7 |
setc bl |
adc bl, bl |
xor bl, 3 |
add bl, 8 |
jmp .repmovsb |
.10: |
mov eax, [.rep0] |
xchg eax, [.rep1] |
xchg eax, [.rep2] |
xchg eax, [.rep3] |
cmp bl, 7 |
setc bl |
adc bl, bl |
xor bl, 3 |
add bl, 7 |
mov eax, .p + .Lencoder*4 |
call .LzmaLenDecode |
mov eax, .kNumLenToPosStates-1 |
cmp eax, ecx |
jb @f |
mov eax, ecx |
@@: |
push ecx |
mov ecx, .kNumPosSlotBits |
shl eax, cl |
shl eax, 2 |
add eax, .p+.PosSlot*4 |
call .RangeDecoderBitTreeDecode |
mov [.rep0], ecx |
cmp ecx, .kStartPosModelIndex |
jb .l6 |
push ecx |
mov eax, ecx |
and eax, 1 |
shr ecx, 1 |
or eax, 2 |
dec ecx |
shl eax, cl |
mov [.rep0], eax |
pop edx |
cmp edx, .kEndPosModelIndex |
jae .l5 |
sub eax, edx |
shl eax, 2 |
add eax, .p + (.SpecPos - 1)*4 |
call .RangeDecoderReverseBitTreeDecode |
add [.rep0], ecx |
jmp .l6 |
.l5: |
sub ecx, .kNumAlignBits |
call .RangeDecoderDecodeDirectBits |
mov ecx, .kNumAlignBits |
shl eax, cl |
add [.rep0], eax |
mov eax, .p+.Align_*4 |
call .RangeDecoderReverseBitTreeDecode |
add [.rep0], ecx |
.l6: |
pop ecx |
inc [.rep0] |
jz .main_loop_done |
.repmovsb: |
add ecx, .kMatchMinLen |
push esi |
mov esi, edi |
sub esi, [.rep0] |
rep movsb |
pop esi |
mov al, [edi-1] |
mov [.previousByte], al |
jmp .main_loop |
.main_loop_done: |
ret |
.RangeDecoderBitDecode: |
; in: eax->prob |
; out: CF=bit; destroys eax |
push edx |
mov edx, [.range] |
shr edx, .kNumBitModelTotalBits |
imul edx, [eax] |
cmp [.code_], edx |
jae .ae |
mov [.range], edx |
mov edx, .kBitModelTotal |
sub edx, [eax] |
shr edx, .kNumMoveBits |
add [eax], edx |
clc |
.n: |
lahf |
cmp [.range], .kTopValue |
jae @f |
shl [.range], 8 |
shl [.code_], 8 |
lodsb |
mov byte [.code_], al |
@@: |
sahf |
pop edx |
ret |
.ae: |
sub [.range], edx |
sub [.code_], edx |
mov edx, [eax] |
shr edx, .kNumMoveBits |
sub [eax], edx |
stc |
jmp .n |
.RangeDecoderDecodeDirectBits: |
; in: ecx=numTotalBits |
; out: eax=result; destroys edx |
xor eax, eax |
.l: |
shr [.range], 1 |
shl eax, 1 |
mov edx, [.code_] |
sub edx, [.range] |
jb @f |
mov [.code_], edx |
or eax, 1 |
@@: |
cmp [.range], .kTopValue |
jae @f |
shl [.range], 8 |
shl [.code_], 8 |
push eax |
lodsb |
mov byte [.code_], al |
pop eax |
@@: |
loop .l |
ret |
.LzmaLiteralDecode: |
; in: eax->probs |
; out: al=byte; destroys edx |
push ecx |
mov ecx, 1 |
@@: |
push eax |
lea eax, [eax+ecx*4] |
call .RangeDecoderBitDecode |
pop eax |
adc cl, cl |
jnc @b |
.LzmaLiteralDecode.ret: |
mov al, cl |
pop ecx |
ret |
.LzmaLiteralDecodeMatch: |
; in: eax->probs, dl=matchByte |
; out: al=byte; destroys edx |
push ecx |
mov ecx, 1 |
.LzmaLiteralDecodeMatch.1: |
add dl, dl |
setc ch |
push eax |
lea eax, [eax+ecx*4+0x100*4] |
call .RangeDecoderBitDecode |
pop eax |
adc cl, cl |
jc .LzmaLiteralDecode.ret |
xor ch, cl |
test ch, 1 |
mov ch, 0 |
jnz @b |
jmp .LzmaLiteralDecodeMatch.1 |
.LzmaLenDecode: |
; in: eax->prob, edx=posState |
; out: ecx=len |
push eax |
add eax, .LenChoice*4 |
call .RangeDecoderBitDecode |
pop eax |
jnc .0 |
push eax |
add eax, .LenChoice2*4 |
call .RangeDecoderBitDecode |
pop eax |
jc @f |
mov ecx, .kLenNumMidBits |
shl edx, cl |
lea eax, [eax + .LenMid*4 + edx*4] |
call .RangeDecoderBitTreeDecode |
add ecx, .kLenNumLowSymbols |
ret |
@@: |
add eax, .LenHigh*4 |
mov ecx, .kLenNumHighBits |
call .RangeDecoderBitTreeDecode |
add ecx, .kLenNumLowSymbols + .kLenNumMidSymbols |
ret |
.0: |
mov ecx, .kLenNumLowBits |
shl edx, cl |
lea eax, [eax + .LenLow*4 + edx*4] |
.RangeDecoderBitTreeDecode: |
; in: eax->probs,ecx=numLevels |
; out: ecx=length; destroys edx |
push ebx |
mov edx, 1 |
mov ebx, edx |
@@: |
push eax |
lea eax, [eax+edx*4] |
call .RangeDecoderBitDecode |
pop eax |
adc dl, dl |
add bl, bl |
loop @b |
sub dl, bl |
pop ebx |
mov ecx, edx |
ret |
.RangeDecoderReverseBitTreeDecode: |
; in: eax->probs,ecx=numLevels |
; out: ecx=length; destroys edx |
push ebx ecx |
mov edx, 1 |
xor ebx, ebx |
@@: |
push eax |
lea eax, [eax+edx*4] |
call .RangeDecoderBitDecode |
lahf |
adc edx, edx |
sahf |
rcr ebx, 1 |
pop eax |
loop @b |
pop ecx |
rol ebx, cl |
mov ecx, ebx |
pop ebx |
ret |
uglobal |
align 4 |
unpack.p rd unpack.LZMA_BASE_SIZE + (unpack.LZMA_LIT_SIZE shl (unpack.lc+unpack.lp)) |
unpack.code_ dd ? |
unpack.range dd ? |
unpack.rep0 dd ? |
unpack.rep1 dd ? |
unpack.rep2 dd ? |
unpack.rep3 dd ? |
unpack.previousByte db ? |
endg |