author | Claus Gittinger <cg@exept.de> |
Fri, 28 Feb 2014 14:27:02 +0100 | |
changeset 6287 | 4f4be4afb377 |
parent 6021 | 95e38167b702 |
child 6575 | 8a1490f0e1c7 |
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 |
||
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
14 |
WindowSensor subclass:#SynchronousWindowSensor |
730 | 15 |
instanceVariableNames:'' |
598 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
5278 | 18 |
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
|
19 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
20 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
21 |
!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
|
22 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
23 |
copyright |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
24 |
" |
267 | 25 |
COPYRIGHT (c) 1995 by Claus Gittinger |
2718
85d77ac33019
deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents:
2699
diff
changeset
|
26 |
All Rights Reserved |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
27 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
28 |
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
|
29 |
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
|
30 |
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
|
31 |
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
|
32 |
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
|
33 |
hereby transferred. |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
34 |
" |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
35 |
! |
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 |
documentation |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
38 |
" |
3888 | 39 |
These sensors are not used with regular views. |
40 |
||
41 |
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
|
42 |
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
|
43 |
Instead, the underlying view is notified synchronously (via a message send) |
3888 | 44 |
immediately about the event. |
266
1e234d542ef9
oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents:
264
diff
changeset
|
45 |
|
3888 | 46 |
SynchronousWindowSensor are used for only one single situation: |
47 |
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
|
48 |
(i.e. one that is debugging the scheduler or event-dispatcher). |
267 | 49 |
|
3888 | 50 |
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
|
51 |
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
|
52 |
(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
|
53 |
|
3888 | 54 |
This is pretty tricky and magic - and you dont 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
|
55 |
(consider this system internal code) |
612 | 56 |
|
57 |
[author:] |
|
3888 | 58 |
Claus Gittinger |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
59 |
" |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
60 |
! ! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
61 |
|
3888 | 62 |
!SynchronousWindowSensor methodsFor:'dummy event flushing'! |
63 |
||
64 |
compressKeyPressEventsWithKey:aKey |
|
65 |
^ 0 |
|
66 |
! |
|
67 |
||
68 |
flushEventsFor:aViewOrNil inQueue:anEventQueue where:aCondition |
|
69 |
^ nil |
|
70 |
! ! |
|
71 |
||
72 |
!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
|
73 |
|
1299 | 74 |
addDamage:aRectangle view:aView wakeup:doWakeup |
75 |
"forward as an expose for some view" |
|
76 |
||
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
77 |
aView |
3680 | 78 |
dispatchEvent:#exposeX:y:width:height: |
79 |
arguments:(Array with:aRectangle left |
|
80 |
with:aRectangle top |
|
81 |
with:aRectangle width |
|
82 |
with:aRectangle height) |
|
1299 | 83 |
! |
84 |
||
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
85 |
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
|
86 |
"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
|
87 |
|
3594
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
88 |
ignoreExposeEvents ~~ true ifTrue:[ |
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
89 |
aView |
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
90 |
dispatchEvent:#exposeX:y:width:height: |
76381e75d9d2
Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents:
3450
diff
changeset
|
91 |
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
|
92 |
] |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
93 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
94 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
95 |
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
|
96 |
"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
|
97 |
|
1299 | 98 |
"/ 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
|
99 |
"/ (if an expose is pending) |
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
100 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
101 |
final ifTrue:[ |
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
102 |
(catchExpose includes:aView) ifTrue:[ |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
103 |
gotExpose add:aView. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
104 |
] |
1244
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
105 |
]. |
d3182558fc9d
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1243
diff
changeset
|
106 |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
107 |
aView |
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
108 |
dispatchEvent:#graphicsExposeX:y:width:height:final: |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3680
diff
changeset
|
109 |
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
|
110 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1872
diff
changeset
|
111 |
"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
|
112 |
"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
|
113 |
! |
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 |
noExposeView:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
116 |
"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
|
117 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
118 |
catchExpose isNil ifTrue:[ |
2718
85d77ac33019
deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents:
2699
diff
changeset
|
119 |
'SWSensor [info]: noExpose but not catching' infoPrintCR. |
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
120 |
]. |
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
121 |
|
1299 | 122 |
(catchExpose includes:aView) ifTrue:[ |
2718
85d77ac33019
deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents:
2699
diff
changeset
|
123 |
gotExpose add:aView. |
85d77ac33019
deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents:
2699
diff
changeset
|
124 |
catchExpose remove:aView. |
1299 | 125 |
]. |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
126 |
aView noExpose. |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
127 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
128 |
"Created: 24.11.1995 / 19:18:10 / cg" |
1299 | 129 |
"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
|
130 |
! |
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 |
saveAndTerminateView:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
133 |
"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
|
134 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
135 |
aView saveAndTerminate |
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 |
"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
|
138 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
139 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
140 |
terminateView:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
141 |
"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
|
142 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
143 |
aView terminate |
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 |
"Created: 24.11.1995 / 19:18:48 / cg" |
3888 | 146 |
! ! |
147 |
||
148 |
!SynchronousWindowSensor methodsFor:'event processing-private'! |
|
149 |
||
4212 | 150 |
pushDamageEvent:anEvent |
151 |
WindowGroup lastEventQuerySignal answer:anEvent do:[ |
|
152 |
anEvent view dispatchEvent:anEvent |
|
153 |
]. |
|
154 |
! |
|
155 |
||
156 |
pushEvent:anEvent |
|
157 |
WindowGroup lastEventQuerySignal answer:anEvent do:[ |
|
158 |
anEvent view dispatchEvent:anEvent |
|
159 |
]. |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
160 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
161 |
|
3888 | 162 |
pushUserEvent:selector for:anyObject withArguments:argList |
163 |
^ 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
|
164 |
! ! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
165 |
|
4212 | 166 |
!SynchronousWindowSensor methodsFor:'initialization'! |
167 |
||
168 |
initialize |
|
169 |
"initialize the event queues to empty" |
|
170 |
||
6287
4f4be4afb377
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6021
diff
changeset
|
171 |
super initialize. |
3680 | 172 |
|
4212 | 173 |
gotExpose := IdentitySet new. |
174 |
catchExpose := IdentitySet new. |
|
175 |
gotOtherEvent := IdentitySet new. |
|
176 |
||
177 |
compressMotionEvents := false. |
|
178 |
translateKeyboardEvents := true. |
|
179 |
ignoreUserInput := false. |
|
180 |
shiftDown := ctrlDown := altDown := metaDown := false. |
|
181 |
leftButtonDown := middleButtonDown := rightButtonDown := false. |
|
3680 | 182 |
! ! |
183 |
||
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
184 |
!SynchronousWindowSensor methodsFor:'specials'! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
185 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
186 |
catchExposeFor:aView |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
187 |
"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
|
188 |
|
1299 | 189 |
catchExpose notEmpty ifTrue:[ |
2718
85d77ac33019
deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents:
2699
diff
changeset
|
190 |
'SWSensor [warning]: already catching in catchExpose' errorPrintCR. |
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
191 |
]. |
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
192 |
|
1299 | 193 |
gotOtherEvent remove:aView ifAbsent:nil. |
194 |
gotExpose remove:aView ifAbsent:nil. |
|
195 |
catchExpose add:aView. |
|
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
196 |
|
1299 | 197 |
"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
|
198 |
! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
199 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
200 |
waitForExposeFor:aView |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
201 |
"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
|
202 |
|
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
203 |
|device windowId stopPoll endPollTime| |
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
204 |
|
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
205 |
device := aView graphicsDevice. |
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
206 |
|
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
207 |
"/ this is only needed for X ... |
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
208 |
device scrollsAsynchronous ifTrue:[ |
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
209 |
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
|
210 |
|
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
211 |
"/ |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
212 |
"/ 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
|
213 |
"/ must poll for the event |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
214 |
"/ |
6021
95e38167b702
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
5278
diff
changeset
|
215 |
endPollTime := Timestamp now addSeconds:2. |
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
216 |
stopPoll := false. |
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 |
[(gotExpose includes:aView) or:[stopPoll]] whileFalse:[ |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
219 |
(device exposeEventPendingFor:windowId withSync:true) ifTrue:[ |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
220 |
device dispatchExposeEventFor:windowId. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
221 |
]. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
222 |
stopPoll := Timestamp now > endPollTime. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
223 |
Processor yield. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
224 |
]. |
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
225 |
|
4120
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
226 |
stopPoll ifTrue:[ |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
227 |
'SyncWindowSensor [warning]: lost expose event' errorPrintCR. |
bd779aa2b314
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
3888
diff
changeset
|
228 |
] |
264
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
229 |
]. |
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
230 |
|
1299 | 231 |
catchExpose remove:aView ifAbsent:nil. |
232 |
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
|
233 |
|
1872
2a10e693d93f
break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
234 |
"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
|
235 |
! ! |
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
236 |
|
1243
0c33cb7f8458
hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
237 |
!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
|
238 |
|
fc9ecf4814a0
use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
239 |
version |
6287
4f4be4afb377
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
6021
diff
changeset
|
240 |
^ '$Header: /cvs/stx/stx/libview/SynchronousWindowSensor.st,v 1.30 2014-02-28 13:27:02 cg Exp $' |
615 | 241 |
! ! |
6021
95e38167b702
class: SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
5278
diff
changeset
|
242 |