Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9925 → Rev 9926

/kernel/trunk/gui/background.inc
140,9 → 140,6
draw_background_temp:
mov [background_defined], 1
call force_redraw_background
;--------------------------------------
align 4
nosb31:
ret
;--------------------------------------
align 4
/kernel/trunk/gui/button.inc
95,12 → 95,13
 
; make coordinates clientbox-relative
push eax
mov eax, [current_slot]
mov eax, [current_slot_idx]
shl eax, BSF sizeof.WDATA
rol ebx, 16
add bx, word[eax + APPDATA.wnd_clientbox.left]
add bx, word[window_data + eax + WDATA.clientbox.left]
rol ebx, 16
rol ecx, 16
add cx, word[eax + APPDATA.wnd_clientbox.top]
add cx, word[window_data + eax + WDATA.clientbox.top]
rol ecx, 16
pop eax
 
339,12 → 340,11
mov esi, eax
mov edi, ebx
movzx ecx, [esi + SYS_BUTTON.pslot]
shl ecx, 5
add ecx, window_data
shl ecx, BSF sizeof.WDATA
mov eax, dword[esi + SYS_BUTTON.left]
mov ebx, dword[esi + SYS_BUTTON.top]
add eax, [ecx + WDATA.box.left]
add ebx, [ecx + WDATA.box.top]
add eax, [window_data + ecx + WDATA.box.left]
add ebx, [window_data + ecx + WDATA.box.top]
mov ecx, eax
mov edx, ebx
bt edi, 30
/kernel/trunk/gui/event.inc
67,9 → 67,8
; edx - uid
;scratched: ebx,ecx,esi,edi
mov ebx, [current_slot]
mov edx, [ebx+APPDATA.tid]
add ebx, APP_OBJ_OFFSET
mov edx, [current_slot]
mov edx, [edx+APPDATA.tid]
pushfd
cli
;--------------------------------------
463,7 → 462,7
;--------------------------------------
align 4
.result:
setae byte[esp+32+4] ;we consider that initially was: dword[esp+32+4]==72
setae byte[esp + SYSCALL_STACK.eax + 4] ;we consider that initially was: dword[esp+32+4]==72
;--------------------------------------
align 4
.retf:
510,7 → 509,7
; eax - event number (=0 => no events)
movzx edi, bh ; bh is assumed as [current_slot_idx]
mov ecx, [ebx+APPDATA.event_mask]
shl edi, 5
shl edi, BSF sizeof.WDATA
add edi, window_data
and ecx, 0x7FFFFFFF
;--------------------------------------
553,7 → 552,7
push eax
mov eax, [current_slot]
mov eax, [eax + APPDATA.event_mask]
test eax, 0x80000000 ; bit 31: active/inactive filter f.40
test eax, EVM_MOUSE_FILTER ; bit 31: active/inactive filter f.40
jz @f
pop eax
jmp .FlagAutoReset
/kernel/trunk/gui/mouse.inc
294,7 → 294,7
jz .exit
 
mov eax, esi
shl eax, 5
shl eax, BSF sizeof.WDATA
add eax, window_data + WDATA.box
mov ebx, mouse.active_sys_window.old_box
mov ecx, sizeof.BOX
515,7 → 515,7
 
push eax
mov edi, esi
shl edi, 5
shl edi, BSF sizeof.WDATA
add edi, window_data
call window._.get_rolledup_height
mov ecx, eax
582,7 → 582,7
mov [fl_moving], 1
push edi
mov edi, esi
shl edi, 5
shl edi, BSF sizeof.WDATA
add edi, WDATA.box + window_data
call window._.draw_negative_box
pop edi
609,7 → 609,7
add esi, [mouse.state.pos.x]
movzx esi, byte[esi]
mov edi, esi
shl edi, 5
shl edi, BSF sizeof.WDATA
add edi, window_data
ret
 
