XLIB FUNCTIONS XCreateGC(3x11)
NAME
XCreateGC, XCopyGC, XChangeGC, XGetGCValues, XFreeGC, XGCon-
textFromGC, XGCValues - create or free graphics contexts and
graphics context structure SYNTAXcc [ flag... ] file... -lX11 [ library... ]
GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values); int XCopyGC(Display *display, GC src, unsigned long valuemask, GC dest); int XChangeGC(Display *display, GC gc, unsigned long valuemask, XGCValues *values); Status XGetGCValues(Display *display, GC gc, unsigned longvaluemask, 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 andreturns 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. X Version 11 Last change: libX11 1.3.5 1 XLIB FUNCTIONS XCreateGC(3x11)XCreateGC can generate BadAlloc, BadDrawable, BadFont, Bad-
Match, BadPixmap, and BadValue errors. The XCopyGC function copies the specified components fromthe source GC to the destination GC. The source and desti-
nation 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 byvaluemask for the specified GC. The values argument con-
tains the values to be set. The values and restrictions arethe 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
XSetDashes request on the context. The order in which com-
ponents 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 specifiedby valuemask for the specified GC. If the valuemask con-
tains 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 zerostatus. 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: X Version 11 Last change: libX11 1.3.5 2 XLIB FUNCTIONS XCreateGC(3x11) /* GC attribute value mask bits */ X Version 11 Last change: libX11 1.3.5 3