### 2 Workstation Names

2.1 GKS Names
2.2 IDI Names
2.3 GWM windows

#### 2.1 GKS Names

A GKS workstation name is a character string that represents a graphics device that may be opened and manipulated using GKS. The simplest way to get a list of valid workstation names is to run the demonstration program (section 2.4). When you supply a workstation name to a program that uses GNS (either directly or indirectly via a high level graphics package) you can abbreviate the name provided that the abbreviation is not ambiguous. You can also supply a environment variable that translates to a workstation name; this can be used to create “nicknames” for devices that you use frequently.

Each workstation name identifies a device type and may also identify a particular device (or file). For example, the workstation name cifer_t5 might translate to 801 (the GKS workstation type for a Cifer T5 terminal), while ps_l might translate to 2700 and gks74.ps (the GKS workstation type and the usual file name of a landscape orientation PostScript printer file).

If a name translates to just a workstation type then a “default” device is used. All device types have a default device name associated with them, and this is most important for terminals where the default is the terminal from which the program is being run. In this case the default device name depends on which terminal is being used.

The device name implied by a workstation name can be overridden by appending a semicolon followed by a new device or file name to the workstation name. For example, the name ps_l;plot.ps would use plot.ps instead of gks74.ps.

If an explicit device name is supplied there are no checks made to ensure that the device is the right type; attempting to use the wrong type will either cause the attempt to open the GKS workstation to fail or garbage to be sent to the device.

An application program can also override the device name implied by a workstation name; if it does, the program’s documentation should make this clear. An application cannot override a device name which is supplied explicitly as part of a workstation name.

It is also possible to specify an explicit GKS device type and connection identifier as a pair of integers separated by a comma, space or underscore. If the connection identifier is omitted, it defaults to zero.

Finally, a workstation name can be an environment variable that translates to a valid workstation name (which can be another environment variable). Any explicit device name is removed before the translation is attempted and the first device name encountered is the one that is used; any subsequent device names are ignored. Environment variable translation continues recursively until either no translation is found or the resulting name begins with “GKS_”.

#### 2.2 IDI Names

An IDI workstation (or device) name is simply a character string (for example, xwindows) which identifies an image display and its type. The default device name can be overridden by appending a semicolon followed by the new device name after the workstation name. Environment variables can be set up and translation proceeds recursively until a name is found that does not translate to another name.

#### 2.3 GWM windows

There are some special features of GNS that apply to GWM window devices; these are X window display devices under the control of the Graphics Window Manager (SUN/130). All GWM windows have a name (usually displayed in the title bar) which need not be the same as the workstation name supplied at a prompt or as an argument to a routine such as GNS_TNG. This window name is the one that is supplied as an argument to the xmake or xdestroy commands. When a GWM window is accessed through GNS (for both GKS and IDI) the supplied workstation name is translated into a GWM window with a default name. For instance the workstation name "xwindows" usually translates into a window named "xwindows". Note that the GKS workstation name "xoverlay" also translates into a window named "xwindows" because the overlay device is part of the same GWM window.

Both GKS and IDI will create a new GWM window with the default name if one does not already exist. The default window name can be overridden by using the device name field of the workstation name. The device name field is separated from the workstation name by a semi-colon; thus the string ‘xw;bert’ is parsed into the workstation name ‘xw’ and the device name ‘bert’. The device name supersedes the default and so a window named ‘bert’ is used rather than one named ‘xwindows’

By default a GWM window created by a GKS or IDI graphics application will not have an overlay plane unless the overlay option is specified in the X defaults file (see SUN/130) . The user can request that a window is created with an overlay plane by appending a ‘+’ to the name when prompted for it. Thus the workstation name ‘xwindows+’ or ‘xw+’ will result in a GWM window with an overlay. Note that when using GKS specifying ‘xw+’ will create a window with an overlay, but the drawing will be done in the base plane (specifying ‘xoverlay’ automatically results in a window with an overlay).

#### 2.4 Demonstration Program

A complete list of all the GKS workstation names defined on your current node can be obtained by running the program \$STARLINK_DIR/share/examples/gnsrun_gks. After listing all the GKS names along with a short description of each workstation, the program prompts for a workstation name. If one of the names in the list (or any other valid workstation name) is entered, a simple demonstration picture is plotted on the device selected.

A similar program called gnsrun_idi will also be available if the IDI library has been installed on the system.

If running either program produces any unexpected error messages you should report them to your system manager; however, you should not necessarily expect all workstations on the lists to be useable. A device could, for example, be in use by someone else.