Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9929 → Rev 9930

/kernel/trunk/gui/background.inc
289,11 → 289,12
jnz nosb8
 
mov ecx, [current_slot]
mov ecx, [ecx + APPDATA.window]
xor eax, eax
xchg eax, [ecx + APPDATA.draw_bgr_x]
xchg eax, [ecx + WDATA.draw_bgr_x]
mov [esp + SYSCALL_STACK.eax], eax ; eax = [left]*65536 + [right]
xor eax, eax
xchg eax, [ecx + APPDATA.draw_bgr_y]
xchg eax, [ecx + WDATA.draw_bgr_y]
mov [esp + SYSCALL_STACK.ebx], eax ; ebx = [top]*65536 + [bottom]
ret
;---------------------------------------
328,11 → 329,11
 
mov [background_defined], 1
 
mov [draw_data + sizeof.WDATA + RECT.left], eax
mov [draw_data + sizeof.WDATA + RECT.top], ebx
mov [background_window + WDATA.draw_data.left], eax
mov [background_window + WDATA.draw_data.top], ebx
 
mov [draw_data + sizeof.WDATA + RECT.right], ecx
mov [draw_data + sizeof.WDATA + RECT.bottom], edx
mov [background_window + WDATA.draw_data.right], ecx
mov [background_window + WDATA.draw_data.bottom], edx
 
inc [REDRAW_BACKGROUND]
call wakeup_osloop
353,15 → 354,15
 
align 4
force_redraw_background:
and [draw_data + sizeof.WDATA + RECT.left], 0
and [draw_data + sizeof.WDATA + RECT.top], 0
and [background_window + WDATA.draw_data.left], 0
and [background_window + WDATA.draw_data.top], 0
push eax ebx
mov eax, [_display.width]
mov ebx, [_display.height]
dec eax
dec ebx
mov [draw_data + sizeof.WDATA + RECT.right], eax
mov [draw_data + sizeof.WDATA + RECT.bottom], ebx
mov [background_window + WDATA.draw_data.right], eax
mov [background_window + WDATA.draw_data.bottom], ebx
pop ebx eax
inc [REDRAW_BACKGROUND]
call wakeup_osloop
424,7 → 425,7
; esi - buffer of 0x00RRGGBB
mov eax, [img_background]
cmp eax, static_background_data
jz .ret_39_3
jz .fail_39_3
align 4
@@:
movzx eax, cx ; store y in eax
489,12 → 490,13
.end_copy_rect:
xor eax, eax
mov [esp + SYSCALL_STACK.eax], eax
align 4
.ret_39_3:
ret
;--------------------------------------
align 4
.fail_39_3:
mov eax, -1
align 4
.ret_39_3:
mov [esp + SYSCALL_STACK.eax], -1
ret
;--------------------------------------
align 4
/kernel/trunk/gui/mouse.inc
390,15 → 390,15
.set_resizing_cursor:
; DEBUGF 1, ".set_resizing_cursor eax = %x\n", eax
; change cursor to resizing cursor
shl esi, BSF sizeof.APPDATA
add esi, SLOT_BASE
shl esi, BSF sizeof.WDATA
add esi, window_data
; if resizing cursor we need (eax) isnt set already, set it
cmp eax, [esi + APPDATA.cursor]
cmp eax, [esi + WDATA.cursor]
je @f
; DEBUGF 1, "changing cursor to resizing\n"
xchg eax, [esi + APPDATA.cursor] ; set resizing cursor, prev cursor goes to eax
xchg eax, [esi + WDATA.cursor] ; set resizing cursor, prev cursor goes to eax
; save previous cursor (will be restored when we'll get out of the resizing area)
; if we change resizing cursor to resizing cursor then dont update previous cursor
cmp eax, [def_cursor_hresize]
410,7 → 410,7
cmp eax, [def_cursor_dresize2]
je @f
 
mov [esi + APPDATA.temp_cursor], eax ; save prev cursor
mov [esi + WDATA.temp_cursor], eax ; save prev cursor
 
@@:
jmp .end1
417,16 → 417,16
.not_in_resize_area:
; DEBUGF 1, ".not_in_resize_area\n"
 
shl esi, BSF sizeof.APPDATA
add esi, SLOT_BASE
mov eax, [esi + APPDATA.temp_cursor]
shl esi, BSF sizeof.WDATA
add esi, window_data
mov eax, [esi + WDATA.temp_cursor]
 
test eax, eax
jz .end1
; restore prev cursor
mov [esi + APPDATA.temp_cursor], 0
mov [esi + APPDATA.cursor], eax
mov [esi + WDATA.temp_cursor], 0
mov [esi + WDATA.cursor], eax
 
.end1:
pop ebx eax
819,15 → 819,15
mov eax, [MOUSE_X]
shl eax, 16
mov ax, [MOUSE_Y]
mov esi, [current_slot_idx]
shl esi, BSF sizeof.WDATA
mov bx, word[window_data + esi + WDATA.box.left]
mov esi, [current_slot]
mov esi, [esi + APPDATA.window]
mov bx, word[esi + WDATA.box.left]
shl ebx, 16
mov bx, word[window_data + esi + WDATA.box.top]
mov bx, word[esi + WDATA.box.top]
sub eax, ebx
sub ax, word[window_data + esi + WDATA.clientbox.top]
sub ax, word[esi + WDATA.clientbox.top]
rol eax, 16
sub ax, word[window_data + esi + WDATA.clientbox.left]
sub ax, word[esi + WDATA.clientbox.left]
rol eax, 16
mov [esp + SYSCALL_STACK.eax], eax
ret
/kernel/trunk/gui/window.inc
78,12 → 78,12
mov eax, ebx
mov ebx, ecx
mov ecx, edx
mov edx, [current_slot_idx]
shl edx, BSF sizeof.WDATA
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]
mov edx, [current_slot]
mov edx, [edx + APPDATA.window]
add eax, [edx + WDATA.box.left]
add ebx, [edx + WDATA.box.top]
add eax, [edx + WDATA.clientbox.left]
add ebx, [edx + WDATA.clientbox.top]
xor edi, edi ; no force
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
jmp __sys_putpixel
103,13 → 103,13
pop esi
jnz .err
 
