Charles Sturt University AussieMOO


Introduction to the X-window interface


X History

A Massachusetts Institute of Technology (MIT) development team formed Project Athena in conjunction with people from DEC and IBM, during the mid to late eighties (1984-1988). The aim was to develop a hardware and vendor-independent operating environment that could provide a network of graphical workstations as teaching aids: the X window system.

MIT holds the rights to X, but gives it away free. The X consortium refer to X as: X Window System or X Window or X11 or just plain X

X11 refers to the version 11 of which the latest release is Release 7. At its basic level X can be described simply as a C graphics library.

A window is an area of the screen allocated to a given application program.

The X-window system is widely available on every UNIX platform. X is a client/server architecture. The X server is the program that controls the display capability and may be found on the host or the local machine. This may seem to be the reverse to the normal client/server model. The following notes may help to explain.

UNIX Workstations

UNIX workstations can range from high performances machines manaufactured by companies such as DIGITAL, HEWLETT-PACKARD, SUN and SILICON GRAPHICS to your own personal computer with network access. A Microsoft Windows or Apple Macintosh machine can use terminal emulation software to act as a UNIX workstation and X terminal. Micro-X for Windows and MacX for Macintosh are two examples of popular X emulation software for personal computers. An Acorn RISC computer running UNIX, can be used as a low cost UNIX workstation.

X Architecture: Are you being served?

An X server and Client software interaction description using golum and an X-terminal emulation. X client programs communicate with the X server using the X network protocol and sends TWO kinds of messages:

The X server on the local machine accepts requests over an ethernet connection from X client 1 running on the remote host called golum, and from X client 2 running locally to provide the display the needed resources. It is after all, the display screen that is being served as the clients require a bit-mapped output.

Users view: X window architecture

Window Manager controls the look and feel of the GUI window system and is normally found running locally, but like all X clients, it can run on the local or the remote machine.

Other GUI systems can be added to the X-window environment such as Motif which has its own window manager.

Programmers view: X software architecture

The software structure of X is multi-layered from the programmers view:

	| Toolkit	|Intrinsic library	Widget set	|
	| layers	|					|
	|		|			Xlib		|
	-----------------------------------------------------
	| X server	|	X network protocol library	|
	| layers	|					|
	|		|		Base X software	|
The X server layer is at the base and contains the base X software and the X network protocol library. Built on top of this layer is the programmers Toolkit layer. The Toolkit is a high-level programming library used to develop the many X applications such as mosaic, dxmail. The Toolkit contains the standard Xlib runtime library, the Intrinsics Library of object-oriented routines and a collection of widget routines called the widget set.

The widget is a routine that implements an interface entity such as a push button, a scroll bar, an editing window or a pop-up menu. The widget set is used by programmers to build a GUI such as Motif or Open Look.

X-window applications

Certain access privileges may be required to use some X applications software on golum, but the following alphabetical list provides a range of common X software types. The X clients which start with 'd' are produced by the Digital company.

X Application		Program type

dxmail			mail program 
dxnotepad		text editor
dxpaint			paint program
ghostview		PostScript viewer (with demo files)
mosaic			WWW hypermedia browser
netscape		WWW hypermedia browser
SimCity			Simulation game (5 minute demo only)
xclock			Clock tool
xedit			text editor
xfig			object drawing program
xmh			mail program
xv			image viewer (JPEG, GIF files etc)

X-window Practical Exercises

You need to connect to your golum account using the MicroX terminal emulator

Exercise 1

Choose any TWO (2) of the following activities:

dxpaint			create and save a paint document
netscape		view and save a HTML document
dxnotepad		create and save a text file
xv			view a JPEG or GIF file

Exercise 2

Exercise 3

Choose ONE (1) of the following activities:

Conclusion

The shell game

There are many commands available in UNIX which makes it a versatile programming environment in Pascal and C. The command lanaguage interpreter is often called the shell and can be also for programming. Since the shell can read commands from a file, the user can write their shell scripts and customise the range of commands and ultimately, their interface to UNIX. There are two common shells in UNIX:

Usually however, systems programmers are the users who have to write shell scripts to help maintain the system that is running UNIX. Others UNIX developers may prefer to write GUI applications to run under the X-window interface.

The widget game

In contrast to programming in Pascal, C or the UNIX shell, GUI programmers can use the programming tools of the X-window system, to develop interesting software applications. It is possible to program at several different levels starting with C and low-level libraries and going up to simple, but powerful scripting systems like tk-tcl (often pronounced tk tickle).

RETURN to the UNIX Practical

References

  1. UNIXhelp for Users. [Online]. Available WWW at http://www.cit.gu.edu.au/services/UNIXhelp/
  2. Berlage, T. (1991). OSF/Motif: Concepts and Programming. Addison-Wesley, Wokingham, England.
  3. Christian, K. and Richter, S. (1994). The UNIX operating system. 3rd Ed. Wiley. New York.
  4. Johnson, E.F. and Reichard, K. (1991). Advanced X window Applications Programming. MIS Press. Portland.
  5. Kay, D.C. and Levine, J.R. (1992). Graphics File Formats. Windcrest/McGraw-Hill. USA.
  6. Poole, P.C. & Poole, N. (1991). Using UNIX by Example. Addison-Wesley. Sydney
  7. Stallings, W (1992). Operating Systems. Macmillan. New York.

Note

Digital Press and O'Reilly books also have many good references covering the X-window environment.

Compiled by Ken Eustace, 1996


Back to Main