Blame man/XCreateGC.man

Packit 5bd3a9
'\" t
Packit 5bd3a9
.\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" Permission is hereby granted, free of charge, to any person obtaining
Packit 5bd3a9
.\" a copy of this software and associated documentation files (the
Packit 5bd3a9
.\" "Software"), to deal in the Software without restriction, including
Packit 5bd3a9
.\" without limitation the rights to use, copy, modify, merge, publish,
Packit 5bd3a9
.\" distribute, sublicense, and/or sell copies of the Software, and to
Packit 5bd3a9
.\" permit persons to whom the Software is furnished to do so, subject to
Packit 5bd3a9
.\" the following conditions:
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" The above copyright notice and this permission notice shall be included
Packit 5bd3a9
.\" in all copies or substantial portions of the Software.
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
Packit 5bd3a9
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Packit 5bd3a9
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Packit 5bd3a9
.\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
Packit 5bd3a9
.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
Packit 5bd3a9
.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
Packit 5bd3a9
.\" OTHER DEALINGS IN THE SOFTWARE.
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" Except as contained in this notice, the name of the X Consortium shall
Packit 5bd3a9
.\" not be used in advertising or otherwise to promote the sale, use or
Packit 5bd3a9
.\" other dealings in this Software without prior written authorization
Packit 5bd3a9
.\" from the X Consortium.
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by
Packit 5bd3a9
.\" Digital Equipment Corporation
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" Portions Copyright \(co 1990, 1991 by
Packit 5bd3a9
.\" Tektronix, Inc.
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" Permission to use, copy, modify and distribute this documentation for
Packit 5bd3a9
.\" any purpose and without fee is hereby granted, provided that the above
Packit 5bd3a9
.\" copyright notice appears in all copies and that both that copyright notice
Packit 5bd3a9
.\" and this permission notice appear in all copies, and that the names of
Packit 5bd3a9
.\" Digital and Tektronix not be used in in advertising or publicity pertaining
Packit 5bd3a9
.\" to this documentation without specific, written prior permission.
Packit 5bd3a9
.\" Digital and Tektronix makes no representations about the suitability
Packit 5bd3a9
.\" of this documentation for any purpose.
Packit 5bd3a9
.\" It is provided ``as is'' without express or implied warranty.
Packit 5bd3a9
.\" 
Packit 5bd3a9
.\"
Packit 5bd3a9
.ds xT X Toolkit Intrinsics \- C Language Interface
Packit 5bd3a9
.ds xW Athena X Widgets \- C Language X Toolkit Interface
Packit 5bd3a9
.ds xL Xlib \- C Language X Interface
Packit 5bd3a9
.ds xC Inter-Client Communication Conventions Manual
Packit 5bd3a9
.na
Packit 5bd3a9
.de Ds
Packit 5bd3a9
.nf
Packit 5bd3a9
.\\$1D \\$2 \\$1
Packit 5bd3a9
.ft CW
Packit 5bd3a9
.\".ps \\n(PS
Packit 5bd3a9
.\".if \\n(VS>=40 .vs \\n(VSu
Packit 5bd3a9
.\".if \\n(VS<=39 .vs \\n(VSp
Packit 5bd3a9
..
Packit 5bd3a9
.de De
Packit 5bd3a9
.ce 0
Packit 5bd3a9
.if \\n(BD .DF
Packit 5bd3a9
.nr BD 0
Packit 5bd3a9
.in \\n(OIu
Packit 5bd3a9
.if \\n(TM .ls 2
Packit 5bd3a9
.sp \\n(DDu
Packit 5bd3a9
.fi
Packit 5bd3a9
..
Packit 5bd3a9
.de IN		\" send an index entry to the stderr
Packit 5bd3a9
..
Packit 5bd3a9
.de Pn
Packit 5bd3a9
.ie t \\$1\fB\^\\$2\^\fR\\$3
Packit 5bd3a9
.el \\$1\fI\^\\$2\^\fP\\$3
Packit 5bd3a9
..
Packit 5bd3a9
.de ZN
Packit 5bd3a9
.ie t \fB\^\\$1\^\fR\\$2
Packit 5bd3a9
.el \fI\^\\$1\^\fP\\$2
Packit 5bd3a9
..
Packit 5bd3a9
.de hN
Packit 5bd3a9
.ie t <\fB\\$1\fR>\\$2
Packit 5bd3a9
.el <\fI\\$1\fP>\\$2
Packit 5bd3a9
..
Packit 5bd3a9
.ny0
Packit 5bd3a9
'\" t
Packit 5bd3a9
.TH XCreateGC __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS"
Packit 5bd3a9
.SH NAME
Packit 5bd3a9
XCreateGC, XCopyGC, XChangeGC, XGetGCValues, XFreeGC, XGContextFromGC, XGCValues \- create or free graphics contexts and graphics context structure
Packit 5bd3a9
.SH SYNTAX
Packit 5bd3a9
.HP
Packit 5bd3a9
GC XCreateGC\^(\^Display *\fIdisplay\fP\^, Drawable \fId\fP\^, unsigned long
Packit 5bd3a9
\fIvaluemask\fP\^, XGCValues *\^\fIvalues\fP\^); 
Packit 5bd3a9
.HP
Packit 5bd3a9
int XCopyGC\^(\^Display *\fIdisplay\fP\^, GC \fIsrc\fP\^,
Packit 5bd3a9
unsigned long \fIvaluemask\fP\^, GC \fIdest\fP\^); 
Packit 5bd3a9
.HP
Packit 5bd3a9
int XChangeGC\^(\^Display *\fIdisplay\fP\^, GC \fIgc\fP\^, unsigned long
Packit 5bd3a9
\fIvaluemask\fP\^, XGCValues *\^\fIvalues\fP\^); 
Packit 5bd3a9
.HP
Packit 5bd3a9
Status XGetGCValues\^(\^Display *\fIdisplay\fP\^, GC \fIgc\fP\^, unsigned long
Packit 5bd3a9
\fIvaluemask\fP\^, XGCValues *\fIvalues_return\fP\^); 
Packit 5bd3a9
.HP
Packit 5bd3a9
int XFreeGC\^(\^Display *\fIdisplay\fP\^, GC \fIgc\fP\^); 
Packit 5bd3a9
.HP
Packit 5bd3a9
GContext XGContextFromGC\^(\^GC \fIgc\fP\^); 
Packit 5bd3a9
.SH ARGUMENTS
Packit 5bd3a9
.IP \fId\fP 1i
Packit 5bd3a9
Specifies the drawable. 
Packit 5bd3a9
.IP \fIdest\fP 1i
Packit 5bd3a9
Specifies the destination GC.
Packit 5bd3a9
.IP \fIdisplay\fP 1i
Packit 5bd3a9
Specifies the connection to the X server.
Packit 5bd3a9
.IP \fIgc\fP 1i
Packit 5bd3a9
Specifies the GC.
Packit 5bd3a9
.IP \fIsrc\fP 1i
Packit 5bd3a9
Specifies the components of the source GC.
Packit 5bd3a9
.ds Vm set, copied, changed, or returned 
Packit 5bd3a9
.IP \fIvaluemask\fP 1i
Packit 5bd3a9
Specifies which components in the GC are to be \*(Vm. 
Packit 5bd3a9
This argument is the bitwise inclusive OR of zero or more of the valid
Packit 5bd3a9
GC component mask bits.
Packit 5bd3a9
.IP \fIvalues\fP 1i
Packit 5bd3a9
Specifies any values as specified by the valuemask.
Packit 5bd3a9
.IP \fIvalues_return\fP 1i
Packit 5bd3a9
Returns the GC values in the specified
Packit 5bd3a9
.ZN XGCValues 
Packit 5bd3a9
structure.
Packit 5bd3a9
.SH DESCRIPTION
Packit 5bd3a9
The
Packit 5bd3a9
.ZN XCreateGC
Packit 5bd3a9
function creates a graphics context and returns a GC.
Packit 5bd3a9
The GC can be used with any destination drawable having the same root
Packit 5bd3a9
and depth as the specified drawable.
Packit 5bd3a9
Use with other drawables results in a
Packit 5bd3a9
.ZN BadMatch
Packit 5bd3a9
error.
Packit 5bd3a9
.LP
Packit 5bd3a9
.ZN XCreateGC
Packit 5bd3a9
can generate
Packit 5bd3a9
.ZN BadAlloc ,
Packit 5bd3a9
.ZN BadDrawable ,
Packit 5bd3a9
.ZN BadFont ,
Packit 5bd3a9
.ZN BadMatch ,
Packit 5bd3a9
.ZN BadPixmap ,
Packit 5bd3a9
and
Packit 5bd3a9
.ZN BadValue 
Packit 5bd3a9
errors.
Packit 5bd3a9
.LP
Packit 5bd3a9
The
Packit 5bd3a9
.ZN XCopyGC
Packit 5bd3a9
function copies the specified components from the source GC
Packit 5bd3a9
to the destination GC.
Packit 5bd3a9
The source and destination GCs must have the same root and depth,
Packit 5bd3a9
or a
Packit 5bd3a9
.ZN BadMatch
Packit 5bd3a9
error results.
Packit 5bd3a9
The valuemask specifies which component to copy, as for
Packit 5bd3a9
.ZN XCreateGC .
Packit 5bd3a9
.LP
Packit 5bd3a9
.ZN XCopyGC
Packit 5bd3a9
can generate
Packit 5bd3a9
.ZN BadAlloc ,
Packit 5bd3a9
.ZN BadGC ,
Packit 5bd3a9
and
Packit 5bd3a9
.ZN BadMatch
Packit 5bd3a9
errors.
Packit 5bd3a9
.LP
Packit 5bd3a9
The
Packit 5bd3a9
.ZN XChangeGC
Packit 5bd3a9
function changes the components specified by valuemask for
Packit 5bd3a9
the specified GC.
Packit 5bd3a9
The values argument contains the values to be set.
Packit 5bd3a9
The values and restrictions are the same as for 
Packit 5bd3a9
.ZN XCreateGC .
Packit 5bd3a9
Changing the clip-mask overrides any previous 
Packit 5bd3a9
.ZN XSetClipRectangles
Packit 5bd3a9
request on the context. 
Packit 5bd3a9
Changing the dash-offset or dash-list
Packit 5bd3a9
overrides any previous 
Packit 5bd3a9
.ZN XSetDashes
Packit 5bd3a9
request on the context.
Packit 5bd3a9
The order in which components are verified and altered is server dependent.
Packit 5bd3a9
If an error is generated, a subset of the components may have been altered.
Packit 5bd3a9
.LP
Packit 5bd3a9
.ZN XChangeGC
Packit 5bd3a9
can generate
Packit 5bd3a9
.ZN BadAlloc ,
Packit 5bd3a9
.ZN BadFont ,
Packit 5bd3a9
.ZN BadGC ,
Packit 5bd3a9
.ZN BadMatch ,
Packit 5bd3a9
.ZN BadPixmap ,
Packit 5bd3a9
and
Packit 5bd3a9
.ZN BadValue 
Packit 5bd3a9
errors.
Packit 5bd3a9
.LP
Packit 5bd3a9
The
Packit 5bd3a9
.ZN XGetGCValues
Packit 5bd3a9
function returns the components specified by valuemask for the specified GC.
Packit 5bd3a9
If the valuemask contains a valid set of GC mask bits
Packit 5bd3a9
.Pn ( GCFunction ,
Packit 5bd3a9
.ZN GCPlaneMask ,
Packit 5bd3a9
.ZN GCForeground ,
Packit 5bd3a9
.ZN GCBackground ,
Packit 5bd3a9
.ZN GCLineWidth ,
Packit 5bd3a9
.ZN GCLineStyle ,
Packit 5bd3a9
.ZN GCCapStyle ,
Packit 5bd3a9
.ZN GCJoinStyle ,
Packit 5bd3a9
.ZN GCFillStyle ,
Packit 5bd3a9
.ZN GCFillRule ,
Packit 5bd3a9
.ZN GCTile ,
Packit 5bd3a9
.ZN GCStipple ,
Packit 5bd3a9
.ZN GCTileStipXOrigin ,
Packit 5bd3a9
.ZN GCTileStipYOrigin ,
Packit 5bd3a9
.ZN GCFont ,
Packit 5bd3a9
.ZN GCSubwindowMode ,
Packit 5bd3a9
.ZN GCGraphicsExposures ,
Packit 5bd3a9
.ZN GCClipXOrigin ,
Packit 5bd3a9
.ZN GCCLipYOrigin ,
Packit 5bd3a9
.ZN GCDashOffset ,
Packit 5bd3a9
or
Packit 5bd3a9
.ZN GCArcMode )
Packit 5bd3a9
and no error occurs,
Packit 5bd3a9
.ZN XGetGCValues
Packit 5bd3a9
sets the requested components in values_return and returns a nonzero status.
Packit 5bd3a9
Otherwise, it returns a zero status.
Packit 5bd3a9
Note that the clip-mask and dash-list (represented by the
Packit 5bd3a9
.ZN GCClipMask
Packit 5bd3a9
and 
Packit 5bd3a9
.ZN GCDashList
Packit 5bd3a9
bits, respectively, in the valuemask)
Packit 5bd3a9
cannot be requested.
Packit 5bd3a9
Also note that an invalid resource ID (with one or more of the three
Packit 5bd3a9
most significant bits set to 1) will be returned for
Packit 5bd3a9
.ZN GCFont ,
Packit 5bd3a9
.ZN GCTile ,
Packit 5bd3a9
and
Packit 5bd3a9
.ZN GCStipple
Packit 5bd3a9
if the component has never been explicitly set by the client.
Packit 5bd3a9
.LP
Packit 5bd3a9
The
Packit 5bd3a9
.ZN XFreeGC
Packit 5bd3a9
function destroys the specified GC as well as all the associated storage.
Packit 5bd3a9
.LP
Packit 5bd3a9
.ZN XFreeGC
Packit 5bd3a9
can generate a
Packit 5bd3a9
.ZN BadGC 
Packit 5bd3a9
error.
Packit 5bd3a9
.SH STRUCTURES
Packit 5bd3a9
The
Packit 5bd3a9
.ZN XGCValues
Packit 5bd3a9
structure contains:
Packit 5bd3a9
.LP
Packit 5bd3a9
/\&* GC attribute value mask bits */
Packit 5bd3a9
.TS
Packit 5bd3a9
lw(.5i) lw(2.5i) lw(.75i).
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCFunction
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<0)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCPlaneMask
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<1)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCForeground
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<2)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCBackground
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<3)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCLineWidth
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<4)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCLineStyle
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<5)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCCapStyle
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<6)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCJoinStyle
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<7)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCFillStyle
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<8)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCFillRule
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<9)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCTile
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<10)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCStipple
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<11)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCTileStipXOrigin
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<12)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCTileStipYOrigin
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<13)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCFont
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<14)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCSubwindowMode
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<15)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCGraphicsExposures
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<16)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCClipXOrigin
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<17)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCClipYOrigin
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<18)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCClipMask
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<19)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCDashOffset
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<20)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCDashList
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<21)
Packit 5bd3a9
T}
Packit 5bd3a9
\&#define	T{
Packit 5bd3a9
.ZN GCArcMode
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(1L<<22)
Packit 5bd3a9
T}
Packit 5bd3a9
.TE
Packit 5bd3a9
.IN "XGCValues" "" "@DEF@"
Packit 5bd3a9
.LP
Packit 5bd3a9
.Ds 0
Packit 5bd3a9
/\&* Values */
Packit 5bd3a9
Packit 5bd3a9
typedef struct {
Packit 5bd3a9
        int function;   /\&* logical operation */
Packit 5bd3a9
        unsigned long plane_mask;       /\&* plane mask */
Packit 5bd3a9
        unsigned long foreground;       /\&* foreground pixel */
Packit 5bd3a9
        unsigned long background;       /\&* background pixel */
Packit 5bd3a9
        int line_width; /\&* line width (in pixels) */
Packit 5bd3a9
        int line_style; /\&* LineSolid, LineOnOffDash, LineDoubleDash */
Packit 5bd3a9
        int cap_style;  /\&* CapNotLast, CapButt, CapRound, CapProjecting */
Packit 5bd3a9
        int join_style; /\&* JoinMiter, JoinRound, JoinBevel */
Packit 5bd3a9
        int fill_style; /\&* FillSolid, FillTiled, FillStippled FillOpaqueStippled*/
Packit 5bd3a9
        int fill_rule;  /\&* EvenOddRule, WindingRule */
Packit 5bd3a9
        int arc_mode;   /\&* ArcChord, ArcPieSlice */
Packit 5bd3a9
        Pixmap tile;    /\&* tile pixmap for tiling operations */
Packit 5bd3a9
        Pixmap stipple; /\&* stipple 1 plane pixmap for stippling */
Packit 5bd3a9
        int ts_x_origin;        /\&* offset for tile or stipple operations */
Packit 5bd3a9
        int ts_y_origin;
Packit 5bd3a9
        Font font;      /\&* default text font for text operations */
Packit 5bd3a9
        int subwindow_mode;     /\&* ClipByChildren, IncludeInferiors */
Packit 5bd3a9
        Bool graphics_exposures;        /\&* boolean, should exposures be generated */
Packit 5bd3a9
        int clip_x_origin;      /\&* origin for clipping */
Packit 5bd3a9
        int clip_y_origin;
Packit 5bd3a9
        Pixmap clip_mask;       /\&* bitmap clipping; other calls for rects */
Packit 5bd3a9
        int dash_offset;        /\&* patterned/dashed line information */
Packit 5bd3a9
        char dashes;
Packit 5bd3a9
} XGCValues;
Packit 5bd3a9
.De
Packit 5bd3a9
.LP
Packit 5bd3a9
The function attributes of a GC are used when you update a section of
Packit 5bd3a9
a drawable (the destination) with bits from somewhere else (the source).  
Packit 5bd3a9
The function in a GC defines how the new destination bits are to be
Packit 5bd3a9
computed from the source bits and the old destination bits.
Packit 5bd3a9
.ZN GXcopy
Packit 5bd3a9
is typically the most useful because it will work on a color display,
Packit 5bd3a9
but special applications may use other functions,
Packit 5bd3a9
particularly in concert with particular planes of a color display.
Packit 5bd3a9
The 16 GC functions, defined in 
Packit 5bd3a9
.hN X11/X.h ,
Packit 5bd3a9
are:
Packit 5bd3a9
.\" are listed in Table 5-1 along with the 
Packit 5bd3a9
.\"the associated hexadecimal code
Packit 5bd3a9
.\" and operation.
Packit 5bd3a9
.\".CP T 1
Packit 5bd3a9
.\"Display Functions
Packit 5bd3a9
.TS
Packit 5bd3a9
lw(1.5i) cw(.5i) lw(2i).
Packit 5bd3a9
_
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
.B
Packit 5bd3a9
Function Name	Value	Operation
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
_
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXclear
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0x0
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXand
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0x1
Packit 5bd3a9
T}	T{
Packit 5bd3a9
src AND dst
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXandReverse
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0x2
Packit 5bd3a9
T}	T{
Packit 5bd3a9
src AND NOT dst
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXcopy
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0x3
Packit 5bd3a9
T}	T{
Packit 5bd3a9
src
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXandInverted
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0x4
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(NOT src) AND dst
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXnoop
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0x5
Packit 5bd3a9
T}	T{
Packit 5bd3a9
dst
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXxor
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0x6
Packit 5bd3a9
T}	T{
Packit 5bd3a9
src XOR dst
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXor
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0x7
Packit 5bd3a9
T}	T{
Packit 5bd3a9
src OR dst
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXnor
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0x8
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(NOT src) AND (NOT dst)
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXequiv
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0x9
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(NOT src) XOR dst
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXinvert
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0xa
Packit 5bd3a9
T}	T{
Packit 5bd3a9
NOT dst
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXorReverse
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0xb
Packit 5bd3a9
T}	T{
Packit 5bd3a9
src OR (NOT dst)
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXcopyInverted
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0xc
Packit 5bd3a9
T}	T{
Packit 5bd3a9
NOT src
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXorInverted
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0xd
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(NOT src) OR dst
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXnand
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0xe
Packit 5bd3a9
T}	T{
Packit 5bd3a9
(NOT src) OR (NOT dst)
Packit 5bd3a9
T}
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN GXset
Packit 5bd3a9
T}	T{
Packit 5bd3a9
0xf
Packit 5bd3a9
T}	T{
Packit 5bd3a9
1
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
_
Packit 5bd3a9
.TE
Packit 5bd3a9
.LP
Packit 5bd3a9
Many graphics operations depend on either pixel values or planes in a GC.
Packit 5bd3a9
.IN "Pixel value"
Packit 5bd3a9
The planes attribute is of type long, and it specifies which planes of the
Packit 5bd3a9
destination are to be modified, one bit per plane.
Packit 5bd3a9
.IN "Plane" "mask"
Packit 5bd3a9
A monochrome display has only one plane and
Packit 5bd3a9
will be the least significant bit of the word.
Packit 5bd3a9
As planes are added to the display hardware, they will occupy more
Packit 5bd3a9
significant bits in the plane mask.
Packit 5bd3a9
.LP
Packit 5bd3a9
In graphics operations, given a source and destination pixel, 
Packit 5bd3a9
the result is computed bitwise on corresponding bits of the pixels.
Packit 5bd3a9
That is, a Boolean operation is performed in each bit plane.  
Packit 5bd3a9
The plane_mask restricts the operation to a subset of planes.
Packit 5bd3a9
A macro constant
Packit 5bd3a9
.ZN AllPlanes
Packit 5bd3a9
can be used to refer to all planes of the screen simultaneously.
Packit 5bd3a9
The result is computed by the following:
Packit 5bd3a9
.LP
Packit 5bd3a9
.Ds 
Packit 5bd3a9
((src FUNC dst) AND plane-mask) OR (dst AND (NOT plane-mask))
Packit 5bd3a9
.De
Packit 5bd3a9
.LP
Packit 5bd3a9
Range checking is not performed on the values for foreground,
Packit 5bd3a9
background, or plane_mask.
Packit 5bd3a9
They are simply truncated to the appropriate
Packit 5bd3a9
number of bits.
Packit 5bd3a9
The line-width is measured in pixels and either can be greater than or equal to
Packit 5bd3a9
one (wide line) or can be the special value zero (thin line).
Packit 5bd3a9
.LP
Packit 5bd3a9
Wide lines are drawn centered on the path described by the graphics request.
Packit 5bd3a9
Unless otherwise specified by the join-style or cap-style,
Packit 5bd3a9
the bounding box of a wide line with endpoints [x1, y1], [x2, y2] and
Packit 5bd3a9
width w is a rectangle with vertices at the following real coordinates:
Packit 5bd3a9
.LP
Packit 5bd3a9
.Ds
Packit 5bd3a9
[x1-(w*sn/2), y1+(w*cs/2)], [x1+(w*sn/2), y1-(w*cs/2)],
Packit 5bd3a9
[x2-(w*sn/2), y2+(w*cs/2)], [x2+(w*sn/2), y2-(w*cs/2)]
Packit 5bd3a9
.De
Packit 5bd3a9
.LP
Packit 5bd3a9
Here sn is the sine of the angle of the line,
Packit 5bd3a9
and cs is the cosine of the angle of the line.
Packit 5bd3a9
A pixel is part of the line and so is drawn
Packit 5bd3a9
if the center of the pixel is fully inside the bounding box
Packit 5bd3a9
(which is viewed as having infinitely thin edges).
Packit 5bd3a9
If the center of the pixel is exactly on the bounding box,
Packit 5bd3a9
it is part of the line if and only if the interior is immediately to its right
Packit 5bd3a9
(x increasing direction).
Packit 5bd3a9
Pixels with centers on a horizontal edge are a special case and are part of
Packit 5bd3a9
the line if and only if the interior or the boundary is immediately below 
Packit 5bd3a9
(y increasing direction) and the interior or the boundary is immediately
Packit 5bd3a9
to the right (x increasing direction).
Packit 5bd3a9
.LP
Packit 5bd3a9
Thin lines (zero line-width) are one-pixel-wide lines drawn using an
Packit 5bd3a9
unspecified, device-dependent algorithm.
Packit 5bd3a9
There are only two constraints on this algorithm. 
Packit 5bd3a9
.IP 1. 5
Packit 5bd3a9
If a line is drawn unclipped from [x1,y1] to [x2,y2] and
Packit 5bd3a9
if another line is drawn unclipped from [x1+dx,y1+dy] to [x2+dx,y2+dy],
Packit 5bd3a9
a point [x,y] is touched by drawing the first line 
Packit 5bd3a9
if and only if the point [x+dx,y+dy] is touched by drawing the second line.
Packit 5bd3a9
.IP 2. 5
Packit 5bd3a9
The effective set of points comprising a line cannot be affected by clipping.
Packit 5bd3a9
That is, a point is touched in a clipped line if and only if the point 
Packit 5bd3a9
lies inside the clipping region and the point would be touched
Packit 5bd3a9
by the line when drawn unclipped.
Packit 5bd3a9
.LP
Packit 5bd3a9
A wide line drawn from [x1,y1] to [x2,y2] always draws the same pixels 
Packit 5bd3a9
as a wide line drawn from [x2,y2] to [x1,y1], not counting cap-style 
Packit 5bd3a9
and join-style.
Packit 5bd3a9
It is recommended that this property be true for thin lines, 
Packit 5bd3a9
but this is not required.
Packit 5bd3a9
A line-width of zero may differ from a line-width of one in which pixels are
Packit 5bd3a9
drawn.
Packit 5bd3a9
This permits the use of many manufacturers' line drawing hardware,
Packit 5bd3a9
which may run many times faster than the more precisely specified
Packit 5bd3a9
wide lines.
Packit 5bd3a9
.LP
Packit 5bd3a9
In general, 
Packit 5bd3a9
drawing a thin line will be faster than drawing a wide line of width one.
Packit 5bd3a9
However, because of their different drawing algorithms,
Packit 5bd3a9
thin lines may not mix well aesthetically with wide lines.
Packit 5bd3a9
If it is desirable to obtain precise and uniform results across all displays,
Packit 5bd3a9
a client should always use a line-width of one rather than a line-width of zero.
Packit 5bd3a9
.LP
Packit 5bd3a9
The line-style defines which sections of a line are drawn:
Packit 5bd3a9
.TS
Packit 5bd3a9
lw(1.3i) lw(4.5i).
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN LineSolid
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The full path of the line is drawn.
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN LineDoubleDash
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The full path of the line is drawn, 
Packit 5bd3a9
but the even dashes are filled differently 
Packit 5bd3a9
from the odd dashes (see fill-style) with
Packit 5bd3a9
.ZN CapButt 
Packit 5bd3a9
style used where even and odd dashes meet.
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN LineOnOffDash
Packit 5bd3a9
T}	T{
Packit 5bd3a9
Only the even dashes are drawn,
Packit 5bd3a9
and cap-style applies to 
Packit 5bd3a9
all internal ends of the individual dashes,
Packit 5bd3a9
except 
Packit 5bd3a9
.ZN CapNotLast
Packit 5bd3a9
is treated as 
Packit 5bd3a9
.ZN CapButt . 
Packit 5bd3a9
T}
Packit 5bd3a9
.TE
Packit 5bd3a9
.LP
Packit 5bd3a9
The cap-style defines how the endpoints of a path are drawn:
Packit 5bd3a9
.IN "Graphics context" "path"
Packit 5bd3a9
.TS
Packit 5bd3a9
lw(1.3i) lw(4.5i).
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN CapNotLast
Packit 5bd3a9
T}	T{
Packit 5bd3a9
This is equivalent to 
Packit 5bd3a9
.ZN CapButt  
Packit 5bd3a9
except that for a line-width of zero the final endpoint is not drawn.
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN CapButt
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The line is square at the endpoint (perpendicular to the slope of the line)
Packit 5bd3a9
with no projection beyond.
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN CapRound
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The line has a circular arc with the diameter equal to the line-width,
Packit 5bd3a9
centered on the endpoint.
Packit 5bd3a9
(This is equivalent to 
Packit 5bd3a9
.ZN CapButt 
Packit 5bd3a9
for line-width of zero).
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN CapProjecting
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The line is square at the end, but the path continues beyond the endpoint 
Packit 5bd3a9
for a distance equal to half the line-width.
Packit 5bd3a9
(This is equivalent to 
Packit 5bd3a9
.ZN CapButt 
Packit 5bd3a9
for line-width of zero).
Packit 5bd3a9
T}
Packit 5bd3a9
.TE
Packit 5bd3a9
.LP
Packit 5bd3a9
The join-style defines how corners are drawn for wide lines:
Packit 5bd3a9
.TS
Packit 5bd3a9
lw(1.3i) lw(4.5i).
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN JoinMiter
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The outer edges of two lines extend to meet at an angle.
Packit 5bd3a9
However, if the angle is less than 11 degrees,
Packit 5bd3a9
then a
Packit 5bd3a9
.ZN JoinBevel
Packit 5bd3a9
join-style is used instead.
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN JoinRound
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The corner is a circular arc with the diameter equal to the line-width, 
Packit 5bd3a9
centered on the joinpoint.
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN JoinBevel
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The corner has
Packit 5bd3a9
.ZN CapButt 
Packit 5bd3a9
endpoint styles with the triangular notch filled.
Packit 5bd3a9
T}
Packit 5bd3a9
.TE
Packit 5bd3a9
.LP
Packit 5bd3a9
For a line with coincident endpoints (x1=x2, y1=y2), 
Packit 5bd3a9
when the cap-style is applied to both endpoints, 
Packit 5bd3a9
the semantics depends on the line-width and the cap-style:
Packit 5bd3a9
.TS
Packit 5bd3a9
lw(1.3i) lw(.5i) lw(4i).
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN CapNotLast
Packit 5bd3a9
T}	T{
Packit 5bd3a9
thin
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The results are device dependent, 
Packit 5bd3a9
but the desired effect is that nothing is drawn.
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN CapButt
Packit 5bd3a9
T}	T{
Packit 5bd3a9
thin
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The results are device dependent, 
Packit 5bd3a9
but the desired effect is that a single pixel is drawn.
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN CapRound
Packit 5bd3a9
T}	T{
Packit 5bd3a9
thin
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The results are the same as for
Packit 5bd3a9
.ZN CapButt /thin.
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN CapProjecting
Packit 5bd3a9
T}	T{
Packit 5bd3a9
thin
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The results are the same as for
Packit 5bd3a9
.ZN CapButt /thin.
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN CapButt
Packit 5bd3a9
T}	T{
Packit 5bd3a9
wide
Packit 5bd3a9
T}	T{
Packit 5bd3a9
Nothing is drawn.
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN CapRound
Packit 5bd3a9
T}	T{
Packit 5bd3a9
wide
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The closed path is a circle, centered at the endpoint, and
Packit 5bd3a9
with the diameter equal to the line-width.
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN CapProjecting
Packit 5bd3a9
T}	T{
Packit 5bd3a9
wide
Packit 5bd3a9
T}	T{
Packit 5bd3a9
The closed path is a square, aligned with the coordinate axes, centered at the
Packit 5bd3a9
endpoint, and with the sides equal to the line-width.
Packit 5bd3a9
T}
Packit 5bd3a9
.TE
Packit 5bd3a9
.LP
Packit 5bd3a9
For a line with coincident endpoints (x1=x2, y1=y2), 
Packit 5bd3a9
when the join-style is applied at one or both endpoints, 
Packit 5bd3a9
the effect is as if the line was removed from the overall path.
Packit 5bd3a9
However, if the total path consists of or is reduced to a single point joined
Packit 5bd3a9
with itself, the effect is the same as when the cap-style is applied at both
Packit 5bd3a9
endpoints.
Packit 5bd3a9
.LP
Packit 5bd3a9
The tile/stipple represents an infinite two-dimensional plane,
Packit 5bd3a9
with the tile/stipple replicated in all dimensions.
Packit 5bd3a9
When that plane is superimposed on the drawable
Packit 5bd3a9
for use in a graphics operation, the upper-left corner
Packit 5bd3a9
of some instance of the tile/stipple is at the coordinates within
Packit 5bd3a9
the drawable specified by the tile/stipple origin.
Packit 5bd3a9
The tile/stipple and clip origins are interpreted relative to the
Packit 5bd3a9
origin of whatever destination drawable is specified in a graphics
Packit 5bd3a9
request.
Packit 5bd3a9
The tile pixmap must have the same root and depth as the GC,
Packit 5bd3a9
or a
Packit 5bd3a9
.ZN BadMatch 
Packit 5bd3a9
error results.
Packit 5bd3a9
The stipple pixmap must have depth one and must have the same root as the
Packit 5bd3a9
GC, or a 
Packit 5bd3a9
.ZN BadMatch 
Packit 5bd3a9
error results.  
Packit 5bd3a9
For stipple operations where the fill-style is
Packit 5bd3a9
.ZN FillStippled
Packit 5bd3a9
but not 
Packit 5bd3a9
.ZN FillOpaqueStippled ,
Packit 5bd3a9
the stipple pattern is tiled in a
Packit 5bd3a9
single plane and acts as an additional clip mask to be ANDed with the clip-mask.
Packit 5bd3a9
Although some sizes may be faster to use than others,
Packit 5bd3a9
any size pixmap can be used for tiling or stippling.
Packit 5bd3a9
.LP
Packit 5bd3a9
The fill-style defines the contents of the source for line, text, and
Packit 5bd3a9
fill requests.  
Packit 5bd3a9
For all text and fill requests (for example,
Packit 5bd3a9
.ZN XDrawText , 
Packit 5bd3a9
.ZN XDrawText16 ,
Packit 5bd3a9
.ZN XFillRectangle , 
Packit 5bd3a9
.ZN XFillPolygon , 
Packit 5bd3a9
and
Packit 5bd3a9
.ZN XFillArc );
Packit 5bd3a9
for line requests 
Packit 5bd3a9
with line-style 
Packit 5bd3a9
.ZN LineSolid 
Packit 5bd3a9
(for example,
Packit 5bd3a9
.ZN XDrawLine ,
Packit 5bd3a9
.ZN XDrawSegments , 
Packit 5bd3a9
.ZN XDrawRectangle ,
Packit 5bd3a9
.ZN XDrawArc );
Packit 5bd3a9
and for the even dashes for line requests with line-style 
Packit 5bd3a9
.ZN LineOnOffDash 
Packit 5bd3a9
or 
Packit 5bd3a9
.ZN LineDoubleDash ,
Packit 5bd3a9
the following apply:
Packit 5bd3a9
.TS
Packit 5bd3a9
lw(1.8i) lw(4i).
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN FillSolid
Packit 5bd3a9
T}	T{
Packit 5bd3a9
Foreground
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN FillTiled
Packit 5bd3a9
T}	T{
Packit 5bd3a9
Tile
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN FillOpaqueStippled
Packit 5bd3a9
T}	T{
Packit 5bd3a9
A tile with the same width and height as stipple,
Packit 5bd3a9
but with background everywhere stipple has a zero
Packit 5bd3a9
and with foreground everywhere stipple has a one
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN FillStippled
Packit 5bd3a9
T}	T{
Packit 5bd3a9
Foreground masked by stipple
Packit 5bd3a9
T}
Packit 5bd3a9
.TE
Packit 5bd3a9
.LP
Packit 5bd3a9
When drawing lines with line-style
Packit 5bd3a9
.ZN LineDoubleDash ,
Packit 5bd3a9
the odd dashes are controlled by the fill-style in the following manner:
Packit 5bd3a9
.TS
Packit 5bd3a9
lw(1.8i) lw(4i).
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN FillSolid
Packit 5bd3a9
T}	T{
Packit 5bd3a9
Background
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN FillTiled
Packit 5bd3a9
T}	T{
Packit 5bd3a9
Same as for even dashes
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN FillOpaqueStippled
Packit 5bd3a9
T}	T{
Packit 5bd3a9
Same as for even dashes
Packit 5bd3a9
T}
Packit 5bd3a9
.sp 6p
Packit 5bd3a9
T{
Packit 5bd3a9
.ZN FillStippled
Packit 5bd3a9
T}	T{
Packit 5bd3a9
Background masked by stipple
Packit 5bd3a9
T}
Packit 5bd3a9
.TE
Packit 5bd3a9
.LP
Packit 5bd3a9
Storing a pixmap in a GC might or might not result in a copy
Packit 5bd3a9
being made.
Packit 5bd3a9
If the pixmap is later used as the destination for a graphics request,
Packit 5bd3a9
the change might or might not be reflected in the GC.
Packit 5bd3a9
If the pixmap is used simultaneously in a graphics request both as
Packit 5bd3a9
a destination and as a tile or stipple,
Packit 5bd3a9
the results are undefined.
Packit 5bd3a9
.LP
Packit 5bd3a9
For optimum performance,
Packit 5bd3a9
you should draw as much as possible with the same GC 
Packit 5bd3a9
(without changing its components).
Packit 5bd3a9
The costs of changing GC components relative to using different GCs
Packit 5bd3a9
depend on the display hardware and the server implementation.
Packit 5bd3a9
It is quite likely that some amount of GC information will be
Packit 5bd3a9
cached in display hardware and that such hardware can only cache a small number
Packit 5bd3a9
of GCs.
Packit 5bd3a9
.LP
Packit 5bd3a9
The dashes value is actually a simplified form of the
Packit 5bd3a9
more general patterns that can be set with 
Packit 5bd3a9
.ZN XSetDashes .  
Packit 5bd3a9
Specifying a
Packit 5bd3a9
value of N is equivalent to specifying the two-element list [N, N] in 
Packit 5bd3a9
.ZN XSetDashes . 
Packit 5bd3a9
The value must be nonzero,
Packit 5bd3a9
or a
Packit 5bd3a9
.ZN BadValue
Packit 5bd3a9
error results.
Packit 5bd3a9
.LP
Packit 5bd3a9
The clip-mask restricts writes to the destination drawable.  
Packit 5bd3a9
If the clip-mask is set to a pixmap,
Packit 5bd3a9
it must have depth one and have the same root as the GC,
Packit 5bd3a9
or a
Packit 5bd3a9
.ZN BadMatch 
Packit 5bd3a9
error results.
Packit 5bd3a9
If clip-mask is set to
Packit 5bd3a9
.ZN None ,
Packit 5bd3a9
the pixels are always drawn regardless of the clip origin.
Packit 5bd3a9
The clip-mask also can be set by calling the
Packit 5bd3a9
.ZN XSetClipRectangles
Packit 5bd3a9
or
Packit 5bd3a9
.ZN XSetRegion
Packit 5bd3a9
functions.
Packit 5bd3a9
Only pixels where the clip-mask has a bit set to 1 are drawn.  
Packit 5bd3a9
Pixels are not drawn outside the area covered by the clip-mask 
Packit 5bd3a9
or where the clip-mask has a bit set to 0.
Packit 5bd3a9
The clip-mask affects all graphics requests.
Packit 5bd3a9
The clip-mask does not clip sources.
Packit 5bd3a9
The clip-mask origin is interpreted relative to the origin of whatever
Packit 5bd3a9
destination drawable is specified in a graphics request.
Packit 5bd3a9
.LP
Packit 5bd3a9
You can set the subwindow-mode to
Packit 5bd3a9
.ZN ClipByChildren
Packit 5bd3a9
or
Packit 5bd3a9
.ZN IncludeInferiors .
Packit 5bd3a9
For 
Packit 5bd3a9
.ZN ClipByChildren , 
Packit 5bd3a9
both source and destination windows are
Packit 5bd3a9
additionally clipped by all viewable 
Packit 5bd3a9
.ZN InputOutput
Packit 5bd3a9
children.  
Packit 5bd3a9
For 
Packit 5bd3a9
.ZN IncludeInferiors ,
Packit 5bd3a9
neither source nor destination window is clipped by inferiors. 
Packit 5bd3a9
This will result in including subwindow contents in the source
Packit 5bd3a9
and drawing through subwindow boundaries of the destination.
Packit 5bd3a9
The use of 
Packit 5bd3a9
.ZN IncludeInferiors 
Packit 5bd3a9
on a window of one depth with mapped
Packit 5bd3a9
inferiors of differing depth is not illegal, but the semantics are
Packit 5bd3a9
undefined by the core protocol.
Packit 5bd3a9
.LP
Packit 5bd3a9
The fill-rule defines what pixels are inside (drawn) for
Packit 5bd3a9
paths given in 
Packit 5bd3a9
.ZN XFillPolygon 
Packit 5bd3a9
requests and can be set to 
Packit 5bd3a9
.ZN EvenOddRule 
Packit 5bd3a9
or
Packit 5bd3a9
.ZN WindingRule .
Packit 5bd3a9
For
Packit 5bd3a9
.ZN EvenOddRule ,
Packit 5bd3a9
a point is inside if
Packit 5bd3a9
an infinite ray with the point as origin crosses the path an odd number
Packit 5bd3a9
of times.  
Packit 5bd3a9
For 
Packit 5bd3a9
.ZN WindingRule , 
Packit 5bd3a9
a point is inside if an infinite ray with the
Packit 5bd3a9
point as origin crosses an unequal number of clockwise and
Packit 5bd3a9
counterclockwise directed path segments.
Packit 5bd3a9
A clockwise directed path segment is one that crosses the ray from left to
Packit 5bd3a9
right as observed from the point.
Packit 5bd3a9
A counterclockwise segment is one that crosses the ray from right to left
Packit 5bd3a9
as observed from the point.
Packit 5bd3a9
The case where a directed line segment is coincident with the ray is
Packit 5bd3a9
uninteresting because you can simply choose a different ray that is not
Packit 5bd3a9
coincident with a segment.
Packit 5bd3a9
.LP
Packit 5bd3a9
For both 
Packit 5bd3a9
.ZN EvenOddRule
Packit 5bd3a9
and
Packit 5bd3a9
.ZN WindingRule ,
Packit 5bd3a9
a point is infinitely small, 
Packit 5bd3a9
and the path is an infinitely thin line.  
Packit 5bd3a9
A pixel is inside if the center point of the pixel is inside
Packit 5bd3a9
and the center point is not on the boundary.  
Packit 5bd3a9
If the center point is on the boundary,
Packit 5bd3a9
the pixel is inside if and only if the polygon interior is immediately to
Packit 5bd3a9
its right (x increasing direction).  
Packit 5bd3a9
Pixels with centers on a horizontal edge are a special case 
Packit 5bd3a9
and are inside if and only if the polygon interior is immediately below 
Packit 5bd3a9
(y increasing direction).
Packit 5bd3a9
.LP
Packit 5bd3a9
The arc-mode controls filling in the 
Packit 5bd3a9
.ZN XFillArcs
Packit 5bd3a9
function and can be set to
Packit 5bd3a9
.ZN ArcPieSlice
Packit 5bd3a9
or
Packit 5bd3a9
.ZN ArcChord .
Packit 5bd3a9
For
Packit 5bd3a9
.ZN ArcPieSlice ,
Packit 5bd3a9
the arcs are pie-slice filled.
Packit 5bd3a9
For
Packit 5bd3a9
.ZN ArcChord ,
Packit 5bd3a9
the arcs are chord filled.
Packit 5bd3a9
.LP
Packit 5bd3a9
The graphics-exposure flag controls 
Packit 5bd3a9
.ZN GraphicsExpose 
Packit 5bd3a9
event generation
Packit 5bd3a9
for 
Packit 5bd3a9
.ZN XCopyArea 
Packit 5bd3a9
and 
Packit 5bd3a9
.ZN XCopyPlane
Packit 5bd3a9
requests (and any similar requests defined by extensions).
Packit 5bd3a9
.SH DIAGNOSTICS
Packit 5bd3a9
.TP 1i
Packit 5bd3a9
.ZN BadAlloc
Packit 5bd3a9
The server failed to allocate the requested resource or server memory.
Packit 5bd3a9
.TP 1i
Packit 5bd3a9
.ZN BadDrawable
Packit 5bd3a9
A value for a Drawable argument does not name a defined Window or Pixmap.
Packit 5bd3a9
.TP 1i
Packit 5bd3a9
.ZN BadFont
Packit 5bd3a9
A value for a Font or GContext argument does not name a defined Font.
Packit 5bd3a9
.TP 1i
Packit 5bd3a9
.ZN BadGC
Packit 5bd3a9
A value for a GContext argument does not name a defined GContext.
Packit 5bd3a9
.TP 1i
Packit 5bd3a9
.ZN BadMatch
Packit 5bd3a9
An
Packit 5bd3a9
.ZN InputOnly
Packit 5bd3a9
window is used as a Drawable.
Packit 5bd3a9
.TP 1i
Packit 5bd3a9
.ZN BadMatch
Packit 5bd3a9
Some argument or pair of arguments has the correct type and range but fails
Packit 5bd3a9
to match in some other way required by the request.
Packit 5bd3a9
.TP 1i
Packit 5bd3a9
.ZN BadPixmap
Packit 5bd3a9
A value for a Pixmap argument does not name a defined Pixmap.
Packit 5bd3a9
.TP 1i
Packit 5bd3a9
.ZN BadValue
Packit 5bd3a9
Some numeric value falls outside the range of values accepted by the request.
Packit 5bd3a9
Unless a specific range is specified for an argument, the full range defined
Packit 5bd3a9
by the argument's type is accepted.  Any argument defined as a set of
Packit 5bd3a9
alternatives can generate this error.
Packit 5bd3a9
.SH "SEE ALSO"
Packit 5bd3a9
AllPlanes(__libmansuffix__),
Packit 5bd3a9
XCopyArea(__libmansuffix__),
Packit 5bd3a9
XCreateRegion(__libmansuffix__),
Packit 5bd3a9
XDrawArc(__libmansuffix__),
Packit 5bd3a9
XDrawLine(__libmansuffix__),
Packit 5bd3a9
XDrawRectangle(__libmansuffix__),
Packit 5bd3a9
XDrawText(__libmansuffix__),
Packit 5bd3a9
XFillRectangle(__libmansuffix__),
Packit 5bd3a9
XQueryBestSize(__libmansuffix__),
Packit 5bd3a9
XSetArcMode(__libmansuffix__),
Packit 5bd3a9
XSetClipOrigin(__libmansuffix__),
Packit 5bd3a9
XSetFillStyle(__libmansuffix__),
Packit 5bd3a9
XSetFont(__libmansuffix__),
Packit 5bd3a9
XSetLineAttributes(__libmansuffix__),
Packit 5bd3a9
XSetState(__libmansuffix__),
Packit 5bd3a9
XSetTile(__libmansuffix__)
Packit 5bd3a9
.br
Packit 5bd3a9
\fI\*(xL\fP