--- a/SynchronousWindowSensor.st Wed May 07 17:18:44 2003 +0200
+++ b/SynchronousWindowSensor.st Wed May 07 20:57:25 2003 +0200
@@ -37,29 +37,40 @@
documentation
"
- in contrast to a regular windowSensor, instances of SynchronousWindowSensor
+ These sensors are not used with regular views.
+
+ In contrast to a regular windowSensor, instances of SynchronousWindowSensor
do NOT put events into a queue and do NOT wakeup any windowGroup process.
Instead, the underlying view is notified synchronously (via a message send)
- about the event.
+ immediately about the event.
- These are used for only one single situation:
- when a modal debugger is open
+ SynchronousWindowSensor are used for only one single situation:
+ when a super-modal debugger is open
(i.e. one that is debugging the scheduler or event-dispatcher).
- This debuggers windowGroup is augmented with a synchronous Sensor, in order
+ This debugger's windowGroup is augmented with a synchronous Sensor, in order
to prevent the event handling code from suspending any process
(you cannot suspend the scheduler; you should not suspend the event dispatcher).
- This is pretty tricky and magic - you dont have to understand this.
+ This is pretty tricky and magic - and you dont have to understand this.
(consider this system internal code)
- These sensors are not used with regular views.
[author:]
- Claus Gittinger
+ Claus Gittinger
"
! !
-!SynchronousWindowSensor methodsFor:'event handling'!
+!SynchronousWindowSensor methodsFor:'dummy event flushing'!
+
+compressKeyPressEventsWithKey:aKey
+ ^ 0
+!
+
+flushEventsFor:aViewOrNil inQueue:anEventQueue where:aCondition
+ ^ nil
+! !
+
+!SynchronousWindowSensor methodsFor:'event processing'!
addDamage:aRectangle view:aView wakeup:doWakeup
"forward as an expose for some view"
@@ -70,16 +81,6 @@
with:aRectangle top
with:aRectangle width
with:aRectangle height)
-
-"/ WindowEvent
-"/ sendEvent:#exposeX:y:width:height:
-"/ arguments:(Array with:aRectangle left
-"/ with:aRectangle top
-"/ with:aRectangle width
-"/ with:aRectangle height)
-"/ view:aView
-
- "Modified: / 20.5.1998 / 22:55:37 / cg"
!
buttonMotion:buttonAndModifierState x:x y:y view:aView
@@ -133,22 +134,6 @@
aView dispatchEvent:ev
!
-coveredBy:otherView view:aView
- "forward a covered for some view"
-
- aView coveredBy:otherView
-
- "Created: 24.11.1995 / 19:15:11 / cg"
-!
-
-destroyedView:aView
- "forward a destroyed event for some view"
-
- aView destroyed
-
- "Created: 24.11.1995 / 19:15:22 / cg"
-!
-
exposeX:x y:y width:w height:h view:aView
"forward an expose for some view"
@@ -159,30 +144,6 @@
]
!
-focusInView:aView
- "forward a focusIn event for some view"
-
- |ev|
-
- ev := WindowEvent focusInView:aView.
- aView dispatchEvent:ev
-
- "Created: / 24.11.1995 / 19:16:11 / cg"
- "Modified: / 20.5.1998 / 22:57:04 / cg"
-!
-
-focusOutView:aView
- "forward a focusOut event for some view"
-
- |ev|
-
- ev := WindowEvent focusOutView:aView.
- aView dispatchEvent:ev
-
- "Created: / 24.11.1995 / 19:16:24 / cg"
- "Modified: / 20.5.1998 / 22:57:16 / cg"
-!
-
graphicsExposeX:x y:y width:w height:h final:final view:aView
"forward a graphic expose for some view"
@@ -249,17 +210,6 @@
"Modified: / 20.5.1998 / 22:58:05 / cg"
!
-mappedView:aView
- "forward a mapped event for some view"
-
- |ev|
-
- ev := WindowEvent mappedView:aView.
- aView dispatchEvent:ev
-
- "Created: 24.11.1995 / 19:18:01 / cg"
-!
-
mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime view:aView
"forward a wheel-motion for some view"
@@ -288,11 +238,6 @@
"Modified: 29.1.1997 / 20:46:47 / cg"
!
-pasteFromClipBoard:s view:aView
-
- ^ aView pasteFromClipBoard:s
-!
-
pointerEnter:buttonState x:x y:y view:aView
"forward a pointer enter for some view"
@@ -317,11 +262,6 @@
"Modified: / 20.5.1998 / 22:58:35 / cg"
!
-pushUserEvent:selector for:anyObject withArguments:argList
-
- ^ anyObject perform:selector withArguments:argList.
-!
-
saveAndTerminateView:aView
"forward a saveAndTerminate event for some view"
@@ -336,23 +276,21 @@
aView terminate
"Created: 24.11.1995 / 19:18:48 / cg"
+! !
+
+!SynchronousWindowSensor methodsFor:'event processing-private'!
+
+pushDamageEvent:ev
+ self sendEvent:ev to:ev view
!
-unmappedView:aView
- "forward an unmapped event for some view"
-
- |ev|
-
- ev := WindowEvent unmappedView:aView.
- aView dispatchEvent:ev
-
- "Created: 24.11.1995 / 19:18:59 / cg"
+pushUserEvent:selector for:anyObject withArguments:argList
+ ^ anyObject perform:selector withArguments:argList.
! !
!SynchronousWindowSensor methodsFor:'private'!
sendEvent:anEvent to:aView
-
WindowGroup lastEventQuerySignal answer:anEvent do:[
aView dispatchEvent:anEvent
].
@@ -414,5 +352,5 @@
!SynchronousWindowSensor class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/SynchronousWindowSensor.st,v 1.24 2003-04-15 11:59:37 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/SynchronousWindowSensor.st,v 1.25 2003-05-07 18:57:16 cg Exp $'
! !
--- a/WindowSensor.st Wed May 07 17:18:44 2003 +0200
+++ b/WindowSensor.st Wed May 07 20:57:25 2003 +0200
@@ -917,6 +917,8 @@
|action lastFlushed|
+ anEventQueue isNil ifTrue:[^ nil].
+
action := [
|nEvent "{ Class: SmallInteger }"
anEvent
@@ -974,8 +976,7 @@
can be done after a full redraw (or in views, which are
doing full redraws anly)"
- self
- flushEventsFor:nil inQueue:damage where:[:event | event isDamage].
+ self flushEventsFor:nil inQueue:damage where:[:event | event isDamage].
"Modified: / 6.6.1998 / 21:18:03 / cg"
!
@@ -987,8 +988,7 @@
(or in views, which are always doing full redraws -
instead of drawing the clip-area only)"
- self
- flushEventsFor:aView inQueue:damage where:[:event | event isDamage].
+ self flushEventsFor:aView inQueue:damage where:[:event | event isDamage].
"Modified: / 6.6.1998 / 21:18:05 / cg"
!
@@ -1024,9 +1024,7 @@
flushUserEvents
"throw away all pending user events (i.e. key & button stuff)"
- (mouseAndKeyboard isNil or:[mouseAndKeyboard size > 0]) ifTrue:[
- self flushUserEventsFor:nil
- ].
+ self flushUserEventsFor:nil
"Modified: / 20.6.1998 / 16:40:02 / cg"
!
@@ -3094,7 +3092,7 @@
!WindowSensor class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/WindowSensor.st,v 1.214 2003-05-07 15:03:25 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/WindowSensor.st,v 1.215 2003-05-07 18:57:25 cg Exp $'
! !
WindowSensor initialize!