Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 522 → Rev 523

/kernel/trunk/gui/skincode.inc
10,31 → 10,36
 
;skin_data = 0x00778000
 
load_skin_file:
; eax = filename
; edx = destination
mov ebx,1
or ecx,-1
mov esi,12
pushad
push eax
mov [skin_to_load.adr],edx
read_skin_file:
stdcall load_file, ebx
test eax, eax
jz .notfound
cmp dword [eax], 'SKIN'
jnz .noskin
cmp ebx, 32*1024
jb @f
mov ebx, 32*1024
@@:
lea ecx, [ebx+3]
shr ecx, 2
mov esi, eax
mov edi, skin_data
rep movsd
stdcall kernel_free, eax
 
mov [skin_to_load.stradr],_skin_file_default
mov eax,skin_to_load
call file_system_lfn
call parse_skin_data
xor eax, eax
ret
.notfound:
xor eax, eax
inc eax
ret
.noskin:
stdcall kernel_free, eax
push 2
pop eax
popad
ret
 
skin_to_load:
dd 0,0,0
dd 64*1024
.adr dd 0
db 0
.stradr dd 0
 
 
struct SKIN_HEADER
.ident dd ?
.version dd ?
75,20 → 80,10
.data dd ?
ends
 
load_skin:
pushad
load_default_skin:
mov [_skinh],22
mov eax,_skin_file
mov edx,skin_data
mov [edx+SKIN_HEADER.ident],'????'
call load_skin_file
cmp eax,ERROR_SUCCESS
je @f
cmp eax,ERROR_END_OF_FILE
jne .exit
@@: call parse_skin_data
.exit:
popad
mov ebx,_skin_file_default
call read_skin_file
ret
 
parse_skin_data:
/kernel/trunk/gui/skindata.inc
55,8 → 55,6
skin_active SKIN_DATA
skin_inactive SKIN_DATA
 
_skin_file rb 256
 
align 4
 
skin_udata.end:
/kernel/trunk/gui/window.inc
475,45 → 475,17
 
cmp eax,8 ; set window skin
jne no_set_skin
mov eax,ebx
mov edi,[TASK_BASE]
add ebx,[edi+TASKDATA.mem_start] ; abs start of info block
pushd [ebx+0] [ebx+4] [ebx+8] [ebx+12]
mov dword[ebx+0],0 ; read
mov dword[ebx+4],0 ; from the beginning
mov dword[ebx+8],64 ; 32 KBytes maximum
mov ecx,skin_data+64*512
sub ecx,[edi+0x10]
mov dword[ebx+12],ecx ; destination
push eax
pushad
call file_system
popad
pop eax
popd [ebx+12] [ebx+8] [ebx+4] [ebx+0]
cmp eax,ERROR_SUCCESS
je @f
cmp eax,ERROR_END_OF_FILE
jne .exit
@@: cmp [skin_data+64*512+SKIN_HEADER.ident],'SKIN'
mov eax,ERROR_UNKNOWN_FS
jne .exit
mov esi,skin_data+64*512
mov edi,skin_data
mov ecx,(64*512)/4
rep movsd
call parse_skin_data
pushad
mov eax, 0
mov ebx, 0
call read_skin_file
mov [esp+32+36], eax
test eax, eax
jnz .ret
xor eax, eax
xor ebx, ebx
mov ecx, [ScreenWidth]
mov edx, [ScreenHeight]
call calculatescreen
popad
mov dword[esp+32+36],0
jmp redraw_screen_direct
.exit:
mov [esp+32+36],eax
.ret:
popad
ret
no_set_skin: