SynchronousWindowSensor.st
author Stefan Vogel <sv@exept.de>
Sat, 20 Mar 2004 16:43:19 +0100
changeset 4120 bd779aa2b314
parent 3888 1e06f949dc58
child 4212 b04d89b5695a
permissions -rw-r--r--
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
267
5728c37ff3f6 commentary
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
     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
"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
3450
4b5f22cd68e4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
    13
"{ Package: 'stx:libview' }"
4b5f22cd68e4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
    14
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
WindowSensor subclass:#SynchronousWindowSensor
730
43d9c5848424 device instVar is not needed
Claus Gittinger <cg@exept.de>
parents: 615
diff changeset
    16
	instanceVariableNames:''
598
1a2339e902d4 commentary
Claus Gittinger <cg@exept.de>
parents: 267
diff changeset
    17
	classVariableNames:''
1a2339e902d4 commentary
Claus Gittinger <cg@exept.de>
parents: 267
diff changeset
    18
	poolDictionaries:''
1a2339e902d4 commentary
Claus Gittinger <cg@exept.de>
parents: 267
diff changeset
    19
	category:'Interface-Support'
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
1243
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
    22
!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
    23
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
copyright
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
267
5728c37ff3f6 commentary
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
    26
 COPYRIGHT (c) 1995 by Claus Gittinger
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
    27
	      All Rights Reserved
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 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
    30
 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
    31
 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
    32
 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
    33
 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
    34
 hereby transferred.
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
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
documentation
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
"
3888
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    40
    These sensors are not used with regular views.
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    41
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    42
    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
    43
    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
    44
    Instead, the underlying view is notified synchronously (via a message send)
3888
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    45
    immediately about the event.
266
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
    46
3888
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    47
    SynchronousWindowSensor are used for only one single situation: 
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    48
        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
    49
    (i.e. one that is debugging the scheduler or event-dispatcher).
267
5728c37ff3f6 commentary
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
    50
