Rev 2288 | Rev 2411 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2288 | Rev 2384 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 2288 $ |
8 | $Revision: 2384 $ |
9 | 9 | ||
10 | WINDOW_MOVE_AND_RESIZE_FLAGS = \ |
10 | WINDOW_MOVE_AND_RESIZE_FLAGS = \ |
11 | mouse.WINDOW_RESIZE_N_FLAG + \ |
11 | mouse.WINDOW_RESIZE_N_FLAG + \ |
Line 23... | Line 23... | ||
23 | EV_SPACE = 512 |
23 | EV_SPACE = 512 |
24 | FreeEvents = event_start-EVENT.fd ; "âèðòóàëüíûé" event, èñïîëüçóþòñÿ òîëüêî ïîëÿ: |
24 | FreeEvents = event_start-EVENT.fd ; "âèðòóàëüíûé" event, èñïîëüçóþòñÿ òîëüêî ïîëÿ: |
25 | ; FreeEvents.fd=event_start è FreeEvents.bk=event_end |
25 | ; FreeEvents.fd=event_start è FreeEvents.bk=event_end |
26 | align 4 |
26 | align 4 |
27 | init_events: ;; used from kernel.asm |
27 | init_events: ;; used from kernel.asm |
28 | stdcall kernel_alloc, EV_SPACE*EVENT.size |
28 | stdcall kernel_alloc, EV_SPACE*sizeof.EVENT |
29 | or eax, eax |
29 | or eax, eax |
30 | jz .fail |
30 | jz .fail |
31 | ; eax - current event, ebx - previos event below |
31 | ; eax - current event, ebx - previos event below |
32 | mov ecx, EV_SPACE ; current - in allocated space |
32 | mov ecx, EV_SPACE ; current - in allocated space |
33 | mov ebx, FreeEvents ; previos - íà÷àëî ñïèñêà |
33 | mov ebx, FreeEvents ; previos - íà÷àëî ñïèñêà |
34 | push ebx ; îíî æå è êîíåö ïîòîì áóäåò |
34 | push ebx ; îíî æå è êîíåö ïîòîì áóäåò |
35 | @@: |
35 | @@: |
36 | mov [ebx+EVENT.fd], eax |
36 | mov [ebx+EVENT.fd], eax |
37 | mov [eax+EVENT.bk], ebx |
37 | mov [eax+EVENT.bk], ebx |
38 | mov ebx, eax ; previos <- current |
38 | mov ebx, eax ; previos <- current |
39 | add eax, EVENT.size ; new current |
39 | add eax, sizeof.EVENT ; new current |
40 | loop @b |
40 | loop @b |
41 | pop eax ; âîò îíî êîíöîì è ñòàëî |
41 | pop eax ; âîò îíî êîíöîì è ñòàëî |
42 | mov [ebx+EVENT.fd], eax |
42 | mov [ebx+EVENT.fd], eax |
43 | mov [eax+EVENT.bk], ebx |
43 | mov [eax+EVENT.bk], ebx |
44 | .fail: |
44 | .fail: |
Line 98... | Line 98... | ||
98 | inc [event_uid] |
98 | inc [event_uid] |
99 | Mov [eax+EVENT.id],edx,[event_uid] |
99 | Mov [eax+EVENT.id],edx,[event_uid] |
100 | or esi, esi |
100 | or esi, esi |
101 | jz RemoveEventTo |
101 | jz RemoveEventTo |
102 | lea edi, [eax+EVENT.code] |
102 | lea edi, [eax+EVENT.code] |
103 | mov ecx, EVENT.codesize/4 |
103 | mov ecx, (sizeof.EVENT -EVENT.code)/4 |
104 | cld |
104 | cld |
105 | rep movsd |
105 | rep movsd |
Line 106... | Line 106... | ||
106 | 106 | ||
107 | RemoveEventTo: ;; INTERNAL use !!! don't use for Call |
107 | RemoveEventTo: ;; INTERNAL use !!! don't use for Call |
Line 153... | Line 153... | ||
153 | ;scratched: ebx,ecx,esi,edi |
153 | ;scratched: ebx,ecx,esi,edi |
154 | call NotDummyTest ; not returned for fail !!! |
154 | call NotDummyTest ; not returned for fail !!! |
155 | or esi, esi |
155 | or esi, esi |
156 | jz @f |
156 | jz @f |
157 | lea edi, [ebx+EVENT.code] |
157 | lea edi, [ebx+EVENT.code] |
158 | mov ecx, EVENT.codesize/4 |
158 | mov ecx, (sizeof.EVENT -EVENT.code)/4 |
159 | cld |
159 | cld |
160 | rep movsd |
160 | rep movsd |
161 | @@: |
161 | @@: |
162 | test byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24 |
162 | test byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24 |
163 | jnz RemoveEventTo.break ; POPF+RET |
163 | jnz RemoveEventTo.break ; POPF+RET |
Line 297... | Line 297... | ||
297 | ; eax - ñîáñòâåííî EVENT (áóäåì íàçûâàòü ýòî åãî õýíäëîì) |
297 | ; eax - ñîáñòâåííî EVENT (áóäåì íàçûâàòü ýòî åãî õýíäëîì) |
298 | ;scratched: ebx,ecx,edx,esi,edi |
298 | ;scratched: ebx,ecx,edx,esi,edi |
299 | mov edx, get_event_queue ; wait_test |
299 | mov edx, get_event_queue ; wait_test |
300 | call Wait_events ; timeout ignored |
300 | call Wait_events ; timeout ignored |
301 | lea esi, [eax+EVENT.code] |
301 | lea esi, [eax+EVENT.code] |
302 | mov ecx, EVENT.codesize/4 |
302 | mov ecx, (sizeof.EVENT-EVENT.code)/4 |
303 | cld |
303 | cld |
304 | rep movsd |
304 | rep movsd |
305 | mov [edi-EVENT.codesize+2], cl;clear priority field |
305 | mov byte[edi-(sizeof.EVENT-EVENT.code)+2], cl;clear priority field |
306 | wait_finish: |
306 | wait_finish: |
307 | test byte[eax+EVENT.state+3], MANUAL_RESET shr 24 |
307 | test byte[eax+EVENT.state+3], MANUAL_RESET shr 24 |
308 | jnz get_event_queue.ret ; RET |
308 | jnz get_event_queue.ret ; RET |
309 | and byte[eax+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24) |
309 | and byte[eax+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24) |
310 | test byte[eax+EVENT.state+3], MANUAL_DESTROY shr 24 |
310 | test byte[eax+EVENT.state+3], MANUAL_DESTROY shr 24 |