equal
deleted
inserted
replaced
1 " |
1 " |
2 COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
2 COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
3 All Rights Reserved |
3 All Rights Reserved |
4 |
4 |
5 This software is furnished under a license and may be used |
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 |
6 only in accordance with the terms of that license and with the |
7 inclusion of the above copyright notice. This software may not |
7 inclusion of the above copyright notice. This software may not |
8 be provided or otherwise made available to, or used by, any |
8 be provided or otherwise made available to, or used by, any |
12 |
12 |
13 |
13 |
14 "{ Package: 'stx:libview' }" |
14 "{ Package: 'stx:libview' }" |
15 |
15 |
16 Object subclass:#GraphicsDevice |
16 Object subclass:#GraphicsDevice |
17 instanceVariableNames:'displayId eventListeners' |
17 instanceVariableNames:'displayId screen eventListeners' |
18 classVariableNames:'' |
18 classVariableNames:'' |
19 poolDictionaries:'' |
19 poolDictionaries:'' |
20 category:'Interface-Graphics' |
20 category:'Interface-Graphics' |
21 ! |
21 ! |
22 |
22 |
23 !GraphicsDevice class methodsFor:'documentation'! |
23 !GraphicsDevice class methodsFor:'documentation'! |
24 |
24 |
25 copyright |
25 copyright |
26 " |
26 " |
27 COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
27 COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
28 All Rights Reserved |
28 All Rights Reserved |
29 |
29 |
30 This software is furnished under a license and may be used |
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 |
31 only in accordance with the terms of that license and with the |
32 inclusion of the above copyright notice. This software may not |
32 inclusion of the above copyright notice. This software may not |
33 be provided or otherwise made available to, or used by, any |
33 be provided or otherwise made available to, or used by, any |
44 |
44 |
45 In ST/X, this is mostly dummy. |
45 In ST/X, this is mostly dummy. |
46 |
46 |
47 [instance variables:] |
47 [instance variables:] |
48 displayId <Handle> the device handle |
48 displayId <Handle> the device handle |
|
49 screen any another some device specific id |
49 |
50 |
50 [see also:] |
51 [see also:] |
51 DeviceWorkstation XWorkstation |
52 DeviceWorkstation XWorkstation |
52 |
53 |
53 [author:] |
54 [author:] |
54 Claus Gittinger |
55 Claus Gittinger |
55 " |
56 " |
56 |
57 |
57 ! ! |
58 ! ! |
58 |
59 |
59 !GraphicsDevice methodsFor:'accessing'! |
60 !GraphicsDevice methodsFor:'accessing'! |
61 addEventListener:aListener |
62 addEventListener:aListener |
62 "add a local eventListener (with new protocol - #processEvent:) |
63 "add a local eventListener (with new protocol - #processEvent:) |
63 This one gets a chance to intercept all events for this device" |
64 This one gets a chance to intercept all events for this device" |
64 |
65 |
65 eventListeners isNil ifTrue:[ |
66 eventListeners isNil ifTrue:[ |
66 eventListeners := OrderedCollection new:2 |
67 eventListeners := OrderedCollection new:2 |
67 ]. |
68 ]. |
68 eventListeners add:aListener |
69 eventListeners add:aListener |
69 |
70 |
70 |
71 |
71 ! |
72 ! |
72 |
73 |
73 removeEventListener:aListener |
74 removeEventListener:aListener |
74 "remove a local eventListener (with new protocol - #processEvent:)" |
75 "remove a local eventListener (with new protocol - #processEvent:)" |
75 |
76 |
76 eventListeners notNil ifTrue:[ |
77 eventListeners notNil ifTrue:[ |
77 eventListeners removeIdentical:aListener ifAbsent:nil |
78 eventListeners removeIdentical:aListener ifAbsent:nil |
78 ]. |
79 ]. |
79 |
80 |
80 |
81 |
81 ! ! |
82 ! ! |
82 |
83 |
91 |
92 |
92 anyListenerReturnedTrue := false. |
93 anyListenerReturnedTrue := false. |
93 |
94 |
94 "/ local listeners ... |
95 "/ local listeners ... |
95 eventListeners notNil ifTrue:[ |
96 eventListeners notNil ifTrue:[ |
96 eventListeners do:[:aListener | |
97 eventListeners do:[:aListener | |
97 anyListenerReturnedTrue := anyListenerReturnedTrue | |
98 anyListenerReturnedTrue := anyListenerReturnedTrue | |
98 (aListener processEvent:anEvent) |
99 (aListener processEvent:anEvent) |
99 ] |
100 ] |
100 ]. |
101 ]. |
101 |
102 |
102 ^ anyListenerReturnedTrue. |
103 ^ anyListenerReturnedTrue. |
103 |
104 |
104 ! ! |
105 ! ! |
105 |
106 |
106 !GraphicsDevice class methodsFor:'documentation'! |
107 !GraphicsDevice class methodsFor:'documentation'! |
107 |
108 |
108 version |
109 version |
109 ^ '$Header: /cvs/stx/stx/libview/GraphicsDevice.st,v 1.4 2000-05-17 13:59:53 stefan Exp $' |
110 ^ '$Header: /cvs/stx/stx/libview/GraphicsDevice.st,v 1.5 2000-07-07 09:41:35 cg Exp $' |
110 ! ! |
111 ! ! |