eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'XWorkstation':

Home

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

Class: XWorkstation


Inheritance:

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

Package:
stx:libview
Category:
Interface-Graphics
Version:
rev: 1.691 date: 2019/08/06 09:38:22
user: stefan
file: XWorkstation.st directory: libview
module: stx stc-classLibrary: libview
Author:
Claus Gittinger

Description:


this class provides the interface to X11. It redefines all required methods
from DeviceWorkstation.
Notice, that in Smalltalk/X you are not technically limited to one display;
in theory (and in our practice), you can create Views on many displays
simultaneously. However, the default setup is for one display only.
To support multiple displays, you will have to start another event dispatcher
process for the other display(s) and create the other views with a slightly
different protocol (ApplicationModel openOnDevice:) or by temporarily answering
the other device to the currentScreen query.
Therefore, 'normal' applications do not have to care for all of this, as the currentScreen
query is answered by the launcher when opening its applications.

Timeouts:
    sometimes, X-connections are lost and, as the Xlib is blocking and synchronous by
    default, this would lead to a locked ST/X system.
    Therefore, this class defines a timeOut, whenever doing an Xlib call.
    The default for this timeout is 30seconds.
    This may be a problem with windowmanagers which show a rubber-band rectangle
    when creating windows.
    If the user does not specify the rectangle within 30 seconds, the device assumes
    a timeout and closes the connection.
    As a (kludgy) workaround, a second timeout value is used for window-creation.
    This secondary timeout value defaults to 60*5 seconds (5 minutes).

See more documentation in my superclass, DeviceWorkstation.


Class protocol:

accessing-display capabilities
o  hasXCursorLibrary
Display hasXCursorLibrary

o  hasXftLibrary
Display hasXftLibrary

error handling
o  debug: aBoolean

o  debugResources
XWorkstation debugResources

o  errorStringOfLastError

o  getConnectionTimeOut
returns the default connectionTimeOut (seconds)

o  getConnectionTimeOutForWindowCreation
returns the default connectionTimeOut (seconds)

o  lastErrorString
return the last X-error string -
when buffering is on, this may be
an error for a long-ago operation

usage example(s):

	Screen lastErrorString

o  minorCodeOfLastError

o  requestCodeOfLastError

o  resourceIdOfLastError
Screen resourceIdOfLastError

o  setConnectionTimeOut: seconds
set the default connection timeout (seconds)

o  setConnectionTimeOutForWindowCreation: seconds
set the default connection timeout (seconds)

initialization
o  initialize
ConservativeSync is required for some Xlib implementation,

queries
o  isX11Platform

o  platformName
ST-80 compatibility.
Return a string describing the display systems platform.
XWorkstation always returns #X11.


Instance protocol:

Signal constants
o  deviceIOTimeoutErrorSignal
return the per-device signal, which is raised when a timeout
IO error (i.e. broken connection) occurs.

accessing
o  displayId

o  displayIdOrErrorIfBroken

o  displayIdOrNilIfBroken

o  maxOperationsUntilFlush

o  maxOperationsUntilFlush: anIntegerOrNil
if not nil, after anInteger number of draw operations
a flush is performed.

This is to work around a drawing problem which occurs on
Ubuntu 12.04 64bit running on a VMware player (2013-11).

o  screen

accessing & queries
o  activateOnClick: aBoolean
set/clear the activateOnClick behavior.
If on, a click into a window raises and activates
the (top) window.
Windows users typically enable this;
in contrast, those used to the X-Window system typically prefer
it disabled.
Returns the previous setting.

usage example(s):

     Display class activateOnClick:true
     Display class activateOnClick:false

o  anyButtonMotionMask
return the state-mask for any button in motion events' state-field.
This is the devices mask.

o  asPseudoDeviceWithoutXFTSupport
return a pseudo device to be used when drawing into pixmaps
on a device where xft-drawing into pixmaps is broken.
This is a temporary hack, to be removed when that problem is fixed in xft;
then, we should return self here.

o  blackpixel
return the colornumber of black

o  button1MotionMask
return the state-mask for button1 in motion events' state-field.
For backward compatibility.

usage example(s):

     Display button1MotionMask

o  button2MotionMask
return the state-mask for button2 in motion events' state-field
For backward compatibility.

o  button3MotionMask
return the state-mask for button3 in motion events' state-field
For backward compatibility.

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

o  controlMask
return the state-mask for the CTRL modified in motion events' state-field.

o  displayFileDescriptor
return the displays fileNumber - for select

o  displayName
return the X-connections display name.
This is (currently) nil for the default display,
something like foo:0 for any other remote display.
Future versions may return non-nil strings for the default display as well.

o  displayName: something

o  protocolVersion
return the X-servers protocol version - should normally not be of
any interest

usage example(s):

     Display protocolVersion

o  serverVendor
return the X-server vendor string - this should normally not be of
any interest, but can be for special cases
(to avoid bugs in certain implementations)

usage example(s):

     Display serverVendor
     Display platformName

o  shiftMask
return the state-mask for the SHIFT modified in motion events' state-field.

o  translatePoint: aPoint from: windowId1 to: windowId2
given a point in window1, return the coordinate in window2.
This expects a device coordinate (relative to the first views origin)
in aPoint and returns a device coordinate relative to the 2nd views origin.
- use to xlate points from a window to rootwindow

o  vendorRelease
return the X-servers vendor release - should normally not be of
any interest, but can be for special cases.
(to avoid bugs in certain implementations)

usage example(s):

     Display vendorRelease

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.
The returned id may be the id of a non ST view.
- used to find the window to drop objects after a cross-view drag.

usage example(s):

      Display viewIdFromPoint:100@100 in:Display realRootWindowId

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.

usage example(s):

     Display virtualExtent
     Display extent

o  whitepixel
return the colornumber of white

o  xlibTimeout

o  xlibTimeout: seconds

o  xlibTimeoutForWindowCreation

o  xlibTimeoutForWindowCreation: seconds

accessing-display capabilities
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  hasCursorExtension
return true, if this workstation supports the X cursor extension.
This extension allows for deep cursors (depth > 1)

usage example(s):

     Display hasCursorExtension

o  hasDPS
return true, if this workstation supports display postscript.
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 hasDPS