mov eax, [current_slot_idx]
shl eax, BSF sizeof.WDATA
mov ebp, [window_data + eax + WDATA.box.left]
add ebp, [window_data + eax + WDATA.clientbox.left]
mov eax, [current_slot]
mov eax, [eax + APPDATA.window]
mov ebp, [eax + WDATA.box.left]
add ebp, [eax + WDATA.clientbox.left]
shl ebp, 16
add ebp, [window_data + eax + WDATA.box.top]
add bp, word[window_data + eax + WDATA.clientbox.top]
add ebp, [eax + WDATA.box.top]
add bp, word[eax + WDATA.clientbox.top]
test ecx, 0x08000000 ; redirect the output to the user area
jnz @f
add ebx, ebp
147,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_idx]
shl esi, BSF sizeof.WDATA
add eax, [window_data + esi + WDATA.clientbox.left]
add ebx, [window_data + esi + WDATA.clientbox.top]
mov esi, [current_slot]
mov esi, [esi + APPDATA.window]
add eax, [esi + WDATA.clientbox.left]
add ebx, [esi + WDATA.clientbox.top]
add ecx, eax
add edx, ebx
jmp vesa20_drawbar
161,19 → 161,19
align 4
; system function 38
syscall_drawline:
mov edi, [current_slot_idx]
shl edi, BSF sizeof.WDATA
movzx eax, word[window_data + edi + WDATA.box.left]
mov edi, [current_slot]
mov edi, [edi + APPDATA.window]
movzx eax, word[edi + WDATA.box.left]
mov ebp, eax
add ebp, [window_data + edi + WDATA.clientbox.left]
add ax, word[window_data + edi + WDATA.clientbox.left]
add ebp, [edi + WDATA.clientbox.left]
add ax, word[edi + WDATA.clientbox.left]
add ebp, ebx
shl eax, 16
movzx ebx, word[window_data + edi + WDATA.box.top]
movzx ebx, word[edi + WDATA.box.top]
add eax, ebp
mov ebp, ebx
add ebp, [window_data + edi + WDATA.clientbox.top]
add bx, word[window_data + edi + WDATA.clientbox.top]
add ebp, [edi + WDATA.clientbox.top]
add bx, word[edi + WDATA.clientbox.top]
add ebp, ecx
shl ebx, 16
xor edi, edi
483,9 → 483,9
 
; system function 71
syscall_window_settings:
mov edi, [current_slot_idx]
shl edi, BSF sizeof.WDATA
or [edi + window_data + WDATA.fl_wstyle], WSTYLE_HASCAPTION
mov edi, [current_slot]
mov edi, [edi + APPDATA.window]
or [edi + WDATA.fl_wstyle], WSTYLE_HASCAPTION
cmp ebx, 2
jz @f
xor edx, edx
494,14 → 494,14
jc @f
xor edx, edx
@@:
mov [window_data + edi + WDATA.caption], ecx
mov [window_data + edi + WDATA.captionEncoding], dl
mov [edi + WDATA.caption], ecx
mov [edi + WDATA.captionEncoding], dl
jmp window._.draw_window_caption
;------------------------------------------------------------------------------
 
align 4
set_window_defaults:
mov byte [window_data + sizeof.WDATA + WDATA.cl_titlebar + 3], 1 ; desktop is not movable
mov byte [background_window + WDATA.cl_titlebar + 3], 1 ; desktop is not movable
push eax ecx
xor eax, eax
mov ecx, WIN_STACK
555,10 → 555,10
align 4
.next_window:
movzx edi, word[WIN_POS + esi * 2]
shl edi, BSF sizeof.WDATA ;size of TASKDATA and WDATA = 32 bytes
shl edi, BSF sizeof.WDATA
 
