Non-skinned button press style

git-svn-id: svn://kolibrios.org@6044 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pathoswithin 2016-01-07 16:29:25 +00:00
parent 4b8415c842
commit 5f2eec40f1
2 changed files with 27 additions and 95 deletions

View File

@ -293,12 +293,13 @@ sys_button_deactivate_handler:
mov ebx, dword[eax + SYS_BUTTON.id_hi - 2] mov ebx, dword[eax + SYS_BUTTON.id_hi - 2]
; display button border on press? ; display button border on press?
test ebx, 0x20000000 bt ebx, 29
jnz .exit jc .exit
; invert system button border ; invert system button border
pushad pushad
mov esi, eax mov esi, eax
mov edi, ebx
movzx ecx, [esi + SYS_BUTTON.pslot] movzx ecx, [esi + SYS_BUTTON.pslot]
shl ecx, 5 shl ecx, 5
add ecx, window_data add ecx, window_data
@ -308,14 +309,17 @@ sys_button_deactivate_handler:
add ebx, [ecx + WDATA.box.top] add ebx, [ecx + WDATA.box.top]
mov ecx, eax mov ecx, eax
mov edx, ebx mov edx, ebx
bt edi, 30
jc @f
inc ax inc ax
inc bx inc bx
dec cx
dec dx
@@:
rol eax, 16 rol eax, 16
rol ebx, 16 rol ebx, 16
add ax, cx add ax, cx
add bx, dx add bx, dx
dec ax
dec bx
mov esi, 1000000h mov esi, 1000000h
call draw_rectangle.forced call draw_rectangle.forced
popad popad

View File

