author | matilk |
Wed, 13 Sep 2017 09:40:34 +0200 | |
changeset 8174 | 2704c965b97b |
parent 7667 | 03e064bb2153 |
child 7715 | 925b859e1758 |
child 8336 | ab27804d3b46 |
permissions | -rw-r--r-- |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1 |
" |
267 | 2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
2718
85d77ac33019
deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents:
2699
diff
changeset
|
3 |
All Rights Reserved |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5 |
This software is furnished under a license and may be used |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
10 |
hereby transferred. |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
11 |
" |
3450 | 12 |
"{ Package: 'stx:libview' }" |
13 |
||
6817
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
14 |
"{ NameSpace: Smalltalk }" |
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
15 |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
16 |
WindowSensor subclass:#SynchronousWindowSensor |
730 | 17 |
instanceVariableNames:'' |
598 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
5278 | 20 |
category:'Interface-Support-UI' |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
21 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
22 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
23 |
!SynchronousWindowSensor class methodsFor:'documentation'! |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
24 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
25 |
copyright |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
26 |
" |
267 | 27 |
COPYRIGHT (c) 1995 by Claus Gittinger |
2718
85d77ac33019
deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents:
2699
diff
changeset
|
28 |
All Rights Reserved |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
29 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
30 |
This software is furnished under a license and may be used |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
31 |
only in accordance with the terms of that license and with the |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
32 |
inclusion of the above copyright notice. This software may not |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
33 |
be provided or otherwise made available to, or used by, any |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
34 |
other person. No title to or ownership of the software is |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
35 |
hereby transferred. |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
36 |
" |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
37 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
38 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
39 |
documentation |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
40 |
" |
3888 | 41 |
These sensors are not used with regular views. |
42 |
||
43 |
In contrast to a regular windowSensor, instances of SynchronousWindowSensor |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
44 |
do NOT put events into a queue and do NOT wakeup any windowGroup process. |
266
1e234d542ef9
oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents:
264
diff
changeset
|
45 |
Instead, the underlying view is notified synchronously (via a message send) |
3888 | 46 |
immediately about the event. |
266
1e234d542ef9
oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents:
264
diff
changeset
|
47 |
|
3888 | 48 |
SynchronousWindowSensor are used for only one single situation: |
49 |
when a super-modal debugger is open |
|
266
1e234d542ef9
oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents:
264
diff
changeset
|
50 |
(i.e. one that is debugging the scheduler or event-dispatcher). |
267 | 51 |
|
3888 | 52 |
This debugger's windowGroup is augmented with a synchronous Sensor, in order |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
53 |
to prevent the event handling code from suspending any process |
266
1e234d542ef9
oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents:
264
diff
changeset
|
54 |
(you cannot suspend the scheduler; you should not suspend the event dispatcher). |
1e234d542ef9
oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents:
264
diff
changeset
|
55 |
|
7667 | 56 |
This is pretty tricky and magic - and you don't have to understand this. |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
57 |
(consider this system internal code) |
612 | 58 |
|
59 |
[author:] |
|
3888 | 60 |
Claus Gittinger |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
61 |
" |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
62 |
! ! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
63 |
|
3888 | 64 |
!SynchronousWindowSensor methodsFor:'dummy event flushing'! |
65 |
||
66 |
compressKeyPressEventsWithKey:aKey |
|
67 |
^ 0 |
|
68 |
! |
|
69 |
||
70 |
flushEventsFor:aViewOrNil inQueue:anEventQueue where:aCondition |
|
71 |
^ nil |
|
72 |
! ! |
|
73 |
||
74 |
!SynchronousWindowSensor methodsFor:'event processing'! |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
75 |
|
1299 | 76 |
addDamage:aRectangle view:aView wakeup:doWakeup |
77 |
"forward as an expose for some view" |
|
78 |
||
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
79 |
aView |
3680 | 80 |
dispatchEvent:#exposeX:y:width:height: |
81 |
arguments:(Array with:aRectangle left |
|
82 |
with:aRectangle top |
|
83 |
with:aRectangle width |
|
84 |
with:aRectangle height) |
|
1299 | 85 |
! |
86 |
||
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
87 |
exposeX:x y:y width:w height:h view:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
88 |
"forward an expose for some view" |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
89 |
|
3594
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
90 |
ignoreExposeEvents ~~ true ifTrue:[ |
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
91 |
aView |
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
92 |
dispatchEvent:#exposeX:y:width:height: |
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
93 |
arguments:(Array with:x with:y with:w with:h) |
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
94 |
] |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
95 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
96 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
97 |
graphicsExposeX:x y:y width:w height:h final:final view:aView |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
98 |
"forward a graphic expose for some view" |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
99 |
|
1299 | 100 |
"/ this is a possible response to a scroll operation |
1244
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
101 |
"/ (if an expose is pending) |
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
102 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
103 |
final ifTrue:[ |
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
104 |
(catchExpose includes:aView) ifTrue:[ |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
105 |
gotExpose add:aView. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
106 |
] |
1244
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
107 |
]. |
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
108 |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
109 |
aView |
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
110 |
dispatchEvent:#graphicsExposeX:y:width:height:final: |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
111 |
arguments:(Array with:x with:y with:w with:h with:final) |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
112 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
113 |
"Created: / 24.11.1995 / 19:16:38 / cg" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
114 |
"Modified: / 20.5.1998 / 22:57:32 / cg" |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
115 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
116 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
117 |
noExposeView:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
118 |
"forward a noExpose event for some view" |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
119 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
120 |
catchExpose isNil ifTrue:[ |
7460 | 121 |
Logger info:'noExpose but not catching: %1' with:aView. |
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
122 |
]. |
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
123 |
|
1299 | 124 |
(catchExpose includes:aView) ifTrue:[ |
7460 | 125 |
gotExpose add:aView. |
126 |
catchExpose remove:aView. |
|
1299 | 127 |
]. |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
128 |
aView noExpose. |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
129 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
130 |
"Created: 24.11.1995 / 19:18:10 / cg" |
1299 | 131 |
"Modified: 29.1.1997 / 20:46:47 / cg" |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
132 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
133 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
134 |
saveAndTerminateView:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
135 |
"forward a saveAndTerminate event for some view" |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
136 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
137 |
aView saveAndTerminate |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
138 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
139 |
"Created: 24.11.1995 / 19:18:38 / cg" |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
140 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
141 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
142 |
terminateView:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
143 |
"forward a terminate event for some view" |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
144 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
145 |
aView terminate |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
146 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
147 |
"Created: 24.11.1995 / 19:18:48 / cg" |
3888 | 148 |
! ! |
149 |
||
150 |
!SynchronousWindowSensor methodsFor:'event processing-private'! |
|
151 |
||
6575
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
152 |
basicPushEvent:anEvent |
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
153 |
"disptach the event immediately" |
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
154 |
|
7076 | 155 |
anEvent timeStamp isNil ifTrue:[ |
156 |
anEvent timeStamp:(Timestamp now). |
|
157 |
]. |
|
4212 | 158 |
WindowGroup lastEventQuerySignal answer:anEvent do:[ |
159 |
anEvent view dispatchEvent:anEvent |
|
160 |
]. |
|
161 |
! |
|
162 |
||
6575
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
163 |
pushDamageEvent:anEvent |
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
164 |
"disptach the event immediately" |
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
165 |
|
7076 | 166 |
self basicPushEvent:anEvent |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
167 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
168 |
|
3888 | 169 |
pushUserEvent:selector for:anyObject withArguments:argList |
6575
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
170 |
"disptach the event immediately" |
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
171 |
|
3888 | 172 |
^ anyObject perform:selector withArguments:argList. |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
173 |
! ! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
174 |
|
6817
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
175 |
!SynchronousWindowSensor methodsFor:'event simulation'! |
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
176 |
|
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
177 |
enqueueMessage:selector for:someone arguments:argList |
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
178 |
"do it synchronously" |
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
179 |
someone perform:selector withArguments:argList |
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
180 |
! ! |
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
181 |
|
4212 | 182 |
!SynchronousWindowSensor methodsFor:'initialization'! |
183 |
||
184 |
initialize |
|
185 |
"initialize the event queues to empty" |
|
186 |
||
6287
4f4be4afb377
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6021
diff
changeset
|
187 |
super initialize. |
3680 | 188 |
|
4212 | 189 |
gotExpose := IdentitySet new. |
190 |
catchExpose := IdentitySet new. |
|
191 |
gotOtherEvent := IdentitySet new. |
|
192 |
||
193 |
compressMotionEvents := false. |
|
194 |
translateKeyboardEvents := true. |
|
195 |
ignoreUserInput := false. |
|
196 |
shiftDown := ctrlDown := altDown := metaDown := false. |
|
197 |
leftButtonDown := middleButtonDown := rightButtonDown := false. |
|
3680 | 198 |
! ! |
199 |
||
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
200 |
!SynchronousWindowSensor methodsFor:'specials'! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
201 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
202 |
catchExposeFor:aView |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
203 |
"start catching noExpose events (must be done BEFORE a bitblt)." |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
204 |
|
1299 | 205 |
catchExpose notEmpty ifTrue:[ |
7460 | 206 |
Logger warning:'already catching in catchExpose: %1' with:aView. |
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
207 |
]. |
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
208 |
|
1299 | 209 |
gotOtherEvent remove:aView ifAbsent:nil. |
210 |
gotExpose remove:aView ifAbsent:nil. |
|
211 |
catchExpose add:aView. |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
212 |
|
1299 | 213 |
"Modified: 29.1.1997 / 20:43:44 / cg" |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
214 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
215 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
216 |
waitForExposeFor:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
217 |
"wait until a graphicsExpose or a noExpose arrives (after a bitblt)." |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
218 |
|
7259 | 219 |
|viewsDevice windowId stopPoll endPollTime| |
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
220 |
|
7259 | 221 |
viewsDevice := aView graphicsDevice. |
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
222 |
|
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
223 |
"/ this is only needed for X ... |
7259 | 224 |
viewsDevice scrollsAsynchronous ifTrue:[ |
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
225 |
windowId := aView id. |
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
226 |
|
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
227 |
"/ |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
228 |
"/ cannot suspend, I am a synchronous-modal sensor |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
229 |
"/ must poll for the event |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
230 |
"/ |
6021
95e38167b702
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
5278
diff
changeset
|
231 |
endPollTime := Timestamp now addSeconds:2. |
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
232 |
stopPoll := false. |
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
233 |
|
7460 | 234 |
[stopPoll or:[gotExpose includes:aView]] whileFalse:[ |
7259 | 235 |
(viewsDevice exposeEventPendingFor:windowId withSync:true) ifTrue:[ |
236 |
viewsDevice dispatchExposeEventFor:windowId. |
|
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
237 |
]. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
238 |
stopPoll := Timestamp now > endPollTime. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
239 |
Processor yield. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
240 |
]. |
7460 | 241 |
]. |
242 |
stopPoll ifTrue:[ |
|
243 |
Logger warning:'lost expose event: %1' with:aView. |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
244 |
]. |
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
245 |
|
1299 | 246 |
catchExpose remove:aView ifAbsent:nil. |
247 |
gotExpose remove:aView ifAbsent:nil. |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
248 |
|
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
249 |
"Modified: 19.8.1997 / 17:25:09 / cg" |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
250 |
! ! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
251 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
252 |
!SynchronousWindowSensor class methodsFor:'documentation'! |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
253 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
254 |
version |
7076 | 255 |
^ '$Header$' |
615 | 256 |
! ! |
6021
95e38167b702
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
5278
diff
changeset
|
257 |