cmp byte [SLOT_BASE + edi*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.state], TSTATE_FREE
je .skip_window
test byte [window_data + edi + WDATA.fl_wstate], WSTATE_USED
jz .skip_window
 
add edi, window_data
test [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
1086,17 → 1086,17
movzx edi, word[WIN_POS + eax * 2]
shl edi, BSF sizeof.WDATA
; it is a unused slot?
cmp byte [SLOT_BASE + edi*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.state], TSTATE_FREE
je @f
test byte [window_data + edi + WDATA.fl_wstate], WSTATE_USED
jz @f
; it is a hidden thread?
lea esi, [SLOT_BASE + edi*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.app_name]
cmp [esi], byte '@'
je @f
; is it already minimized?
test [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED
test [window_data + edi + WDATA.fl_wstate], WSTATE_MINIMIZED
jnz @f
; no it's not, let's do that
or [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED
or [window_data + edi + WDATA.fl_wstate], WSTATE_MINIMIZED
inc edx
;--------------------------------------
align 4
1291,13 → 1291,10
;--------------------------------------
align 4
.restore_size:
mov eax, esi
shl eax, BSF sizeof.APPDATA
add eax, SLOT_BASE + APPDATA.saved_box
push [eax + BOX.height] \
[eax + BOX.width] \
[eax + BOX.top] \
[eax + BOX.left]
push [edi + WDATA.saved_box.height] \
[edi + WDATA.saved_box.width] \
[edi + WDATA.saved_box.top] \
[edi + WDATA.saved_box.left]
mov eax, esp
;--------------------------------------
align 4
1325,10 → 1322,6
align 4
;> esi = process slot
sys_window_rollup_handler:
mov edx, esi
shl edx, BSF sizeof.APPDATA
add edx, SLOT_BASE
 
; toggle normal/rolled up window state
mov bl, [edi + WDATA.fl_wstate]
xor bl, WSTATE_ROLLEDUP
1350,7 → 1343,7
test bl, WSTATE_MAXIMIZED
jnz @f
add esp, -sizeof.BOX
lea eax, [edx + APPDATA.saved_box]
lea eax, [edi + WDATA.saved_box]
jmp .set_box
;--------------------------------------
align 4
1543,17 → 1536,12
test cl, WSTATE_MAXIMIZED
jnz .exit
 
mov eax, edi
sub eax, window_data
shl eax, (BSF sizeof.APPDATA - BSF sizeof.WDATA)
add eax, SLOT_BASE
 
lea ebx, [edi + WDATA.box]
xchg esp, ebx
 
pop [eax + APPDATA.saved_box.left] \
[eax + APPDATA.saved_box.top] \
[eax + APPDATA.saved_box.width] \
pop [edi + WDATA.saved_box.left] \
[edi + WDATA.saved_box.top] \
[edi + WDATA.saved_box.width] \
edx
 
xchg esp, ebx
1561,7 → 1549,7
test ch, WSTATE_ROLLEDUP
jnz .exit
 
mov [eax + APPDATA.saved_box.height], edx
mov [edi + WDATA.saved_box.height], edx
;--------------------------------------
align 4
.exit:
1661,8 → 1649,6
mov eax, [edi + WDATA.cl_frames]
 
mov esi, [esp]
sub edi, window_data
shl edi, (BSF sizeof.APPDATA - BSF sizeof.WDATA)
 
and cl, 0x0F
cmp cl, 3
1676,7 → 1662,7
@@:
mov [esi + WDATA.caption], eax
 
add edi, SLOT_BASE + APPDATA.saved_box
add edi, WDATA.saved_box
movsd
movsd
movsd
2186,7 → 2172,7
ja .exit.no_redraw
 
movzx edx, word[esi]
shl edx, BSF sizeof.WDATA ; size of TASKDATA and WDATA is 32 bytes
shl edx, BSF sizeof.WDATA
cmp byte [SLOT_BASE + edx*(sizeof.APPDATA/sizeof.WDATA) - sizeof.APPDATA + APPDATA.state], TSTATE_FREE
je .next_window
 
2453,10 → 2439,10
align 4
.next_window:
movzx edi, word[WIN_POS + esi * 2]
shl edi, BSF sizeof.WDATA ;size of TASKDATA and WDATA = 32 bytes
shl edi, BSF sizeof.WDATA
 
cmp byte [SLOT_BASE + edi*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.state], TSTATE_FREE
je .skip_window
test byte [window_data + edi + WDATA.fl_wstate], WSTATE_USED
jz .skip_window
 
add edi, window_data
test [edi + WDATA.fl_wstate], WSTATE_MINIMIZED