author | Claus Gittinger <cg@exept.de> |
Tue, 23 Apr 2019 16:30:55 +0200 | |
changeset 8674 | e29a561c0fbe |
parent 8503 | fcd14f4ec13f |
child 8987 | bc8b27e8c34d |
permissions | -rw-r--r-- |
8360 | 1 |
"{ Encoding: utf8 }" |
2 |
||
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3 |
" |
267 | 4 |
COPYRIGHT (c) 1995 by Claus Gittinger |
2718
85d77ac33019
deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents:
2699
diff
changeset
|
5 |
All Rights Reserved |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7 |
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
|
8 |
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
|
9 |
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
|
10 |
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
|
11 |
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
|
12 |
hereby transferred. |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
13 |
" |
3450 | 14 |
"{ Package: 'stx:libview' }" |
15 |
||
6817
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
16 |
"{ NameSpace: Smalltalk }" |
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
17 |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
18 |
WindowSensor subclass:#SynchronousWindowSensor |
730 | 19 |
instanceVariableNames:'' |
598 | 20 |
classVariableNames:'' |
21 |
poolDictionaries:'' |
|
5278 | 22 |
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
|
23 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
24 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
25 |
!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
|
26 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
27 |
copyright |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
28 |
" |
267 | 29 |
COPYRIGHT (c) 1995 by Claus Gittinger |
2718
85d77ac33019
deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents:
2699
diff
changeset
|
30 |
All Rights Reserved |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
31 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
32 |
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
|
33 |
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
|
34 |
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
|
35 |
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
|
36 |
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
|
37 |
hereby transferred. |
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 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
40 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
41 |
documentation |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
42 |
" |
3888 | 43 |
These sensors are not used with regular views. |
44 |
||
45 |
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
|
46 |
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
|
47 |
Instead, the underlying view is notified synchronously (via a message send) |
3888 | 48 |
immediately about the event. |
266
1e234d542ef9
oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents:
264
diff
changeset
|
49 |
|
3888 | 50 |
SynchronousWindowSensor are used for only one single situation: |
51 |
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
|
52 |
(i.e. one that is debugging the scheduler or event-dispatcher). |
267 | 53 |
|
3888 | 54 |
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
|
55 |
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
|
56 |
(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
|
57 |
|
7667 | 58 |
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
|
59 |
(consider this system internal code) |
612 | 60 |
|
61 |
[author:] |
|
3888 | 62 |
Claus Gittinger |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
63 |
" |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
64 |
! ! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
65 |
|
3888 | 66 |
!SynchronousWindowSensor methodsFor:'dummy event flushing'! |
67 |
||
68 |
compressKeyPressEventsWithKey:aKey |
|
69 |
^ 0 |
|
70 |
! |
|
71 |
||
72 |
flushEventsFor:aViewOrNil inQueue:anEventQueue where:aCondition |
|
73 |
^ nil |
|
74 |
! ! |
|
75 |
||
76 |
!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
|
77 |
|
1299 | 78 |
addDamage:aRectangle view:aView wakeup:doWakeup |
79 |
"forward as an expose for some view" |
|
80 |
||
8503 | 81 |
aView dispatchEvent: |
82 |
(WindowEvent::DamageEvent |
|
83 |
for:aView |
|
84 |
type:#'exposeX:y:width:height:' |
|
85 |
arguments:{ aRectangle left . |
|
86 |
aRectangle top . |
|
87 |
aRectangle width . |
|
88 |
aRectangle height }) |
|
89 |
"/ aView |
|
90 |
"/ dispatchEvent:#exposeX:y:width:height: |
|
91 |
"/ arguments:(Array with:aRectangle left |
|
92 |
"/ with:aRectangle top |
|
93 |
"/ with:aRectangle width |
|
94 |
"/ with:aRectangle height) |
|
1299 | 95 |
! |
96 |
||
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
97 |
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
|
98 |
"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
|
99 |
|
3594
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
100 |
ignoreExposeEvents ~~ true ifTrue:[ |
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
101 |
aView |
8503 | 102 |
dispatchEvent: |
103 |
(WindowEvent::DamageEvent |
|
104 |
for:aView |
|
105 |
type:#'exposeX:y:width:height:' |
|
106 |
arguments:{ x . |
|
107 |
y . |
|
108 |
w . |
|
109 |
h }) |
|
110 |
"/ aView |
|
111 |
"/ dispatchEvent:#exposeX:y:width:height: |
|
112 |
"/ arguments:(Array with:x with:y with:w with:h) |
|
3594
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
113 |
] |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
114 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
115 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
116 |
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
|
117 |
"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
|
118 |
|
1299 | 119 |
"/ 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
|
120 |
"/ (if an expose is pending) |
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
121 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
122 |
final ifTrue:[ |
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
123 |
(catchExpose includes:aView) ifTrue:[ |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
124 |
gotExpose add:aView. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
125 |
] |
1244
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
126 |
]. |
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
127 |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
128 |
aView |
8503 | 129 |
dispatchEvent: |
130 |
(WindowEvent::DamageEvent |
|
131 |
for:aView |
|
132 |
type:#'graphicsExposeX:y:width:height:final:' |
|
133 |
arguments:{ x . |
|
134 |
y . |
|
135 |
w . |
|
136 |
h . |
|
137 |
final }) |
|
138 |
"/ aView |
|
139 |
"/ dispatchEvent:#graphicsExposeX:y:width:height:final: |
|
140 |
"/ 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
|
141 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
142 |
"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
|
143 |
"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
|
144 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
145 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
146 |
noExposeView:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
147 |
"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
|
148 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
149 |
catchExpose isNil ifTrue:[ |
7460 | 150 |
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
|
151 |
]. |
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
152 |
|
1299 | 153 |
(catchExpose includes:aView) ifTrue:[ |
7460 | 154 |
gotExpose add:aView. |
155 |
catchExpose remove:aView. |
|
1299 | 156 |
]. |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
157 |
aView noExpose. |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
158 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
159 |
"Created: 24.11.1995 / 19:18:10 / cg" |
1299 | 160 |
"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
|
161 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
162 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
163 |
saveAndTerminateView:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
164 |
"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
|
165 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
166 |
aView saveAndTerminate |
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 |
"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
|
169 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
170 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
171 |
terminateView:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
172 |
"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
|
173 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
174 |
aView terminate |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
175 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
176 |
"Created: 24.11.1995 / 19:18:48 / cg" |
3888 | 177 |
! ! |
178 |
||
179 |
!SynchronousWindowSensor methodsFor:'event processing-private'! |
|
180 |
||
6575
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
181 |
basicPushEvent:anEvent |
8360 | 182 |
"dispach the event immediately" |
6575
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
183 |
|
8360 | 184 |
anEvent ensureTimeStamped. |
8478 | 185 |
anEvent view dispatchEvent:anEvent |
186 |
||
187 |
"Modified: / 21-09-2018 / 12:33:48 / Claus Gittinger" |
|
4212 | 188 |
! |
189 |
||
6575
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
190 |
pushDamageEvent:anEvent |
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
191 |
"disptach the event immediately" |
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
192 |
|
7076 | 193 |
self basicPushEvent:anEvent |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
194 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
195 |
|
3888 | 196 |
pushUserEvent:selector for:anyObject withArguments:argList |
6575
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
197 |
"disptach the event immediately" |
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
198 |
|
3888 | 199 |
^ 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
|
200 |
! ! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
201 |
|
6817
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
202 |
!SynchronousWindowSensor methodsFor:'event simulation'! |
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
203 |
|
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
204 |
enqueueMessage:selector for:someone arguments:argList |
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
205 |
"do it synchronously" |
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
206 |
someone perform:selector withArguments:argList |
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
207 |
! ! |
0238692d35b5
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
208 |
|
4212 | 209 |
!SynchronousWindowSensor methodsFor:'initialization'! |
210 |
||
211 |
initialize |
|
6287
4f4be4afb377
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6021
diff
changeset
|
212 |
super initialize. |
8337 | 213 |
compressMotionEvents := false. |
3680 | 214 |
|
8337 | 215 |
"Modified: / 19-04-2018 / 12:29:07 / stefan" |
3680 | 216 |
! ! |
217 |
||
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
218 |
!SynchronousWindowSensor methodsFor:'specials'! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
219 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
220 |
catchExposeFor:aView |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
221 |
"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
|
222 |
|
1299 | 223 |
catchExpose notEmpty ifTrue:[ |
7460 | 224 |
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
|
225 |
]. |
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
226 |
|
1299 | 227 |
gotOtherEvent remove:aView ifAbsent:nil. |
228 |
gotExpose remove:aView ifAbsent:nil. |
|
229 |
catchExpose add:aView. |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
230 |
|
1299 | 231 |
"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
|
232 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
233 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
234 |
waitForExposeFor:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
235 |
"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
|
236 |
|
7259 | 237 |
|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
|
238 |
|
7259 | 239 |
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
|
240 |
|
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
241 |
"/ this is only needed for X ... |
7259 | 242 |
viewsDevice scrollsAsynchronous ifTrue:[ |
8490 | 243 |
windowId := aView drawableId. |
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
244 |
|
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
245 |
"/ |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
246 |
"/ 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
|
247 |
"/ must poll for the event |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
248 |
"/ |
6021
95e38167b702
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
5278
diff
changeset
|
249 |
endPollTime := Timestamp now addSeconds:2. |
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
250 |
stopPoll := false. |
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
251 |
|
7460 | 252 |
[stopPoll or:[gotExpose includes:aView]] whileFalse:[ |
7259 | 253 |
(viewsDevice exposeEventPendingFor:windowId withSync:true) ifTrue:[ |
254 |
viewsDevice dispatchExposeEventFor:windowId. |
|
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
255 |
]. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
256 |
stopPoll := Timestamp now > endPollTime. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
257 |
Processor yield. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
258 |
]. |
8336 | 259 |
stopPoll ifTrue:[ |
260 |
Logger warning:'lost expose event: %1' with:aView. |
|
261 |
]. |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
262 |
]. |
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
263 |
|
1299 | 264 |
catchExpose remove:aView ifAbsent:nil. |
265 |
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
|
266 |
|
8336 | 267 |
"Modified: / 19-08-1997 / 17:25:09 / cg" |
268 |
"Modified: / 19-04-2018 / 12:11:33 / stefan" |
|
8490 | 269 |
"Modified: / 01-10-2018 / 17:06:47 / Claus Gittinger" |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
270 |
! ! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
271 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
272 |
!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
|
273 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
274 |
version |
7076 | 275 |
^ '$Header$' |
8337 | 276 |
! |
277 |
||
278 |
version_CVS |
|
279 |
^ '$Header$' |
|
615 | 280 |
! ! |
6021
95e38167b702
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
5278
diff
changeset
|
281 |