author | Claus Gittinger <cg@exept.de> |
Wed, 22 Aug 2018 12:58:11 +0200 | |
changeset 8451 | 6eafe0433763 |
parent 8360 | 3d1049e9b1b1 |
child 8478 | a4efe2621fa8 |
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 |
||
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
81 |
aView |
3680 | 82 |
dispatchEvent:#exposeX:y:width:height: |
83 |
arguments:(Array with:aRectangle left |
|
84 |
with:aRectangle top |
|
85 |
with:aRectangle width |
|
86 |
with:aRectangle height) |
|
1299 | 87 |
! |
88 |
||
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
89 |
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
|
90 |
"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
|
91 |
|
3594
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
92 |
ignoreExposeEvents ~~ true ifTrue:[ |
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
93 |
aView |
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
94 |
dispatchEvent:#exposeX:y:width:height: |
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
95 |
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
|
96 |
] |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
97 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
98 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
99 |
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
|
100 |
"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
|
101 |
|
1299 | 102 |
"/ 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
|
103 |
"/ (if an expose is pending) |
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
104 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
105 |
final ifTrue:[ |
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
106 |
(catchExpose includes:aView) ifTrue:[ |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
107 |
gotExpose add:aView. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
108 |
] |
1244
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
109 |
]. |
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
110 |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
111 |
aView |
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
112 |
dispatchEvent:#graphicsExposeX:y:width:height:final: |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
113 |
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
|
114 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
115 |
"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
|
116 |
"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
|
117 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
118 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
119 |
noExposeView:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
120 |
"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
|
121 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
122 |
catchExpose isNil ifTrue:[ |
7460 | 123 |
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
|
124 |
]. |
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
125 |
|
1299 | 126 |
(catchExpose includes:aView) ifTrue:[ |
7460 | 127 |
gotExpose add:aView. |
128 |
catchExpose remove:aView. |
|
1299 | 129 |
]. |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
130 |
aView noExpose. |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
131 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
132 |
"Created: 24.11.1995 / 19:18:10 / cg" |
1299 | 133 |
"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
|
134 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
135 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
136 |
saveAndTerminateView:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
137 |
"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
|
138 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
139 |
aView saveAndTerminate |
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 |
"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
|
142 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
143 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
144 |
terminateView:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
145 |
"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
|
146 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
147 |
aView terminate |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
148 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
149 |
"Created: 24.11.1995 / 19:18:48 / cg" |
3888 | 150 |
! ! |
151 |
||
152 |
!SynchronousWindowSensor methodsFor:'event processing-private'! |
|
153 |
||
6575
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
154 |
basicPushEvent:anEvent |
8360 | 155 |
"dispach the event immediately" |
6575
8a1490f0e1c7
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6287
diff
changeset
|
156 |
|
8360 | 157 |
anEvent ensureTimeStamped. |
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 |
|
6287
4f4be4afb377
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6021
diff
changeset
|
185 |
super initialize. |
8337 | 186 |
compressMotionEvents := false. |
3680 | 187 |
|
8337 | 188 |
"Modified: / 19-04-2018 / 12:29:07 / stefan" |
3680 | 189 |
! ! |
190 |
||
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
191 |
!SynchronousWindowSensor methodsFor:'specials'! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
192 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
193 |
catchExposeFor:aView |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
194 |
"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
|
195 |
|
1299 | 196 |
catchExpose notEmpty ifTrue:[ |
7460 | 197 |
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
|
198 |
]. |
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
199 |
|
1299 | 200 |
gotOtherEvent remove:aView ifAbsent:nil. |
201 |
gotExpose remove:aView ifAbsent:nil. |
|
202 |
catchExpose add:aView. |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
203 |
|
1299 | 204 |
"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
|
205 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
206 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
207 |
waitForExposeFor:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
208 |
"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
|
209 |
|
7259 | 210 |
|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
|
211 |
|
7259 | 212 |
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
|
213 |
|
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
214 |
"/ this is only needed for X ... |
7259 | 215 |
viewsDevice scrollsAsynchronous ifTrue:[ |
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
216 |
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
|
217 |
|
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
218 |
"/ |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
219 |
"/ 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
|
220 |
"/ must poll for the event |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
221 |
"/ |
6021
95e38167b702
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
5278
diff
changeset
|
222 |
endPollTime := Timestamp now addSeconds:2. |
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
223 |
stopPoll := false. |
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
224 |
|
7460 | 225 |
[stopPoll or:[gotExpose includes:aView]] whileFalse:[ |
7259 | 226 |
(viewsDevice exposeEventPendingFor:windowId withSync:true) ifTrue:[ |
227 |
viewsDevice dispatchExposeEventFor:windowId. |
|
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
228 |
]. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
229 |
stopPoll := Timestamp now > endPollTime. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
230 |
Processor yield. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
231 |
]. |
8336 | 232 |
stopPoll ifTrue:[ |
233 |
Logger warning:'lost expose event: %1' with:aView. |
|
234 |
]. |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
235 |
]. |
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
236 |
|
1299 | 237 |
catchExpose remove:aView ifAbsent:nil. |
238 |
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
|
239 |
|
8336 | 240 |
"Modified: / 19-08-1997 / 17:25:09 / cg" |
241 |
"Modified: / 19-04-2018 / 12:11:33 / stefan" |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
242 |
! ! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
243 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
244 |
!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
|
245 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
246 |
version |
7076 | 247 |
^ '$Header$' |
8337 | 248 |
! |
249 |
||
250 |
version_CVS |
|
251 |
^ '$Header$' |
|
615 | 252 |
! ! |
6021
95e38167b702
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
5278
diff
changeset
|
253 |