2005-10-14 17:40:15 +02:00
|
|
|
include "skindata.inc"
|
2005-10-06 19:56:22 +02:00
|
|
|
|
2006-02-18 11:41:47 +01:00
|
|
|
skin_data = 0x00778000
|
2005-10-06 19:56:22 +02:00
|
|
|
|
2006-02-18 11:41:47 +01:00
|
|
|
load_skin_file:
|
|
|
|
; eax = filename
|
|
|
|
; edx = destination
|
|
|
|
mov ebx,1
|
|
|
|
or ecx,-1
|
|
|
|
mov esi,12
|
2005-10-06 19:56:22 +02:00
|
|
|
call fileread
|
|
|
|
ret
|
|
|
|
|
2006-02-18 11:41:47 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
load_skin:
|
|
|
|
pushad
|
|
|
|
mov eax,_skin_file
|
|
|
|
mov edx,skin_data
|
|
|
|
call load_skin_file
|
|
|
|
call parse_skin_data
|
|
|
|
popad
|
|
|
|
ret
|
|
|
|
|
|
|
|
parse_skin_data:
|
|
|
|
mov ebp,skin_data
|
|
|
|
cmp [ebp+SKIN_HEADER.ident],'SKIN'
|
|
|
|
jne .exit
|
|
|
|
|
|
|
|
mov ebx,[ebp+SKIN_HEADER.params]
|
|
|
|
add ebx,skin_data
|
|
|
|
mov eax,[ebx+SKIN_PARAMS.skin_height]
|
|
|
|
mov [_skinh],eax
|
|
|
|
mov eax,[ebx+SKIN_PARAMS.colors.inner]
|
|
|
|
mov [skin_active.colors.inner],eax
|
|
|
|
mov eax,[ebx+SKIN_PARAMS.colors.outer]
|
|
|
|
mov [skin_active.colors.outer],eax
|
|
|
|
mov eax,[ebx+SKIN_PARAMS.colors.frame]
|
|
|
|
mov [skin_active.colors.frame],eax
|
|
|
|
mov eax,[ebx+SKIN_PARAMS.colors_1.inner]
|
|
|
|
mov [skin_inactive.colors.inner],eax
|
|
|
|
mov eax,[ebx+SKIN_PARAMS.colors_1.outer]
|
|
|
|
mov [skin_inactive.colors.outer],eax
|
|
|
|
mov eax,[ebx+SKIN_PARAMS.colors_1.frame]
|
|
|
|
mov [skin_inactive.colors.frame],eax
|
|
|
|
lea esi,[ebx+SKIN_PARAMS.dtp.data]
|
|
|
|
mov edi,common_colours
|
|
|
|
mov ecx,[ebx+SKIN_PARAMS.dtp.size]
|
|
|
|
and ecx,127
|
|
|
|
cld
|
|
|
|
rep movsb
|
2006-03-04 12:58:09 +01:00
|
|
|
mov eax,dword[ebx+SKIN_PARAMS.margin.right]
|
2006-02-18 11:41:47 +01:00
|
|
|
mov dword[_skinmargins+0],eax
|
2006-03-04 12:58:09 +01:00
|
|
|
mov eax,dword[ebx+SKIN_PARAMS.margin.bottom]
|
2006-02-18 11:41:47 +01:00
|
|
|
mov dword[_skinmargins+4],eax
|
|
|
|
|
|
|
|
mov ebx,[ebp+SKIN_HEADER.bitmaps]
|
|
|
|
add ebx,skin_data
|
|
|
|
.lp1: cmp dword[ebx],0
|
|
|
|
je .end_bitmaps
|
|
|
|
movzx eax,[ebx+SKIN_BITMAPS.kind]
|
|
|
|
movzx ecx,[ebx+SKIN_BITMAPS.type]
|
|
|
|
dec eax
|
|
|
|
jnz .not_left
|
|
|
|
xor eax,eax
|
|
|
|
mov edx,skin_active.left.data
|
|
|
|
or ecx,ecx
|
|
|
|
jnz @f
|
|
|
|
mov edx,skin_inactive.left.data
|
|
|
|
@@: jmp .next_bitmap
|
|
|
|
.not_left:
|
|
|
|
dec eax
|
|
|
|
jnz .not_oper
|
|
|
|
mov esi,[ebx+SKIN_BITMAPS.data]
|
|
|
|
add esi,skin_data
|
|
|
|
mov eax,[esi+0]
|
|
|
|
neg eax
|
|
|
|
mov edx,skin_active.oper.data
|
|
|
|
or ecx,ecx
|
|
|
|
jnz @f
|
|
|
|
mov edx,skin_inactive.oper.data
|
|
|
|
@@: jmp .next_bitmap
|
|
|
|
.not_oper:
|
|
|
|
dec eax
|
|
|
|
jnz .not_base
|
|
|
|
mov eax,[skin_active.left.width]
|
|
|
|
mov edx,skin_active.base.data
|
|
|
|
or ecx,ecx
|
|
|
|
jnz @f
|
|
|
|
mov eax,[skin_inactive.left.width]
|
|
|
|
mov edx,skin_inactive.base.data
|
|
|
|
@@: jmp .next_bitmap
|
|
|
|
.not_base:
|
|
|
|
add ebx,8
|
|
|
|
jmp .lp1
|
|
|
|
.next_bitmap:
|
|
|
|
mov ecx,[ebx+SKIN_BITMAPS.data]
|
|
|
|
add ecx,skin_data
|
|
|
|
mov [edx+4],eax
|
|
|
|
mov eax,[ecx+0]
|
|
|
|
mov [edx+8],eax
|
|
|
|
add ecx,8
|
|
|
|
mov [edx+0],ecx
|
|
|
|
add ebx,8
|
|
|
|
jmp .lp1
|
|
|
|
.end_bitmaps:
|
|
|
|
|
|
|
|
mov ebx,[ebp+SKIN_HEADER.buttons]
|
|
|
|
add ebx,skin_data
|
|
|
|
.lp2: cmp dword[ebx],0
|
|
|
|
je .end_buttons
|
|
|
|
mov eax,[ebx+SKIN_BUTTONS.type]
|
|
|
|
dec eax
|
|
|
|
jnz .not_close
|
|
|
|
mov edx,skin_btn_close
|
|
|
|
jmp .next_button
|
|
|
|
.not_close:
|
|
|
|
dec eax
|
|
|
|
jnz .not_minimize
|
|
|
|
mov edx,skin_btn_minimize
|
|
|
|
jmp .next_button
|
|
|
|
.not_minimize:
|
|
|
|
add ebx,12
|
|
|
|
jmp .lp2
|
|
|
|
.next_button:
|
|
|
|
movsx eax,[ebx+SKIN_BUTTONS.left]
|
|
|
|
mov [edx+SKIN_BUTTON.left],eax
|
|
|
|
movsx eax,[ebx+SKIN_BUTTONS.top]
|
|
|
|
mov [edx+SKIN_BUTTON.top],eax
|
|
|
|
movsx eax,[ebx+SKIN_BUTTONS.width]
|
|
|
|
mov [edx+SKIN_BUTTON.width],eax
|
|
|
|
movsx eax,[ebx+SKIN_BUTTONS.height]
|
|
|
|
mov [edx+SKIN_BUTTON.height],eax
|
|
|
|
add ebx,12
|
|
|
|
jmp .lp2
|
|
|
|
.end_buttons:
|
|
|
|
|
|
|
|
.exit:
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
drawwindow_IV:
|
2006-01-11 11:18:52 +01:00
|
|
|
;param1 - aw_yes
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
push edx
|
|
|
|
|
|
|
|
mov edi,[esp] ; RECTANGLE
|
|
|
|
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ebp,skin_active
|
|
|
|
cmp byte [esp+32+4+4],0
|
|
|
|
jne @f
|
|
|
|
mov ebp,skin_inactive
|
|
|
|
@@:
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
mov eax,[edi+0]
|
|
|
|
shl eax,16
|
|
|
|
mov ax,[edi+0]
|
|
|
|
add ax,[edi+8]
|
|
|
|
mov ebx,[edi+4]
|
|
|
|
shl ebx,16
|
|
|
|
mov bx,[edi+4]
|
|
|
|
add bx,[edi+12]
|
|
|
|
; mov esi,[edi+24]
|
|
|
|
; shr esi,1
|
|
|
|
; and esi,0x007f7f7f
|
2006-02-18 11:41:47 +01:00
|
|
|
mov esi,[ebp+SKIN_DATA.colors.outer]
|
2005-10-06 19:56:22 +02:00
|
|
|
call draw_rectangle
|
|
|
|
mov ecx,3
|
|
|
|
_dw3l:
|
|
|
|
add eax,1*65536-1
|
|
|
|
add ebx,1*65536-1
|
|
|
|
test ax,ax
|
|
|
|
js no_skin_add_button
|
|
|
|
test bx,bx
|
|
|
|
js no_skin_add_button
|
2006-02-18 11:41:47 +01:00
|
|
|
mov esi,[ebp+SKIN_DATA.colors.frame] ;[edi+24]
|
2005-10-06 19:56:22 +02:00
|
|
|
call draw_rectangle
|
|
|
|
dec ecx
|
|
|
|
jnz _dw3l
|
2006-02-18 11:41:47 +01:00
|
|
|
mov esi,[ebp+SKIN_DATA.colors.inner]
|
2005-10-06 19:56:22 +02:00
|
|
|
add eax,1*65536-1
|
|
|
|
add ebx,1*65536-1
|
|
|
|
test ax,ax
|
|
|
|
js no_skin_add_button
|
|
|
|
test bx,bx
|
|
|
|
js no_skin_add_button
|
|
|
|
call draw_rectangle
|
|
|
|
|
|
|
|
mov esi,[esp]
|
|
|
|
mov eax,[esi+8] ; window width
|
2006-02-18 11:41:47 +01:00
|
|
|
mov edx,[ebp+SKIN_DATA.left.left]
|
2005-10-06 19:56:22 +02:00
|
|
|
shl edx,16
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ecx,[ebp+SKIN_DATA.left.width]
|
2005-10-06 19:56:22 +02:00
|
|
|
shl ecx,16
|
|
|
|
add ecx,[_skinh]
|
2006-01-06 12:46:26 +01:00
|
|
|
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ebx, [ebp+SKIN_DATA.left.data]
|
2005-10-06 19:56:22 +02:00
|
|
|
call sys_putimage
|
|
|
|
|
|
|
|
mov esi,[esp]
|
|
|
|
mov eax,[esi+8]
|
2006-02-18 11:41:47 +01:00
|
|
|
sub eax,[ebp+SKIN_DATA.left.width]
|
|
|
|
sub eax,[ebp+SKIN_DATA.oper.width]
|
|
|
|
cmp eax,[ebp+SKIN_DATA.base.left]
|
2005-10-06 19:56:22 +02:00
|
|
|
jng non_base
|
|
|
|
xor edx,edx
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ebx,[ebp+SKIN_DATA.base.width]
|
2005-10-06 19:56:22 +02:00
|
|
|
div ebx
|
|
|
|
|
|
|
|
inc eax
|
|
|
|
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ebx,[ebp+SKIN_DATA.base.data]
|
|
|
|
mov ecx,[ebp+SKIN_DATA.base.width]
|
2005-10-06 19:56:22 +02:00
|
|
|
shl ecx,16
|
|
|
|
add ecx,[_skinh]
|
2006-02-18 11:41:47 +01:00
|
|
|
mov edx,[ebp+SKIN_DATA.base.left]
|
|
|
|
sub edx,[ebp+SKIN_DATA.base.width]
|
2005-10-06 19:56:22 +02:00
|
|
|
shl edx,16
|
|
|
|
baseskinloop:
|
|
|
|
shr edx,16
|
2006-02-18 11:41:47 +01:00
|
|
|
add edx,[ebp+SKIN_DATA.base.width]
|
2005-10-06 19:56:22 +02:00
|
|
|
shl edx,16
|
|
|
|
|
|
|
|
push eax ebx ecx edx
|
|
|
|
call sys_putimage
|
|
|
|
pop edx ecx ebx eax
|
|
|
|
|
|
|
|
dec eax
|
|
|
|
jnz baseskinloop
|
|
|
|
non_base:
|
|
|
|
|
|
|
|
mov esi,[esp]
|
|
|
|
mov edx,[esi+8]
|
2006-02-18 11:41:47 +01:00
|
|
|
sub edx,[ebp+SKIN_DATA.oper.width]
|
2005-10-06 19:56:22 +02:00
|
|
|
inc edx
|
|
|
|
shl edx,16
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ebx,[ebp+SKIN_DATA.oper.data]
|
2006-01-11 11:18:52 +01:00
|
|
|
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ecx,[ebp+SKIN_DATA.oper.width]
|
2005-10-06 19:56:22 +02:00
|
|
|
shl ecx,16
|
|
|
|
add ecx,[_skinh]
|
|
|
|
call sys_putimage
|
|
|
|
|
|
|
|
mov esi,[esp]
|
|
|
|
|
|
|
|
mov edx,[esi+04] ; WORK AREA
|
|
|
|
add edx,21+5
|
|
|
|
mov ebx,[esi+04]
|
|
|
|
add ebx,[esi+12]
|
|
|
|
cmp edx,ebx
|
|
|
|
jg _noinside2
|
|
|
|
mov eax,5
|
|
|
|
mov ebx,[_skinh]
|
|
|
|
mov ecx,[esi+8]
|
|
|
|
mov edx,[esi+12]
|
|
|
|
sub ecx,4
|
|
|
|
sub edx,4
|
|
|
|
mov edi,[esi+16]
|
|
|
|
call [drawbar]
|
|
|
|
_noinside2:
|
|
|
|
|
2006-02-18 11:41:47 +01:00
|
|
|
;* close button
|
2005-10-06 19:56:22 +02:00
|
|
|
mov edi,[0xfe88]
|
|
|
|
movzx eax,word [edi]
|
|
|
|
cmp eax,1000
|
|
|
|
jge no_skin_add_button
|
|
|
|
inc eax
|
|
|
|
mov [edi],ax
|
|
|
|
|
|
|
|
shl eax,4
|
|
|
|
add eax,edi
|
|
|
|
|
|
|
|
mov bx,[0x3000]
|
|
|
|
mov [eax],bx
|
|
|
|
|
|
|
|
add eax,2 ; save button id number
|
|
|
|
mov bx,1
|
|
|
|
mov [eax],bx
|
|
|
|
add eax,2 ; x start
|
2006-02-18 11:41:47 +01:00
|
|
|
xor ebx,ebx
|
|
|
|
cmp [skin_btn_close.left],0
|
|
|
|
jge _bCx_at_right
|
2005-10-06 19:56:22 +02:00
|
|
|
mov ebx,[esp]
|
|
|
|
mov ebx,[ebx+8]
|
2006-02-18 11:41:47 +01:00
|
|
|
inc ebx
|
2005-10-06 19:56:22 +02:00
|
|
|
_bCx_at_right:
|
2006-02-18 11:41:47 +01:00
|
|
|
add ebx,[skin_btn_close.left]
|
2005-10-06 19:56:22 +02:00
|
|
|
mov [eax],bx
|
|
|
|
add eax,2 ; x size
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ebx,[skin_btn_close.width]
|
|
|
|
dec ebx
|
2005-10-06 19:56:22 +02:00
|
|
|
mov [eax],bx
|
|
|
|
add eax,2 ; y start
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ebx,[skin_btn_close.top]
|
2005-10-06 19:56:22 +02:00
|
|
|
mov [eax],bx
|
|
|
|
add eax,2 ; y size
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ebx,[skin_btn_close.height]
|
|
|
|
dec ebx
|
2005-10-06 19:56:22 +02:00
|
|
|
mov [eax],bx
|
|
|
|
|
|
|
|
;* minimize button
|
|
|
|
mov edi,[0xfe88]
|
|
|
|
movzx eax,word [edi]
|
|
|
|
cmp eax,1000
|
|
|
|
jge no_skin_add_button
|
|
|
|
inc eax
|
|
|
|
mov [edi],ax
|
|
|
|
|
|
|
|
shl eax,4
|
|
|
|
add eax,edi
|
|
|
|
|
|
|
|
mov bx,[0x3000]
|
|
|
|
mov [eax],bx
|
|
|
|
|
|
|
|
add eax,2 ; save button id number
|
|
|
|
mov bx,65535 ;999
|
|
|
|
mov [eax],bx
|
|
|
|
add eax,2 ; x start
|
2006-02-18 11:41:47 +01:00
|
|
|
xor ebx,ebx
|
|
|
|
cmp [skin_btn_minimize.left],0
|
|
|
|
jge _bMx_at_right
|
2005-10-06 19:56:22 +02:00
|
|
|
mov ebx,[esp]
|
|
|
|
mov ebx,[ebx+8]
|
2006-02-18 11:41:47 +01:00
|
|
|
inc ebx
|
2005-10-06 19:56:22 +02:00
|
|
|
_bMx_at_right:
|
2006-02-18 11:41:47 +01:00
|
|
|
add ebx,[skin_btn_minimize.left]
|
2005-10-06 19:56:22 +02:00
|
|
|
mov [eax],bx
|
|
|
|
add eax,2 ; x size
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ebx,[skin_btn_minimize.width]
|
|
|
|
dec ebx
|
2005-10-06 19:56:22 +02:00
|
|
|
mov [eax],bx
|
|
|
|
add eax,2 ; y start
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ebx,[skin_btn_minimize.top]
|
2005-10-06 19:56:22 +02:00
|
|
|
mov [eax],bx
|
|
|
|
add eax,2 ; y size
|
2006-02-18 11:41:47 +01:00
|
|
|
mov ebx,[skin_btn_minimize.height]
|
|
|
|
dec ebx
|
2005-10-06 19:56:22 +02:00
|
|
|
mov [eax],bx
|
|
|
|
|
|
|
|
no_skin_add_button:
|
|
|
|
|
|
|
|
add esp,4
|
|
|
|
popa
|
2006-01-06 12:46:26 +01:00
|
|
|
|
2006-01-11 11:18:52 +01:00
|
|
|
ret 4
|
2005-10-06 19:56:22 +02:00
|
|
|
|