xcb_atom.h   xcb_atom.h 
#ifndef ATOMS_H #ifndef __XCB_ATOM_H__
#define ATOMS_H #define __XCB_ATOM_H__
enum tag_t { #include <xcb/xcb.h>
enum xcb_atom_fast_tag_t {
TAG_COOKIE, TAG_COOKIE,
TAG_VALUE TAG_VALUE
}; };
typedef struct { typedef struct {
enum tag_t tag; enum xcb_atom_fast_tag_t tag;
union { union {
xcb_intern_atom_cookie_t cookie; xcb_intern_atom_cookie_t cookie;
xcb_atom_t atom; xcb_atom_t atom;
} u; } u;
} intern_atom_fast_cookie_t; } xcb_atom_fast_cookie_t;
xcb_atom_t xcb_atom_get_predefined(uint16_t name_len, const char *name);
xcb_atom_fast_cookie_t xcb_atom_get_fast(xcb_connection_t *c, uint8_t only_
if_exists, uint16_t name_len, const char *name);
xcb_atom_t xcb_atom_get_fast_reply(xcb_connection_t *c, xcb_atom_fast_cooki
e_t cookie, xcb_generic_error_t **e);
xcb_atom_t intern_atom_predefined(uint16_t name_len, const char *name); const char *xcb_atom_get_name_predefined(xcb_atom_t atom);
intern_atom_fast_cookie_t intern_atom_fast(xcb_connection_t *c, uint8_t onl int xcb_atom_get_name(xcb_connection_t *c, xcb_atom_t atom, const char **na
y_if_exists, uint16_t name_len, const char *name); mep, int *lengthp);
xcb_atom_t intern_atom_fast_reply(xcb_connection_t *c, intern_atom_fast_coo
kie_t cookie, xcb_generic_error_t **e);
const char *get_atom_name_predefined(xcb_atom_t atom); char *xcb_atom_name_by_screen(const char *base, uint8_t screen);
int get_atom_name(xcb_connection_t *c, xcb_atom_t atom, const char **namep, char *xcb_atom_name_by_resource(const char *base, uint32_t resource);
int *lengthp); char *xcb_atom_name_unique(const char *base, uint32_t id);
extern const xcb_atom_t PRIMARY; extern const xcb_atom_t PRIMARY;
extern const xcb_atom_t SECONDARY; extern const xcb_atom_t SECONDARY;
extern const xcb_atom_t ARC; extern const xcb_atom_t ARC;
extern const xcb_atom_t ATOM; extern const xcb_atom_t ATOM;
extern const xcb_atom_t BITMAP; extern const xcb_atom_t BITMAP;
extern const xcb_atom_t CARDINAL; extern const xcb_atom_t CARDINAL;
extern const xcb_atom_t COLORMAP; extern const xcb_atom_t COLORMAP;
extern const xcb_atom_t CURSOR; extern const xcb_atom_t CURSOR;
extern const xcb_atom_t CUT_BUFFER0; extern const xcb_atom_t CUT_BUFFER0;
skipping to change at line 92 skipping to change at line 98
extern const xcb_atom_t RESOLUTION; extern const xcb_atom_t RESOLUTION;
extern const xcb_atom_t COPYRIGHT; extern const xcb_atom_t COPYRIGHT;
extern const xcb_atom_t NOTICE; extern const xcb_atom_t NOTICE;
extern const xcb_atom_t FONT_NAME; extern const xcb_atom_t FONT_NAME;
extern const xcb_atom_t FAMILY_NAME; extern const xcb_atom_t FAMILY_NAME;
extern const xcb_atom_t FULL_NAME; extern const xcb_atom_t FULL_NAME;
extern const xcb_atom_t CAP_HEIGHT; extern const xcb_atom_t CAP_HEIGHT;
extern const xcb_atom_t WM_CLASS; extern const xcb_atom_t WM_CLASS;
extern const xcb_atom_t WM_TRANSIENT_FOR; extern const xcb_atom_t WM_TRANSIENT_FOR;
#endif /* ATOMS_H */ #endif /* __XCB_ATOM_H__ */
 End of changes. 7 change blocks. 
13 lines changed or deleted 19 lines changed or added


 xcb_bitops.h   xcb_bitops.h 
