eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'DeviceWorkstation':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: DeviceWorkstation


Inheritance:

   Object
   |
   +--GraphicsDevice
      |
      +--HostGraphicsDevice
         |
         +--DeviceWorkstation
            |
            +--XWorkstation

Package:
stx:libview
Category:
Interface-Graphics
Version:
rev: 1.815 date: 2024/04/22 17:08:23
user: stefan
file: DeviceWorkstation.st directory: libview
module: stx stc-classLibrary: libview

Description:


this abstract class defines common protocol to all Display types.
For compatibility with ST-80, this class (actually a concrete subclass)
is also bound to the global variable Screen.

DeviceWorkstation (and its concrete subclasses) are the central classes
around windowManagement and event processing.
See the documentation in #events and #workstationDevices for more detailed
info.

[instance variables:]

  displayId       <Number>          the device id of the display
  visualType      <Symbol>          one of #StaticGray, #PseudoColor, ... #TrueColor
  monitorType     <Symbol>          one of #monochrome, #color, #unknown

  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)
  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)
  redMask         <SmallInteger>    shifted red mask (only useful for TrueColor displays)
  greenMask       <SmallInteger>    shifted green mask (only useful for TrueColor displays)
  blueMask        <SmallInteger>    shifted blue mask (only useful for TrueColor displays)
  shiftRed        <SmallInteger>    number of bits to shift red bits (only valid for TrueColor displays)
  shiftGreen      <SmallInteger>    number of bits to shift green bits (only valid for TrueColor displays)
  shiftBlue       <SmallInteger>    number of bits to shift blue bits (only valid for TrueColor displays)

  hasColors       <Boolean>         true, if display supports colors
  hasGreyscales   <Boolean>         true, if display supports grey-scales (i.e is not b/w display)
  width           <SmallInteger>    number of horizontal pixels
  height          <SmallInteger>    number of vertical pixels
  heightMM        <Number>          screen height in millimeter
  widthMM         <Number>          screen width in millimeter
  resolutionHor   <Number>          pixels per horizontal millimeter
  resolutionVer   <Number>          pixels per vertical millimeter

  knownViews      <WeakValueDictionary>  viewId -> view all of my known views

  dispatching     <Boolean>         true, if currently in dispatch loop
  exitDispatchOnLastWindowClose
                  <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
  metaDown        <Boolean>         true, if meta key (cmd-key) is currently pressed
  altDown         <Boolean>         true, if alt key is currently pressed

  motionEventCompression
                  <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)

  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.

  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.

[class variables:]

  MultiClickTimeDelta               in ms; controls how long of a delay is
                                    required between two clicks, to NOT take
                                    it as a multi-click.

  ErrorPrinting                     controls low-level (X-) error message printing

  AllScreens                        a collection of known screens

copyright

COPYRIGHT (c) 1993 by Claus Gittinger 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 inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

events

All events are processed in a workstation's dispatchEvent method. There, incoming events are first sent to itself, for a first (view independent) preprocessing. For example, the device's state of the shift-, alt-, control and meta keys are updated there. After that, the event is forwarded either to the view's sensor or to the view directly (if it has no sensor). (Sensorless views are a leftover from ancient times and will sooner or later vanish - simplifying things a bit. Do not depend on views without sensors to work correctly in future versions.) This event processing is done by the event dispatcher process, which is launched in ST/X's startup sequence (see Smalltalk>>start). Event processing is done at a high priority, to allow keyboard processing and CTRL-C handling to be performed even while other processes are running. The code executed by the event process is found in #startDispatch. 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 Other events have to be enabled by sending a corresponding #enableXXXEvent message to the view which shall receive those events. For example, pointerMotion events (i.e. motion without button being pressed) are enabled by: 'aView enableMotionEvent' The above is only of interest, if you write your own widget classes; existing widgets set things as required in their #initEvents method.

workstationDevices

In ST/X, all interaction with the graphics device is done through an instance of (a subclass) of DeviceWorkstation. Every view has a reference to the device it has been created on in its 'device' instance variable. One particular device instance is bound to the global variable Display: this is the default graphics display, on which new views are created (however, provisions exist for multi-display operation) 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) 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 ? An experimental version for a NeXTStep interface exists, but is currently no longer maintained and not released. DeviceWorkstation itself is an abstract class; the methods as defined here perform things which are common to all graphic devices or block methods and raise a subclassResponsibilty error condition. To create a new graphic interface, at least the subclassResponsibility-methods have to be reimplemented in a concrete subclass. ST/X is designed to allow the use of multiple workstation devices in parallel, if the underlying window system supports this. For example, in X, it is possible to create another instance of XWorkstation, start a dispatch process for it, and to create and open views on this display. Multiple display operation does not work with other devices (i.e. Windows). If you want to experiment with multi-display applications, you have to: - create a new instance of XWorkstation: Smalltalk at:#Display2 put:(XWorkstation new). or: 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' returns nil, if connection is refused - leaving you with Display2==nil in this case. - start an event dispatcher process for it: (this is now no longer needed - the first opened view will do it for you) 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) - 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. For all of the above, there is now a convenient helper method in ApplicationModel, which allows to write: 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 Public domain code, you may find those. Beside this (little bug ;-), remote display operation works pretty well. If you write your application to work around those, multi-display applications are possible in the current release (and actually being used in a concrete application, where up to 6 x-terminals are connected to a single linux PC). To make your application ready for multi-display operation, replace all references to 'Display' by: 'Screen current', which evaluates to the currently active display. I.e. each view gets its actual display via this expression. Since ST/X views already use this, new views opened by remote views should come up on the remote display. There is no easy solution for things like Notifiers, WarnBoxes or Debuggers when opened from some background or non-view process. These will come up one the default Display, as returned by 'Screen default'. Finally, your application should care for I/O errors (i.e. lost connection when a remote display is switched off). The framework provides per-display signals, which are raised in the corresponding 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. ]. There may still some problems to be expected, if the screens have different display capabilities (b&w vs. greyscale vs. color display). The current styleSheet approach keeps default values only once (it should do so per display ...) For now, expect ugly looking views in this case - or set your styleSheet for the smallest common capabilities (i.e. for b&w). This may be fixed in a future version ...

Class protocol:

Signal constants
o  currentScreenQuerySignal
return the signal which can be used to provide a current
screen (if background processes ask for one)

o  deviceErrorSignal
return the signal used for device error reporting.
In multi-display configurations, this is the parent of
all per-instance deviceErrorSignals.

o  deviceIOErrorSignal
return the signal used for device I/O error reporting.
In multi-display configurations, this is the parent of
all per-instance deviceIOErrorSignals.

o  deviceIOTimeoutErrorSignal
return the signal used for device I/O timeout error reporting.
In multi-display configurations, this is the parent of
all per-instance deviceIOTimeoutErrorSignals.

o  deviceOpenErrorSignal
return the signal used for reporting of errors while opening a device.

o  drawingOnClosedDeviceSignal

accessing
o  default
ST-80 compatibility.
Return the default screen. This is typically the first opened
Display screen in a session. Use of the global variable Display
should vanish over time - replace it by Screen default.

Usage example(s):

     Screen default

o  default: aDevice
Set the default screen. This is sent very early during startup,
and assigns the first opened screenDevice to both Display and the default
screen.

cleanup
o  lowSpaceCleanup
cleanup in low-memory situations

clipboard support
o  bufferAsString: aBuffer
aBuffer (my current selection or the clipBoard) as a string

defaults
o  defaultButtonPressTimeForMenu

o  defaultButtonPressTimeForMenu: seconds

error handling
o  errorInterrupt: errID with: aParameter
an error in the devices low level code (typically Xlib or XtLib)
This is invoked via
XError->errorInterrupt:#DisplayError->registeredErrorInterruptHandlers
or
XError->errorInterrupt:#DisplayIOError->registeredErrorInterruptHandlers

looks if a signal handler for DeviceErrorSignal is present,
and - if so raises the signal.
If the signal not handled, simply output a message and continue.
This allows for non disrupted error reporting OR to catch and
investigate errors as required.
However, io-errors are always delivered as a signal raise.

Usage example(s):

an error in the devices low level code (typically Xlib or XtLib)
     This is invoked via
	XError->errorInterrupt:#DisplayError->registeredErrorInterruptHandlers
     or
	XError->errorInterrupt:#DisplayIOError->registeredErrorInterruptHandlers

     looks if a signal handler for DeviceErrorSignal is present,
     and - if so raises the signal.
     If the signal not handled, simply output a message and continue.
     This allows for non disrupted error reporting OR to catch and
     investigate errors as required.
     However, io-errors are always delivered as a signal raise.

o  errorPrinting
return the `errorPrinting-is-on' flag

o  errorPrinting: aBoolean
set/clear the `errorPrinting-is-on' flag

o  lastErrorString
return a string describing the last error

** This method must be redefined in concrete classes (subclassResponsibility) **

o  resourceIdOfLastError
return the resource id responsible for the last error

** This method must be redefined in concrete classes (subclassResponsibility) **

initialization
o  initialize
create local error signals; enable errorPrinting

o  initializeConstants
initialize some (soft) constants

o  nativeWindows: aBoolean
enable / disable use of native windows - dummy here.

instance creation
o  newDispatchingFor: aScreenName
create a new instance of mySelf, which serves aScreenName.
Only useful for device-classes which support multiple devices -
i.e. X-Workstations

o  newFor: aDisplayName
Create an new instance for a connection to aDisplayName.
If aDisplayName is nil, a connection to the standard display is opened

o  openDefaultDisplay: aStringOrNil
open the default display. aStringOrNil may be the display name,
if nil, the name is extracted from command-line-arguments or the environment.
Raise a signal if open fails.

queries
o  allScreens
Return a collection of active display devices.
Typically, there is only one: Display or Screen current.

Usage example(s):

     Screen allScreens

o  current
Return the currently active screen,
that is, the device of the currently executing windowGroup.
It will be used in multi-display operation, to launch views on
the correct device - even if not specified explicitely.
This does not yet work fully satisfying if a background processes
invokes this ... the default display is returned in this case.
In a headless (i.e. non-GUI) application, nil is returned.

Usage example(s):

the current windowGroup got corrupted somehow ...

Usage example(s):

'DevWorkstation [info]: cannot figure out current screen - use default' infoPrintCR.

Usage example(s):

     Screen current

     |s|
     Transcript topView windowGroup process interruptWith:[s := Screen current].
     Delay waitForSeconds:0.5.
     s inspect

o  currentIfNone: exceptionValue
Return the currently active screen;
if there is none, return the value from exceptionValue

Usage example(s):

     Screen currentIfNone:[self error]

o  currentWindow
Return the currently active window,
that is, the topView of the currently executing windowGroup

Usage example(s):

     Screen currentWindow

o  defaultDisplayName
extract the default display name from command line arguments
and environment. Nil is a valid name which represents the builtin default

Usage example(s):

     self defaultDisplayName

o  flushCachedLastScreen

o  isAbstract
answer true, if I am not a concrete Workstation class

Usage example(s):

     DeviceWorkstation isAbstract
     XWorkstation isAbstract

o  isWindowsPlatform

o  isX11Platform

o  platformName
ST-80 compatibility.
Return a string describing the display systems platform.
Returns a dummy here. This must be redefined in concrete
Workstation classes, to return something like 'X11', 'win32', 'os2' etc.

standalone setup
o  exitOnLastClose: aBoolean
set/clear the flag which controls if the
event dispatching should stop when the last view is closed
on the (main) Display connection.
(standAlone applications will set it)


Instance protocol:

Compatibility-ST80
o  colorDepth
alias for depth - for ST-80 compatibility

o  colorPalette
alias for colorMap - for ST-80 compatibility

o  stackedWindows
supposed to return all topViews in stacking order;
BUGGY: right now, the order is undefined

o  zoom: startRect to: endRect
animate a rubber-rectangle from startRect to endRect.
Can be used by buttons, which open some dialog for nicer user feedback.
Notice: since the display's window manager typically allows a topWindow
to be placed by the user, this should not be used for modeless
topViews.

Usage example(s):

     Screen current zoom:(10@10 corner:20@20) to:(20@20 corner:1000@1000)
     Screen current zoom:(20@20 corner:1000@1000) to:(10@10 corner:20@20)

o  zoom: startRect to: endRect duration: milliseconds
animate a rubber-rectangle from startRect to endRect.
Can be used by buttons, which open some dialog for nicer user feedback.
Notice: since the display's window manager typically allows a topWindow
to be placed by the user, this should not be used for modeless
topViews.

Usage example(s):

     Screen current zoom:(10@10 corner:20@20) to:(20@20 corner:1000@1000) duration:1000
     Screen current zoom:(20@20 corner:1000@1000) to:(10@10 corner:20@20) duration:1000

o  zoom: startRect to: endRect speed: pixelsPerSecond
animate a rubber-rectangle from startRect to endRect.
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 display's window manager typically allows a topWindow
to be placed by the user, this should not be used for modeless
topViews.

Usage example(s):

     Screen current zoom:(10@10 corner:20@20) to:(20@20 corner:1000@1000) speed:1000
     Screen current zoom:(20@20 corner:1000@1000) to:(10@10 corner:20@20) speed:10

Compatibility-Squeak
o  border: aRectangle width: bw
draw a rectangular border on the display with black.
Added to allow for some squeak examples to be evaluated ...

Usage example(s):

     Display restoreAfter:[
	Display border:(10@10 corner:100@100) width:2.
     ]

o  centerOfMonitorHavingPointer
answer the center of the bounds of the monitor which contains the mouse pointer.

Usage example(s):

     Display centerOfMonitorHavingPointer  => 640@389

