12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 1Introduction to <strong>Xlib</strong>The X Window System is a network-transparent window system that was designed at MIT. Xdisplay servers run on computers with either monochrome or color bitmap display hardware. Theserver distributes user input to and accepts output requests from various client programs locatedeither on the same machine or elsewhere in the network. <strong>Xlib</strong> is a C subroutine library that applicationprograms (clients) use to interface with the window system by means of a stream connection.Although aclient usually runs on the same machine as the X server it is talking to, this neednot be the case.<strong>Xlib</strong> − C <strong>Language</strong> X <strong>Interface</strong> is a reference guide to the low-level Clanguage interface to the XWindow System protocol. It is neither a tutorial nor a user’s guide to programming the X WindowSystem. Rather, itprovides a detailed description of each function in the library as well as adiscussion of the related background information. <strong>Xlib</strong> − C <strong>Language</strong> X <strong>Interface</strong> assumes abasic understanding of a graphics window system and of the C programming language. Otherhigher-level abstractions (for example, those provided by the toolkits for X) are built on top of the<strong>Xlib</strong> library. For further information about these higher-level libraries, see the appropriate toolkitdocumentation. The XWindow System Protocol provides the definitive word on the behavior ofX. Although additional information appears here, the protocol document is the ruling document.To provide an introduction to X programming, this chapter discusses:• Overview ofthe X Window System• Errors• Standard header files• Generic values and types• Naming and argument conventions within <strong>Xlib</strong>• Programming considerations• Character sets and encodings• Formatting conventions1.1. Overview of the X Window SystemSome of the terms used in this book are unique to X, and other terms that are common to otherwindow systems have different meanings in X. Youmay find it helpful to refer to the glossary,which is located at the end of the book.The X Window System supports one or more screens containing overlapping windows or subwindows.A screen is a physical monitor and hardware that can be color, grayscale, or monochrome.There can be multiple screens for each display or workstation. A single X server can provide displayservices for any number of screens. Aset of screens for a single user with one keyboard andone pointer (usually a mouse) is called a display.All the windows in an X server are arranged in strict hierarchies. At the top of each hierarchy isaroot window, which covers each of the display screens. Each root window ispartially or completelycovered by child windows. All windows, except for root windows, have parents. There isusually at least one window for each application program. Child windows may in turn have their1

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

Saved successfully!

Ooh no, something went wrong!