<F8>Introduction<Tab><F6>6.1<F0><#04>Once connected to an X server,
a client can use CLX functions to perform graphic operations on drawables.
<para>
This section describes CLX functions to:
<bullet>
<F9>w<Tab><F0>Operate on areas and planes
<F9>w<Tab><F0>Draw points
<F9>w<Tab><F0>Draw lines
<F9>w<Tab><F0>Draw rectangles
<F9>w<Tab><F0>Draw arcs
<bullet,
Bottom Margin = 0.12 inches>
<F9>w<Tab><F0>Draw text
<p1rule>
<Index, "area of a window", To Named = p1rule><Index, "plane", To Named = p1rule><Index, "graphics", "plane", To Named = p1rule><Index, "graphics", "area", To Named = p1rule>
<Frame,
Name = p1rule,
Placement = At Anchor,
Width = 6.35 inches,
Height = 0.153 inches,
Vertical Alignment = 0.007 inches,
Shared Contents = yes>
<p1stacked,
Font = F3,
Left Tab = -1.70/0 inches>
<F8>Area and Plane<Tab><F6>6.2<#04>clear<#1e>area<F0> clears an
area or an entire window to the background.<F6><FJ>
<p1para,
Bottom Margin = 0.12 inches,
Alignment = Both,
Font = F3,
Allow Page Break After = yes>
<F8>Operations<Tab><F0>Since pixmaps do not have backgrounds, they
cannot be filled by using the functions described in the following
paragraphs. Instead, you should use <F6>draw<#1e>rectangle<F0>,
which sets the pixmap to a known value. See paragraph 6.5, Drawing
Rectangles, for information on <F6>draw<#1e>rectangle<F0>.
Uses a single bit plane of the specified rectangular area of the <F2>source
<F0> <F6>drawable<F0> along with the specified graphics context
(<F2>gcontext<F0>) to modify the specified rectangle area of the <F2>destina
tion<F0> <F6>drawabl<F0>e. The drawables specified by the <F2>source<F0>
and <F2>destination<F0> arguments must have the same root but need
not have the same depth.
Effectively, this operation forms a pixmap of the same depth as <F2>destinatio
n<F0> and with a size specified by the <F2>source<F0> area. It
then uses the foreground and background from the graphics context
(foreground where the bit<#1e>plane in <F2>source<F0> contains a
one bit, background where the bit<#1e>plane in <F2>source<F0> contains
a zero bit), and the equivalent of a <F6>copy<#1e>area<F0> operation
is performed with all the same exposure semantics. This can also be
thought of as using the specified region of the <F2>source<F0> bit<#1e>plane
as a stipple with a fill<#1e>style of <F6>:opaque<#1e>stippled<F0>
for filling a rectangular area of the <F2>destination<F0>.
<arg>
source <F3><#1f> The source <F6>drawable<F3>.
gcontext <F3><#1f> The graphics context to use during the copy operation.
<|,"6<#1e>71">plane <F3><#1f> Specifies the bit<#1e>plane of the <F0>source<F3>
<F6>drawable<F3>. Exactly one bit must be set. Type is <F6>pixel<F3>.
source<#1e>x<F3>, <F0>source<#1e>y<F6> <F3><#1f> The <F0>x<F3>
and <F0>y<F3> coordinates of the upper<#1e>left corner of the area
in the <F0>source<F3> <F6>drawable<F3>. These coordinates are
relative to the <F0>source<F3> <F6>drawable<F3> origin. Type is <F6>int16
<F3>.
width<F3>, <F0>height<F6> <F3><#1f> The width and height of the
area being copied. These apply to both the <F0>source<F3> and <F0>destinatio
n<F3> areas. Type is <F6>card16<F3>.
destination <F3><#1f> The destination <F6>drawable<F3>.
destination<#1e>x<F3>, <F0>destination<#1e>y <F3><#1f> The x and
y coordinates of the upper<#1e>left corner of the destination area
in the <F0>destination<F3> <F6>drawable<F3>. These coordinates
are relative to the <F0>destination<F3> <F6>drawable<F3> origin.
Type is <F6>int16<F3>.
<p1rule>
<Index, "drawing", "points", To Named = p1rule><Index, "points", "drawing", To Named = p1rule><Index, "graphics", "drawing", "points", To Named = p1rule>
Draws circular or elliptical, outlined or filled arcs. Each arc is
specified by a rectangle and two angles. For a more detailed description,
see <F6>draw<#1e>arc<F0>.
The arcs are filled in the order listed. For any given arc, no pixel
is drawn more than once. If regions intersect, the intersecting pixels
are drawn multiple times.
<arg>
drawable <F3><#1f> Specifies the <F6>drawable<F3> where you want
the arcs drawn.
gcontext <F3><#1f> Specifies the graphics context for drawing the
arc.
arcs <F3><#1f> A sequence containing the width, height, angle1, and
angle2 arguments defining the arcs. See <F6>draw<#1e>arc<F3> for
more detail. Type is <F6>arc<#1e>seq<F3>.
fill<#1e>p <F3><#1f> Specifies whether the arcs are filled or not.
Type is <F6>boolean<F3>.
<p1rule>
<Index, "graphics", "drawing", "glyphs", To Named = p1rule><Index, "drawing", "glyphs", To Named = p1rule><Index, "glyphs", "drawing", To Named = p1rule><Index, "drawing", "text"><Index, "text", "drawing", To Named = p1rule><Index, "graphics", "drawing", "text", To Named = p1rule>
<Frame,
Name = p1rule,
Placement = At Anchor,
Width = 6.35 inches,
Height = 0.153 inches,
Vertical Alignment = 0.007 inches,
Shared Contents = yes>
<p1para,
Alignment = Both,
Font = F3,
Allow Page Break After = yes>
<F8>Drawing Text<Tab><F6>6.7<F0><#04>CLX provides functions for
drawing text using text fonts provided by the<SP>X server. An X font
is array of character bit maps indexed by integer<SP>codes. See Section
8 for a complete discussion of the CLX functions<SP>used to manage
fonts and characters.<F6><#04><F0>
<para>
Since Common Lisp programs typically represent text as sequences of
characters (that is, strings), CLX text functions must be prepared
to<SP>convert a Common Lisp character into the integer code used to
index the<SP>appropriate character bitmap in a given font. The <F6>:translate
<F0> argument<SP>to a text function is a function which performs
this conversion. The default <F6>:translate<F0> function handles
all characters that satisfy<SP><F6>graphic<#1e>char<#1e>p<F0> by
converting each character into its ASCII code. Note<SP>that the assumption
made by the default <F6>:translate<F0> function<#1f>that is,<SP>that
an X font indexes bitmaps by ASCII codes<#1f>is often valid, but<SP>other
encodings are possible. In general, a <F6>:translate<F0> function
can perform complex transformations. It can be used to convert<SP>non<#1e>chara
cter input, to handle non<#1e>ASCII character encodings, and to change
the fonts used to access character bitmaps. The complete behavior
of a <F6>:translate<F0> function is given below by describing a<SP>prototypic
al <F6>translate<#1e>function<F0>.
CLX offers two different ways to draw text<#1f>filled text and block
text. The <F6>draw<#1e>glyph<F0> and <F6>draw<#1e>glyphs<F0> functions
create filled text, in which each character image is treated as an
area to be filled according to the fill<#1e>style of the given graphics
context, without otherwise disturbing the surrounding background.
In addition, filled<SP>text sends a complex type of server request
which allows a series of font<SP>indices, font changes, and horizontal
position changes to be compiled<SP>into a single request. Filled text
functions use<FJ>
the following graphics<SP>context attributes: background, clip<#1e>mask,