Sync net branch with trunk
git-svn-id: svn://kolibrios.org@2540 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
|
||||
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision$
|
||||
$Revision $
|
||||
|
||||
WINDOW_MOVE_AND_RESIZE_FLAGS = \
|
||||
mouse.WINDOW_RESIZE_N_FLAG + \
|
||||
@@ -22,33 +22,38 @@ align 4
|
||||
endg
|
||||
EV_SPACE = 512
|
||||
FreeEvents = event_start-EVENT.fd ; "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" event, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
; FreeEvents.fd=event_start <EFBFBD> FreeEvents.bk=event_end
|
||||
align 4
|
||||
init_events: ;; used from kernel.asm
|
||||
stdcall kernel_alloc, EV_SPACE*sizeof.EVENT
|
||||
or eax, eax
|
||||
jz .fail
|
||||
; eax - current event, ebx - previos event below
|
||||
; FreeEvents.fd=event_start <EFBFBD> FreeEvents.bk=event_end
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
init_events: ;; used from kernel.asm
|
||||
stdcall kernel_alloc, EV_SPACE*sizeof.EVENT
|
||||
or eax, eax
|
||||
jz .fail
|
||||
; eax - current event, ebx - previos event below
|
||||
mov ecx, EV_SPACE ; current - in allocated space
|
||||
mov ebx, FreeEvents ; previos - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
push ebx ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@:
|
||||
mov [ebx+EVENT.fd], eax
|
||||
mov [eax+EVENT.bk], ebx
|
||||
mov ebx, eax ; previos <- current
|
||||
add eax, sizeof.EVENT ; new current
|
||||
loop @b
|
||||
pop eax ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov [ebx+EVENT.fd], eax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov [ebx+EVENT.fd], eax
|
||||
mov [eax+EVENT.bk], ebx
|
||||
mov ebx, eax ; previos <- current
|
||||
add eax, sizeof.EVENT ; new current
|
||||
loop @b
|
||||
pop eax ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov [ebx+EVENT.fd], eax
|
||||
mov [eax+EVENT.bk], ebx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.fail:
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
EVENT_WATCHED equ 0x10000000 ;<EFBFBD><EFBFBD><EFBFBD> 28
|
||||
EVENT_SIGNALED equ 0x20000000 ;<EFBFBD><EFBFBD><EFBFBD> 29
|
||||
MANUAL_RESET equ 0x40000000 ;<EFBFBD><EFBFBD><EFBFBD> 30
|
||||
MANUAL_DESTROY equ 0x80000000 ;<EFBFBD><EFBFBD><EFBFBD> 31
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
create_event: ;; EXPORT use
|
||||
;info:
|
||||
@@ -67,7 +72,8 @@ create_event: ;; EXPORT use
|
||||
mov edx, [edx+TASKDATA.pid]
|
||||
pushfd
|
||||
cli
|
||||
|
||||
;--------------------------------------
|
||||
align 4
|
||||
set_event: ;; INTERNAL use !!! don't use for Call
|
||||
;info:
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> event <20><> FreeEvents, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ecx,edx,esi
|
||||
@@ -89,7 +95,9 @@ set_event: ;; INTERNAL use !!! don't use
|
||||
call init_events
|
||||
popad
|
||||
jz RemoveEventTo.break ; POPF+RET
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov eax, [eax+EVENT.fd]
|
||||
mov [eax+EVENT.magic], 'EVNT'
|
||||
mov [eax+EVENT.destroy], destroy_event.internal
|
||||
@@ -97,13 +105,14 @@ set_event: ;; INTERNAL use !!! don't use
|
||||
mov [eax+EVENT.pid], edx
|
||||
inc [event_uid]
|
||||
Mov [eax+EVENT.id],edx,[event_uid]
|
||||
or esi, esi
|
||||
jz RemoveEventTo
|
||||
lea edi, [eax+EVENT.code]
|
||||
mov ecx, (sizeof.EVENT -EVENT.code)/4
|
||||
cld
|
||||
rep movsd
|
||||
|
||||
or esi, esi
|
||||
jz RemoveEventTo
|
||||
lea edi, [eax+EVENT.code]
|
||||
mov ecx, (sizeof.EVENT -EVENT.code)/4
|
||||
cld
|
||||
rep movsd
|
||||
;--------------------------------------
|
||||
align 4
|
||||
RemoveEventTo: ;; INTERNAL use !!! don't use for Call
|
||||
;param:
|
||||
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> event, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -118,10 +127,12 @@ RemoveEventTo: ;; INTERNAL use !!! don't use
|
||||
xchg ecx, [eax+EVENT.fd] ; Self.fd=NewRight, ecx=OldRight
|
||||
mov [ebx+EVENT.fd], ecx ; OldLeft.fd=OldRight
|
||||
mov [ecx+EVENT.bk], ebx ; OldRight.bk=OldLeft
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.break:
|
||||
popfd
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
NotDummyTest: ;; INTERNAL use (not returned for fail !!!)
|
||||
pop edi
|
||||
@@ -129,6 +140,8 @@ NotDummyTest: ;; INTERNAL use (not returned
|
||||
mov ebx, eax
|
||||
mov eax, [ebx+EVENT.pid]
|
||||
push edi
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.small: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD>...
|
||||
pop edi
|
||||
pushfd
|
||||
@@ -137,7 +150,7 @@ NotDummyTest: ;; INTERNAL use (not returned
|
||||
shl eax, 8
|
||||
jz RemoveEventTo.break ; POPF+RET
|
||||
jmp edi ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
raise_event: ;; EXPORT use
|
||||
;info:
|
||||
@@ -152,25 +165,29 @@ raise_event: ;; EXPORT use
|
||||
; esi - event data (=0 => skip)
|
||||
;scratched: ebx,ecx,esi,edi
|
||||
call NotDummyTest ; not returned for fail !!!
|
||||
or esi, esi
|
||||
jz @f
|
||||
lea edi, [ebx+EVENT.code]
|
||||
mov ecx, (sizeof.EVENT -EVENT.code)/4
|
||||
cld
|
||||
rep movsd
|
||||
@@:
|
||||
or esi, esi
|
||||
jz @f
|
||||
lea edi, [ebx+EVENT.code]
|
||||
mov ecx, (sizeof.EVENT -EVENT.code)/4
|
||||
cld
|
||||
rep movsd
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
test byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24
|
||||
jnz RemoveEventTo.break ; POPF+RET
|
||||
bt edx, 28 ;EVENT_WATCHED
|
||||
jnc @f
|
||||
test byte[ebx+EVENT.state+3], EVENT_WATCHED shr 24
|
||||
jz RemoveEventTo.break ; POPF+RET
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
or byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24
|
||||
add eax, SLOT_BASE+APP_EV_OFFSET
|
||||
xchg eax, ebx
|
||||
jmp RemoveEventTo
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
clear_event: ;; EXPORT use
|
||||
;info:
|
||||
@@ -184,7 +201,7 @@ clear_event: ;; EXPORT use
|
||||
and byte[ebx+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24)
|
||||
xchg eax, ebx
|
||||
jmp RemoveEventTo
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
send_event: ;; EXPORT use
|
||||
;info:
|
||||
@@ -207,7 +224,7 @@ send_event: ;; EXPORT use
|
||||
lea ebx, [eax+SLOT_BASE+APP_EV_OFFSET]
|
||||
mov ecx, EVENT_SIGNALED
|
||||
jmp set_event
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
DummyTest: ;; INTERNAL use (not returned for fail !!!)
|
||||
;param:
|
||||
@@ -217,16 +234,21 @@ DummyTest: ;; INTERNAL use (not returned
|
||||
jne @f
|
||||
cmp [eax+EVENT.id], ebx
|
||||
je .ret
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
pop eax
|
||||
xor eax, eax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ret:
|
||||
ret
|
||||
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
Wait_events:
|
||||
or ebx, -1; infinite timeout
|
||||
;--------------------------------------
|
||||
align 4
|
||||
Wait_events_ex:
|
||||
;info:
|
||||
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> 5-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
@@ -260,9 +282,11 @@ Wait_events_ex:
|
||||
mov [eax+TASKDATA.state], 5
|
||||
call change_task
|
||||
mov eax, [esi+APPDATA.wait_param]
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
wait_event: ;; EXPORT use
|
||||
;info:
|
||||
@@ -281,7 +305,7 @@ wait_event: ;; EXPORT use
|
||||
mov edx, get_event_alone ; wait_test
|
||||
call Wait_events ; timeout ignored
|
||||
jmp wait_finish
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
get_event_ex: ;; f68:14
|
||||
;info:
|
||||
@@ -296,16 +320,18 @@ get_event_ex: ;; f68:14
|
||||
;retval:
|
||||
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
;scratched: ebx,ecx,edx,esi,edi
|
||||
mov edx, get_event_queue ; wait_test
|
||||
call Wait_events ; timeout ignored
|
||||
lea esi, [eax+EVENT.code]
|
||||
mov ecx, (sizeof.EVENT-EVENT.code)/4
|
||||
cld
|
||||
rep movsd
|
||||
mov byte[edi-(sizeof.EVENT-EVENT.code)+2], cl;clear priority field
|
||||
wait_finish:
|
||||
test byte[eax+EVENT.state+3], MANUAL_RESET shr 24
|
||||
jnz get_event_queue.ret ; RET
|
||||
mov edx, get_event_queue ; wait_test
|
||||
call Wait_events ; timeout ignored
|
||||
lea esi, [eax+EVENT.code]
|
||||
mov ecx, (sizeof.EVENT-EVENT.code)/4
|
||||
cld
|
||||
rep movsd
|
||||
mov byte[edi-(sizeof.EVENT-EVENT.code)+2], cl;clear priority field
|
||||
;--------------------------------------
|
||||
align 4
|
||||
wait_finish:
|
||||
test byte[eax+EVENT.state+3], MANUAL_RESET shr 24
|
||||
jnz get_event_queue.ret ; RET
|
||||
and byte[eax+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24)
|
||||
test byte[eax+EVENT.state+3], MANUAL_DESTROY shr 24
|
||||
jz destroy_event.internal
|
||||
@@ -314,7 +340,7 @@ wait_finish:
|
||||
pushfd
|
||||
cli
|
||||
jmp RemoveEventTo
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
destroy_event: ;; EXPORT use
|
||||
;info:
|
||||
@@ -326,6 +352,8 @@ destroy_event: ;; EXPORT use
|
||||
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT (=0 => fail)
|
||||
;scratched: ebx,ecx
|
||||
call DummyTest ; not returned for fail !!!
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.internal:
|
||||
xor ecx, ecx ; clear common header
|
||||
pushfd
|
||||
@@ -336,7 +364,7 @@ destroy_event: ;; EXPORT use
|
||||
mov [eax+EVENT.id], ecx
|
||||
mov ebx, FreeEvents
|
||||
jmp RemoveEventTo
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
get_event_queue:
|
||||
;info:
|
||||
@@ -353,9 +381,11 @@ get_event_queue:
|
||||
mov eax, [ebx+APPOBJ.bk] ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FIFO
|
||||
cmp eax, ebx ; empty ???
|
||||
je get_event_alone.ret0
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ret:
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
get_event_alone:
|
||||
;info:
|
||||
@@ -372,21 +402,27 @@ get_event_alone:
|
||||
test byte[eax+EVENT.state+3], EVENT_SIGNALED shr 24
|
||||
jnz .ret
|
||||
or byte[eax+EVENT.state+3], EVENT_WATCHED shr 24
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ret0:
|
||||
xor eax, eax; NO event!!!
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ret:
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
sys_sendwindowmsg: ;; f72
|
||||
dec ebx
|
||||
jnz .ret ;subfunction==1 ?
|
||||
;pushfd ;<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
||||
pushfd
|
||||
cli
|
||||
sub ecx, 2
|
||||
je .sendkey
|
||||
dec ecx
|
||||
jnz .retf
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sendbtn:
|
||||
cmp byte[BTN_COUNT], 1
|
||||
jae .result ;overflow
|
||||
@@ -394,18 +430,27 @@ sys_sendwindowmsg: ;; f72
|
||||
shl edx, 8
|
||||
mov [BTN_BUFF], edx
|
||||
jmp .result
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sendkey:
|
||||
movzx eax, byte[KEY_COUNT]
|
||||
cmp al, 120
|
||||
jae .result ;overflow
|
||||
inc byte[KEY_COUNT]
|
||||
mov [KEY_COUNT+1+eax], dl
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.result:
|
||||
setae byte[esp+32] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: dword[esp+32]==72
|
||||
.retf: ;popfd
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.retf:
|
||||
popfd
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ret:
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
sys_getevent: ;; f11
|
||||
mov ebx, [current_slot];<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..........
|
||||
@@ -415,16 +460,18 @@ sys_getevent: ;; f11
|
||||
popfd
|
||||
mov [esp+32], eax
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
sys_waitforevent: ;; f10
|
||||
or ebx, -1; infinite timeout
|
||||
;--------------------------------------
|
||||
align 4
|
||||
sys_wait_event_timeout: ;; f23
|
||||
mov edx, get_event_for_app; wait_test
|
||||
call Wait_events_ex ; ebx - timeout
|
||||
mov [esp+32], eax
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
get_event_for_app: ;; used from f10,f11,f23
|
||||
;info:
|
||||
@@ -441,46 +488,78 @@ get_event_for_app: ;; used from f10,f11,f23
|
||||
shl edi, 5
|
||||
add edi, CURRENT_TASK ; edi is assumed as [TASK_BASE]
|
||||
mov ecx, [edi+TASKDATA.event_mask]
|
||||
and ecx, 0x7FFFFFFF
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.loop: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bsr eax, ecx ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (31 -> 0)
|
||||
jz .no_events ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ???
|
||||
btr ecx, eax ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (eax) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
cmp eax, 9
|
||||
jae .loop ; eax=[9..31], ignored
|
||||
jae .loop ; eax=[9..31], ignored (event 10...32)
|
||||
|
||||
cmp eax, 3
|
||||
je .loop ; eax=3, ignored
|
||||
ja .FlagAutoReset ; eax=[4..8], retvals=eax+1
|
||||
je .loop ; eax=3, ignored (event 4)
|
||||
|
||||
cmp eax, 4
|
||||
je .FlagAutoReset ; eax=4, retvals=eax+1 (event 5)
|
||||
|
||||
cmp eax, 5
|
||||
je .mouse_check ; eax=5, retvals=eax+1 (event 6)
|
||||
|
||||
ja .FlagAutoReset ; eax=[6..8], retvals=eax+1 (event 7...9)
|
||||
|
||||
cmp eax, 1
|
||||
jae .BtKy ; eax=[1,2], retvals=eax+1
|
||||
jae .BtKy ; eax=[1,2], retvals=eax+1 (event 2,3)
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.WndRedraw: ; eax=0, retval WndRedraw=1
|
||||
cmp [edi-twdw+WDATA.fl_redraw], al;al==0
|
||||
jne .result
|
||||
jmp .loop
|
||||
.no_events:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_events:
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
.FlagAutoReset: ; retvals: BgrRedraw=5, Mouse=6, IPC=7, Stack=8, Debug=9
|
||||
cmp eax, 5; Mouse 5+1=6
|
||||
jne @f
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.mouse_check: ; Mouse 5+1=6
|
||||
push eax
|
||||
mov eax, [TASK_BASE]
|
||||
mov eax, [eax + TASKDATA.event_mask]
|
||||
test eax, 0x80000000 ; bit 31: active/inactive filter f.40
|
||||
jz @f
|
||||
pop eax
|
||||
jmp .FlagAutoReset
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
; If the window is captured and moved by the user, then no mouse events!!!
|
||||
mov al, [mouse.active_sys_window.action]
|
||||
and al, WINDOW_MOVE_AND_RESIZE_FLAGS
|
||||
test al, al
|
||||
pop eax
|
||||
jnz .loop
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.FlagAutoReset: ; retvals: BgrRedraw=5, IPC=7, Stack=8, Debug=9
|
||||
btr [ebx+APPDATA.event_mask], eax
|
||||
jnc .loop
|
||||
.result: ; retval = eax+1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.result: ; retval = eax+1
|
||||
inc eax
|
||||
ret
|
||||
.BtKy:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.BtKy:
|
||||
movzx edx, bh
|
||||
movzx edx, word[WIN_STACK+edx*2]
|
||||
je .Keys ; eax=1, retval Keys=2
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.Buttons: ; eax=2, retval Buttons=3
|
||||
cmp byte[BTN_COUNT], 0
|
||||
je .loop ; empty ???
|
||||
@@ -493,14 +572,20 @@ get_event_for_app: ;; used from f10,f11,f23
|
||||
mov [window_minimize], 1
|
||||
dec byte[BTN_COUNT]
|
||||
jmp .loop
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.Keys: ; eax==1
|
||||
cmp edx, [TASK_COUNT]
|
||||
jne @f ; not Top ???
|
||||
cmp [KEY_COUNT], al; al==1
|
||||
jae .result ; not empty ???
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov edx, hotkey_buffer
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
cmp [edx], bh ; bh - slot for testing
|
||||
je .result
|
||||
add edx, 8
|
||||
@@ -508,3 +593,4 @@ get_event_for_app: ;; used from f10,f11,f23
|
||||
jb @b
|
||||
jmp .loop
|
||||
;end.
|
||||
;-----------------------------------------------------------------------------
|
Reference in New Issue
Block a user