Appendix A: Global Configuration Resources

There are a small number of drawing features that can't be said to belong to any particular object in a GLG drawing. When a drawing is presented within the GLG Graphics Builder, those drawing features, such as the file save format, are managed by the Builder. When a drawing is presented in an application program, that program must assume the responsibility of managing those features. Rather than include more functions in the GLG API, the Toolkit provides configuration resources to control these features that can be queried and modified with the same resource access functions you use to control any other feature of a drawing.

The path name of a configuration resource starts with $config followed by the configuration resource name. For example, $config/GlgSaveFormat is the name of the configuration parameter that controls the default save format.

The GLG configuration file may be used to set global configuration resources for the GLG Graphics Builder, and the GLG Programming API may be used to set these global resources in a program.

The configuration resources, their types and possible values, are listed in the following table. The table also lists environment variables which can be used as an alternative way of setting some global configuration resources for quick testing, or for the cases when the application code can not be accessed. The environment variables settings do not apply to the Java version of the Toolkit.

GLG Toolkit Configuration Resources
 

Name

Type

Default

Description (possible values)

GlgGridPolygon

polygon object

solid black line, one pixel wide

Defines grid attributes such as line width and color (the grid spacing is controlled by an attribute of the viewport screen object). The polygon is not accessed directly, but its attributes are, for example: $config/GlgGridPolygon/LineWidth

GlgArrowShape

polygon object

default arrow shape as seen in the Graphics Builder

3-point polygon defining the pixel dimensions and shape of the arrowheads drawn by the rendering object. To change the arrowheads, change the coordinates of the polygon's points.

GlgPickResolution

Double

5

Defines pick resolution for user input. When the mouse is within this many pixels of a point, it is considered to be on that point.

GlgSaveFormat

String

"ascii"

Defines a default save format ("binary", "ascii" or "extended")

GlgCompressFormat

String

"uncompressed"

Enables saved drawing compression ("compressed" or "uncompressed")

GlgPSLevel

Double

2

The level of the PostScript output (1 or 2)

GlgSearchPath

(C/C++ and ActiveX only)

 

String

GLG_PATH

env. var. or

NULL

The search path used to resolve not found relative file names. May be changed from a program.

GlgButtonTooltipTimeout

Double

0.5

The button tooltip timeout in seconds

GlgMouseTooltipTimeout

Double

0.5

The object mouse over tooltip timeout in seconds

GlgIHArray

group object

an array holding default GLG interaction handlers

The array of GLG Interaction Handlers (GlgButton, GlgSlider, etc.) used to resolve interaction handlers names. It may be used by a program to add custom interaction handlers.

GlgSwingUsage

(Java only)

Double

0

Controls the component set for the Java version of the Toolkit. If the value is 0, faster AWT components are used. If the value is 1, Swing components are used. Swing components may be used when lightweight components are required by JDesktopPane and JInternalFrame, and also when the Swing version of input objects (buttons and sliders) are wanted.

GlgAntiAliasing

Double

GLG_ANTI_
ALIASING_INT

Controls the use of antialiasing of the OpenGL renderer. The value of 1 to enables anti-aliasing for the Java version of the Toolkit. For all other environments, the following values are supported:

GLG_ANTI_ALIASING_OFF - disables antialiasing.

GLG_ANTI_ALIASING_INT - enables antialiasing and maps vertices to integer pixel boundaries.

GLG_ANTI_ALIASING_DBL - enables antialiasing and uses double vertex coordinates.

Alternatively for non-Java environments, the antialiasing may be disabled by setting the GLG_ANTI_ALIASING environment variable to False.

GlgOpenGLMode

(C/C++ and ActiveX only)

 

Double

1

Controls the use of the OpenGL renderer. If set to True, the OpenGL renderer is used for the viewports with OpenGLHint=ON if the OpenGL renderer is available. Setting the resource to False suppresses the use of the OpenGL renderer.

Alternatively, the OpenGL renderer may be enabled or disabled by setting the GLG_OPENGL_MODE environment variable to True or False, as well as using the -glg-enable-opengl and -glg-disable-opengl command-line options.

