Book description
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.
Table of contents
-
XLIB Programming Manual, Rel. 5
- Preface
- 1. Introduction
- 2. X Concepts
-
3. Basic Window Program
- 3.1 Running the Program
-
3.2 The Main of basicwin
- 3.2.1 Include Files and Declarations
- 3.2.2 Connecting to a Server
- 3.2.3 Display Macros
- 3.2.4 Getting Window Information
- 3.2.5 Creating Windows
- 3.2.6 Color Strategy
- 3.2.7 Preparing an Icon Pixmap
- 3.2.8 Communicating with the Window Manager
- 3.2.9 Selecting Desired Event Types
- 3.2.10 Creating Server Resources
- 3.2.11 Window Mapping
- 3.2.12 Flushing the Output Buffer
- 3.2.13 Setting Up an Event-gathering Loop
- 3.2.14 When Can I Draw?
- 3.2.15 When Will My Drawing Appear?
- 3.2.16 Handling Resizing of the Window
- 3.2.17 Exiting the Program
- 3.2.18 Error Handling
- 3.2.19 Summary
- 3.2.20 Complete Code for basicwin
-
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
-
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
-
6. Drawing Graphics and Text
- 6.1 Drawing
- 6.2 Fonts and Text
- 6.3 Regions
- 6.4 Images
- 6.5 Cursors
-
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
-
8. Events
- 8.1 Overview of Event Handling
- 8.2 Event Processing
-
8.3 Selecting Events
- 8.3.1 Correspondence Between Event Masks and Events
- 8.3.2 Propagation of Device Events
-
8.3.3 Event Masks
- 8.3.3.1 KeyPressMask and KeyReleaseMask
- 8.3.3.2 ButtonPressMask, ButtonReleaseMask, and OwnerGrabButtonMask
- 8.3.3.3 The Pointer Motion Masks
- 8.3.3.4 FocusChangeMask
- 8.3.3.5 EnterWindowMask and LeaveWindowMask
- 8.3.3.6 KeymapStateMask
- 8.3.3.7 ExposureMask
- 8.3.3.8 VisibilityChangeMask
- 8.3.3.9 ColormapChangeMask
- 8.3.3.10 PropertyChangeMask
- 8.3.3.11 StructureNotifyMask and SubstructureNotifyMask
- 8.3.3.12 SubstructureRedirectMask
- 8.3.3.13 ResizeRedirectMask
- 8.3.3.14 Automatically Selected Events
- 8.4 Sending Events
- 8.5 Where to Find More on Each Event
-
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
-
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
-
11. Internationalized Text Input
- 11.1 Issues of Internationalized Text Input
-
11.2 Overview of the X Input Method Architecture
- 11.2.1 Input Methods and Input Servers
- 11.2.2 User Interaction with an Input Method
- 11.2.3 The X Input Method
- 11.2.4 The X Input Context
- 11.2.5 Input Context Focus Management
- 11.2.6 Preedit and Status Area Geometry Management
- 11.2.7 Preedit and Status Callbacks
- 11.2.8 Getting Composed Input
- 11.2.9 Filtering Events
- 11.2.10 The Big Picture
- 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
-
12. Interclient Communication
- 12.1 Properties and Atoms
- 12.2 The Compound Text Encoding
-
12.3 Communicating with the Window Manager
- 12.3.1 Standard Properties for Window Manager
- 12.3.2 Standard Properties for Session Manager
- 12.3.3 Optional Properties for Window and Session Manager
- 12.3.4 Properties Set by the Window Manager
- 12.3.5 Text Properties
- 12.3.6 Constraints on Client Actions
-
12.4 Selections
- 12.4.1 The Selection Mechanism
- 12.4.2 An Example of Selection
- 12.4.3 Acquiring Selection Ownership
- 12.4.4 Responsibilities of the Selection Owner
- 12.4.5 Giving Up Selection Ownership
- 12.4.6 Requesting a Selection
- 12.4.7 Large Data Transfers
- 12.4.8 More on Selection Properties and Types
- 12.4.9 Target Atoms
- 12.5 Cut Buffers
- 13. Managing User Preferences
- 14. A Complete Application
-
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
-
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
- 16.7.1 Operation of the Program
- 16.7.2 Description of the Code of main
- 16.7.3 Window Layering
- 16.7.4 Selecting Input
- 16.7.5 Handling Input
- 16.7.6 Inverting an Area
- 16.7.7 Cursors
- 16.7.8 Grabbing the Pointer
- 16.7.9 Painting the Menu
- 16.7.10 Circulating Windows
- 16.7.11 Raising and Lowering Windows
- 16.7.12 Moving and Resizing Windows
- 16.7.13 The draw_box Routine
- 16.7.14 (De)Iconifying Windows
- 16.7.15 Creating the Icons
- 16.7.16 Getting the Icon Size
- 16.7.17 Updating the Icon List
- 16.7.18 Removing Icons
- 16.7.19 Changing Keyboard Focus
- 16.7.20 Drawing the Focus Frame
- 16.7.21 Executing a Shell Command
- A. Specifying Fonts
- B. X10 Compatibility
-
C. Writing Extensions to X
- C.1 Basic Protocol Support Routines
- C.2 Hooking into Xlib
- C.3 GC Caching
- C.4 Graphics Batching
-
C.5 Writing Extension Stubs
- C.5.1 Requests, Replies, and Xproto.h
- C.5.2 Request Format
- C.5.3 Starting to Write a Stub Routine
- C.5.4 Locking Data Structures
- C.5.5 Sending the Protocol Request and Arguments
- C.5.6 Variable Length Arguments
- C.5.7 Replies
- C.5.8 Synchronous Calling
- C.5.9 Allocating and Deallocating Memory
- C.5.10 Portability Considerations
- C.5.11 Deriving the Correct Extension Opcode
- D. The basecalc Application
-
E. Event Reference
-
E.1 Meaning of Common Structure Elements
- ButtonPress,ButtonRelease
- CirculateNotify
- CirculateRequest
- ClientMessage
- ColormapNotify
- ConfigureNotify
- ConfigureRequest
- CreateNotify
- DestroyNotify
- EnterNotify,LeaveNotify
- Expose
- FocusIn,FocusOut
- GraphicsExpose,NoExpose
- GravityNotify
- KeymapNotify
- KeyPress,KeyRelease
- MapNotify,UnmapNotify
- MappingNotify
- MapRequest
- MotionNotify
- PropertyNotify
- ReparentNotify
- ResizeRequest
- SelectionClear
- SelectionNotify
- SelectionRequest
- VisibilityNotify
-
E.1 Meaning of Common Structure Elements
-
F. The Xmu Library
- F.1 Atom Functions
- F.2 Error Handler Functions
- F.3 System Utility Functions
- F.4 Window Utility Functions
- F.5 Cursor Utility Functions
- F.6 Color Utilities
- F.7 Pixmap Utilities
- F.8 Graphics Functions
- F.9 Selection Functions
- F.10 Character Set Functions
- F.11 Compound Text Functions
- F.12 CloseDisplay Hook Functions
- F.13 Display Queue Functions
- F.14 Standard Colormap Functions
- G. Sources of Additional Information
- H. Release Notes
- Glossary
-
References
- Index
Product information
- Title: XLIB Programming Manual, Rel. 5, Third Edition
- Author(s):
- Release date: June 1994
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781565920026
You might also like
book
Autotools, 2nd Edition
The GNU Autotools make it easy for developers to create software that is portable across many …
book
X Window Programming from Scratch
X Window Programming From Scratch shows how to create a graphical user interface and accomplish graphic …
book
Real-Time 3D Rendering with DirectX® and HLSL: A Practical Guide to Graphics Programming
Get Started Quickly with DirectX 3D Programming: No 3D Experience Needed This step-by-step text demystifies modern …
book
Programming 2D Games
Most of today's commercial games are written in C++ and are created using a game engine. …