ICI Modules: X


Modules by name : by type

Overview

The X module provides access to Xlib, the X11 library. The module provides sufficient functionality for the creation of realistic applications and is easily extended to add missing functionality. Numerous types are created that map to the Xlib counterpart and all important Xlib functions are provided. Macros provided in the X11 header files are provided as functions in the module.

The X module is an interface to Xlib. It provides many of the types and functions actually used in writing X11 programs and has been used to write simple applications, a toolkit and a window manager. It is not yet a complete binding to Xlib but does provide a usable base which can be easily extended and enhanced.

The module is essentially a mapping of Xlib into ICI with conversion of structured types and practices as appropriate to ICI. No attempt is made to abstract the Xlib programming interface and the same principles applied during C development of Xlib programs apply for ICI Xlib programs. The same techniques apply although ICI's structured types allow for simpler approaches the many implementation problems.

The module uses the same name used in Xlib with the removal of the "X" prefix replacing it with the ICI module reference, "X.". The argument lists of functions have been retained where possible with changes as appropriate to the ICI environment. X11 structures such as events and window attributes are stored in ICI struct objects and sets of strings may be used as flags rather than bitsets (which may also be used however). ICI X11 programs are quite similar to their C counterparts when dealing with X11 however much of the remaining program is simpler or more adaptable to the ICI environment.

The large number of constants used in X11 programming are defined as elements of the X module. The complete list of names is too long for inclusion in a short note such as this and the reader is directed to the source code (the file "vars.c" to be precise).

The functions defined the module may be split into a number of function groups according to the area of X11 or Xlib to which they relate. A summary of the module functions follows.

Atoms

Colors

	color = Color(string)
	color = Color(int, int, int)
	    Return a color given a name or an RGB triplet.

	struct = LookupColor(display, colormap, string)
	    Returns a struct containing two colors with
	    the keys "screen" and "exact".

	color = AllocColor(display, colormap, color)

	struct = AllocNamedColor(display, colormap, string)

	color = ParseColor(display, colormap, string)

	colormap = DefaultColormap(display, int)
	    Return the default colormap associated with
	    the numbered screen on the display.

Cursors

Initialisation, Defaults and Control

Events

Fonts

Graphics

Window Manager Interaction

Windows