@ -101,7 +101,6 @@ parse_skin_data:
xor eax, eax xor eax, eax
cld cld
rep stosd rep stosd
mov ebx, [ebp+SKIN_HEADER.params] mov ebx, [ebp+SKIN_HEADER.params]
add ebx, [skin_data] add ebx, [skin_data]
mov eax, [ebx+SKIN_PARAMS.skin_height] mov eax, [ebx+SKIN_PARAMS.skin_height]
@ -127,11 +126,8 @@ parse_skin_data:
mov dword[_skinmargins+0], eax mov dword[_skinmargins+0], eax
mov eax, dword[ebx+SKIN_PARAMS.margin.bottom] mov eax, dword[ebx+SKIN_PARAMS.margin.bottom]
mov dword[_skinmargins+4], eax mov dword[_skinmargins+4], eax
mov ebx, [ebp+SKIN_HEADER.bitmaps] mov ebx, [ebp+SKIN_HEADER.bitmaps]
add ebx, [skin_data] add ebx, [skin_data]
;--------------------------------------
align 4
.lp1: .lp1:
cmp dword[ebx], 0 cmp dword[ebx], 0
je .end_bitmaps je .end_bitmaps
@ -142,11 +138,8 @@ align 4
xor eax, eax xor eax, eax
mov edx, skin_active.left.data mov edx, skin_active.left.data
or ecx, ecx or ecx, ecx
jnz @f jnz .next_bitmap
mov edx, skin_inactive.left.data mov edx, skin_inactive.left.data
;--------------------------------------
align 4
@@:
jmp .next_bitmap jmp .next_bitmap
;-------------------------------------- ;--------------------------------------
align 4 align 4
@ -159,11 +152,8 @@ align 4
neg eax neg eax
mov edx, skin_active.oper.data mov edx, skin_active.oper.data
or ecx, ecx or ecx, ecx
jnz @f jnz .next_bitmap
mov edx, skin_inactive.oper.data mov edx, skin_inactive.oper.data
;--------------------------------------
align 4
@@:
jmp .next_bitmap jmp .next_bitmap
;-------------------------------------- ;--------------------------------------
align 4 align 4
@ -173,12 +163,9 @@ align 4
mov eax, [skin_active.left.width] mov eax, [skin_active.left.width]
mov edx, skin_active.base.data mov edx, skin_active.base.data
or ecx, ecx or ecx, ecx
jnz @f jnz .next_bitmap
mov eax, [skin_inactive.left.width] mov eax, [skin_inactive.left.width]
mov edx, skin_inactive.base.data mov edx, skin_inactive.base.data
;--------------------------------------
align 4
@@:
jmp .next_bitmap jmp .next_bitmap
;-------------------------------------- ;--------------------------------------
align 4 align 4
@ -202,8 +189,6 @@ align 4
.end_bitmaps: .end_bitmaps:
mov ebx, [ebp+SKIN_HEADER.buttons] mov ebx, [ebp+SKIN_HEADER.buttons]
add ebx, [skin_data] add ebx, [skin_data]
;--------------------------------------
align 4
.lp2: .lp2:
cmp dword[ebx], 0 cmp dword[ebx], 0
je .end_buttons je .end_buttons
@ -245,13 +230,10 @@ align 4
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
drawwindow_IV_caption: drawwindow_IV_caption:
mov ebp, skin_active mov ebp, skin_active
or al, al or al, al
jnz @f jnz @f
mov ebp, skin_inactive mov ebp, skin_inactive
;--------------------------------------
align 4
@@: @@:
mov esi, [esp+4] mov esi, [esp+4]
mov eax, [esi+WDATA.box.width] ; window width mov eax, [esi+WDATA.box.width] ; window width
@ -260,13 +242,10 @@ align 4
mov ecx, [ebp+SKIN_DATA.left.width] mov ecx, [ebp+SKIN_DATA.left.width]
shl ecx, 16 shl ecx, 16
add ecx, [_skinh] add ecx, [_skinh]
mov ebx, [ebp+SKIN_DATA.left.data] mov ebx, [ebp+SKIN_DATA.left.data]
or ebx, ebx or ebx, ebx
jz @f jz @f
call sys_putimage.forced call sys_putimage.forced
;--------------------------------------
align 4
@@: @@:
mov esi, [esp+4] mov esi, [esp+4]
mov eax, [esi+WDATA.box.width] mov eax, [esi+WDATA.box.width]
@ -278,9 +257,7 @@ align 4
mov ecx, [ebp+SKIN_DATA.base.width] mov ecx, [ebp+SKIN_DATA.base.width]
jecxz .non_base jecxz .non_base
div ecx div ecx
inc eax inc eax
mov ebx, [ebp+SKIN_DATA.base.data] mov ebx, [ebp+SKIN_DATA.base.data]
mov ecx, [ebp+SKIN_DATA.base.width] mov ecx, [ebp+SKIN_DATA.base.width]
shl ecx, 16 shl ecx, 16
@ -288,45 +265,33 @@ align 4
mov edx, [ebp+SKIN_DATA.base.left] mov edx, [ebp+SKIN_DATA.base.left]
sub edx, [ebp+SKIN_DATA.base.width] sub edx, [ebp+SKIN_DATA.base.width]
shl edx, 16 shl edx, 16
;--------------------------------------
align 4
.baseskinloop: .baseskinloop:
shr edx, 16 shr edx, 16
add edx, [ebp+SKIN_DATA.base.width] add edx, [ebp+SKIN_DATA.base.width]
shl edx, 16 shl edx, 16
push eax ebx ecx edx push eax ebx ecx edx
or ebx, ebx or ebx, ebx
jz @f jz @f
call sys_putimage.forced call sys_putimage.forced
;--------------------------------------
align 4
@@: @@:
pop edx ecx ebx eax pop edx ecx ebx eax
dec eax dec eax
jnz .baseskinloop jnz .baseskinloop
;--------------------------------------
align 4
.non_base: .non_base:
mov esi, [esp+4] mov esi, [esp+4]
mov edx, [esi+WDATA.box.width] mov edx, [esi+WDATA.box.width]
sub edx, [ebp+SKIN_DATA.oper.width] sub edx, [ebp+SKIN_DATA.oper.width]
inc edx inc edx
shl edx, 16 shl edx, 16
mov ebx, [ebp+SKIN_DATA.oper.data] mov ebx, [ebp+SKIN_DATA.oper.data]
mov ecx, [ebp+SKIN_DATA.oper.width] mov ecx, [ebp+SKIN_DATA.oper.width]
shl ecx, 16 shl ecx, 16
add ecx, [_skinh] add ecx, [_skinh]
or ebx, ebx or ebx, ebx
jz @f jz @f
call sys_putimage.forced call sys_putimage.forced
;--------------------------------------
align 4
@@: @@:
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -334,17 +299,12 @@ align 4
drawwindow_IV: drawwindow_IV:
;param1 - aw_yes ;param1 - aw_yes
pusha pusha
push edx push edx
mov edi, edx mov edi, edx
mov ebp, skin_active mov ebp, skin_active
cmp byte [esp+32+4+4], 0 cmp byte [esp+32+4+4], 0
jne @f jne @f
mov ebp, skin_inactive mov ebp, skin_inactive
;--------------------------------------
align 4
@@: @@:
mov eax, [edi+WDATA.box.left] mov eax, [edi+WDATA.box.left]
shl eax, 16 shl eax, 16
@ -362,8 +322,6 @@ align 4
rol ebx, 16 rol ebx, 16
call draw_rectangle call draw_rectangle
mov ecx, 3 mov ecx, 3
;--------------------------------------
align 4
_dw3l: _dw3l:
add eax, 1*65536-1 add eax, 1*65536-1
add ebx, 0*65536-1 add ebx, 0*65536-1
@ -387,8 +345,6 @@ _dw3l:
test [edi + WDATA.fl_wstate], WSTATE_ROLLEDUP test [edi + WDATA.fl_wstate], WSTATE_ROLLEDUP
jnz @f jnz @f
call draw_rectangle call draw_rectangle
;--------------------------------------
align 4
@@: @@:
mov eax, [skin_data] mov eax, [skin_data]
cmp [eax], dword 'SKIN' cmp [eax], dword 'SKIN'
@ -400,7 +356,6 @@ align 4
inc ecx inc ecx
mov edx, [_skinh] mov edx, [_skinh]
mov edi, [common_colours+4]; standard grab color mov edi, [common_colours+4]; standard grab color
; call [drawbar]
call vesa20_drawbar call vesa20_drawbar
jmp draw_clientbar jmp draw_clientbar
;-------------------------------------- ;--------------------------------------
@ -408,11 +363,8 @@ align 4
@@: @@:
mov al, [esp+32+4+4] mov al, [esp+32+4+4]
call drawwindow_IV_caption call drawwindow_IV_caption
;--------------------------------------
align 4
draw_clientbar: draw_clientbar:
mov esi, [esp] mov esi, [esp]
mov edx, [esi+WDATA.box.top] ; WORK AREA mov edx, [esi+WDATA.box.top] ; WORK AREA
add edx, 21+5 add edx, 21+5
mov ebx, [esi+WDATA.box.top] mov ebx, [esi+WDATA.box.top]
@ -428,10 +380,7 @@ draw_clientbar:
mov edi, [esi+WDATA.cl_workarea] mov edi, [esi+WDATA.cl_workarea]
test edi, 0x40000000 test edi, 0x40000000
jnz _noinside2 jnz _noinside2
; call [drawbar]
call vesa20_drawbar call vesa20_drawbar
;--------------------------------------
align 4
_noinside2: _noinside2:
mov eax, [skin_data] mov eax, [skin_data]
cmp [eax], dword 'SKIN' cmp [eax], dword 'SKIN'
@ -443,39 +392,30 @@ _noinside2:
jge no_skin_add_button jge no_skin_add_button
inc eax inc eax
mov [edi], ax mov [edi], ax
shl eax, 4 shl eax, 4
add eax, edi add eax, edi
mov bx, [CURRENT_TASK] mov bx, [CURRENT_TASK]
mov [eax], bx mov [eax], bx
mov word [eax+2], 1 ; button id
add eax, 2 ; save button id number
mov bx, 1
mov [eax], bx
add eax, 2 ; x start
xor ebx, ebx xor ebx, ebx
cmp [skin_btn_close.left], 0 cmp [skin_btn_close.left], 0
jge _bCx_at_right jge @f
mov ebx, [esp] mov ebx, [esp]
mov ebx, [ebx+WDATA.box.width] mov ebx, [ebx+WDATA.box.width]
inc ebx inc ebx
;-------------------------------------- @@:
align 4
_bCx_at_right:
add ebx, [skin_btn_close.left] add ebx, [skin_btn_close.left]
mov [eax], bx mov word [eax+4], bx ; x start
add eax, 2 ; x size
mov ebx, [skin_btn_close.width] mov ebx, [skin_btn_close.width]
dec ebx dec ebx
mov [eax], bx mov word [eax+6], bx ; x size
add eax, 2 ; y start
mov ebx, [skin_btn_close.top] mov ebx, [skin_btn_close.top]
mov [eax], bx mov word [eax+8], bx ; y start
add eax, 2 ; y size
mov ebx, [skin_btn_close.height] mov ebx, [skin_btn_close.height]
dec ebx dec ebx
mov [eax], bx mov word [eax+10], bx ; y size
bts word [eax+12], 14
;* minimize button ;* minimize button
mov edi, [BTN_ADDR] mov edi, [BTN_ADDR]
movzx eax, word [edi] movzx eax, word [edi]
@ -483,43 +423,31 @@ _bCx_at_right:
jge no_skin_add_button jge no_skin_add_button
inc eax inc eax
mov [edi], ax mov [edi], ax
shl eax, 4 shl eax, 4
add eax, edi add eax, edi
mov bx, [CURRENT_TASK] mov bx, [CURRENT_TASK]
mov [eax], bx mov [eax], bx
mov word [eax+2], -1 ; button id
add eax, 2 ; save button id number
mov bx, 65535;999
mov [eax], bx
add eax, 2 ; x start
xor ebx, ebx xor ebx, ebx
cmp [skin_btn_minimize.left], 0 cmp [skin_btn_minimize.left], 0
jge _bMx_at_right jge @f
mov ebx, [esp] mov ebx, [esp]
mov ebx, [ebx+WDATA.box.width] mov ebx, [ebx+WDATA.box.width]
inc ebx inc ebx
;-------------------------------------- @@:
align 4
_bMx_at_right:
add ebx, [skin_btn_minimize.left] add ebx, [skin_btn_minimize.left]
mov [eax], bx mov word [eax+4], bx ; x start
add eax, 2 ; x size
mov ebx, [skin_btn_minimize.width] mov ebx, [skin_btn_minimize.width]
dec ebx dec ebx
mov [eax], bx mov word [eax+6], bx ; x size
add eax, 2 ; y start
mov ebx, [skin_btn_minimize.top] mov ebx, [skin_btn_minimize.top]
mov [eax], bx mov word [eax+8], bx ; y start
add eax, 2 ; y size
mov ebx, [skin_btn_minimize.height] mov ebx, [skin_btn_minimize.height]
dec ebx dec ebx
mov [eax], bx mov word [eax+10], bx ; y size
;-------------------------------------- bts word [eax+12], 14
align 4
no_skin_add_button: no_skin_add_button:
pop edi pop edi
popa popa
ret 4 ret 4
;------------------------------------------------------------------------------