821,14 → 821,13
mov ax, [MOUSE_Y]
mov esi, [current_slot_idx]
shl esi, BSF sizeof.WDATA
mov bx, word [esi + window_data + WDATA.box.left]
mov bx, word[window_data + esi + WDATA.box.left]
shl ebx, 16
mov bx, word [esi + window_data + WDATA.box.top]
mov bx, word[window_data + esi + WDATA.box.top]
sub eax, ebx
mov edi, [current_slot]
sub ax, word[edi + APPDATA.wnd_clientbox.top]
sub ax, word[window_data + esi + WDATA.clientbox.top]
rol eax, 16
sub ax, word[edi + APPDATA.wnd_clientbox.left]
sub ax, word[window_data + esi + WDATA.clientbox.left]
rol eax, 16
mov [esp + SYSCALL_STACK.eax], eax
ret
/kernel/trunk/gui/skincode.inc
97,7 → 97,7
jne .exit
 
mov edi, skin_udata
mov ecx, (skin_udata.end-skin_udata)/4
mov ecx, (skin_udata.size)/4
xor eax, eax
cld
rep stosd
/kernel/trunk/gui/skindata.inc
59,6 → 59,6
 
align 4
 
skin_udata.end:
skin_udata.size = $ - skin_udata
 
endg
/kernel/trunk/gui/window.inc
80,11 → 80,10
mov ecx, edx
mov edx, [current_slot_idx]
shl edx, BSF sizeof.WDATA
add eax, [edx + window_data + WDATA.box.left]
add ebx, [edx + window_data + WDATA.box.top]
mov edi, [current_slot]
add eax, [edi+APPDATA.wnd_clientbox.left]
add ebx, [edi+APPDATA.wnd_clientbox.top]
add eax, [window_data + edx + WDATA.box.left]
add ebx, [window_data + edx + WDATA.box.top]
add eax, [window_data + edx + WDATA.clientbox.left]
add ebx, [window_data + edx + WDATA.clientbox.top]
xor edi, edi ; no force
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
jmp __sys_putpixel
106,14 → 105,11
 
mov eax, [current_slot_idx]
shl eax, BSF sizeof.WDATA
mov ebp, [eax + window_data + WDATA.box.left]
push esi
mov esi, [current_slot]
add ebp, [esi+APPDATA.wnd_clientbox.left]
mov ebp, [window_data + eax + WDATA.box.left]
add ebp, [window_data + eax + WDATA.clientbox.left]
shl ebp, 16
add ebp, [eax + window_data + WDATA.box.top]
add bp, word[esi+APPDATA.wnd_clientbox.top]
pop esi
add ebp, [window_data + eax + WDATA.box.top]
add bp, word[window_data + eax + WDATA.clientbox.top]
test ecx, 0x08000000 ; redirect the output to the user area
jnz @f
add ebx, ebp
151,10 → 147,10
shr eax, 16 ; eax - x.coord
movzx edx, bx ; edx - y.size
shr ebx, 16 ; ebx - y.coord
mov esi, [current_slot]
 
add eax, [esi + APPDATA.wnd_clientbox.left]
add ebx, [esi + APPDATA.wnd_clientbox.top]
mov esi, [current_slot_idx]
shl esi, BSF sizeof.WDATA
add eax, [window_data + esi + WDATA.clientbox.left]
add ebx, [window_data + esi + WDATA.clientbox.top]
add ecx, eax
add edx, ebx
jmp vesa20_drawbar
167,18 → 163,17
syscall_drawline:
mov edi, [current_slot_idx]
shl edi, BSF sizeof.WDATA
movzx eax, word[edi + window_data + WDATA.box.left]
movzx eax, word[window_data + edi + WDATA.box.left]
mov ebp, eax
mov esi, [current_slot]
add ebp, [esi+APPDATA.wnd_clientbox.left]
add ax, word[esi+APPDATA.wnd_clientbox.left]
add ebp, [window_data + edi + WDATA.clientbox.left]
add ax, word[window_data + edi + WDATA.clientbox.left]
add ebp, ebx
shl eax, 16
movzx ebx, word[edi + window_data + WDATA.box.top]
movzx ebx, word[window_data + edi + WDATA.box.top]
add eax, ebp
mov ebp, ebx
add ebp, [esi+APPDATA.wnd_clientbox.top]
add bx, word[esi+APPDATA.wnd_clientbox.top]
add ebp, [window_data + edi + WDATA.clientbox.top]
add bx, word[window_data + edi + WDATA.clientbox.top]
add ebp, ecx
shl ebx, 16
xor edi, edi
411,17 → 406,18
;> ebx = 1
;> ecx = scale power (resulting scale is 2^ebx)
syscall_set_window_shape:
mov edi, [current_slot]
mov edi, [current_slot_idx]
shl edi, BSF sizeof.WDATA
 
