1 /* Copyright © 2006 Jamey Sharp.
3 * Permission is hereby granted, free of charge, to any person obtaining a
4 * copy of this software and associated documentation files (the "Software"),
5 * to deal in the Software without restriction, including without limitation
6 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 * and/or sell copies of the Software, and to permit persons to whom the
8 * Software is furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
17 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 * Except as contained in this notice, the names of the authors or their
21 * institutions shall not be used in advertising or otherwise to promote the
22 * sale, use or other dealings in this Software without prior written
23 * authorization from the authors.
26 #ifndef XCB_RENDERUTIL
27 #define XCB_RENDERUTIL
28 #include <xcb/render.h>
30 typedef enum xcb_pict_format_t {
31 XCB_PICT_FORMAT_ID = (1 << 0),
32 XCB_PICT_FORMAT_TYPE = (1 << 1),
33 XCB_PICT_FORMAT_DEPTH = (1 << 2),
34 XCB_PICT_FORMAT_RED = (1 << 3),
35 XCB_PICT_FORMAT_RED_MASK = (1 << 4),
36 XCB_PICT_FORMAT_GREEN = (1 << 5),
37 XCB_PICT_FORMAT_GREEN_MASK = (1 << 6),
38 XCB_PICT_FORMAT_BLUE = (1 << 7),
39 XCB_PICT_FORMAT_BLUE_MASK = (1 << 8),
40 XCB_PICT_FORMAT_ALPHA = (1 << 9),
41 XCB_PICT_FORMAT_ALPHA_MASK = (1 << 10),
42 XCB_PICT_FORMAT_COLORMAP = (1 << 11)
45 typedef enum xcb_pict_standard_t {
46 XCB_PICT_STANDARD_ARGB_32,
47 XCB_PICT_STANDARD_RGB_24,
48 XCB_PICT_STANDARD_A_8,
49 XCB_PICT_STANDARD_A_4,
51 } xcb_pict_standard_t;
54 xcb_render_pictvisual_t *
55 xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t *formats,
56 const xcb_visualid_t visual);
58 xcb_render_pictforminfo_t *
59 xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats,
61 const xcb_render_pictforminfo_t *template,
64 xcb_render_pictforminfo_t *
65 xcb_render_util_find_standard_format (const xcb_render_query_pict_formats_reply_t *formats,
66 xcb_pict_standard_t format);
68 const xcb_render_query_version_reply_t *
69 xcb_render_util_query_version (xcb_connection_t *c);
71 const xcb_render_query_pict_formats_reply_t *
72 xcb_render_util_query_formats (xcb_connection_t *c);
75 xcb_render_util_disconnect (xcb_connection_t *c);
77 /* wrappers for xcb_render_composite_glyphs_8/16/32 */
79 typedef struct xcb_render_util_composite_text_stream_t xcb_render_util_composite_text_stream_t;
81 xcb_render_util_composite_text_stream_t *
82 xcb_render_util_composite_text_stream (
83 xcb_render_glyphset_t initial_glyphset,
84 uint32_t total_glyphs,
85 uint32_t total_glyphset_changes );
88 xcb_render_util_glyphs_8 (
89 xcb_render_util_composite_text_stream_t *stream,
93 const uint8_t *glyphs );
96 xcb_render_util_glyphs_16 (
97 xcb_render_util_composite_text_stream_t *stream,
101 const uint16_t *glyphs );
104 xcb_render_util_glyphs_32 (
105 xcb_render_util_composite_text_stream_t *stream,
109 const uint32_t *glyphs );
112 xcb_render_util_change_glyphset (
113 xcb_render_util_composite_text_stream_t *stream,
114 xcb_render_glyphset_t glyphset );
117 xcb_render_util_composite_text (
118 xcb_connection_t *xc,
120 xcb_render_picture_t src,
121 xcb_render_picture_t dst,
122 xcb_render_pictformat_t mask_format,
125 xcb_render_util_composite_text_stream_t *stream );
128 xcb_render_util_composite_text_checked (
129 xcb_connection_t *xc,
131 xcb_render_picture_t src,
132 xcb_render_picture_t dst,
133 xcb_render_pictformat_t mask_format,
136 xcb_render_util_composite_text_stream_t *stream );
139 xcb_render_util_composite_text_free (
140 xcb_render_util_composite_text_stream_t *stream );
142 #endif /* XCB_RENDERUTIL */