Direct window activation without osloop/checkwindows, straightforward window minimizing

git-svn-id: svn://kolibrios.org@105 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Ivan Poddubny 2006-07-25 10:48:35 +00:00
parent 45e9240e92
commit 82859246df
4 changed files with 94 additions and 106 deletions

View File

@ -872,8 +872,6 @@ terminate: ; terminate application
je .check_next_window je .check_next_window
add edi, window_data add edi, window_data
call waredraw call waredraw
mov [0xf400], byte 0
mov [0xf500], byte 0
.nothing_to_activate: .nothing_to_activate:
popad popad
.dont_activate: .dont_activate:

View File

@ -978,44 +978,11 @@ waredraw: ; if redraw necessary at activate
call setscreen call setscreen
popad popad
cmp [0xff01], dword 1 ; if > 1 then activate process
jbe .not_activate
;;; mov eax, 10 ; wait for putimages to finish
;;; call delay_hs
mov [edi+31],byte 1 ; redraw flag for app mov [edi+31],byte 1 ; redraw flag for app
mov [0xfb44],byte 0 ; mouse down checks mov [0xfb44],byte 0 ; mouse down checks
ret ret
.not_activate:
; mov eax,5 ; wait for putimages to finish
; call delay_hs
mov [edi+31],byte 1 ; redraw flag for app
mov ecx, 25 ;100
.waitflagdown:
dec ecx
jz .nowait
; mov eax, 2
; call delay_hs
cmp [edi+31], byte 0 ; wait flag to drop
jnz .waitflagdown
.nowait:
; mov ecx,10
; .wait:
; mov eax,1 ; wait for draw to finish
; call delay_hs
; loop .wait
mov [0xfb44],byte 0
ret
.do_not_draw: .do_not_draw:
popad popad
@ -1027,6 +994,66 @@ waredraw: ; if redraw necessary at activate
ret ret
; eax = window number on screen
; corrupts registers and [dl*]
minimize_window:
movzx eax, word [0xC400+eax*2]
shl eax, 5
add eax, window_data
test [eax+WDATA.fl_wstate], WSTATE_MINIMIZED
jnz .skip_redrawings
pushfd
cli
or [eax+WDATA.fl_wstate], WSTATE_MINIMIZED
mov edi, eax
call calculatescreen
mov eax, [edi+WDATA.left]
mov [dlx], eax
add eax, [edi+WDATA.width]
mov [dlxe], eax
mov eax, [edi+WDATA.top]
mov [dly], eax
add eax, [edi+WDATA.height]
mov [dlye], eax
xor esi, esi
xor eax, eax
call redrawscreen
popfd
.skip_redrawings:
ret
; eax = window number on screen
; corrupts registers and [dl*]
restore_minimized_window:
pushfd
cli
movzx esi, word [0xC400+eax*2]
mov edi, esi
shl edi, 5
add edi, window_data
test [edi+WDATA.fl_wstate], WSTATE_MINIMIZED
jz .skip_redrawings
mov [edi+WDATA.fl_redraw], 1
and [edi+WDATA.fl_wstate], not WSTATE_MINIMIZED
cmp eax, [0x3004] ; the uppermost window
jnz .no_uppermost
mov eax, [edi+WDATA.left]
mov ebx, [edi+WDATA.top]
mov ecx, eax
mov edx, ebx
add ecx, [edi+WDATA.width]
add edx, [edi+WDATA.height]
call setscreen
jmp .done
.no_uppermost:
call calculatescreen
.done:
mov [0xfff4],byte 0 ; no mouse under
.skip_redrawings:
popfd
ret
iglobal iglobal
window_moving db 'K : Window - move/resize',13,10,0 window_moving db 'K : Window - move/resize',13,10,0
window_moved db 'K : Window - done',13,10,0 window_moved db 'K : Window - done',13,10,0
@ -1037,40 +1064,24 @@ align 4
checkwindows: checkwindows:
pushad pushad
cmp [0xff01],dword 1 ; activate request from app ? cmp [window_minimize], 0
jbe .no_activate_request je .no_minimizing
mov edi,[0xff01] ; process number mov eax, [0x3004] ; the uppermost window
shl edi,5 mov bl, 0
add edi,window_data xchg [window_minimize], bl
mov ebx,[0xff01] cmp bl, 1
movzx esi, word [0xC000 + ebx * 2] jne .restore
lea esi, [0xC400 + esi * 2] call minimize_window
call waredraw jmp .continue
.restore:
call restore_minimized_window
.continue:
.no_minimizing:
mov [0xff01],dword 0 ; activated
popad
ret
.no_activate_request:
cmp [0xfb40],byte 0 ; mouse buttons pressed ? cmp [0xfb40],byte 0 ; mouse buttons pressed ?
jne .mouse_buttons_pressed jne .mouse_buttons_pressed
cmp [window_minimize],0
je .no_activate_request_2
cmp [window_minimize],1
je .mouse_buttons_pressed
mov esi,[0x3004]
movzx edi, word [0xC400 + esi * 2]
shl edi, 5
add edi, window_data
test [edi+WDATA.fl_wstate],WSTATE_MINIMIZED
jnz .mouse_buttons_pressed
.no_activate_request_2:
mov [window_minimize],0
popad popad
ret ret
.mouse_buttons_pressed: .mouse_buttons_pressed:
mov esi,[0x3004] mov esi,[0x3004]
@ -1079,7 +1090,7 @@ checkwindows:
cwloop: cwloop:
cmp esi,2 cmp esi,2
jb .exit jb .exit
.temp_window_minimize_1:
dec esi dec esi
movzx edi, word [0xC400 + esi * 2] ; ebx movzx edi, word [0xC400 + esi * 2] ; ebx
shl edi, 5 shl edi, 5
@ -1090,8 +1101,6 @@ checkwindows:
mov eax,ecx mov eax,ecx
mov ebx,edx mov ebx,edx
cmp [window_minimize],1
jge .window_minimize_no_check_mouse
test [edi+WDATA.fl_wstate],WSTATE_MINIMIZED test [edi+WDATA.fl_wstate],WSTATE_MINIMIZED
jnz cwloop jnz cwloop
@ -1109,8 +1118,6 @@ checkwindows:
cmp ebx, edx cmp ebx, edx
jae cwloop jae cwloop
.window_minimize_no_check_mouse:
pushad pushad
mov eax, esi mov eax, esi
mov ebx, [0x3004] mov ebx, [0x3004]
@ -1172,7 +1179,7 @@ checkwindows:
call sys_msg_board_str call sys_msg_board_str
pop esi pop esi
mov ecx, [timer_ticks] ;[0xfdf0] ; double-click ? mov ecx, [timer_ticks] ; double-click ?
mov edx, ecx mov edx, ecx
sub edx, [latest_window_touch] sub edx, [latest_window_touch]
mov [latest_window_touch], ecx mov [latest_window_touch], ecx
@ -1369,7 +1376,6 @@ checkwindows:
cmp [reposition],1 ; save new position and size cmp [reposition],1 ; save new position and size
jne no_bounds_save jne no_bounds_save
; <IP 28.08.2004>
push esi edi ecx push esi edi ecx
mov esi,edi mov esi,edi
mov ecx,2 mov ecx,2
@ -1383,7 +1389,6 @@ checkwindows:
cld cld
rep movsd rep movsd
pop ecx edi esi pop ecx edi esi
; </IP 28.08.2004>
no_bounds_save: no_bounds_save:
pushad ; WINDOW SHADE/FULLSCREEN pushad ; WINDOW SHADE/FULLSCREEN
@ -1396,21 +1401,6 @@ checkwindows:
shl edx,8 shl edx,8
add edx,0x80000 ; process base at 0x80000+ add edx,0x80000 ; process base at 0x80000+
cmp [window_minimize],0
je no_wnd_minimize_restore
mov [reposition],1
wnd_minimize:
cmp [window_minimize],1
jne wnd_restore
or [edi+WDATA.fl_wstate],WSTATE_MINIMIZED
jmp no_wnd_minimize_restore
wnd_restore:
cmp [window_minimize],2
jne no_wnd_minimize_restore
and [edi+WDATA.fl_wstate],not WSTATE_MINIMIZED
no_wnd_minimize_restore:
cmp [do_resize],2 ; window shade ? cmp [do_resize],2 ; window shade ?
jne no_window_shade jne no_window_shade
mov [reposition],1 mov [reposition],1
@ -1527,8 +1517,6 @@ checkwindows:
popad popad
mov [window_minimize],0
ret ret

