0
|
1 |
"
|
6
|
2 |
COPYRIGHT (c) 1988 by Claus Gittinger
|
71
|
3 |
All Rights Reserved
|
0
|
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 |
PseudoView subclass:#DisplayRootView
|
2
|
14 |
instanceVariableNames:''
|
0
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Views-Basic'
|
|
18 |
!
|
|
19 |
|
|
20 |
DisplayRootView comment:'
|
6
|
21 |
COPYRIGHT (c) 1988 by Claus Gittinger
|
71
|
22 |
All Rights Reserved
|
54
|
23 |
|
71
|
24 |
$Header: /cvs/stx/stx/libview/DisplayRootView.st,v 1.8 1994-10-10 02:29:37 claus Exp $
|
0
|
25 |
'!
|
|
26 |
|
|
27 |
Smalltalk at:#RootView put:nil!
|
|
28 |
|
45
|
29 |
!DisplayRootView class methodsFor:'documentation'!
|
|
30 |
|
|
31 |
copyright
|
|
32 |
"
|
|
33 |
COPYRIGHT (c) 1988 by Claus Gittinger
|
71
|
34 |
All Rights Reserved
|
45
|
35 |
|
|
36 |
This software is furnished under a license and may be used
|
|
37 |
only in accordance with the terms of that license and with the
|
|
38 |
inclusion of the above copyright notice. This software may not
|
|
39 |
be provided or otherwise made available to, or used by, any
|
|
40 |
other person. No title to or ownership of the software is
|
|
41 |
hereby transferred.
|
|
42 |
"
|
|
43 |
!
|
|
44 |
|
|
45 |
version
|
|
46 |
"
|
71
|
47 |
$Header: /cvs/stx/stx/libview/DisplayRootView.st,v 1.8 1994-10-10 02:29:37 claus Exp $
|
45
|
48 |
"
|
|
49 |
!
|
|
50 |
|
|
51 |
documentation
|
|
52 |
"
|
|
53 |
this class describes Xs rootWindow (which is the background window and
|
|
54 |
must be used for drawing outside of Views i.e. for dragging between Views)
|
|
55 |
"
|
|
56 |
! !
|
|
57 |
|
0
|
58 |
!DisplayRootView class methodsFor:'initialization'!
|
|
59 |
|
|
60 |
initialize
|
|
61 |
Display isNil ifTrue:[
|
71
|
62 |
Workstation initialize
|
0
|
63 |
].
|
|
64 |
super initialize
|
|
65 |
! !
|
|
66 |
|
|
67 |
!DisplayRootView class methodsFor:'instance creation'!
|
|
68 |
|
|
69 |
new
|
|
70 |
"since there is only one RootView - catch new"
|
|
71 |
RootView isNil ifTrue:[
|
71
|
72 |
RootView := super new
|
0
|
73 |
].
|
|
74 |
^ RootView
|
|
75 |
! !
|
|
76 |
|
|
77 |
!DisplayRootView methodsFor:'initialization'!
|
|
78 |
|
|
79 |
initialize
|
|
80 |
super initialize.
|
|
81 |
width := device width.
|
|
82 |
height := device height.
|
|
83 |
realized := true.
|
|
84 |
drawableId := device rootWindowFor:self
|
|
85 |
!
|
|
86 |
|
|
87 |
reinitialize
|
|
88 |
"reinit after snapin"
|
|
89 |
|
|
90 |
width := device width.
|
|
91 |
height := device height.
|
2
|
92 |
drawableId := device rootWindowFor:self.
|
|
93 |
gcId := nil.
|
0
|
94 |
! !
|
|
95 |
|
|
96 |
!DisplayRootView methodsFor:'accessing'!
|
|
97 |
|
|
98 |
name
|
|
99 |
^ 'RootWindow'
|
|
100 |
!
|
|
101 |
|
|
102 |
controller
|
|
103 |
^ nil
|
23
|
104 |
!
|
|
105 |
|
|
106 |
sensor
|
|
107 |
^ nil
|
0
|
108 |
! !
|
|
109 |
|
71
|
110 |
!DisplayRootView methodsFor:'destroying'!
|
|
111 |
|
|
112 |
destroy
|
|
113 |
"catch destroy - some windowmanagers get confused if
|
|
114 |
we destroy the rootWindow if its a virtual root window"
|
|
115 |
|
|
116 |
^ self
|
|
117 |
! !
|
|
118 |
|
0
|
119 |
!DisplayRootView methodsFor:'queries'!
|
|
120 |
|
|
121 |
canDrop:anObjectOrCollection
|
|
122 |
"return true, if anObjectOrCollection can be
|
|
123 |
dropped in the receiver. This method should be
|
|
124 |
redefined in views which can take objects"
|
|
125 |
|
|
126 |
^ false
|
2
|
127 |
!
|
0
|
128 |
|
|
129 |
isWindowManagerRunning
|
2
|
130 |
"answer true, if a window manager is currently running.
|
|
131 |
This is done by performing an action (enabling button events of
|
23
|
132 |
root window), which will fail if a window manager is running."
|
0
|
133 |
|
2
|
134 |
|errorOccured|
|
0
|
135 |
|
|
136 |
errorOccured := false.
|
2
|
137 |
device class deviceErrorSignal handle:[:ex |
|
71
|
138 |
errorOccured := true.
|
|
139 |
ex return
|
2
|
140 |
] do:[
|
71
|
141 |
self enableButtonEvents.
|
|
142 |
device synchronizeOutput.
|
2
|
143 |
].
|
0
|
144 |
^ errorOccured
|
23
|
145 |
|
|
146 |
"RootView isWindowManagerRunning"
|
0
|
147 |
! !
|