test ebx, ebx
jne .shape_scale
mov [edi + APPDATA.wnd_shape], ecx
mov [window_data + edi + WDATA.shape], ecx
;--------------------------------------
align 4
.shape_scale:
dec ebx
jnz .exit
mov [edi + APPDATA.wnd_shape_scale], ecx
mov [window_data + edi + WDATA.shape_scale], ecx
;--------------------------------------
align 4
.exit:
498,8 → 494,8
jc @f
xor edx, edx
@@:
mov [edi*8 + SLOT_BASE + APPDATA.wnd_caption], ecx
mov [edi*8 + SLOT_BASE + APPDATA.captionEncoding], dl
mov [window_data + edi + WDATA.caption], ecx
mov [window_data + edi + WDATA.captionEncoding], dl
jmp window._.draw_window_caption
;------------------------------------------------------------------------------
 
561,7 → 557,7
movzx edi, word[WIN_POS + esi * 2]
shl edi, BSF sizeof.WDATA ;size of TASKDATA and WDATA = 32 bytes
 
cmp byte [SLOT_BASE + edi*8 + APPDATA.state], TSTATE_FREE
cmp byte [SLOT_BASE + edi*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.state], TSTATE_FREE
je .skip_window
 
add edi, window_data
1090,10 → 1086,10
movzx edi, word[WIN_POS + eax * 2]
shl edi, BSF sizeof.WDATA
; it is a unused slot?
cmp byte [SLOT_BASE + edi*8 + APPDATA.state], TSTATE_FREE
cmp byte [SLOT_BASE + edi*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.state], TSTATE_FREE
je @f
; it is a hidden thread?
lea esi, [SLOT_BASE + edi*8 + APPDATA.app_name]
lea esi, [SLOT_BASE + edi*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.app_name]
cmp [esi], byte '@'
je @f
; is it already minimized?
1549,7 → 1545,7
 
mov eax, edi
sub eax, window_data
shl eax, 3
shl eax, (BSF sizeof.APPDATA - BSF sizeof.WDATA)
add eax, SLOT_BASE
 
lea ebx, [edi + WDATA.box]
1584,8 → 1580,6
mov [window_topleft + 8 * 4 + 4], eax
 
mov ecx, edi
sub edi, window_data
shl edi, 3
test [ecx + WDATA.fl_wstyle], WSTYLE_CLIENTRELATIVE
jz .whole_window
 
1592,23 → 1586,23
movzx eax, [ecx + WDATA.fl_wstyle]
and eax, 0x0F
mov eax, [eax * 8 + window_topleft + 0]
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.left], eax
mov [ecx + WDATA.clientbox.left], eax
shl eax, 1
neg eax
add eax, [ecx + WDATA.box.width]
inc eax ;Leency: as window is created width+1 so client the same
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.width], eax
mov [ecx + WDATA.clientbox.width], eax
 
movzx eax, [ecx + WDATA.fl_wstyle]
and eax, 0x0F
push [eax * 8 + window_topleft + 0]
mov eax, [eax * 8 + window_topleft + 4]
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.top], eax
mov [ecx + WDATA.clientbox.top], eax
neg eax
sub eax, [esp]
add eax, [ecx + WDATA.box.height]
inc eax ;Leency: as window is created height+1 so client the same
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.height], eax
mov [ecx + WDATA.clientbox.height], eax
add esp, 4
jmp .exit
;--------------------------------------
1615,12 → 1609,12
align 4
.whole_window:
xor eax, eax
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.left], eax
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.top], eax
mov [ecx + WDATA.clientbox.left], eax
mov [ecx + WDATA.clientbox.top], eax
mov eax, [ecx + WDATA.box.width]
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.width], eax
mov [ecx + WDATA.clientbox.width], eax
mov eax, [ecx + WDATA.box.height]
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.height], eax
mov [ecx + WDATA.clientbox.height], eax
;--------------------------------------
align 4
.exit:
1666,9 → 1660,9
mov cl, [edi + WDATA.fl_wstyle]
mov eax, [edi + WDATA.cl_frames]
 
