X Window System

C Library and Protocol Reference

James Gettys, Robert W. Scheifler, Ron Newman

Publisher: Digital Press, 1988, 701 pages

ISBN: 1-55558-012-2

Keywords: Programming, Graphics

Last modified: April 23, 2021, 11:28 a.m.

Written by the people who designed and created the X Window System™, this book is the essential reference tool for its use. The book opens with an informative introduction to the system. Part I is the reference manual to the C Language X Interface Library, or XLib for short. It presents an overview of the system, explains how to create and manipulate windows, gives an in-depth look at graphics capabilities, and explains events, event-handling functions, and a variety of utility functions.

Part II is a detailed specification of the X protocol semantics with an appendix defining the precise encoding. It is independent of any one programming language and can be used as a starting point for creating interface libraries for other programming languages. Instructive diagrams and a comprehensive technical index add to the book's usefulness.

  • Part I: XLIB — C Library X Interface
    1.  Introducion to Xlib
      1. Overview of the X Window System
      2. Errors
      3. Naming and Argument Conventions within Xlib
      4. Programming Considerations
      5. Conventions Used in Xlib — C Language Interface
    2. Display Functions
      1. Opening the Dispplay
      2. Obtaining Information about the Display, Image Formats, or Screens
        1. Display Macros
        2. Image Formats Macros
        3. Screen Information Macros
      3. Generating a NoOperation Protocol Request
      4. Freeing Client-Created Data
      5. Closing the Display
      6. X Server Connection Close Operations
    3. Window Functions
      1. Visual Types
      2. Window Attributes
        1. Background Attribute
        2. Border Attribute
        3. Gravity Attribute
        4. Backing Store Attribute
        5. Save Under Flag
        6. Backing Planes and Backing Pixel Attributes
        7. Event Mask and Do Not Propagate Mask Attributes
        8. Override Redirect Flag
        9. Colormap Attribute
        10. Cursor Attribute
      3. Creating Windows
      4. Destroying Windows
      5. apping Windows
      6. Unmapping Windows
      7. Configuring Windows
      8. Changing Window Stacking Order
      9. Changing Window Attributes
      10. Translating Window Coordinates
    4. Window Information Functions
      1. Obtaining Window Information
      2. Properties and Atoms
      3. Obtaining and Changing Window Properties
      4. Selections
    5. Graphics Resource Functions
      1. Colormap Functions
        1. Creating, Copying, and Destroying Colormaps
        2. Allocating, Modifying, and Freeing Color Cells
        3. Reading Entries in a Colormap
      2. Creating and Freeing Pixmaps
      3. Manipulating Graphics Context/State
      4. Using GC Convenience Routines
        1. Setting the Foreground, Background, Function, or Plane Mask
        2. Setting the Line Attributes and Dashes
        3. Setting the Fill Style and Fill Rule
        4. Setting the Fill Tile and Stipple
        5. Setting the Current Font
        6. Setting the Clip Region
        7. Setting the Arc Mode, Subwindow Mode, and Graphics Exposure
    6. Graphics Functions
      1. Clearing Areas
      2. Copying Areas
      3. Drawing Points, Lines, Rectangles, and Arcs
        1. Drawing Single and Multiple Points
        2. Drawing Single and Multiple Lines
        3. Drawing Single and Multiple Rectangles
        4. Drawing Single and Multiple Arcs
      4. Filling Areas
        1. Filling Single and Multiple Rectangles
        2. Filling a Single Polygon
        3. Filling Single and Multiple Arcs
      5. Font Metrics
        1. Loading and Freeing Fonts
        2. Obtaining and Freeing Font Names and Information
        3. Setting and Retrieving the Font Search Path
        4. Computing Character String Sizes
        5. Computing Logical Extents
        6. Querying Character String Sizes
      6. Drawing Text
        1. Drawing Complex Text
        2. Drawing Text Characters
        3. Drawing Image Text Characters
      7. Transferring Images between Client and Server
      8. Cursors
        1. Creating a Cursor
        2. Changing and Destroying Cursors
        3. Defining the Cursor
    7. Window Manager Functions
      1. Changing the Parent of a Window
      2. Controlling the Lifetime of a Window
      3. Determining Resident Colormaps
      4. Pointer Grabbing
      5. Keyboard Grabbing
      6. Server Grabbing
      7. Miscellaneous Control Functions
        1. Controlling Input Focus
        2. Killing Clients
      8. Keyboard and Pointer Settings
      9. Keyboard Encoding
      10. Screen Saver Control
      11. Controlling Host Access
        1. Adding, Getting, or Removing Hosts
        2. Changing, Enabling, or Disabling Access Control
    8. Events and Event-Handling Functions
      1. Event Types
      2. Event Structures
      3. Event Masks
      4. Event Processing
        1. Keyboard and Pointer Events
          1. Pointer Button Events
          2. Keyboard and Pointer Events
        2. Window Entry/Exit Events
          1. Normal Entry/Exit Events
          2. Grab and Ungrab Entry/Exit Events
        3. Input Focus Events
          1. Normal Focus Events and Focus Events While Grabbed
          2. Focus Events Generated by Grabs
        4. KeyMap State Notification Events
        5. Exposure Events
          1. Expose Event
          2. GraphicsExpose and NoExpose Events
        6. Windows State Change Events
          1. CirculateNotify Events
          2. ConfigureNotify Events
          3. CreateNotify Events
          4. DestroyNotify Events
          5. GravityNotify Events
          6. MapNotify Events
          7. MappingNotify Events
          8. ReparentNotify Events
          9. UnmapNotify Events
          10. VisibilityNotify Events
        7. Structure Control Events
          1. CirculateRequest Events
          2. ConfigureRequest Events
          3. MapRequest Events
          4. ResizeRequest Events
        8. Colormap State Change Events
        9. Client Communication Events
          1. ClientMessage Events
          2. PropertyNotify Events
          3. SelectionClear Events
          4. SelectionRequest Events
          5. SelectionNotify Events
      5. Selecting Events
      6. Handling the Output Buffer
      7. Event Queue Management
      8. Manipulating the Event Queue
        1. Returning the Next Event
        2. Selecting Events Using a Predicate Procedure
        3. Selecting Events Using a Window or Event Mask
      9. Putting an Event Back into the Queue
      10. Sending Events to Other Applications
      11. Getting Pointer Motion History
      12. Handling Error Events
        1. Enabling or Disabling Synchronization
        2. Using the Default Error Handlers
    9. Predefined Property Functions
      1. Communicating with Window Managers
        1. Setting Standard Properties
        2. Setting and Getting Window Names
        3. Setting and Getting Icon Names
        4. Setting the Command
        5. Setting and Getting Window Manager Hints
        6. Setting and Getting Window Sizing Hints
        7. Setting and Getting Icon Size Hints
        8. Setting and Getting the Class of a Window
        9. Setting and Getting the Transient Property
      2. Manipulating Standard Colormaps
        1. Standard Colormaps
        2. Standard Colormap Properties and Atoms
        3. Getting and Setting an XStandardColormap Structure
    10. Application Utility Functions
      1. Keyboard Utility Functions
        1. Keyboard Event Functions
        2. Keysym Classification Macros
      2. Obtaining the X Environment Defaults
      3. Parsing the Window Geometry
      4. Parsing the Color Specifications
      5. Generating Regions
      6. Manipulating Regions
        1. Creating, Copying, or Destroying Regions
        2. Moving or Shrinking Regions
        3. Computing with Regions
        4. Determining if Regions Are Empty or Equal
        5. Locating a Point or a Rectangle in a Region
      7. Using the Cut and Paste Buffers
      8. Determining the Appropriate Visual Type
      9. Manipulating Images
      10. Manipulating Bitmaps
      11. Using the Resource Manager
        1. Resource Manager Matching Rules
        2. Basic Resource Manager Definitions
        3. Resource Database Access
          1. Storing Into a Resource Database
          2. Looking Up from a Resource Database
          3. Databse Search Lists
          4. Merging Resource Databases
          5. Retrieving and Storing Databases
        4. Parsing Command Line Options
      12. Using the Context Manager
  • Part II: X Window System Protocol Version 11
    1. Protocol Formats
    2. Syntactic Conventions
    3. Common Types
    4. Errors
    5. Keyboards
    6. Pointers
    7. Predefined Atoms
    8. Connection Setup
    9. Requests
    10. Connection Close
    11. Events
    12. Flow Control and Concurrency
  1. Xlib Functions and Protocol Requests
  2. X Font Cursors
  3. Extensions
    • Basic Protocol Support Routines
    • Hooking into Xlib
    • Hooks into the Library
    • Hooks onto Xlib Data Structures
    • GC Caching
    • Graphics Batching
    • Writing Extension Stubs
    • Requests, Replies, and Xproto.h
    • Request Format
    • Starying to Write a Stub Routine
    • Locking Data Structures
    • Sending the Protocol Request and Arguments
    • Variable Length Arguments
    • Replies
    • Synchronous Calling
    • Allocating and Deallocating Memory
    • Portability Considerations
    • Deriving the Correct Extension Opcode
  4. Version 10 Compatibility Functions
    • Drawing and Filling Polygons and Curves
    • Associating User Data with a Value
  5. KEYSYM Encoding
  6. Protocol Encoding
    • Syntactic Conventions
    • Common Types
    • Errors
    • Keyboards
    • Pointers
    • Predefined Atoms
    • Connection Setup
    • Requests
    • Events

Reviews

X Windows System

Reviewed by Roland Buresund

Bad ** (2 out of 10)

Last modified: May 21, 2007, 2:47 a.m.

Nobody has any reason to poke around in X at this level (at least not with any sanity).

If you do, you'll soon understand the horrors of X11 (I assume that you already understand the good stuff if you even contemplate this book).

Granted, if you really, really want to understand X at a very, very low level (to implement something new and hopefully better), this book can be of use. Otherwise, it is a technical manual that any application programmer should steer clear of (or any aspiring UNIX/LINUX programmer/user/administrator), so as not to be scared away. There exists toolkits and other stuff that makes programming under X11 a breeze, but this will with 99% probability not help you!

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required

captcha

required