Imported Upstream version 1.6.2
[platform/upstream/libX11.git] / man / XCopyArea.man
1 .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium
2 .\"
3 .\" Permission is hereby granted, free of charge, to any person obtaining
4 .\" a copy of this software and associated documentation files (the
5 .\" "Software"), to deal in the Software without restriction, including
6 .\" without limitation the rights to use, copy, modify, merge, publish,
7 .\" distribute, sublicense, and/or sell copies of the Software, and to
8 .\" permit persons to whom the Software is furnished to do so, subject to
9 .\" the following conditions:
10 .\"
11 .\" The above copyright notice and this permission notice shall be included
12 .\" in all copies or substantial portions of the Software.
13 .\"
14 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 .\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 .\" OTHER DEALINGS IN THE SOFTWARE.
21 .\"
22 .\" Except as contained in this notice, the name of the X Consortium shall
23 .\" not be used in advertising or otherwise to promote the sale, use or
24 .\" other dealings in this Software without prior written authorization
25 .\" from the X Consortium.
26 .\"
27 .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by
28 .\" Digital Equipment Corporation
29 .\"
30 .\" Portions Copyright \(co 1990, 1991 by
31 .\" Tektronix, Inc.
32 .\"
33 .\" Permission to use, copy, modify and distribute this documentation for
34 .\" any purpose and without fee is hereby granted, provided that the above
35 .\" copyright notice appears in all copies and that both that copyright notice
36 .\" and this permission notice appear in all copies, and that the names of
37 .\" Digital and Tektronix not be used in in advertising or publicity pertaining
38 .\" to this documentation without specific, written prior permission.
39 .\" Digital and Tektronix makes no representations about the suitability
40 .\" of this documentation for any purpose.
41 .\" It is provided ``as is'' without express or implied warranty.
42 .\" 
43 .\"
44 .ds xT X Toolkit Intrinsics \- C Language Interface
45 .ds xW Athena X Widgets \- C Language X Toolkit Interface
46 .ds xL Xlib \- C Language X Interface
47 .ds xC Inter-Client Communication Conventions Manual
48 .na
49 .de Ds
50 .nf
51 .\\$1D \\$2 \\$1
52 .ft CW
53 .\".ps \\n(PS
54 .\".if \\n(VS>=40 .vs \\n(VSu
55 .\".if \\n(VS<=39 .vs \\n(VSp
56 ..
57 .de De
58 .ce 0
59 .if \\n(BD .DF
60 .nr BD 0
61 .in \\n(OIu
62 .if \\n(TM .ls 2
63 .sp \\n(DDu
64 .fi
65 ..
66 .de IN          \" send an index entry to the stderr
67 ..
68 .de Pn
69 .ie t \\$1\fB\^\\$2\^\fR\\$3
70 .el \\$1\fI\^\\$2\^\fP\\$3
71 ..
72 .de ZN
73 .ie t \fB\^\\$1\^\fR\\$2
74 .el \fI\^\\$1\^\fP\\$2
75 ..
76 .de hN
77 .ie t <\fB\\$1\fR>\\$2
78 .el <\fI\\$1\fP>\\$2
79 ..
80 .ny0
81 .TH XCopyArea __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS"
82 .SH NAME
83 XCopyArea, XCopyPlane \- copy areas
84 .SH SYNTAX
85 .HP
86 int XCopyArea\^(\^Display *\fIdisplay\fP\^, Drawable \fIsrc\fP\^, Drawable
87 \fIdest\fP\^, GC \fIgc\fP\^, int \fIsrc_x\fP\^, int \fIsrc_y\fP\^, unsigned
88 int \fIwidth\fP\^, unsigned \fIheight\fP\^, int \fIdest_x\fP\^, int
89 \fIdest_y\fP\^);
90 .HP
91 int XCopyPlane\^(\^Display *\fIdisplay\fP\^, Drawable \fIsrc\fP\^, Drawable
92 \fIdest\fP\^, GC \fIgc\fP\^, int \fIsrc_x\fP\^, int \fIsrc_y\fP\^, unsigned
93 \fIwidth\fP\^, int \fIheight\fP\^, int \fIdest_x\fP\^, int \fIdest_y\fP\^,
94 unsigned long \fIplane\fP\^); 
95 .SH ARGUMENTS
96 .ds Dx , which are relative to the origin of the destination rectangle \
97 and specify its upper-left corner
98 .IP \fIdest_x\fP 1i
99 .br
100 .ns
101 .IP \fIdest_y\fP 1i
102 Specify the x and y coordinates\*(Dx. 
103 .IP \fIdisplay\fP 1i
104 Specifies the connection to the X server.
105 .IP \fIgc\fP 1i
106 Specifies the GC.
107 .IP \fIplane\fP 1i
108 Specifies the bit plane.
109 You must set exactly one bit to 1.
110 .IP \fIsrc\fP 1i
111 .br
112 .ns
113 .IP \fIdest\fP 1i
114 Specify the source and destination rectangles to be combined. 
115 .IP \fIsrc_x\fP 1i
116 .br
117 .ns
118 .IP \fIsrc_y\fP 1i
119 Specify the x and y coordinates, 
120 which are relative to the origin of the source rectangle
121 and specify its upper-left corner.
122 .ds Wh , which are the dimensions of both the source and destination rectangles
123 .IP \fIwidth\fP 1i
124 .br
125 .ns
126 .IP \fIheight\fP 1i
127 Specify the width and height\*(Wh.
128 .SH DESCRIPTION
129 The
130 .ZN XCopyArea
131 function combines the specified rectangle of src with the specified rectangle 
132 of dest.
133 The drawables must have the same root and depth,
134 or a
135 .ZN BadMatch
136 error results.
137 .LP
138 If regions of the source rectangle are obscured and have not been
139 retained in backing store 
140 or if regions outside the boundaries of the source drawable are specified, 
141 those regions are not copied. 
142 Instead, the 
143 following occurs on all corresponding destination regions that are either
144 visible or are retained in backing store.  
145 If the destination is a window with a background other than 
146 .ZN None , 
147 corresponding regions
148 of the destination are tiled with that background
149 (with plane-mask of all ones and
150 .ZN GXcopy 
151 function).
152 Regardless of tiling or whether the destination is a window or a pixmap,
153 if graphics-exposures is 
154 .ZN True ,
155 then
156 .ZN GraphicsExpose
157 events for all corresponding destination regions are generated.
158 If graphics-exposures is 
159 .ZN True 
160 but no
161 .ZN GraphicsExpose
162 events are generated, a
163 .ZN NoExpose 
164 event is generated.
165 Note that by default graphics-exposures is
166 .ZN True
167 in new GCs.
168 .LP
169 This function uses these GC components: function, plane-mask, 
170 subwindow-mode, graphics-exposures, clip-x-origin,
171 clip-y-origin, and clip-mask.
172 .LP
173 .ZN XCopyArea
174 can generate
175 .ZN BadDrawable ,
176 .ZN BadGC ,
177 and
178 .ZN BadMatch 
179 errors.
180 .LP
181 The
182 .ZN XCopyPlane
183 function uses a single bit plane of the specified source rectangle
184 combined with the specified GC to modify the specified rectangle of dest.
185 The drawables must have the same root but need not have the same depth.
186 If the drawables do not have the same root, a
187 .ZN BadMatch
188 error results.
189 If plane does not have exactly one bit set to 1 and the value of plane
190 is not less than %2 sup n%, where \fIn\fP is the depth of src, a
191 .ZN BadValue
192 error results.
193 .LP
194 Effectively, 
195 .ZN XCopyPlane
196 forms a pixmap of the same depth as the rectangle of dest and with a
197 size specified by the source region. 
198 It uses the foreground/background pixels in the GC (foreground
199 everywhere the bit plane in src contains a bit set to 1,
200 background everywhere the bit plane in src contains a bit set to 0)
201 and the equivalent of a 
202 .ZN CopyArea
203 protocol request is performed with all the same exposure semantics.
204 This can also be thought of as using the specified region of the source 
205 bit plane as a stipple with a fill-style of
206 .ZN FillOpaqueStippled
207 for filling a rectangular area of the destination.
208 .LP
209 This function uses these GC components: function, plane-mask, foreground,
210 background, subwindow-mode, graphics-exposures, clip-x-origin, clip-y-origin,
211 and clip-mask.
212 .LP
213 .ZN XCopyPlane
214 can generate
215 .ZN BadDrawable ,
216 .ZN BadGC ,
217 .ZN BadMatch ,
218 and
219 .ZN BadValue 
220 errors.
221 .SH DIAGNOSTICS
222 .TP 1i
223 .ZN BadDrawable
224 A value for a Drawable argument does not name a defined Window or Pixmap.
225 .TP 1i
226 .ZN BadGC
227 A value for a GContext argument does not name a defined GContext.
228 .TP 1i
229 .ZN BadMatch
230 An
231 .ZN InputOnly
232 window is used as a Drawable.
233 .TP 1i
234 .ZN BadMatch
235 Some argument or pair of arguments has the correct type and range but fails
236 to match in some other way required by the request.
237 .TP 1i
238 .ZN BadValue
239 Some numeric value falls outside the range of values accepted by the request.
240 Unless a specific range is specified for an argument, the full range defined
241 by the argument's type is accepted.  Any argument defined as a set of
242 alternatives can generate this error.
243 .SH "SEE ALSO"
244 XClearArea(__libmansuffix__)
245 .br
246 \fIXlib \- C Language X Interface\fP