Chapter 7. Xlib Graphic Primitives

In this chapter

  • The Graphics Context

  • Graphic Primitive Functions

  • Next Steps

The thorough discussion of programming with the X Toolkit Intrinsics in Chapter 6,"Components of an X Window Application," omitted one essential element necessary for approaching the Graphics Editor project. The missing piece is not addressed by any of the functions provided with Xt.

To perform the basic graphic functions of drawing lines, arcs, points, and rectangles, the X library, Xlib, must be used. These basic functions, along with others for copying and for creating the graphic contexts needed to define the attributes of the operations, are known as X Graphic Primitives.

A graphic primitive is an Xlib call that sends a request to the ...

Get X Window Programming from Scratch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.