mov esi, [esp]
sub edi, window_data
shl edi, 3
add edi, SLOT_BASE
shl edi, (BSF sizeof.APPDATA - BSF sizeof.WDATA)
 
and cl, 0x0F
cmp cl, 3
1680,10 → 1674,9
;--------------------------------------
align 4
@@:
mov [edi + APPDATA.wnd_caption], eax
mov [esi + WDATA.caption], eax
 
mov esi, [esp]
add edi, APPDATA.saved_box
add edi, SLOT_BASE + APPDATA.saved_box
movsd
movsd
movsd
1866,10 → 1859,12
 
pushad
 
mov edi, esi
shl edi, BSF sizeof.WDATA
 
cmp esi, 1
jz .check_for_shaped_window
mov edi, esi
shl edi, BSF sizeof.WDATA
 
cmp [window_data + edi + WDATA.box.width], 0
jnz .check_for_shaped_window
cmp [window_data + edi + WDATA.box.height], 0
1877,10 → 1872,7
;--------------------------------------
align 4
.check_for_shaped_window:
mov edi, esi
shl edi, BSF sizeof.APPDATA
add edi, SLOT_BASE
cmp [edi + APPDATA.wnd_shape], 0
cmp [window_data + edi + WDATA.shape], 0
jne .shaped_window
 
; get x&y size
1930,7 → 1922,7
inc ecx
inc edx
 
push [edi + APPDATA.wnd_shape_scale] ; push scale first -> for loop
push [window_data + edi + WDATA.shape_scale] ; push scale first -> for loop
 
; get WinMap start -> ebp
push eax
1940,7 → 1932,7
add eax, [_display.win_map]
mov ebp, eax
 
mov edi, [edi + APPDATA.wnd_shape]
mov edi, [window_data + edi + WDATA.shape]
pop eax
 
; eax = x_start
2178,7 → 2170,7
 
mov eax, edi
sub eax, window_data
shr eax, 5
shr eax, BSF sizeof.WDATA
 
movzx eax, word[WIN_STACK + eax * 2] ; get value of the curr process
lea esi, [WIN_POS + eax * 2] ; get address of this process at 0xC400
2195,7 → 2187,7
 
movzx edx, word[esi]
shl edx, BSF sizeof.WDATA ; size of TASKDATA and WDATA is 32 bytes
cmp byte [SLOT_BASE + edx*8 - sizeof.APPDATA + APPDATA.state], TSTATE_FREE
cmp byte [SLOT_BASE + edx*(sizeof.APPDATA/sizeof.WDATA) - sizeof.APPDATA + APPDATA.state], TSTATE_FREE
je .next_window
 
mov eax, [edi + WDATA.box.top]
2250,7 → 2242,7
align 4
@@:
mov edx, [current_slot_idx]
shl edx, 5
shl edx, BSF sizeof.WDATA
add edx, window_data
movzx ebx, [edx + WDATA.fl_wstyle]
and bl, 0x0F
2287,9 → 2279,9
.2:
mov edi, [current_slot_idx]
shl edi, BSF sizeof.WDATA
test [edi + window_data + WDATA.fl_wstyle], WSTYLE_HASCAPTION
test [window_data + edi + WDATA.fl_wstyle], WSTYLE_HASCAPTION
jz .exit
mov edx, [edi * 8 + SLOT_BASE + APPDATA.wnd_caption]
mov edx, [window_data + edi + WDATA.caption]
or edx, edx
jz .exit
 
2332,7 → 2324,7
mov esi, eax
add ebx, ebp
mov ecx, [common_colours + 16]
mov al, [edi*8 + SLOT_BASE + APPDATA.captionEncoding]
mov al, [window_data + edi + WDATA.captionEncoding]
test al, al
jnz @f
mov al, 1
2463,7 → 2455,7
movzx edi, word[WIN_POS + esi * 2]
shl edi, BSF sizeof.WDATA ;size of TASKDATA and WDATA = 32 bytes
 
cmp byte [SLOT_BASE + edi*8 + APPDATA.state], TSTATE_FREE
cmp byte [SLOT_BASE + edi*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.state], TSTATE_FREE
je .skip_window
 
add edi, window_data