author | convert-repo |
Fri, 21 Dec 2018 04:38:02 +0000 | |
changeset 8601 | bee9c53ab413 |
parent 8499 | 46c8f7e673c2 |
child 8614 | e22f68a413b2 |
permissions | -rw-r--r-- |
8352 | 1 |
"{ Encoding: utf8 }" |
2 |
||
0 | 3 |
" |
4 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
6296 | 5 |
All Rights Reserved |
0 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
3193 | 14 |
"{ Package: 'stx:libview' }" |
15 |
||
6757 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
1286
f7c2ac67388b
inserted dummy abstract classes for ST-80 compatible subclassing
Claus Gittinger <cg@exept.de>
parents:
1281
diff
changeset
|
18 |
HostGraphicsDevice subclass:#DeviceWorkstation |
6164
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
19 |
instanceVariableNames:'visualType monitorType depth ncells bitsPerRGB bitsRed bitsGreen |
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
20 |
bitsBlue redMask greenMask blueMask redShift greenShift blueShift |
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
21 |
hasColors hasGreyscales width height widthMM heightMM |
7450 | 22 |
resolutionHor resolutionVer lastId lastView knownViews |
23 |
dispatching dispatchProcess exitOnLastClose ctrlDown shiftDown |
|
24 |
metaDown altDown superDown motionEventCompression keyboardMap |
|
25 |
rootView isSlow activeKeyboardGrab activePointerGrab |
|
26 |
buttonTranslation multiClickTimeDelta altModifiers metaModifiers |
|
27 |
ctrlModifiers shiftModifiers superModifiers buttonModifiers |
|
28 |
supportsDeepIcons preferredIconSize ditherColors fixColors |
|
29 |
numFixRed numFixGreen numFixBlue fixGrayColors copyBuffer |
|
30 |
blackColor whiteColor focusMode activeView clipBoardEncoding |
|
8435 | 31 |
maxClipBoardSize focusView focusWindowGroup deviceErrorSignal |
32 |
deviceIOErrorSignal mayOpenDebugger suppressDebugger eventSema |
|
7450 | 33 |
buttonLongPressedHandlerProcess buttonPressTimeForMenu |
34 |
aboutToOpenModalWindowHooks aboutToOpenNonModalWindowHooks' |
|
7776 | 35 |
classVariableNames:'AllScreens ButtonTranslation CopyBufferHistory |
36 |
CopyBufferHistorySize CurrentScreenQuerySignal |
|
37 |
DefaultButtonPressTimeForMenu DefaultScreen DeviceErrorSignal |
|
38 |
DeviceIOErrorSignal DeviceIOTimeoutErrorSignal |
|
39 |
DeviceOpenErrorSignal DrawingOnClosedDeviceSignal ErrorPrinting |
|
40 |
ExitOnLastClose LastActiveProcess LastActiveScreen |
|
41 |
MultiClickTimeDelta WindowsRightButtonBehavior' |
|
6164
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
42 |
poolDictionaries:'' |
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
43 |
category:'Interface-Graphics' |
0 | 44 |
! |
45 |
||
3478 | 46 |
Object subclass:#DeviceFontMetrics |
6164
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
47 |
instanceVariableNames:'encoding ascent descent maxAscent maxDescent minWidth maxWidth |
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
48 |
averageWidth minCode maxCode direction' |
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
49 |
classVariableNames:'' |
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
50 |
poolDictionaries:'' |
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
51 |
privateIn:DeviceWorkstation |
3478 | 52 |
! |
53 |
||
1075
62f0cfb3c956
dont return nil entries in #knownViews
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
54 |
!DeviceWorkstation class methodsFor:'documentation'! |
46 | 55 |
|
56 |
copyright |
|
57 |
" |
|
0 | 58 |
COPYRIGHT (c) 1993 by Claus Gittinger |
6296 | 59 |
All Rights Reserved |
0 | 60 |
|
46 | 61 |
This software is furnished under a license and may be used |
62 |
only in accordance with the terms of that license and with the |
|
63 |
inclusion of the above copyright notice. This software may not |
|
64 |
be provided or otherwise made available to, or used by, any |
|
65 |
other person. No title to or ownership of the software is |
|
66 |
hereby transferred. |
|
67 |
" |
|
68 |
! |
|
0 | 69 |
|
70 |
documentation |
|
71 |
" |
|
38 | 72 |
this abstract class defines common protocol to all Display types. |
4350 | 73 |
For compatibility with ST-80, this class (actually a concrete subclass) |
599 | 74 |
is also bound to the global variable Screen. |
75 |
||
76 |
DeviceWorkstation (and its concrete subclasses) are the central classes |
|
77 |
around windowManagement and event processing. |
|
78 |
See the documentation in #events and #workstationDevices for more detailed |
|
79 |
info. |
|
80 |
||
81 |
[instance variables:] |
|
0 | 82 |
|
134 | 83 |
displayId <Number> the device id of the display |
84 |
visualType <Symbol> one of #StaticGray, #PseudoColor, ... #TrueColor |
|
85 |
monitorType <Symbol> one of #monochrome, #color, #unknown |
|
86 |
||
193 | 87 |
depth <SmallInteger> bits per color |
88 |
ncells <SmallInteger> number of colors (i.e. colormap size; not always == 2^depth) |
|
89 |
bitsPerRGB <SmallInteger> number of valid bits per rgb component |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
90 |
(actual number taken in A/D converter; not all devices report the true value) |
193 | 91 |
bitsRed <SmallInteger> number of red bits (only valid for TrueColor displays) |
92 |
bitsGreen <SmallInteger> number of green bits (only valid for TrueColor displays) |
|
93 |
bitsBlue <SmallInteger> number of blue bits (only valid for TrueColor displays) |
|
94 |
redMask <SmallInteger> shifted red mask (only useful for TrueColor displays) |
|
95 |
greenMask <SmallInteger> shifted green mask (only useful for TrueColor displays) |
|
96 |
blueMask <SmallInteger> shifted blue mask (only useful for TrueColor displays) |
|
97 |
shiftRed <SmallInteger> number of bits to shift red bits (only valid for TrueColor displays) |
|
98 |
shiftGreen <SmallInteger> number of bits to shift green bits (only valid for TrueColor displays) |
|
99 |
shiftBlue <SmallInteger> number of bits to shift blue bits (only valid for TrueColor displays) |
|
100 |
||
134 | 101 |
hasColors <Boolean> true, if display supports colors |
102 |
hasGreyscales <Boolean> true, if display supports grey-scales (i.e is not b/w display) |
|
193 | 103 |
width <SmallInteger> number of horizontal pixels |
4350 | 104 |
height <SmallInteger> number of vertical pixels |
134 | 105 |
heightMM <Number> screen height in millimeter |
106 |
widthMM <Number> screen width in millimeter |
|
107 |
resolutionHor <Number> pixels per horizontal millimeter |
|
108 |
resolutionVer <Number> pixels per vertical millimeter |
|
109 |
||
7450 | 110 |
knownViews <WeakValueDictionary> viewId -> view all of my known views |
134 | 111 |
|
112 |
dispatching <Boolean> true, if currently in dispatch loop |
|
2818
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
113 |
exitDispatchOnLastWindowClose |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
114 |
<Boolean> if true, dispatch is finished when the last |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
115 |
window closes (default:true). |
134 | 116 |
|
151 | 117 |
ctrlDown <Boolean> true, if control key currently pressed |
134 | 118 |
shiftDown <Boolean> true, if shift key currently pressed |
119 |
metaDown <Boolean> true, if meta key (cmd-key) is currently pressed |
|
120 |
altDown <Boolean> true, if alt key is currently pressed |
|
121 |
||
122 |
motionEventCompression |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
123 |
<Boolean> if true motion events are compressed |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
124 |
(obsolete: now done in sensor) |
134 | 125 |
|
126 |
lastId <Number> the id of the last events view (internal) |
|
127 |
lastView <View> the last events view (internal, for faster id->view mapping) |
|
128 |
||
129 |
keyboardMap <KeyBdMap> mapping for keys |
|
130 |
rootView <DisplayRootView> this displays root window |
|
131 |
isSlow <Boolean> set/cleared from startup - used to turn off |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
132 |
things like popup-shadows etc. |
599 | 133 |
|
1717
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
134 |
focusMode <Symbol> nil, #pointer or #activeWindow |
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
135 |
activeWindow <View> WINDOWS only: the currently active (foreground) view |
1710
df5f8609825d
win changes (pass drawableId to clip methods)
Claus Gittinger <cg@exept.de>
parents:
1708
diff
changeset
|
136 |
|
1788 | 137 |
clipBoardEncoding |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
138 |
<Symbol> encoding of pasted clipBoard text; |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
139 |
nil means: iso8859. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
140 |
set this to #shiftJis, if pasting |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
141 |
SJIS text (for example, from Netscape) |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
142 |
Some systems pass encoding information |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
143 |
in the clipBoard - there, this is not |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
144 |
needed. |
1787 | 145 |
|
1122 | 146 |
[class variables:] |
147 |
||
148 |
MultiClickTimeDelta in ms; controls how long of a delay is |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
149 |
required between two clicks, to NOT take |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
150 |
it as a multi-click. |
1122 | 151 |
|
152 |
ErrorPrinting controls low-level (X-) error message printing |
|
153 |
||
8033 | 154 |
AllScreens a collection of known screens |
1122 | 155 |
|
599 | 156 |
[see also:] |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
157 |
GraphicsContext DeviceDrawable |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
158 |
WindowSensor WindowGroup WindowEvent |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
159 |
ProcessorScheduler |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
160 |
PSMedium |
614 | 161 |
|
162 |
[author:] |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
163 |
Claus Gittinger |
0 | 164 |
" |
151 | 165 |
! |
166 |
||
293 | 167 |
events |
168 |
" |
|
6099 | 169 |
All events are processed in a workstation's dispatchEvent method. |
293 | 170 |
There, incoming events are first sent to itself, for a first (view independent) |
6099 | 171 |
preprocessing. For example, the device's state of the shift-, alt-, control and |
293 | 172 |
meta keys are updated there. After that, the event is forwarded either to |
6099 | 173 |
the view's sensor or to the view directly (if it has no sensor). |
293 | 174 |
(Sensorless views are a leftover from ancient times and will sooner or |
175 |
later vanish - simplifying things a bit. Do not depend on views without |
|
176 |
sensors to work correctly in future versions.) |
|
177 |
||
178 |
This event processing is done by the event dispatcher process, which is |
|
179 |
launched in ST/X's startup sequence (see Smalltalk>>start). |
|
6099 | 180 |
Event processing is done at a high priority, to allow keyboard processing |
293 | 181 |
and CTRL-C handling to be performed even while other processes are running. |
1697 | 182 |
The code executed by the event process is found in #startDispatch. |
293 | 183 |
|
6296 | 184 |
Individual events can be enabled or disabled. |
6099 | 185 |
The ones that are enabled by default are: |
6296 | 186 |
keypress / keyRelease |
187 |
buttonPress / buttonRelease / buttonMotion (i.e. motion with button pressed) |
|
188 |
pointerEnter / pointerLeave |
|
6099 | 189 |
|
190 |
Other events have to be enabled by sending a corresponding #enableXXXEvent |
|
293 | 191 |
message to the view which shall receive those events. |
192 |
For example, pointerMotion events (i.e. motion without button being pressed) |
|
390
19a90edd0dc4
added #resolution for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
354
diff
changeset
|
193 |
are enabled by: 'aView enableMotionEvent' |
293 | 194 |
|
6099 | 195 |
The above is only of interest, if you write your own widget classes; |
293 | 196 |
existing widgets set things as required in their #initEvents method. |
197 |
" |
|
198 |
! |
|
199 |
||
151 | 200 |
workstationDevices |
201 |
" |
|
202 |
In ST/X, all interaction with the graphics device is done through |
|
203 |
an instance of (a subclass) of DeviceWorkstation. |
|
204 |
Every view has a reference to the device it has been created on in |
|
4350 | 205 |
its 'device' instance variable. |
151 | 206 |
|
207 |
One particular device instance is bound to the global variable Display: |
|
208 |
this is the default graphics display, on which new views are created |
|
209 |
(however, provisions exist for multi-display operation) |
|
210 |
||
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
211 |
Currently, there is are twoconcrete display classes (released to the public): |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
212 |
|
6296 | 213 |
XWorkstation - a plain X window interface |
214 |
||
215 |
GLXWorkstation - an X window interface with a GL(tm) (3D graphic library) |
|
216 |
extension; either simulated (VGL) or a real GL |
|
217 |
(real GL is only available on SGI machines) |
|
1122 | 218 |
|
219 |
the following are coming soon: |
|
220 |
||
6296 | 221 |
OpenGLWorkstation |
222 |
- an X window interface with a openGL(tm) (3D graphic library) |
|
223 |
extension; either simulated (MESA) or a real openGL |
|
224 |
(real openGL is only available on SGI/NT machines) |
|
225 |
||
226 |
WinWorkstation - what will that be ? |
|
151 | 227 |
|
228 |
An experimental version for a NeXTStep interface exists, but is currently |
|
229 |
no longer maintained and not released. |
|
230 |
||
231 |
DeviceWorkstation itself is an abstract class; the methods as defined |
|
232 |
here perform things which are common to all graphic devices or block |
|
233 |
methods and raise a subclassResponsibilty error condition. |
|
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
234 |
To create a new graphic interface, at least the subclassResponsibility-methods |
151 | 235 |
have to be reimplemented in a concrete subclass. |
236 |
||
4350 | 237 |
ST/X is designed to allow the use of multiple workstation devices in parallel, |
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
238 |
if the underlying window system supports this. |
4350 | 239 |
For example, in X, it is possible to create another instance of XWorkstation, |
240 |
start a dispatch process for it, and to create and open views on this display. |
|
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
241 |
Multiple display operation does not work with other devices (i.e. Windows). |
151 | 242 |
|
243 |
If you want to experiment with multi-display applications, |
|
244 |
you have to: |
|
245 |
||
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
246 |
- create a new instance of XWorkstation: |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
247 |
|
6296 | 248 |
Smalltalk at:#Display2 put:(XWorkstation new). |
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
249 |
or: |
6296 | 250 |
Smalltalk at:#Display2 put:(GLXWorkstation new). |
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
251 |
|
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
252 |
|
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
253 |
- have it connect to the display (i.e. the xServer): |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
254 |
(replace 'localhost' below with the name of your display) |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
255 |
|
6296 | 256 |
Display2 := Display2 initializeFor:'localhost:0.0' |
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
257 |
|
4350 | 258 |
returns nil, if connection is refused |
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
259 |
- leaving you with Display2==nil in this case. |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
260 |
|
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
261 |
|
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
262 |
- start an event dispatcher process for it: |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
263 |
(this is now no longer needed - the first opened view will do it for you) |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
264 |
|
6296 | 265 |
Display2 startDispatch |
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
266 |
|
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
267 |
|
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
268 |
- optionally set its keyboard map |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
269 |
(since this is usually done for Display in the startup-file, |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
270 |
the new display does not have all your added key bindings) |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
271 |
|
6296 | 272 |
Display2 keyboardMap:(Display keyboardMap) |
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
273 |
|
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
274 |
|
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
275 |
- create a view for it: |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
276 |
|
6296 | 277 |
(FileBrowser onDevice:Display2) open |
278 |
||
279 |
(Workspace onDevice:Display2) open |
|
280 |
||
281 |
(Launcher onDevice:Display2) open |
|
282 |
does not work with Launcher, since its an ApplicationModel (not a view) |
|
283 |
use: |
|
284 |
Launcher openOnDevice:Display2 |
|
285 |
instead. |
|
3073 | 286 |
|
287 |
For all of the above, there is now a convenient helper method in |
|
288 |
ApplicationModel, which allows to write: |
|
6296 | 289 |
Application openOnXScreenNamed:'foo:0' |
921
db3996767685
care for rootView when checking for end of dispatch
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
290 |
|
db3996767685
care for rootView when checking for end of dispatch
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
291 |
However, as mentioned above, there may be a few places, where the default |
1191 | 292 |
display 'Display' is still hard-coded - especially, in contributed and |
293 |
Public domain code, you may find those. |
|
294 |
||
4350 | 295 |
Beside this (little bug ;-), remote display operation works pretty well. |
1191 | 296 |
If you write your application to work around those, multi-display applications are |
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
297 |
possible in the current release (and actually being used in a concrete application, |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
298 |
where up to 6 x-terminals are connected to a single linux PC). |
1191 | 299 |
|
300 |
To make your application ready for multi-display operation, replace all |
|
301 |
references to 'Display' by: 'Screen current', which evaluates to the currently |
|
302 |
active display. I.e. each view gets its actual display via this expression. |
|
303 |
Since ST/X views already use this, new views opened by remote views should |
|
304 |
come up on the remote display. |
|
151 | 305 |
|
306 |
There is no easy solution for things like Notifiers, WarnBoxes or |
|
307 |
Debuggers when opened from some background or non-view process. |
|
308 |
These will come up one the default Display, as returned by 'Screen default'. |
|
309 |
||
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
310 |
Finally, your application should care for I/O errors (i.e. lost connection when |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
311 |
a remote display is switched off). |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
312 |
The framework provides per-display signals, which are raised in the corresponding |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
313 |
event dispatchers context. |
4350 | 314 |
For a save environment, you should add static exception handler blocks on those |
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
315 |
signals; i.e. the setup for remote displays should look somewhat like: |
6296 | 316 |
|newDpy| |
317 |
||
318 |
newDpy := GLXWorkstation new. |
|
319 |
newDpy := newDpy initializeFor:'localhost:0.0'. |
|
320 |
newDpy isNil ifTrue:[ |
|
321 |
self warn:'cannot connect ...'. |
|
322 |
] ifFalse:[ |
|
323 |
newDpy deviceIOErrorSignal handlerBlock:[:ex | |
|
324 |
Transcript beep. |
|
325 |
Transcript showCR:'Display (' , newDpy displayName , '): connection broken.'. |
|
326 |
AbortSignal raise. |
|
327 |
]. |
|
328 |
newDpy startDispatch. |
|
329 |
Launcher openOnDevice:newDpy. |
|
330 |
]. |
|
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
331 |
|
1191 | 332 |
There may still some problems to be expected, |
151 | 333 |
if the screens have different display capabilities (b&w vs. greyscale vs. |
334 |
color display). The current styleSheet approach keeps default values |
|
4350 | 335 |
only once (it should do so per display ...) |
336 |
For now, expect ugly looking views in this case - or set your styleSheet |
|
1580
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
337 |
for the smallest common capabilities (i.e. for b&w). |
9a28ea48ec73
documentation: error handling
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
338 |
This may be fixed in a future version ... |
151 | 339 |
" |
0 | 340 |
! ! |
341 |
||
1075
62f0cfb3c956
dont return nil entries in #knownViews
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
342 |
!DeviceWorkstation class methodsFor:'initialization'! |
0 | 343 |
|
2 | 344 |
initialize |
609 | 345 |
"create local error signals; enable errorPrinting" |
346 |
||
2 | 347 |
DeviceErrorSignal isNil ifTrue:[ |
6296 | 348 |
DeviceErrorSignal := (Signal new) mayProceed:true. |
349 |
DeviceErrorSignal notifierString:'device error'. |
|
350 |
DeviceErrorSignal nameClass:self message:#deviceErrorSignal. |
|
351 |
||
352 |
DeviceOpenErrorSignal := DeviceErrorSignal newSignalMayProceed:true. |
|
353 |
DeviceOpenErrorSignal nameClass:self message:#deviceOpenErrorSignal. |
|
354 |
DeviceOpenErrorSignal notifierString:'cannot open device'. |
|
355 |
||
356 |
DeviceIOErrorSignal := (Signal new) mayProceed:false. |
|
357 |
DeviceIOErrorSignal notifierString:'device IO error'. |
|
358 |
DeviceIOErrorSignal nameClass:self message:#deviceIOErrorSignal. |
|
359 |
||
360 |
DeviceIOTimeoutErrorSignal := DeviceIOErrorSignal newSignalMayProceed:false. |
|
361 |
DeviceIOTimeoutErrorSignal notifierString:'device IO timeout error'. |
|
362 |
DeviceIOTimeoutErrorSignal nameClass:self message:#deviceIOTimeoutErrorSignal. |
|
363 |
||
364 |
CurrentScreenQuerySignal := QuerySignal new. |
|
365 |
CurrentScreenQuerySignal nameClass:self message:#currentScreenQuerySignal. |
|
366 |
CurrentScreenQuerySignal notifierString:'asking for current screen'. |
|
367 |
||
368 |
DrawingOnClosedDeviceSignal := DeviceErrorSignal newSignalMayProceed:true. |
|
369 |
DrawingOnClosedDeviceSignal nameClass:self message:#drawingOnClosedDeviceSignal. |
|
370 |
DrawingOnClosedDeviceSignal notifierString:'drawing attempt on closed graphics device'. |
|
3299
970960ffaef5
added DrawingOnClosedDevice signal
Claus Gittinger <cg@exept.de>
parents:
3263
diff
changeset
|
371 |
]. |
970960ffaef5
added DrawingOnClosedDevice signal
Claus Gittinger <cg@exept.de>
parents:
3263
diff
changeset
|
372 |
|
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
373 |
ErrorPrinting := true. |
423
98a3808d9902
additions for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
414
diff
changeset
|
374 |
|
134 | 375 |
self initializeConstants. |
609 | 376 |
|
3136 | 377 |
"/ for ST80 compatibility ... |
378 |
Screen := self. |
|
379 |
||
1844 | 380 |
"Modified: 3.8.1997 / 18:14:58 / cg" |
2 | 381 |
! |
382 |
||
0 | 383 |
initializeConstants |
384 |
"initialize some (soft) constants" |
|
385 |
||
3311 | 386 |
MultiClickTimeDelta := 300. "a click within 300ms is considered a double one" |
8499 | 387 |
CopyBufferHistorySize := 40. |
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
388 |
ButtonTranslation isNil ifTrue:[ |
8499 | 389 |
ButtonTranslation := #(1 2 2 2 2 2 2) "all other buttons to middleButton menu" |
390 |
"/ ButtonTranslation := #(1 2 3 4 5 6 7) "identity translation" |
|
5601 | 391 |
]. |
392 |
||
393 |
"Modified: / 25-08-2010 / 21:57:43 / cg" |
|
1704 | 394 |
! |
395 |
||
396 |
nativeWindows:aBoolean |
|
397 |
"enable / disable use of native windows - dummy here." |
|
398 |
||
0 | 399 |
! ! |
400 |
||
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
401 |
!DeviceWorkstation class methodsFor:'instance creation'! |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
402 |
|
3927 | 403 |
newDispatchingFor:aScreenName |
404 |
"create a new instance of mySelf, which serves aDeviceName. |
|
405 |
Only useful for device-classes which support multiple devices - |
|
406 |
i.e. X-Workstations" |
|
407 |
||
408 |
|newDevice someScreen| |
|
409 |
||
410 |
newDevice := self newFor:aScreenName. |
|
411 |
newDevice startDispatch. |
|
412 |
(someScreen := Screen current) isNil ifTrue:[ |
|
6296 | 413 |
someScreen := Screen default. |
3927 | 414 |
]. |
415 |
someScreen notNil ifTrue:[ |
|
6296 | 416 |
newDevice keyboardMap:(someScreen keyboardMap). |
417 |
newDevice buttonTranslation:(someScreen buttonTranslation). |
|
3927 | 418 |
]. |
419 |
||
4350 | 420 |
"/ arrange for it to finish its event dispatch loop, |
3927 | 421 |
"/ when the last view on it is closed. |
422 |
newDevice exitOnLastClose:true. |
|
423 |
||
424 |
^ newDevice. |
|
425 |
! |
|
426 |
||
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
427 |
newFor:aDisplayName |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
428 |
"Create an new instance for a connection to aDisplayName. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
429 |
If aDisplayName is nil, a connection to the standard display is opened" |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
430 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
431 |
^ self basicNew initializeFor:aDisplayName |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
432 |
! |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
433 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
434 |
openDefaultDisplay:aStringOrNil |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
435 |
"open the default display. aStringOrNil may be the display name, |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
436 |
if nil, the name is extracted from command-line-arguments or the environment. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
437 |
Raise a signal if open fails." |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
438 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
439 |
|display displayName| |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
440 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
441 |
displayName := aStringOrNil ? Screen defaultDisplayName. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
442 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
443 |
"find out about the concrete Workstation class" |
4350 | 444 |
Screen isAbstract ifTrue:[ |
6296 | 445 |
|wsClass wsClasses| |
446 |
||
447 |
wsClasses := OrderedCollection new. |
|
448 |
||
449 |
#(OpenGLWorkstation GLXWorkstation XWorkstation) |
|
450 |
detect:[:eachClassNameSymbol| (wsClass := Smalltalk classNamed:eachClassNameSymbol) notNil] ifNone:nil. |
|
451 |
wsClass notNil ifTrue:[wsClasses add:wsClass]. |
|
452 |
||
453 |
"preparation for WIN32/NeXTStep/OS2 and Mac interfacing; |
|
454 |
But if X11 is linked in and it is capable of setting up a connection, that will be used." |
|
455 |
#( |
|
456 |
"/ #NeXTWorkstation nil |
|
457 |
OS2Workstation isOS2like |
|
458 |
MacWorkstation isMAClike |
|
459 |
WinWorkstation isMSWINDOWSlike |
|
460 |
) pairWiseDo:[:wsClassName :checkSel| |
|
461 |
(checkSel isNil or:[OperatingSystem perform:checkSel]) ifTrue:[ |
|
462 |
(wsClass := Smalltalk classNamed:wsClassName) notNil ifTrue:[ |
|
463 |
wsClasses add:wsClass. |
|
464 |
] |
|
465 |
]. |
|
466 |
]. |
|
467 |
||
468 |
"/ try all classes until open of display works. |
|
469 |
wsClasses detect:[:cls| |
|
470 |
[ |
|
471 |
display := cls newFor:displayName. |
|
472 |
] on:Screen deviceOpenErrorSignal do:[:ex| ]. |
|
473 |
display notNil |
|
474 |
] ifNone:nil. |
|
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
475 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
476 |
] ifFalse:[ |
6296 | 477 |
display := Screen newFor:displayName. |
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
478 |
]. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
479 |
display isNil ifTrue:[ |
6296 | 480 |
Screen deviceOpenErrorSignal raiseWith:displayName. |
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
481 |
]. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
482 |
Screen := display class. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
483 |
Screen default:display. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
484 |
! ! |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
485 |
|
1075
62f0cfb3c956
dont return nil entries in #knownViews
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
486 |
!DeviceWorkstation class methodsFor:'Signal constants'! |
2 | 487 |
|
1219
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
488 |
currentScreenQuerySignal |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
489 |
"return the signal which can be used to provide a current |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
490 |
screen (if background processes ask for one)" |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
491 |
|
3398 | 492 |
CurrentScreenQuerySignal isNil ifTrue:[ |
6296 | 493 |
DeviceWorkstation initialize |
3398 | 494 |
]. |
1219
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
495 |
^ CurrentScreenQuerySignal |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
496 |
|
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
497 |
"Created: 15.2.1997 / 15:07:20 / cg" |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
498 |
! |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
499 |
|
2 | 500 |
deviceErrorSignal |
1578
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
501 |
"return the signal used for device error reporting. |
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
502 |
In multi-display configurations, this is the parent of |
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
503 |
all per-instance deviceErrorSignals." |
2 | 504 |
|
505 |
^ DeviceErrorSignal |
|
1578
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
506 |
! |
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
507 |
|
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
508 |
deviceIOErrorSignal |
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
509 |
"return the signal used for device I/O error reporting. |
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
510 |
In multi-display configurations, this is the parent of |
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
511 |
all per-instance deviceIOErrorSignals." |
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
512 |
|
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
513 |
^ DeviceIOErrorSignal |
1973 | 514 |
! |
515 |
||
516 |
deviceIOTimeoutErrorSignal |
|
517 |
"return the signal used for device I/O timeout error reporting. |
|
518 |
In multi-display configurations, this is the parent of |
|
519 |
all per-instance deviceIOTimeoutErrorSignals." |
|
520 |
||
521 |
^ DeviceIOTimeoutErrorSignal |
|
3308 | 522 |
! |
523 |
||
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
524 |
deviceOpenErrorSignal |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
525 |
"return the signal used for reporting of errors while opening a device." |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
526 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
527 |
^ DeviceOpenErrorSignal |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
528 |
! |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
529 |
|
3308 | 530 |
drawingOnClosedDeviceSignal |
531 |
^ DrawingOnClosedDeviceSignal |
|
1578
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
532 |
! ! |
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
533 |
|
1075
62f0cfb3c956
dont return nil entries in #knownViews
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
534 |
!DeviceWorkstation class methodsFor:'accessing'! |
0 | 535 |
|
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
536 |
default |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
537 |
"ST-80 compatibility. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
538 |
Return the default screen. This is typically the first opened |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
539 |
Display screen in a session. Use of the global variable Display |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
540 |
should vanish over time - replace it by Screen default." |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
541 |
|
3941 | 542 |
^ DefaultScreen ? Display |
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
543 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
544 |
" |
4350 | 545 |
Screen default |
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
546 |
" |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
547 |
! |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
548 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
549 |
default:aDevice |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
550 |
"Set the default screen. This is sent very early during startup, |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
551 |
and assigns the first opened screenDevice to both Display and the default |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
552 |
screen." |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
553 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
554 |
|old| |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
555 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
556 |
old := DefaultScreen. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
557 |
DefaultScreen := aDevice. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
558 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
559 |
"as long as global variable Display exists, set it too" |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
560 |
Display := aDevice. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
561 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
562 |
old ~~ aDevice ifTrue:[ |
6296 | 563 |
DisplayRootView initialize. |
75 | 564 |
]. |
0 | 565 |
! ! |
566 |
||
5937 | 567 |
!DeviceWorkstation class methodsFor:'clipboard support'! |
568 |
||
569 |
bufferAsString:aBuffer |
|
570 |
"aBuffer (my current selection) as a string" |
|
571 |
||
572 |
aBuffer isString ifTrue:[ |
|
6296 | 573 |
^ aBuffer string. |
5937 | 574 |
]. |
575 |
||
576 |
aBuffer isNil ifTrue:[ |
|
6296 | 577 |
^ '' |
5937 | 578 |
]. |
579 |
||
580 |
aBuffer isStringCollection ifTrue:[ |
|
6296 | 581 |
^ aBuffer |
582 |
from:1 |
|
583 |
to:aBuffer size |
|
584 |
asStringWith:Character cr |
|
585 |
compressTabs:false |
|
586 |
final:nil |
|
587 |
withEmphasis:false. |
|
6130 | 588 |
]. |
589 |
||
590 |
Error handle:[:ex | |
|
6296 | 591 |
Transcript showCR:'error while converting copyBuffer to store string: ', ex description. |
592 |
Error handle:[:ex | |
|
593 |
Transcript showCR:'error while converting copyBuffer to print string: ', ex description. |
|
594 |
^ '' |
|
595 |
] do:[ |
|
596 |
^ aBuffer printString |
|
597 |
] |
|
5937 | 598 |
] do:[ |
599 |
^ aBuffer storeString |
|
600 |
] |
|
601 |
||
602 |
"Created: / 13.2.1997 / 13:10:30 / cg" |
|
603 |
"Modified: / 20.1.1998 / 14:11:01 / stefan" |
|
604 |
! ! |
|
605 |
||
4350 | 606 |
!DeviceWorkstation class methodsFor:'defaults'! |
607 |
||
608 |
defaultButtonPressTimeForMenu |
|
609 |
^ DefaultButtonPressTimeForMenu ? 1 |
|
610 |
! |
|
611 |
||
612 |
defaultButtonPressTimeForMenu:seconds |
|
613 |
DefaultButtonPressTimeForMenu := seconds |
|
614 |
! ! |
|
615 |
||
1075
62f0cfb3c956
dont return nil entries in #knownViews
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
616 |
!DeviceWorkstation class methodsFor:'error handling'! |
293 | 617 |
|
618 |
errorInterrupt:errID with:aParameter |
|
544 | 619 |
"{ Pragma: +optSpace }" |
620 |
||
609 | 621 |
"an error in the devices low level code (typically Xlib or XtLib) |
4350 | 622 |
This is invoked via |
7450 | 623 |
XError->errorInterrupt:#DisplayError->registeredErrorInterruptHandlers |
1578
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
624 |
or |
7450 | 625 |
XError->errorInterrupt:#DisplayIOError->registeredErrorInterruptHandlers |
293 | 626 |
|
627 |
looks if a signal handler for DeviceErrorSignal is present, |
|
4350 | 628 |
and - if so raises the signal. |
1578
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
629 |
If the signal not handled, simply output a message and continue. |
293 | 630 |
This allows for non disrupted error reporting OR to catch and |
1578
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
631 |
investigate errors as required. |
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
632 |
However, io-errors are always delivered as a signal raise." |
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
633 |
|
4166 | 634 |
|badResource msg theDevice theSignal p signalHolder| |
1578
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
635 |
|
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
636 |
errID notNil ifTrue:[ |
7450 | 637 |
"/ |
638 |
"/ timeoutError passes the device; |
|
639 |
"/ the others pass the devicesID |
|
640 |
"/ |
|
641 |
errID == #DisplayIOTimeoutError ifTrue:[ |
|
642 |
theDevice := aParameter. |
|
643 |
"/ 'device timeout error' printCR. |
|
644 |
] ifFalse:[ |
|
645 |
AllScreens do:[:aDisplayDevice | |
|
646 |
aDisplayDevice id = aParameter ifTrue:[ |
|
647 |
theDevice := aDisplayDevice. |
|
648 |
] |
|
649 |
] |
|
650 |
] |
|
3299
970960ffaef5
added DrawingOnClosedDevice signal
Claus Gittinger <cg@exept.de>
parents:
3263
diff
changeset
|
651 |
]. |
1578
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
652 |
|
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
653 |
"/ now, we have the bad guy at hand ... |
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
654 |
"/ get a per-instance signal. |
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
655 |
|
2983 | 656 |
signalHolder := theDevice ? self. |
1578
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
657 |
errID == #DisplayIOError ifTrue:[ |
7450 | 658 |
"always raises an exception" |
659 |
theSignal := signalHolder deviceIOErrorSignal. |
|
660 |
msg := 'Display I/O Error'. |
|
661 |
badResource := theDevice. |
|
4166 | 662 |
] ifFalse:[errID == #DisplayIOTimeoutError ifTrue:[ |
7450 | 663 |
"always raises an exception for the current process" |
664 |
theSignal := signalHolder deviceIOTimeoutErrorSignal. |
|
665 |
msg := 'Display I/O timeout Error'. |
|
666 |
badResource := theDevice. |
|
4166 | 667 |
] ifFalse:[ "errID == #DisplayError" |
7450 | 668 |
"only raises an exception if handled" |
669 |
theSignal := signalHolder deviceErrorSignal. |
|
670 |
theDevice notNil ifTrue:[ |
|
671 |
"/ #resourceIdOfLastError will become instance-specific information in |
|
672 |
"/ the near future ... |
|
673 |
badResource := theDevice resourceOfId:self resourceIdOfLastError. |
|
674 |
]. |
|
675 |
msg := 'Display error: ' , self lastErrorString. |
|
4166 | 676 |
]]. |
7443 | 677 |
Logger info:'%1 - %2' with:msg with:badResource. |
4166 | 678 |
|
679 |
||
680 |
"interrupt that displays dispatch process |
|
681 |
and force it to shutdown" |
|
682 |
||
683 |
"DiplayIOTimeoutError is a synchronous event, that should hit the process |
|
684 |
that caused the timeout." |
|
685 |
||
686 |
(errID ~~ #DisplayIOTimeoutError and:[theDevice notNil]) ifTrue:[ |
|
7450 | 687 |
p := theDevice dispatchProcess. |
688 |
(p notNil and:[p ~~ Processor activeProcess]) ifTrue:[ |
|
689 |
Logger info:'interrupting: %1' with:p. |
|
690 |
||
691 |
p interruptWith:[ |
|
692 |
(errID == #DisplayError and:[theSignal isHandled not]) ifTrue:[ |
|
693 |
"unhandled display errors are ignored" |
|
694 |
ErrorPrinting ifTrue:[ |
|
695 |
Logger error:msg. |
|
696 |
]. |
|
697 |
] ifFalse:[ |
|
698 |
Logger info:'raising exception ...'. |
|
699 |
theSignal raiseSignalWith:badResource errorString:msg. |
|
700 |
Logger warning:'exception returned - send brokenConnection'. |
|
701 |
theDevice brokenConnection. |
|
702 |
Logger warning:'stopping dispatch'. |
|
703 |
theDevice stopDispatch. |
|
704 |
]. |
|
705 |
]. |
|
706 |
^ self. |
|
4166 | 707 |
"/ Processor reschedule. |
4250 | 708 |
"/ AbortOperationRequest raise. |
7450 | 709 |
]. |
4166 | 710 |
]. |
711 |
||
712 |
"If we come here, this is a DiplayIOTimeoutError, we don't know |
|
713 |
the display device or we are running on top of the dispatchProcess" |
|
1973 | 714 |
|
3186
c6cbcd34adf8
Allow handling of DisplayTimeout errors.
Stefan Vogel <sv@exept.de>
parents:
3177
diff
changeset
|
715 |
(theSignal isHandled or:[theSignal handlerBlock notNil]) ifTrue:[ |
7450 | 716 |
Logger info:'raising signal in current process' "with:Processor activeProcess displayString". |
717 |
theSignal raiseSignalWith:badResource errorString:msg. |
|
4166 | 718 |
]. |
719 |
||
720 |
errID == #DisplayError ifTrue:[ |
|
7450 | 721 |
"unhandled display errors are ignored" |
722 |
^ self. |
|
2983 | 723 |
]. |
3186
c6cbcd34adf8
Allow handling of DisplayTimeout errors.
Stefan Vogel <sv@exept.de>
parents:
3177
diff
changeset
|
724 |
|
c6cbcd34adf8
Allow handling of DisplayTimeout errors.
Stefan Vogel <sv@exept.de>
parents:
3177
diff
changeset
|
725 |
theDevice notNil ifTrue:[ |
7450 | 726 |
Logger info:'sending #brokenConnection'. |
727 |
theDevice brokenConnection. |
|
728 |
theDevice dispatchProcess == Processor activeProcess ifTrue:[ |
|
729 |
"I am running in the dispatch process |
|
730 |
and nobody handles theSignal, so abort the dispatcher" |
|
731 |
||
732 |
Logger info:'raising AbortOperationRequest'. |
|
733 |
AbortOperationRequest raise. |
|
734 |
] ifFalse:[ |
|
735 |
"Some other process (probably not even guilty - like someone doing a draw after a change) ... |
|
736 |
... see if we can unwind out of the drawing operation" |
|
737 |
||
738 |
|context| |
|
4637
b1f8510639aa
Fix display timeout error handling
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
739 |
|
b1f8510639aa
Fix display timeout error handling
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
740 |
"/ thisContext fullPrintAll. |
7450 | 741 |
context := thisContext. |
742 |
[ |
|
743 |
"find the first returnable context where theDevice is the receiver" |
|
744 |
context := context sender. |
|
745 |
] doUntil:[ |
|
746 |
context isNil or:[context receiver == theDevice and:[context canReturn]]. |
|
747 |
]. |
|
748 |
context notNil ifTrue:[ |
|
749 |
Logger info:'unwind the draw operation: %1' |
|
750 |
with:context methodPrintString. |
|
4637
b1f8510639aa
Fix display timeout error handling
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
751 |
"/ context fullPrintAll. |
7450 | 752 |
context unwind. |
753 |
"not reached" |
|
754 |
]. |
|
755 |
] |
|
7443 | 756 |
]. |
757 |
Logger info:'proceeding after error'. |
|
1578
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
758 |
|
01db7f44cbbd
handle broken X-connection smoothly
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
759 |
"Modified: 11.4.1997 / 11:28:27 / cg" |
293 | 760 |
! |
761 |
||
762 |
errorPrinting |
|
609 | 763 |
"return the `errorPrinting-is-on' flag" |
764 |
||
293 | 765 |
ErrorPrinting isNil ifTrue:[^ false]. |
766 |
^ ErrorPrinting |
|
609 | 767 |
|
768 |
"Modified: 24.4.1996 / 19:35:55 / cg" |
|
293 | 769 |
! |
770 |
||
771 |
errorPrinting:aBoolean |
|
609 | 772 |
"set/clear the `errorPrinting-is-on' flag" |
773 |
||
293 | 774 |
ErrorPrinting := aBoolean |
609 | 775 |
|
776 |
"Modified: 24.4.1996 / 19:36:02 / cg" |
|
293 | 777 |
! |
778 |
||
779 |
lastErrorString |
|
780 |
"return a string describing the last error" |
|
781 |
||
782 |
^ self subclassResponsibility |
|
783 |
! |
|
784 |
||
785 |
resourceIdOfLastError |
|
786 |
"return the resource id responsible for the last error" |
|
787 |
||
788 |
^ self subclassResponsibility |
|
789 |
! ! |
|
790 |
||
1075
62f0cfb3c956
dont return nil entries in #knownViews
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
791 |
!DeviceWorkstation class methodsFor:'queries'! |
293 | 792 |
|
793 |
allScreens |
|
609 | 794 |
"Return a collection of active display devices. |
390
19a90edd0dc4
added #resolution for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
354
diff
changeset
|
795 |
Typically, there is only one: Display or Screen current." |
293 | 796 |
|
1870
7f5931773d54
allScreens should always return a collection
Claus Gittinger <cg@exept.de>
parents:
1844
diff
changeset
|
797 |
^ AllScreens ? #() |
293 | 798 |
|
799 |
" |
|
4350 | 800 |
Screen allScreens |
293 | 801 |
" |
802 |
||
803 |
"Modified: 1.9.1995 / 13:38:35 / claus" |
|
1870
7f5931773d54
allScreens should always return a collection
Claus Gittinger <cg@exept.de>
parents:
1844
diff
changeset
|
804 |
"Modified: 18.8.1997 / 18:43:42 / cg" |
293 | 805 |
! |
806 |
||
807 |
current |
|
609 | 808 |
"Return the currently active screen, |
293 | 809 |
that is, the device of the currently executing windowGroup. |
810 |
It will be used in multi-display operation, to launch views on |
|
811 |
the correct device - even if not specified explicitely. |
|
609 | 812 |
This does not yet work fully satisfying if a background processes |
3100
0997eb19c9a4
removed info message (cannot figure out current screen)
Claus Gittinger <cg@exept.de>
parents:
3091
diff
changeset
|
813 |
invokes this ... the default display is returned in this case. |
0997eb19c9a4
removed info message (cannot figure out current screen)
Claus Gittinger <cg@exept.de>
parents:
3091
diff
changeset
|
814 |
In a headless (i.e. non-GUI) application, nil is returned." |
293 | 815 |
|
1310
6f89c1709ac3
changed (fixed?) Screen>>current
Claus Gittinger <cg@exept.de>
parents:
1305
diff
changeset
|
816 |
|wg dev thisProcess| |
293 | 817 |
|
1219
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
818 |
"/ |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
819 |
"/ if there is only one screen, |
7648 | 820 |
"/ take that ... it ought to be the Display |
1219
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
821 |
"/ |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
822 |
AllScreens size <= 1 ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
823 |
LastActiveProcess := LastActiveScreen := nil. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
824 |
Display notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
825 |
^ Display |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
826 |
] |
347 | 827 |
]. |
1219
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
828 |
|
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
829 |
"/ |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
830 |
"/ someone willing to tell me ? |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
831 |
"/ |
3398 | 832 |
(dev := self currentScreenQuerySignal query) notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
833 |
^ dev |
293 | 834 |
]. |
835 |
||
1310
6f89c1709ac3
changed (fixed?) Screen>>current
Claus Gittinger <cg@exept.de>
parents:
1305
diff
changeset
|
836 |
thisProcess := Processor activeProcess. |
6f89c1709ac3
changed (fixed?) Screen>>current
Claus Gittinger <cg@exept.de>
parents:
1305
diff
changeset
|
837 |
LastActiveScreen notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
838 |
LastActiveProcess == thisProcess ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
839 |
^ LastActiveScreen |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
840 |
] |
1310
6f89c1709ac3
changed (fixed?) Screen>>current
Claus Gittinger <cg@exept.de>
parents:
1305
diff
changeset
|
841 |
]. |
6f89c1709ac3
changed (fixed?) Screen>>current
Claus Gittinger <cg@exept.de>
parents:
1305
diff
changeset
|
842 |
|
1219
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
843 |
"/ |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
844 |
"/ mhmh - multiple screens are active; |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
845 |
"/ look for the active windowGroups screen. |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
846 |
"/ Be careful, to not run into an error in case |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
847 |
"/ the current windowGroup got corrupted somehow ... |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
848 |
|
293 | 849 |
(wg := WindowGroup activeGroup) notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
850 |
"/ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
851 |
"/ ok, not a background process or scheduler ... |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
852 |
"/ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
853 |
(dev := wg graphicsDevice) notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
854 |
LastActiveScreen := dev. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
855 |
LastActiveProcess := thisProcess. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
856 |
^ dev |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
857 |
]. |
293 | 858 |
]. |
1219
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
859 |
|
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
860 |
"/ |
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
861 |
"/ in all other cases, return the default display |
3100
0997eb19c9a4
removed info message (cannot figure out current screen)
Claus Gittinger <cg@exept.de>
parents:
3091
diff
changeset
|
862 |
"/ (which may be nil in a headless system) |
1219
e1e8d23f16e2
added another query signal: currentScreenQuerySignal.
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
863 |
"/ |
3100
0997eb19c9a4
removed info message (cannot figure out current screen)
Claus Gittinger <cg@exept.de>
parents:
3091
diff
changeset
|
864 |
"/ 'DevWorkstation [info]: cannot figure out current screen - use default' infoPrintCR. |
1310
6f89c1709ac3
changed (fixed?) Screen>>current
Claus Gittinger <cg@exept.de>
parents:
1305
diff
changeset
|
865 |
|
7648 | 866 |
Display isNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
867 |
'DevWorkstation [info]: Display is nil.' infoPrintCR. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
868 |
]. |
293 | 869 |
^ Display |
870 |
||
871 |
" |
|
4350 | 872 |
Screen current |
3308 | 873 |
|
874 |
|s| |
|
875 |
Transcript topView windowGroup process interruptWith:[s := Screen current]. |
|
876 |
Delay waitForSeconds:0.5. |
|
877 |
s inspect |
|
293 | 878 |
" |
879 |
||
2520
c5d3b01ab788
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
880 |
"Modified: / 1.9.1995 / 13:40:05 / claus" |
c5d3b01ab788
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
881 |
"Modified: / 7.2.1997 / 16:16:58 / cg" |
c5d3b01ab788
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
882 |
"Modified: / 18.3.1999 / 18:20:39 / stefan" |
293 | 883 |
! |
884 |
||
1968
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
885 |
currentWindow |
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
886 |
"Return the currently active window, |
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
887 |
that is, the topView of the currently executing windowGroup" |
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
888 |
|
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
889 |
|wg| |
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
890 |
|
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
891 |
wg := WindowGroup activeGroup. |
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
892 |
wg notNil ifTrue:[^ wg topViews first]. |
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
893 |
^ nil |
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
894 |
|
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
895 |
" |
4350 | 896 |
Screen currentWindow |
1968
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
897 |
" |
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
898 |
|
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
899 |
"Modified: / 1.9.1995 / 13:40:05 / claus" |
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
900 |
"Modified: / 7.2.1997 / 16:16:58 / cg" |
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
901 |
"Created: / 14.11.1997 / 21:52:24 / cg" |
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
902 |
! |
f632cb14733b
added #currentWindow query (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1961
diff
changeset
|
903 |
|
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
904 |
defaultDisplayName |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
905 |
"extract the default display name from command line arguments |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
906 |
and environment. Nil is a valid name which represents the builtin default" |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
907 |
|
3747 | 908 |
|displayName| |
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
909 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
910 |
"look for a '-display xxx' commandline argument" |
3747 | 911 |
displayName := Smalltalk commandLineArgumentNamed:'-display'. |
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
912 |
displayName isNil ifTrue:[ |
6296 | 913 |
displayName := OperatingSystem getEnvironment:'DISPLAY'. |
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
914 |
]. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
915 |
^ displayName. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
916 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
917 |
" |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
918 |
self defaultDisplayName |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
919 |
" |
293 | 920 |
! |
921 |
||
3308 | 922 |
flushCachedLastScreen |
923 |
LastActiveScreen := nil. |
|
924 |
LastActiveProcess := nil. |
|
925 |
||
926 |
! |
|
927 |
||
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
928 |
isAbstract |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
929 |
"answer true, if I am not a concrete Workstation class" |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
930 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
931 |
^ self == DeviceWorkstation |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
932 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
933 |
" |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
934 |
DeviceWorkstation isAbstract |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
935 |
XWorkstation isAbstract |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
936 |
" |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
937 |
! |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
938 |
|
6374 | 939 |
isWindowsPlatform |
940 |
^ false |
|
941 |
! |
|
942 |
||
6578 | 943 |
isX11Platform |
944 |
^ false |
|
945 |
! |
|
946 |
||
293 | 947 |
platformName |
948 |
"ST-80 compatibility. |
|
949 |
Return a string describing the display systems platform. |
|
950 |
Returns a dummy here. This must be redefined in concrete |
|
8029 | 951 |
Workstation classes, to return something like 'X11', 'win32', 'os2' etc." |
5035 | 952 |
|
953 |
^ #unknown |
|
8029 | 954 |
|
955 |
"Modified (comment): / 17-05-2017 / 18:25:06 / mawalch" |
|
293 | 956 |
! ! |
957 |
||
1075
62f0cfb3c956
dont return nil entries in #knownViews
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
958 |
!DeviceWorkstation class methodsFor:'standalone setup'! |
423
98a3808d9902
additions for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
414
diff
changeset
|
959 |
|
98a3808d9902
additions for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
414
diff
changeset
|
960 |
exitOnLastClose:aBoolean |
599 | 961 |
"set/clear the flag which controls if the |
2818
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
962 |
event dispatching should stop when the last view is closed |
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
963 |
on the (main) Display connection. |
599 | 964 |
(standAlone applications will set it)" |
965 |
||
2818
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
966 |
"/ here, a separate class variable is used, since this may have |
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
967 |
"/ to be set at init-time, when no display instance exists yet. |
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
968 |
"/ For all other (non-main-Display) connections, an instVar is used. |
6296 | 969 |
|
423
98a3808d9902
additions for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
414
diff
changeset
|
970 |
ExitOnLastClose := aBoolean |
599 | 971 |
|
972 |
"Modified: 23.4.1996 / 22:01:28 / cg" |
|
423
98a3808d9902
additions for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
414
diff
changeset
|
973 |
! ! |
98a3808d9902
additions for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
414
diff
changeset
|
974 |
|
3880 | 975 |
!DeviceWorkstation methodsFor:'Compatibility-ST80'! |
1281 | 976 |
|
1352 | 977 |
colorDepth |
978 |
"alias for depth - for ST-80 compatibility" |
|
979 |
||
980 |
^ self depth |
|
981 |
! |
|
982 |
||
4380 | 983 |
colorPalette |
984 |
"alias for colorMap - for ST-80 compatibility" |
|
985 |
||
986 |
^ self colorMap |
|
987 |
! |
|
988 |
||
3189 | 989 |
stackedWindows |
990 |
"supposed to return all topViews in stacking order; |
|
991 |
BUGGY: right now, the order is undefined" |
|
992 |
||
993 |
^ self allTopViews |
|
994 |
! |
|
995 |
||
1281 | 996 |
zoom:startRect to:endRect |
997 |
"animate a rubber-rectangle from startRect to endRect. |
|
998 |
Can be used by buttons, which open some dialog for nicer user feedback. |
|
8157 | 999 |
Notice: since the display's window manager typically allows a topWindow |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1000 |
to be placed by the user, this should not be used for modeless |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1001 |
topViews. |
3163 | 1002 |
" |
1003 |
||
4350 | 1004 |
^ self zoom:startRect to:endRect duration:300 |
1281 | 1005 |
|
1006 |
" |
|
1007 |
Screen current zoom:(10@10 corner:20@20) to:(20@20 corner:1000@1000) |
|
1008 |
Screen current zoom:(20@20 corner:1000@1000) to:(10@10 corner:20@20) |
|
1009 |
" |
|
1010 |
||
8157 | 1011 |
"Modified: / 27-01-1997 / 18:20:11 / cg" |
1012 |
"Modified (comment): / 01-09-2017 / 09:57:09 / cg" |
|
1281 | 1013 |
! |
1014 |
||
1015 |
zoom:startRect to:endRect duration:milliseconds |
|
1016 |
"animate a rubber-rectangle from startRect to endRect. |
|
1017 |
Can be used by buttons, which open some dialog for nicer user feedback. |
|
8157 | 1018 |
Notice: since the display's window manager typically allows a topWindow |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1019 |
to be placed by the user, this should not be used for modeless |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1020 |
topViews. |
1281 | 1021 |
" |
1022 |
||
1023 |
|steps dExt dOrg org ext root| |
|
1024 |
||
1025 |
root := self rootView. |
|
1026 |
||
1027 |
steps := 10. |
|
1028 |
dExt := (endRect extent - startRect extent) / steps. |
|
1029 |
dOrg := (endRect origin - startRect origin) / steps. |
|
1030 |
0 to:steps do:[:step | |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1031 |
org := (startRect origin + (dOrg * step)) rounded. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1032 |
ext := (startRect extent + (dExt * step)) rounded. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1033 |
root clippedByChildren:false. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1034 |
root xoring:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1035 |
root displayRectangleX:org x y:org y width:ext x height:ext y |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1036 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1037 |
Delay waitForMilliseconds:(milliseconds // steps). |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1038 |
root xoring:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1039 |
root displayRectangleX:org x y:org y width:ext x height:ext y |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1040 |
]. |
1281 | 1041 |
]. |
3896
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1042 |
root clippedByChildren:true. |
1281 | 1043 |
|
1044 |
" |
|
1045 |
Screen current zoom:(10@10 corner:20@20) to:(20@20 corner:1000@1000) duration:1000 |
|
1046 |
Screen current zoom:(20@20 corner:1000@1000) to:(10@10 corner:20@20) duration:1000 |
|
1047 |
" |
|
1048 |
||
8157 | 1049 |
"Created: / 27-01-1997 / 18:19:35 / cg" |
1050 |
"Modified (comment): / 01-09-2017 / 09:57:12 / cg" |
|
1281 | 1051 |
! |
1052 |
||
1053 |
zoom:startRect to:endRect speed:pixelsPerSecond |
|
1054 |
"animate a rubber-rectangle from startRect to endRect. |
|
1055 |
Can be used by buttons, which open some dialog for nicer user feedback. |
|
1056 |
The speed is computed for the longest edge to run at the given speed. |
|
8157 | 1057 |
Notice: since the display's window manager typically allows a topWindow |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1058 |
to be placed by the user, this should not be used for modeless |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1059 |
topViews. |
1281 | 1060 |
" |
1061 |
||
1062 |
|maxDistance| |
|
1063 |
||
1064 |
maxDistance := (endRect origin - startRect origin). |
|
1065 |
maxDistance := maxDistance max:(endRect topRight - startRect topRight). |
|
1066 |
maxDistance := maxDistance max:(endRect bottomLeft - startRect bottomLeft). |
|
1067 |
maxDistance := maxDistance max:(endRect corner - startRect corner). |
|
1068 |
maxDistance := maxDistance x max:(maxDistance y). |
|
1069 |
^ self |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1070 |
zoom:startRect to:endRect duration:(maxDistance abs / pixelsPerSecond * 1000) |
1281 | 1071 |
|
1072 |
" |
|
1073 |
Screen current zoom:(10@10 corner:20@20) to:(20@20 corner:1000@1000) speed:1000 |
|
3163 | 1074 |
Screen current zoom:(20@20 corner:1000@1000) to:(10@10 corner:20@20) speed:10 |
1281 | 1075 |
" |
1076 |
||
8157 | 1077 |
"Created: / 27-01-1997 / 18:19:35 / cg" |
1078 |
"Modified (comment): / 01-09-2017 / 09:57:16 / cg" |
|
1281 | 1079 |
! ! |
1080 |
||
3880 | 1081 |
!DeviceWorkstation methodsFor:'Compatibility-Squeak'! |
1926 | 1082 |
|
1083 |
border:aRectangle width:bw |
|
1084 |
"draw a rectangular border on the display with black. |
|
1085 |
Added to allow for some squeak examples to be evaluated ..." |
|
1086 |
||
3896
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1087 |
|r root| |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1088 |
|
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1089 |
root := self rootView. |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1090 |
|
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1091 |
root clippedByChildren:false. |
7422 | 1092 |
root paint:self blackColor. |
1926 | 1093 |
r := aRectangle. |
1094 |
0 to:bw-1 do:[:i | |
|
7450 | 1095 |
root displayRectangle:r. |
1096 |
r := r insetBy:1. |
|
1926 | 1097 |
]. |
3896
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1098 |
root clippedByChildren:true. |
1926 | 1099 |
|
1100 |
" |
|
1101 |
Display restoreAfter:[ |
|
7450 | 1102 |
Display border:(10@10 corner:100@100) width:2. |
1926 | 1103 |
] |
1104 |
" |
|
1105 |
||
1106 |
"Modified: 15.10.1997 / 19:23:28 / cg" |
|
1107 |
! |
|
1108 |
||
2789 | 1109 |
cursorPoint |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1110 |
"ST-80 compatibility: |
7681 | 1111 |
return the position of the mouse pointer on this display |
1112 |
(in screen coordinates)" |
|
1113 |
||
2789 | 1114 |
^ self pointerPosition |
7681 | 1115 |
|
1116 |
"Modified (comment): / 17-11-2016 / 22:10:20 / cg" |
|
2789 | 1117 |
! |
1118 |
||
1926 | 1119 |
displayOpaqueString:s x:x y:y |
1120 |
"draw a string on the display with black. |
|
1121 |
Added to allow for some squeak examples to be evaluated ..." |
|
1122 |
||
3896
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1123 |
|root| |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1124 |
|
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1125 |
root := self rootView. |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1126 |
|
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1127 |
root clippedByChildren:false. |
7422 | 1128 |
root paint:self blackColor. |
3896
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1129 |
root displayOpaqueString:s x:x y:y. |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1130 |
root clippedByChildren:true. |
1926 | 1131 |
|
1132 |
" |
|
1133 |
Display restoreAfter:[ |
|
7450 | 1134 |
Display displayOpaqueString:'hello' x:10 y:10. |
1926 | 1135 |
] |
1136 |
" |
|
1137 |
||
1138 |
"Created: 15.10.1997 / 19:25:09 / cg" |
|
1139 |
"Modified: 15.10.1997 / 19:29:05 / cg" |
|
1140 |
! |
|
1141 |
||
1142 |
displayString:s x:x y:y |
|
1143 |
"draw a string on the display with black. |
|
1144 |
Added to allow for some squeak examples to be evaluated ..." |
|
1145 |
||
3896
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1146 |
|root| |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1147 |
|
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1148 |
root := self rootView. |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1149 |
|
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1150 |
root clippedByChildren:false. |
7422 | 1151 |
root paint:self blackColor. |
3896
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1152 |
root displayString:s x:x y:y. |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1153 |
root clippedByChildren:true. |
1926 | 1154 |
|
1155 |
" |
|
1156 |
Display restoreAfter:[ |
|
7450 | 1157 |
Display displayString:'hello' x:10 y:10. |
1926 | 1158 |
] |
1159 |
" |
|
1160 |
||
1161 |
"Modified: 15.10.1997 / 19:29:10 / cg" |
|
1162 |
! |
|
1163 |
||
3396 | 1164 |
fill:aRectangle fillColor:aColor |
1165 |
"fill a rectangular area on the display with aColor. |
|
1166 |
Added to allow for some squeak examples to be evaluated ..." |
|
1167 |
||
3896
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1168 |
|oldPaint root| |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1169 |
|
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1170 |
root := self rootView. |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1171 |
|
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1172 |
oldPaint := root paint. |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1173 |
root clippedByChildren:false. |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1174 |
root paint:aColor. |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1175 |
root fillRectangle:aRectangle. |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1176 |
root clippedByChildren:true. |
268d2a3ee2b5
rootView access only via message
Claus Gittinger <cg@exept.de>
parents:
3883
diff
changeset
|
1177 |
root paint:oldPaint. |
3396 | 1178 |
|
1179 |
" |
|
1180 |
Display restoreAfter:[ |
|
6296 | 1181 |
Display fill:(10@10 corner:100@100) fillColor:Color yellow |
3396 | 1182 |
] |
1183 |
" |
|
1184 |
||
1185 |
"Modified: 15.10.1997 / 19:28:17 / cg" |
|
1186 |
! |
|
1187 |
||
3388 | 1188 |
fillWhite |
1189 |
"fill all of the display with white. |
|
1190 |
Added to allow for some squeak examples to be evaluated ..." |
|
1191 |
||
1192 |
self fillWhite:(self bounds) |
|
1193 |
||
1194 |
" |
|
1195 |
Display restoreAfter:[ |
|
6296 | 1196 |
Display fillWhite |
3388 | 1197 |
] |
1198 |
" |
|
1199 |
" |
|
1200 |
Display restoreAfter:[ |
|
6296 | 1201 |
Display fillWhite:(10@10 corner:100@100) |
3388 | 1202 |
] |
1203 |
" |
|
1204 |
||
1205 |
"Modified: 15.10.1997 / 19:28:17 / cg" |
|
1206 |
! |
|
1207 |
||
1926 | 1208 |
fillWhite:aRectangle |
1209 |
"fill a rectangular area on the display with white. |
|
1210 |
Added to allow for some squeak examples to be evaluated ..." |
|
1211 |
||
3396 | 1212 |
self fill:aRectangle fillColor:Color white |
1926 | 1213 |
|
1214 |
" |
|
1215 |
Display restoreAfter:[ |
|
6296 | 1216 |
Display fillWhite:(10@10 corner:100@100) |
1926 | 1217 |
] |
1218 |
" |
|
1219 |
||
1220 |
"Modified: 15.10.1997 / 19:28:17 / cg" |
|
1221 |
! |
|
1222 |
||
3029 | 1223 |
primMouseButtons |
1224 |
"return the current button state" |
|
1225 |
||
1226 |
|mask| |
|
1227 |
||
1228 |
mask := 0. |
|
3038 | 1229 |
self leftButtonPressed ifTrue:[ mask := mask bitOr:4 ]. |
3029 | 1230 |
self middleButtonPressed ifTrue:[ mask := mask bitOr:2 ]. |
3038 | 1231 |
self rightButtonPressed ifTrue:[ mask := mask bitOr:1 ]. |
3029 | 1232 |
^ mask |
1233 |
||
1234 |
" |
|
1235 |
Display primMouseButtons |
|
1236 |
" |
|
1237 |
||
1238 |
"Modified: 15.10.1997 / 19:23:28 / cg" |
|
1239 |
! |
|
1240 |
||
1926 | 1241 |
restoreAfter:aBlock |
1242 |
"evaluate aBlock, wait for a buttonPress, then restore the display. |
|
1243 |
Added to allow for some squeak examples to be evaluated ..." |
|
1244 |
||
1245 |
aBlock value. |
|
3385
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
1246 |
self sync. |
1926 | 1247 |
[self anyButtonPressed] whileFalse:[]. |
1248 |
self restoreWindows. |
|
1249 |
||
1250 |
" |
|
1251 |
Display restoreAfter:[Display fillWhite:(10@10 corner:100@100)] |
|
1252 |
" |
|
1253 |
||
1254 |
"Modified: 15.10.1997 / 19:43:08 / cg" |
|
2790 | 1255 |
! |
1256 |
||
1257 |
supportsDisplayDepth:givenDepth |
|
1258 |
"return true, if the given depth is supported by the display. |
|
1259 |
(Actually, some displays support multiple depths (i.e. visuals), |
|
1260 |
but for now, we want the displays native depth here." |
|
1261 |
||
1262 |
^ depth == givenDepth |
|
2963 | 1263 |
! |
1264 |
||
1265 |
waitButton |
|
1266 |
"wait for any button to be pressed" |
|
1267 |
||
7956 | 1268 |
|delay| |
1269 |
||
1270 |
delay := Delay forSeconds:0.05. |
|
1271 |
||
1272 |
[self anyButtonPressed] whileFalse:[delay wait]. |
|
2963 | 1273 |
|
1274 |
" |
|
1275 |
Sensor waitButton. |
|
1276 |
Sensor waitNoButton |
|
1277 |
" |
|
7956 | 1278 |
|
1279 |
"Modified: / 23-02-2017 / 13:31:56 / stefan" |
|
2963 | 1280 |
! |
1281 |
||
1282 |
waitClickButton |
|
1283 |
"wait for any button to be pressed and released again. |
|
1284 |
Return the screen coordinate of the click." |
|
1285 |
||
1286 |
|pos| |
|
1287 |
||
4350 | 1288 |
self waitButton. |
7682 | 1289 |
pos := self pointerPosition. |
2963 | 1290 |
self waitNoButton. |
1291 |
^ pos |
|
1292 |
||
1293 |
" |
|
1294 |
Sensor waitClickButton. |
|
1295 |
" |
|
7682 | 1296 |
|
1297 |
"Modified: / 17-11-2016 / 22:10:39 / cg" |
|
2963 | 1298 |
! |
1299 |
||
1300 |
waitNoButton |
|
1301 |
"wait for no button to be pressed" |
|
1302 |
||
7956 | 1303 |
|delay| |
1304 |
||
1305 |
delay := Delay forSeconds:0.05. |
|
1306 |
||
1307 |
[self anyButtonPressed] whileTrue:[delay wait]. |
|
2963 | 1308 |
|
1309 |
" |
|
1310 |
Sensor waitButton. |
|
1311 |
Sensor waitNoButton |
|
1312 |
" |
|
7956 | 1313 |
|
1314 |
"Modified: / 23-02-2017 / 13:32:33 / stefan" |
|
1926 | 1315 |
! ! |
1316 |
||
2934 | 1317 |
!DeviceWorkstation methodsFor:'Signal constants'! |
1318 |
||
1319 |
deviceErrorSignal |
|
1320 |
"return the per-device signal, which is used for error reporting. |
|
4350 | 1321 |
The default here is the global DeviceErrorSignal |
2934 | 1322 |
(which is the parent of any per-instance error signals)." |
1323 |
||
1324 |
deviceErrorSignal notNil ifTrue:[^ deviceErrorSignal]. |
|
1325 |
^ self class deviceErrorSignal |
|
1326 |
! |
|
1327 |
||
1328 |
deviceIOErrorSignal |
|
1329 |
"return the signal used for device I/O error reporting. |
|
4350 | 1330 |
The default here is the global DeviceIOErrorSignal |
2934 | 1331 |
(which is the parent of any per-instance I/O error signals)." |
1332 |
||
1333 |
deviceIOErrorSignal notNil ifTrue:[^ deviceIOErrorSignal]. |
|
1334 |
^ self class deviceIOErrorSignal |
|
1335 |
! |
|
1336 |
||
1337 |
deviceIOTimeoutErrorSignal |
|
1338 |
"return the signal used for device I/O timeout error reporting. |
|
4350 | 1339 |
The default here is the global DeviceIOTimeoutErrorSignal |
2934 | 1340 |
(which is the parent of any per-instance I/O timeout signals)." |
1341 |
||
1342 |
^ self class deviceIOTimeoutErrorSignal |
|
1343 |
! ! |
|
1344 |
||
293 | 1345 |
!DeviceWorkstation methodsFor:'accessing & queries'! |
1346 |
||
2685
094ce08f9fc5
made activateOnClick an instance method
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
1347 |
activateOnClick:aBoolean |
094ce08f9fc5
made activateOnClick an instance method
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
1348 |
"enable/disable raise&activate on click; |
094ce08f9fc5
made activateOnClick an instance method
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
1349 |
return the previous setting. |
094ce08f9fc5
made activateOnClick an instance method
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
1350 |
This may be left unimplemented by a device." |
094ce08f9fc5
made activateOnClick an instance method
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
1351 |
|
094ce08f9fc5
made activateOnClick an instance method
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
1352 |
^ false |
094ce08f9fc5
made activateOnClick an instance method
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
1353 |
|
094ce08f9fc5
made activateOnClick an instance method
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
1354 |
"Created: / 2.10.1998 / 01:07:51 / cg" |
094ce08f9fc5
made activateOnClick an instance method
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
1355 |
! |
094ce08f9fc5
made activateOnClick an instance method
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
1356 |
|
1710
df5f8609825d
win changes (pass drawableId to clip methods)
Claus Gittinger <cg@exept.de>
parents:
1708
diff
changeset
|
1357 |
activeView |
df5f8609825d
win changes (pass drawableId to clip methods)
Claus Gittinger <cg@exept.de>
parents:
1708
diff
changeset
|
1358 |
^ activeView |
5947
9b29e25d9ff4
comment/format in: #activeView
Claus Gittinger <cg@exept.de>
parents:
5937
diff
changeset
|
1359 |
|
9b29e25d9ff4
comment/format in: #activeView
Claus Gittinger <cg@exept.de>
parents:
5937
diff
changeset
|
1360 |
" |
9b29e25d9ff4
comment/format in: #activeView
Claus Gittinger <cg@exept.de>
parents:
5937
diff
changeset
|
1361 |
Display activeView |
9b29e25d9ff4
comment/format in: #activeView
Claus Gittinger <cg@exept.de>
parents:
5937
diff
changeset
|
1362 |
" |
1710
df5f8609825d
win changes (pass drawableId to clip methods)
Claus Gittinger <cg@exept.de>
parents:
1708
diff
changeset
|
1363 |
! |
df5f8609825d
win changes (pass drawableId to clip methods)
Claus Gittinger <cg@exept.de>
parents:
1708
diff
changeset
|
1364 |
|
7450 | 1365 |
allViews |
1366 |
"return a collection of all my known views" |
|
1367 |
||
7455 | 1368 |
^ knownViews asIdentitySet. |
7450 | 1369 |
|
1370 |
"Created: / 14.2.1997 / 14:29:43 / cg" |
|
1371 |
"Modified: / 19.1.2000 / 10:07:05 / cg" |
|
1372 |
! |
|
1373 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1374 |
buttonMotionMask:aMask includesButton:aButton |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1375 |
"given a device button mask, return true if a logical button |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1376 |
(1 .. 3 for left .. right) is included." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1377 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1378 |
|buttonNr| |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1379 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1380 |
"reverse buttonTranslation" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1381 |
buttonTranslation notNil ifTrue:[ |
6296 | 1382 |
buttonNr := buttonTranslation indexOf:aButton ifAbsent:[1]. |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1383 |
] ifFalse:[ |
6296 | 1384 |
buttonNr := aButton. |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1385 |
]. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1386 |
^ (aMask bitTest:(self buttonMotionMask:buttonNr)) |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1387 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1388 |
|
4895 | 1389 |
colorAt:aPoint |
1390 |
|img| |
|
1391 |
||
1392 |
img := Image fromScreen:(aPoint corner:aPoint+1) on:self grab:false. |
|
1393 |
^ img colorAt:0@0 |
|
1394 |
||
1395 |
" |
|
1396 |
Screen current colorAt:0@0 |
|
1397 |
" |
|
1398 |
! |
|
1399 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1400 |
dispatchProcess |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1401 |
^ dispatchProcess |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1402 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1403 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1404 |
displayFileDescriptor |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1405 |
"return the file descriptor associated with the display |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1406 |
if any. If there is no underlying filedescriptor, return nil. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1407 |
(used for event select/polling)" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1408 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1409 |
^ nil |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1410 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1411 |
|
4336 | 1412 |
getSystemColor:aKey |
1413 |
"retrieve a windows system color. |
|
1414 |
The styleSheet/View classes may use this to setup default colors." |
|
1415 |
||
1416 |
^ nil |
|
1417 |
||
1418 |
" |
|
1419 |
Display getSystemColor:#COLOR_WINDOW |
|
1420 |
Display getSystemColor:#COLOR_HIGHLIGHT |
|
1421 |
" |
|
1422 |
! |
|
1423 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1424 |
id |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1425 |
"return the displayId" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1426 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1427 |
^ displayId |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1428 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1429 |
|
1281 | 1430 |
isOpen |
1431 |
"return true, if there is a valid connection to the display. |
|
1432 |
Added for ST-80 compatibility." |
|
1433 |
||
1434 |
^ displayId notNil |
|
1435 |
||
1436 |
"Created: 27.1.1997 / 18:28:30 / cg" |
|
1437 |
! |
|
1438 |
||
5219
779129113def
care for dead display (non dispatching)
Claus Gittinger <cg@exept.de>
parents:
5218
diff
changeset
|
1439 |
isOpenAndDispatching |
779129113def
care for dead display (non dispatching)
Claus Gittinger <cg@exept.de>
parents:
5218
diff
changeset
|
1440 |
"return true, if there is a valid connection to the display and events are dispatched." |
779129113def
care for dead display (non dispatching)
Claus Gittinger <cg@exept.de>
parents:
5218
diff
changeset
|
1441 |
|
779129113def
care for dead display (non dispatching)
Claus Gittinger <cg@exept.de>
parents:
5218
diff
changeset
|
1442 |
^ self isOpen and:[dispatching] |
779129113def
care for dead display (non dispatching)
Claus Gittinger <cg@exept.de>
parents:
5218
diff
changeset
|
1443 |
! |
779129113def
care for dead display (non dispatching)
Claus Gittinger <cg@exept.de>
parents:
5218
diff
changeset
|
1444 |
|
2932 | 1445 |
isPersistentInSnapshot |
1446 |
"return true, if resources on this device are to be made |
|
1447 |
persistent in a snapshot image." |
|
1448 |
||
1449 |
^ true |
|
1450 |
! |
|
1451 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1452 |
knownViews |
7450 | 1453 |
<resource: #obsolete> |
1454 |
||
1455 |
^ self allViews. |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1456 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1457 |
|
2859 | 1458 |
mayOpenDebugger |
1459 |
"return true, if a debugger may open on this workstation; |
|
1460 |
if false, the debugger opens on the main display. |
|
1461 |
This should be made a variable ..." |
|
1462 |
||
3424 | 1463 |
^ mayOpenDebugger ? true |
1464 |
! |
|
1465 |
||
1466 |
mayOpenDebugger:aBoolean |
|
1467 |
"set/clear the flag, which controls if a debugger may open on this workstation; |
|
1468 |
if false, the debugger opens on the main display." |
|
1469 |
||
1470 |
mayOpenDebugger := aBoolean |
|
2859 | 1471 |
! |
1472 |
||
4350 | 1473 |
multiClickTimeDelta |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1474 |
^ multiClickTimeDelta |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1475 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1476 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1477 |
multiClickTimeDelta:milliseconds |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1478 |
multiClickTimeDelta := milliseconds |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1479 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1480 |
|
3572 | 1481 |
nativeDialogs |
1482 |
^ false |
|
1483 |
! |
|
1484 |
||
5597 | 1485 |
nativeFileDialogs |
1486 |
^ false |
|
1487 |
||
1488 |
"Created: / 24-08-2010 / 17:22:27 / sr" |
|
1489 |
! |
|
1490 |
||
4260 | 1491 |
nativeWidgets |
1492 |
^ false |
|
1493 |
! |
|
1494 |
||
729
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1495 |
rootView |
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1496 |
"return the rootView (i.e. the background window) on the receiver screen. |
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1497 |
It is not guaranteed, that a particular display device supports this." |
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1498 |
|
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1499 |
rootView isNil ifTrue:[ |
6296 | 1500 |
rootView := DisplayRootView onDevice:self |
729
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1501 |
]. |
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1502 |
^ rootView |
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1503 |
|
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1504 |
" |
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1505 |
|v| |
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1506 |
v := Display rootView. |
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1507 |
v paint:Color red. |
1722 | 1508 |
v clippedByChildren:false. |
4350 | 1509 |
v fillRectangleX:10 y:10 width:100 height:100. |
729
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1510 |
" |
2963 | 1511 |
|
1512 |
" |
|
1513 |
|v| |
|
1514 |
v := Display rootView. |
|
1515 |
v paint:Color red. |
|
1516 |
v clippedByChildren:true. |
|
4350 | 1517 |
v fillRectangleX:10 y:10 width:100 height:100. |
2963 | 1518 |
" |
1519 |
||
729
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1520 |
! |
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
1521 |
|
2885 | 1522 |
suppressDebugger |
1523 |
"return true, if no debugger should be opened for applications running |
|
1524 |
on this device (i.e. neither a debugger on the device nor on the |
|
3441 | 1525 |
main screen). |
2885 | 1526 |
If true, the debugger is either opened on the device or on the |
1527 |
main display, depending on the mayOpenDebugger setting." |
|
1528 |
||
3424 | 1529 |
^ suppressDebugger ? false |
1530 |
! |
|
1531 |
||
1532 |
suppressDebugger:aBoolean |
|
1533 |
"set/clear the flag, which controls if no debugger should be opened for applications running |
|
1534 |
on this device (i.e. neither a debugger on the device nor on the |
|
3441 | 1535 |
main screen). |
3424 | 1536 |
If true, the debugger is either opened on the device or on the |
1537 |
main display, depending on the mayOpenDebugger setting." |
|
1538 |
||
1539 |
suppressDebugger := aBoolean |
|
2885 | 1540 |
! |
1541 |
||
2876
dbe1454f8539
allow for a device to suppress shadowViews.
Claus Gittinger <cg@exept.de>
parents:
2875
diff
changeset
|
1542 |
suppressShadowViews |
dbe1454f8539
allow for a device to suppress shadowViews.
Claus Gittinger <cg@exept.de>
parents:
2875
diff
changeset
|
1543 |
"return true, if this device wants to suppress shadow views |
dbe1454f8539
allow for a device to suppress shadowViews.
Claus Gittinger <cg@exept.de>
parents:
2875
diff
changeset
|
1544 |
(i.e. shadows under popups and modalBoxes). |
dbe1454f8539
allow for a device to suppress shadowViews.
Claus Gittinger <cg@exept.de>
parents:
2875
diff
changeset
|
1545 |
Some (slow) devices may want to return true here" |
dbe1454f8539
allow for a device to suppress shadowViews.
Claus Gittinger <cg@exept.de>
parents:
2875
diff
changeset
|
1546 |
|
dbe1454f8539
allow for a device to suppress shadowViews.
Claus Gittinger <cg@exept.de>
parents:
2875
diff
changeset
|
1547 |
^ false |
dbe1454f8539
allow for a device to suppress shadowViews.
Claus Gittinger <cg@exept.de>
parents:
2875
diff
changeset
|
1548 |
! |
dbe1454f8539
allow for a device to suppress shadowViews.
Claus Gittinger <cg@exept.de>
parents:
2875
diff
changeset
|
1549 |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1550 |
translatePoint:aPoint from:windowId1 to:windowId2 |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1551 |
"given a point in window1 (defined by its id), return the coordinate of |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1552 |
aPoint in window2 (defined by its id). |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1553 |
Use to xlate points from a window to rootwindow, mainly for rubber-line |
8157 | 1554 |
drawing on the display's root window." |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1555 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1556 |
"This method has to be reimplemented in concrete display classes." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1557 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1558 |
^ self subclassResponsibility |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1559 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1560 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1561 |
|v p root| |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1562 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1563 |
v := View new. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1564 |
v openAndWait. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1565 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1566 |
root := v device rootView. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1567 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1568 |
p := v device translatePoint:10@10 from:(v id) to:(root id). |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1569 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1570 |
root clippedByChildren:false. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1571 |
root displayLineFrom:0@0 to:p. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1572 |
root clippedByChildren:true. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1573 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1574 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1575 |
|v1 v2 p1 p2 root| |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1576 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1577 |
v1 := View new. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1578 |
v1 openAndWait. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1579 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1580 |
v2 := View new. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1581 |
v2 openAndWait. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1582 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1583 |
root := v1 device rootView. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1584 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1585 |
p1 := v1 device translatePoint:10@10 from:(v1 id) to:(root id). |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1586 |
p2 := v1 device translatePoint:10@10 from:(v2 id) to:(root id). |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1587 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1588 |
root clippedByChildren:false. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1589 |
root displayLineFrom:p1 to:p2. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1590 |
root clippedByChildren:true. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1591 |
" |
8157 | 1592 |
|
1593 |
"Modified (comment): / 01-09-2017 / 09:56:54 / cg" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1594 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1595 |
|
3517
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1596 |
translatePoint:aPoint fromView:window1 toView:window2 |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1597 |
"given a point in window1, return the coordinate of aPoint in window2. |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1598 |
Either window argument may be nil to specify the root window (screen) |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1599 |
Use to xlate points from a window to another window (or from a window |
8157 | 1600 |
to the rootwindow), mainly for rubber-line drawing on the display's root window." |
3517
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1601 |
|
5243
7bbb86b0015e
handle non-views as components in translatePointFrom:...
Claus Gittinger <cg@exept.de>
parents:
5219
diff
changeset
|
1602 |
|w1 w2 devicePoint offset1 offset2| |
3517
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1603 |
|
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1604 |
w1 := window1 ? self rootView. |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1605 |
w2 := window2 ? self rootView. |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1606 |
|
6348 | 1607 |
(w1 device ~~ self or:[w2 device ~~ self]) ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1608 |
self error:'Huh - Cross device translation' mayProceed:true. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1609 |
^ aPoint |
5243
7bbb86b0015e
handle non-views as components in translatePointFrom:...
Claus Gittinger <cg@exept.de>
parents:
5219
diff
changeset
|
1610 |
]. |
7bbb86b0015e
handle non-views as components in translatePointFrom:...
Claus Gittinger <cg@exept.de>
parents:
5219
diff
changeset
|
1611 |
w1 isView ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1612 |
offset1 := 0 |
5243
7bbb86b0015e
handle non-views as components in translatePointFrom:...
Claus Gittinger <cg@exept.de>
parents:
5219
diff
changeset
|
1613 |
] ifFalse:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1614 |
"/ can be a graphic element inside a view |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1615 |
offset1 := w1 origin. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1616 |
w1 := w1 container. |
5243
7bbb86b0015e
handle non-views as components in translatePointFrom:...
Claus Gittinger <cg@exept.de>
parents:
5219
diff
changeset
|
1617 |
]. |
7bbb86b0015e
handle non-views as components in translatePointFrom:...
Claus Gittinger <cg@exept.de>
parents:
5219
diff
changeset
|
1618 |
w2 isView ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1619 |
offset2 := 0 |
5243
7bbb86b0015e
handle non-views as components in translatePointFrom:...
Claus Gittinger <cg@exept.de>
parents:
5219
diff
changeset
|
1620 |
] ifFalse:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1621 |
"/ can be a graphic element inside a view |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1622 |
offset2 := w2 origin. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1623 |
w2 := w2 container. |
7630 | 1624 |
]. |
1625 |
devicePoint := self translatePoint:aPoint from:(w1 drawableId) to:(w2 drawableId). |
|
5259 | 1626 |
devicePoint isNil ifTrue:[ ^ aPoint]. |
5244 | 1627 |
^ devicePoint + offset1 - offset2 |
4806 | 1628 |
|
1629 |
"Modified: / 27-10-2007 / 13:04:09 / cg" |
|
8157 | 1630 |
"Modified (comment): / 01-09-2017 / 09:55:46 / cg" |
3517
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1631 |
! |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1632 |
|
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1633 |
translatePointFromRoot:aPoint toView:window |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1634 |
"given a point as absolute root-window coordinate, return the coordinate within the window. |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1635 |
Use to xlate points from the rootWindow to a window." |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1636 |
|
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1637 |
^ self translatePoint:aPoint fromView:nil toView:window |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1638 |
|
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1639 |
"Modified: / 10.10.2001 / 14:09:05 / cg" |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1640 |
! |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1641 |
|
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1642 |
translatePointToRoot:aPoint fromView:window1 |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1643 |
"given a point in window1, return the absolute root-window coordinate. |
4350 | 1644 |
Use to xlate points from a window to the rootwindow, |
8157 | 1645 |
mainly for rubber-line drawing on the display's root window." |
3517
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1646 |
|
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1647 |
^ self translatePoint:aPoint fromView:window1 toView:nil |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1648 |
|
8157 | 1649 |
"Modified: / 10-10-2001 / 14:09:22 / cg" |
1650 |
"Modified (comment): / 01-09-2017 / 09:56:59 / cg" |
|
3517
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1651 |
! |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1652 |
|
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1653 |
viewFromPoint:aScreenPoint |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1654 |
"given a point on the screen, return the ST/X view in which that |
4350 | 1655 |
point is (this may be a subview). |
7881 | 1656 |
Return nil, if it's not an ST/X view or if the point is on the background" |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1657 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1658 |
|view id| |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1659 |
|
3517
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1660 |
id := self viewIdFromPoint:aScreenPoint. |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1661 |
view := self viewFromId:id. |
2978
81de1019a14c
fixes for picking a view from another device
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
1662 |
view isNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1663 |
"/ search on other devices (if present). |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1664 |
"/ This may find the view, in case another device |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1665 |
"/ has its views on the same display screen |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1666 |
"/ (i.e. under X, if its another display connection to the same |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1667 |
"/ X-server) |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1668 |
Screen allScreens do:[:aScreen | |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1669 |
|v| |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1670 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1671 |
aScreen ~~ self ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1672 |
(v := aScreen viewFromId:id) notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1673 |
^ v |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1674 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1675 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1676 |
] |
2978
81de1019a14c
fixes for picking a view from another device
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
1677 |
]. |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1678 |
^ view |
7881 | 1679 |
|
1680 |
"Modified (comment): / 13-02-2017 / 20:00:41 / cg" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1681 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1682 |
|
3517
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1683 |
viewIdFromPoint:aScreenPoint |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1684 |
"given a point on the screen, return the id of the ST/X view in which that |
7881 | 1685 |
point is (this may be a subview). Return nil, if it's not an ST/X view |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1686 |
or if the point is on the background" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1687 |
|
3513 | 1688 |
|searchId foundId n| |
3413
95e8a55dff8c
Use #realRootView to get the owning view of a point
Stefan Vogel <sv@exept.de>
parents:
3401
diff
changeset
|
1689 |
|
95e8a55dff8c
Use #realRootView to get the owning view of a point
Stefan Vogel <sv@exept.de>
parents:
3401
diff
changeset
|
1690 |
searchId := self realRootWindowId. |
2978
81de1019a14c
fixes for picking a view from another device
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
1691 |
|
4166 | 1692 |
"/ this is required, since X raises an error, when we come |
2978
81de1019a14c
fixes for picking a view from another device
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
1693 |
"/ along with an illegal id (which happens, if a view from another |
81de1019a14c
fixes for picking a view from another device
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
1694 |
"/ screen-device is picked ...) |
81de1019a14c
fixes for picking a view from another device
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
1695 |
self class deviceErrorSignal handle:[:ex | |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1696 |
^ nil |
2978
81de1019a14c
fixes for picking a view from another device
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
1697 |
] do:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1698 |
n := 0. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1699 |
[searchId notNil] whileTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1700 |
n := n + 1. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1701 |
n > 1000 ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1702 |
self error:'endless view hierarchy'. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1703 |
^ nil |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1704 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1705 |
foundId := searchId. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1706 |
searchId := self viewIdFromPoint:aScreenPoint in:searchId. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1707 |
] |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1708 |
]. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1709 |
^ foundId |
7881 | 1710 |
|
1711 |
"Modified (comment): / 13-02-2017 / 20:00:46 / cg" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1712 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1713 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1714 |
viewIdFromPoint:aPoint in:windowId |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1715 |
"given a point in rootWindow, return the viewId of the subview of windowId |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1716 |
hit by this coordinate. Return nil if no view was hit. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1717 |
- use to find window to drop objects after a cross-view drag" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1718 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1719 |
"returning nil here actually makes drag&drop impossible |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1720 |
- could also be reimplemented to make a search over all knownViews here. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1721 |
This method has to be reimplemented in concrete display classes." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1722 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1723 |
^ nil |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1724 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1725 |
|
3517
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1726 |
windowAt:aScreenPoint |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1727 |
"given a point on the screen, return the ST/X topview in which that |
4350 | 1728 |
point is. |
7881 | 1729 |
Return nil, if it's not an ST/X view or if the point is on the background. |
3517
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1730 |
Alias for viewFromPoint: for ST-80 compatibility" |
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1731 |
|
f0e11daf1d3a
added translatePoint methods with view argument (instead of id-arg)
Claus Gittinger <cg@exept.de>
parents:
3513
diff
changeset
|
1732 |
^ self viewFromPoint:aScreenPoint |
7881 | 1733 |
|
1734 |
"Modified (comment): / 13-02-2017 / 20:00:50 / cg" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1735 |
! ! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1736 |
|
3263 | 1737 |
!DeviceWorkstation methodsFor:'accessing-display attributes'! |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1738 |
|
293 | 1739 |
bitsBlue |
1602 | 1740 |
"return the number of valid bits in the blue component." |
293 | 1741 |
|
1742 |
bitsBlue isNil ifTrue:[ |
|
6296 | 1743 |
"/ not a truecolor display |
1744 |
^ bitsPerRGB |
|
293 | 1745 |
]. |
1746 |
^ bitsBlue |
|
1747 |
||
1748 |
" |
|
4350 | 1749 |
Display bitsBlue |
293 | 1750 |
" |
1751 |
||
1752 |
"Created: 21.10.1995 / 00:45:27 / cg" |
|
1602 | 1753 |
"Modified: 16.4.1997 / 15:00:53 / cg" |
293 | 1754 |
! |
1755 |
||
1756 |
bitsGreen |
|
1602 | 1757 |
"return the number of valid bits in the green component." |
293 | 1758 |
|
1759 |
bitsGreen isNil ifTrue:[ |
|
6296 | 1760 |
"/ not a truecolor display |
1761 |
^ bitsPerRGB |
|
293 | 1762 |
]. |
1763 |
^ bitsGreen |
|
1764 |
||
1765 |
" |
|
4350 | 1766 |
Display bitsGreen |
293 | 1767 |
" |
1768 |
||
1769 |
"Created: 21.10.1995 / 00:45:11 / cg" |
|
1602 | 1770 |
"Modified: 16.4.1997 / 15:01:02 / cg" |
293 | 1771 |
! |
1772 |
||
1773 |
bitsPerRGB |
|
1774 |
"return the number of valid bits per rgb component; |
|
1775 |
Currently, assume that r/g/b all have the same precision, |
|
1776 |
which is a stupid assumption (there may be some, where less |
|
1777 |
resolution is available in the blue component). |
|
1778 |
Therefore, this may be changed to return a 3-element vector. |
|
1779 |
In the meantime, use bitsRed/bitsGreen/bitsBlue to get this information." |
|
1780 |
||
1781 |
^ bitsPerRGB |
|
1782 |
||
1783 |
" |
|
4350 | 1784 |
Display bitsPerRGB |
293 | 1785 |
" |
1786 |
||
1787 |
"Modified: 21.10.1995 / 00:46:27 / cg" |
|
1788 |
! |
|
1789 |
||
1790 |
bitsRed |
|
1791 |
"return the number of valid bits in the red component." |
|
1792 |
||
1793 |
bitsRed isNil ifTrue:[ |
|
6296 | 1794 |
"/ not a truecolor display |
1795 |
^ bitsPerRGB |
|
293 | 1796 |
]. |
1797 |
^ bitsRed |
|
1798 |
||
1799 |
" |
|
1800 |
Display bitsRed |
|
1801 |
" |
|
1802 |
||
1803 |
"Created: 21.10.1995 / 00:44:55 / cg" |
|
1804 |
! |
|
1805 |
||
1197 | 1806 |
blackColor |
1807 |
"return the black color on this device. |
|
7545 | 1808 |
This is the same as 'Color black onDevice:device', but much faster." |
1809 |
||
1810 |
blackColor isNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1811 |
"not yet initialized" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
1812 |
^ Color black onDevice:self. |
7545 | 1813 |
]. |
1197 | 1814 |
|
1815 |
^ blackColor |
|
1816 |
||
6537 | 1817 |
" |
1818 |
Display blackColor |
|
1819 |
" |
|
1820 |
||
1197 | 1821 |
"Created: 13.1.1997 / 22:37:05 / cg" |
1822 |
"Modified: 13.1.1997 / 22:43:19 / cg" |
|
1823 |
! |
|
1824 |
||
293 | 1825 |
blackpixel |
1826 |
"return the colorId of black" |
|
1827 |
||
2853 | 1828 |
visualType == #TrueColor ifTrue:[^ 0]. |
1829 |
||
293 | 1830 |
^ self subclassResponsibility |
1831 |
! |
|
1832 |
||
996 | 1833 |
blueMask |
1834 |
"return a mask, which extracts the blueBits from a color id. |
|
4350 | 1835 |
This only makes sense with trueColor displays; |
996 | 1836 |
therefore, 0 is returned on all others." |
1837 |
||
1838 |
^ blueMask |
|
1839 |
||
1840 |
" |
|
4350 | 1841 |
Display blueMask |
996 | 1842 |
" |
1843 |
||
1844 |
"Modified: 21.10.1995 / 00:47:58 / cg" |
|
1845 |
"Created: 24.7.1996 / 13:25:21 / cg" |
|
1846 |
! |
|
1847 |
||
293 | 1848 |
depth |
1849 |
"return the depth in pixels of the display" |
|
1850 |
||
1851 |
^ depth |
|
1852 |
||
1853 |
" |
|
1854 |
Display depth |
|
1855 |
" |
|
1856 |
! |
|
1857 |
||
1710
df5f8609825d
win changes (pass drawableId to clip methods)
Claus Gittinger <cg@exept.de>
parents:
1708
diff
changeset
|
1858 |
focusMode |
df5f8609825d
win changes (pass drawableId to clip methods)
Claus Gittinger <cg@exept.de>
parents:
1708
diff
changeset
|
1859 |
^ focusMode |
df5f8609825d
win changes (pass drawableId to clip methods)
Claus Gittinger <cg@exept.de>
parents:
1708
diff
changeset
|
1860 |
! |
df5f8609825d
win changes (pass drawableId to clip methods)
Claus Gittinger <cg@exept.de>
parents:
1708
diff
changeset
|
1861 |
|
996 | 1862 |
greenMask |
1863 |
"return a mask, which extracts the greenBits from a color id. |
|
4350 | 1864 |
This only makes sense with trueColor displays; |
996 | 1865 |
therefore, 0 is returned on all others." |
1866 |
||
1867 |
^ greenMask |
|
1868 |
||
1869 |
" |
|
4350 | 1870 |
Display greenMask |
996 | 1871 |
" |
1872 |
||
1873 |
"Modified: 21.10.1995 / 00:47:58 / cg" |
|
1874 |
"Created: 24.7.1996 / 13:25:15 / cg" |
|
1875 |
! |
|
1876 |
||
293 | 1877 |
hasColors |
7881 | 1878 |
"return true, if it's a color display" |
293 | 1879 |
|
1880 |
^ hasColors |
|
1881 |
||
1882 |
" |
|
4350 | 1883 |
Display hasColors |
293 | 1884 |
" |
7881 | 1885 |
|
1886 |
"Modified (comment): / 13-02-2017 / 20:00:32 / cg" |
|
293 | 1887 |
! |
1888 |
||
631 | 1889 |
hasGrayscales |
1890 |
"return true, if this workstation supports grayscales |
|
1891 |
(also true for color displays)" |
|
1892 |
||
1893 |
^ hasGreyscales |
|
1894 |
||
1895 |
" |
|
4350 | 1896 |
Display hasGrayscales |
631 | 1897 |
" |
1898 |
||
1899 |
"Created: 2.5.1996 / 11:49:07 / cg" |
|
1900 |
! |
|
1901 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1902 |
hasGreyscales |
631 | 1903 |
"OBSOLETE english version; please use #hasGrayScales. |
1904 |
Return true, if this workstation supports greyscales |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1905 |
(also true for color displays)" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1906 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1907 |
^ hasGreyscales |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1908 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1909 |
" |
4350 | 1910 |
Display hasGreyscales |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1911 |
" |
631 | 1912 |
|
1913 |
"Modified: 2.5.1996 / 11:51:03 / cg" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1914 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1915 |
|
996 | 1916 |
redMask |
1917 |
"return a mask, which extracts the redBits from a color id. |
|
4350 | 1918 |
This only makes sense with trueColor displays; |
996 | 1919 |
therefore, 0 is returned on all others." |
1920 |
||
1921 |
^ redMask |
|
1922 |
||
1923 |
" |
|
4350 | 1924 |
Display redMask |
996 | 1925 |
" |
1926 |
||
1927 |
"Created: 21.10.1995 / 00:45:27 / cg" |
|
1928 |
"Modified: 24.7.1996 / 13:25:08 / cg" |
|
1929 |
! |
|
1930 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1931 |
shiftBlue |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1932 |
"return the count by which the blue bits are to be shifted |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1933 |
when forming a color index. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1934 |
This only makes sense with trueColor displays; therefore, |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1935 |
nil is returned on all others." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1936 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1937 |
^ blueShift |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1938 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1939 |
" |
4350 | 1940 |
Display shiftBlue |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1941 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1942 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1943 |
"Created: 21.10.1995 / 00:45:27 / cg" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1944 |
"Modified: 21.10.1995 / 00:47:58 / cg" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1945 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1946 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1947 |
shiftGreen |
1602 | 1948 |
"return the count by which the green bits are to be shifted |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1949 |
when forming a color index. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1950 |
This only makes sense with trueColor displays; therefore, |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1951 |
nil is returned on all others." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1952 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1953 |
^ greenShift |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1954 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1955 |
" |
4350 | 1956 |
Display shiftGreen |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1957 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1958 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1959 |
"Created: 21.10.1995 / 00:45:27 / cg" |
1602 | 1960 |
"Modified: 16.4.1997 / 15:02:37 / cg" |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1961 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1962 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1963 |
shiftRed |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1964 |
"return the count by which the red bits are to be shifted |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1965 |
when forming a color index. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1966 |
This only makes sense with trueColor displays; therefore, |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1967 |
nil is returned on all others." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1968 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1969 |
^ redShift |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1970 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1971 |
" |
4350 | 1972 |
Display shiftRed |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1973 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1974 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1975 |
"Created: 21.10.1995 / 00:45:27 / cg" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1976 |
"Modified: 21.10.1995 / 00:48:10 / cg" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1977 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1978 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1979 |
visualType |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1980 |
"return a symbol representing the visual type of the display" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1981 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1982 |
^ visualType |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1983 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1984 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1985 |
Display visualType |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1986 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1987 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1988 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1989 |
visualType:aSymbol |
4350 | 1990 |
"set the visual type. |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1991 |
The only situation, where setting the visual makes sense, |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1992 |
is with my plasma-display, which ignores the palette and spits out |
4350 | 1993 |
grey scales, independent of color LUT definitions. |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1994 |
(of which the server knows nothing). |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1995 |
So, this should be used from a display-specific startup file only." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1996 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1997 |
visualType := aSymbol. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
1998 |
(visualType == #StaticGray or:[visualType == #GrayScale]) ifTrue:[ |
6296 | 1999 |
hasColors := false |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2000 |
] ifFalse:[ |
6296 | 2001 |
hasColors := true |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2002 |
] |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2003 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2004 |
|
1197 | 2005 |
whiteColor |
2006 |
"return the white color on this device. |
|
7545 | 2007 |
This is the same as 'Color white onDevice:device', but much faster." |
2008 |
||
2009 |
whiteColor isNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2010 |
"not yet initialized" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2011 |
^ Color white onDevice:self. |
7545 | 2012 |
]. |
1197 | 2013 |
|
2014 |
^ whiteColor |
|
2015 |
||
2016 |
"Created: 13.1.1997 / 22:37:10 / cg" |
|
2017 |
"Modified: 13.1.1997 / 22:43:04 / cg" |
|
2018 |
! |
|
2019 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2020 |
whitepixel |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2021 |
"return the colorId of white" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2022 |
|
2853 | 2023 |
visualType == #TrueColor ifTrue:[^ (1 bitShift:depth)-1]. |
2024 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2025 |
^ self subclassResponsibility |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2026 |
! ! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2027 |
|
3263 | 2028 |
!DeviceWorkstation methodsFor:'accessing-display capabilities'! |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2029 |
|
5969 | 2030 |
centerOfMonitorHavingPointer |
7073 | 2031 |
|pos bounds| |
7450 | 2032 |
|
7073 | 2033 |
pos := self pointerPosition. |
2034 |
pos isNil ifTrue:[ |
|
7450 | 2035 |
bounds := self bounds |
2036 |
] ifFalse:[ |
|
2037 |
bounds:= self monitorBoundsAt:pos. |
|
7073 | 2038 |
]. |
2039 |
^ bounds center rounded. |
|
5969 | 2040 |
|
2041 |
" |
|
2042 |
Screen current centerOfMonitorHavingPointer |
|
2043 |
" |
|
2044 |
! |
|
2045 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2046 |
hasColors:aBoolean |
7653 | 2047 |
"set the hasColors flag - needed since some servers don't tell the |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2048 |
truth if a monochrome monitor is connected to a color server. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2049 |
Clearing the hasColors flag in the rc file will force use of grey |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2050 |
colors (which might make a difference, since some colors are hard to |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2051 |
distinguish on a greyscale monitor)." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2052 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2053 |
hasColors := aBoolean |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2054 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2055 |
|
293 | 2056 |
hasDPS |
2057 |
"return true, if this workstation supports postscript output into views. |
|
2058 |
Should be reimplemented in concrete classes which do support this." |
|
2059 |
||
2060 |
^ false |
|
2061 |
||
2062 |
" |
|
4350 | 2063 |
Display hasDPS |
293 | 2064 |
" |
2065 |
! |
|
2066 |
||
2067 |
hasExtension:extensionString |
|
2068 |
"query for an X extension. The method here is provide for XWorkstation |
|
2069 |
protocol compatibility only." |
|
2070 |
||
2071 |
^ false |
|
2072 |
||
2073 |
" |
|
4350 | 2074 |
Display hasExtension:'XVideo' |
2075 |
Display hasExtension:'Input' |
|
2076 |
Display hasExtension:'GLX' |
|
2077 |
Display hasExtension:'X3D-PEX' |
|
2078 |
Display hasExtension:'XInputExtension' |
|
2079 |
Display hasExtension:'SHAPE' |
|
2080 |
Display hasExtension:'MIT-SHM' |
|
2081 |
Display hasExtension:'SGIFullScreenStereo' |
|
293 | 2082 |
" |
2083 |
! |
|
2084 |
||
631 | 2085 |
hasGrayscales:aBoolean |
2086 |
"set the hasGrayscales flag - can be used to simulate b&w behavior |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2087 |
on greyScale and color monitors. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2088 |
(You may want to check if your application looks ok if displayed on |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2089 |
a b&w monitor - even if you have a color display. To do so, clear |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2090 |
the hasGreyscales flag from your .rc file)" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2091 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2092 |
hasGreyscales := aBoolean |
631 | 2093 |
|
2094 |
"Created: 2.5.1996 / 11:50:04 / cg" |
|
2095 |
! |
|
2096 |
||
2097 |
hasGreyscales:aBoolean |
|
2098 |
"OBSOLETE english version - please use #hasGrayscales: |
|
2099 |
Set the hasGreyscales flag - can be used to simulate b&w behavior |
|
2100 |
on greyScale and color monitors. |
|
2101 |
(You may want to check if your application looks ok if displayed on |
|
2102 |
a b&w monitor - even if you have a color display. To do so, clear |
|
2103 |
the hasGreyscales flag from your .rc file)" |
|
2104 |
||
2105 |
hasGreyscales := aBoolean |
|
2106 |
||
2107 |
"Modified: 2.5.1996 / 11:50:48 / cg" |
|
293 | 2108 |
! |
2109 |
||
2110 |
hasImageExtension |
|
2111 |
"return true, if this workstation supports the X Image extension" |
|
2112 |
||
2113 |
^ false |
|
2114 |
||
2115 |
" |
|
4350 | 2116 |
Display hasImageExtension |
293 | 2117 |
" |
2118 |
! |
|
2119 |
||
2120 |
hasInputExtension |
|
2121 |
"return true, if this workstation supports the X Input extension" |
|
2122 |
||
2123 |
^ false |
|
2124 |
||
2125 |
" |
|
4350 | 2126 |
Display hasInputExtension |
293 | 2127 |
" |
2128 |
! |
|
2129 |
||
2130 |
hasMultibuffer |
|
2131 |
"return true, if this workstation supports the X multibuffer extension" |
|
2132 |
||
2133 |
^ false |
|
2134 |
||
2135 |
" |
|
4350 | 2136 |
Display hasMultibuffer |
293 | 2137 |
" |
2138 |
! |
|
2139 |
||
2140 |
hasPEX |
|
2141 |
"return true, if this workstation supports PEX graphics. |
|
2142 |
Should be reimplemented in concrete classes which do support this." |
|
2143 |
||
2144 |
^ false |
|
2145 |
||
2146 |
" |
|
4350 | 2147 |
Display hasPEX |
293 | 2148 |
" |
2149 |
! |
|
2150 |
||
2151 |
hasShape |
|
2744
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2152 |
"return true, if this workstation supports arbitrary shaped windows. |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2153 |
This is obsolete - use #supportsArbitraryShapedViews." |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2154 |
|
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2155 |
^ self supportsArbitraryShapedViews |
293 | 2156 |
|
2157 |
" |
|
4350 | 2158 |
Display hasShape |
293 | 2159 |
" |
2160 |
! |
|
2161 |
||
2162 |
hasShm |
|
2163 |
"return true, if this workstation supports shared memory pixmaps. |
|
2164 |
Should be reimplemented in concrete classes which do support this." |
|
2165 |
||
2166 |
^ false |
|
2167 |
||
2168 |
" |
|
4350 | 2169 |
Display hasShm |
293 | 2170 |
" |
2171 |
! |
|
2172 |
||
2173 |
hasStereoExtension |
|
2174 |
"return true, if this workstation supports stereo GL drawing. |
|
2175 |
Both the server must support it, and the feature must have been |
|
2176 |
enabled in the smalltalk system, for true to be returned." |
|
2177 |
||
2178 |
^ false |
|
2179 |
||
2180 |
" |
|
4350 | 2181 |
Display hasStereoExtension |
293 | 2182 |
" |
2183 |
! |
|
2184 |
||
2185 |
hasXVideo |
|
2186 |
"return true, if this workstation supports the XVideo extension" |
|
2187 |
||
2188 |
^ false |
|
2189 |
||
2190 |
" |
|
4350 | 2191 |
Display hasXVideo |
293 | 2192 |
" |
2193 |
! |
|
2194 |
||
340 | 2195 |
iconSizes |
690 | 2196 |
"Get the supported icon sizes. These are typically set by the window manager. |
340 | 2197 |
We return nil here (as if there are no special size preferences)." |
2198 |
||
2199 |
^ nil |
|
2200 |
||
2201 |
"Created: 2.1.1996 / 15:08:16 / cg" |
|
690 | 2202 |
"Modified: 7.5.1996 / 10:43:38 / cg" |
340 | 2203 |
! |
2204 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2205 |
ignoreBackingStore:aBoolean |
7695 | 2206 |
"if the argument is true, the view's backingStore setting will be ignored, and |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2207 |
no backing store used - this can be used on servers where backing store is |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2208 |
very slow (from rc-file)" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2209 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2210 |
^ self |
293 | 2211 |
! |
2212 |
||
2213 |
isSlow |
|
2214 |
"return true, if this is a relatively slow device - |
|
2215 |
used to turn off things like popup-shadows" |
|
2216 |
||
2217 |
^ isSlow |
|
2218 |
! |
|
2219 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2220 |
isSlow:aBoolean |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2221 |
"set/clear the slow flag. |
4350 | 2222 |
The slow-flag has no semantic meaning by itself; |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2223 |
however, it can be set via the display.rc file and tested at various |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2224 |
other places to turn off some bells&whistles which might slow down |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2225 |
the drawing. For example, shadows under popUps are suppressed if isSlow |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2226 |
is set." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2227 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2228 |
isSlow := aBoolean |
293 | 2229 |
! |
2230 |
||
5610 | 2231 |
monitorBoundsAt:aPoint |
5622
1d15d632c9c6
comment/format in: #monitorBoundsAt:
Claus Gittinger <cg@exept.de>
parents:
5610
diff
changeset
|
2232 |
"to be redefined for display systems which support MULTI SCREEN" |
1d15d632c9c6
comment/format in: #monitorBoundsAt:
Claus Gittinger <cg@exept.de>
parents:
5610
diff
changeset
|
2233 |
|
5610 | 2234 |
^ self bounds |
5622
1d15d632c9c6
comment/format in: #monitorBoundsAt:
Claus Gittinger <cg@exept.de>
parents:
5610
diff
changeset
|
2235 |
|
1d15d632c9c6
comment/format in: #monitorBoundsAt:
Claus Gittinger <cg@exept.de>
parents:
5610
diff
changeset
|
2236 |
"Modified: / 22-10-2010 / 10:57:17 / cg" |
5606 | 2237 |
! |
2238 |
||
293 | 2239 |
monitorType |
2240 |
"return a symbol representing the monitor type of the display. |
|
2241 |
It is usually set to #unknown, #color or #monochrome. |
|
2242 |
But it can be set to any value from the startup file, for later |
|
4350 | 2243 |
testing from anywhere. For example the startup for plasma-displays |
293 | 2244 |
can set it to #plasma to later influence the colors used in widgets |
2245 |
(indirectly through the resource file)." |
|
2246 |
||
2247 |
^ monitorType |
|
2248 |
||
2249 |
" |
|
4350 | 2250 |
Display monitorType |
293 | 2251 |
" |
2252 |
! |
|
2253 |
||
2254 |
monitorType:aSymbol |
|
7592 | 2255 |
"set the monitorType - see comment in DeviceWorkstation>>monitorType" |
293 | 2256 |
|
2257 |
monitorType := aSymbol |
|
2258 |
! |
|
2259 |
||
2260 |
ncells |
|
4350 | 2261 |
"return the number of usable color cells, the display has |
293 | 2262 |
- this is not always 2 to the power of depth |
2263 |
(for example, on 6bit displays, ncells is 64 while depth is 8)" |
|
2264 |
||
2265 |
^ ncells |
|
2266 |
||
2267 |
" |
|
2268 |
Display ncells |
|
2269 |
" |
|
2270 |
! |
|
2271 |
||
5638 | 2272 |
pointIsVisible:aPoint |
2273 |
"is the point visible? |
|
2274 |
To be redefined for display systems which support MULTI SCREEN" |
|
2275 |
||
2276 |
^ self bounds containsPoint:aPoint |
|
2277 |
! |
|
2278 |
||
5636
850d83c40ad3
added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents:
5634
diff
changeset
|
2279 |
pointsAreOnSameMonitor:point1 and:point2 |
850d83c40ad3
added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents:
5634
diff
changeset
|
2280 |
"are the two points on the same (multi-screen) monitors? |
850d83c40ad3
added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents:
5634
diff
changeset
|
2281 |
To be redefined for display systems which support MULTI SCREEN" |
850d83c40ad3
added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents:
5634
diff
changeset
|
2282 |
|
850d83c40ad3
added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents:
5634
diff
changeset
|
2283 |
^ true |
850d83c40ad3
added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents:
5634
diff
changeset
|
2284 |
! |
850d83c40ad3
added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents:
5634
diff
changeset
|
2285 |
|
689 | 2286 |
preferredIconSize |
7139 | 2287 |
"Get the preferrered icon size. These are typically set by the window manager." |
689 | 2288 |
|
827 | 2289 |
|sizes spec sz sz2| |
820 | 2290 |
|
821 | 2291 |
preferredIconSize isNil ifTrue:[ |
7450 | 2292 |
sizes := self iconSizes. |
2293 |
sizes notNil ifTrue:[ |
|
2294 |
spec := sizes first. |
|
2295 |
||
2296 |
"/ we prefer square icons ... |
|
2297 |
sz := (spec at:#maxWidth) min: (spec at:#maxHeight). |
|
2298 |
sz > 64 ifTrue:[ |
|
2299 |
sz2 := (spec at:#minWidth) max: (spec at:#minHeight). |
|
2300 |
sz2 <= 48 ifTrue:[ |
|
2301 |
sz := 48 |
|
2302 |
] |
|
2303 |
]. |
|
2304 |
preferredIconSize := sz @ sz |
|
2305 |
] ifFalse:[ |
|
2306 |
preferredIconSize := 48@48 |
|
2307 |
]. |
|
820 | 2308 |
]. |
821 | 2309 |
|
2310 |
^ preferredIconSize |
|
689 | 2311 |
|
820 | 2312 |
" |
7139 | 2313 |
Display preferredIconSize:nil. |
2314 |
Display preferredIconSize. |
|
821 | 2315 |
Display preferredIconSize:32@32 |
827 | 2316 |
Display preferredIconSize:nil |
820 | 2317 |
" |
2318 |
||
827 | 2319 |
"Modified: 10.6.1996 / 22:10:58 / cg" |
821 | 2320 |
! |
2321 |
||
2322 |
preferredIconSize:anExtentPoint |
|
4350 | 2323 |
"set the preferrered icon size. |
821 | 2324 |
By default, the preferredIconSize is queried from the display, |
2325 |
however, some windowManagers return stupid values. |
|
2326 |
This methods allows overriding thngs from a startup file" |
|
2327 |
||
2328 |
preferredIconSize := anExtentPoint |
|
2329 |
||
2330 |
" |
|
4350 | 2331 |
Display preferredIconSize |
821 | 2332 |
Display preferredIconSize:32@32 |
2333 |
Display preferredIconSize:48@48 |
|
2334 |
" |
|
2335 |
||
2336 |
"Modified: 10.6.1996 / 21:01:50 / cg" |
|
689 | 2337 |
! |
2338 |
||
1024 | 2339 |
scrollsAsynchronous |
1007
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
2340 |
"return true, if this display asynchronously sends expose events after a |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
2341 |
scroll operation. False otherwise. Asynchronous expose events are an X |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
2342 |
speciality, which affects a few methods outside of the display class (sorry)" |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
2343 |
|
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
2344 |
^ false |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
2345 |
! |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
2346 |
|
7228 | 2347 |
supportedClipboards |
2348 |
"answer a collection of symbols with the supported clipboards.. |
|
2349 |
At least clipboard should be supported on any platform" |
|
2350 |
||
2351 |
^ #(clipboard) |
|
2352 |
! |
|
2353 |
||
2536 | 2354 |
supportedImageFormatForDepth:aDepth |
2355 |
"given a depth, return the devices image format info, |
|
2356 |
which provides padding info. If the given depth is not |
|
2357 |
supported, return nil." |
|
2358 |
||
4507 | 2359 |
^ self supportedImageFormats detect:[:fmt | (fmt at:#depth) == aDepth] ifNone:nil. |
2360 |
||
2361 |
"/ self supportedImageFormats do:[:fmt | |
|
2362 |
"/ (fmt at:#depth) == aDepth ifTrue:[ |
|
2363 |
"/ ^fmt |
|
2364 |
"/ ] |
|
2365 |
"/ ]. |
|
2366 |
"/ ^ nil |
|
2536 | 2367 |
! |
2368 |
||
293 | 2369 |
supportedImageFormats |
2370 |
"return an array with supported image formats; each array entry |
|
2371 |
is another array, consisting of depth and bitsPerPixel values. |
|
2372 |
Here, we return a single format only; every graphics device must |
|
2373 |
support b&w single bit images." |
|
2374 |
||
2375 |
|info| |
|
2376 |
||
2377 |
info := IdentityDictionary new. |
|
2378 |
info at:#depth put:1. |
|
2379 |
info at:#bitsPerPixel put:1. |
|
2380 |
info at:#padding put:32. |
|
2381 |
^ Array with:info |
|
2382 |
! |
|
2383 |
||
7999 | 2384 |
supportsAlphaChannel |
2385 |
"return true, if this workstation supports alpha information. |
|
8007 | 2386 |
If not, alpha blending is done 'manually' when images are displayed. |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2387 |
Currently none does" |
7999 | 2388 |
|
2389 |
^ false |
|
2390 |
||
2391 |
" |
|
2392 |
Display supportsAlphaChannel |
|
2393 |
" |
|
2394 |
||
2395 |
"Created: / 11-04-2017 / 01:42:38 / cg" |
|
8007 | 2396 |
"Modified (comment): / 12-04-2017 / 09:57:16 / cg" |
7999 | 2397 |
! |
2398 |
||
2634 | 2399 |
supportsAnyViewBackgroundPixmaps |
2400 |
"return true, if the device allows any pixmap as |
|
2401 |
viewBackground. False returned here - redefined in some |
|
2402 |
device classes." |
|
2403 |
||
2404 |
^ false |
|
2405 |
||
2406 |
"Created: / 4.5.1999 / 18:41:01 / cg" |
|
2407 |
! |
|
2408 |
||
2744
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2409 |
supportsArbitraryShapedViews |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2410 |
"return true, if this workstation supports arbitrary shaped |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2411 |
windows. |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2412 |
Should be reimplemented in concrete classes which do support this." |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2413 |
|
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2414 |
^ false |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2415 |
|
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2416 |
" |
4350 | 2417 |
Display supportsArbitraryShapedViews |
2744
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2418 |
" |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2419 |
! |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
2420 |
|
293 | 2421 |
supportsDeepIcons |
2422 |
"return true, if this device supports non b&w (i.e. greyScale |
|
817 | 2423 |
or colored icons). Many Xservers (and/or windowManagers) crash, |
2424 |
if you pass them a deep form as icon; therefore, the default is false. |
|
2425 |
It may be a good idea to check for the server vendor/release and |
|
2426 |
return true sometimes. |
|
2427 |
This flag can be set with #supportsDeepIcons:" |
|
2428 |
||
2429 |
^ supportsDeepIcons |
|
2430 |
||
2431 |
" |
|
4350 | 2432 |
Display supportsDeepIcons:true |
817 | 2433 |
|
2434 |
|v| |
|
2435 |
||
2436 |
v := StandardSystemView new. |
|
2437 |
v icon:((Image fromFile:'bitmaps/claus.gif') magnifiedTo:68@68). |
|
2438 |
v open. |
|
2439 |
" |
|
2440 |
||
2441 |
"Modified: 10.6.1996 / 20:11:48 / cg" |
|
2442 |
! |
|
2443 |
||
2444 |
supportsDeepIcons:yesOrNo |
|
2445 |
"set/clear the supportsDeepIcons flag. |
|
2446 |
Many Xservers (and/or windowManagers) crash, |
|
2447 |
if you pass them a deep form as icon; therefore, the default is false." |
|
2448 |
||
2449 |
supportsDeepIcons := yesOrNo |
|
293 | 2450 |
|
2451 |
" |
|
4350 | 2452 |
Display supportsDeepIcons |
293 | 2453 |
" |
817 | 2454 |
|
2455 |
"Created: 10.6.1996 / 19:36:19 / cg" |
|
293 | 2456 |
! |
2457 |
||
2458 |
supportsGLDrawing |
|
2459 |
"return true, if this device supports 3D GL drawing. |
|
2460 |
We do not depend on that being implemented." |
|
2461 |
||
1957 | 2462 |
"This method should be reimplemented in concrete display classes." |
293 | 2463 |
^ false |
2464 |
||
2465 |
" |
|
4350 | 2466 |
Display supportsGLDrawing |
293 | 2467 |
" |
2468 |
! |
|
2469 |
||
2603 | 2470 |
supportsIconMasks |
2471 |
"return true, if this device supports masked icons. |
|
2472 |
Assume true here - to be redefined in concrete classes." |
|
2473 |
||
2474 |
^ true |
|
2475 |
||
2476 |
" |
|
4350 | 2477 |
Display supportsIconMasks |
2603 | 2478 |
" |
2479 |
||
2480 |
"Modified: / 28.4.1999 / 19:58:12 / cg" |
|
2481 |
! |
|
2482 |
||
824 | 2483 |
supportsIconViews |
2484 |
"return true, if this device supports views as icons. |
|
2485 |
Only Xservers (currently) support this." |
|
2486 |
||
2487 |
^ false |
|
2488 |
||
2489 |
" |
|
4350 | 2490 |
Display supportsIconViews |
824 | 2491 |
" |
2492 |
||
2493 |
"Modified: 10.6.1996 / 21:08:04 / cg" |
|
2494 |
! |
|
2495 |
||
2631
c42013ed57a8
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2622
diff
changeset
|
2496 |
supportsMaskedDrawingWith:aForm |
c42013ed57a8
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2622
diff
changeset
|
2497 |
"return true, if the device allows the given form pixmap |
4350 | 2498 |
to be used as paint color. |
2631
c42013ed57a8
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2622
diff
changeset
|
2499 |
False returned here, which forces higher level code to |
c42013ed57a8
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2622
diff
changeset
|
2500 |
perform the filling manually (by copying the form) |
c42013ed57a8
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2622
diff
changeset
|
2501 |
- redefined in most device classes." |
2332
c025bb452cd9
added #supportsPatternDrawing query (for win-95)
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2502 |
|
c025bb452cd9
added #supportsPatternDrawing query (for win-95)
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2503 |
^ false |
c025bb452cd9
added #supportsPatternDrawing query (for win-95)
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2504 |
|
2631
c42013ed57a8
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2622
diff
changeset
|
2505 |
"Created: / 4.5.1999 / 12:16:18 / cg" |
c42013ed57a8
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2622
diff
changeset
|
2506 |
"Modified: / 4.5.1999 / 12:58:04 / cg" |
2332
c025bb452cd9
added #supportsPatternDrawing query (for win-95)
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2507 |
! |
c025bb452cd9
added #supportsPatternDrawing query (for win-95)
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2508 |
|
7019 | 2509 |
supportsMaskedDrawingWithOffset:aForm |
2510 |
"return true, if the device allows the given form pixmap |
|
2511 |
to be used as paint color AND it supports a pattern offset. |
|
2512 |
Pattern offset is needed to display the form in a scrolled view, |
|
7450 | 2513 |
to correctly start bit-blitting within the pattern. |
7019 | 2514 |
False returned here, which forces higher level code to |
2515 |
perform the filling manually (by copying the form) |
|
2516 |
- redefined in most device classes." |
|
2517 |
||
2518 |
^ false |
|
2519 |
! |
|
2520 |
||
7228 | 2521 |
supportsNativeDialogs |
2522 |
^ false |
|
2523 |
||
2524 |
" |
|
2525 |
Screen current supportsNativeDialogs |
|
2526 |
" |
|
2527 |
! |
|
2528 |
||
2529 |
supportsNativeFileDialogs |
|
2530 |
^ false |
|
2531 |
||
2532 |
"Created: / 24-08-2010 / 17:23:51 / sr" |
|
2533 |
! |
|
2534 |
||
2535 |
supportsNativeWidgetType:aWidgetTypeSymbol |
|
2536 |
^ false |
|
2537 |
||
2538 |
" |
|
2539 |
Screen current supportsNativeWidgetType:#Button |
|
2540 |
" |
|
2541 |
! |
|
2542 |
||
2543 |
supportsNativeWidgets |
|
2544 |
^ false |
|
2545 |
||
2546 |
" |
|
2547 |
Screen current supportsNativeWidgets |
|
2548 |
" |
|
2549 |
! |
|
2550 |
||
2749
9052311a0bc1
added #supportsRoundShapedViews
Claus Gittinger <cg@exept.de>
parents:
2744
diff
changeset
|
2551 |
supportsRoundShapedViews |
9052311a0bc1
added #supportsRoundShapedViews
Claus Gittinger <cg@exept.de>
parents:
2744
diff
changeset
|
2552 |
"return true, if this workstation supports round shaped |
9052311a0bc1
added #supportsRoundShapedViews
Claus Gittinger <cg@exept.de>
parents:
2744
diff
changeset
|
2553 |
(elliptical & circular) windows. |
9052311a0bc1
added #supportsRoundShapedViews
Claus Gittinger <cg@exept.de>
parents:
2744
diff
changeset
|
2554 |
Should be reimplemented in concrete classes which do support this." |
9052311a0bc1
added #supportsRoundShapedViews
Claus Gittinger <cg@exept.de>
parents:
2744
diff
changeset
|
2555 |
|
9052311a0bc1
added #supportsRoundShapedViews
Claus Gittinger <cg@exept.de>
parents:
2744
diff
changeset
|
2556 |
^ false |
9052311a0bc1
added #supportsRoundShapedViews
Claus Gittinger <cg@exept.de>
parents:
2744
diff
changeset
|
2557 |
|
9052311a0bc1
added #supportsRoundShapedViews
Claus Gittinger <cg@exept.de>
parents:
2744
diff
changeset
|
2558 |
" |
4350 | 2559 |
Display supportsRoundShapedViews |
2749
9052311a0bc1
added #supportsRoundShapedViews
Claus Gittinger <cg@exept.de>
parents:
2744
diff
changeset
|
2560 |
" |
9052311a0bc1
added #supportsRoundShapedViews
Claus Gittinger <cg@exept.de>
parents:
2744
diff
changeset
|
2561 |
! |
9052311a0bc1
added #supportsRoundShapedViews
Claus Gittinger <cg@exept.de>
parents:
2744
diff
changeset
|
2562 |
|
7228 | 2563 |
supportsScreenReading |
2564 |
"can the screen be read?" |
|
2565 |
||
2566 |
^ true |
|
2567 |
! |
|
2568 |
||
2569 |
supportsVariableHeightFonts |
|
2570 |
"are fonts with variable height supported? |
|
2571 |
Subclasses may redefine this" |
|
2572 |
||
2573 |
^ false |
|
2574 |
! |
|
2575 |
||
2634 | 2576 |
supportsViewBackgroundPixmap:aForm |
2577 |
"return true, if the device allows the given pixmap as |
|
2578 |
viewBackground. If false is returned, |
|
2579 |
drawing is done by (possibly) slower smalltalk code. |
|
2580 |
False returned here - redefined in some concrete device classes." |
|
2324
a50065345df3
do not regrab under win32, when dragging a rectangleFromUser
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
2581 |
|
a50065345df3
do not regrab under win32, when dragging a rectangleFromUser
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
2582 |
^ false |
2634 | 2583 |
|
2584 |
"Created: / 4.5.1999 / 18:40:25 / cg" |
|
2585 |
"Modified: / 4.5.1999 / 18:44:41 / cg" |
|
2324
a50065345df3
do not regrab under win32, when dragging a rectangleFromUser
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
2586 |
! |
a50065345df3
do not regrab under win32, when dragging a rectangleFromUser
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
2587 |
|
293 | 2588 |
supportsViewGravity |
2589 |
"return true, if this device supports gravity attributes. |
|
2590 |
We do not depend on the being implemented, but some resizing operations |
|
2591 |
are faster, it is is." |
|
2592 |
||
2593 |
"This method should to be reimplemented in concrete display classes." |
|
2594 |
^ false |
|
2595 |
||
2596 |
" |
|
4350 | 2597 |
Display supportsViewGravity |
293 | 2598 |
" |
2906
f94aca472883
added query if device supports bordered windows.
Claus Gittinger <cg@exept.de>
parents:
2896
diff
changeset
|
2599 |
! |
f94aca472883
added query if device supports bordered windows.
Claus Gittinger <cg@exept.de>
parents:
2896
diff
changeset
|
2600 |
|
f94aca472883
added query if device supports bordered windows.
Claus Gittinger <cg@exept.de>
parents:
2896
diff
changeset
|
2601 |
supportsWindowBorder:aNumber |
3108 | 2602 |
"return true, if this device supports bordered windows with the given borderWidth. |
2603 |
Right now, some drawing stuff depends on (at least) a border of 1 pixel |
|
2906
f94aca472883
added query if device supports bordered windows.
Claus Gittinger <cg@exept.de>
parents:
2896
diff
changeset
|
2604 |
to be supported by the device. |
f94aca472883
added query if device supports bordered windows.
Claus Gittinger <cg@exept.de>
parents:
2896
diff
changeset
|
2605 |
ST/X's views are being rewritten to draw the border manually in the |
6639 | 2606 |
future, since some systems do not support arbitrary wide borders (i.e. Windows). |
2607 |
Also, most (all?) systems only support drawing a solid border, which may or may not be |
|
2608 |
what we want." |
|
2906
f94aca472883
added query if device supports bordered windows.
Claus Gittinger <cg@exept.de>
parents:
2896
diff
changeset
|
2609 |
|
f94aca472883
added query if device supports bordered windows.
Claus Gittinger <cg@exept.de>
parents:
2896
diff
changeset
|
2610 |
^ true |
f94aca472883
added query if device supports bordered windows.
Claus Gittinger <cg@exept.de>
parents:
2896
diff
changeset
|
2611 |
|
f94aca472883
added query if device supports bordered windows.
Claus Gittinger <cg@exept.de>
parents:
2896
diff
changeset
|
2612 |
" |
4350 | 2613 |
Display supportsWindowBorder:1 |
2906
f94aca472883
added query if device supports bordered windows.
Claus Gittinger <cg@exept.de>
parents:
2896
diff
changeset
|
2614 |
" |
6537 | 2615 |
! |
2616 |
||
7117 | 2617 |
supportsXftFonts |
7698 | 2618 |
"can we draw into windows using Xft fonts? |
2619 |
Obviously, this will only ever be answered true by XWindow displays" |
|
2620 |
||
2621 |
^ false |
|
2622 |
! |
|
2623 |
||
2624 |
supportsXftFontsInBitmaps |
|
2625 |
"can we draw into bitmap/pixmaps using Xft fonts? |
|
2626 |
Obviously, this will only ever be answered true by XWindow displays. |
|
2627 |
This is a separate query (for now), because rendering into pixmaps |
|
2628 |
seems not to work currently" |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2629 |
|
6537 | 2630 |
^ false |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2631 |
! ! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2632 |
|
3263 | 2633 |
!DeviceWorkstation methodsFor:'accessing-display geometry'! |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2634 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2635 |
boundingBox |
8157 | 2636 |
"return a rectangle representing the display's bounding box. |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2637 |
For Smalltalk-80 2.x compatibility" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2638 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2639 |
^ self bounds |
8157 | 2640 |
|
2641 |
"Modified (comment): / 01-09-2017 / 09:56:23 / cg" |
|
293 | 2642 |
! |
2643 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2644 |
bounds |
8157 | 2645 |
"return a rectangle representing the display's bounding box. |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2646 |
For Smalltalk-80 4.x compatibility" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2647 |
|
656 | 2648 |
^ Rectangle left:0 top:0 width:width-1 height:height-1 |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2649 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2650 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2651 |
Screen default bounds |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2652 |
" |
7583 | 2653 |
"/ that's the same as: |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2654 |
" |
4350 | 2655 |
Display bounds |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2656 |
" |
656 | 2657 |
|
8157 | 2658 |
"Modified: / 08-05-1996 / 20:58:26 / cg" |
2659 |
"Modified (comment): / 01-09-2017 / 09:56:27 / cg" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2660 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2661 |
|
2308
3f4c19d81b4b
dummy methods for #supportBackgroundPixmaps and #captionHeight
Claus Gittinger <cg@exept.de>
parents:
2275
diff
changeset
|
2662 |
captionHeight |
3f4c19d81b4b
dummy methods for #supportBackgroundPixmaps and #captionHeight
Claus Gittinger <cg@exept.de>
parents:
2275
diff
changeset
|
2663 |
"return the height in pixels of the caption |
3f4c19d81b4b
dummy methods for #supportBackgroundPixmaps and #captionHeight
Claus Gittinger <cg@exept.de>
parents:
2275
diff
changeset
|
2664 |
(i.e. title bar) of topWindows. |
3f4c19d81b4b
dummy methods for #supportBackgroundPixmaps and #captionHeight
Claus Gittinger <cg@exept.de>
parents:
2275
diff
changeset
|
2665 |
Fallback of 0 (i.e. unknown) is returned here. |
3f4c19d81b4b
dummy methods for #supportBackgroundPixmaps and #captionHeight
Claus Gittinger <cg@exept.de>
parents:
2275
diff
changeset
|
2666 |
Applications should not depend on that returned value |
4350 | 2667 |
to be exact - on some systems (windowManagers), |
2308
3f4c19d81b4b
dummy methods for #supportBackgroundPixmaps and #captionHeight
Claus Gittinger <cg@exept.de>
parents:
2275
diff
changeset
|
2668 |
its value cannot be retrieved" |
3f4c19d81b4b
dummy methods for #supportBackgroundPixmaps and #captionHeight
Claus Gittinger <cg@exept.de>
parents:
2275
diff
changeset
|
2669 |
|
3f4c19d81b4b
dummy methods for #supportBackgroundPixmaps and #captionHeight
Claus Gittinger <cg@exept.de>
parents:
2275
diff
changeset
|
2670 |
^ 0 |
3f4c19d81b4b
dummy methods for #supportBackgroundPixmaps and #captionHeight
Claus Gittinger <cg@exept.de>
parents:
2275
diff
changeset
|
2671 |
! |
3f4c19d81b4b
dummy methods for #supportBackgroundPixmaps and #captionHeight
Claus Gittinger <cg@exept.de>
parents:
2275
diff
changeset
|
2672 |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2673 |
center |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2674 |
"return the centerpoint in pixels of the display" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2675 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2676 |
^ (width // 2) @ (height // 2) |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2677 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2678 |
|
783
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2679 |
drawingResolution |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2680 |
"return a point consisting of the actual drawing resolution |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2681 |
in pixel-per-inch horizontally and vertically. |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2682 |
On screen devices, this is the same as resolution; on postscript |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2683 |
devices, this is usually higher than the coordinate systems unit. |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2684 |
This method is provided for compatibility with postscript media, |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2685 |
to query the device if sub-pixel-coordinate drawing is possible. |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2686 |
(there are a few situations, in which resolution-independ drawing |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2687 |
leads to ugly looking output ... knowing about subPixel resolution |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2688 |
may help there.)" |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2689 |
|
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2690 |
^ self resolution |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2691 |
|
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2692 |
"Created: 4.6.1996 / 15:20:43 / cg" |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2693 |
"Modified: 4.6.1996 / 17:56:26 / cg" |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2694 |
! |
6492ac9c2494
added resolution & drawingResolution
Claus Gittinger <cg@exept.de>
parents:
762
diff
changeset
|
2695 |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2696 |
extent |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2697 |
"return the extent of the display (in pixels)" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2698 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2699 |
^ width @ height |
293 | 2700 |
|
2701 |
" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2702 |
Display extent |
293 | 2703 |
" |
2704 |
! |
|
2705 |
||
5994 | 2706 |
extentOfResizeHandle |
2707 |
"if the window system needs any area for a window resize handle (such as on MACOS-X), |
|
6011
5f2245003b40
semaphore bug workaround - temporary
Claus Gittinger <cg@exept.de>
parents:
6006
diff
changeset
|
2708 |
this area's extent is returned here. It is assumed, that this handle is located at the lower-right |
5994 | 2709 |
of the window. |
2710 |
0@0 is returned for systems which locate the resize handles outside the client area. |
|
2711 |
This may be used by the UI painter or programmatically to reserve some client area. |
|
2712 |
This method must be redefined for displays which need it (i.e. X11 on osx)" |
|
2713 |
||
2714 |
^ 0@0 |
|
2715 |
! |
|
2716 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2717 |
height |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2718 |
"return the height of the display (in pixels)" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2719 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2720 |
^ height |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2721 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2722 |
"Display height" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2723 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2724 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2725 |
heightInMillimeter |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2726 |
"return the height in millimeter of the display" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2727 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2728 |
^ heightMM |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2729 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2730 |
"Display heightInMillimeter" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2731 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2732 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2733 |
heightInMillimeter:aNumber |
4350 | 2734 |
"set the height in millimeter of the display |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2735 |
- needed since some displays do not tell the truth or do not know it" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2736 |
|
1044 | 2737 |
aNumber > 0 ifTrue:[ |
6296 | 2738 |
heightMM := aNumber. |
2739 |
resolutionVer := nil. |
|
1044 | 2740 |
] |
2741 |
||
2742 |
"Modified: 10.9.1996 / 14:25:39 / cg" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2743 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2744 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2745 |
horizontalPixelPerInch |
8363 | 2746 |
"return the number of horizontal pixels per inch of the display. |
2747 |
By default, this is computed from the width and widthInMM infos, |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2748 |
as returned by the system. |
8363 | 2749 |
However, some systems report this wrong, |
2750 |
and also with mixed resolution monitors, we cannot depend on what |
|
2751 |
is returned (happens when an additional external monitor is |
|
2752 |
connected to a retina). |
|
2753 |
Thus, you can override the resolution via: |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2754 |
Display horizontalPixelPerMillimeter:pixels" |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2755 |
|
8333 | 2756 |
^ self horizontalPixelPerMillimeter * 25.4 |
7643 | 2757 |
|
2758 |
" |
|
8363 | 2759 |
Display width |
2760 |
Display height |
|
2761 |
Display monitorBounds |
|
2762 |
||
7643 | 2763 |
Display horizontalPixelPerInch |
8363 | 2764 |
Display verticalPixelPerInch |
7643 | 2765 |
Display widthInMillimeter:(Display width * 25.4) / 120 |
2766 |
Display heightInMillimeter:(Display height * 25.4) / 120 |
|
2767 |
" |
|
8333 | 2768 |
|
2769 |
"Modified: / 12-04-2018 / 16:44:47 / stefan" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2770 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2771 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2772 |
horizontalPixelPerMillimeter |
8363 | 2773 |
"return the number of horizontal pixels per millimeter of the display. |
2774 |
By default, this is computed from the width and widthInMM infos, |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2775 |
as returned by the system. |
8363 | 2776 |
However, some systems report this wrong, |
2777 |
and also with mixed resolution monitors, we cannot depend on what |
|
2778 |
is returned (happens when an additional external monitor is |
|
2779 |
connected to a retina). |
|
2780 |
Thus, you can override the resolution via: |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2781 |
Display horizontalPixelPerMillimeter:pixels" |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2782 |
|
999 | 2783 |
resolutionHor notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2784 |
^ resolutionHor |
999 | 2785 |
]. |
1000 | 2786 |
resolutionHor := (width / widthMM) asFloat. |
999 | 2787 |
^ resolutionHor |
7643 | 2788 |
|
2789 |
" |
|
2790 |
Display horizontalPixelPerMillimeter |
|
2791 |
Display verticalPixelPerMillimeter |
|
2792 |
Display width |
|
2793 |
Display widthInMillimeter |
|
2794 |
Display heightInMillimeter |
|
2795 |
" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2796 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2797 |
|
8363 | 2798 |
horizontalPixelPerMillimeter:aNumber |
2799 |
"set the number of horizontal pixels per millimeter of the display. |
|
2800 |
By default, this is computed from the width and widthInMM infos, |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2801 |
as returned by the system. |
8363 | 2802 |
However, some systems report this wrong, |
2803 |
and also with mixed resolution monitors, we cannot depend on what |
|
2804 |
is returned (happens when an additional external monitor is |
|
2805 |
connected to a retina). |
|
2806 |
Thus, you can override the resolution via: |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2807 |
Display horizontalPixelPerMillimeter:pixels" |
8363 | 2808 |
|
2809 |
resolutionHor := aNumber |
|
2810 |
! |
|
2811 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2812 |
pixelPerInch |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2813 |
"return the number of horizontal/vertical pixels per inch of the display as Point" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2814 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2815 |
^ ((width / widthMM) @ (height / heightMM)) * 25.4 |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2816 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2817 |
"Display pixelPerInch" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2818 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2819 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2820 |
pixelPerMillimeter |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2821 |
"return the number of horizontal/vertical pixels per millimeter of the display as Point" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2822 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2823 |
^ (width / widthMM) @ (height / heightMM) |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2824 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
2825 |
"Display pixelPerMillimeter" |
293 | 2826 |
! |
2827 |
||
390
19a90edd0dc4
added #resolution for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
354
diff
changeset
|
2828 |
resolution |
19a90edd0dc4
added #resolution for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
354
diff
changeset
|
2829 |
"return a point consisting of pixel-per-inch horizontally and vertically. |
19a90edd0dc4
added #resolution for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
354
diff
changeset
|
2830 |
This is an ST-80 compatibility method" |
19a90edd0dc4
added #resolution for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
354
diff
changeset
|
2831 |
|
19a90edd0dc4
added #resolution for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
354
diff
changeset
|
2832 |
^ self pixelPerInch |
19a90edd0dc4
added #resolution for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
354
diff
changeset
|
2833 |
! |
19a90edd0dc4
added #resolution for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
354
diff
changeset
|
2834 |
|
6149 | 2835 |
setUsableHeight:h |
2836 |
height := h |
|
2837 |
! |
|
2838 |
||
2839 |
setUsableWidth:w |
|
2840 |
width := w |
|
2841 |
! |
|
2842 |
||
5868 | 2843 |
smallestMonitorHeight |
2844 |
"returns the usable height of the smallest monitor in a mult-monitor setup. |
|
2845 |
Subclasses supporting multi-monitors redefine this." |
|
2846 |
||
2847 |
^ self usableHeight. |
|
2848 |
! |
|
2849 |
||
1692
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2850 |
usableExtent |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2851 |
"return the usable extent of the display (in pixels). |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2852 |
Normally, the same as extent, but may be smaller, in |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2853 |
case some menu space is taken up by the window manager (windows)" |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2854 |
|
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2855 |
^ width @ height |
1844 | 2856 |
|
2857 |
" |
|
4350 | 2858 |
Display extent |
2859 |
Display usableExtent |
|
1844 | 2860 |
" |
2861 |
||
2862 |
"Modified: 4.8.1997 / 01:40:14 / cg" |
|
1692
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2863 |
! |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2864 |
|
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2865 |
usableHeight |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2866 |
"returns the usable height of the display (in pixels) |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2867 |
Normally, the same as height, but may be smaller, in |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2868 |
case some menu space is taken up by the window manager (windows)" |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2869 |
|
1708 | 2870 |
^ self usableExtent y |
1692
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2871 |
! |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2872 |
|
5550 | 2873 |
usableHeightAt:aPoint |
2874 |
"returns the usable height of the display (in pixels) at a given point |
|
2875 |
Normally, the same as height, but may be smaller, in |
|
2876 |
case some menu space is taken up by the window manager (windows). |
|
5610 | 2877 |
On multi-display systems with different sized screens, this should care for |
5550 | 2878 |
which display is at the given x-position" |
2879 |
||
2880 |
^ self usableHeight |
|
2881 |
! |
|
2882 |
||
1692
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2883 |
usableWidth |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2884 |
"returns the usable width of the display (in pixels) |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2885 |
Normally, the same as width, but may be smaller, in |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2886 |
case some menu space is taken up by the window manager (windows)" |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2887 |
|
1708 | 2888 |
^ self usableExtent x |
1692
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2889 |
! |
c301f69d322b
added #usableExtent (subtracts the toolBar height from the displays height)
Claus Gittinger <cg@exept.de>
parents:
1684
diff
changeset
|
2890 |
|
293 | 2891 |
verticalPixelPerInch |
8363 | 2892 |
"return the number of vertical pixels per inch of the display. |
2893 |
By default, this is computed from the height and heigthInMM infos, |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2894 |
as returned by the system. |
8363 | 2895 |
However, some systems report this wrong, |
2896 |
and also with mixed resolution monitors, we cannot depend on what |
|
2897 |
is returned (happens when an additional external monitor is |
|
2898 |
connected to a retina). |
|
2899 |
Thus, you can override the resolution via: |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2900 |
Display verticalPixelPerMillimeter:pixels" |
293 | 2901 |
|
8333 | 2902 |
^ self verticalPixelPerMillimeter * 25.4 |
2903 |
||
2904 |
" |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2905 |
Display verticalPixelPerInch |
8333 | 2906 |
" |
2907 |
||
2908 |
"Modified (comment): / 12-04-2018 / 16:45:47 / stefan" |
|
293 | 2909 |
! |
2910 |
||
2911 |
verticalPixelPerMillimeter |
|
8363 | 2912 |
"return the number of vertical pixels per millimeter of the display. |
2913 |
By default, this is computed from the height and heigthInMM infos, |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2914 |
as returned by the system. |
8363 | 2915 |
However, some systems report this wrong, |
2916 |
and also with mixed resolution monitors, we cannot depend on what |
|
2917 |
is returned (happens when an additional external monitor is |
|
2918 |
connected to a retina). |
|
2919 |
Thus, you can override the resolution via: |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2920 |
Display verticalPixelPerMillimeter:pixels" |
293 | 2921 |
|
999 | 2922 |
resolutionVer notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2923 |
^ resolutionVer |
999 | 2924 |
]. |
1000 | 2925 |
resolutionVer := (height / heightMM) asFloat. |
999 | 2926 |
^ resolutionVer |
293 | 2927 |
! |
2928 |
||
8363 | 2929 |
verticalPixelPerMillimeter:aNumber |
2930 |
"set the number of vertical pixels per millimeter of the display. |
|
2931 |
By default, this is computed from the height and heigthInMM infos, |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2932 |
as returned by the system. |
8363 | 2933 |
However, some systems report this wrong, |
2934 |
and also with mixed resolution monitors, we cannot depend on what |
|
2935 |
is returned (happens when an additional external monitor is |
|
2936 |
connected to a retina). |
|
2937 |
Thus, you can override the resolution via: |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
2938 |
Display verticalPixelPerMillimeter:pixels" |
8363 | 2939 |
|
2940 |
resolutionVer := aNumber |
|
2941 |
! |
|
2942 |
||
293 | 2943 |
virtualExtent |
2944 |
"return the virtual extent of the display (in pixels). |
|
2945 |
On most systems, this is the same as the physical width; |
|
2946 |
except, if a window manager with a virtual desktop like olvwm |
|
2947 |
(simulating a bigger screen) is running." |
|
2948 |
||
2949 |
^ width @ height |
|
2950 |
! |
|
2951 |
||
2952 |
virtualHeight |
|
2953 |
"return the virtual height of the display (in pixels). |
|
2954 |
On most systems, this is the same as the physical height; |
|
2955 |
except, if a window manager with a virtual desktop like olvwm |
|
2956 |
(simulating a bigger screen) is running." |
|
2957 |
||
2958 |
^ self virtualExtent y |
|
2959 |
||
2960 |
"Display virtualHeight" |
|
2961 |
! |
|
2962 |
||
2963 |
virtualWidth |
|
2964 |
"return the virtual width of the display (in pixels). |
|
2965 |
On most systems, this is the same as the physical width; |
|
2966 |
except, if a window manager with a virtual desktop like olvwm |
|
2967 |
(simulating a bigger screen) is running." |
|
2968 |
||
2969 |
^ self virtualExtent x |
|
2970 |
||
2971 |
"Display virtualWidth" |
|
2972 |
! |
|
2973 |
||
2974 |
width |
|
2975 |
"return the width of the display (in pixels)" |
|
2976 |
||
2977 |
^ width |
|
2978 |
||
2979 |
"Display width" |
|
2980 |
! |
|
2981 |
||
2982 |
widthInMillimeter |
|
2983 |
"return the width in millimeter of the display" |
|
2984 |
||
2985 |
^ widthMM |
|
2986 |
||
2987 |
"Display widthInMillimeter" |
|
2988 |
! |
|
2989 |
||
2990 |
widthInMillimeter:aNumber |
|
4350 | 2991 |
"set the width in millimeter of the display |
293 | 2992 |
- needed since some displays do not tell the truth or do not know it" |
2993 |
||
1044 | 2994 |
aNumber > 0 ifTrue:[ |
6296 | 2995 |
widthMM := aNumber. |
2996 |
resolutionHor := nil. |
|
1044 | 2997 |
]. |
2998 |
||
2999 |
"Modified: 10.9.1996 / 14:25:27 / cg" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3000 |
! ! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3001 |
|
3263 | 3002 |
!DeviceWorkstation methodsFor:'accessing-keyboard mappings'! |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3003 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3004 |
buttonTranslation |
4485 | 3005 |
"return the buttonTranslation (for lefthanders)" |
3006 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3007 |
^ buttonTranslation |
293 | 3008 |
! |
3009 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3010 |
buttonTranslation:anArray |
4485 | 3011 |
"set the buttonTranslation (for lefthanders)" |
3012 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3013 |
buttonTranslation := anArray |
4849 | 3014 |
|
3015 |
" |
|
3016 |
Screen current buttonTranslation |
|
3017 |
Screen current buttonTranslation:#(1 2 1) |
|
3018 |
" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3019 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3020 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3021 |
keyboardMap |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3022 |
"return the keyboard map" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3023 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3024 |
^ keyboardMap |
4552
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3025 |
|
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3026 |
" |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3027 |
Screen current keyboardMap |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3028 |
" |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3029 |
|
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3030 |
"Modified: / 08-08-2006 / 15:00:35 / cg" |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3031 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3032 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3033 |
keyboardMap:aMap |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3034 |
"set the keyboard map" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3035 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3036 |
keyboardMap := aMap |
4552
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3037 |
! |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3038 |
|
5778
9416217f347a
added: #shortKeyPrefixSeparator
Claus Gittinger <cg@exept.de>
parents:
5734
diff
changeset
|
3039 |
shortKeyPrefixSeparator |
9416217f347a
added: #shortKeyPrefixSeparator
Claus Gittinger <cg@exept.de>
parents:
5734
diff
changeset
|
3040 |
"the saparator shown between the shortcut modified (CTRL, CMD etc.) |
9416217f347a
added: #shortKeyPrefixSeparator
Claus Gittinger <cg@exept.de>
parents:
5734
diff
changeset
|
3041 |
and the actual character. I.e. makes a Ctrl+A" |
9416217f347a
added: #shortKeyPrefixSeparator
Claus Gittinger <cg@exept.de>
parents:
5734
diff
changeset
|
3042 |
|
9416217f347a
added: #shortKeyPrefixSeparator
Claus Gittinger <cg@exept.de>
parents:
5734
diff
changeset
|
3043 |
"/ used to be '-' |
9416217f347a
added: #shortKeyPrefixSeparator
Claus Gittinger <cg@exept.de>
parents:
5734
diff
changeset
|
3044 |
^ '+' |
9416217f347a
added: #shortKeyPrefixSeparator
Claus Gittinger <cg@exept.de>
parents:
5734
diff
changeset
|
3045 |
|
9416217f347a
added: #shortKeyPrefixSeparator
Claus Gittinger <cg@exept.de>
parents:
5734
diff
changeset
|
3046 |
"Created: / 21-07-2011 / 16:04:22 / cg" |
9416217f347a
added: #shortKeyPrefixSeparator
Claus Gittinger <cg@exept.de>
parents:
5734
diff
changeset
|
3047 |
! |
9416217f347a
added: #shortKeyPrefixSeparator
Claus Gittinger <cg@exept.de>
parents:
5734
diff
changeset
|
3048 |
|
6395
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3049 |
shortKeyStringFor:symbolicOrRawKey |
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3050 |
"For given symbolic or raw key, return a user-friendly shortcut description string. |
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3051 |
Examples: |
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3052 |
#Find -> Ctrl+f (depending on your settings) |
6885 | 3053 |
#CtrlX -> Ctrl+X |
6395
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3054 |
|
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3055 |
This method is used in menu panel (#shortcutKeyAsString) to display shortcuts in menus. |
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3056 |
" |
5848 | 3057 |
|
5111 | 3058 |
|untranslatedKeys untranslatedKey prefix| |
4552
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3059 |
|
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3060 |
"/ this is somewhat complicated: we have the symbolic key at hand, |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3061 |
"/ but want to know the untranslated (inverse keyBoardMapped) key & modifier |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3062 |
"/ this is used in the menu, to show the shortCut key beside the items. |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3063 |
|
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3064 |
untranslatedKeys := OrderedCollection new. |
6395
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3065 |
self keyboardMap keysAndValuesDo:[:k :v | v == symbolicOrRawKey ifTrue:[untranslatedKeys add:k]]. |
4552
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3066 |
untranslatedKeys size == 0 ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3067 |
"/ if it's not an explicit command key (Ctrl-*, Alt-* or Cmd-*), |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3068 |
"/ but a symbolic key, return nil. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3069 |
(#('Cmd' 'Ctrl' 'Alt' 'Meta' 'Shift') |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3070 |
contains:[:k | (symbolicOrRawKey startsWith:k) ]) |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3071 |
ifFalse:[^ nil]. |
5848 | 3072 |
|
3073 |
"/ (aSymbolicKey startsWith:'Cmd') ifFalse:[ |
|
3074 |
"/ (aSymbolicKey startsWith:'Ctrl') ifFalse:[ |
|
3075 |
"/ (aSymbolicKey startsWith:'Alt') ifFalse:[ |
|
3076 |
"/ (aSymbolicKey startsWith:'Meta') ifFalse:[ |
|
3077 |
"/ (aSymbolicKey startsWith:'Shift') ifFalse:[ |
|
3078 |
"/ ^ nil |
|
3079 |
"/ ]. |
|
3080 |
"/ ]. |
|
3081 |
"/ ]. |
|
3082 |
"/ ]. |
|
3083 |
"/ ]. |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3084 |
untranslatedKey := symbolicOrRawKey. |
4552
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3085 |
] ifFalse:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3086 |
untranslatedKeys size == 1 ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3087 |
untranslatedKey := untranslatedKeys first. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3088 |
] ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3089 |
"if there are multiple mappings, show the Ctrl or the F-key mapping" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3090 |
untranslatedKey := untranslatedKeys |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3091 |
detect:[:k |k startsWith:'Ctrl'] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3092 |
ifNone:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3093 |
untranslatedKeys |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3094 |
detect:[:k |k startsWith:'F'] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3095 |
ifNone:[untranslatedKeys first]]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3096 |
]. |
4552
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3097 |
]. |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3098 |
|
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3099 |
"/ |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3100 |
"/ some modifier-key combination ? |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3101 |
"/ |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3102 |
(untranslatedKey startsWith:#Cmd) ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3103 |
prefix := #Cmd. |
4552
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3104 |
] ifFalse:[(untranslatedKey startsWith:#Alt) ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3105 |
prefix := #Alt. |
4552
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3106 |
] ifFalse:[(untranslatedKey startsWith:#Meta) ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3107 |
prefix := #Meta. |
4552
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3108 |
] ifFalse:[(untranslatedKey startsWith:#Ctrl) ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3109 |
prefix := #Ctrl. |
4552
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3110 |
]]]]. |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3111 |
|
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3112 |
prefix notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3113 |
|modifier rest| |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3114 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3115 |
modifier := self modifierKeyTopFor:prefix. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3116 |
modifier := (modifier ? prefix). |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3117 |
rest := (untranslatedKey copyFrom:(prefix size + 1)). |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3118 |
rest isEmpty ifTrue:[^ modifier ]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3119 |
modifier := modifier , (self shortKeyPrefixSeparator). |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3120 |
^ modifier , rest |
4552
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3121 |
]. |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3122 |
^ untranslatedKey |
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3123 |
|
6395
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3124 |
" |
6885 | 3125 |
Screen current shortKeyStringFor: #Find |
6395
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3126 |
Screen current shortKeyStringFor: #CtrlX |
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3127 |
Screen current shortKeyStringFor: #CursorLeft |
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3128 |
" |
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3129 |
|
4552
ff6d09e621c7
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
4507
diff
changeset
|
3130 |
"Created: / 08-08-2006 / 15:45:38 / cg" |
6395
4cf299c9c247
Comment in DeviceWorkstation>>#shortKeyStringFor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6383
diff
changeset
|
3131 |
"Modified (comment): / 28-04-2014 / 10:04:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7881 | 3132 |
"Modified (format): / 13-02-2017 / 20:00:37 / cg" |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3133 |
! ! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3134 |
|
3263 | 3135 |
!DeviceWorkstation methodsFor:'accessing-misc'! |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3136 |
|
7705 | 3137 |
asPseudoDeviceWithoutXFTSupport |
3138 |
"hack - see XWorkstation" |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3139 |
|
7705 | 3140 |
^ self |
3141 |
! |
|
3142 |
||
3012 | 3143 |
defaultEventMask |
3144 |
"return a mask to enable some events by default." |
|
3145 |
||
3146 |
self subclassResponsibility |
|
3147 |
! |
|
3148 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3149 |
displayName |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3150 |
"return the display name - that is the name of the display connection |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3151 |
or nil, for default display. For example, in X, this returns a string |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3152 |
like 'hostname:0' for remote connections, and nil for a default local |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3153 |
connection. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3154 |
- nothing known here, but maybe redefined in subclasses." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3155 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3156 |
^ nil |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3157 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3158 |
" |
4350 | 3159 |
Display displayName |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3160 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3161 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3162 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3163 |
glVersion |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3164 |
"return a string describing the GL version. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3165 |
Since the generic display does not support 3D GL graphics, |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3166 |
a dummy is returned here." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3167 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3168 |
^ 'noGL' |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3169 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3170 |
" |
4350 | 3171 |
Display glVersion |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3172 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3173 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3174 |
|
5550 | 3175 |
numberOfMonitors |
3176 |
^ 1 "a fallback value only" |
|
3177 |
||
3178 |
" |
|
5610 | 3179 |
Display numberOfMonitors |
5550 | 3180 |
" |
3181 |
! |
|
3182 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3183 |
platformName |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3184 |
"return a string describing the display systems platform. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3185 |
Returns a dummy here." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3186 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3187 |
^ self class platformName |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3188 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3189 |
" |
4350 | 3190 |
Display platformName |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3191 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3192 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3193 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3194 |
protocolVersion |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3195 |
"return the display systems protocol version number. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3196 |
Returns a dummy here" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3197 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3198 |
^ 0 |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3199 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3200 |
" |
4350 | 3201 |
Display protocolVersion |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3202 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3203 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3204 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3205 |
serverVendor |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3206 |
"return a string describing the display systems server vendor. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3207 |
Returns a dummy here" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3208 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3209 |
^ 'generic' |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3210 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3211 |
" |
4350 | 3212 |
Display serverVendor |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3213 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3214 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3215 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3216 |
vendorRelease |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3217 |
"return the display systems release number. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3218 |
Returns a dummy here." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3219 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3220 |
^ 0 |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3221 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3222 |
" |
4350 | 3223 |
Display vendorRelease |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
3224 |
" |
293 | 3225 |
! ! |
3226 |
||
3227 |
!DeviceWorkstation methodsFor:'bitmap/window creation'! |
|
3228 |
||
4808
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3229 |
convertedIcon:iconArg |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3230 |
"make certain, that the image argument is compatible with myself; |
5061
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
3231 |
this means converting it to a format (typically: monochrome) which I support. |
4808
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3232 |
Return a compatible version of the icon." |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3233 |
|
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3234 |
|deviceIcon d toMono toDeep icon| |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3235 |
|
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3236 |
icon := iconArg value. |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3237 |
icon isNil ifTrue:[^ nil]. |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3238 |
|
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3239 |
toMono := toDeep := false. |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3240 |
|
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3241 |
d := icon depth. |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3242 |
self supportsDeepIcons ifFalse:[ |
6296 | 3243 |
(d ~~ 1 or:[icon isImage]) ifTrue:[ |
3244 |
" |
|
3245 |
dither to monochrome |
|
3246 |
" |
|
3247 |
toMono := true. |
|
3248 |
] |
|
4808
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3249 |
] ifTrue:[ |
6296 | 3250 |
d == 1 ifTrue:[ |
3251 |
icon colorMap notNil ifTrue:[ |
|
3252 |
icon isImage ifFalse:[ |
|
3253 |
toMono := true. |
|
3254 |
] ifTrue:[ |
|
3255 |
toDeep := true. |
|
3256 |
] |
|
3257 |
] |
|
3258 |
] ifFalse:[ |
|
3259 |
d ~~ self depth ifTrue:[ |
|
3260 |
icon isImage ifFalse:[ |
|
3261 |
toMono := true. |
|
3262 |
] ifTrue:[ |
|
3263 |
toDeep := true. |
|
3264 |
] |
|
3265 |
] |
|
3266 |
] |
|
4808
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3267 |
]. |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3268 |
|
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3269 |
deviceIcon := icon. |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3270 |
toMono ifTrue:[ |
6296 | 3271 |
deviceIcon := icon asMonochromeFormOn:self. |
4808
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3272 |
]. |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3273 |
toDeep ifTrue:[ |
6296 | 3274 |
deviceIcon := (Image implementorForDepth:self depth) fromImage:icon. |
4808
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3275 |
]. |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3276 |
|
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3277 |
deviceIcon notNil ifTrue:[ |
6296 | 3278 |
" |
3279 |
get device pixmap (i.e. allocate colors & resource) |
|
3280 |
" |
|
3281 |
deviceIcon := deviceIcon onDevice:self |
|
4808
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3282 |
]. |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3283 |
^ deviceIcon |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3284 |
|
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3285 |
"Created: / 30-10-2007 / 16:37:10 / cg" |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3286 |
! |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3287 |
|
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3288 |
convertedIconMask:aMask |
5061
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
3289 |
"return a version of the argument which can be used as an iconMask on myself. |
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
3290 |
Typically, this means conversion to a monochrome mask - |
4808
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3291 |
future versions may add alpha channel masks, if I support them ..." |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3292 |
|
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3293 |
self supportsIconMasks ifFalse:[^ nil]. |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3294 |
|
5734 | 3295 |
aMask depth == 1 ifTrue:[ |
6296 | 3296 |
^ aMask onDevice:self. |
5734 | 3297 |
]. |
3298 |
^ aMask asMonochromeFormOn:self |
|
4808
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3299 |
|
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3300 |
"Created: / 30-10-2007 / 16:38:37 / cg" |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3301 |
! |
ba94c76b6684
icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents:
4806
diff
changeset
|
3302 |
|
293 | 3303 |
createBitmapFromArray:anArray width:w height:h |
2896 | 3304 |
"create a monochrome, depth1 bitmap from a given (byte-)array. |
3305 |
The rows are aligned to a multiple of 8" |
|
3306 |
||
293 | 3307 |
^ self subclassResponsibility |
3308 |
! |
|
3309 |
||
3310 |
createBitmapFromFile:aString for:aForm |
|
974 | 3311 |
^ nil |
293 | 3312 |
! |
3313 |
||
3314 |
createBitmapWidth:w height:h |
|
3315 |
"allocate a bitmap on the Xserver, the contents is undefined |
|
3316 |
(i.e. random). Return a bitmap id or nil" |
|
3317 |
||
3318 |
^ self subclassResponsibility |
|
3319 |
! |
|
3320 |
||
3321 |
createPixmapWidth:w height:h depth:d |
|
3322 |
"allocate a pixmap on the Xserver, the contents is undefined |
|
3323 |
(i.e. random). Return a bitmap id or nil" |
|
3324 |
||
3325 |
^ self subclassResponsibility |
|
3326 |
! |
|
3327 |
||
4350 | 3328 |
createWindowFor:aView type:typeSymbol origin:org extent:ext |
6296 | 3329 |
minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:sv |
3330 |
style:styleSymbol inputOnly:inp |
|
3331 |
label:label owner:owner |
|
3332 |
icon:icn iconMask:icnM iconView:icnV |
|
1961 | 3333 |
"must be implemented by a concrete class" |
3334 |
||
3335 |
^ self subclassResponsibility |
|
3336 |
! |
|
3337 |
||
293 | 3338 |
destroyGC:aGCId |
3339 |
"destroy a GC" |
|
3340 |
||
3341 |
^ self subclassResponsibility |
|
3342 |
! |
|
3343 |
||
3344 |
destroyPixmap:aDrawableId |
|
3345 |
^ self subclassResponsibility |
|
3346 |
! |
|
3347 |
||
3348 |
destroyView:aView withId:aWindowId |
|
3349 |
^ self subclassResponsibility |
|
3350 |
! |
|
3351 |
||
3352 |
gcFor:aDrawableId |
|
3353 |
"create a GC for drawing into aDrawable" |
|
3354 |
||
3355 |
^ self subclassResponsibility |
|
3356 |
! |
|
3357 |
||
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1131
diff
changeset
|
3358 |
gcForBitmap:aDrawableId |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1131
diff
changeset
|
3359 |
"create a GC for drawing into a bitmap drawable" |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1131
diff
changeset
|
3360 |
|
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1131
diff
changeset
|
3361 |
^ self subclassResponsibility |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1131
diff
changeset
|
3362 |
! |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1131
diff
changeset
|
3363 |
|
2963 | 3364 |
realRootWindowFor:aView |
3365 |
"the name of this method is historic; |
|
3366 |
- it will vanish" |
|
3367 |
||
3368 |
|id| |
|
3369 |
||
3370 |
id := self realRootWindowId. |
|
3371 |
self addKnownView:aView withId:id. |
|
3372 |
^ id |
|
3373 |
! |
|
3374 |
||
974 | 3375 |
realRootWindowId |
3376 |
"return the id of the real root window. |
|
4350 | 3377 |
This may or may not be the view you see as background, |
974 | 3378 |
since some window managers install a virtual root window on top |
3379 |
of the real one. In this case, this method returns the id of the |
|
4350 | 3380 |
covered real-root |
974 | 3381 |
(in contrast, rootWindowId returns the id of the visible one). |
3382 |
With most window systems, the realRoot is the same as the root window. |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1059
diff
changeset
|
3383 |
The real root is only seldom of any interest." |
974 | 3384 |
|
3385 |
^ self rootWindowId |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1059
diff
changeset
|
3386 |
|
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1059
diff
changeset
|
3387 |
"Modified: 14.10.1996 / 22:25:03 / stefan" |
974 | 3388 |
! |
3389 |
||
293 | 3390 |
rootWindowFor:aView |
974 | 3391 |
|id| |
3392 |
||
3393 |
id := self rootWindowId. |
|
3394 |
self addKnownView:aView withId:id. |
|
3395 |
^ id |
|
3396 |
! |
|
3397 |
||
3398 |
rootWindowId |
|
3399 |
"return the id of the root window. |
|
4350 | 3400 |
This is the window you see as background, |
974 | 3401 |
however, it may or may not be the real physical root window, |
3402 |
since some window managers install a virtual root window on top |
|
3403 |
of the real one. If this is the case, that views id is returned here." |
|
3404 |
||
293 | 3405 |
^ self subclassResponsibility |
3406 |
! ! |
|
3407 |
||
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3408 |
!DeviceWorkstation methodsFor:'clipboard'! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3409 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3410 |
clipboardEncoding |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3411 |
"return the assumed default clibBoards encoding |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3412 |
if a raw string (i.e. without encoding information) is pasted. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3413 |
Useful on X11, if a sjis or euc string is pasted from a netscape |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3414 |
or other program." |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3415 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3416 |
^ clipBoardEncoding |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3417 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3418 |
" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3419 |
Screen current clipBoardEncoding |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3420 |
" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3421 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3422 |
"Created: 28.6.1997 / 13:46:02 / cg" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3423 |
"Modified: 28.6.1997 / 17:28:08 / cg" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3424 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3425 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3426 |
clipboardEncoding:aSymbol |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3427 |
"set the assumed default clipBoard's encoding |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3428 |
if a raw string (i.e. without encoding information) is pasted. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3429 |
Useful on X11, if a sjis or euc string is pasted from a netscape |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3430 |
or other program." |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3431 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3432 |
clipBoardEncoding := aSymbol |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3433 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3434 |
" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3435 |
Screen current clipBoardEncoding:#sjis |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3436 |
Screen current clipBoardEncoding:#euc |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3437 |
Screen current clipBoardEncoding:nil |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3438 |
" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3439 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3440 |
"Created: 28.6.1997 / 13:46:12 / cg" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3441 |
"Modified: 28.6.1997 / 17:28:02 / cg" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3442 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3443 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3444 |
copyBufferAsString |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3445 |
"return my current selection as a string" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3446 |
|
6130 | 3447 |
^ self class bufferAsString:self getCopyBuffer. |
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3448 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3449 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3450 |
getClipboardObjectFor:drawableId |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3451 |
"Retrieve the common per-display selection object. |
4350 | 3452 |
For clipBoard mechanisms to work (into ST/X), |
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3453 |
this must be redefined in a concrete subclass" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3454 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3455 |
^ nil |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3456 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3457 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3458 |
getClipboardText:selectionBufferSymbol for:drawableId |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3459 |
"Retrieve the common per-display selection text. |
4350 | 3460 |
For clipBoard mechanisms to work (into ST/X), |
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3461 |
this must be redefined in a concrete subclass" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3462 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3463 |
^ nil |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3464 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3465 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3466 |
getCopyBuffer |
4350 | 3467 |
"return the copyBuffers contents. |
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3468 |
This is an ST/X internal buffer (i.e. its not visible to alien views)." |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3469 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3470 |
^ copyBuffer |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3471 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3472 |
"Modified: 11.12.1996 / 12:55:42 / cg" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3473 |
"Created: 11.12.1996 / 13:34:34 / cg" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3474 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3475 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3476 |
getCopyBufferHistory |
4350 | 3477 |
"return the copyBufferHistory. |
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3478 |
This is an ST/X internal buffer (i.e. its not visible to alien views)." |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3479 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3480 |
^ CopyBufferHistory ? #() |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3481 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3482 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3483 |
rememberCopyBuffer |
5994 | 3484 |
"remember the current copyBuffer value in the copyBuffer-history (for paste previous); |
3485 |
but only do so, if it is a string" |
|
3486 |
||
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3487 |
copyBuffer size == 0 ifTrue:[ |
6296 | 3488 |
^ self |
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3489 |
]. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3490 |
copyBuffer isString ifFalse:[ |
6296 | 3491 |
copyBuffer isStringCollection ifFalse:[ |
3492 |
^ self |
|
3493 |
] |
|
5601 | 3494 |
]. |
3495 |
self rememberInCopyBufferHistory:copyBuffer. |
|
3496 |
||
3497 |
"Modified: / 25-08-2010 / 21:58:26 / cg" |
|
3498 |
! |
|
3499 |
||
3500 |
rememberInCopyBufferHistory:aString |
|
3501 |
"add aString to the copyBuffer LRU-cache. |
|
3502 |
Allows for the last 20 (or so) copy/cut strings to be recovered |
|
3503 |
(via Shift-Paste)" |
|
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3504 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3505 |
CopyBufferHistory isNil ifTrue:[ |
6296 | 3506 |
CopyBufferHistory := OrderedCollection new. |
5601 | 3507 |
]. |
3508 |
CopyBufferHistory remove:aString ifAbsent:nil. |
|
3509 |
CopyBufferHistory addFirst:aString. |
|
3510 |
||
3511 |
CopyBufferHistory size > (CopyBufferHistorySize ? 20) ifTrue:[ |
|
6296 | 3512 |
CopyBufferHistory removeLast |
5601 | 3513 |
]. |
3514 |
||
3515 |
"Created: / 25-08-2010 / 21:57:08 / cg" |
|
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3516 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3517 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3518 |
setClipboardObject:anObject owner:aWindowId |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3519 |
"set the common per-display object selection. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3520 |
This can be used by other Smalltalk(X) applications only. |
4350 | 3521 |
For clipBoard mechanisms to work (out of ST/X), |
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3522 |
this must be redefined in a concrete subclass to copy |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3523 |
anObject to the devices clipBoard." |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3524 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3525 |
^ nil |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3526 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3527 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3528 |
setClipboardObject:something ownerView:aView |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3529 |
"set the object selection - both the local one, and tell the display |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3530 |
that we have changed it (i.e. place it into the clipBoard)." |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3531 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3532 |
|viewID| |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3533 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3534 |
self rememberCopyBuffer. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3535 |
self setCopyBuffer:something. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3536 |
|
7630 | 3537 |
viewID := aView drawableId. |
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3538 |
viewID notNil ifTrue:[ "/ if the view is not already closed |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3539 |
self setClipboardObject:something owner:viewID. |
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3540 |
] |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3541 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3542 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3543 |
setClipboardText:aString owner:aView |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3544 |
"Set the common per-display selection text. |
4350 | 3545 |
For clipBoard mechanisms to work (out of ST/X), |
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3546 |
this must be redefined in a concrete subclass to copy |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3547 |
aString to the devices clipBoard." |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3548 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3549 |
^ nil |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3550 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3551 |
"Modified: 11.12.1996 / 12:56:36 / cg" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3552 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3553 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3554 |
setClipboardText:aString ownerView:aView |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3555 |
"set the text selection - both the local one, and tell the display |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3556 |
that we have changed it (i.e. place it into the clipBoard)." |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3557 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3558 |
|s viewID| |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3559 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3560 |
self rememberCopyBuffer. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3561 |
self setCopyBuffer:aString. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3562 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3563 |
s := aString ? ''. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3564 |
s isString ifFalse:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3565 |
s := s asStringWithCRsFrom:1 to:(s size) compressTabs:false withCR:false |
7630 | 3566 |
]. |
3567 |
||
3568 |
viewID := aView drawableId. |
|
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3569 |
viewID notNil ifTrue:[ "/ if the view is not already closed |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3570 |
"/ TODO: should add support to pass emphasis information too |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3571 |
s := s string. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3572 |
self setClipboardText:s owner:viewID. |
6858 | 3573 |
] ifFalse:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3574 |
Transcript showCR:'DeviceWorkstation [warning]: setClipboardText - view has no id; selection only kept locally' |
6858 | 3575 |
]. |
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3576 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3577 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3578 |
setCopyBuffer:something |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3579 |
"set the copyBuffers contents. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3580 |
This is an ST/X internal buffer (i.e. its not visible to alien views)." |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3581 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3582 |
copyBuffer := something. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3583 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3584 |
"Created: 11.12.1996 / 12:54:23 / cg" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3585 |
"Modified: 11.12.1996 / 12:55:53 / cg" |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3586 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3587 |
|
5897
11d09aa349cb
added: #setPrimaryText:ownerView: (so support X11's PRIMARY selection)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5868
diff
changeset
|
3588 |
setPrimaryText: text ownerView: view |
11d09aa349cb
added: #setPrimaryText:ownerView: (so support X11's PRIMARY selection)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5868
diff
changeset
|
3589 |
"Overridden in XWorkstation to support X's PRIMARY selection, intentionally void here" |
11d09aa349cb
added: #setPrimaryText:ownerView: (so support X11's PRIMARY selection)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5868
diff
changeset
|
3590 |
|
11d09aa349cb
added: #setPrimaryText:ownerView: (so support X11's PRIMARY selection)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5868
diff
changeset
|
3591 |
"Created: / 27-03-2012 / 15:05:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11d09aa349cb
added: #setPrimaryText:ownerView: (so support X11's PRIMARY selection)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5868
diff
changeset
|
3592 |
! |
11d09aa349cb
added: #setPrimaryText:ownerView: (so support X11's PRIMARY selection)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5868
diff
changeset
|
3593 |
|
4282
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3594 |
setSelection:anObject owner:aWindowId |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3595 |
<resource: #obsolete> |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3596 |
self obsoleteMethodWarning:'use #setClipboardObject:owner:'. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3597 |
self setClipboardObject:anObject owner:aWindowId |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3598 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3599 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3600 |
setSelection:something ownerView:aView |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3601 |
<resource: #obsolete> |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3602 |
self obsoleteMethodWarning:'use #setClipboardObject:ownerView:'. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3603 |
self setClipboardObject:something ownerView:aView |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3604 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3605 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3606 |
setTextSelection:aString owner:aWindowId |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3607 |
<resource: #obsolete> |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3608 |
self obsoleteMethodWarning:'use #setClipboardText:owner'. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3609 |
self setClipboardText:aString owner:aWindowId |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3610 |
! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3611 |
|
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3612 |
setTextSelection:aString ownerView:aView |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3613 |
<resource: #obsolete> |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3614 |
self obsoleteMethodWarning:'use #setClipboardText:ownerView'. |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3615 |
self setClipboardText:aString ownerView:aView |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3616 |
! ! |
b487fe05c51d
Unify naming: clipBoard->clipboard
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
3617 |
|
293 | 3618 |
!DeviceWorkstation methodsFor:'color stuff'! |
3619 |
||
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3620 |
availableDitherColors |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3621 |
"return the table of preallocated emergency ditherColors |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3622 |
plus possibly available fixColors." |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3623 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3624 |
|s| |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3625 |
|
1768 | 3626 |
s := IdentitySet new. |
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3627 |
fixColors notNil ifTrue:[ |
6296 | 3628 |
s addAll:fixColors. |
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3629 |
]. |
1768 | 3630 |
fixGrayColors notNil ifTrue:[ |
6296 | 3631 |
s addAll:fixGrayColors. |
1768 | 3632 |
]. |
1776 | 3633 |
ditherColors notNil ifTrue:[ |
6296 | 3634 |
s addAll:ditherColors. |
1776 | 3635 |
]. |
1768 | 3636 |
^ s asArray |
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3637 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3638 |
"Created: 11.7.1996 / 18:13:30 / cg" |
1776 | 3639 |
"Modified: 24.6.1997 / 16:23:50 / cg" |
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3640 |
! |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3641 |
|
293 | 3642 |
blueComponentOfColor:colorId |
3643 |
"get blue component (0..100) of color in map at:index" |
|
3644 |
||
3220 | 3645 |
^ (self getRGBFrom:colorId) at:3 |
3646 |
||
293 | 3647 |
! |
3648 |
||
3649 |
colorCell |
|
974 | 3650 |
"allocate a color - return index or nil, if no color cell |
3651 |
can be allocated (out of colors or trueColor device)" |
|
3652 |
||
3653 |
^ nil |
|
293 | 3654 |
! |
3655 |
||
934 | 3656 |
colorMap |
3657 |
"return my displays colormap, or nil, if the display is not colorMap based |
|
3658 |
(i.e. not PseudoColor)" |
|
3659 |
||
3660 |
|mapSize "{ Class: SmallInteger }" |
|
3661 |
depthUsed mapArray| |
|
3662 |
||
3663 |
visualType == #DirectColor ifTrue:[ |
|
7450 | 3664 |
Logger info:'directColor displays not fully supported'. |
3665 |
^ nil |
|
934 | 3666 |
]. |
4350 | 3667 |
|
934 | 3668 |
(visualType == #StaticGray or:[visualType == #TrueColor]) ifTrue:[ |
7450 | 3669 |
" |
3670 |
those have no colorMap - we're done |
|
3671 |
" |
|
3672 |
^ nil |
|
934 | 3673 |
]. |
3674 |
||
3675 |
" |
|
3676 |
get some attributes of the display device |
|
3677 |
" |
|
3678 |
depthUsed := depth. |
|
3679 |
||
3680 |
"/ kludge for 15bit XFree server |
|
3681 |
"/ (but: I have never encountered a PseudoColor display with more |
|
3682 |
"/ than 8 bits ...) |
|
3683 |
||
3684 |
depthUsed == 15 ifTrue:[ |
|
7450 | 3685 |
depthUsed := 16 |
934 | 3686 |
]. |
3687 |
depthUsed > 16 ifTrue:[ |
|
7450 | 3688 |
"/ do not allocate zillions of colors ... |
3689 |
self error:'unreasonably large colorMap ...'. |
|
3690 |
^ nil |
|
934 | 3691 |
]. |
3692 |
||
3693 |
mapSize := (1 bitShift:depthUsed). |
|
3694 |
||
3695 |
"/ get the palette |
|
3696 |
mapArray := Array new:mapSize. |
|
3697 |
1 to:mapSize do:[:i | |
|
7450 | 3698 |
self getRGBFrom:(i-1) into:[:r :g :b | |
3699 |
mapArray at:i put:(Color red:r green:g blue:b) |
|
3700 |
] |
|
934 | 3701 |
]. |
3702 |
^ mapArray. |
|
3703 |
||
3704 |
" |
|
3705 |
Display colorMap |
|
3706 |
" |
|
3707 |
||
3708 |
"Created: 11.7.1996 / 10:53:38 / cg" |
|
1168 | 3709 |
"Modified: 10.1.1997 / 15:40:10 / cg" |
934 | 3710 |
! |
3711 |
||
3220 | 3712 |
colorNamed:aString |
3713 |
"allocate a color with color name - return the color index (i.e. colorID). |
|
5339
2bcee9cc577a
colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents:
5336
diff
changeset
|
3714 |
Only a subset of the colorNames are available on all displays; |
7653 | 3715 |
therefore, don't use this method; at least only for the common names such as red, green, blue etc." |
5339
2bcee9cc577a
colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents:
5336
diff
changeset
|
3716 |
|
5610 | 3717 |
^ self |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3718 |
getScaledRGBFromName:aString |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3719 |
into:[:r :g :b | |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3720 |
self colorScaledRed:r scaledGreen:g scaledBlue:b |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3721 |
] |
5339
2bcee9cc577a
colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents:
5336
diff
changeset
|
3722 |
|
2bcee9cc577a
colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents:
5336
diff
changeset
|
3723 |
" |
2bcee9cc577a
colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents:
5336
diff
changeset
|
3724 |
Screen current colorNamed:'red' |
2bcee9cc577a
colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents:
5336
diff
changeset
|
3725 |
" |
3220 | 3726 |
! |
3727 |
||
293 | 3728 |
colorRed:redVal green:greenVal blue:blueVal |
3220 | 3729 |
"allocate a color with rgb values (0..100) - return the color index (i.e. colorID). |
3730 |
This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:" |
|
3731 |
||
3732 |
|r g b| |
|
3733 |
||
3734 |
r := self percentToDeviceColorValue:redVal. |
|
3735 |
g := self percentToDeviceColorValue:greenVal. |
|
3736 |
b := self percentToDeviceColorValue:blueVal. |
|
3737 |
^ self colorScaledRed:r scaledGreen:g scaledBlue:b |
|
293 | 3738 |
! |
3739 |
||
2854 | 3740 |
colorScaledRed:red scaledGreen:green scaledBlue:blue |
7781 | 3741 |
"return an id for a color. |
3742 |
On trueColor displays, nothing is actually allocated, |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3743 |
and the returned colorID is formed by simply packing the RGB values." |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3744 |
|
2854 | 3745 |
visualType == #TrueColor ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3746 |
^ (((red asInteger bitShift:-8) bitShift:redShift) |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3747 |
bitOr:((green asInteger bitShift:-8) bitShift:greenShift)) |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
3748 |
bitOr:((blue asInteger bitShift:-8) bitShift:blueShift) |
7781 | 3749 |
]. |
3750 |
||
3751 |
self subclassResponsibility:'this fallback is only valid for trueColor displays' |
|
6213 | 3752 |
|
3753 |
"Modified: / 03-02-2014 / 11:30:23 / cg" |
|
2854 | 3754 |
! |
3755 |
||
3220 | 3756 |
deviceColorValueToPercent:deviceColorValue |
3757 |
^ self subclassResponsibility |
|
3758 |
! |
|
3759 |
||
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3760 |
ditherColors |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3761 |
"return the table of preallocated emergency ditherColors" |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3762 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3763 |
^ ditherColors |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3764 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3765 |
"Modified: 11.7.1996 / 18:13:37 / cg" |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3766 |
! |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3767 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3768 |
fixColors |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3769 |
"return the table of preallocated fix colors (a colorCube), |
1768 | 3770 |
or nil if no fix colors were preallocated." |
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3771 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3772 |
^ fixColors |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3773 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3774 |
"Created: 11.7.1996 / 17:49:24 / cg" |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3775 |
! |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3776 |
|
1768 | 3777 |
fixGrayColors |
3778 |
"return the table of preallocated fix grayScale colors, |
|
3779 |
or nil if no fix gray colors were preallocated." |
|
3780 |
||
3781 |
^ fixGrayColors |
|
3782 |
||
3783 |
"Created: 11.7.1996 / 17:49:24 / cg" |
|
3784 |
! |
|
3785 |
||
293 | 3786 |
freeColor:colorIndex |
3787 |
"free a color on the display, when its no longer needed" |
|
3788 |
||
3789 |
^ self subclassResponsibility |
|
3790 |
! |
|
3791 |
||
3220 | 3792 |
getRGBFrom:index |
3793 |
"get rgb components (0..100) of color in map at:index, |
|
3794 |
and evaluate the 3-arg block, aBlock with them" |
|
3795 |
||
3796 |
|triple| |
|
3797 |
||
3798 |
triple := self getScaledRGBFrom:index. |
|
3799 |
triple notNil ifTrue:[ |
|
6296 | 3800 |
^ triple collect:[:val | self deviceColorValueToPercent:val] |
3220 | 3801 |
]. |
3802 |
^ nil |
|
3803 |
! |
|
3804 |
||
293 | 3805 |
getRGBFrom:index into:aBlock |
3806 |
"get rgb components (0..100) of color in map at:index, |
|
3807 |
and evaluate the 3-arg block, aBlock with them" |
|
3808 |
||
3220 | 3809 |
|triple| |
3810 |
||
3811 |
triple := self getRGBFrom:index. |
|
3812 |
triple notNil ifTrue:[ |
|
6296 | 3813 |
^ aBlock valueWithArguments:triple. |
3220 | 3814 |
]. |
3815 |
^ nil |
|
3816 |
||
3817 |
! |
|
3818 |
||
6877 | 3819 |
getRGBFromName:colorNameArg |
293 | 3820 |
"get rgb components (0..100) of color named colorName, |
3220 | 3821 |
and return a 3-element array, containing them. |
293 | 3822 |
The method here only handles some often used colors; |
3823 |
getRGBFromName should not be used, since colorNames other |
|
3824 |
than those below are X specific." |
|
3825 |
||
6877 | 3826 |
|colorName idx names triple r g b| |
3827 |
||
3828 |
colorName := colorNameArg. |
|
1674
787399517305
handle hex-r/g/b color names
Claus Gittinger <cg@exept.de>
parents:
1623
diff
changeset
|
3829 |
(colorName startsWith:$#) ifTrue:[ |
6885 | 3830 |
"/ color in r/g/b hex notation |
3831 |
colorName size < 7 ifTrue:[ |
|
3832 |
"/ that's an error, but some web pages do that |
|
3833 |
colorName := '#',((colorName copyFrom:2) leftPaddedTo:6 with:$0). |
|
3834 |
]. |
|
3835 |
r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16. |
|
3836 |
g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16. |
|
3837 |
b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16. |
|
3838 |
r := (r * 100 / 255). |
|
3839 |
g := (g * 100 / 255). |
|
3840 |
b := (b * 100 / 255). |
|
3841 |
^ Array with:r with:g with:b |
|
1674
787399517305
handle hex-r/g/b color names
Claus Gittinger <cg@exept.de>
parents:
1623
diff
changeset
|
3842 |
]. |
293 | 3843 |
|
1059
c040194dcab8
added internet explorers color-names
Claus Gittinger <cg@exept.de>
parents:
1045
diff
changeset
|
3844 |
names := #( |
6885 | 3845 |
'red' |
3846 |
'green' |
|
3847 |
'blue' |
|
3848 |
'yellow' |
|
3849 |
'magenta' |
|
3850 |
'cyan' |
|
3851 |
'white' |
|
3852 |
'black' |
|
3853 |
||
3854 |
'olive' |
|
3855 |
'teal' |
|
3856 |
'silver' |
|
3857 |
'lime' |
|
3858 |
'fuchsia' |
|
3859 |
'aqua' |
|
3860 |
). |
|
293 | 3861 |
idx := names indexOf:colorName. |
3862 |
idx == 0 ifTrue:[ |
|
6885 | 3863 |
idx := names indexOf:colorName asLowercase. |
293 | 3864 |
]. |
3220 | 3865 |
idx ~~ 0 ifTrue:[ |
6885 | 3866 |
triple := #( |
3867 |
(100 0 0) "red" |
|
3868 |
( 0 100 0) "green" |
|
3869 |
( 0 0 100) "blue" |
|
3870 |
(100 100 0) "yellow" |
|
3871 |
(100 0 100) "magenta" |
|
3872 |
( 0 100 100) "cyan" |
|
3873 |
(100 100 100) "white" |
|
3874 |
( 0 0 0) "black" |
|
3875 |
||
3876 |
( 50 50 0) "olive" |
|
3877 |
( 0 50 50) "teal" |
|
3878 |
( 40 40 40) "silver" |
|
3879 |
( 20 100 0) "lime" |
|
3880 |
( 60 3 100) "fuchsia" |
|
3881 |
( 10 100 100) "aqua" |
|
3882 |
) at:idx. |
|
3883 |
||
3884 |
^ triple |
|
3220 | 3885 |
]. |
3886 |
^ nil |
|
3887 |
! |
|
3888 |
||
3889 |
getRGBFromName:colorName into:aBlock |
|
3890 |
"get rgb components (0..100) of color named colorName, |
|
3891 |
and evaluate the 3-arg block, aBlock with them" |
|
3892 |
||
3893 |
|triple| |
|
3894 |
||
3895 |
triple := self getScaledRGBFromName:colorName. |
|
3896 |
triple notNil ifTrue:[ |
|
6296 | 3897 |
^ aBlock value:(self deviceColorValueToPercent:(triple at:1)) |
3898 |
value:(self deviceColorValueToPercent:(triple at:2)) |
|
3899 |
value:(self deviceColorValueToPercent:(triple at:3)) |
|
293 | 3900 |
]. |
3901 |
^ nil |
|
1059
c040194dcab8
added internet explorers color-names
Claus Gittinger <cg@exept.de>
parents:
1045
diff
changeset
|
3902 |
|
3220 | 3903 |
" |
3904 |
Display getRGBFromName:'red' into:[:r :g :b | r printCR. g printCR. b printCR.] |
|
3905 |
" |
|
3906 |
! |
|
3907 |
||
3908 |
getScaledRGBFrom:index |
|
3909 |
"get rgb components (0..devicesMaxColorVal) of color in map at:index, |
|
3910 |
and return a 3-element array containing them" |
|
3911 |
||
3912 |
^ self subclassResponsibility |
|
3913 |
! |
|
3914 |
||
3915 |
getScaledRGBFrom:index into:aBlock |
|
3916 |
"get rgb components (0..devicesMaxColorVal) of color in map at:index, |
|
3917 |
and evaluate the 3-arg block, aBlock with them" |
|
3918 |
||
3919 |
|triple| |
|
3920 |
||
3921 |
triple := self getScaledRGBFrom:index. |
|
3922 |
triple notNil ifTrue:[ |
|
6296 | 3923 |
^ aBlock valueWithArguments:triple. |
3220 | 3924 |
]. |
3925 |
^ nil |
|
3926 |
||
3927 |
! |
|
3928 |
||
3929 |
getScaledRGBFromName:colorName |
|
3930 |
"get rgb components (0..devicesMaxColorVal) of color named colorName, |
|
3931 |
and return a 3-element array containing them" |
|
3932 |
||
3933 |
|triple| |
|
3934 |
||
3935 |
triple := self getRGBFromName:colorName. |
|
3936 |
triple notNil ifTrue:[ |
|
6296 | 3937 |
^ triple collect:[:val | self percentToDeviceColorValue:val]. |
3220 | 3938 |
]. |
3939 |
^ nil. |
|
3940 |
||
293 | 3941 |
! |
3942 |
||
996 | 3943 |
getScaledRGBFromName:colorName into:aBlock |
3220 | 3944 |
"get rgb components (0..devicesMaxColorVal) of color named colorName, |
5339
2bcee9cc577a
colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents:
5336
diff
changeset
|
3945 |
and evaluate the 3-arg block, aBlock with them. |
2bcee9cc577a
colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents:
5336
diff
changeset
|
3946 |
Return nil for unknown color names." |
996 | 3947 |
|
3220 | 3948 |
|triple| |
3949 |
||
3950 |
triple := self getScaledRGBFromName:colorName. |
|
3951 |
triple notNil ifTrue:[ |
|
6296 | 3952 |
^ aBlock valueWithArguments:triple. |
3220 | 3953 |
]. |
3954 |
^ nil |
|
996 | 3955 |
! |
3956 |
||
293 | 3957 |
greenComponentOfColor:colorId |
3958 |
"get green component (0..100) of color in map at:index" |
|
3959 |
||
3220 | 3960 |
^ (self getRGBFrom:colorId) at:2 |
293 | 3961 |
! |
3962 |
||
3963 |
listOfAvailableColors |
|
3964 |
"return a list of all available colornames; |
|
3965 |
This method should not be used, since colornames are |
|
3966 |
very X specific. However, the names defined here are pretty common" |
|
3967 |
||
3968 |
^ #('red' 'green' 'blue' 'yellow' 'magenta' 'cyan' 'white' 'black') |
|
3969 |
! |
|
3970 |
||
4779
5fea61ea9782
Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents:
4641
diff
changeset
|
3971 |
numFixBlue |
5fea61ea9782
Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents:
4641
diff
changeset
|
3972 |
"return the number of blue shades in the |
5fea61ea9782
Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents:
4641
diff
changeset
|
3973 |
preallocated fix color cube (or 0 if there is none)" |
5fea61ea9782
Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents:
4641
diff
changeset
|
3974 |
|
5fea61ea9782
Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents:
4641
diff
changeset
|
3975 |
^ numFixBlue |
5fea61ea9782
Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents:
4641
diff
changeset
|
3976 |
! |
5fea61ea9782
Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents:
4641
diff
changeset
|
3977 |
|
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3978 |
numFixGreen |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3979 |
"return the number of green shades in the |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3980 |
preallocated fix color cube (or 0 if there is none)" |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3981 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3982 |
^ numFixGreen |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3983 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3984 |
"Created: 11.7.1996 / 17:50:12 / cg" |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3985 |
! |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3986 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3987 |
numFixRed |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3988 |
"return the number of red shades in the |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3989 |
preallocated fix color cube (or 0 if there is none)" |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3990 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3991 |
^ numFixRed |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3992 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3993 |
"Created: 11.7.1996 / 17:50:20 / cg" |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3994 |
! |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3995 |
|
974 | 3996 |
percentToDeviceColorValue:percent |
3997 |
^ self subclassResponsibility |
|
3998 |
! |
|
3999 |
||
293 | 4000 |
redComponentOfColor:colorId |
4001 |
"get red component (0..100) of color in map at:index" |
|
4002 |
||
3220 | 4003 |
^ (self getRGBFrom:colorId) at:1 |
4004 |
||
4005 |
" |
|
4006 |
Display redComponentOfColor:1 |
|
4007 |
" |
|
293 | 4008 |
! |
4009 |
||
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4010 |
releaseFixColors |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4011 |
"release the fix colorMap" |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4012 |
|
1769 | 4013 |
fixColors := nil. |
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4014 |
numFixRed := numFixGreen := numFixBlue := 0. |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4015 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4016 |
" |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4017 |
Display releaseFixColors |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4018 |
" |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4019 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4020 |
"Created: 11.7.1996 / 18:00:42 / cg" |
1769 | 4021 |
"Modified: 23.6.1997 / 15:32:04 / cg" |
4022 |
! |
|
4023 |
||
4024 |
releaseFixGrayColors |
|
4025 |
"release the fix colorMap" |
|
4026 |
||
4027 |
fixGrayColors := nil. |
|
4028 |
||
4029 |
" |
|
4030 |
Display releaseFixGrayColors |
|
4031 |
" |
|
4032 |
||
4033 |
"Created: 23.6.1997 / 15:32:00 / cg" |
|
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4034 |
! |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4035 |
|
293 | 4036 |
setColor:index red:redVal green:greenVal blue:blueVal |
974 | 4037 |
"change color in map at:index to rgb (0..100). |
4038 |
This is a no-op on TrueColor systems." |
|
4039 |
||
4040 |
^ self |
|
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4041 |
! |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4042 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4043 |
setDitherColors:colors |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4044 |
"set the table of preallocated emergency dither fix colors |
4350 | 4045 |
These preallocated colors |
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4046 |
(white, black, red, green, blue and a few grayScales) prevent |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4047 |
running out of colors later, when images have to be dithered or |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4048 |
pen colors must be approximated. |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4049 |
((Although, with such a small number of colors, the result will |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4050 |
definitely look poor))" |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4051 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4052 |
ditherColors := colors. |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4053 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4054 |
"Created: 11.7.1996 / 18:11:45 / cg" |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4055 |
! |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4056 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4057 |
setFixColors:colors numRed:nR numGreen:nG numBlue:nB |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4058 |
"set the table of preallocated fix colors (a colorCube), |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4059 |
and the number of r/g/b entries in each dimension." |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4060 |
|
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4061 |
fixColors := colors. |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4062 |
numFixRed := nR. |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4063 |
numFixGreen := nG. |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4064 |
numFixBlue := nB. |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4065 |
|
8124 | 4066 |
" |
4067 |
Display fixColors |
|
4068 |
" |
|
4069 |
||
4070 |
"Created: / 11-07-1996 / 17:56:18 / cg" |
|
4071 |
"Modified (comment): / 29-08-2017 / 16:46:42 / cg" |
|
1768 | 4072 |
! |
4073 |
||
4074 |
setFixGrayColors:colors |
|
4075 |
"set the table of preallocated fix gray colors" |
|
4076 |
||
4077 |
fixGrayColors := colors. |
|
293 | 4078 |
! ! |
4079 |
||
3028 | 4080 |
!DeviceWorkstation methodsFor:'copying'! |
4081 |
||
4933 | 4082 |
deepCopyUsing:aDictionary postCopySelector:postCopySelector |
3028 | 4083 |
^ nil |
4084 |
! ! |
|
4085 |
||
293 | 4086 |
!DeviceWorkstation methodsFor:'cursor stuff'! |
4087 |
||
1562
9a061e6942b9
allow device to specify its builtIn cursors
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
4088 |
builtInCursorShapes |
9a061e6942b9
allow device to specify its builtIn cursors
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
4089 |
"return a collection of standard cursor names. |
9a061e6942b9
allow device to specify its builtIn cursors
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
4090 |
Hre none is assumed - so all cursors are created as user cursors |
9a061e6942b9
allow device to specify its builtIn cursors
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
4091 |
(see Cursor>>initializeNewCursors)" |
9a061e6942b9
allow device to specify its builtIn cursors
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
4092 |
|
9a061e6942b9
allow device to specify its builtIn cursors
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
4093 |
"/ if you add something here, also add to #shapeNumberFromCursor ... |
9a061e6942b9
allow device to specify its builtIn cursors
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
4094 |
|
9a061e6942b9
allow device to specify its builtIn cursors
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
4095 |
^ #() |
9a061e6942b9
allow device to specify its builtIn cursors
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
4096 |
|
9a061e6942b9
allow device to specify its builtIn cursors
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
4097 |
"Created: 8.4.1997 / 10:32:31 / cg" |
9a061e6942b9
allow device to specify its builtIn cursors
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
4098 |
! |
9a061e6942b9
allow device to specify its builtIn cursors
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
4099 |
|
293 | 4100 |
colorCursor:aCursorId foreground:fgColor background:bgColor |
4350 | 4101 |
"change a cursors colors. |
974 | 4102 |
Ignored on systems which do not support colored cursors." |
4103 |
||
4104 |
^ self |
|
293 | 4105 |
! |
4106 |
||
2875 | 4107 |
createCursorShape:aShapeSymbol |
4108 |
"create a cursor given a shape-symbol; return a cursorID or nil. |
|
4109 |
This only works for a few standard cursors, and returns nil |
|
4110 |
if no such cursor exists. |
|
974 | 4111 |
Always care for a fallBack, in case of a nil return." |
4112 |
||
4113 |
^ nil |
|
4114 |
! |
|
4115 |
||
4116 |
createCursorSourceForm:sourceForm maskForm:maskForm hotX:hx hotY:hy width:w height:h |
|
4117 |
"create a cursor given 2 bitmaps (source, mask) and a hotspot. |
|
4118 |
Returns nil, if no cursor can be created (for any reason)" |
|
4119 |
||
293 | 4120 |
^ self subclassResponsibility |
4121 |
! |
|
4122 |
||
4123 |
destroyCursor:aCursorId |
|
4124 |
"free a cursor" |
|
4125 |
||
4126 |
^ self subclassResponsibility |
|
974 | 4127 |
! |
4128 |
||
4129 |
needDeviceFormsForCursor |
|
2843
e13e0c53924a
keep registry of cursors here - no longer use a Cursor Lobby
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4130 |
"return true, if this device requires device-forms as opposed |
e13e0c53924a
keep registry of cursors here - no longer use a Cursor Lobby
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4131 |
to a simple bitmap-byteArray for creation. |
e13e0c53924a
keep registry of cursors here - no longer use a Cursor Lobby
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4132 |
Redefined in X- and Win- Workstation classes." |
e13e0c53924a
keep registry of cursors here - no longer use a Cursor Lobby
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4133 |
|
974 | 4134 |
^ self subclassResponsibility |
4135 |
! |
|
4136 |
||
4137 |
shapeNumberFromSymbol:shape |
|
4138 |
"given a shape-symbol, return the corresponding cursor-number, |
|
4139 |
or nil if no such standard cursor exists." |
|
4140 |
||
4141 |
^ nil |
|
293 | 4142 |
! ! |
4143 |
||
1542 | 4144 |
!DeviceWorkstation methodsFor:'drag & drop'! |
4145 |
||
4461 | 4146 |
dragFinish:dropHandle |
4147 |
! |
|
4148 |
||
1582
ec428aba3f9c
drop argument is always a collection
Claus Gittinger <cg@exept.de>
parents:
1580
diff
changeset
|
4149 |
drop:aCollectionOfDropObjects inWindowID:destinationId position:destinationPoint rootPosition:rootPoint |
1542 | 4150 |
"device specific drop here" |
4151 |
||
4152 |
"/ self subclassResponsibility |
|
4153 |
||
4154 |
"Created: 4.4.1997 / 18:33:44 / cg" |
|
1582
ec428aba3f9c
drop argument is always a collection
Claus Gittinger <cg@exept.de>
parents:
1580
diff
changeset
|
4155 |
"Modified: 11.4.1997 / 12:43:23 / cg" |
1542 | 4156 |
! ! |
4157 |
||
293 | 4158 |
!DeviceWorkstation methodsFor:'drawing'! |
4159 |
||
1030
ca9d23090688
pass srcGCId to bit-blitters (req'd on WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
4160 |
copyFromId:sourceId x:srcX y:srcY gc:srcGCId to:destId x:dstX y:dstY gc:dstGCId width:w height:h |
293 | 4161 |
"do a bit-blt" |
4162 |
||
4163 |
^ self subclassResponsibility |
|
4164 |
! |
|
4165 |
||
1247
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4166 |
copyFromPixmapId:sourceId x:srcX y:srcY gc:srcGCId to:destId x:dstX y:dstY gc:dstGCId width:w height:h |
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4167 |
"do a bit-blt from a pix- or bitmap. |
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4168 |
Here, fall back into copyFromId:, which should also work. |
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4169 |
Subclasses may redefine this for more performance or if required" |
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4170 |
|
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4171 |
^ self copyFromId:sourceId x:srcX y:srcY gc:srcGCId to:destId x:dstX y:dstY gc:dstGCId width:w height:h |
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4172 |
! |
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4173 |
|
1030
ca9d23090688
pass srcGCId to bit-blitters (req'd on WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
4174 |
copyPlaneFromId:sourceId x:srcX y:srcY gc:srcGCId to:destId x:dstX y:dstY gc:dstGCId width:w height:h |
293 | 4175 |
"do a bit-blt, using the low-bit plane of the source only" |
4176 |
||
4177 |
^ self subclassResponsibility |
|
4178 |
! |
|
4179 |
||
1247
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4180 |
copyPlaneFromPixmapId:sourceId x:srcX y:srcY gc:srcGCId to:destId x:dstX y:dstY gc:dstGCId width:w height:h |
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4181 |
"do a bit-blt from a pix- or bitmap, using the low-bit plane of the source only. |
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4182 |
Here, fall back into copyPlaneFromId:, which should also work. |
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4183 |
Subclasses may redefine this for more performance or if required" |
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4184 |
|
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4185 |
^ self copyPlaneFromId:sourceId x:srcX y:srcY gc:srcGCId to:destId x:dstX y:dstY gc:dstGCId width:w height:h |
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4186 |
! |
c04af1fc542c
added fallbacks for copy*FromPixmapId:*
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
4187 |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
4188 |
displayArcX:x y:y width:width height:height from:startAngle angle:angle |
6296 | 4189 |
in:aDrawableId with:aGCId |
293 | 4190 |
"draw an arc" |
4191 |
||
4192 |
^ self subclassResponsibility |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
4193 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
4194 |
"Created: 8.5.1996 / 08:44:43 / cg" |
293 | 4195 |
! |
4196 |
||
4197 |
displayLineFromX:x0 y:y0 toX:x1 y:y1 in:aDrawableId with:aGCId |
|
4198 |
"draw a line" |
|
4199 |
||
1014
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
4200 |
" |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
4201 |
could add a bresenham line drawer here ... |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
4202 |
" |
293 | 4203 |
^ self subclassResponsibility |
4204 |
! |
|
4205 |
||
2909 | 4206 |
displayLinesFromX:xStart step:xStep yValues:ydata scaleY:yScale transY:yTrans in:drawableId with:gcId |
4207 |
"draw a polygon starting at x; the y values derives from the collection yValues. |
|
4208 |
The associated x is a multiple of step. Each y value will be scaled and translated. |
|
4209 |
The implementation here is a fallback, using the line-draw primitive; |
|
4210 |
devices which support fast drawing of a polygon may redefine this for more performance." |
|
4211 |
||
4212 |
|x xLast yLast| |
|
4213 |
||
4214 |
ydata size == 0 ifTrue:[^ self]. |
|
4215 |
||
4216 |
xLast := xStart. |
|
4217 |
yLast := (ydata at:1) * yScale + yTrans. |
|
4218 |
ydata from:2 do:[:y | |yT| |
|
6296 | 4219 |
x := xLast + xStep. |
4220 |
yT := y * yScale + yTrans. |
|
4221 |
self displayLineFromX:xLast rounded y:yLast rounded toX:x rounded y:yT rounded in:drawableId with:gcId. |
|
4222 |
xLast := x. |
|
4223 |
yLast := y. |
|
2909 | 4224 |
] |
4225 |
! |
|
4226 |
||
293 | 4227 |
displayOpaqueString:aString from:index1 to:index2 x:x y:y in:aDrawableId with:aGCId |
4228 |
"draw a sub-string - draw foreground on background. |
|
4350 | 4229 |
If the coordinates are not integers, retry with rounded." |
4230 |
||
4231 |
self displayString:aString |
|
6296 | 4232 |
from:index1 |
4233 |
to:index2 |
|
4234 |
x:x |
|
4235 |
y:y |
|
4236 |
in:aDrawableId |
|
4237 |
with:aGCId |
|
4238 |
opaque:true |
|
293 | 4239 |
! |
4240 |
||
4241 |
displayOpaqueString:aString x:x y:y in:aDrawableId with:aGCId |
|
4242 |
"draw a string - draw foreground on background. |
|
4350 | 4243 |
If the coordinates are not integers, retry with rounded." |
4244 |
||
4245 |
self displayString:aString |
|
6296 | 4246 |
x:x |
4247 |
y:y |
|
4248 |
in:aDrawableId |
|
4249 |
with:aGCId |
|
4250 |
opaque:true |
|
293 | 4251 |
! |
4252 |
||
4253 |
displayPointX:x y:y in:aDrawableId with:aGCId |
|
4254 |
"draw a point" |
|
4255 |
||
2622 | 4256 |
"/ could use |
4257 |
"/ self displayLineFromX:x y:y toX:x y:y in:aDrawableId with:aGCId. |
|
4258 |
"/ but then, we had to care for lineWidth & style ... |
|
4259 |
||
4260 |
^ self subclassResponsibility |
|
4261 |
||
4262 |
"Modified: / 3.5.1999 / 14:26:32 / cg" |
|
293 | 4263 |
! |
4264 |
||
4265 |
displayPolygon:aPolygon in:aDrawableId with:aGCId |
|
4266 |
"draw a polygon" |
|
4267 |
||
4268 |
" |
|
1014
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
4269 |
could draw the lines here |
293 | 4270 |
but then, we have to reimplement all line and join styles here |
4271 |
" |
|
4272 |
^ self subclassResponsibility |
|
4273 |
! |
|
4274 |
||
2442 | 4275 |
displayPolylines:arrayOfPoints in:aDrawableId with:aGCId |
4276 |
"draw a bunch of lines" |
|
4277 |
||
2523 | 4278 |
|startPoint p| |
2442 | 4279 |
|
4280 |
1 to:arrayOfPoints size by:2 do:[:idx | |
|
6296 | 4281 |
p := arrayOfPoints at:idx. |
4282 |
idx odd ifTrue:[ |
|
4283 |
startPoint := p |
|
4284 |
] ifFalse:[ |
|
4285 |
self |
|
4286 |
displayLineFromX:startPoint x |
|
4287 |
y:startPoint y |
|
4288 |
toX:p x |
|
4289 |
y:p y |
|
4290 |
in:aDrawableId |
|
4291 |
with:aGCId |
|
4292 |
] |
|
2442 | 4293 |
] |
4294 |
! |
|
4295 |
||
293 | 4296 |
displayRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId |
4297 |
"draw a rectangle" |
|
4298 |
||
4299 |
" |
|
1014
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
4300 |
could draw four lines here |
293 | 4301 |
but then, we have to reimplement all line and join styles here |
4302 |
" |
|
4303 |
^ self subclassResponsibility |
|
4304 |
! |
|
4305 |
||
4306 |
displayString:aString from:index1 to:index2 x:x y:y in:aDrawableId with:aGCId |
|
4307 |
"draw a sub-string - draw foreground only. |
|
4350 | 4308 |
If the coordinates are not integers, retry with rounded." |
4309 |
||
4310 |
self |
|
6296 | 4311 |
displayString:aString |
4312 |
from:index1 |
|
4313 |
to:index2 |
|
4314 |
x:x |
|
4315 |
y:y |
|
4316 |
in:aDrawableId |
|
4317 |
with:aGCId |
|
4318 |
opaque:false |
|
293 | 4319 |
! |
4320 |
||
4321 |
displayString:aString from:i1 to:i2 x:x y:y in:aDrawableId with:aGCId opaque:opaque |
|
4322 |
"draw part of a string" |
|
4323 |
||
1014
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
4324 |
^ self subclassResponsibility |
293 | 4325 |
! |
4326 |
||
4327 |
displayString:aString x:x y:y in:aDrawableId with:aGCId |
|
4328 |
"draw a string - draw foreground only. |
|
4350 | 4329 |
If the coordinates are not integers, retry with rounded." |
4330 |
||
4331 |
self |
|
6296 | 4332 |
displayString:aString |
4333 |
x:x |
|
4334 |
y:y |
|
4335 |
in:aDrawableId |
|
4336 |
with:aGCId |
|
4337 |
opaque:false |
|
293 | 4338 |
! |
4339 |
||
4340 |
displayString:aString x:x y:y in:aDrawableId with:aGCId opaque:opaque |
|
4341 |
"draw a string" |
|
4342 |
||
1014
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
4343 |
self displayString:aString |
6296 | 4344 |
from:1 |
4345 |
to:aString size |
|
4346 |
x:x |
|
4347 |
y:y |
|
4348 |
in:aDrawableId |
|
4349 |
with:aGCId |
|
4350 |
opaque:opaque |
|
293 | 4351 |
! |
4352 |
||
2002 | 4353 |
drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:pad |
6296 | 4354 |
width:imageWidth height:imageHeight |
4355 |
x:srcx y:srcy |
|
4356 |
into:aDrawableId |
|
4357 |
x:dstx y:dsty |
|
4358 |
width:w height:h |
|
4359 |
with:aGCId |
|
2002 | 4360 |
"draw a bitimage which has depth id, width iw and height ih into |
4361 |
the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty. |
|
4362 |
It has to be checked elsewhere, that server can do it with the given |
|
4363 |
depth; also it is assumed, that the colormap is setup correctly. |
|
4364 |
The actual bits per pixel may be different from the depth (for example, |
|
4365 |
on a depth-15 device, 16 bits/pixel may be used; also, many depth-24 |
|
4366 |
systems actually use 32 bits/pixel)" |
|
4367 |
||
4368 |
^ self subclassResponsibility |
|
4369 |
! |
|
4370 |
||
4350 | 4371 |
drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth |
6296 | 4372 |
width:imageWidth height:imageHeight |
4373 |
x:srcx y:srcy |
|
4374 |
into:aDrawableId |
|
4375 |
x:dstx y:dsty |
|
4376 |
width:w height:h |
|
4377 |
with:aGCId |
|
1602 | 4378 |
|
4379 |
"draw a bitimage which has depth id, width iw and height ih into |
|
4380 |
the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty. |
|
4381 |
It has to be checked elsewhere, that server can do it with the given |
|
4382 |
depth; also it is assumed, that the colormap is setup correctly. |
|
4383 |
The actual bits per pixel may be different from the depth (for example, |
|
4384 |
on a depth-15 device, 16 bits/pixel may be used; also, many depth-24 |
|
2004 | 4385 |
systems actually use 32 bits/pixel). |
4350 | 4386 |
This assumes a padding of 8-bits (i.e. byte-boundary), |
2004 | 4387 |
which is the natural padding within ST/X." |
1602 | 4388 |
|
2002 | 4389 |
^ self |
6296 | 4390 |
drawBits:imageBits |
4391 |
bitsPerPixel:bitsPerPixel |
|
4392 |
depth:imageDepth |
|
4393 |
padding:8 |
|
4394 |
width:imageWidth height:imageHeight |
|
4395 |
x:srcx y:srcy |
|
4396 |
into:aDrawableId |
|
4397 |
x:dstx y:dsty |
|
4398 |
width:w height:h |
|
4399 |
with:aGCId |
|
2004 | 4400 |
|
4401 |
"Created: / 16.4.1997 / 14:55:57 / cg" |
|
4402 |
"Modified: / 21.1.1998 / 13:27:58 / cg" |
|
2002 | 4403 |
! |
4404 |
||
4405 |
drawBits:imageBits depth:imageDepth padding:pad width:imageWidth height:imageHeight |
|
6296 | 4406 |
x:srcx y:srcy into:aDrawableId x:dstx y:dsty width:w height:h with:aGCId |
2002 | 4407 |
|
4408 |
"draw a bitimage which has depth id, width iw and height ih into |
|
4409 |
the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty. |
|
4410 |
It has to be checked elsewhere, that server can do it with the given |
|
4411 |
depth; also it is assumed, that the colormap is setup correctly" |
|
4412 |
||
4350 | 4413 |
^ self |
6296 | 4414 |
drawBits:imageBits |
4415 |
bitsPerPixel:imageDepth |
|
4416 |
depth:imageDepth |
|
4417 |
padding:pad |
|
4418 |
width:imageWidth height:imageHeight |
|
4419 |
x:srcx y:srcy |
|
4420 |
into:aDrawableId |
|
4421 |
x:dstx y:dsty |
|
4422 |
width:w height:h |
|
4423 |
with:aGCId |
|
293 | 4424 |
! |
4425 |
||
2004 | 4426 |
drawBits:imageBits depth:imageDepth width:imageWidth height:imageHeight |
6296 | 4427 |
x:srcx y:srcy |
4428 |
into:aDrawableId x:dstx y:dsty width:w height:h with:aGCId |
|
2004 | 4429 |
|
4430 |
"draw a bitimage which has depth id, width iw and height ih into |
|
4431 |
the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty. |
|
4432 |
It has to be checked elsewhere, that server can do it with the given |
|
4433 |
depth; also it is assumed, that the colormap is setup correctly. |
|
4350 | 4434 |
This assumes a padding of 8-bits (i.e. byte-boundary), |
2004 | 4435 |
which is the natural padding within ST/X." |
4436 |
||
4350 | 4437 |
^ self |
6296 | 4438 |
drawBits:imageBits |
4439 |
bitsPerPixel:imageDepth |
|
4440 |
depth:imageDepth |
|
4441 |
width:imageWidth height:imageHeight |
|
4442 |
x:srcx y:srcy |
|
4443 |
into:aDrawableId |
|
4444 |
x:dstx y:dsty |
|
4445 |
width:w height:h |
|
4446 |
with:aGCId |
|
2004 | 4447 |
|
4448 |
"Modified: / 21.1.1998 / 13:28:34 / cg" |
|
4449 |
! |
|
4450 |
||
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
4451 |
fillArcX:x y:y width:width height:height from:startAngle angle:angle |
6296 | 4452 |
in:aDrawableId with:aGCId |
293 | 4453 |
"fill an arc" |
4454 |
||
4455 |
^ self subclassResponsibility |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
4456 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
4457 |
"Created: 8.5.1996 / 08:45:11 / cg" |
293 | 4458 |
! |
4459 |
||
4460 |
fillPolygon:aPolygon in:aDrawableId with:aGCId |
|
4461 |
"fill a polygon" |
|
4462 |
||
4463 |
^ self subclassResponsibility |
|
4464 |
! |
|
4465 |
||
4466 |
fillRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId |
|
4467 |
"fill a rectangle" |
|
4468 |
||
4469 |
^ self subclassResponsibility |
|
4470 |
! ! |
|
4471 |
||
4472 |
!DeviceWorkstation methodsFor:'enumerating'! |
|
4473 |
||
3189 | 4474 |
allTopViews |
4475 |
"return a collection of all my known top views" |
|
4476 |
||
4477 |
^self allViews select:[:eachView | eachView isTopView]. |
|
4478 |
||
4479 |
! |
|
4480 |
||
293 | 4481 |
allViewsDo:aBlock |
3147
33419a1a34a0
brokenConnection: do not remove element from an enumerated collection
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
4482 |
"evaluate the argument, aBlock for all of my known views. |
4350 | 4483 |
Warning do not use this to remove view |
3147
33419a1a34a0
brokenConnection: do not remove element from an enumerated collection
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
4484 |
(never remove elements from an enumerated collection)" |
293 | 4485 |
|
4486 |
knownViews notNil ifTrue:[ |
|
7450 | 4487 |
knownViews do:aBlock |
4488 |
]. |
|
293 | 4489 |
|
4490 |
" |
|
4491 |
View defaultStyle:#iris. |
|
4492 |
Display allViewsDo:[:v | v initStyle. v redraw] |
|
4493 |
" |
|
4494 |
" |
|
4495 |
View defaultStyle:#next. |
|
4496 |
Display allViewsDo:[:v | v initStyle. v redraw] |
|
4497 |
" |
|
4498 |
" |
|
4499 |
View defaultStyle:#normal. |
|
4500 |
Display allViewsDo:[:v | v initStyle. v redraw] |
|
4501 |
" |
|
1215 | 4502 |
|
3147
33419a1a34a0
brokenConnection: do not remove element from an enumerated collection
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
4503 |
"Modified: / 19.1.2000 / 10:13:32 / cg" |
293 | 4504 |
! ! |
4505 |
||
3299
970960ffaef5
added DrawingOnClosedDevice signal
Claus Gittinger <cg@exept.de>
parents:
3263
diff
changeset
|
4506 |
!DeviceWorkstation methodsFor:'error handling'! |
970960ffaef5
added DrawingOnClosedDevice signal
Claus Gittinger <cg@exept.de>
parents:
3263
diff
changeset
|
4507 |
|
6885 | 4508 |
primitiveFailedOrClosedConnection |
6511 | 4509 |
"sent by all primitives here, when something is wrong. |
4510 |
Check what was wrong and raise a corresponding error here." |
|
4511 |
||
3299
970960ffaef5
added DrawingOnClosedDevice signal
Claus Gittinger <cg@exept.de>
parents:
3263
diff
changeset
|
4512 |
self isOpen ifFalse:[ |
6885 | 4513 |
"/ ignore in end-user apps |
4514 |
(Smalltalk isSmalltalkDevelopmentSystem) ifTrue:[ |
|
4515 |
DrawingOnClosedDeviceSignal raiseRequestWith:self. |
|
4516 |
]. |
|
4517 |
^ nil |
|
6511 | 4518 |
]. |
4519 |
^ self primitiveFailed |
|
4166 | 4520 |
! |
4521 |
||
4522 |
resourceOfId:id |
|
6345 | 4523 |
"search through all device stuff for a resource. |
4166 | 4524 |
Needed for error handling. |
4525 |
||
4526 |
Since id may be an ExternalAddress, do not compare with ==" |
|
4527 |
||
6481 | 4528 |
|addr| |
6345 | 4529 |
|
4169
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4167
diff
changeset
|
4530 |
id isNil ifTrue:[ |
6885 | 4531 |
"nil id is no resource" |
4532 |
^ nil |
|
4169
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4167
diff
changeset
|
4533 |
]. |
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4167
diff
changeset
|
4534 |
|
4166 | 4535 |
self allViewsDo:[:aView | |
6885 | 4536 |
(aView drawableId = id or:[aView gcId = id]) ifTrue:[^ aView]. |
4166 | 4537 |
]. |
4538 |
||
4173
100ca435fb0e
New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents:
4169
diff
changeset
|
4539 |
Form allSubInstancesDo:[:f | |
6885 | 4540 |
(f drawableId = id and:[f graphicsDevice == self]) ifTrue:[^ f] |
4166 | 4541 |
]. |
4542 |
||
4543 |
Font allInstancesDo:[:f | |
|
6885 | 4544 |
(f fontId = id and:[f graphicsDevice == self]) ifTrue:[^ f] |
4166 | 4545 |
]. |
4546 |
||
4350 | 4547 |
"KLUDGE: XWorkstation stores all IDs in ExternalAddresses, |
6885 | 4548 |
only colorId is stored as SmallInteger, |
4549 |
But resourceOfLastError returns an ExternalAddress even for colors." |
|
4166 | 4550 |
|
4551 |
(id respondsTo:#address) ifTrue:[ |
|
6885 | 4552 |
addr := id address. |
6481 | 4553 |
]. |
4554 |
Color allInstancesDo:[:c | |
|
6885 | 4555 |
(c graphicsDevice == self |
4556 |
and:[ c colorId = id or:[ c colorId = addr ]]) ifTrue:[^ c]. |
|
6481 | 4557 |
]. |
4166 | 4558 |
^ nil |
3299
970960ffaef5
added DrawingOnClosedDevice signal
Claus Gittinger <cg@exept.de>
parents:
3263
diff
changeset
|
4559 |
! ! |
970960ffaef5
added DrawingOnClosedDevice signal
Claus Gittinger <cg@exept.de>
parents:
3263
diff
changeset
|
4560 |
|
293 | 4561 |
!DeviceWorkstation methodsFor:'event forwarding'! |
4562 |
||
4959 | 4563 |
buttonMotion:buttonAndModifierState x:x y:y view:aView |
293 | 4564 |
"forward a button-motion for some view" |
4565 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4566 |
aView isNil ifTrue:[ |
6296 | 4567 |
"/ event arrived, after I destroyed it myself |
4568 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4569 |
]. |
4959 | 4570 |
aView sensor buttonMotion:buttonAndModifierState x:x y:y view:aView |
293 | 4571 |
! |
4572 |
||
4573 |
buttonMultiPress:button x:x y:y view:aView |
|
4574 |
"forward a button-multi-press event for some view" |
|
4575 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4576 |
aView isNil ifTrue:[ |
6296 | 4577 |
"/ event arrived, after I destroyed it myself |
4578 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4579 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4580 |
aView sensor buttonMultiPress:button x:x y:y view:aView |
293 | 4581 |
! |
4582 |
||
5134
0ce6b18c2747
alt-button-1 is translated to button2
Claus Gittinger <cg@exept.de>
parents:
5111
diff
changeset
|
4583 |
buttonPress:buttonArg x:x y:y view:aView |
293 | 4584 |
"forward a button-press event for some view" |
4585 |
||
5134
0ce6b18c2747
alt-button-1 is translated to button2
Claus Gittinger <cg@exept.de>
parents:
5111
diff
changeset
|
4586 |
|sensor button| |
293 | 4587 |
|
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4588 |
aView isNil ifTrue:[ |
6296 | 4589 |
"/ event arrived, after I destroyed it myself |
4590 |
^ self |
|
5134
0ce6b18c2747
alt-button-1 is translated to button2
Claus Gittinger <cg@exept.de>
parents:
5111
diff
changeset
|
4591 |
]. |
0ce6b18c2747
alt-button-1 is translated to button2
Claus Gittinger <cg@exept.de>
parents:
5111
diff
changeset
|
4592 |
|
0ce6b18c2747
alt-button-1 is translated to button2
Claus Gittinger <cg@exept.de>
parents:
5111
diff
changeset
|
4593 |
button := buttonArg. |
5999 | 4594 |
"/ used that for X on a mac, with a single button. |
4595 |
"/ No longer done automatically. |
|
5134
0ce6b18c2747
alt-button-1 is translated to button2
Claus Gittinger <cg@exept.de>
parents:
5111
diff
changeset
|
4596 |
(metaDown and:[button == 1]) ifTrue:[ |
6296 | 4597 |
UserPreferences current button2WithAltKey ifTrue:[ |
4598 |
button := 2. |
|
4599 |
]. |
|
5134
0ce6b18c2747
alt-button-1 is translated to button2
Claus Gittinger <cg@exept.de>
parents:
5111
diff
changeset
|
4600 |
]. |
0ce6b18c2747
alt-button-1 is translated to button2
Claus Gittinger <cg@exept.de>
parents:
5111
diff
changeset
|
4601 |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4602 |
sensor := aView sensor. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4603 |
WindowsRightButtonBehavior == true ifTrue:[ |
6296 | 4604 |
button >= 2 ifTrue:[ |
4605 |
sensor buttonPress:1 x:x y:y view:aView. |
|
4606 |
^ self. |
|
4607 |
] |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4608 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4609 |
sensor buttonPress:button x:x y:y view:aView |
293 | 4610 |
! |
4611 |
||
4612 |
buttonRelease:button x:x y:y view:aView |
|
4613 |
"forward a button-release event for some view" |
|
4614 |
||
4615 |
|sensor| |
|
4616 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4617 |
aView isNil ifTrue:[ |
6296 | 4618 |
"/ event arrived, after I destroyed it myself |
4619 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4620 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4621 |
sensor := aView sensor. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4622 |
WindowsRightButtonBehavior == true ifTrue:[ |
6296 | 4623 |
button >= 2 ifTrue:[ |
4624 |
sensor buttonRelease:1 x:x y:y view:aView. |
|
4625 |
sensor buttonPress:button x:x y:y view:aView. |
|
4626 |
sensor buttonRelease:button x:x y:y view:aView. |
|
4627 |
^ self. |
|
4628 |
]. |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4629 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4630 |
sensor buttonRelease:button x:x y:y view:aView |
293 | 4631 |
! |
4632 |
||
4633 |
configureX:x y:y width:w height:h view:aView |
|
6639 | 4634 |
"forward a configure (i.e. size or position change) event for some view" |
293 | 4635 |
|
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4636 |
aView isNil ifTrue:[ |
6885 | 4637 |
"/ event arrived, after I destroyed it myself |
4638 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4639 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4640 |
aView sensor configureX:x y:y width:w height:h view:aView |
293 | 4641 |
! |
4642 |
||
4643 |
coveredBy:otherView view:aView |
|
3602
3df4b726ba4b
Use WindowSensor for #coveredBy:
Stefan Vogel <sv@exept.de>
parents:
3597
diff
changeset
|
4644 |
"forward a covered for some view |
3df4b726ba4b
Use WindowSensor for #coveredBy:
Stefan Vogel <sv@exept.de>
parents:
3597
diff
changeset
|
4645 |
(aView has been covered by otherView)" |
3df4b726ba4b
Use WindowSensor for #coveredBy:
Stefan Vogel <sv@exept.de>
parents:
3597
diff
changeset
|
4646 |
|
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4647 |
aView isNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4648 |
"/ event arrived, after I destroyed it myself |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4649 |
^ self |
8371 | 4650 |
]. |
4651 |
otherView isNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4652 |
"/ event arrived, after otherView destroyed itself |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4653 |
^ self |
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4654 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4655 |
aView sensor coveredBy:otherView view:aView |
293 | 4656 |
! |
4657 |
||
4658 |
destroyedView:aView |
|
4659 |
"forward a destroyed event for some view" |
|
4660 |
||
3953 | 4661 |
|sensor| |
4662 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4663 |
aView isNil ifTrue:[ |
6296 | 4664 |
"/ event arrived, after I destroyed it myself |
4665 |
^ self |
|
3953 | 4666 |
]. |
4667 |
||
4668 |
"/ this one has special treatment - the destroyed could |
|
4669 |
"/ (in certain situations) arrive after the view has shutdown its |
|
4670 |
"/ sensor. |
|
4671 |
sensor := aView sensor. |
|
4672 |
sensor notNil ifTrue:[ |
|
6296 | 4673 |
sensor destroyedView:aView |
3953 | 4674 |
]. |
293 | 4675 |
! |
4676 |
||
4677 |
exposeX:x y:y width:w height:h view:aView |
|
4678 |
"forward an expose for some view" |
|
4679 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4680 |
aView isNil ifTrue:[ |
6296 | 4681 |
"/ event arrived, after I destroyed it myself |
4682 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4683 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4684 |
aView sensor exposeX:x y:y width:w height:h view:aView |
293 | 4685 |
! |
4686 |
||
4687 |
focusInView:aView |
|
4688 |
"forward a focusIn event for some view" |
|
4689 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4690 |
aView isNil ifTrue:[ |
6296 | 4691 |
"/ event arrived, after I destroyed it myself |
4692 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4693 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4694 |
aView sensor focusInView:aView |
293 | 4695 |
! |
4696 |
||
4350 | 4697 |
focusOutView:aView |
293 | 4698 |
"forward a focusOut event for some view" |
4699 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4700 |
aView isNil ifTrue:[ |
6296 | 4701 |
"/ event arrived, after I destroyed it myself |
4702 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4703 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4704 |
aView sensor focusOutView:aView |
293 | 4705 |
! |
4706 |
||
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1287
diff
changeset
|
4707 |
graphicsExposeX:x y:y width:w height:h final:final view:aView |
293 | 4708 |
"forward a graphic expose for some view" |
4709 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4710 |
aView isNil ifTrue:[ |
6296 | 4711 |
"/ event arrived, after I destroyed it myself |
4712 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4713 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4714 |
aView sensor graphicsExposeX:x y:y width:w height:h final:final view:aView |
293 | 4715 |
! |
4716 |
||
5960 | 4717 |
hotkeyWithId:aHotkeyId key:aKey view:aView |
4718 |
"forward a hotkey press for a view |
|
4719 |
" |
|
4720 |
||
4721 |
aView isNil ifTrue:[ |
|
6296 | 4722 |
"/ event arrived, after I destroyed it myself |
4723 |
^ self |
|
5960 | 4724 |
]. |
4725 |
aView sensor hotkeyWithId:aHotkeyId key:aKey view:aView |
|
4726 |
! |
|
4727 |
||
5061
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
4728 |
keyPress:untranslatedKeyArg x:x y:y view:aView |
293 | 4729 |
"forward a key-press event for some view" |
4730 |
||
509 | 4731 |
<resource: #keyboard (#Escape)> |
4732 |
||
5061
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
4733 |
|untranslatedKey| |
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
4734 |
|
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
4735 |
untranslatedKeyArg isInteger ifTrue:[ |
8499 | 4736 |
untranslatedKey := Character value:untranslatedKeyArg |
5061
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
4737 |
] ifFalse:[ |
8499 | 4738 |
untranslatedKey := untranslatedKeyArg |
5828
b77d25ec29ad
comment/format in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
5778
diff
changeset
|
4739 |
]. |
b77d25ec29ad
comment/format in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
5778
diff
changeset
|
4740 |
|
5917
d5b5e701a6e8
changed: #prependModifierToKey:
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
4741 |
"/ Timestamp now print. 'X: ' print. untranslatedKey printCR. |
4070 | 4742 |
|
6175 | 4743 |
"/ ctrl/meta-ESC give up focus& escapes an activePointerGrab |
3691
9427485e2507
Fix previous change: Return in LicenceBox on startup crashed the system.
Stefan Vogel <sv@exept.de>
parents:
3690
diff
changeset
|
4744 |
untranslatedKey == #Escape ifTrue:[ |
8499 | 4745 |
(activePointerGrab notNil |
4746 |
and:[ctrlDown or:[metaDown]]) ifTrue:[ |
|
4747 |
"/ 'Display: ungrab' printCR. |
|
4748 |
self ungrabPointer. |
|
4749 |
self ungrabKeyboard. |
|
4750 |
self setInputFocusTo:nil |
|
4751 |
] |
|
492
e67b71dd143d
added panic-ESC to release grab (Ctrl-ESC)
Claus Gittinger <cg@exept.de>
parents:
479
diff
changeset
|
4752 |
]. |
e67b71dd143d
added panic-ESC to release grab (Ctrl-ESC)
Claus Gittinger <cg@exept.de>
parents:
479
diff
changeset
|
4753 |
|
293 | 4754 |
self modifierKeyProcessing:untranslatedKey down:true. |
4755 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4756 |
aView isNil ifTrue:[ |
8499 | 4757 |
"/ event arrived, after I destroyed it myself |
4758 |
"/ 'Display: key for no view' printCR. |
|
4759 |
^ self |
|
4070 | 4760 |
]. |
4761 |
||
4762 |
"/ xlatedKey := self translateKey:untranslatedKey forView:aView. |
|
4763 |
"/ xlatedKey == #Hardcopy ifTrue:[ |
|
4764 |
"/ [ |
|
4765 |
"/ Transcript topView application |
|
4766 |
"/ saveScreenImage:(Image fromView:(aView topView) "inset:0" grab:true) defaultName:'hardcopy'. |
|
4767 |
"/ ] forkAt:Processor userSchedulingPriority + 1. |
|
4768 |
"/ ^ self. |
|
4769 |
"/ ]. |
|
4770 |
"/ |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4771 |
aView sensor keyPress:untranslatedKey x:x y:y view:aView |
5828
b77d25ec29ad
comment/format in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
5778
diff
changeset
|
4772 |
|
5917
d5b5e701a6e8
changed: #prependModifierToKey:
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
4773 |
"Modified (format): / 12-07-2012 / 18:37:40 / cg" |
8435 | 4774 |
"Modified: / 28-07-2018 / 10:10:24 / Claus Gittinger" |
293 | 4775 |
! |
4776 |
||
5061
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
4777 |
keyRelease:untranslatedKeyArg x:x y:y view:aView |
293 | 4778 |
"forward a key-release event for some view" |
4779 |
||
5061
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
4780 |
|untranslatedKey xlatedKey| |
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
4781 |
|
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
4782 |
untranslatedKeyArg isInteger ifTrue:[ |
6296 | 4783 |
untranslatedKey := Character value:untranslatedKeyArg |
5061
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
4784 |
] ifFalse:[ |
6296 | 4785 |
untranslatedKey := untranslatedKeyArg |
5061
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
4786 |
]. |
293 | 4787 |
|
4788 |
self modifierKeyProcessing:untranslatedKey down:false. |
|
4789 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4790 |
aView isNil ifTrue:[ |
6296 | 4791 |
"/ event arrived, after I destroyed it myself |
4792 |
^ self |
|
3691
9427485e2507
Fix previous change: Return in LicenceBox on startup crashed the system.
Stefan Vogel <sv@exept.de>
parents:
3690
diff
changeset
|
4793 |
]. |
9427485e2507
Fix previous change: Return in LicenceBox on startup crashed the system.
Stefan Vogel <sv@exept.de>
parents:
3690
diff
changeset
|
4794 |
|
9427485e2507
Fix previous change: Return in LicenceBox on startup crashed the system.
Stefan Vogel <sv@exept.de>
parents:
3690
diff
changeset
|
4795 |
xlatedKey := self translateKey:untranslatedKey forView:aView. |
9427485e2507
Fix previous change: Return in LicenceBox on startup crashed the system.
Stefan Vogel <sv@exept.de>
parents:
3690
diff
changeset
|
4796 |
xlatedKey == #Hardcopy ifTrue:[^ self]. |
9427485e2507
Fix previous change: Return in LicenceBox on startup crashed the system.
Stefan Vogel <sv@exept.de>
parents:
3690
diff
changeset
|
4797 |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4798 |
aView sensor keyRelease:untranslatedKey x:x y:y view:aView |
293 | 4799 |
! |
4800 |
||
4801 |
mappedView:aView |
|
4802 |
"forward a mapped event for some view" |
|
4803 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4804 |
aView isNil ifTrue:[ |
6296 | 4805 |
"/ event arrived, after I destroyed it myself |
4806 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4807 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4808 |
aView sensor mappedView:aView |
293 | 4809 |
! |
4810 |
||
6763 | 4811 |
mouseWheelMotion:buttonState x:x y:y amount:amountArg deltaTime:dTime view:aView |
2677 | 4812 |
"the mousewheel was moved by some amount (signed). |
4813 |
This event is sent to the current pointer view (like keyPress/release)." |
|
2699 | 4814 |
|
6763 | 4815 |
|amount| |
4816 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4817 |
aView isNil ifTrue:[ |
6885 | 4818 |
"/ event arrived, after I destroyed it myself |
4819 |
^ self |
|
6763 | 4820 |
]. |
4821 |
amount := amountArg. |
|
4822 |
UserPreferences current mouseWheelDirectionReversed ifTrue:[ |
|
6885 | 4823 |
amount := amount negated |
4824 |
]. |
|
5610 | 4825 |
aView sensor |
6885 | 4826 |
mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime view:aView |
6763 | 4827 |
|
4828 |
" |
|
4829 |
UserPreferences current mouseWheelDirectionReversed:true |
|
4830 |
UserPreferences current mouseWheelDirectionReversed:false |
|
4831 |
" |
|
2699 | 4832 |
"Modified: / 21.5.1999 / 13:05:53 / cg" |
2677 | 4833 |
! |
4834 |
||
293 | 4835 |
noExposeView:aView |
4836 |
"forward a noExpose event for some view" |
|
4837 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4838 |
aView isNil ifTrue:[ |
6296 | 4839 |
"/ event arrived, after I destroyed it myself |
4840 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4841 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4842 |
aView sensor noExposeView:aView |
293 | 4843 |
! |
4844 |
||
4845 |
pointerEnter:buttonState x:x y:y view:aView |
|
4846 |
"forward a pointer enter for some view" |
|
4847 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4848 |
aView isNil ifTrue:[ |
6296 | 4849 |
"/ event arrived, after I destroyed it myself |
4850 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4851 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4852 |
aView sensor pointerEnter:buttonState x:x y:y view:aView |
293 | 4853 |
! |
4854 |
||
4855 |
pointerLeave:buttonState view:aView |
|
4856 |
"forward a pointer leave for some view" |
|
4857 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4858 |
aView isNil ifTrue:[ |
6296 | 4859 |
"/ event arrived, after I destroyed it myself |
4860 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4861 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4862 |
aView sensor pointerLeave:buttonState view:aView |
293 | 4863 |
! |
4864 |
||
4865 |
saveAndTerminateView:aView |
|
4866 |
"forward a saveAndTerminate event for some view" |
|
4867 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4868 |
aView isNil ifTrue:[ |
6296 | 4869 |
"/ event arrived, after I destroyed it myself |
4870 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4871 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4872 |
aView sensor saveAndTerminateView:aView |
293 | 4873 |
! |
4874 |
||
4875 |
terminateView:aView |
|
4876 |
"forward a terminate event for some view" |
|
4877 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4878 |
aView isNil ifTrue:[ |
6296 | 4879 |
"/ event arrived, after I destroyed it myself |
4880 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4881 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4882 |
aView sensor terminateView:aView. |
293 | 4883 |
! |
4884 |
||
4885 |
unmappedView:aView |
|
4886 |
"forward an unmapped event for some view" |
|
4887 |
||
3231
b7fc5adc9404
care for unknown view in event forwarding code
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4888 |
aView isNil ifTrue:[ |
6296 | 4889 |
"/ event arrived, after I destroyed it myself |
4890 |
^ self |
|
3858
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4891 |
]. |
ecbaa5d75c70
Use SynchronousWindowSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3834
diff
changeset
|
4892 |
aView sensor unmappedView:aView |
293 | 4893 |
! ! |
4894 |
||
4895 |
!DeviceWorkstation methodsFor:'event handling'! |
|
4896 |
||
6560 | 4897 |
addToKnownScreens |
4898 |
AllScreens isNil ifTrue:[ |
|
6885 | 4899 |
AllScreens := IdentitySet new:1 |
6560 | 4900 |
]. |
4901 |
AllScreens add:self. |
|
4902 |
! |
|
4903 |
||
293 | 4904 |
checkForEndOfDispatch |
7100 | 4905 |
"if there are no longer any views of interest - stop dispatch. |
349
507a573eba58
dont exit dispatch loop with last window (stopped when changing language with only a launcher open)
Claus Gittinger <cg@exept.de>
parents:
347
diff
changeset
|
4906 |
This ends the dispatcher process when the last view is closed on that device. |
507a573eba58
dont exit dispatch loop with last window (stopped when changing language with only a launcher open)
Claus Gittinger <cg@exept.de>
parents:
347
diff
changeset
|
4907 |
We only do this for displays other that the default Display." |
507a573eba58
dont exit dispatch loop with last window (stopped when changing language with only a launcher open)
Claus Gittinger <cg@exept.de>
parents:
347
diff
changeset
|
4908 |
|
423
98a3808d9902
additions for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
414
diff
changeset
|
4909 |
dispatching ifFalse:[^ self]. |
98a3808d9902
additions for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
414
diff
changeset
|
4910 |
|
98a3808d9902
additions for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
414
diff
changeset
|
4911 |
self == Display ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4912 |
ExitOnLastClose == true ifFalse:[^ self]. |
423
98a3808d9902
additions for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
414
diff
changeset
|
4913 |
]. |
2826 | 4914 |
exitOnLastClose == true ifFalse:[^ self]. |
293 | 4915 |
|
4916 |
knownViews notNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4917 |
"/ if there is no non-popup topview, stop dispatching |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4918 |
(knownViews contains:[:slot | |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4919 |
slot notNil |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4920 |
and:[(self viewIsRelevantInCheckForEndOfDispatch:slot) |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4921 |
and:[true "slot isModal not" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4922 |
"and:[slot realized]"]]] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4923 |
) ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4924 |
"/ my last view was closed |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4925 |
dispatching := false. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4926 |
Logger info:'finished dispatch (last view closed): %1' with:self. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4927 |
self releaseDeviceResources. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4928 |
eventSema notNil ifTrue:[eventSema signal]. "/ get dispatchLoop out of its wait... |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
4929 |
] |
423
98a3808d9902
additions for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
414
diff
changeset
|
4930 |
]. |
293 | 4931 |
|
4932 |
"Modified: 19.9.1995 / 11:31:54 / claus" |
|
1449
02f4faded623
end of dispatch if no realized topview
Claus Gittinger <cg@exept.de>
parents:
1429
diff
changeset
|
4933 |
"Modified: 18.3.1997 / 10:42:11 / cg" |
293 | 4934 |
! |
4935 |
||
3646 | 4936 |
cleanupAfterDispatch |
4937 |
eventSema notNil ifTrue:[ |
|
6296 | 4938 |
Processor disableSemaphore:eventSema. |
4939 |
eventSema := nil. |
|
3646 | 4940 |
]. |
4941 |
dispatchProcess := nil. |
|
3742 | 4942 |
|
4943 |
DefaultScreen == self ifTrue:[ |
|
6296 | 4944 |
(Transcript isView and:[Transcript topView device ~~ self]) ifTrue:[ |
4945 |
DefaultScreen := Transcript topView device |
|
4946 |
] ifFalse:[ |
|
4947 |
"/ what should the defaultScreen be - help !!!!!! |
|
4948 |
||
4949 |
DefaultScreen := DeviceWorkstation allSubInstances |
|
4950 |
detect:[:aDevice | aDevice isOpen] ifNone:nil |
|
4951 |
] |
|
3742 | 4952 |
] |
3646 | 4953 |
! |
4954 |
||
293 | 4955 |
dispatchEvent |
4956 |
"get and process the next pending event - for any view" |
|
4957 |
||
4958 |
self dispatchEventFor:nil withMask:nil |
|
4959 |
! |
|
4960 |
||
4961 |
dispatchEventFor:aViewIdOrNil withMask:eventMask |
|
4962 |
"central event handling method: |
|
7695 | 4963 |
get next event and send an appropriate message to the view's sensor, |
293 | 4964 |
or to the view directly (if the view has none). |
4965 |
If the argument aViewIdOrNil is nil, events for any view are processed, |
|
4966 |
otherwise only events for the view with given id are processed |
|
4967 |
(in this case, nothing is done if no events are pending); |
|
4968 |
if the argument aMask is nonNil, only events for this eventMask are |
|
4969 |
handled. The mask is a device dependent event mask." |
|
4970 |
||
4971 |
^ self subclassResponsibility |
|
4972 |
! |
|
4973 |
||
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
4974 |
dispatchLoop |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
4975 |
"the actual event dispatching loop." |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
4976 |
|
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
4977 |
[dispatching] whileTrue:[ |
7450 | 4978 |
"abortAll is handled, but not asked for here!!" |
4979 |
AbortAllOperationRequest handle:[:ex | |
|
4980 |
ex return |
|
4981 |
] do:[ |
|
4982 |
[self eventPending] whileFalse:[ |
|
4983 |
Processor activeProcess setStateTo:#ioWait if:#active. |
|
4984 |
eventSema wait. |
|
4985 |
"/ a temporary hack & workaround for semaphore-bug |
|
6383 | 4986 |
"/ (eventSema waitWithTimeoutMs:500) isNil ifTrue:[ |
4987 |
"/ "/ timeout |
|
4988 |
"/ eventSema wouldBlock ifFalse:[ |
|
7443 | 4989 |
"/ Logger info:'sema did not wake up'. |
6383 | 4990 |
"/ ] ifTrue:[ |
4991 |
"/ self eventPending ifTrue:[ |
|
7443 | 4992 |
"/ Logger info:'sema missed'. |
6383 | 4993 |
"/ ]. |
4994 |
"/ ]. |
|
4995 |
"/ ]. |
|
7450 | 4996 |
dispatching ifFalse:[^ self]. |
4997 |
]. |
|
4998 |
dispatching ifTrue:[ |
|
4999 |
self dispatchPendingEvents. |
|
5000 |
]. |
|
5001 |
] |
|
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5002 |
] |
5715 | 5003 |
|
5004 |
"Modified: / 09-02-2011 / 13:59:43 / cg" |
|
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5005 |
! |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5006 |
|
293 | 5007 |
dispatchModalWhile:aBlock |
4350 | 5008 |
"get and process next event for any view as long as the |
293 | 5009 |
argument-block evaluates to true. |
5010 |
This is a modal loop, not switching to other processes, |
|
4350 | 5011 |
effectively polling the device in a (nice) busy loop. |
293 | 5012 |
This should only be (and is only) used for emergency cases. |
5013 |
(such as a graphical debugger, debugging the event-dispatcher itself)" |
|
5014 |
||
5015 |
|myFd| |
|
5016 |
||
5017 |
" |
|
5018 |
if this display has a fileDescriptor to wait on, |
|
5019 |
it is used; otherwise we poll (with a delay to not lock up |
|
5020 |
the workstation) |
|
5021 |
" |
|
5022 |
myFd := self displayFileDescriptor. |
|
7842 | 5023 |
aBlock whileTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5024 |
self eventPending ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5025 |
myFd isNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5026 |
OperatingSystem millisecondDelay:50 |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5027 |
] ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5028 |
OperatingSystem selectOn:myFd withTimeOut:50. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5029 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5030 |
Processor evaluateTimeouts. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5031 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5032 |
self eventPending ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5033 |
self dispatchEvent |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5034 |
]. |
293 | 5035 |
] |
7842 | 5036 |
|
5037 |
"Modified (format): / 07-02-2017 / 12:50:58 / stefan" |
|
293 | 5038 |
! |
5039 |
||
5040 |
dispatchPendingEvents |
|
8352 | 5041 |
"go dispatch events as long as there is one." |
293 | 5042 |
|
4287 | 5043 |
OSSignalInterrupt handle:[:ex | |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5044 |
ex return |
2114 | 5045 |
] do:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5046 |
[self eventPending] whileTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5047 |
self dispatchEventFor:nil withMask:nil. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5048 |
"/ multi-screen config: give others a chance |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5049 |
"/ (needed because we run at high (non-timesliced) prio) |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5050 |
Processor yield. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5051 |
] |
293 | 5052 |
] |
8352 | 5053 |
|
5054 |
"Modified (comment): / 03-05-2018 / 17:42:09 / stefan" |
|
293 | 5055 |
! |
5056 |
||
5057 |
disposeButtonEventsFor:aViewIdOrNil |
|
5058 |
"dispose (i.e. forget) all pending button events on this display" |
|
5059 |
||
5060 |
|mask| |
|
5061 |
||
5062 |
mask := self eventMaskFor:#buttonPress. |
|
5063 |
mask := mask bitOr:(self eventMaskFor:#buttonRelease). |
|
5064 |
mask := mask bitOr:(self eventMaskFor:#buttonMotion). |
|
5065 |
self disposeEventsWithMask:mask for:aViewIdOrNil |
|
5066 |
! |
|
5067 |
||
5068 |
disposeEvents |
|
5069 |
"dispose (i.e. forget) all events pending on this display" |
|
5070 |
||
5071 |
[self eventPending] whileTrue:[ |
|
6296 | 5072 |
self getEventFor:nil withMask:nil into:nil |
293 | 5073 |
]. |
5074 |
! |
|
5075 |
||
5076 |
disposeEventsWithMask:aMask for:aWindowId |
|
5077 |
"dispose (throw away) specific events" |
|
5078 |
||
5079 |
^ self subclassResponsibility |
|
5080 |
! |
|
5081 |
||
5082 |
eventMaskFor:anEventSymbol |
|
5083 |
^ self subclassResponsibility |
|
5084 |
! |
|
5085 |
||
5086 |
eventPending |
|
5087 |
"return true, if any event is pending" |
|
5088 |
||
5089 |
^ self subclassResponsibility |
|
5090 |
! |
|
5091 |
||
5092 |
eventPending:anEventSymbol for:aWindowId |
|
5093 |
"return true, if a specific event is pending for a specific window. |
|
5094 |
This expects device independent event symbols (such as #buttonPress, |
|
5095 |
#buttonRelease etc.) as first argument." |
|
5096 |
||
5097 |
^ self subclassResponsibility |
|
5098 |
! |
|
5099 |
||
3224 | 5100 |
eventPending:anEventMask for:aWindowId withSync:doSync |
5101 |
"return true, if any of the masked events is pending |
|
5102 |
for a specific window. |
|
5103 |
This expects a device dependent event mask as first argument." |
|
5104 |
||
5105 |
^ self subclassResponsibility |
|
5106 |
! |
|
5107 |
||
405 | 5108 |
eventPendingWithSync:doSync |
293 | 5109 |
"return true, if any event is pending" |
5110 |
||
5111 |
^ self subclassResponsibility |
|
5112 |
! |
|
5113 |
||
332
48f78f549e5f
dont want two dispatchers after restart (addknownView started it; Smalltalk>>restart did it again)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
5114 |
eventQueued |
48f78f549e5f
dont want two dispatchers after restart (addknownView started it; Smalltalk>>restart did it again)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
5115 |
"return true, if any event is pending in some internal queue. |
48f78f549e5f
dont want two dispatchers after restart (addknownView started it; Smalltalk>>restart did it again)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
5116 |
The fallBack here returns true if events are pending on the display connection; |
48f78f549e5f
dont want two dispatchers after restart (addknownView started it; Smalltalk>>restart did it again)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
5117 |
only devices which use internal queues (i.e. Xlib) need to redefine this." |
48f78f549e5f
dont want two dispatchers after restart (addknownView started it; Smalltalk>>restart did it again)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
5118 |
|
48f78f549e5f
dont want two dispatchers after restart (addknownView started it; Smalltalk>>restart did it again)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
5119 |
^ self eventPending |
48f78f549e5f
dont want two dispatchers after restart (addknownView started it; Smalltalk>>restart did it again)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
5120 |
! |
48f78f549e5f
dont want two dispatchers after restart (addknownView started it; Smalltalk>>restart did it again)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
5121 |
|
2169 | 5122 |
eventQueuedAlready |
5123 |
"return true, if any event is pending in some internal queue. |
|
5124 |
The fallBack here returns true if events are pending on the display connection; |
|
5125 |
only devices which use internal queues (i.e. Xlib) need to redefine this." |
|
5126 |
||
5127 |
^ self eventPending |
|
5128 |
! |
|
5129 |
||
405 | 5130 |
eventsPending:anEventMask for:aWindowId withSync:doSync |
3224 | 5131 |
"obsolete - will vanish." |
5132 |
||
5133 |
^ self eventPending:anEventMask for:aWindowId withSync:doSync |
|
293 | 5134 |
! |
5135 |
||
5959
84cbcbd739f1
added: #registerHotKeyForWindow:withId:modifiers:virtualKeyCode:
ab
parents:
5947
diff
changeset
|
5136 |
registerHotKeyForWindow:aDrawableId withId:anId modifiers:aModifier virtualKeyCode:aVirtualKeyCode |
8442 | 5137 |
"Defines a system-wide hotkey." |
5959
84cbcbd739f1
added: #registerHotKeyForWindow:withId:modifiers:virtualKeyCode:
ab
parents:
5947
diff
changeset
|
5138 |
|
84cbcbd739f1
added: #registerHotKeyForWindow:withId:modifiers:virtualKeyCode:
ab
parents:
5947
diff
changeset
|
5139 |
^ self subclassResponsibility |
8442 | 5140 |
|
5141 |
"Modified (comment): / 06-08-2018 / 15:39:25 / Claus Gittinger" |
|
5959
84cbcbd739f1
added: #registerHotKeyForWindow:withId:modifiers:virtualKeyCode:
ab
parents:
5947
diff
changeset
|
5142 |
! |
84cbcbd739f1
added: #registerHotKeyForWindow:withId:modifiers:virtualKeyCode:
ab
parents:
5947
diff
changeset
|
5143 |
|
293 | 5144 |
setEventMask:aMask in:aWindowId |
310 | 5145 |
"arrange that only events from aMask are reported to a view. |
5146 |
Highly device specific, to be defined in concrete subclasses" |
|
5147 |
||
293 | 5148 |
^ self subclassResponsibility |
5149 |
! |
|
5150 |
||
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5151 |
setupDispatchLoop |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5152 |
"create & start the display event dispatch process." |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5153 |
|
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5154 |
|fd checkBlock| |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5155 |
|
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5156 |
fd := self displayFileDescriptor. |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5157 |
|
8068 | 5158 |
eventSema := Semaphore name:'display inputSema'. |
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5159 |
|
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5160 |
"/ arrange for the processor to signal that semaphore when input |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5161 |
"/ is available or #eventPending returns true |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5162 |
|
6085 | 5163 |
(fd isNil or:[ OperatingSystem isOSXlike]) ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5164 |
"no fd -- so have to check for input also" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5165 |
checkBlock := [self eventPending]. |
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5166 |
] ifFalse:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5167 |
"there is a fd, so checkblock has to check only the internal queue" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5168 |
checkBlock := [self eventQueued]. |
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5169 |
]. |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5170 |
|
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5171 |
"/ handle all incoming events from the device, sitting on a semaphore. |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5172 |
"/ Tell Processor to trigger this semaphore when some event arrives |
4350 | 5173 |
"/ for me. Since a select alone may not be enough to know if events are pending |
5174 |
"/ (Xlib reads out event-queue while doing output), we also install a poll-check block. |
|
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5175 |
"/ The poll check is also req'd for systems where we cannot do a select |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5176 |
"/ on the eventQ (i.e. windows). |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5177 |
|
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5178 |
Processor signal:eventSema onInput:fd orCheck:checkBlock. |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5179 |
|
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5180 |
DeviceIOErrorSignal handle:[:ex | |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5181 |
"test for handlerBlock until the signal is changed to be class-based" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5182 |
ex creator handlerBlock notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5183 |
ex defaultAction. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5184 |
] ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5185 |
(self == self class default and:[AllScreens size == 1]) ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5186 |
'DeviceWorkstation [error]: I/O error for default display - writing crash.img and exiting' _errorPrintCR. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5187 |
SnapshotError catch:[ ObjectMemory writeCrashImage ]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5188 |
Smalltalk exit:1. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5189 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5190 |
'DeviceWorkstation [warning]: stop dispatch due to I/O error: ' errorPrint. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5191 |
self errorPrintCR. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5192 |
self brokenConnection. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5193 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5194 |
ex return. |
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5195 |
] do:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5196 |
self initializeDeviceResources. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5197 |
[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5198 |
self dispatchLoop |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5199 |
] ifCurtailed:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5200 |
self cleanupAfterDispatch. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5201 |
self emergencyCloseConnection. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5202 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5203 |
self cleanupAfterDispatch. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5204 |
self close. |
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5205 |
]. |
4629 | 5206 |
|
5207 |
"Modified: / 29-09-2006 / 12:28:04 / cg" |
|
8289 | 5208 |
"Modified: / 09-02-2018 / 20:45:10 / stefan" |
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5209 |
! |
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5210 |
|
293 | 5211 |
startDispatch |
1719
c9d6b6fc6fb0
systems without a display fd install a checkBlock only and an fd of -1 (windows)
Claus Gittinger <cg@exept.de>
parents:
1717
diff
changeset
|
5212 |
"create & start the display event dispatch process." |
293 | 5213 |
|
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5214 |
|p nm| |
293 | 5215 |
|
1185
f72f2a0d97cf
code cleanup (obsolete pureEvent stuff removed)
Claus Gittinger <cg@exept.de>
parents:
1177
diff
changeset
|
5216 |
"/ |
f72f2a0d97cf
code cleanup (obsolete pureEvent stuff removed)
Claus Gittinger <cg@exept.de>
parents:
1177
diff
changeset
|
5217 |
"/ only allow one dispatcher process per display |
f72f2a0d97cf
code cleanup (obsolete pureEvent stuff removed)
Claus Gittinger <cg@exept.de>
parents:
1177
diff
changeset
|
5218 |
"/ |
6253 | 5219 |
(dispatchProcess notNil and:[dispatchProcess isDead not]) ifTrue:[^ self]. |
293 | 5220 |
dispatching := true. |
5221 |
||
6560 | 5222 |
self addToKnownScreens. |
293 | 5223 |
|
3645
7ed096386bd3
refactored event dispatch loop;
Claus Gittinger <cg@exept.de>
parents:
3644
diff
changeset
|
5224 |
p := [ self setupDispatchLoop ] newProcess. |
1185
f72f2a0d97cf
code cleanup (obsolete pureEvent stuff removed)
Claus Gittinger <cg@exept.de>
parents:
1177
diff
changeset
|
5225 |
|
f72f2a0d97cf
code cleanup (obsolete pureEvent stuff removed)
Claus Gittinger <cg@exept.de>
parents:
1177
diff
changeset
|
5226 |
"/ |
f72f2a0d97cf
code cleanup (obsolete pureEvent stuff removed)
Claus Gittinger <cg@exept.de>
parents:
1177
diff
changeset
|
5227 |
"/ give the process a nice name (for the processMonitor) |
f72f2a0d97cf
code cleanup (obsolete pureEvent stuff removed)
Claus Gittinger <cg@exept.de>
parents:
1177
diff
changeset
|
5228 |
"/ |
762 | 5229 |
(nm := self displayName) notNil ifTrue:[ |
8499 | 5230 |
nm := 'Display: event dispatcher (' , nm , ')'. |
293 | 5231 |
] ifFalse:[ |
8499 | 5232 |
nm := 'Display: event dispatcher'. |
762 | 5233 |
]. |
5234 |
p name:nm. |
|
958 | 5235 |
p priority:(Processor userInterruptPriority). |
2969
c0c385edd320
explicit mark of the dispatcher process as a systemProcess.
Claus Gittinger <cg@exept.de>
parents:
2963
diff
changeset
|
5236 |
p beSystemProcess. |
958 | 5237 |
dispatchProcess := p. |
5238 |
p resume. |
|
8446 | 5239 |
|
5240 |
"Modified: / 15-08-2018 / 15:05:40 / Claus Gittinger" |
|
2892 | 5241 |
! |
5242 |
||
5243 |
stopDispatch |
|
5244 |
"stop the dispatch process" |
|
5245 |
||
5246 |
|p| |
|
5247 |
||
2924
9b42e9bafdf7
Forget about cached Displays (cg)
Stefan Vogel <sv@exept.de>
parents:
2922
diff
changeset
|
5248 |
LastActiveScreen == self ifTrue:[ |
6296 | 5249 |
LastActiveScreen := nil. |
5250 |
LastActiveProcess := nil. |
|
2924
9b42e9bafdf7
Forget about cached Displays (cg)
Stefan Vogel <sv@exept.de>
parents:
2922
diff
changeset
|
5251 |
]. |
9b42e9bafdf7
Forget about cached Displays (cg)
Stefan Vogel <sv@exept.de>
parents:
2922
diff
changeset
|
5252 |
|
2892 | 5253 |
(p := dispatchProcess) notNil ifTrue:[ |
6296 | 5254 |
dispatchProcess := nil. |
5255 |
p terminateWithAllSubprocessesInGroup. |
|
5256 |
p terminateNoSignal. "/ just in case |
|
2892 | 5257 |
] |
5960 | 5258 |
! |
5259 |
||
5260 |
unregisterHotKeyForWindow:aDrawableId withId:anId |
|
8442 | 5261 |
"Release a system-wide hotkey." |
5960 | 5262 |
|
5263 |
^ self subclassResponsibility |
|
8442 | 5264 |
|
5265 |
"Modified (comment): / 06-08-2018 / 15:39:21 / Claus Gittinger" |
|
6293 | 5266 |
! |
5267 |
||
5268 |
viewIsRelevantInCheckForEndOfDispatch:aView |
|
5269 |
"return true, if the argument is not to be treated as a user view. |
|
5270 |
These, if any of them is still present, will prevent the endOfDispatch if the |
|
5271 |
exitOnLastClose flag is set." |
|
5272 |
||
5273 |
^ aView isRootView not |
|
6296 | 5274 |
and:[ aView isTopView |
6293 | 5275 |
and:[ aView isPopUpView not ]] |
293 | 5276 |
! ! |
5277 |
||
2669
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5278 |
!DeviceWorkstation methodsFor:'event sending'! |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5279 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5280 |
sendKeyOrButtonEvent:typeSymbol x:xPos y:yPos keyOrButton:keySymCodeOrButtonNr state:stateMask toViewId:targetId |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5281 |
"send a keyPress/Release or buttonPress/Release event to some (possibly alien) view. |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5282 |
TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease. |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5283 |
For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...); |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5284 |
for key events, it can be either a symbol (as listen in X's keySyms) |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5285 |
or a numeric keysym code. If state is nil, the modifier bits (shift & control) |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5286 |
are computed from the keyboardMap - if non-nil, these are passed as modifierbits. |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5287 |
The non-nil case is the lowlevel entry, where state must include any shift/ctrl information |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5288 |
(not very user friendly)" |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5289 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5290 |
self subclassResponsibility |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5291 |
! |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5292 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5293 |
simulateKeyboardInput:aCharacterOrString inViewId:viewId |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5294 |
"send input to some other view, by simulating keyPress/keyRelease |
4350 | 5295 |
events. |
2669
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5296 |
Only a few control characters are supported. |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5297 |
Notice: not all alien views allow this kind of synthetic input; |
6296 | 5298 |
some simply ignore it." |
2669
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5299 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5300 |
|control code state| |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5301 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5302 |
aCharacterOrString isString ifTrue:[ |
6296 | 5303 |
aCharacterOrString do:[:char | |
5304 |
self simulateKeyboardInput:char inViewId:viewId |
|
5305 |
]. |
|
5306 |
^ self |
|
2669
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5307 |
]. |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5308 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5309 |
control := false. |
4075
1ab094bc6a69
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
4074
diff
changeset
|
5310 |
code := aCharacterOrString codePoint. |
2669
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5311 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5312 |
(aCharacterOrString == Character cr) ifTrue:[ |
6296 | 5313 |
code := #Return |
2669
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5314 |
] ifFalse:[ |
6296 | 5315 |
(aCharacterOrString == Character tab) ifTrue:[ |
5316 |
code := #Tab |
|
5317 |
] ifFalse:[ |
|
5318 |
(aCharacterOrString == Character esc) ifTrue:[ |
|
5319 |
code := #Escape |
|
5320 |
] |
|
5321 |
] |
|
2669
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5322 |
]. |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5323 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5324 |
control ifTrue:[ |
6296 | 5325 |
state := self ctrlModifierMask |
2669
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5326 |
]. |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5327 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5328 |
|
4350 | 5329 |
"/ the stuff below should not be needed |
2669
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5330 |
"/ (sendKeyOrButtonevent should be able to figure out things itself) |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5331 |
"/ however, on some linux systems it seems to not work correctly. |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5332 |
"/ Hopefully, this is correct ... |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5333 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5334 |
code isNumber ifTrue:[ |
6296 | 5335 |
code >= $A codePoint ifTrue:[ |
5336 |
code <= $Z codePoint ifTrue:[ |
|
5337 |
state := self shiftModifierMask |
|
5338 |
] |
|
5339 |
] |
|
2669
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5340 |
]. |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5341 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5342 |
self sendKeyOrButtonEvent:#keyPress x:0 y:0 keyOrButton:code state:state toViewId:viewId. |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5343 |
self sendKeyOrButtonEvent:#keyRelease x:0 y:0 keyOrButton:code state:state toViewId:viewId |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5344 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5345 |
" |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5346 |
sending input to some (possibly alien) view: |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5347 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5348 |
|point id| |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5349 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5350 |
point := Display pointFromUser. |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5351 |
id := Display viewIdFromPoint:point. |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5352 |
Display simulateKeyboardInput:'Hello_world' inViewId:id |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5353 |
" |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5354 |
|
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5355 |
"Modified: 11.6.1996 / 10:59:42 / cg" |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5356 |
! ! |
7754d5eddaba
event sending abstracted (partial common code for X & Win32)
Claus Gittinger <cg@exept.de>
parents:
2648
diff
changeset
|
5357 |
|
1014
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5358 |
!DeviceWorkstation methodsFor:'font helpers'! |
293 | 5359 |
|
5360 |
ascentOf:aFontId |
|
5361 |
"return the number of pixels above the base line of a font" |
|
5362 |
||
5363 |
^ self subclassResponsibility |
|
5364 |
! |
|
5365 |
||
5366 |
descentOf:aFontId |
|
5367 |
"return the number of pixels below the base line of a font" |
|
5368 |
||
5369 |
^ self subclassResponsibility |
|
5370 |
! |
|
5371 |
||
439
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5372 |
encodingOf:aFontId |
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5373 |
"return the characterEncoding of a font. |
3992 | 5374 |
Here, we assume an iso8859-1 encoding" |
5375 |
||
3994 | 5376 |
^ #'iso8859-1' |
439
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5377 |
|
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5378 |
"Created: 23.2.1996 / 00:39:06 / cg" |
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5379 |
! |
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5380 |
|
1014
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5381 |
maxAscentOf:aFontId |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5382 |
"return the number of pixels above the base line of the tallest character |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5383 |
in a font" |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5384 |
|
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5385 |
^ self subclassResponsibility |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5386 |
! |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5387 |
|
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5388 |
maxDescentOf:aFontId |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5389 |
"return the number of pixels below the base line of the tallest character |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5390 |
in a font" |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5391 |
|
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5392 |
^ self subclassResponsibility |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5393 |
! |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5394 |
|
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5395 |
maxWidthOfFont:aFontId |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5396 |
"return the width in pixels of the widest character a specific font" |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5397 |
|
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5398 |
^ self subclassResponsibility |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5399 |
! |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5400 |
|
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5401 |
minWidthOfFont:aFontId |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5402 |
"return the width in pixels of the smallest character a specific font" |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5403 |
|
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5404 |
^ self subclassResponsibility |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5405 |
! ! |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5406 |
|
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5407 |
!DeviceWorkstation methodsFor:'font stuff'! |
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5408 |
|
293 | 5409 |
facesInFamily:aFamilyName |
5410 |
"return a set of all available font faces in aFamily on this display" |
|
5411 |
||
4350 | 5412 |
^ self facesInFamily:aFamilyName filtering:nil |
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5413 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5414 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5415 |
" |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5416 |
Display facesInFamily:'times' |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5417 |
Display facesInFamily:'fixed' |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5418 |
" |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5419 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5420 |
"Modified: 27.2.1996 / 01:33:47 / cg" |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5421 |
! |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5422 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5423 |
facesInFamily:aFamilyName filtering:filterBlock |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5424 |
"return a set of all available font faces in aFamily on this display. |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5425 |
But only those matching filterBlock (if nonNil)." |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5426 |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5427 |
|fonts| |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5428 |
|
4350 | 5429 |
fonts := self fontsInFamily:aFamilyName |
6296 | 5430 |
filtering:[:f| f face notNil and:[filterBlock isNil or:[filterBlock value:f]]]. |
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5431 |
fonts size == 0 ifTrue:[^ nil]. |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5432 |
|
3419
04d77587de17
Do not return font infos as sorted collections
Stefan Vogel <sv@exept.de>
parents:
3415
diff
changeset
|
5433 |
^ fonts collect:[:descr | descr face] |
293 | 5434 |
|
5435 |
" |
|
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5436 |
Display facesInFamily:'fixed' filtering:[:f | |
6296 | 5437 |
f encoding notNil and:[f encoding startsWith:'jis']] |
293 | 5438 |
" |
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5439 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5440 |
"Created: 27.2.1996 / 01:33:25 / cg" |
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5441 |
"Modified: 29.2.1996 / 04:29:01 / cg" |
293 | 5442 |
! |
5443 |
||
2220
0db8feaf7bcf
added #flushListOfAvailableFonts for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
2181
diff
changeset
|
5444 |
flushListOfAvailableFonts |
0db8feaf7bcf
added #flushListOfAvailableFonts for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
2181
diff
changeset
|
5445 |
"flush any cached font information - dummy here, |
0db8feaf7bcf
added #flushListOfAvailableFonts for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
2181
diff
changeset
|
5446 |
but should be implemented in subclasses, which keep |
0db8feaf7bcf
added #flushListOfAvailableFonts for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
2181
diff
changeset
|
5447 |
a list of available device fonts. |
0db8feaf7bcf
added #flushListOfAvailableFonts for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
2181
diff
changeset
|
5448 |
This should be flushed, to allow update whenever new fonts |
0db8feaf7bcf
added #flushListOfAvailableFonts for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
2181
diff
changeset
|
5449 |
are installed or the system-font-path changes." |
0db8feaf7bcf
added #flushListOfAvailableFonts for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
2181
diff
changeset
|
5450 |
|
0db8feaf7bcf
added #flushListOfAvailableFonts for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
2181
diff
changeset
|
5451 |
"Created: / 4.8.1998 / 16:52:13 / cg" |
0db8feaf7bcf
added #flushListOfAvailableFonts for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
2181
diff
changeset
|
5452 |
! |
0db8feaf7bcf
added #flushListOfAvailableFonts for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
2181
diff
changeset
|
5453 |
|
293 | 5454 |
fontFamilies |
5455 |
"return a set of all available font families on this display" |
|
5456 |
||
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5457 |
^ self fontFamiliesFiltering:nil |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5458 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5459 |
" |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5460 |
Display fontFamilies |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5461 |
" |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5462 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5463 |
"Modified: 27.2.1996 / 01:31:14 / cg" |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5464 |
! |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5465 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5466 |
fontFamiliesFiltering:aFilterBlock |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5467 |
"return a set of all available font families on this display, |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5468 |
but only those matching aFilterBlock (if nonNil)." |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5469 |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5470 |
|fonts| |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5471 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5472 |
fonts := self fontsFiltering:aFilterBlock. |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5473 |
fonts size == 0 ifTrue:[^ nil]. |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5474 |
|
3834 | 5475 |
^ fonts collect:[:descr | descr family] thenSelect:[:family | family notNil] |
293 | 5476 |
|
5477 |
" |
|
4350 | 5478 |
Display fontFamiliesFiltering:[:f | |
6296 | 5479 |
f encoding notNil and:[f encoding startsWith:'jis']] |
293 | 5480 |
" |
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5481 |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5482 |
"Modified: 29.2.1996 / 04:31:51 / cg" |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5483 |
! |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5484 |
|
3478 | 5485 |
fontMetricsOf:fontId |
5486 |
"return a fonts metrics info object" |
|
5487 |
||
5488 |
|info| |
|
5489 |
||
5490 |
info := DeviceWorkstation::DeviceFontMetrics new. |
|
5491 |
info |
|
5492 |
ascent:(self ascentOf:fontId) |
|
5493 |
descent:(self descentOf:fontId) |
|
5494 |
maxAscent:(self maxAscentOf:fontId) |
|
5495 |
maxDescent:(self maxDescentOf:fontId) |
|
5496 |
minWidth:(self minWidthOfFont:fontId) |
|
5497 |
maxWidth:(self maxWidthOfFont:fontId) |
|
5498 |
avgWidth:(self widthOf:' ' inFont:fontId). |
|
5499 |
||
5500 |
^ info |
|
991 | 5501 |
! |
5502 |
||
1045
b03222053583
added query for a fonts real resolution (kludge for X)
Claus Gittinger <cg@exept.de>
parents:
1044
diff
changeset
|
5503 |
fontResolutionOf:fontId |
b03222053583
added query for a fonts real resolution (kludge for X)
Claus Gittinger <cg@exept.de>
parents:
1044
diff
changeset
|
5504 |
"return the resolution (as dpiX @ dpiY) of the font - this is usually the displays resolution, |
b03222053583
added query for a fonts real resolution (kludge for X)
Claus Gittinger <cg@exept.de>
parents:
1044
diff
changeset
|
5505 |
but due to errors in some XServer installations, some use 75dpi fonts on higher |
b03222053583
added query for a fonts real resolution (kludge for X)
Claus Gittinger <cg@exept.de>
parents:
1044
diff
changeset
|
5506 |
resolution displays and vice/versa." |
b03222053583
added query for a fonts real resolution (kludge for X)
Claus Gittinger <cg@exept.de>
parents:
1044
diff
changeset
|
5507 |
|
b03222053583
added query for a fonts real resolution (kludge for X)
Claus Gittinger <cg@exept.de>
parents:
1044
diff
changeset
|
5508 |
^ self resolution |
b03222053583
added query for a fonts real resolution (kludge for X)
Claus Gittinger <cg@exept.de>
parents:
1044
diff
changeset
|
5509 |
! |
b03222053583
added query for a fonts real resolution (kludge for X)
Claus Gittinger <cg@exept.de>
parents:
1044
diff
changeset
|
5510 |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5511 |
fontsFiltering:aFilterBlock |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5512 |
"return a set of all available font on this display, |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5513 |
but only those matching aFilterBlock (if nonNil)." |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5514 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5515 |
|allFonts fonts| |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5516 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5517 |
allFonts := self listOfAvailableFonts. |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5518 |
allFonts isNil ifTrue:[^ nil]. |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5519 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5520 |
fonts := Set new. |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5521 |
allFonts do:[:fntDescr | |
6296 | 5522 |
(aFilterBlock isNil or:[aFilterBlock value:fntDescr]) ifTrue:[ |
5523 |
fonts add:fntDescr |
|
5524 |
] |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5525 |
]. |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5526 |
^ fonts |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5527 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5528 |
" |
4350 | 5529 |
Display fontsFiltering:[:f | |
6296 | 5530 |
f encoding notNil and:[f encoding startsWith:'jis']] |
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5531 |
" |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5532 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5533 |
"Modified: 29.2.1996 / 04:30:35 / cg" |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5534 |
! |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5535 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5536 |
fontsInFamily:aFamilyName face:aFaceName filtering:filter |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5537 |
"return a set of all available fonts in aFamily/aFace on this display. |
8233 | 5538 |
But only those matching filter (if nonNil)." |
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5539 |
|
3834 | 5540 |
^ self |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5541 |
fontsFiltering:[:fntDescr | |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5542 |
(aFamilyName match:fntDescr family caseSensitive:false) |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5543 |
and:[ (aFaceName match:fntDescr face caseSensitive:false) |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5544 |
and:[ (filter isNil or:[filter value:fntDescr]) ]] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5545 |
] |
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5546 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5547 |
" |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5548 |
Display fontsInFamily:'fixed' face:'medium' filtering:[:f | |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5549 |
f encoding notNil and:[f encoding startsWith:'jis']] |
8233 | 5550 |
" |
5551 |
||
5552 |
"Created: / 29-02-1996 / 04:32:56 / cg" |
|
5553 |
"Modified: / 30-06-1997 / 11:07:21 / cg" |
|
5554 |
"Modified (comment): / 19-12-2017 / 09:20:39 / mawalch" |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5555 |
! |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5556 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5557 |
fontsInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5558 |
"return a set of all available font in aFamily/aFace/aStyle |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5559 |
on this display. |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5560 |
But only those matching filter (if nonNIl)." |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5561 |
|
3834 | 5562 |
^ self |
6296 | 5563 |
fontsFiltering:[:fntDescr | |
5564 |
(aFamilyName match:fntDescr family caseSensitive:false) |
|
5565 |
and:[ (aFaceName match:fntDescr face caseSensitive:false) |
|
5566 |
and:[ (aStyleName match:fntDescr style caseSensitive:false) |
|
5567 |
and:[ (filter isNil or:[filter value:fntDescr]) ]]] |
|
5568 |
] |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5569 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5570 |
" |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5571 |
Display fontsInFamily:'fixed' face:'medium' style:'roman' filtering:[:f | |
6296 | 5572 |
f encoding notNil and:[f encoding startsWith:'jis']] |
1796
9384026b7b20
allow matchPattern in #fontsWithFamily:*
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
5573 |
" |
9384026b7b20
allow matchPattern in #fontsWithFamily:*
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
5574 |
" |
9384026b7b20
allow matchPattern in #fontsWithFamily:*
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
5575 |
Display fontsInFamily:'fixed' face:'*' style:'roman' filtering:[:f | |
6296 | 5576 |
f encoding notNil and:[f encoding startsWith:'jis']] |
4088 | 5577 |
" |
5578 |
" |
|
5579 |
Display fontsInFamily:'courier' face:'medium' style:'roman' filtering:nil |
|
5580 |
Display fontsInFamily:'courier' face:'normal' style:'roman' filtering:nil |
|
5581 |
Display fontsInFamily:'Courier' face:'normal' style:'roman' filtering:nil |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5582 |
" |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5583 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5584 |
"Created: 29.2.1996 / 04:25:30 / cg" |
1796
9384026b7b20
allow matchPattern in #fontsWithFamily:*
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
5585 |
"Modified: 30.6.1997 / 11:07:08 / cg" |
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5586 |
! |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5587 |
|
3834 | 5588 |
fontsInFamily:aFamilyName filtering:filter |
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5589 |
"return a set of all available font in aFamily on this display. |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5590 |
But only those matching filterBlock (if nonNil)." |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5591 |
|
3834 | 5592 |
^ self |
6296 | 5593 |
fontsFiltering:[:fntDescr | |
5594 |
(aFamilyName match:fntDescr family caseSensitive:false) |
|
5595 |
and:[ (filter isNil or:[filter value:fntDescr]) ] |
|
5596 |
] |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5597 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5598 |
" |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5599 |
Display fontsInFamily:'fixed' filtering:[:f | |
6296 | 5600 |
f encoding notNil and:[f encoding startsWith:'jis']] |
1796
9384026b7b20
allow matchPattern in #fontsWithFamily:*
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
5601 |
" |
9384026b7b20
allow matchPattern in #fontsWithFamily:*
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
5602 |
" |
9384026b7b20
allow matchPattern in #fontsWithFamily:*
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
5603 |
Display fontsInFamily:'*' filtering:[:f | |
6296 | 5604 |
f encoding notNil and:[f encoding startsWith:'jis']] |
1796
9384026b7b20
allow matchPattern in #fontsWithFamily:*
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
5605 |
" |
9384026b7b20
allow matchPattern in #fontsWithFamily:*
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
5606 |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5607 |
"Created: 29.2.1996 / 04:27:49 / cg" |
1796
9384026b7b20
allow matchPattern in #fontsWithFamily:*
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
5608 |
"Modified: 30.6.1997 / 11:06:36 / cg" |
293 | 5609 |
! |
5610 |
||
3415
5318d7f58d35
Rename #fullNameOf: to #fullFontNameOf:
Stefan Vogel <sv@exept.de>
parents:
3413
diff
changeset
|
5611 |
fullFontNameOf:aFontId |
439
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5612 |
"return the full name of a font. |
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5613 |
Here, we return nil, not knowing anything about fonts" |
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5614 |
|
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5615 |
^ nil |
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5616 |
|
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5617 |
"Created: 23.2.1996 / 00:43:19 / cg" |
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5618 |
! |
9948e62438f1
dummy font encoding & fullName support
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
5619 |
|
5909
c8177fd7a890
added: #getDefaultFontWithEncoding:
Stefan Vogel <sv@exept.de>
parents:
5897
diff
changeset
|
5620 |
getDefaultFontWithEncoding:encoding |
4350 | 5621 |
"return a default font id |
5909
c8177fd7a890
added: #getDefaultFontWithEncoding:
Stefan Vogel <sv@exept.de>
parents:
5897
diff
changeset
|
5622 |
- used when class Font cannot find anything usable. |
c8177fd7a890
added: #getDefaultFontWithEncoding:
Stefan Vogel <sv@exept.de>
parents:
5897
diff
changeset
|
5623 |
Subclasses will redefine this." |
c8177fd7a890
added: #getDefaultFontWithEncoding:
Stefan Vogel <sv@exept.de>
parents:
5897
diff
changeset
|
5624 |
|
c8177fd7a890
added: #getDefaultFontWithEncoding:
Stefan Vogel <sv@exept.de>
parents:
5897
diff
changeset
|
5625 |
"For backward compatibility..." |
c8177fd7a890
added: #getDefaultFontWithEncoding:
Stefan Vogel <sv@exept.de>
parents:
5897
diff
changeset
|
5626 |
^ self getDefaultFont |
293 | 5627 |
! |
5628 |
||
5218
8f370f30a6e5
getFont...pixelSize... for backward compatibility
Claus Gittinger <cg@exept.de>
parents:
5217
diff
changeset
|
5629 |
getFontWithFamily:familyString face:faceString style:styleString pixelSize:sizeArg encoding:encodingSym |
8f370f30a6e5
getFont...pixelSize... for backward compatibility
Claus Gittinger <cg@exept.de>
parents:
5217
diff
changeset
|
5630 |
"try to get the specified font, return id. |
8f370f30a6e5
getFont...pixelSize... for backward compatibility
Claus Gittinger <cg@exept.de>
parents:
5217
diff
changeset
|
5631 |
If not available, try next smaller font. |
8f370f30a6e5
getFont...pixelSize... for backward compatibility
Claus Gittinger <cg@exept.de>
parents:
5217
diff
changeset
|
5632 |
If no font fits, return nil" |
8f370f30a6e5
getFont...pixelSize... for backward compatibility
Claus Gittinger <cg@exept.de>
parents:
5217
diff
changeset
|
5633 |
|
8f370f30a6e5
getFont...pixelSize... for backward compatibility
Claus Gittinger <cg@exept.de>
parents:
5217
diff
changeset
|
5634 |
"/ for backward comaptibility - will vanish |
5610 | 5635 |
^ self |
6296 | 5636 |
getFontWithFamily:familyString |
5637 |
face:faceString |
|
5638 |
style:styleString |
|
5639 |
size:sizeArg |
|
5640 |
sizeUnit:#px |
|
5641 |
encoding:encodingSym |
|
5218
8f370f30a6e5
getFont...pixelSize... for backward compatibility
Claus Gittinger <cg@exept.de>
parents:
5217
diff
changeset
|
5642 |
! |
8f370f30a6e5
getFont...pixelSize... for backward compatibility
Claus Gittinger <cg@exept.de>
parents:
5217
diff
changeset
|
5643 |
|
5187 | 5644 |
getFontWithFamily:familyString face:faceString style:styleString size:sizeArg encoding:encodingSym |
5162 | 5645 |
"try to get the specified font, return id. |
5646 |
If not available, try next smaller font. |
|
5647 |
If no font fits, return nil" |
|
5648 |
||
5610 | 5649 |
^ self |
6296 | 5650 |
getFontWithFamily:familyString |
5651 |
face:faceString |
|
5652 |
style:styleString |
|
5653 |
size:sizeArg |
|
5654 |
sizeUnit:#pt |
|
5655 |
encoding:encodingSym |
|
5162 | 5656 |
! |
5657 |
||
5187 | 5658 |
getFontWithFamily:familyString face:faceString style:styleString size:sizeArg sizeUnit:sizeUnit encoding:encodingSym |
293 | 5659 |
"try to get the specified font, return id. |
4350 | 5660 |
If not available, try next smaller font. |
293 | 5661 |
If no font fits, return nil" |
5662 |
||
5663 |
^ self subclassResponsibility |
|
5664 |
! |
|
5665 |
||
5980 | 5666 |
heightOf:aString from:index1 to:index2 inFont:aFontId |
5667 |
"return the width in pixels of a substring in a specific font" |
|
5668 |
||
5669 |
^ self subclassResponsibility |
|
5670 |
! |
|
5671 |
||
5672 |
heightOf:aString inFont:aFontId |
|
5673 |
"return the width in pixels of a string in a specific font" |
|
5674 |
||
5675 |
|sz| |
|
5676 |
||
5677 |
sz := aString size. |
|
5678 |
sz == 0 ifTrue:[ |
|
6296 | 5679 |
^ 0. |
5980 | 5680 |
]. |
5681 |
^ self heightOf:aString from:1 to:sz inFont:aFontId |
|
5682 |
! |
|
5683 |
||
293 | 5684 |
listOfAvailableFonts |
5685 |
"return a list containing all fonts on this display. |
|
5509
fe84ac005fbc
comment/format in: #listOfAvailableFonts
Stefan Vogel <sv@exept.de>
parents:
5339
diff
changeset
|
5686 |
The returned list is an array of FontDescriptions." |
293 | 5687 |
|
535 | 5688 |
^ self subclassResponsibility |
293 | 5689 |
! |
5690 |
||
5168 | 5691 |
pixelSizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filterBlock |
5692 |
"return a set of all available pixel sizes in aFamily/aFace/aStyle on this display. |
|
5693 |
But only those matching filterBlock (if notNil)." |
|
5694 |
||
5695 |
|fonts| |
|
5696 |
||
5610 | 5697 |
fonts := self |
6296 | 5698 |
fontsInFamily:aFamilyName face:aFaceName style:aStyleName |
5699 |
filtering:[:f | |
|
5700 |
f size notNil |
|
5701 |
and:[filterBlock isNil or:[filterBlock value:f]] |
|
5702 |
]. |
|
5168 | 5703 |
fonts size == 0 ifTrue:[^ nil]. |
5704 |
||
6103 | 5705 |
^ fonts collect:[:descr | descr pixelSize "height"] thenSelect:[:pixelSize| pixelSize notNil]. |
5168 | 5706 |
|
5707 |
" |
|
5610 | 5708 |
Display |
6296 | 5709 |
pixelSizesInFamily:'fixed' face:'medium' style:'roman' |
5710 |
filtering:[:f | |
|
5711 |
f encoding notNil and:[f encoding startsWith:'jis'] |
|
5712 |
] |
|
5610 | 5713 |
|
5714 |
Display |
|
6296 | 5715 |
pixelSizesInFamily:'arial' face:'medium' style:'roman' |
5716 |
filtering:[:f | |
|
5717 |
f encoding == #'ms-ansi' |
|
5718 |
] |
|
5168 | 5719 |
" |
5720 |
||
5721 |
"Created: 27.2.1996 / 01:37:56 / cg" |
|
5722 |
"Modified: 29.2.1996 / 04:26:52 / cg" |
|
5723 |
! |
|
5724 |
||
293 | 5725 |
releaseFont:aFontId |
5726 |
"free a font" |
|
5727 |
||
5728 |
^ self subclassResponsibility |
|
5729 |
! |
|
5730 |
||
5731 |
sizesInFamily:aFamilyName face:aFaceName style:aStyleName |
|
5732 |
"return a set of all available font sizes in aFamily/aFace/aStyle |
|
5733 |
on this display" |
|
5734 |
||
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5735 |
^ self sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:nil |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5736 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5737 |
" |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5738 |
Display sizesInFamily:'times' face:'medium' style:'italic' |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5739 |
" |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5740 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5741 |
"Modified: 27.2.1996 / 01:38:42 / cg" |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5742 |
! |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5743 |
|
3419
04d77587de17
Do not return font infos as sorted collections
Stefan Vogel <sv@exept.de>
parents:
3415
diff
changeset
|
5744 |
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filterBlock |
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5745 |
"return a set of all available font sizes in aFamily/aFace/aStyle |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5746 |
on this display. |
3419
04d77587de17
Do not return font infos as sorted collections
Stefan Vogel <sv@exept.de>
parents:
3415
diff
changeset
|
5747 |
But only those matching filterBlock (if notNil)." |
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5748 |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5749 |
|fonts| |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5750 |
|
5610 | 5751 |
fonts := self |
6885 | 5752 |
fontsInFamily:aFamilyName face:aFaceName style:aStyleName |
5753 |
filtering:[:f | |
|
5754 |
(f size notNil or:[f isScaledFont]) |
|
5755 |
and:[filterBlock isNil or:[filterBlock value:f]] |
|
5756 |
]. |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5757 |
fonts size == 0 ifTrue:[^ nil]. |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5758 |
|
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5759 |
^ fonts collect:[:descr | descr size]. |
293 | 5760 |
|
5761 |
" |
|
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5762 |
Display sizesInFamily:'fixed' face:'medium' style:'roman' filtering:[:f | |
6885 | 5763 |
f encoding notNil and:[f encoding startsWith:'jis']] |
293 | 5764 |
" |
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5765 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5766 |
"Created: 27.2.1996 / 01:37:56 / cg" |
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5767 |
"Modified: 29.2.1996 / 04:26:52 / cg" |
293 | 5768 |
! |
5769 |
||
5770 |
stylesInFamily:aFamilyName face:aFaceName |
|
5771 |
"return a set of all available font styles in aFamily/aFace on this display" |
|
5772 |
||
4350 | 5773 |
^ self stylesInFamily:aFamilyName face:aFaceName filtering:nil |
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5774 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5775 |
" |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5776 |
Display stylesInFamily:'times' face:'medium' |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5777 |
Display stylesInFamily:'times' face:'bold' |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5778 |
" |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5779 |
|
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5780 |
"Modified: 27.2.1996 / 01:35:43 / cg" |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5781 |
! |
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5782 |
|
3419
04d77587de17
Do not return font infos as sorted collections
Stefan Vogel <sv@exept.de>
parents:
3415
diff
changeset
|
5783 |
stylesInFamily:aFamilyName face:aFaceName filtering:filterBlock |
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5784 |
"return a set of all available font styles in aFamily/aFace on this display. |
8233 | 5785 |
But only those matching filterBlock (if notNil)." |
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5786 |
|
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5787 |
|fonts| |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5788 |
|
4350 | 5789 |
fonts := self |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5790 |
fontsInFamily:aFamilyName face:aFaceName |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5791 |
filtering:[:f| |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5792 |
f style notNil |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5793 |
and:[filterBlock isNil or:[filterBlock value:f]] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5794 |
]. |
479
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5795 |
fonts size == 0 ifTrue:[^ nil]. |
a1ec90f1dc5c
more & better fontSelection stuff
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
5796 |
|
3419
04d77587de17
Do not return font infos as sorted collections
Stefan Vogel <sv@exept.de>
parents:
3415
diff
changeset
|
5797 |
^ fonts collect:[:descr | descr style] |
293 | 5798 |
|
5799 |
" |
|
465
731d2d077883
added filter for font-extraction methods
Claus Gittinger <cg@exept.de>
parents:
439
diff
changeset
|
5800 |
Display stylesInFamily:'fixed' face:'medium' filtering:[:f | |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5801 |
f encoding notNil and:[f encoding startsWith:'jis']] |
8233 | 5802 |
" |
5803 |
||
5804 |
"Created: / 27-02-1996 / 01:35:22 / cg" |
|
5805 |
"Modified: / 29-02-1996 / 04:33:59 / cg" |
|
5806 |
"Modified (comment): / 19-12-2017 / 09:20:43 / mawalch" |
|
293 | 5807 |
! |
5808 |
||
5809 |
widthOf:aString from:index1 to:index2 inFont:aFontId |
|
5810 |
"return the width in pixels of a substring in a specific font" |
|
5811 |
||
5812 |
^ self subclassResponsibility |
|
5813 |
! |
|
5814 |
||
5815 |
widthOf:aString inFont:aFontId |
|
5816 |
"return the width in pixels of a string in a specific font" |
|
5817 |
||
1014
6be12d5937f5
removed obsolete font access methods
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
5818 |
^ self widthOf:aString from:1 to:(aString size) inFont:aFontId |
293 | 5819 |
! ! |
5820 |
||
3177 | 5821 |
!DeviceWorkstation methodsFor:'grabbing'! |
293 | 5822 |
|
5823 |
activeKeyboardGrab |
|
5824 |
"return the view, which currently has the keyboard grabbed, |
|
5825 |
or nil, if there is none" |
|
5826 |
||
5827 |
^ activeKeyboardGrab |
|
5828 |
! |
|
5829 |
||
5830 |
activePointerGrab |
|
5831 |
"return the view, which currently has the pointer grabbed, |
|
5832 |
or nil, if there is none" |
|
5833 |
||
5834 |
^ activePointerGrab |
|
5835 |
! |
|
5836 |
||
5837 |
grabKeyboardIn:aWindowId |
|
5838 |
"grab the keyboard - all keyboard input will be sent to the view |
|
5839 |
with id aWindowId" |
|
5840 |
||
5841 |
^ self subclassResponsibility |
|
5842 |
! |
|
5843 |
||
5844 |
grabKeyboardInView:aView |
|
5845 |
"grab the keyboard - all keyboard input will be sent to aView. |
|
5846 |
Return true if ok, false if it failed for some reason." |
|
5847 |
||
7761 | 5848 |
|vid| |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5849 |
|
293 | 5850 |
activeKeyboardGrab notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5851 |
self ungrabKeyboard. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5852 |
activeKeyboardGrab := nil |
7630 | 5853 |
]. |
7761 | 5854 |
vid := aView drawableId. |
5855 |
"/ the view might be already gone... |
|
5856 |
vid notNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5857 |
(self grabKeyboardIn:vid) ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5858 |
activeKeyboardGrab := aView. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5859 |
^ true |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5860 |
]. |
293 | 5861 |
]. |
5862 |
^ false |
|
5863 |
! |
|
5864 |
||
5865 |
grabPointerIn:aWindowId |
|
5866 |
"grap the pointer; all pointer events will be reported to the view |
|
5867 |
with id aWindowId. Return true if ok, false if it failed for some reason." |
|
5868 |
||
5869 |
^ self grabPointerIn:aWindowId withCursor:nil pointerMode:#async keyboardMode:#sync confineTo:nil |
|
5870 |
! |
|
5871 |
||
5872 |
grabPointerIn:aWindowId withCursor:cursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId |
|
5873 |
"grap the pointer - all pointer events will be reported to aWindowId. The cursor will be set to cursorId |
|
5874 |
for the duration of the grab. For pMode/kMode, see X documentation. The pointer is restricted to |
|
5875 |
confineId - if non-nil." |
|
5876 |
||
5877 |
^ self subclassResponsibility |
|
5878 |
! |
|
5879 |
||
3091 | 5880 |
grabPointerIn:aWindowId withCursorId:aCursorIdOrNil |
5881 |
"grap the pointer; all pointer events will be reported to the view |
|
5882 |
with id aWindowId. Return true if ok, false if it failed for some reason." |
|
5883 |
||
5884 |
^ self grabPointerIn:aWindowId withCursor:aCursorIdOrNil pointerMode:#async keyboardMode:#sync confineTo:nil |
|
5885 |
! |
|
5886 |
||
293 | 5887 |
grabPointerInView:aView |
5888 |
"grap the pointer; all pointer events will be reported to |
|
5889 |
aView. Return true if ok, false if it failed for some reason." |
|
5890 |
||
3694 | 5891 |
^ self grabPointerInView:aView withCursor:nil |
5892 |
! |
|
5893 |
||
5894 |
grabPointerInView:aView withCursor:aCursorOrNil |
|
3091 | 5895 |
"grap the pointer; all pointer events will be reported to |
5896 |
aView. Return true if ok, false if it failed for some reason." |
|
5897 |
||
3694 | 5898 |
|cId vId ok| |
3091 | 5899 |
|
5900 |
activePointerGrab notNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5901 |
self ungrabPointer. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5902 |
activePointerGrab := nil |
7630 | 5903 |
]. |
5904 |
vId := aView drawableId. |
|
7761 | 5905 |
"/ the view might be already gone... |
5906 |
vId notNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5907 |
aCursorOrNil notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5908 |
cId := aCursorOrNil id. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5909 |
ok := self grabPointerIn:vId withCursorId:cId. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5910 |
] ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5911 |
ok := self grabPointerIn:vId. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5912 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5913 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5914 |
ok ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5915 |
activePointerGrab := aView. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5916 |
^ true |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
5917 |
]. |
3091 | 5918 |
]. |
5919 |
^ false |
|
5920 |
! |
|
5921 |
||
293 | 5922 |
setActivePointerGrab:aView |
5923 |
"DO NOT USE. private kludge - will vanish" |
|
5924 |
||
5925 |
activePointerGrab := aView |
|
5926 |
! |
|
5927 |
||
5928 |
ungrabKeyboard |
|
5929 |
"release the keyboard" |
|
5930 |
||
5931 |
^ self subclassResponsibility |
|
5932 |
! |
|
5933 |
||
5934 |
ungrabPointer |
|
5935 |
"release the pointer" |
|
5936 |
||
5937 |
^ self subclassResponsibility |
|
5938 |
! ! |
|
5939 |
||
5940 |
!DeviceWorkstation methodsFor:'graphic context stuff'! |
|
5941 |
||
1710
df5f8609825d
win changes (pass drawableId to clip methods)
Claus Gittinger <cg@exept.de>
parents:
1708
diff
changeset
|
5942 |
noClipIn:aDrawableId gc:aGCId |
293 | 5943 |
"disable clipping rectangle" |
5944 |
||
5945 |
^ self subclassResponsibility |
|
5946 |
! |
|
5947 |
||
5948 |
setBackground:bgColorIndex in:aGCId |
|
3528 | 5949 |
"set background color-index to be drawn with" |
293 | 5950 |
|
5951 |
^ self subclassResponsibility |
|
5952 |
! |
|
5953 |
||
3597
322d40d45f02
fix #setForegroundColor: ans setBackgroundColor: for non-device colors
Stefan Vogel <sv@exept.de>
parents:
3572
diff
changeset
|
5954 |
setBackgroundColor:color in:aGCId |
3528 | 5955 |
"set background color to be drawn with" |
5956 |
||
5957 |
|colorId deviceColor| |
|
5958 |
||
3597
322d40d45f02
fix #setForegroundColor: ans setBackgroundColor: for non-device colors
Stefan Vogel <sv@exept.de>
parents:
3572
diff
changeset
|
5959 |
(color isOnDevice:self) ifTrue:[ |
7450 | 5960 |
colorId := color colorId. |
3597
322d40d45f02
fix #setForegroundColor: ans setBackgroundColor: for non-device colors
Stefan Vogel <sv@exept.de>
parents:
3572
diff
changeset
|
5961 |
] ifFalse:[ |
7450 | 5962 |
deviceColor := color onDevice:self. |
5963 |
deviceColor notNil ifTrue:[ |
|
5964 |
colorId := deviceColor colorId. |
|
5965 |
] |
|
3528 | 5966 |
]. |
5967 |
colorId isNil ifTrue:[ |
|
7450 | 5968 |
Logger warning:'could not set bg color'. |
3528 | 5969 |
] ifFalse:[ |
7450 | 5970 |
self setBackground:colorId in:aGCId. |
3528 | 5971 |
] |
5972 |
! |
|
5973 |
||
293 | 5974 |
setBitmapMask:aBitmapId in:aGCId |
5975 |
"set or clear the drawing mask - a bitmap mask using current fg/bg" |
|
5976 |
||
5977 |
^ self subclassResponsibility |
|
5978 |
! |
|
5979 |
||
1682 | 5980 |
setClipByChildren:aBool in:aDrawableID gc:aGCId |
293 | 5981 |
"enable/disable drawing into child views" |
5982 |
||
5983 |
^ self subclassResponsibility |
|
5984 |
! |
|
5985 |
||
1710
df5f8609825d
win changes (pass drawableId to clip methods)
Claus Gittinger <cg@exept.de>
parents:
1708
diff
changeset
|
5986 |
setClipX:clipX y:clipY width:clipWidth height:clipHeight in:drawableId gc:aGCId |
293 | 5987 |
"clip to a rectangle" |
5988 |
||
5989 |
^ self subclassResponsibility |
|
5990 |
! |
|
5991 |
||
787 | 5992 |
setDashes:dashList dashOffset:offset in:aGCId |
5993 |
"set dash attributes. |
|
5994 |
Ignored here - it may be left unimplemented by some devices." |
|
5995 |
||
5996 |
^ self subclassResponsibility |
|
5997 |
||
5998 |
"Created: 4.6.1996 / 18:50:38 / cg" |
|
5999 |
"Modified: 4.6.1996 / 19:05:22 / cg" |
|
6000 |
! |
|
6001 |
||
293 | 6002 |
setFont:aFontId in:aGCId |
6003 |
"set font to be drawn in" |
|
6004 |
||
6005 |
^ self subclassResponsibility |
|
6006 |
! |
|
6007 |
||
8003 | 6008 |
setForeground:fgColorIndex background:bgColorIndex function:blitOpSymbol in:aGCId |
6009 |
"set foreground and background color-indices and blit-function to be drawn with" |
|
6010 |
||
6011 |
self setForeground:fgColorIndex background:bgColorIndex in:aGCId. |
|
6012 |
self setFunction:blitOpSymbol in:aGCId. |
|
6013 |
||
6014 |
"Created: / 11-04-2017 / 16:37:19 / cg" |
|
6015 |
! |
|
6016 |
||
293 | 6017 |
setForeground:fgColorIndex background:bgColorIndex in:aGCId |
3528 | 6018 |
"set foreground and background color-indices to be drawn with" |
6019 |
||
6020 |
self setForeground:fgColorIndex in:aGCId. |
|
6021 |
self setBackground:bgColorIndex in:aGCId. |
|
293 | 6022 |
! |
6023 |
||
6024 |
setForeground:fgColorIndex in:aGCId |
|
3528 | 6025 |
"set the foreground color-index to be drawn with" |
293 | 6026 |
|
6027 |
^ self subclassResponsibility |
|
6028 |
! |
|
6029 |
||
3528 | 6030 |
setForegroundColor:fgColor backgroundColor:bgColor in:aGCId |
6031 |
"set foreground and background colors to be drawn with" |
|
6032 |
||
6033 |
self setForegroundColor:fgColor in:aGCId. |
|
6034 |
self setBackgroundColor:bgColor in:aGCId. |
|
6035 |
! |
|
6036 |
||
3597
322d40d45f02
fix #setForegroundColor: ans setBackgroundColor: for non-device colors
Stefan Vogel <sv@exept.de>
parents:
3572
diff
changeset
|
6037 |
setForegroundColor:color in:aGCId |
3528 | 6038 |
"set the foreground color to be drawn with" |
6039 |
||
6040 |
|colorId deviceColor| |
|
6041 |
||
3597
322d40d45f02
fix #setForegroundColor: ans setBackgroundColor: for non-device colors
Stefan Vogel <sv@exept.de>
parents:
3572
diff
changeset
|
6042 |
(color isOnDevice:self) ifTrue:[ |
7450 | 6043 |
colorId := color colorId. |
3597
322d40d45f02
fix #setForegroundColor: ans setBackgroundColor: for non-device colors
Stefan Vogel <sv@exept.de>
parents:
3572
diff
changeset
|
6044 |
] ifFalse:[ |
7450 | 6045 |
deviceColor := color onDevice:self. |
6046 |
deviceColor notNil ifTrue:[ |
|
6047 |
colorId := deviceColor colorId. |
|
6048 |
] |
|
3528 | 6049 |
]. |
6050 |
colorId isNil ifTrue:[ |
|
7450 | 6051 |
Logger warning:'could not set fg color'. |
3528 | 6052 |
] ifFalse:[ |
7450 | 6053 |
self setForeground:colorId in:aGCId. |
3528 | 6054 |
] |
6055 |
! |
|
6056 |
||
293 | 6057 |
setFunction:aFunctionSymbol in:aGCId |
8299 | 6058 |
"set alu function to be drawn with. |
6059 |
functionSymbol is one of: |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6060 |
#copy,#copyInverted,#xor,#and,#andReverse |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6061 |
#andInverted,#or,#orReverse,#orInverted |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6062 |
#invert,#clear,#set,#noop,#equiv,#nand |
8299 | 6063 |
" |
293 | 6064 |
|
6065 |
^ self subclassResponsibility |
|
6066 |
! |
|
6067 |
||
6068 |
setGraphicsExposures:aBoolean in:aGCId |
|
6069 |
"set or clear the graphics exposures flag" |
|
6070 |
||
6071 |
^ self subclassResponsibility |
|
6072 |
! |
|
6073 |
||
6074 |
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId |
|
6075 |
"set line attributes" |
|
6076 |
||
6077 |
^ self subclassResponsibility |
|
6078 |
! |
|
6079 |
||
6080 |
setMaskOriginX:orgX y:orgY in:aGCid |
|
6081 |
"set the mask origin" |
|
6082 |
||
6083 |
^ self subclassResponsibility |
|
6084 |
! |
|
6085 |
||
6086 |
setPixmapMask:aPixmapId in:aGCId |
|
6087 |
"set or clear the drawing mask - a pixmap mask providing full color" |
|
6088 |
||
6089 |
^ self subclassResponsibility |
|
6090 |
! ! |
|
6091 |
||
5632 | 6092 |
!DeviceWorkstation methodsFor:'hooks'! |
6093 |
||
6094 |
addModalWindowListener:aListener |
|
6095 |
aboutToOpenModalWindowHooks isNil ifTrue:[ |
|
6296 | 6096 |
aboutToOpenModalWindowHooks := IdentitySet new. |
5632 | 6097 |
]. |
6098 |
aboutToOpenModalWindowHooks add:aListener |
|
6099 |
||
6100 |
"Created: / 24-10-2010 / 14:57:39 / cg" |
|
6101 |
! |
|
6102 |
||
6103 |
addNonModalWindowListener:aListener |
|
6104 |
aboutToOpenNonModalWindowHooks isNil ifTrue:[ |
|
6296 | 6105 |
aboutToOpenNonModalWindowHooks := IdentitySet new. |
5632 | 6106 |
]. |
6107 |
aboutToOpenNonModalWindowHooks add:aListener |
|
6108 |
||
6109 |
"Created: / 24-10-2010 / 14:58:13 / cg" |
|
6110 |
! |
|
6111 |
||
6112 |
addSelectionHandler:someone |
|
6113 |
"ignored here" |
|
6114 |
! |
|
6115 |
||
6116 |
modalWindowListenersDo:aBlock |
|
6117 |
aboutToOpenModalWindowHooks notNil ifTrue:[ |
|
6296 | 6118 |
aboutToOpenModalWindowHooks do:aBlock |
5632 | 6119 |
]. |
6120 |
||
5634 | 6121 |
" |
6122 |
aboutToOpenModalWindowHooks := nil |
|
6123 |
" |
|
6124 |
||
5632 | 6125 |
"Created: / 24-10-2010 / 14:58:40 / cg" |
6126 |
! |
|
6127 |
||
6128 |
nonModalWindowListenersDo:aBlock |
|
6129 |
aboutToOpenNonModalWindowHooks notNil ifTrue:[ |
|
6296 | 6130 |
aboutToOpenNonModalWindowHooks do:aBlock |
5632 | 6131 |
]. |
6132 |
||
6133 |
"Created: / 24-10-2010 / 14:58:43 / cg" |
|
6134 |
! |
|
6135 |
||
6136 |
removeModalWindowListener:aListener |
|
5633 | 6137 |
aboutToOpenModalWindowHooks notNil ifTrue:[ |
6296 | 6138 |
aboutToOpenModalWindowHooks remove:aListener ifAbsent:[]. |
6139 |
aboutToOpenModalWindowHooks := aboutToOpenModalWindowHooks asNilIfEmpty. |
|
5633 | 6140 |
] |
5632 | 6141 |
|
6142 |
"Created: / 24-10-2010 / 14:58:02 / cg" |
|
6143 |
! |
|
6144 |
||
6145 |
removeNonModalWindowListener:aListener |
|
5633 | 6146 |
aboutToOpenNonModalWindowHooks notNil ifTrue:[ |
6296 | 6147 |
aboutToOpenNonModalWindowHooks remove:aListener ifAbsent:[]. |
6148 |
aboutToOpenNonModalWindowHooks := aboutToOpenNonModalWindowHooks asNilIfEmpty. |
|
5633 | 6149 |
] |
5632 | 6150 |
|
6151 |
"Created: / 24-10-2010 / 14:58:19 / cg" |
|
6152 |
! |
|
6153 |
||
6154 |
removeSelectionHandler:someone |
|
6155 |
"ignored here" |
|
6285 | 6156 |
! |
6157 |
||
6158 |
withoutExitingOnLastCloseDo:aBlock |
|
6159 |
"evaluate a block, but do not exit when the last view is closed. |
|
6160 |
This is used when an operation is to be performed, which possibly |
|
6161 |
leads to a temporary no-more-windows-open situation. |
|
6162 |
Concrete: when reopening a launcher" |
|
6163 |
||
6164 |
|sav| |
|
6165 |
||
6166 |
sav := exitOnLastClose. |
|
6167 |
exitOnLastClose := false. |
|
6168 |
aBlock ensure:[ exitOnLastClose := sav ]. |
|
5632 | 6169 |
! ! |
6170 |
||
3883 | 6171 |
!DeviceWorkstation methodsFor:'initialization & release'! |
0 | 6172 |
|
1973 | 6173 |
brokenConnection |
6174 |
"the connection to the display device was lost." |
|
6175 |
||
3770 | 6176 |
dispatching ifTrue:[ |
7450 | 6177 |
Logger info:'finished dispatch (broken connection): %1' with:self. |
6178 |
dispatching := false. |
|
3770 | 6179 |
]. |
3208 | 6180 |
self emergencyCloseConnection. |
1973 | 6181 |
displayId := nil. |
6182 |
||
2924
9b42e9bafdf7
Forget about cached Displays (cg)
Stefan Vogel <sv@exept.de>
parents:
2922
diff
changeset
|
6183 |
LastActiveScreen == self ifTrue:[ |
7450 | 6184 |
LastActiveScreen := nil. |
6185 |
LastActiveProcess := nil. |
|
4641
448cfd73ba35
Release applicatons when top views are closed.
Stefan Vogel <sv@exept.de>
parents:
4639
diff
changeset
|
6186 |
]. |
448cfd73ba35
Release applicatons when top views are closed.
Stefan Vogel <sv@exept.de>
parents:
4639
diff
changeset
|
6187 |
|
448cfd73ba35
Release applicatons when top views are closed.
Stefan Vogel <sv@exept.de>
parents:
4639
diff
changeset
|
6188 |
"/ tell all of my top views about this. |
448cfd73ba35
Release applicatons when top views are closed.
Stefan Vogel <sv@exept.de>
parents:
4639
diff
changeset
|
6189 |
|
448cfd73ba35
Release applicatons when top views are closed.
Stefan Vogel <sv@exept.de>
parents:
4639
diff
changeset
|
6190 |
self allTopViews do:[:eachTopView | |
7450 | 6191 |
|wg sensor model| |
6192 |
||
6193 |
"notice: we must manually wakeup the windowGroup process here |
|
6194 |
(it might be waiting on an event, |
|
6195 |
and the destroy below is executed by another thread. |
|
6196 |
Otherwise, the windowGroup process would |
|
6197 |
not terminate itself in this case." |
|
6198 |
||
6199 |
(wg := eachTopView windowGroup) notNil ifTrue:[ |
|
6200 |
sensor := wg sensor |
|
6201 |
]. |
|
6202 |
eachTopView destroyed. |
|
6203 |
||
6204 |
"the #destroyed above should release the application model - but is doesn't |
|
6205 |
yet (2006-10) - so we do it here" |
|
6206 |
model := eachTopView model. |
|
6207 |
model notNil ifTrue:[ |
|
6208 |
model release. |
|
6209 |
]. |
|
6210 |
sensor notNil ifTrue:[ |
|
6211 |
sensor eventSemaphore signal. |
|
6212 |
]. |
|
1973 | 6213 |
]. |
6214 |
||
6215 |
self releaseDeviceResources. |
|
6216 |
||
3148
909a1c3c2953
brokenConnection: wakeup the wGroup process to allow it detecting
Claus Gittinger <cg@exept.de>
parents:
3147
diff
changeset
|
6217 |
"Modified: / 19.1.2000 / 10:36:02 / cg" |
1973 | 6218 |
! |
6219 |
||
293 | 6220 |
close |
3555
6ff09db833b0
terminate event process, when closed.
Claus Gittinger <cg@exept.de>
parents:
3529
diff
changeset
|
6221 |
"close down connection to Display - usually never done for the main screen" |
293 | 6222 |
|
1196 | 6223 |
self releaseDeviceResources. |
1194
b38e3cbe03b2
splitted close into #closeConnection and resource releasing #close.
Claus Gittinger <cg@exept.de>
parents:
1192
diff
changeset
|
6224 |
self closeConnection. |
7670 | 6225 |
self == Display ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6226 |
Display := nil. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6227 |
]. |
3770 | 6228 |
dispatching ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6229 |
Logger info:'finished dispatch (close): %1' with:self. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6230 |
dispatching := false. |
3770 | 6231 |
]. |
3565 | 6232 |
dispatchProcess notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6233 |
dispatchProcess terminate. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6234 |
]. |
1194
b38e3cbe03b2
splitted close into #closeConnection and resource releasing #close.
Claus Gittinger <cg@exept.de>
parents:
1192
diff
changeset
|
6235 |
|
b38e3cbe03b2
splitted close into #closeConnection and resource releasing #close.
Claus Gittinger <cg@exept.de>
parents:
1192
diff
changeset
|
6236 |
"Modified: 13.1.1997 / 22:13:18 / cg" |
b38e3cbe03b2
splitted close into #closeConnection and resource releasing #close.
Claus Gittinger <cg@exept.de>
parents:
1192
diff
changeset
|
6237 |
! |
b38e3cbe03b2
splitted close into #closeConnection and resource releasing #close.
Claus Gittinger <cg@exept.de>
parents:
1192
diff
changeset
|
6238 |
|
b38e3cbe03b2
splitted close into #closeConnection and resource releasing #close.
Claus Gittinger <cg@exept.de>
parents:
1192
diff
changeset
|
6239 |
closeConnection |
b38e3cbe03b2
splitted close into #closeConnection and resource releasing #close.
Claus Gittinger <cg@exept.de>
parents:
1192
diff
changeset
|
6240 |
"close down connection to Display - usually never done" |
b38e3cbe03b2
splitted close into #closeConnection and resource releasing #close.
Claus Gittinger <cg@exept.de>
parents:
1192
diff
changeset
|
6241 |
|
293 | 6242 |
^ self subclassResponsibility |
1194
b38e3cbe03b2
splitted close into #closeConnection and resource releasing #close.
Claus Gittinger <cg@exept.de>
parents:
1192
diff
changeset
|
6243 |
|
b38e3cbe03b2
splitted close into #closeConnection and resource releasing #close.
Claus Gittinger <cg@exept.de>
parents:
1192
diff
changeset
|
6244 |
"Created: 13.1.1997 / 22:10:07 / cg" |
293 | 6245 |
! |
6246 |
||
3014 | 6247 |
emergencyCloseConnection |
6248 |
"close down connection to the Display in case of emergency; |
|
6249 |
this is usually invoked after an error and should not try to flush |
|
6250 |
any outstanding graphics requests - usually never done" |
|
6251 |
||
6252 |
^ self close |
|
6253 |
||
6254 |
"Created: 13.1.1997 / 22:10:07 / cg" |
|
6255 |
! |
|
6256 |
||
2818
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
6257 |
exitOnLastClose:aBoolean |
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
6258 |
"set/clear the flag which controls if the |
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
6259 |
event dispatching should stop when the last view is closed." |
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
6260 |
|
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
6261 |
self == Display ifTrue:[ |
6296 | 6262 |
ExitOnLastClose := aBoolean |
6263 |
]. |
|
6264 |
exitOnLastClose := aBoolean. |
|
2818
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
6265 |
|
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
6266 |
"Modified: 23.4.1996 / 22:01:28 / cg" |
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
6267 |
! |
d5453b85243d
added an exitOnLastClose instVar flag. (smc requirement)
Claus Gittinger <cg@exept.de>
parents:
2793
diff
changeset
|
6268 |
|
3831 | 6269 |
initializeDefaultKeyboardMappingsIn:aKeyboardMap |
8316 | 6270 |
"this is called to pre-initialize a new keyboard map. |
6271 |
Usually, a real mapping comes from the keyboard.rc startup file, |
|
6272 |
but here, some mappings are defined in case the keyboard.rc file is |
|
6273 |
missing (i.e. for standalone programs which have not been deployed correctly)" |
|
6274 |
||
3831 | 6275 |
aKeyboardMap bindValue:#Copy to:#Cmdc. "copy selection to buffer" |
6276 |
aKeyboardMap bindValue:#Cut to:#Cmdx. "cut selection into buffer" |
|
6277 |
aKeyboardMap bindValue:#Paste to:#Cmdv. "paste buffer or external selection" |
|
6278 |
||
6279 |
aKeyboardMap bindValue:#UserInterrupt to:#Ctrlc. "interrupt window process" |
|
6280 |
! |
|
6281 |
||
2861
098094668b4b
moved some init stuff from XWorkstat to here
Claus Gittinger <cg@exept.de>
parents:
2859
diff
changeset
|
6282 |
initializeDefaultValues |
2866 | 6283 |
isSlow := false. |
6284 |
motionEventCompression := true. |
|
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
6285 |
buttonTranslation isNil ifTrue:[ |
6296 | 6286 |
buttonTranslation := ButtonTranslation. |
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
6287 |
]. |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
6288 |
multiClickTimeDelta isNil ifTrue:[ |
6296 | 6289 |
multiClickTimeDelta := MultiClickTimeDelta. |
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
6290 |
]. |
2867 | 6291 |
shiftDown := false. |
6292 |
ctrlDown := false. |
|
6293 |
metaDown := false. |
|
6294 |
altDown := false. |
|
6295 |
||
2861
098094668b4b
moved some init stuff from XWorkstat to here
Claus Gittinger <cg@exept.de>
parents:
2859
diff
changeset
|
6296 |
self initializeModifierMappings |
098094668b4b
moved some init stuff from XWorkstat to here
Claus Gittinger <cg@exept.de>
parents:
2859
diff
changeset
|
6297 |
! |
098094668b4b
moved some init stuff from XWorkstat to here
Claus Gittinger <cg@exept.de>
parents:
2859
diff
changeset
|
6298 |
|
1196 | 6299 |
initializeDeviceResources |
6300 |
"initialize heavily used device resources - to avoid looking them up later" |
|
6301 |
||
1623 | 6302 |
blackColor isNil ifTrue:[ |
6296 | 6303 |
blackColor := Color black onDevice:self. |
6304 |
whiteColor := Color white onDevice:self. |
|
6305 |
Color getPrimaryColorsOn:self. |
|
1623 | 6306 |
] |
1369 | 6307 |
|
6308 |
"Modified: 24.2.1997 / 22:07:50 / cg" |
|
1196 | 6309 |
! |
6310 |
||
2855
f1fca530bab1
moved signal creation up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
2854
diff
changeset
|
6311 |
initializeDeviceSignals |
2983 | 6312 |
deviceErrorSignal := DeviceErrorSignal newSignal. |
2855
f1fca530bab1
moved signal creation up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
2854
diff
changeset
|
6313 |
deviceErrorSignal nameClass:self message:#deviceErrorSignal. |
2983 | 6314 |
deviceIOErrorSignal := DeviceIOErrorSignal newSignal. |
2855
f1fca530bab1
moved signal creation up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
2854
diff
changeset
|
6315 |
deviceIOErrorSignal nameClass:self message:#deviceIOErrorSignal. |
f1fca530bab1
moved signal creation up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
2854
diff
changeset
|
6316 |
! |
f1fca530bab1
moved signal creation up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
2854
diff
changeset
|
6317 |
|
0 | 6318 |
initializeFor:aDisplayOrNilForAny |
6319 |
"initialize the receiver for a connection to a display. If the |
|
6320 |
argument is non-nil, it should specify which workstation should be |
|
6321 |
connected to (in a device specific manner). For X displays, this is |
|
6322 |
to be the display-string i.e. hostname:displayNr. |
|
6323 |
If the argument is nil, connect to the default display." |
|
6324 |
||
71 | 6325 |
^ self subclassResponsibility |
0 | 6326 |
! |
6327 |
||
293 | 6328 |
initializeKeyboardMap |
6329 |
"keystrokes from the server are translated via the keyboard map. |
|
6330 |
Untranslated keystrokes arrive either as characters, or symbols |
|
6331 |
(which are the keySyms as symbol). The mapping table which is |
|
6332 |
setup here, is used in sendKeyPress:... later. |
|
2876
dbe1454f8539
allow for a device to suppress shadowViews.
Claus Gittinger <cg@exept.de>
parents:
2875
diff
changeset
|
6333 |
Here, an empty (no-translation) keyboard map is setup initially; |
dbe1454f8539
allow for a device to suppress shadowViews.
Claus Gittinger <cg@exept.de>
parents:
2875
diff
changeset
|
6334 |
this is usually filled via the keyboard.rc startup file. |
293 | 6335 |
" |
6336 |
||
6337 |
keyboardMap isNil ifTrue:[ |
|
6296 | 6338 |
keyboardMap := KeyboardMap new. |
6339 |
self initializeDefaultKeyboardMappingsIn:keyboardMap |
|
293 | 6340 |
]. |
6341 |
||
6342 |
" |
|
6343 |
no more setup here - moved everything out into 'display.rc' file |
|
6344 |
" |
|
0 | 6345 |
! |
6346 |
||
2861
098094668b4b
moved some init stuff from XWorkstat to here
Claus Gittinger <cg@exept.de>
parents:
2859
diff
changeset
|
6347 |
initializeModifierMappings |
098094668b4b
moved some init stuff from XWorkstat to here
Claus Gittinger <cg@exept.de>
parents:
2859
diff
changeset
|
6348 |
shiftModifiers := ctrlModifiers := altModifiers := metaModifiers := nil. |
098094668b4b
moved some init stuff from XWorkstat to here
Claus Gittinger <cg@exept.de>
parents:
2859
diff
changeset
|
6349 |
|
098094668b4b
moved some init stuff from XWorkstat to here
Claus Gittinger <cg@exept.de>
parents:
2859
diff
changeset
|
6350 |
shiftModifiers := #(Shift_L Shift_R Shift). |
098094668b4b
moved some init stuff from XWorkstat to here
Claus Gittinger <cg@exept.de>
parents:
2859
diff
changeset
|
6351 |
ctrlModifiers := #(Control_L Control_R Control). |
4400 | 6352 |
metaModifiers := #(Meta_L Meta_R Meta). |
6353 |
altModifiers := #(Alt_L Alt_R Alt). |
|
6354 |
||
6355 |
" |
|
6356 |
Display initializeModifierMappings |
|
6357 |
" |
|
2861
098094668b4b
moved some init stuff from XWorkstat to here
Claus Gittinger <cg@exept.de>
parents:
2859
diff
changeset
|
6358 |
! |
098094668b4b
moved some init stuff from XWorkstat to here
Claus Gittinger <cg@exept.de>
parents:
2859
diff
changeset
|
6359 |
|
814 | 6360 |
initializeScreenProperties |
6361 |
"setup screen specific properties." |
|
6362 |
||
885
07df2e77a8fe
dont clobber the supportsDeepIcons flag
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
6363 |
supportsDeepIcons isNil ifTrue:[ |
6296 | 6364 |
supportsDeepIcons := true. |
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
6365 |
]. |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
6366 |
|
1768 | 6367 |
fixColors := fixGrayColors := ditherColors := nil. |
937
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
6368 |
numFixRed := numFixGreen := numFixBlue := 0. |
e4db13d571c0
fixColor and ditherColor stuff moved from Color
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
6369 |
|
4795
e3a73ffce640
default widthMM and heightMM
Claus Gittinger <cg@exept.de>
parents:
4779
diff
changeset
|
6370 |
widthMM := 320. |
e3a73ffce640
default widthMM and heightMM
Claus Gittinger <cg@exept.de>
parents:
4779
diff
changeset
|
6371 |
heightMM := 240. |
e3a73ffce640
default widthMM and heightMM
Claus Gittinger <cg@exept.de>
parents:
4779
diff
changeset
|
6372 |
|
e3a73ffce640
default widthMM and heightMM
Claus Gittinger <cg@exept.de>
parents:
4779
diff
changeset
|
6373 |
"Modified: / 23-07-2007 / 21:19:57 / cg" |
814 | 6374 |
! |
6375 |
||
2997 | 6376 |
initializeViewStyle |
6377 |
"late viewStyle init - if no viewStyle has been read yet." |
|
6378 |
||
5592 | 6379 |
self class currentScreenQuerySignal answer:self do:[ |
6296 | 6380 |
SimpleView styleSheet isNil ifTrue:[ |
6381 |
SimpleView readStyleSheetAndUpdateAllStyleCaches |
|
6382 |
] ifFalse:[ |
|
6383 |
"maybe some view classes have been loaded and theit styles have to |
|
6384 |
be initialized" |
|
6385 |
SimpleView updateAllStyleCaches. |
|
6386 |
]. |
|
2997 | 6387 |
]. |
6388 |
! |
|
6389 |
||
276
160e1410c537
entry to invalidate display connection during early initialization
Claus Gittinger <cg@exept.de>
parents:
261
diff
changeset
|
6390 |
invalidateConnection |
609 | 6391 |
"clear my connection handle - sent after an imageRestart to |
6392 |
forget about our previous life" |
|
6393 |
||
276
160e1410c537
entry to invalidate display connection during early initialization
Claus Gittinger <cg@exept.de>
parents:
261
diff
changeset
|
6394 |
displayId := nil |
609 | 6395 |
|
6396 |
"Modified: 24.4.1996 / 19:38:46 / cg" |
|
276
160e1410c537
entry to invalidate display connection during early initialization
Claus Gittinger <cg@exept.de>
parents:
261
diff
changeset
|
6397 |
! |
160e1410c537
entry to invalidate display connection during early initialization
Claus Gittinger <cg@exept.de>
parents:
261
diff
changeset
|
6398 |
|
6560 | 6399 |
nativeWidgets:aBoolean |
6400 |
"enable/disable native widgets on a display" |
|
6401 |
||
6402 |
"/ ignored here |
|
6403 |
! |
|
6404 |
||
0 | 6405 |
reinitialize |
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
6406 |
"historic leftover (old subclasses call super reinitialize)" |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
6407 |
! |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
6408 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
6409 |
reinitializeFor:aDisplayName |
0 | 6410 |
"reinit after snapin" |
6411 |
||
7450 | 6412 |
|prevKnownViews prevWidth prevHeight| |
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
6413 |
|
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
6414 |
"do subclass specific reinitialization" |
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
6415 |
self reinitialize. |
0 | 6416 |
|
3239 | 6417 |
blackColor notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6418 |
blackColor releaseFromDevice. |
3239 | 6419 |
]. |
6420 |
whiteColor notNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6421 |
whiteColor releaseFromDevice. |
3239 | 6422 |
]. |
2846 | 6423 |
self releaseDeviceFonts. |
2845 | 6424 |
self releaseDeviceCursors. |
6425 |
self releaseDeviceColors. |
|
414
bf996c417cc8
flush device fonts early; allow selective flushing; catch errors during reinitialize of views
Claus Gittinger <cg@exept.de>
parents:
405
diff
changeset
|
6426 |
|
0 | 6427 |
displayId := nil. |
51 | 6428 |
dispatching := false. |
151 | 6429 |
dispatchProcess := nil. |
46 | 6430 |
|
505
f939ab04e30c
only adjust geometry of views at restart if the displays dimension has changed
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
6431 |
prevWidth := width. |
f939ab04e30c
only adjust geometry of views at restart if the displays dimension has changed
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
6432 |
prevHeight := height. |
f939ab04e30c
only adjust geometry of views at restart if the displays dimension has changed
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
6433 |
|
0 | 6434 |
prevKnownViews := knownViews. |
6435 |
knownViews := nil. |
|
1267
a27c2daaea25
remember lastView/id when searching view by id - helps often
Claus Gittinger <cg@exept.de>
parents:
1258
diff
changeset
|
6436 |
lastId := nil. |
a27c2daaea25
remember lastView/id when searching view by id - helps often
Claus Gittinger <cg@exept.de>
parents:
1258
diff
changeset
|
6437 |
lastView := nil. |
0 | 6438 |
|
3630
2b2f6649c014
Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
3602
diff
changeset
|
6439 |
self initializeFor:aDisplayName. |
899
fda82596dea6
exit from image restart, if connection is refused
Claus Gittinger <cg@exept.de>
parents:
885
diff
changeset
|
6440 |
displayId isNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6441 |
^ nil |
899
fda82596dea6
exit from image restart, if connection is refused
Claus Gittinger <cg@exept.de>
parents:
885
diff
changeset
|
6442 |
]. |
0 | 6443 |
|
43 | 6444 |
" |
6445 |
first, all Forms must be recreated |
|
51 | 6446 |
(since they may be needed for view recreation as |
43 | 6447 |
background or icons) |
6448 |
" |
|
0 | 6449 |
Form reinitializeAllOn:self. |
6450 |
||
6451 |
prevKnownViews notNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6452 |
" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6453 |
first round: flush all device specific stuff |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6454 |
" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6455 |
prevKnownViews do:[:aView | |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6456 |
aView notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6457 |
aView prepareForReinit |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6458 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6459 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6460 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6461 |
" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6462 |
2nd round: all views should reinstall themself |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6463 |
on the new display |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6464 |
" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6465 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6466 |
prevKnownViews do:[:aView | |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6467 |
aView notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6468 |
"have to re-create the view" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6469 |
"abortAll is handled, but not asked for here!!" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6470 |
(UserInterrupt, AbortAllOperationRequest) catch:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6471 |
GraphicsContext drawingOnClosedDrawableSignal handle:[:ex | |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6472 |
'DeviceWorkstation [warning]: drawing attempt on closed drawable during reinit' errorPrintCR. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6473 |
ex return |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6474 |
] do:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6475 |
aView reinitialize |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6476 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6477 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6478 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6479 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6480 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6481 |
(prevWidth ~~ width |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6482 |
or:[prevHeight ~~ height]) ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6483 |
" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6484 |
3rd round: all views get a chance to handle |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6485 |
changed environment (colors, font sizes etc) |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6486 |
" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6487 |
prevKnownViews do:[:aView | |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6488 |
aView notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6489 |
aView reAdjustGeometry |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6490 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6491 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6492 |
] |
0 | 6493 |
]. |
8 | 6494 |
dispatching := false. |
505
f939ab04e30c
only adjust geometry of views at restart if the displays dimension has changed
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
6495 |
|
5715 | 6496 |
"Modified: / 09-02-2011 / 13:59:53 / cg" |
1196 | 6497 |
! |
6498 |
||
6499 |
releaseDeviceResources |
|
2837 | 6500 |
"release any cached device resources. |
6501 |
This is invoked when closed or when the display connection is broken |
|
6502 |
(i.e. be prepared to not be able to release resources regularily)" |
|
6503 |
||
4218
c483dfc16644
When closing, remove also references from cursors and cursors forms
Stefan Vogel <sv@exept.de>
parents:
4195
diff
changeset
|
6504 |
LastActiveScreen == self ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6505 |
LastActiveScreen := nil. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6506 |
LastActiveProcess := nil. |
4218
c483dfc16644
When closing, remove also references from cursors and cursors forms
Stefan Vogel <sv@exept.de>
parents:
4195
diff
changeset
|
6507 |
]. |
c483dfc16644
When closing, remove also references from cursors and cursors forms
Stefan Vogel <sv@exept.de>
parents:
4195
diff
changeset
|
6508 |
|
c483dfc16644
When closing, remove also references from cursors and cursors forms
Stefan Vogel <sv@exept.de>
parents:
4195
diff
changeset
|
6509 |
Image releaseResourcesOnDevice:self. |
7443 | 6510 |
|
4218
c483dfc16644
When closing, remove also references from cursors and cursors forms
Stefan Vogel <sv@exept.de>
parents:
4195
diff
changeset
|
6511 |
"This unregisters all the finalization handles" |
7443 | 6512 |
self releaseGraphicsContexts. |
6513 |
||
3121 | 6514 |
blackColor notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6515 |
blackColor releaseFromDevice. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6516 |
blackColor := nil. |
3121 | 6517 |
]. |
6518 |
whiteColor notNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6519 |
whiteColor releaseFromDevice. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6520 |
whiteColor := nil. |
4218
c483dfc16644
When closing, remove also references from cursors and cursors forms
Stefan Vogel <sv@exept.de>
parents:
4195
diff
changeset
|
6521 |
]. |
2837 | 6522 |
self releaseDeviceColors. |
2843
e13e0c53924a
keep registry of cursors here - no longer use a Cursor Lobby
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6523 |
self releaseDeviceCursors. |
2846 | 6524 |
self releaseDeviceFonts. |
1225
797de68f0760
release deviceResources when closing a connection
Claus Gittinger <cg@exept.de>
parents:
1219
diff
changeset
|
6525 |
|
2837 | 6526 |
focusView := activeView := rootView := lastView := nil. |
6527 |
activeKeyboardGrab := activePointerGrab := nil. |
|
6528 |
AllScreens remove:self ifAbsent:nil. |
|
6529 |
||
1231 | 6530 |
"Modified: 16.1.1997 / 19:34:11 / cg" |
133 | 6531 |
! ! |
6532 |
||
71 | 6533 |
!DeviceWorkstation methodsFor:'interactive queries'! |
6534 |
||
1843 | 6535 |
colorFromUser |
6536 |
"{ Pragma: +optSpace }" |
|
6537 |
||
6538 |
"let user specify a point on the screen (by pressing the left button), |
|
6539 |
return the color of that pixel." |
|
6540 |
||
1973 | 6541 |
|p| |
1843 | 6542 |
|
6543 |
p := self pointFromUser. |
|
4350 | 6544 |
^ self rootView colorAt:p |
1843 | 6545 |
|
6546 |
" |
|
6547 |
Display colorFromUser |
|
6548 |
" |
|
6549 |
||
6550 |
"Modified: 1.8.1997 / 20:00:41 / cg" |
|
6551 |
! |
|
6552 |
||
293 | 6553 |
originFromUser:extent |
1198 | 6554 |
"{ Pragma: +optSpace }" |
6555 |
||
293 | 6556 |
"let user specify a rectangles origin on the screen, return the rectangle. |
4350 | 6557 |
Start with initialRectangle. |
293 | 6558 |
Can be used for dragging operations." |
6559 |
||
7956 | 6560 |
|curs origin root rect prevGrab delay| |
6561 |
||
6562 |
delay := Delay forSeconds:0.05. |
|
1499 | 6563 |
curs := Cursor origin onDevice:self. |
293 | 6564 |
|
6565 |
" |
|
6566 |
just in case; wait for button to be down ... |
|
6567 |
" |
|
7956 | 6568 |
[self leftButtonPressed] whileFalse:[delay wait]. |
293 | 6569 |
|
6570 |
root := self rootView. |
|
6571 |
||
6572 |
" |
|
6573 |
grab and wait for leftButton being pressed |
|
6574 |
" |
|
6575 |
origin := self pointerPosition. |
|
6576 |
||
1722 | 6577 |
root clippedByChildren:false. |
1198 | 6578 |
root foreground:blackColor background:whiteColor. |
293 | 6579 |
|
6580 |
root xoring:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6581 |
|left right top bottom newOrigin newCorner p| |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6582 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6583 |
rect := origin extent:extent. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6584 |
root displayRectangle:rect. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6585 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6586 |
prevGrab := activePointerGrab. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6587 |
self grabPointerInView:root withCursor:curs. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6588 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6589 |
[self leftButtonPressed] whileTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6590 |
newOrigin := self pointerPosition. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6591 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6592 |
(newOrigin ~= origin) ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6593 |
root displayRectangle:rect. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6594 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6595 |
self |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6596 |
grabPointerIn:root drawableId |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6597 |
withCursor:curs id |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6598 |
pointerMode:#async |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6599 |
keyboardMode:#sync |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6600 |
confineTo:nil. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6601 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6602 |
rect := newOrigin extent:extent. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6603 |
root displayRectangle:rect. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6604 |
self disposeButtonEventsFor:nil. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6605 |
self flush. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6606 |
origin := newOrigin. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6607 |
] ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6608 |
delay wait. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6609 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6610 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6611 |
root displayRectangle:rect. |
293 | 6612 |
]. |
6613 |
||
6614 |
self ungrabPointer. |
|
3091 | 6615 |
prevGrab notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6616 |
self grabPointerInView:prevGrab. |
3091 | 6617 |
]. |
293 | 6618 |
|
6619 |
"flush all events pending on my display" |
|
6620 |
||
1722 | 6621 |
root clippedByChildren:true. |
293 | 6622 |
|
6623 |
self flush. |
|
6624 |
self disposeButtonEventsFor:nil. |
|
6625 |
||
6626 |
^ rect |
|
6627 |
||
6628 |
" |
|
6629 |
Display originFromUser:200@200 |
|
6630 |
" |
|
1198 | 6631 |
|
7956 | 6632 |
"Modified: / 18-08-1998 / 15:00:14 / cg" |
6633 |
"Modified: / 23-02-2017 / 13:27:39 / stefan" |
|
293 | 6634 |
! |
6635 |
||
6636 |
pointFromUser |
|
1198 | 6637 |
"{ Pragma: +optSpace }" |
6638 |
||
293 | 6639 |
"let user specify a point on the screen (by pressing the left button)" |
6640 |
||
6641 |
^ self pointFromUserShowing:(Cursor crossHair). |
|
6642 |
||
6643 |
" |
|
6644 |
Display pointFromUser |
|
6645 |
" |
|
1198 | 6646 |
|
6647 |
"Modified: 13.1.1997 / 22:53:05 / cg" |
|
293 | 6648 |
! |
6649 |
||
81 | 6650 |
pointFromUserShowing:aCursor |
1198 | 6651 |
"{ Pragma: +optSpace }" |
6652 |
||
81 | 6653 |
"let user specify a point on the screen (by pressing leftButton). |
6654 |
Show aCursor while waiting." |
|
6655 |
||
4895 | 6656 |
^ self |
6296 | 6657 |
pointFromUserShowing:aCursor |
6658 |
positionFeedback:nil |
|
4895 | 6659 |
|
6660 |
" |
|
6661 |
Display pointFromUserShowing:(Cursor stop) |
|
6662 |
Display pointFromUserShowing:(Cursor crossHair) |
|
6663 |
Display pointFromUserShowing:(Cursor origin) |
|
6664 |
Display pointFromUser |
|
6665 |
" |
|
6666 |
||
6667 |
"Modified: / 18.8.1998 / 15:00:19 / cg" |
|
6668 |
! |
|
6669 |
||
6670 |
pointFromUserShowing:aCursor positionFeedback:feedbackBlockOrNil |
|
6671 |
"{ Pragma: +optSpace }" |
|
6672 |
||
6673 |
"let user specify a point on the screen (by pressing leftButton). |
|
6075 | 6674 |
Show aCursor while waiting. Pressing shift or ctrl cancels the operation, |
6675 |
and aborts" |
|
4895 | 6676 |
|
7956 | 6677 |
|p prevGrab prevKbdGrab delay| |
3091 | 6678 |
|
6679 |
prevGrab := activePointerGrab. |
|
6168 | 6680 |
prevKbdGrab := activeKeyboardGrab. |
6681 |
||
23 | 6682 |
self ungrabPointer. |
3091 | 6683 |
self grabPointerInView:(self rootView) withCursor:(aCursor onDevice:self). |
5714
0d3832fcb39e
changed: #pointFromUserShowing:positionFeedback:
Claus Gittinger <cg@exept.de>
parents:
5638
diff
changeset
|
6684 |
|
7956 | 6685 |
delay := Delay forSeconds:0.05. |
5714
0d3832fcb39e
changed: #pointFromUserShowing:positionFeedback:
Claus Gittinger <cg@exept.de>
parents:
5638
diff
changeset
|
6686 |
" |
0d3832fcb39e
changed: #pointFromUserShowing:positionFeedback:
Claus Gittinger <cg@exept.de>
parents:
5638
diff
changeset
|
6687 |
wait for no leftButton... |
0d3832fcb39e
changed: #pointFromUserShowing:positionFeedback:
Claus Gittinger <cg@exept.de>
parents:
5638
diff
changeset
|
6688 |
" |
0d3832fcb39e
changed: #pointFromUserShowing:positionFeedback:
Claus Gittinger <cg@exept.de>
parents:
5638
diff
changeset
|
6689 |
[self leftButtonPressed] whileTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6690 |
delay wait. |
5714
0d3832fcb39e
changed: #pointFromUserShowing:positionFeedback:
Claus Gittinger <cg@exept.de>
parents:
5638
diff
changeset
|
6691 |
]. |
0d3832fcb39e
changed: #pointFromUserShowing:positionFeedback:
Claus Gittinger <cg@exept.de>
parents:
5638
diff
changeset
|
6692 |
|
5336
f2f56441b54c
ensure that the grab is released when unwinding from
Claus Gittinger <cg@exept.de>
parents:
5259
diff
changeset
|
6693 |
[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6694 |
self grabKeyboardInView:(self rootView). |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6695 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6696 |
" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6697 |
wait for leftButton... |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6698 |
ctrl, shift or escape terminate that operation |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6699 |
" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6700 |
[self leftButtonPressed] whileFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6701 |
(self ctrlDown or:[self shiftDown or:[activePointerGrab == nil]]) ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6702 |
AbortOperationRequest raise. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6703 |
^ nil |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6704 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6705 |
feedbackBlockOrNil notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6706 |
feedbackBlockOrNil value:(self pointerPosition) |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6707 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6708 |
delay wait. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6709 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6710 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6711 |
p := self pointerPosition. |
5336
f2f56441b54c
ensure that the grab is released when unwinding from
Claus Gittinger <cg@exept.de>
parents:
5259
diff
changeset
|
6712 |
] ensure:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6713 |
self ungrabKeyboard. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6714 |
prevKbdGrab notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6715 |
self grabKeyboardInView:prevKbdGrab |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6716 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6717 |
self ungrabPointer. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6718 |
prevGrab notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6719 |
self grabPointerInView:prevGrab |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6720 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6721 |
"flush all events pending on myself" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6722 |
self disposeButtonEventsFor:nil. |
5336
f2f56441b54c
ensure that the grab is released when unwinding from
Claus Gittinger <cg@exept.de>
parents:
5259
diff
changeset
|
6723 |
]. |
f2f56441b54c
ensure that the grab is released when unwinding from
Claus Gittinger <cg@exept.de>
parents:
5259
diff
changeset
|
6724 |
|
23 | 6725 |
^ p |
6726 |
||
71 | 6727 |
" |
4350 | 6728 |
Display pointFromUserShowing:(Cursor stop) |
6729 |
Display pointFromUserShowing:(Cursor crossHair) |
|
6730 |
Display pointFromUserShowing:(Cursor origin) |
|
81 | 6731 |
Display pointFromUser |
6732 |
" |
|
1198 | 6733 |
|
5714
0d3832fcb39e
changed: #pointFromUserShowing:positionFeedback:
Claus Gittinger <cg@exept.de>
parents:
5638
diff
changeset
|
6734 |
"Modified: / 08-02-2011 / 21:48:08 / cg" |
7956 | 6735 |
"Modified: / 23-02-2017 / 13:28:33 / stefan" |
81 | 6736 |
! |
6737 |
||
293 | 6738 |
rectangleFromUser |
1198 | 6739 |
"{ Pragma: +optSpace }" |
6740 |
||
6168 | 6741 |
"let user specify a rectangle in the screen, return the rectangle. |
6742 |
If the user presses ESC, an AbortSignal is raised." |
|
293 | 6743 |
|
6744 |
|origin| |
|
81 | 6745 |
|
6746 |
" |
|
293 | 6747 |
get origin |
6748 |
" |
|
1499 | 6749 |
origin := self pointFromUserShowing:(Cursor origin onDevice:self). |
293 | 6750 |
|
6751 |
" |
|
6752 |
get corner |
|
6753 |
" |
|
4350 | 6754 |
^ self rectangleFromUser:(origin corner:origin). |
6755 |
||
6756 |
" |
|
6757 |
Display rectangleFromUser |
|
71 | 6758 |
" |
1198 | 6759 |
|
1499 | 6760 |
"Modified: 28.3.1997 / 16:14:44 / cg" |
23 | 6761 |
! |
6762 |
||
81 | 6763 |
rectangleFromUser:initialRectangle |
1198 | 6764 |
"{ Pragma: +optSpace }" |
6765 |
||
81 | 6766 |
"let user specify a rectangle on the screen, return the rectangle. |
4350 | 6767 |
Start with initialRectangle. |
133 | 6768 |
A helper for rectangleFromUser; can also be used for resizing operations." |
81 | 6769 |
|
1824 | 6770 |
^ self rectangleFromUser:initialRectangle keepExtent:false |
6771 |
||
6772 |
" |
|
6773 |
Display rectangleFromUser:(100@100 corner:300@300) |
|
6774 |
" |
|
6775 |
||
6776 |
"Modified: 24.7.1997 / 16:04:54 / cg" |
|
6777 |
! |
|
6778 |
||
6779 |
rectangleFromUser:initialRectangle keepExtent:keepExtent |
|
6780 |
"{ Pragma: +optSpace }" |
|
6781 |
||
6782 |
"let user specify a rectangle on the screen, return the rectangle. |
|
4350 | 6783 |
Start with initialRectangle. |
1824 | 6784 |
A helper for rectangleFromUser; can also be used for resizing operations." |
6785 |
||
7956 | 6786 |
|curs1 origin corner root rect doRegrab prevGrab delay| |
2324
a50065345df3
do not regrab under win32, when dragging a rectangleFromUser
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
6787 |
|
a50065345df3
do not regrab under win32, when dragging a rectangleFromUser
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
6788 |
"/ regrabbing leads to horrible flicker and |
a50065345df3
do not regrab under win32, when dragging a rectangleFromUser
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
6789 |
"/ events being sent to applications under the mouse. |
a50065345df3
do not regrab under win32, when dragging a rectangleFromUser
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
6790 |
"/ on windows displays. |
a50065345df3
do not regrab under win32, when dragging a rectangleFromUser
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
6791 |
doRegrab := self class ~~ WinWorkstation. |
157 | 6792 |
|
1824 | 6793 |
keepExtent ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6794 |
curs1 := Cursor origin |
4350 | 6795 |
] ifFalse:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6796 |
curs1 := Cursor corner |
1824 | 6797 |
]. |
6798 |
curs1 := curs1 onDevice:self. |
|
134 | 6799 |
root := self rootView. |
81 | 6800 |
|
6801 |
" |
|
6802 |
grab and wait for leftButton being pressed |
|
6803 |
" |
|
6804 |
origin := initialRectangle origin. |
|
6805 |
||
1722 | 6806 |
root clippedByChildren:false. |
1198 | 6807 |
root foreground:blackColor background:whiteColor. |
81 | 6808 |
|
7956 | 6809 |
delay := Delay forSeconds:0.05. |
6810 |
||
81 | 6811 |
root xoring:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6812 |
|left right top bottom newOrigin newCorner p curs| |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6813 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6814 |
keepExtent ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6815 |
corner := origin. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6816 |
rect := origin corner:corner. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6817 |
root displayRectangle:rect. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6818 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6819 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6820 |
prevGrab := activePointerGrab. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6821 |
self grabPointerInView:root withCursor:curs1. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6822 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6823 |
" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6824 |
just in case; wait for button to be down ... |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6825 |
" |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6826 |
[self leftButtonPressed] whileFalse:[delay wait]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6827 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6828 |
keepExtent ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6829 |
p := self pointerPosition. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6830 |
origin := p. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6831 |
corner := origin + initialRectangle extent. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6832 |
rect := origin corner:corner. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6833 |
root displayRectangle:rect. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6834 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6835 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6836 |
[self leftButtonPressed] whileTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6837 |
left := initialRectangle origin x. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6838 |
top := initialRectangle origin y. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6839 |
right := initialRectangle corner x. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6840 |
bottom := initialRectangle corner y. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6841 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6842 |
p := self pointerPosition. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6843 |
keepExtent ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6844 |
newOrigin := p. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6845 |
newCorner := newOrigin + initialRectangle extent. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6846 |
curs := curs1. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6847 |
] ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6848 |
p x < initialRectangle left ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6849 |
p y < initialRectangle top ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6850 |
curs := Cursor topLeft. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6851 |
left := p x. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6852 |
top := p y. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6853 |
] ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6854 |
curs := Cursor bottomLeft. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6855 |
left := p x. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6856 |
bottom := p y |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6857 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6858 |
] ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6859 |
p y < initialRectangle top ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6860 |
curs := Cursor topRight. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6861 |
right := p x. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6862 |
top := p y |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6863 |
] ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6864 |
curs := Cursor bottomRight. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6865 |
right := p x. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6866 |
bottom := p y |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6867 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6868 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6869 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6870 |
newOrigin := left @ top. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6871 |
newCorner := right @ bottom. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6872 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6873 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6874 |
((newOrigin ~= origin) or:[newCorner ~= corner]) ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6875 |
root displayRectangle:rect. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6876 |
doRegrab ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6877 |
self grabPointerInView:root withCursor:curs1. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6878 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6879 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6880 |
origin := newOrigin. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6881 |
corner := newCorner. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6882 |
rect := origin corner:corner. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6883 |
root displayRectangle:rect. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6884 |
self disposeButtonEventsFor:nil. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6885 |
self flush. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6886 |
] ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6887 |
delay wait. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6888 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6889 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6890 |
root displayRectangle:rect. |
23 | 6891 |
]. |
6892 |
||
3091 | 6893 |
|
23 | 6894 |
self ungrabPointer. |
3091 | 6895 |
prevGrab notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
6896 |
self grabPointerInView:prevGrab |
3091 | 6897 |
]. |
23 | 6898 |
|
6899 |
"flush all events pending on my display" |
|
81 | 6900 |
|
1722 | 6901 |
root clippedByChildren:true. |
81 | 6902 |
|
151 | 6903 |
self flush. |
81 | 6904 |
self disposeButtonEventsFor:nil. |
6905 |
||
6906 |
^ rect |
|
157 | 6907 |
|
6908 |
" |
|
1824 | 6909 |
Display rectangleFromUser |
157 | 6910 |
Display rectangleFromUser:(100@100 corner:300@300) |
1824 | 6911 |
Display rectangleFromUser:(100@100 corner:300@300) keepExtent:true |
6912 |
" |
|
6913 |
||
7956 | 6914 |
"Created: / 24-07-1997 / 15:26:47 / cg" |
6915 |
"Modified: / 10-09-1998 / 17:38:41 / cg" |
|
6916 |
"Modified: / 23-02-2017 / 13:30:21 / stefan" |
|
81 | 6917 |
! |
6918 |
||
293 | 6919 |
topviewFromUser |
1198 | 6920 |
"{ Pragma: +optSpace }" |
6921 |
||
293 | 6922 |
"let user specify a view on the screen; if the selected view is |
6923 |
not an ST/X view, nil is returned. |
|
6924 |
Otherwise, the topview is returned." |
|
6925 |
||
6926 |
|v| |
|
6927 |
||
6928 |
v := self viewFromUser. |
|
6929 |
v notNil ifTrue:[ |
|
6296 | 6930 |
v := v topView |
293 | 6931 |
]. |
4350 | 6932 |
^ v |
157 | 6933 |
|
6934 |
" |
|
293 | 6935 |
Display topviewFromUser |
157 | 6936 |
" |
1198 | 6937 |
|
6938 |
"Modified: 13.1.1997 / 22:53:15 / cg" |
|
190 | 6939 |
! |
6940 |
||
23 | 6941 |
viewFromUser |
1198 | 6942 |
"{ Pragma: +optSpace }" |
6943 |
||
23 | 6944 |
"let user specify a view on the screen; if the selected view is |
133 | 6945 |
not an ST/X view, nil is returned. |
6946 |
This returns the view being clicked in, which is not always a topView. |
|
6947 |
(send topView to the returned view or use topviewFromUser, |
|
6948 |
to get the topview)" |
|
23 | 6949 |
|
4350 | 6950 |
^ self viewFromPoint:(self pointFromUser) |
6951 |
||
6952 |
" |
|
6953 |
Display viewFromUser |
|
71 | 6954 |
" |
6955 |
" |
|
6956 |
|v| |
|
6957 |
v := Display viewFromUser. |
|
6958 |
v notNil ifTrue:[v topView] ifFalse:[nil] |
|
6959 |
" |
|
1198 | 6960 |
|
6961 |
"Modified: 13.1.1997 / 22:53:17 / cg" |
|
71 | 6962 |
! |
6963 |
||
293 | 6964 |
viewIdFromUser |
1198 | 6965 |
"{ Pragma: +optSpace }" |
6966 |
||
293 | 6967 |
"let user specify a view on the screen, return its window id. |
6968 |
This works even for non smalltalk views. |
|
4350 | 6969 |
This returns the id of the view being clicked in, |
293 | 6970 |
which is not always a topView." |
6971 |
||
4350 | 6972 |
^ self viewIdFromPoint:(self pointFromUser) |
6973 |
||
6974 |
" |
|
6975 |
Display viewIdFromUser |
|
71 | 6976 |
" |
293 | 6977 |
|
6978 |
"Created: 18.9.1995 / 23:07:20 / claus" |
|
1198 | 6979 |
"Modified: 13.1.1997 / 22:53:20 / cg" |
0 | 6980 |
! ! |
6981 |
||
6982 |
!DeviceWorkstation methodsFor:'keyboard mapping'! |
|
6983 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6984 |
altModifiers |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6985 |
"Return the set of keys which are treated as Alt-keys. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6986 |
This set is initialized at startup from what the server thinks |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6987 |
are alt-keys." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6988 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6989 |
^ altModifiers |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6990 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6991 |
" |
4350 | 6992 |
Display altModifiers |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6993 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6994 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6995 |
"Created: 2.1.1996 / 14:57:13 / cg" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6996 |
"Modified: 2.1.1996 / 15:01:54 / cg" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6997 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6998 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
6999 |
altModifiers:arrayOfAltModifierKeys |
8340 | 7000 |
"Change the set of keys which are treated as Alt-keys. |
7001 |
This is useful for ST/X on OSX on XQuartz, where the window manager |
|
7002 |
uses the CMD keys, making it unavailable for ST/X. |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7003 |
Here, we map the left ALT key onto the command key |
8340 | 7004 |
(see keyboard.rc). Lefthanders might want to use the right ALT key for that." |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7005 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7006 |
altModifiers := arrayOfAltModifierKeys |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7007 |
|
8340 | 7008 |
" |
7009 |
Screen current cmdModifiers |
|
7010 |
Screen current altModifiers:#(#'Meta_L' #'Meta_R' #'Hyper_R') |
|
7011 |
" |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7012 |
"Created: 2.1.1996 / 14:58:24 / cg" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7013 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7014 |
|
7863 | 7015 |
appleAltModifierMask |
7016 |
"return the Xlib mask bit for the ALT modifier key on OS-X. |
|
7017 |
Nil returned for other displays" |
|
7018 |
||
7019 |
^ nil |
|
7020 |
||
7021 |
"Created: / 10-02-2017 / 21:32:28 / cg" |
|
7022 |
! |
|
7023 |
||
7024 |
appleCmdModifierMask |
|
7025 |
"return the Xlib mask bit for the CMD modifier key on OS-X. |
|
7026 |
Nil returned for other displays" |
|
7027 |
||
7028 |
^ nil |
|
7029 |
||
7030 |
"Created: / 10-02-2017 / 21:32:35 / cg" |
|
7031 |
! |
|
7032 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7033 |
metaModifiers |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7034 |
"Return the set of keys which are treated as Meta-keys (i.e. Cmd-keys). |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7035 |
This set is initialized at startup from what the server thinks |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7036 |
are meta-keys." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7037 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7038 |
^ metaModifiers |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7039 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7040 |
" |
4350 | 7041 |
Display metaModifiers |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7042 |
" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7043 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7044 |
"Created: 2.1.1996 / 14:57:35 / cg" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7045 |
"Modified: 2.1.1996 / 15:02:00 / cg" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7046 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7047 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7048 |
metaModifiers:arrayOfMetaModifierKeys |
8340 | 7049 |
"Change the set of keys which are treated as Meta-keys (i.e. Cmd keys). |
7050 |
This is useful for ST/X on OSX on XQuartz, where the window manager |
|
7051 |
uses the CMD keys, making it unavailable for ST/X. |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7052 |
Here, we map the left ALT key onto the command key |
8340 | 7053 |
(see keyboard.rc). Lefthanders might want to use the right ALT key for that." |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7054 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7055 |
metaModifiers := arrayOfMetaModifierKeys |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7056 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7057 |
"Created: 2.1.1996 / 14:58:41 / cg" |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7058 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7059 |
|
293 | 7060 |
modifierKeyProcessing:key down:pressed |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7061 |
"internal, private method. |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7062 |
Called with every keyPress/keyRelease to update the xxxDown flags." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7063 |
|
293 | 7064 |
(altModifiers notNil and:[altModifiers includes:key]) ifTrue:[ |
6296 | 7065 |
altDown := pressed |
293 | 7066 |
] ifFalse:[ |
6296 | 7067 |
(metaModifiers notNil and:[metaModifiers includes:key]) ifTrue:[ |
7068 |
metaDown := pressed |
|
7069 |
] ifFalse:[ |
|
7070 |
(shiftModifiers notNil and:[shiftModifiers includes:key]) ifTrue:[ |
|
7071 |
shiftDown := pressed |
|
7072 |
] ifFalse:[ |
|
7073 |
(ctrlModifiers notNil and:[ctrlModifiers includes:key]) ifTrue:[ |
|
7074 |
ctrlDown := pressed |
|
7075 |
] |
|
7076 |
] |
|
7077 |
] |
|
293 | 7078 |
] |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7079 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7080 |
"Modified: 2.1.1996 / 15:00:25 / cg" |
293 | 7081 |
! |
7082 |
||
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7083 |
modifierKeyTopFor:key |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7084 |
"reverse translation for a modifier key |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7085 |
(i.e. to get the keyTop from a modifier)" |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7086 |
|
532 | 7087 |
|t modifiers| |
7088 |
||
7089 |
key == #Alt ifTrue:[ |
|
6296 | 7090 |
modifiers := altModifiers |
532 | 7091 |
] ifFalse:[ |
6296 | 7092 |
key == #Cmd ifTrue:[ |
7093 |
modifiers := metaModifiers |
|
7094 |
] |
|
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7095 |
]. |
2053 | 7096 |
|
7097 |
"/ temporary kludge ... |
|
532 | 7098 |
(modifiers size > 0) ifTrue:[ |
6296 | 7099 |
(modifiers includes:'Num_Lock') ifTrue:[ |
7100 |
modifiers := modifiers copyWithout:'Num_Lock' |
|
7101 |
] |
|
2053 | 7102 |
]. |
7103 |
||
7104 |
(modifiers size > 0) ifTrue:[ |
|
6296 | 7105 |
t := modifiers first. |
7106 |
(t includes:$_) ifTrue:[ |
|
7107 |
t := t copyTo:(t indexOf:$_)-1 |
|
7108 |
]. |
|
7109 |
^ t |
|
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7110 |
]. |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7111 |
^ key |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7112 |
|
2053 | 7113 |
"Created: / 28.2.1996 / 17:07:08 / cg" |
7114 |
"Modified: / 7.2.1998 / 16:18:17 / cg" |
|
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7115 |
! |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7116 |
|
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7117 |
modifierKeyTranslationFor:untranslatedKey |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7118 |
"map possible modifiers to a smaller set of common symbols. |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7119 |
Especially, left/right keys are mapped to a common one." |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7120 |
|
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7121 |
"should this come from a configurable variable ?" |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7122 |
|
1022 | 7123 |
"/ the next statement will vanish .... |
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7124 |
(untranslatedKey == #Control |
4350 | 7125 |
or:[untranslatedKey == #'Control_L' |
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7126 |
or:[untranslatedKey == #'Control_R']]) ifTrue:[ |
6296 | 7127 |
^ #Ctrl |
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7128 |
]. |
1022 | 7129 |
|
7130 |
(untranslatedKey == #Ctrl |
|
4350 | 7131 |
or:[untranslatedKey == #'Ctrl_L' |
1022 | 7132 |
or:[untranslatedKey == #'Ctrl_R']]) ifTrue:[ |
6296 | 7133 |
^ #Ctrl |
1022 | 7134 |
]. |
4350 | 7135 |
(untranslatedKey == #'Shift' |
7136 |
or:[untranslatedKey == #'Shift_L' |
|
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7137 |
or:[untranslatedKey == #'Shift_R']]) ifTrue:[ |
6296 | 7138 |
^ #Shift |
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7139 |
]. |
4350 | 7140 |
(untranslatedKey == #'Alt' |
7141 |
or:[untranslatedKey == #'Alt_L' |
|
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7142 |
or:[untranslatedKey == #'Alt_R']]) ifTrue:[ |
6296 | 7143 |
^ #Alt |
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7144 |
]. |
4350 | 7145 |
(untranslatedKey == #'Meta' |
7146 |
or:[untranslatedKey == #'Meta_L' |
|
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7147 |
or:[untranslatedKey == #'Meta_R']]) ifTrue:[ |
6296 | 7148 |
^ #Meta |
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7149 |
]. |
4350 | 7150 |
(untranslatedKey == #'Cmd' |
7151 |
or:[untranslatedKey == #'Cmd_L' |
|
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7152 |
or:[untranslatedKey == #'Cmd_R']]) ifTrue:[ |
6296 | 7153 |
^ #Cmd |
4070 | 7154 |
]. |
4350 | 7155 |
(untranslatedKey == #'Super' |
7156 |
or:[untranslatedKey == #'Super_L' |
|
4070 | 7157 |
or:[untranslatedKey == #'Super_R']]) ifTrue:[ |
6296 | 7158 |
^ #Super |
4485 | 7159 |
]. |
4944
f843d2c7946e
correct translation of Alt-key
Claus Gittinger <cg@exept.de>
parents:
4933
diff
changeset
|
7160 |
|
f843d2c7946e
correct translation of Alt-key
Claus Gittinger <cg@exept.de>
parents:
4933
diff
changeset
|
7161 |
"/ I know - this is stupid; however the tradition was Cmd for this... |
f843d2c7946e
correct translation of Alt-key
Claus Gittinger <cg@exept.de>
parents:
4933
diff
changeset
|
7162 |
(untranslatedKey == #'Menu' |
f843d2c7946e
correct translation of Alt-key
Claus Gittinger <cg@exept.de>
parents:
4933
diff
changeset
|
7163 |
or:[untranslatedKey == #'Menu_L' |
f843d2c7946e
correct translation of Alt-key
Claus Gittinger <cg@exept.de>
parents:
4933
diff
changeset
|
7164 |
or:[untranslatedKey == #'Menu_R']]) ifTrue:[ |
6296 | 7165 |
^ #Cmd |
4944
f843d2c7946e
correct translation of Alt-key
Claus Gittinger <cg@exept.de>
parents:
4933
diff
changeset
|
7166 |
]. |
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7167 |
^ nil |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7168 |
|
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7169 |
"Created: 28.2.1996 / 16:40:46 / cg" |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7170 |
"Modified: 28.2.1996 / 17:11:34 / cg" |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7171 |
! |
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7172 |
|
6146 | 7173 |
modifierKeys |
7174 |
"a list of possible modifiers" |
|
7175 |
||
7176 |
^ #( #Control #'Control_L' #'Control_R' |
|
6296 | 7177 |
#Ctrl #'Ctrl_L' #'Ctrl_R' |
7178 |
#'Shift' #'Shift_L' #'Shift_R' |
|
7179 |
#'Alt' #'Alt_L' #'Alt_R' |
|
7180 |
#'Meta' #'Meta_L' #'Meta_R' |
|
7181 |
#'Cmd' #'Cmd_L' #'Cmd_R' |
|
7182 |
#'Super' #'Super_L' #'Super_R' |
|
7183 |
#'Menu' #'Menu_L' #'Menu_R' |
|
6146 | 7184 |
) |
7185 |
! |
|
7186 |
||
3236 | 7187 |
prependModifierToKey:untranslatedKey |
6557 | 7188 |
|xlatedKey s modifier k| |
51 | 7189 |
|
5917
d5b5e701a6e8
changed: #prependModifierToKey:
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
7190 |
(ctrlDown and:[ metaDown ]) ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7191 |
"/ right-ALT: already xlated (I hope) |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7192 |
^ untranslatedKey |
6011
5f2245003b40
semaphore bug workaround - temporary
Claus Gittinger <cg@exept.de>
parents:
6006
diff
changeset
|
7193 |
]. |
5f2245003b40
semaphore bug workaround - temporary
Claus Gittinger <cg@exept.de>
parents:
6006
diff
changeset
|
7194 |
|
5f2245003b40
semaphore bug workaround - temporary
Claus Gittinger <cg@exept.de>
parents:
6006
diff
changeset
|
7195 |
xlatedKey := untranslatedKey. |
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7196 |
modifier := self modifierKeyTranslationFor:untranslatedKey. |
4944
f843d2c7946e
correct translation of Alt-key
Claus Gittinger <cg@exept.de>
parents:
4933
diff
changeset
|
7197 |
"/ Transcript show: 'untranslatedKey: ' ; showCR: untranslatedKey storeString. |
f843d2c7946e
correct translation of Alt-key
Claus Gittinger <cg@exept.de>
parents:
4933
diff
changeset
|
7198 |
"/ Transcript show: 'modifier: ' ; showCR: modifier storeString. |
f843d2c7946e
correct translation of Alt-key
Claus Gittinger <cg@exept.de>
parents:
4933
diff
changeset
|
7199 |
"/ 'untranslatedKey: ' print. untranslatedKey storeString printCR. |
f843d2c7946e
correct translation of Alt-key
Claus Gittinger <cg@exept.de>
parents:
4933
diff
changeset
|
7200 |
"/ 'modifier: ' print. modifier storeString printCR. |
4070 | 7201 |
|
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7202 |
"/ |
4485 | 7203 |
"/ only prepend, if this is not a modifier (otherwise, we get CmdCmd or CtrlCtrl) |
473
e954ce348a47
added protocol for reverse modifier mappings
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
7204 |
"/ |
8317 | 7205 |
modifier notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7206 |
xlatedKey isCharacter ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7207 |
xlatedKey := xlatedKey asSymbol |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7208 |
]. |
8317 | 7209 |
] ifFalse:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7210 |
s := xlatedKey asString. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7211 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7212 |
"/ NO, do not prepend the Shift modifier. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7213 |
"/ although logical, this makes many keyPress methods incompatible. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7214 |
"/ sigh. |
4485 | 7215 |
"/ xlatedKey isSymbol ifTrue:[ |
7216 |
"/ shiftDown ifTrue:[ |
|
7217 |
"/ xlatedKey := 'Shift' , s |
|
7218 |
"/ ]. |
|
7219 |
"/ ]. |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7220 |
ctrlDown ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7221 |
xlatedKey := 'Ctrl' , s |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7222 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7223 |
metaDown ifTrue:[ "/ sigh - new hp's have both CMD and META keys. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7224 |
xlatedKey := 'Cmd' , s |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7225 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7226 |
altDown ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7227 |
xlatedKey := 'Alt' , s |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7228 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7229 |
xlatedKey isCharacter ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7230 |
"/ prepend Shift modifier |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7231 |
"/ if done unconditionally, this breaks a lot of code. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7232 |
"/ which is not prepared for that and checks shiftDown instead. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7233 |
"/ Therefore, this must be changed at the places where shiftDown is checked for!! |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7234 |
"/ In the meanwhile, only do it iff there is a translation. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7235 |
shiftDown ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7236 |
(k := ('Shift' , s) asSymbolIfInterned) notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7237 |
(self keyboardMap hasBindingFor:k) ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7238 |
xlatedKey := k. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7239 |
"/ Transcript show:k ; show:' -> '; showCR:(self keyboardMap valueFor:k). |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7240 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7241 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7242 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7243 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7244 |
"/ sigh: twoByteSymbols are not (yet) allowed |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7245 |
xlatedKey isWideString ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7246 |
xlatedKey := xlatedKey asSymbol |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7247 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7248 |
]. |
51 | 7249 |
]. |
7250 |
||
3236 | 7251 |
^ xlatedKey |
5828
b77d25ec29ad
comment/format in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
5778
diff
changeset
|
7252 |
|
5917
d5b5e701a6e8
changed: #prependModifierToKey:
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
7253 |
"Modified (format): / 12-07-2012 / 18:37:22 / cg" |
3236 | 7254 |
! |
7255 |
||
7256 |
translateKey:untranslatedKey forView:aView |
|
7257 |
"Return the key translated via the translation table. |
|
7258 |
Your application program should never depend on the values returned |
|
7259 |
by this method, but instead use symbolic keys (such as #FindNext). |
|
7260 |
Doing so allows easier reconfiguration by changing the translation map |
|
7261 |
in the 'smalltalk.rc' or 'display.rc' startup files. |
|
7262 |
||
7263 |
First, the modifier is prepended, making character X into |
|
7264 |
AltX, CtrlX or CmdX (on many systems, no separate Cmd (or Meta) |
|
7265 |
key exists; on those we always get AltX if the metaModifiers are not set correctly). |
|
7266 |
If multiple modifiers are active, the symbol becoms the concatenation |
|
7267 |
as in AltCtrlq (for control-alt-q). Shift will affect the last component, |
|
7268 |
thus the above with shift becoms: AltCtrlQ instead. |
|
7269 |
Some keyboards offer both Alt and Meta keys - on those, the first has a |
|
7270 |
prefix of Alt, the second has Cmd as prefix. Keyboards with only an Alt |
|
7271 |
key will will create prefix codes of Cmd for that. |
|
7272 |
For symbolic keys (i.e.Tab, Backspace etc, shift is ignored). |
|
7273 |
Then the result is used as a key into the translation keyboardMap |
|
7274 |
to get the final return value." |
|
7275 |
||
7865 | 7276 |
|xlatedKey code| |
7277 |
||
7278 |
xlatedKey := untranslatedKey. |
|
7279 |
||
7280 |
"/ handle Uxxxx keysyms |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7281 |
(untranslatedKey isSymbol |
7865 | 7282 |
and:[untranslatedKey size == 5 |
7283 |
and:[untranslatedKey first == $U |
|
7284 |
and:[(code := Integer readFrom:(untranslatedKey copyFrom:2) radix:16 onError:nil) notNil |
|
7285 |
]]]) ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7286 |
xlatedKey := Character value:code. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7287 |
] ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7288 |
"/ translate via keyboardMap |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7289 |
"/ Stderr show:'k1: '; showCR:xlatedKey storeString. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7290 |
xlatedKey := self prependModifierToKey:xlatedKey. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7291 |
"/ Stderr show:'k2: '; showCR:xlatedKey storeString. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7292 |
xlatedKey := aView keyboardMap valueFor:xlatedKey. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7293 |
"/ Stderr show:'k3: '; showCR:xlatedKey storeString. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7294 |
xlatedKey notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7295 |
xlatedKey isCharacter ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7296 |
xlatedKey isWideString ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7297 |
xlatedKey := xlatedKey asSymbol. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7298 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7299 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7300 |
]. |
7865 | 7301 |
]. |
7302 |
||
7303 |
||
51 | 7304 |
^ xlatedKey |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7305 |
|
7865 | 7306 |
"Modified: / 10-02-2017 / 22:30:12 / cg" |
293 | 7307 |
! ! |
7308 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7309 |
!DeviceWorkstation methodsFor:'keyboard queries'! |
293 | 7310 |
|
7311 |
altDown |
|
7312 |
"return true, if the alt-key is currently pressed." |
|
7313 |
||
7314 |
^ altDown |
|
249
f33de7016dba
modifierKeyProcessing (altDown/metaDown ...) now done in smalltalk
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
7315 |
! |
f33de7016dba
modifierKeyProcessing (altDown/metaDown ...) now done in smalltalk
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
7316 |
|
3244 | 7317 |
altModifierMask |
7318 |
"return the mask bit for the alt modifier key" |
|
7319 |
||
7320 |
self subclassResponsibility |
|
7321 |
||
7322 |
! |
|
7323 |
||
4350 | 7324 |
ctrlDown |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7325 |
"return true, if the control-key is currently pressed." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7326 |
|
4350 | 7327 |
^ ctrlDown |
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7328 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7329 |
|
3244 | 7330 |
ctrlModifierMask |
7331 |
"return the mask bit for the ctrl modifier key" |
|
7332 |
||
7333 |
self subclassResponsibility |
|
7334 |
||
7335 |
! |
|
7336 |
||
1114
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7337 |
leftShiftDown |
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7338 |
"return true, if the left shift-key is currently pressed. |
7653 | 7339 |
Here, we don't differentiate between left and right shift keys." |
1114
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7340 |
|
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7341 |
^ shiftDown |
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7342 |
|
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7343 |
"Created: 9.11.1996 / 19:06:48 / cg" |
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7344 |
! |
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7345 |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7346 |
metaDown |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7347 |
"return true, if the meta-key (alt-key on systems without meta) |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7348 |
is currently pressed." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7349 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7350 |
^ metaDown |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7351 |
! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7352 |
|
3244 | 7353 |
metaModifierMask |
7354 |
"return the mask bit for the meta modifier key" |
|
7355 |
||
7356 |
self subclassResponsibility |
|
7357 |
||
7358 |
! |
|
7359 |
||
1114
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7360 |
rightShiftDown |
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7361 |
"return true, if the right shift-key is currently pressed. |
7653 | 7362 |
Here, we don't differentiate between left and right shift keys." |
1114
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7363 |
|
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7364 |
^ shiftDown |
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7365 |
|
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7366 |
"Created: 9.11.1996 / 19:06:56 / cg" |
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7367 |
! |
1e1d28b9876a
added queries for left- and rightShift keys.
Claus Gittinger <cg@exept.de>
parents:
1079
diff
changeset
|
7368 |
|
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7369 |
shiftDown |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7370 |
"return true, if the shift-key is currently pressed." |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7371 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7372 |
^ shiftDown |
3244 | 7373 |
! |
7374 |
||
7375 |
shiftModifierMask |
|
7376 |
"return the mask bit for the shift modifier key" |
|
7377 |
||
7378 |
self subclassResponsibility |
|
7379 |
||
339
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7380 |
! ! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7381 |
|
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7382 |
!DeviceWorkstation methodsFor:'misc'! |
16bc1232293b
added modifier-changing protocol
Claus Gittinger <cg@exept.de>
parents:
335
diff
changeset
|
7383 |
|
293 | 7384 |
beep |
6757 | 7385 |
"output an audible beep or bell" |
7386 |
||
1198 | 7387 |
"{ Pragma: +optSpace }" |
7388 |
||
3078 | 7389 |
UserPreferences current beepEnabled ifTrue:[ |
6885 | 7390 |
Stdout nextPut:(Character bell) |
1906 | 7391 |
] |
1198 | 7392 |
|
3078 | 7393 |
"Modified: / 13.1.1997 / 22:56:13 / cg" |
7394 |
"Modified: / 3.12.1999 / 17:13:52 / ps" |
|
293 | 7395 |
! |
7396 |
||
8255 | 7397 |
beepInEditor |
8260 | 7398 |
"output an audible beep or bell, if enabled. |
7399 |
||
7400 |
Beep to wakeup the user after some error/not found condition in an editor. |
|
7401 |
Use this ONLY to beep in response to a bad user operation (not system failure beeps). |
|
7402 |
Can be disabled via the settings if too annoying" |
|
8255 | 7403 |
|
7404 |
"{ Pragma: +optSpace }" |
|
7405 |
||
7406 |
UserPreferences current beepInEditor ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7407 |
self beep |
8255 | 7408 |
] |
7409 |
||
7410 |
"Modified: / 13.1.1997 / 22:56:13 / cg" |
|
7411 |
"Modified: / 3.12.1999 / 17:13:52 / ps" |
|
7412 |
! |
|
7413 |
||
293 | 7414 |
buffered |
7415 |
"buffer drawing - do not send it immediately to the display. |
|
7416 |
This is the default; see comment in #unBuffered." |
|
7417 |
||
7418 |
^ self |
|
7419 |
! |
|
7420 |
||
4346
98c44fc2c272
long-button-press handling added
Claus Gittinger <cg@exept.de>
parents:
4339
diff
changeset
|
7421 |
buttonLongPressedHandlerProcess |
4350 | 7422 |
^ buttonLongPressedHandlerProcess |
4346
98c44fc2c272
long-button-press handling added
Claus Gittinger <cg@exept.de>
parents:
4339
diff
changeset
|
7423 |
! |
98c44fc2c272
long-button-press handling added
Claus Gittinger <cg@exept.de>
parents:
4339
diff
changeset
|
7424 |
|
98c44fc2c272
long-button-press handling added
Claus Gittinger <cg@exept.de>
parents:
4339
diff
changeset
|
7425 |
buttonLongPressedHandlerProcess:aProcess |
4350 | 7426 |
buttonLongPressedHandlerProcess := aProcess. |
7427 |
! |
|
7428 |
||
7429 |
buttonPressTimeForMenu |
|
7430 |
^ buttonPressTimeForMenu |
|
7431 |
! |
|
7432 |
||
7433 |
buttonPressTimeForMenu:seconds |
|
7434 |
buttonPressTimeForMenu := seconds |
|
4346
98c44fc2c272
long-button-press handling added
Claus Gittinger <cg@exept.de>
parents:
4339
diff
changeset
|
7435 |
! |
98c44fc2c272
long-button-press handling added
Claus Gittinger <cg@exept.de>
parents:
4339
diff
changeset
|
7436 |
|
293 | 7437 |
compressMotionEvents:aBoolean |
4350 | 7438 |
"turn on/off motion event compression |
293 | 7439 |
- compressions makes always sense except in free-hand drawing of curves" |
7440 |
||
7441 |
motionEventCompression := aBoolean |
|
115 | 7442 |
! |
7443 |
||
4350 | 7444 |
flush |
2744
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
7445 |
"send all buffered drawing to the display. |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
7446 |
This used to be called #synchronizeOutput, but has been renamed |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
7447 |
for ST-80 compatibility." |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
7448 |
|
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
7449 |
^ self |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
7450 |
! |
7129de2192f7
#hasShape -> #supportsArbitraryShapedViews
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
7451 |
|
2716
b295e9763c24
added a slot for the current focusView
Claus Gittinger <cg@exept.de>
parents:
2712
diff
changeset
|
7452 |
focusView |
6510 | 7453 |
"the view, which has got the focus from the operating system" |
7454 |
||
2716
b295e9763c24
added a slot for the current focusView
Claus Gittinger <cg@exept.de>
parents:
2712
diff
changeset
|
7455 |
^ focusView |
b295e9763c24
added a slot for the current focusView
Claus Gittinger <cg@exept.de>
parents:
2712
diff
changeset
|
7456 |
! |
b295e9763c24
added a slot for the current focusView
Claus Gittinger <cg@exept.de>
parents:
2712
diff
changeset
|
7457 |
|
8397 | 7458 |
focusView:aViewOrNil |
7459 |
"remember the view, which has got the focus from the operating system" |
|
7460 |
||
7461 |
focusView := aViewOrNil. |
|
8056 | 7462 |
|
7463 |
"the view having the focus is active by definition. |
|
7464 |
Note: activeView is set explicitly by WinWorkstation, but not by XWorkstation!!" |
|
8397 | 7465 |
activeView := aViewOrNil. |
8056 | 7466 |
|
7467 |
"Modified (comment): / 25-07-2017 / 12:59:41 / stefan" |
|
2716
b295e9763c24
added a slot for the current focusView
Claus Gittinger <cg@exept.de>
parents:
2712
diff
changeset
|
7468 |
! |
b295e9763c24
added a slot for the current focusView
Claus Gittinger <cg@exept.de>
parents:
2712
diff
changeset
|
7469 |
|
8397 | 7470 |
focusWindowGroup |
7471 |
"the last windowGroup, which has got the focus from the operating system" |
|
7472 |
||
7473 |
^ focusWindowGroup |
|
7474 |
! |
|
7475 |
||
7476 |
focusWindowGroup:aWindowGroupOrNil |
|
7477 |
"remember the last windowGroup, which has got the focus from the operating system" |
|
7478 |
||
7479 |
focusWindowGroup := aWindowGroupOrNil |
|
7480 |
! |
|
7481 |
||
3385
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7482 |
redrawAllWindows |
7450 | 7483 |
self allViewsDo:[:eachView | |
7484 |
(eachView shown and:[eachView isRootView not]) ifTrue:[ |
|
7485 |
eachView clearView; invalidate |
|
7486 |
]. |
|
7487 |
]. |
|
3385
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7488 |
|
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7489 |
" |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7490 |
Display redrawAllWindows |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7491 |
" |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7492 |
|
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7493 |
"Modified: 15.10.1997 / 19:06:26 / cg" |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7494 |
! |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7495 |
|
2536 | 7496 |
repadBits:givenBits width:imageWidth height:imageHeight depth:imageDepth from:givenPadding to:wantedPadding |
7497 |
"repadding support - required for some devices when drawing images" |
|
7498 |
||
4350 | 7499 |
|newBits bytesPerLineGiven bytesPerLineWanted |
2536 | 7500 |
dstIndex "{ Class: SmallInteger }" |
7501 |
srcIndex "{ Class: SmallInteger }"| |
|
7502 |
||
7503 |
bytesPerLineGiven := ((width * imageDepth) + givenPadding - 1) // 8. |
|
7504 |
bytesPerLineWanted := ((width * imageDepth) + wantedPadding - 1) // 8. |
|
7505 |
||
7506 |
bytesPerLineGiven == bytesPerLineWanted ifTrue:[^ givenBits]. |
|
7507 |
||
7508 |
newBits := ByteArray new:(bytesPerLineWanted * height). |
|
7509 |
srcIndex := dstIndex := 1. |
|
7510 |
1 to:height do:[:row | |
|
6296 | 7511 |
newBits |
7512 |
replaceFrom:dstIndex |
|
7513 |
to:(dstIndex + bytesPerLineWanted - 1) |
|
7514 |
with:givenBits |
|
7515 |
startingAt:srcIndex. |
|
7516 |
dstIndex := dstIndex + bytesPerLineWanted. |
|
7517 |
srcIndex := srcIndex + bytesPerLineGiven. |
|
2536 | 7518 |
]. |
7519 |
^ newBits. |
|
4350 | 7520 |
|
2536 | 7521 |
! |
7522 |
||
1926 | 7523 |
restoreWindows |
7524 |
"restore the display. |
|
7525 |
Here, a view is popped over all of the screen temporarily" |
|
7526 |
||
7527 |
|v| |
|
7528 |
||
3385
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7529 |
self flush. |
1926 | 7530 |
v := PopUpView onDevice:self. |
7531 |
v origin:0@0 corner:(self bounds corner). |
|
3385
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7532 |
v raise. |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7533 |
v realize. |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7534 |
self flush. |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7535 |
|
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7536 |
Delay waitForSeconds:0.2. |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7537 |
v destroy. |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7538 |
self flush. |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7539 |
Delay waitForSeconds:0.2. |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7540 |
self flush. |
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7541 |
|
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7542 |
self redrawAllWindows. |
1926 | 7543 |
|
7544 |
" |
|
7545 |
Display restoreWindows |
|
3385
777869fdc56d
restoreWindows is better (I hope)
Claus Gittinger <cg@exept.de>
parents:
3360
diff
changeset
|
7546 |
Display redrawAllWindows |
1926 | 7547 |
" |
7548 |
||
7549 |
"Modified: 15.10.1997 / 19:06:26 / cg" |
|
7550 |
! |
|
7551 |
||
7776 | 7552 |
rightButtonIsLowerWindow:aBooleanOrNil |
7553 |
"ignored here. Used with windows displays, to control the |
|
7554 |
bahavior of the right mouse button, when clicking into the |
|
7555 |
title area (to lower a view). |
|
7556 |
With a non-nil argument, the flag is set. |
|
7557 |
with a nil value, its current value is returned" |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7558 |
|
7776 | 7559 |
^ false |
7560 |
! |
|
7561 |
||
293 | 7562 |
ringBell |
1198 | 7563 |
"{ Pragma: +optSpace }" |
7564 |
||
293 | 7565 |
"alias for beep; for ST-80 compatibility" |
7566 |
||
7567 |
self beep |
|
1198 | 7568 |
|
7569 |
"Modified: 13.1.1997 / 22:56:02 / cg" |
|
115 | 7570 |
! |
7571 |
||
293 | 7572 |
setInputFocusTo:aWindowId |
7573 |
^ self subclassResponsibility |
|
115 | 7574 |
! |
7575 |
||
7776 | 7576 |
shiftedLeftButtonIsLowerWindow:aBooleanOrNil |
7577 |
"ignored here. Used with windows displays, to control the |
|
7578 |
bahavior of the shifted right mouse button, when clicking into the |
|
7579 |
title area (to lower a view). |
|
7580 |
With a non-nil argument, the flag is set. |
|
7581 |
with a nil value, its current value is returned" |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7582 |
|
7776 | 7583 |
^ false |
7584 |
! |
|
7585 |
||
293 | 7586 |
sync |
1198 | 7587 |
"{ Pragma: +optSpace }" |
7588 |
||
7589 |
"send all buffered drawing to the display and wait until its processed/drawn. |
|
7590 |
See also #flush, which does not wait. |
|
7591 |
ST-80 seems to only support flush." |
|
293 | 7592 |
|
7593 |
self flush |
|
1198 | 7594 |
|
7595 |
"Modified: 13.1.1997 / 22:55:44 / cg" |
|
115 | 7596 |
! |
7597 |
||
293 | 7598 |
synchronizeOutput |
1198 | 7599 |
"{ Pragma: +optSpace }" |
7600 |
||
3430 | 7601 |
<resource:#obsolete> |
7602 |
||
293 | 7603 |
"send all buffered drawing to the display. |
7604 |
OBSOLETE: please use #flush for ST-80 compatibility." |
|
7605 |
||
7606 |
self obsoleteMethodWarning:'use #flush'. |
|
7607 |
^ self flush |
|
1198 | 7608 |
|
7609 |
"Modified: 13.1.1997 / 22:53:44 / cg" |
|
115 | 7610 |
! |
7611 |
||
293 | 7612 |
unBuffered |
7613 |
"make all drawing be sent immediately to the display. |
|
7614 |
This may horribly slow down your drawings, but will result |
|
7615 |
in any errors to be delivered right after the bad operation |
|
7616 |
(in X only). Only useful for debugging." |
|
7617 |
||
7618 |
^ self |
|
7619 |
! ! |
|
7620 |
||
6560 | 7621 |
!DeviceWorkstation methodsFor:'native window stuff'! |
7622 |
||
7623 |
changeButtonState:state in:drawableId |
|
7624 |
self subclassResponsibility |
|
7625 |
! |
|
7626 |
||
7627 |
changeLabel:state in:drawableId |
|
7628 |
self subclassResponsibility |
|
7629 |
! |
|
7630 |
||
7631 |
enableScrollBar:enableBoolean in:drawableId |
|
7632 |
self subclassResponsibility |
|
7633 |
! ! |
|
7634 |
||
1717
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7635 |
!DeviceWorkstation methodsFor:'pointer stuff'! |
293 | 7636 |
|
2869 | 7637 |
anyButtonMotionMask |
7638 |
"return an integer for masking out any button from a motion |
|
7639 |
buttonStates value. This is very device specific and to |
|
7640 |
be redefined by concrete subclasses." |
|
7641 |
||
7642 |
^ self subclassResponsibility |
|
7643 |
||
7644 |
"Created: 15.10.1997 / 19:17:00 / cg" |
|
7645 |
! |
|
7646 |
||
1926 | 7647 |
anyButtonPressed |
7648 |
"return true, if the any button is currently pressed" |
|
7649 |
||
7650 |
^ (self buttonStates bitAnd:self anyButtonStateMask) ~~ 0 |
|
7651 |
||
7652 |
"Created: 15.10.1997 / 19:16:32 / cg" |
|
7653 |
! |
|
7654 |
||
7655 |
anyButtonStateMask |
|
7656 |
"return an integer for masking out any button from a |
|
7657 |
buttonStates value. This is very device specific and to |
|
7658 |
be redefined by concrete subclasses." |
|
7659 |
||
7660 |
^ self subclassResponsibility |
|
7661 |
||
7662 |
"Created: 15.10.1997 / 19:17:00 / cg" |
|
7663 |
! |
|
7664 |
||
2880
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7665 |
button1MotionMask |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7666 |
"return an integer for masking out the left button from a |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7667 |
motion buttonStates value. This is very device specific and to |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7668 |
be redefined by concrete subclasses." |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7669 |
|
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7670 |
^ self subclassResponsibility |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7671 |
! |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7672 |
|
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7673 |
button2MotionMask |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7674 |
"return an integer for masking out the middle button from a |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7675 |
motion buttonStates value. This is very device specific and to |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7676 |
be redefined by concrete subclasses." |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7677 |
|
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7678 |
^ self subclassResponsibility |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7679 |
! |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7680 |
|
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7681 |
button3MotionMask |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7682 |
"return an integer for masking out the right button from a |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7683 |
motion buttonStates value. This is very device specific and to |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7684 |
be redefined by concrete subclasses." |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7685 |
|
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7686 |
^ self subclassResponsibility |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7687 |
! |
9dda5e03b02b
missing subClassResponsibilty protocol
Claus Gittinger <cg@exept.de>
parents:
2876
diff
changeset
|
7688 |
|
293 | 7689 |
buttonStates |
7690 |
"return an integer representing the state of the pointer buttons; |
|
7691 |
a one-bit represents a pressed button. The bit positions are device specific |
|
7692 |
and to be returned by the *ButtonStateMask methods. |
|
7693 |
Must be redefined by concrete subclasses." |
|
7694 |
||
7695 |
^ self subclassResponsibility |
|
115 | 7696 |
! |
7697 |
||
293 | 7698 |
leftButtonPressed |
7699 |
"return true, if the left button is currently pressed" |
|
7700 |
||
7701 |
^ (self buttonStates bitAnd:self leftButtonStateMask) ~~ 0 |
|
7702 |
! |
|
7703 |
||
7704 |
leftButtonStateMask |
|
7705 |
"return an integer for masking out the left button from a |
|
7706 |
buttonStates value. This is very device specific and to |
|
7707 |
be redefined by concrete subclasses." |
|
7708 |
||
7709 |
^ self subclassResponsibility |
|
115 | 7710 |
! |
7711 |
||
293 | 7712 |
middleButtonPressed |
7713 |
"return true, if the middle button is currently pressed" |
|
7714 |
||
7715 |
^ (self buttonStates bitAnd:self middleButtonStateMask) ~~ 0 |
|
115 | 7716 |
! |
7717 |
||
293 | 7718 |
middleButtonStateMask |
7719 |
"return an integer for masking out the middle button from a |
|
7720 |
buttonStates value. This is very device specific and to |
|
7721 |
be redefined by concrete subclasses." |
|
7722 |
||
7723 |
^ self subclassResponsibility |
|
115 | 7724 |
! |
7725 |
||
293 | 7726 |
pointerPosition |
7727 |
"return the current pointer position in root-window coordinates. |
|
7728 |
Must be redefined by concrete subclasses." |
|
7729 |
||
7730 |
^ self subclassResponsibility |
|
115 | 7731 |
! |
7732 |
||
293 | 7733 |
rightButtonPressed |
7734 |
"return true, if the right button is currently pressed" |
|
7735 |
||
7736 |
^ (self buttonStates bitAnd:self rightButtonStateMask) ~~ 0 |
|
115 | 7737 |
! |
7738 |
||
293 | 7739 |
rightButtonStateMask |
7740 |
"return an integer for masking out the right button from a |
|
7741 |
buttonStates value. This is very device specific and to |
|
7742 |
be redefined by concrete subclasses." |
|
7743 |
||
7744 |
^ self subclassResponsibility |
|
115 | 7745 |
! |
7746 |
||
293 | 7747 |
rootPositionOfLastEvent |
7748 |
"return the position in root-window coordinates |
|
7749 |
of the last button, key or pointer event. |
|
7750 |
Must be redefined by concrete subclasses." |
|
7751 |
||
7752 |
^ self subclassResponsibility |
|
1717
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7753 |
! |
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7754 |
|
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7755 |
setPointerPosition:newPosition |
8466 | 7756 |
"change the pointer position in root-window coordinates. |
7757 |
Warning: moving the mouse pointer may lead to the mouse falling off the table |
|
7758 |
after a while. So it should be used very very seldom (if at all)" |
|
1717
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7759 |
|
7630 | 7760 |
self setPointerPosition:newPosition in:(self rootView drawableId) |
1717
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7761 |
|
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7762 |
" |
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7763 |
Display setPointerPosition:10@30 |
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7764 |
" |
8466 | 7765 |
|
7766 |
"Modified (comment): / 14-09-2018 / 17:59:33 / Claus Gittinger" |
|
1717
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7767 |
! |
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7768 |
|
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7769 |
setPointerPosition:newPosition in:aWindowID |
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7770 |
"change the pointer position relative to some views origin. |
8466 | 7771 |
Must be redefined by concrete subclasses. |
7772 |
Warning: moving the mouse pointer may lead to the mouse falling off the table |
|
7773 |
after a while. So it should be used very very seldom (if at all)" |
|
1717
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7774 |
|
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7775 |
^ self subclassResponsibility |
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7776 |
|
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7777 |
" |
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7778 |
Display setPointerPosition:10@30 |
4e48d1778b27
added setPointerPosition: for recorder/playback support
Claus Gittinger <cg@exept.de>
parents:
1710
diff
changeset
|
7779 |
" |
8466 | 7780 |
|
7781 |
"Modified (comment): / 14-09-2018 / 17:59:28 / Claus Gittinger" |
|
293 | 7782 |
! ! |
7783 |
||
7784 |
!DeviceWorkstation methodsFor:'printing & storing'! |
|
7785 |
||
7786 |
printOn:aStream |
|
7787 |
"for your convenience, add the name of the display connection |
|
7788 |
or 'default' to the printed representation." |
|
7789 |
||
7790 |
|name| |
|
7791 |
||
7792 |
super printOn:aStream. |
|
7793 |
||
7794 |
aStream nextPut:$(. |
|
7795 |
(name := self displayName) isNil ifTrue:[ |
|
6296 | 7796 |
name := 'defaultDisplay' |
293 | 7797 |
]. |
7798 |
aStream nextPutAll:name. |
|
4218
c483dfc16644
When closing, remove also references from cursors and cursors forms
Stefan Vogel <sv@exept.de>
parents:
4195
diff
changeset
|
7799 |
self isOpen ifFalse:[ |
6296 | 7800 |
aStream nextPutAll:' - closed'. |
4218
c483dfc16644
When closing, remove also references from cursors and cursors forms
Stefan Vogel <sv@exept.de>
parents:
4195
diff
changeset
|
7801 |
]. |
c483dfc16644
When closing, remove also references from cursors and cursors forms
Stefan Vogel <sv@exept.de>
parents:
4195
diff
changeset
|
7802 |
aStream nextPut:$). |
293 | 7803 |
! ! |
7804 |
||
3791 | 7805 |
!DeviceWorkstation methodsFor:'queries'! |
7806 |
||
6359 | 7807 |
isWindowsPlatform |
6374 | 7808 |
^ self class isWindowsPlatform |
6359 | 7809 |
! |
7810 |
||
6578 | 7811 |
isX11Platform |
7812 |
^ self class isX11Platform |
|
3791 | 7813 |
! ! |
7814 |
||
293 | 7815 |
!DeviceWorkstation methodsFor:'retrieving pixels'! |
7816 |
||
1461
6d8b022bfcd8
renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents:
1460
diff
changeset
|
7817 |
getBitsFromId:aDrawableId x:srcx y:srcy width:w height:h into:imageBits |
1460
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7818 |
"get bits from a view drawable into the imageBits. The storage for the bits |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7819 |
must be big enough for the data to fit. If ok, returns an array with some |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7820 |
info and the bits in imageBits. The info contains the depth, bitOrder and |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7821 |
number of bytes per scanline. The number of bytes per scanline is not known |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7822 |
in advance, since the X-server is free to return whatever it thinks is a good padding." |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7823 |
|
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7824 |
self subclassResponsibility |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7825 |
|
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7826 |
"Created: 19.3.1997 / 13:41:21 / cg" |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7827 |
! |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7828 |
|
1461
6d8b022bfcd8
renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents:
1460
diff
changeset
|
7829 |
getBitsFromPixmapId:aDrawableId x:srcx y:srcy width:w height:h into:imageBits |
1460
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7830 |
"get bits from a drawable into the imageBits. The storage for the bits |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7831 |
must be big enough for the data to fit. If ok, returns an array with some |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7832 |
info and the bits in imageBits. The info contains the depth, bitOrder and |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7833 |
number of bytes per scanline. The number of bytes per scanline is not known |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7834 |
in advance, since the X-server is free to return whatever it thinks is a good padding." |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7835 |
|
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7836 |
^ self |
6296 | 7837 |
getBitsFromId:aDrawableId |
7838 |
x:srcx |
|
7839 |
y:srcy |
|
7840 |
width:w |
|
7841 |
height:h |
|
7842 |
into:imageBits |
|
1460
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7843 |
|
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7844 |
"Created: 19.3.1997 / 13:43:04 / cg" |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7845 |
"Modified: 19.3.1997 / 13:43:38 / cg" |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7846 |
! |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7847 |
|
1461
6d8b022bfcd8
renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents:
1460
diff
changeset
|
7848 |
getBitsFromViewId:aDrawableId x:srcx y:srcy width:w height:h into:imageBits |
1460
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7849 |
"get bits from a drawable into the imageBits. The storage for the bits |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7850 |
must be big enough for the data to fit. If ok, returns an array with some |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7851 |
info and the bits in imageBits. The info contains the depth, bitOrder and |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7852 |
number of bytes per scanline. The number of bytes per scanline is not known |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7853 |
in advance, since the X-server is free to return whatever it thinks is a good padding." |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7854 |
|
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7855 |
^ self |
6296 | 7856 |
getBitsFromId:aDrawableId |
7857 |
x:srcx |
|
7858 |
y:srcy |
|
7859 |
width:w |
|
7860 |
height:h |
|
7861 |
into:imageBits |
|
1460
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7862 |
|
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7863 |
"Created: 19.3.1997 / 13:43:04 / cg" |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7864 |
"Modified: 19.3.1997 / 13:43:42 / cg" |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7865 |
! |
e068ac480152
splitted getBitsFrom into pixmap-get and view-get (windows)
Claus Gittinger <cg@exept.de>
parents:
1454
diff
changeset
|
7866 |
|
2712
641bad954139
need gc-arg in getPixel (for WIN32)
Claus Gittinger <cg@exept.de>
parents:
2699
diff
changeset
|
7867 |
getPixelX:x y:y from:aDrawableId with:gcId |
293 | 7868 |
"return the pixel value at x/y" |
7869 |
||
7870 |
^ self subclassResponsibility |
|
2712
641bad954139
need gc-arg in getPixel (for WIN32)
Claus Gittinger <cg@exept.de>
parents:
2699
diff
changeset
|
7871 |
|
641bad954139
need gc-arg in getPixel (for WIN32)
Claus Gittinger <cg@exept.de>
parents:
2699
diff
changeset
|
7872 |
"Created: / 22.5.1999 / 01:40:42 / cg" |
115 | 7873 |
! ! |
7874 |
||
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7875 |
!DeviceWorkstation methodsFor:'style defaults'! |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7876 |
|
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7877 |
defaultStyleValueFor:aKey |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7878 |
"return a default style value, given a key. |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7879 |
These defaults are used if nothing is specified |
4350 | 7880 |
in the style sheet |
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7881 |
This allows for empty values in style sheets, and defaults |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7882 |
being provided by the display (which makes sense with Windows, |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7883 |
where the systemDefaults are used ..." |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7884 |
|
4350 | 7885 |
<resource: #style (#viewSpacing |
7450 | 7886 |
#borderColor #borderWidth |
7887 |
#viewBackgroundColor #shadowColor #lightColor |
|
7888 |
)> |
|
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7889 |
|
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7890 |
aKey == #viewSpacing ifTrue:[ |
7450 | 7891 |
^ self verticalPixelPerMillimeter rounded "/ 1 millimeter |
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7892 |
]. |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7893 |
|
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7894 |
aKey == #borderColor ifTrue:[ |
7450 | 7895 |
^ self blackColor |
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7896 |
]. |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7897 |
aKey == #borderWidth ifTrue:[ |
7450 | 7898 |
^ 1 |
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7899 |
]. |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7900 |
|
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7901 |
aKey == #shadowColor ifTrue:[ |
7450 | 7902 |
^ self blackColor |
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7903 |
]. |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7904 |
aKey == #lightColor ifTrue:[ |
7450 | 7905 |
^ self whiteColor |
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7906 |
]. |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7907 |
aKey == #viewBackgroundColor ifTrue:[ |
7450 | 7908 |
^ self whiteColor |
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7909 |
]. |
1684 | 7910 |
aKey == #scrollerViewBackgroundColor ifTrue:[ |
7450 | 7911 |
^ self whiteColor |
1684 | 7912 |
]. |
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7913 |
|
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7914 |
aKey == #textForegroundColor ifTrue:[ |
7450 | 7915 |
^ self blackColor. |
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7916 |
]. |
1684 | 7917 |
aKey == #textBackgroundColor ifTrue:[ |
7450 | 7918 |
^ self whiteColor. |
1684 | 7919 |
]. |
7920 |
aKey == #selectionForegroundColor ifTrue:[ |
|
7450 | 7921 |
^ self whiteColor. |
1684 | 7922 |
]. |
7923 |
aKey == #selectionBackgroundColor ifTrue:[ |
|
7450 | 7924 |
^ self blackColor. |
1684 | 7925 |
]. |
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7926 |
|
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7927 |
^ nil. |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7928 |
|
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7929 |
"Modified: 29.4.1997 / 11:16:57 / dq" |
1684 | 7930 |
"Modified: 29.4.1997 / 17:17:15 / cg" |
1677
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7931 |
! ! |
2a980405798c
prepared to fetch default style values from the device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1675
diff
changeset
|
7932 |
|
4838 | 7933 |
!DeviceWorkstation methodsFor:'tray access'! |
7934 |
||
7935 |
addTrayIconFor:aView icon:wicon iconMask:wiconMask toolTipMessage:toolTipMessage |
|
7936 |
"add an icon to the tray for aView (which will receive tray-events in the future. |
|
7937 |
intentionally ignored here - only supported by win32 (for now)" |
|
7938 |
||
7939 |
^ self |
|
7940 |
||
7941 |
"Created: / 31-10-2007 / 01:56:33 / cg" |
|
7942 |
"Modified: / 05-11-2007 / 12:19:04 / cg" |
|
7943 |
! |
|
7944 |
||
7945 |
removeTrayIconFor:aView |
|
7946 |
"remove the tray icon. |
|
7947 |
intentionally ignored here - only supported by win32 (for now)" |
|
7948 |
||
7949 |
^ self |
|
7950 |
||
7951 |
"Created: / 05-11-2007 / 12:17:38 / cg" |
|
7952 |
! |
|
7953 |
||
7954 |
setTrayIconFor:aView icon:wicon iconMask:wiconMaskArg |
|
7955 |
"change the tray icon. |
|
7956 |
intentionally ignored here - only supported by win32 (for now)" |
|
7957 |
||
7958 |
^ self |
|
7959 |
||
7960 |
"Created: / 05-11-2007 / 12:14:09 / cg" |
|
7961 |
! |
|
7962 |
||
7963 |
setTrayIconsToolTipMessageFor:aView to:toolTipMessageArg |
|
5061
f6422d11163a
so allow for smallInt keyPress codes (used to be characters)
Claus Gittinger <cg@exept.de>
parents:
5035
diff
changeset
|
7964 |
"Change the toolTopText. |
4838 | 7965 |
intentionally ignored here - only supported by win32 (for now)" |
7966 |
||
7967 |
^ self |
|
7968 |
||
7969 |
"Created: / 05-11-2007 / 12:14:21 / cg" |
|
7970 |
! ! |
|
7971 |
||
54 | 7972 |
!DeviceWorkstation methodsFor:'view registration'! |
0 | 7973 |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
7974 |
addKnownView:aView withId:aWindowID |
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
7975 |
"add the View aView with id:aWindowID to the list of known views/id's. |
51 | 7976 |
This map is needed later (on event arrival) to get the view from |
7695 | 7977 |
the view's id (which is passed along with the devices event) quickly." |
0 | 7978 |
|
7979 |
knownViews isNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
7980 |
knownViews := WeakValueDictionary new:500. |
7450 | 7981 |
]. |
7982 |
knownViews at:aWindowID put:aView. |
|
1406
2aa01c6279f0
fast mapping from viewID to view (experimental)
Claus Gittinger <cg@exept.de>
parents:
1383
diff
changeset
|
7983 |
|
332
48f78f549e5f
dont want two dispatchers after restart (addknownView started it; Smalltalk>>restart did it again)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
7984 |
"/ dispatching ifFalse:[ |
48f78f549e5f
dont want two dispatchers after restart (addknownView started it; Smalltalk>>restart did it again)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
7985 |
"/ self startDispatch |
48f78f549e5f
dont want two dispatchers after restart (addknownView started it; Smalltalk>>restart did it again)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
7986 |
"/ ]. |
48f78f549e5f
dont want two dispatchers after restart (addknownView started it; Smalltalk>>restart did it again)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
7987 |
|
1515 | 7988 |
"Modified: 2.4.1997 / 19:15:46 / cg" |
1525 | 7989 |
! |
0 | 7990 |
|
2874
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2872
diff
changeset
|
7991 |
initializeTopViewHookFor:aView |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2872
diff
changeset
|
7992 |
"callBack from topViews initialize method. |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2872
diff
changeset
|
7993 |
empty here, but may be useful ..." |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2872
diff
changeset
|
7994 |
! |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2872
diff
changeset
|
7995 |
|
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2872
diff
changeset
|
7996 |
realizedTopViewHookFor:aView |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2872
diff
changeset
|
7997 |
"callBack from topViews realize method. |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2872
diff
changeset
|
7998 |
empty here, but may be useful ..." |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2872
diff
changeset
|
7999 |
! |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2872
diff
changeset
|
8000 |
|
1478
042a65d624cd
reorganize knownViews/knownIds table when views are removed.
Claus Gittinger <cg@exept.de>
parents:
1475
diff
changeset
|
8001 |
removeKnownView:aView withId:aViewId |
6331 | 8002 |
"remove aView from the list of known views/id's. |
8003 |
One of aView of aViewId may be nil. The nil one is computed from the other variable." |
|
8004 |
||
7450 | 8005 |
|removedView| |
54 | 8006 |
|
1267
a27c2daaea25
remember lastView/id when searching view by id - helps often
Claus Gittinger <cg@exept.de>
parents:
1258
diff
changeset
|
8007 |
lastId := nil. |
a27c2daaea25
remember lastView/id when searching view by id - helps often
Claus Gittinger <cg@exept.de>
parents:
1258
diff
changeset
|
8008 |
lastView := nil. |
46 | 8009 |
|
0 | 8010 |
knownViews notNil ifTrue:[ |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8011 |
aViewId notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8012 |
removedView := knownViews removeKey:aViewId ifAbsent:[]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8013 |
focusView == removedView ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8014 |
focusView := nil |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8015 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8016 |
] ifFalse:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8017 |
focusView == aView ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8018 |
focusView := nil |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8019 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8020 |
knownViews removeIdentityValue:aView ifAbsent:[]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8021 |
]. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8022 |
self checkForEndOfDispatch. |
7450 | 8023 |
]. |
958 | 8024 |
|
1478
042a65d624cd
reorganize knownViews/knownIds table when views are removed.
Claus Gittinger <cg@exept.de>
parents:
1475
diff
changeset
|
8025 |
"Created: 22.3.1997 / 14:56:20 / cg" |
1493
b162273f59f9
oops - idToTableIndexMapping seems to become nil ?!
Claus Gittinger <cg@exept.de>
parents:
1484
diff
changeset
|
8026 |
"Modified: 27.3.1997 / 17:13:28 / cg" |
0 | 8027 |
! |
8028 |
||
293 | 8029 |
viewFromId:aWindowID |
6576 | 8030 |
"given an Id, return the corresponding view. |
6885 | 8031 |
Return nil for unknown windows |
6576 | 8032 |
(can happen for external window, if a key grab is active)" |
293 | 8033 |
|
7450 | 8034 |
|view| |
8035 |
||
8036 |
knownViews isNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8037 |
^ nil. |
7450 | 8038 |
]. |
8039 |
||
8040 |
lastId = aWindowID ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8041 |
^ lastView. |
7450 | 8042 |
]. |
8043 |
||
8044 |
view := knownViews at:aWindowID ifAbsent:[]. |
|
8045 |
view notNil ifTrue:[ |
|
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8046 |
lastView := view. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8047 |
lastId := aWindowID. |
7450 | 8048 |
]. |
8049 |
^ view. |
|
1267
a27c2daaea25
remember lastView/id when searching view by id - helps often
Claus Gittinger <cg@exept.de>
parents:
1258
diff
changeset
|
8050 |
|
1484 | 8051 |
"Modified: 22.3.1997 / 17:19:59 / cg" |
1525 | 8052 |
! |
8053 |
||
8054 |
viewIdKnown:aWindowID |
|
8055 |
"return true, if I still consider a windowId as being valid" |
|
8056 |
||
7450 | 8057 |
^ knownViews includesKey:aWindowID. |
1525 | 8058 |
|
8059 |
"Created: 4.4.1997 / 11:01:07 / cg" |
|
1547 | 8060 |
"Modified: 4.4.1997 / 19:07:55 / cg" |
0 | 8061 |
! ! |
8062 |
||
12 | 8063 |
!DeviceWorkstation methodsFor:'window stuff'! |
8064 |
||
2756 | 8065 |
activateWindow:aWindowId |
8066 |
"make a window active. |
|
4353 | 8067 |
Fall back to raiseWindow here" |
8068 |
||
5151 | 8069 |
self raiseWindowToTop:aWindowId. |
4353 | 8070 |
! |
8071 |
||
293 | 8072 |
clearRectangleX:x y:y width:width height:height in:aWindowId |
8073 |
"clear a rectangular area of a window to its view background" |
|
8074 |
||
2648 | 8075 |
"/ mhmh - should not be needed |
293 | 8076 |
^ self subclassResponsibility |
8077 |
! |
|
8078 |
||
8079 |
clearWindow:aWindowId |
|
8080 |
"clear a windows to its view background" |
|
8081 |
||
2648 | 8082 |
"/ mhmh - should not be needed |
293 | 8083 |
^ self subclassResponsibility |
8084 |
! |
|
8085 |
||
8086 |
lowerWindow:aWindowId |
|
609 | 8087 |
"lower a window" |
8088 |
||
293 | 8089 |
^ self subclassResponsibility |
609 | 8090 |
|
8091 |
"Modified: 24.4.1996 / 19:40:04 / cg" |
|
293 | 8092 |
! |
8093 |
||
2106
8fdc7283a99f
pass minExtent/maxExtent to mapView:...
Claus Gittinger <cg@exept.de>
parents:
2053
diff
changeset
|
8094 |
mapView:aView id:aWindowId iconified:aBoolean atX:xPos y:yPos width:w height:h |
8fdc7283a99f
pass minExtent/maxExtent to mapView:...
Claus Gittinger <cg@exept.de>
parents:
2053
diff
changeset
|
8095 |
"map a window - either as icon or as a real view - needed for restart" |
8fdc7283a99f
pass minExtent/maxExtent to mapView:...
Claus Gittinger <cg@exept.de>
parents:
2053
diff
changeset
|
8096 |
|
8fdc7283a99f
pass minExtent/maxExtent to mapView:...
Claus Gittinger <cg@exept.de>
parents:
2053
diff
changeset
|
8097 |
"/ OBSOLETE interface - this looses the minExtent/maxExtent properties |
8fdc7283a99f
pass minExtent/maxExtent to mapView:...
Claus Gittinger <cg@exept.de>
parents:
2053
diff
changeset
|
8098 |
"/ use mapView:...minWidth:minHeight:maxWidth:maxHeight: |
8fdc7283a99f
pass minExtent/maxExtent to mapView:...
Claus Gittinger <cg@exept.de>
parents:
2053
diff
changeset
|
8099 |
|
8fdc7283a99f
pass minExtent/maxExtent to mapView:...
Claus Gittinger <cg@exept.de>
parents:
2053
diff
changeset
|
8100 |
^ self |
6296 | 8101 |
mapView:aView id:aWindowId iconified:aBoolean atX:xPos y:yPos |
8102 |
width:w height:h minExtent:nil maxExtent:nil |
|
2106
8fdc7283a99f
pass minExtent/maxExtent to mapView:...
Claus Gittinger <cg@exept.de>
parents:
2053
diff
changeset
|
8103 |
! |
8fdc7283a99f
pass minExtent/maxExtent to mapView:...
Claus Gittinger <cg@exept.de>
parents:
2053
diff
changeset
|
8104 |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
8105 |
mapView:aView id:aWindowId iconified:aBoolean atX:xPos y:yPos |
6296 | 8106 |
width:w height:h minExtent:minExt maxExtent:maxExt |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
8107 |
"make a window visible - either as icon or as a real view - needed for restart" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
8108 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
8109 |
^ self subclassResponsibility |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
8110 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
8111 |
"Modified: 24.4.1996 / 19:43:17 / cg" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
8112 |
! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
8113 |
|
293 | 8114 |
mapWindow:aWindowId |
609 | 8115 |
"map a window" |
8116 |
||
293 | 8117 |
^ self subclassResponsibility |
609 | 8118 |
|
8119 |
"Modified: 24.4.1996 / 19:43:06 / cg" |
|
293 | 8120 |
! |
8121 |
||
4489
8e481f09dd33
preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents:
4485
diff
changeset
|
8122 |
mapWindow:aWindowId animation:animationSymbolorNil time:timeInMillisOrNil |
8e481f09dd33
preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents:
4485
diff
changeset
|
8123 |
"unmap a window" |
8e481f09dd33
preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents:
4485
diff
changeset
|
8124 |
|
8e481f09dd33
preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents:
4485
diff
changeset
|
8125 |
^ self mapWindow:aWindowId |
8e481f09dd33
preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents:
4485
diff
changeset
|
8126 |
! |
8e481f09dd33
preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents:
4485
diff
changeset
|
8127 |
|
293 | 8128 |
moveResizeWindow:aWindowId x:x y:y width:w height:h |
609 | 8129 |
"move & resize a window" |
8130 |
||
1002 | 8131 |
"/ fallBack: move & resize as two individual operations |
8132 |
||
8133 |
self moveWindow:aWindowId x:x y:y. |
|
1003 | 8134 |
self resizeWindow:aWindowId width:w height:h. |
293 | 8135 |
! |
8136 |
||
8137 |
moveWindow:aWindowId x:x y:y |
|
609 | 8138 |
"move a window" |
8139 |
||
293 | 8140 |
^ self subclassResponsibility |
609 | 8141 |
|
8142 |
"Modified: 24.4.1996 / 19:40:36 / cg" |
|
293 | 8143 |
! |
8144 |
||
8145 |
raiseWindow:aWindowId |
|
5151 | 8146 |
"raise a window. |
8147 |
In some systems (aka MSWindows), this raises only above all other st/x views, |
|
8148 |
but not above other-application's views, which have a TOPMOST attribute. |
|
8149 |
Se raiseWindowToTop for this." |
|
609 | 8150 |
|
293 | 8151 |
^ self subclassResponsibility |
609 | 8152 |
|
8153 |
"Modified: 24.4.1996 / 19:40:42 / cg" |
|
293 | 8154 |
! |
8155 |
||
5151 | 8156 |
raiseWindowToTop:aWindowId |
8157 |
"raise a window above all others (even above non-st/x windows)" |
|
8158 |
||
8159 |
self raiseWindow:aWindowId |
|
8160 |
! |
|
8161 |
||
2428 | 8162 |
reparentWindow:windowId to:newParentWindowId |
8163 |
"change a windows parent (an optional interface). |
|
8033 | 8164 |
Returns true if successful." |
2428 | 8165 |
|
8166 |
^ false |
|
8033 | 8167 |
|
8168 |
"Modified (comment): / 23-05-2017 / 14:57:40 / mawalch" |
|
2428 | 8169 |
! |
8170 |
||
293 | 8171 |
resizeWindow:aWindowId width:w height:h |
609 | 8172 |
"resize a window" |
8173 |
||
293 | 8174 |
^ self subclassResponsibility |
609 | 8175 |
|
8176 |
"Modified: 24.4.1996 / 19:40:47 / cg" |
|
12 | 8177 |
! |
8178 |
||
8179 |
restoreCursors |
|
1475 | 8180 |
"restore the cursors of all views to their current cursor. |
8181 |
This undoes the effect of #setCursors:" |
|
46 | 8182 |
|
7450 | 8183 |
self allViewsDo:[:aView | |
8393
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8184 |
|c vid cid| |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8185 |
|
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8186 |
(vid := aView drawableId) notNil ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8187 |
c := aView cursor. |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8188 |
(c notNil and:[(cid := c id) notNil]) ifTrue:[ |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8189 |
self setCursor:cid in:vid |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8190 |
] |
43fd938de095
feature: added focusWIndowGroup instvar to remember the last group which
Claus Gittinger <cg@exept.de>
parents:
8371
diff
changeset
|
8191 |
] |
7450 | 8192 |
]. |
8193 |
self flush. |
|
12 | 8194 |
|
1475 | 8195 |
" |
8196 |
Display setCursors:(Cursor wait). |
|
8197 |
Delay waitForSeconds:5. |
|
8198 |
Display restoreCursors |
|
8199 |
" |
|
8200 |
||
8201 |
"Modified: 20.3.1997 / 16:28:25 / cg" |
|
12 | 8202 |
! |
8203 |
||
293 | 8204 |
setBackingStore:how in:aWindowId |
2648 | 8205 |
"turn on/off backing-store for a window. |
8206 |
A view with backingStore will redraw automatically |
|
8207 |
from the backing pixmap (without sending expose events). |
|
8208 |
An implementation may ignore this request." |
|
23 | 8209 |
|
1002 | 8210 |
"/ default here is to ignore the request |
23 | 8211 |
! |
8212 |
||
1007
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8213 |
setBitGravity:how in:aWindowId |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8214 |
"set bit gravity for a window" |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8215 |
|
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8216 |
"/ default here is to ignore the request |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8217 |
! |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8218 |
|
293 | 8219 |
setCursor:aCursorId in:aWindowId |
6560 | 8220 |
"set a window's cursor" |
2648 | 8221 |
|
8222 |
"/ mhmh - could be ignored |
|
12 | 8223 |
^ self subclassResponsibility |
8224 |
! |
|
8225 |
||
293 | 8226 |
setCursors:aCursor |
1475 | 8227 |
"change the cursor of all views on the receiver device |
6560 | 8228 |
to aCursorId, without affecting the view's idea of what |
8229 |
the cursor is (so that it can be restored from the view's |
|
1475 | 8230 |
cursor instance variable later). |
6560 | 8231 |
Use of this is not recommended - it's better to change |
1475 | 8232 |
the cursor of a windowGroup alone." |
293 | 8233 |
|
2648 | 8234 |
|id| |
293 | 8235 |
|
3063
cb325adb5731
care for nil cursor in #setCursors:
Claus Gittinger <cg@exept.de>
parents:
3038
diff
changeset
|
8236 |
aCursor isNil ifTrue:[^ self]. |
cb325adb5731
care for nil cursor in #setCursors:
Claus Gittinger <cg@exept.de>
parents:
3038
diff
changeset
|
8237 |
|
1499 | 8238 |
id := (aCursor onDevice:self) id. |
293 | 8239 |
id notNil ifTrue:[ |
7450 | 8240 |
self allViewsDo:[:aView | |
6885 | 8241 |
|vid| |
8242 |
||
8243 |
(vid := aView id) notNil ifTrue:[ |
|
8244 |
self setCursor:id in:vid |
|
8245 |
] |
|
8246 |
]. |
|
8247 |
self flush |
|
293 | 8248 |
] |
8249 |
||
1475 | 8250 |
" |
8251 |
Display setCursors:(Cursor wait). |
|
8252 |
Delay waitForSeconds:5. |
|
8253 |
Display restoreCursors. |
|
8254 |
" |
|
8255 |
||
1499 | 8256 |
"Modified: 28.3.1997 / 16:14:59 / cg" |
0 | 8257 |
! |
8258 |
||
4369
998f4525d159
Make snapshot writing more robust against errors.
Stefan Vogel <sv@exept.de>
parents:
4353
diff
changeset
|
8259 |
setForegroundWindow:aWindowId |
998f4525d159
Make snapshot writing more robust against errors.
Stefan Vogel <sv@exept.de>
parents:
4353
diff
changeset
|
8260 |
"make a window active. |
998f4525d159
Make snapshot writing more robust against errors.
Stefan Vogel <sv@exept.de>
parents:
4353
diff
changeset
|
8261 |
Fall back to raiseWindow here" |
998f4525d159
Make snapshot writing more robust against errors.
Stefan Vogel <sv@exept.de>
parents:
4353
diff
changeset
|
8262 |
|
5151 | 8263 |
self raiseWindowToTop:aWindowId. |
4369
998f4525d159
Make snapshot writing more robust against errors.
Stefan Vogel <sv@exept.de>
parents:
4353
diff
changeset
|
8264 |
! |
998f4525d159
Make snapshot writing more robust against errors.
Stefan Vogel <sv@exept.de>
parents:
4353
diff
changeset
|
8265 |
|
293 | 8266 |
setIconName:aString in:aWindowId |
8267 |
"set a windows icon name" |
|
10 | 8268 |
|
1002 | 8269 |
"/ default here is to ignore the request |
0 | 8270 |
! |
8271 |
||
8272 |
setSaveUnder:yesOrNo in:aWindowId |
|
2648 | 8273 |
"turn on/off save-under for a window. |
8274 |
A view with saveUnder will save the pixels of the |
|
8275 |
area covered by itself and repair from those when |
|
8276 |
unmapped (therefore, no expose events are generated later). |
|
8277 |
It is especially useful for popUp menus. |
|
8278 |
An implementation may ignore this request." |
|
10 | 8279 |
|
1002 | 8280 |
"/ default here is to ignore the request |
0 | 8281 |
! |
8282 |
||
1881 | 8283 |
setTransient:aWindowId for:aMainWindowId |
2648 | 8284 |
"set aWindowId to be a transient of aMainWindow. |
8285 |
This informs the windowManager that those are to |
|
8286 |
be handled as a group w.r.t. iconification and deiconification. |
|
4350 | 8287 |
An implementation may ignore this |
2648 | 8288 |
(being somewhat inconvenient to the user, though)" |
8289 |
||
8290 |
"/ default here is to ignore the request |
|
1881 | 8291 |
|
8292 |
"Created: 20.8.1997 / 20:38:32 / cg" |
|
8293 |
! |
|
8294 |
||
0 | 8295 |
setWindowBackground:aColorIndex in:aWindowId |
10 | 8296 |
"set a windows background color" |
0 | 8297 |
|
8298 |
^ self subclassResponsibility |
|
8299 |
! |
|
8300 |
||
8301 |
setWindowBackgroundPixmap:aPixmapId in:aWindowId |
|
2636 | 8302 |
"set a windows background pattern to be a form. |
8303 |
No need to be implemented in concrete workstation; |
|
8304 |
if not implemented, its done by (slower) smalltalk code |
|
8305 |
(must return false from #supportsViewBackgroundPixmap query)" |
|
8306 |
||
8307 |
^ self |
|
8308 |
||
8309 |
"Modified: / 4.5.1999 / 19:06:13 / cg" |
|
0 | 8310 |
! |
8311 |
||
8312 |
setWindowBorderColor:aColorIndex in:aWindowId |
|
10 | 8313 |
"set a windows border color" |
8314 |
||
1002 | 8315 |
"/ default here is to ignore the request |
8316 |
||
8317 |
^ self |
|
0 | 8318 |
! |
8319 |
||
8320 |
setWindowBorderPixmap:aPixmapId in:aWindowId |
|
10 | 8321 |
"set a windows border pattern" |
8322 |
||
1002 | 8323 |
"/ default here is to ignore the request |
8324 |
||
8325 |
^ self |
|
0 | 8326 |
! |
8327 |
||
8328 |
setWindowBorderShape:aPixmapId in:aWindowId |
|
10 | 8329 |
"set a windows border shape" |
8330 |
||
1002 | 8331 |
"/ default here is to ignore the request |
8332 |
||
8333 |
^ self |
|
0 | 8334 |
! |
8335 |
||
293 | 8336 |
setWindowBorderWidth:aNumber in:aWindowId |
8337 |
"set a windows border width" |
|
10 | 8338 |
|
0 | 8339 |
^ self subclassResponsibility |
8340 |
! |
|
8341 |
||
857
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
849
diff
changeset
|
8342 |
setWindowClass:wClass name:wName in:aWindowId |
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
849
diff
changeset
|
8343 |
"define class and name of a window. |
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
849
diff
changeset
|
8344 |
This may be used by the window manager to |
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
849
diff
changeset
|
8345 |
select client specific resources." |
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
849
diff
changeset
|
8346 |
|
1007
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8347 |
"/ default here is to ignore the request |
857
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
849
diff
changeset
|
8348 |
|
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
849
diff
changeset
|
8349 |
"Created: 14.6.1996 / 17:23:34 / stefan" |
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
849
diff
changeset
|
8350 |
! |
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
849
diff
changeset
|
8351 |
|
1007
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8352 |
setWindowGravity:how in:aWindowId |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8353 |
"set window gravity for a window" |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8354 |
|
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8355 |
"/ default here is to ignore the request |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8356 |
! |
6b6b2a63f01d
support for non-selectable devices (WIN32)
Claus Gittinger <cg@exept.de>
parents:
1003
diff
changeset
|
8357 |
|
0 | 8358 |
setWindowIcon:aForm in:aWindowId |
2648 | 8359 |
"define a bitmap to be used as icon" |
8360 |
||
8361 |
self |
|
6296 | 8362 |
setWindowIcon:aForm |
8363 |
mask:nil |
|
8364 |
in:aWindowId |
|
1375 | 8365 |
! |
8366 |
||
8367 |
setWindowIcon:aForm mask:aMaskForm in:aWindowId |
|
8368 |
"set a windows icon & iconMask" |
|
10 | 8369 |
|
2648 | 8370 |
"/ default here is to ignore the request |
0 | 8371 |
! |
8372 |
||
8373 |
setWindowIconWindow:aView in:aWindowId |
|
10 | 8374 |
"set a windows icon window" |
8375 |
||
2648 | 8376 |
"/ default here is to ignore the request |
8377 |
! |
|
8378 |
||
3244 | 8379 |
setWindowMinExtent:minExt maxExtent:maxExt in:aWindowId |
8380 |
"set a windows minimum & max extents. |
|
8381 |
nil arguments are ignored." |
|
8382 |
||
8383 |
|minW minH maxW maxH| |
|
8384 |
||
8385 |
minExt notNil ifTrue:[ |
|
6296 | 8386 |
minW := minExt x. |
8387 |
minH := minExt y. |
|
3244 | 8388 |
]. |
8389 |
maxExt notNil ifTrue:[ |
|
6296 | 8390 |
maxW := maxExt x. |
8391 |
maxH := maxExt y. |
|
3244 | 8392 |
]. |
8393 |
self setWindowMinExtentX:minW y:minH maxExtentX:maxW y:maxH in:aWindowId |
|
8394 |
! |
|
8395 |
||
8396 |
setWindowMinExtentX:minW y:minH maxExtentX:maxW y:maxH in:aWindowId |
|
2648 | 8397 |
"set a windows minimum & max extents. |
8398 |
nil arguments are ignored." |
|
8399 |
||
0 | 8400 |
^ self subclassResponsibility |
8401 |
! |
|
8402 |
||
293 | 8403 |
setWindowName:aString in:aWindowId |
2872 | 8404 |
"define a windows name (i.e. windowTitle)" |
10 | 8405 |
|
0 | 8406 |
^ self subclassResponsibility |
8407 |
! |
|
8408 |
||
5977
8d55715c166f
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5969
diff
changeset
|
8409 |
setWindowPid:anIntegerOrNil in:aWindowId |
8d55715c166f
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5969
diff
changeset
|
8410 |
"Sets the _NET_WM_PID property for the window. |
8d55715c166f
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5969
diff
changeset
|
8411 |
This may be used by the window manager to group windows. |
8d55715c166f
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5969
diff
changeset
|
8412 |
If anIntegerOrNil is nil, then PID of currently running |
8d55715c166f
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5969
diff
changeset
|
8413 |
Smalltalk is used" |
8d55715c166f
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5969
diff
changeset
|
8414 |
|
8d55715c166f
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5969
diff
changeset
|
8415 |
"/ default here is to ignore the request |
8d55715c166f
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5969
diff
changeset
|
8416 |
|
8d55715c166f
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5969
diff
changeset
|
8417 |
"Created: / 04-01-2013 / 16:02:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8d55715c166f
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5969
diff
changeset
|
8418 |
! |
8d55715c166f
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5969
diff
changeset
|
8419 |
|
293 | 8420 |
setWindowShape:aPixmapId in:aWindowId |
8421 |
"set a windows visible shape" |
|
8422 |
||
1002 | 8423 |
"/ default here is to ignore the request |
0 | 8424 |
! |
8425 |
||
8426 |
unmapWindow:aWindowId |
|
609 | 8427 |
"unmap a window" |
8428 |
||
0 | 8429 |
^ self subclassResponsibility |
609 | 8430 |
|
8431 |
"Modified: 24.4.1996 / 19:42:39 / cg" |
|
1532 | 8432 |
! |
8433 |
||
4489
8e481f09dd33
preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents:
4485
diff
changeset
|
8434 |
unmapWindow:aWindowId animation:animationSymbolorNil time:timeInMillisOrNil |
8e481f09dd33
preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents:
4485
diff
changeset
|
8435 |
"unmap a window" |
8e481f09dd33
preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents:
4485
diff
changeset
|
8436 |
|
8e481f09dd33
preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents:
4485
diff
changeset
|
8437 |
^ self unmapWindow:aWindowId |
8e481f09dd33
preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents:
4485
diff
changeset
|
8438 |
! |
8e481f09dd33
preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents:
4485
diff
changeset
|
8439 |
|
1532 | 8440 |
windowIsIconified:aWindowId |
8441 |
"return true, if a window is iconified" |
|
8442 |
||
8443 |
^ self subclassResponsibility |
|
8444 |
||
8445 |
"Modified: 24.4.1996 / 19:42:39 / cg" |
|
8446 |
"Created: 4.4.1997 / 14:45:26 / cg" |
|
0 | 8447 |
! ! |
8448 |
||
3478 | 8449 |
!DeviceWorkstation::DeviceFontMetrics methodsFor:'accessing'! |
8450 |
||
8451 |
ascent |
|
3862 | 8452 |
"return the ascent" |
3478 | 8453 |
|
8454 |
^ ascent |
|
8455 |
! |
|
8456 |
||
6296 | 8457 |
ascent:ascentArg descent:descentArg |
6164
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
8458 |
ascent := ascentArg. |
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
8459 |
descent := descentArg. |
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
8460 |
! |
1860d4131349
class: DeviceWorkstation::DeviceFontMetrics
Stefan Vogel <sv@exept.de>
parents:
6149
diff
changeset
|
8461 |
|
3478 | 8462 |
ascent:ascentArg descent:descentArg maxAscent:maxAscentArg maxDescent:maxDescentArg minWidth:minWidthArg maxWidth:maxWidthArg avgWidth:avgWidthArg |
3862 | 8463 |
"set corresponding instance variables" |
8464 |
||
3478 | 8465 |
ascent := ascentArg. |
8466 |
descent := descentArg. |
|
8467 |
maxAscent := maxAscentArg. |
|
8468 |
maxDescent := maxDescentArg. |
|
8469 |
minWidth := minWidthArg. |
|
8470 |
maxWidth := maxWidthArg. |
|
8471 |
averageWidth := avgWidthArg |
|
8472 |
! |
|
8473 |
||
4350 | 8474 |
ascent:ascentArg descent:descentArg maxAscent:maxAscentArg maxDescent:maxDescentArg |
4020 | 8475 |
minWidth:minWidthArg maxWidth:maxWidthArg avgWidth:avgWidthArg minCode:minCodeArg maxCode:maxCodeArg |
8476 |
"set corresponding instance variables" |
|
8477 |
||
8478 |
ascent := ascentArg. |
|
8479 |
descent := descentArg. |
|
8480 |
maxAscent := maxAscentArg. |
|
8481 |
maxDescent := maxDescentArg. |
|
8482 |
minWidth := minWidthArg. |
|
8483 |
maxWidth := maxWidthArg. |
|
8484 |
averageWidth := avgWidthArg. |
|
8485 |
minCode := minCodeArg. |
|
8486 |
maxCode := maxCodeArg. |
|
8487 |
! |
|
8488 |
||
4350 | 8489 |
ascent:ascentArg descent:descentArg maxAscent:maxAscentArg maxDescent:maxDescentArg |
4020 | 8490 |
minWidth:minWidthArg maxWidth:maxWidthArg avgWidth:avgWidthArg minCode:minCodeArg maxCode:maxCodeArg |
8491 |
direction:directionArg |
|
8492 |
"set corresponding instance variables" |
|
8493 |
||
8494 |
ascent := ascentArg. |
|
8495 |
descent := descentArg. |
|
8496 |
maxAscent := maxAscentArg. |
|
8497 |
maxDescent := maxDescentArg. |
|
8498 |
minWidth := minWidthArg. |
|
8499 |
maxWidth := maxWidthArg. |
|
8500 |
averageWidth := avgWidthArg. |
|
8501 |
minCode := minCodeArg. |
|
8502 |
maxCode := maxCodeArg. |
|
8503 |
direction := directionArg. |
|
8504 |
! |
|
8505 |
||
4350 | 8506 |
ascent:ascentArg descent:descentArg maxAscent:maxAscentArg maxDescent:maxDescentArg |
4087 | 8507 |
minWidth:minWidthArg maxWidth:maxWidthArg avgWidth:avgWidthArg minCode:minCodeArg maxCode:maxCodeArg |
8508 |
direction:directionArg encoding:encodingArg |
|
8509 |
"set corresponding instance variables" |
|
8510 |
||
8511 |
ascent := ascentArg. |
|
8512 |
descent := descentArg. |
|
8513 |
maxAscent := maxAscentArg. |
|
8514 |
maxDescent := maxDescentArg. |
|
8515 |
minWidth := minWidthArg. |
|
8516 |
maxWidth := maxWidthArg. |
|
8517 |
averageWidth := avgWidthArg. |
|
8518 |
minCode := minCodeArg. |
|
8519 |
maxCode := maxCodeArg. |
|
8520 |
direction := directionArg. |
|
8521 |
encoding := encodingArg. |
|
8522 |
! |
|
8523 |
||
3478 | 8524 |
averageWidth |
3862 | 8525 |
"return the averageWidth" |
3478 | 8526 |
|
8527 |
^ averageWidth |
|
8528 |
! |
|
8529 |
||
8530 |
descent |
|
3862 | 8531 |
"return the descent" |
3478 | 8532 |
|
8533 |
^ descent |
|
8534 |
! |
|
8535 |
||
4020 | 8536 |
direction |
8537 |
"return the drawing direction (think of hebrew and arabic !!)" |
|
8538 |
||
4021 | 8539 |
^ direction ? #LeftToRight |
4020 | 8540 |
! |
8541 |
||
3478 | 8542 |
encoding |
3862 | 8543 |
"return the encoding" |
3478 | 8544 |
|
8545 |
^ encoding |
|
8546 |
! |
|
8547 |
||
8548 |
maxAscent |
|
3862 | 8549 |
"return the maxAscent" |
3478 | 8550 |
|
8551 |
^ maxAscent |
|
8552 |
! |
|
8553 |
||
4022 | 8554 |
maxCode |
8555 |
^ maxCode ? 16rFFFF |
|
8556 |
! |
|
8557 |
||
3478 | 8558 |
maxDescent |
3862 | 8559 |
"return the maxDescent" |
3478 | 8560 |
|
8561 |
^ maxDescent |
|
8562 |
! |
|
8563 |
||
8564 |
maxWidth |
|
3862 | 8565 |
"return the maxWidth" |
3478 | 8566 |
|
8567 |
^ maxWidth |
|
8568 |
! |
|
8569 |
||
4022 | 8570 |
minCode |
8571 |
^ minCode ? 0 |
|
8572 |
! |
|
8573 |
||
3478 | 8574 |
minWidth |
3862 | 8575 |
"return the minWidth" |
3478 | 8576 |
|
8577 |
^ minWidth |
|
8578 |
! ! |
|
8579 |
||
1075
62f0cfb3c956
dont return nil entries in #knownViews
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
8580 |
!DeviceWorkstation class methodsFor:'documentation'! |
293 | 8581 |
|
8582 |
version |
|
6877 | 8583 |
^ '$Header$' |
5509
fe84ac005fbc
comment/format in: #listOfAvailableFonts
Stefan Vogel <sv@exept.de>
parents:
5339
diff
changeset
|
8584 |
! |
fe84ac005fbc
comment/format in: #listOfAvailableFonts
Stefan Vogel <sv@exept.de>
parents:
5339
diff
changeset
|
8585 |
|
fe84ac005fbc
comment/format in: #listOfAvailableFonts
Stefan Vogel <sv@exept.de>
parents:
5339
diff
changeset
|
8586 |
version_CVS |
6877 | 8587 |
^ '$Header$' |
0 | 8588 |
! ! |
3740
14cfe4f8255e
Change sends to obsolete methods
Stefan Vogel <sv@exept.de>
parents:
3710
diff
changeset
|
8589 |
|
5980 | 8590 |
|
293 | 8591 |
DeviceWorkstation initialize! |