XCreateGC(3X11) XLIB FUNCTIONS XCreateGC(3X11)
NAME
XCreateGC, XCopyGC, XChangeGC, XGetGCValues, XFreeGC, XGCon-
textFromGC, XGCValues - create or free graphics contexts and
graphics context structure
SYNTAX
GC XCreateGC(Display *display, Drawable d, unsigned long
valuemask, XGCValues *values);
int XCopyGC(Display *display, GC src, GC dest, unsigned long
valuemask);
int XChangeGC(Display *display, GC gc, unsigned long
valuemask, XGCValues *values);
Status XGetGCValues(Display *display, GC gc, unsigned long
valuemask, XGCValues *values_return);
int XFreeGC(Display *display, GC gc);
GContext XGContextFromGC(GC gc);
ARGUMENTS
d Specifies the drawable.
dest Specifies the destination GC.
display Specifies the connection to the X server.
gc Specifies the GC.
src Specifies the components of the source GC.
valuemask Specifies which components in the GC are to be
set, copied, changed, or returned . This argument
is the bitwise inclusive OR of zero or more of the
valid GC component mask bits.
values Specifies any values as specified by the
valuemask.
values_return
Returns the GC values in the specified XGCValues
structure.
DESCRIPTION
The XCreateGC function creates a graphics context and
returns a GC. The GC can be used with any destination draw-
able having the same root and depth as the specified draw-
able. Use with other drawables results in a BadMatch error.
XFree86 Version 4.5.0 1
XCreateGC(3X11) XLIB FUNCTIONS XCreateGC(3X11)
XCreateGC can generate BadAlloc, BadDrawable, BadFont, Bad-
Match, BadPixmap, and BadValue errors.
The XCopyGC function copies the specified components from
the source GC to the destination GC. The source and destina-
tion GCs must have the same root and depth, or a BadMatch
error results. The valuemask specifies which component to
copy, as for XCreateGC.
XCopyGC can generate BadAlloc, BadGC, and BadMatch errors.
The XChangeGC function changes the components specified by
valuemask for the specified GC. The values argument contains
the values to be set. The values and restrictions are the
same as for XCreateGC. Changing the clip-mask overrides any
previous XSetClipRectangles request on the context. Changing
the dash-offset or dash-list overrides any previous XSet-
Dashes request on the context. The order in which components
are verified and altered is server dependent. If an error is
generated, a subset of the components may have been altered.
XChangeGC can generate BadAlloc, BadFont, BadGC, BadMatch,
BadPixmap, and BadValue errors.
The XGetGCValues function returns the components specified
by valuemask for the specified GC. If the valuemask contains
a valid set of GC mask bits (GCFunction, GCPlaneMask,
GCForeground, GCBackground, GCLineWidth, GCLineStyle,
GCCapStyle, GCJoinStyle, GCFillStyle, GCFillRule, GCTile,
GCStipple, GCTileStipXOrigin, GCTileStipYOrigin, GCFont,
GCSubwindowMode, GCGraphicsExposures, GCClipXOrigin, GCCLi-
pYOrigin, GCDashOffset, or GCArcMode) and no error occurs,
XGetGCValues sets the requested components in values_return
and returns a nonzero status. Otherwise, it returns a zero
status. Note that the clip-mask and dash-list (represented
by the GCClipMask and GCDashList bits, respectively, in the
valuemask) cannot be requested. Also note that an invalid
resource ID (with one or more of the three most significant
bits set to 1) will be returned for GCFont, GCTile, and
GCStipple if the component has never been explicitly set by
the client.
The XFreeGC function destroys the specified GC as well as
all the associated storage.
XFreeGC can generate a BadGC error.
STRUCTURES
The XGCValues structure contains:
/* GC attribute value mask bits */
XFree86 Version 4.5.0 2