GlgMapServerUsage (C/C++ and ActiveX only)

Double

0

Controls the use of Map Server in C/C++ and ActiveX versions of GLG and may have one of the following values defined in the GlgApi.h file:

GLG_LOCAL_MAP_SERVER - uses the Map Server from the GLG library .

GLG_REMOTE_MAP_SERVER - uses the Map Server from a web server defined by the GISMapServerURL attribute of the GIS object.

GLG_AUTO_MAP_SERVER (default) - if the drawing was loaded from a URL, use a remote Map Server, otherwise use a local Map Server.

May also be defined by setting GLG_MAP_SERVER_USAGE environment variable to the "auto", "local" or "remote" values.

GlgDefaultNumFontTypes

Double

12

Defines NumTypes attribute of the default font table. May also be defined by setting GLG_DEFAULT_NUM_FONT_TYPES environment variable to the desired integer value.

GlgDefaultNumFontSizes

Double

7

Defines NumSizes attribute of the default font table. May also be defined by setting GLG_DEFAULT_NUM_FONT_SIZES environment variable to the desired integer value.

GlgDefaultFontFile

String

NULL

Specifies name of the file that contains a list of font names for the default font table. Each font in the file is listed on a separate line. May also be defined by setting GLG_DEFAULT_FONT_FILE_NAME environment variable.

GlgDefaultPSFont
File

String

NULL

Specifies name of the file that contains a list of PostScript font names for the default font table. May also be defined by setting GLG_DEFAULT_PS_FONT_FILE_NAME environment variable.

GlgFontCharset (C/C++ and ActiveX on
Windows only)

Double

0

Defines a charset to use for fonts with DEFAULT_CHARSET, providing a simple way to change the charset of all fonts in the default font table. May also be defined by setting GLG_FONT_CHARSET environment variable to the integer value of the desired font charset.

GlgMultibyteFlag (C/C++ and ActiveX only)

Double

0

Defines the value of the multi-byte flag to use for fonts with DEFAULT_CHARSET, providing a simple way to change the multi-byte flag setting for all fonts in the default font table. May also be defined by setting GLG_MULTIBYTE_FLAG environment variable to the "SINGLE_BYTE", "MULTI_BYTE" or "UTF8" values.

GlgDefaultColor
TableType

Double

1

Defines type of the default color table: RAINBOW (value of 1) or STANDARD (value of 2). May also be defined by setting GLG_DEFAULT_COLOR_TABLE_TYPE environment variable to the "rainbow" or "standard" values.

GlgDefaultColor
Factor

Double

19

Defines ColorFactor of the default color table. May also be defined by setting GLG_DEFAULT_COLOR_FACTOR environment variable to the desired integer value.

GlgDefaultNum
ColorGrades

Double

1

Defines GradeHint of the default color table. May also be defined by setting GLG_DEFAULT_NUM_COLOR_GRADES environment variable to the desired integer value.

GlgDefaultDialog
Color
(C/C++ on Unix and Java only)

G - holds 3 RGB color values

(-1;-1;-1)

Specifies default fill color for the dialog area widget type. If it is set to (-1;-1;-1), the FillColor of the dialog widget is used when the widget is displayed.

GlgCompatibility
Mode

Double

GLG_LATEST_RELEASE constant

Specifies compatibility mode. For example, when it is set to the GLG_PRE_2_9 constant, the release 2.9 changes which affect code compatibility with the older versions will be disabled. This resource may also be defined by setting GLG_COMPATIBILITY_MODE environment variable to the integer value corresponding to the desired constant.

 

When accessing configuration parameters from a remote client application, both the client's and the server's configuration parameters may be accessed. If the first argument of the resource querying or setting functions is a link ID, the function refers to the server's configuration resources. If the argument is an object ID, or is NULL, the function refers to the client's configuration resources.

When configuration parameters are accessed from the server side, the first parameter of the resource querying or setting functions may be NULL. You cannot access a client's configuration resources from a remote server, since they are interpreted as the client's configuration resource setting.