1282
|
1 |
"
|
1283
|
2 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
|
1282
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
|
3198
|
14 |
"{ Package: 'stx:libview' }"
|
|
15 |
|
1282
|
16 |
Object subclass:#GraphicsDevice
|
3198
|
17 |
instanceVariableNames:'displayId eventListeners'
|
1282
|
18 |
classVariableNames:''
|
|
19 |
poolDictionaries:''
|
|
20 |
category:'Interface-Graphics'
|
|
21 |
!
|
|
22 |
|
|
23 |
!GraphicsDevice class methodsFor:'documentation'!
|
|
24 |
|
|
25 |
copyright
|
|
26 |
"
|
1283
|
27 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
|
1282
|
28 |
All Rights Reserved
|
|
29 |
|
|
30 |
This software is furnished under a license and may be used
|
|
31 |
only in accordance with the terms of that license and with the
|
|
32 |
inclusion of the above copyright notice. This software may not
|
|
33 |
be provided or otherwise made available to, or used by, any
|
|
34 |
other person. No title to or ownership of the software is
|
|
35 |
hereby transferred.
|
|
36 |
"
|
|
37 |
|
|
38 |
!
|
|
39 |
|
|
40 |
documentation
|
|
41 |
"
|
|
42 |
this abstract class was inserted to provide a home for ST-80 classes
|
|
43 |
(previously, DeviceWorkstation was directly under Object).
|
|
44 |
|
1283
|
45 |
In ST/X, this is mostly dummy.
|
|
46 |
|
1282
|
47 |
[instance variables:]
|
|
48 |
displayId <Handle> the device handle
|
|
49 |
|
|
50 |
[see also:]
|
|
51 |
DeviceWorkstation XWorkstation
|
|
52 |
|
|
53 |
[author:]
|
|
54 |
Claus Gittinger
|
|
55 |
"
|
|
56 |
|
|
57 |
! !
|
|
58 |
|
3198
|
59 |
!GraphicsDevice methodsFor:'accessing'!
|
|
60 |
|
|
61 |
addEventListener:aListener
|
|
62 |
"add a local eventListener (with new protocol - #processEvent:)
|
|
63 |
This one gets a chance to intercept all events for this device"
|
|
64 |
|
|
65 |
eventListeners isNil ifTrue:[
|
|
66 |
eventListeners := OrderedCollection new:2
|
|
67 |
].
|
|
68 |
eventListeners add:aListener
|
|
69 |
|
|
70 |
|
|
71 |
!
|
|
72 |
|
|
73 |
removeEventListener:aListener
|
|
74 |
"remove a local eventListener (with new protocol - #processEvent:)"
|
|
75 |
|
|
76 |
eventListeners notNil ifTrue:[
|
|
77 |
eventListeners removeIdentical:aListener ifAbsent:nil
|
|
78 |
].
|
|
79 |
|
|
80 |
|
|
81 |
! !
|
|
82 |
|
|
83 |
!GraphicsDevice methodsFor:'event processing'!
|
|
84 |
|
|
85 |
notifyEventListenersAbout:anEvent
|
|
86 |
"notify all eventHandlers about an incoming event.
|
|
87 |
If any returns true, it is assumed to be eaten by the handler and not
|
|
88 |
enqueued (i.e. not passed to the windowGroup process)"
|
|
89 |
|
|
90 |
|anyListenerReturnedTrue|
|
|
91 |
|
|
92 |
anyListenerReturnedTrue := false.
|
|
93 |
|
|
94 |
"/ local listeners ...
|
|
95 |
eventListeners notNil ifTrue:[
|
|
96 |
eventListeners do:[:aListener |
|
|
97 |
anyListenerReturnedTrue := anyListenerReturnedTrue |
|
|
98 |
(aListener processEvent:anEvent)
|
|
99 |
]
|
|
100 |
].
|
|
101 |
|
|
102 |
^ anyListenerReturnedTrue.
|
|
103 |
|
|
104 |
! !
|
|
105 |
|
1282
|
106 |
!GraphicsDevice class methodsFor:'documentation'!
|
|
107 |
|
|
108 |
version
|
3198
|
109 |
^ '$Header: /cvs/stx/stx/libview/GraphicsDevice.st,v 1.4 2000-05-17 13:59:53 stefan Exp $'
|
1282
|
110 |
! !
|