How to Use This Manual

Volume One is intended as an introduction to all the basic concepts of X programming and also as a useful reference for many of the most common programming techniques. It is divided into 14 chapters, which describe and demonstrate the use of the X programming library, and numerous appendices.

You will find it necessary to read at least Chapter 1, Chapter 2, and Chapter 3 before attempting to program with the X library. Chapter 1, provides a discussion of the context in which X programs operate. Chapter 2, describes the conceptual foundations underlying X programming. Chapter 3, presents a simple program.

Chapter 4 through Chapter 9 (Window Attributes, The Graphics Context, Drawing Graphics and Text, Color, Events, and The Keyboard and Pointer) discuss various programming techniques that are used in all X programs. These chapters can be read as a tutorial and consulted for reference later.

Chapter 10, and Chapter 11 describe the Xlib features for making an application usable in any language without changes to the application binary. These features were added in Release 5.

Chapter 12, is a description of communication between applications and between applications and the window manager, including properties and selections.

Chapter 13, describes the facilities provided for database management, parsing the command line, and managing user preferences. Xlib calls this the resource manager.

Chapter 14, provides an example of a complete application. This chapter is especially useful in demonstrating managing user preferences with the resource manager.

Chapter 15, describes programming techniques that will be useful to some but not all programs. It should be scanned for applicable techniques and read in detail when needed for a particular project.

Chapter 16, describes what window managers do and how they work. This information should provide a more complete knowledge of the variety of contexts in which X applications may function. It also describes the Xlib functions that are intended primarily for window management. A simple window manager program is described.

Appendix A, describes how the programmer should specify default font names.

Appendix B, describes the routines supported in X11 for compatibility with X Version 10.

Appendix C, is a guide to writing extensions to X. This is for experienced X programmers only. It is provided so that this manual can serve as a complete replacement for the MIT Xlib documentation.

Appendix D, presents the complete code for basecalc, the complete application described in Chapter 12, A Complete Application.

Appendix E, describes each event type in a reference page format. Included is how to select the events, when they are generated, the contents of the event structures, and notes on how to use them. This information is vital in using the numerous events.

Appendix F, describes the routines in this miscellaneous utilities library that are useful in Xlib programming. This library is not an X Consortium standard but is widely available.

Appendix G, lists where to get the X software, companies that offer training in X programming, and descriptions of additional published books on the subject.

Appendix H, describes the changes between Releases 3, 4 and 5. This manual describes Release 4 and Release 5.

The Glossary gives you somewhere to turn should you run across a term with which you are unfamiliar. Some care has been taken to see that all terms are defined where they are first used in the text, but this assumes a sequential reading of the manual.

Volume Two consists of a permuted index, reference pages to each library function, and appendices that cover macros, structures, function groups, events, fonts, colors, cursors, keysyms, and errors. Finally, Volume Two concludes with at-a-glance charts that help in setting the graphics context (GC) and the window attributes. This volume should be consulted to obtain the specifics of calling each Xlib function.

Get XLIB Programming Manual, Rel. 5, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.