diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2009-09-05 15:55:47 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2009-09-05 15:55:47 +0000 |
commit | 7e6bbbf222239c48377c748a99a9996f66fe68ac (patch) | |
tree | f0742a11efd32a888c21174c90e6f39dfe0fd17b /dist | |
parent | 1f6f82c0a5a3164b783bd897c90f993af8881801 (diff) |
update to xcb-util 0.3.6. Tested on a packages bulk build by naddy@.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/xcb-util/configure.ac | 12 | ||||
-rw-r--r-- | dist/xcb-util/event/event.c | 1 | ||||
-rw-r--r-- | dist/xcb-util/event/xcb_event.h | 2 | ||||
-rw-r--r-- | dist/xcb-util/icccm/icccm.c | 45 | ||||
-rw-r--r-- | dist/xcb-util/icccm/xcb_icccm.h | 11 | ||||
-rw-r--r-- | dist/xcb-util/property/xcb_property.h | 2 | ||||
-rw-r--r-- | dist/xcb-util/xcb-util-common.h | 4 |
7 files changed, 52 insertions, 25 deletions
diff --git a/dist/xcb-util/configure.ac b/dist/xcb-util/configure.ac index c7f8ad7d6..75a89d15a 100644 --- a/dist/xcb-util/configure.ac +++ b/dist/xcb-util/configure.ac @@ -1,5 +1,6 @@ -AC_PREREQ(2.57) -AC_INIT([xcb-util],0.3.5,[xcb@lists.freedesktop.org]) +dnl AC_TYPE_SSIZE_T is defined from 2.59c +AC_PREREQ(2.59c) +AC_INIT([xcb-util],0.3.6,[xcb@lists.freedesktop.org]) AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) @@ -41,13 +42,16 @@ fi AC_SUBST(CWARNFLAGS) AC_CHECK_FUNCS_ONCE(vasprintf) +dnl Checking whether ssize_t is defined (xcb-util-common.h) +AC_TYPE_SSIZE_T + xcbincludedir='${includedir}/xcb' AC_SUBST(xcbincludedir) pkgconfigdir='${libdir}/pkgconfig' AC_SUBST(pkgconfigdir) -PKG_CHECK_MODULES(XCB, xcb >= 1.2) +PKG_CHECK_MODULES(XCB, xcb >= 1.4) ###### # Check version of xcb-proto that xcb was compiled against @@ -63,7 +67,7 @@ AX_COMPARE_VERSION([$xcbproto_version],[ge],[$xcbproto_required], xcbproto_ok="y AC_MSG_RESULT([$xcbproto_ok]) if test $xcbproto_ok = no; then - AC_MSG_ERROR([libxcb was compiled against xcb-proto $xcbproto_version; it needs needs to be compiled against version $xcbproto_required or higher]) + AC_MSG_ERROR([libxcb was compiled against xcb-proto $xcbproto_version; it needs to be compiled against version $xcbproto_required or higher]) fi diff --git a/dist/xcb-util/event/event.c b/dist/xcb-util/event/event.c index 1332a33c6..7faac1c52 100644 --- a/dist/xcb-util/event/event.c +++ b/dist/xcb-util/event/event.c @@ -28,6 +28,7 @@ #include <assert.h> #include <stdlib.h> +#include <string.h> #include "xcb_event.h" #include "../xcb-util-common.h" diff --git a/dist/xcb-util/event/xcb_event.h b/dist/xcb-util/event/xcb_event.h index 05b9cac18..9bd286b0e 100644 --- a/dist/xcb-util/event/xcb_event.h +++ b/dist/xcb-util/event/xcb_event.h @@ -55,8 +55,6 @@ extern "C" { #define XCB_EVENT_RESPONSE_TYPE_MASK (0x7f) #define XCB_EVENT_RESPONSE_TYPE(e) (e->response_type & XCB_EVENT_RESPONSE_TYPE_MASK) #define XCB_EVENT_SENT(e) (e->response_type & ~XCB_EVENT_RESPONSE_TYPE_MASK) -#define XCB_EVENT_ERROR_TYPE(e) (*((uint8_t *) e + 1)) -#define XCB_EVENT_REQUEST_TYPE(e) (*((uint8_t *) e + 10)) typedef int (*xcb_generic_event_handler_t)(void *data, xcb_connection_t *c, xcb_generic_event_t *event); typedef int (*xcb_generic_error_handler_t)(void *data, xcb_connection_t *c, xcb_generic_error_t *error); diff --git a/dist/xcb-util/icccm/icccm.c b/dist/xcb-util/icccm/icccm.c index 454e1ab35..6f9463fa7 100644 --- a/dist/xcb-util/icccm/icccm.c +++ b/dist/xcb-util/icccm/icccm.c @@ -70,7 +70,8 @@ xcb_get_text_property_reply(xcb_connection_t *c, return 1; } -void xcb_get_text_property_reply_wipe(xcb_get_text_property_reply_t *prop) +void +xcb_get_text_property_reply_wipe(xcb_get_text_property_reply_t *prop) { free(prop->_reply); } @@ -270,7 +271,8 @@ xcb_get_wm_class_reply(xcb_connection_t *c, xcb_get_property_cookie_t cookie, return ret; } -void xcb_get_wm_class_reply_wipe(xcb_get_wm_class_reply_t *prop) +void +xcb_get_wm_class_reply_wipe(xcb_get_wm_class_reply_t *prop) { free(prop->_reply); } @@ -390,7 +392,7 @@ xcb_size_hints_set_base_size(xcb_size_hints_t *hints, int32_t base_width, } void -xcb_size_hints_set_win_gravity(xcb_size_hints_t *hints, uint32_t win_gravity) +xcb_size_hints_set_win_gravity(xcb_size_hints_t *hints, xcb_gravity_t win_gravity) { hints->flags |= XCB_SIZE_HINT_P_WIN_GRAVITY; hints->win_gravity = win_gravity; @@ -473,7 +475,7 @@ uint8_t xcb_get_wm_size_hints_reply(xcb_connection_t *c, xcb_get_property_cookie_t cookie, xcb_size_hints_t *hints, xcb_generic_error_t **e) { - xcb_get_property_reply_t *reply = reply = xcb_get_property_reply(c, cookie, e); + xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e); uint8_t ret = xcb_get_wm_size_hints_from_reply(hints, reply); free(reply); return ret; @@ -608,15 +610,17 @@ xcb_set_wm_hints(xcb_connection_t *c, xcb_window_t window, sizeof(*hints) >> 2, hints); } -xcb_get_property_cookie_t xcb_get_wm_hints(xcb_connection_t *c, - xcb_window_t window) +xcb_get_property_cookie_t +xcb_get_wm_hints(xcb_connection_t *c, + xcb_window_t window) { return xcb_get_property(c, 0, window, WM_HINTS, WM_HINTS, 0L, XCB_NUM_WM_HINTS_ELEMENTS); } -xcb_get_property_cookie_t xcb_get_wm_hints_unchecked(xcb_connection_t *c, - xcb_window_t window) +xcb_get_property_cookie_t +xcb_get_wm_hints_unchecked(xcb_connection_t *c, + xcb_window_t window) { return xcb_get_property_unchecked(c, 0, window, WM_HINTS, WM_HINTS, 0L, XCB_NUM_WM_HINTS_ELEMENTS); @@ -695,26 +699,31 @@ xcb_get_wm_protocols_unchecked(xcb_connection_t *c, } uint8_t -xcb_get_wm_protocols_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_get_wm_protocols_reply_t *protocols, - xcb_generic_error_t **e) +xcb_get_wm_protocols_from_reply(xcb_get_property_reply_t *reply, xcb_get_wm_protocols_reply_t *protocols) { - xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e); - if(!reply || reply->type != ATOM || reply->format != 32) - { - free(reply); return 0; - } protocols->_reply = reply; - protocols->atoms_len = xcb_get_property_value_length(protocols->_reply); + protocols->atoms_len = xcb_get_property_value_length(protocols->_reply) / (reply->format / 8); protocols->atoms = (xcb_atom_t *) xcb_get_property_value(protocols->_reply); return 1; } +uint8_t +xcb_get_wm_protocols_reply(xcb_connection_t *c, + xcb_get_property_cookie_t cookie, + xcb_get_wm_protocols_reply_t *protocols, + xcb_generic_error_t **e) +{ + xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e); + uint8_t ret = xcb_get_wm_protocols_from_reply(reply, protocols); + if(!ret) + free(reply); + return ret; +} + void xcb_get_wm_protocols_reply_wipe(xcb_get_wm_protocols_reply_t *protocols) { diff --git a/dist/xcb-util/icccm/xcb_icccm.h b/dist/xcb-util/icccm/xcb_icccm.h index 5358d899f..938fecb4b 100644 --- a/dist/xcb-util/icccm/xcb_icccm.h +++ b/dist/xcb-util/icccm/xcb_icccm.h @@ -871,6 +871,17 @@ xcb_get_property_cookie_t xcb_get_wm_protocols_unchecked(xcb_connection_t *c, /** * @brief Fill the given structure with the WM_PROTOCOLS property of a window. + * @param reply The reply of the GetProperty request. + * @param protocols WM_PROTOCOLS property value. + * @return Return 1 on success, 0 otherwise. + * + * protocols structure members should be freed by + * xcb_get_wm_protocols_reply_wipe(). + */ +uint8_t xcb_get_wm_protocols_from_reply(xcb_get_property_reply_t *reply, + xcb_get_wm_protocols_reply_t *protocols); +/** + * @brief Fill the given structure with the WM_PROTOCOLS property of a window. * @param c The connection to the X server. * @param cookie Request cookie. * @param protocols WM_PROTOCOLS property value. diff --git a/dist/xcb-util/property/xcb_property.h b/dist/xcb-util/property/xcb_property.h index 1137ab08f..d90f5c9ab 100644 --- a/dist/xcb-util/property/xcb_property.h +++ b/dist/xcb-util/property/xcb_property.h @@ -68,7 +68,7 @@ struct xcb_property_handlers { /** * @brief Get any property from a window, from any format. * @param c The connection to the X server. - * @param del The XCB_PROP_MODE value. + * @param del Boolean value that determines whether the property is deleted. * @param window The window to get property from. * @param name The property atom name. * @param long_len The maximum length of the property. diff --git a/dist/xcb-util/xcb-util-common.h b/dist/xcb-util/xcb-util-common.h index b325bf508..a76fbb370 100644 --- a/dist/xcb-util/xcb-util-common.h +++ b/dist/xcb-util/xcb-util-common.h @@ -29,5 +29,9 @@ * */ +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + #define ssizeof(foo) (ssize_t)sizeof(foo) #define countof(foo) (ssizeof(foo) / ssizeof(foo[0])) |