View File

@ -2182,21 +2182,24 @@ sysfn_terminate2:
ret ret
sysfn_activate: ; 18.3 = ACTIVATE WINDOW sysfn_activate: ; 18.3 = ACTIVATE WINDOW
;* start code - get active process (1) - Mario79
mov [window_minimize],2
;* end code - get active process (1) - Mario79
cmp ebx,2 cmp ebx,2
jb nowindowactivate jb .nowindowactivate
cmp ebx,[0x3004] cmp ebx,[0x3004]
ja nowindowactivate ja .nowindowactivate
; edi = position at window_data+
mov edi, ebx ; edi = process number mov [window_minimize], 2 ; restore window if minimized
movzx esi, word [0xC000 + ebx*2]
cmp esi, [0x3004] ; number of processes movzx esi, word [0xC000 + ebx*2]
jz nowindowactivate ; continue if window_stack_value != number_of_processes cmp esi, [0x3004]
; i.e. if window is not already active je .nowindowactivate ; already active
mov [0xff01],edi ; activate
nowindowactivate: mov edi, ebx
shl edi, 5
add edi, window_data
movzx esi, word [0xC000 + ebx * 2]
lea esi, [0xC400 + esi * 2]
call waredraw
.nowindowactivate:
ret ret
sysfn_getidletime: ; 18.4 = GET IDLETIME sysfn_getidletime: ; 18.4 = GET IDLETIME
@ -3203,10 +3206,9 @@ checkpixel:
imul edx, ebx imul edx, ebx
mov dl, [eax+edx+display_data] ; lea eax, [...] mov dl, [eax+edx+display_data] ; lea eax, [...]
mov eax, [0x3010]
xor ecx, ecx xor ecx, ecx
cmp byte [eax+0xe], dl mov eax, [0x3000]
cmp al, dl
setne cl setne cl
pop edx eax pop edx eax

View File

@ -110,7 +110,7 @@
; FE88 dword address of button list ; FE88 dword address of button list
; FE8C dword memory to use ; FE8C dword memory to use
; FF00 byte 1 = system shutdown request ; FF00 byte 1 = system shutdown request
; FF01 dword if >1 then activate process ; FF01 dword free
; FFF0 byte 1 = redraw background request from app ; FFF0 byte 1 = redraw background request from app
; FFF1 byte 1 = diskette int occur ; FFF1 byte 1 = diskette int occur
; FFF2 write and read bank in screen ; FFF2 write and read bank in screen