o  cursorPoint
ST-80 compatibility:
return the position of the mouse pointer on this display
(in screen coordinates)

o  displayOpaqueString: s x: x y: y
draw a string on the display with black.
Added to allow for some squeak examples to be evaluated ...

Usage example(s):

     Display restoreAfter:[
	Display displayOpaqueString:'hello' x:10 y:10.
     ]

o  displayString: s x: x y: y
draw a string on the display with black.
Added to allow for some squeak examples to be evaluated ...

Usage example(s):

     Display restoreAfter:[
	Display displayString:'hello' x:10 y:10.
     ]

o  fill: aRectangle fillColor: aColor
fill a rectangular area on the display with aColor.
Added to allow for some squeak examples to be evaluated ...

Usage example(s):

     Display restoreAfter:[
	 Display fill:(10@10 corner:100@100) fillColor:Color yellow
     ]

o  fillWhite
fill all of the display with white.
Added to allow for some squeak examples to be evaluated ...

Usage example(s):

     Display restoreAfter:[
	 Display fillWhite
     ]

Usage example(s):

     Display restoreAfter:[
	 Display fillWhite:(10@10 corner:100@100)
     ]

o  fillWhite: aRectangle
fill a rectangular area on the display with white.
Added to allow for some squeak examples to be evaluated ...

Usage example(s):

     Display restoreAfter:[
	 Display fillWhite:(10@10 corner:100@100)
     ]

o  primMouseButtons
return the current button state

Usage example(s):

     Display primMouseButtons

o  restoreAfter: aBlock
evaluate aBlock, wait for a buttonPress, then restore the display.
Added to allow for some squeak examples to be evaluated ...

Usage example(s):

     Display restoreAfter:[Display fillWhite:(10@10 corner:100@100)]

