xcb_event.h | xcb_event.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (C) 2008 Julien Danjou <julien@danjou.info> | * Copyright (C) 2008-2009 Julien Danjou <julien@danjou.info> | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person | * Permission is hereby granted, free of charge, to any person | |||
* obtaining a copy of this software and associated documentation | * obtaining a copy of this software and associated documentation | |||
* files (the "Software"), to deal in the Software without | * files (the "Software"), to deal in the Software without | |||
* restriction, including without limitation the rights to use, copy, | * restriction, including without limitation the rights to use, copy, | |||
* modify, merge, publish, distribute, sublicense, and/or sell copies | * modify, merge, publish, distribute, sublicense, and/or sell copies | |||
* of the Software, and to permit persons to whom the Software is | * of the Software, and to permit persons to whom the Software is | |||
* furnished to do so, subject to the following conditions: | * furnished to do so, subject to the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 58 | skipping to change at line 58 | |||
* | * | |||
* Each event in the X11 protocol contains an 8-bit type code. | * 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 | * The most-significant bit in this code is set if the event was | |||
* generated from a SendEvent request. This mask can be used to | * generated from a SendEvent request. This mask can be used to | |||
* determine the type of event regardless of how the event was | * determine the type of event regardless of how the event was | |||
* generated. See the X11R6 protocol specification for details. | * generated. See the X11R6 protocol specification for details. | |||
*/ | */ | |||
#define XCB_EVENT_RESPONSE_TYPE_MASK (0x7f) | #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_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) | #define XCB_EVENT_SENT(e) (e->response_type & ~XCB_EVENT_RESPONS E_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_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); | |||
typedef struct xcb_event_handler xcb_event_handler_t; | typedef struct xcb_event_handler xcb_event_handler_t; | |||
struct xcb_event_handler | struct xcb_event_handler | |||
{ | { | |||
xcb_generic_event_handler_t handler; | xcb_generic_event_handler_t handler; | |||
void *data; | void *data; | |||
}; | }; | |||
skipping to change at line 171 | skipping to change at line 173 | |||
XCB_EVENT_MAKE_EVENT_HANDLER(circulate_notify, CIRCULATE_NOTIFY) | XCB_EVENT_MAKE_EVENT_HANDLER(circulate_notify, CIRCULATE_NOTIFY) | |||
XCB_EVENT_MAKE_EVENT_HANDLER(circulate_request, CIRCULATE_REQUEST) | XCB_EVENT_MAKE_EVENT_HANDLER(circulate_request, CIRCULATE_REQUEST) | |||
XCB_EVENT_MAKE_EVENT_HANDLER(property_notify, PROPERTY_NOTIFY) | XCB_EVENT_MAKE_EVENT_HANDLER(property_notify, PROPERTY_NOTIFY) | |||
XCB_EVENT_MAKE_EVENT_HANDLER(selection_clear, SELECTION_CLEAR) | XCB_EVENT_MAKE_EVENT_HANDLER(selection_clear, SELECTION_CLEAR) | |||
XCB_EVENT_MAKE_EVENT_HANDLER(selection_request, SELECTION_REQUEST) | XCB_EVENT_MAKE_EVENT_HANDLER(selection_request, SELECTION_REQUEST) | |||
XCB_EVENT_MAKE_EVENT_HANDLER(selection_notify, SELECTION_NOTIFY) | XCB_EVENT_MAKE_EVENT_HANDLER(selection_notify, SELECTION_NOTIFY) | |||
XCB_EVENT_MAKE_EVENT_HANDLER(colormap_notify, COLORMAP_NOTIFY) | XCB_EVENT_MAKE_EVENT_HANDLER(colormap_notify, COLORMAP_NOTIFY) | |||
XCB_EVENT_MAKE_EVENT_HANDLER(client_message, CLIENT_MESSAGE) | XCB_EVENT_MAKE_EVENT_HANDLER(client_message, CLIENT_MESSAGE) | |||
XCB_EVENT_MAKE_EVENT_HANDLER(mapping_notify, MAPPING_NOTIFY) | XCB_EVENT_MAKE_EVENT_HANDLER(mapping_notify, MAPPING_NOTIFY) | |||
/** Everyting is ok */ | ||||
#define XCB_EVENT_ERROR_SUCESS 0 | ||||
/** Bad request code */ | ||||
#define XCB_EVENT_ERROR_BAD_REQUEST 1 | ||||
/** Int parameter out of range */ | ||||
#define XCB_EVENT_ERROR_BAD_VALUE 2 | ||||
/** Parameter not a Window */ | ||||
#define XCB_EVENT_ERROR_BAD_WINDOW 3 | ||||
/** Parameter not a Pixmap */ | ||||
#define XCB_EVENT_ERROR_BAD_PIXMAP 4 | ||||
/** Parameter not an Atom */ | ||||
#define XCB_EVENT_ERROR_BAD_ATOM 5 | ||||
/** Parameter not a Cursor */ | ||||
#define XCB_EVENT_ERROR_BAD_CURSOR 6 | ||||
/** Parameter not a Font */ | ||||
#define XCB_EVENT_ERROR_BAD_FONT 7 | ||||
/** Parameter mismatch */ | ||||
#define XCB_EVENT_ERROR_BAD_MATCH 8 | ||||
/** Parameter not a Pixmap or Window */ | ||||
#define XCB_EVENT_ERROR_BAD_DRAWABLE 9 | ||||
/* Depending on context: | ||||
- key/button already grabbed | ||||
- attempt to free an illegal | ||||
cmap entry | ||||
- attempt to store into a read-only | ||||
color map entry. | ||||
- attempt to modify the access control | ||||
list from other than the local host. | ||||
*/ | ||||
#define XCB_EVENT_ERROR_BAD_ACCESS 10 | ||||
/** Insufficient resources */ | ||||
#define XCB_EVENT_ERROR_BAD_ALLOC 11 | ||||
/** No such colormap */ | ||||
#define XCB_EVENT_ERROR_BAD_COLOR 12 | ||||
/** Parameter not a GC */ | ||||
#define XCB_EVENT_ERROR_BAD_GC 13 | ||||
/** Choice not in range or already used */ | ||||
#define XCB_EVENT_ERROR_BAD_ID_CHOICE 14 | ||||
/** Font or color name doesn't exist */ | ||||
#define XCB_EVENT_ERROR_BAD_NAME 15 | ||||
/** Request length incorrect */ | ||||
#define XCB_EVENT_ERROR_BAD_LENGTH 16 | ||||
/** Server is defective */ | ||||
#define XCB_EVENT_ERROR_BAD_IMPLEMENTATION 17 | ||||
/** | ||||
* @brief Convert an event reponse type to a label. | ||||
* @param type The event type. | ||||
* @return A string with the event name, or NULL if unknown. | ||||
*/ | ||||
const char * xcb_event_get_label(uint8_t type); | ||||
/** | ||||
* @brief Convert an event error type to a label. | ||||
* @param type The erro type. | ||||
* @return A string with the event name, or NULL if unknown or if the event | ||||
is | ||||
* not an error. | ||||
*/ | ||||
const char * xcb_event_get_error_label(uint8_t type); | ||||
/** | ||||
* @brief Convert an event request type to a label. | ||||
* @param type The request type. | ||||
* @return A string with the event name, or NULL if unknown or if the event | ||||
is | ||||
* not an error. | ||||
*/ | ||||
const char * xcb_event_get_request_label(uint8_t type); | ||||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
/** | /** | |||
* @} | * @} | |||
*/ | */ | |||
#endif /* __XCB_EVENT_H__ */ | #endif /* __XCB_EVENT_H__ */ | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 73 lines changed or added | |||
xcb_icccm.h | xcb_icccm.h | |||
---|---|---|---|---|
skipping to change at line 331 | skipping to change at line 331 | |||
xcb_get_property_cookie_t xcb_get_wm_class(xcb_connection_t *c, | xcb_get_property_cookie_t xcb_get_wm_class(xcb_connection_t *c, | |||
xcb_window_t window); | xcb_window_t window); | |||
/** | /** | |||
* @see xcb_get_wm_class() | * @see xcb_get_wm_class() | |||
*/ | */ | |||
xcb_get_property_cookie_t xcb_get_wm_class_unchecked(xcb_connection_t *c, | xcb_get_property_cookie_t xcb_get_wm_class_unchecked(xcb_connection_t *c, | |||
xcb_window_t window); | xcb_window_t window); | |||
/** | /** | |||
* @brief Fill give structure with the WM_CLASS property of a window. | ||||
* @param prop The property structur to fill. | ||||
* @param reply The property request reply. | ||||
* @return Return 1 on success, 0 otherwise. | ||||
*/ | ||||
uint8_t | ||||
xcb_get_wm_class_from_reply(xcb_get_wm_class_reply_t *prop, | ||||
xcb_get_property_reply_t *reply); | ||||
/** | ||||
* @brief Fill given structure with the WM_CLASS property of a window. | * @brief Fill given structure with the WM_CLASS property of a window. | |||
* @param c The connection to the X server. | * @param c The connection to the X server. | |||
* @param cookie Request cookie. | * @param cookie Request cookie. | |||
* @param prop WM_CLASS property value. | * @param prop WM_CLASS property value. | |||
* @param e Error if any. | * @param e Error if any. | |||
* @return Return 1 on success, 0 otherwise. | * @return Return 1 on success, 0 otherwise. | |||
* | * | |||
* The parameter e supplied to this function must be NULL if | * The parameter e supplied to this function must be NULL if | |||
* xcb_get_wm_class_unchecked() is used. Otherwise, it stores the | * xcb_get_wm_class_unchecked() is used. Otherwise, it stores the | |||
* error if any. prop structure members should be freed by | * error if any. prop structure members should be freed by | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 10 lines changed or added | |||
xcb_keysyms.h | xcb_keysyms.h | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
typedef struct _XCBKeySymbols xcb_key_symbols_t; | typedef struct _XCBKeySymbols xcb_key_symbols_t; | |||
xcb_key_symbols_t *xcb_key_symbols_alloc (xcb_connection_t * c); | xcb_key_symbols_t *xcb_key_symbols_alloc (xcb_connection_t * c); | |||
void xcb_key_symbols_free (xcb_key_symbols_t *sym s); | void xcb_key_symbols_free (xcb_key_symbols_t *sym s); | |||
xcb_keysym_t xcb_key_symbols_get_keysym (xcb_key_symbols_t *syms, | xcb_keysym_t xcb_key_symbols_get_keysym (xcb_key_symbols_t *syms, | |||
xcb_keycode_t keycode, | xcb_keycode_t keycode, | |||
int col); | int col); | |||
xcb_keycode_t xcb_key_symbols_get_keycode (xcb_key_symbols_t | /** | |||
*syms, | * @brief Get the keycodes attached to a keysyms. | |||
xcb_keysym_t keysym); | * There can be several value, so what is returned is an array of keycode | |||
* terminated by XCB_NO_SYMBOL. You are responsible to free it. | ||||
* Be aware that this function can be slow. It will convert all | ||||
* combinations of all available keycodes to keysyms to find the ones that | ||||
* match. | ||||
* @param syms Key symbols. | ||||
* @param keysym The keysym to look for. | ||||
* @return A XCB_NO_SYMBOL terminated array of keycode, or NULL if nothing | ||||
is found. | ||||
*/ | ||||
xcb_keycode_t * xcb_key_symbols_get_keycode(xcb_key_symbols_t *syms, | ||||
xcb_keysym_t keysym); | ||||
xcb_keysym_t xcb_key_press_lookup_keysym (xcb_key_symbols_t *syms, | xcb_keysym_t xcb_key_press_lookup_keysym (xcb_key_symbols_t *syms, | |||
xcb_key_press_event_t *event, | xcb_key_press_event_t *event, | |||
int col); | int col); | |||
xcb_keysym_t xcb_key_release_lookup_keysym (xcb_key_symbols_t *syms, | xcb_keysym_t xcb_key_release_lookup_keysym (xcb_key_symbols_t *syms, | |||
xcb_key_release_event_t *event, | xcb_key_release_event_t *event, | |||
int col); | int col); | |||
int xcb_refresh_keyboard_mapping (xcb_key_symbols_t *sym s, | int xcb_refresh_keyboard_mapping (xcb_key_symbols_t *sym s, | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 14 lines changed or added | |||