Covering X11 Release 5, the Xlib Programming Manual is a complete guide to programming the X library (Xlib), the lowest level of programming interface to X. It includes introductions to internationalization, device-independent color, font service, and scalable fonts.
Includes chapters on:
X Window System concepts
A simple client application
Window attributes
The graphics context
Graphics in practice
Color
Events
Interclient communication
Internationalization
The Resource Manager
A complete client application
Window management
This manual is a companion to Volume 2, Xlib Reference Manual.
Chapter 1 Introduction
1.1 Versions of X
1.2 X Window System Concepts
1.3 X Window System Software Architecture
1.4 Overview of Xlib
Chapter 2 X Concepts
2.1 How Xlib Works
2.2 What are X Windows?
2.3 Introduction to X Graphics
2.4 More on Window Characteristics
2.5 Introduction to Events
2.6 How to Program with Xlib
Chapter 3 Basic Window Program
3.1 Running the Program
3.2 The Main of basicwin
Chapter 4 Window Attributes
4.1 Setting Window Attributes
4.2 The Window Attribute Structures
4.3 Settable Attributes
4.4 Information from the XWindowAttributes Structure
Chapter 5 The Graphics Context
5.1 Creating and Setting a Graphics Context
5.2 Switching Between Graphics Contexts
5.3 Controlling Pixel Selection
5.4 Controlling Coloring and Patterning
5.5 Controlling Graphics Tricks
5.6 Graphics Exposure
5.7 Subwindow Mode
5.8 Sharing GCs Between Clients
5.9 GCs and Server Efficiency
5.10 Querying the Graphics Context
5.11 The Default GC Versus Default Values of a GC
Chapter 6 Drawing Graphics and Text
6.1 Drawing
6.2 Fonts and Text
6.3 Regions
6.4 Images
6.5 Cursors
Chapter 7 Color
7.1 Basic Color Terms and Concepts
7.2 Color Naming and Specification
7.3 Differences in Display Hardware
7.4 Allocating Shared Colors
7.5 Allocating Private Colors
7.6 Getting Complete Visual Information
7.7 The GrayScale Visual
7.8 Standard Colormaps
7.9 Device-independent Color and Xcms
7.10 Creating and Installing Colormaps
7.11 Miscellaneous Color-handling Functions
Chapter 8 Events
8.1 Overview of Event Handling
8.2 Event Processing
8.3 Selecting Events
8.4 Sending Events
8.5 Where to Find More on Each Event
Chapter 9 The Keyboard and Pointer
9.1 The Keyboard
9.2 The Pointer
9.3 Border Crossing and Keyboard Focus Change Events
9.4 Grabbing the Keyboard and Pointer
9.5 Keyboard Preferences
9.6 Pointer Preferences
9.7 X Input Extension
Chapter 10 Internationalization
10.1 An Overview of Internationalization
10.2 Locale Management in X
10.3 Internationalized Text Output in X
10.4 String Encoding Changes for Internationalization
10.5 Internationalized Interclient Communication
10.6 Localization of Resource Databases
10.7 Summary: Writing an Internationalized Application
Chapter 11 Internationalized Text Input
11.1 Issues of Internationalized Text Input
11.2 Overview of the X Input Method Architecture
11.3 XIM Programming Interface
11.4 XIM Functions
11.5 XIC Functions
11.6 Input Context Attributes
11.7 Negotiating Preedit and Status Area Geometries
11.8 Geometry, Preedit, and Status Callbacks
11.9 Filtering Events
11.10 Getting Composed Text
11.11 XIM Programming Checklist
Chapter 12 Interclient Communication
12.1 Properties and Atoms
12.2 The Compound Text Encoding
12.3 Communicating with the Window Manager
12.4 Selections
12.5 Cut Buffers
Chapter 13 Managing User Preferences
13.1 Using XGetDefault()
13.2 Using the Low-level Resource Manager Routines
13.3 Standard Geometry
13.4 Resource Specification and Matching
13.5 Other Resource Manager Routines
Chapter 14 A Complete Application
14.1 Description of basecalc
14.2 Include Files
14.3 The Main of basecalc
14.4 Getting User Preferences
14.5 Printing a Usage Message
14.6 Initializing the Calculator
14.7 Making Windows
14.8 Selecting Events
14.9 Processing Events
14.10 Drawing a Pad
14.11 Routines Not Shown
Chapter 15 Other Programming Techniques
15.1 Reading and Writing Properties
15.2 Screen Saver
15.3 Host Access and Security
15.4 Getting the Window Hierarchy
15.5 Close Down Mode
15.6 Connection Close Operations
15.7 Data Management
15.8 The After Function
15.9 Coordinate Transformation
15.10 ANSI-C and POSIX Portability
15.11 Porting Programs to X
15.12 Programming for Multiple X Releases
15.13 Using Extensions to X
Chapter 16 Window Management
16.1 Layout Policy
16.2 Substructure Redirection
16.3 Reparenting
16.4 Window Save-set
16.5 Window Manager - Client Communications
16.6 Window Management Functions
16.7 A Basic Window Manager
Appendix Specifying Fonts
A.1 Font Specification
A.2 Font Service
A.3 Scalable Fonts
Appendix X10 Compatibility
B.1 XDraw and XDrawFilled()
B.2 Association Tables
Appendix Writing Extensions to XThis appendix is lightly edited and reformatted from the original MIT material. Before attempting to write extensions, you should be intimately familiar with the X Window System Protocol, Version 11, by Robert Scheifler and Ron Newman, and with the server code.Unfortunately, this appendix does not currently provide sufficient tutorial or contextual information to allow you to build an extension. We intend to provide a more helpful description of how to write extensions in a forthcoming book about the server. In the meantime, several sample extensions are provided with the X core distribution which can be used as examples.
Adrian Nye is the author or editor of several volumes in the X Window System Series from O'Reilly & Associates. Adrian has worked as a programmer writing educational software in C and as a mechanical engineer designing offshore oil spill cleanup equipment. He has interests in the environment and the impact of people and technology. He graduated from the Massachusetts Institute of Technology in 1984 with a B.S. in mechanical engineering.
Comments about oreilly XLIB Programming Manual, Rel. 5, Third Edition:
I wasn't going to write a review, but I noticed that the previous reviewer insisted that the code examples don't work on X11R6. I can assure that although this might have been the case at one time, it's no longer true - I'm reading through the book, typing out all of the code examples on my Linux workstation which is running XFree86 4.3.0 and so far all of the code examples have worked exactly as advertised.
I am inclined to agree that some indicator as to which lines changed between one example and the next would be nice, but I wouldn't go so far as to say this series sucks eggs. I'm actually enjoying the book (I'm six chapters in), but I'm learning X because I'm curious, not because I honestly think I'll ever do any significant programming in it (I mean, honestly, who really uses X at the Xlib level?)
8/1/2001
4.0
Volume 1: Xlib Programming Manual Review
By David Gómez
from Undisclosed
Comments about oreilly XLIB Programming Manual, Rel. 5, Third Edition:
This is the book everyone should have, if they have any hopes to do something useful with the XLib. But you have to practice a lot, don't use the samples of the book and write your own. Once you have read book, you always will need it besides your computer. And the people that says that this it a bad book are plain wrong. This book is excellent, what really is awful is the X Window System, but if you have to program with it, you need this one.