Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:41

0001 /*
0002  * Copyright (C) 2008-2009 Julien Danjou <julien@danjou.info>
0003  *
0004  * Permission is hereby granted, free of charge, to any person
0005  * obtaining a copy of this software and associated documentation
0006  * files (the "Software"), to deal in the Software without
0007  * restriction, including without limitation the rights to use, copy,
0008  * modify, merge, publish, distribute, sublicense, and/or sell copies
0009  * of the Software, and to permit persons to whom the Software is
0010  * furnished to do so, subject to the following conditions:
0011  *
0012  * The above copyright notice and this permission notice shall be
0013  * included in all copies or substantial portions of the Software.
0014  *
0015  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0016  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0017  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0018  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
0019  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
0020  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
0021  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0022  *
0023  * Except as contained in this notice, the names of the authors or
0024  * their institutions shall not be used in advertising or otherwise to
0025  * promote the sale, use or other dealings in this Software without
0026  * prior written authorization from the authors.
0027  */
0028 
0029 /**
0030  * @defgroup xcb__event_t XCB Event Functions
0031  *
0032  * These functions ease the handling of X events received.
0033  *
0034  * @{
0035  */
0036 
0037 #ifndef __XCB_EVENT_H__
0038 #define __XCB_EVENT_H__
0039 
0040 #include <xcb/xcb.h>
0041 
0042 #ifdef __cplusplus
0043 extern "C" {
0044 #endif
0045 
0046 /**
0047  * @brief Bit mask to find event type regardless of event source.
0048  *
0049  * Each event in the X11 protocol contains an 8-bit type code.
0050  * The most-significant bit in this code is set if the event was
0051  * generated from a SendEvent request. This mask can be used to
0052  * determine the type of event regardless of how the event was
0053  * generated. See the X11R6 protocol specification for details.
0054  */
0055 #define XCB_EVENT_RESPONSE_TYPE_MASK (0x7f)
0056 #define XCB_EVENT_RESPONSE_TYPE(e)   (e->response_type &  XCB_EVENT_RESPONSE_TYPE_MASK)
0057 #define XCB_EVENT_SENT(e)            (e->response_type & ~XCB_EVENT_RESPONSE_TYPE_MASK)
0058 
0059 /**
0060  * @brief Convert an event response type to a label.
0061  * @param type The event type.
0062  * @return A string with the event name, or NULL if unknown.
0063  */
0064 const char * xcb_event_get_label(uint8_t type);
0065 
0066 /**
0067  * @brief Convert an event error type to a label.
0068  * @param type The error type.
0069  * @return A string with the event name, or NULL if unknown or if the event is
0070  * not an error.
0071  */
0072 const char * xcb_event_get_error_label(uint8_t type);
0073 
0074 /**
0075  * @brief Convert an event request type to a label.
0076  * @param type The request type.
0077  * @return A string with the event name, or NULL if unknown or if the event is
0078  * not an error.
0079  */
0080 const char * xcb_event_get_request_label(uint8_t type);
0081 
0082 #ifdef __cplusplus
0083 }
0084 #endif
0085 
0086 /**
0087  * @}
0088  */
0089 
0090 #endif /* __XCB_EVENT_H__ */