--- a/DeviceWorkstation.st Thu Jul 11 14:20:55 2002 +0200
+++ b/DeviceWorkstation.st Thu Jul 11 14:23:18 2002 +0200
@@ -1,6 +1,6 @@
"
COPYRIGHT (c) 1993 by Claus Gittinger
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -27,7 +27,7 @@
numFixBlue fixGrayColors copyBuffer lastCopyBuffer blackColor
whiteColor focusMode activeView clipBoardEncoding focusView
deviceErrorSignal deviceIOErrorSignal mayOpenDebugger
- suppressDebugger'
+ suppressDebugger eventSema'
classVariableNames:'ButtonTranslation MultiClickTimeDelta DeviceErrorSignal
DeviceOpenErrorSignal DeviceIOErrorSignal
DeviceIOTimeoutErrorSignal ErrorPrinting DefaultScreen AllScreens
@@ -51,7 +51,7 @@
copyright
"
COPYRIGHT (c) 1993 by Claus Gittinger
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -82,7 +82,7 @@
depth <SmallInteger> bits per color
ncells <SmallInteger> number of colors (i.e. colormap size; not always == 2^depth)
bitsPerRGB <SmallInteger> number of valid bits per rgb component
- (actual number taken in A/D converter; not all devices report the true value)
+ (actual number taken in A/D converter; not all devices report the true value)
bitsRed <SmallInteger> number of red bits (only valid for TrueColor displays)
bitsGreen <SmallInteger> number of green bits (only valid for TrueColor displays)
bitsBlue <SmallInteger> number of blue bits (only valid for TrueColor displays)
@@ -110,8 +110,8 @@
dispatching <Boolean> true, if currently in dispatch loop
exitDispatchOnLastWindowClose
- <Boolean> if true, dispatch is finished when the last
- window closes (default:true).
+ <Boolean> if true, dispatch is finished when the last
+ window closes (default:true).
ctrlDown <Boolean> true, if control key currently pressed
shiftDown <Boolean> true, if shift key currently pressed
@@ -119,8 +119,8 @@
altDown <Boolean> true, if alt key is currently pressed
motionEventCompression
- <Boolean> if true motion events are compressed
- (obsolete: now done in sensor)
+ <Boolean> if true motion events are compressed
+ (obsolete: now done in sensor)
lastId <Number> the id of the last events view (internal)
lastView <View> the last events view (internal, for faster id->view mapping)
@@ -128,38 +128,38 @@
keyboardMap <KeyBdMap> mapping for keys
rootView <DisplayRootView> this displays root window
isSlow <Boolean> set/cleared from startup - used to turn off
- things like popup-shadows etc.
+ things like popup-shadows etc.
focusMode <Symbol> nil, #pointer or #activeWindow
activeWindow <View> WINDOWS only: the currently active (foreground) view
clipBoardEncoding
- <Symbol> encoding of pasted clipBoard text;
- nil means: iso8859.
- set this to #shiftJis, if pasting
- SJIS text (for example, from netscape)
- Some systems pass encoding information
- in the clipBoard - there, this is not
- needed.
+ <Symbol> encoding of pasted clipBoard text;
+ nil means: iso8859.
+ set this to #shiftJis, if pasting
+ SJIS text (for example, from netscape)
+ Some systems pass encoding information
+ in the clipBoard - there, this is not
+ needed.
[class variables:]
MultiClickTimeDelta in ms; controls how long of a delay is
- required between two clicks, to NOT take
- it as a multi-click.
+ required between two clicks, to NOT take
+ it as a multi-click.
ErrorPrinting controls low-level (X-) error message printing
AllScreens a collectin of known screens
[see also:]
- GraphicsContext DeviceDrawable
- WindowSensor WindowGroup WindowEvent
- ProcessorScheduler
- PSMedium
+ GraphicsContext DeviceDrawable
+ WindowSensor WindowGroup WindowEvent
+ ProcessorScheduler
+ PSMedium
[author:]
- Claus Gittinger
+ Claus Gittinger
"
!
@@ -182,9 +182,9 @@
Individual events can be enabled or disabled. The ones that are enabled
by default are:
- keypress / keyRelease
- buttonPress / buttonRelease / buttonMotion (i.e. motion with button pressed)
- pointerEnter / pointerLeave
+ keypress / keyRelease
+ buttonPress / buttonRelease / buttonMotion (i.e. motion with button pressed)
+ pointerEnter / pointerLeave
other events have to be enabled by sending a corresponding #enableXXXEvent
message to the view which shall receive those events.
@@ -209,20 +209,20 @@
Currently, there is are twoconcrete display classes (released to the public):
- XWorkstation - a plain X window interface
-
- GLXWorkstation - an X window interface with a GL(tm) (3D graphic library)
- extension; either simulated (VGL) or a real GL
- (real GL is only available on SGI machines)
+ XWorkstation - a plain X window interface
+
+ GLXWorkstation - an X window interface with a GL(tm) (3D graphic library)
+ extension; either simulated (VGL) or a real GL
+ (real GL is only available on SGI machines)
the following are coming soon:
- OpenGLWorkstation
- - an X window interface with a openGL(tm) (3D graphic library)
- extension; either simulated (MESA) or a real openGL
- (real openGL is only available on SGI/NT machines)
-
- WinWorkstation - what will that be ?
+ OpenGLWorkstation
+ - an X window interface with a openGL(tm) (3D graphic library)
+ extension; either simulated (MESA) or a real openGL
+ (real openGL is only available on SGI/NT machines)
+
+ WinWorkstation - what will that be ?
An experimental version for a NeXTStep interface exists, but is currently
no longer maintained and not released.
@@ -244,15 +244,15 @@
- create a new instance of XWorkstation:
- Smalltalk at:#Display2 put:(XWorkstation new).
+ Smalltalk at:#Display2 put:(XWorkstation new).
or:
- Smalltalk at:#Display2 put:(GLXWorkstation new).
+ Smalltalk at:#Display2 put:(GLXWorkstation new).
- have it connect to the display (i.e. the xServer):
(replace 'localhost' below with the name of your display)
- Display2 := Display2 initializeFor:'localhost:0.0'
+ Display2 := Display2 initializeFor:'localhost:0.0'
returns nil, if connection is refused
- leaving you with Display2==nil in this case.
@@ -261,31 +261,31 @@
- start an event dispatcher process for it:
(this is now no longer needed - the first opened view will do it for you)
- Display2 startDispatch
+ Display2 startDispatch
- optionally set its keyboard map
(since this is usually done for Display in the startup-file,
the new display does not have all your added key bindings)
- Display2 keyboardMap:(Display keyboardMap)
+ Display2 keyboardMap:(Display keyboardMap)
- create a view for it:
- (FileBrowser onDevice:Display2) open
-
- (Workspace onDevice:Display2) open
-
- (Launcher onDevice:Display2) open
- does not work with Launcher, since its an ApplicationModel (not a view)
- use:
- Launcher openOnDevice:Display2
- instead.
+ (FileBrowser onDevice:Display2) open
+
+ (Workspace onDevice:Display2) open
+
+ (Launcher onDevice:Display2) open
+ does not work with Launcher, since its an ApplicationModel (not a view)
+ use:
+ Launcher openOnDevice:Display2
+ instead.
For all of the above, there is now a convenient helper method in
ApplicationModel, which allows to write:
- Application openOnXScreenNamed:'foo:0'
+ Application openOnXScreenNamed:'foo:0'
However, as mentioned above, there may be a few places, where the default
display 'Display' is still hard-coded - especially, in contributed and
@@ -312,21 +312,21 @@
event dispatchers context.
For a save environment, you should add static exception handler blocks on those
signals; i.e. the setup for remote displays should look somewhat like:
- |newDpy|
-
- newDpy := GLXWorkstation new.
- newDpy := newDpy initializeFor:'localhost:0.0'.
- newDpy isNil ifTrue:[
- self warn:'cannot connect ...'.
- ] ifFalse:[
- newDpy deviceIOErrorSignal handlerBlock:[:ex |
- Transcript beep.
- Transcript showCR:'Display (' , newDpy displayName , '): connection broken.'.
- AbortSignal raise.
- ].
- newDpy startDispatch.
- Launcher openOnDevice:newDpy.
- ].
+ |newDpy|
+
+ newDpy := GLXWorkstation new.
+ newDpy := newDpy initializeFor:'localhost:0.0'.
+ newDpy isNil ifTrue:[
+ self warn:'cannot connect ...'.
+ ] ifFalse:[
+ newDpy deviceIOErrorSignal handlerBlock:[:ex |
+ Transcript beep.
+ Transcript showCR:'Display (' , newDpy displayName , '): connection broken.'.
+ AbortSignal raise.
+ ].
+ newDpy startDispatch.
+ Launcher openOnDevice:newDpy.
+ ].
There may still some problems to be expected,
if the screens have different display capabilities (b&w vs. greyscale vs.
@@ -344,29 +344,29 @@
"create local error signals; enable errorPrinting"
DeviceErrorSignal isNil ifTrue:[
- DeviceErrorSignal := (Signal new) mayProceed:true.
- DeviceErrorSignal notifierString:'device error'.
- DeviceErrorSignal nameClass:self message:#deviceErrorSignal.
-
- DeviceOpenErrorSignal := DeviceErrorSignal newSignalMayProceed:true.
- DeviceOpenErrorSignal nameClass:self message:#deviceOpenErrorSignal.
- DeviceOpenErrorSignal notifierString:'cannot open device'.
-
- DeviceIOErrorSignal := (Signal new) mayProceed:false.
- DeviceIOErrorSignal notifierString:'device IO error'.
- DeviceIOErrorSignal nameClass:self message:#deviceIOErrorSignal.
-
- DeviceIOTimeoutErrorSignal := DeviceIOErrorSignal newSignalMayProceed:false.
- DeviceIOTimeoutErrorSignal notifierString:'device IO timeout error'.
- DeviceIOTimeoutErrorSignal nameClass:self message:#deviceIOTimeoutErrorSignal.
-
- CurrentScreenQuerySignal := QuerySignal new.
- CurrentScreenQuerySignal nameClass:self message:#currentScreenQuerySignal.
- CurrentScreenQuerySignal notifierString:'asking for current screen'.
-
- DrawingOnClosedDeviceSignal := DeviceErrorSignal newSignalMayProceed:true.
- DrawingOnClosedDeviceSignal nameClass:self message:#drawingOnClosedDeviceSignal.
- DrawingOnClosedDeviceSignal notifierString:'drawing attempt on closed graphics device'.
+ DeviceErrorSignal := (Signal new) mayProceed:true.
+ DeviceErrorSignal notifierString:'device error'.
+ DeviceErrorSignal nameClass:self message:#deviceErrorSignal.
+
+ DeviceOpenErrorSignal := DeviceErrorSignal newSignalMayProceed:true.
+ DeviceOpenErrorSignal nameClass:self message:#deviceOpenErrorSignal.
+ DeviceOpenErrorSignal notifierString:'cannot open device'.
+
+ DeviceIOErrorSignal := (Signal new) mayProceed:false.
+ DeviceIOErrorSignal notifierString:'device IO error'.
+ DeviceIOErrorSignal nameClass:self message:#deviceIOErrorSignal.
+
+ DeviceIOTimeoutErrorSignal := DeviceIOErrorSignal newSignalMayProceed:false.
+ DeviceIOTimeoutErrorSignal notifierString:'device IO timeout error'.
+ DeviceIOTimeoutErrorSignal nameClass:self message:#deviceIOTimeoutErrorSignal.
+
+ CurrentScreenQuerySignal := QuerySignal new.
+ CurrentScreenQuerySignal nameClass:self message:#currentScreenQuerySignal.
+ CurrentScreenQuerySignal notifierString:'asking for current screen'.
+
+ DrawingOnClosedDeviceSignal := DeviceErrorSignal newSignalMayProceed:true.
+ DrawingOnClosedDeviceSignal nameClass:self message:#drawingOnClosedDeviceSignal.
+ DrawingOnClosedDeviceSignal notifierString:'drawing attempt on closed graphics device'.
].
ErrorPrinting := true.
@@ -384,7 +384,7 @@
MultiClickTimeDelta := 300. "a click within 300ms is considered a double one"
ButtonTranslation isNil ifTrue:[
- ButtonTranslation := #(1 2 3 4 5 6 7) "identity translation"
+ ButtonTranslation := #(1 2 3 4 5 6 7) "identity translation"
].
!
@@ -413,42 +413,42 @@
"find out about the concrete Workstation class"
Screen isAbstract ifTrue:[
- |wsClass wsClasses|
-
- wsClasses := OrderedCollection new.
-
- #(OpenGLWorkstation GLXWorkstation XWorkstation)
- detect:[:w| (wsClass := Smalltalk at:w) notNil] ifNone:nil.
- wsClasses add:wsClass.
-
- "preparation for WIN32/NeXTStep/OS2 and Mac interfacing;
- But if X11 is linked in and it is capable of setting up a connection, that will be used."
- #(
- "/ #NeXTWorkstation nil
- OS2Workstation isOS2like
- MacWorkstation isMAClike
- WinWorkstation isMSWINDOWSlike
- ) pairWiseDo:[:wsClassName :checkSel|
- (checkSel isNil or:[OperatingSystem perform:checkSel]) ifTrue:[
- (wsClass := Smalltalk at:wsClassName) notNil ifTrue:[
- wsClasses add:wsClass.
- ]
- ].
- ].
-
- "/ try all classes until open of display works.
- wsClasses detect:[:cls|
- [
- display := cls newFor:displayName.
- ] on:Screen deviceOpenErrorSignal do:[:ex| ].
- display notNil
- ] ifNone:nil.
+ |wsClass wsClasses|
+
+ wsClasses := OrderedCollection new.
+
+ #(OpenGLWorkstation GLXWorkstation XWorkstation)
+ detect:[:w| (wsClass := Smalltalk at:w) notNil] ifNone:nil.
+ wsClasses add:wsClass.
+
+ "preparation for WIN32/NeXTStep/OS2 and Mac interfacing;
+ But if X11 is linked in and it is capable of setting up a connection, that will be used."
+ #(
+ "/ #NeXTWorkstation nil
+ OS2Workstation isOS2like
+ MacWorkstation isMAClike
+ WinWorkstation isMSWINDOWSlike
+ ) pairWiseDo:[:wsClassName :checkSel|
+ (checkSel isNil or:[OperatingSystem perform:checkSel]) ifTrue:[
+ (wsClass := Smalltalk at:wsClassName) notNil ifTrue:[
+ wsClasses add:wsClass.
+ ]
+ ].
+ ].
+
+ "/ try all classes until open of display works.
+ wsClasses detect:[:cls|
+ [
+ display := cls newFor:displayName.
+ ] on:Screen deviceOpenErrorSignal do:[:ex| ].
+ display notNil
+ ] ifNone:nil.
] ifFalse:[
- display := Screen newFor:displayName.
+ display := Screen newFor:displayName.
].
display isNil ifTrue:[
- Screen deviceOpenErrorSignal raiseWith:displayName.
+ Screen deviceOpenErrorSignal raiseWith:displayName.
].
Screen := display class.
Screen default:display.
@@ -461,7 +461,7 @@
screen (if background processes ask for one)"
CurrentScreenQuerySignal isNil ifTrue:[
- DeviceWorkstation initialize
+ DeviceWorkstation initialize
].
^ CurrentScreenQuerySignal
@@ -531,7 +531,7 @@
Display := aDevice.
old ~~ aDevice ifTrue:[
- DisplayRootView initialize.
+ DisplayRootView initialize.
].
! !
@@ -542,9 +542,9 @@
"an error in the devices low level code (typically Xlib or XtLib)
This is invoked via
- XError->errorInterrupt:#DisplayError->registeredErrorInterruptHandlers
+ XError->errorInterrupt:#DisplayError->registeredErrorInterruptHandlers
or
- XError->errorInterrupt:#DisplayIOError->registeredErrorInterruptHandlers
+ XError->errorInterrupt:#DisplayIOError->registeredErrorInterruptHandlers
looks if a signal handler for DeviceErrorSignal is present,
and - if so raises the signal.
@@ -558,20 +558,20 @@
'DeviceWorkstation [info]: errorInterrupt: ' infoPrint. errID infoPrintCR.
errID notNil ifTrue:[
- "/
- "/ timeoutError passes the device;
- "/ the others pass the devicesID
- "/
- errID == #DisplayIOTimeoutError ifTrue:[
- theDevice := aParameter.
- "/ 'device timeout error' printCR.
- ] ifFalse:[
- AllScreens do:[:aDisplayDevice |
- aDisplayDevice id = aParameter ifTrue:[
- theDevice := aDisplayDevice.
- ]
- ]
- ]
+ "/
+ "/ timeoutError passes the device;
+ "/ the others pass the devicesID
+ "/
+ errID == #DisplayIOTimeoutError ifTrue:[
+ theDevice := aParameter.
+ "/ 'device timeout error' printCR.
+ ] ifFalse:[
+ AllScreens do:[:aDisplayDevice |
+ aDisplayDevice id = aParameter ifTrue:[
+ theDevice := aDisplayDevice.
+ ]
+ ]
+ ]
].
'DeviceWorkstation [info]: device: ' infoPrint. theDevice infoPrintCR.
@@ -580,36 +580,36 @@
signalHolder := theDevice ? self.
errID == #DisplayIOError ifTrue:[
- "/ always raises an exception
- msg := 'Display I/O Error'.
- badResource := theDevice.
- theSignal := signalHolder deviceIOErrorSignal.
+ "/ always raises an exception
+ msg := 'Display I/O Error'.
+ badResource := theDevice.
+ theSignal := signalHolder deviceIOErrorSignal.
] ifFalse:[
- errID == #DisplayIOTimeoutError ifTrue:[
- "/ always raises an exception for the current process
- msg := 'Display I/O timeout Error'.
- badResource := theDevice.
- theSignal := signalHolder deviceIOTimeoutErrorSignal
- ] ifFalse:[
- theSignal := signalHolder deviceErrorSignal.
- "/ only raises an exception if handled
-
- "/ that will become instance-specific information in
- "/ the near future ...
-
- badId := self resourceIdOfLastError.
- badId ~~ 0 ifTrue:[
- badResource := self resourceOfId:badId.
- ].
- msg := 'Display error: ' , (self lastErrorString).
-
- theSignal isHandled ifFalse:[
- ErrorPrinting ifTrue:[
- ('DeviceWorkstation [error]: ' , msg) errorPrintCR
- ].
- ^ self
- ]
- ]
+ errID == #DisplayIOTimeoutError ifTrue:[
+ "/ always raises an exception for the current process
+ msg := 'Display I/O timeout Error'.
+ badResource := theDevice.
+ theSignal := signalHolder deviceIOTimeoutErrorSignal
+ ] ifFalse:[
+ theSignal := signalHolder deviceErrorSignal.
+ "/ only raises an exception if handled
+
+ "/ that will become instance-specific information in
+ "/ the near future ...
+
+ badId := self resourceIdOfLastError.
+ badId ~~ 0 ifTrue:[
+ badResource := self resourceOfId:badId.
+ ].
+ msg := 'Display error: ' , (self lastErrorString).
+
+ theSignal isHandled ifFalse:[
+ ErrorPrinting ifTrue:[
+ ('DeviceWorkstation [error]: ' , msg) errorPrintCR
+ ].
+ ^ self
+ ]
+ ]
].
@@ -617,60 +617,60 @@
"/ and force it to shutdown
theDevice notNil ifTrue:[
- "/ DiplayIOTimeoutError is a synchronous event, that should hit the process
- "/ that caused the timeout.
-
- errID ~~ #DisplayIOTimeoutError ifTrue:[
- p := theDevice dispatchProcess.
- (p notNil and:[p ~~ Processor activeProcess]) ifTrue:[
- 'DeviceWorkstation [info]: interrupting: ' infoPrint. p displayString infoPrintCR.
- p interruptWith:[
- 'DeviceWorkstation [warning]: raising - exception' errorPrintCR.
- theSignal mayProceed ifTrue:[
- theSignal raiseRequestWith:badResource errorString:msg.
- ] ifFalse:[
- theSignal raiseWith:badResource errorString:msg.
- ].
- 'DeviceWorkstation [warning]: broken connection' errorPrintCR.
- theDevice brokenConnection.
- 'DeviceWorkstation [warning]: stopping dispatch' errorPrintCR.
- theDevice stopDispatch.
- ].
- ^ self.
+ "/ DiplayIOTimeoutError is a synchronous event, that should hit the process
+ "/ that caused the timeout.
+
+ errID ~~ #DisplayIOTimeoutError ifTrue:[
+ p := theDevice dispatchProcess.
+ (p notNil and:[p ~~ Processor activeProcess]) ifTrue:[
+ 'DeviceWorkstation [info]: interrupting: ' infoPrint. p displayString infoPrintCR.
+ p interruptWith:[
+ 'DeviceWorkstation [warning]: raising - exception' errorPrintCR.
+ theSignal mayProceed ifTrue:[
+ theSignal raiseRequestWith:badResource errorString:msg.
+ ] ifFalse:[
+ theSignal raiseWith:badResource errorString:msg.
+ ].
+ 'DeviceWorkstation [warning]: broken connection' errorPrintCR.
+ theDevice brokenConnection.
+ 'DeviceWorkstation [warning]: stopping dispatch' errorPrintCR.
+ theDevice stopDispatch.
+ ].
+ ^ self.
"/ Processor reschedule.
"/ AbortSignal raise.
- ].
- ].
+ ].
+ ].
].
(theSignal isHandled or:[theSignal handlerBlock notNil]) ifTrue:[
"/ 'DeviceWorkstation [info]: interrupting current process: ' infoPrint.
"/ Processor activeProcess displayString infoPrintCR.
- 'DeviceWorkstation [info]: raising signal in current process' infoPrintCR.
- theSignal mayProceed ifTrue:[
- theSignal raiseRequestWith:badResource errorString:msg.
- ] ifFalse:[
- theSignal raiseWith:badResource errorString:msg.
- ].
+ 'DeviceWorkstation [info]: raising signal in current process' infoPrintCR.
+ theSignal mayProceed ifTrue:[
+ theSignal raiseRequestWith:badResource errorString:msg.
+ ] ifFalse:[
+ theSignal raiseWith:badResource errorString:msg.
+ ].
].
theDevice notNil ifTrue:[
- "/ 'broken connection' printCR.
- 'DeviceWorkstation [info]: sending #brokenConnection' infoPrintCR.
- theDevice brokenConnection.
- theDevice dispatchProcess == Processor activeProcess ifTrue:[
- "/ I am running in the dispatch process
- "/ and nobody handles theSignal, so abort the dispatcher
-
- 'DeviceWorkstation [info]: raising abortSignal' infoPrintCR.
- AbortSignal raise.
- ] ifFalse:[
- "/ Some other process (probably not even guilty - like someone doing a draw after a change) ...
- "/ ... see if we can unwind out of the drawing operation
- 'DeviceWorkstation [info]: should unwind the draw operation' infoPrintCR.
- thisContext fullPrintAll.
- ]
+ "/ 'broken connection' printCR.
+ 'DeviceWorkstation [info]: sending #brokenConnection' infoPrintCR.
+ theDevice brokenConnection.
+ theDevice dispatchProcess == Processor activeProcess ifTrue:[
+ "/ I am running in the dispatch process
+ "/ and nobody handles theSignal, so abort the dispatcher
+
+ 'DeviceWorkstation [info]: raising abortSignal' infoPrintCR.
+ AbortSignal raise.
+ ] ifFalse:[
+ "/ Some other process (probably not even guilty - like someone doing a draw after a change) ...
+ "/ ... see if we can unwind out of the drawing operation
+ 'DeviceWorkstation [info]: should unwind the draw operation' infoPrintCR.
+ thisContext fullPrintAll.
+ ]
].
'DeviceWorkstation [info]: proceeding after error' infoPrintCR.
@@ -713,14 +713,14 @@
Needed for error handling"
Form allInstancesDo:[:f |
- f id == id ifTrue:[^ f]
+ f id == id ifTrue:[^ f]
].
self allInstancesDo:[:aDisplay |
- aDisplay allViewsDo:[:aView |
- aView id == id ifTrue:[^ aView].
- aView gcId == id ifTrue:[^ aView]
- ].
+ aDisplay allViewsDo:[:aView |
+ aView id == id ifTrue:[^ aView].
+ aView gcId == id ifTrue:[^ aView]
+ ].
"/ |views|
"/ views := aDisplay knownViews.
@@ -733,11 +733,11 @@
].
Color allInstancesDo:[:c |
- c colorId == id ifTrue:[^ c]
+ c colorId == id ifTrue:[^ c]
].
Font allInstancesDo:[:f |
- f fontId == id ifTrue:[^ f]
+ f fontId == id ifTrue:[^ f]
].
^ nil
@@ -776,24 +776,24 @@
"/ take that ... it ought to be display
"/
AllScreens size <= 1 ifTrue:[
- LastActiveProcess := LastActiveScreen := nil.
- Display notNil ifTrue:[
- ^ Display
- ]
+ LastActiveProcess := LastActiveScreen := nil.
+ Display notNil ifTrue:[
+ ^ Display
+ ]
].
"/
"/ someone willing to tell me ?
"/
(dev := self currentScreenQuerySignal query) notNil ifTrue:[
- ^ dev
+ ^ dev
].
thisProcess := Processor activeProcess.
LastActiveScreen notNil ifTrue:[
- LastActiveProcess == thisProcess ifTrue:[
- ^ LastActiveScreen
- ]
+ LastActiveProcess == thisProcess ifTrue:[
+ ^ LastActiveScreen
+ ]
].
"/
@@ -803,14 +803,14 @@
"/ the current windowGroup got corrupted somehow ...
(wg := WindowGroup activeGroup) notNil ifTrue:[
- "/
- "/ ok, not a background process or scheduler ...
- "/
- (dev := wg graphicsDevice) notNil ifTrue:[
- LastActiveScreen := dev.
- LastActiveProcess := thisProcess.
- ^ dev
- ].
+ "/
+ "/ ok, not a background process or scheduler ...
+ "/
+ (dev := wg graphicsDevice) notNil ifTrue:[
+ LastActiveScreen := dev.
+ LastActiveProcess := thisProcess.
+ ^ dev
+ ].
].
"/
@@ -864,10 +864,10 @@
args := Smalltalk commandLineArguments.
index := args indexOf:'-display'.
(index between:1 and:(args size - 1)) ifTrue:[
- displayName := args at:index+1
+ displayName := args at:index+1
].
displayName isNil ifTrue:[
- displayName := OperatingSystem getEnvironment:'DISPLAY'.
+ displayName := OperatingSystem getEnvironment:'DISPLAY'.
].
^ displayName.
@@ -937,8 +937,8 @@
"animate a rubber-rectangle from startRect to endRect.
Can be used by buttons, which open some dialog for nicer user feedback.
Notice: since the displays window manager typically allows a topWindow
- to be placed by the user, this should not be used for modeless
- topViews.
+ to be placed by the user, this should not be used for modeless
+ topViews.
"
^ self zoom:startRect to:endRect duration:300
@@ -955,8 +955,8 @@
"animate a rubber-rectangle from startRect to endRect.
Can be used by buttons, which open some dialog for nicer user feedback.
Notice: since the displays window manager typically allows a topWindow
- to be placed by the user, this should not be used for modeless
- topViews.
+ to be placed by the user, this should not be used for modeless
+ topViews.
"
|steps dExt dOrg org ext root|
@@ -967,16 +967,16 @@
dExt := (endRect extent - startRect extent) / steps.
dOrg := (endRect origin - startRect origin) / steps.
0 to:steps do:[:step |
- org := (startRect origin + (dOrg * step)) rounded.
- ext := (startRect extent + (dExt * step)) rounded.
- rootView clippedByChildren:false.
- rootView xoring:[
- rootView displayRectangleX:org x y:org y width:ext x height:ext y
- ].
- Delay waitForMilliseconds:(milliseconds // steps).
- rootView xoring:[
- rootView displayRectangleX:org x y:org y width:ext x height:ext y
- ].
+ org := (startRect origin + (dOrg * step)) rounded.
+ ext := (startRect extent + (dExt * step)) rounded.
+ rootView clippedByChildren:false.
+ rootView xoring:[
+ rootView displayRectangleX:org x y:org y width:ext x height:ext y
+ ].
+ Delay waitForMilliseconds:(milliseconds // steps).
+ rootView xoring:[
+ rootView displayRectangleX:org x y:org y width:ext x height:ext y
+ ].
].
rootView clippedByChildren:true.
@@ -993,8 +993,8 @@
Can be used by buttons, which open some dialog for nicer user feedback.
The speed is computed for the longest edge to run at the given speed.
Notice: since the displays window manager typically allows a topWindow
- to be placed by the user, this should not be used for modeless
- topViews.
+ to be placed by the user, this should not be used for modeless
+ topViews.
"
|maxDistance|
@@ -1005,7 +1005,7 @@
maxDistance := maxDistance max:(endRect corner - startRect corner).
maxDistance := maxDistance x max:(maxDistance y).
^ self
- zoom:startRect to:endRect duration:(maxDistance abs / pixelsPerSecond * 1000)
+ zoom:startRect to:endRect duration:(maxDistance abs / pixelsPerSecond * 1000)
"
Screen current zoom:(10@10 corner:20@20) to:(20@20 corner:1000@1000) speed:1000
@@ -1028,14 +1028,14 @@
rootView paint:Color black.
r := aRectangle.
0 to:bw-1 do:[:i |
- rootView displayRectangle:r.
- r := r insetBy:1.
+ rootView displayRectangle:r.
+ r := r insetBy:1.
].
rootView clippedByChildren:true.
"
Display restoreAfter:[
- Display border:(10@10 corner:100@100) width:2.
+ Display border:(10@10 corner:100@100) width:2.
]
"
@@ -1057,7 +1057,7 @@
"
Display restoreAfter:[
- Display displayOpaqueString:'hello' x:10 y:10.
+ Display displayOpaqueString:'hello' x:10 y:10.
]
"
@@ -1076,7 +1076,7 @@
"
Display restoreAfter:[
- Display displayString:'hello' x:10 y:10.
+ Display displayString:'hello' x:10 y:10.
]
"
@@ -1099,7 +1099,7 @@
"
Display restoreAfter:[
- Display fill:(10@10 corner:100@100) fillColor:Color yellow
+ Display fill:(10@10 corner:100@100) fillColor:Color yellow
]
"
@@ -1114,12 +1114,12 @@
"
Display restoreAfter:[
- Display fillWhite
+ Display fillWhite
]
"
"
Display restoreAfter:[
- Display fillWhite:(10@10 corner:100@100)
+ Display fillWhite:(10@10 corner:100@100)
]
"
@@ -1134,7 +1134,7 @@
"
Display restoreAfter:[
- Display fillWhite:(10@10 corner:100@100)
+ Display fillWhite:(10@10 corner:100@100)
]
"
@@ -1273,9 +1273,9 @@
"reverse buttonTranslation"
buttonTranslation notNil ifTrue:[
- buttonNr := buttonTranslation indexOf:aButton ifAbsent:[1].
+ buttonNr := buttonTranslation indexOf:aButton ifAbsent:[1].
] ifFalse:[
- buttonNr := aButton.
+ buttonNr := aButton.
].
^ (aMask bitTest:(self buttonMotionMask:buttonNr))
!
@@ -1367,7 +1367,7 @@
It is not guaranteed, that a particular display device supports this."
rootView isNil ifTrue:[
- rootView := DisplayRootView onDevice:self
+ rootView := DisplayRootView onDevice:self
].
^ rootView
@@ -1473,8 +1473,8 @@
w2 := window2 ? self rootView.
(w1 device == self and:[w2 device == self]) ifFalse:[
- self error:'Huh - Cross device translation' mayProceed:true.
- ^ aPoint
+ self error:'Huh - Cross device translation' mayProceed:true.
+ ^ aPoint
].
^ self translatePoint:aPoint from:(w1 id) to:(w2 id).
@@ -1511,20 +1511,20 @@
id := self viewIdFromPoint:aScreenPoint.
view := self viewFromId:id.
view isNil ifTrue:[
- "/ search on other devices (if present).
- "/ This may find the view, in case another device
- "/ has its views on the same display screen
- "/ (i.e. under X, if its another display connection to the same
- "/ X-server)
- Screen allScreens do:[:aScreen |
- |v|
-
- aScreen ~~ self ifTrue:[
- (v := aScreen viewFromId:id) notNil ifTrue:[
- ^ v
- ]
- ]
- ]
+ "/ search on other devices (if present).
+ "/ This may find the view, in case another device
+ "/ has its views on the same display screen
+ "/ (i.e. under X, if its another display connection to the same
+ "/ X-server)
+ Screen allScreens do:[:aScreen |
+ |v|
+
+ aScreen ~~ self ifTrue:[
+ (v := aScreen viewFromId:id) notNil ifTrue:[
+ ^ v
+ ]
+ ]
+ ]
].
^ view
!
@@ -1542,18 +1542,18 @@
"/ along with an illegal id (which happens, if a view from another
"/ screen-device is picked ...)
self class deviceErrorSignal handle:[:ex |
- ^ nil
+ ^ nil
] do:[
- n := 0.
- [searchId notNil] whileTrue:[
- n := n + 1.
- n > 1000 ifTrue:[
- self halt:'oops - endless view hierarchy'.
- ^ nil
- ].
- foundId := searchId.
- searchId := self viewIdFromPoint:aScreenPoint in:searchId.
- ]
+ n := 0.
+ [searchId notNil] whileTrue:[
+ n := n + 1.
+ n > 1000 ifTrue:[
+ self halt:'oops - endless view hierarchy'.
+ ^ nil
+ ].
+ foundId := searchId.
+ searchId := self viewIdFromPoint:aScreenPoint in:searchId.
+ ]
].
^ foundId
!
@@ -1585,8 +1585,8 @@
"return the number of valid bits in the blue component."
bitsBlue isNil ifTrue:[
- "/ not a truecolor display
- ^ bitsPerRGB
+ "/ not a truecolor display
+ ^ bitsPerRGB
].
^ bitsBlue
@@ -1602,8 +1602,8 @@
"return the number of valid bits in the green component."
bitsGreen isNil ifTrue:[
- "/ not a truecolor display
- ^ bitsPerRGB
+ "/ not a truecolor display
+ ^ bitsPerRGB
].
^ bitsGreen
@@ -1636,8 +1636,8 @@
"return the number of valid bits in the red component."
bitsRed isNil ifTrue:[
- "/ not a truecolor display
- ^ bitsPerRGB
+ "/ not a truecolor display
+ ^ bitsPerRGB
].
^ bitsRed
@@ -1830,9 +1830,9 @@
visualType := aSymbol.
(visualType == #StaticGray or:[visualType == #GrayScale]) ifTrue:[
- hasColors := false
+ hasColors := false
] ifFalse:[
- hasColors := true
+ hasColors := true
]
!
@@ -2081,24 +2081,24 @@
|sizes spec sz sz2|
preferredIconSize isNil ifTrue:[
- sizes := self iconSizes.
- sizes notNil ifTrue:[
- spec := sizes first.
-
- "/ we prefer square icons ...
-
- sz := (spec at:#maxWidth) min: (spec at:#maxHeight).
- sz > 64 ifTrue:[
- sz2 := (spec at:#minWidth) max: (spec at:#minHeight).
- sz2 <= 48 ifTrue:[
- sz := 48
- ]
- ].
- preferredIconSize := sz @ sz
- ].
- preferredIconSize isNil ifTrue:[
- preferredIconSize := 48@48
- ].
+ sizes := self iconSizes.
+ sizes notNil ifTrue:[
+ spec := sizes first.
+
+ "/ we prefer square icons ...
+
+ sz := (spec at:#maxWidth) min: (spec at:#maxHeight).
+ sz > 64 ifTrue:[
+ sz2 := (spec at:#minWidth) max: (spec at:#minHeight).
+ sz2 <= 48 ifTrue:[
+ sz := 48
+ ]
+ ].
+ preferredIconSize := sz @ sz
+ ].
+ preferredIconSize isNil ifTrue:[
+ preferredIconSize := 48@48
+ ].
].
^ preferredIconSize
@@ -2143,9 +2143,9 @@
supported, return nil."
self supportedImageFormats do:[:fmt |
- (fmt at:#depth) == aDepth ifTrue:[
- ^fmt
- ]
+ (fmt at:#depth) == aDepth ifTrue:[
+ ^fmt
+ ]
].
^ nil
!
@@ -2417,8 +2417,8 @@
- needed since some displays do not tell the truth or do not know it"
aNumber > 0 ifTrue:[
- heightMM := aNumber.
- resolutionVer := nil.
+ heightMM := aNumber.
+ resolutionVer := nil.
]
"Modified: 10.9.1996 / 14:25:39 / cg"
@@ -2434,7 +2434,7 @@
"return the number of horizontal pixels per millimeter of the display"
resolutionHor notNil ifTrue:[
- ^ resolutionHor
+ ^ resolutionHor
].
resolutionHor := (width / widthMM) asFloat.
^ resolutionHor
@@ -2504,7 +2504,7 @@
"return the number of vertical pixels per millimeter of the display"
resolutionVer notNil ifTrue:[
- ^ resolutionVer
+ ^ resolutionVer
].
resolutionVer := (height / heightMM) asFloat.
^ resolutionVer
@@ -2562,8 +2562,8 @@
- needed since some displays do not tell the truth or do not know it"
aNumber > 0 ifTrue:[
- widthMM := aNumber.
- resolutionHor := nil.
+ widthMM := aNumber.
+ resolutionHor := nil.
].
"Modified: 10.9.1996 / 14:25:27 / cg"
@@ -2703,10 +2703,10 @@
!
createWindowFor:aView type:typeSymbol origin:org extent:ext
- minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:sv
- style:styleSymbol inputOnly:inp
- label:label owner:owner
- icon:icn iconMask:icnM iconView:icnV
+ minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:sv
+ style:styleSymbol inputOnly:inp
+ label:label owner:owner
+ icon:icn iconMask:icnM iconView:icnV
"must be implemented by a concrete class"
^ self subclassResponsibility
@@ -2792,13 +2792,13 @@
s := IdentitySet new.
fixColors notNil ifTrue:[
- s addAll:fixColors.
+ s addAll:fixColors.
].
fixGrayColors notNil ifTrue:[
- s addAll:fixGrayColors.
+ s addAll:fixGrayColors.
].
ditherColors notNil ifTrue:[
- s addAll:ditherColors.
+ s addAll:ditherColors.
].
^ s asArray
@@ -2828,15 +2828,15 @@
depthUsed mapArray|
visualType == #DirectColor ifTrue:[
- 'DeviceWorkstation [info]: directColor displays not fully supported.' infoPrintCR.
- ^ nil
+ 'DeviceWorkstation [info]: directColor displays not fully supported.' infoPrintCR.
+ ^ nil
].
(visualType == #StaticGray or:[visualType == #TrueColor]) ifTrue:[
- "
- those have no colorMap - we're done
- "
- ^ nil
+ "
+ those have no colorMap - we're done
+ "
+ ^ nil
].
"
@@ -2849,12 +2849,12 @@
"/ than 8 bits ...)
depthUsed == 15 ifTrue:[
- depthUsed := 16
+ depthUsed := 16
].
depthUsed > 16 ifTrue:[
- "/ do not allocate zillions of colors ...
- self error:'unreasonably large colorMap ...'.
- ^ nil
+ "/ do not allocate zillions of colors ...
+ self error:'unreasonably large colorMap ...'.
+ ^ nil
].
mapSize := (1 bitShift:depthUsed).
@@ -2862,9 +2862,9 @@
"/ get the palette
mapArray := Array new:mapSize.
1 to:mapSize do:[:i |
- self getRGBFrom:(i-1) into:[:r :g :b |
- mapArray at:i put:(Color red:r green:g blue:b)
- ]
+ self getRGBFrom:(i-1) into:[:r :g :b |
+ mapArray at:i put:(Color red:r green:g blue:b)
+ ]
].
^ mapArray.
@@ -2881,7 +2881,7 @@
Dont use this method, colornames are mostly X specific"
^ self getScaledRGBFromName:aString into:[:r :g :b |
- self colorScaledRed:r scaledGreen:g scaledBlue:b
+ self colorScaledRed:r scaledGreen:g scaledBlue:b
]
!
@@ -2900,9 +2900,9 @@
colorScaledRed:red scaledGreen:green scaledBlue:blue
visualType == #TrueColor ifTrue:[
- ^ (((red bitShift:-8) bitShift:redShift)
- bitOr:((green bitShift:-8) bitShift:greenShift))
- bitOr:((blue bitShift:-8) bitShift:blueShift)
+ ^ (((red bitShift:-8) bitShift:redShift)
+ bitOr:((green bitShift:-8) bitShift:greenShift))
+ bitOr:((blue bitShift:-8) bitShift:blueShift)
].
self subclassResponsibility
!
@@ -2951,7 +2951,7 @@
triple := self getScaledRGBFrom:index.
triple notNil ifTrue:[
- ^ triple collect:[:val | self deviceColorValueToPercent:val]
+ ^ triple collect:[:val | self deviceColorValueToPercent:val]
].
^ nil
!
@@ -2964,7 +2964,7 @@
triple := self getRGBFrom:index.
triple notNil ifTrue:[
- ^ aBlock valueWithArguments:triple.
+ ^ aBlock valueWithArguments:triple.
].
^ nil
@@ -2980,57 +2980,57 @@
|idx names triple r g b|
(colorName startsWith:$#) ifTrue:[
- "/ color in r/g/b hex notation
- r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16.
- g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16.
- b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16.
- r := (r * 100 / 255).
- g := (g * 100 / 255).
- b := (b * 100 / 255).
- ^ Array with:r with:g with:b
+ "/ color in r/g/b hex notation
+ r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16.
+ g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16.
+ b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16.
+ r := (r * 100 / 255).
+ g := (g * 100 / 255).
+ b := (b * 100 / 255).
+ ^ Array with:r with:g with:b
].
names := #(
- 'red'
- 'green'
- 'blue'
- 'yellow'
- 'magenta'
- 'cyan'
- 'white'
- 'black'
-
- 'olive'
- 'teal'
- 'silver'
- 'lime'
- 'fuchsia'
- 'aqua'
- ).
+ 'red'
+ 'green'
+ 'blue'
+ 'yellow'
+ 'magenta'
+ 'cyan'
+ 'white'
+ 'black'
+
+ 'olive'
+ 'teal'
+ 'silver'
+ 'lime'
+ 'fuchsia'
+ 'aqua'
+ ).
idx := names indexOf:colorName.
idx == 0 ifTrue:[
- idx := names indexOf:colorName asLowercase.
+ idx := names indexOf:colorName asLowercase.
].
idx ~~ 0 ifTrue:[
- triple := #(
- (100 0 0) "red"
- ( 0 100 0) "green"
- ( 0 0 100) "blue"
- (100 100 0) "yellow"
- (100 0 100) "magenta"
- ( 0 100 100) "cyan"
- (100 100 100) "white"
- ( 0 0 0) "black"
-
- ( 50 50 0) "olive"
- ( 0 50 50) "teal"
- ( 40 40 40) "silver"
- ( 20 100 0) "lime"
- ( 60 3 100) "fuchsia"
- ( 10 100 100) "aqua"
- ) at:idx.
+ triple := #(
+ (100 0 0) "red"
+ ( 0 100 0) "green"
+ ( 0 0 100) "blue"
+ (100 100 0) "yellow"
+ (100 0 100) "magenta"
+ ( 0 100 100) "cyan"
+ (100 100 100) "white"
+ ( 0 0 0) "black"
+
+ ( 50 50 0) "olive"
+ ( 0 50 50) "teal"
+ ( 40 40 40) "silver"
+ ( 20 100 0) "lime"
+ ( 60 3 100) "fuchsia"
+ ( 10 100 100) "aqua"
+ ) at:idx.
- ^ triple
+ ^ triple
].
^ nil
@@ -3044,9 +3044,9 @@
triple := self getScaledRGBFromName:colorName.
triple notNil ifTrue:[
- ^ aBlock value:(self deviceColorValueToPercent:(triple at:1))
- value:(self deviceColorValueToPercent:(triple at:2))
- value:(self deviceColorValueToPercent:(triple at:3))
+ ^ aBlock value:(self deviceColorValueToPercent:(triple at:1))
+ value:(self deviceColorValueToPercent:(triple at:2))
+ value:(self deviceColorValueToPercent:(triple at:3))
].
^ nil
@@ -3070,7 +3070,7 @@
triple := self getScaledRGBFrom:index.
triple notNil ifTrue:[
- ^ aBlock valueWithArguments:triple.
+ ^ aBlock valueWithArguments:triple.
].
^ nil
@@ -3084,7 +3084,7 @@
triple := self getRGBFromName:colorName.
triple notNil ifTrue:[
- ^ triple collect:[:val | self percentToDeviceColorValue:val].
+ ^ triple collect:[:val | self percentToDeviceColorValue:val].
].
^ nil.
@@ -3098,7 +3098,7 @@
triple := self getScaledRGBFromName:colorName.
triple notNil ifTrue:[
- ^ aBlock valueWithArguments:triple.
+ ^ aBlock valueWithArguments:triple.
].
^ nil
!
@@ -3321,7 +3321,7 @@
!
displayArcX:x y:y width:width height:height from:startAngle angle:angle
- in:aDrawableId with:aGCId
+ in:aDrawableId with:aGCId
"draw an arc"
^ self subclassResponsibility
@@ -3351,11 +3351,11 @@
xLast := xStart.
yLast := (ydata at:1) * yScale + yTrans.
ydata from:2 do:[:y | |yT|
- x := xLast + xStep.
- yT := y * yScale + yTrans.
- self displayLineFromX:xLast rounded y:yLast rounded toX:x rounded y:yT rounded in:drawableId with:gcId.
- xLast := x.
- yLast := y.
+ x := xLast + xStep.
+ yT := y * yScale + yTrans.
+ self displayLineFromX:xLast rounded y:yLast rounded toX:x rounded y:yT rounded in:drawableId with:gcId.
+ xLast := x.
+ yLast := y.
]
!
@@ -3364,13 +3364,13 @@
If the coordinates are not integers, retry with rounded."
self displayString:aString
- from:index1
- to:index2
- x:x
- y:y
- in:aDrawableId
- with:aGCId
- opaque:true
+ from:index1
+ to:index2
+ x:x
+ y:y
+ in:aDrawableId
+ with:aGCId
+ opaque:true
!
displayOpaqueString:aString x:x y:y in:aDrawableId with:aGCId
@@ -3378,11 +3378,11 @@
If the coordinates are not integers, retry with rounded."
self displayString:aString
- x:x
- y:y
- in:aDrawableId
- with:aGCId
- opaque:true
+ x:x
+ y:y
+ in:aDrawableId
+ with:aGCId
+ opaque:true
!
displayPointX:x y:y in:aDrawableId with:aGCId
@@ -3413,18 +3413,18 @@
|startPoint p|
1 to:arrayOfPoints size by:2 do:[:idx |
- p := arrayOfPoints at:idx.
- idx odd ifTrue:[
- startPoint := p
- ] ifFalse:[
- self
- displayLineFromX:startPoint x
- y:startPoint y
- toX:p x
- y:p y
- in:aDrawableId
- with:aGCId
- ]
+ p := arrayOfPoints at:idx.
+ idx odd ifTrue:[
+ startPoint := p
+ ] ifFalse:[
+ self
+ displayLineFromX:startPoint x
+ y:startPoint y
+ toX:p x
+ y:p y
+ in:aDrawableId
+ with:aGCId
+ ]
]
!
@@ -3443,14 +3443,14 @@
If the coordinates are not integers, retry with rounded."
self
- displayString:aString
- from:index1
- to:index2
- x:x
- y:y
- in:aDrawableId
- with:aGCId
- opaque:false
+ displayString:aString
+ from:index1
+ to:index2
+ x:x
+ y:y
+ in:aDrawableId
+ with:aGCId
+ opaque:false
!
displayString:aString from:i1 to:i2 x:x y:y in:aDrawableId with:aGCId opaque:opaque
@@ -3464,34 +3464,34 @@
If the coordinates are not integers, retry with rounded."
self
- displayString:aString
- x:x
- y:y
- in:aDrawableId
- with:aGCId
- opaque:false
+ displayString:aString
+ x:x
+ y:y
+ in:aDrawableId
+ with:aGCId
+ opaque:false
!
displayString:aString x:x y:y in:aDrawableId with:aGCId opaque:opaque
"draw a string"
self displayString:aString
- from:1
- to:aString size
- x:x
- y:y
- in:aDrawableId
- with:aGCId
- opaque:opaque
+ from:1
+ to:aString size
+ x:x
+ y:y
+ in:aDrawableId
+ with:aGCId
+ opaque:opaque
!
drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:pad
- width:imageWidth height:imageHeight
- x:srcx y:srcy
- into:aDrawableId
- x:dstx y:dsty
- width:w height:h
- with:aGCId
+ width:imageWidth height:imageHeight
+ x:srcx y:srcy
+ into:aDrawableId
+ x:dstx y:dsty
+ width:w height:h
+ with:aGCId
"draw a bitimage which has depth id, width iw and height ih into
the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty.
It has to be checked elsewhere, that server can do it with the given
@@ -3504,12 +3504,12 @@
!
drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth
- width:imageWidth height:imageHeight
- x:srcx y:srcy
- into:aDrawableId
- x:dstx y:dsty
- width:w height:h
- with:aGCId
+ width:imageWidth height:imageHeight
+ x:srcx y:srcy
+ into:aDrawableId
+ x:dstx y:dsty
+ width:w height:h
+ with:aGCId
"draw a bitimage which has depth id, width iw and height ih into
the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty.
@@ -3522,23 +3522,23 @@
which is the natural padding within ST/X."
^ self
- drawBits:imageBits
- bitsPerPixel:bitsPerPixel
- depth:imageDepth
- padding:8
- width:imageWidth height:imageHeight
- x:srcx y:srcy
- into:aDrawableId
- x:dstx y:dsty
- width:w height:h
- with:aGCId
+ drawBits:imageBits
+ bitsPerPixel:bitsPerPixel
+ depth:imageDepth
+ padding:8
+ width:imageWidth height:imageHeight
+ x:srcx y:srcy
+ into:aDrawableId
+ x:dstx y:dsty
+ width:w height:h
+ with:aGCId
"Created: / 16.4.1997 / 14:55:57 / cg"
"Modified: / 21.1.1998 / 13:27:58 / cg"
!
drawBits:imageBits depth:imageDepth padding:pad width:imageWidth height:imageHeight
- x:srcx y:srcy into:aDrawableId x:dstx y:dsty width:w height:h with:aGCId
+ x:srcx y:srcy into:aDrawableId x:dstx y:dsty width:w height:h with:aGCId
"draw a bitimage which has depth id, width iw and height ih into
the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty.
@@ -3546,21 +3546,21 @@
depth; also it is assumed, that the colormap is setup correctly"
^ self
- drawBits:imageBits
- bitsPerPixel:imageDepth
- depth:imageDepth
- padding:pad
- width:imageWidth height:imageHeight
- x:srcx y:srcy
- into:aDrawableId
- x:dstx y:dsty
- width:w height:h
- with:aGCId
+ drawBits:imageBits
+ bitsPerPixel:imageDepth
+ depth:imageDepth
+ padding:pad
+ width:imageWidth height:imageHeight
+ x:srcx y:srcy
+ into:aDrawableId
+ x:dstx y:dsty
+ width:w height:h
+ with:aGCId
!
drawBits:imageBits depth:imageDepth width:imageWidth height:imageHeight
- x:srcx y:srcy
- into:aDrawableId x:dstx y:dsty width:w height:h with:aGCId
+ x:srcx y:srcy
+ into:aDrawableId x:dstx y:dsty width:w height:h with:aGCId
"draw a bitimage which has depth id, width iw and height ih into
the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty.
@@ -3570,21 +3570,21 @@
which is the natural padding within ST/X."
^ self
- drawBits:imageBits
- bitsPerPixel:imageDepth
- depth:imageDepth
- width:imageWidth height:imageHeight
- x:srcx y:srcy
- into:aDrawableId
- x:dstx y:dsty
- width:w height:h
- with:aGCId
+ drawBits:imageBits
+ bitsPerPixel:imageDepth
+ depth:imageDepth
+ width:imageWidth height:imageHeight
+ x:srcx y:srcy
+ into:aDrawableId
+ x:dstx y:dsty
+ width:w height:h
+ with:aGCId
"Modified: / 21.1.1998 / 13:28:34 / cg"
!
fillArcX:x y:y width:width height:height from:startAngle angle:angle
- in:aDrawableId with:aGCId
+ in:aDrawableId with:aGCId
"fill an arc"
^ self subclassResponsibility
@@ -3621,7 +3621,7 @@
setOfViews := IdentitySet new.
knownViews notNil ifTrue:[
- knownViews validElementsDo:[:v | setOfViews add:v].
+ knownViews validElementsDo:[:v | setOfViews add:v].
].
^ setOfViews
@@ -3642,7 +3642,7 @@
"/ ]
knownViews notNil ifTrue:[
- knownViews validElementsDo:aBlock
+ knownViews validElementsDo:aBlock
]
"
@@ -3665,8 +3665,8 @@
primitiveFailedOrClosedConnection
self isOpen ifFalse:[
- DrawingOnClosedDeviceSignal raiseRequestWith:self.
- ^ nil
+ DrawingOnClosedDeviceSignal raiseRequestWith:self.
+ ^ nil
].
^ super primitiveFailed
! !
@@ -3679,25 +3679,25 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor buttonMotion:button x:x y:y view:aView
+ sensor buttonMotion:button x:x y:y view:aView
] ifFalse:[
- aView shown ifTrue:[ "/ could be a late event arrival
- "
- if there is no sensor ...
- "
- aView
- dispatchEvent:#buttonMotion:x:y:
- arguments:(Array with:button with:x with:y)
+ aView shown ifTrue:[ "/ could be a late event arrival
+ "
+ if there is no sensor ...
+ "
+ aView
+ dispatchEvent:#buttonMotion:x:y:
+ arguments:(Array with:button with:x with:y)
"/ WindowEvent
"/ sendEvent:#buttonMotion:x:y:
"/ arguments:(Array with:button with:x with:y)
"/ view:aView
- ]
+ ]
]
"Modified: / 20.5.1998 / 22:50:32 / cg"
@@ -3709,25 +3709,25 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor buttonMultiPress:button x:x y:y view:aView
+ sensor buttonMultiPress:button x:x y:y view:aView
] ifFalse:[
- aView shown ifTrue:[ "/ could be a late event arrival
- "
- if there is no sensor ...
- "
- aView
- dispatchEvent:#buttonMultiPress:x:y:
- arguments:(Array with:button with:x with:y)
+ aView shown ifTrue:[ "/ could be a late event arrival
+ "
+ if there is no sensor ...
+ "
+ aView
+ dispatchEvent:#buttonMultiPress:x:y:
+ arguments:(Array with:button with:x with:y)
"/ WindowEvent
"/ sendEvent:#buttonMultiPress:x:y:
"/ arguments:(Array with:button with:x with:y)
"/ view:aView
- ]
+ ]
]
"Modified: / 20.5.1998 / 22:50:49 / cg"
@@ -3739,32 +3739,32 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- WindowsRightButtonBehavior == true ifTrue:[
- button >= 2 ifTrue:[
- sensor buttonPress:1 x:x y:y view:aView.
- ^ self.
- ]
- ].
-
- sensor buttonPress:button x:x y:y view:aView
+ WindowsRightButtonBehavior == true ifTrue:[
+ button >= 2 ifTrue:[
+ sensor buttonPress:1 x:x y:y view:aView.
+ ^ self.
+ ]
+ ].
+
+ sensor buttonPress:button x:x y:y view:aView
] ifFalse:[
- aView shown ifTrue:[ "/ could be a late event arrival
- "
- if there is no sensor ...
- "
- aView
- dispatchEvent:#buttonPress:x:y:
- arguments:(Array with:button with:x with:y)
+ aView shown ifTrue:[ "/ could be a late event arrival
+ "
+ if there is no sensor ...
+ "
+ aView
+ dispatchEvent:#buttonPress:x:y:
+ arguments:(Array with:button with:x with:y)
"/ WindowEvent
"/ sendEvent:#buttonPress:x:y:
"/ arguments:(Array with:button with:x with:y)
"/ view:aView
- ]
+ ]
]
"Modified: / 20.5.1998 / 22:51:02 / cg"
@@ -3776,33 +3776,33 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- WindowsRightButtonBehavior == true ifTrue:[
- button >= 2 ifTrue:[
- sensor buttonRelease:1 x:x y:y view:aView.
- sensor buttonPress:button x:x y:y view:aView.
- sensor buttonRelease:button x:x y:y view:aView.
- ^ self.
- ].
- ].
- sensor buttonRelease:button x:x y:y view:aView
+ WindowsRightButtonBehavior == true ifTrue:[
+ button >= 2 ifTrue:[
+ sensor buttonRelease:1 x:x y:y view:aView.
+ sensor buttonPress:button x:x y:y view:aView.
+ sensor buttonRelease:button x:x y:y view:aView.
+ ^ self.
+ ].
+ ].
+ sensor buttonRelease:button x:x y:y view:aView
] ifFalse:[
- aView shown ifTrue:[ "/ could be a late event arrival
- "
- if there is no sensor ...
- "
- aView
- dispatchEvent:#buttonRelease:x:y:
- arguments:(Array with:button with:x with:y)
+ aView shown ifTrue:[ "/ could be a late event arrival
+ "
+ if there is no sensor ...
+ "
+ aView
+ dispatchEvent:#buttonRelease:x:y:
+ arguments:(Array with:button with:x with:y)
"/ WindowEvent
"/ sendEvent:#buttonRelease:x:y:
"/ arguments:(Array with:button with:x with:y)
"/ view:aView
- ]
+ ]
]
"Modified: / 20.5.1998 / 22:51:13 / cg"
@@ -3814,16 +3814,16 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor configureX:x y:y width:w height:h view:aView
+ sensor configureX:x y:y width:w height:h view:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView configureX:x y:y width:w height:h
+ "
+ if there is no sensor ...
+ "
+ aView configureX:x y:y width:w height:h
]
!
@@ -3834,17 +3834,17 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor coveredBy:otherView view:aView
+ sensor coveredBy:otherView view:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView coveredBy:otherView
+ "
+ if there is no sensor ...
+ "
+ aView coveredBy:otherView
]
!
@@ -3854,16 +3854,16 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor destroyedView:aView
+ sensor destroyedView:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView destroyed
+ "
+ if there is no sensor ...
+ "
+ aView destroyed
]
!
@@ -3873,18 +3873,18 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor exposeX:x y:y width:w height:h view:aView
+ sensor exposeX:x y:y width:w height:h view:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView
- dispatchEvent:#exposeX:y:width:height:
- arguments:(Array with:x with:y with:w with:h)
+ "
+ if there is no sensor ...
+ "
+ aView
+ dispatchEvent:#exposeX:y:width:height:
+ arguments:(Array with:x with:y with:w with:h)
"/ WindowEvent
"/ sendEvent:#exposeX:y:width:height:
@@ -3901,18 +3901,18 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor focusInView:aView
+ sensor focusInView:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView
- dispatchEvent:#focusIn
- arguments:nil
+ "
+ if there is no sensor ...
+ "
+ aView
+ dispatchEvent:#focusIn
+ arguments:nil
"/ WindowEvent
"/ sendEvent:#focusIn
@@ -3929,18 +3929,18 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor focusOutView:aView
+ sensor focusOutView:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView
- dispatchEvent:#focusOut
- arguments:nil
+ "
+ if there is no sensor ...
+ "
+ aView
+ dispatchEvent:#focusOut
+ arguments:nil
"/ WindowEvent
"/ sendEvent:#focusOut
@@ -3957,18 +3957,18 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor graphicsExposeX:x y:y width:w height:h final:final view:aView
+ sensor graphicsExposeX:x y:y width:w height:h final:final view:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView
- dispatchEvent:#graphicsExposeX:y:width:height:final:
- arguments:(Array with:x with:y with:w with:h with:final)
+ "
+ if there is no sensor ...
+ "
+ aView
+ dispatchEvent:#graphicsExposeX:y:width:height:final:
+ arguments:(Array with:x with:y with:w with:h with:final)
"/ WindowEvent
"/ sendEvent:#graphicsExposeX:y:width:height:final:
@@ -3990,37 +3990,37 @@
"/ ctrl-Esc gives up focus
"/
untranslatedKey == #Escape ifTrue:[
- ctrlDown ifTrue:[
- self ungrabPointer.
- self setInputFocusTo:nil
- ]
+ ctrlDown ifTrue:[
+ self ungrabPointer.
+ self setInputFocusTo:nil
+ ]
].
self modifierKeyProcessing:untranslatedKey down:true.
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor keyPress:untranslatedKey x:x y:y view:aView
+ sensor keyPress:untranslatedKey x:x y:y view:aView
] ifFalse:[
- aView shown ifTrue:[ "/ could be a late event arrival
- "
- if there is no sensor ...
- "
- xlatedKey := self translateKey:untranslatedKey forView:aView.
- xlatedKey notNil ifTrue:[
- aView
- dispatchEvent:#keyPress:x:y:
- arguments:(Array with:xlatedKey with:x with:y)
+ aView shown ifTrue:[ "/ could be a late event arrival
+ "
+ if there is no sensor ...
+ "
+ xlatedKey := self translateKey:untranslatedKey forView:aView.
+ xlatedKey notNil ifTrue:[
+ aView
+ dispatchEvent:#keyPress:x:y:
+ arguments:(Array with:xlatedKey with:x with:y)
"/ WindowEvent
"/ sendEvent:#keyPress:x:y:
"/ arguments:(Array with:xlatedKey with:x with:y)
"/ view:aView
- ]
- ]
+ ]
+ ]
]
"Modified: / 20.5.1998 / 22:52:36 / cg"
@@ -4034,28 +4034,28 @@
self modifierKeyProcessing:untranslatedKey down:false.
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor keyRelease:untranslatedKey x:x y:y view:aView
+ sensor keyRelease:untranslatedKey x:x y:y view:aView
] ifFalse:[
- aView shown ifTrue:[ "/ could be a late event arrival
- "
- if there is no sensor ...
- "
- xlatedKey := self translateKey:untranslatedKey forView:aView.
- xlatedKey notNil ifTrue:[
- aView
- dispatchEvent:#keyRelease:x:y:
- arguments:(Array with:xlatedKey with:x with:y)
+ aView shown ifTrue:[ "/ could be a late event arrival
+ "
+ if there is no sensor ...
+ "
+ xlatedKey := self translateKey:untranslatedKey forView:aView.
+ xlatedKey notNil ifTrue:[
+ aView
+ dispatchEvent:#keyRelease:x:y:
+ arguments:(Array with:xlatedKey with:x with:y)
"/ WindowEvent
"/ sendEvent:#keyRelease:x:y:
"/ arguments:(Array with:xlatedKey with:x with:y)
"/ view:aView
- ]
- ]
+ ]
+ ]
]
"Modified: / 20.5.1998 / 22:52:52 / cg"
@@ -4067,16 +4067,16 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor mappedView:aView
+ sensor mappedView:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView mapped
+ "
+ if there is no sensor ...
+ "
+ aView mapped
]
!
@@ -4087,20 +4087,20 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime view:aView
+ sensor mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime view:aView
] ifFalse:[
- aView shown ifTrue:[ "/ could be a late event arrival
- "
- if there is no sensor ...
- "
- aView
- dispatchEvent:#mouseWheelMotion:x:y:amount:deltaTime:
- arguments:(Array with:buttonState with:x with:y with:amount with:dTime )
- ]
+ aView shown ifTrue:[ "/ could be a late event arrival
+ "
+ if there is no sensor ...
+ "
+ aView
+ dispatchEvent:#mouseWheelMotion:x:y:amount:deltaTime:
+ arguments:(Array with:buttonState with:x with:y with:amount with:dTime )
+ ]
]
"Modified: / 21.5.1999 / 13:05:53 / cg"
@@ -4112,16 +4112,16 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor noExposeView:aView
+ sensor noExposeView:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView noExpose
+ "
+ if there is no sensor ...
+ "
+ aView noExpose
]
!
@@ -4131,18 +4131,18 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor pointerEnter:buttonState x:x y:y view:aView
+ sensor pointerEnter:buttonState x:x y:y view:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView
- dispatchEvent:#pointerEnter:x:y:
- arguments:(Array with:buttonState with:x with:y)
+ "
+ if there is no sensor ...
+ "
+ aView
+ dispatchEvent:#pointerEnter:x:y:
+ arguments:(Array with:buttonState with:x with:y)
"/ WindowEvent
"/ sendEvent:#pointerEnter:x:y:
@@ -4159,18 +4159,18 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor pointerLeave:buttonState view:aView
+ sensor pointerLeave:buttonState view:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView
- dispatchEvent:#pointerLeave:
- arguments:(Array with:buttonState)
+ "
+ if there is no sensor ...
+ "
+ aView
+ dispatchEvent:#pointerLeave:
+ arguments:(Array with:buttonState)
"/ WindowEvent
"/ sendEvent:#pointerLeave:
@@ -4187,16 +4187,16 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor saveAndTerminateView:aView
+ sensor saveAndTerminateView:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView saveAndTerminate
+ "
+ if there is no sensor ...
+ "
+ aView saveAndTerminate
]
!
@@ -4206,16 +4206,16 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor terminateView:aView
+ sensor terminateView:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView terminate
+ "
+ if there is no sensor ...
+ "
+ aView terminate
]
!
@@ -4225,16 +4225,16 @@
|sensor|
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
+ "/ event arrived, after I destroyed it myself
+ ^ self
].
(sensor := aView sensor) notNil ifTrue:[
- sensor unmappedView:aView
+ sensor unmappedView:aView
] ifFalse:[
- "
- if there is no sensor ...
- "
- aView unmapped
+ "
+ if there is no sensor ...
+ "
+ aView unmapped
]
! !
@@ -4249,27 +4249,27 @@
dispatching ifFalse:[^ self].
self == Display ifTrue:[
- ExitOnLastClose == true ifFalse:[^ self].
+ ExitOnLastClose == true ifFalse:[^ self].
].
exitOnLastClose == true ifFalse:[^ self].
knownViews notNil ifTrue:[
- (knownViews findFirst:[:slot |
- slot notNil
- and:[slot ~~ 0 "/ if there is no non-popup
- and:[slot isRootView not "/ non-dialog ...
- and:[slot isTopView "/ stop dispatching.
- and:[slot isPopUpView not
- and:[slot isModal not
- "and:[slot realized]"]]]]]]) == 0 ifTrue:[
- "/ my last view was closed
- dispatching := false.
- 'DeviceWorkstation [info]: finished dispatch (last view closed)' infoPrintCR.
- LastActiveScreen == self ifTrue:[
- LastActiveScreen := nil.
- LastActiveProcess := nil.
- ].
- ]
+ (knownViews findFirst:[:slot |
+ slot notNil
+ and:[slot ~~ 0 "/ if there is no non-popup
+ and:[slot isRootView not "/ non-dialog ...
+ and:[slot isTopView "/ stop dispatching.
+ and:[slot isPopUpView not
+ and:[slot isModal not
+ "and:[slot realized]"]]]]]]) == 0 ifTrue:[
+ "/ my last view was closed
+ dispatching := false.
+ 'DeviceWorkstation [info]: finished dispatch (last view closed)' infoPrintCR.
+ LastActiveScreen == self ifTrue:[
+ LastActiveScreen := nil.
+ LastActiveProcess := nil.
+ ].
+ ]
].
"Modified: 19.9.1995 / 11:31:54 / claus"
@@ -4312,17 +4312,17 @@
"
myFd := self displayFileDescriptor.
[aBlock value] whileTrue:[
- self eventPending ifFalse:[
- myFd isNil ifTrue:[
- OperatingSystem millisecondDelay:50
- ] ifFalse:[
- OperatingSystem selectOn:myFd withTimeOut:50.
- ].
- Processor evaluateTimeouts.
- ].
- self eventPending ifTrue:[
- self dispatchEvent
- ].
+ self eventPending ifFalse:[
+ myFd isNil ifTrue:[
+ OperatingSystem millisecondDelay:50
+ ] ifFalse:[
+ OperatingSystem selectOn:myFd withTimeOut:50.
+ ].
+ Processor evaluateTimeouts.
+ ].
+ self eventPending ifTrue:[
+ self dispatchEvent
+ ].
]
!
@@ -4332,11 +4332,11 @@
(i.e. when in the modal debugger)"
Object osSignalInterruptSignal handle:[:ex |
- ex return
+ ex return
] do:[
- [self eventPending] whileTrue:[
- self dispatchEventFor:nil withMask:nil
- ]
+ [self eventPending] whileTrue:[
+ self dispatchEventFor:nil withMask:nil
+ ]
]
!
@@ -4355,7 +4355,7 @@
"dispose (i.e. forget) all events pending on this display"
[self eventPending] whileTrue:[
- self getEventFor:nil withMask:nil
+ self getEventFor:nil withMask:nil
].
!
@@ -4438,7 +4438,7 @@
dispatching := true.
AllScreens isNil ifTrue:[
- AllScreens := IdentitySet new:1
+ AllScreens := IdentitySet new:1
].
AllScreens add:self.
@@ -4454,56 +4454,56 @@
inputSema := Semaphore new name:'display inputSema'.
p := [
- self initializeDeviceResources.
-
- DeviceIOErrorSignal handle:[:ex |
- "/ test for handlerBlock until the signal is changed to be classed based.
- ex signal handlerBlock notNil ifTrue:[
- ex defaultAction.
- ] ifFalse:[
- 'DeviceWorkstation [warning]: stop dispatch due to I/O error' errorPrintCR.
- self brokenConnection.
- ].
- ex return.
- ] do:[
- [
- [dispatching] whileTrue:[
- AbortSignal handle:[:ex |
- ex return
- ] do:[
- self eventPending ifFalse:[
- Processor activeProcess setStateTo:#ioWait if:#active.
- inputSema wait.
- ].
- dispatching ifTrue:[
- self dispatchPendingEvents.
- ].
- ]
- ]
- ] ifCurtailed:[
- inputSema notNil ifTrue:[
- Processor disableSemaphore:inputSema.
- inputSema := nil.
- ].
- dispatchProcess := nil.
- self emergencyCloseConnection.
- ].
- inputSema notNil ifTrue:[
- Processor disableSemaphore:inputSema.
- inputSema := nil.
- ].
- dispatchProcess := nil.
- self close.
- ].
+ self initializeDeviceResources.
+
+ DeviceIOErrorSignal handle:[:ex |
+ "/ test for handlerBlock until the signal is changed to be classed based.
+ ex signal handlerBlock notNil ifTrue:[
+ ex defaultAction.
+ ] ifFalse:[
+ 'DeviceWorkstation [warning]: stop dispatch due to I/O error' errorPrintCR.
+ self brokenConnection.
+ ].
+ ex return.
+ ] do:[
+ [
+ [dispatching] whileTrue:[
+ AbortSignal handle:[:ex |
+ ex return
+ ] do:[
+ self eventPending ifFalse:[
+ Processor activeProcess setStateTo:#ioWait if:#active.
+ inputSema wait.
+ ].
+ dispatching ifTrue:[
+ self dispatchPendingEvents.
+ ].
+ ]
+ ]
+ ] ifCurtailed:[
+ inputSema notNil ifTrue:[
+ Processor disableSemaphore:inputSema.
+ inputSema := nil.
+ ].
+ dispatchProcess := nil.
+ self emergencyCloseConnection.
+ ].
+ inputSema notNil ifTrue:[
+ Processor disableSemaphore:inputSema.
+ inputSema := nil.
+ ].
+ dispatchProcess := nil.
+ self close.
+ ].
] newProcess.
"/
"/ give the process a nice name (for the processMonitor)
"/
(nm := self displayName) notNil ifTrue:[
- nm := 'event dispatcher (' , nm , ')'.
+ nm := 'event dispatcher (' , nm , ')'.
] ifFalse:[
- nm := 'event dispatcher'.
+ nm := 'event dispatcher'.
].
p name:nm.
p priority:(Processor userInterruptPriority).
@@ -4515,11 +4515,11 @@
"/ is available or #eventPending returns true
fd isNil ifTrue:[
- "no fd -- so have to check for input also"
- checkBlock := [self eventPending].
+ "no fd -- so have to check for input also"
+ checkBlock := [self eventPending].
] ifFalse:[
- "there is a fd, so checkblock has to check only the internal queue"
- checkBlock := [self eventQueued].
+ "there is a fd, so checkblock has to check only the internal queue"
+ checkBlock := [self eventQueued].
].
Processor signal:inputSema onInput:fd orCheck:checkBlock.
@@ -4534,14 +4534,14 @@
|p|
LastActiveScreen == self ifTrue:[
- LastActiveScreen := nil.
- LastActiveProcess := nil.
+ LastActiveScreen := nil.
+ LastActiveProcess := nil.
].
(p := dispatchProcess) notNil ifTrue:[
- dispatchProcess := nil.
- p terminateWithAllSubprocesses.
- p terminateNoSignal. "/ just in case
+ dispatchProcess := nil.
+ p terminateWithAllSubprocesses.
+ p terminateNoSignal. "/ just in case
]
! !
@@ -4565,34 +4565,34 @@
events.
Only a few control characters are supported.
Notice: not all alien views allow this kind of synthetic input;
- some simply ignore it."
+ some simply ignore it."
|control code state|
aCharacterOrString isString ifTrue:[
- aCharacterOrString do:[:char |
- self simulateKeyboardInput:char inViewId:viewId
- ].
- ^ self
+ aCharacterOrString do:[:char |
+ self simulateKeyboardInput:char inViewId:viewId
+ ].
+ ^ self
].
control := false.
code := aCharacterOrString asciiValue.
(aCharacterOrString == Character cr) ifTrue:[
- code := #Return
+ code := #Return
] ifFalse:[
- (aCharacterOrString == Character tab) ifTrue:[
- code := #Tab
- ] ifFalse:[
- (aCharacterOrString == Character esc) ifTrue:[
- code := #Escape
- ]
- ]
+ (aCharacterOrString == Character tab) ifTrue:[
+ code := #Tab
+ ] ifFalse:[
+ (aCharacterOrString == Character esc) ifTrue:[
+ code := #Escape
+ ]
+ ]
].
control ifTrue:[
- state := self ctrlModifierMask
+ state := self ctrlModifierMask
].
@@ -4602,11 +4602,11 @@
"/ Hopefully, this is correct ...
code isNumber ifTrue:[
- code >= $A asciiValue ifTrue:[
- code <= $Z asciiValue ifTrue:[
- state := self shiftModifierMask
- ]
- ]
+ code >= $A asciiValue ifTrue:[
+ code <= $Z asciiValue ifTrue:[
+ state := self shiftModifierMask
+ ]
+ ]
].
self sendKeyOrButtonEvent:#keyPress x:0 y:0 keyOrButton:code state:state toViewId:viewId.
@@ -4697,14 +4697,14 @@
|fonts|
fonts := self fontsInFamily:aFamilyName
- filtering:[:f| f face notNil and:[filterBlock isNil or:[filterBlock value:f]]].
+ filtering:[:f| f face notNil and:[filterBlock isNil or:[filterBlock value:f]]].
fonts size == 0 ifTrue:[^ nil].
^ fonts collect:[:descr | descr face]
"
Display facesInFamily:'fixed' filtering:[:f |
- f encoding notNil and:[f encoding startsWith:'jis']]
+ f encoding notNil and:[f encoding startsWith:'jis']]
"
"Created: 27.2.1996 / 01:33:25 / cg"
@@ -4746,7 +4746,7 @@
"
Display fontFamiliesFiltering:[:f |
- f encoding notNil and:[f encoding startsWith:'jis']]
+ f encoding notNil and:[f encoding startsWith:'jis']]
"
"Modified: 29.2.1996 / 04:31:51 / cg"
@@ -4789,17 +4789,17 @@
fonts := Set new.
allFonts do:[:fntDescr |
- (aFilterBlock isNil or:[aFilterBlock value:fntDescr]) ifTrue:[
- fntDescr family notNil ifTrue:[
- fonts add:fntDescr
- ]
- ]
+ (aFilterBlock isNil or:[aFilterBlock value:fntDescr]) ifTrue:[
+ fntDescr family notNil ifTrue:[
+ fonts add:fntDescr
+ ]
+ ]
].
^ fonts
"
Display fontsFiltering:[:f |
- f encoding notNil and:[f encoding startsWith:'jis']]
+ f encoding notNil and:[f encoding startsWith:'jis']]
"
"Modified: 29.2.1996 / 04:30:35 / cg"
@@ -4816,19 +4816,19 @@
fonts := Set new.
allFonts do:[:fntDescr |
- (aFamilyName match:fntDescr family) ifTrue:[
- (aFaceName match:fntDescr face) ifTrue:[
- (filter isNil or:[filter value:fntDescr]) ifTrue:[
- fonts add:fntDescr
- ]
- ]
- ]
+ (aFamilyName match:fntDescr family) ifTrue:[
+ (aFaceName match:fntDescr face) ifTrue:[
+ (filter isNil or:[filter value:fntDescr]) ifTrue:[
+ fonts add:fntDescr
+ ]
+ ]
+ ]
].
^ fonts
"
Display fontsInFamily:'fixed' face:'medium' filtering:[:f |
- f encoding notNil and:[f encoding startsWith:'jis']]
+ f encoding notNil and:[f encoding startsWith:'jis']]
"
"Created: 29.2.1996 / 04:32:56 / cg"
@@ -4847,25 +4847,25 @@
fonts := Set new.
allFonts do:[:fntDescr |
- (aFamilyName match:fntDescr family) ifTrue:[
- (aFaceName match:fntDescr face) ifTrue:[
- (aStyleName match:fntDescr style) ifTrue:[
- (filter isNil or:[filter value:fntDescr]) ifTrue:[
- fonts add:fntDescr
- ]
- ]
- ]
- ]
+ (aFamilyName match:fntDescr family) ifTrue:[
+ (aFaceName match:fntDescr face) ifTrue:[
+ (aStyleName match:fntDescr style) ifTrue:[
+ (filter isNil or:[filter value:fntDescr]) ifTrue:[
+ fonts add:fntDescr
+ ]
+ ]
+ ]
+ ]
].
^ fonts
"
Display fontsInFamily:'fixed' face:'medium' style:'roman' filtering:[:f |
- f encoding notNil and:[f encoding startsWith:'jis']]
+ f encoding notNil and:[f encoding startsWith:'jis']]
"
"
Display fontsInFamily:'fixed' face:'*' style:'roman' filtering:[:f |
- f encoding notNil and:[f encoding startsWith:'jis']]
+ f encoding notNil and:[f encoding startsWith:'jis']]
"
"Created: 29.2.1996 / 04:25:30 / cg"
@@ -4883,21 +4883,21 @@
fonts := Set new.
allFonts do:[:fntDescr |
- (aFamilyName match:fntDescr family) ifTrue:[
- (filterBlock isNil or:[filterBlock value:fntDescr]) ifTrue:[
- fonts add:fntDescr
- ]
- ]
+ (aFamilyName match:fntDescr family) ifTrue:[
+ (filterBlock isNil or:[filterBlock value:fntDescr]) ifTrue:[
+ fonts add:fntDescr
+ ]
+ ]
].
^ fonts
"
Display fontsInFamily:'fixed' filtering:[:f |
- f encoding notNil and:[f encoding startsWith:'jis']]
+ f encoding notNil and:[f encoding startsWith:'jis']]
"
"
Display fontsInFamily:'*' filtering:[:f |
- f encoding notNil and:[f encoding startsWith:'jis']]
+ f encoding notNil and:[f encoding startsWith:'jis']]
"
"Created: 29.2.1996 / 04:27:49 / cg"
@@ -4964,14 +4964,14 @@
|fonts|
fonts := self fontsInFamily:aFamilyName face:aFaceName style:aStyleName
- filtering:[:f| f size notNil and:[filterBlock isNil or:[filterBlock value:f]]].
+ filtering:[:f| f size notNil and:[filterBlock isNil or:[filterBlock value:f]]].
fonts size == 0 ifTrue:[^ nil].
^ fonts collect:[:descr | descr size].
"
Display sizesInFamily:'fixed' face:'medium' style:'roman' filtering:[:f |
- f encoding notNil and:[f encoding startsWith:'jis']]
+ f encoding notNil and:[f encoding startsWith:'jis']]
"
"Created: 27.2.1996 / 01:37:56 / cg"
@@ -4998,14 +4998,14 @@
|fonts|
fonts := self fontsInFamily:aFamilyName face:aFaceName
- filtering:[:f| f style notNil and:[filterBlock isNil or:[filterBlock value:f]]].
+ filtering:[:f| f style notNil and:[filterBlock isNil or:[filterBlock value:f]]].
fonts size == 0 ifTrue:[^ nil].
^ fonts collect:[:descr | descr style]
"
Display stylesInFamily:'fixed' face:'medium' filtering:[:f |
- f encoding notNil and:[f encoding startsWith:'jis']]
+ f encoding notNil and:[f encoding startsWith:'jis']]
"
"Created: 27.2.1996 / 01:35:22 / cg"
@@ -5052,12 +5052,12 @@
Return true if ok, false if it failed for some reason."
activeKeyboardGrab notNil ifTrue:[
- self ungrabKeyboard.
- activeKeyboardGrab := nil
+ self ungrabKeyboard.
+ activeKeyboardGrab := nil
].
(self grabKeyboardIn:(aView id)) ifTrue:[
- activeKeyboardGrab := aView.
- ^ true
+ activeKeyboardGrab := aView.
+ ^ true
].
^ false
!
@@ -5089,12 +5089,12 @@
aView. Return true if ok, false if it failed for some reason."
activePointerGrab notNil ifTrue:[
- self ungrabPointer.
- activePointerGrab := nil
+ self ungrabPointer.
+ activePointerGrab := nil
].
(self grabPointerIn:(aView id)) ifTrue:[
- activePointerGrab := aView.
- ^ true
+ activePointerGrab := aView.
+ ^ true
].
^ false
!
@@ -5106,15 +5106,15 @@
|cId|
activePointerGrab notNil ifTrue:[
- self ungrabPointer.
- activePointerGrab := nil
+ self ungrabPointer.
+ activePointerGrab := nil
].
aCursor notNil ifTrue:[
- cId := aCursor id.
+ cId := aCursor id.
].
(self grabPointerIn:(aView id) withCursorId:cId) ifTrue:[
- activePointerGrab := aView.
- ^ true
+ activePointerGrab := aView.
+ ^ true
].
^ false
!
@@ -5157,17 +5157,17 @@
|colorId deviceColor|
(color isOnDevice:self) ifTrue:[
- colorId := color colorId.
+ colorId := color colorId.
] ifFalse:[
- deviceColor := color onDevice:self.
- deviceColor notNil ifTrue:[
- colorId := deviceColor colorId.
- ]
+ deviceColor := color onDevice:self.
+ deviceColor notNil ifTrue:[
+ colorId := deviceColor colorId.
+ ]
].
colorId isNil ifTrue:[
- 'DeviceWorkstation [warning]: could not set bg color' infoPrintCR.
+ 'DeviceWorkstation [warning]: could not set bg color' infoPrintCR.
] ifFalse:[
- self setBackground:colorId in:aGCId.
+ self setBackground:colorId in:aGCId.
]
!
@@ -5231,17 +5231,17 @@
|colorId deviceColor|
(color isOnDevice:self) ifTrue:[
- colorId := color colorId.
+ colorId := color colorId.
] ifFalse:[
- deviceColor := color onDevice:self.
- deviceColor notNil ifTrue:[
- colorId := deviceColor colorId.
- ]
+ deviceColor := color onDevice:self.
+ deviceColor notNil ifTrue:[
+ colorId := deviceColor colorId.
+ ]
].
colorId isNil ifTrue:[
- 'DeviceWorkstation [warning]: could not set fg color' infoPrintCR.
+ 'DeviceWorkstation [warning]: could not set fg color' infoPrintCR.
] ifFalse:[
- self setForeground:colorId in:aGCId.
+ self setForeground:colorId in:aGCId.
]
!
@@ -5285,31 +5285,31 @@
displayId := nil.
LastActiveScreen == self ifTrue:[
- LastActiveScreen := nil.
- LastActiveProcess := nil.
+ LastActiveScreen := nil.
+ LastActiveProcess := nil.
].
"/ tell all of my views about this.
"/ first, all topViews get a notification ...
self allViews do:[:aView |
- |wg sensor|
-
- aView isTopView ifTrue:[
- "/ notice: we must manually wakeup the
- "/ windowGroup process here (it might be waiting on
- "/ an event, and the destroy below is executed by
- "/ another thread.
- "/ Otherwise, the windowGroup process would
- "/ not terminate itself in this case.
- (wg := aView windowGroup) notNil ifTrue:[
- sensor := wg sensor
- ].
- aView destroyed.
- sensor notNil ifTrue:[
- sensor eventSemaphore signal.
- ].
- ]
+ |wg sensor|
+
+ aView isTopView ifTrue:[
+ "/ notice: we must manually wakeup the
+ "/ windowGroup process here (it might be waiting on
+ "/ an event, and the destroy below is executed by
+ "/ another thread.
+ "/ Otherwise, the windowGroup process would
+ "/ not terminate itself in this case.
+ (wg := aView windowGroup) notNil ifTrue:[
+ sensor := wg sensor
+ ].
+ aView destroyed.
+ sensor notNil ifTrue:[
+ sensor eventSemaphore signal.
+ ].
+ ]
].
self releaseDeviceResources.
@@ -5324,7 +5324,7 @@
self closeConnection.
dispatching := false.
dispatchProcess notNil ifTrue:[
- dispatchProcess terminate.
+ dispatchProcess terminate.
].
"Modified: 13.1.1997 / 22:13:18 / cg"
@@ -5353,7 +5353,7 @@
event dispatching should stop when the last view is closed."
self == Display ifTrue:[
- ExitOnLastClose := aBoolean
+ ExitOnLastClose := aBoolean
].
exitOnLastClose := aBoolean
@@ -5364,10 +5364,10 @@
isSlow := false.
motionEventCompression := true.
buttonTranslation isNil ifTrue:[
- buttonTranslation := ButtonTranslation.
+ buttonTranslation := ButtonTranslation.
].
multiClickTimeDelta isNil ifTrue:[
- multiClickTimeDelta := MultiClickTimeDelta.
+ multiClickTimeDelta := MultiClickTimeDelta.
].
shiftDown := false.
ctrlDown := false.
@@ -5381,9 +5381,9 @@
"initialize heavily used device resources - to avoid looking them up later"
blackColor isNil ifTrue:[
- blackColor := Color black onDevice:self.
- whiteColor := Color white onDevice:self.
- Color getPrimaryColorsOn:self.
+ blackColor := Color black onDevice:self.
+ whiteColor := Color white onDevice:self.
+ Color getPrimaryColorsOn:self.
]
"Modified: 24.2.1997 / 22:07:50 / cg"
@@ -5416,7 +5416,7 @@
"
keyboardMap isNil ifTrue:[
- keyboardMap := KeyboardMap new.
+ keyboardMap := KeyboardMap new.
].
"
@@ -5439,7 +5439,7 @@
"setup screen specific properties."
supportsDeepIcons isNil ifTrue:[
- supportsDeepIcons := false.
+ supportsDeepIcons := false.
].
fixColors := fixGrayColors := ditherColors := nil.
@@ -5452,9 +5452,9 @@
"late viewStyle init - if no viewStyle has been read yet."
View styleSheet isNil ifTrue:[
- self class currentScreenQuerySignal answer:self do:[
- View readStyleSheetAndUpdateAllStyleCaches
- ]
+ self class currentScreenQuerySignal answer:self do:[
+ View readStyleSheetAndUpdateAllStyleCaches
+ ]
].
!
@@ -5480,10 +5480,10 @@
self reinitialize.
blackColor notNil ifTrue:[
- blackColor releaseFromDevice.
+ blackColor releaseFromDevice.
].
whiteColor notNil ifTrue:[
- whiteColor releaseFromDevice.
+ whiteColor releaseFromDevice.
].
self releaseDeviceFonts.
self releaseDeviceCursors.
@@ -5509,7 +5509,7 @@
self initializeFor:aDisplayName.
displayId isNil ifTrue:[
- ^ nil
+ ^ nil
].
"
@@ -5521,51 +5521,51 @@
"/ prevMapping notNil ifTrue:[
prevKnownViews notNil ifTrue:[
- "
- first round: flush all device specific stuff
- "
+ "
+ first round: flush all device specific stuff
+ "
"/ prevMapping keysAndValuesDo:[:anId :aView |
- prevKnownViews do:[:aView |
- (aView notNil and:[aView ~~ 0]) ifTrue:[
- aView prepareForReinit
- ]
- ].
-
- "
- 2nd round: all views should reinstall themself
- on the new display
- "
+ prevKnownViews do:[:aView |
+ (aView notNil and:[aView ~~ 0]) ifTrue:[
+ aView prepareForReinit
+ ]
+ ].
+
+ "
+ 2nd round: all views should reinstall themself
+ on the new display
+ "
"/ prevMapping keysAndValuesDo:[:anId :aView |
- prevKnownViews do:[:aView |
- (aView notNil and:[aView ~~ 0]) ifTrue:[
- "have to re-create the view"
- UserInterruptSignal catch:[
- AbortSignal catch:[
- GraphicsContext drawingOnClosedDrawableSignal handle:[:ex |
- 'DeviceWorkstation [warning]: drawing attempt on closed drawable during reinit' errorPrintCR.
- ex return
- ] do:[
- aView reinitialize
- ]
- ]
- ]
- ]
- ].
-
- (prevWidth ~~ width
- or:[prevHeight ~~ height]) ifTrue:[
- "
- 3rd round: all views get a chance to handle
- changed environment (colors, font sizes etc)
- "
+ prevKnownViews do:[:aView |
+ (aView notNil and:[aView ~~ 0]) ifTrue:[
+ "have to re-create the view"
+ UserInterruptSignal catch:[
+ AbortSignal catch:[
+ GraphicsContext drawingOnClosedDrawableSignal handle:[:ex |
+ 'DeviceWorkstation [warning]: drawing attempt on closed drawable during reinit' errorPrintCR.
+ ex return
+ ] do:[
+ aView reinitialize
+ ]
+ ]
+ ]
+ ]
+ ].
+
+ (prevWidth ~~ width
+ or:[prevHeight ~~ height]) ifTrue:[
+ "
+ 3rd round: all views get a chance to handle
+ changed environment (colors, font sizes etc)
+ "
"/ prevMapping keysAndValuesDo:[:anId :aView |
- prevKnownViews do:[:aView |
- (aView notNil and:[aView ~~ 0]) ifTrue:[
- aView reAdjustGeometry
- ]
- ].
- ]
+ prevKnownViews do:[:aView |
+ (aView notNil and:[aView ~~ 0]) ifTrue:[
+ aView reAdjustGeometry
+ ]
+ ].
+ ]
].
dispatching := false.
@@ -5578,15 +5578,15 @@
(i.e. be prepared to not be able to release resources regularily)"
blackColor notNil ifTrue:[
- blackColor releaseFromDevice.
+ blackColor releaseFromDevice.
].
whiteColor notNil ifTrue:[
- whiteColor releaseFromDevice.
+ whiteColor releaseFromDevice.
].
LastActiveScreen == self ifTrue:[
- LastActiveScreen := nil.
- LastActiveProcess := nil.
+ LastActiveScreen := nil.
+ LastActiveProcess := nil.
].
blackColor := whiteColor := nil.
@@ -5651,42 +5651,42 @@
root foreground:blackColor background:whiteColor.
root xoring:[
- |left right top bottom newOrigin newCorner p|
-
- rect := origin extent:extent.
- root displayRectangle:rect.
-
- prevGrab := activePointerGrab.
- self grabPointerInView:root withCursor:curs.
-
- [self leftButtonPressed] whileTrue:[
- newOrigin := self pointerPosition.
-
- (newOrigin ~= origin) ifTrue:[
- root displayRectangle:rect.
-
- self
- grabPointerIn:root id
- withCursor:curs id
- pointerMode:#async
- keyboardMode:#sync
- confineTo:nil.
-
- rect := newOrigin extent:extent.
- root displayRectangle:rect.
- self disposeButtonEventsFor:nil.
- self flush.
- origin := newOrigin.
- ] ifFalse:[
- Delay waitForSeconds:0.05
- ]
- ].
- root displayRectangle:rect.
+ |left right top bottom newOrigin newCorner p|
+
+ rect := origin extent:extent.
+ root displayRectangle:rect.
+
+ prevGrab := activePointerGrab.
+ self grabPointerInView:root withCursor:curs.
+
+ [self leftButtonPressed] whileTrue:[
+ newOrigin := self pointerPosition.
+
+ (newOrigin ~= origin) ifTrue:[
+ root displayRectangle:rect.
+
+ self
+ grabPointerIn:root id
+ withCursor:curs id
+ pointerMode:#async
+ keyboardMode:#sync
+ confineTo:nil.
+
+ rect := newOrigin extent:extent.
+ root displayRectangle:rect.
+ self disposeButtonEventsFor:nil.
+ self flush.
+ origin := newOrigin.
+ ] ifFalse:[
+ Delay waitForSeconds:0.05
+ ]
+ ].
+ root displayRectangle:rect.
].
self ungrabPointer.
prevGrab notNil ifTrue:[
- self grabPointerInView:prevGrab.
+ self grabPointerInView:prevGrab.
].
"flush all events pending on my display"
@@ -5739,7 +5739,7 @@
self ungrabPointer.
prevGrab notNil ifTrue:[
- self grabPointerInView:prevGrab
+ self grabPointerInView:prevGrab
].
"flush all events pending on myself"
@@ -5811,9 +5811,9 @@
doRegrab := self class ~~ WinWorkstation.
keepExtent ifTrue:[
- curs1 := Cursor origin
+ curs1 := Cursor origin
] ifFalse:[
- curs1 := Cursor corner
+ curs1 := Cursor corner
].
curs1 := curs1 onDevice:self.
root := self rootView.
@@ -5827,91 +5827,91 @@
root foreground:blackColor background:whiteColor.
root xoring:[
- |left right top bottom newOrigin newCorner p curs|
-
- keepExtent ifFalse:[
- corner := origin.
- rect := origin corner:corner.
- root displayRectangle:rect.
- ].
-
- prevGrab := activePointerGrab.
- self grabPointerInView:root withCursor:curs1.
-
- "
- just in case; wait for button to be down ...
- "
- [self leftButtonPressed] whileFalse:[Delay waitForSeconds:0.05].
-
- keepExtent ifTrue:[
- p := self pointerPosition.
- origin := p.
- corner := origin + initialRectangle extent.
- rect := origin corner:corner.
- root displayRectangle:rect.
- ].
-
- [self leftButtonPressed] whileTrue:[
- left := initialRectangle origin x.
- top := initialRectangle origin y.
- right := initialRectangle corner x.
- bottom := initialRectangle corner y.
-
- p := self pointerPosition.
- keepExtent ifTrue:[
- newOrigin := p.
- newCorner := newOrigin + initialRectangle extent.
- curs := curs1.
- ] ifFalse:[
- p x < initialRectangle left ifTrue:[
- p y < initialRectangle top ifTrue:[
- curs := Cursor topLeft.
- left := p x.
- top := p y.
- ] ifFalse:[
- curs := Cursor bottomLeft.
- left := p x.
- bottom := p y
- ]
- ] ifFalse:[
- p y < initialRectangle top ifTrue:[
- curs := Cursor topRight.
- right := p x.
- top := p y
- ] ifFalse:[
- curs := Cursor bottomRight.
- right := p x.
- bottom := p y
- ]
- ].
-
- newOrigin := left @ top.
- newCorner := right @ bottom.
- ].
-
- ((newOrigin ~= origin) or:[newCorner ~= corner]) ifTrue:[
- root displayRectangle:rect.
- doRegrab ifTrue:[
- self grabPointerInView:root withCursor:curs1.
- ].
-
- origin := newOrigin.
- corner := newCorner.
- rect := origin corner:corner.
- root displayRectangle:rect.
- self disposeButtonEventsFor:nil.
- self flush.
- ] ifFalse:[
- Delay waitForSeconds:0.05
- ]
- ].
- root displayRectangle:rect.
+ |left right top bottom newOrigin newCorner p curs|
+
+ keepExtent ifFalse:[
+ corner := origin.
+ rect := origin corner:corner.
+ root displayRectangle:rect.
+ ].
+
+ prevGrab := activePointerGrab.
+ self grabPointerInView:root withCursor:curs1.
+
+ "
+ just in case; wait for button to be down ...
+ "
+ [self leftButtonPressed] whileFalse:[Delay waitForSeconds:0.05].
+
+ keepExtent ifTrue:[
+ p := self pointerPosition.
+ origin := p.
+ corner := origin + initialRectangle extent.
+ rect := origin corner:corner.
+ root displayRectangle:rect.
+ ].
+
+ [self leftButtonPressed] whileTrue:[
+ left := initialRectangle origin x.
+ top := initialRectangle origin y.
+ right := initialRectangle corner x.
+ bottom := initialRectangle corner y.
+
+ p := self pointerPosition.
+ keepExtent ifTrue:[
+ newOrigin := p.
+ newCorner := newOrigin + initialRectangle extent.
+ curs := curs1.
+ ] ifFalse:[
+ p x < initialRectangle left ifTrue:[
+ p y < initialRectangle top ifTrue:[
+ curs := Cursor topLeft.
+ left := p x.
+ top := p y.
+ ] ifFalse:[
+ curs := Cursor bottomLeft.
+ left := p x.
+ bottom := p y
+ ]
+ ] ifFalse:[
+ p y < initialRectangle top ifTrue:[
+ curs := Cursor topRight.
+ right := p x.
+ top := p y
+ ] ifFalse:[
+ curs := Cursor bottomRight.
+ right := p x.
+ bottom := p y
+ ]
+ ].
+
+ newOrigin := left @ top.
+ newCorner := right @ bottom.
+ ].
+
+ ((newOrigin ~= origin) or:[newCorner ~= corner]) ifTrue:[
+ root displayRectangle:rect.
+ doRegrab ifTrue:[
+ self grabPointerInView:root withCursor:curs1.
+ ].
+
+ origin := newOrigin.
+ corner := newCorner.
+ rect := origin corner:corner.
+ root displayRectangle:rect.
+ self disposeButtonEventsFor:nil.
+ self flush.
+ ] ifFalse:[
+ Delay waitForSeconds:0.05
+ ]
+ ].
+ root displayRectangle:rect.
].
self ungrabPointer.
prevGrab notNil ifTrue:[
- self grabPointerInView:prevGrab
+ self grabPointerInView:prevGrab
].
"flush all events pending on my display"
@@ -5944,7 +5944,7 @@
v := self viewFromUser.
v notNil ifTrue:[
- v := v topView
+ v := v topView
].
^ v
@@ -6049,19 +6049,19 @@
Called with every keyPress/keyRelease to update the xxxDown flags."
(altModifiers notNil and:[altModifiers includes:key]) ifTrue:[
- altDown := pressed
+ altDown := pressed
] ifFalse:[
- (metaModifiers notNil and:[metaModifiers includes:key]) ifTrue:[
- metaDown := pressed
- ] ifFalse:[
- (shiftModifiers notNil and:[shiftModifiers includes:key]) ifTrue:[
- shiftDown := pressed
- ] ifFalse:[
- (ctrlModifiers notNil and:[ctrlModifiers includes:key]) ifTrue:[
- ctrlDown := pressed
- ]
- ]
- ]
+ (metaModifiers notNil and:[metaModifiers includes:key]) ifTrue:[
+ metaDown := pressed
+ ] ifFalse:[
+ (shiftModifiers notNil and:[shiftModifiers includes:key]) ifTrue:[
+ shiftDown := pressed
+ ] ifFalse:[
+ (ctrlModifiers notNil and:[ctrlModifiers includes:key]) ifTrue:[
+ ctrlDown := pressed
+ ]
+ ]
+ ]
]
"Modified: 2.1.1996 / 15:00:25 / cg"
@@ -6074,27 +6074,27 @@
|t modifiers|
key == #Alt ifTrue:[
- modifiers := altModifiers
+ modifiers := altModifiers
] ifFalse:[
- key == #Cmd ifTrue:[
- modifiers := metaModifiers
- ]
+ key == #Cmd ifTrue:[
+ modifiers := metaModifiers
+ ]
].
"/ temporary kludge ...
(modifiers size > 0) ifTrue:[
- (modifiers includes:'Num_Lock') ifTrue:[
- modifiers := modifiers copy.
- modifiers remove:'Num_Lock'
- ]
+ (modifiers includes:'Num_Lock') ifTrue:[
+ modifiers := modifiers copy.
+ modifiers remove:'Num_Lock'
+ ]
].
(modifiers size > 0) ifTrue:[
- t := modifiers first.
- (t includes:$_) ifTrue:[
- t := t copyTo:(t indexOf:$_)-1
- ].
- ^ t
+ t := modifiers first.
+ (t includes:$_) ifTrue:[
+ t := t copyTo:(t indexOf:$_)-1
+ ].
+ ^ t
].
^ key
@@ -6112,33 +6112,33 @@
(untranslatedKey == #Control
or:[untranslatedKey == #'Control_L'
or:[untranslatedKey == #'Control_R']]) ifTrue:[
- ^ #Ctrl
+ ^ #Ctrl
].
(untranslatedKey == #Ctrl
or:[untranslatedKey == #'Ctrl_L'
or:[untranslatedKey == #'Ctrl_R']]) ifTrue:[
- ^ #Ctrl
+ ^ #Ctrl
].
(untranslatedKey == #'Shift'
or:[untranslatedKey == #'Shift_L'
or:[untranslatedKey == #'Shift_R']]) ifTrue:[
- ^ #Shift
+ ^ #Shift
].
(untranslatedKey == #'Alt'
or:[untranslatedKey == #'Alt_L'
or:[untranslatedKey == #'Alt_R']]) ifTrue:[
- ^ #Alt
+ ^ #Alt
].
(untranslatedKey == #'Meta'
or:[untranslatedKey == #'Meta_L'
or:[untranslatedKey == #'Meta_R']]) ifTrue:[
- ^ #Meta
+ ^ #Meta
].
(untranslatedKey == #'Cmd'
or:[untranslatedKey == #'Cmd_L'
or:[untranslatedKey == #'Cmd_R']]) ifTrue:[
- ^ #Cmd
+ ^ #Cmd
].
^ nil
@@ -6151,7 +6151,7 @@
xlatedKey := untranslatedKey.
xlatedKey isCharacter ifFalse:[
- xlatedKey := xlatedKey asSymbol
+ xlatedKey := xlatedKey asSymbol
].
modifier := self modifierKeyTranslationFor:untranslatedKey.
@@ -6159,19 +6159,19 @@
"/ only prepend, if this is not a modifier
"/
modifier isNil ifTrue:[
- s := xlatedKey asString.
- ctrlDown ifTrue:[
- xlatedKey := 'Ctrl' , s
- ].
- metaDown ifTrue:[ "/ sigh - new hp's have both CMD and META keys.
- xlatedKey := 'Cmd' , s
- ].
- altDown ifTrue:[
- xlatedKey := 'Alt' , s
- ].
- xlatedKey isCharacter ifFalse:[
- xlatedKey := xlatedKey asSymbol
- ].
+ s := xlatedKey asString.
+ ctrlDown ifTrue:[
+ xlatedKey := 'Ctrl' , s
+ ].
+ metaDown ifTrue:[ "/ sigh - new hp's have both CMD and META keys.
+ xlatedKey := 'Cmd' , s
+ ].
+ altDown ifTrue:[
+ xlatedKey := 'Alt' , s
+ ].
+ xlatedKey isCharacter ifFalse:[
+ xlatedKey := xlatedKey asSymbol
+ ].
].
^ xlatedKey
@@ -6205,7 +6205,7 @@
xlatedKey := aView keyboardMap valueFor:xlatedKey.
xlatedKey isCharacter ifFalse:[
- xlatedKey := xlatedKey asSymbol
+ xlatedKey := xlatedKey asSymbol
].
^ xlatedKey
@@ -6293,7 +6293,7 @@
"output an audible beep or bell"
UserPreferences current beepEnabled ifTrue:[
- Stdout nextPut:(Character bell)
+ Stdout nextPut:(Character bell)
]
"Modified: / 13.1.1997 / 22:56:13 / cg"
@@ -6336,11 +6336,11 @@
setOfViews := self knownViews.
setOfViews do:[:aView |
- aView shown ifTrue:[
- aView isRootView ifFalse:[
- aView clear; invalidate
- ]
- ]
+ aView shown ifTrue:[
+ aView isRootView ifFalse:[
+ aView clear; invalidate
+ ]
+ ]
]
"
@@ -6365,13 +6365,13 @@
newBits := ByteArray new:(bytesPerLineWanted * height).
srcIndex := dstIndex := 1.
1 to:height do:[:row |
- newBits
- replaceFrom:dstIndex
- to:(dstIndex + bytesPerLineWanted - 1)
- with:givenBits
- startingAt:srcIndex.
- dstIndex := dstIndex + bytesPerLineWanted.
- srcIndex := srcIndex + bytesPerLineGiven.
+ newBits
+ replaceFrom:dstIndex
+ to:(dstIndex + bytesPerLineWanted - 1)
+ with:givenBits
+ startingAt:srcIndex.
+ dstIndex := dstIndex + bytesPerLineWanted.
+ srcIndex := srcIndex + bytesPerLineGiven.
].
^ newBits.
@@ -6608,7 +6608,7 @@
aStream nextPut:$(.
(name := self displayName) isNil ifTrue:[
- name := 'defaultDisplay'
+ name := 'defaultDisplay'
].
aStream nextPutAll:name.
aStream nextPut:$)
@@ -6636,12 +6636,12 @@
in advance, since the X-server is free to return whatever it thinks is a good padding."
^ self
- getBitsFromId:aDrawableId
- x:srcx
- y:srcy
- width:w
- height:h
- into:imageBits
+ getBitsFromId:aDrawableId
+ x:srcx
+ y:srcy
+ width:w
+ height:h
+ into:imageBits
"Created: 19.3.1997 / 13:43:04 / cg"
"Modified: 19.3.1997 / 13:43:38 / cg"
@@ -6655,12 +6655,12 @@
in advance, since the X-server is free to return whatever it thinks is a good padding."
^ self
- getBitsFromId:aDrawableId
- x:srcx
- y:srcy
- width:w
- height:h
- into:imageBits
+ getBitsFromId:aDrawableId
+ x:srcx
+ y:srcy
+ width:w
+ height:h
+ into:imageBits
"Created: 19.3.1997 / 13:43:04 / cg"
"Modified: 19.3.1997 / 13:43:42 / cg"
@@ -6757,16 +6757,16 @@
rememberCopyBuffer
copyBuffer size == 0 ifTrue:[
- ^ self
+ ^ self
].
CopyBufferHistory isNil ifTrue:[
- CopyBufferHistory := OrderedCollection new.
+ CopyBufferHistory := OrderedCollection new.
].
CopyBufferHistory remove:copyBuffer ifAbsent:nil.
CopyBufferHistory addFirst:copyBuffer.
CopyBufferHistory size > 10 ifTrue:[
- CopyBufferHistory removeLast
+ CopyBufferHistory removeLast
].
!
@@ -6778,21 +6778,21 @@
o := self getCopyBuffer.
s := o.
o isString ifFalse:[
- o isNil ifTrue:[
- s := ''
- ] ifFalse:[
- (o isStringCollection) ifTrue:[
- o := o collect:[:each| each isNil ifTrue:[nil] ifFalse:[each string]].
- s := o asStringWithCRsFrom:1 to:(o size) compressTabs:false withCR:false.
- s := s string.
- ] ifFalse:[
- Object recursiveStoreStringSignal handle:[:ex |
- s := ''
- ] do:[
- s := o storeString
- ]
- ]
- ]
+ o isNil ifTrue:[
+ s := ''
+ ] ifFalse:[
+ (o isStringCollection) ifTrue:[
+ o := o collect:[:each| each isNil ifTrue:[nil] ifFalse:[each string]].
+ s := o asStringWithCRsFrom:1 to:(o size) compressTabs:false withCR:false.
+ s := s string.
+ ] ifFalse:[
+ Object recursiveStoreStringSignal handle:[:ex |
+ s := ''
+ ] do:[
+ s := o storeString
+ ]
+ ]
+ ]
].
^ s
@@ -6850,45 +6850,45 @@
where the systemDefaults are used ..."
<resource: #style (#viewSpacing
- #borderColor #borderWidth
- #viewBackgroundColor #shadowColor #lightColor
- )>
+ #borderColor #borderWidth
+ #viewBackgroundColor #shadowColor #lightColor
+ )>
aKey == #viewSpacing ifTrue:[
- ^ self verticalPixelPerMillimeter rounded "/ 1 millimeter
+ ^ self verticalPixelPerMillimeter rounded "/ 1 millimeter
].
aKey == #borderColor ifTrue:[
- ^ Color black
+ ^ Color black
].
aKey == #borderWidth ifTrue:[
- ^ 1
+ ^ 1
].
aKey == #shadowColor ifTrue:[
- ^ Color black
+ ^ Color black
].
aKey == #lightColor ifTrue:[
- ^ Color white
+ ^ Color white
].
aKey == #viewBackgroundColor ifTrue:[
- ^ Color white
+ ^ Color white
].
aKey == #scrollerViewBackgroundColor ifTrue:[
- ^ Color white
+ ^ Color white
].
aKey == #textForegroundColor ifTrue:[
- ^ Color black.
+ ^ Color black.
].
aKey == #textBackgroundColor ifTrue:[
- ^ Color white.
+ ^ Color white.
].
aKey == #selectionForegroundColor ifTrue:[
- ^ Color white.
+ ^ Color white.
].
aKey == #selectionBackgroundColor ifTrue:[
- ^ Color black.
+ ^ Color black.
].
^ nil.
@@ -6909,43 +6909,43 @@
wasBlocked := OperatingSystem blockInterrupts.
knownViews isNil ifTrue:[
- knownViews := WeakArray new:50.
- knownIds := Array new:50.
- freeIdx := 1.
+ knownViews := WeakArray new:50.
+ knownIds := Array new:50.
+ freeIdx := 1.
] ifFalse:[
- freeIdx := knownViews identityIndexOf:nil.
- freeIdx == 0 ifTrue:[
- freeIdx := knownViews identityIndexOf:0.
- [freeIdx ~~ 0
- and:[(knownIds at:freeIdx) notNil]] whileTrue:[
- "/ mhmh - the view is already clear in the weakArray
- "/ but the id is not.
- "/ (i.e. its collected, but not yet finalized)
- "/ skip this entry.
- "/ 'XXX ' print. (knownIds at:freeIdx) displayString printCR.
- freeIdx := knownViews identityIndexOf:0 startingAt:(freeIdx + 1).
- ].
- ].
+ freeIdx := knownViews identityIndexOf:nil.
+ freeIdx == 0 ifTrue:[
+ freeIdx := knownViews identityIndexOf:0.
+ [freeIdx ~~ 0
+ and:[(knownIds at:freeIdx) notNil]] whileTrue:[
+ "/ mhmh - the view is already clear in the weakArray
+ "/ but the id is not.
+ "/ (i.e. its collected, but not yet finalized)
+ "/ skip this entry.
+ "/ 'XXX ' print. (knownIds at:freeIdx) displayString printCR.
+ freeIdx := knownViews identityIndexOf:0 startingAt:(freeIdx + 1).
+ ].
+ ].
].
freeIdx == 0 ifTrue:[
- sz := knownViews size.
- newSize := sz * 2.
- newArr := WeakArray new:newSize.
- newArr replaceFrom:1 to:sz with:knownViews.
- knownViews := newArr.
-
- newArr := Array new:newSize.
- newArr replaceFrom:1 to:sz with:knownIds.
- knownIds := newArr.
- freeIdx := sz + 1.
+ sz := knownViews size.
+ newSize := sz * 2.
+ newArr := WeakArray new:newSize.
+ newArr replaceFrom:1 to:sz with:knownViews.
+ knownViews := newArr.
+
+ newArr := Array new:newSize.
+ newArr replaceFrom:1 to:sz with:knownIds.
+ knownIds := newArr.
+ freeIdx := sz + 1.
].
knownViews at:freeIdx put:aView.
knownIds at:freeIdx put:aWindowID.
wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
idToTableIndexMapping notNil ifTrue:[
- idToTableIndexMapping at:aWindowID put:freeIdx.
+ idToTableIndexMapping at:aWindowID put:freeIdx.
].
"/ dispatching ifFalse:[
@@ -6973,82 +6973,82 @@
lastId := nil.
lastView := nil.
focusView == aView ifTrue:[
- focusView := nil
+ focusView := nil
].
knownViews notNil ifTrue:[
- wasBlocked := OperatingSystem blockInterrupts.
-
- index := 0.
- aViewId notNil ifTrue:[
- idToTableIndexMapping notNil ifTrue:[
- index := idToTableIndexMapping at:aViewId ifAbsent:0.
- ]
- ].
- index == 0 ifTrue:[
- aView notNil ifTrue:[
- index := knownViews identityIndexOf:aView.
- ].
- ].
-
- index ~~ 0 ifTrue:[
- idToTableIndexMapping notNil ifTrue:[
- aViewId notNil ifTrue:[
- idToTableIndexMapping removeKey:aViewId ifAbsent:nil
- ] ifFalse:[
- id := knownIds at:index.
- id notNil ifTrue:[
- idToTableIndexMapping removeKey:id ifAbsent:nil.
- ]
- ]
- ].
- knownViews at:index put:nil.
- knownIds at:index put:nil.
- lastId := nil.
- lastView := nil.
- ].
-
- wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
-
- aView notNil ifTrue:[
- aView isTopView ifTrue:[
- "/ check for sparsely filled knownViews - array
- wasBlocked := OperatingSystem blockInterrupts.
- n := 0.
- knownViews do:[:v |
- (v notNil and:[v ~~ 0]) ifTrue:[
- n := n + 1
- ].
- ].
- n < (knownViews size * 2 // 3) ifTrue:[
- newSize := n * 3 // 2.
- newSize > 50 ifTrue:[
- nV := WeakArray new:newSize.
- nI := Array new:newSize.
- dstIdx := 1.
- 1 to:knownViews size do:[:srcIdx |
- v := knownViews at:srcIdx.
- (v notNil and:[v ~~ 0]) ifTrue:[
- nV at:dstIdx put:v.
- nI at:dstIdx put:(knownIds at:srcIdx).
- dstIdx := dstIdx + 1.
- ].
- ].
- idToTableIndexMapping := nil.
- knownViews := nV.
- knownIds := nI.
- idToTableIndexMapping := Dictionary new.
- knownIds keysAndValuesDo:[:idx :id |
- id notNil ifTrue:[
- idToTableIndexMapping at:id put:idx
- ]
- ].
- ].
- ].
- wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
- ].
- ].
- self checkForEndOfDispatch.
+ wasBlocked := OperatingSystem blockInterrupts.
+
+ index := 0.
+ aViewId notNil ifTrue:[
+ idToTableIndexMapping notNil ifTrue:[
+ index := idToTableIndexMapping at:aViewId ifAbsent:0.
+ ]
+ ].
+ index == 0 ifTrue:[
+ aView notNil ifTrue:[
+ index := knownViews identityIndexOf:aView.
+ ].
+ ].
+
+ index ~~ 0 ifTrue:[
+ idToTableIndexMapping notNil ifTrue:[
+ aViewId notNil ifTrue:[
+ idToTableIndexMapping removeKey:aViewId ifAbsent:nil
+ ] ifFalse:[
+ id := knownIds at:index.
+ id notNil ifTrue:[
+ idToTableIndexMapping removeKey:id ifAbsent:nil.
+ ]
+ ]
+ ].
+ knownViews at:index put:nil.
+ knownIds at:index put:nil.
+ lastId := nil.
+ lastView := nil.
+ ].
+
+ wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+
+ aView notNil ifTrue:[
+ aView isTopView ifTrue:[
+ "/ check for sparsely filled knownViews - array
+ wasBlocked := OperatingSystem blockInterrupts.
+ n := 0.
+ knownViews do:[:v |
+ (v notNil and:[v ~~ 0]) ifTrue:[
+ n := n + 1
+ ].
+ ].
+ n < (knownViews size * 2 // 3) ifTrue:[
+ newSize := n * 3 // 2.
+ newSize > 50 ifTrue:[
+ nV := WeakArray new:newSize.
+ nI := Array new:newSize.
+ dstIdx := 1.
+ 1 to:knownViews size do:[:srcIdx |
+ v := knownViews at:srcIdx.
+ (v notNil and:[v ~~ 0]) ifTrue:[
+ nV at:dstIdx put:v.
+ nI at:dstIdx put:(knownIds at:srcIdx).
+ dstIdx := dstIdx + 1.
+ ].
+ ].
+ idToTableIndexMapping := nil.
+ knownViews := nV.
+ knownIds := nI.
+ idToTableIndexMapping := Dictionary new.
+ knownIds keysAndValuesDo:[:idx :id |
+ id notNil ifTrue:[
+ idToTableIndexMapping at:id put:idx
+ ]
+ ].
+ ].
+ ].
+ wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+ ].
+ ].
+ self checkForEndOfDispatch.
]
"Created: 22.3.1997 / 14:56:20 / cg"
@@ -7061,37 +7061,37 @@
|index v idx|
aWindowID = lastId ifTrue:[
- lastView notNil ifTrue:[
- ^ lastView
- ]
+ lastView notNil ifTrue:[
+ ^ lastView
+ ]
].
idToTableIndexMapping notNil ifTrue:[
- idx := idToTableIndexMapping at:aWindowID ifAbsent:nil.
- idx notNil ifTrue:[
- v := knownViews at:idx.
- (v notNil and:[v ~~ 0]) ifTrue:[
- lastView := v.
- lastId := aWindowID.
- ^ v
- ].
- ]
+ idx := idToTableIndexMapping at:aWindowID ifAbsent:nil.
+ idx notNil ifTrue:[
+ v := knownViews at:idx.
+ (v notNil and:[v ~~ 0]) ifTrue:[
+ lastView := v.
+ lastId := aWindowID.
+ ^ v
+ ].
+ ]
].
knownIds isNil ifTrue:[
- ^ nil
+ ^ nil
].
index := knownIds indexOf:aWindowID.
index == 0 ifTrue:[
- ^ nil
+ ^ nil
].
v := knownViews at:index.
v == 0 ifTrue:[
- knownViews at:index put:nil.
- knownIds at:index put:nil.
- ^ nil
+ knownViews at:index put:nil.
+ knownIds at:index put:nil.
+ ^ nil
].
lastId := aWindowID.
@@ -7108,20 +7108,20 @@
|index v|
aWindowID = lastId ifTrue:[
- lastView notNil ifTrue:[
- ^ true
- ]
+ lastView notNil ifTrue:[
+ ^ true
+ ]
].
idToTableIndexMapping notNil ifTrue:[
- index := idToTableIndexMapping at:aWindowID ifAbsent:nil.
+ index := idToTableIndexMapping at:aWindowID ifAbsent:nil.
].
index isNil ifTrue:[
- index := knownIds indexOf:aWindowID.
+ index := knownIds indexOf:aWindowID.
].
index ~~ 0 ifTrue:[
- v := knownViews at:index.
- ^ (v notNil and:[v ~~ 0])
+ v := knownViews at:index.
+ ^ (v notNil and:[v ~~ 0])
].
^ false.
@@ -7167,12 +7167,12 @@
"/ use mapView:...minWidth:minHeight:maxWidth:maxHeight:
^ self
- mapView:aView id:aWindowId iconified:aBoolean atX:xPos y:yPos
- width:w height:h minExtent:nil maxExtent:nil
+ mapView:aView id:aWindowId iconified:aBoolean atX:xPos y:yPos
+ width:w height:h minExtent:nil maxExtent:nil
!
mapView:aView id:aWindowId iconified:aBoolean atX:xPos y:yPos
- width:w height:h minExtent:minExt maxExtent:maxExt
+ width:w height:h minExtent:minExt maxExtent:maxExt
"make a window visible - either as icon or as a real view - needed for restart"
^ self subclassResponsibility
@@ -7233,17 +7233,17 @@
This undoes the effect of #setCursors:"
knownViews notNil ifTrue:[
- knownViews validElementsDo:[:aView |
- |c vid cid|
-
- (vid := aView id) notNil ifTrue:[
- c := aView cursor.
- (c notNil and:[(cid := c id) notNil]) ifTrue:[
- self setCursor:cid in:vid
- ]
- ]
- ].
- self flush
+ knownViews validElementsDo:[:aView |
+ |c vid cid|
+
+ (vid := aView id) notNil ifTrue:[
+ c := aView cursor.
+ (c notNil and:[(cid := c id) notNil]) ifTrue:[
+ self setCursor:cid in:vid
+ ]
+ ]
+ ].
+ self flush
]
"
@@ -7291,14 +7291,14 @@
id := (aCursor onDevice:self) id.
id notNil ifTrue:[
- knownViews validElementsDo:[:aView |
- |vid|
-
- (vid := aView id) notNil ifTrue:[
- self setCursor:id in:vid
- ]
- ].
- self flush
+ knownViews validElementsDo:[:aView |
+ |vid|
+
+ (vid := aView id) notNil ifTrue:[
+ self setCursor:id in:vid
+ ]
+ ].
+ self flush
]
"
@@ -7406,9 +7406,9 @@
"define a bitmap to be used as icon"
self
- setWindowIcon:aForm
- mask:nil
- in:aWindowId
+ setWindowIcon:aForm
+ mask:nil
+ in:aWindowId
!
setWindowIcon:aForm mask:aMaskForm in:aWindowId
@@ -7430,12 +7430,12 @@
|minW minH maxW maxH|
minExt notNil ifTrue:[
- minW := minExt x.
- minH := minExt y.
+ minW := minExt x.
+ minH := minExt y.
].
maxExt notNil ifTrue:[
- maxW := maxExt x.
- maxH := maxExt y.
+ maxW := maxExt x.
+ maxH := maxExt y.
].
self setWindowMinExtentX:minW y:minH maxExtentX:maxW y:maxH in:aWindowId
!
@@ -7550,6 +7550,6 @@
!DeviceWorkstation class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.414 2002-07-09 14:13:17 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.415 2002-07-11 12:23:18 cg Exp $'
! !
DeviceWorkstation initialize!