o  hasExtension: extensionString
query for an X extension. The argument, extensionString
should be the name of the extension (i.e. 'SHAPE', 'XInputExtension' etc).
Return true, if that extension is available in the server.
(which does not imply, that there is support in smalltalk for it.

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'

     XQuartz supports the following:
	Apple-DRI
	Apple-WM
	BIG-REQUESTS
	DAMAGE
	DOUBLE-BUFFER
	GLX
	Generic Event Extension
	MIT-SCREEN-SAVER
	MIT-SHM
	Present
	RANDR
	RENDER
	SECURITY
	SGI-GLX
	SHAPE
	SYNC
	X-Resource
	XC-MISC
	XFIXES
	XINERAMA
	XInputExtension
	XKEYBOARD
	XVideo

o  hasImageExtension
return true, if this workstation supports the X image extension.
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 hasImageExtension

o  hasInputExtension
return true, if this workstation supports the X input extension.
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 hasInputExtension

o  hasMultibuffer
return true, if this workstation supports the multibuffer extension.
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 hasMultibuffer

o  hasPEX
return true, if this workstation supports PEX 3D graphics.
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 hasPEX

o  hasRenderExtension
return true, if this workstation supports the X render extension.

usage example(s):

     Display hasRenderExtension

o  hasSaveUnder: aBoolean
if the argument is false, a popup view's saveUnder will not be used
- this can be used on servers where saveUnder is
very slow or is broken (can be put into display-rc-file)

usage example(s):

     Screen current hasSaveUnder:false

o  hasShm
return true, if this workstation supports the shared pixmap extension.
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 hasShm

o  hasXTestExtension
return true, if this workstation supports the X cursor extension.
This extension allows for deep cursors (depth > 1)

usage example(s):

     Display hasExtension:'XTEST'
     Display hasXTestExtension

o  hasXVideo
return true, if this workstation supports the XVideo extension.
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 hasXVideo

o  iconSizes
Get the preferred/supported icon sizes. These are set by the window manager.
We return nil (if not set) or an OrderedCollection of iconSize specs.

usage example(s):

     Display iconSizes

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 or is broken (can be put into display-rc-file)

o  monitorBounds
ask the X server via the Xinerama extension about the available monitors.
The first monitor returned is the primary monitor

usage example(s):

     Display monitorBounds

o  monitorBoundsAt: aPoint
Screen current monitorBoundsAt:(0@0)
Screen current monitorBoundsAt:(1500@0)
Screen current monitorBoundsAt:(3000@0)
Screen current monitorBoundsAt:(9000@0)
Screen current monitorBoundsAt:(Display pointFromUser)

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?

o  preferredIconSize
return the display's preferred size for icons.
Redefined to return a special value on SGI servers.

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  smallestMonitorHeight
returns the usable height of the smallest monitor in a mult-monito setup

usage example(s):

	Display smallestMonitorHeight

o  supportedClipboards
answer a collection of symbols with the supported clipboards.
X11 additionaly supports a buffer containing the currently selected text
(in xterm) - the PRIMARY selection

o  supportedImageFormats
return an array with supported image formats;
each array entry is an attribute dictionary, consisting of
depth, bitsPerPixel and padding values.

usage example(s):

     Display supportedImageFormats

o  supportsAnyViewBackgroundPixmaps
return true, if the device allows pixmaps as viewBackground.

o  supportsArbitraryShapedViews
return true, if this workstation supports arbitrary shaped windows.
Both the server must support it (the shape-extension),
and the feature must have been enabled in the smalltalk system,
for true to be returned.

usage example(s):

     Display supportsArbitraryShapedViews

o  supportsIconViews
return true, if this device supports views as icons.
These can be drawn into like any other regular view, and therefore be easily animated.
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.
True returned here - X has no trouble with any mask.

o  supportsMaskedDrawingWithOffset: aForm
return true, if the device allows the given form pixmap
to be used as paint color with a mask offset.
True returned here - X has no trouble with any mask.

o  supportsScreenReading
return true, if the device allows reading the screen pixels
True returned here - X can do it

usage example(s):

     Display serverVendor
     Display supportsScreenReading

o  supportsUTF8WindowLabels
answer true, if window labels are to be utf-8 encoded

o  supportsVariableHeightFonts
are fonts with variable height supported?

o  supportsViewBackgroundPixmap: aForm
return true, if the device allows the given pixmap as viewBackground.
True returned here - X supports any size.
Other device types (windows) may restrict this to certain sizes.

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

o  supportsXCursor
return true, if the XCursor extension (deep cursors ) are supported
on this display.
Both Smalltalk has to be compiled to support it (as client),
and the display we are connected to must support it,
to return true here.

usage example(s):

     Display supportsXCursor
     Display hasCursorExtension
     Display class hasXCursorLibrary

o  supportsXftFonts
return true, if XftFonts (nice looking truetype fonts)
are supported on this display.
Both Smalltalk has to be compiled to support it (as client),
and the display we are connected to must support it,
to return true here.

usage example(s):

     Display supportsXftFonts
     Display hasRenderExtension
     Display class hasXftLibrary

o  supportsXftFontsInBitmaps
return true, if XftFonts (nice looking truetype fonts)
are supported when drawing into bitmaps on this display.
Currently, this does not work, so xft drawing must be disabled when
rendering into bitmaps

usage example(s):

     Display supportsXftFontsInBitmaps
     Display hasRenderExtension
     Display class hasXftLibrary

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.
Also, with XQuartz, it does not work, because we cannot readout the screen...

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

usage example(s):

     Screen current usableHeightAt:(0@0)
     Screen current usableHeightAt:(1500@0)
     Screen current usableHeightAt:(3000@0)
     Screen current usableHeightAt:(9000@0)
     Screen current usableHeightAt:(Display pointFromUser)

bitmap/window creation
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

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

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

o  createWindowFor: aView type: typeSymbol origin: origin extent: extent minExtent: minExt maxExtent: maxExt borderWidth: bWidth subViewOf: wsuperView style: wStyle inputOnly: winputOnly label: wlabel owner: wowner icon: wicon iconMask: wiconMask iconView: wiconView
(wStyle ~= nil and:[wStyle ~= #normal]) ifTrue:[

o  destroyGC: aGCId

o  destroyPixmap: aDrawableId

o  destroyView: aViewOrNil withId: aWindowId

o  dpsContextFor: aDrawableId and: aGCId

o  gcFor: aDrawableId

o  gcForBitmap: aDrawableId
with X, this is the same as a normal gc

o  primCreateBitmapFromArray: anArray width: w height: h

o  primCreateWindowType: t origin: o extent: e minExtent: minE maxExtent: maxE borderWidth: bw superViewId: sv style: st inputOnly: i label: l ownerId: oId iconId: ic iconMaskId: im iconViewId: iv
for rel5 only

o  primDestroyViewWithId: aWindowId

clipboard
o  getPrimaryBuffer
Returns the contents of PRIMARY selection buffer

o  primaryBufferAsString
return my current selection as a string

o  setPrimaryBuffer: aString
Sets the contents of PRIMARY selection.

o  setPrimaryText: aString ownerView: aView
Set the PRIMARY selection - both the local one, and tell the display
that we have changed it (i.e. place it into the PRIMARY).

color stuff
o  colorCell
allocate a color cell - return the color index (i.e. colorID).
This method will return nil for StaticGrey, StaticGrey and TrueColor displays.

o  colorNamed: aString
allocate a color with color name - return the color index (i.e. colorID).
On trueColor displays, nothing is actually allocated,
and the returned colorID is formed by simply packing the RGB values.
Don't use this method, colornames are mostly X specific.

o  colorScaledRed: r scaledGreen: g scaledBlue: b
allocate a color with rgb values (0..16rFFFF)
- return the color index (i.e. colorID).
On trueColor displays, nothing is actually allocated,
and the returned colorID is formed by simply packing the RGB values.

o  deviceColorValueToPercent: aDeviceValue
given a color-component value in percent (0..65k), return the corresponding
x-component value (0..100)

usage example(s):

     Display deviceColorValueToPercent:0
     Display deviceColorValueToPercent:16r8000
     Display deviceColorValueToPercent:16rFFFF

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

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

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

usage example(s):

	Screen current getScaledRGBFromName:'red'
	Screen current getScaledRGBFromName:'orange'

o  listOfAvailableColors
return a list of all available colornames.
This should not be used, since colornames are very
display-specific (here X-specific).

usage example(s):

     Screen current listOfAvailableColors

o  percentToDeviceColorValue: aPercentage
given a color-component value in percent (0..100), return the corresponding
x-component value (0..65k) as an integer

o  setColor: index scaledRed: sred scaledGreen: sgreen scaledBlue: sblue
change color in map at:index to rgb (0..16rFFFF).
This method is a noop for StaticGrey, StaticGrey and TrueColor displays.

cursor stuff
o  builtInCursorShapes
return a collection of standard cursor names.
Those are built into the XServer and need not be created as
user cursors.
(actually, there are more than those below ...)

o  colorCursor: aCursorId foreground: fgColor background: bgColor
change a cursors colors

o  createCursorShape: aShape
create a cursor given a shape-symbol. This only works
for a few standard cursors, and returns nil if no such cursor exists.
Senders must 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

o  destroyCursor: aCursorId
release a cursor - frees any device resources

o  needDeviceFormsForCursor

o  primCreateCursorShapeNumber: aShapeNumber
create a cursor given a shape-number.

o  primCreateCursorSourceFormId: sourceId maskFormId: maskId hotX: hx hotY: hy width: w height: h
create a cursor given 2 bitmaps (source, mask) and a hotspot

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

drag & drop
o  dndDrop: dropObjects inWindowID: destinationId position: destinationPoint rootPosition: rootPoint
drop something in some alien view, using the DND protocol.
Returns false, if the drop could not be performed.

o  dndDropTypes
return the dropTypes as supported by DND

o  dndMessage: event data: data view: targetView
handle a drag&drop protocol message

o  drop: aCollectionOfDropObjects inWindowID: destinationId position: destinationPoint rootPosition: rootPoint
drop something in some alien view.
Returns false, if the drop could not be performed.

drag & drop - xdnd
o  initializeXdnd
Xdnd is an alternative protocol for drag and drop
(both modern and standard now).
https://freedesktop.org/wiki/Specifications/XDND/

usage example(s):

     Display initializeXdnd

o  setXdndAwarePropertyFor: aWindowOrWindowID
announce that this window supports the Xdnd (drag & drop) protocol

usage example(s):

     Display setXdndAwarePropertyFor:Transcript
     Display getProperty:#'XdndAware' from:Transcript delete:false

o  xdndDrop: data view: targetView
handle a xdnd drag&drop protocol message.
Ignored for now

o  xdndEnter: data view: targetView
handle a xdnd drag&drop protocol message.
Ignored for now

o  xdndLeave: data view: targetView
handle a xdnd drag&drop protocol message.
Ignored for now

o  xdndPosition: data view: targetView
handle a xdnd drag&drop protocol message.
Ignored for now

drawing
o  _displayLineFromX: x0 y: y0 toX: x1 y: y1 in: aDrawableId with: aGCId
draw a line. If the coordinates are not integers, an error is triggered.

o  _fillRectangleX: x y: y width: width height: height in: aDrawableId with: aGCId
fill a rectangle.
If any coordinate is not integer, an error is triggered.

o  clearRectangleX: x y: y width: width height: height in: aDrawableId with: aGCId
clear (fill with background) a rectangle. If any coordinate is not integer, an error is triggered.

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; copy bits from the rectangle defined by
srcX/srcY and w/h from the sourceId drawable to the rectangle
below dstX/dstY in the destId drawable. Trigger an error if any
argument is not integer.

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; copy bits from the rectangle defined by
srcX/srcY and w/h from the sourceId drawable to the rectangle
below dstX/dstY in the destId drawable. Trigger an error if any
argument is not integer.
This is basically the same as copyFromId:..., but does not generate expose events.

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, but only copy the low-bit plane;
copy bits from the rectangle defined by
srcX/srcY and w/h from the sourceId drawable to the rectangle
below dstX/dstY in the destId drawable. Trigger an error if any
argument is not integer.

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, but only copy the low-bit plane;
copy bits from the rectangle defined by
srcX/srcY and w/h from the sourceId drawable to the rectangle
below dstX/dstY in the destId drawable. Trigger an error if any
argument is not integer.
This is the same as copyPlaneFromId:..., but does not generate graphics exposes

o  displayArcX: x y: y width: width height: height from: startAngle angle: angle in: aDrawableId with: aGCId
draw an arc. If any of x,y, w or h is not an integer, an error is triggered.
The angles may be floats or integer - they are given in degrees.

o  displayLineFromX: x0 y: y0 toX: x1 y: y1 in: aDrawableId with: aGCId
draw a line. If the coordinates are not integers, an error is triggered.

o  displayLinesFromX: startX step: stepX yValues: yValues scaleY: scaleY transY: transY in: aDrawableId with: aGCId
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

o  displayPointX: x y: y in: aDrawableId with: aGCId
draw a point. If x/y are not integers, an error is triggered.

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.

o  displayPolygon: aPolygon in: aDrawableId with: aGCId
draw a polygon, the argument aPolygon is a Collection of individual points, which
define the polygon.
If any coordinate is not integer, an error is triggered.

o  displayRectangleX: x y: y width: width height: height in: aDrawableId with: aGCId
draw a rectangle. If the coordinates are not integers, an error is triggered.

o  displayString: aString from: index1 to: index2 x: x y: y in: aDrawableId with: aGCId opaque: opaque
draw a sub-string - if opaque is false, draw foreground only; otherwise, draw both
foreground and background characters.
If the coordinates are not integers, an error is triggered.

o  displayString: aString x: x y: y in: aDrawableId with: aGCId opaque: opaque
draw a string - if opaque is false, draw foreground only; otherwise, draw both
foreground and background characters.
If the coordinates are not integers, an error is triggered.

o  drawBits: givenBits bitsPerPixel: bitsPerPixel depth: imageDepth padding: givenPadding 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.
Individual source pixels have bitsPerPixel bits, allowing to draw
depth and pixel-units to be different.
It has to be checked elsewhere, that the server can do it with the given
depth - otherwise, primitive failure will be signalled.
Also it is assumed, that the colormap is setup correctly and the
colors are allocated - otherwise the colors may be wrong.

o  drawBits: bits msb: msb bitsPerPixel: bitsPerPixel depth: imageDepth padding: padding 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.
Individual source pixels have bitsPerPixel bits, allowing to draw
depth and pixel-units to be different.
It has to be checked elsewhere, that the server can do it with the given
depth - otherwise, primitive failure will be signalled.
Also it is assumed, that the colormap is setup correctly and the
colors are allocated - otherwise the colors may be wrong.

o  fillArcX: x y: y width: width height: height from: startAngle angle: angle in: aDrawableId with: aGCId
fill an arc. If any coordinate is not integer, an error is triggered.
The angles may be floats or integer - they are given in degrees.

o  fillPolygon: aPolygon in: aDrawableId with: aGCId
fill a polygon given by its points.
If any coordinate is not integer, an error is triggered.

o  fillRectangleX: x y: y width: width height: height in: aDrawableId with: aGCId
fill a rectangle.
If any coordinate is not integer, an error is triggered.

o  primDrawBits: imageBits bitsPerPixel: bitsPerPixel depth: imageDepth msb: msb masks: maskArray padding: bitPadding extent: imageExtent sourceOrigin: srcOrg into: aDrawableId destinationOrigin: dstOrg extent: dstExtent with: aGCId
since XPutImage may allocate huge amount of stack space
(some implementations use alloca), this must run with unlimited stack.

o  primDrawBits: imageBits bitsPerPixel: bitsPerPixel depth: imageDepth msb: msb padding: bitPadding width: imageWidth height: imageHeight x: srcx y: srcy into: aDrawableId x: dstx y: dsty width: w height: h with: aGCId
since XPutImage may allocate huge amount of stack space
(some implementations use alloca), this must run with unlimited stack.

event forwarding
o  buttonMotion: view state: state x: x y: y rootX: rX rootY: rY time: time
forward a buttonMotion event for some view

o  buttonPress: view button: button state: state x: x y: y rootX: rX rootY: rY time: time
forward a buttonPress event for some view

o  buttonRelease: view button: button state: state x: x y: y rootX: rX rootY: rY time: time
forward a buttonPress event for some view

o  clientMessage: targetView type: typeAtom format: format data: data
targetView is gone? Anyway, cannot do anything with this event...

o  configure: view relativeTo: anotherViewId x: x y: y width: w height: h borderWidth: borderWidth above: aboveViewId overrideRedirect: overrideBool
forward a size-change event for some view

o  createWindow: view x: x y: y width: w height: h
event arrived, after I destroyed it myself

o  expose: view x: x y: y width: w height: h count: count
forward an expose event for some view

o  focusIn: view mode: mode detail: detail
a view got the keyboard focus

o  focusOut: view mode: mode detail: detail
a view lost the keyboard focus

o  graphicsExpose: view x: x y: y width: w height: h count: count
forward a graphics-expose event for some view

o  keyPress: view key: key code: keyCode state: state x: x y: y rootX: rX rootY: rY time: time
forward a key-press event for some view

o  keyRelease: view key: key code: keyCode state: state x: x y: y rootX: rX rootY: rY time: time
forward a key-release event for some view

o  mappingNotify: view request: what event: eB
One of Keyboard-, Modifier- or PointerMap has changed, probably by xmodmap.
Tell xlib about the fact.

o  pointerEnter: view x: x y: y rootX: rX rootY: rY state: state mode: mode detail: detail time: time
forward a pointer enter event for some view

o  pointerLeave: view x: x y: y rootX: rX rootY: rY state: state mode: mode detail: detail time: time
forward a pointer leave event for some view

o  propertyChange: aView property: propertyId state: aSymbol time: time
sent when an X property changes.
This is a very X-specific mechanism.

usage example(s):

aView propertyChange:atom state:aSymbol.

o  selectionClear: aView selection: selectionID time: time
sent when another X-client has created a selection.
This is a very X-specific mechanism.

o  selectionNotify: aView selection: selectionID target: targetID property: propertyID requestor: requestorID time: time
This event is sent by the selection owner as a response to our request for a selection.
This is a very X-specific mechanism.

o  selectionRequest: aView requestor: requestorID selection: selectionID target: targetID property: propertyID time: time
sent by some other X-client to ask for the selection.
This is a very X-specific mechanism.

o  visibilityNotify: aView state: how

event forwarding-ignored events
o  circulateNotify: aView place: aSymbol
sent, when the stacking order changes.
ignored for now.

o  circulateRequest: aView place: aSymbol
sent, when the stacking order is about to change.
ignored for now.

o  colorMapNotify: aView state: aBoolean
sent, when another colormap is installed.
This is a very X-specific mechanism.

o  configureRequest: view x: x y: y width: w height: h above: above detail: detail
ignored for now

o  gravityNotify: aView x: x y: y
ignored for now

o  keymapNotify: aView
ignore for now

o  mapRequest: aView
ignored for now

o  reparentedView: aView parentId: parentId x: x y: y
ignored for now

o  resizeRequest: aView width: width height: height
ignored for now

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

o  dispatchEvent: evArray
a raw event array as coming from the low level C code is converted
to a message send here.
Also, the windowID from the event array is mapped to a view object.

o  dispatchEventFor: aViewIdOrNil withMask: eventMask
central event handling method:
get next event and send appropriate message to the sensor or view.
If the argument aViewIdOrNil is nil, events for any view are processed,
otherwise only events for the view with given id are processed.
If the argument aMask is nonNil, only events for this eventMask are
handled.
WARNING: this may block to wait for an event - you better check for a
pending event before calling this.

o  dispatchExposeEventFor: aViewIdOrNil
get next expose event and send appropriate message to the sensor or view.
If the argument aViewIdOrNil is nil, events for any view are processed,
otherwise only events for the view with given id are processed.
WARNING: this may block to wait for an event - you better check for a
pending event before calling this.

o  dispatchLoop

o  dispatchPendingEvents
central event handling method for modal operation.
(i.e. this is now only used in the modal debugger)
Dispatch any pending events; return when no more are pending.
This code is somewhat special, since X has a concept of graphic
expose events (which are sent after a bitblt). After such a bitblt,
we only handle exposes until the graphicsExpose arrives.
Other systems may not need such a kludge

o  disposeEventsWithMask: aMask for: aWindowIdOrNil
dispose (throw away) specific events. If aWindowId is nil,
events matching the mask are thrown away regardless of which
view they are for. Otherwise, only matching events for that
view are flushed.

o  eventMaskFor: anEventSymbol
return the eventMask bit-constant corresponding to an event symbol

o  eventPending
return true, if any event is pending.
This looks for both the internal queue and the display connection.

usage example(s):

where eventPending returns wrong if we do not flush the buffer.

o  eventPending: anEventSymbol for: aWindowIdOrNil
return true, if a specific event is pending

o  eventPending: anEventMask for: aWindowIdOrNil withSync: doSync
return true, if any of the masked events is pending

o  eventPendingWithSync: doSync
return true, if any event is pending.
If doSync is true, do a sync output buffer (i.e. send all to the display and wait until its processed)
before checking.

o  eventQueued
return true, if any event is queued

o  eventQueuedAlready
return true, if any event is queued internally.
(i.e. in X's internal event queue, which is both filled by explicit
nextEvent calls AND whenever drawing is done and events are pending on
the display connection).

o  exposeEventPendingFor: aWindowIdOrNil withSync: doSync
return true, if any expose event is pending for a specific view,
or any view (if the arg is nil).
This is an X specific, only required after a scroll operation.

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.

The event fields are placed into anEventArray (must be at least size 13):
the fields are:
1: windowID
2: eventType-ID
3: eventTypeSymbol

4.. args

Sorry I had to split dispatch into this fetch method and a separate
handler method to allow UNLIMITEDSTACK here.
(some Xlibs do a big alloca there which cannot be done in
#dispatchEvent:, since it dispatches out into ST-methods).

o  handleAllEvents
from now on, handle any kind of event

o  handleExposeOnlyFor: aView
from now on, handle expose events only

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

o  setEventMask: aMask in: aWindowId
tell X that we are only interested in events from aMask, which
is the bitwise or of the eventMask bits (see 'eventMaskFor:')

o  startDispatch
redefined to clear dispatchingExpose, which is a special X feature

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

o  viewIsRelevantInCheckForEndOfDispatch: aView

event sending
o  sendClientEvent: msgType format: msgFormat to: targetWindowID propagate: propagate eventMask: eventMask window: windowID data1: d1 data2: d2 data3: d3 data4: d4 data5: d5
send a ClientMessage to some other (possibly: non-ST/X) view.
The client message gets message_type and msgFormat as specified by
the arguments. The additional data arguments specify up to
5 longWords of user data; each may be an integer or nil.
It is passed transparently in the events data field.
See XProtocol specification for more details.

o  sendKeyOrButtonEvent: typeSymbol x: xPos y: yPos keyOrButton: keySymCodeOrButtonNr state: stateMask toViewId: targetId

o  sendKeyOrButtonEvent: typeSymbol x: xPos y: yPos keyOrButton: keySymCodeOrButtonNr state: stateMask toViewId: targetId useXTest: useXTestBoolean
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 listed 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)

font stuff
o  createFontFor: aFontName
a basic method for X-font allocation; this method allows
any font to be acquired (even those not conforming to
standard naming conventions, such as cursor, fixed or k14)

o  decomposeXFontName: aString into: aBlock
extract family, face, style and size from an
X-font name
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
-brand-family-face-style-moreStyle- -height-size-resX-resY-??-??-registry-encoding;
evaluate aBlock with these

o  encodingOf: aFontId
the font's encoding - if the font does not provide that info,
return nil (and assume #ascii, which is a subset of #iso8859-1).

usage example(s):

       Screen current encodingOf:(Screen current getDefaultFontWithEncoding:#'iso10646-1')

o  extentsOf: aString from: index1 to: index2 inFont: aFontId into: anArray
|result|
result := Array new:8.
Screen current
extentsOf:'hello World' from:1 to:11
inFont:(Screen current getFontWithFoundry:'*'
family:'courier new'
weight:'medium'
slant:'r'
spacing:nil
pixelSize:nil
size:10
encoding:#'iso10646-1'
)
into:result.

result

o  extractEncodingFromRegistry: registry encoding: encoding charSetCollections: charSetCollections
given registry and encoding as returned by X11,
generate a single symbol naming the ST/X encoding.
I.e. from registry='ISO8859' and encoding='1', generate #'iso8859-1'.
This is pure magic ...

o  flushListOfAvailableFonts
flush the cached list of all available fonts on this display.
Required if new fonts have been added on the display server.

usage example(s):

     Display flushListOfAvailableFonts.
     Display listOfAvailableFonts

o  fontDescriptionFromXFontName: aFontNameString
extract family, face, style and size from an
X-font name
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
-brand-family-face-style-moreStyle- -pxlSize-size-resX-resY-??-??-registry-encoding;
evaluate aBlock with these

usage example(s):

     Screen current fontDescriptionFromXFontName:'-arabic-newspaper-medium-r-normal--32-246-100-100-p-137-iso10646-1'

o  fontMetricsOf: fontId
return a fonts metrics info object

usage example(s):

     Screen current fontMetricsOf:(View defaultFont onDevice:Screen current) fontId
     CharacterSetView openOn:(View defaultFont onDevice:Screen current)

     Screen current fontMetricsOf:(MenuView defaultFont onDevice:Screen current) fontId
     CharacterSetView openOn:(MenuView defaultFont onDevice:Screen current)

o  fontProperties: propertyNames of: aFontId
Answer an array with selected property values of a font.
This is X11-Specific.
PropertyNames is an array with property names (symbols or strings).
Nonexistent properties are returned as nil

usage example(s):

     Screen current
	fontProperties:#(#'PIXEL_SIZE' #'POINT_SIZE' RESOLUTION notExistent)
	of:(Screen current getDefaultFontWithEncoding:#'iso10646-1')

o  fontPropertiesOf: aFontId
Answer an array with all the properties of a font.
This is X11-Specific.
Odd indices contain the property name (atom)
Even indices contain the property value (atom)

Answer nil, if there are no properties

usage example(s):

     Screen current fontPropertiesOf:(Screen current getDefaultFontWithEncoding:#'iso10646-1')
     Dictionary withKeysAndValues:(Screen current fontPropertiesOf:(Screen current getDefaultFontWithEncoding:#'iso10646-1'))

     |d|
     d := Dictionary new.
     (Screen current fontPropertiesOf:(Screen current getDefaultFontWithEncoding:#'iso10646-1')) keysAndValuesDo:[:name :value|
	  d at:name put:((Screen current atomName:value) ? value)
     ].
     d

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

usage example(s):

      Screen current fontResolutionOf:(Screen current getDefaultFontWithEncoding:#'iso10646-1')

o  fullFontNameOf: aFontId
the font's fullName - this is very device specific and should only be
used for user feed-back (for example: in the fontPanel).
If the display/font does not provide that info, return nil.

usage example(s):

     Screen current fullFontNameOf:(Screen current getDefaultFontWithEncoding:#'iso10646-1')

o  getAvailableFontsMatching: pattern
return an Array filled with font names matching aPattern

usage example(s):

      Screen current getAvailableFontsMatching:'*'

o  getDefaultFontWithEncoding: encoding
return a default font id - used when class Font cannot
find anything usable

usage example(s):

       Screen current getDefaultFontWithEncoding:#'iso10646-1'

o  getFontWithFamily: familyString face: faceString style: styleArgString size: sizeArgOrNil sizeUnit: sizeUnit encoding: encoding
try to get the specified font, if not available, try next smaller
font. Access to X-fonts by name is possible, by passing the X font name
as family and the other parameters as nil. For example, the cursor font
can be acquired that way.

o  getFontWithFoundry: foundry family: family weight: weight slant: slant spacing: spc pixelSize: pSize size: size encoding: encoding
get the specified font, if not available, return nil.
Individual attributes can be left empty (i.e. '') or nil to match any.

foundry: 'adobe', 'misc', 'dec', 'schumacher' ... usually '*'
family: 'helvetica' 'courier' 'times' ...
weight: 'bold' 'medium' 'demi' ...
slant: 'r(oman)' 'i(talic)' 'o(blique)'
spacing: 'narrow' 'normal' semicondensed' ... usually '*'
pixelSize: 16,18 ... usually left empty
size: size in point (1/72th of an inch)
encoding: iso8859-*, iso8859-1, iso10646-1 ... '*'

usage example(s):

     Display
	getFontWithFoundry:'*'
	family:'courier'
	weight:'medium'
	slant:'r'
	spacing:nil
	pixelSize:nil
	size:13
	encoding:#'iso8859-1'.

     Display
	getFontWithFoundry:'*'
	family:'courier'
	weight:'medium'
	slant:'r'
	spacing:nil
	pixelSize:nil
	size:13
	encoding:#'iso10646-1'

o  heightOf: aString from: index1 to: index2 inFont: aFontId
Screen current
heightOf:'hello world' from:1 to:10
inFont:(Screen current getFontWithFoundry:'*'
family:'courier new'
weight:'medium'
slant:'r'
spacing:nil
pixelSize:nil
size:13
encoding:#'iso10646-1'
).

Screen current
heightOf:'hello World gggÖÜ' from:1 to:15
inFont:(Screen current getDefaultFontWithEncoding:#'iso10646-1')

o  listOfAvailableFonts
return a list with all available fonts on this display.
Since this takes some time, keep the result of the query for the
next time. The elements of the returned collection are instances of
FontDescription.

usage example(s):

     Display flushListOfAvailableFonts.
     Display listOfAvailableFonts.

     Display getAvailableFontsMatching:'*'.
     Display getAvailableFontsMatching:'fixed'.
     Display fontsInFamily:'fixed' filtering:nil.

o  pixelSizesInFamily: aFamilyName face: aFaceName style: aStyleName filtering: filter
return a set of all available font sizes in aFamily/aFace/aStyle
on this display.
Redefined to handle X's special case of 0-size (which stands for any)

usage example(s):

     Display pixelSizesInFamily:'courier' face:'bold' style:'roman' filtering:nil

o  releaseFont: aFontId

o  sizesInFamily: aFamilyName face: aFaceName style: aStyleName filtering: filter
return a set of all available font sizes in aFamily/aFace/aStyle
on this display.
Redefined to handle X's special case of 0-size (which stands for any)

usage example(s):

     Display sizesInFamily:'courier' face:'bold' style:'roman' filtering:nil

o  widthOf: aString from: index1 to: index2 inFont: aFontId

grabbing
o  allowEvents: mode

o  grabKeyboardIn: aWindowId
grab the keyboard

o  grabPointerIn: aWindowId withCursor: aCursorId eventMask: eventMask pointerMode: pMode keyboardMode: kMode confineTo: confineId
grap the pointer - return true if ok

o  grabPointerIn: aWindowId withCursor: aCursorId pointerMode: pMode keyboardMode: kMode confineTo: confineId
grap the pointer - return true if ok

o  primUngrabKeyboard
release the keyboard

o  primUngrabPointer
release the pointer

o  ungrabKeyboard
release the keyboard

o  ungrabPointer
release the pointer

grabbing-keys
o  grabKey: keySymCodeOrChar modifier: modifierMaskOrNil grabModeKeyboard: modeKbd grabModePointer: modePtr window: aWindowIdOrNil
internal basic entry to grab a single key either for an individual window
or the whole screen (if aWindowIdOrNil is nil).
The keySymCodeOrChar argument may be a keySym (name of a key) or an integer (the keySymCode)
or a character.
The modifierMaskOrNil is as mask as returned by altModifierMask, ctrlModifierMask, etc.
if nil, the key is grabbed with AnyModifier.
ModeKbd and modePtr are symbols GrabModeAsync or GrabModeSync.

After that, this key-event will no longer be sent to the window/screen.

Use with care: the only useful application is to define a special hotKey
to start/stop event recorders without a need for a click or focus change.
Once grabbed, those key events will be exclusively reported to me.

Use GrabModeSync with big care - you can easily lock up your Xserver,
and have to kill ST/X or force an ungrab from a remote login if you have.

o  grabKey: keySymCodeOrChar modifier: modifierMaskOrNil window: aWindowIdOrNil
grab a single key either for an individual window
or the whole screen (if aWindowIdOrNil is nil).
The keySymCodeOrChar argument may be a keySym (name of a key) or an integer (the keySymCode)
or a character.
The modifierMaskOrNil is as mask as returned by altModifierMask, ctrlModifierMask, etc.
if nil, the key is grabbed with AnyModifier.
Only the key is passed to myself - no permanent grab is installed.
(GrabModeAsync).
While the grab is active, key events for this key will be sent to
the DisplayRootWindow

usage example(s):

     Display grabKey:#Escape modifier:nil window:nil.
     Delay waitForSeconds:15.
     Display ungrabKey:#Escape modifier:nil window:nil.

o  ungrabKey: keySymCodeOrChar modifier: modifierMaskOrNil window: aWindowIdOrNil
ungrab a single key as previously grabbed via grabKey:
Read the comment there.

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

o  setBackground: bgColorIndex 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

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

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

o  setDashes: dashList dashOffset: offset in: aGCId
set line attributes

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

o  setForeground: fgColorIndex background: bgColorIndex in: aGCId
set foreground and background colors to be drawn with

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

o  setFunction: aFunctionSymbol in: aGCId
set alu function to be drawn with

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

o  setLineWidth: aNumber style: lineStyle cap: capStyle join: joinStyle in: aGCId
set line attributes;
lineStyle must be one of #solid, #dashed or #doubleDashed;
capStyle one of: #notLast, #butt, #round or #projecting;
joinStyle one of: #miter, #bevel or #round.

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

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

o  setPlaneMask: bits in: aGCId
set foreground color to be drawn with

initialization & release
o  closeConnection
close down the connection to the X-server

o  emergencyCloseConnection
low level close of the displays connection (without sending any buffered
requests to the display). Only used in case of emergency (brokenConnection)

o  eventBufferSize

o  getWindowGroupWindow
Creates a fake WindowGroup view. This window is used
in XWMHints & _NET_WM_LEADER properties to define
application window group

o  initializeDefaultValues
JV@2012: On X11, mouse buttons are: left=1, middle=2, right=3
Even on 2-button mouse (button 2 is simply not reported).
Here the middle button is mapped to button #paste (which in EditTextView
pastes the PRIMARY selection). 128 is here to make clear that this
is somewhat special value.

This remapping kludge is here to have all the widget's code backward/windows
compatible while still having X11's middle button behavior.

Also note that buttonTranslation is overwritten in display.rc,
the code is here just for a case display.rc is not read/available
and for documentation (symbol references does not search .rc files).

o  initializeDeviceSignals

o  initializeFor: aDisplayName
initialize the receiver for a connection to an X-Server;
the argument, aDisplayName may be nil (for the default server from
DISPLAY-variable or command line argument) or the name of the server
as hostname:number

o  initializeModifierMappings
initialize keyboard modifiers.
We assume that mod1 are the META modifiers and mod2 are the ALT modifiers,
but if any of them contains the Num_Lock key, it is disregarded.

usage example(s):

     Display initializeModifierMappings

o  initializeScreenBounds
queries answer nil if not open

usage example(s):

      Display initializeScreenBounds

o  initializeScreenProperties

o  initializeSpecialFlags
perform additional special server implementation flags

o  initializeUniqueID

o  invalidateConnection
the new display may support a different set of fonts

o  openConnectionTo: dpyName
open a connection to some display;
return the displayId if ok, nil of not ok

o  queryBlackPixel
Display queryBlackPixel

o  queryCells
Display queryCells

o  queryDefaultScreen
Display queryDefaultScreen

o  queryDefaultVisual
Display queryDefaultVisual

o  queryDefaultVisualType
Display queryDefaultVisualType

o  queryDepth
Display queryDepth

o  queryHeight
Display queryHeight

o  queryHeightMM
Display queryHeightMM

o  queryRGBMasks
Display queryRGBMasks

o  queryWhitePixel
Display queryWhitePixel

o  queryWidth
Display queryWidth

o  queryWidthMM
Display queryWidthMM

o  reinitialize

o  releaseDeviceResources

keyboard mapping
o  altModifierMask
return the mask (in motionEvents) for the alt-key modifier.
Notice: ST/X may use the left ALT key as CMD/Meta key,
therefore return a variable here, which can be changed during startup.

o  altModifierMask: aSmallInteger
define which key takes the role of an alt-key.
By default, this is X's modifier1, which is the ALT key on
most keyboards. However, there may be exceptions to this,
and the setting can be changed with:
Display altModifierMask:(Display modifier2Mask)
Setting the mask to 0 disables the ALT key (in ST/X) altogether.

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  ctrlModifierMask
return the Xlib mask bit for the control modifier key

o  metaModifierMask
return the mask (in motionEvents) for the meta-key modifier.
Notice: ST/X may use the left ALT key as CMD/Meta key,
therefore return a variable here, which can be changed during startup.

o  metaModifierMask: aSmallInteger
define which key takes the role of a meta key.
By default, this is X's modifier2, which is the 2nd ALT key on
most keyboards (if present at all).
However, there may be exceptions to this, and the setting can
be changed with:
Display metaModifierMask:(Display modifier1Mask)
Setting the mask to 0 disables the META key (in ST/X) altogether.
As reported, some Xservers place the Meta-key onto NumLock,
and having NumLock enabled makes ST/X think, that meta is pressed
all the time. On those, you should disable the meta key by setting
the mask to 0.

o  modifier1Mask
return the Xlib mask bit for the 1st modifier key.
See comment in altModifierMask: / metaModifierMask: for what
this could be used.

o  modifier2Mask
return the Xlib mask bit for the 2nd modifier key.
See comment in altModifierMask: / metaModifierMask: for what
this could be used.

o  modifier3Mask
return the Xlib mask bit for the 3rd modifier key.
See comment in altModifierMask: / metaModifierMask: for what
this could be used.

o  modifier4Mask
return the Xlib mask bit for the 4th modifier key.
See comment in altModifierMask: / metaModifierMask: for what
this could be used.

o  modifier5Mask
return the Xlib mask bit for the 5th modifier key.
See comment in altModifierMask: / metaModifierMask: for what
this could be used.

o  modifierMapping
Get the Modifier Mapping.
We return an array of arrays of keycodes

usage example(s):

     Display modifierMapping

o  rawKeySymTranslation
Get the raw keyboard mapping (maps some special X-keySyms to STX-internal names
and can also be used to untranslate a stupid x-mapping (as on hpux).

usage example(s):

     Display rawKeySymTranslation

o  rawModifierMapping
Get the raw Modifier Mapping.

usage example(s):

	Display rawModifierMapping

o  shiftModifierMask
return the Xlib mask bit for the shift modifier key

o  superModifierMask
return the Xlib mask bit for the super modifier key

o  symbolFromKeycode: code
Get a KeySymbol (a smalltalk symbol) from the keycode.

usage example(s):

	Display symbolFromKeycode:50

misc
o  beep
output an audible beep or bell

usage example(s):

     Screen current beep

o  beep: aSymbolOrInteger volume: volumeInPercent
output an audible beep. aSymbolOrInteger determines the sound, but is ignored here
(kept for comaptibilty with WinWorkstation).

o  buffered
buffer drawing - do not send it immediately to the display.
This is the default anyway.
See #unBuffered for additional info.

usage example(s):

     Display buffered

o  flush
send all buffered drawing to the display.
This may be required to make certain, that all previous operations
are really sent to the display before continuing. For example,
after a cursor-change with a followup long computation.
(otherwise, the cursor change request may still be in the output buffer)
See also #sync, which even waits until the request has been processed.

o  flushDpsContext: aDPSContext

o  flushIfAppropriate
flush the device, if necessary

o  primSync
send all buffered drawing to the display AND wait until the display
has finished drawing it.
This is almost never needed, except if you are about to read previously
drawn pixels back from the display screen, or you want to wait for a beep
to be finished. See also #flush.

o  refreshKeyboardMapping: eB

o  roundTripTime
answer the round trip time in milliSeconds.
May be used to detect slow X11 connections

usage example(s):

     Screen current roundTripTime

o  setInputFocusTo: aWindowId
set the focus to the view as defined by aWindowId.
When released, return the focus to the root window

usage example(s):

self setInputFocusTo:aWindowId revertTo:#parent

o  setInputFocusTo: aWindowId revertTo: revertSymbol
set the focus to the view as defined by aWindowId.
Passing nil set the focus to no window and lets the display discard all
input until a new focus is set.
RevertSymbol specifies what should happen if the view becomes invisible;
passing one of #parent, #root or nil specifies that the focus should be
given to the parent view, the root view or no view.

o  sync
send all buffered drawing to the display AND wait until the display
has finished drawing it.
This is almost never needed, except if you are about to read previously
drawn pixels back from the display screen, or you want to wait for a beep
to be finished. See also #flush.

o  unBuffered
make all drawing be sent immediately to the display.
This makes all graphics synchronous and turns off any buffering
(i.e. each individual draw-request is sent immediately without
packing multiple requests into a larger message buffer).
Be prepared, that this slows down graphics considerably.
However, it allows display errors to be handled immediately and
may be useful if you get Xdisplay errors and want to find the request
which was responsible for it. See also #buffered.

usage example(s):

     Display unBuffered

pointer stuff
o  anyButtonStateMask
return an integer for masking out any button from a
buttonStates value.

o  buttonStates
return an integer representing the state of the pointer buttons;
a one-bit in positions 0.. represent a pressed button.
See the button1Mask/button2Mask/button3Mask,
shiftMask/controlMask and modifierMask methods for the meaning of the bits.

usage example(s):

     Display buttonStates

usage example(s):

is the control-key pressed ?

     Display buttonStates bitTest:(Display controlMask)

usage example(s):

is the alt/meta-key pressed ?

     Display buttonStates bitTest:(Display altModifierMask)
     Display buttonStates bitTest:(Display metaModifierMask)

o  leftButtonStateMask
return an integer for masking out the left button from a
buttonStates value

o  middleButtonStateMask
return an integer for masking out the middle button from a
buttonStates value

o  pointerPosition
return the current pointer position in (virtual) root-window coordinates

o  rightButtonStateMask
return an integer for masking out the right button from a
buttonStates value

o  rootPositionOfLastEvent
return the position in root-window coordinates
of the last button, key or pointer event

o  setPointerPosition: newPosition in: aWindowId
change the pointer position to a new position relative to the
given windows origin (which may be the rootWindow).
Be careful with this - its usually not very ergonomically
to change the mousePointer position.
This interface is provided for special applications (presentation
playback) and should not be used in normal applications.

usage example(s):

     Display setPointerPosition:1000@1000

private
o  addSelectionHandler: someone
register someone to be notified when the selection changes

o  findSelectionFetcher: aDrawableId
find the SelectionFetcher that receives selection events for aDrawableId.
Answer nil, if there is none

o  registerSelectionFetcher: aSelectionFetcher
register a SelectionFetcher that receives selection events for aDrawableId

o  removeSelectionHandler: someone
no longer tell someone about selection changes

o  unregisterSelectionFetcher: aSelectionFetcher
unregister a SelectionFetcher that received selection events for aDrawableId

properties
o  deleteProperty: propertyID for: aWindowID
delete a property in the XServer

o  getProperty: propertySymbolOrAtomID from: aWindowOrWindowIDOrNil delete: doDelete
get a property as an association propertyType->propertyValue

usage example(s):

     Display
	getProperty:#'_NET_DESKTOP_NAMES'
	from:nil
	delete:false

     Display
	getProperty:#'_NET_CURRENT_DESKTOP'
	from:nil
	delete:false

     Display
	getProperty:#'_NET_WM_ALLOWED_ACTIONS'
	from:Transcript
	delete:false

     Display
	getProperty:#'_NET_SUPPORTED'
	from:nil
	delete:false

     Transcript showCR:(
	 (Display
	    getProperty:#'_NET_SUPPORTED'
	    from:nil
	    delete:false) value
		    collect:[:eachID | Display atomName:eachID])

o  primGetProperty: propertyAtomID from: aWindowIDOrNil delete: doDelete
get a property as an association propertyType->propertyValue

o  primSetProperty: propertyID type: typeID value: anObject for: aWindowID
set a property in the XServer

o  propertiesOf: aWindowOrWindowIDOrNil
return a collection of all properties' atomIDs of a window.
Returns the rootWindows props for a nil window argument.

usage example(s):

     Display propertiesOf:nil
     Display propertiesOf:Transcript id

     (Display propertiesOf:nil) collect:[:eachID | Display atomName:eachID]
     (Display propertiesOf:Transcript id) collect:[:eachID | Display atomName:eachID]

o  setIcon: anIcon for: aWindowOrWindowID
Display setIcon:0 for:Transcript

o  setProperty: propertySymbolOrAtomID type: typeSymbolOrAtomID value: anObject for: aWindowOrWindowIDOrNil
set a property in the XServer

queries
o  defaultExtentForTopViews
redefined, to define the default extent for the default monitor

o  isOpen
answer true, if device can be used

o  isXineramaActive
Display isXineramaActive

resources
o  atomIDOf: aStringOrSymbol
return an X11 atom's ID.
This is highly X specific and only for local use (with selections).
The default is to create the atom, if it does not exist, in order to
speed up future lookups

usage example(s):

     Display atomIDOf:#'FACE_NAME'
     Display atomIDOf:#'FULL_NAME'
     Display atomIDOf:#DndProtocol
     Display atomIDOf:#DndSelection

o  atomIDOf: aStringOrSymbol create: create
return an Atom's ID, given its name.
If it already exists, return its ID.
If not and the create argument is true, it is created.
Otherwise, nil is returned.
This is highly X specific and only for local use (with selections).

usage example(s):

     Display atomIDOf:#'VT_SELECTION' create:false
     Display atomIDOf:#CLIPBOARD create:false
     Display atomIDOf:'STRING' create:false
     Display atomIDOf:'PRIMARY' create:false
     Display atomIDOf:'blabla' create:false

o  atomName: anAtomID
given an AtomID, return its name.
This is highly X specific and only for local use (with selections).

usage example(s):

     Display atomName:1    'PRIMARY'
     Display atomName:130  '_DEC_DEVICE_FONTNAMES'
     Display atomName:132  'FONTNAME_REGISTRY'
     Display atomName:135 'FOUNDRY'
     Display atomName:150  'CHARSET_REGISTRY'
     Display atomName:151  'ISO8859'
     Display atomName:152 'CHARSET_ENCODING'
     Display atomName:154

o  getResource: name class: cls
access the displays resource database for a default value
of name in a resource class.
This is highly X specific and currently not used.

Notice:
we do not plan to use X's resources for ST/X's defaults,
styles or resources. This would make porting of applications
to different platforms much more difficult (Windows has no resource
database). If you stay within ST/X's resource files, these can be
easily transported to other platforms.

This method is provided for special applications which want to access
existing X resources and are not planned to be ever ported to other
platforms.

o  primAtomIDOf: aStringOrSymbol create: create
return an Atoms ID; if create is true, create it if not already present.
This is highly X specific and only for local use (with selections).

usage example(s):

     Display primAtomIDOf:'VT_SELECTION' create:false
     Display primAtomIDOf:'CUT_BUFFER0' create:false
     Display primAtomIDOf:'STRING' create:false
     Display primAtomIDOf:'PRIMARY' create:false

retrieving pixels
o  getBitsFromId: 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: dummyGCId
return the pixel value at x/y; coordinates start at 0/0 for the upper left.
Nil is returned for invalid coordinates or if any other problem arises.

o  primGetBitsFrom: aDrawableId x: srcx y: srcy width: w height: h into: imageBits infoInto: info
since XGetImage may allocate huge amount of stack space
(some implementations use alloca), this must run with unlimited stack.

selection fetching
o  getClipboardObjectFor: drawableId
get the object selection.
Returns nil, if no selection is available.

Smalltalk puts ST_OBJECT only into the CLIPBOARD

usage example(s):

       Display getClipboardObjectFor:Transcript drawableId

o  getClipboardText: selectionBufferSymbol for: drawableId
get the text selection.
Returns nil, if no selection is available

usage example(s):

       Display getClipboardText:#clipboard for:Transcript drawableId
       Display getClipboardText:#selection for:Transcript drawableId

selection sending
o  selectionBuffer: bufferGetSelector as: aTargetAtomID
convert the current selection to the format defined by aTargetAtom.
Answer an association with the type of converted selection (an atomID)
and the converted selection

o  setClipboardObject: anObject owner: aWindowId
set the object selection, and make aWindowId be the owner.
This can be used by other Smalltalk(X) applications only.
We set only the CLIPBOARD selection

o  setClipboardText: aString owner: aWindowId
set the text selection, and make aWindowId be the owner.
This can be used by any other X application.

We set both the PRIMARY and CLIPBOARD, so that you can paste
into xterm.

o  setPrimaryText: aString owner: aWindowId
set the PRIMARY selection, and make aWindowId be the owner.
This can be used by any other X application when middle-click
pasting. X Window specific.

o  supportedTargetAtoms
answer an integer array containing the list of supported targets
i.e. supported clipboard formats

selections-basic
o  getSelectionOwnerOf: selectionAtomSymbolOrID
get the owner of a selection, aDrawableID.
Answer nil, if there is no owner

o  requestSelection: selectionID type: typeID for: aWindowId intoProperty: propertyID
ask the server to send us the selection - the view with id aWindowID
will later receive a SelectionNotify event for it (once the Xserver replies
with the selections value).

usage example(s):

     Display
	requestSelection:(Display atomIDOf:'PRIMARY')
	property:(Display atomIDOf:'VT_SELECTION')
	type:(Display atomIDOf:'STRING')
	for:Transcript id

usage example(s):

     Display
	requestSelection:(Display atomIDOf:'PRIMARY')
	property:(Display atomIDOf:'VT_SELECTION')
	type:(Display atomIDOf:'C_STRING')
	for:Transcript id

o  sendNotifySelection: selectionID property: propertyID target: targetID time: aTime to: requestorID
send a selectionNotify back from a SelectionRequest.
PropertyID should be the same as requested or nil, if the selection
could not be converted.
TargetId should be the same as requested.
Time should be the time when the selection has been acquired

o  setSelectionOwner: aWindowId of: selectionAtomSymbolOrID time: anIntegerTimestamp
set the owner of a selection; return false if failed

window queries
o  allChildIdsOf: aWindowId
return all children-ids of the given window.
Allows for all windows to be enumerated, if we start at the root.

usage example(s):

     Display allChildIdsOf:(Display rootWindowId)

o  childIdsOf: aWindowId
return all children-ids of the given window. Allows for all windows to be
enumerated, if we start at the root.

usage example(s):

      Display childIdsOf:(Display rootWindowId)

o  realRootWindowId
return the id of the real root window.
This may not be the window you see as background,
since some window managers install a virtual root window on top
of it. Except for very special cases, use #rootWindowId, which takes
care of any virtual root.

usage example(s):

      Display rootWindowId
      Display realRootWindowId

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.

usage example(s):

      Display rootWindowId

window stuff
o  clearRectangleX: x y: y width: width height: height in: aWindowId
clear a rectangular area to viewbackground

o  clearWindow: aWindowId
clear a window to viewbackground

o  configureWindow: aWindowId sibling: siblingId stackMode: modeSymbol
configure stacking operation of aWindowId w.r.t siblingId

o  getGeometryOf: aWindowId
get a windows geometry.
NOTICE: X-WindowManagers usually do wrap client topViews into their own
decoration views (top label, resize boundaries etc.).
Thus, the numbers returned here for topViews are the physical (real) dimensions
relative to such a wrapper.
In contrast, the values found in the view's instance variables are virtual dimensions
(i.e. ST/X makes this decoration view transparent to the program.

usage example(s):

     Transcript topView device
	getGeometryOf:(Transcript id)

usage example(s):

     Transcript topView device
	getGeometryOf:(Transcript topView id)

usage example(s):

     Display
	getGeometryOf:(Display viewIdFromUser)

o  isValidWindowId: aWindowId
return true, if the given window ID is (still) valid.
Especially useful, if the passed windowID is
an alien (external) windows id.

o  lowerWindow: aWindowId
bring a window to back

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
in addition, allow change of extend, position, minExtend and maxExtent.
Needed for restart, to allow recreating a view as iconified,
and to collaps/expand windows.

o  mapWindow: aWindowId
make a window visible

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

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

o  newGraphicsContextFor: aGraphicsMedium
Redefined to use my own device specific graphics context

o  parentWindowIdOf: aWindowId
return a windows parent-window id.
Useful with getGeometryOf:, to compute information about the decoration.

o  raiseWindow: aWindowId
bring a window to front

o  reparentWindow: windowId to: newParentWindowId
change a windows parent (an optional interface)

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

o  setBackingStore: how in: aWindowId
turn on/off backing-store for a window

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

o  setCursor: aCursorId in: aWindowId
define a windows cursor

o  setForegroundWindow: aWindowId
bring a window to front.
Send a specific message to the WindowManager

o  setIconName: aString in: aWindowId
define a windows iconname

o  setSaveUnder: yesOrNo in: aWindowId
turn on/off save-under for a window

o  setTransient: aWindowId for: aMainWindowId
set aWindowId to be a transient of aMainWindow

o  setWindowBackground: aColorIndex in: aWindowId
set the windows background color. This is the color with which
the view is filled whenever exposed. Do not confuse this with
the background drawing color, which is used with opaque drawing.

o  setWindowBackgroundPixmap: aPixmapId in: aWindowId
set the windows background pattern to be a form.
This is the pattern with which the view is filled whenever exposed.
Do not confuse this with the background drawing color, which is used
with opaque drawing.

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

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

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

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

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
define a windows icon and (optional) iconMask.

o  setWindowIconWindow: aView in: aWindowId
define a window to be used as icon

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

o  setWindowName: aString in: aWindowId
define a windows name

o  setWindowPid: anIntegerOrNil in: aWindowId
Sets the _NET_WM_PID property for the window.
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 the windows shape.
Returns false, if the display does not support the
X shape extension.

o  setWindowState: aSymbol in: aWindowId
tell the window type to the window manager.
Send a specific message to the WindowManager

o  setWindowType: aSymbol in: aWindowOrWindowId
Tell the window type to the window manager.
See Extended Window Manager Hints 1.3,
chapter 'Application Window Properties'
http://standards.freedesktop.org/wm-spec/1.3/

It also helps to fix super-annoying problem with window autoraiser
on X11 in a proper way - window manager should manage top-level
window stacking, that's why it is called a 'window manager' :-)

o  unmapWindow: aWindowId
make a window invisible

o  windowIsIconified: aWindowId
return true, if some window is iconified.
The passed windowID may be an alien windows id.


Private classes:

    PseudoDeviceWithoutXFTSupport
    SelectionFetcher
    WindowGroupWindow


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 28 Mar 2024 17:20:32 GMT