04.04.2013 Views

Volume One: Xlib Programming Manual - Niksula

Volume One: Xlib Programming Manual - Niksula

Volume One: Xlib Programming Manual - Niksula

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

About This <strong>Manual</strong><br />

This manual describes the X library, the C Language programming interface to Version 11 of the X Window System. The<br />

X library, known as <strong>Xlib</strong>, is the lowest level of programming interface to X. This library enables a programmer to write<br />

applications with an advanced user interface based on windows on the screen, with complete network transparency, that<br />

will run without changes on many types of workstations and personal computers.<br />

<strong>Xlib</strong> is powerful enough to write effective applications without additional programming tools and is necessary for certain<br />

tasks even in applications written with higher−level "toolkits."<br />

There are a number of these toolkits for X programming, the most notable being the DEC/MIT toolkit Xt, the Andrew<br />

toolkit developed by IBM and Carnegie−Mellon University, and the InterViews toolkit from Stanford. These toolkits are<br />

still evolving, and only Xt is currently part of the X standard. Toolkits simplify the process of application writing<br />

considerably, providing a number of widgets that implement menus, command buttons, and other common features of the<br />

user interface.<br />

This manual does not describe Xt or any other toolkit. That is done in <strong>Volume</strong>s Four and Five of our X Window System<br />

series. Nonetheless, much of the material described in this book is helpful for understanding and using the toolkits, since<br />

the toolkits themselves are written using <strong>Xlib</strong> and allow <strong>Xlib</strong> code to be intermingled with toolkit code.<br />

Summary of Contents<br />

This manual is divided into two volumes. This is the first volume, the <strong>Xlib</strong> <strong>Programming</strong> <strong>Manual</strong>. It provides a<br />

conceptual introduction to <strong>Xlib</strong>, including tutorial material and numerous programming examples. Arranged by task or<br />

topic, each chapter brings together a group of <strong>Xlib</strong> functions, describes the conceptual foundation they are based on, and<br />

illustrates how they are most often used in writing applications (or, in the case of the last chapter, in writing window<br />

managers). <strong>Volume</strong> <strong>One</strong> is structured so as to be useful as a tutorial and also as a task−oriented reference.<br />

The second volume, the <strong>Xlib</strong> Reference <strong>Manual</strong>, includes reference pages for each of the <strong>Xlib</strong> functions, organized<br />

alphabetically for ease of reference; a permuted index; and numerous appendices and quick reference aids.<br />

<strong>Volume</strong> <strong>One</strong> and <strong>Volume</strong> Two are designed to be used together. To get the most out of the examples in <strong>Volume</strong> <strong>One</strong>, you<br />

will need the exact calling sequences of each function from <strong>Volume</strong> Two. To understand fully how to use each of the<br />

functions described in <strong>Volume</strong> Two, all but the most experienced X "hacker" will need the explanation and examples in<br />

<strong>Volume</strong> <strong>One</strong>.<br />

Both volumes include material from the original <strong>Xlib</strong> and X11 protocol documentation provided by MIT, as well as from<br />

other documents provided on the MIT release tape. We have done our best to incorporate all of the useful information<br />

from the MIT documentation, to correct code references we found to be in error, to reorganize and present it in a more<br />

useful form, and to supplement it with conceptual material, tutorials, reference aids, and examples. In other words, this<br />

manual is not only a replacement but is a superset of the MIT documentation.<br />

Those of you familiar with the MIT documentation will recognize that each reference page in <strong>Volume</strong> Two includes the<br />

detailed description of the routine found in Gettys, Newman, and Scheifler’s <strong>Xlib</strong>−C Language X Interface, plus, in many<br />

cases, additional text that clarifies ambiguities and describes the context in which the routine would be used. We have also<br />

added cross references to related reference pages and to where additional information can be found in <strong>Volume</strong> <strong>One</strong>.<br />

How to Use This <strong>Manual</strong><br />

<strong>Volume</strong> <strong>One</strong> is intended as an introduction to all the basic concepts of X programming and also as a useful reference for<br />

many of the most common programming techniques. It is divided into 14 chapters, which describe and demonstrate the use<br />

of the X programming library, and numerous appendices.<br />

You will find it necessary to read at least Chapters 1, 2, and 3 before attempting to program with the X library. Chapter 1,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!