skipping to change at line 53 skipping to change at line 53
* @param n Mask size. * @param n Mask size.
* @return Mask. * @return Mask.
* *
* Create a bitmask with the lower @p n bits set and the * Create a bitmask with the lower @p n bits set and the
* rest of the word clear. * rest of the word clear.
* @ingroup xcb__bitops * @ingroup xcb__bitops
*/ */
_X_INLINE static uint32_t _X_INLINE static uint32_t
xcb_mask(uint32_t n) xcb_mask(uint32_t n)
{ {
return (1 << n) - 1; return n == 32 ? ~0 : (1 << n) - 1;
} }
/** /**
* Population count. * Population count.
* @param n Integer representing a bitset. * @param n Integer representing a bitset.
* @return Number of 1 bits in the bitset. * @return Number of 1 bits in the bitset.
* *
* This is a reasonably fast algorithm for counting the bits * This is a reasonably fast algorithm for counting the bits
* in a 32-bit word. Currently a classic binary * in a 32-bit word. Currently a classic binary
* divide-and-conquer popcount: popcount_2() from * divide-and-conquer popcount: popcount_2() from
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 xcb_event.h   xcb_event.h 
#ifndef __XCB_EVENTS_H__ /*
#define __XCB_EVENTS_H__ * Copyright (C) 2008 Julien Danjou <julien@danjou.info>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or
* their institutions shall not be used in advertising or otherwise to
* promote the sale, use or other dealings in this Software without
* prior written authorization from the authors.
*/
/**
* @defgroup xcb__event_t XCB Event Functions
*
* These functions ease the handling of X events received.
*
* @{
*/
#ifndef __XCB_EVENT_H__
#define __XCB_EVENT_H__
#include <xcb/xcb.h> #include <xcb/xcb.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef struct xcb_event_handlers_t xcb_event_handlers_t; /**
xcb_event_handlers_t *xcb_alloc_event_handlers(xcb_connection_t *c); * @brief Bit mask to find event type regardless of event source.
void xcb_free_event_handlers(xcb_event_handlers_t *evenths); *
xcb_connection_t *xcb_get_xcb_connection(xcb_event_handlers_t *evenths); * Each event in the X11 protocol contains an 8-bit type code.
* The most-significant bit in this code is set if the event was
void xcb_wait_for_event_loop(xcb_event_handlers_t *evenths); * generated from a SendEvent request. This mask can be used to
void xcb_poll_for_event_loop(xcb_event_handlers_t *evenths); * determine the type of event regardless of how the event was
int xcb_handle_event(xcb_event_handlers_t *evenths, xcb_generic_event_t *ev * generated. See the X11R6 protocol specification for details.
ent); */
#define XCB_EVENT_RESPONSE_TYPE_MASK (0x7f)
#define XCB_EVENT_RESPONSE_TYPE(e) (e->response_type & XCB_EVENT_RESPONS
E_TYPE_MASK)
#define XCB_EVENT_SENT(e) (e->response_type & ~XCB_EVENT_RESPONS
E_TYPE_MASK)
typedef int (*xcb_generic_event_handler_t)(void *data, xcb_connection_t *c, xcb_generic_event_t *event); 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); typedef int (*xcb_generic_error_handler_t)(void *data, xcb_connection_t *c, xcb_generic_error_t *error);
void xcb_set_event_handler(xcb_event_handlers_t *evenths, int event, xcb_ge typedef struct xcb_event_handler xcb_event_handler_t;
neric_event_handler_t handler, void *data); struct xcb_event_handler
void xcb_set_error_handler(xcb_event_handlers_t *evenths, int error, xcb_ge {
neric_error_handler_t handler, void *data); xcb_generic_event_handler_t handler;
void *data;
};
typedef struct xcb_event_handlers xcb_event_handlers_t;
struct xcb_event_handlers
{
xcb_event_handler_t event[126];
xcb_event_handler_t error[256];
xcb_connection_t *c;
};
/**
* @brief Initialize event handlers data structure.
* @param c The connection to the X server.
* @param evenths A pointer to the event handler data structure to initiali
ze.
*/
void xcb_event_handlers_init(xcb_connection_t *c, xcb_event_handlers_t *eve
nths);
/**
* @brief Get X connection used in event handlers.
* @param evenths The event handlers.
* @return The connection to the X server.
*/
xcb_connection_t *xcb_event_get_xcb_connection(xcb_event_handlers_t *eventh
s);
/**
* @brief Wait for event and handle it with event handler.
* @param evenths The event handlers.
*/
void xcb_event_wait_for_event_loop(xcb_event_handlers_t *evenths);
/**
* @brief Poll for event and handle it with event handler.
* @param evenths The event handlers.
*/
void xcb_event_poll_for_event_loop(xcb_event_handlers_t *evenths);
/**
* @brief Handle an event using event handlers from event handlers data
* structure.
* @param evenths The event handlers.
* @param event The event to handle.
* @return The return value of the handler, or 0 if no handler exists for t
his
* event.
*/
int xcb_event_handle(xcb_event_handlers_t *evenths, xcb_generic_event_t *ev
ent);
/**
* @brief Set an event handler for an event type.
* @param evenths The event handlers data structure.
* @param event The event type.
* @param handler The callback function to call for this event type.
* @param data Optional data pointer to pass to handler callback function.
*/
void xcb_event_set_handler(xcb_event_handlers_t *evenths, int event, xcb_ge
neric_event_handler_t handler, void *data);
/**
* @brief Set an error handler for an error type.
* @param evenths The error handlers data structure.
* @param error The error type.
* @param handler The callback function to call for this error type.
* @param data Optional data pointer to pass to handler callback function.
*/
void xcb_event_set_error_handler(xcb_event_handlers_t *evenths, int error,
xcb_generic_error_handler_t handler, void *data);
#define MAKE_HANDLER(cls,lkind, ukind) \ #define XCB_EVENT_MAKE_EVENT_HANDLER(lkind, ukind) \
static inline void set_##lkind##_##cls##_handler(xcb_event_handlers_t *even static inline void xcb_event_set_##lkind##_handler(xcb_event_handlers_t *ev
ths, int (*handler)(void *, xcb_connection_t *, xcb_##lkind##_##cls##_t *), enths, int (*handler)(void *, xcb_connection_t *, xcb_##lkind##_event_t *),
void *data) \ void *data) \
{ \ { \
xcb_set_##cls##_handler(evenths, XCB_##ukind, (xcb_generic_event_han dler_t) handler, data); \ xcb_event_set_handler(evenths, XCB_##ukind, (xcb_generic_event_handler_ t) handler, data); \
} }
MAKE_HANDLER(event, key_press, KEY_PRESS) XCB_EVENT_MAKE_EVENT_HANDLER(key_press, KEY_PRESS)
MAKE_HANDLER(event, key_release, KEY_RELEASE) XCB_EVENT_MAKE_EVENT_HANDLER(key_release, KEY_RELEASE)
MAKE_HANDLER(event, button_press, BUTTON_PRESS) XCB_EVENT_MAKE_EVENT_HANDLER(button_press, BUTTON_PRESS)
MAKE_HANDLER(event, button_release, BUTTON_RELEASE) XCB_EVENT_MAKE_EVENT_HANDLER(button_release, BUTTON_RELEASE)
MAKE_HANDLER(event, motion_notify, MOTION_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(motion_notify, MOTION_NOTIFY)
MAKE_HANDLER(event, enter_notify, ENTER_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(enter_notify, ENTER_NOTIFY)
MAKE_HANDLER(event, leave_notify, LEAVE_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(leave_notify, LEAVE_NOTIFY)
MAKE_HANDLER(event, focus_in, FOCUS_IN) XCB_EVENT_MAKE_EVENT_HANDLER(focus_in, FOCUS_IN)
MAKE_HANDLER(event, focus_out, FOCUS_OUT) XCB_EVENT_MAKE_EVENT_HANDLER(focus_out, FOCUS_OUT)
MAKE_HANDLER(event, keymap_notify, KEYMAP_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(keymap_notify, KEYMAP_NOTIFY)
MAKE_HANDLER(event, expose, EXPOSE) XCB_EVENT_MAKE_EVENT_HANDLER(expose, EXPOSE)
MAKE_HANDLER(event, graphics_exposure, GRAPHICS_EXPOSURE) XCB_EVENT_MAKE_EVENT_HANDLER(graphics_exposure, GRAPHICS_EXPOSURE)
MAKE_HANDLER(event, no_exposure, NO_EXPOSURE) XCB_EVENT_MAKE_EVENT_HANDLER(no_exposure, NO_EXPOSURE)
MAKE_HANDLER(event, visibility_notify, VISIBILITY_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(visibility_notify, VISIBILITY_NOTIFY)
MAKE_HANDLER(event, create_notify, CREATE_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(create_notify, CREATE_NOTIFY)
MAKE_HANDLER(event, destroy_notify, DESTROY_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(destroy_notify, DESTROY_NOTIFY)
MAKE_HANDLER(event, unmap_notify, UNMAP_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(unmap_notify, UNMAP_NOTIFY)
MAKE_HANDLER(event, map_notify, MAP_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(map_notify, MAP_NOTIFY)
MAKE_HANDLER(event, map_request, MAP_REQUEST) XCB_EVENT_MAKE_EVENT_HANDLER(map_request, MAP_REQUEST)
MAKE_HANDLER(event, reparent_notify, REPARENT_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(reparent_notify, REPARENT_NOTIFY)
MAKE_HANDLER(event, configure_notify, CONFIGURE_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(configure_notify, CONFIGURE_NOTIFY)
MAKE_HANDLER(event, configure_request, CONFIGURE_REQUEST) XCB_EVENT_MAKE_EVENT_HANDLER(configure_request, CONFIGURE_REQUEST)
MAKE_HANDLER(event, gravity_notify, GRAVITY_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(gravity_notify, GRAVITY_NOTIFY)
MAKE_HANDLER(event, resize_request, RESIZE_REQUEST) XCB_EVENT_MAKE_EVENT_HANDLER(resize_request, RESIZE_REQUEST)
MAKE_HANDLER(event, circulate_notify, CIRCULATE_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(circulate_notify, CIRCULATE_NOTIFY)
MAKE_HANDLER(event, circulate_request, CIRCULATE_REQUEST) XCB_EVENT_MAKE_EVENT_HANDLER(circulate_request, CIRCULATE_REQUEST)
MAKE_HANDLER(event, property_notify, PROPERTY_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(property_notify, PROPERTY_NOTIFY)
MAKE_HANDLER(event, selection_clear, SELECTION_CLEAR) XCB_EVENT_MAKE_EVENT_HANDLER(selection_clear, SELECTION_CLEAR)
MAKE_HANDLER(event, selection_request, SELECTION_REQUEST) XCB_EVENT_MAKE_EVENT_HANDLER(selection_request, SELECTION_REQUEST)
MAKE_HANDLER(event, selection_notify, SELECTION_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(selection_notify, SELECTION_NOTIFY)
MAKE_HANDLER(event, colormap_notify, COLORMAP_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(colormap_notify, COLORMAP_NOTIFY)
MAKE_HANDLER(event, client_message, CLIENT_MESSAGE) XCB_EVENT_MAKE_EVENT_HANDLER(client_message, CLIENT_MESSAGE)
MAKE_HANDLER(event, mapping_notify, MAPPING_NOTIFY) XCB_EVENT_MAKE_EVENT_HANDLER(mapping_notify, MAPPING_NOTIFY)
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __XCB_EVENTS_H__ */ /**
* @}
*/
#endif /* __XCB_EVENT_H__ */
 End of changes. 7 change blocks. 
53 lines changed or deleted 165 lines changed or added


 xcb_icccm.h   xcb_icccm.h 
#ifndef __XCB_ICCCM_H__ #ifndef __XCB_ICCCM_H__
#define __XCB_ICCCM_H__ #define __XCB_ICCCM_H__
/*
* Copyright (C) 2008 Arnaud Fontaine <arnau@debian.org>
* Copyright (C) 2007-2008 Vincent Torri <vtorri@univ-evry.fr>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or
* their institutions shall not be used in advertising or otherwise to
* promote the sale, use or other dealings in this Software without
* prior written authorization from the authors.
*/
/**
* @defgroup xcb__icccm_t XCB ICCCM Functions
*
* These functions allow easy handling of the protocol described in the
* Inter-Client Communication Conventions Manual.
*
* @{
*/
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include "xcb_property.h" #include "xcb_property.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/**
* @brief TextProperty reply structure.
*/
typedef struct {
/** Store reply to avoid memory allocation, should normally not be
used directly */
xcb_get_property_reply_t *_reply;
/** Encoding used */
xcb_atom_t encoding;
/** Length of the name field above */
uint32_t name_len;
/** Property value */
char *name;
/** Format, may be 8, 16 or 32 */
uint8_t format;
} xcb_get_text_property_reply_t;
/**
* @brief Deliver a GetProperty request to the X server.
* @param c The connection to the X server.
* @param window Window X identifier.
* @param property Property atom to get.
* @return The request cookie.
*
* Allow to get a window property, in most case you might want to use
* above functions to get an ICCCM property for a given window.
*/
xcb_get_property_cookie_t xcb_get_text_property(xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t property);
/**
* @see xcb_get_text_property()
*/
xcb_get_property_cookie_t xcb_get_text_property_unchecked(xcb_connection_t
*c,
xcb_window_t wind
ow,
xcb_atom_t proper
ty);
/**
* @brief Fill given structure with the property value of a window.
* @param c The connection to the X server.
* @param cookie TextProperty request cookie.
* @param prop TextProperty reply which is to be filled.
* @param e Error if any.
* @return Return 1 on success, 0 otherwise.
*
* The parameter e supplied to this function must be NULL if
* xcb_get_text_property_unchecked() is used. Otherwise, it stores
* the error if any. prop structure members should be freed by
* xcb_get_text_property_reply_wipe().
*/
uint8_t xcb_get_text_property_reply(xcb_connection_t *c,
xcb_get_property_cookie_t cookie,
xcb_get_text_property_reply_t *prop,
xcb_generic_error_t **e);
/**
* @brief Wipe prop structure members previously allocated by
* xcb_get_text_property_reply().
* @param prop prop structure whose members is going to be freed.
*/
void xcb_get_text_property_reply_wipe(xcb_get_text_property_reply_t *prop);
/* WM_NAME */ /* WM_NAME */
void xcb_set_wm_name_checked (xcb_connection_t *c, /**
xcb_window_t window, * @brief Deliver a SetProperty request to set WM_NAME property value.
xcb_atom_t encoding, * @param c The connection to the X server.
uint32_t name_len, * @param window Window X identifier.
const char *name); * @param encoding Encoding used.
* @param name_len Length of name value to set.
void xcb_set_wm_name (xcb_connection_t *c, * @param name Name value to set.
xcb_window_t window, */
xcb_atom_t encoding, void xcb_set_wm_name_checked(xcb_connection_t *c,
uint32_t name_len, xcb_window_t window,
const char *name); xcb_atom_t encoding,
uint32_t name_len,
int xcb_get_wm_name (xcb_connection_t *c, const char *name);
xcb_window_t window,
uint8_t *format, /**
xcb_atom_t *encoding, * @see xcb_set_wm_name_checked()
uint32_t *name_len, */
char **name); void xcb_set_wm_name(xcb_connection_t *c, xcb_window_t window,
xcb_atom_t encoding, uint32_t name_len,
void xcb_watch_wm_name (xcb_property_handlers_t *prophs, const char *name);
uint32_t long_len,
xcb_generic_property_handler_t handler, /**
void *data); * @brief Deliver a GetProperty request to the X server for WM_NAME.
* @param c The connection to the X server.
* @param window Window X identifier.
* @return The request cookie.
*/
xcb_get_property_cookie_t xcb_get_wm_name(xcb_connection_t *c,
xcb_window_t window);
/**
* @see xcb_get_wm_name()
*/
xcb_get_property_cookie_t xcb_get_wm_name_unchecked(xcb_connection_t *c,
xcb_window_t window);
/**
* @brief Fill given structure with the WM_NAME property of a window.
* @param c The connection to the X server.
* @param cookie Request cookie.
* @param prop WM_NAME property value.
* @param e Error if any.
* @see xcb_get_text_property_reply()
* @return Return 1 on success, 0 otherwise.
*/
uint8_t xcb_get_wm_name_reply(xcb_connection_t *c,
xcb_get_property_cookie_t cookie,
xcb_get_text_property_reply_t *prop,
xcb_generic_error_t **e);
/**
* @brief Set a callback on WM_NAME property changes.
* @param prophs Property handlers.
* @param long_len Length of data.
* @param handler The callback.
* @param data data given to the callback.
*/
void xcb_watch_wm_name(xcb_property_handlers_t *prophs, uint32_t long_len,
xcb_generic_property_handler_t handler, void *data);
/* WM_ICON_NAME */ /* WM_ICON_NAME */
void xcb_set_wm_icon_name_checked (xcb_connection_t *c, /**
xcb_window_t window, * @brief Deliver a SetProperty request to set WM_ICON_NAME property value.
xcb_atom_t encoding, * @param c The connection to the X server.
uint32_t name_len, * @param window Window X identifier.
const char *name); * @param encoding Encoding used.
* @param name_len Length of name value to set.
void xcb_set_wm_icon_name (xcb_connection_t *c, * @param name Name value to set.
xcb_window_t window, */
xcb_atom_t encoding, void xcb_set_wm_icon_name_checked(xcb_connection_t *c, xcb_window_t window,
uint32_t name_len, xcb_atom_t encoding, uint32_t name_len,
const char *name); const char *name);
int xcb_get_wm_icon_name (xcb_connection_t *c, /**
xcb_window_t window, * @see xcb_set_wm_icon_name_checked()
uint8_t *format, */
xcb_atom_t *encoding, void xcb_set_wm_icon_name(xcb_connection_t *c, xcb_window_t window,
uint32_t *name_len, xcb_atom_t encoding, uint32_t name_len,
char **name); const char *name);
void xcb_watch_wm_icon_name (xcb_property_handlers_t *prophs, /**
uint32_t long_len, * @brief Send request to get WM_ICON_NAME property of a window.
xcb_generic_property_handler_t handler, * @param c The connection to the X server.
void *data); * @param window Window X identifier.
* @return The request cookie.
*/
xcb_get_property_cookie_t xcb_get_wm_icon_name(xcb_connection_t *c,
xcb_window_t window);
/**
* @see xcb_get_wm_icon_name()
*/
xcb_get_property_cookie_t xcb_get_wm_icon_name_unchecked(xcb_connection_t *
c,
xcb_window_t windo
w);
/**
* @brief Fill given structure with the WM_ICON_NAME property of a window.
* @param c The connection to the X server.
* @param cookie Request cookie.
* @param prop WM_ICON_NAME property value.
* @param e Error if any.
* @see xcb_get_text_property_reply()
* @return Return 1 on success, 0 otherwise.
*/
uint8_t xcb_get_wm_icon_name_reply(xcb_connection_t *c,
xcb_get_property_cookie_t cookie,
xcb_get_text_property_reply_t *prop,
xcb_generic_error_t **e);
/**
* @brief Set a callback on WM_ICON_NAME property changes.
* @param prophs Property handlers.
* @param long_len Length of data.
* @param handler The callback.
* @param data data given to the callback.
*/
void xcb_watch_wm_icon_name(xcb_property_handlers_t *prophs, uint32_t long_
len,
xcb_generic_property_handler_t handler,
void *data);
/* WM_CLIENT_MACHINE */ /* WM_CLIENT_MACHINE */
void xcb_set_wm_client_machine_checked (xcb_connection_t *c, /**
xcb_window_t window, * @brief Deliver a SetProperty request to set WM_CLIENT_MACHINE property v
xcb_atom_t encoding, alue.
uint32_t name_len, * @param c The connection to the X server.
const char *name); * @param window Window X identifier.
* @param encoding Encoding used.
void xcb_set_wm_client_machine (xcb_connection_t *c, * @param name_len Length of name value to set.
xcb_window_t window, * @param name Name value to set.
xcb_atom_t encoding, */
uint32_t name_len, void xcb_set_wm_client_machine_checked(xcb_connection_t *c, xcb_window_t wi
const char *name); ndow,
xcb_atom_t encoding, uint32_t name_l
int xcb_get_wm_client_machine (xcb_connection_t *c, en,
xcb_window_t window, const char *name);
uint8_t *format,
xcb_atom_t *encoding, /**
uint32_t *name_len, * @see xcb_set_wm_client_machine_checked()
char **name); */
void xcb_set_wm_client_machine(xcb_connection_t *c, xcb_window_t window,
void xcb_watch_wm_client_machine (xcb_property_handlers_t *prophs, xcb_atom_t encoding, uint32_t name_len,
uint32_t long_len, const char *name);
xcb_generic_property_handler_t handler,
void *data); /**
* @brief Send request to get WM_CLIENT_MACHINE property of a window.
* @param c The connection to the X server.
* @param window Window X identifier.
* @return The request cookie.
*/
xcb_get_property_cookie_t xcb_get_wm_client_machine(xcb_connection_t *c,
xcb_window_t window);
/**
* @see xcb_get_wm_client_machine()
*/
xcb_get_property_cookie_t xcb_get_wm_client_machine_unchecked(xcb_connectio
n_t *c,
xcb_window_t
window);
/**
* @brief Fill given structure with the WM_CLIENT_MACHINE property of a win
dow.
* @param c The connection to the X server.
* @param cookie Request cookie.
* @param prop WM_CLIENT_MACHINE property value.
* @param e Error if any.
* @see xcb_get_text_property_reply()
* @return Return 1 on success, 0 otherwise.
*/
uint8_t xcb_get_wm_client_machine_reply(xcb_connection_t *c,
xcb_get_property_cookie_t cookie,
xcb_get_text_property_reply_t *prop
,
xcb_generic_error_t **e);
/**
* @brief Set a callback on WM_CLIENT_MACHINE property changes.
* @param prophs Property handlers.
* @param long_len Length of data.
* @param handler The callback.
* @param data data given to the callback.
*/
void xcb_watch_wm_client_machine(xcb_property_handlers_t *prophs,
uint32_t long_len,
xcb_generic_property_handler_t handler,
void *data);
/* WM_CLASS */
/**
* @brief WM_CLASS hint structure
*/
typedef struct {
/** Instance name */
char *name;
/** Class of application */
char *class;
/** Store reply to avoid memory allocation, should normally not be
used directly */
xcb_get_property_reply_t *_reply;
} xcb_get_wm_class_reply_t;
/**
* @brief Deliver a GetProperty request to the X server for WM_CLASS.
* @param c The connection to the X server.
* @param window Window X identifier.
* @return The request cookie.
*/
xcb_get_property_cookie_t xcb_get_wm_class(xcb_connection_t *c,
xcb_window_t window);
/**
* @see xcb_get_wm_class()
*/
xcb_get_property_cookie_t xcb_get_wm_class_unchecked(xcb_connection_t *c,
xcb_window_t window);
/**
* @brief Fill given structure with the WM_CLASS property of a window.
* @param c The connection to the X server.
* @param cookie Request cookie.
* @param prop WM_CLASS property value.
* @param e Error if any.
* @return Return 1 on success, 0 otherwise.
*
* The parameter e supplied to this function must be NULL if
* xcb_get_wm_class_unchecked() is used. Otherwise, it stores the
* error if any. prop structure members should be freed by
* xcb_get_wm_class_reply_wipe().
*/
uint8_t xcb_get_wm_class_reply(xcb_connection_t *c,
xcb_get_property_cookie_t cookie,
xcb_get_wm_class_reply_t *prop,
xcb_generic_error_t **e);
/**
* @brief Wipe prop structure members previously allocated by
* xcb_get_wm_class_reply().
* @param prop prop structure whose members is going to be freed.
*/
void xcb_get_wm_class_reply_wipe(xcb_get_wm_class_reply_t *prop);
/* WM_TRANSIENT_FOR */ /* WM_TRANSIENT_FOR */
int xcb_get_wm_transient_for (xcb_connection_t *c,
xcb_window_t window, /**
xcb_window_t *prop_win); * @brief Send request to get WM_TRANSIENT_FOR property of a window.
* @param c The connection to the X server
* @param window Window X identifier.
* @return The request cookie.
*/
xcb_get_property_cookie_t xcb_get_wm_transient_for(xcb_connection_t *c,
xcb_window_t window);
/**
* @see xcb_get_wm_transient_for_unchecked()
*/
xcb_get_property_cookie_t xcb_get_wm_transient_for_unchecked(xcb_connection
_t *c,
xcb_window_t w
indow);
/**
* @brief Fill given window pointer with the WM_TRANSIENT_FOR property of a
window.
* @param prop WM_TRANSIENT_FOR property value.
* @param reply The get property request reply.
* @return Return 1 on success, 0 otherwise.
*/
uint8_t
xcb_get_wm_transient_for_from_reply(xcb_window_t *prop,
xcb_get_property_reply_t *reply);
/**
* @brief Fill given structure with the WM_TRANSIENT_FOR property of a wind
ow.
* @param c The connection to the X server.
* @param cookie Request cookie.
* @param prop WM_TRANSIENT_FOR property value.
* @param e Error if any.
* @return Return 1 on success, 0 otherwise.
*
* The parameter e supplied to this function must be NULL if
* xcb_get_wm_transient_for_unchecked() is used. Otherwise, it stores
* the error if any.
*/
uint8_t xcb_get_wm_transient_for_reply(xcb_connection_t *c,
xcb_get_property_cookie_t cookie,
xcb_window_t *prop,
xcb_generic_error_t **e);
/* WM_SIZE_HINTS */ /* WM_SIZE_HINTS */
typedef enum { typedef enum {
XCB_SIZE_US_POSITION_HINT = 1 << 0, XCB_SIZE_HINT_US_POSITION = 1 << 0,
XCB_SIZE_US_SIZE_HINT = 1 << 1, XCB_SIZE_HINT_US_SIZE = 1 << 1,
XCB_SIZE_P_POSITION_HINT = 1 << 2, XCB_SIZE_HINT_P_POSITION = 1 << 2,
XCB_SIZE_P_SIZE_HINT = 1 << 3, XCB_SIZE_HINT_P_SIZE = 1 << 3,
XCB_SIZE_P_MIN_SIZE_HINT = 1 << 4, XCB_SIZE_HINT_P_MIN_SIZE = 1 << 4,
XCB_SIZE_P_MAX_SIZE_HINT = 1 << 5, XCB_SIZE_HINT_P_MAX_SIZE = 1 << 5,
XCB_SIZE_P_RESIZE_INC_HINT = 1 << 6, XCB_SIZE_HINT_P_RESIZE_INC = 1 << 6,
XCB_SIZE_P_ASPECT_HINT = 1 << 7, XCB_SIZE_HINT_P_ASPECT = 1 << 7,
XCB_SIZE_BASE_SIZE_HINT = 1 << 8, XCB_SIZE_HINT_BASE_SIZE = 1 << 8,
XCB_SIZE_P_WIN_GRAVITY_HINT = 1 << 9 XCB_SIZE_HINT_P_WIN_GRAVITY = 1 << 9
} xcb_size_hints_flags_t; } xcb_size_hints_flags_t;
typedef struct xcb_size_hints_t xcb_size_hints_t; /**
* @brief Size hints structure.
xcb_size_hints_t *xcb_alloc_size_hints (); */
typedef struct {
void xcb_free_size_hints (xcb_size_hints_t *hints); /** User specified flags */
uint32_t flags;
void xcb_size_hints_get_position (xcb_size_hints_t *hints, /** User-specified position */
int32_t *x, int32_t x, y;
int32_t *y); /** User-specified size */
void xcb_size_hints_get_size (xcb_size_hints_t *hints, int32_t width, height;
int32_t *width, /** Program-specified minimum size */
int32_t *height); int32_t min_width, min_height;
void xcb_size_hints_get_min_size (xcb_size_hints_t *hints, /** Program-specified maximum size */
int32_t *min_width, int32_t max_width, max_height;
int32_t *min_height); /** Program-specified resize increments */
void xcb_size_hints_get_max_size (xcb_size_hints_t *hints, int32_t width_inc, height_inc;
int32_t *max_width, /** Program-specified minimum aspect ratios */
int32_t *max_height); int32_t min_aspect_num, min_aspect_den;
void xcb_size_hints_get_increase (xcb_size_hints_t *hints, /** Program-specified maximum aspect ratios */
int32_t *width_inc, int32_t max_aspect_num, max_aspect_den;
int32_t *height_inc); /** Program-specified base size */
void xcb_size_hints_get_min_aspect (xcb_size_hints_t *hints, int32_t base_width, base_height;
int32_t *min_aspect_num, /** Program-specified window gravity */
int32_t *min_aspect_den) uint32_t win_gravity;
; } xcb_size_hints_t;
void xcb_size_hints_get_max_aspect (xcb_size_hints_t *hints,
int32_t *max_aspect_num, /**
int32_t *max_aspect_den) * @brief Set size hints to a given position.
; * @param hints SIZE_HINTS structure.
void xcb_size_hints_get_base_size (xcb_size_hints_t *hints, * @param user_specified Is the size user-specified?
int32_t *base_width, * @param x The X position.
int32_t *base_height); * @param y The Y position.
uint32_t xcb_size_hints_get_win_gravity (xcb_size_hints_t *hints); */
void xcb_size_hints_set_position(xcb_size_hints_t *hints, int user_specifie
uint32_t xcb_size_hints_get_flags (xcb_size_hints_t *hints); d,
int32_t x, int32_t y);
void xcb_size_hints_set_flags (xcb_size_hints_t *hints,
uint32_t flags); /**
* @brief Set size hints to a given size.
void xcb_size_hints_set_position (xcb_size_hints_t *hints, * @param hints SIZE_HINTS structure.
int user_specified, * @param user_specified is the size user-specified?
int32_t x, * @param width The width.
int32_t y); * @param height The height.
*/
void xcb_size_hints_set_size (xcb_size_hints_t *hints, void xcb_size_hints_set_size(xcb_size_hints_t *hints, int user_specified,
int user_specified, int32_t width, int32_t height);
int32_t width,
int32_t height); /**
* @brief Set size hints to a given minimum size.
void xcb_size_hints_set_min_size (xcb_size_hints_t *hints, * @param hints SIZE_HINTS structure.
int32_t min_width, * @param width The minimum width.
int32_t min_height); * @param height The minimum height.
*/
void xcb_size_hints_set_max_size (xcb_size_hints_t *hints, void xcb_size_hints_set_min_size(xcb_size_hints_t *hints, int32_t min_width
int32_t max_width, ,
int32_t max_height); int32_t min_height);
void xcb_size_hints_set_resize_inc (xcb_size_hints_t *hints, /**
int32_t width_inc, * @brief Set size hints to a given maximum size.
int32_t height_inc); * @param hints SIZE_HINTS structure.
* @param width The maximum width.
void xcb_size_hints_set_aspect (xcb_size_hints_t *hints, * @param height The maximum height.
int32_t min_aspect_num, */
int32_t min_aspect_den, void xcb_size_hints_set_max_size(xcb_size_hints_t *hints, int32_t max_width
int32_t max_aspect_num, ,
int32_t max_aspect_den) int32_t max_height);
;
/**
void xcb_size_hints_set_base_size (xcb_size_hints_t *hints, * @brief Set size hints to a given resize increments.
int32_t base_width, * @param hints SIZE_HINTS structure.
int32_t base_height); * @param width The resize increments width.
* @param height The resize increments height.
void xcb_size_hints_set_win_gravity (xcb_size_hints_t *hints, */
uint8_t win_gravity); void xcb_size_hints_set_resize_inc(xcb_size_hints_t *hints, int32_t width_i
nc,
void xcb_set_wm_size_hints_checked (xcb_connection_t *c, int32_t height_inc);
xcb_window_t window,
xcb_atom_t property, /**
xcb_size_hints_t *hints); * @brief Set size hints to a given aspect ratios.
* @param hints SIZE_HINTS structure.
void xcb_set_wm_size_hints (xcb_connection_t *c, * @param min_aspect_num The minimum aspect ratios for the width.
xcb_window_t window, * @param min_aspect_den The minimum aspect ratios for the height.
xcb_atom_t property, * @param max_aspect_num The maximum aspect ratios for the width.
xcb_size_hints_t *hints); * @param max_aspect_den The maximum aspect ratios for the height.
*/
xcb_size_hints_t *xcb_get_wm_size_hints (xcb_connection_t *c, void xcb_size_hints_set_aspect(xcb_size_hints_t *hints, int32_t min_aspect_
xcb_window_t window, num,
xcb_atom_t property, int32_t min_aspect_den, int32_t max_aspect_n
long *supplied); um,
int32_t max_aspect_den);
/**
* @brief Set size hints to a given base size.
* @param hints SIZE_HINTS structure.
* @param base_width Base width.
* @param base_height Base height.
*/
void xcb_size_hints_set_base_size(xcb_size_hints_t *hints, int32_t base_wid
th,
int32_t base_height);
/**
* @brief Set size hints to a given window gravity.
* @param hints SIZE_HINTS structure.
* @param win_gravity Window gravity value.
*/
void xcb_size_hints_set_win_gravity(xcb_size_hints_t *hints,
uint8_t win_gravity);
/**
* @brief Deliver a ChangeProperty request to set a value to a given proper
ty.
* @param c The connection to the X server.
* @param window Window X identifier.
* @param property Property to set value for.
* @param hints Hints value to set.
*/
void xcb_set_wm_size_hints_checked(xcb_connection_t *c, xcb_window_t window
,
xcb_atom_t property, xcb_size_hints_t *h
ints);
/**
* @see xcb_set_wm_size_hints_checked()
*/
void xcb_set_wm_size_hints(xcb_connection_t *c, xcb_window_t window,
xcb_atom_t property, xcb_size_hints_t *hints);
/**
* @brief Send request to get size hints structure for the named property.
* @param c The connection to the X server.
* @param window Window X identifier.
* @param property Specify the property name.
* @return The request cookie.
*/
xcb_get_property_cookie_t xcb_get_wm_size_hints(xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t property);
/**
* @see xcb_get_wm_size_hints()
*/
xcb_get_property_cookie_t xcb_get_wm_size_hints_unchecked(xcb_connection_t
*c,
xcb_window_t wind
ow,
xcb_atom_t proper
ty);
/**
* @brief Fill given structure with the size hints of the named property.
* @param c The connection to the X server.
* @param cookie Request cookie.
* @param hints Size hints structure.
* @param e Error if any.
* @return Return 1 on success, 0 otherwise.
*
* The parameter e supplied to this function must be NULL if
* xcb_get_wm_size_hints_unchecked() is used. Otherwise, it stores
* the error if any. The returned pointer should be freed.
*/
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);
/* WM_NORMAL_HINTS */ /* WM_NORMAL_HINTS */
void xcb_set_wm_normal_hints_checked (xcb_connection_t *c, /**
xcb_window_t window, * @brief Deliver a ChangeProperty request to set WM_NORMAL_HINTS property
xcb_size_hints_t *hints); value.
* @param c The connection to the X server.
void xcb_set_wm_normal_hints (xcb_connection_t *c, * @param window Window X identifier.
xcb_window_t window, * @param hints Hints value to set.
xcb_size_hints_t *hints); */
void xcb_set_wm_normal_hints_checked(xcb_connection_t *c, xcb_window_t wind
xcb_size_hints_t *xcb_get_wm_normal_hints (xcb_connection_t *c, ow,
xcb_window_t window, xcb_size_hints_t *hints);
long *supplied);
/**
* @see xcb_set_wm_normal_hints_checked()
*/
void xcb_set_wm_normal_hints(xcb_connection_t *c, xcb_window_t window,
xcb_size_hints_t *hints);
/**
* @brief Send request to get WM_NORMAL_HINTS property of a window.
* @param c The connection to the X server.
* @param window Window X identifier.
* @return The request cookie.
*/
xcb_get_property_cookie_t xcb_get_wm_normal_hints(xcb_connection_t *c,
xcb_window_t window);
/**
* @see xcb_get_wm_normal_hints()
*/
xcb_get_property_cookie_t xcb_get_wm_normal_hints_unchecked(xcb_connection_
t *c,
xcb_window_t wi
ndow);
/**
* @brief Fill given structure with the WM_NORMAL_HINTS property of a windo
w.
* @param hints WM_NORMAL_HINTS property value.
* @param reply The get property request reply.
* @return Return 1 on success, 0 otherwise.
*/
uint8_t
xcb_get_wm_size_hints_from_reply(xcb_size_hints_t *hints,
xcb_get_property_reply_t *reply);
/**
* @brief Fill given structure with the WM_NORMAL_HINTS property of a windo
w.
* @param c The connection to the X server.
* @param cookie Request cookie.
* @param hints WM_NORMAL_HINTS property value.
* @param e Error if any.
* @return Return 1 on success, 0 otherwise.
*
* The parameter e supplied to this function must be NULL if
* xcb_get_wm_normal_hints_unchecked() is used. Otherwise, it stores
* the error if any. The returned pointer should be freed.
*/
uint8_t xcb_get_wm_normal_hints_reply(xcb_connection_t *c,
xcb_get_property_cookie_t cookie,
xcb_size_hints_t *hints,
xcb_generic_error_t **e);
/* WM_HINTS */ /* WM_HINTS */
typedef struct xcb_wm_hints_t xcb_wm_hints_t; /**
#define XCB_NUM_WM_HINTS_ELEMENTS 9 /* number of elements in this structure * @brief WM hints structure (may be extended in the future).
*/ */
typedef struct {
/** Marks which fields in this structure are defined */
int32_t flags;
/** Does this application rely on the window manager to get keyboard
input? */
uint8_t input;
/** See below */
int32_t initial_state;
/** Pixmap to be used as icon */
xcb_pixmap_t icon_pixmap;
/** Window to be used as icon */
xcb_window_t icon_window;
/** Initial position of icon */
int32_t icon_x, icon_y;
/** Icon mask bitmap */
xcb_pixmap_t icon_mask;
/* Identifier of related window group */
xcb_window_t window_group;
} xcb_wm_hints_t;
/** Number of elements in this structure */
#define XCB_NUM_WM_HINTS_ELEMENTS 9
/**
* @brief WM_HINTS window states.
*/
typedef enum { typedef enum {
XCB_WM_WITHDRAWN_STATE = 0, XCB_WM_STATE_WITHDRAWN = 0,
XCB_WM_NORMAL_STATE = 1, XCB_WM_STATE_NORMAL = 1,
XCB_WM_ICONIC_STATE = 3 XCB_WM_STATE_ICONIC = 3
} xcb_wm_state_t; } xcb_wm_state_t;
typedef enum { typedef enum {
XCB_WM_INPUT_HINT = (1L << 0), XCB_WM_HINT_INPUT = (1L << 0),
XCB_WM_STATE_HINT = (1L << 1), XCB_WM_HINT_STATE = (1L << 1),
XCB_WM_ICON_PIXMAP_HINT = (1L << 2), XCB_WM_HINT_ICON_PIXMAP = (1L << 2),
XCB_WM_ICON_WINDOW_HINT = (1L << 3), XCB_WM_HINT_ICON_WINDOW = (1L << 3),
XCB_WM_ICON_POSITION_HINT = (1L << 4), XCB_WM_HINT_ICON_POSITION = (1L << 4),
XCB_WM_ICON_MASK_HINT = (1L << 5), XCB_WM_HINT_ICON_MASK = (1L << 5),
XCB_WM_WINDOW_GROUP_HINT = (1L << 6), XCB_WM_HINT_WINDOW_GROUP = (1L << 6),
XCB_WM_X_URGENCY_HINT = (1L << 8) XCB_WM_HINT_X_URGENCY = (1L << 8)
} xcb_wm_t; } xcb_wm_t;
#define XCB_WM_ALL_HINTS (XCB_WM_INPUT_HINT | XCB_WM_STATE_HINT #define XCB_WM_ALL_HINTS (XCB_WM_HINT_INPUT | XCB_WM_HINT_STATE |\
| XCB_WM_ICON_PIXMAP_HINT | \ XCB_WM_HINT_ICON_PIXMAP | XCB_WM_HINT_ICON_WINDOW
XCB_WM_ICON_WINDOW_HINT | XCB_WM_ICON_POSITION_HI |\
NT | XCB_WM_ICON_MASK_HINT | \ XCB_WM_HINT_ICON_POSITION | XCB_WM_HINT_ICON_MASK
XCB_WM_WINDOW_GROUP_HINT) |\
XCB_WM_HINT_WINDOW_GROUP)
xcb_wm_hints_t *xcb_alloc_wm_hints();
void xcb_free_wm_hints (xcb_wm_hints_t *hints); /**
* @brief Get urgency hint.
uint8_t xcb_wm_hints_get_input (xcb_wm_hints_t *hints); * @param hints WM_HINTS structure.
xcb_pixmap_t xcb_wm_hints_get_icon_pixmap (xcb_wm_hints_t *hints); * @return Urgency hint value.
xcb_pixmap_t xcb_wm_hints_get_icon_mask (xcb_wm_hints_t *hints); */
xcb_window_t xcb_wm_hints_get_icon_window (xcb_wm_hints_t *hints); uint32_t xcb_wm_hints_get_urgency(xcb_wm_hints_t *hints);
xcb_window_t xcb_wm_hints_get_window_group (xcb_wm_hints_t *hints);
uint32_t xcb_wm_hints_get_urgency (xcb_wm_hints_t *hints); /**
* @brief Set input focus.
uint32_t xcb_wm_hints_get_flags(xcb_wm_hints_t *hints); * @param hints WM_HINTS structure.
void xcb_wm_hints_set_flags(xcb_wm_hints_t *hints, uint32_t flags); * @param input Input focus.
uint32_t xcb_wm_hints_get_initial_state(xcb_wm_hints_t *hints); */
void xcb_wm_hints_set_input(xcb_wm_hints_t *hints, uint8_t input);
void xcb_wm_hints_set_input (xcb_wm_hints_t *hints, uint8_t input);
void xcb_wm_hints_set_iconic (xcb_wm_hints_t *hints); /**
void xcb_wm_hints_set_normal (xcb_wm_hints_t *hints); * @brief Set hints state to 'iconic'.
void xcb_wm_hints_set_withdrawn (xcb_wm_hints_t *hints); * @param hints WM_HINTS structure.
void xcb_wm_hints_set_none (xcb_wm_hints_t *hints); */
void xcb_wm_hints_set_icon_pixmap (xcb_wm_hints_t *hints, xcb_pixmap_t ico void xcb_wm_hints_set_iconic(xcb_wm_hints_t *hints);
n_pixmap);
void xcb_wm_hints_set_icon_mask (xcb_wm_hints_t *hints, xcb_pixmap_t ico /**
n_mask); * @brief Set hints state to 'normal'.
void xcb_wm_hints_set_icon_window (xcb_wm_hints_t *hints, xcb_window_t ico * @param hints WM_HINTS structure.
n_window); */
void xcb_wm_hints_set_window_group (xcb_wm_hints_t *hints, xcb_window_t win void xcb_wm_hints_set_normal(xcb_wm_hints_t *hints);
dow_group);
void xcb_wm_hints_set_urgency (xcb_wm_hints_t *hints); /**
* @brief Set hints state to 'withdrawn'.
void xcb_set_wm_hints_checked (xcb_connection_t *c, * @param hints WM_HINTS structure.
xcb_window_t window, */
xcb_wm_hints_t *hints); void xcb_wm_hints_set_withdrawn(xcb_wm_hints_t *hints);
void xcb_set_wm_hints (xcb_connection_t *c, /**
xcb_window_t window, * @brief Set hints state to none.
xcb_wm_hints_t *hints); * @param hints WM_HINTS structure.
*/
xcb_wm_hints_t *xcb_get_wm_hints (xcb_connection_t *c, void xcb_wm_hints_set_none(xcb_wm_hints_t *hints);
xcb_window_t window);
/**
* @brief Set pixmap to be used as icon.
* @param hints WM_HINTS structure.
* @param icon_pixmap Pixmap.
*/
void xcb_wm_hints_set_icon_pixmap(xcb_wm_hints_t *hints,
xcb_pixmap_t icon_pixmap);
/**
* @brief Set icon mask bitmap.
* @param hints WM_HINTS structure.
* @param icon_mask Pixmap.
*/
void xcb_wm_hints_set_icon_mask(xcb_wm_hints_t *hints, xcb_pixmap_t icon_ma
sk);
/**
* @brief Set window identifier to be used as icon.
* @param hints WM_HINTS structure.
* @param icon_window Window X identifier.
*/
void xcb_wm_hints_set_icon_window(xcb_wm_hints_t *hints,
xcb_window_t icon_window);
/**
* @brief Set identifier of related window group.
* @param hints WM_HINTS structure.
* @param window_group Window X identifier.
*/
void xcb_wm_hints_set_window_group(xcb_wm_hints_t *hints,
xcb_window_t window_group);
/**
* @brief Set urgency hints flag.
* @param hints WM_HINTS structure.
*/
void xcb_wm_hints_set_urgency(xcb_wm_hints_t *hints);
/**
* @brief Deliver a SetProperty request to set WM_HINTS property value.
* @param c The connection to the X server.
* @param window Window X identifier.
* @param hints Hints value to set.
*/
void xcb_set_wm_hints_checked(xcb_connection_t *c, xcb_window_t window,
xcb_wm_hints_t *hints);
/**
* @see xcb_set_wm_hints_checked()
*/
void xcb_set_wm_hints(xcb_connection_t *c, xcb_window_t window,
xcb_wm_hints_t *hints);
/**
* @brief Send request to get WM_HINTS property of a window.
* @param c The connection to the X server.
* @param window Window X identifier.
* @return The request cookie.
*/
xcb_get_property_cookie_t xcb_get_wm_hints(xcb_connection_t *c,
xcb_window_t window);
/**
* @see xcb_get_wm_hints()
*/
xcb_get_property_cookie_t xcb_get_wm_hints_unchecked(xcb_connection_t *c,
xcb_window_t window);
/**
* @brief Fill given structure with the WM_HINTS property of a window.
* @param hints WM_HINTS property value.
* @param reply The get property request reply.
* @return Return 1 on success, 0 otherwise.
*/
uint8_t
xcb_get_wm_hints_from_reply(xcb_wm_hints_t *hints,
xcb_get_property_reply_t *reply);
/**
* @brief Fill given structure with the WM_HINTS property of a window.
* @param c The connection to the X server.
* @param cookie Request cookie.
* @param hints WM_HINTS property value.
* @param e Error if any.
* @return Return 1 on success, 0 otherwise.
*
* The parameter e supplied to this function must be NULL if
* xcb_get_wm_hints_unchecked() is used. Otherwise, it stores the
* error if any. The returned pointer should be freed.
*/
uint8_t xcb_get_wm_hints_reply(xcb_connection_t *c,
xcb_get_property_cookie_t cookie,
xcb_wm_hints_t *hints,
xcb_generic_error_t **e);
/* WM_PROTOCOLS */ /* WM_PROTOCOLS */
void xcb_set_wm_protocols_checked (xcb_connection_t *c, /**
xcb_window_t window, * @brief Deliver a SetProperty request to set WM_PROTOCOLS property value.
uint32_t list_len, * @param c The connection to the X server.
xcb_atom_t *list); * @param wm_protocols The WM_PROTOCOLS atom.
* @param window Window X identifier.
void xcb_set_wm_protocols (xcb_connection_t *c, * @param list_len Atom list len.
xcb_window_t window, * @param list Atom list.
uint32_t list_len, */
xcb_atom_t *list); void xcb_set_wm_protocols_checked(xcb_connection_t *c, xcb_atom_t wm_protoc
ols,
int xcb_get_wm_protocols (xcb_connection_t *c, xcb_window_t window, uint32_t list_len,
xcb_window_t window, xcb_atom_t *list);
uint32_t *list_len,
xcb_atom_t **list); /**
* @see xcb_set_wm_protocols_checked()
#define HAS_DISCRIMINATED_NAME 0 */
#if HAS_DISCRIMINATED_NAME void xcb_set_wm_protocols(xcb_connection_t *c, xcb_atom_t wm_protocols,
char *discriminated_atom_name_by_screen (const char *base, uint8_t screen xcb_window_t window, uint32_t list_len,
); xcb_atom_t *list);
char *discriminated_atom_name_by_resource (const char *base, uint32_t resou
rce); /**
char *discriminated_atom_name_unique (const char *base, uint32_t id); * @brief WM_PROTOCOLS structure.
#endif */
typedef struct {
/** Length of the atoms list */
uint32_t atoms_len;
/** Atoms list */
xcb_atom_t *atoms;
/** Store reply to avoid memory allocation, should normally not be
used directly */
xcb_get_property_reply_t *_reply;
} xcb_get_wm_protocols_reply_t;
/**
* @brief Send request to get WM_PROTOCOLS property of a given window.
* @param c The connection to the X server.
* @param window Window X identifier.
* @return The request cookie.
*/
xcb_get_property_cookie_t xcb_get_wm_protocols(xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t wm_protocol_atom)
;
/**
* @see xcb_get_wm_protocols()
*/
xcb_get_property_cookie_t xcb_get_wm_protocols_unchecked(xcb_connection_t *
c,
xcb_window_t windo
w,
xcb_atom_t wm_prot
ocol_atom);
/**
* @brief Fill the given structure with the WM_PROTOCOLS property of a wind
ow.
* @param c The connection to the X server.
* @param cookie Request cookie.
* @param protocols WM_PROTOCOLS property value.
* @param e Error if any.
* @return Return 1 on success, 0 otherwise.
*
* The parameter e supplied to this function must be NULL if
* xcb_get_wm_protocols_unchecked() is used. Otherwise, it stores the
* error if any. protocols structure members should be freed by
* xcb_get_wm_protocols_reply_wipe().
*/
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);
/**
* @brief Wipe protocols structure members previously allocated by
* xcb_get_wm_protocols_reply().
* @param protocols protocols structure whose members is going to be freed.
*/
void xcb_get_wm_protocols_reply_wipe(xcb_get_wm_protocols_reply_t *protocol
s);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/**
* @}
*/
#endif /* __XCB_ICCCM_H__ */ #endif /* __XCB_ICCCM_H__ */
 End of changes. 15 change blocks. 
265 lines changed or deleted 890 lines changed or added


 xcb_property.h   xcb_property.h 
#ifndef __XCB_PROP_H__ /*
#define __XCB_PROP_H__ * Copyright (C) 2008 Julien Danjou <julien@danjou.info>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or
* their institutions shall not be used in advertising or otherwise to
* promote the sale, use or other dealings in this Software without
* prior written authorization from the authors.
*/
/**
* @defgroup xcb__property_t XCB Property Functions
*
* These functions ease the handling of X propertiess received.
*
* @{
*/
#ifndef __XCB_PROPERTY_H__
#define __XCB_PROPERTY_H__
#include "xcb_event.h" #include "xcb_event.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
xcb_get_property_cookie_t xcb_get_any_property(xcb_connection_t *c, uint8_t
del, xcb_window_t window, xcb_atom_t name, uint32_t long_len);
typedef struct xcb_property_handlers xcb_property_handlers_t; typedef struct xcb_property_handlers xcb_property_handlers_t;
xcb_property_handlers_t *xcb_alloc_property_handlers(xcb_event_handlers_t *
evenths);
void xcb_free_property_handlers(xcb_property_handlers_t *prophs);
xcb_event_handlers_t *xcb_get_property_event_handlers(xcb_property_handlers
_t *prophs);
typedef int (*xcb_generic_property_handler_t)(void *data, xcb_connection_t *c, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_r eply_t *property); typedef int (*xcb_generic_property_handler_t)(void *data, xcb_connection_t *c, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_r eply_t *property);
int xcb_set_property_handler(xcb_property_handlers_t *prophs, xcb_atom_t na typedef struct {
me, uint32_t long_len, xcb_generic_property_handler_t handler, void *data); uint32_t long_len;
int xcb_set_default_property_handler(xcb_property_handlers_t *prophs, uint3 xcb_generic_property_handler_t handler;
2_t long_len, xcb_generic_property_handler_t handler, void *data); void *data;
} xcb_property_handler_t;
typedef struct xcb_property_handler_node xcb_property_handler_node_t;
struct xcb_property_handler_node {
xcb_property_handler_node_t *next;
xcb_atom_t name;
xcb_property_handler_t h;
};
struct xcb_property_handlers {
xcb_property_handler_node_t *head;
xcb_property_handler_t def;
xcb_event_handlers_t *evenths;
};
/**
* @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 window The window to get property from.
* @param name The property atom name.
* @param long_len The maximum length of the property.
* @return A cookie.
*/
xcb_get_property_cookie_t xcb_get_any_property(xcb_connection_t *c,
uint8_t del,
xcb_window_t window,
xcb_atom_t name,
uint32_t long_len);
/**
* @see xcb_get_any_property
*/
xcb_get_property_cookie_t xcb_get_any_property_unchecked(xcb_connection_t *
c,
uint8_t del,
xcb_window_t windo
w,
xcb_atom_t name,
uint32_t long_len)
;
/**
* @brief Initialize a property handlers structure.
* @param prophs The property handlers data structure pointer.
* @param evenths The event handlers.
*/
void xcb_property_handlers_init(xcb_property_handlers_t *prophs, xcb_event_
handlers_t *evenths);
/**
* @brief Wipe a property handler structure.
* @param prophs The property handlers data structure pointer.
*/
void xcb_property_handlers_wipe(xcb_property_handlers_t *prophs);
/**
* @brief Get a event handlers from a property handlers data structure.
* @param prophs The property handlers.
* @return The event handlers data structure which was set if any, NULL
* otherwise.
*/
xcb_event_handlers_t *xcb_property_get_event_handlers(xcb_property_handlers
_t *prophs);
/**
* @brief Set a property handler for an event.
* @param prophs The property handlers.
* @param name The property atom name.
* @param long_len The maximum length of the property value that will be
* handled.
* @param handler The handler callback function.
* @param data Optional data that will be passed as argument of the handler
* callback function. Can be NULL safely if you do not need it.
* @return Return 1 on success, 0 otherwise.
*/
uint8_t xcb_property_set_handler(xcb_property_handlers_t *prophs,
xcb_atom_t name,
uint32_t long_len,
xcb_generic_property_handler_t handler,
void *data);
/**
* @brief Set the default property handler.
* If a property does not have its own handler function, this one will be
* used.
* @param prophs The property handlers.
* @param name The property atom name.
* @param long_len The maximum length of the property value that will be
* handled.
* @param handler The handler callback function.
* @param data Optional data that will be passed as argument of the handler
* callback function. Can be NULL safely if you do not need it.
* @return Return 1 on success, 0 otherwise.
*/
uint8_t xcb_property_set_default_handler(xcb_property_handlers_t *prophs, u
int32_t long_len, xcb_generic_property_handler_t handler, void *data);
/**
* @brief Notify that a property has changed and call handler function call
back as needed.
* @param prophs The property handlers.
* @param state The property state.
* @param window The window.
* @param atom The property atom name.
*/
int xcb_property_changed(xcb_property_handlers_t *prophs, uint8_t state, xc b_window_t window, xcb_atom_t atom); int xcb_property_changed(xcb_property_handlers_t *prophs, uint8_t state, xc b_window_t window, xcb_atom_t atom);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __XCB_PROP_H__ */ /**
* @}
*/
#endif /* __XCB_PROPERTY_H__ */
 End of changes. 5 change blocks. 
17 lines changed or deleted 147 lines changed or added


 xcb_reply.h   xcb_reply.h 
/*
* Copyright (C) 2008 Julien Danjou <julien@danjou.info>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or
* their institutions shall not be used in advertising or otherwise to
* promote the sale, use or other dealings in this Software without
* prior written authorization from the authors.
*/
/**
* @defgroup xcb__reply_t XCB Reply Functions
*
* These functions ease the usage of asynchronous possibility of XCB about
* the reply retrieve of sent requests.
*
* @{
*/
#ifndef __XCB_REPLY_H__ #ifndef __XCB_REPLY_H__
#define __XCB_REPLY_H__ #define __XCB_REPLY_H__
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <pthread.h> #include <pthread.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef struct reply_handlers reply_handlers_t; typedef void (*xcb_generic_reply_handler_t)(void *data, xcb_connection_t *c
reply_handlers_t *alloc_reply_handlers(xcb_connection_t *c); , xcb_generic_reply_t *reply, xcb_generic_error_t *error);
void free_reply_handlers(reply_handlers_t *h);
xcb_connection_t *get_xcb_connection(reply_handlers_t *h);
int poll_replies(reply_handlers_t *h);
void start_reply_thread(reply_handlers_t *h);
void stop_reply_thread(reply_handlers_t *h);
typedef void (*generic_reply_handler)(void *data, xcb_connection_t *c, xcb_
generic_reply_t *reply, xcb_generic_error_t *error);
void add_reply_handler(reply_handlers_t *h, unsigned int request, generic_r struct xcb_reply_node
eply_handler handler, void *data); {
struct xcb_reply_node *next;
unsigned int request;
xcb_generic_reply_handler_t handler;
void *data;
char handled;
};
struct xcb_reply_handlers
{
pthread_mutex_t lock;
pthread_cond_t cond;
struct xcb_reply_node *head;
xcb_connection_t *c;
pthread_t thread;
};
typedef struct xcb_reply_handlers xcb_reply_handlers_t;
/**
* @brief Initialize a reply handlers structure.
* @param c The connection to the X server.
* @param h The reply handlers.
*/
void xcb_reply_handlers_init(xcb_connection_t *c, xcb_reply_handlers_t *h);
/**
* @brief Get the connection to the X server used in reply handlers.
* @param h The reply handlers data structure.
* @return The connection to the X server.
*/
xcb_connection_t *xcb_reply_get_xcb_connection(xcb_reply_handlers_t *h);
/**
* @brief Poll for reply using reply handlers.
* @param h The reply handlers data structure.
* @return The value return by the handler callback function, or 0 if no
* handler was found.
*/
int xcb_reply_poll_for_reply(xcb_reply_handlers_t *h);
/**
* @brief Start reply handling thread.
* This thread will run forever until it is stop with xcb_reply_stop_thread
.
* @param h The reply handlers.
*/
void xcb_reply_start_thread(xcb_reply_handlers_t *h);
/**
* @brief Stop reply handling thread.
* @param h The reply handlers.
*/
void xcb_reply_stop_thread(xcb_reply_handlers_t *h);
/**
* @brief Add a reply handler.
* @param h The reply handlers data structure to fill.
* @param request The request identifier.
* @param handler The handler to call for this request.
* @param data Optional data passed to the callback function handling reque
st.
*/
void xcb_reply_add_handler(xcb_reply_handlers_t *h, unsigned int request, x
cb_generic_reply_handler_t handler, void *data);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/**
* @}
*/
#endif /* __XCB_REPLY_H__ */ #endif /* __XCB_REPLY_H__ */
 End of changes. 4 change blocks. 
13 lines changed or deleted 109 lines changed or added


 xcb_wm.h   xcb_wm.h 
skipping to change at line 25 skipping to change at line 25
typedef struct { typedef struct {
xcb_window_t child; xcb_window_t child;
xcb_window_t parent; xcb_window_t parent;
int name_len; int name_len;
char *name; char *name;
xcb_gcontext_t titlegc; xcb_gcontext_t titlegc;
} client_window_t; } client_window_t;
typedef struct { typedef struct {
enum tag_t tag; enum xcb_atom_fast_tag_t tag;
union { union {
xcb_get_window_attributes_cookie_t cookie; xcb_get_window_attributes_cookie_t cookie;
uint8_t override_redirect; uint8_t override_redirect;
} u; } u;
} window_attributes_t; } window_attributes_t;
void manage_window(xcb_property_handlers_t *prophs, xcb_connection_t *c, xc b_window_t window, window_attributes_t wa); void manage_window(xcb_property_handlers_t *prophs, xcb_connection_t *c, xc b_window_t window, window_attributes_t wa);
int handle_map_notify_event(void *prophs, xcb_connection_t *c, xcb_map_noti fy_event_t *e); int handle_map_notify_event(void *prophs, xcb_connection_t *c, xcb_map_noti fy_event_t *e);
int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_no tify_event_t *e); int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_no tify_event_t *e);
void manage_existing_windows(xcb_connection_t *c, xcb_property_handlers_t * prophs, xcb_window_t root); void manage_existing_windows(xcb_connection_t *c, xcb_property_handlers_t * prophs, xcb_window_t root);
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/