3888
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    51
    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
    52
    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
    53
    (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
    54
3888
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    55
    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
    56
    (consider this system internal code)
612
8758d0c9933e documentation
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
    57
8758d0c9933e documentation
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
    58
    [author:]
3888
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    59
        Claus Gittinger
264
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
! !
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
3888
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    63
!SynchronousWindowSensor methodsFor:'dummy event flushing'!
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    64
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    65
compressKeyPressEventsWithKey:aKey
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    66
    ^ 0
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    67
!
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    68
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    69
flushEventsFor:aViewOrNil inQueue:anEventQueue where:aCondition
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    70
    ^ nil
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    71
! !
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    72
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
    73
!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
    74
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    75
addDamage:aRectangle view:aView wakeup:doWakeup
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    76
    "forward as an expose for some view"
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    77
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
    78
    aView
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    79
        dispatchEvent:#exposeX:y:width:height:
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    80
        arguments:(Array with:aRectangle left 
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    81
                         with:aRectangle top 
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    82
                         with:aRectangle width
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    83
                         with:aRectangle height)
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    84
!
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    85
3450
4b5f22cd68e4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
    86
buttonMotion:buttonAndModifierState x:x y:y view:aView
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    "forward a button-motion for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    89
    |buttonState ev|
3450
4b5f22cd68e4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
    90
4b5f22cd68e4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
    91
    "/ in the following, we are only interested in the buttons (i.e. mask out the modifiers)
4b5f22cd68e4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
    92
    buttonState := buttonAndModifierState bitAnd:(aView device anyButtonStateMask).
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    94
    ev := WindowEvent buttonMotion:buttonState x:x y:y view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    95
    self sendEvent:ev to:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
!
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
buttonMultiPress:button x:x y:y view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    "forward a button-multi-press event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   101
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   103
    ev := WindowEvent buttonMultiPress:button x:x y:y view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   104
    self sendEvent:ev to:aView.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   105
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   106
    "Created: / 24.11.1995 / 19:14:14 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   107
    "Modified: / 20.5.1998 / 22:56:07 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
buttonPress:button x:x y:y view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    "forward a button-press event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   113
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   115
    ev := WindowEvent buttonPress:button x:x y:y view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   116
    self sendEvent:ev to:aView.
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
buttonRelease:button x:x y:y view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
    "forward a button-release 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
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   122
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   124
    ev := WindowEvent buttonRelease:button x:x y:y view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   125
    self sendEvent:ev to:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
!
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
configureX: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
   129
    "forward a configure for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   131
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   133
    ev := WindowEvent configureX:x y:y width:w height:h view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   134
    aView dispatchEvent:ev
264
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
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
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
   138
    "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
   139
3594
76381e75d9d2 Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents: 3450
diff changeset
   140
    ignoreExposeEvents ~~ true ifTrue:[
76381e75d9d2 Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents: 3450
diff changeset
   141
        aView
76381e75d9d2 Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents: 3450
diff changeset
   142
            dispatchEvent:#exposeX:y:width:height:
76381e75d9d2 Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents: 3450
diff changeset
   143
            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
   144
    ]
264
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
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
   147
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
   148
    "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
   149
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   150
    "/ 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
   151
    "/ (if an expose is pending)
d3182558fc9d hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
   152
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
   153
    final ifTrue:[
3858
ecbaa5d75c70 Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 3680
diff changeset
   154
        (catchExpose includes:aView) ifTrue:[
ecbaa5d75c70 Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 3680
diff changeset
   155
            gotExpose add:aView.
ecbaa5d75c70 Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 3680
diff changeset
   156
        ]
1244
d3182558fc9d hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
   157
    ].
d3182558fc9d hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
   158
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   159
    aView
3858
ecbaa5d75c70 Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 3680
diff changeset
   160
        dispatchEvent:#graphicsExposeX:y:width:height:final:
ecbaa5d75c70 Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 3680
diff changeset
   161
        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
   162
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   163
    "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
   164
    "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
   165
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
keyPress:untranslatedKey x:x y:y view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    "forward a key-press event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   170
    |xlatedKey ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
266
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   172
    self key:untranslatedKey state:true. 
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   173
2141
ed587c556c11 ask view for keyboardMap.
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
   174
    xlatedKey := aView graphicsDevice translateKey:untranslatedKey forView:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    xlatedKey notNil ifTrue:[
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   176
        ev := WindowEvent 
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   177
                keyPress:xlatedKey
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   178
                rawKey:untranslatedKey
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   179
                hasShift:shiftDown ctrl:ctrlDown alt:altDown meta:metaDown
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   180
                button1:leftButtonDown button2:middleButtonDown button3:rightButtonDown
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   181
                x:x y:y view:aView.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   182
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   183
        self sendEvent:ev to:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
    ]
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   186
    "Created: / 24.11.1995 / 19:17:23 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   187
    "Modified: / 20.5.1998 / 22:57:52 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
keyRelease:untranslatedKey x:x y:y view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    "forward a key-release event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   193
    |xlatedKey ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
266
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   195
    self key:untranslatedKey state:false. 
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   196
2141
ed587c556c11 ask view for keyboardMap.
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
   197
    xlatedKey := aView graphicsDevice translateKey:untranslatedKey forView:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
    xlatedKey notNil ifTrue:[
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   199
        ev := WindowEvent
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   200
                keyRelease:xlatedKey
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   201
                rawKey:untranslatedKey
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   202
                hasShift:shiftDown ctrl:ctrlDown alt:altDown meta:metaDown
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   203
                button1:leftButtonDown button2:middleButtonDown button3:rightButtonDown
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   204
                x:x y:y view:aView.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   205
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   206
        self sendEvent:ev to:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    ]
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   209
    "Created: / 24.11.1995 / 19:17:50 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   210
    "Modified: / 20.5.1998 / 22:58:05 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   213
mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime view:aView
2699
01594e76fc92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2141
diff changeset
   214
    "forward a wheel-motion for some view"
01594e76fc92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2141
diff changeset
   215
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   216
    |ev|
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   217
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   218
    ev := WindowEvent mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   219
    self sendEvent:ev to:aView.
2699
01594e76fc92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2141
diff changeset
   220
01594e76fc92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2141
diff changeset
   221
    "Created: / 21.5.1999 / 13:07:51 / cg"
01594e76fc92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2141
diff changeset
   222
!
01594e76fc92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2141
diff changeset
   223
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
noExposeView:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
    "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
   226
1243
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   227
    catchExpose isNil ifTrue:[
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   228
	'SWSensor [info]: noExpose but not catching' infoPrintCR.
1243
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   229
    ].
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   230
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   231
    (catchExpose includes:aView) ifTrue:[
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   232
	gotExpose add:aView.
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   233
	catchExpose remove:aView.
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   234
    ].
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
    aView noExpose.
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
    "Created: 24.11.1995 / 19:18:10 / cg"
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   238
    "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
   239
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
pointerEnter:buttonState x:x y:y view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
    "forward a pointer enter for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   244
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   246
    ev := WindowEvent pointerEnter:buttonState x:x y:y view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   247
    aView dispatchEvent:ev
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   248
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   249
    "Created: / 24.11.1995 / 19:18:20 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   250
    "Modified: / 20.5.1998 / 22:58:20 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
pointerLeave:buttonState view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
    "forward a pointer leave for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   256
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   258
    ev := WindowEvent pointerLeave:buttonState view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   259
    aView dispatchEvent:ev
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   260
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   261
    "Created: / 24.11.1995 / 19:18:30 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   262
    "Modified: / 20.5.1998 / 22:58:35 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
saveAndTerminateView:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
    "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
   267
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
    aView saveAndTerminate
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
    "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
   271
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
terminateView:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
    "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
   275
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
    aView terminate
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
    "Created: 24.11.1995 / 19:18:48 / cg"
3888
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
   279
! !
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
   280
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
   281
!SynchronousWindowSensor methodsFor:'event processing-private'!
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
   282
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
   283
pushDamageEvent:ev
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
   284
    self sendEvent:ev to:ev view
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
3888
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
   287
pushUserEvent:selector for:anyObject withArguments:argList
1e06f949dc58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3858
diff changeset
   288
    ^ 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
   289
! !
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   291
!SynchronousWindowSensor methodsFor:'private'!
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   292
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   293
sendEvent:anEvent to:aView
3858
ecbaa5d75c70 Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 3680
diff changeset
   294
    WindowGroup lastEventQuerySignal answer:anEvent do:[
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   295
        aView dispatchEvent:anEvent
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   296
    ].
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   297
! !
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   298
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
!SynchronousWindowSensor methodsFor:'specials'!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
1243
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   301
catchExposeFor:aView
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
    "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
   303
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   304
    catchExpose notEmpty ifTrue:[
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   305
	'SWSensor [warning]: already catching in catchExpose' errorPrintCR.
1243
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   306
    ].
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   307
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   308
    gotOtherEvent remove:aView ifAbsent:nil.
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   309
    gotExpose remove:aView ifAbsent:nil.
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   310
    catchExpose add:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   312
    "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
   313
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
waitForExposeFor:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
    "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
   317
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   318
    |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
   319
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   320
    device := aView graphicsDevice.
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   321
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   322
    "/ 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
   323
    device scrollsAsynchronous ifTrue:[
4120
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   324
        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
   325
4120
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   326
        "/
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   327
        "/ 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
   328
        "/ must poll for the event
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   329
        "/
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   330
        endPollTime := Timestamp now addSeconds:10.
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   331
        stopPoll := false.
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   332
4120
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   333
        [(gotExpose includes:aView) or:[stopPoll]] whileFalse:[
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   334
            (device exposeEventPendingFor:windowId withSync:true) ifTrue:[
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   335
                device dispatchExposeEventFor:windowId.
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   336
            ].
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   337
            stopPoll := Timestamp now > endPollTime.
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   338
            Processor yield.
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   339
        ].
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   340
4120
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   341
        stopPoll ifTrue:[
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   342
            'SyncWindowSensor [warning]: lost expose event' errorPrintCR.
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   343
        ]
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
    ].
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   345
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   346
    catchExpose remove:aView ifAbsent:nil.
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   347
    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
   348
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   349
    "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
   350
! !
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
1243
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   352
!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
   353
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
version
4120
bd779aa2b314 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 3888
diff changeset
   355
    ^ '$Header: /cvs/stx/stx/libview/SynchronousWindowSensor.st,v 1.26 2004-03-20 15:42:56 stefan Exp $'
615
59b046c2e44f documentation
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   356
! !