diff options
author | Ian Osgood <iano@quirkster.com> | 2006-09-24 13:34:03 -0700 |
---|---|---|
committer | Ian Osgood <iano@quirkster.com> | 2006-09-24 13:34:03 -0700 |
commit | a76558d985a2a0172e452e705249c37c5dafae0b (patch) | |
tree | 5dc8fb6598e537e6dfcb4108e71a7c66d432cf81 /renderutil | |
parent | ab76fa5412e8f707031fe012c411a8702c1bcf45 (diff) |
All xcb-util libraries compile after the Great Renaming.
Many of the exported library functions still need to follow the new convention.
Diffstat (limited to 'renderutil')
-rw-r--r-- | renderutil/cache.c | 66 | ||||
-rw-r--r-- | renderutil/util.c | 46 | ||||
-rw-r--r-- | renderutil/xcb_renderutil.h | 26 |
3 files changed, 69 insertions, 69 deletions
diff --git a/renderutil/cache.c b/renderutil/cache.c index fe95a14..3bfeb87 100644 --- a/renderutil/cache.c +++ b/renderutil/cache.c @@ -32,9 +32,9 @@ typedef struct connection_cache { struct connection_cache *next; /* keep a linked list */ - XCBConnection *c; /* which display this is */ - XCBRenderQueryVersionRep *version; - XCBRenderQueryPictFormatsRep *formats; + xcb_connection_t *c; /* which display this is */ + xcb_render_query_version_reply_t *version; + xcb_render_query_pict_formats_reply_t *formats; } connection_cache; static struct { @@ -63,17 +63,17 @@ static struct { /* Test each depth not explicitly advertised to see if pixmap creation * succeeds: if it does, that depth is usable. */ static int -pixmap_depths_usable (XCBConnection *c, CARD32 missing, XCBPIXMAP pixmap, XCBDRAWABLE root) +pixmap_depths_usable (xcb_connection_t *c, uint32_t missing, xcb_pixmap_t pixmap, xcb_drawable_t root) { - XCBVoidCookie create_cookie[32] = { { 0 } }; - XCBVoidCookie free_cookie[32] = { { 0 } }; + xcb_void_cookie_t create_cookie[32] = { { 0 } }; + xcb_void_cookie_t free_cookie[32] = { { 0 } }; int d; int success = 1; for (d = 1; d <= 32; d++) if (missing & DEPTH_MASK(d)) { - create_cookie[d - 1] = XCBCreatePixmapChecked (c, d, pixmap, root, 1, 1); - free_cookie[d - 1] = XCBFreePixmapChecked (c, pixmap); + create_cookie[d - 1] = xcb_create_pixmap_checked (c, d, pixmap, root, 1, 1); + free_cookie[d - 1] = xcb_free_pixmap_checked (c, pixmap); if (!create_cookie[d - 1].sequence || !free_cookie[d - 1].sequence) { success = 0; @@ -83,8 +83,8 @@ pixmap_depths_usable (XCBConnection *c, CARD32 missing, XCBPIXMAP pixmap, XCBDRA for (d = 0; d < 32; d++) if (create_cookie[d].sequence || free_cookie[d].sequence) { - XCBGenericError *create_error = XCBRequestCheck (c, create_cookie[d]); - XCBGenericError *free_error = XCBRequestCheck (c, free_cookie[d]); + xcb_generic_error_t *create_error = xcb_request_check (c, create_cookie[d]); + xcb_generic_error_t *free_error = xcb_request_check (c, free_cookie[d]); success = success && !create_error; free(create_error); free(free_error); @@ -93,17 +93,17 @@ pixmap_depths_usable (XCBConnection *c, CARD32 missing, XCBPIXMAP pixmap, XCBDRA } static int -has_required_depths (XCBConnection *c) +has_required_depths (xcb_connection_t *c) { - XCBSCREENIter screens; - XCBPIXMAP pixmap = { -1 }; - for (screens = XCBSetupRootsIter(XCBGetSetup(c)); screens.rem; XCBSCREENNext(&screens)) + xcb_screen_iterator_t screens; + xcb_pixmap_t pixmap = { -1 }; + for (screens = xcb_setup_roots_iterator(xcb_get_setup(c)); screens.rem; xcb_screen_next(&screens)) { - XCBDEPTHIter depths; - CARD32 missing = REQUIRED_DEPTHS; - XCBDRAWABLE root; + xcb_depth_iterator_t depths; + uint32_t missing = REQUIRED_DEPTHS; + xcb_drawable_t root; - for (depths = XCBSCREENAllowedDepthsIter(screens.data); depths.rem; XCBDEPTHNext(&depths)) + for (depths = xcb_screen_allowed_depths_iterator(screens.data); depths.rem; xcb_depth_next(&depths)) missing &= ~DEPTH_MASK(depths.data->depth); if (!missing) continue; @@ -116,7 +116,7 @@ has_required_depths (XCBConnection *c) * work, but the only way to find out is to try them. */ if (pixmap.xid == -1) - pixmap = XCBPIXMAPNew(c); + pixmap = xcb_pixmap_new(c); root.window = screens.data->root; if (!pixmap_depths_usable (c, missing, pixmap, root)) return 0; @@ -125,11 +125,11 @@ has_required_depths (XCBConnection *c) } static connection_cache * -find_or_create_display (XCBConnection *c) +find_or_create_display (xcb_connection_t *c) { connection_cache *info; - XCBRenderQueryVersionCookie version_cookie; - XCBRenderQueryPictFormatsCookie formats_cookie; + xcb_render_query_version_cookie_t version_cookie; + xcb_render_query_pict_formats_cookie_t formats_cookie; int present; /* @@ -149,12 +149,12 @@ find_or_create_display (XCBConnection *c) return NULL; info->c = c; - version_cookie = XCBRenderQueryVersion(c, 0, 10); - formats_cookie = XCBRenderQueryPictFormats(c); - XCBFlush(c); + version_cookie = xcb_render_query_version(c, 0, 10); + formats_cookie = xcb_render_query_pict_formats(c); + xcb_flush(c); present = has_required_depths (c); - info->version = XCBRenderQueryVersionReply(c, version_cookie, 0); - info->formats = XCBRenderQueryPictFormatsReply(c, formats_cookie, 0); + info->version = xcb_render_query_version_reply(c, version_cookie, 0); + info->formats = xcb_render_query_pict_formats_reply(c, formats_cookie, 0); if (!present || !info->version || !info->formats) { @@ -178,7 +178,7 @@ find_or_create_display (XCBConnection *c) } static connection_cache * -find_display (XCBConnection *c) +find_display (xcb_connection_t *c) { connection_cache *info; @@ -194,8 +194,8 @@ find_display (XCBConnection *c) return info; } -const XCBRenderQueryVersionRep * -XCBRenderUtilQueryVersion (XCBConnection *c) +const xcb_render_query_version_reply_t * +xcb_render_util_query_version (xcb_connection_t *c) { connection_cache *info = find_display (c); if (!info) @@ -203,8 +203,8 @@ XCBRenderUtilQueryVersion (XCBConnection *c) return info->version; } -const XCBRenderQueryPictFormatsRep * -XCBRenderUtilQueryFormats (XCBConnection *c) +const xcb_render_query_pict_formats_reply_t * +xcb_render_util_query_formats (xcb_connection_t *c) { connection_cache *info = find_display (c); if (!info) @@ -213,7 +213,7 @@ XCBRenderUtilQueryFormats (XCBConnection *c) } int -XCBRenderUtilDisconnect (XCBConnection *c) +xcb_render_util_disconnect (xcb_connection_t *c) { connection_cache **prev, *cur = NULL; pthread_mutex_lock(&connections.lock); diff --git a/renderutil/util.c b/renderutil/util.c index 8e8074d..c405d0d 100644 --- a/renderutil/util.c +++ b/renderutil/util.c @@ -21,33 +21,33 @@ #include "xcb_renderutil.h" -XCBRenderPICTVISUAL * -XCBRenderUtilFindVisualFormat (const XCBRenderQueryPictFormatsRep *formats, - const XCBVISUALID visual) +xcb_render_pictvisual_t * +xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t *formats, + const xcb_visualid_t visual) { - XCBRenderPICTSCREENIter screens; - XCBRenderPICTDEPTHIter depths; - XCBRenderPICTVISUALIter visuals; + xcb_render_pictscreen_iterator_t screens; + xcb_render_pictdepth_iterator_t depths; + xcb_render_pictvisual_iterator_t visuals; if (!formats) return 0; - for (screens = XCBRenderQueryPictFormatsScreensIter(formats); screens.rem; XCBRenderPICTSCREENNext(&screens)) - for (depths = XCBRenderPICTSCREENDepthsIter(screens.data); depths.rem; XCBRenderPICTDEPTHNext(&depths)) - for (visuals = XCBRenderPICTDEPTHVisualsIter(depths.data); visuals.rem; XCBRenderPICTVISUALNext(&visuals)) + for (screens = xcb_render_query_pict_formats_screens_iterator(formats); screens.rem; xcb_render_pictscreen_next(&screens)) + for (depths = xcb_render_pictscreen_depths_iterator(screens.data); depths.rem; xcb_render_pictdepth_next(&depths)) + for (visuals = xcb_render_pictdepth_visuals_iterator(depths.data); visuals.rem; xcb_render_pictvisual_next(&visuals)) if (visuals.data->visual.id == visual.id) return visuals.data; return 0; } -XCBRenderPICTFORMINFO * -XCBRenderUtilFindFormat (const XCBRenderQueryPictFormatsRep *formats, +xcb_render_pictforminfo_t * +xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats, unsigned long mask, - const XCBRenderPICTFORMINFO *template, + const xcb_render_pictforminfo_t *template, int count) { - XCBRenderPICTFORMINFOIter i; + xcb_render_pictforminfo_iterator_t i; if (!formats) return 0; - for (i = XCBRenderQueryPictFormatsFormatsIter(formats); i.rem; XCBRenderPICTFORMINFONext(&i)) + for (i = xcb_render_query_pict_formats_formats_iterator(formats); i.rem; xcb_render_pictforminfo_next(&i)) { if (mask & PictFormatID) if (template->id.xid != i.data->id.xid) @@ -91,19 +91,19 @@ XCBRenderUtilFindFormat (const XCBRenderQueryPictFormatsRep *formats, return 0; } -XCBRenderPICTFORMINFO * -XCBRenderUtilFindStandardFormat (const XCBRenderQueryPictFormatsRep *formats, +xcb_render_pictforminfo_t * +xcb_render_util_find_standard_format (const xcb_render_query_pict_formats_reply_t *formats, int format) { static const struct { - XCBRenderPICTFORMINFO templ; + xcb_render_pictforminfo_t templ; unsigned long mask; } standardFormats[] = { /* PictStandardARGB32 */ { { { 0 }, /* id */ - XCBRenderPictTypeDirect, /* type */ + XCB_RENDER_PICT_TYPE_DIRECT, /* type */ 32, /* depth */ { 0 }, /* pad */ { /* direct */ @@ -133,7 +133,7 @@ XCBRenderUtilFindStandardFormat (const XCBRenderQueryPictFormatsRep *formats, { { { 0 }, /* id */ - XCBRenderPictTypeDirect, /* type */ + XCB_RENDER_PICT_TYPE_DIRECT, /* type */ 24, /* depth */ { 0 }, /* pad */ { /* direct */ @@ -162,7 +162,7 @@ XCBRenderUtilFindStandardFormat (const XCBRenderQueryPictFormatsRep *formats, { { { 0 }, /* id */ - XCBRenderPictTypeDirect, /* type */ + XCB_RENDER_PICT_TYPE_DIRECT, /* type */ 8, /* depth */ { 0 }, /* pad */ { /* direct */ @@ -189,7 +189,7 @@ XCBRenderUtilFindStandardFormat (const XCBRenderQueryPictFormatsRep *formats, { { { 0 }, /* id */ - XCBRenderPictTypeDirect, /* type */ + XCB_RENDER_PICT_TYPE_DIRECT, /* type */ 4, /* depth */ { 0 }, /* pad */ { /* direct */ @@ -216,7 +216,7 @@ XCBRenderUtilFindStandardFormat (const XCBRenderQueryPictFormatsRep *formats, { { { 0 }, /* id */ - XCBRenderPictTypeDirect, /* type */ + XCB_RENDER_PICT_TYPE_DIRECT, /* type */ 1, /* depth */ { 0 }, /* pad */ { /* direct */ @@ -244,7 +244,7 @@ XCBRenderUtilFindStandardFormat (const XCBRenderQueryPictFormatsRep *formats, if (format < 0 || format >= sizeof(standardFormats) / sizeof(*standardFormats)) return 0; - return XCBRenderUtilFindFormat (formats, + return xcb_render_util_find_format (formats, standardFormats[format].mask, &standardFormats[format].templ, 0); diff --git a/renderutil/xcb_renderutil.h b/renderutil/xcb_renderutil.h index a535eae..51a3718 100644 --- a/renderutil/xcb_renderutil.h +++ b/renderutil/xcb_renderutil.h @@ -50,27 +50,27 @@ enum { PictStandardNUM }; -XCBRenderPICTVISUAL * -XCBRenderUtilFindVisualFormat (const XCBRenderQueryPictFormatsRep *formats, - const XCBVISUALID visual); +xcb_render_pictvisual_t * +xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t *formats, + const xcb_visualid_t visual); -XCBRenderPICTFORMINFO * -XCBRenderUtilFindFormat (const XCBRenderQueryPictFormatsRep *formats, +xcb_render_pictforminfo_t * +xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats, unsigned long mask, - const XCBRenderPICTFORMINFO *template, + const xcb_render_pictforminfo_t *template, int count); -XCBRenderPICTFORMINFO * -XCBRenderUtilFindStandardFormat (const XCBRenderQueryPictFormatsRep *formats, +xcb_render_pictforminfo_t * +xcb_render_util_find_standard_format (const xcb_render_query_pict_formats_reply_t *formats, int format); -const XCBRenderQueryVersionRep * -XCBRenderUtilQueryVersion (XCBConnection *c); +const xcb_render_query_version_reply_t * +xcb_render_util_query_version (xcb_connection_t *c); -const XCBRenderQueryPictFormatsRep * -XCBRenderUtilQueryFormats (XCBConnection *c); +const xcb_render_query_pict_formats_reply_t * +xcb_render_util_query_formats (xcb_connection_t *c); int -XCBRenderUtilDisconnect (XCBConnection *c); +xcb_render_util_disconnect (xcb_connection_t *c); #endif /* XCB_RENDERUTIL */ |