XCopyArea(3X) XCopyArea(3X)NAME XCopyArea, XCopyPlane - copy areas SYNOPSIS XCopyArea (display, src, dest, gc, src-x, src-y, width, height, dest-x, dest-y) Display *display; Drawable src, dest; GC gc; int src-x,src-y; unsigned int width, height; int dest-x, dest-y; XCopyPlane (display, src, dest, gc, src-x, src-y, width, height, dest-x, dest-y, plane) Display *display; Drawable src, dest; GC gc; int src-x, src-y; unsigned int width, height; int dest-x, dest-y; unsigned long plane; DESCRIPTION The XCopyArea function combines the specified rectangle of src with the specified rectangle of dest. The drawables must have the same root and depth, or a BadMatch error results. If regions of the source rectangle are obscured and have not been retained in backing store or if regions outside the boundaries of the source drawable are specified, those re- gions are not copied. Instead, the following occurs on all corresponding destination regions that are either visible or are retained in backing store. If the destination is a win- dow with a background other than None, corresponding regions of the destination are tiled with that background (with plane-mask of all ones and GXcopy function). Regardless of tiling or whether the destination is a window or a pixel map, if graphics-exposures is TRUE, GraphicsExpose events for all corresponding destination regions are generated. If graphics-exposures is TRUE but no GraphicsExpose events are generated, a NoExpose event is generated. Note that by de- fault graphics-exposures is TRUE in new graphic contexts. The XCopyArea function uses these graphic context com- ponents: function, plane-mask, subwindow-mode, graphics- exposures, clip-x-origin, clip-y-origin, and clip-mask. The XCopyPlane function uses a single bit plane of the specified source rectangle combined with the specified graphic context to modify the specified rectangle of dest. November, 1990 1
XCopyArea(3X) XCopyArea(3X)The drawables must have the same root but need not have the same depth. If the drawables do not have the same root, a BadMatch error results. If plane does not have exactly onenbit set to 1 and the values of planes must be less than 2 ,where n is the depth of src, a BadValue error results. Effectively, XCopyPlane forms a pixel map of the same depth as the rectangle of dest and with a size specified by the source region. It uses the foreground and background pixels in the graphic context (foreground everywhere the bit plane in src contains a bit set to 1, background everywhere the bit plane in src contains a bit set to 0) and the equivalent of a CopyArea protocol request is performed with all the same exposure semantics. This can also be thought of as us- ing the specified region of the source bit plane as a stip- ple with a fill-style of FillOpaqueStippled for filling a rectangular area of the destination. The XCopyPlane function uses these graphic context com- ponents: function, plane-mask, foreground, background, subwindow-mode, graphics-exposures, clip-x-origin, clip-y- origin, and clip-mask. Arguments These functions accept the following arguments: dest-x, dest-y Specify the x and y coordinates of the destination rectangle relative to its origin. These coordinates indicate the upper-left corner of the destination rectangle. display Specifies the connection to the X server. gc Specifies the graphic context. plane Specifies the bit plane. Exactly one bit must be set. src, dest Specify the source and destination rectangles to be combined. src-x, src-y Specify the x and y coordinates of the source rec- tangle relative to its origin. These coordinates specify the upper-left corner of the source rectan- gle. width , height Specify the width and height, which are the dimen- 2 November, 1990
XCopyArea(3X) XCopyArea(3X)sions of both the source and destination rectangles. ERRORS BadDrawable A value for a Drawable argument does not name a de- fined window or pixel map. BadGC A value for a GC argument does not name a defined graphic context. BadMatch An InputOnly window is used as a drawable; or, an argument or pair of arguments has the correct type and range but fails to match in some other required way. BadValue A numeric value falls outside the range of values accepted by the request. Unless a range is speci- fied for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error. The XCopyArea function can generate BadDrawable, BadGC, and BadMatch errors. The XCopyPlane function can generate BadDrawable, BadGC, BadMatch, and BadValue errors. SEE ALSO XClearArea(3X)Xlib - C Language InterfaceNovember, 1990 3