X Window Applications Programming

Eric F. Johnson, Kevin Reichard

Publisher: MIS, 1989, 562 pages

ISBN: 1-55828-016-2

Keywords: Programming, Graphics

Last modified: May 9, 2021, 7:24 p.m.

Push X to the limit

Written for developers, programmers, and users who want to keep pace with America's best-selling database software.

Loaded with source code and illustrations, this book exposes the ingenious intricacies of this new vendor-independent, hardware-independent graphical windowing system developed by MIT.

Delineates in detail X Window programming involving both C and UNIX.

Comprehensive tutorial teaches you to build a full-fledged X Window application one program at a time.

Includes complete details on widget sets — programming libraries of useful tools programmers can use over and over again.

Minimize time and effort needed to manage "Events" in X.

11 good reasons to read this book

  • Writing Your First X Program
  • Drawing with X
  • Drawing in Color
  • "Events" in X
  • X Text
  • Auto-Raise Windows
  • Interacting with Window Managers
  • Building Complete Applications
  • Graphic File Formats
  • Enhancing Applications
  • Dealing with Widget Sets

Complete tutorial and reference guide in one.

    • Introduction
      • The History of X
      • Why X Now?
      • What Is X?
      • The Sum of Its Parts
      • What You Need to Run X
      • This Book's Approach to X
      • Typographical Conventions
    Section I: Learning X Programming
    1. Building a First X Program
      • Example 1: A Minimalist X Program
        • Example 1 Source Code
      • Example 2: Opening a Minimalist Window
        • Creating a Window
        • Sending "Hints" to the Window Manager
        • Flushing the Display
        • Destroying the Window
        • Example 2 Source Code
      • Example 3: Fleshing Out the open Window Function
        • Icons
        • Example 3 Source Code
        • Icon Bitmaps
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
    2. Drawing with X
      • Drawing Lines and Rectangles
      • The Graphic Context
        • Creating the Graphics Context for a Window
      • Example 1: Drawing Lines and Rectangles
        • Example 1 Source Code
      • Drawing Ovals from Arcs
      • Filling Ovals and Rectangles
      • Example 2: Drawing and Filling Ovals and Rectangles
        • Example 2 Source Code
      • Drawing Multiple Lines, Rectangles, and Arcs
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
    3. Using Color
      • The Portability and Usefulness of Color Applications
      • Colormaps in X
      • Example 1: Drawing a Line in Red
        • Example 1 Source Code
      • Example 2: Using More Colors, Again and Again
        • Example 2 Source Code
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
    4. Using Text
      • Fonts
        • Loading Fonts
        • Setting Up the Graphics Context
        • Drawing Text
        • Where the Text Is Drawn
        • Finding Out How Large a Font Is
        • Freeing Up Fonts
        • Tips on Using Fonts
        • Finding the Available Fonts
        • Limited X Server Resources
      • Example Program
        • Example Program Source Code
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
    5. Events
      • Event-Driven Programming
      • The X Event Model
      • Asking for Events
      • The Event Mask
      • Receiving Events from the X Server
      • Polling for Events
      • Event Types
      • Mouse Button Events
      • Keyboard Events
      • Enter/Leave Events
      • Exposure Events
      • Example 1: A Program to Check Events
        • Example 1 Source Code
      • Example 2: A Mouse-Based Drawing Program
        • Example 2 Source Code
      • More About the X Event Model with the XEV Program
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
    6. Keyboard Events
      • Meta Keys
      • Mouse Buttons
      • Example Program
        • Example Program Source Code
      • When the Keyboard Mapping Changes
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
    7. Rubber-Band Lines
      • Raster Operation Functions
      • Summary of the GC Graphics Functions
      • Example 1: Rubber-Band Lines
        • Example 1 Source Code
      • Example 2: Rubber-Band Ovals
        • Example 2 Source Code
      • Example 3: Showing the Raster Op Functions
        • Example 3 Source Code
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
    8. X Standards and Interacting with Windows Managers
      • X Command-Line Arguments
      • Display Names
      • X Geometry
      • Creating Cursors for Windows
        • Cursors as Text
        • Creating Your Own Cursors
        • Freeing Up the Cursor Resources
      • Example 1: Taking in Command-Line Arguments and Setting Up a Cursor
        • Example 1 Source Code
      • Example 2: Sending More Information to the Window Manager
        • The Class Property
        • Sizing Windows
        • Icon Names
        • Example 2 Source Code
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
  • Section II: Building an X Window System Application
    1. Introducing the Draw Application: A User's Guide
      • The Floating Selection Palette
        • Points
        • Text
        • Loading In New Files
        • Undoing Drawing Operations
      • Command-Line Parameters
      • Power-User Meta-Key Shortcuts
      • Critical Error Handling
      • Handling Fatal IO Errors
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
    2. Multiple-Window Applications
      • Floating Palettes
        • Highlighting a Palette Choice
        • Refreshing the Palette Window
        • Cursors for the Palette
          • Waiting for Godot (or Setting a "Busy" Cursor)
          • Setting the Cursor for the Drawing Window
          • Freeing Up the Cursor Resources
      • The Drawing Window
      • Cleaning Up the X Window and GC Resources
      • File Format for the Draw Application
      • Pixmaps and Windows
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
    3. Event Processing in the Draw Application
      • The Event Mask and Selecting Events
      • Drawing Events
      • Palette-Selection Events
      • Text-Entry Events
      • Keyboard Shortcut Events
      • X Server-Generated Events
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
    4. Pop-Up Windows and Dialog Boxes
      • Setting Up a Pop-Up Window in X
      • Calling Up the Pop-Up Window from the Palette
      • Finding the Mouse Pointer Location
      • A Pop-Up File Name Dialog Box
      • Implementing the Dialog Box
      • Setting Up the Dialog Windows
      • Displaying the Contents of the Dialog Windows
      • Dialog Events
      • Cleaning Up
      • Hinting About Transient Windows
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
    5. The Draw Application Source Code
      • Source Files for the drawapp Application
    6. Enhancing the Draw Application
      • Handling Expose Events
      • Enlargements
      • Scrolling
      • Cursor Editing
      • Cutting and Pasting/Moving and Copying Areas
      • Cropping
      • Flipping, Reversing, and Rotating
      • Summary
        • Xlib Functions and Macros Introduced in This Chapter
  • Section III: X Toolkits
    1. An Introduction to X Toolkits
      • The XT Toolkit
      • A Sample XT Program
        • Initilizing the XT Library
        • Creating Subwidgets
        • Managing Widgets
        • Realizing Widgets
        • The Widget Event Loop
        • Sample Widget Program Source Code
        • Compiling the XT Program
      • More About the X Toolkits
      • Summary
        • XT Functions and Macros Introduced in This Chapter
  • Appendices
    1. The X Color Data Base
    2. X Event Types and Structures
      • 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
    3. The Graphics Context
    4. Some Sample X Client Programs
      • bitmap
      • xdpyinfo
      • xev
      • xfd
      • xwd
      • xwininfo
    5. How to Order X Window
      • The MIT Software Distribution Center
      • The X Consortium
      • X User's Group (XUG)
    6. For More Information on X Window

Reviews

X Windows Applications Programming

Reviewed by Roland Buresund

OK ***** (5 out of 10)

Last modified: May 21, 2007, 3:18 a.m.

A good introduction, but anyone of a sane mind wouldn't program X at this level!

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required

captcha

required