o  supportsDisplayDepth: givenDepth
return true, if the given depth is supported by the display.
(Actually, some displays support multiple depths (i.e. visuals),
but for now, we want the displays native depth here.

o  waitButton
wait for any button to be pressed

Usage example(s):

     Sensor waitButton.
     Sensor waitNoButton

o  waitClickButton
wait for any button to be pressed and released again.
Return the screen coordinate of the click.

Usage example(s):

     Sensor waitClickButton.

o  waitNoButton
wait for no button to be pressed

Usage example(s):

     Sensor waitButton.
     Sensor waitNoButton

Signal constants
o  deviceErrorSignal
return the per-device signal, which is used for error reporting.
The default here is the global DeviceErrorSignal
(which is the parent of any per-instance error signals).

o  deviceIOErrorSignal
return the signal used for device I/O error reporting.
The default here is the global DeviceIOErrorSignal
(which is the parent of any per-instance I/O error signals).

o  deviceIOTimeoutErrorSignal
return the signal used for device I/O timeout error reporting.
The default here is the global DeviceIOTimeoutErrorSignal
(which is the parent of any per-instance I/O timeout signals).

accessing & queries
o  activateOnClick: aBoolean
enable/disable raise&activate on click;
return the previous setting.
This may be left unimplemented by a device.

o  activeView
Display activeView

o  allViews
return a collection of all my known views

o  buttonMotionMask: aButtonNr
return the state-mask for button<n> in motion events state-field.
This is the devices mask.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  buttonMotionMask: aMask includesButton: aButton
given a device button mask, return true if a logical button
(1 .. 3 for left .. right) is included.

o  colorAt: aPoint
Screen current colorAt:0@0

o  dispatchProcess

o  displayFileDescriptor
return the file descriptor associated with the display
if any. If there is no underlying filedescriptor, return nil.
(used for event select/polling)

o  getSystemColor: aKey
retrieve a windows system color.
The styleSheet/View classes may use this to setup default colors.

Usage example(s):

     Display getSystemColor:#COLOR_WINDOW
     Display getSystemColor:#COLOR_HIGHLIGHT

o  id
return the displayId

o  isOpen
return true, if there is a valid connection to the display.
Added for ST-80 compatibility.

o  isOpenAndDispatching
return true, if there is a valid connection to the display and events are dispatched.

o  isPersistentInSnapshot
return true, if resources on this device are to be made
persistent in a snapshot image.

o  knownViews

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  mayOpenDebugger
return true, if a debugger may open on this workstation;
if false, the debugger opens on the main display.
This should be made a variable ...

o  mayOpenDebugger: aBoolean
set/clear the flag, which controls if a debugger may open on this workstation;
if false, the debugger opens on the main display.

o  multiClickTimeDelta

o  multiClickTimeDelta: milliseconds

o  nativeDialogs

o  nativeFileDialogs

o  nativeWidgets
true if the use of native widgets is enabled on this device

o  queryUsableExtent
answer the extent of all monitors

Usage example(s):

        Screen current queryUsableExtent

o  rootView
return the rootView (i.e. the background window) on the receiver screen.
It is not guaranteed, that a particular display device supports this.

Usage example(s):

     |v|
     v := Display rootView.
     v paint:Color red.
     v clippedByChildren:false.
     v fillRectangleX:10 y:10 width:100 height:100.

Usage example(s):

     |v|
     v := Display rootView.
     v paint:Color red.
     v clippedByChildren:true.
     v fillRectangleX:10 y:10 width:100 height:100.

o  suppressDebugger
return true, if no debugger should be opened for applications running
on this device (i.e. neither a debugger on the device nor on the
main screen).
If true, the debugger is either opened on the device or on the
main display, depending on the mayOpenDebugger setting.

o  suppressDebugger: aBoolean
set/clear the flag, which controls if no debugger should be opened for applications running
on this device (i.e. neither a debugger on the device nor on the
main screen).
If true, the debugger is either opened on the device or on the
main display, depending on the mayOpenDebugger setting.

o  suppressShadowViews
return true, if this device wants to suppress shadow views
(i.e. shadows under popups and modalBoxes).
Some (slow) devices may want to return true here

o  translatePoint: aPoint from: windowId1 to: windowId2
given a point in window1 (defined by its id), return the coordinate of
aPoint in window2 (defined by its id).
Use to xlate points from a window to rootwindow, mainly for rubber-line
drawing on the display's root window.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  translatePoint: aPoint fromView: window1 toView: window2
given a point in window1, return the coordinate of aPoint in window2.
Either window argument may be nil to specify the root window (screen)
Use to xlate points from a window to another window (or from a window
to the rootwindow), mainly for rubber-line drawing on the display's root window.

o  translatePointFromRoot: aPoint toView: window
given a point as absolute root-window coordinate, return the coordinate within the window.
Use to xlate points from the rootWindow to a window.

o  translatePointToRoot: aPoint fromView: window1
given a point in window1, return the absolute root-window coordinate.
Use to xlate points from a window to the rootwindow,
mainly for rubber-line drawing on the display's root window.

o  viewFromPoint: aScreenPoint
given a point on the screen, return the ST/X view in which that
point is (this may be a subview).
Return nil, if it's not an ST/X view or if the point is on the background

o  viewIdFromPoint: aScreenPoint
given a point on the screen, return the id of the ST/X view in which that
point is (this may be a subview). Return nil, if it's not an ST/X view
or if the point is on the background

o  viewIdFromPoint: aPoint in: windowId
given a point in rootWindow, return the viewId of the subview of windowId
hit by this coordinate. Return nil if no view was hit.
- use to find window to drop objects after a cross-view drag

o  windowAt: aScreenPoint
given a point on the screen, return the ST/X topview in which that
point is.
Return nil, if it's not an ST/X view or if the point is on the background.
Alias for viewFromPoint: for ST-80 compatibility

accessing-display attributes
o  bitsBlue
return the number of valid bits in the blue component.

Usage example(s):

     Display bitsBlue

o  bitsGreen
return the number of valid bits in the green component.

Usage example(s):

     Display bitsGreen

o  bitsPerRGB
return the number of valid bits per rgb component;
Currently, assume that r/g/b all have the same precision,
which is a stupid assumption (there may be some, where less
resolution is available in the blue component).
Therefore, this may be changed to return a 3-element vector.
In the meantime, use bitsRed/bitsGreen/bitsBlue to get this information.

Usage example(s):

     Display bitsPerRGB

o  bitsRed
return the number of valid bits in the red component.

Usage example(s):

     Display bitsRed

o  blackColor
return the black color on this device.
This is the same as 'Color black onDevice:device', but much faster.

Usage example(s):

     Display blackColor

o  blackpixel
return the colorId of black

** This method must be redefined in concrete classes (subclassResponsibility) **

o  blueMask
return a mask, which extracts the blueBits from a color id.
This only makes sense with trueColor displays;
therefore, 0 is returned on all others.

Usage example(s):

     Display blueMask

o  depth
return the depth in pixels of the display

Usage example(s):

     Display depth

o  focusMode

o  greenMask
return a mask, which extracts the greenBits from a color id.
This only makes sense with trueColor displays;
therefore, 0 is returned on all others.

Usage example(s):

     Display greenMask

o  hasColors
return true, if it's a color display

Usage example(s):

     Display hasColors

o  hasGrayscales
return true, if this workstation supports grayscales
(also true for color displays)

Usage example(s):

     Display hasGrayscales

o  hasGreyscales
marked as obsolete by exept MBP at 20-09-2021

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  redMask
return a mask, which extracts the redBits from a color id.
This only makes sense with trueColor displays;
therefore, 0 is returned on all others.

Usage example(s):

     Display redMask

o  shiftBlue
return the count by which the blue bits are to be shifted
when forming a color index.
This only makes sense with trueColor displays; therefore,
nil is returned on all others.

Usage example(s):

     Display shiftBlue

o  shiftGreen
return the count by which the green bits are to be shifted
when forming a color index.
This only makes sense with trueColor displays; therefore,
nil is returned on all others.

Usage example(s):

     Display shiftGreen

o  shiftRed
return the count by which the red bits are to be shifted
when forming a color index.
This only makes sense with trueColor displays; therefore,
nil is returned on all others.

Usage example(s):

     Display shiftRed

o  visualType
return a symbol representing the visual type of the display

Usage example(s):

     Display visualType

o  visualType: aSymbol
set the visual type.
The only situation, where setting the visual makes sense,
is with my plasma-display, which ignores the palette and spits out
grey scales, independent of color LUT definitions.
(of which the server knows nothing).
So, this should be used from a display-specific startup file only.

o  whiteColor
return the white color on this device.
This is the same as 'Color white onDevice:device', but much faster.

o  whitepixel
return the colorId of white

** This method must be redefined in concrete classes (subclassResponsibility) **

accessing-display capabilities
o  hasColors: aBoolean
set the hasColors flag - needed since some servers don't tell the
truth if a monochrome monitor is connected to a color server.
Clearing the hasColors flag in the rc file will force use of grey
colors (which might make a difference, since some colors are hard to
distinguish on a greyscale monitor).

o  hasDPS
return true, if this workstation supports postscript output into views.
Should be reimplemented in concrete classes which do support this.

Usage example(s):

     Display hasDPS

o  hasExtension: extensionString
query for an X extension. The method here is provide for XWorkstation
protocol compatibility only.

Usage example(s):

     Display hasExtension:'XVideo'
     Display hasExtension:'Input'
     Display hasExtension:'GLX'
     Display hasExtension:'X3D-PEX'
     Display hasExtension:'XInputExtension'
     Display hasExtension:'SHAPE'
     Display hasExtension:'MIT-SHM'
     Display hasExtension:'SGIFullScreenStereo'

o  hasGrayscales: aBoolean
set the hasGrayscales flag - can be used to simulate b&w behavior
on greyScale and color monitors.
(You may want to check if your application looks ok if displayed on
a b&w monitor - even if you have a color display. To do so, clear
the hasGreyscales flag from your .rc file)

o  hasGreyscales: aBoolean
marked as obsolete by exept MBP at 20-09-2021

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  hasImageExtension
return true, if this workstation supports the X Image extension

Usage example(s):

     Display hasImageExtension

o  hasInputExtension
return true, if this workstation supports the X Input extension

Usage example(s):

     Display hasInputExtension

o  hasMultibuffer
return true, if this workstation supports the X multibuffer extension

Usage example(s):

     Display hasMultibuffer

o  hasPEX
return true, if this workstation supports PEX graphics.
Should be reimplemented in concrete classes which do support this.

Usage example(s):

     Display hasPEX

o  hasShape
marked as obsolete by Stefan Vogel at 8-Sep-2023

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  hasShm
return true, if this workstation supports shared memory pixmaps.
Should be reimplemented in concrete classes which do support this.

Usage example(s):

     Display hasShm

o  hasStereoExtension
return true, if this workstation supports stereo GL drawing.
Both the server must support it, and the feature must have been
enabled in the smalltalk system, for true to be returned.

Usage example(s):

     Display hasStereoExtension

o  hasXVideo
return true, if this workstation supports the XVideo extension

Usage example(s):

     Display hasXVideo

o  iconSizes
Get the supported icon sizes. These are typically set by the window manager.
We return nil here (as if there are no special size preferences).

o  ignoreBackingStore: aBoolean
if the argument is true, the view's backingStore setting will be ignored, and
no backing store used - this can be used on servers where backing store is
very slow (from rc-file)

o  isSlow
return true, if this is a relatively slow device -
used to turn off things like popup-shadows

o  isSlow: aBoolean
set/clear the slow flag.
The slow-flag has no semantic meaning by itself;
however, it can be set via the display.rc file and tested at various
other places to turn off some bells&whistles which might slow down
the drawing. For example, shadows under popUps are suppressed if isSlow
is set.

o  monitorInfoFor: aMonitorId

o  monitorType
return a symbol representing the monitor type of the display.
It is usually set to #unknown, #color or #monochrome.
But it can be set to any value from the startup file, for later
testing from anywhere. For example the startup for plasma-displays
can set it to #plasma to later influence the colors used in widgets
(indirectly through the resource file).

Usage example(s):

     Display monitorType

o  monitorType: aSymbol
set the monitorType - see comment in DeviceWorkstation>>monitorType

o  ncells
return the number of usable color cells, the display has
- this is not always 2 to the power of depth
(for example, on 6bit displays, ncells is 64 while depth is 8)

Usage example(s):

     Display ncells

o  numberOfMonitors
Display numberOfMonitors

o  pointIsVisible: aPoint
is the point visible?

Usage example(s):

     Screen current pointIsVisible:(0@0)
     Screen current pointIsVisible:(1500@0)
     Screen current pointIsVisible:(9000@0)
     Screen current pointIsVisible:(Display pointFromUser)

o  pointsAreOnSameMonitor: point1 and: point2
are the two points on the same (multi-screen) monitors?
To be redefined for display systems which support MULTI SCREEN

o  preferredIconSize
Get the preferrered icon size. These are typically set by the window manager.

Usage example(s):

     Display preferredIconSize:nil.
     Display preferredIconSize.
     Display preferredIconSize:32@32
     Display preferredIconSize:nil

o  preferredIconSize: anExtentPoint
set the preferrered icon size.
By default, the preferredIconSize is queried from the display,
however, some windowManagers return stupid values.
This methods allows overriding thngs from a startup file

Usage example(s):

     Display preferredIconSize
     Display preferredIconSize:32@32
     Display preferredIconSize:48@48

o  scrollsAsynchronous
return true, if this display asynchronously sends expose events after a
scroll operation. False otherwise. Asynchronous expose events are an X
speciality, which affects a few methods outside of the display class (sorry)

o  supportedClipboards
answer a collection of symbols with the supported clipboards..
At least clipboard should be supported on any platform

o  supportedImageFormatForDepth: aDepth
given a depth, return the devices image format info,
which provides padding info. If the given depth is not
supported, return nil.

o  supportedImageFormats
return an array with supported image formats; each array entry
is another array, consisting of depth and bitsPerPixel values.
Here, we return a single format only; every graphics device must
support b&w single bit images.

o  supportsAlphaChannel
return true, if this workstation supports alpha information.
If not, alpha blending is done 'manually' when images are displayed.
Currently none does

Usage example(s):

     Display supportsAlphaChannel

o  supportsAnyViewBackgroundPixmaps
return true, if the device allows any pixmap as
viewBackground. False returned here - redefined in some
device classes.

o  supportsArbitraryShapedViews
return true, if this workstation supports arbitrary shaped
windows.
Should be reimplemented in concrete classes which do support this.

Usage example(s):

     Display supportsArbitraryShapedViews

o  supportsDeepIcons
return true, if this device supports non b&w (i.e. greyScale
or colored icons). Many Xservers (and/or windowManagers) crash,
if you pass them a deep form as icon; therefore, the default is false.
It may be a good idea to check for the server vendor/release and
return true sometimes.
This flag can be set with #supportsDeepIcons:

Usage example(s):

     Display supportsDeepIcons:true

     |v|

     v := StandardSystemView new.
     v icon:((Image fromFile:'bitmaps/claus.gif') magnifiedTo:68@68).
     v open.

o  supportsDeepIcons: yesOrNo
set/clear the supportsDeepIcons flag.
Many Xservers (and/or windowManagers) crash,
if you pass them a deep form as icon; therefore, the default is false.

o  supportsGLDrawing
return true, if this device supports 3D GL drawing.
We do not depend on that being implemented.

Usage example(s):

     Display supportsGLDrawing

o  supportsHotKeys
can we register/deregister hotKeys?

o  supportsIconMasks
return true, if this device supports masked icons.
Assume true here - to be redefined in concrete classes.

Usage example(s):

     Display supportsIconMasks

o  supportsIconViews
return true, if this device supports views as icons.
Only Xservers (currently) support this.

Usage example(s):

     Display supportsIconViews

o  supportsMaskedDrawingWith: aForm
return true, if the device allows the given form pixmap
to be used as paint color.
False returned here, which forces higher level code to
perform the filling manually (by copying the form)
- redefined in most device classes.

o  supportsMaskedDrawingWithOffset: aForm
return true, if the device allows the given form pixmap
to be used as paint color AND it supports a pattern offset.
Pattern offset is needed to display the form in a scrolled view,
to correctly start bit-blitting within the pattern.
False returned here, which forces higher level code to
perform the filling manually (by copying the form)
- redefined in most device classes.

o  supportsNativeDialogs
true if this device supports native dialogs for warning and info dialogs

Usage example(s):

     Screen current supportsNativeDialogs

o  supportsNativeFileDialogs
true if this device supports native file dialogs

o  supportsNativeWidgetType: aWidgetTypeSymbol
true, if this device does support this kind of native widget.
If true, that kind of widget is created and NOT a standard view;
also, drawing is then typically done by that widget itself,
instead of by ST/X.
Currently, this is not supported and in an experimental stage.

Usage example(s):

     Screen current supportsNativeWidgetType:#Button

o  supportsNativeWidgets
true, if this device does support any kind of native widget.

Usage example(s):

     Screen current supportsNativeWidgets

o  supportsRoundShapedViews
return true, if this workstation supports round shaped
(elliptical & circular) windows.
Should be reimplemented in concrete classes which do support this.

Usage example(s):

     Display supportsRoundShapedViews

o  supportsScreenReading
can the screen be read?

o  supportsVariableHeightFonts
are fonts with variable height supported?
Subclasses may redefine this

o  supportsViewBackgroundPixmap: aForm
return true, if the device allows the given pixmap as
viewBackground. If false is returned,
drawing is done by (possibly) slower smalltalk code.
False returned here - redefined in some concrete device classes.

o  supportsViewGravity
return true, if this device supports gravity attributes.
We do not depend on the being implemented, but some resizing operations
are faster, it is is.

Usage example(s):

     Display supportsViewGravity

o  supportsWindowBorder: aNumber
return true, if this device supports bordered windows with the given borderWidth.
Right now, some drawing stuff depends on (at least) a border of 1 pixel
to be supported by the device.
ST/X's views are being rewritten to draw the border manually in the
future, since some systems do not support arbitrary wide borders (i.e. Windows).
Also, most (all?) systems only support drawing a solid border, which may or may not be
what we want.

Usage example(s):

     Display supportsWindowBorder:1

o  supportsXftFonts
can we draw into windows using Xft fonts?
Obviously, this will only ever be answered true by XWindow displays

o  supportsXftFontsInBitmaps
can we draw into bitmap/pixmaps using Xft fonts?
Obviously, this will only ever be answered true by XWindow displays.
This is a separate query (for now), because rendering into pixmaps
seems not to work currently

accessing-display geometry
o  boundingBox
return a rectangle representing the display's bounding box.
For Smalltalk-80 2.x compatibility

o  bounds
return a rectangle representing the display's bounding box.
For Smalltalk-80 4.x compatibility

Usage example(s):

     Screen default bounds

Usage example(s):

     Display bounds

o  captionHeight
return the height in pixels of the caption
(i.e. title bar) of topWindows.
Fallback of 0 (i.e. unknown) is returned here.
Applications should not depend on that returned value
to be exact - on some systems (windowManagers),
its value cannot be retrieved

o  center
return the centerpoint in pixels of the display;
caveat: might misbehave with multiple screens;
see centerOfMonitorHavingPointer

o  drawingResolution
return a point consisting of the actual drawing resolution
in pixel-per-inch horizontally and vertically.
On screen devices, this is the same as resolution; on postscript
devices, this is usually higher than the coordinate systems unit.
This method is provided for compatibility with postscript media,
to query the device if sub-pixel-coordinate drawing is possible.
(there are a few situations, in which resolution-independ drawing
leads to ugly looking output ... knowing about subPixel resolution
may help there.)

o  extent
return the extent of the display (in pixels)

Usage example(s):

     Display extent

o  extentOfResizeHandle
if the window system needs any area for a window resize handle (such as on MACOS-X),
this area's extent is returned here. It is assumed, that this handle is located at the lower-right
of the window.
0@0 is returned for systems which locate the resize handles outside the client area.
This may be used by the UI painter or programmatically to reserve some client area.
This method must be redefined for displays which need it (i.e. X11 on osx)

o  height
return the height of the display (in pixels)

Usage example(s):

Display height

o  heightInMillimeter
return the height in millimeter of the display

Usage example(s):

Display heightInMillimeter

o  heightInMillimeter: aNumber
set the height in millimeter of the display
- needed since some displays do not tell the truth or do not know it

o  horizontalPixelPerInch
return the number of horizontal pixels per inch of the display.
By default, this is computed from the width and widthInMM infos,
as returned by the system.
However, some systems report this wrong,
and also with mixed resolution monitors, we cannot depend on what
is returned (happens when an additional external monitor is
connected to a retina).
Thus, you can override the resolution via:
Display horizontalPixelPerMillimeter:pixels

Usage example(s):

     Display width
     Display height
     Display monitorBounds

     Display horizontalPixelPerInch
     Display verticalPixelPerInch
     Display widthInMillimeter:(Display width * 25.4) / 120
     Display heightInMillimeter:(Display height * 25.4) / 120

o  horizontalPixelPerMillimeter
return the number of horizontal pixels per millimeter of the display.
By default, this is computed from the width and widthInMM infos,
as returned by the system.
However, some systems report this wrong,
and also with mixed resolution monitors, we cannot depend on what
is returned (happens when an additional external monitor is
connected to a retina).
Thus, you can override the resolution via:
Display horizontalPixelPerMillimeter:pixels

Usage example(s):

     Display horizontalPixelPerMillimeter
     Display verticalPixelPerMillimeter
     Display width
     Display widthInMillimeter
     Display heightInMillimeter

o  horizontalPixelPerMillimeter: aNumber
set the number of horizontal pixels per millimeter of the display.
By default, this is computed from the width and widthInMM infos,
as returned by the system.
However, some systems report this wrong,
and also with mixed resolution monitors, we cannot depend on what
is returned (happens when an additional external monitor is
connected to a retina).
Thus, you can override the resolution via:
Display horizontalPixelPerMillimeter:pixels

o  monitorBounds
answer an Array with the bounds of all available monitors.
The first monitor in the Array is the primary monitor.
The allback here assumes a single monitor (see concrete subclasses)

Usage example(s):

        Screen current monitorBounds

o  monitorBoundsAt: aPoint
answer the bounds of the monitor which contains aPoint.

o  monitorBoundsAtPointer
answer the bounds of the monitor which contains the mouse pointer.

Usage example(s):

     Display monitorBoundsAtPointer  => (0@0) extent: (1280@778)

o  pixelPerInch
return the number of horizontal/vertical pixels per inch of the display as Point

Usage example(s):

Display pixelPerInch

o  pixelPerMillimeter
return the number of horizontal/vertical pixels per millimeter of the display as Point

Usage example(s):

Display pixelPerMillimeter

o  resolution
return a point consisting of pixel-per-inch horizontally and vertically.
This is an ST-80 compatibility method

o  setUsableHeight: h

o  setUsableWidth: w

o  smallestMonitorHeight
returns the usable height of the smallest monitor in a mult-monitor setup.
Subclasses supporting multi-monitors redefine this.

o  usableExtent
return the usable extent of the display (in pixels).
Normally, the same as extent, but may be smaller, in
case some menu space is taken up by the window manager (windows)

Usage example(s):

     Display extent
     Display usableExtent

o  usableHeight
returns the usable height of the display (in pixels)
Normally, the same as height, but may be smaller, in
case some menu space is taken up by the window manager (windows)

o  usableHeightAt: aPoint
returns the usable height of the display (in pixels) at a given point
Normally, the same as height, but may be smaller, in
case some menu space is taken up by the window manager (windows).
On multi-display systems with different sized screens, this should care for
which display is at the given x-position

o  usableWidth
returns the usable width of the display (in pixels)
Normally, the same as width, but may be smaller, in
case some menu space is taken up by the window manager (windows)

o  usableWidthAt: aPoint
returns the usable width of the display (in pixels) at a given point.
On multi-display systems with different sized screens, this should care for
which display is at the given x-position

o  verticalPixelPerInch
return the number of vertical pixels per inch of the display.
By default, this is computed from the height and heightInMM infos,
as returned by the system.
However, some systems report this wrong,
and also with mixed resolution monitors, we cannot depend on what
is returned (happens when an additional external monitor is
connected to a retina).
Thus, you can override the resolution via:
Display verticalPixelPerMillimeter:pixels

Usage example(s):

        Display verticalPixelPerInch

o  verticalPixelPerMillimeter
return the number of vertical pixels per millimeter of the display.
By default, this is computed from the height and heightInMM infos,
as returned by the system.
However, some systems report this wrong,
and also with mixed resolution monitors, we cannot depend on what
is returned (happens when an additional external monitor is
connected to a retina).
Thus, you can override the resolution via:
Display verticalPixelPerMillimeter:pixels

o  verticalPixelPerMillimeter: aNumber
set the number of vertical pixels per millimeter of the display.
By default, this is computed from the height and heightInMM infos,
as returned by the system.
However, some systems report this wrong,
and also with mixed resolution monitors, we cannot depend on what
is returned (happens when an additional external monitor is
connected to a retina).
Thus, you can override the resolution via:
Display verticalPixelPerMillimeter:pixels

o  virtualExtent
return the virtual extent of the display (in pixels).
On most systems, this is the same as the physical width;
except, if a window manager with a virtual desktop like olvwm
(simulating a bigger screen) is running.

o  virtualHeight
return the virtual height of the display (in pixels).
On most systems, this is the same as the physical height;
except, if a window manager with a virtual desktop like olvwm
(simulating a bigger screen) is running.

Usage example(s):

Display virtualHeight

o  virtualWidth
return the virtual width of the display (in pixels).
On most systems, this is the same as the physical width;
except, if a window manager with a virtual desktop like olvwm
(simulating a bigger screen) is running.

Usage example(s):

Display virtualWidth

o  width
return the width of the display (in pixels)

Usage example(s):

Display width

o  widthInMillimeter
return the width in millimeter of the display

Usage example(s):

Display widthInMillimeter

o  widthInMillimeter: aNumber
set the width in millimeter of the display
- needed since some displays do not tell the truth or do not know it

o  workableAreaBoundsAt: aPoint
return a rectangle representing the displays bounding box
of the workable area (without TaskBar etc.) of the monitor

accessing-keyboard mappings
o  buttonTranslation
return the buttonTranslation (for lefthanders)

o  buttonTranslation: anArray
set the buttonTranslation (for lefthanders)

Usage example(s):

     Screen current buttonTranslation
     Screen current buttonTranslation:#(1 2 1)

o  keyboardMap
return the keyboard map

Usage example(s):

     Screen current keyboardMap

o  keyboardMap: aMap
set the keyboard map

o  shortKeyPrefixSeparator
the saparator shown between the shortcut modified (CTRL, CMD etc.)
and the actual character. I.e. makes a Ctrl+A

o  shortKeyStringFor: symbolicOrRawKey
For given symbolic or raw key, return a user-friendly shortcut description string.
Examples:
#Find -> Ctrl+f (depending on your settings)
#CtrlX -> Ctrl+X

This method is used in menu panel (#shortcutKeyAsString) to display shortcuts in menus.

Usage example(s):

      Screen current shortKeyStringFor: #Find
      Screen current shortKeyStringFor: #Rename
      Screen current shortKeyStringFor: #CtrlX
      Screen current shortKeyStringFor: #UserInterrupt
      Screen current shortKeyStringFor: #Oacute
      Screen current shortKeyStringFor: #CursorLeft

accessing-misc
o  asPseudoDeviceWithoutXFTSupport
hack - see XWorkstation

o  defaultEventMask
return a mask to enable some events by default.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  displayName
return the display name - that is the name of the display connection
or nil, for default display. For example, in X, this returns a string
like 'hostname:0' for remote connections, and nil for a default local
connection.
- nothing known here, but maybe redefined in subclasses.

Usage example(s):

     Display displayName

o  glVersion
return a string describing the GL version.
Since the generic display does not support 3D GL graphics,
a dummy is returned here.

Usage example(s):

     Display glVersion

o  platformName
return a string describing the display system's platform.
Please use isX11Platform or isWindowsPlatform.

Usage example(s):

     Display platformName

o  protocolVersion
return the display systems protocol version number.
Returns a dummy here

Usage example(s):

     Display protocolVersion

o  serverVendor
return a string describing the display systems server vendor.
Returns a dummy here

Usage example(s):

     Display serverVendor

o  vendorRelease
return the display systems release number.
Returns a dummy here.

Usage example(s):

     Display vendorRelease

bitmap/window creation
o  convertedIcon: iconArg
make certain, that the image argument is compatible with myself;
this means converting it to a format (typically: monochrome) which I support.
Return a compatible version of the icon.

o  convertedIconMask: aMask
return a version of the argument which can be used as an iconMask on myself.
Typically, this means conversion to a monochrome mask -
future versions may add alpha channel masks, if I support them ...

o  createBitmapFromArray: anArray width: w height: h
create a monochrome, depth1 bitmap from a given (byte-)array.
The rows are aligned to a multiple of 8

** This method must be redefined in concrete classes (subclassResponsibility) **

o  createBitmapFromFile: aString for: aForm

o  createBitmapWidth: w height: h
allocate a bitmap on the Xserver, the contents is undefined
(i.e. random). Return a bitmap id or nil

** This method must be redefined in concrete classes (subclassResponsibility) **

o  createPixmapWidth: w height: h depth: d
allocate a pixmap on the Xserver, the contents is undefined
(i.e. random). Return a bitmap id or nil

** This method must be redefined in concrete classes (subclassResponsibility) **

o  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
must be implemented by a concrete class

** This method must be redefined in concrete classes (subclassResponsibility) **

o  destroyGC: aGCId
destroy a GC

** This method must be redefined in concrete classes (subclassResponsibility) **

o  destroyPixmap: aDrawableId

** This method must be redefined in concrete classes (subclassResponsibility) **

o  destroyView: aView withId: aWindowId

** This method must be redefined in concrete classes (subclassResponsibility) **

o  gcFor: aDrawableId
create a GC for drawing into aDrawable

** This method must be redefined in concrete classes (subclassResponsibility) **

o  gcForBitmap: aDrawableId
create a GC for drawing into a bitmap drawable

** This method must be redefined in concrete classes (subclassResponsibility) **

o  realRootWindowFor: aView
the name of this method is historic;
- it will vanish

o  realRootWindowId
return the id of the real root window.
This may or may not be the view you see as background,
since some window managers install a virtual root window on top
of the real one. In this case, this method returns the id of the
covered real-root
(in contrast, rootWindowId returns the id of the visible one).
With most window systems, the realRoot is the same as the root window.
The real root is only seldom of any interest.

o  rootWindowFor: aView

o  rootWindowId
return the id of the root window.
This is the window you see as background,
however, it may or may not be the real physical root window,
since some window managers install a virtual root window on top
of the real one. If this is the case, that views id is returned here.

** This method must be redefined in concrete classes (subclassResponsibility) **

clipboard
o  clipboardEncoding
return the assumed default clibBoards encoding
if a raw string (i.e. without encoding information) is pasted.
Useful on X11, if a sjis or euc string is pasted from a netscape
or other program.

o  clipboardEncoding: aSymbol
set the assumed default clipBoard's encoding
if a raw string (i.e. without encoding information) is pasted.
Useful on X11, if a sjis or euc string is pasted from a netscape
or other program.

o  copyBufferAsString
return my current selection as a string

o  getClipboardObjectFor: drawableId
Retrieve the common per-display selection object.
For clipBoard mechanisms to work (into ST/X),
this must be redefined in a concrete subclass

o  getClipboardText: selectionBufferSymbol for: drawableId
Retrieve the common per-display selection text.
For clipBoard mechanisms to work (into ST/X),
this must be redefined in a concrete subclass

o  getCopyBuffer
return the copyBuffers contents.
This is an ST/X internal buffer (i.e. its not visible to alien views).

o  getCopyBufferHistory
return the copyBufferHistory.
This is an ST/X internal buffer (i.e. its not visible to alien views).

o  rememberCopyBuffer
remember the current copyBuffer value in the copyBuffer-history (for paste previous);
but only do so, if it is a string

o  rememberInCopyBufferHistory: aString
add aString to the copyBuffer LRU-cache.
Allows for the last 20 (or so) copy/cut strings to be recovered
(via Shift-Paste)

o  setClipboardObject: anObject owner: aWindowId
set the common per-display object selection.
This can be used by other Smalltalk(X) applications only.
For clipBoard mechanisms to work (out of ST/X),
this must be redefined in a concrete subclass to copy
anObject to the devices clipBoard.

o  setClipboardObject: anObject ownerView: aView
set the object selection - both the local one, and tell the display
that we have changed it (i.e. place it into the clipBoard).

o  setClipboardText: aString owner: aView
Set the common per-display selection text.
For clipBoard mechanisms to work (out of ST/X),
this must be redefined in a concrete subclass to copy
aString to the devices clipBoard.

o  setClipboardText: aStringOrStringCollection ownerView: aView
set the clipboard's text - both the local one, and tell the display
that we have changed it (i.e. place it into the display's clipBoard).

o  setCopyBuffer: anObject
set the copyBuffers contents.
This is an ST/X internal buffer (i.e. its not visible to alien views).

o  setPrimaryText: text ownerView: view
Overridden in XWorkstation to support X's PRIMARY selection, intentionally void here

o  setSelection: anObject owner: aWindowId

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  setSelection: anObject ownerView: aView
Modified (format): / 20-04-2023 / 13:04:57 / Stefan_Vogel

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  setTextSelection: aString owner: aWindowId

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  setTextSelection: aString ownerView: aView

** This is an obsolete interface - do not use it (it may vanish in future versions) **

color stuff
o  availableDitherColors
return the table of preallocated emergency ditherColors
plus possibly available fixColors.

o  blueComponentOfColor: colorId
get blue component (0..100) of color in map at:index

o  colorCell
allocate a color - return index or nil, if no color cell
can be allocated (out of colors or trueColor device)

o  colorMap
return my displays colormap, or nil, if the display is not colorMap based
(i.e. not PseudoColor)

Usage example(s):

	 those have no colorMap - we're done

Usage example(s):

     Display colorMap

o  colorNamed: aString
allocate a color with color name - return the color index (i.e. colorID).
Only a subset of the colorNames are available on all displays;
therefore, don't use this method; at least only for the common names such as red, green, blue etc.

Usage example(s):

     Screen current colorNamed:'red'

o  colorRed: redVal green: greenVal blue: blueVal
marked as obsolete by Stefan Vogel at 8-Sep-2023

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  colorScaledRed: red scaledGreen: green scaledBlue: blue
return an id for a color.
On trueColor displays, nothing is actually allocated,
and the returned colorID is formed by simply packing the RGB values.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  deviceColorValueToPercent: deviceColorValue

** This method must be redefined in concrete classes (subclassResponsibility) **

o  ditherColors
return the table of preallocated emergency ditherColors

o  fixColors
return the table of preallocated fix colors (a colorCube),
or nil if no fix colors were preallocated.

o  fixGrayColors
return the table of preallocated fix grayScale colors,
or nil if no fix gray colors were preallocated.

o  freeColor: colorIndex
free a color on the display, when its no longer needed

** This method must be redefined in concrete classes (subclassResponsibility) **

o  getRGBFrom: index
get rgb components (0..100) of color in map at:index,
and evaluate the 3-arg block, aBlock with them

o  getRGBFrom: index into: aBlock
get rgb components (0..100) of color in map at:index,
and evaluate the 3-arg block, aBlock with them

o  getRGBFromName: colorNameArg
get rgb components (0..100) of color named colorName,
and return a 3-element array, containing them.
The method here only handles some often used colors;
getRGBFromName should not be used, since colorNames other
than those below are X specific.

o  getRGBFromName: colorName into: aBlock
get rgb components (0..100) of color named colorName,
and evaluate the 3-arg block, aBlock with them

Usage example(s):

     Display getRGBFromName:'red' into:[:r :g :b | r printCR. g printCR. b printCR.]

o  getScaledRGBFrom: index
get rgb components (0..devicesMaxColorVal) of color in map at:index,
and return a 3-element array containing them

** This method must be redefined in concrete classes (subclassResponsibility) **

o  getScaledRGBFrom: index into: aBlock
get rgb components (0..devicesMaxColorVal) of color in map at:index,
and evaluate the 3-arg block, aBlock with them

o  getScaledRGBFromName: colorName
get rgb components (0..devicesMaxColorVal) of color named colorName,
and return a 3-element array containing them

o  getScaledRGBFromName: colorName into: aBlock
get rgb components (0..devicesMaxColorVal) of color named colorName,
and evaluate the 3-arg block, aBlock with them.
Return nil for unknown color names.

o  greenComponentOfColor: colorId
get green component (0..100) of color in map at:index

o  listOfAvailableColors
return a list of all available colornames;
This method should not be used, since colornames are
very X specific. However, the names defined here are pretty common

o  numFixBlue
return the number of blue shades in the
preallocated fix color cube (or 0 if there is none)

o  numFixGreen
return the number of green shades in the
preallocated fix color cube (or 0 if there is none)

o  numFixRed
return the number of red shades in the
preallocated fix color cube (or 0 if there is none)

o  percentToDeviceColorValue: percent

** This method must be redefined in concrete classes (subclassResponsibility) **

o  redComponentOfColor: colorId
get red component (0..100) of color in map at:index

Usage example(s):

     Display redComponentOfColor:1

o  releaseFixColors
release the fix colorMap

Usage example(s):

     Display releaseFixColors

o  releaseFixGrayColors
release the fix colorMap

Usage example(s):

     Display releaseFixGrayColors

o  setColor: index red: redVal green: greenVal blue: blueVal
change color in map at:index to rgb (0..100).
This is a no-op on TrueColor systems.

o  setDitherColors: colors
set the table of preallocated emergency dither fix colors
These preallocated colors
(white, black, red, green, blue and a few grayScales) prevent
running out of colors later, when images have to be dithered or
pen colors must be approximated.
((Although, with such a small number of colors, the result will
definitely look poor))

o  setFixColors: colors numRed: nR numGreen: nG numBlue: nB
set the table of preallocated fix colors (a colorCube),
and the number of r/g/b entries in each dimension.

o  setFixGrayColors: colors
set the table of preallocated fix gray colors

converting
o  convertVirtualResolutionPointToCurrentResolutionPoint: aPoint
this is required when you want to access the root display coordinates correctly,
because may the os did scale the application (when the app is not high DPI aware),
and if the os do scale the application, the application gets a virtual display
with a diffrent resolution

o  convertVirtualResolutionRectangleToCurrentResolutionRectangle: aRectangle
this is required when you want to access the root display coordinates correctly,
because may windows did scale the application (when the app is not high DPI aware),
and if windows did scale the application, the application gets a virtual display
with a diffrent resolution

copying
o  deepCopyUsing: aDictionary postCopySelector: postCopySelector

cursor stuff
o  builtInCursorShapes
return a collection of standard cursor names.
Hre none is assumed - so all cursors are created as user cursors
(see Cursor>>initializeNewCursors)

o  colorCursor: aCursorId foreground: fgColor background: bgColor
change a cursors colors.
Ignored on systems which do not support colored cursors.

o  createCursorShape: aShapeSymbol
create a cursor given a shape-symbol; return a cursorID or nil.
This only works for a few standard cursors, and returns nil
if no such cursor exists.
Always care for a fallBack, in case of a nil return.

o  createCursorSourceForm: sourceForm maskForm: maskForm hotX: hx hotY: hy width: w height: h
create a cursor given 2 bitmaps (source, mask) and a hotspot.
Returns nil, if no cursor can be created (for any reason)

** This method must be redefined in concrete classes (subclassResponsibility) **

o  destroyCursor: aCursorId
free a cursor

** This method must be redefined in concrete classes (subclassResponsibility) **

o  needDeviceFormsForCursor
return true, if this device requires device-forms as opposed
to a simple bitmap-byteArray for creation.
Redefined in X- and Win- Workstation classes.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  shapeNumberFromSymbol: shape
given a shape-symbol, return the corresponding cursor-number,
or nil if no such standard cursor exists.

drag & drop
o  dragFinish: dropHandle

o  drop: aCollectionOfDropObjects inWindowID: destinationId position: destinationPoint rootPosition: rootPoint
device specific drop here.
Answer true, if the drop was successfull, false otherwise.

drawing
o  copyFromId: sourceId x: srcX y: srcY gc: srcGCId to: destId x: dstX y: dstY gc: dstGCId width: w height: h
do a bit-blt

** This method must be redefined in concrete classes (subclassResponsibility) **

o  copyFromPixmapId: sourceId x: srcX y: srcY gc: srcGCId to: destId x: dstX y: dstY gc: dstGCId width: w height: h
do a bit-blt from a pix- or bitmap.
Here, fall back into copyFromId:, which should also work.
Subclasses may redefine this for more performance or if required

o  copyPlaneFromId: sourceId x: srcX y: srcY gc: srcGCId to: destId x: dstX y: dstY gc: dstGCId width: w height: h
do a bit-blt, using the low-bit plane of the source only

** This method must be redefined in concrete classes (subclassResponsibility) **

o  copyPlaneFromPixmapId: sourceId x: srcX y: srcY gc: srcGCId to: destId x: dstX y: dstY gc: dstGCId width: w height: h
do a bit-blt from a pix- or bitmap, using the low-bit plane of the source only.
Here, fall back into copyPlaneFromId:, which should also work.
Subclasses may redefine this for more performance or if required

o  displayArcX: x y: y width: width height: height from: startAngle angle: angle in: aDrawableId with: aGCId
draw an arc

** This method must be redefined in concrete classes (subclassResponsibility) **

o  displayLineFromX: x0 y: y0 toX: x1 y: y1 in: aDrawableId with: aGCId
draw a line

** This method must be redefined in concrete classes (subclassResponsibility) **

o  displayLinesFromX: xStart step: xStep yValues: ydata scaleY: yScale transY: yTrans in: drawableId with: gcId
draw a polygon starting at x; the y values derives from the collection yValues.
The associated x is a multiple of step. Each y value will be scaled and translated.
The implementation here is a fallback, using the line-draw primitive;
devices which support fast drawing of a polygon may redefine this for more performance.

o  displayOpaqueString: aString from: index1 to: index2 x: x y: y in: aDrawableId with: aGCId
draw a sub-string - draw foreground on background.
If the coordinates are not integers, retry with rounded.

o  displayOpaqueString: aString x: x y: y in: aDrawableId with: aGCId
draw a string - draw foreground on background.
If the coordinates are not integers, retry with rounded.

o  displayPointX: x y: y in: aDrawableId with: aGCId
draw a point

** This method must be redefined in concrete classes (subclassResponsibility) **

o  displayPointsX: xColl y: yColl in: aDrawableId with: aGCId
draw a collection of points. Each element of xColl/yCollmust be integer,
otherwise, an error is triggered.
Slow fallback here for protocol completeness

o  displayPolygon: aPolygon in: aDrawableId with: aGCId
draw a polygon

** This method must be redefined in concrete classes (subclassResponsibility) **

o  displayPolylines: arrayOfPoints in: aDrawableId with: aGCId
draw a bunch of lines

o  displayRectangleX: x y: y width: width height: height in: aDrawableId with: aGCId
draw a rectangle

** This method must be redefined in concrete classes (subclassResponsibility) **

o  displayString: aString from: index1 to: index2 x: x y: y in: aDrawableId with: aGCId
draw a sub-string - draw foreground only.
If the coordinates are not integers, retry with rounded.

o  displayString: aString from: i1 to: i2 x: x y: y in: aDrawableId with: aGCId opaque: opaque
draw part of a string

** This method must be redefined in concrete classes (subclassResponsibility) **

o  displayString: aString x: x y: y in: aDrawableId with: aGCId
draw a string - draw foreground only.
If the coordinates are not integers, retry with rounded.

o  displayString: aString x: x y: y in: aDrawableId with: aGCId opaque: opaque
draw a string

o  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
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
depth; also it is assumed, that the colormap is setup correctly.
The actual bits per pixel may be different from the depth (for example,
on a depth-15 device, 16 bits/pixel may be used; also, many depth-24
systems actually use 32 bits/pixel)

** This method must be redefined in concrete classes (subclassResponsibility) **

o  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
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
depth; also it is assumed, that the colormap is setup correctly.
The actual bits per pixel may be different from the depth (for example,
on a depth-15 device, 16 bits/pixel may be used; also, many depth-24
systems actually use 32 bits/pixel).
This assumes a padding of 8-bits (i.e. byte-boundary),
which is the natural padding within ST/X.

o  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
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
depth; also it is assumed, that the colormap is setup correctly

o  drawBits: imageBits depth: imageDepth 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
depth; also it is assumed, that the colormap is setup correctly.
This assumes a padding of 8-bits (i.e. byte-boundary),
which is the natural padding within ST/X.

o  fillArcX: x y: y width: width height: height from: startAngle angle: angle in: aDrawableId with: aGCId
fill an arc.
The angles may be floats or integer - they are given in degrees.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  fillPolygon: aPolygon in: aDrawableId with: aGCId
fill a polygon

** This method must be redefined in concrete classes (subclassResponsibility) **

o  fillRectangleX: x y: y width: width height: height in: aDrawableId with: aGCId
fill a rectangle

** This method must be redefined in concrete classes (subclassResponsibility) **

enumerating
o  allTopViews
return a collection of all my known top views

o  allTopViewsAndLabelsSortedFilteringWindowGroups: windowGroupFilterOrNil
helper to return all windows on THIS screen sorted by a label to suite

Usage example(s):

     Display allTopViewsAndLabelsSortedFilteringWindowGroups:nil

o  allTopViewsFilteringWindowGroups: windowGroupFilterOrNil withLabelsDo: aBlock
helper enumerating all windows on THIS device with a label to suite

o  allViewsDo: aBlock
evaluate the argument, aBlock for all of my known views.
Warning: do not use this to remove a view
(never remove elements from an enumerated collection)

Usage example(s):

     View defaultStyle:#iris.
     Display allViewsDo:[:v | v initStyle. v redraw]

Usage example(s):

     View defaultStyle:#next.
     Display allViewsDo:[:v | v initStyle. v redraw]

Usage example(s):

     View defaultStyle:#normal.
     Display allViewsDo:[:v | v initStyle. v redraw]

error handling
o  primitiveFailedOrClosedConnection
sent by all primitives here, when something is wrong.
Check what was wrong and raise a corresponding error here.

o  resourceOfId: id
search through all device stuff for a resource.
Needed for error handling.

Since id may be an ExternalAddress, do not compare with ==

event forwarding
o  buttonMotion: buttonAndModifierState x: x y: y view: aView
forward a button-motion for some view

o  buttonMultiPress: button x: x y: y view: aView
forward a button-multi-press event for some view

o  buttonPress: buttonArg x: x y: y view: aView
forward a button-press event for some view

o  buttonRelease: button x: x y: y view: aView
forward a button-release event for some view

o  configureX: x y: y width: w height: h view: aView
forward a configure (i.e. size or position change) event for some view

o  coveredBy: otherView view: aView
forward a covered for some view
(aView has been covered by otherView)

o  destroyedView: aView
forward a destroyed event for some view

o  exposeX: x y: y width: w height: h view: aView
forward an expose for some view

o  focusInView: aView
forward a focusIn event for some view

o  focusOutView: aView
forward a focusOut event for some view

o  graphicsExposeX: x y: y width: w height: h final: final view: aView
forward a graphic expose for some view

o  hotkeyWithId: aHotkeyId key: aKey view: aView
forward a hotkey press for a view

o  keyPress: untranslatedKeyArg code: keyCode x: x y: y view: aView
forward a key-press event for some view

o  keyPress: untranslatedKeyArg x: x y: y view: aView
forward a key-press event for some view

Usage example(s):

Logger info:'Display keyPress: %1 (%2@%3)' with:untranslatedKey with:x with:y.

o  keyRelease: untranslatedKeyArg code: keyCode x: x y: y view: aView
forward a key-press event for some view

o  keyRelease: untranslatedKeyArg x: x y: y view: aView
forward a key-release event for some view

Usage example(s):

Logger info:'Display keyRelease: %1 (%2@%3)' with:untranslatedKey with:x with:y.

o  mappedView: aView
forward a mapped event for some view

o  mouseWheelMotion: buttonState x: x y: y amount: amountArg deltaTime: dTime view: aView
the mousewheel was moved by some amount (signed).
This event is sent to the current pointer view (like keyPress/release).

o  noExposeView: aView
forward a noExpose event for some view

o  pointerEnter: buttonState x: x y: y view: aView
forward a pointer enter for some view

o  pointerLeave: buttonState view: aView
forward a pointer leave for some view

o  saveAndTerminateView: aView
forward a saveAndTerminate event for some view

o  terminateView: aView
forward a terminate event for some view

Usage example(s):

Logger debug:'terminateView:%1 to sensor %2' with:aView with:sensor.

o  unmappedView: aView
forward an unmapped event for some view

event handling
o  addToKnownScreens

o  checkForEndOfDispatch
if there are no longer any views of interest - stop dispatch.
This ends the dispatcher process when the last view is closed on that device.
We only do this for displays other that the default Display.

o  cleanupAfterDispatch
make sure, no one is waiting

o  dispatchEvent
get and process the next pending event - for any view

o  dispatchEventFor: aViewIdOrNil withMask: eventMask
central event handling method:
get next event and send an appropriate message to the view's sensor,
or to the view directly (if the view has none).
If the argument aViewIdOrNil is nil, events for any view are processed,
otherwise only events for the view with given id are processed
(in this case, nothing is done if no events are pending);
if the argument aMask is nonNil, only events for this eventMask are
handled. The mask is a device dependent event mask.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  dispatchLoop
the actual event dispatching loop.

o  dispatchModalWhile: aBlock
get and process next event for any view as long as the
argument-block evaluates to true.
This is a modal loop, not switching to other processes,
effectively polling the device in a (nice) busy loop.
This should only be (and is only) used for emergency cases.
(such as a graphical debugger, debugging the event-dispatcher itself)

o  dispatchPendingEvents
go dispatch events as long as there is one.

o  dispatchProcessPriority

o  disposeButtonEventsFor: aViewIdOrNil
dispose (i.e. forget) all pending button events on this display

o  disposeEvents
dispose (i.e. forget) all events pending on this display

o  disposeEventsWithMask: aMask for: aWindowId
dispose (throw away) specific events

** This method must be redefined in concrete classes (subclassResponsibility) **

o  eventMaskFor: anEventSymbol

** This method must be redefined in concrete classes (subclassResponsibility) **

o  eventPending
return true, if any event is pending

** This method must be redefined in concrete classes (subclassResponsibility) **

o  eventPending: anEventSymbol for: aWindowId
return true, if a specific event is pending for a specific window.
This expects device independent event symbols (such as #buttonPress,
#buttonRelease etc.) as first argument.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  eventPending: anEventMask for: aWindowId withSync: doSync
return true, if any of the masked events is pending
for a specific window.
This expects a device dependent event mask as first argument.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  eventPendingWithSync: doSync
return true, if any event is pending

** This method must be redefined in concrete classes (subclassResponsibility) **

o  eventQueued
return true, if any event is pending in some internal queue.
The fallBack here returns true if events are pending on the display connection;
only devices which use internal queues (i.e. Xlib) need to redefine this.

o  eventQueuedAlready
return true, if any event is pending in some internal queue.
The fallBack here returns true if events are pending on the display connection;
only devices which use internal queues (i.e. Xlib) need to redefine this.

o  eventsPending: anEventMask for: aWindowId withSync: doSync
obsolete - will vanish.

o  getEventFor: aViewIdOrNil withMask: eventMask into: anEventArray
read next event if there is one and put event's data into anEventArray.
If aViewIdOrNil is nil, events for any view are fetched;
otherwise only events for that specific view will be fetched.
Returns true, if there was an event, false otherwise.
This method may block - so you better check for pending events
before calling for it.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  registerHotKeyForWindow: aDrawableId withId: anId modifiers: aModifier virtualKeyCode: aVirtualKeyCode
Defines a system-wide hotkey.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setEventMask: aMask in: aWindowId
arrange that only events from aMask are reported to a view.
Highly device specific, to be defined in concrete subclasses

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setupDispatchLoop
create & start the display event dispatch process.

o  startDispatch
create & start the display event dispatch process.

o  stopDispatch
stop the dispatch process

o  unregisterHotKeyForWindow: aDrawableId withId: anId
Release a system-wide hotkey.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  viewIsRelevantInCheckForEndOfDispatch: aView
return true, if the argument is not to be treated as a user view.
These, if any of them is still present, will prevent the endOfDispatch if the
exitOnLastClose flag is set.

event sending
o  sendKeyOrButtonEvent: typeSymbol x: xPos y: yPos keyOrButton: keySymCodeOrButtonNr state: stateMask toViewId: targetId
send a keyPress/Release or buttonPress/Release event to some (possibly alien) view.
TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
for key events, it can be either a symbol (as listen in X's keySyms)
or a numeric keysym code. If state is nil, the modifier bits (shift & control)
are computed from the keyboardMap - if non-nil, these are passed as modifierbits.
The non-nil case is the lowlevel entry, where state must include any shift/ctrl information
(not very user friendly)

** This method must be redefined in concrete classes (subclassResponsibility) **

o  simulateKeyboardInput: aCharacterOrString inViewId: viewId
send input to some other view, by simulating keyPress/keyRelease
events.
Only a few control characters are supported.
Notice: not all alien views allow this kind of synthetic input;
some simply ignore it.

font helpers
o  ascentOf: aFontId
return the number of pixels above the base line of a font

** This method must be redefined in concrete classes (subclassResponsibility) **

o  descentOf: aFontId
return the number of pixels below the base line of a font

** This method must be redefined in concrete classes (subclassResponsibility) **

o  encodingOf: aFontId
return the characterEncoding of a font.
Here, we assume an iso8859-1 encoding

o  maxAscentOf: aFontId
return the number of pixels above the base line of the tallest character
in a font

** This method must be redefined in concrete classes (subclassResponsibility) **

o  maxDescentOf: aFontId
return the number of pixels below the base line of the tallest character
in a font

** This method must be redefined in concrete classes (subclassResponsibility) **

o  maxWidthOfFont: aFontId
return the width in pixels of the widest character a specific font

** This method must be redefined in concrete classes (subclassResponsibility) **

o  minWidthOfFont: aFontId
return the width in pixels of the smallest character a specific font

** This method must be redefined in concrete classes (subclassResponsibility) **

font stuff
o  facesInFamily: aFamilyName
return a set of all available font faces in aFamily on this display

Usage example(s):

     Display facesInFamily:'times'
     Display facesInFamily:'fixed'

o  facesInFamily: aFamilyName filtering: filterBlock
return a set of all available font faces in aFamily on this display.
But only those matching filterBlock (if nonNil).

Usage example(s):

     Display facesInFamily:'fixed' filtering:[:f |
        f encoding notNil and:[f encoding startsWith:'jis']]

o  flushListOfAvailableFonts
flush any cached font information - dummy here,
but should be implemented in subclasses, which keep
a list of available device fonts.
This should be flushed, to allow update whenever new fonts
are installed or the system-font-path changes.

o  fontFamilies
return a set of all available font families on this display

Usage example(s):

     Display fontFamilies

o  fontFamiliesFiltering: aFilterBlock
return a set of all available font families on this display,
but only those matching aFilterBlock (if nonNil).

Usage example(s):

     Display fontFamiliesFiltering:[:f |
        f encoding notNil and:[f encoding startsWith:'jis']]

o  fontMetricsOf: fontId
return a fonts metrics info object

o  fontResolutionOf: fontId
return the resolution (as dpiX @ dpiY) of the font - this is usually the displays resolution,
but due to errors in some XServer installations, some use 75dpi fonts on higher
resolution displays and vice/versa.

o  fontsFiltering: aFilterBlock
return a set of all available font on this display,
but only those matching aFilterBlock (if nonNil).

Usage example(s):

     Display fontsFiltering:[:f |
        f encoding notNil and:[f encoding startsWith:'jis']]

o  fontsInFamily: aFamilyName face: aFaceName filtering: filter
return a set of all available fonts in aFamily/aFace on this display.
But only those matching filter (if nonNil).

Usage example(s):

     Display fontsInFamily:'fixed' face:'medium' filtering:[:f |
	f encoding notNil and:[f encoding startsWith:'jis']]

o  fontsInFamily: aFamilyName face: aFaceName style: aStyleName filtering: filter
return a set of all available font in aFamily/aFace/aStyle
on this display.
But only those matching filter (if nonNIl).

Usage example(s):

     Display fontsInFamily:'fixed' face:'medium' style:'roman' filtering:[:f |
	f encoding notNil and:[f encoding startsWith:'jis']]

Usage example(s):

     Display fontsInFamily:'fixed' face:'*' style:'roman' filtering:[:f |
	f encoding notNil and:[f encoding startsWith:'jis']]

Usage example(s):

     Display fontsInFamily:'courier' face:'medium' style:'roman' filtering:nil
     Display fontsInFamily:'courier' face:'normal' style:'roman' filtering:nil
     Display fontsInFamily:'Courier' face:'normal' style:'roman' filtering:nil

o  fontsInFamily: aFamilyName filtering: filter
return a set of all available font in aFamily on this display.
But only those matching filterBlock (if nonNil).

Usage example(s):

     Display fontsInFamily:'fixed' filtering:[:f |
	f encoding notNil and:[f encoding startsWith:'jis']]

Usage example(s):

     Display fontsInFamily:'*' filtering:[:f |
	f encoding notNil and:[f encoding startsWith:'jis']]

o  fullFontNameOf: aFontId
return the full name of a font.
Here, we return nil, not knowing anything about fonts

o  getDefaultFontWithEncoding: encoding
return a default font id
- used when class Font cannot find anything usable.
Subclasses will redefine this.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  getFontWithFamily: familyString face: faceString style: styleString pixelSize: sizeArg encoding: encodingSym
try to get the specified font, return id.
If not available, try next smaller font.
If no font fits, return nil

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  getFontWithFamily: familyString face: faceString style: styleString size: sizeArg encoding: encodingSym
try to get the specified font, return id.
If not available, try next smaller font.
If no font fits, return nil

o  getFontWithFamily: familyString face: faceString style: styleString size: sizeArg sizeUnit: sizeUnit encoding: encodingSym
try to get the specified font, return id.
If not available, try next smaller font.
If no font fits, return nil

** This method must be redefined in concrete classes (subclassResponsibility) **

o  heightOf: aString from: index1 to: index2 inFont: aFontId
return the width in pixels of a substring in a specific font

** This method must be redefined in concrete classes (subclassResponsibility) **

o  heightOf: aString inFont: aFontId
return the width in pixels of a string in a specific font

o  listOfAvailableFonts
return a list containing all fonts on this display.
The returned list is an array of FontDescriptions.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  pixelSizesInFamily: aFamilyName face: aFaceName style: aStyleName filtering: filterBlock
return a set of all available pixel sizes in aFamily/aFace/aStyle on this display.
But only those matching filterBlock (if notNil).

Usage example(s):

     Display
        pixelSizesInFamily:'fixed' face:'medium' style:'roman'
        filtering:[:f |
            f encoding notNil and:[f encoding startsWith:'jis']
        ]

     Display
        pixelSizesInFamily:'arial' face:'medium' style:'roman'
        filtering:[:f |
            f encoding == #'ms-ansi'
        ]

o  releaseFont: aFontId
free a font

** This method must be redefined in concrete classes (subclassResponsibility) **

o  sizesInFamily: aFamilyName face: aFaceName style: aStyleName
return a set of all available font sizes in aFamily/aFace/aStyle
on this display

Usage example(s):

     Display sizesInFamily:'times' face:'medium' style:'italic'

o  sizesInFamily: aFamilyName face: aFaceName style: aStyleName filtering: filterBlock
return a set of all available font sizes in aFamily/aFace/aStyle
on this display.
But only those matching filterBlock (if notNil).

Usage example(s):

     Display sizesInFamily:'fixed' face:'medium' style:'roman' filtering:[:f |
        f encoding notNil and:[f encoding startsWith:'jis']]

o  stylesInFamily: aFamilyName face: aFaceName
return a set of all available font styles in aFamily/aFace on this display

Usage example(s):

     Display stylesInFamily:'times' face:'medium'
     Display stylesInFamily:'times' face:'bold'

o  stylesInFamily: aFamilyName face: aFaceName filtering: filterBlock
return a set of all available font styles in aFamily/aFace on this display.
But only those matching filterBlock (if notNil).

Usage example(s):

     Display stylesInFamily:'fixed' face:'medium' filtering:[:f |
        f encoding notNil and:[f encoding startsWith:'jis']]

o  widthOf: aString from: index1 to: index2 inFont: aFontId
return the width in pixels of a substring in a specific font

** This method must be redefined in concrete classes (subclassResponsibility) **

o  widthOf: aString inFont: aFontId
return the width in pixels of a string in a specific font

grabbing
o  activeKeyboardGrab
return the view, which currently has the keyboard grabbed,
or nil, if there is none

o  activePointerGrab
return the view, which currently has the pointer grabbed,
or nil, if there is none

o  grabKeyboardIn: aWindowId
grab the keyboard - all keyboard input will be sent to the view
with id aWindowId

** This method must be redefined in concrete classes (subclassResponsibility) **

o  grabKeyboardInView: aView
grab the keyboard - all keyboard input will be sent to aView.
Return true if ok, false if it failed for some reason.

o  grabPointerIn: aWindowId
grap the pointer; all pointer events will be reported to the view
with id aWindowId. Return true if ok, false if it failed for some reason.

o  grabPointerIn: aWindowId withCursor: cursorId pointerMode: pMode keyboardMode: kMode confineTo: confineId
grap the pointer - all pointer events will be reported to aWindowId. The cursor will be set to cursorId
for the duration of the grab. For pMode/kMode, see X documentation. The pointer is restricted to
confineId - if non-nil.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  grabPointerIn: aWindowId withCursorId: aCursorIdOrNil
grap the pointer; all pointer events will be reported to the view
with id aWindowId. Return true if ok, false if it failed for some reason.

o  grabPointerInView: aView
grap the pointer; all pointer events will be reported to
aView. Return true if ok, false if it failed for some reason.

o  grabPointerInView: aView withCursor: aCursorOrNil
grap the pointer; all pointer events will be reported to
aView. Return true if ok, false if it failed for some reason.

o  setActivePointerGrab: aView
DO NOT USE. private kludge - will vanish

o  ungrabKeyboard
release the keyboard

** This method must be redefined in concrete classes (subclassResponsibility) **

o  ungrabPointer
release the pointer

** This method must be redefined in concrete classes (subclassResponsibility) **

graphic context stuff
o  noClipIn: aDrawableId gc: aGCId
disable clipping rectangle

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setBackground: bgColorIndex in: aGCId
set background color-index to be drawn with

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setBackgroundColor: color in: aGCId
set background color to be drawn with

o  setBitmapMask: aBitmapId in: aGCId
set or clear the drawing mask - a bitmap mask using current fg/bg

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setClipByChildren: aBool in: aDrawableID gc: aGCId
enable/disable drawing into child views

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setClipX: clipX y: clipY width: clipWidth height: clipHeight in: drawableId gc: aGCId
clip to a rectangle

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setDashes: dashList dashOffset: offset in: aGCId
set dash attributes.
Ignored here - it may be left unimplemented by some devices.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setFont: aFontId in: aGCId
set font to be drawn in

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setForeground: fgColorIndex background: bgColorIndex function: blitOpSymbol in: aGCId
set foreground and background color-indices and blit-function to be drawn with

o  setForeground: fgColorIndex background: bgColorIndex in: aGCId
set foreground and background color-indices to be drawn with

o  setForeground: fgColorIndex in: aGCId
set the foreground color-index to be drawn with

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setForegroundColor: fgColor backgroundColor: bgColor in: aGCId
set foreground and background colors to be drawn with

o  setForegroundColor: color in: aGCId
set the foreground color to be drawn with

o  setFunction: aFunctionSymbol in: aGCId
set alu function to be drawn with.
functionSymbol is one of:
#copy,#copyInverted,#xor,#and,#andReverse
#andInverted,#or,#orReverse,#orInverted
#invert,#clear,#set,#noop,#equiv,#nand


** This method must be redefined in concrete classes (subclassResponsibility) **

o  setGraphicsExposures: aBoolean in: aGCId
set or clear the graphics exposures flag

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setLineWidth: aNumber style: lineStyle cap: capStyle join: joinStyle in: aGCId
set line attributes

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setMaskOriginX: orgX y: orgY in: aGCid
set the mask origin

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setPixmapMask: aPixmapId in: aGCId
set or clear the drawing mask - a pixmap mask providing full color

** This method must be redefined in concrete classes (subclassResponsibility) **

hooks
o  addModalWindowListener: aListener

o  addNonModalWindowListener: aListener

o  addSelectionHandler: someone
ignored here

o  modalWindowListenersDo: aBlock
aboutToOpenModalWindowHooks := nil

o  nonModalWindowListenersDo: aBlock

o  removeModalWindowListener: aListener

o  removeNonModalWindowListener: aListener

o  removeSelectionHandler: someone
ignored here

o  withoutExitingOnLastCloseDo: aBlock
evaluate a block, but do not exit when the last view is closed.
This is used when an operation is to be performed, which possibly
leads to a temporary no-more-windows-open situation.
Concrete: when reopening a launcher

initialization & release
o  brokenConnection
the connection to the display device was lost.

o  close
close down connection to Display - usually never done for the main screen

o  closeConnection
close down connection to Display - usually never done

** This method must be redefined in concrete classes (subclassResponsibility) **

o  emergencyCloseConnection
close down connection to the Display in case of emergency;
this is usually invoked after an error and should not try to flush
any outstanding graphics requests - usually never done

o  exitOnLastClose: aBoolean
set/clear the flag which controls if the
event dispatching should stop when the last view is closed.

o  initializeDefaultKeyboardMappingsIn: aKeyboardMap
this is called to pre-initialize a new keyboard map.
Usually, a real mapping comes from the keyboard.rc startup file,
but here, some mappings are defined in case the keyboard.rc file is
missing (i.e. for standalone programs which have not been deployed correctly)

o  initializeDefaultValues

o  initializeDeviceResources
initialize heavily used device resources - to avoid looking them up later

o  initializeDeviceSignals

o  initializeFor: aDisplayOrNilForAny
initialize the receiver for a connection to a display. If the
argument is non-nil, it should specify which workstation should be
connected to (in a device specific manner). For X displays, this is
to be the display-string i.e. hostname:displayNr.
If the argument is nil, connect to the default display.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  initializeKeyboardMap
keystrokes from the server are translated via the keyboard map.
Untranslated keystrokes arrive either as characters, or symbols
(which are the keySyms as symbol). The mapping table which is
setup here, is used in sendKeyPress:... later.
Here, an empty (no-translation) keyboard map is setup initially;
this is usually filled via the keyboard.rc startup file.

o  initializeModifierMappings
Display initializeModifierMappings

o  initializeScreenProperties
setup screen specific properties.

o  initializeViewStyle
late viewStyle init - if no viewStyle has been read yet.

o  invalidateConnection
clear my connection handle - sent after an imageRestart to
forget about our previous life

o  nativeWidgets: aBoolean
enable/disable native widgets on a display

o  reinitialize
historic leftover (old subclasses call super reinitialize)

o  reinitializeFor: aDisplayName
reinit after snapin

o  releaseDeviceResources
release any cached device resources.
This is invoked when closed or when the display connection is broken
(i.e. be prepared to not be able to release resources regularily)

interactive queries
o  colorFromUser
let user specify a point on the screen (by pressing the left button),
return the color of that pixel.

Usage example(s):

     Display colorFromUser

o  originFromUser: extent
let user specify a rectangle's origin on the screen, return the rectangle.
Start with initialRectangle.
Can be used for dragging operations.

Usage example(s):

     Display originFromUser:200@200

o  pointFromUser
let user specify a point on the screen (by pressing the left button).
The point is relative to/within the root window
(which makes trouble with OSX, where the top menu is not included in X's root window)

Usage example(s):

     Display pointFromUser

o  pointFromUserShowing: aCursor
let user specify a point on the screen (by pressing leftButton).
Show aCursor while waiting.
The point is relative to/within the root window
(which makes trouble with OSX, where the top menu is not included in X's root window)

Usage example(s):

     Display pointFromUserShowing:(Cursor stop)
     Display pointFromUserShowing:(Cursor crossHair)
     Display pointFromUserShowing:(Cursor origin)
     Display pointFromUser

o  pointFromUserShowing: aCursor positionFeedback: feedbackBlockOrNil
let user specify a point on the screen (by pressing leftButton).
Show aCursor while waiting. Pressing shift or ctrl cancels the operation,
and aborts.
The point is relative to/within the root window
(which makes trouble with OSX, where the top menu is not included in X's root window)

Usage example(s):

     Display pointFromUserShowing:(Cursor stop)
     Display pointFromUserShowing:(Cursor crossHair)
     Display pointFromUserShowing:(Cursor origin)
     Display pointFromUser

o  rectangleFromUser
let user specify a rectangle in the screen, return the rectangle.
If the user presses ESC, an AbortSignal is raised.
The rectangle is relative to/within the root window
(which makes trouble with OSX, where the top menu is not included in X's root window)

Usage example(s):

     Display rectangleFromUser

o  rectangleFromUser: initialRectangle
let user specify a rectangle on the screen, return the rectangle.
Start with initialRectangle.
The point is relative to/within the root window
(which makes trouble with OSX, where the top menu is not included in X's root window).
A helper for rectangleFromUser; can also be used for resizing operations.

Usage example(s):

     Display rectangleFromUser:(100@100 corner:300@300)

o  rectangleFromUser: initialRectangle keepExtent: keepExtent
let user specify a rectangle on the screen, return the rectangle.
Start with initialRectangle.
If keepExtent is true, only the origin is asked for.
A helper for rectangleFromUser;
can also be used for resizing operations.

Usage example(s):

     Display rectangleFromUser
     Display rectangleFromUser:(100@100 corner:300@300)
     Display rectangleFromUser:(100@100 corner:300@300) keepExtent:true

o  topviewFromUser
let user specify a view on the screen; if the selected view is
not an ST/X view, nil is returned.
Otherwise, the topview is returned.

Usage example(s):

     Display topviewFromUser

o  viewFromUser
let user specify a view on the screen; if the selected view is
not an ST/X view, nil is returned.
This returns the view being clicked in, which is not always a topView.
(send topView to the returned view or use topviewFromUser,
to get the topview)

Usage example(s):

     Display viewFromUser

Usage example(s):

     |v|
     v := Display viewFromUser.
     v notNil ifTrue:[v topView] ifFalse:[nil]

o  viewIdFromUser
let user specify a view on the screen, return its window id.
This works even for non smalltalk views.
This returns the id of the view being clicked in,
which is not always a topView.

Usage example(s):

     Display viewIdFromUser

keyboard mapping
o  altModifiers
Return the set of keys which are treated as Alt-keys.
This set is initialized at startup from what the server thinks
are alt-keys.

Usage example(s):

     Display altModifiers

o  altModifiers: arrayOfAltModifierKeys
Change the set of keys which are treated as Alt-keys.
This is useful for ST/X on OSX on XQuartz, where the window manager
uses the CMD keys, making it unavailable for ST/X.
Here, we map the left ALT key onto the command key
(see keyboard.rc). Lefthanders might want to use the right ALT key for that.

Usage example(s):

     Screen current cmdModifiers
     Screen current altModifiers:#(#'Meta_L' #'Meta_R' #'Hyper_R')

o  appleAltModifierMask
return the Xlib mask bit for the ALT modifier key on OS-X.
Nil returned for other displays

o  appleCmdModifierMask
return the Xlib mask bit for the CMD modifier key on OS-X.
Nil returned for other displays

o  metaModifiers
Return the set of keys which are treated as Meta-keys (i.e. Cmd-keys).
This set is initialized at startup from what the server thinks
are meta-keys.

Usage example(s):

     Display metaModifiers

o  metaModifiers: arrayOfMetaModifierKeys
Change the set of keys which are treated as Meta-keys (i.e. Cmd keys).
This is useful for ST/X on OSX on XQuartz, where the window manager
uses the CMD keys, making it unavailable for ST/X.
Here, we map the left ALT key onto the command key
(see keyboard.rc). Lefthanders might want to use the right ALT key for that.

o  modifierKeyProcessing: key down: pressedOrNil
internal, private method.
Called with every keyPress/keyRelease to update the xxxDown flags.

o  modifierKeyTopFor: key
reverse translation for a modifier key
(i.e. to get the keyTop from a modifier)

Usage example(s):

       Screen current modifierKeyTopFor:#Cmd
       Screen current modifierKeyTopFor:#Alt

o  modifierKeyTranslationFor: untranslatedKey
map possible modifiers to a smaller set of common symbols.
Especially, left/right keys are mapped to a common one.

o  modifierKeys
a list of possible modifiers

o  prependModifierToKey: untranslatedKey
prepend Shift, Ctrl, Alt and Cmd modifiers to a key;
The order is:
<Shift><Alt><Cmd><Ctrl><key>
i.e. if both Alt and Ctrl are pressed with x,
the result will be:
AltCtrlx
not
CtrlAltx
Shift is only prepended as modifier if <key> is symbolic (not a single character);
therefore, if all of Shift, Alt and Ctrl are pressed with x,
the result is:
AltCtrlX
not
ShiftAltCtrlx
However, for a symbolic key, like F1, we'll get:
ShiftAltCtrlF1

o  translateKey: untranslatedKey forView: aView
Return the key translated via the translation table.
Your application program should never depend on the values returned
by this method, but instead use symbolic keys (such as #FindNext).
Doing so allows easier reconfiguration by changing the translation map
in the 'smalltalk.rc' or 'display.rc' startup files.

First, the modifier is prepended, making character X into
AltX, CtrlX or CmdX (on many systems, no separate Cmd (or Meta)
key exists; on those we always get AltX if the metaModifiers are not set correctly).
If multiple modifiers are active, the symbol becomes the concatenation
as in AltCtrlq (for control-alt-q).
Shift will affect the last component IFF it is a single character,
thus the above with shift becomes: AltCtrlQ instead.
Some keyboards offer both Alt and Meta keys - on those, the first has a
prefix of Alt, the second has Cmd as prefix. Keyboards with only an Alt
key will will create prefix codes of Cmd for that.
For symbolic keys (i.e.Tab, BackSpace etc, shift is ignored).
Then the result is used as a key into the translation keyboardMap
to get the final return value.

keyboard queries
o  altDown
return true, if the alt-key is currently pressed.

o  altModifierMask
return the mask bit for the alt modifier key

** This method must be redefined in concrete classes (subclassResponsibility) **

o  ctrlDown
return true, if the control-key is currently pressed.
Here, we don't differentiate between left and right ctrl keys.

o  ctrlModifierMask
return the mask bit for the ctrl modifier key

** This method must be redefined in concrete classes (subclassResponsibility) **

o  leftCtrlDown
return true, if the left control-key is currently pressed.

o  leftShiftDown
return true, if the left shift-key is currently pressed.

Usage example(s):

     10 timesRepeat:[
        Transcript showCR:'l:%1 r:%2' with:Display leftShiftDown with:Display rightShiftDown.
        Delay waitForSeconds:1.
     ]

o  metaDown
return true, if the meta-key (alt-key on systems without meta)
is currently pressed.

o  metaModifierMask
return the mask bit for the meta modifier key

** This method must be redefined in concrete classes (subclassResponsibility) **

o  rightCtrlDown
return true, if the right control-key is currently pressed.

Usage example(s):

     10 timesRepeat:[
        Transcript showCR:'right: %1' with:(Display rightCtrlDown).
        Transcript showCR:'left: %1' with:(Display leftCtrlDown).
        Transcript showCR:'ctrl: %1' with:(Display ctrlDown).
        Delay waitForSeconds:1.
     ].

o  rightShiftDown
return true, if the right shift-key is currently pressed

o  shiftDown
return true, if the shift-key is currently pressed.
Here, we don't differentiate between left and right shift keys.

o  shiftModifierMask
return the mask bit for the shift modifier key

** This method must be redefined in concrete classes (subclassResponsibility) **

misc
o  beep
output an audible beep or bell

o  beepInEditor
output an audible beep or bell, if enabled.

Beep to wakeup the user after some error/not found condition in an editor.
Use this ONLY to beep in response to a bad user operation (not system failure beeps).
Can be disabled via the settings if too annoying

o  buffered
buffer drawing - do not send it immediately to the display.
This is the default; see comment in #unBuffered.

o  buttonLongPressedHandlerProcess

o  buttonLongPressedHandlerProcess: aProcess

o  buttonPressTimeForMenu

o  buttonPressTimeForMenu: seconds

o  compressMotionEvents: aBoolean
turn on/off motion event compression
- compressions makes always sense except in free-hand drawing of curves

o  focusView
the view, which has got the focus from the operating system

o  focusView: aViewOrNil
remember the view, which has got the focus from the operating system

o  focusWindowGroup
the last windowGroup, which has got the focus from the operating system

o  focusWindowGroup: aWindowGroupOrNil
remember the last windowGroup, which has got the focus from the operating system

o  redrawAllWindows
Display redrawAllWindows

o  repadBits: givenBits width: imageWidth height: imageHeight depth: imageDepth from: givenPadding to: wantedPadding
repadding support - required for some devices when drawing images

o  restoreWindows
restore the display.
Here, a view is popped over all of the screen temporarily

Usage example(s):

     Display restoreWindows
     Display redrawAllWindows

o  rightButtonIsLowerWindow: aBooleanOrNil
ignored here. Used with windows displays, to control the
bahavior of the right mouse button, when clicking into the
title area (to lower a view).
With a non-nil argument, the flag is set.
with a nil value, its current value is returned

o  ringBell
alias for beep; for ST-80 compatibility

o  setInputFocusTo: aWindowId

** This method must be redefined in concrete classes (subclassResponsibility) **

o  shiftedLeftButtonIsLowerWindow: aBooleanOrNil
ignored here. Used with windows displays, to control the
bahavior of the shifted right mouse button, when clicking into the
title area (to lower a view).
With a non-nil argument, the flag is set.
with a nil value, its current value is returned

o  sync
send all buffered drawing to the display and wait until its processed/drawn.
See also #flush, which does not wait.
ST-80 seems to only support flush.

o  synchronizeOutput
send all buffered drawing to the display.
OBSOLETE: please use #flush for ST-80 compatibility.

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  unBuffered
make all drawing be sent immediately to the display.
This may horribly slow down your drawings, but will result
in any errors to be delivered right after the bad operation
(in X only). Only useful for debugging.

multi monitor support
o  openViewWithBlock: openAction view: aView at: origin
HACK for multi monitor support.
sub views needs to be opened on the same monitor as their top view,
so that Windows create/place them into the same virtual resolution/display.
after the sub views are opened we can move them within the same virtual resolution/display.
to their actually origin

USED BY WINDOWS ONLY

native window stuff
o  changeButtonState: state in: drawableId

** This method must be redefined in concrete classes (subclassResponsibility) **

o  changeLabel: state in: drawableId

** This method must be redefined in concrete classes (subclassResponsibility) **

o  enableScrollBar: enableBoolean in: drawableId

** This method must be redefined in concrete classes (subclassResponsibility) **

pointer stuff
o  anyButtonMotionMask
return an integer for masking out any button from a motion
buttonStates value. This is very device specific and to
be redefined by concrete subclasses.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  anyButtonPressed
return true, if the any button is currently pressed.
You should not use it in 'normal' applications.
Instead, keep track of the buttons state in your view's or controller's
button-event methods.

o  anyButtonStateMask
return an integer for masking out any button from a
buttonStates value. This is very device specific and to
be redefined by concrete subclasses.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  button1MotionMask
return an integer for masking out the left button from a
motion buttonStates value. This is very device specific and to
be redefined by concrete subclasses.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  button2MotionMask
return an integer for masking out the middle button from a
motion buttonStates value. This is very device specific and to
be redefined by concrete subclasses.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  button3MotionMask
return an integer for masking out the right button from a
motion buttonStates value. This is very device specific and to
be redefined by concrete subclasses.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  buttonStates
return an integer representing the state of the pointer buttons;
a one-bit represents a pressed button. The bit positions are device specific
and to be returned by the *ButtonStateMask methods.
Must be redefined by concrete subclasses.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  leftButtonPressed
return true, if the left button is currently pressed

o  leftButtonStateMask
return an integer for masking out the left button from a
buttonStates value. This is very device specific and to
be redefined by concrete subclasses.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  middleButtonPressed
return true, if the middle button is currently pressed

o  middleButtonStateMask
return an integer for masking out the middle button from a
buttonStates value. This is very device specific and to
be redefined by concrete subclasses.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  pointerPosition
return the current pointer position in root-window coordinates.
Must be redefined by concrete subclasses.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  rightButtonPressed
return true, if the right button is currently pressed

o  rightButtonStateMask
return an integer for masking out the right button from a
buttonStates value. This is very device specific and to
be redefined by concrete subclasses.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  rootPositionOfLastEvent
return the position in root-window coordinates
of the last button, key or pointer event.
Must be redefined by concrete subclasses.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setPointerPosition: newPosition
change the pointer position in root-window coordinates.
Warning: moving the mouse pointer may lead to the mouse falling off the table
after a while. So it should be used very very seldom (if at all)

Usage example(s):

     Display setPointerPosition:10@30

o  setPointerPosition: newPosition in: aWindowID
change the pointer position relative to some views origin.
Must be redefined by concrete subclasses.
Warning: moving the mouse pointer may lead to the mouse falling off the table
after a while. So it should be used very very seldom (if at all)

** This method must be redefined in concrete classes (subclassResponsibility) **

printing & storing
o  printOn: aStream
for your convenience, add the name of the display connection
or 'default' to the printed representation.

queries
o  isWindowsPlatform

o  isX11Platform

o  screenImagePixelOffset

queries - monitor
o  isHighDpiAware
answers if this app is high dpi aware

o  monitorRealResolutionByMonitorDeviceName: anIgnoredMonitorDeviceName
this is the real resolution of the display,
without any effect of os scaling

for e.g.
real resolution -> 1080p
os scaling 150%
virtual resolution -> 720p

real resolution -> 1080p
os scaling 100%
virtual resolution -> 1080p

Usage example(s):

        Screen current monitorRealResolutionByMonitorDeviceName:nil.
        Screen current monitorRealResolutionByMonitorDeviceName:'ereswt'.
        Screen current monitorRealResolutionByMonitorDeviceName:'\\.\DISPLAY1'.
        Screen current monitorRealResolutionByMonitorDeviceName:'\\.\DISPLAY2'.

o  monitorRealResolutionByPoint: aPoint
this is the real resolution of the display,
without any effect of os scaling

for e.g.
real resolution -> 1080p
os scaling 150%
virtual resolution -> 720p

real resolution -> 1080p
os scaling 100%
virtual resolution -> 1080p

Usage example(s):

        Screen current monitorRealResolutionByPoint:nil.     
        Screen current monitorRealResolutionByPoint:0@0.     
        Screen current monitorRealResolutionByPoint:500@0.       
        Screen current monitorRealResolutionByPoint:2000@0. 

o  monitorScaleFactorForView: aView
this method always returns the os scale factor,
regardless if the app is high dpi aware or not.

this is the scale factor the user did enter in the os settings,
for e.g. the user can choose between 100, 125, 150 etc.
here we return 1, 1.25 1.5

Usage example(s):

        Screen current monitorScaleFactorForView:Transcript topView.       

retrieving pixels
o  getBitsFromId: aDrawableId x: srcx y: srcy width: w height: h into: imageBits
get bits from a view drawable into the imageBits. The storage for the bits
must be big enough for the data to fit. If ok, returns an array with some
info and the bits in imageBits. The info contains the depth, bitOrder and
number of bytes per scanline. The number of bytes per scanline is not known
in advance, since the X-server is free to return whatever it thinks is a good padding.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  getBitsFromPixmapId: aDrawableId x: srcx y: srcy width: w height: h into: imageBits
get bits from a drawable into the imageBits. The storage for the bits
must be big enough for the data to fit. If ok, returns an array with some
info and the bits in imageBits. The info contains the depth, bitOrder and
number of bytes per scanline. The number of bytes per scanline is not known
in advance, since the X-server is free to return whatever it thinks is a good padding.

o  getBitsFromViewId: aDrawableId x: srcx y: srcy width: w height: h into: imageBits
get bits from a drawable into the imageBits. The storage for the bits
must be big enough for the data to fit. If ok, returns an array with some
info and the bits in imageBits. The info contains the depth, bitOrder and
number of bytes per scanline. The number of bytes per scanline is not known
in advance, since the X-server is free to return whatever it thinks is a good padding.

o  getPixelX: x y: y from: aDrawableId with: gcId
return the pixel value at x/y

** This method must be redefined in concrete classes (subclassResponsibility) **

style defaults
o  defaultStyleValueFor: aKey
return a default style value, given a key.
These defaults are used if nothing is specified
in the style sheet
This allows for empty values in style sheets, and defaults
being provided by the display (which makes sense with Windows,
where the systemDefaults are used ...

tray access
o  addTrayIconFor: aView icon: wicon iconMask: wiconMask toolTipMessage: toolTipMessage
add an icon to the tray for aView (which will receive tray-events in the future.
intentionally ignored here - only supported by win32 (for now)

o  removeTrayIconFor: aView
remove the tray icon.
intentionally ignored here - only supported by win32 (for now)

o  setTrayIconFor: aView icon: wicon iconMask: wiconMaskArg
change the tray icon.
intentionally ignored here - only supported by win32 (for now)

o  setTrayIconsToolTipMessageFor: aView to: toolTipMessageArg
Change the toolTopText.
intentionally ignored here - only supported by win32 (for now)

view registration
o  addKnownView: aView withId: aWindowID
add the View aView with id:aWindowID to the list of known views/id's.
This map is needed later (on event arrival) to get the view from
the view's id (which is passed along with the devices event) quickly.

o  applyTopViewRealizeHooksFor: aView
callBack from a topView's realize method.
apply intercepting hooks...

o  initializeTopViewHookFor: aView
marked as obsolete by exept MBP at 05-07-2023

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  realizedTopViewHookFor: aView
marked as obsolete by exept MBP at 05-07-2023

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  removeKnownView: aView withId: aViewId
remove aView from the list of known views/id's.
One of aView of aViewId may be nil - the nil one is computed from the other variable.

o  viewFromId: aWindowID
given an Id, return the corresponding view.
Return nil for unknown windows
(can happen for external window, if a key grab is active)

o  viewIdKnown: aWindowID
return true, if I still consider a windowId as being valid

window stuff
o  activateWindow: aWindowId
make a window active.
Fall back to raiseWindow here

o  clearRectangleX: x y: y width: width height: height in: aWindowId
clear a rectangular area of a window to its view background

** This method must be redefined in concrete classes (subclassResponsibility) **

o  clearWindow: aWindowId
clear a windows to its view background

** This method must be redefined in concrete classes (subclassResponsibility) **

o  iconify: aView id: aWindowId
iconify a window.
Generic workaround for workstations not having a iconify method.

o  lowerWindow: aWindowId
lower a window

** This method must be redefined in concrete classes (subclassResponsibility) **

o  mapView: aView id: aWindowId iconified: aBoolean atX: xPos y: yPos width: w height: h
marked as obsolete by Stefan Vogel at 9-Jun-2022

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  mapView: aView id: aWindowId iconified: aBoolean atX: xPos y: yPos width: w height: h minExtent: minExt maxExtent: maxExt
make a window visible - either as icon or as a real view - needed for restart

** This method must be redefined in concrete classes (subclassResponsibility) **

o  mapWindow: aWindowId
map a window

** This method must be redefined in concrete classes (subclassResponsibility) **

o  mapWindow: aWindowId animation: animationSymbolorNil time: timeInMillisOrNil
unmap a window

o  moveResizeWindow: aWindowId x: x y: y width: w height: h
move & resize a window

o  moveWindow: aWindowId x: x y: y
move a window

** This method must be redefined in concrete classes (subclassResponsibility) **

o  raiseWindow: aWindowId
raise a window.
In some systems (aka MSWindows), this raises only above all other st/x views,
but not above other-application's views, which have a TOPMOST attribute.
Se raiseWindowToTop for this.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  raiseWindowToTop: aWindowId
raise a window above all others (even above non-st/x windows)

o  raiseWindowToTopMost: aWindowId
raise a window above all others (even above non-st/x windows)

o  reparentWindow: windowId to: newParentWindowId
change a windows parent (an optional interface).
Returns true if successful.

o  resizeWindow: aWindowId width: w height: h
resize a window

** This method must be redefined in concrete classes (subclassResponsibility) **

o  restoreCursors
restore the cursors of all views to their current cursor.
This undoes the effect of #setCursors:

Usage example(s):

     Display setCursors:(Cursor wait).
     Delay waitForSeconds:5.
     Display restoreCursors

o  setBackingStore: how in: aWindowId
turn on/off backing-store for a window.
A view with backingStore will redraw automatically
from the backing pixmap (without sending expose events).
An implementation may ignore this request.

o  setBitGravity: how in: aWindowId
set bit gravity for a window

o  setCursor: aCursorId in: aWindowId
set a window's cursor

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setCursors: aCursor
change the cursor of all views on the receiver device
to aCursorId, without affecting the view's idea of what
the cursor is (so that it can be restored from the view's
cursor instance variable later).
Use of this is not recommended - it's better to change
the cursor of a windowGroup alone.

Usage example(s):

     Display setCursors:(Cursor wait).
     Delay waitForSeconds:5.
     Display restoreCursors.

o  setForegroundWindow: aWindowId
make a window active.
Fall back to raiseWindow here

o  setIconName: aString in: aWindowId
set a windows icon name

o  setSaveUnder: yesOrNo in: aWindowId
turn on/off save-under for a window.
A view with saveUnder will save the pixels of the
area covered by itself and repair from those when
unmapped (therefore, no expose events are generated later).
It is especially useful for popUp menus.
An implementation may ignore this request.

o  setTransient: aWindowId for: aMainWindowId
set aWindowId to be a transient of aMainWindow.
This informs the windowManager that those are to
be handled as a group w.r.t. iconification and deiconification.
An implementation may ignore this
(being somewhat inconvenient to the user, though)

o  setWindowBackground: aColorIndex in: aWindowId
set a windows background color

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setWindowBackgroundPixmap: aPixmapId in: aWindowId
set a windows background pattern to be a form.
No need to be implemented in concrete workstation;
if not implemented, its done by (slower) smalltalk code
(must return false from #supportsViewBackgroundPixmap query)

o  setWindowBorderColor: aColorIndex in: aWindowId
set a windows border color

o  setWindowBorderPixmap: aPixmapId in: aWindowId
set a windows border pattern

o  setWindowBorderShape: aPixmapId in: aWindowId
set a windows border shape

o  setWindowBorderWidth: aNumber in: aWindowId
set a windows border width

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setWindowClass: wClass name: wName in: aWindowId
define class and name of a window.
This may be used by the window manager to
select client specific resources.

o  setWindowGravity: how in: aWindowId
set window gravity for a window

o  setWindowIcon: aForm in: aWindowId
define a bitmap to be used as icon

o  setWindowIcon: aForm mask: aMaskForm in: aWindowId
set a windows icon & iconMask

o  setWindowIconWindow: aView in: aWindowId
set a windows icon window

o  setWindowMinExtent: minExt maxExtent: maxExt in: aWindowId
set a windows minimum & max extents.
nil arguments are ignored.

o  setWindowMinExtentX: minW y: minH maxExtentX: maxW y: maxH in: aWindowId
set a windows minimum & max extents.
nil arguments are ignored.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setWindowName: aString in: aWindowId
define a windows name (i.e. windowTitle)

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setWindowPid: anIntegerOrNil in: aWindowId
Sets the _NET_WM_PID property for the window (in X11).
This may be used by the window manager to group windows.
If anIntegerOrNil is nil, then PID of currently running
Smalltalk is used

o  setWindowShape: aPixmapId in: aWindowId
set a windows visible shape

o  unmapWindow: aWindowId
unmap a window

** This method must be redefined in concrete classes (subclassResponsibility) **

o  unmapWindow: aWindowId animation: animationSymbolorNil time: timeInMillisOrNil
unmap a window

o  windowIsIconified: aWindowId
return true, if a window is iconified

** This method must be redefined in concrete classes (subclassResponsibility) **


Private classes:

    DeviceFontMetrics


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:27:55 GMT