update to xcb-util 0.3.6. Tested on a packages bulk build by naddy@.

This commit is contained in:
matthieu 2009-09-05 15:55:46 +00:00
parent e9d6b4f7bf
commit 86fe704ca5
8 changed files with 55 additions and 28 deletions

View File

@ -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

View File

@ -28,6 +28,7 @@
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "xcb_event.h"
#include "../xcb-util-common.h"

View File

@ -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);

View File

@ -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);
@ -694,6 +698,19 @@ xcb_get_wm_protocols_unchecked(xcb_connection_t *c,
UINT_MAX);
}
uint8_t
xcb_get_wm_protocols_from_reply(xcb_get_property_reply_t *reply, xcb_get_wm_protocols_reply_t *protocols)
{
if(!reply || reply->type != ATOM || reply->format != 32)
return 0;
protocols->_reply = 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,
@ -701,18 +718,10 @@ xcb_get_wm_protocols_reply(xcb_connection_t *c,
xcb_generic_error_t **e)
{
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 = (xcb_atom_t *) xcb_get_property_value(protocols->_reply);
return 1;
uint8_t ret = xcb_get_wm_protocols_from_reply(reply, protocols);
if(!ret)
free(reply);
return ret;
}
void

View File

@ -869,6 +869,17 @@ xcb_get_property_cookie_t xcb_get_wm_protocols_unchecked(xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t wm_protocol_atom);
/**
* @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.

View File

@ -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.

View File

@ -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]))

View File

@ -1,2 +1,2 @@
major=1
minor=0
minor=1