shm.xml revision 18ea056e
1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3Copyright (C) 2001-2004 Bart Massey, Jamey Sharp, and Josh Triplett. 4All Rights Reserved. 5 6Permission is hereby granted, free of charge, to any person obtaining a copy 7of this software and associated documentation files (the "Software"), to deal 8in the Software without restriction, including without limitation the rights 9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10copies of the Software, and to permit persons to whom the Software is 11furnished to do so, subject to the following conditions: 12 13The above copyright notice and this permission notice shall be included in all 14copies or substantial portions of the Software. 15 16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 23Except as contained in this notice, the names of the authors or their 24institutions shall not be used in advertising or otherwise to promote the 25sale, use or other dealings in this Software without prior written 26authorization from the authors. 27--> 28<xcb header="shm" extension-xname="MIT-SHM" extension-name="Shm" 29 major-version="1" minor-version="2"> 30 <import>xproto</import> 31 32 <xidtype name="SEG" /> 33 34 <event name="Completion" number="0"> 35 <pad bytes="1" /> 36 <field type="DRAWABLE" name="drawable" /> 37 <field type="CARD16" name="minor_event" /> 38 <field type="BYTE" name="major_event" /> 39 <pad bytes="1" /> 40 <field type="SEG" name="shmseg" /> 41 <field type="CARD32" name="offset" /> 42 <doc> 43 <brief>Report that an XCB_SHM_PUT_IMAGE request has completed</brief> 44 <description><![CDATA[ 45This is generated by the X server to report that an XCB_SHM_PUT_IMAGE request 46has been successfully processed. 47 ]]></description> 48 <field name="drawable"><![CDATA[ 49The drawable used in the XCB_SHM_PUT_IMAGE request. 50 ]]></field> 51 <field name="minor_event"><![CDATA[ 52The minor opcode used in the request. Always XCB_SHM_PUT_IMAGE. 53 ]]></field> 54 <field name="major_event"><![CDATA[ 55The major opcode used in the request. Always the opcode of the MIT-SHM 56extension. 57 ]]></field> 58 <field name="shmseg"><![CDATA[ 59The shared memory segment used in the request. 60 ]]></field> 61 <field name="offset"><![CDATA[ 62The offset in the shared memory segment used in the request. 63 ]]></field> 64 </doc> 65 </event> 66 67 <errorcopy name="BadSeg" number="0" ref="Value" /> 68 69 <request name="QueryVersion" opcode="0"> 70 <reply> 71 <field type="BOOL" name="shared_pixmaps" /> 72 <field type="CARD16" name="major_version" /> 73 <field type="CARD16" name="minor_version" /> 74 <field type="CARD16" name="uid" /> 75 <field type="CARD16" name="gid" /> 76 <field type="CARD8" name="pixmap_format" /> 77 <pad bytes="15" /> 78 <doc> 79 <brief>The version of the MIT-SHM extension supported by the server</brief> 80 <description><![CDATA[ 81This contains the version of the MIT-SHM extension supported by the server, as 82well as the server’s UID and GID. Clients MUST obtain the version supproted by 83the server before making other requests from this extension. To prevent local 84privilege escalation and local information leak security vulnerabilities, 85clients MUST ensure that System V shared memory objects they use with this 86extension can only be accessed by the client and the X server. If this is not 87possible, the requests in this extension that use System V shared memory MUST 88NOT be used. The file descriptor-passing versions provide an alternative. 89 ]]></description> 90 <field name="shared_pixmaps"><![CDATA[ 91True if the server supports shared pixmaps, otherwise false. 92 ]]></field> 93 <field name="major_version"><![CDATA[ 94The major version of the extension supported. 95 ]]></field> 96 <field name="minor_version"><![CDATA[ 97The minor version of the extension supported. 98 ]]></field> 99 <field name="uid">The UID of the server.</field> 100 <field name="gid">The GID of the server.</field> 101 </doc> 102 </reply> 103 <doc> 104 <brief>Query the version of the MIT-SHM extension.</brief> 105 <description><![CDATA[ 106This is used to determine the version of the MIT-SHM extension supported by the 107X server. Clients MUST NOT make other requests in this extension until a reply 108to this requests indicates the X server supports them. 109 ]]></description> 110 </doc> 111 </request> 112 113 <request name="Attach" opcode="1"> 114 <field type="SEG" name="shmseg" /> 115 <field type="CARD32" name="shmid" /> 116 <field type="BOOL" name="read_only" /> 117 <pad bytes="3" /> 118 <doc> 119 <brief>Attach a System V shared memory segment.</brief> 120 <description><![CDATA[ 121Attach a System V shared memory segment to the server. This will fail unless 122the server has permission to map the segment. The client may destroy the segment 123as soon as it receives a XCB_SHM_COMPLETION event with the shmseg value in this 124request and with the appropriate serial number. 125 ]]></description> 126 <field name="shmseg"><![CDATA[ 127A shared memory segment ID created with xcb_generate_id(). 128 ]]></field> 129 <field name="shmid"><![CDATA[ 130The System V shared memory segment the server should map. 131 ]]></field> 132 <field name="read_only"><![CDATA[ 133True if the segment shall be mapped read only by the X11 server, otherwise false. 134 ]]></field> 135 </doc> 136 </request> 137 138 <request name="Detach" opcode="2"> 139 <field type="SEG" name="shmseg" /> 140 <doc> 141 <brief>Destroys the specified shared memory segment.</brief> 142 <description><![CDATA[ 143Destroys the specified shared memory segment. This will never fail unless the 144segment number is incorrect. 145 ]]></description> 146 <field name="shmseg">The segment to be destroyed.</field> 147 </doc> 148 </request> 149 150 <request name="PutImage" opcode="3"> 151 <field type="DRAWABLE" name="drawable" /> 152 <field type="GCONTEXT" name="gc" /> 153 <field type="CARD16" name="total_width" /> 154 <field type="CARD16" name="total_height" /> 155 <field type="CARD16" name="src_x" /> 156 <field type="CARD16" name="src_y" /> 157 <field type="CARD16" name="src_width" /> 158 <field type="CARD16" name="src_height" /> 159 <field type="INT16" name="dst_x" /> 160 <field type="INT16" name="dst_y" /> 161 <field type="CARD8" name="depth" /> 162 <field type="CARD8" name="format" /> 163 <field type="BOOL" name="send_event" /> 164 <pad bytes="1" /> 165 <field type="SEG" name="shmseg" /> 166 <field type="CARD32" name="offset" /> 167 <doc> 168 <brief>Copy data from the shared memory to the specified drawable.</brief> 169 <description><![CDATA[ 170Copy data from the shared memory to the specified drawable. The amount of bytes 171written to the destination image is always equal to the number of bytes read 172from the shared memory segment. 173 ]]></description> 174 <field name="drawable">The drawable to draw to.</field> 175 <field name="gc">The graphics context to use.</field> 176 <field name="total_width">The total width of the source image.</field> 177 <field name="total_height">The total height of the source image.</field> 178 <field name="src_x">The source X coordinate of the sub-image to copy.</field> 179 <field name="src_y">The source Y coordinate of the sub-image to copy.</field> 180 <field name="src_width"><![CDATA[ 181The width, in source image coordinates, of the data to copy from the source. 182The X server will use this to determine the amount of data to copy. The amount 183of the destination image that is overwritten is determined automatically. 184 ]]></field> 185 <field name="src_height"><![CDATA[ 186The height, in source image coordinates, of the data to copy from the source. 187The X server will use this to determine the amount of data to copy. The amount 188of the destination image that is overwritten is determined automatically. 189 ]]></field> 190 <field name="dst_x"><![CDATA[ 191The X coordinate on the destination drawable to copy to. 192 ]]></field> 193 <field name="dst_y"><![CDATA[ 194The Y coordinate on the destination drawable to copy to. 195 ]]></field> 196 <field name="depth">The depth to use.</field> 197 <field name="format"><![CDATA[ 198The format of the image being drawn. If it is XYBitmap, depth must be 1, or a 199"BadMatch" error results. The foreground pixel in the GC determines the source 200for the one bits in the image, and the background pixel determines the source 201for the zero bits. For XYPixmap and ZPixmap, the depth must match the depth of 202the drawable, or a "BadMatch" error results. 203 ]]></field> 204 <field name="send_event"><![CDATA[ 205True if the server should send an XCB_SHM_COMPLETION event when the blit 206completes. 207 ]]></field> 208 <field name="offset">The offset that the source image starts at.</field> 209 </doc> 210 </request> 211 212 <request name="GetImage" opcode="4"> 213 <field type="DRAWABLE" name="drawable" /> 214 <field type="INT16" name="x" /> 215 <field type="INT16" name="y" /> 216 <field type="CARD16" name="width" /> 217 <field type="CARD16" name="height" /> 218 <field type="CARD32" name="plane_mask" /> 219 <field type="CARD8" name="format" /> 220 <pad bytes="3" /> 221 <field type="SEG" name="shmseg" /> 222 <field type="CARD32" name="offset" /> 223 <reply> 224 <field type="CARD8" name="depth" /> 225 <field type="VISUALID" name="visual" /> 226 <field type="CARD32" name="size" /> 227 <doc> 228 <brief>Indicates the result of the copy.</brief> 229 <description><![CDATA[ 230The result of the copy. 231 ]]></description> 232 <field name="depth">The depth of the source drawable.</field> 233 <field name="visual">The visual ID of the source drawable.</field> 234 <field name="size">The number of bytes copied.</field> 235 </doc> 236 </reply> 237 <doc> 238 <brief>Copies data from the specified drawable to the shared memory segment.</brief> 239 <description><![CDATA[ 240Copy data from the specified drawable to the shared memory segment. The amount 241of bytes written to the destination image is always equal to the number of bytes 242read from the shared memory segment. 243 ]]></description> 244 <field name="drawable">The drawable to copy the image out of.</field> 245 <field name="x">The X coordinate in the drawable to begin copying at.</field> 246 <field name="y">The Y coordinate in the drawable to begin copying at.</field> 247 <field name="width">The width of the image to copy.</field> 248 <field name="height">The height of the image to copy.</field> 249 <field name="plane_mask">A mask that determines which planes are used.</field> 250 <field name="format">The format to use for the copy (???).</field> 251 <field name="shmseg">The destination shared memory segment.</field> 252 <field name="offset">The offset in the shared memory segment to copy data to.</field> 253 </doc> 254 </request> 255 256 <request name="CreatePixmap" opcode="5"> 257 <field type="PIXMAP" name="pid" /> 258 <field type="DRAWABLE" name="drawable" /> 259 <field type="CARD16" name="width" /> 260 <field type="CARD16" name="height" /> 261 <field type="CARD8" name="depth" /> 262 <pad bytes="3" /> 263 <field type="SEG" name="shmseg" /> 264 <field type="CARD32" name="offset" /> 265 <doc> 266 <brief>Create a pixmap backed by shared memory.</brief> 267 <description> 268Create a pixmap backed by shared memory. Writes to the shared memory will be 269reflected in the contents of the pixmap, and writes to the pixmap will be 270reflected in the contents of the shared memory. 271 </description> 272 <field name="pid">A pixmap ID created with xcb_generate_id().</field> 273 <field name="drawable">The drawable to create the pixmap in.</field> 274 <field name="width"><![CDATA[ 275The width of the pixmap to create. Must be nonzero, or a Value error results. 276 ]]></field> 277 <field name="height"><![CDATA[ 278The height of the pixmap to create. Must be nonzero, or a Value error results. 279 ]]></field> 280 <field name="depth"><![CDATA[ 281The depth of the pixmap to create. Must be nonzero, or a Value error results. 282 ]]></field> 283 <field name="shmseg"><![CDATA[ 284The shared memory segment to use to create the pixmap. 285 ]]></field> 286 <field name="offset"><![CDATA[ 287The offset in the segment to create the pixmap at. 288 ]]></field> 289 </doc> 290 </request> 291 292 <request name="AttachFd" opcode="6"> 293 <field type="SEG" name="shmseg" /> 294 <fd name="shm_fd" /> 295 <field type="BOOL" name="read_only" /> 296 <pad bytes="3" /> 297 <doc> 298 <brief>Create a shared memory segment</brief> 299 <description><![CDATA[ 300Create a shared memory segment. The file descriptor will be mapped at offset 301zero, and the size will be obtained using fstat(). A zero size will result in a 302Value error. 303 ]]></description> 304 <field name="shmseg"><![CDATA[ 305A shared memory segment ID created with xcb_generate_id(). 306 ]]></field> 307 <field name="shm_fd">The file descriptor the server should mmap().</field> 308 <field name="read_only"><![CDATA[ 309True if the segment shall be mapped read only by the X11 server, otherwise false. 310 ]]></field> 311 </doc> 312 </request> 313 314 <request name="CreateSegment" opcode="7"> 315 <field type="SEG" name="shmseg" /> 316 <field type="CARD32" name="size" /> 317 <field type="BOOL" name="read_only" /> 318 <pad bytes="3" /> 319 <reply> 320 <field type="CARD8" name="nfd" /> 321 <fd name="shm_fd" /> 322 <pad bytes="24" /> 323 <doc> 324 <brief>The returned file descriptor.</brief> 325 <description><![CDATA[ 326The file descriptor returned by the server. The client may call mmap() on it to 327map the memory allocated by the server. 328 ]]></description> 329 <field name="nfd"><![CDATA[ 330The number of file descriptors sent by the server. Will always be 1. 331 ]]></field> 332 </doc> 333 </reply> 334 <doc> 335 <brief>Asks the server to allocate a shared memory segment.</brief> 336 <description><![CDATA[ 337Asks the server to allocate a shared memory segment. The server’s reply will 338include a file descriptor for the client to pass to mmap(). 339 ]]></description> 340 <field name="shmseg"><![CDATA[ 341A shared memory segment ID created with xcb_generate_id(). 342 ]]></field> 343 <field name="size">The size of the segment to create.</field> 344 <field name="read_only"><![CDATA[ 345True if the server should map the segment read-only; otherwise false. 346 ]]></field> 347 </doc> 348 </request> 349</xcb> 350