3rdparty: remove xcb libs and bump minimal required version to 1.11
With libxcb 1.11 as minimal required version we can: (a) (Maybe) Enable threaded GL for MESA, see QTBUG-67277. (b) Avoid performance issues described in QTBUG-46017. Bundled xcb libs don't contain the more modern SHM fd passing APIs. The official binaries use "-qt-xcb", therefore we were shipping with the performance fix #ifdef-ed out. (c) Make xcb-xkb a mandatory dependency avoiding issues described in QTBUG-30911. Issues that appear when Qt was configure with "-no-xkb -xcb-xlib", but X server has the XKB extension. (d) Drop all, but xcb-xinput sources from src/3rdparty/xcb/, for which we need "xcb-xinput >= 1.12". This way we can reduce maintenance work. The xcb libraries were origianlly bundled because of lack of availability on supported distributions. This is not the case anymore: CI for Qt 5.13 has: Ubuntu 18.04 - libxcb 1.13 RHEL 7.4 - libxcb 1.13 openSUSE 15.0 - libxcb 1.13 CI for Qt 5.12 has: Ubuntu 16.04 - libxcb 1.11 RHEL 7.4 - libxcb 1.13 openSUSE 42.3 - libxcb 1.11 RHEL 6.x - not relevant because it was dropped from supported platforms. Why 1.11 (released on Aug, 2014), but not 1.13 (released on March 2018)? Based on what we have in CI for 5.13 and 5.14 we could update to 1.13, but it means that Qt would require a very recent version of 3rd party dependency. [ChangeLog][Configure][X11] The minimal required version of libxcb now is 1.11. [ChangeLog][Third-Party Code][X11] Removed all bundled XCB libs, with the exception of xcb-xinput, which is not available on systems with libxcb 1.11. [ChangeLog][Configure][X11] Removed -qt-xcb, -system-xcb, -xkb, -xcb-xinput switches. [ChangeLog][Platform Specific Changes][X11] XKB and XInput2 now are mandatory dependencies for XCB plugin. XCB-XKB is a part of libxcb 1.11 releases. XCB-XInput is not part of libxcb 1.11 releases, but Qt builders can use -bundled-xcb-xinput switch. Fixes: QTBUG-73862 Fixes: QTBUG-73888 Task-number: QTBUG-67277 Task-number: QTBUG-30939 Change-Id: I4c2bd2a0e667220d32fd1fbfa1419c844f17fcce Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
5bb178c479
commit
60588e1a5d
@ -297,8 +297,7 @@ Gui, printing, widget options:
|
||||
-gbm ............... Enable backends for GBM [auto] (Linux only)
|
||||
-kms ............... Enable backends for KMS [auto] (Linux only)
|
||||
-linuxfb ........... Enable Linux Framebuffer support [auto] (Linux only)
|
||||
-xcb ............... Enable X11 support. Select used xcb-* libraries [system/qt/no]
|
||||
(-qt-xcb still uses system version of libxcb itself)
|
||||
-xcb ............... Enable X11 support [auto] (Linux only)
|
||||
|
||||
Input backends:
|
||||
-libudev............ Enable udev support [auto]
|
||||
@ -307,7 +306,7 @@ Gui, printing, widget options:
|
||||
-libinput .......... Enable libinput support [auto]
|
||||
-mtdev ............. Enable mtdev support [auto]
|
||||
-tslib ............. Enable tslib support [auto]
|
||||
-xcb-xinput ........ Enable XInput2 support [auto]
|
||||
-bundled-xcb-xinput Use bundled XInput2 support [auto]
|
||||
-xkbcommon ......... Enable key mapping support [auto]
|
||||
|
||||
Image formats:
|
||||
|
35
src/3rdparty/xcb/README
vendored
35
src/3rdparty/xcb/README
vendored
@ -1,19 +1,22 @@
|
||||
Contains the header and sources files from selected xcb libraries:
|
||||
*****************************************************************
|
||||
From 62f053c19b917a369c4aad5b71ab150911b589aa:
|
||||
|
||||
libxcb-1.9.1 together with xcb-proto-1.8 (randr, render, shape, shm, sync,
|
||||
xfixes, xinerama sources)
|
||||
# libxkbcommon-x11 requires libxcb-xkb >= 1.10
|
||||
libxcb-1.10 together with xcb-proto-1.10 (xkb sources)
|
||||
libxcb-1.13 together with xcb-proto-1.13 (xinput sources with removed
|
||||
Pointer Barriers API and SendExtensionEvent API)
|
||||
libxcb-util-image-0.3.9
|
||||
libxcb-util-keysyms-0.3.9
|
||||
libxcb-util-renderutil-0.3.9
|
||||
libxcb-util-wm-0.3.9
|
||||
xcb-xinput code was produced by build of libxcb 1.13 with xcb-proto 1.13.
|
||||
|
||||
The 'include' directory was obtained by compiling and installing all of the modules.
|
||||
When upgrading the bundled xcb headers, they must be tested to run also with the
|
||||
minimal supported libxcb version, which currently is 1.9.1.
|
||||
The following parts were removed from it:
|
||||
- Pointer Barriers API (requires xcb-xfixes 1.9 with xcb-proto 1.9)
|
||||
- SendExtensionEvent API (requires definition of xcb_raw_generic_event_t
|
||||
from libxcb 1.13)
|
||||
|
||||
*****************************************************************
|
||||
|
||||
As of time of writing the minimal required libxcb version is 1.11, hence
|
||||
we could restore the Pointer Barriers API, but we don't use it, so it is
|
||||
not worth the hustle. When we will bump the minimal required version of libxcb
|
||||
to 1.13, then we can drop the bundled xcb-xinput altogether.
|
||||
|
||||
The xcb-xinput files where modified to use system includes, see:
|
||||
|
||||
src/3rdparty/xcb/include/xcb/fixup-xinput-h.patch
|
||||
src/3rdparty/xcb/libxcb/fixup-xinput-c.patch
|
||||
|
||||
Use the -qt-xcb configure option to use the files instead of system xcb libraries.
|
||||
See src/plugins/platforms/xcb/README for details.
|
||||
|
15
src/3rdparty/xcb/include/xcb/fixup-xinput-h.patch
vendored
Normal file
15
src/3rdparty/xcb/include/xcb/fixup-xinput-h.patch
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
diff --git a/src/3rdparty/xcb/include/xcb/xinput.h b/src/3rdparty/xcb/include/xcb/xinput.h
|
||||
index 9420047c71..729c0b5169 100644
|
||||
--- a/src/3rdparty/xcb/include/xcb/xinput.h
|
||||
+++ b/src/3rdparty/xcb/include/xcb/xinput.h
|
||||
@@ -12,8 +12,8 @@
|
||||
#ifndef __XINPUT_H
|
||||
#define __XINPUT_H
|
||||
|
||||
-#include "xcb.h"
|
||||
-#include "xfixes.h"
|
||||
+#include <xcb/xcb.h>
|
||||
+#include <xcb/xfixes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
5075
src/3rdparty/xcb/include/xcb/randr.h
vendored
5075
src/3rdparty/xcb/include/xcb/randr.h
vendored
File diff suppressed because it is too large
Load Diff
4513
src/3rdparty/xcb/include/xcb/render.h
vendored
4513
src/3rdparty/xcb/include/xcb/render.h
vendored
File diff suppressed because it is too large
Load Diff
1103
src/3rdparty/xcb/include/xcb/shape.h
vendored
1103
src/3rdparty/xcb/include/xcb/shape.h
vendored
File diff suppressed because it is too large
Load Diff
738
src/3rdparty/xcb/include/xcb/shm.h
vendored
738
src/3rdparty/xcb/include/xcb/shm.h
vendored
@ -1,738 +0,0 @@
|
||||
/*
|
||||
* This file generated automatically from shm.xml by c_client.py.
|
||||
* Edit at your peril.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup XCB_Shm_API XCB Shm API
|
||||
* @brief Shm XCB Protocol Implementation.
|
||||
* @{
|
||||
**/
|
||||
|
||||
#ifndef __SHM_H
|
||||
#define __SHM_H
|
||||
|
||||
#include "xcb.h"
|
||||
#include "xproto.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define XCB_SHM_MAJOR_VERSION 1
|
||||
#define XCB_SHM_MINOR_VERSION 1
|
||||
|
||||
extern xcb_extension_t xcb_shm_id;
|
||||
|
||||
typedef uint32_t xcb_shm_seg_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_shm_seg_iterator_t
|
||||
**/
|
||||
typedef struct xcb_shm_seg_iterator_t {
|
||||
xcb_shm_seg_t *data; /**< */
|
||||
int rem; /**< */
|
||||
int index; /**< */
|
||||
} xcb_shm_seg_iterator_t;
|
||||
|
||||
/** Opcode for xcb_shm_completion. */
|
||||
#define XCB_SHM_COMPLETION 0
|
||||
|
||||
/**
|
||||
* @brief xcb_shm_completion_event_t
|
||||
**/
|
||||
typedef struct xcb_shm_completion_event_t {
|
||||
uint8_t response_type; /**< */
|
||||
uint8_t pad0; /**< */
|
||||
uint16_t sequence; /**< */
|
||||
xcb_drawable_t drawable; /**< */
|
||||
uint16_t minor_event; /**< */
|
||||
uint8_t major_event; /**< */
|
||||
uint8_t pad1; /**< */
|
||||
xcb_shm_seg_t shmseg; /**< */
|
||||
uint32_t offset; /**< */
|
||||
} xcb_shm_completion_event_t;
|
||||
|
||||
/** Opcode for xcb_shm_bad_seg. */
|
||||
#define XCB_SHM_BAD_SEG 0
|
||||
|
||||
typedef xcb_value_error_t xcb_shm_bad_seg_error_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_shm_query_version_cookie_t
|
||||
**/
|
||||
typedef struct xcb_shm_query_version_cookie_t {
|
||||
unsigned int sequence; /**< */
|
||||
} xcb_shm_query_version_cookie_t;
|
||||
|
||||
/** Opcode for xcb_shm_query_version. */
|
||||
#define XCB_SHM_QUERY_VERSION 0
|
||||
|
||||
/**
|
||||
* @brief xcb_shm_query_version_request_t
|
||||
**/
|
||||
typedef struct xcb_shm_query_version_request_t {
|
||||
uint8_t major_opcode; /**< */
|
||||
uint8_t minor_opcode; /**< */
|
||||
uint16_t length; /**< */
|
||||
} xcb_shm_query_version_request_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_shm_query_version_reply_t
|
||||
**/
|
||||
typedef struct xcb_shm_query_version_reply_t {
|
||||
uint8_t response_type; /**< */
|
||||
uint8_t shared_pixmaps; /**< */
|
||||
uint16_t sequence; /**< */
|
||||
uint32_t length; /**< */
|
||||
uint16_t major_version; /**< */
|
||||
uint16_t minor_version; /**< */
|
||||
uint16_t uid; /**< */
|
||||
uint16_t gid; /**< */
|
||||
uint8_t pixmap_format; /**< */
|
||||
uint8_t pad0[15]; /**< */
|
||||
} xcb_shm_query_version_reply_t;
|
||||
|
||||
/** Opcode for xcb_shm_attach. */
|
||||
#define XCB_SHM_ATTACH 1
|
||||
|
||||
/**
|
||||
* @brief xcb_shm_attach_request_t
|
||||
**/
|
||||
typedef struct xcb_shm_attach_request_t {
|
||||
uint8_t major_opcode; /**< */
|
||||
uint8_t minor_opcode; /**< */
|
||||
uint16_t length; /**< */
|
||||
xcb_shm_seg_t shmseg; /**< */
|
||||
uint32_t shmid; /**< */
|
||||
uint8_t read_only; /**< */
|
||||
uint8_t pad0[3]; /**< */
|
||||
} xcb_shm_attach_request_t;
|
||||
|
||||
/** Opcode for xcb_shm_detach. */
|
||||
#define XCB_SHM_DETACH 2
|
||||
|
||||
/**
|
||||
* @brief xcb_shm_detach_request_t
|
||||
**/
|
||||
typedef struct xcb_shm_detach_request_t {
|
||||
uint8_t major_opcode; /**< */
|
||||
uint8_t minor_opcode; /**< */
|
||||
uint16_t length; /**< */
|
||||
xcb_shm_seg_t shmseg; /**< */
|
||||
} xcb_shm_detach_request_t;
|
||||
|
||||
/** Opcode for xcb_shm_put_image. */
|
||||
#define XCB_SHM_PUT_IMAGE 3
|
||||
|
||||
/**
|
||||
* @brief xcb_shm_put_image_request_t
|
||||
**/
|
||||
typedef struct xcb_shm_put_image_request_t {
|
||||
uint8_t major_opcode; /**< */
|
||||
uint8_t minor_opcode; /**< */
|
||||
uint16_t length; /**< */
|
||||
xcb_drawable_t drawable; /**< */
|
||||
xcb_gcontext_t gc; /**< */
|
||||
uint16_t total_width; /**< */
|
||||
uint16_t total_height; /**< */
|
||||
uint16_t src_x; /**< */
|
||||
uint16_t src_y; /**< */
|
||||
uint16_t src_width; /**< */
|
||||
uint16_t src_height; /**< */
|
||||
int16_t dst_x; /**< */
|
||||
int16_t dst_y; /**< */
|
||||
uint8_t depth; /**< */
|
||||
uint8_t format; /**< */
|
||||
uint8_t send_event; /**< */
|
||||
uint8_t pad0; /**< */
|
||||
xcb_shm_seg_t shmseg; /**< */
|
||||
uint32_t offset; /**< */
|
||||
} xcb_shm_put_image_request_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_shm_get_image_cookie_t
|
||||
**/
|
||||
typedef struct xcb_shm_get_image_cookie_t {
|
||||
unsigned int sequence; /**< */
|
||||
} xcb_shm_get_image_cookie_t;
|
||||
|
||||
/** Opcode for xcb_shm_get_image. */
|
||||
#define XCB_SHM_GET_IMAGE 4
|
||||
|
||||
/**
|
||||
* @brief xcb_shm_get_image_request_t
|
||||
**/
|
||||
typedef struct xcb_shm_get_image_request_t {
|
||||
uint8_t major_opcode; /**< */
|
||||
uint8_t minor_opcode; /**< */
|
||||
uint16_t length; /**< */
|
||||
xcb_drawable_t drawable; /**< */
|
||||
int16_t x; /**< */
|
||||
int16_t y; /**< */
|
||||
uint16_t width; /**< */
|
||||
uint16_t height; /**< */
|
||||
uint32_t plane_mask; /**< */
|
||||
uint8_t format; /**< */
|
||||
uint8_t pad0[3]; /**< */
|
||||
xcb_shm_seg_t shmseg; /**< */
|
||||
uint32_t offset; /**< */
|
||||
} xcb_shm_get_image_request_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_shm_get_image_reply_t
|
||||
**/
|
||||
typedef struct xcb_shm_get_image_reply_t {
|
||||
uint8_t response_type; /**< */
|
||||
uint8_t depth; /**< */
|
||||
uint16_t sequence; /**< */
|
||||
uint32_t length; /**< */
|
||||
xcb_visualid_t visual; /**< */
|
||||
uint32_t size; /**< */
|
||||
} xcb_shm_get_image_reply_t;
|
||||
|
||||
/** Opcode for xcb_shm_create_pixmap. */
|
||||
#define XCB_SHM_CREATE_PIXMAP 5
|
||||
|
||||
/**
|
||||
* @brief xcb_shm_create_pixmap_request_t
|
||||
**/
|
||||
typedef struct xcb_shm_create_pixmap_request_t {
|
||||
uint8_t major_opcode; /**< */
|
||||
uint8_t minor_opcode; /**< */
|
||||
uint16_t length; /**< */
|
||||
xcb_pixmap_t pid; /**< */
|
||||
xcb_drawable_t drawable; /**< */
|
||||
uint16_t width; /**< */
|
||||
uint16_t height; /**< */
|
||||
uint8_t depth; /**< */
|
||||
uint8_t pad0[3]; /**< */
|
||||
xcb_shm_seg_t shmseg; /**< */
|
||||
uint32_t offset; /**< */
|
||||
} xcb_shm_create_pixmap_request_t;
|
||||
|
||||
/**
|
||||
* Get the next element of the iterator
|
||||
* @param i Pointer to a xcb_shm_seg_iterator_t
|
||||
*
|
||||
* Get the next element in the iterator. The member rem is
|
||||
* decreased by one. The member data points to the next
|
||||
* element. The member index is increased by sizeof(xcb_shm_seg_t)
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** void xcb_shm_seg_next
|
||||
**
|
||||
** @param xcb_shm_seg_iterator_t *i
|
||||
** @returns void
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
xcb_shm_seg_next (xcb_shm_seg_iterator_t *i /**< */);
|
||||
|
||||
/**
|
||||
* Return the iterator pointing to the last element
|
||||
* @param i An xcb_shm_seg_iterator_t
|
||||
* @return The iterator pointing to the last element
|
||||
*
|
||||
* Set the current element in the iterator to the last element.
|
||||
* The member rem is set to 0. The member data points to the
|
||||
* last element.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_generic_iterator_t xcb_shm_seg_end
|
||||
**
|
||||
** @param xcb_shm_seg_iterator_t i
|
||||
** @returns xcb_generic_iterator_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_generic_iterator_t
|
||||
xcb_shm_seg_end (xcb_shm_seg_iterator_t i /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_shm_query_version_cookie_t xcb_shm_query_version
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @returns xcb_shm_query_version_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_shm_query_version_cookie_t
|
||||
xcb_shm_query_version (xcb_connection_t *c /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
* This form can be used only if the request will cause
|
||||
* a reply to be generated. Any returned error will be
|
||||
* placed in the event queue.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_shm_query_version_cookie_t xcb_shm_query_version_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @returns xcb_shm_query_version_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_shm_query_version_cookie_t
|
||||
xcb_shm_query_version_unchecked (xcb_connection_t *c /**< */);
|
||||
|
||||
/**
|
||||
* Return the reply
|
||||
* @param c The connection
|
||||
* @param cookie The cookie
|
||||
* @param e The xcb_generic_error_t supplied
|
||||
*
|
||||
* Returns the reply of the request asked by
|
||||
*
|
||||
* The parameter @p e supplied to this function must be NULL if
|
||||
* xcb_shm_query_version_unchecked(). is used.
|
||||
* Otherwise, it stores the error if any.
|
||||
*
|
||||
* The returned value must be freed by the caller using free().
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_shm_query_version_reply_t * xcb_shm_query_version_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_shm_query_version_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_shm_query_version_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_shm_query_version_reply_t *
|
||||
xcb_shm_query_version_reply (xcb_connection_t *c /**< */,
|
||||
xcb_shm_query_version_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
* This form can be used only if the request will not cause
|
||||
* a reply to be generated. Any returned error will be
|
||||
* saved for handling by xcb_request_check().
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_attach_checked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t shmid
|
||||
** @param uint8_t read_only
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_attach_checked (xcb_connection_t *c /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t shmid /**< */,
|
||||
uint8_t read_only /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_attach
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t shmid
|
||||
** @param uint8_t read_only
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_attach (xcb_connection_t *c /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t shmid /**< */,
|
||||
uint8_t read_only /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
* This form can be used only if the request will not cause
|
||||
* a reply to be generated. Any returned error will be
|
||||
* saved for handling by xcb_request_check().
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_detach_checked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_detach_checked (xcb_connection_t *c /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_detach
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_detach (xcb_connection_t *c /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
* This form can be used only if the request will not cause
|
||||
* a reply to be generated. Any returned error will be
|
||||
* saved for handling by xcb_request_check().
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_put_image_checked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_drawable_t drawable
|
||||
** @param xcb_gcontext_t gc
|
||||
** @param uint16_t total_width
|
||||
** @param uint16_t total_height
|
||||
** @param uint16_t src_x
|
||||
** @param uint16_t src_y
|
||||
** @param uint16_t src_width
|
||||
** @param uint16_t src_height
|
||||
** @param int16_t dst_x
|
||||
** @param int16_t dst_y
|
||||
** @param uint8_t depth
|
||||
** @param uint8_t format
|
||||
** @param uint8_t send_event
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t offset
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_put_image_checked (xcb_connection_t *c /**< */,
|
||||
xcb_drawable_t drawable /**< */,
|
||||
xcb_gcontext_t gc /**< */,
|
||||
uint16_t total_width /**< */,
|
||||
uint16_t total_height /**< */,
|
||||
uint16_t src_x /**< */,
|
||||
uint16_t src_y /**< */,
|
||||
uint16_t src_width /**< */,
|
||||
uint16_t src_height /**< */,
|
||||
int16_t dst_x /**< */,
|
||||
int16_t dst_y /**< */,
|
||||
uint8_t depth /**< */,
|
||||
uint8_t format /**< */,
|
||||
uint8_t send_event /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t offset /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_put_image
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_drawable_t drawable
|
||||
** @param xcb_gcontext_t gc
|
||||
** @param uint16_t total_width
|
||||
** @param uint16_t total_height
|
||||
** @param uint16_t src_x
|
||||
** @param uint16_t src_y
|
||||
** @param uint16_t src_width
|
||||
** @param uint16_t src_height
|
||||
** @param int16_t dst_x
|
||||
** @param int16_t dst_y
|
||||
** @param uint8_t depth
|
||||
** @param uint8_t format
|
||||
** @param uint8_t send_event
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t offset
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_put_image (xcb_connection_t *c /**< */,
|
||||
xcb_drawable_t drawable /**< */,
|
||||
xcb_gcontext_t gc /**< */,
|
||||
uint16_t total_width /**< */,
|
||||
uint16_t total_height /**< */,
|
||||
uint16_t src_x /**< */,
|
||||
uint16_t src_y /**< */,
|
||||
uint16_t src_width /**< */,
|
||||
uint16_t src_height /**< */,
|
||||
int16_t dst_x /**< */,
|
||||
int16_t dst_y /**< */,
|
||||
uint8_t depth /**< */,
|
||||
uint8_t format /**< */,
|
||||
uint8_t send_event /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t offset /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_shm_get_image_cookie_t xcb_shm_get_image
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_drawable_t drawable
|
||||
** @param int16_t x
|
||||
** @param int16_t y
|
||||
** @param uint16_t width
|
||||
** @param uint16_t height
|
||||
** @param uint32_t plane_mask
|
||||
** @param uint8_t format
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t offset
|
||||
** @returns xcb_shm_get_image_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_shm_get_image_cookie_t
|
||||
xcb_shm_get_image (xcb_connection_t *c /**< */,
|
||||
xcb_drawable_t drawable /**< */,
|
||||
int16_t x /**< */,
|
||||
int16_t y /**< */,
|
||||
uint16_t width /**< */,
|
||||
uint16_t height /**< */,
|
||||
uint32_t plane_mask /**< */,
|
||||
uint8_t format /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t offset /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
* This form can be used only if the request will cause
|
||||
* a reply to be generated. Any returned error will be
|
||||
* placed in the event queue.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_shm_get_image_cookie_t xcb_shm_get_image_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_drawable_t drawable
|
||||
** @param int16_t x
|
||||
** @param int16_t y
|
||||
** @param uint16_t width
|
||||
** @param uint16_t height
|
||||
** @param uint32_t plane_mask
|
||||
** @param uint8_t format
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t offset
|
||||
** @returns xcb_shm_get_image_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_shm_get_image_cookie_t
|
||||
xcb_shm_get_image_unchecked (xcb_connection_t *c /**< */,
|
||||
xcb_drawable_t drawable /**< */,
|
||||
int16_t x /**< */,
|
||||
int16_t y /**< */,
|
||||
uint16_t width /**< */,
|
||||
uint16_t height /**< */,
|
||||
uint32_t plane_mask /**< */,
|
||||
uint8_t format /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t offset /**< */);
|
||||
|
||||
/**
|
||||
* Return the reply
|
||||
* @param c The connection
|
||||
* @param cookie The cookie
|
||||
* @param e The xcb_generic_error_t supplied
|
||||
*
|
||||
* Returns the reply of the request asked by
|
||||
*
|
||||
* The parameter @p e supplied to this function must be NULL if
|
||||
* xcb_shm_get_image_unchecked(). is used.
|
||||
* Otherwise, it stores the error if any.
|
||||
*
|
||||
* The returned value must be freed by the caller using free().
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_shm_get_image_reply_t * xcb_shm_get_image_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_shm_get_image_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_shm_get_image_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_shm_get_image_reply_t *
|
||||
xcb_shm_get_image_reply (xcb_connection_t *c /**< */,
|
||||
xcb_shm_get_image_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
* This form can be used only if the request will not cause
|
||||
* a reply to be generated. Any returned error will be
|
||||
* saved for handling by xcb_request_check().
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_create_pixmap_checked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_pixmap_t pid
|
||||
** @param xcb_drawable_t drawable
|
||||
** @param uint16_t width
|
||||
** @param uint16_t height
|
||||
** @param uint8_t depth
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t offset
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_create_pixmap_checked (xcb_connection_t *c /**< */,
|
||||
xcb_pixmap_t pid /**< */,
|
||||
xcb_drawable_t drawable /**< */,
|
||||
uint16_t width /**< */,
|
||||
uint16_t height /**< */,
|
||||
uint8_t depth /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t offset /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_create_pixmap
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_pixmap_t pid
|
||||
** @param xcb_drawable_t drawable
|
||||
** @param uint16_t width
|
||||
** @param uint16_t height
|
||||
** @param uint8_t depth
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t offset
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_create_pixmap (xcb_connection_t *c /**< */,
|
||||
xcb_pixmap_t pid /**< */,
|
||||
xcb_drawable_t drawable /**< */,
|
||||
uint16_t width /**< */,
|
||||
uint16_t height /**< */,
|
||||
uint8_t depth /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t offset /**< */);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
2216
src/3rdparty/xcb/include/xcb/sync.h
vendored
2216
src/3rdparty/xcb/include/xcb/sync.h
vendored
File diff suppressed because it is too large
Load Diff
18
src/3rdparty/xcb/include/xcb/xcb_atom.h
vendored
18
src/3rdparty/xcb/include/xcb/xcb_atom.h
vendored
@ -1,18 +0,0 @@
|
||||
#ifndef __XCB_ATOM_H__
|
||||
#define __XCB_ATOM_H__
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
char *xcb_atom_name_by_screen(const char *base, uint8_t screen);
|
||||
char *xcb_atom_name_by_resource(const char *base, uint32_t resource);
|
||||
char *xcb_atom_name_unique(const char *base, uint32_t id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __XCB_ATOM_H__ */
|
214
src/3rdparty/xcb/include/xcb/xcb_aux.h
vendored
214
src/3rdparty/xcb/include/xcb/xcb_aux.h
vendored
@ -1,214 +0,0 @@
|
||||
#ifndef __XCB_AUX_H__
|
||||
#define __XCB_AUX_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
uint8_t xcb_aux_get_depth (xcb_connection_t *c,
|
||||
xcb_screen_t *screen);
|
||||
|
||||
uint8_t xcb_aux_get_depth_of_visual (xcb_screen_t *screen,
|
||||
xcb_visualid_t id);
|
||||
|
||||
xcb_screen_t *xcb_aux_get_screen (xcb_connection_t *c,
|
||||
int screen);
|
||||
|
||||
xcb_visualtype_t *xcb_aux_get_visualtype (xcb_connection_t *c,
|
||||
int screen,
|
||||
xcb_visualid_t vid);
|
||||
|
||||
xcb_visualtype_t *
|
||||
xcb_aux_find_visual_by_id (xcb_screen_t *screen,
|
||||
xcb_visualid_t id);
|
||||
|
||||
xcb_visualtype_t *
|
||||
xcb_aux_find_visual_by_attrs (xcb_screen_t *screen,
|
||||
int8_t class_,
|
||||
int8_t depth);
|
||||
|
||||
void xcb_aux_sync (xcb_connection_t *c);
|
||||
|
||||
/* internal helper macro for XCB_AUX_ADD_PARAM
|
||||
It gives the offset of the field 'param' in the structure pointed to by
|
||||
'paramsp' in multiples of an uint32_t's size. */
|
||||
#define XCB_AUX_INTERNAL_OFFSETOF(paramsp, param) \
|
||||
((uint32_t const*)(&((paramsp)->param))-(uint32_t const*)(paramsp))
|
||||
|
||||
/* add an optional parameter to an xcb_params_* structure
|
||||
parameters:
|
||||
maskp: pointer to bitmask whos bits mark used parameters
|
||||
paramsp: pointer to structure with parameters
|
||||
param: parameter to set
|
||||
value: value to set the parameter to
|
||||
*/
|
||||
#define XCB_AUX_ADD_PARAM(maskp, paramsp, param, value) \
|
||||
((*(maskp)|=1<<XCB_AUX_INTERNAL_OFFSETOF((paramsp),param)), \
|
||||
((paramsp)->param=(value)))
|
||||
|
||||
typedef struct {
|
||||
uint32_t back_pixmap;
|
||||
uint32_t back_pixel;
|
||||
uint32_t border_pixmap;
|
||||
uint32_t border_pixel;
|
||||
uint32_t bit_gravity;
|
||||
uint32_t win_gravity;
|
||||
uint32_t backing_store;
|
||||
uint32_t backing_planes;
|
||||
uint32_t backing_pixel;
|
||||
uint32_t override_redirect;
|
||||
uint32_t save_under;
|
||||
uint32_t event_mask;
|
||||
uint32_t dont_propagate;
|
||||
uint32_t colormap;
|
||||
uint32_t cursor;
|
||||
} xcb_params_cw_t;
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_create_window (xcb_connection_t *c,
|
||||
uint8_t depth,
|
||||
xcb_window_t wid,
|
||||
xcb_window_t parent,
|
||||
int16_t x,
|
||||
int16_t y,
|
||||
uint16_t width,
|
||||
uint16_t height,
|
||||
uint16_t border_width,
|
||||
uint16_t class_,
|
||||
xcb_visualid_t visual,
|
||||
uint32_t mask,
|
||||
const xcb_params_cw_t *params);
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_create_window_checked (xcb_connection_t *c,
|
||||
uint8_t depth,
|
||||
xcb_window_t wid,
|
||||
xcb_window_t parent,
|
||||
int16_t x,
|
||||
int16_t y,
|
||||
uint16_t width,
|
||||
uint16_t height,
|
||||
uint16_t border_width,
|
||||
uint16_t class_,
|
||||
xcb_visualid_t visual,
|
||||
uint32_t mask,
|
||||
const xcb_params_cw_t *params);
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_change_window_attributes (xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
uint32_t mask,
|
||||
const xcb_params_cw_t *params);
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_change_window_attributes_checked (xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
uint32_t mask,
|
||||
const xcb_params_cw_t *params);
|
||||
|
||||
typedef struct {
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t border_width;
|
||||
uint32_t sibling;
|
||||
uint32_t stack_mode;
|
||||
} xcb_params_configure_window_t;
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_configure_window (xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
uint16_t mask,
|
||||
const xcb_params_configure_window_t *params);
|
||||
|
||||
typedef struct {
|
||||
uint32_t function;
|
||||
uint32_t plane_mask;
|
||||
uint32_t foreground;
|
||||
uint32_t background;
|
||||
uint32_t line_width;
|
||||
uint32_t line_style;
|
||||
uint32_t cap_style;
|
||||
uint32_t join_style;
|
||||
uint32_t fill_style;
|
||||
uint32_t fill_rule;
|
||||
uint32_t tile;
|
||||
uint32_t stipple;
|
||||
uint32_t tile_stipple_origin_x;
|
||||
uint32_t tile_stipple_origin_y;
|
||||
uint32_t font;
|
||||
uint32_t subwindow_mode;
|
||||
uint32_t graphics_exposures;
|
||||
uint32_t clip_originX;
|
||||
uint32_t clip_originY;
|
||||
uint32_t mask;
|
||||
uint32_t dash_offset;
|
||||
uint32_t dash_list;
|
||||
uint32_t arc_mode;
|
||||
} xcb_params_gc_t;
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_create_gc (xcb_connection_t *c,
|
||||
xcb_gcontext_t cid,
|
||||
xcb_drawable_t drawable,
|
||||
uint32_t mask,
|
||||
const xcb_params_gc_t *params);
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_create_gc_checked (xcb_connection_t *c,
|
||||
xcb_gcontext_t gid,
|
||||
xcb_drawable_t drawable,
|
||||
uint32_t mask,
|
||||
const xcb_params_gc_t *params);
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_change_gc (xcb_connection_t *c,
|
||||
xcb_gcontext_t gc,
|
||||
uint32_t mask,
|
||||
const xcb_params_gc_t *params);
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_change_gc_checked (xcb_connection_t *c,
|
||||
xcb_gcontext_t gc,
|
||||
uint32_t mask,
|
||||
const xcb_params_gc_t *params);
|
||||
typedef struct {
|
||||
uint32_t key_click_percent;
|
||||
uint32_t bell_percent;
|
||||
uint32_t bell_pitch;
|
||||
uint32_t bell_duration;
|
||||
uint32_t led;
|
||||
uint32_t led_mode;
|
||||
uint32_t key;
|
||||
uint32_t auto_repeat_mode;
|
||||
} xcb_params_keyboard_t;
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_change_keyboard_control (xcb_connection_t *c,
|
||||
uint32_t mask,
|
||||
const xcb_params_keyboard_t *params);
|
||||
|
||||
int
|
||||
xcb_aux_parse_color(char *color_name,
|
||||
uint16_t *red, uint16_t *green, uint16_t *blue);
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_set_line_attributes_checked (xcb_connection_t *dpy,
|
||||
xcb_gcontext_t gc,
|
||||
uint16_t linewidth,
|
||||
int32_t linestyle,
|
||||
int32_t capstyle,
|
||||
int32_t joinstyle);
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_clear_window(xcb_connection_t * dpy,
|
||||
xcb_window_t w);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __XCB_AUX_H__ */
|
212
src/3rdparty/xcb/include/xcb/xcb_bitops.h
vendored
212
src/3rdparty/xcb/include/xcb/xcb_bitops.h
vendored
@ -1,212 +0,0 @@
|
||||
#ifndef __XCB_BITOPS_H__
|
||||
#define __XCB_BITOPS_H__
|
||||
|
||||
/* Copyright (C) 2007 Bart Massey
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
/**
|
||||
* @defgroup xcb__bitops XCB Bit Operations
|
||||
*
|
||||
* Inline functions for common bit ops used in XCB and elsewhere.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Create a low-order bitmask.
|
||||
* @param n Mask size.
|
||||
* @return Mask.
|
||||
*
|
||||
* Create a bitmask with the lower @p n bits set and the
|
||||
* rest of the word clear.
|
||||
* @ingroup xcb__bitops
|
||||
*/
|
||||
_X_INLINE static uint32_t
|
||||
xcb_mask(uint32_t n)
|
||||
{
|
||||
return n == 32 ? ~0 : (1 << n) - 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Population count.
|
||||
* @param n Integer representing a bitset.
|
||||
* @return Number of 1 bits in the bitset.
|
||||
*
|
||||
* This is a reasonably fast algorithm for counting the bits
|
||||
* in a 32-bit word. Currently a classic binary
|
||||
* divide-and-conquer popcount: popcount_2() from
|
||||
* http://en.wikipedia.org/wiki/Hamming_weight.
|
||||
* @ingroup xcb__bitops
|
||||
*/
|
||||
|
||||
|
||||
/* 15 ops, 3 long immediates, 14 stages, 9 alu ops, 9 alu stages */
|
||||
_X_INLINE static uint32_t
|
||||
xcb_popcount(uint32_t x)
|
||||
{
|
||||
uint32_t m1 = 0x55555555;
|
||||
uint32_t m2 = 0x33333333;
|
||||
uint32_t m4 = 0x0f0f0f0f;
|
||||
x -= (x >> 1) & m1;
|
||||
x = (x & m2) + ((x >> 2) & m2);
|
||||
x = (x + (x >> 4)) & m4;
|
||||
x += x >> 8;
|
||||
return (x + (x >> 16)) & 0x3f;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Round up to the next power-of-two unit size.
|
||||
* @param base Number to be rounded up.
|
||||
* @param pad Multiple to be rounded to; must be a power of two.
|
||||
* @return Rounded-up number.
|
||||
*
|
||||
* Rounds @p base up to a multiple of @p pad, where @p pad
|
||||
* is a power of two. The more general case is handled by
|
||||
* xcb_roundup().
|
||||
* @ingroup xcb__bitops
|
||||
*/
|
||||
_X_INLINE static uint32_t
|
||||
xcb_roundup_2 (uint32_t base, uint32_t pad)
|
||||
{
|
||||
return (base + pad - 1) & -pad;
|
||||
}
|
||||
|
||||
/**
|
||||
* Round down to the next power-of-two unit size.
|
||||
* @param base Number to be rounded down.
|
||||
* @param pad Multiple to be rounded to; must be a power of two.
|
||||
* @return Rounded-down number.
|
||||
*
|
||||
* Rounds @p base down to a multiple of @p pad, where @p pad
|
||||
* is a power of two. The more general case is handled by
|
||||
* xcb_rounddown().
|
||||
* @ingroup xcb__bitops
|
||||
*/
|
||||
_X_INLINE static uint32_t
|
||||
xcb_rounddown_2 (uint32_t base, uint32_t pad)
|
||||
{
|
||||
return base & -pad;
|
||||
}
|
||||
|
||||
/**
|
||||
* Round up to the next unit size.
|
||||
* @param base Number to be rounded up.
|
||||
* @param pad Multiple to be rounded to.
|
||||
* @return Rounded-up number.
|
||||
*
|
||||
* This is a general routine for rounding @p base up
|
||||
* to a multiple of @p pad. If you know that @p pad
|
||||
* is a power of two, you should probably call xcb_roundup_2()
|
||||
* instead.
|
||||
* @ingroup xcb__bitops
|
||||
*/
|
||||
_X_INLINE static uint32_t
|
||||
xcb_roundup (uint32_t base, uint32_t pad)
|
||||
{
|
||||
uint32_t b = base + pad - 1;
|
||||
/* faster if pad is a power of two */
|
||||
if (((pad - 1) & pad) == 0)
|
||||
return b & -pad;
|
||||
return b - b % pad;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Round down to the next unit size.
|
||||
* @param base Number to be rounded down.
|
||||
* @param pad Multiple to be rounded to.
|
||||
* @return Rounded-down number.
|
||||
*
|
||||
* This is a general routine for rounding @p base down
|
||||
* to a multiple of @p pad. If you know that @p pad
|
||||
* is a power of two, you should probably call xcb_rounddown_2()
|
||||
* instead.
|
||||
* @ingroup xcb__bitops
|
||||
*/
|
||||
_X_INLINE static uint32_t
|
||||
xcb_rounddown (uint32_t base, uint32_t pad)
|
||||
{
|
||||
/* faster if pad is a power of two */
|
||||
if (((pad - 1) & pad) == 0)
|
||||
return base & -pad;
|
||||
return base - base % pad;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse bits of word.
|
||||
* @param x Target word.
|
||||
* @param n Number of low-order bits to reverse.
|
||||
* @return Word with low @p n bits reversed, all others 0.
|
||||
*
|
||||
* Reverses the bottom @p n bits of @p x.
|
||||
* @ingroup xcb__bitops
|
||||
*/
|
||||
_X_INLINE static uint32_t
|
||||
xcb_bit_reverse(uint32_t x, uint8_t n) {
|
||||
uint32_t m1 = 0x00ff00ff;
|
||||
uint32_t m2 = 0x0f0f0f0f;
|
||||
uint32_t m3 = 0x33333333;
|
||||
uint32_t m4 = 0x55555555;
|
||||
x = ((x << 16) | (x >> 16));
|
||||
x = ((x & m1) << 8) | ((x >> 8) & m1);
|
||||
x = ((x & m2) << 4) | ((x >> 4) & m2);
|
||||
x = ((x & m3) << 2) | ((x >> 2) & m3);
|
||||
x = ((x & m4) << 1) | ((x >> 1) & m4);
|
||||
x >>= 32 - n;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Host byte order.
|
||||
* @return The byte order of the host.
|
||||
*
|
||||
* Tests the host's byte order and returns either
|
||||
* XCB_IMAGE_ORDER_MSB_FIRST or XCB_IMAGE_ORDER_LSB_FIRST
|
||||
* as appropriate.
|
||||
* @ingroup xcb__bitops
|
||||
*/
|
||||
_X_INLINE static xcb_image_order_t
|
||||
xcb_host_byte_order(void) {
|
||||
uint32_t endian_test = 0x01020304;
|
||||
|
||||
switch (*(char *)&endian_test) {
|
||||
case 0x01:
|
||||
return XCB_IMAGE_ORDER_MSB_FIRST;
|
||||
case 0x04:
|
||||
return XCB_IMAGE_ORDER_LSB_FIRST;
|
||||
}
|
||||
assert(0);
|
||||
}
|
||||
|
||||
#endif /* __XCB_BITOPS_H__ */
|
90
src/3rdparty/xcb/include/xcb/xcb_event.h
vendored
90
src/3rdparty/xcb/include/xcb/xcb_event.h
vendored
@ -1,90 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2009 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>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Bit mask to find event type regardless of event source.
|
||||
*
|
||||
* 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
|
||||
* generated from a SendEvent request. This mask can be used to
|
||||
* determine the type of event regardless of how the event was
|
||||
* generated. See the X11R6 protocol specification for details.
|
||||
*/
|
||||
#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)
|
||||
|
||||
/**
|
||||
* @brief Convert an event response 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 error 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
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __XCB_EVENT_H__ */
|
1049
src/3rdparty/xcb/include/xcb/xcb_icccm.h
vendored
1049
src/3rdparty/xcb/include/xcb/xcb_icccm.h
vendored
File diff suppressed because it is too large
Load Diff
630
src/3rdparty/xcb/include/xcb/xcb_image.h
vendored
630
src/3rdparty/xcb/include/xcb/xcb_image.h
vendored
@ -1,630 +0,0 @@
|
||||
#ifndef __XCB_IMAGE_H__
|
||||
#define __XCB_IMAGE_H__
|
||||
|
||||
/* Copyright (C) 2007 Bart Massey
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
#include <xcb/shm.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup xcb__image_t XCB Image Functions
|
||||
*
|
||||
* These are functions used to create and manipulate X images.
|
||||
*
|
||||
* The X image format we use is specific to this software,
|
||||
* which is probably a bug; it represents an intermediate
|
||||
* position between the wire format used by the X GetImage
|
||||
* and PutImage requests and standard formats like PBM. An
|
||||
* image consists of a header of type @ref xcb_image_t
|
||||
* describing the properties of the image, together with a
|
||||
* pointer to the image data itself.
|
||||
*
|
||||
* X wire images come in three formats. An xy-bitmap is a
|
||||
* bit-packed format that will be expanded to a two-color
|
||||
* pixmap using a GC when sent over the wire by PutImage.
|
||||
* An xy-pixmap is one or more bit-planes, each in the same
|
||||
* format as xy-bitmap. A z-pixmap is a more conventional
|
||||
* pixmap representation, with each pixel packed into a
|
||||
* word. Pixmaps are sent and received over the wire only
|
||||
* to/from drawables of their depth.
|
||||
*
|
||||
* Each X server defines, for each depth and format,
|
||||
* properties of images in that format that are sent and
|
||||
* received on the wire. We refer to this as a "native"
|
||||
* image for a given X server. It is not uncommon to want
|
||||
* to work with non-native images on the client side, or to
|
||||
* convert between the native images of different servers.
|
||||
*
|
||||
* This library provides several things. Facilities for
|
||||
* creating and destroying images are, of course, provided.
|
||||
* Wrappers for xcb_get_image() and xcb_put_image() are
|
||||
* provided; these utilize the image header to simplify the
|
||||
* interface. Routines for getting and putting image pixels
|
||||
* are provided: both a generic form that works with
|
||||
* arbitrary images, and fastpath forms for some common
|
||||
* cases. Conversion routines are provided for X images;
|
||||
* these routines have been fairly well optimized for the
|
||||
* common cases, and should run fast even on older hardware.
|
||||
* A routine analogous to Xlib's XCreate*FromBitmapData() is
|
||||
* provided for creating X images from xbm-format data; this
|
||||
* routine is in this library only because it is a trivial
|
||||
* use case for the library.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
typedef struct xcb_image_t xcb_image_t;
|
||||
|
||||
/**
|
||||
* @struct xcb_image_t
|
||||
* A structure that describes an xcb_image_t.
|
||||
*/
|
||||
struct xcb_image_t
|
||||
{
|
||||
uint16_t width; /**< Width in pixels, excluding pads etc. */
|
||||
uint16_t height; /**< Height in pixels. */
|
||||
xcb_image_format_t format; /**< Format. */
|
||||
uint8_t scanline_pad; /**< Right pad in bits. Valid pads
|
||||
* are 8, 16, 32.
|
||||
*/
|
||||
uint8_t depth; /**< Depth in bits. Valid depths
|
||||
* are 1, 4, 8, 16, 24 for z format,
|
||||
* 1 for xy-bitmap-format, anything
|
||||
* for xy-pixmap-format.
|
||||
*/
|
||||
uint8_t bpp; /**< Storage per pixel in bits.
|
||||
* Must be >= depth. Valid bpp
|
||||
* are 1, 4, 8, 16, 24, 32 for z
|
||||
* format, 1 for xy-bitmap format,
|
||||
* anything for xy-pixmap-format.
|
||||
*/
|
||||
uint8_t unit; /**< Scanline unit in bits for
|
||||
* xy formats and for bpp == 1,
|
||||
* in which case valid scanline
|
||||
* units are 8, 16, 32. Otherwise,
|
||||
* will be max(8, bpp). Must be >= bpp.
|
||||
*/
|
||||
uint32_t plane_mask; /**< When format is
|
||||
* xy-pixmap and depth >
|
||||
* 1, this says which
|
||||
* planes are "valid" in
|
||||
* some vague sense.
|
||||
* Currently used only
|
||||
* by xcb_image_get/put_pixel(),
|
||||
* and set only by
|
||||
* xcb_image_get().
|
||||
*/
|
||||
xcb_image_order_t byte_order; /**< Component byte order
|
||||
* for z-pixmap, byte
|
||||
* order of scanline unit
|
||||
* for xy-bitmap and
|
||||
* xy-pixmap. Nybble
|
||||
* order for z-pixmap
|
||||
* when bpp == 4.
|
||||
*/
|
||||
xcb_image_order_t bit_order; /**< Bit order of
|
||||
* scanline unit for
|
||||
* xy-bitmap and
|
||||
* xy-pixmap.
|
||||
*/
|
||||
uint32_t stride; /**< Bytes per image row.
|
||||
* Computable from other
|
||||
* data, but cached for
|
||||
* convenience/performance.
|
||||
*/
|
||||
uint32_t size; /**< Size of image data in bytes.
|
||||
* Computable from other
|
||||
* data, but cached for
|
||||
* convenience/performance.
|
||||
*/
|
||||
void * base; /**< Malloced block of storage that
|
||||
* will be freed by
|
||||
* @ref xcb_image_destroy() if non-null.
|
||||
*/
|
||||
uint8_t * data; /**< The actual image. */
|
||||
};
|
||||
|
||||
typedef struct xcb_shm_segment_info_t xcb_shm_segment_info_t;
|
||||
|
||||
/**
|
||||
* @struct xcb_shm_segment_info_t
|
||||
* A structure that stores the informations needed by the MIT Shm
|
||||
* Extension.
|
||||
*/
|
||||
struct xcb_shm_segment_info_t
|
||||
{
|
||||
xcb_shm_seg_t shmseg;
|
||||
uint32_t shmid;
|
||||
uint8_t *shmaddr;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Update the cached data of an image.
|
||||
* @param image The image.
|
||||
*
|
||||
* An image's size and stride, among other things, are
|
||||
* cached in its structure. This function recomputes those
|
||||
* cached values for the given image.
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
void
|
||||
xcb_image_annotate (xcb_image_t *image);
|
||||
|
||||
/**
|
||||
* Create a new image.
|
||||
* @param width The width of the image, in pixels.
|
||||
* @param height The height of the image, in pixels.
|
||||
* @param format The format of the image.
|
||||
* @param xpad The scanline pad of the image.
|
||||
* @param depth The depth of the image.
|
||||
* @param bpp The depth of the image storage.
|
||||
* @param unit The unit of image representation, in bits.
|
||||
* @param byte_order The byte order of the image.
|
||||
* @param bit_order The bit order of the image.
|
||||
* @param base The base address of malloced image data.
|
||||
* @param bytes The size in bytes of the storage pointed to by base.
|
||||
* If base == 0 and bytes == ~0 and data == 0 on
|
||||
* entry, no storage will be auto-allocated.
|
||||
* @param data The image data. If data is null and bytes != ~0, then
|
||||
* an attempt will be made to fill in data; from
|
||||
* base if it is non-null (and bytes is large enough), else
|
||||
* by mallocing sufficient storage and filling in base.
|
||||
* @return The new image.
|
||||
*
|
||||
* This function allocates the memory needed for an @ref xcb_image_t structure
|
||||
* with the given properties. See the description of xcb_image_t for details.
|
||||
* This function initializes and returns a pointer to the
|
||||
* xcb_image_t structure. It may try to allocate or reserve data for the
|
||||
* structure, depending on how @p base, @p bytes and @p data are set.
|
||||
*
|
||||
* The image must be destroyed with xcb_image_destroy().
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
xcb_image_t *
|
||||
xcb_image_create (uint16_t width,
|
||||
uint16_t height,
|
||||
xcb_image_format_t format,
|
||||
uint8_t xpad,
|
||||
uint8_t depth,
|
||||
uint8_t bpp,
|
||||
uint8_t unit,
|
||||
xcb_image_order_t byte_order,
|
||||
xcb_image_order_t bit_order,
|
||||
void * base,
|
||||
uint32_t bytes,
|
||||
uint8_t * data);
|
||||
|
||||
|
||||
/**
|
||||
* Create a new image in connection-native format.
|
||||
* @param c The connection.
|
||||
* @param width The width of the image, in pixels.
|
||||
* @param height The height of the image, in pixels.
|
||||
* @param format The format of the image.
|
||||
* @param depth The depth of the image.
|
||||
* @param base The base address of malloced image data.
|
||||
* @param bytes The size in bytes of the storage pointed to by base.
|
||||
* If base == 0 and bytes == ~0 and data == 0 on
|
||||
* entry, no storage will be auto-allocated.
|
||||
* @param data The image data. If data is null and bytes != ~0, then
|
||||
* an attempt will be made to fill in data; from
|
||||
* base if it is non-null (and bytes is large enough), else
|
||||
* by mallocing sufficient storage and filling in base.
|
||||
* @return The new image.
|
||||
*
|
||||
* This function calls @ref xcb_image_create() with the given
|
||||
* properties, and with the remaining properties chosen
|
||||
* according to the "native format" with the given
|
||||
* properties on the current connection.
|
||||
*
|
||||
* It is usual to use this rather
|
||||
* than calling xcb_image_create() directly.
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
xcb_image_t *
|
||||
xcb_image_create_native (xcb_connection_t * c,
|
||||
uint16_t width,
|
||||
uint16_t height,
|
||||
xcb_image_format_t format,
|
||||
uint8_t depth,
|
||||
void * base,
|
||||
uint32_t bytes,
|
||||
uint8_t * data);
|
||||
|
||||
|
||||
/**
|
||||
* Destroy an image.
|
||||
* @param image The image to be destroyed.
|
||||
*
|
||||
* This function frees the memory associated with the @p image
|
||||
* parameter. If its base pointer is non-null, it frees
|
||||
* that also.
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
void
|
||||
xcb_image_destroy (xcb_image_t *image);
|
||||
|
||||
|
||||
/**
|
||||
* Get an image from the X server.
|
||||
* @param conn The connection to the X server.
|
||||
* @param draw The drawable to get the image from.
|
||||
* @param x The x coordinate in pixels, relative to the origin of the
|
||||
* drawable and defining the upper-left corner of the rectangle.
|
||||
* @param y The y coordinate in pixels, relative to the origin of the
|
||||
* drawable and defining the upper-left corner of the rectangle.
|
||||
* @param width The width of the subimage in pixels.
|
||||
* @param height The height of the subimage in pixels.
|
||||
* @param plane_mask The plane mask. See the protocol document for details.
|
||||
* @param format The format of the image.
|
||||
* @return The subimage of @p draw defined by @p x, @p y, @p w, @p h.
|
||||
*
|
||||
|
||||
* This function returns a new image taken from the
|
||||
* given drawable @p draw.
|
||||
* The image will be in connection native format. If the @p format
|
||||
* is xy-bitmap and the @p plane_mask masks bit planes out, those
|
||||
* bit planes will be made part of the returned image anyway,
|
||||
* by zero-filling them; this will require a fresh memory allocation
|
||||
* and some copying. Otherwise, the resulting image will use the
|
||||
* xcb_get_image_reply() record as its backing store.
|
||||
*
|
||||
* If a problem occurs, the function returns null.
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
xcb_image_t *
|
||||
xcb_image_get (xcb_connection_t * conn,
|
||||
xcb_drawable_t draw,
|
||||
int16_t x,
|
||||
int16_t y,
|
||||
uint16_t width,
|
||||
uint16_t height,
|
||||
uint32_t plane_mask,
|
||||
xcb_image_format_t format);
|
||||
|
||||
|
||||
/**
|
||||
* Put an image onto the X server.
|
||||
* @param conn The connection to the X server.
|
||||
* @param draw The draw you get the image from.
|
||||
* @param gc The graphic context.
|
||||
* @param image The image you want to combine with the rectangle.
|
||||
* @param x The x coordinate, which is relative to the origin of the
|
||||
* drawable and defines the x coordinate of the upper-left corner of the
|
||||
* rectangle.
|
||||
* @param y The y coordinate, which is relative to the origin of the
|
||||
* drawable and defines the x coordinate of the upper-left corner of
|
||||
* the rectangle.
|
||||
* @param left_pad Notionally shift an xy-bitmap or xy-pixmap image
|
||||
* to the right some small amount, for some reason. XXX Not clear
|
||||
* this is currently supported correctly.
|
||||
* @return The cookie returned by xcb_put_image().
|
||||
*
|
||||
* This function combines an image with a rectangle of the
|
||||
* specified drawable @p draw. The image must be in native
|
||||
* format for the connection. The image is drawn at the
|
||||
* specified location in the drawable. For the xy-bitmap
|
||||
* format, the foreground pixel in @p gc defines the source
|
||||
* for the one bits in the image, and the background pixel
|
||||
* defines the source for the zero bits. For xy-pixmap and
|
||||
* z-pixmap formats, the depth of the image must match the
|
||||
* depth of the drawable; the gc is ignored.
|
||||
*
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
xcb_void_cookie_t
|
||||
xcb_image_put (xcb_connection_t * conn,
|
||||
xcb_drawable_t draw,
|
||||
xcb_gcontext_t gc,
|
||||
xcb_image_t * image,
|
||||
int16_t x,
|
||||
int16_t y,
|
||||
uint8_t left_pad);
|
||||
|
||||
|
||||
/**
|
||||
* Check image for or convert image to native format.
|
||||
* @param c The connection to the X server.
|
||||
* @param image The image.
|
||||
* @param convert If 0, just check the image for native format.
|
||||
* Otherwise, actually convert it.
|
||||
* @return Null if the image is not in native format and can or will not
|
||||
* be converted. Otherwise, the native format image.
|
||||
*
|
||||
* Each X display has its own "native format" for images of a given
|
||||
* format and depth. This function either checks whether the given
|
||||
* @p image is in native format for the given connection @p c, or
|
||||
* actually tries to convert the image to native format, depending
|
||||
* on whether @p convert is true or false.
|
||||
*
|
||||
* When @p convert is true, and the image is not in native format
|
||||
* but can be converted, it will be, and a pointer to the new image
|
||||
* will be returned. The image passed in will be unharmed in this
|
||||
* case; it is the caller's responsibility to check that the returned
|
||||
* pointer is different and to dispose of the old image if desired.
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
xcb_image_t *
|
||||
xcb_image_native (xcb_connection_t * c,
|
||||
xcb_image_t * image,
|
||||
int convert);
|
||||
|
||||
|
||||
/**
|
||||
* Put a pixel to an image.
|
||||
* @param image The image.
|
||||
* @param x The x coordinate of the pixel.
|
||||
* @param y The y coordinate of the pixel.
|
||||
* @param pixel The new pixel value.
|
||||
*
|
||||
* This function overwrites the pixel in the given @p image with the
|
||||
* specified @p pixel value (in client format). The image must contain the @p x
|
||||
* and @p y coordinates, as no clipping is done. This function honors
|
||||
* the plane-mask for xy-pixmap images.
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
void
|
||||
xcb_image_put_pixel (xcb_image_t *image,
|
||||
uint32_t x,
|
||||
uint32_t y,
|
||||
uint32_t pixel);
|
||||
|
||||
/**
|
||||
* Get a pixel from an image.
|
||||
* @param image The image.
|
||||
* @param x The x coordinate of the pixel.
|
||||
* @param y The y coordinate of the pixel.
|
||||
* @return The pixel value.
|
||||
*
|
||||
* This function retrieves a pixel from the given @p image.
|
||||
* The image must contain the @p x
|
||||
* and @p y coordinates, as no clipping is done. This function honors
|
||||
* the plane-mask for xy-pixmap images.
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
uint32_t
|
||||
xcb_image_get_pixel (xcb_image_t *image,
|
||||
uint32_t x,
|
||||
uint32_t y);
|
||||
|
||||
|
||||
/**
|
||||
* Convert an image to a new format.
|
||||
* @param src Source image.
|
||||
* @param dst Destination image.
|
||||
* @return The @p dst image, or null on error.
|
||||
*
|
||||
* This function tries to convert the image data of the @p
|
||||
* src image to the format implied by the @p dst image,
|
||||
* overwriting the current destination image data.
|
||||
* The source and destination must have the same
|
||||
* width, height, and depth. When the source and destination
|
||||
* are already the same format, a simple copy is done. Otherwise,
|
||||
* when the destination has the same bits-per-pixel/scanline-unit
|
||||
* as the source, an optimized copy routine (thanks to Keith Packard)
|
||||
* is used for the conversion. Otherwise, the copy is done the
|
||||
* slow, slow way with @ref xcb_image_get_pixel() and
|
||||
* @ref xcb_image_put_pixel() calls.
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
xcb_image_t *
|
||||
xcb_image_convert (xcb_image_t * src,
|
||||
xcb_image_t * dst);
|
||||
|
||||
|
||||
/**
|
||||
* Extract a subimage of an image.
|
||||
* @param image Source image.
|
||||
* @param x X coordinate of subimage.
|
||||
* @param y Y coordinate of subimage.
|
||||
* @param width Width of subimage.
|
||||
* @param height Height of subimage.
|
||||
* @param base Base of memory allocation.
|
||||
* @param bytes Size of base allocation.
|
||||
* @param data Memory allocation.
|
||||
* @return The subimage, or null on error.
|
||||
*
|
||||
* Given an image, this function extracts the subimage at the
|
||||
* given coordinates. The requested subimage must be entirely
|
||||
* contained in the source @p image. The resulting image will have the same
|
||||
* general image parameters as the source image. The @p base, @p bytes,
|
||||
* and @p data arguments are passed to @ref xcb_create_image() unaltered
|
||||
* to create the destination image---see its documentation for details.
|
||||
*
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
xcb_image_t *
|
||||
xcb_image_subimage(xcb_image_t * image,
|
||||
uint32_t x,
|
||||
uint32_t y,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
void * base,
|
||||
uint32_t bytes,
|
||||
uint8_t * data);
|
||||
|
||||
|
||||
/*
|
||||
* Shm stuff
|
||||
*/
|
||||
|
||||
/**
|
||||
* Put the data of an xcb_image_t onto a drawable using the MIT Shm
|
||||
* Extension.
|
||||
* @param conn The connection to the X server.
|
||||
* @param draw The draw you get the image from.
|
||||
* @param gc The graphic context.
|
||||
* @param image The image you want to combine with the rectangle.
|
||||
* @param shminfo A @ref xcb_shm_segment_info_t structure.
|
||||
* @param src_x The offset in x from the left edge of the image
|
||||
* defined by the xcb_image_t structure.
|
||||
* @param src_y The offset in y from the left edge of the image
|
||||
* defined by the xcb_image_t structure.
|
||||
* @param dest_x The x coordinate, which is relative to the origin of the
|
||||
* drawable and defines the x coordinate of the upper-left corner of the
|
||||
* rectangle.
|
||||
* @param dest_y The y coordinate, which is relative to the origin of the
|
||||
* drawable and defines the x coordinate of the upper-left corner of
|
||||
* the rectangle.
|
||||
* @param src_width The width of the subimage, in pixels.
|
||||
* @param src_height The height of the subimage, in pixels.
|
||||
* @param send_event Indicates whether or not a completion event
|
||||
* should occur when the image write is complete.
|
||||
* @return 1 is no problems occurs.
|
||||
*
|
||||
* This function combines an image in memory with a shape of the
|
||||
* specified drawable. The section of the image defined by the @p x, @p y,
|
||||
* @p width, and @p height arguments is drawn on the specified part of
|
||||
* the drawable. If XYBitmap format is used, the depth must be
|
||||
* one, or a``BadMatch'' error results. The foreground pixel in the
|
||||
* Graphic Context @p gc defines the source for the one bits in the
|
||||
* image, and the background pixel defines the source for the zero
|
||||
* bits. For XYPixmap and ZPixmap, the depth must match the depth of
|
||||
* the drawable, or a ``BadMatch'' error results.
|
||||
*
|
||||
* If a problem occurs, the function returns @c 0. Otherwise, it
|
||||
* returns @c 1.
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
xcb_image_t *
|
||||
xcb_image_shm_put (xcb_connection_t * conn,
|
||||
xcb_drawable_t draw,
|
||||
xcb_gcontext_t gc,
|
||||
xcb_image_t * image,
|
||||
xcb_shm_segment_info_t shminfo,
|
||||
int16_t src_x,
|
||||
int16_t src_y,
|
||||
int16_t dest_x,
|
||||
int16_t dest_y,
|
||||
uint16_t src_width,
|
||||
uint16_t src_height,
|
||||
uint8_t send_event);
|
||||
|
||||
|
||||
/**
|
||||
* Read image data into a shared memory xcb_image_t.
|
||||
* @param conn The connection to the X server.
|
||||
* @param draw The draw you get the image from.
|
||||
* @param image The image you want to combine with the rectangle.
|
||||
* @param shminfo A @ref xcb_shm_segment_info_t structure.
|
||||
* @param x The x coordinate, which are relative to the origin of the
|
||||
* drawable and define the upper-left corner of the rectangle.
|
||||
* @param y The y coordinate, which are relative to the origin of the
|
||||
* drawable and define the upper-left corner of the rectangle.
|
||||
* @param plane_mask The plane mask.
|
||||
* @return The subimage of @p draw defined by @p x, @p y, @p w, @p h.
|
||||
*
|
||||
* This function reads image data into a shared memory xcb_image_t where
|
||||
* @p conn is the connection to the X server, @p draw is the source
|
||||
* drawable, @p image is the destination xcb_image_t, @p x and @p y are offsets
|
||||
* within the drawable, and @p plane_mask defines which planes are to be
|
||||
* read.
|
||||
*
|
||||
* If a problem occurs, the function returns @c 0. It returns 1
|
||||
* otherwise.
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
int xcb_image_shm_get (xcb_connection_t * conn,
|
||||
xcb_drawable_t draw,
|
||||
xcb_image_t * image,
|
||||
xcb_shm_segment_info_t shminfo,
|
||||
int16_t x,
|
||||
int16_t y,
|
||||
uint32_t plane_mask);
|
||||
|
||||
|
||||
/**
|
||||
* Create an image from user-supplied bitmap data.
|
||||
* @param data Image data in packed bitmap format.
|
||||
* @param width Width in bits of image data.
|
||||
* @param height Height in bits of image data.
|
||||
* @return The image constructed from the image data, or 0 on error.
|
||||
*
|
||||
* This function creates an image from the user-supplied
|
||||
* bitmap @p data. The bitmap data is assumed to be in
|
||||
* xbm format (i.e., 8-bit scanline unit, LSB-first, 8-bit pad).
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
xcb_image_t *
|
||||
xcb_image_create_from_bitmap_data (uint8_t * data,
|
||||
uint32_t width,
|
||||
uint32_t height);
|
||||
|
||||
/**
|
||||
* Create a pixmap from user-supplied bitmap data.
|
||||
* @param display The connection to the X server.
|
||||
* @param d The parent drawable for the pixmap.
|
||||
* @param data Image data in packed bitmap format.
|
||||
* @param width Width in bits of image data.
|
||||
* @param height Height in bits of image data.
|
||||
* @param depth Depth of the desired pixmap.
|
||||
* @param fg Pixel for one-bits of pixmaps with depth larger than one.
|
||||
* @param bg Pixel for zero-bits of pixmaps with depth larger than one.
|
||||
* @param gcp If this pointer is non-null, the GC created to
|
||||
* fill in the pixmap is stored here; it will have its foreground
|
||||
* and background set to the supplied value. Otherwise, the GC
|
||||
* will be freed.
|
||||
* @return The pixmap constructed from the image data, or 0 on error.
|
||||
*
|
||||
* This function creates a pixmap from the user-supplied
|
||||
* bitmap @p data. The bitmap data is assumed to be in
|
||||
* xbm format (i.e., 8-bit scanline unit, LSB-first, 8-bit pad).
|
||||
* If @p depth is greater than 1, the
|
||||
* bitmap will be expanded to a pixmap using the given
|
||||
* foreground and background pixels @p fg and @p bg.
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
xcb_pixmap_t
|
||||
xcb_create_pixmap_from_bitmap_data (xcb_connection_t * display,
|
||||
xcb_drawable_t d,
|
||||
uint8_t * data,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t depth,
|
||||
uint32_t fg,
|
||||
uint32_t bg,
|
||||
xcb_gcontext_t * gcp);
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __XCB_IMAGE_H__ */
|
71
src/3rdparty/xcb/include/xcb/xcb_keysyms.h
vendored
71
src/3rdparty/xcb/include/xcb/xcb_keysyms.h
vendored
@ -1,71 +0,0 @@
|
||||
#ifndef __XCB_KEYSYMS_H__
|
||||
#define __XCB_KEYSYMS_H__
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct _XCBKeySymbols xcb_key_symbols_t;
|
||||
|
||||
xcb_key_symbols_t *xcb_key_symbols_alloc (xcb_connection_t *c);
|
||||
|
||||
void xcb_key_symbols_free (xcb_key_symbols_t *syms);
|
||||
|
||||
xcb_keysym_t xcb_key_symbols_get_keysym (xcb_key_symbols_t *syms,
|
||||
xcb_keycode_t keycode,
|
||||
int col);
|
||||
|
||||
/**
|
||||
* @brief Get the keycodes attached to a keysyms.
|
||||
* 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_key_press_event_t *event,
|
||||
int col);
|
||||
|
||||
xcb_keysym_t xcb_key_release_lookup_keysym (xcb_key_symbols_t *syms,
|
||||
xcb_key_release_event_t *event,
|
||||
int col);
|
||||
|
||||
int xcb_refresh_keyboard_mapping (xcb_key_symbols_t *syms,
|
||||
xcb_mapping_notify_event_t *event);
|
||||
|
||||
/* TODO: need XLookupString equivalent */
|
||||
|
||||
/* Tests for classes of symbols */
|
||||
|
||||
int xcb_is_keypad_key (xcb_keysym_t keysym);
|
||||
|
||||
int xcb_is_private_keypad_key (xcb_keysym_t keysym);
|
||||
|
||||
int xcb_is_cursor_key (xcb_keysym_t keysym);
|
||||
|
||||
int xcb_is_pf_key (xcb_keysym_t keysym);
|
||||
|
||||
int xcb_is_function_key (xcb_keysym_t keysym);
|
||||
|
||||
int xcb_is_misc_function_key (xcb_keysym_t keysym);
|
||||
|
||||
int xcb_is_modifier_key (xcb_keysym_t keysym);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __XCB_KEYSYMS_H__ */
|
171
src/3rdparty/xcb/include/xcb/xcb_pixel.h
vendored
171
src/3rdparty/xcb/include/xcb/xcb_pixel.h
vendored
@ -1,171 +0,0 @@
|
||||
#ifndef __XCB_PIXEL_H__
|
||||
#define __XCB_PIXEL_H__
|
||||
|
||||
/* Copyright (C) 2007 Bart Massey
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
#ifndef BUILD
|
||||
#include <xcb/xcb_bitops.h>
|
||||
#include <xcb/xcb_image.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* XCB Image fast pixel ops.
|
||||
*
|
||||
* Fast inline versions of xcb_image_get_pixel() and
|
||||
* xcb_image_put_pixel() for various common cases.
|
||||
* The naming convention is xcb_image_put_pixel_FUB()
|
||||
* where F is the format and is either XY for bitmaps
|
||||
* or Z for pixmaps, U is the bitmap unit size or pixmap
|
||||
* bits-per-pixel, and B is the endianness (if needed)
|
||||
* and is either M for most-significant-first or L for
|
||||
* least-significant-first. Note that no checking
|
||||
* is done on the arguments to these routines---caller beware.
|
||||
* Also note that the pixel type is chosen to be appropriate
|
||||
* to the unit; bitmaps use int and pixmaps use the appropriate
|
||||
* size of unsigned.
|
||||
* @ingroup xcb__image_t
|
||||
*/
|
||||
|
||||
_X_INLINE static void
|
||||
xcb_image_put_pixel_XY32M (xcb_image_t *image,
|
||||
uint32_t x,
|
||||
uint32_t y,
|
||||
int pixel)
|
||||
{
|
||||
uint32_t unit = (x >> 3) & ~xcb_mask(2);
|
||||
uint32_t byte = xcb_mask(2) - ((x >> 3) & xcb_mask(2));
|
||||
uint32_t bit = xcb_mask(3) - (x & xcb_mask(3));
|
||||
uint8_t m = 1 << bit;
|
||||
uint8_t p = pixel << bit;
|
||||
uint8_t * bp = image->data + (y * image->stride) + (unit | byte);
|
||||
*bp = (*bp & ~m) | p;
|
||||
}
|
||||
|
||||
_X_INLINE static void
|
||||
xcb_image_put_pixel_XY32L (xcb_image_t *image,
|
||||
uint32_t x,
|
||||
uint32_t y,
|
||||
int pixel)
|
||||
{
|
||||
uint32_t bit = x & xcb_mask(3);
|
||||
uint8_t m = 1 << bit;
|
||||
uint8_t p = pixel << bit;
|
||||
uint8_t * bp = image->data + (y * image->stride) + (x >> 3);
|
||||
*bp = (*bp & ~m) | p;
|
||||
}
|
||||
|
||||
_X_INLINE static int
|
||||
xcb_image_get_pixel_XY32M (xcb_image_t *image,
|
||||
uint32_t x,
|
||||
uint32_t y)
|
||||
{
|
||||
uint32_t unit = (x >> 3) & ~xcb_mask(2);
|
||||
uint32_t byte = xcb_mask(2) - ((x >> 3) & xcb_mask(2));
|
||||
uint32_t bit = xcb_mask(3) - (x & xcb_mask(3));
|
||||
uint8_t * bp = image->data + (y * image->stride) + (unit | byte);
|
||||
return (*bp >> bit) & 1;
|
||||
}
|
||||
|
||||
_X_INLINE static int
|
||||
xcb_image_get_pixel_XY32L (xcb_image_t *image,
|
||||
uint32_t x,
|
||||
uint32_t y)
|
||||
{
|
||||
uint32_t bit = x & xcb_mask(3);
|
||||
uint8_t * bp = image->data + (y * image->stride) + (x >> 3);
|
||||
return (*bp >> bit) & 1;
|
||||
}
|
||||
|
||||
_X_INLINE static void
|
||||
xcb_image_put_pixel_Z8 (xcb_image_t *image,
|
||||
uint32_t x,
|
||||
uint32_t y,
|
||||
uint8_t pixel)
|
||||
{
|
||||
image->data[x + y * image->stride] = pixel;
|
||||
}
|
||||
|
||||
_X_INLINE static uint8_t
|
||||
xcb_image_get_pixel_Z8 (xcb_image_t *image,
|
||||
uint32_t x,
|
||||
uint32_t y)
|
||||
{
|
||||
return image->data[x + y * image->stride];
|
||||
}
|
||||
|
||||
_X_INLINE static void
|
||||
xcb_image_put_pixel_Z32M (xcb_image_t *image,
|
||||
uint32_t x,
|
||||
uint32_t y,
|
||||
uint32_t pixel)
|
||||
{
|
||||
uint8_t * row = image->data + (y * image->stride);
|
||||
row[x << 2] = pixel >> 24;
|
||||
row[(x << 2) + 1] = pixel >> 16;
|
||||
row[(x << 2) + 2] = pixel >> 8;
|
||||
row[(x << 2) + 3] = pixel;
|
||||
}
|
||||
|
||||
_X_INLINE static void
|
||||
xcb_image_put_pixel_Z32L (xcb_image_t *image,
|
||||
uint32_t x,
|
||||
uint32_t y,
|
||||
uint32_t pixel)
|
||||
{
|
||||
uint8_t * row = image->data + (y * image->stride);
|
||||
row[x << 2] = pixel;
|
||||
row[(x << 2) + 1] = pixel >> 8;
|
||||
row[(x << 2) + 2] = pixel >> 16;
|
||||
row[(x << 2) + 3] = pixel >> 24;
|
||||
}
|
||||
|
||||
_X_INLINE static uint32_t
|
||||
xcb_image_get_pixel_Z32M (xcb_image_t *image,
|
||||
uint32_t x,
|
||||
uint32_t y)
|
||||
{
|
||||
uint8_t * row = image->data + (y * image->stride);
|
||||
uint32_t pixel = row[x << 2] << 24;
|
||||
pixel |= row[(x << 2) + 1] << 16;
|
||||
pixel |= row[(x << 2) + 2] << 8;
|
||||
return pixel | row[(x << 2) + 3];
|
||||
}
|
||||
|
||||
_X_INLINE static uint32_t
|
||||
xcb_image_get_pixel_Z32L (xcb_image_t *image,
|
||||
uint32_t x,
|
||||
uint32_t y)
|
||||
{
|
||||
uint8_t * row = image->data + (y * image->stride);
|
||||
uint32_t pixel = row[x << 2];
|
||||
pixel |= row[(x << 2) + 1] << 8;
|
||||
pixel |= row[(x << 2) + 2] << 16;
|
||||
return pixel | row[(x << 2) + 3] << 24;
|
||||
}
|
||||
|
||||
#endif /* __XCB_PIXEL_H__ */
|
150
src/3rdparty/xcb/include/xcb/xcb_renderutil.h
vendored
150
src/3rdparty/xcb/include/xcb/xcb_renderutil.h
vendored
@ -1,150 +0,0 @@
|
||||
/* Copyright © 2006 Jamey Sharp.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef XCB_RENDERUTIL
|
||||
#define XCB_RENDERUTIL
|
||||
#include <xcb/render.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum xcb_pict_format_t {
|
||||
XCB_PICT_FORMAT_ID = (1 << 0),
|
||||
XCB_PICT_FORMAT_TYPE = (1 << 1),
|
||||
XCB_PICT_FORMAT_DEPTH = (1 << 2),
|
||||
XCB_PICT_FORMAT_RED = (1 << 3),
|
||||
XCB_PICT_FORMAT_RED_MASK = (1 << 4),
|
||||
XCB_PICT_FORMAT_GREEN = (1 << 5),
|
||||
XCB_PICT_FORMAT_GREEN_MASK = (1 << 6),
|
||||
XCB_PICT_FORMAT_BLUE = (1 << 7),
|
||||
XCB_PICT_FORMAT_BLUE_MASK = (1 << 8),
|
||||
XCB_PICT_FORMAT_ALPHA = (1 << 9),
|
||||
XCB_PICT_FORMAT_ALPHA_MASK = (1 << 10),
|
||||
XCB_PICT_FORMAT_COLORMAP = (1 << 11)
|
||||
} xcb_pict_format_t;
|
||||
|
||||
typedef enum xcb_pict_standard_t {
|
||||
XCB_PICT_STANDARD_ARGB_32,
|
||||
XCB_PICT_STANDARD_RGB_24,
|
||||
XCB_PICT_STANDARD_A_8,
|
||||
XCB_PICT_STANDARD_A_4,
|
||||
XCB_PICT_STANDARD_A_1
|
||||
} xcb_pict_standard_t;
|
||||
|
||||
|
||||
xcb_render_pictvisual_t *
|
||||
xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t *formats,
|
||||
const xcb_visualid_t visual);
|
||||
|
||||
xcb_render_pictforminfo_t *
|
||||
xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats,
|
||||
unsigned long mask,
|
||||
const xcb_render_pictforminfo_t *ptemplate,
|
||||
int count);
|
||||
|
||||
xcb_render_pictforminfo_t *
|
||||
xcb_render_util_find_standard_format (const xcb_render_query_pict_formats_reply_t *formats,
|
||||
xcb_pict_standard_t format);
|
||||
|
||||
const xcb_render_query_version_reply_t *
|
||||
xcb_render_util_query_version (xcb_connection_t *c);
|
||||
|
||||
const xcb_render_query_pict_formats_reply_t *
|
||||
xcb_render_util_query_formats (xcb_connection_t *c);
|
||||
|
||||
int
|
||||
xcb_render_util_disconnect (xcb_connection_t *c);
|
||||
|
||||
/* wrappers for xcb_render_composite_glyphs_8/16/32 */
|
||||
|
||||
typedef struct xcb_render_util_composite_text_stream_t xcb_render_util_composite_text_stream_t;
|
||||
|
||||
xcb_render_util_composite_text_stream_t *
|
||||
xcb_render_util_composite_text_stream (
|
||||
xcb_render_glyphset_t initial_glyphset,
|
||||
uint32_t total_glyphs,
|
||||
uint32_t total_glyphset_changes );
|
||||
|
||||
void
|
||||
xcb_render_util_glyphs_8 (
|
||||
xcb_render_util_composite_text_stream_t *stream,
|
||||
int16_t dx,
|
||||
int16_t dy,
|
||||
uint32_t count,
|
||||
const uint8_t *glyphs );
|
||||
|
||||
void
|
||||
xcb_render_util_glyphs_16 (
|
||||
xcb_render_util_composite_text_stream_t *stream,
|
||||
int16_t dx,
|
||||
int16_t dy,
|
||||
uint32_t count,
|
||||
const uint16_t *glyphs );
|
||||
|
||||
void
|
||||
xcb_render_util_glyphs_32 (
|
||||
xcb_render_util_composite_text_stream_t *stream,
|
||||
int16_t dx,
|
||||
int16_t dy,
|
||||
uint32_t count,
|
||||
const uint32_t *glyphs );
|
||||
|
||||
void
|
||||
xcb_render_util_change_glyphset (
|
||||
xcb_render_util_composite_text_stream_t *stream,
|
||||
xcb_render_glyphset_t glyphset );
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_render_util_composite_text (
|
||||
xcb_connection_t *xc,
|
||||
uint8_t op,
|
||||
xcb_render_picture_t src,
|
||||
xcb_render_picture_t dst,
|
||||
xcb_render_pictformat_t mask_format,
|
||||
int16_t src_x,
|
||||
int16_t src_y,
|
||||
xcb_render_util_composite_text_stream_t *stream );
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_render_util_composite_text_checked (
|
||||
xcb_connection_t *xc,
|
||||
uint8_t op,
|
||||
xcb_render_picture_t src,
|
||||
xcb_render_picture_t dst,
|
||||
xcb_render_pictformat_t mask_format,
|
||||
int16_t src_x,
|
||||
int16_t src_y,
|
||||
xcb_render_util_composite_text_stream_t *stream );
|
||||
|
||||
void
|
||||
xcb_render_util_composite_text_free (
|
||||
xcb_render_util_composite_text_stream_t *stream );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* XCB_RENDERUTIL */
|
8
src/3rdparty/xcb/include/xcb/xcb_util.h
vendored
8
src/3rdparty/xcb/include/xcb/xcb_util.h
vendored
@ -1,8 +0,0 @@
|
||||
#ifndef __XCB_UTIL_H__
|
||||
#define __XCB_UTIL_H__
|
||||
|
||||
#include <xcb/xcb_atom.h>
|
||||
#include <xcb/xcb_aux.h>
|
||||
#include <xcb/xcb_event.h>
|
||||
|
||||
#endif /* __XCB_UTIL_H__ */
|
2816
src/3rdparty/xcb/include/xcb/xfixes.h
vendored
2816
src/3rdparty/xcb/include/xcb/xfixes.h
vendored
File diff suppressed because it is too large
Load Diff
811
src/3rdparty/xcb/include/xcb/xinerama.h
vendored
811
src/3rdparty/xcb/include/xcb/xinerama.h
vendored
@ -1,811 +0,0 @@
|
||||
/*
|
||||
* This file generated automatically from xinerama.xml by c_client.py.
|
||||
* Edit at your peril.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup XCB_Xinerama_API XCB Xinerama API
|
||||
* @brief Xinerama XCB Protocol Implementation.
|
||||
* @{
|
||||
**/
|
||||
|
||||
#ifndef __XINERAMA_H
|
||||
#define __XINERAMA_H
|
||||
|
||||
#include "xcb.h"
|
||||
#include "xproto.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define XCB_XINERAMA_MAJOR_VERSION 1
|
||||
#define XCB_XINERAMA_MINOR_VERSION 1
|
||||
|
||||
extern xcb_extension_t xcb_xinerama_id;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_screen_info_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_screen_info_t {
|
||||
int16_t x_org; /**< */
|
||||
int16_t y_org; /**< */
|
||||
uint16_t width; /**< */
|
||||
uint16_t height; /**< */
|
||||
} xcb_xinerama_screen_info_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_screen_info_iterator_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_screen_info_iterator_t {
|
||||
xcb_xinerama_screen_info_t *data; /**< */
|
||||
int rem; /**< */
|
||||
int index; /**< */
|
||||
} xcb_xinerama_screen_info_iterator_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_query_version_cookie_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_query_version_cookie_t {
|
||||
unsigned int sequence; /**< */
|
||||
} xcb_xinerama_query_version_cookie_t;
|
||||
|
||||
/** Opcode for xcb_xinerama_query_version. */
|
||||
#define XCB_XINERAMA_QUERY_VERSION 0
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_query_version_request_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_query_version_request_t {
|
||||
uint8_t major_opcode; /**< */
|
||||
uint8_t minor_opcode; /**< */
|
||||
uint16_t length; /**< */
|
||||
uint8_t major; /**< */
|
||||
uint8_t minor; /**< */
|
||||
} xcb_xinerama_query_version_request_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_query_version_reply_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_query_version_reply_t {
|
||||
uint8_t response_type; /**< */
|
||||
uint8_t pad0; /**< */
|
||||
uint16_t sequence; /**< */
|
||||
uint32_t length; /**< */
|
||||
uint16_t major; /**< */
|
||||
uint16_t minor; /**< */
|
||||
} xcb_xinerama_query_version_reply_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_get_state_cookie_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_get_state_cookie_t {
|
||||
unsigned int sequence; /**< */
|
||||
} xcb_xinerama_get_state_cookie_t;
|
||||
|
||||
/** Opcode for xcb_xinerama_get_state. */
|
||||
#define XCB_XINERAMA_GET_STATE 1
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_get_state_request_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_get_state_request_t {
|
||||
uint8_t major_opcode; /**< */
|
||||
uint8_t minor_opcode; /**< */
|
||||
uint16_t length; /**< */
|
||||
xcb_window_t window; /**< */
|
||||
} xcb_xinerama_get_state_request_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_get_state_reply_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_get_state_reply_t {
|
||||
uint8_t response_type; /**< */
|
||||
uint8_t state; /**< */
|
||||
uint16_t sequence; /**< */
|
||||
uint32_t length; /**< */
|
||||
xcb_window_t window; /**< */
|
||||
} xcb_xinerama_get_state_reply_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_get_screen_count_cookie_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_get_screen_count_cookie_t {
|
||||
unsigned int sequence; /**< */
|
||||
} xcb_xinerama_get_screen_count_cookie_t;
|
||||
|
||||
/** Opcode for xcb_xinerama_get_screen_count. */
|
||||
#define XCB_XINERAMA_GET_SCREEN_COUNT 2
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_get_screen_count_request_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_get_screen_count_request_t {
|
||||
uint8_t major_opcode; /**< */
|
||||
uint8_t minor_opcode; /**< */
|
||||
uint16_t length; /**< */
|
||||
xcb_window_t window; /**< */
|
||||
} xcb_xinerama_get_screen_count_request_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_get_screen_count_reply_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_get_screen_count_reply_t {
|
||||
uint8_t response_type; /**< */
|
||||
uint8_t screen_count; /**< */
|
||||
uint16_t sequence; /**< */
|
||||
uint32_t length; /**< */
|
||||
xcb_window_t window; /**< */
|
||||
} xcb_xinerama_get_screen_count_reply_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_get_screen_size_cookie_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_get_screen_size_cookie_t {
|
||||
unsigned int sequence; /**< */
|
||||
} xcb_xinerama_get_screen_size_cookie_t;
|
||||
|
||||
/** Opcode for xcb_xinerama_get_screen_size. */
|
||||
#define XCB_XINERAMA_GET_SCREEN_SIZE 3
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_get_screen_size_request_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_get_screen_size_request_t {
|
||||
uint8_t major_opcode; /**< */
|
||||
uint8_t minor_opcode; /**< */
|
||||
uint16_t length; /**< */
|
||||
xcb_window_t window; /**< */
|
||||
uint32_t screen; /**< */
|
||||
} xcb_xinerama_get_screen_size_request_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_get_screen_size_reply_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_get_screen_size_reply_t {
|
||||
uint8_t response_type; /**< */
|
||||
uint8_t pad0; /**< */
|
||||
uint16_t sequence; /**< */
|
||||
uint32_t length; /**< */
|
||||
uint32_t width; /**< */
|
||||
uint32_t height; /**< */
|
||||
xcb_window_t window; /**< */
|
||||
uint32_t screen; /**< */
|
||||
} xcb_xinerama_get_screen_size_reply_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_is_active_cookie_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_is_active_cookie_t {
|
||||
unsigned int sequence; /**< */
|
||||
} xcb_xinerama_is_active_cookie_t;
|
||||
|
||||
/** Opcode for xcb_xinerama_is_active. */
|
||||
#define XCB_XINERAMA_IS_ACTIVE 4
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_is_active_request_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_is_active_request_t {
|
||||
uint8_t major_opcode; /**< */
|
||||
uint8_t minor_opcode; /**< */
|
||||
uint16_t length; /**< */
|
||||
} xcb_xinerama_is_active_request_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_is_active_reply_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_is_active_reply_t {
|
||||
uint8_t response_type; /**< */
|
||||
uint8_t pad0; /**< */
|
||||
uint16_t sequence; /**< */
|
||||
uint32_t length; /**< */
|
||||
uint32_t state; /**< */
|
||||
} xcb_xinerama_is_active_reply_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_query_screens_cookie_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_query_screens_cookie_t {
|
||||
unsigned int sequence; /**< */
|
||||
} xcb_xinerama_query_screens_cookie_t;
|
||||
|
||||
/** Opcode for xcb_xinerama_query_screens. */
|
||||
#define XCB_XINERAMA_QUERY_SCREENS 5
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_query_screens_request_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_query_screens_request_t {
|
||||
uint8_t major_opcode; /**< */
|
||||
uint8_t minor_opcode; /**< */
|
||||
uint16_t length; /**< */
|
||||
} xcb_xinerama_query_screens_request_t;
|
||||
|
||||
/**
|
||||
* @brief xcb_xinerama_query_screens_reply_t
|
||||
**/
|
||||
typedef struct xcb_xinerama_query_screens_reply_t {
|
||||
uint8_t response_type; /**< */
|
||||
uint8_t pad0; /**< */
|
||||
uint16_t sequence; /**< */
|
||||
uint32_t length; /**< */
|
||||
uint32_t number; /**< */
|
||||
uint8_t pad1[20]; /**< */
|
||||
} xcb_xinerama_query_screens_reply_t;
|
||||
|
||||
/**
|
||||
* Get the next element of the iterator
|
||||
* @param i Pointer to a xcb_xinerama_screen_info_iterator_t
|
||||
*
|
||||
* Get the next element in the iterator. The member rem is
|
||||
* decreased by one. The member data points to the next
|
||||
* element. The member index is increased by sizeof(xcb_xinerama_screen_info_t)
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** void xcb_xinerama_screen_info_next
|
||||
**
|
||||
** @param xcb_xinerama_screen_info_iterator_t *i
|
||||
** @returns void
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
xcb_xinerama_screen_info_next (xcb_xinerama_screen_info_iterator_t *i /**< */);
|
||||
|
||||
/**
|
||||
* Return the iterator pointing to the last element
|
||||
* @param i An xcb_xinerama_screen_info_iterator_t
|
||||
* @return The iterator pointing to the last element
|
||||
*
|
||||
* Set the current element in the iterator to the last element.
|
||||
* The member rem is set to 0. The member data points to the
|
||||
* last element.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_generic_iterator_t xcb_xinerama_screen_info_end
|
||||
**
|
||||
** @param xcb_xinerama_screen_info_iterator_t i
|
||||
** @returns xcb_generic_iterator_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_generic_iterator_t
|
||||
xcb_xinerama_screen_info_end (xcb_xinerama_screen_info_iterator_t i /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param uint8_t major
|
||||
** @param uint8_t minor
|
||||
** @returns xcb_xinerama_query_version_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_query_version_cookie_t
|
||||
xcb_xinerama_query_version (xcb_connection_t *c /**< */,
|
||||
uint8_t major /**< */,
|
||||
uint8_t minor /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
* This form can be used only if the request will cause
|
||||
* a reply to be generated. Any returned error will be
|
||||
* placed in the event queue.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param uint8_t major
|
||||
** @param uint8_t minor
|
||||
** @returns xcb_xinerama_query_version_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_query_version_cookie_t
|
||||
xcb_xinerama_query_version_unchecked (xcb_connection_t *c /**< */,
|
||||
uint8_t major /**< */,
|
||||
uint8_t minor /**< */);
|
||||
|
||||
/**
|
||||
* Return the reply
|
||||
* @param c The connection
|
||||
* @param cookie The cookie
|
||||
* @param e The xcb_generic_error_t supplied
|
||||
*
|
||||
* Returns the reply of the request asked by
|
||||
*
|
||||
* The parameter @p e supplied to this function must be NULL if
|
||||
* xcb_xinerama_query_version_unchecked(). is used.
|
||||
* Otherwise, it stores the error if any.
|
||||
*
|
||||
* The returned value must be freed by the caller using free().
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_query_version_reply_t * xcb_xinerama_query_version_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_xinerama_query_version_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_xinerama_query_version_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_query_version_reply_t *
|
||||
xcb_xinerama_query_version_reply (xcb_connection_t *c /**< */,
|
||||
xcb_xinerama_query_version_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_window_t window
|
||||
** @returns xcb_xinerama_get_state_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_state_cookie_t
|
||||
xcb_xinerama_get_state (xcb_connection_t *c /**< */,
|
||||
xcb_window_t window /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
* This form can be used only if the request will cause
|
||||
* a reply to be generated. Any returned error will be
|
||||
* placed in the event queue.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_window_t window
|
||||
** @returns xcb_xinerama_get_state_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_state_cookie_t
|
||||
xcb_xinerama_get_state_unchecked (xcb_connection_t *c /**< */,
|
||||
xcb_window_t window /**< */);
|
||||
|
||||
/**
|
||||
* Return the reply
|
||||
* @param c The connection
|
||||
* @param cookie The cookie
|
||||
* @param e The xcb_generic_error_t supplied
|
||||
*
|
||||
* Returns the reply of the request asked by
|
||||
*
|
||||
* The parameter @p e supplied to this function must be NULL if
|
||||
* xcb_xinerama_get_state_unchecked(). is used.
|
||||
* Otherwise, it stores the error if any.
|
||||
*
|
||||
* The returned value must be freed by the caller using free().
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_state_reply_t * xcb_xinerama_get_state_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_xinerama_get_state_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_xinerama_get_state_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_state_reply_t *
|
||||
xcb_xinerama_get_state_reply (xcb_connection_t *c /**< */,
|
||||
xcb_xinerama_get_state_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_window_t window
|
||||
** @returns xcb_xinerama_get_screen_count_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_screen_count_cookie_t
|
||||
xcb_xinerama_get_screen_count (xcb_connection_t *c /**< */,
|
||||
xcb_window_t window /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
* This form can be used only if the request will cause
|
||||
* a reply to be generated. Any returned error will be
|
||||
* placed in the event queue.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_window_t window
|
||||
** @returns xcb_xinerama_get_screen_count_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_screen_count_cookie_t
|
||||
xcb_xinerama_get_screen_count_unchecked (xcb_connection_t *c /**< */,
|
||||
xcb_window_t window /**< */);
|
||||
|
||||
/**
|
||||
* Return the reply
|
||||
* @param c The connection
|
||||
* @param cookie The cookie
|
||||
* @param e The xcb_generic_error_t supplied
|
||||
*
|
||||
* Returns the reply of the request asked by
|
||||
*
|
||||
* The parameter @p e supplied to this function must be NULL if
|
||||
* xcb_xinerama_get_screen_count_unchecked(). is used.
|
||||
* Otherwise, it stores the error if any.
|
||||
*
|
||||
* The returned value must be freed by the caller using free().
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_screen_count_reply_t * xcb_xinerama_get_screen_count_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_xinerama_get_screen_count_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_xinerama_get_screen_count_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_screen_count_reply_t *
|
||||
xcb_xinerama_get_screen_count_reply (xcb_connection_t *c /**< */,
|
||||
xcb_xinerama_get_screen_count_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_window_t window
|
||||
** @param uint32_t screen
|
||||
** @returns xcb_xinerama_get_screen_size_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_screen_size_cookie_t
|
||||
xcb_xinerama_get_screen_size (xcb_connection_t *c /**< */,
|
||||
xcb_window_t window /**< */,
|
||||
uint32_t screen /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
* This form can be used only if the request will cause
|
||||
* a reply to be generated. Any returned error will be
|
||||
* placed in the event queue.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_window_t window
|
||||
** @param uint32_t screen
|
||||
** @returns xcb_xinerama_get_screen_size_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_screen_size_cookie_t
|
||||
xcb_xinerama_get_screen_size_unchecked (xcb_connection_t *c /**< */,
|
||||
xcb_window_t window /**< */,
|
||||
uint32_t screen /**< */);
|
||||
|
||||
/**
|
||||
* Return the reply
|
||||
* @param c The connection
|
||||
* @param cookie The cookie
|
||||
* @param e The xcb_generic_error_t supplied
|
||||
*
|
||||
* Returns the reply of the request asked by
|
||||
*
|
||||
* The parameter @p e supplied to this function must be NULL if
|
||||
* xcb_xinerama_get_screen_size_unchecked(). is used.
|
||||
* Otherwise, it stores the error if any.
|
||||
*
|
||||
* The returned value must be freed by the caller using free().
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_screen_size_reply_t * xcb_xinerama_get_screen_size_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_xinerama_get_screen_size_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_xinerama_get_screen_size_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_screen_size_reply_t *
|
||||
xcb_xinerama_get_screen_size_reply (xcb_connection_t *c /**< */,
|
||||
xcb_xinerama_get_screen_size_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @returns xcb_xinerama_is_active_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_is_active_cookie_t
|
||||
xcb_xinerama_is_active (xcb_connection_t *c /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
* This form can be used only if the request will cause
|
||||
* a reply to be generated. Any returned error will be
|
||||
* placed in the event queue.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @returns xcb_xinerama_is_active_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_is_active_cookie_t
|
||||
xcb_xinerama_is_active_unchecked (xcb_connection_t *c /**< */);
|
||||
|
||||
/**
|
||||
* Return the reply
|
||||
* @param c The connection
|
||||
* @param cookie The cookie
|
||||
* @param e The xcb_generic_error_t supplied
|
||||
*
|
||||
* Returns the reply of the request asked by
|
||||
*
|
||||
* The parameter @p e supplied to this function must be NULL if
|
||||
* xcb_xinerama_is_active_unchecked(). is used.
|
||||
* Otherwise, it stores the error if any.
|
||||
*
|
||||
* The returned value must be freed by the caller using free().
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_is_active_reply_t * xcb_xinerama_is_active_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_xinerama_is_active_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_xinerama_is_active_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_is_active_reply_t *
|
||||
xcb_xinerama_is_active_reply (xcb_connection_t *c /**< */,
|
||||
xcb_xinerama_is_active_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */);
|
||||
|
||||
int
|
||||
xcb_xinerama_query_screens_sizeof (const void *_buffer /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @returns xcb_xinerama_query_screens_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_query_screens_cookie_t
|
||||
xcb_xinerama_query_screens (xcb_connection_t *c /**< */);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param c The connection
|
||||
* @return A cookie
|
||||
*
|
||||
* Delivers a request to the X server.
|
||||
*
|
||||
* This form can be used only if the request will cause
|
||||
* a reply to be generated. Any returned error will be
|
||||
* placed in the event queue.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @returns xcb_xinerama_query_screens_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_query_screens_cookie_t
|
||||
xcb_xinerama_query_screens_unchecked (xcb_connection_t *c /**< */);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_screen_info_t * xcb_xinerama_query_screens_screen_info
|
||||
**
|
||||
** @param const xcb_xinerama_query_screens_reply_t *R
|
||||
** @returns xcb_xinerama_screen_info_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_screen_info_t *
|
||||
xcb_xinerama_query_screens_screen_info (const xcb_xinerama_query_screens_reply_t *R /**< */);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** int xcb_xinerama_query_screens_screen_info_length
|
||||
**
|
||||
** @param const xcb_xinerama_query_screens_reply_t *R
|
||||
** @returns int
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
int
|
||||
xcb_xinerama_query_screens_screen_info_length (const xcb_xinerama_query_screens_reply_t *R /**< */);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_screen_info_iterator_t xcb_xinerama_query_screens_screen_info_iterator
|
||||
**
|
||||
** @param const xcb_xinerama_query_screens_reply_t *R
|
||||
** @returns xcb_xinerama_screen_info_iterator_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_screen_info_iterator_t
|
||||
xcb_xinerama_query_screens_screen_info_iterator (const xcb_xinerama_query_screens_reply_t *R /**< */);
|
||||
|
||||
/**
|
||||
* Return the reply
|
||||
* @param c The connection
|
||||
* @param cookie The cookie
|
||||
* @param e The xcb_generic_error_t supplied
|
||||
*
|
||||
* Returns the reply of the request asked by
|
||||
*
|
||||
* The parameter @p e supplied to this function must be NULL if
|
||||
* xcb_xinerama_query_screens_unchecked(). is used.
|
||||
* Otherwise, it stores the error if any.
|
||||
*
|
||||
* The returned value must be freed by the caller using free().
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_query_screens_reply_t * xcb_xinerama_query_screens_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_xinerama_query_screens_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_xinerama_query_screens_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_query_screens_reply_t *
|
||||
xcb_xinerama_query_screens_reply (xcb_connection_t *c /**< */,
|
||||
xcb_xinerama_query_screens_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
4
src/3rdparty/xcb/include/xcb/xinput.h
vendored
4
src/3rdparty/xcb/include/xcb/xinput.h
vendored
@ -12,8 +12,8 @@
|
||||
#ifndef __XINPUT_H
|
||||
#define __XINPUT_H
|
||||
|
||||
#include "xcb.h"
|
||||
#include "xfixes.h"
|
||||
#include <xcb/xcb.h>
|
||||
#include <xcb/xfixes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
12085
src/3rdparty/xcb/include/xcb/xkb.h
vendored
12085
src/3rdparty/xcb/include/xcb/xkb.h
vendored
File diff suppressed because it is too large
Load Diff
@ -1,15 +0,0 @@
|
||||
diff --git a/src/3rdparty/xcb/include/xcb/xkb.h b/src/3rdparty/xcb/include/xcb/xkb.h
|
||||
index 44b0a8d..0180ec8 100644
|
||||
--- a/src/3rdparty/xcb/include/xcb/xkb.h
|
||||
+++ b/src/3rdparty/xcb/include/xcb/xkb.h
|
||||
@@ -114,8 +114,8 @@ typedef enum xcb_xkb_control_t {
|
||||
XCB_XKB_CONTROL_GROUPS_WRAP = 134217728,
|
||||
XCB_XKB_CONTROL_INTERNAL_MODS = 268435456,
|
||||
XCB_XKB_CONTROL_IGNORE_LOCK_MODS = 536870912,
|
||||
- XCB_XKB_CONTROL_PER_KEY_REPEAT = 1073741824,
|
||||
- XCB_XKB_CONTROL_CONTROLS_ENABLED = 2147483648
|
||||
+ XCB_XKB_CONTROL_PER_KEY_REPEAT = 1073741824u,
|
||||
+ XCB_XKB_CONTROL_CONTROLS_ENABLED = 2147483648u
|
||||
} xcb_xkb_control_t;
|
||||
|
||||
typedef enum xcb_xkb_axfb_opt_t {
|
19
src/3rdparty/xcb/libxcb/fixup-xinput-c.patch
vendored
Normal file
19
src/3rdparty/xcb/libxcb/fixup-xinput-c.patch
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
diff --git a/src/3rdparty/xcb/libxcb/xinput.c b/src/3rdparty/xcb/libxcb/xinput.c
|
||||
index 0edfde656c..d4e3c250bc 100644
|
||||
--- a/src/3rdparty/xcb/libxcb/xinput.c
|
||||
+++ b/src/3rdparty/xcb/libxcb/xinput.c
|
||||
@@ -10,11 +10,11 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <stddef.h> /* for offsetof() */
|
||||
-#include "xcbext.h"
|
||||
-#include "xinput.h"
|
||||
+#include <xcb/xcbext.h>
|
||||
+#include <xcb/xinput.h>
|
||||
|
||||
#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
|
||||
-#include "xfixes.h"
|
||||
+#include <xcb/xfixes.h>
|
||||
|
||||
xcb_extension_t xcb_input_id = { "XInputExtension", 0 };
|
||||
|
5640
src/3rdparty/xcb/libxcb/randr.c
vendored
5640
src/3rdparty/xcb/libxcb/randr.c
vendored
File diff suppressed because it is too large
Load Diff
5295
src/3rdparty/xcb/libxcb/render.c
vendored
5295
src/3rdparty/xcb/libxcb/render.c
vendored
File diff suppressed because it is too large
Load Diff
1102
src/3rdparty/xcb/libxcb/shape.c
vendored
1102
src/3rdparty/xcb/libxcb/shape.c
vendored
File diff suppressed because it is too large
Load Diff
724
src/3rdparty/xcb/libxcb/shm.c
vendored
724
src/3rdparty/xcb/libxcb/shm.c
vendored
@ -1,724 +0,0 @@
|
||||
/*
|
||||
* This file generated automatically from shm.xml by c_client.py.
|
||||
* Edit at your peril.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <stddef.h> /* for offsetof() */
|
||||
#include "xcbext.h"
|
||||
#include "shm.h"
|
||||
|
||||
#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
|
||||
#include "xproto.h"
|
||||
|
||||
xcb_extension_t xcb_shm_id = { "MIT-SHM", 0 };
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** void xcb_shm_seg_next
|
||||
**
|
||||
** @param xcb_shm_seg_iterator_t *i
|
||||
** @returns void
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
xcb_shm_seg_next (xcb_shm_seg_iterator_t *i /**< */)
|
||||
{
|
||||
--i->rem;
|
||||
++i->data;
|
||||
i->index += sizeof(xcb_shm_seg_t);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_generic_iterator_t xcb_shm_seg_end
|
||||
**
|
||||
** @param xcb_shm_seg_iterator_t i
|
||||
** @returns xcb_generic_iterator_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_generic_iterator_t
|
||||
xcb_shm_seg_end (xcb_shm_seg_iterator_t i /**< */)
|
||||
{
|
||||
xcb_generic_iterator_t ret;
|
||||
ret.data = i.data + i.rem;
|
||||
ret.index = i.index + ((char *) ret.data - (char *) i.data);
|
||||
ret.rem = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_shm_query_version_cookie_t xcb_shm_query_version
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @returns xcb_shm_query_version_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_shm_query_version_cookie_t
|
||||
xcb_shm_query_version (xcb_connection_t *c /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_shm_id,
|
||||
/* opcode */ XCB_SHM_QUERY_VERSION,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_shm_query_version_cookie_t xcb_ret;
|
||||
xcb_shm_query_version_request_t xcb_out;
|
||||
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_shm_query_version_cookie_t xcb_shm_query_version_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @returns xcb_shm_query_version_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_shm_query_version_cookie_t
|
||||
xcb_shm_query_version_unchecked (xcb_connection_t *c /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_shm_id,
|
||||
/* opcode */ XCB_SHM_QUERY_VERSION,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_shm_query_version_cookie_t xcb_ret;
|
||||
xcb_shm_query_version_request_t xcb_out;
|
||||
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_shm_query_version_reply_t * xcb_shm_query_version_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_shm_query_version_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_shm_query_version_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_shm_query_version_reply_t *
|
||||
xcb_shm_query_version_reply (xcb_connection_t *c /**< */,
|
||||
xcb_shm_query_version_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */)
|
||||
{
|
||||
return (xcb_shm_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_attach_checked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t shmid
|
||||
** @param uint8_t read_only
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_attach_checked (xcb_connection_t *c /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t shmid /**< */,
|
||||
uint8_t read_only /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_shm_id,
|
||||
/* opcode */ XCB_SHM_ATTACH,
|
||||
/* isvoid */ 1
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_void_cookie_t xcb_ret;
|
||||
xcb_shm_attach_request_t xcb_out;
|
||||
|
||||
xcb_out.shmseg = shmseg;
|
||||
xcb_out.shmid = shmid;
|
||||
xcb_out.read_only = read_only;
|
||||
memset(xcb_out.pad0, 0, 3);
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_attach
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t shmid
|
||||
** @param uint8_t read_only
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_attach (xcb_connection_t *c /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t shmid /**< */,
|
||||
uint8_t read_only /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_shm_id,
|
||||
/* opcode */ XCB_SHM_ATTACH,
|
||||
/* isvoid */ 1
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_void_cookie_t xcb_ret;
|
||||
xcb_shm_attach_request_t xcb_out;
|
||||
|
||||
xcb_out.shmseg = shmseg;
|
||||
xcb_out.shmid = shmid;
|
||||
xcb_out.read_only = read_only;
|
||||
memset(xcb_out.pad0, 0, 3);
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_detach_checked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_detach_checked (xcb_connection_t *c /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_shm_id,
|
||||
/* opcode */ XCB_SHM_DETACH,
|
||||
/* isvoid */ 1
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_void_cookie_t xcb_ret;
|
||||
xcb_shm_detach_request_t xcb_out;
|
||||
|
||||
xcb_out.shmseg = shmseg;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_detach
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_detach (xcb_connection_t *c /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_shm_id,
|
||||
/* opcode */ XCB_SHM_DETACH,
|
||||
/* isvoid */ 1
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_void_cookie_t xcb_ret;
|
||||
xcb_shm_detach_request_t xcb_out;
|
||||
|
||||
xcb_out.shmseg = shmseg;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_put_image_checked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_drawable_t drawable
|
||||
** @param xcb_gcontext_t gc
|
||||
** @param uint16_t total_width
|
||||
** @param uint16_t total_height
|
||||
** @param uint16_t src_x
|
||||
** @param uint16_t src_y
|
||||
** @param uint16_t src_width
|
||||
** @param uint16_t src_height
|
||||
** @param int16_t dst_x
|
||||
** @param int16_t dst_y
|
||||
** @param uint8_t depth
|
||||
** @param uint8_t format
|
||||
** @param uint8_t send_event
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t offset
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_put_image_checked (xcb_connection_t *c /**< */,
|
||||
xcb_drawable_t drawable /**< */,
|
||||
xcb_gcontext_t gc /**< */,
|
||||
uint16_t total_width /**< */,
|
||||
uint16_t total_height /**< */,
|
||||
uint16_t src_x /**< */,
|
||||
uint16_t src_y /**< */,
|
||||
uint16_t src_width /**< */,
|
||||
uint16_t src_height /**< */,
|
||||
int16_t dst_x /**< */,
|
||||
int16_t dst_y /**< */,
|
||||
uint8_t depth /**< */,
|
||||
uint8_t format /**< */,
|
||||
uint8_t send_event /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t offset /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_shm_id,
|
||||
/* opcode */ XCB_SHM_PUT_IMAGE,
|
||||
/* isvoid */ 1
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_void_cookie_t xcb_ret;
|
||||
xcb_shm_put_image_request_t xcb_out;
|
||||
|
||||
xcb_out.drawable = drawable;
|
||||
xcb_out.gc = gc;
|
||||
xcb_out.total_width = total_width;
|
||||
xcb_out.total_height = total_height;
|
||||
xcb_out.src_x = src_x;
|
||||
xcb_out.src_y = src_y;
|
||||
xcb_out.src_width = src_width;
|
||||
xcb_out.src_height = src_height;
|
||||
xcb_out.dst_x = dst_x;
|
||||
xcb_out.dst_y = dst_y;
|
||||
xcb_out.depth = depth;
|
||||
xcb_out.format = format;
|
||||
xcb_out.send_event = send_event;
|
||||
xcb_out.pad0 = 0;
|
||||
xcb_out.shmseg = shmseg;
|
||||
xcb_out.offset = offset;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_put_image
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_drawable_t drawable
|
||||
** @param xcb_gcontext_t gc
|
||||
** @param uint16_t total_width
|
||||
** @param uint16_t total_height
|
||||
** @param uint16_t src_x
|
||||
** @param uint16_t src_y
|
||||
** @param uint16_t src_width
|
||||
** @param uint16_t src_height
|
||||
** @param int16_t dst_x
|
||||
** @param int16_t dst_y
|
||||
** @param uint8_t depth
|
||||
** @param uint8_t format
|
||||
** @param uint8_t send_event
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t offset
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_put_image (xcb_connection_t *c /**< */,
|
||||
xcb_drawable_t drawable /**< */,
|
||||
xcb_gcontext_t gc /**< */,
|
||||
uint16_t total_width /**< */,
|
||||
uint16_t total_height /**< */,
|
||||
uint16_t src_x /**< */,
|
||||
uint16_t src_y /**< */,
|
||||
uint16_t src_width /**< */,
|
||||
uint16_t src_height /**< */,
|
||||
int16_t dst_x /**< */,
|
||||
int16_t dst_y /**< */,
|
||||
uint8_t depth /**< */,
|
||||
uint8_t format /**< */,
|
||||
uint8_t send_event /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t offset /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_shm_id,
|
||||
/* opcode */ XCB_SHM_PUT_IMAGE,
|
||||
/* isvoid */ 1
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_void_cookie_t xcb_ret;
|
||||
xcb_shm_put_image_request_t xcb_out;
|
||||
|
||||
xcb_out.drawable = drawable;
|
||||
xcb_out.gc = gc;
|
||||
xcb_out.total_width = total_width;
|
||||
xcb_out.total_height = total_height;
|
||||
xcb_out.src_x = src_x;
|
||||
xcb_out.src_y = src_y;
|
||||
xcb_out.src_width = src_width;
|
||||
xcb_out.src_height = src_height;
|
||||
xcb_out.dst_x = dst_x;
|
||||
xcb_out.dst_y = dst_y;
|
||||
xcb_out.depth = depth;
|
||||
xcb_out.format = format;
|
||||
xcb_out.send_event = send_event;
|
||||
xcb_out.pad0 = 0;
|
||||
xcb_out.shmseg = shmseg;
|
||||
xcb_out.offset = offset;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_shm_get_image_cookie_t xcb_shm_get_image
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_drawable_t drawable
|
||||
** @param int16_t x
|
||||
** @param int16_t y
|
||||
** @param uint16_t width
|
||||
** @param uint16_t height
|
||||
** @param uint32_t plane_mask
|
||||
** @param uint8_t format
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t offset
|
||||
** @returns xcb_shm_get_image_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_shm_get_image_cookie_t
|
||||
xcb_shm_get_image (xcb_connection_t *c /**< */,
|
||||
xcb_drawable_t drawable /**< */,
|
||||
int16_t x /**< */,
|
||||
int16_t y /**< */,
|
||||
uint16_t width /**< */,
|
||||
uint16_t height /**< */,
|
||||
uint32_t plane_mask /**< */,
|
||||
uint8_t format /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t offset /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_shm_id,
|
||||
/* opcode */ XCB_SHM_GET_IMAGE,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_shm_get_image_cookie_t xcb_ret;
|
||||
xcb_shm_get_image_request_t xcb_out;
|
||||
|
||||
xcb_out.drawable = drawable;
|
||||
xcb_out.x = x;
|
||||
xcb_out.y = y;
|
||||
xcb_out.width = width;
|
||||
xcb_out.height = height;
|
||||
xcb_out.plane_mask = plane_mask;
|
||||
xcb_out.format = format;
|
||||
memset(xcb_out.pad0, 0, 3);
|
||||
xcb_out.shmseg = shmseg;
|
||||
xcb_out.offset = offset;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_shm_get_image_cookie_t xcb_shm_get_image_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_drawable_t drawable
|
||||
** @param int16_t x
|
||||
** @param int16_t y
|
||||
** @param uint16_t width
|
||||
** @param uint16_t height
|
||||
** @param uint32_t plane_mask
|
||||
** @param uint8_t format
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t offset
|
||||
** @returns xcb_shm_get_image_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_shm_get_image_cookie_t
|
||||
xcb_shm_get_image_unchecked (xcb_connection_t *c /**< */,
|
||||
xcb_drawable_t drawable /**< */,
|
||||
int16_t x /**< */,
|
||||
int16_t y /**< */,
|
||||
uint16_t width /**< */,
|
||||
uint16_t height /**< */,
|
||||
uint32_t plane_mask /**< */,
|
||||
uint8_t format /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t offset /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_shm_id,
|
||||
/* opcode */ XCB_SHM_GET_IMAGE,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_shm_get_image_cookie_t xcb_ret;
|
||||
xcb_shm_get_image_request_t xcb_out;
|
||||
|
||||
xcb_out.drawable = drawable;
|
||||
xcb_out.x = x;
|
||||
xcb_out.y = y;
|
||||
xcb_out.width = width;
|
||||
xcb_out.height = height;
|
||||
xcb_out.plane_mask = plane_mask;
|
||||
xcb_out.format = format;
|
||||
memset(xcb_out.pad0, 0, 3);
|
||||
xcb_out.shmseg = shmseg;
|
||||
xcb_out.offset = offset;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_shm_get_image_reply_t * xcb_shm_get_image_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_shm_get_image_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_shm_get_image_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_shm_get_image_reply_t *
|
||||
xcb_shm_get_image_reply (xcb_connection_t *c /**< */,
|
||||
xcb_shm_get_image_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */)
|
||||
{
|
||||
return (xcb_shm_get_image_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_create_pixmap_checked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_pixmap_t pid
|
||||
** @param xcb_drawable_t drawable
|
||||
** @param uint16_t width
|
||||
** @param uint16_t height
|
||||
** @param uint8_t depth
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t offset
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_create_pixmap_checked (xcb_connection_t *c /**< */,
|
||||
xcb_pixmap_t pid /**< */,
|
||||
xcb_drawable_t drawable /**< */,
|
||||
uint16_t width /**< */,
|
||||
uint16_t height /**< */,
|
||||
uint8_t depth /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t offset /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_shm_id,
|
||||
/* opcode */ XCB_SHM_CREATE_PIXMAP,
|
||||
/* isvoid */ 1
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_void_cookie_t xcb_ret;
|
||||
xcb_shm_create_pixmap_request_t xcb_out;
|
||||
|
||||
xcb_out.pid = pid;
|
||||
xcb_out.drawable = drawable;
|
||||
xcb_out.width = width;
|
||||
xcb_out.height = height;
|
||||
xcb_out.depth = depth;
|
||||
memset(xcb_out.pad0, 0, 3);
|
||||
xcb_out.shmseg = shmseg;
|
||||
xcb_out.offset = offset;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_void_cookie_t xcb_shm_create_pixmap
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_pixmap_t pid
|
||||
** @param xcb_drawable_t drawable
|
||||
** @param uint16_t width
|
||||
** @param uint16_t height
|
||||
** @param uint8_t depth
|
||||
** @param xcb_shm_seg_t shmseg
|
||||
** @param uint32_t offset
|
||||
** @returns xcb_void_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_shm_create_pixmap (xcb_connection_t *c /**< */,
|
||||
xcb_pixmap_t pid /**< */,
|
||||
xcb_drawable_t drawable /**< */,
|
||||
uint16_t width /**< */,
|
||||
uint16_t height /**< */,
|
||||
uint8_t depth /**< */,
|
||||
xcb_shm_seg_t shmseg /**< */,
|
||||
uint32_t offset /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_shm_id,
|
||||
/* opcode */ XCB_SHM_CREATE_PIXMAP,
|
||||
/* isvoid */ 1
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_void_cookie_t xcb_ret;
|
||||
xcb_shm_create_pixmap_request_t xcb_out;
|
||||
|
||||
xcb_out.pid = pid;
|
||||
xcb_out.drawable = drawable;
|
||||
xcb_out.width = width;
|
||||
xcb_out.height = height;
|
||||
xcb_out.depth = depth;
|
||||
memset(xcb_out.pad0, 0, 3);
|
||||
xcb_out.shmseg = shmseg;
|
||||
xcb_out.offset = offset;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
2258
src/3rdparty/xcb/libxcb/sync.c
vendored
2258
src/3rdparty/xcb/libxcb/sync.c
vendored
File diff suppressed because it is too large
Load Diff
3274
src/3rdparty/xcb/libxcb/xfixes.c
vendored
3274
src/3rdparty/xcb/libxcb/xfixes.c
vendored
File diff suppressed because it is too large
Load Diff
703
src/3rdparty/xcb/libxcb/xinerama.c
vendored
703
src/3rdparty/xcb/libxcb/xinerama.c
vendored
@ -1,703 +0,0 @@
|
||||
/*
|
||||
* This file generated automatically from xinerama.xml by c_client.py.
|
||||
* Edit at your peril.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <stddef.h> /* for offsetof() */
|
||||
#include "xcbext.h"
|
||||
#include "xinerama.h"
|
||||
|
||||
#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
|
||||
#include "xproto.h"
|
||||
|
||||
xcb_extension_t xcb_xinerama_id = { "XINERAMA", 0 };
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** void xcb_xinerama_screen_info_next
|
||||
**
|
||||
** @param xcb_xinerama_screen_info_iterator_t *i
|
||||
** @returns void
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
xcb_xinerama_screen_info_next (xcb_xinerama_screen_info_iterator_t *i /**< */)
|
||||
{
|
||||
--i->rem;
|
||||
++i->data;
|
||||
i->index += sizeof(xcb_xinerama_screen_info_t);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_generic_iterator_t xcb_xinerama_screen_info_end
|
||||
**
|
||||
** @param xcb_xinerama_screen_info_iterator_t i
|
||||
** @returns xcb_generic_iterator_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_generic_iterator_t
|
||||
xcb_xinerama_screen_info_end (xcb_xinerama_screen_info_iterator_t i /**< */)
|
||||
{
|
||||
xcb_generic_iterator_t ret;
|
||||
ret.data = i.data + i.rem;
|
||||
ret.index = i.index + ((char *) ret.data - (char *) i.data);
|
||||
ret.rem = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param uint8_t major
|
||||
** @param uint8_t minor
|
||||
** @returns xcb_xinerama_query_version_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_query_version_cookie_t
|
||||
xcb_xinerama_query_version (xcb_connection_t *c /**< */,
|
||||
uint8_t major /**< */,
|
||||
uint8_t minor /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_xinerama_id,
|
||||
/* opcode */ XCB_XINERAMA_QUERY_VERSION,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_xinerama_query_version_cookie_t xcb_ret;
|
||||
xcb_xinerama_query_version_request_t xcb_out;
|
||||
|
||||
xcb_out.major = major;
|
||||
xcb_out.minor = minor;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param uint8_t major
|
||||
** @param uint8_t minor
|
||||
** @returns xcb_xinerama_query_version_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_query_version_cookie_t
|
||||
xcb_xinerama_query_version_unchecked (xcb_connection_t *c /**< */,
|
||||
uint8_t major /**< */,
|
||||
uint8_t minor /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_xinerama_id,
|
||||
/* opcode */ XCB_XINERAMA_QUERY_VERSION,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_xinerama_query_version_cookie_t xcb_ret;
|
||||
xcb_xinerama_query_version_request_t xcb_out;
|
||||
|
||||
xcb_out.major = major;
|
||||
xcb_out.minor = minor;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_query_version_reply_t * xcb_xinerama_query_version_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_xinerama_query_version_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_xinerama_query_version_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_query_version_reply_t *
|
||||
xcb_xinerama_query_version_reply (xcb_connection_t *c /**< */,
|
||||
xcb_xinerama_query_version_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */)
|
||||
{
|
||||
return (xcb_xinerama_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_window_t window
|
||||
** @returns xcb_xinerama_get_state_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_state_cookie_t
|
||||
xcb_xinerama_get_state (xcb_connection_t *c /**< */,
|
||||
xcb_window_t window /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_xinerama_id,
|
||||
/* opcode */ XCB_XINERAMA_GET_STATE,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_xinerama_get_state_cookie_t xcb_ret;
|
||||
xcb_xinerama_get_state_request_t xcb_out;
|
||||
|
||||
xcb_out.window = window;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_window_t window
|
||||
** @returns xcb_xinerama_get_state_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_state_cookie_t
|
||||
xcb_xinerama_get_state_unchecked (xcb_connection_t *c /**< */,
|
||||
xcb_window_t window /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_xinerama_id,
|
||||
/* opcode */ XCB_XINERAMA_GET_STATE,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_xinerama_get_state_cookie_t xcb_ret;
|
||||
xcb_xinerama_get_state_request_t xcb_out;
|
||||
|
||||
xcb_out.window = window;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_state_reply_t * xcb_xinerama_get_state_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_xinerama_get_state_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_xinerama_get_state_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_state_reply_t *
|
||||
xcb_xinerama_get_state_reply (xcb_connection_t *c /**< */,
|
||||
xcb_xinerama_get_state_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */)
|
||||
{
|
||||
return (xcb_xinerama_get_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_window_t window
|
||||
** @returns xcb_xinerama_get_screen_count_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_screen_count_cookie_t
|
||||
xcb_xinerama_get_screen_count (xcb_connection_t *c /**< */,
|
||||
xcb_window_t window /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_xinerama_id,
|
||||
/* opcode */ XCB_XINERAMA_GET_SCREEN_COUNT,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_xinerama_get_screen_count_cookie_t xcb_ret;
|
||||
xcb_xinerama_get_screen_count_request_t xcb_out;
|
||||
|
||||
xcb_out.window = window;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_window_t window
|
||||
** @returns xcb_xinerama_get_screen_count_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_screen_count_cookie_t
|
||||
xcb_xinerama_get_screen_count_unchecked (xcb_connection_t *c /**< */,
|
||||
xcb_window_t window /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_xinerama_id,
|
||||
/* opcode */ XCB_XINERAMA_GET_SCREEN_COUNT,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_xinerama_get_screen_count_cookie_t xcb_ret;
|
||||
xcb_xinerama_get_screen_count_request_t xcb_out;
|
||||
|
||||
xcb_out.window = window;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_screen_count_reply_t * xcb_xinerama_get_screen_count_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_xinerama_get_screen_count_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_xinerama_get_screen_count_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_screen_count_reply_t *
|
||||
xcb_xinerama_get_screen_count_reply (xcb_connection_t *c /**< */,
|
||||
xcb_xinerama_get_screen_count_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */)
|
||||
{
|
||||
return (xcb_xinerama_get_screen_count_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_window_t window
|
||||
** @param uint32_t screen
|
||||
** @returns xcb_xinerama_get_screen_size_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_screen_size_cookie_t
|
||||
xcb_xinerama_get_screen_size (xcb_connection_t *c /**< */,
|
||||
xcb_window_t window /**< */,
|
||||
uint32_t screen /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_xinerama_id,
|
||||
/* opcode */ XCB_XINERAMA_GET_SCREEN_SIZE,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_xinerama_get_screen_size_cookie_t xcb_ret;
|
||||
xcb_xinerama_get_screen_size_request_t xcb_out;
|
||||
|
||||
xcb_out.window = window;
|
||||
xcb_out.screen = screen;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_window_t window
|
||||
** @param uint32_t screen
|
||||
** @returns xcb_xinerama_get_screen_size_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_screen_size_cookie_t
|
||||
xcb_xinerama_get_screen_size_unchecked (xcb_connection_t *c /**< */,
|
||||
xcb_window_t window /**< */,
|
||||
uint32_t screen /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_xinerama_id,
|
||||
/* opcode */ XCB_XINERAMA_GET_SCREEN_SIZE,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_xinerama_get_screen_size_cookie_t xcb_ret;
|
||||
xcb_xinerama_get_screen_size_request_t xcb_out;
|
||||
|
||||
xcb_out.window = window;
|
||||
xcb_out.screen = screen;
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_get_screen_size_reply_t * xcb_xinerama_get_screen_size_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_xinerama_get_screen_size_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_xinerama_get_screen_size_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_get_screen_size_reply_t *
|
||||
xcb_xinerama_get_screen_size_reply (xcb_connection_t *c /**< */,
|
||||
xcb_xinerama_get_screen_size_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */)
|
||||
{
|
||||
return (xcb_xinerama_get_screen_size_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @returns xcb_xinerama_is_active_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_is_active_cookie_t
|
||||
xcb_xinerama_is_active (xcb_connection_t *c /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_xinerama_id,
|
||||
/* opcode */ XCB_XINERAMA_IS_ACTIVE,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_xinerama_is_active_cookie_t xcb_ret;
|
||||
xcb_xinerama_is_active_request_t xcb_out;
|
||||
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @returns xcb_xinerama_is_active_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_is_active_cookie_t
|
||||
xcb_xinerama_is_active_unchecked (xcb_connection_t *c /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_xinerama_id,
|
||||
/* opcode */ XCB_XINERAMA_IS_ACTIVE,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_xinerama_is_active_cookie_t xcb_ret;
|
||||
xcb_xinerama_is_active_request_t xcb_out;
|
||||
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_is_active_reply_t * xcb_xinerama_is_active_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_xinerama_is_active_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_xinerama_is_active_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_is_active_reply_t *
|
||||
xcb_xinerama_is_active_reply (xcb_connection_t *c /**< */,
|
||||
xcb_xinerama_is_active_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */)
|
||||
{
|
||||
return (xcb_xinerama_is_active_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
|
||||
}
|
||||
|
||||
int
|
||||
xcb_xinerama_query_screens_sizeof (const void *_buffer /**< */)
|
||||
{
|
||||
char *xcb_tmp = (char *)_buffer;
|
||||
const xcb_xinerama_query_screens_reply_t *_aux = (xcb_xinerama_query_screens_reply_t *)_buffer;
|
||||
unsigned int xcb_buffer_len = 0;
|
||||
unsigned int xcb_block_len = 0;
|
||||
unsigned int xcb_pad = 0;
|
||||
unsigned int xcb_align_to;
|
||||
|
||||
|
||||
xcb_block_len += sizeof(xcb_xinerama_query_screens_reply_t);
|
||||
xcb_tmp += xcb_block_len;
|
||||
/* screen_info */
|
||||
xcb_block_len += _aux->number * sizeof(xcb_xinerama_screen_info_t);
|
||||
xcb_tmp += xcb_block_len;
|
||||
xcb_align_to = ALIGNOF(xcb_xinerama_screen_info_t);
|
||||
/* insert padding */
|
||||
xcb_pad = -xcb_block_len & (xcb_align_to - 1);
|
||||
xcb_buffer_len += xcb_block_len + xcb_pad;
|
||||
if (0 != xcb_pad) {
|
||||
xcb_tmp += xcb_pad;
|
||||
xcb_pad = 0;
|
||||
}
|
||||
xcb_block_len = 0;
|
||||
|
||||
return xcb_buffer_len;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @returns xcb_xinerama_query_screens_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_query_screens_cookie_t
|
||||
xcb_xinerama_query_screens (xcb_connection_t *c /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_xinerama_id,
|
||||
/* opcode */ XCB_XINERAMA_QUERY_SCREENS,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_xinerama_query_screens_cookie_t xcb_ret;
|
||||
xcb_xinerama_query_screens_request_t xcb_out;
|
||||
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens_unchecked
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @returns xcb_xinerama_query_screens_cookie_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_query_screens_cookie_t
|
||||
xcb_xinerama_query_screens_unchecked (xcb_connection_t *c /**< */)
|
||||
{
|
||||
static const xcb_protocol_request_t xcb_req = {
|
||||
/* count */ 2,
|
||||
/* ext */ &xcb_xinerama_id,
|
||||
/* opcode */ XCB_XINERAMA_QUERY_SCREENS,
|
||||
/* isvoid */ 0
|
||||
};
|
||||
|
||||
struct iovec xcb_parts[4];
|
||||
xcb_xinerama_query_screens_cookie_t xcb_ret;
|
||||
xcb_xinerama_query_screens_request_t xcb_out;
|
||||
|
||||
|
||||
xcb_parts[2].iov_base = (char *) &xcb_out;
|
||||
xcb_parts[2].iov_len = sizeof(xcb_out);
|
||||
xcb_parts[3].iov_base = 0;
|
||||
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
|
||||
|
||||
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
|
||||
return xcb_ret;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_screen_info_t * xcb_xinerama_query_screens_screen_info
|
||||
**
|
||||
** @param const xcb_xinerama_query_screens_reply_t *R
|
||||
** @returns xcb_xinerama_screen_info_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_screen_info_t *
|
||||
xcb_xinerama_query_screens_screen_info (const xcb_xinerama_query_screens_reply_t *R /**< */)
|
||||
{
|
||||
return (xcb_xinerama_screen_info_t *) (R + 1);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** int xcb_xinerama_query_screens_screen_info_length
|
||||
**
|
||||
** @param const xcb_xinerama_query_screens_reply_t *R
|
||||
** @returns int
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
int
|
||||
xcb_xinerama_query_screens_screen_info_length (const xcb_xinerama_query_screens_reply_t *R /**< */)
|
||||
{
|
||||
return R->number;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_screen_info_iterator_t xcb_xinerama_query_screens_screen_info_iterator
|
||||
**
|
||||
** @param const xcb_xinerama_query_screens_reply_t *R
|
||||
** @returns xcb_xinerama_screen_info_iterator_t
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_screen_info_iterator_t
|
||||
xcb_xinerama_query_screens_screen_info_iterator (const xcb_xinerama_query_screens_reply_t *R /**< */)
|
||||
{
|
||||
xcb_xinerama_screen_info_iterator_t i;
|
||||
i.data = (xcb_xinerama_screen_info_t *) (R + 1);
|
||||
i.rem = R->number;
|
||||
i.index = (char *) i.data - (char *) R;
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
**
|
||||
** xcb_xinerama_query_screens_reply_t * xcb_xinerama_query_screens_reply
|
||||
**
|
||||
** @param xcb_connection_t *c
|
||||
** @param xcb_xinerama_query_screens_cookie_t cookie
|
||||
** @param xcb_generic_error_t **e
|
||||
** @returns xcb_xinerama_query_screens_reply_t *
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
xcb_xinerama_query_screens_reply_t *
|
||||
xcb_xinerama_query_screens_reply (xcb_connection_t *c /**< */,
|
||||
xcb_xinerama_query_screens_cookie_t cookie /**< */,
|
||||
xcb_generic_error_t **e /**< */)
|
||||
{
|
||||
return (xcb_xinerama_query_screens_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
|
||||
}
|
||||
|
6
src/3rdparty/xcb/libxcb/xinput.c
vendored
6
src/3rdparty/xcb/libxcb/xinput.c
vendored
@ -10,11 +10,11 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <stddef.h> /* for offsetof() */
|
||||
#include "xcbext.h"
|
||||
#include "xinput.h"
|
||||
#include <xcb/xcbext.h>
|
||||
#include <xcb/xinput.h>
|
||||
|
||||
#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
|
||||
#include "xfixes.h"
|
||||
#include <xcb/xfixes.h>
|
||||
|
||||
xcb_extension_t xcb_input_id = { "XInputExtension", 0 };
|
||||
|
||||
|
15959
src/3rdparty/xcb/libxcb/xkb.c
vendored
15959
src/3rdparty/xcb/libxcb/xkb.c
vendored
File diff suppressed because it is too large
Load Diff
24
src/3rdparty/xcb/qt_attribution.json
vendored
24
src/3rdparty/xcb/qt_attribution.json
vendored
@ -1,24 +1,14 @@
|
||||
{
|
||||
"Id": "xcb",
|
||||
"Name": "XCB",
|
||||
"Id": "xcb-xinput",
|
||||
"Name": "XCB-XInput",
|
||||
"QDocModule": "qtgui",
|
||||
"QtUsage": "Optionally used in xcb platform plugin if configured with -qt-xcb.",
|
||||
|
||||
"Description": "Selected xcb libraries.",
|
||||
"QtUsage": "Used in XCB platform plugin if xcb-xinput was not present on the system
|
||||
during Qt configuration or -bundled-xcb-xinput switch was used. To force using xcb-xinput from
|
||||
the system, pass -no-bundled-xcb-xinput.",
|
||||
"Description": "XInput 2 extension for XCB (The X protocol C-language Binding) library.",
|
||||
"Homepage": "https://xcb.freedesktop.org/",
|
||||
"License": "MIT License",
|
||||
"LicenseId": "MIT",
|
||||
"LicenseFile": "LICENSE",
|
||||
"Copyright": "Copyright © 2000 Keith Packard
|
||||
Copyright © 2006 Jamey Sharp
|
||||
Copyright © 2007-2008 Vincent Torri <vtorri@univ-evry.fr>
|
||||
Copyright © 2007 Bart Massey
|
||||
Copyright © 2008-2009 Julien Danjou <julien@danjou.info>
|
||||
Copyright © 2008 Arnaud Fontaine <arnau@debian.org>
|
||||
Copyright © 2008 Bart Massey <bart@cs.pdx.edu>
|
||||
Copyright © 2008 Ian Osgood <iano@quirkster.com>
|
||||
Copyright © 2008 Jamey Sharp <jamey@minilop.net>
|
||||
Copyright © 2008 Josh Triplett <josh@freedesktop.org>
|
||||
Copyright © 2008 Ulrich Eckhardt <doomster@knuut.de>
|
||||
"
|
||||
"Copyright": "Copyright (C) Free Software Foundation, Inc."
|
||||
}
|
||||
|
1
src/3rdparty/xcb/sysinclude/render.h
vendored
1
src/3rdparty/xcb/sysinclude/render.h
vendored
@ -1 +0,0 @@
|
||||
#include <xcb/render.h>
|
1
src/3rdparty/xcb/sysinclude/xcb.h
vendored
1
src/3rdparty/xcb/sysinclude/xcb.h
vendored
@ -1 +0,0 @@
|
||||
#include <xcb/xcb.h>
|
1
src/3rdparty/xcb/sysinclude/xcbext.h
vendored
1
src/3rdparty/xcb/sysinclude/xcbext.h
vendored
@ -1 +0,0 @@
|
||||
#include <xcb/xcbext.h>
|
1
src/3rdparty/xcb/sysinclude/xproto.h
vendored
1
src/3rdparty/xcb/sysinclude/xproto.h
vendored
@ -1 +0,0 @@
|
||||
#include <xcb/xproto.h>
|
1011
src/3rdparty/xcb/xcb-util-image/xcb_image.c
vendored
1011
src/3rdparty/xcb/xcb-util-image/xcb_image.c
vendored
File diff suppressed because it is too large
Load Diff
498
src/3rdparty/xcb/xcb-util-keysyms/keysyms.c
vendored
498
src/3rdparty/xcb/xcb-util-keysyms/keysyms.c
vendored
@ -1,498 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2008 Ian Osgood <iano@quirkster.com>
|
||||
* Copyright © 2008 Jamey Sharp <jamey@minilop.net>
|
||||
* Copyright © 2008 Josh Triplett <josh@freedesktop.org>
|
||||
* Copyright © 2008 Ulrich Eckhardt <doomster@knuut.de>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
#define XK_MISCELLANY
|
||||
#define XK_XKB_KEYS
|
||||
#define XK_LATIN1
|
||||
#define XK_LATIN2
|
||||
#define XK_LATIN3
|
||||
#define XK_LATIN4
|
||||
#define XK_CYRILLIC
|
||||
#define XK_GREEK
|
||||
#define XK_ARMENIAN
|
||||
#include <X11/keysymdef.h>
|
||||
|
||||
#include "xcb_keysyms.h"
|
||||
|
||||
/* Private declaration */
|
||||
enum tag_t {
|
||||
TAG_COOKIE,
|
||||
TAG_VALUE
|
||||
};
|
||||
|
||||
struct _XCBKeySymbols
|
||||
{
|
||||
xcb_connection_t *c;
|
||||
enum tag_t tag;
|
||||
union {
|
||||
xcb_get_keyboard_mapping_cookie_t cookie;
|
||||
xcb_get_keyboard_mapping_reply_t *reply;
|
||||
} u;
|
||||
};
|
||||
|
||||
static void xcb_convert_case(xcb_keysym_t sym,
|
||||
xcb_keysym_t *lower,
|
||||
xcb_keysym_t *upper);
|
||||
|
||||
static void xcb_key_symbols_get_reply (xcb_key_symbols_t *syms,
|
||||
xcb_generic_error_t **e);
|
||||
|
||||
/* public implementation */
|
||||
|
||||
xcb_key_symbols_t *
|
||||
xcb_key_symbols_alloc (xcb_connection_t *c)
|
||||
{
|
||||
xcb_key_symbols_t *syms;
|
||||
xcb_keycode_t min_keycode;
|
||||
xcb_keycode_t max_keycode;
|
||||
|
||||
if (!c)
|
||||
return NULL;
|
||||
|
||||
syms = malloc (sizeof (xcb_key_symbols_t));
|
||||
if (!syms)
|
||||
return NULL;
|
||||
|
||||
syms->c = c;
|
||||
syms->tag = TAG_COOKIE;
|
||||
|
||||
min_keycode = xcb_get_setup (c)->min_keycode;
|
||||
max_keycode = xcb_get_setup (c)->max_keycode;
|
||||
|
||||
syms->u.cookie = xcb_get_keyboard_mapping(c,
|
||||
min_keycode,
|
||||
max_keycode - min_keycode + 1);
|
||||
|
||||
return syms;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_key_symbols_free (xcb_key_symbols_t *syms)
|
||||
{
|
||||
if (syms)
|
||||
{
|
||||
if (syms->tag == TAG_VALUE)
|
||||
free (syms->u.reply);
|
||||
free (syms);
|
||||
syms = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Use of the 'col' parameter:
|
||||
|
||||
A list of KeySyms is associated with each KeyCode. The list is intended
|
||||
to convey the set of symbols on the corresponding key. If the list
|
||||
(ignoring trailing NoSymbol entries) is a single KeySym ``K'', then the
|
||||
list is treated as if it were the list ``K NoSymbol K NoSymbol''. If the
|
||||
list (ignoring trailing NoSymbol entries) is a pair of KeySyms ``K1
|
||||
K2'', then the list is treated as if it were the list ``K1 K2 K1 K2''.
|
||||
If the list (ignoring trailing NoSymbol entries) is a triple of KeySyms
|
||||
``K1 K2 K3'', then the list is treated as if it were the list ``K1 K2 K3
|
||||
NoSymbol''. When an explicit ``void'' element is desired in the list,
|
||||
the value VoidSymbol can be used.
|
||||
|
||||
The first four elements of the list are split into two groups of
|
||||
KeySyms. Group 1 contains the first and second KeySyms; Group 2 contains
|
||||
the third and fourth KeySyms. Within each group, if the second element
|
||||
of the group is NoSymbol , then the group should be treated as if the
|
||||
second element were the same as the first element, except when the first
|
||||
element is an alphabetic KeySym ``K'' for which both lowercase and
|
||||
uppercase forms are defined. In that case, the group should be treated
|
||||
as if the first element were the lowercase form of ``K'' and the second
|
||||
element were the uppercase form of ``K.''
|
||||
|
||||
The standard rules for obtaining a KeySym from a KeyPress event make use
|
||||
of only the Group 1 and Group 2 KeySyms; no interpretation of other
|
||||
KeySyms in the list is given. Which group to use is determined by the
|
||||
modifier state. Switching between groups is controlled by the KeySym
|
||||
named MODE SWITCH, by attaching that KeySym to some KeyCode and
|
||||
attaching that KeyCode to any one of the modifiers Mod1 through Mod5.
|
||||
This modifier is called the group modifier. For any KeyCode, Group 1 is
|
||||
used when the group modifier is off, and Group 2 is used when the group
|
||||
modifier is on.
|
||||
|
||||
The Lock modifier is interpreted as CapsLock when the KeySym named
|
||||
XK_Caps_Lock is attached to some KeyCode and that KeyCode is attached to
|
||||
the Lock modifier. The Lock modifier is interpreted as ShiftLock when
|
||||
the KeySym named XK_Shift_Lock is attached to some KeyCode and that
|
||||
KeyCode is attached to the Lock modifier. If the Lock modifier could be
|
||||
interpreted as both CapsLock and ShiftLock, the CapsLock interpretation
|
||||
is used.
|
||||
|
||||
The operation of keypad keys is controlled by the KeySym named
|
||||
XK_Num_Lock, by attaching that KeySym to some KeyCode and attaching that
|
||||
KeyCode to any one of the modifiers Mod1 through Mod5 . This modifier is
|
||||
called the numlock modifier. The standard KeySyms with the prefix
|
||||
``XK_KP_'' in their name are called keypad KeySyms; these are KeySyms
|
||||
with numeric value in the hexadecimal range 0xFF80 to 0xFFBD inclusive.
|
||||
In addition, vendor-specific KeySyms in the hexadecimal range 0x11000000
|
||||
to 0x1100FFFF are also keypad KeySyms.
|
||||
|
||||
Within a group, the choice of KeySym is determined by applying the first
|
||||
rule that is satisfied from the following list:
|
||||
|
||||
* The numlock modifier is on and the second KeySym is a keypad KeySym. In
|
||||
this case, if the Shift modifier is on, or if the Lock modifier is on
|
||||
and is interpreted as ShiftLock, then the first KeySym is used,
|
||||
otherwise the second KeySym is used.
|
||||
|
||||
* The Shift and Lock modifiers are both off. In this case, the first
|
||||
KeySym is used.
|
||||
|
||||
* The Shift modifier is off, and the Lock modifier is on and is
|
||||
interpreted as CapsLock. In this case, the first KeySym is used, but
|
||||
if that KeySym is lowercase alphabetic, then the corresponding
|
||||
uppercase KeySym is used instead.
|
||||
|
||||
* The Shift modifier is on, and the Lock modifier is on and is
|
||||
interpreted as CapsLock. In this case, the second KeySym is used, but
|
||||
if that KeySym is lowercase alphabetic, then the corresponding
|
||||
uppercase KeySym is used instead.
|
||||
|
||||
* The Shift modifier is on, or the Lock modifier is on and is
|
||||
interpreted as ShiftLock, or both. In this case, the second KeySym is
|
||||
used.
|
||||
|
||||
*/
|
||||
|
||||
xcb_keysym_t xcb_key_symbols_get_keysym (xcb_key_symbols_t *syms,
|
||||
xcb_keycode_t keycode,
|
||||
int col)
|
||||
{
|
||||
xcb_keysym_t *keysyms;
|
||||
xcb_keysym_t keysym_null = { XCB_NO_SYMBOL };
|
||||
xcb_keysym_t lsym;
|
||||
xcb_keysym_t usym;
|
||||
xcb_keycode_t min_keycode;
|
||||
xcb_keycode_t max_keycode;
|
||||
int per;
|
||||
|
||||
if (!syms)
|
||||
return keysym_null;
|
||||
|
||||
xcb_key_symbols_get_reply (syms, NULL);
|
||||
|
||||
keysyms = xcb_get_keyboard_mapping_keysyms (syms->u.reply);
|
||||
min_keycode = xcb_get_setup (syms->c)->min_keycode;
|
||||
max_keycode = xcb_get_setup (syms->c)->max_keycode;
|
||||
|
||||
per = syms->u.reply->keysyms_per_keycode;
|
||||
if ((col < 0) || ((col >= per) && (col > 3)) ||
|
||||
(keycode < min_keycode) ||
|
||||
(keycode > max_keycode))
|
||||
return keysym_null;
|
||||
|
||||
keysyms = &keysyms[(keycode - min_keycode) * per];
|
||||
if (col < 4)
|
||||
{
|
||||
if (col > 1)
|
||||
{
|
||||
while ((per > 2) && (keysyms[per - 1] == XCB_NO_SYMBOL))
|
||||
per--;
|
||||
if (per < 3)
|
||||
col -= 2;
|
||||
}
|
||||
if ((per <= (col|1)) || (keysyms[col|1] == XCB_NO_SYMBOL))
|
||||
{
|
||||
xcb_convert_case(keysyms[col&~1], &lsym, &usym);
|
||||
if (!(col & 1))
|
||||
return lsym;
|
||||
else if (usym == lsym)
|
||||
return keysym_null;
|
||||
else
|
||||
return usym;
|
||||
}
|
||||
}
|
||||
return keysyms[col];
|
||||
}
|
||||
|
||||
xcb_keycode_t *
|
||||
xcb_key_symbols_get_keycode(xcb_key_symbols_t *syms,
|
||||
xcb_keysym_t keysym)
|
||||
{
|
||||
xcb_keysym_t ks;
|
||||
int j, nresult = 0;
|
||||
xcb_keycode_t i, min, max, *result = NULL, *result_np = NULL;
|
||||
|
||||
if(syms)
|
||||
{
|
||||
xcb_key_symbols_get_reply (syms, NULL);
|
||||
min = xcb_get_setup(syms->c)->min_keycode;
|
||||
max = xcb_get_setup(syms->c)->max_keycode;
|
||||
|
||||
for(j = 0; j < syms->u.reply->keysyms_per_keycode; j++)
|
||||
for(i = min; i && i <= max; i++)
|
||||
{
|
||||
ks = xcb_key_symbols_get_keysym(syms, i, j);
|
||||
if(ks == keysym)
|
||||
{
|
||||
nresult++;
|
||||
result_np = realloc(result,
|
||||
sizeof(xcb_keycode_t) * (nresult + 1));
|
||||
|
||||
if(result_np == NULL)
|
||||
{
|
||||
free(result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
result = result_np;
|
||||
result[nresult - 1] = i;
|
||||
result[nresult] = XCB_NO_SYMBOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
xcb_keysym_t
|
||||
xcb_key_press_lookup_keysym (xcb_key_symbols_t *syms,
|
||||
xcb_key_press_event_t *event,
|
||||
int col)
|
||||
{
|
||||
return xcb_key_symbols_get_keysym (syms, event->detail, col);
|
||||
}
|
||||
|
||||
xcb_keysym_t
|
||||
xcb_key_release_lookup_keysym (xcb_key_symbols_t *syms,
|
||||
xcb_key_release_event_t *event,
|
||||
int col)
|
||||
{
|
||||
return xcb_key_symbols_get_keysym (syms, event->detail, col);
|
||||
}
|
||||
|
||||
int
|
||||
xcb_refresh_keyboard_mapping (xcb_key_symbols_t *syms,
|
||||
xcb_mapping_notify_event_t *event)
|
||||
{
|
||||
if (event->request == XCB_MAPPING_KEYBOARD && syms) {
|
||||
if (syms->tag == TAG_VALUE) {
|
||||
xcb_keycode_t min_keycode;
|
||||
xcb_keycode_t max_keycode;
|
||||
|
||||
if (syms->u.reply) {
|
||||
free (syms->u.reply);
|
||||
syms->u.reply = NULL;
|
||||
}
|
||||
syms->tag = TAG_COOKIE;
|
||||
min_keycode = xcb_get_setup (syms->c)->min_keycode;
|
||||
max_keycode = xcb_get_setup (syms->c)->max_keycode;
|
||||
|
||||
syms->u.cookie = xcb_get_keyboard_mapping(syms->c,
|
||||
min_keycode,
|
||||
max_keycode - min_keycode + 1);
|
||||
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Tests for classes of symbols */
|
||||
|
||||
int
|
||||
xcb_is_keypad_key (xcb_keysym_t keysym)
|
||||
{
|
||||
return ((keysym >= XK_KP_Space) && (keysym <= XK_KP_Equal));
|
||||
}
|
||||
|
||||
int
|
||||
xcb_is_private_keypad_key (xcb_keysym_t keysym)
|
||||
{
|
||||
return ((keysym >= 0x11000000) && (keysym <= 0x1100FFFF));
|
||||
}
|
||||
|
||||
int
|
||||
xcb_is_cursor_key (xcb_keysym_t keysym)
|
||||
{
|
||||
return ((keysym >= XK_Home) && (keysym <= XK_Select));
|
||||
}
|
||||
|
||||
int
|
||||
xcb_is_pf_key (xcb_keysym_t keysym)
|
||||
{
|
||||
return ((keysym >= XK_KP_F1) && (keysym <= XK_KP_F4));
|
||||
}
|
||||
|
||||
int
|
||||
xcb_is_function_key (xcb_keysym_t keysym)
|
||||
{
|
||||
return ((keysym >= XK_F1) && (keysym <= XK_F35));
|
||||
}
|
||||
|
||||
int
|
||||
xcb_is_misc_function_key (xcb_keysym_t keysym)
|
||||
{
|
||||
return ((keysym >= XK_Select) && (keysym <= XK_Break));
|
||||
}
|
||||
|
||||
int
|
||||
xcb_is_modifier_key (xcb_keysym_t keysym)
|
||||
{
|
||||
return (((keysym >= XK_Shift_L) && (keysym <= XK_Hyper_R)) ||
|
||||
((keysym >= XK_ISO_Lock) && (keysym <= XK_ISO_Level5_Lock)) ||
|
||||
(keysym == XK_Mode_switch) ||
|
||||
(keysym == XK_Num_Lock));
|
||||
}
|
||||
|
||||
/* private functions */
|
||||
|
||||
void
|
||||
xcb_convert_case(xcb_keysym_t sym,
|
||||
xcb_keysym_t *lower,
|
||||
xcb_keysym_t *upper)
|
||||
{
|
||||
*lower = sym;
|
||||
*upper = sym;
|
||||
|
||||
switch(sym >> 8)
|
||||
{
|
||||
case 0: /* Latin 1 */
|
||||
if ((sym >= XK_A) && (sym <= XK_Z))
|
||||
*lower += (XK_a - XK_A);
|
||||
else if ((sym >= XK_a) && (sym <= XK_z))
|
||||
*upper -= (XK_a - XK_A);
|
||||
else if ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis))
|
||||
*lower += (XK_agrave - XK_Agrave);
|
||||
else if ((sym >= XK_agrave) && (sym <= XK_odiaeresis))
|
||||
*upper -= (XK_agrave - XK_Agrave);
|
||||
else if ((sym >= XK_Ooblique) && (sym <= XK_Thorn))
|
||||
*lower += (XK_oslash - XK_Ooblique);
|
||||
else if ((sym >= XK_oslash) && (sym <= XK_thorn))
|
||||
*upper -= (XK_oslash - XK_Ooblique);
|
||||
break;
|
||||
case 1: /* Latin 2 */
|
||||
/* Assume the KeySym is a legal value (ignore discontinuities) */
|
||||
if (sym == XK_Aogonek)
|
||||
*lower = XK_aogonek;
|
||||
else if (sym >= XK_Lstroke && sym <= XK_Sacute)
|
||||
*lower += (XK_lstroke - XK_Lstroke);
|
||||
else if (sym >= XK_Scaron && sym <= XK_Zacute)
|
||||
*lower += (XK_scaron - XK_Scaron);
|
||||
else if (sym >= XK_Zcaron && sym <= XK_Zabovedot)
|
||||
*lower += (XK_zcaron - XK_Zcaron);
|
||||
else if (sym == XK_aogonek)
|
||||
*upper = XK_Aogonek;
|
||||
else if (sym >= XK_lstroke && sym <= XK_sacute)
|
||||
*upper -= (XK_lstroke - XK_Lstroke);
|
||||
else if (sym >= XK_scaron && sym <= XK_zacute)
|
||||
*upper -= (XK_scaron - XK_Scaron);
|
||||
else if (sym >= XK_zcaron && sym <= XK_zabovedot)
|
||||
*upper -= (XK_zcaron - XK_Zcaron);
|
||||
else if (sym >= XK_Racute && sym <= XK_Tcedilla)
|
||||
*lower += (XK_racute - XK_Racute);
|
||||
else if (sym >= XK_racute && sym <= XK_tcedilla)
|
||||
*upper -= (XK_racute - XK_Racute);
|
||||
break;
|
||||
case 2: /* Latin 3 */
|
||||
/* Assume the KeySym is a legal value (ignore discontinuities) */
|
||||
if (sym >= XK_Hstroke && sym <= XK_Hcircumflex)
|
||||
*lower += (XK_hstroke - XK_Hstroke);
|
||||
else if (sym >= XK_Gbreve && sym <= XK_Jcircumflex)
|
||||
*lower += (XK_gbreve - XK_Gbreve);
|
||||
else if (sym >= XK_hstroke && sym <= XK_hcircumflex)
|
||||
*upper -= (XK_hstroke - XK_Hstroke);
|
||||
else if (sym >= XK_gbreve && sym <= XK_jcircumflex)
|
||||
*upper -= (XK_gbreve - XK_Gbreve);
|
||||
else if (sym >= XK_Cabovedot && sym <= XK_Scircumflex)
|
||||
*lower += (XK_cabovedot - XK_Cabovedot);
|
||||
else if (sym >= XK_cabovedot && sym <= XK_scircumflex)
|
||||
*upper -= (XK_cabovedot - XK_Cabovedot);
|
||||
break;
|
||||
case 3: /* Latin 4 */
|
||||
/* Assume the KeySym is a legal value (ignore discontinuities) */
|
||||
if (sym >= XK_Rcedilla && sym <= XK_Tslash)
|
||||
*lower += (XK_rcedilla - XK_Rcedilla);
|
||||
else if (sym >= XK_rcedilla && sym <= XK_tslash)
|
||||
*upper -= (XK_rcedilla - XK_Rcedilla);
|
||||
else if (sym == XK_ENG)
|
||||
*lower = XK_eng;
|
||||
else if (sym == XK_eng)
|
||||
*upper = XK_ENG;
|
||||
else if (sym >= XK_Amacron && sym <= XK_Umacron)
|
||||
*lower += (XK_amacron - XK_Amacron);
|
||||
else if (sym >= XK_amacron && sym <= XK_umacron)
|
||||
*upper -= (XK_amacron - XK_Amacron);
|
||||
break;
|
||||
case 6: /* Cyrillic */
|
||||
/* Assume the KeySym is a legal value (ignore discontinuities) */
|
||||
if (sym >= XK_Serbian_DJE && sym <= XK_Serbian_DZE)
|
||||
*lower -= (XK_Serbian_DJE - XK_Serbian_dje);
|
||||
else if (sym >= XK_Serbian_dje && sym <= XK_Serbian_dze)
|
||||
*upper += (XK_Serbian_DJE - XK_Serbian_dje);
|
||||
else if (sym >= XK_Cyrillic_YU && sym <= XK_Cyrillic_HARDSIGN)
|
||||
*lower -= (XK_Cyrillic_YU - XK_Cyrillic_yu);
|
||||
else if (sym >= XK_Cyrillic_yu && sym <= XK_Cyrillic_hardsign)
|
||||
*upper += (XK_Cyrillic_YU - XK_Cyrillic_yu);
|
||||
break;
|
||||
case 7: /* Greek */
|
||||
/* Assume the KeySym is a legal value (ignore discontinuities) */
|
||||
if (sym >= XK_Greek_ALPHAaccent && sym <= XK_Greek_OMEGAaccent)
|
||||
*lower += (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
|
||||
else if (sym >= XK_Greek_alphaaccent && sym <= XK_Greek_omegaaccent &&
|
||||
sym != XK_Greek_iotaaccentdieresis &&
|
||||
sym != XK_Greek_upsilonaccentdieresis)
|
||||
*upper -= (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
|
||||
else if (sym >= XK_Greek_ALPHA && sym <= XK_Greek_OMEGA)
|
||||
*lower += (XK_Greek_alpha - XK_Greek_ALPHA);
|
||||
else if (sym >= XK_Greek_alpha && sym <= XK_Greek_omega &&
|
||||
sym != XK_Greek_finalsmallsigma)
|
||||
*upper -= (XK_Greek_alpha - XK_Greek_ALPHA);
|
||||
break;
|
||||
case 0x14: /* Armenian */
|
||||
if (sym >= XK_Armenian_AYB && sym <= XK_Armenian_fe) {
|
||||
*lower = sym | 1;
|
||||
*upper = sym & ~1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
xcb_key_symbols_get_reply (xcb_key_symbols_t *syms,
|
||||
xcb_generic_error_t **e)
|
||||
{
|
||||
if (!syms)
|
||||
return;
|
||||
|
||||
if (syms->tag == TAG_COOKIE)
|
||||
{
|
||||
syms->tag = TAG_VALUE;
|
||||
syms->u.reply = xcb_get_keyboard_mapping_reply(syms->c,
|
||||
syms->u.cookie,
|
||||
e);
|
||||
}
|
||||
}
|
255
src/3rdparty/xcb/xcb-util-renderutil/util.c
vendored
255
src/3rdparty/xcb/xcb-util-renderutil/util.c
vendored
@ -1,255 +0,0 @@
|
||||
/* Copyright © 2000 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Keith Packard not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Keith Packard makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xcb_renderutil.h"
|
||||
|
||||
xcb_render_pictvisual_t *
|
||||
xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t *formats,
|
||||
const xcb_visualid_t visual)
|
||||
{
|
||||
xcb_render_pictscreen_iterator_t screens;
|
||||
xcb_render_pictdepth_iterator_t depths;
|
||||
xcb_render_pictvisual_iterator_t visuals;
|
||||
if (!formats)
|
||||
return 0;
|
||||
for (screens = xcb_render_query_pict_formats_screens_iterator(formats); screens.rem; xcb_render_pictscreen_next(&screens))
|
||||
for (depths = xcb_render_pictscreen_depths_iterator(screens.data); depths.rem; xcb_render_pictdepth_next(&depths))
|
||||
for (visuals = xcb_render_pictdepth_visuals_iterator(depths.data); visuals.rem; xcb_render_pictvisual_next(&visuals))
|
||||
if (visuals.data->visual == visual)
|
||||
return visuals.data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
xcb_render_pictforminfo_t *
|
||||
xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats,
|
||||
unsigned long mask,
|
||||
const xcb_render_pictforminfo_t *ptemplate,
|
||||
int count)
|
||||
{
|
||||
xcb_render_pictforminfo_iterator_t i;
|
||||
if (!formats)
|
||||
return 0;
|
||||
for (i = xcb_render_query_pict_formats_formats_iterator(formats); i.rem; xcb_render_pictforminfo_next(&i))
|
||||
{
|
||||
if (mask & XCB_PICT_FORMAT_ID)
|
||||
if (ptemplate->id != i.data->id)
|
||||
continue;
|
||||
if (mask & XCB_PICT_FORMAT_TYPE)
|
||||
if (ptemplate->type != i.data->type)
|
||||
continue;
|
||||
if (mask & XCB_PICT_FORMAT_DEPTH)
|
||||
if (ptemplate->depth != i.data->depth)
|
||||
continue;
|
||||
if (mask & XCB_PICT_FORMAT_RED)
|
||||
if (ptemplate->direct.red_shift != i.data->direct.red_shift)
|
||||
continue;
|
||||
if (mask & XCB_PICT_FORMAT_RED_MASK)
|
||||
if (ptemplate->direct.red_mask != i.data->direct.red_mask)
|
||||
continue;
|
||||
if (mask & XCB_PICT_FORMAT_GREEN)
|
||||
if (ptemplate->direct.green_shift != i.data->direct.green_shift)
|
||||
continue;
|
||||
if (mask & XCB_PICT_FORMAT_GREEN_MASK)
|
||||
if (ptemplate->direct.green_mask != i.data->direct.green_mask)
|
||||
continue;
|
||||
if (mask & XCB_PICT_FORMAT_BLUE)
|
||||
if (ptemplate->direct.blue_shift != i.data->direct.blue_shift)
|
||||
continue;
|
||||
if (mask & XCB_PICT_FORMAT_BLUE_MASK)
|
||||
if (ptemplate->direct.blue_mask != i.data->direct.blue_mask)
|
||||
continue;
|
||||
if (mask & XCB_PICT_FORMAT_ALPHA)
|
||||
if (ptemplate->direct.alpha_shift != i.data->direct.alpha_shift)
|
||||
continue;
|
||||
if (mask & XCB_PICT_FORMAT_ALPHA_MASK)
|
||||
if (ptemplate->direct.alpha_mask != i.data->direct.alpha_mask)
|
||||
continue;
|
||||
if (mask & XCB_PICT_FORMAT_COLORMAP)
|
||||
if (ptemplate->colormap != i.data->colormap)
|
||||
continue;
|
||||
if (count-- == 0)
|
||||
return i.data;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
xcb_render_pictforminfo_t *
|
||||
xcb_render_util_find_standard_format (const xcb_render_query_pict_formats_reply_t *formats,
|
||||
xcb_pict_standard_t format)
|
||||
{
|
||||
static const struct {
|
||||
xcb_render_pictforminfo_t templ;
|
||||
unsigned long mask;
|
||||
} standardFormats[] = {
|
||||
/* XCB_PICT_STANDARD_ARGB_32 */
|
||||
{
|
||||
{
|
||||
0, /* id */
|
||||
XCB_RENDER_PICT_TYPE_DIRECT, /* type */
|
||||
32, /* depth */
|
||||
{ 0 }, /* pad */
|
||||
{ /* direct */
|
||||
16, /* direct.red */
|
||||
0xff, /* direct.red_mask */
|
||||
8, /* direct.green */
|
||||
0xff, /* direct.green_mask */
|
||||
0, /* direct.blue */
|
||||
0xff, /* direct.blue_mask */
|
||||
24, /* direct.alpha */
|
||||
0xff, /* direct.alpha_mask */
|
||||
},
|
||||
0, /* colormap */
|
||||
},
|
||||
XCB_PICT_FORMAT_TYPE |
|
||||
XCB_PICT_FORMAT_DEPTH |
|
||||
XCB_PICT_FORMAT_RED |
|
||||
XCB_PICT_FORMAT_RED_MASK |
|
||||
XCB_PICT_FORMAT_GREEN |
|
||||
XCB_PICT_FORMAT_GREEN_MASK |
|
||||
XCB_PICT_FORMAT_BLUE |
|
||||
XCB_PICT_FORMAT_BLUE_MASK |
|
||||
XCB_PICT_FORMAT_ALPHA |
|
||||
XCB_PICT_FORMAT_ALPHA_MASK,
|
||||
},
|
||||
/* XCB_PICT_STANDARD_RGB_24 */
|
||||
{
|
||||
{
|
||||
0, /* id */
|
||||
XCB_RENDER_PICT_TYPE_DIRECT, /* type */
|
||||
24, /* depth */
|
||||
{ 0 }, /* pad */
|
||||
{ /* direct */
|
||||
16, /* direct.red */
|
||||
0xff, /* direct.red_MASK */
|
||||
8, /* direct.green */
|
||||
0xff, /* direct.green_MASK */
|
||||
0, /* direct.blue */
|
||||
0xff, /* direct.blue_MASK */
|
||||
0, /* direct.alpha */
|
||||
0x00, /* direct.alpha_MASK */
|
||||
},
|
||||
0, /* colormap */
|
||||
},
|
||||
XCB_PICT_FORMAT_TYPE |
|
||||
XCB_PICT_FORMAT_DEPTH |
|
||||
XCB_PICT_FORMAT_RED |
|
||||
XCB_PICT_FORMAT_RED_MASK |
|
||||
XCB_PICT_FORMAT_GREEN |
|
||||
XCB_PICT_FORMAT_GREEN_MASK |
|
||||
XCB_PICT_FORMAT_BLUE |
|
||||
XCB_PICT_FORMAT_BLUE_MASK |
|
||||
XCB_PICT_FORMAT_ALPHA_MASK,
|
||||
},
|
||||
/* XCB_PICT_STANDARD_A_8 */
|
||||
{
|
||||
{
|
||||
0, /* id */
|
||||
XCB_RENDER_PICT_TYPE_DIRECT, /* type */
|
||||
8, /* depth */
|
||||
{ 0 }, /* pad */
|
||||
{ /* direct */
|
||||
0, /* direct.red */
|
||||
0x00, /* direct.red_MASK */
|
||||
0, /* direct.green */
|
||||
0x00, /* direct.green_MASK */
|
||||
0, /* direct.blue */
|
||||
0x00, /* direct.blue_MASK */
|
||||
0, /* direct.alpha */
|
||||
0xff, /* direct.alpha_MASK */
|
||||
},
|
||||
0, /* colormap */
|
||||
},
|
||||
XCB_PICT_FORMAT_TYPE |
|
||||
XCB_PICT_FORMAT_DEPTH |
|
||||
XCB_PICT_FORMAT_RED_MASK |
|
||||
XCB_PICT_FORMAT_GREEN_MASK |
|
||||
XCB_PICT_FORMAT_BLUE_MASK |
|
||||
XCB_PICT_FORMAT_ALPHA |
|
||||
XCB_PICT_FORMAT_ALPHA_MASK,
|
||||
},
|
||||
/* XCB_PICT_STANDARD_A_4 */
|
||||
{
|
||||
{
|
||||
0, /* id */
|
||||
XCB_RENDER_PICT_TYPE_DIRECT, /* type */
|
||||
4, /* depth */
|
||||
{ 0 }, /* pad */
|
||||
{ /* direct */
|
||||
0, /* direct.red */
|
||||
0x00, /* direct.red_MASK */
|
||||
0, /* direct.green */
|
||||
0x00, /* direct.green_MASK */
|
||||
0, /* direct.blue */
|
||||
0x00, /* direct.blue_MASK */
|
||||
0, /* direct.alpha */
|
||||
0x0f, /* direct.alpha_MASK */
|
||||
},
|
||||
0, /* colormap */
|
||||
},
|
||||
XCB_PICT_FORMAT_TYPE |
|
||||
XCB_PICT_FORMAT_DEPTH |
|
||||
XCB_PICT_FORMAT_RED_MASK |
|
||||
XCB_PICT_FORMAT_GREEN_MASK |
|
||||
XCB_PICT_FORMAT_BLUE_MASK |
|
||||
XCB_PICT_FORMAT_ALPHA |
|
||||
XCB_PICT_FORMAT_ALPHA_MASK,
|
||||
},
|
||||
/* XCB_PICT_STANDARD_A_1 */
|
||||
{
|
||||
{
|
||||
0, /* id */
|
||||
XCB_RENDER_PICT_TYPE_DIRECT, /* type */
|
||||
1, /* depth */
|
||||
{ 0 }, /* pad */
|
||||
{ /* direct */
|
||||
0, /* direct.red */
|
||||
0x00, /* direct.red_MASK */
|
||||
0, /* direct.green */
|
||||
0x00, /* direct.green_MASK */
|
||||
0, /* direct.blue */
|
||||
0x00, /* direct.blue_MASK */
|
||||
0, /* direct.alpha */
|
||||
0x01, /* direct.alpha_MASK */
|
||||
},
|
||||
0, /* colormap */
|
||||
},
|
||||
XCB_PICT_FORMAT_TYPE |
|
||||
XCB_PICT_FORMAT_DEPTH |
|
||||
XCB_PICT_FORMAT_RED_MASK |
|
||||
XCB_PICT_FORMAT_GREEN_MASK |
|
||||
XCB_PICT_FORMAT_BLUE_MASK |
|
||||
XCB_PICT_FORMAT_ALPHA |
|
||||
XCB_PICT_FORMAT_ALPHA_MASK,
|
||||
},
|
||||
};
|
||||
|
||||
if (format < 0 || format >= sizeof(standardFormats) / sizeof(*standardFormats))
|
||||
return 0;
|
||||
|
||||
return xcb_render_util_find_format (formats,
|
||||
standardFormats[format].mask,
|
||||
&standardFormats[format].templ,
|
||||
0);
|
||||
}
|
845
src/3rdparty/xcb/xcb-util-wm/icccm.c
vendored
845
src/3rdparty/xcb/xcb-util-wm/icccm.c
vendored
@ -1,845 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2008 Arnaud Fontaine <arnau@debian.org>
|
||||
* Copyright © 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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#include "xcb_icccm.h"
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_text_property(xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
xcb_atom_t property)
|
||||
{
|
||||
return xcb_get_property(c, 0, window, property, XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_text_property_unchecked(xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
xcb_atom_t property)
|
||||
{
|
||||
return xcb_get_property_unchecked(c, 0, window, property, XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_text_property_reply(xcb_connection_t *c,
|
||||
xcb_get_property_cookie_t cookie,
|
||||
xcb_icccm_get_text_property_reply_t *prop,
|
||||
xcb_generic_error_t **e)
|
||||
{
|
||||
xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e);
|
||||
|
||||
if(!reply || reply->type == XCB_NONE) {
|
||||
free(reply);
|
||||
return 0;
|
||||
}
|
||||
|
||||
prop->_reply = reply;
|
||||
prop->encoding = prop->_reply->type;
|
||||
prop->format = prop->_reply->format;
|
||||
prop->name_len = xcb_get_property_value_length(prop->_reply);
|
||||
prop->name = xcb_get_property_value(prop->_reply);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_get_text_property_reply_wipe(xcb_icccm_get_text_property_reply_t *prop)
|
||||
{
|
||||
free(prop->_reply);
|
||||
}
|
||||
|
||||
/* WM_NAME */
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_name_checked(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_atom_t encoding, uint8_t format,
|
||||
uint32_t name_len, const char *name)
|
||||
{
|
||||
return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window,
|
||||
XCB_ATOM_WM_NAME, encoding, format,
|
||||
name_len, name);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_name(xcb_connection_t *c, xcb_window_t window, xcb_atom_t encoding,
|
||||
uint8_t format, uint32_t name_len, const char *name)
|
||||
{
|
||||
return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window,
|
||||
XCB_ATOM_WM_NAME, encoding, format, name_len,
|
||||
name);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_name(xcb_connection_t *c,
|
||||
xcb_window_t window)
|
||||
{
|
||||
return xcb_icccm_get_text_property(c, window, XCB_ATOM_WM_NAME);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_name_unchecked(xcb_connection_t *c,
|
||||
xcb_window_t window)
|
||||
{
|
||||
return xcb_icccm_get_text_property_unchecked(c, window, XCB_ATOM_WM_NAME);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_name_reply(xcb_connection_t *c,
|
||||
xcb_get_property_cookie_t cookie,
|
||||
xcb_icccm_get_text_property_reply_t *prop,
|
||||
xcb_generic_error_t **e)
|
||||
{
|
||||
return xcb_icccm_get_text_property_reply(c, cookie, prop, e);
|
||||
}
|
||||
|
||||
/* WM_ICON_NAME */
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_icon_name_checked(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_atom_t encoding, uint8_t format,
|
||||
uint32_t name_len, const char *name)
|
||||
{
|
||||
return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window,
|
||||
XCB_ATOM_WM_ICON_NAME, encoding, format,
|
||||
name_len, name);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_icon_name(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_atom_t encoding, uint8_t format, uint32_t name_len,
|
||||
const char *name)
|
||||
{
|
||||
return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window,
|
||||
XCB_ATOM_WM_ICON_NAME, encoding, format,
|
||||
name_len, name);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_icon_name(xcb_connection_t *c,
|
||||
xcb_window_t window)
|
||||
{
|
||||
return xcb_icccm_get_text_property(c, window, XCB_ATOM_WM_ICON_NAME);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_icon_name_unchecked(xcb_connection_t *c,
|
||||
xcb_window_t window)
|
||||
{
|
||||
return xcb_icccm_get_text_property_unchecked(c, window, XCB_ATOM_WM_ICON_NAME);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_icon_name_reply(xcb_connection_t *c,
|
||||
xcb_get_property_cookie_t cookie,
|
||||
xcb_icccm_get_text_property_reply_t *prop,
|
||||
xcb_generic_error_t **e)
|
||||
{
|
||||
return xcb_icccm_get_text_property_reply(c, cookie, prop, e);
|
||||
}
|
||||
|
||||
/* WM_COLORMAP_WINDOWS */
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_colormap_windows_checked(xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
xcb_atom_t wm_colormap_windows_atom,
|
||||
uint32_t list_len,
|
||||
const xcb_window_t *list)
|
||||
{
|
||||
return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window,
|
||||
wm_colormap_windows_atom, XCB_ATOM_WINDOW,
|
||||
32, list_len, list);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_colormap_windows(xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
xcb_atom_t wm_colormap_windows_atom,
|
||||
uint32_t list_len,
|
||||
const xcb_atom_t *list)
|
||||
{
|
||||
return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window,
|
||||
wm_colormap_windows_atom, XCB_ATOM_WINDOW, 32,
|
||||
list_len, list);
|
||||
}
|
||||
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_colormap_windows(xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
xcb_atom_t wm_colormap_windows_atom )
|
||||
{
|
||||
return xcb_get_property(c, 0, window, wm_colormap_windows_atom,
|
||||
XCB_ATOM_WINDOW, 0, UINT_MAX);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_colormap_windows_unchecked(xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
xcb_atom_t wm_colormap_windows_atom)
|
||||
{
|
||||
return xcb_get_property_unchecked(c, 0, window, wm_colormap_windows_atom,
|
||||
XCB_ATOM_WINDOW, 0, UINT_MAX);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_colormap_windows_from_reply(xcb_get_property_reply_t *reply,
|
||||
xcb_icccm_get_wm_colormap_windows_reply_t *colormap_windows)
|
||||
{
|
||||
if(!reply || reply->type != XCB_ATOM_WINDOW || reply->format != 32)
|
||||
return 0;
|
||||
|
||||
colormap_windows->_reply = reply;
|
||||
colormap_windows->windows_len = xcb_get_property_value_length(colormap_windows->_reply) / (reply->format / 8);
|
||||
colormap_windows->windows = (xcb_window_t *) xcb_get_property_value(colormap_windows->_reply);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_colormap_windows_reply(xcb_connection_t *c,
|
||||
xcb_get_property_cookie_t cookie,
|
||||
xcb_icccm_get_wm_colormap_windows_reply_t *colormap_windows,
|
||||
xcb_generic_error_t **e)
|
||||
{
|
||||
xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e);
|
||||
uint8_t ret = xcb_icccm_get_wm_colormap_windows_from_reply(reply, colormap_windows);
|
||||
if(!ret)
|
||||
free(reply);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_get_wm_colormap_windows_reply_wipe(xcb_icccm_get_wm_colormap_windows_reply_t *colormap_windows)
|
||||
{
|
||||
free(colormap_windows->_reply);
|
||||
}
|
||||
|
||||
/* WM_CLIENT_MACHINE */
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_client_machine_checked(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_atom_t encoding, uint8_t format,
|
||||
uint32_t name_len, const char *name)
|
||||
{
|
||||
return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window,
|
||||
XCB_ATOM_WM_CLIENT_MACHINE, encoding,
|
||||
format, name_len, name);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_client_machine(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_atom_t encoding, uint8_t format,
|
||||
uint32_t name_len, const char *name)
|
||||
{
|
||||
return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window,
|
||||
XCB_ATOM_WM_CLIENT_MACHINE, encoding, format,
|
||||
name_len, name);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_client_machine(xcb_connection_t *c,
|
||||
xcb_window_t window)
|
||||
{
|
||||
return xcb_icccm_get_text_property(c, window, XCB_ATOM_WM_CLIENT_MACHINE);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_client_machine_unchecked(xcb_connection_t *c,
|
||||
xcb_window_t window)
|
||||
{
|
||||
return xcb_icccm_get_text_property_unchecked(c, window, XCB_ATOM_WM_CLIENT_MACHINE);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_client_machine_reply(xcb_connection_t *c,
|
||||
xcb_get_property_cookie_t cookie,
|
||||
xcb_icccm_get_text_property_reply_t *prop,
|
||||
xcb_generic_error_t **e)
|
||||
{
|
||||
return xcb_icccm_get_text_property_reply(c, cookie, prop, e);
|
||||
}
|
||||
|
||||
/* WM_CLASS */
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_class_checked(xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
uint32_t class_len,
|
||||
const char *class)
|
||||
{
|
||||
return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window,
|
||||
XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 8,
|
||||
class_len, class);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_class(xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
uint32_t class_len,
|
||||
const char *class)
|
||||
{
|
||||
return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window,
|
||||
XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 8,
|
||||
class_len, class);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_class(xcb_connection_t *c, xcb_window_t window)
|
||||
{
|
||||
return xcb_get_property(c, 0, window, XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 0L, 2048L);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_class_unchecked(xcb_connection_t *c, xcb_window_t window)
|
||||
{
|
||||
return xcb_get_property_unchecked(c, 0, window, XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 0L, 2048L);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_class_from_reply(xcb_icccm_get_wm_class_reply_t *prop,
|
||||
xcb_get_property_reply_t *reply)
|
||||
{
|
||||
if(!reply || reply->type != XCB_ATOM_STRING || reply->format != 8)
|
||||
return 0;
|
||||
|
||||
prop->_reply = reply;
|
||||
prop->instance_name = (char *) xcb_get_property_value(prop->_reply);
|
||||
|
||||
int len = xcb_get_property_value_length(prop->_reply);
|
||||
/* Ensure there's a C end-of-string at the end of the property.
|
||||
Truncate the property if necessary (the spec says there's already
|
||||
a 0 in the last position, so this only hurts invalid props). */
|
||||
if(len < reply->length * 4)
|
||||
prop->instance_name[len] = 0;
|
||||
else
|
||||
prop->instance_name[len-1] = 0;
|
||||
|
||||
int name_len = strlen(prop->instance_name);
|
||||
if(name_len == len)
|
||||
name_len--;
|
||||
|
||||
prop->class_name = prop->instance_name + name_len + 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_class_reply(xcb_connection_t *c, xcb_get_property_cookie_t cookie,
|
||||
xcb_icccm_get_wm_class_reply_t *prop, xcb_generic_error_t **e)
|
||||
{
|
||||
xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e);
|
||||
uint8_t ret = xcb_icccm_get_wm_class_from_reply(prop, reply);
|
||||
/* if reply parsing failed, free the reply to avoid mem leak */
|
||||
if(!ret)
|
||||
free(reply);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_get_wm_class_reply_wipe(xcb_icccm_get_wm_class_reply_t *prop)
|
||||
{
|
||||
free(prop->_reply);
|
||||
}
|
||||
|
||||
/* WM_TRANSIENT_FOR */
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_transient_for_checked(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_window_t transient_for_window)
|
||||
{
|
||||
return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window,
|
||||
XCB_ATOM_WM_TRANSIENT_FOR,
|
||||
XCB_ATOM_WINDOW, 32, 1,
|
||||
&transient_for_window);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_transient_for(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_window_t transient_for_window)
|
||||
{
|
||||
return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window,
|
||||
XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 32,
|
||||
1, &transient_for_window);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_transient_for(xcb_connection_t *c, xcb_window_t window)
|
||||
{
|
||||
return xcb_get_property(c, 0, window, XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 0, 1);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_transient_for_unchecked(xcb_connection_t *c, xcb_window_t window)
|
||||
{
|
||||
return xcb_get_property_unchecked(c, 0, window, XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 0, 1);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_transient_for_from_reply(xcb_window_t *prop,
|
||||
xcb_get_property_reply_t *reply)
|
||||
{
|
||||
if(!reply || reply->type != XCB_ATOM_WINDOW || reply->format != 32 || !reply->length)
|
||||
return 0;
|
||||
|
||||
*prop = *((xcb_window_t *) xcb_get_property_value(reply));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_transient_for_reply(xcb_connection_t *c,
|
||||
xcb_get_property_cookie_t cookie,
|
||||
xcb_window_t *prop,
|
||||
xcb_generic_error_t **e)
|
||||
{
|
||||
xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e);
|
||||
uint8_t ret = xcb_icccm_get_wm_transient_for_from_reply(prop, reply);
|
||||
free(reply);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* WM_SIZE_HINTS */
|
||||
|
||||
void
|
||||
xcb_icccm_size_hints_set_position(xcb_size_hints_t *hints, int user_specified,
|
||||
int32_t x, int32_t y)
|
||||
{
|
||||
hints->flags &= ~(XCB_ICCCM_SIZE_HINT_US_POSITION | XCB_ICCCM_SIZE_HINT_P_POSITION);
|
||||
if (user_specified)
|
||||
hints->flags |= XCB_ICCCM_SIZE_HINT_US_POSITION;
|
||||
else
|
||||
hints->flags |= XCB_ICCCM_SIZE_HINT_P_POSITION;
|
||||
hints->x = x;
|
||||
hints->y = y;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_size_hints_set_size(xcb_size_hints_t *hints, int user_specified,
|
||||
int32_t width, int32_t height)
|
||||
{
|
||||
hints->flags &= ~(XCB_ICCCM_SIZE_HINT_US_SIZE | XCB_ICCCM_SIZE_HINT_P_SIZE);
|
||||
if (user_specified)
|
||||
hints->flags |= XCB_ICCCM_SIZE_HINT_US_SIZE;
|
||||
else
|
||||
hints->flags |= XCB_ICCCM_SIZE_HINT_P_SIZE;
|
||||
hints->width = width;
|
||||
hints->height = height;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_size_hints_set_min_size(xcb_size_hints_t *hints, int32_t min_width,
|
||||
int32_t min_height)
|
||||
{
|
||||
hints->flags |= XCB_ICCCM_SIZE_HINT_P_MIN_SIZE;
|
||||
hints->min_width = min_width;
|
||||
hints->min_height = min_height;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_size_hints_set_max_size(xcb_size_hints_t *hints, int32_t max_width,
|
||||
int32_t max_height)
|
||||
{
|
||||
hints->flags |= XCB_ICCCM_SIZE_HINT_P_MAX_SIZE;
|
||||
hints->max_width = max_width;
|
||||
hints->max_height = max_height;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_size_hints_set_resize_inc(xcb_size_hints_t *hints, int32_t width_inc,
|
||||
int32_t height_inc)
|
||||
{
|
||||
hints->flags |= XCB_ICCCM_SIZE_HINT_P_RESIZE_INC;
|
||||
hints->width_inc = width_inc;
|
||||
hints->height_inc = height_inc;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_size_hints_set_aspect(xcb_size_hints_t *hints, int32_t min_aspect_num,
|
||||
int32_t min_aspect_den, int32_t max_aspect_num,
|
||||
int32_t max_aspect_den)
|
||||
{
|
||||
hints->flags |= XCB_ICCCM_SIZE_HINT_P_ASPECT;
|
||||
hints->min_aspect_num = min_aspect_num;
|
||||
hints->min_aspect_den = min_aspect_den;
|
||||
hints->max_aspect_num = max_aspect_num;
|
||||
hints->max_aspect_den = max_aspect_den;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_size_hints_set_base_size(xcb_size_hints_t *hints, int32_t base_width,
|
||||
int32_t base_height)
|
||||
{
|
||||
hints->flags |= XCB_ICCCM_SIZE_HINT_BASE_SIZE;
|
||||
hints->base_width = base_width;
|
||||
hints->base_height = base_height;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_size_hints_set_win_gravity(xcb_size_hints_t *hints, xcb_gravity_t win_gravity)
|
||||
{
|
||||
hints->flags |= XCB_ICCCM_SIZE_HINT_P_WIN_GRAVITY;
|
||||
hints->win_gravity = win_gravity;
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_size_hints_checked(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_atom_t property, xcb_size_hints_t *hints)
|
||||
{
|
||||
return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, property,
|
||||
XCB_ATOM_WM_SIZE_HINTS, 32, sizeof(*hints) >> 2,
|
||||
hints);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_size_hints(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_atom_t property, xcb_size_hints_t *hints)
|
||||
{
|
||||
return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, property,
|
||||
XCB_ATOM_WM_SIZE_HINTS, 32, sizeof(*hints) >> 2, hints);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_size_hints(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_atom_t property)
|
||||
{
|
||||
return xcb_get_property(c, 0, window, property, XCB_ATOM_WM_SIZE_HINTS, 0L, XCB_ICCCM_NUM_WM_SIZE_HINTS_ELEMENTS);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_size_hints_unchecked(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_atom_t property)
|
||||
{
|
||||
return xcb_get_property_unchecked(c, 0, window, property, XCB_ATOM_WM_SIZE_HINTS,
|
||||
0L, XCB_ICCCM_NUM_WM_SIZE_HINTS_ELEMENTS);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_size_hints_from_reply(xcb_size_hints_t *hints, xcb_get_property_reply_t *reply)
|
||||
{
|
||||
uint32_t flags;
|
||||
int length;
|
||||
|
||||
if(!reply)
|
||||
return 0;
|
||||
|
||||
if (!(reply->type == XCB_ATOM_WM_SIZE_HINTS &&
|
||||
reply->format == 32))
|
||||
return 0;
|
||||
|
||||
length = xcb_get_property_value_length(reply) / (reply->format / 8);
|
||||
|
||||
if(length > XCB_ICCCM_NUM_WM_SIZE_HINTS_ELEMENTS)
|
||||
length = XCB_ICCCM_NUM_WM_SIZE_HINTS_ELEMENTS;
|
||||
|
||||
memcpy(hints, (xcb_size_hints_t *) xcb_get_property_value (reply),
|
||||
length * (reply->format / 8));
|
||||
|
||||
flags = (XCB_ICCCM_SIZE_HINT_US_POSITION | XCB_ICCCM_SIZE_HINT_US_SIZE |
|
||||
XCB_ICCCM_SIZE_HINT_P_POSITION | XCB_ICCCM_SIZE_HINT_P_SIZE |
|
||||
XCB_ICCCM_SIZE_HINT_P_MIN_SIZE | XCB_ICCCM_SIZE_HINT_P_MAX_SIZE |
|
||||
XCB_ICCCM_SIZE_HINT_P_RESIZE_INC | XCB_ICCCM_SIZE_HINT_P_ASPECT);
|
||||
|
||||
/* NumPropSizeElements = 18 (ICCCM version 1) */
|
||||
if(length >= 18)
|
||||
flags |= (XCB_ICCCM_SIZE_HINT_BASE_SIZE | XCB_ICCCM_SIZE_HINT_P_WIN_GRAVITY);
|
||||
else
|
||||
{
|
||||
hints->base_width = 0;
|
||||
hints->base_height = 0;
|
||||
hints->win_gravity = 0;
|
||||
}
|
||||
/* get rid of unwanted bits */
|
||||
hints->flags &= flags;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_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 = xcb_get_property_reply(c, cookie, e);
|
||||
uint8_t ret = xcb_icccm_get_wm_size_hints_from_reply(hints, reply);
|
||||
free(reply);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* WM_NORMAL_HINTS */
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_normal_hints_checked(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_size_hints_t *hints)
|
||||
{
|
||||
return xcb_icccm_set_wm_size_hints_checked(c, window, XCB_ATOM_WM_NORMAL_HINTS, hints);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_normal_hints(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_size_hints_t *hints)
|
||||
{
|
||||
return xcb_icccm_set_wm_size_hints(c, window, XCB_ATOM_WM_NORMAL_HINTS, hints);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_normal_hints(xcb_connection_t *c, xcb_window_t window)
|
||||
{
|
||||
return xcb_icccm_get_wm_size_hints(c, window, XCB_ATOM_WM_NORMAL_HINTS);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_normal_hints_unchecked(xcb_connection_t *c, xcb_window_t window)
|
||||
{
|
||||
return xcb_icccm_get_wm_size_hints_unchecked(c, window, XCB_ATOM_WM_NORMAL_HINTS);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_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)
|
||||
{
|
||||
return xcb_icccm_get_wm_size_hints_reply(c, cookie, hints, e);
|
||||
}
|
||||
|
||||
/* WM_HINTS */
|
||||
|
||||
uint32_t
|
||||
xcb_icccm_wm_hints_get_urgency(xcb_icccm_wm_hints_t *hints)
|
||||
{
|
||||
return (hints->flags & XCB_ICCCM_WM_HINT_X_URGENCY);
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_wm_hints_set_input(xcb_icccm_wm_hints_t *hints, uint8_t input)
|
||||
{
|
||||
hints->input = input;
|
||||
hints->flags |= XCB_ICCCM_WM_HINT_INPUT;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_wm_hints_set_iconic(xcb_icccm_wm_hints_t *hints)
|
||||
{
|
||||
hints->initial_state = XCB_ICCCM_WM_STATE_ICONIC;
|
||||
hints->flags |= XCB_ICCCM_WM_HINT_STATE;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_wm_hints_set_normal(xcb_icccm_wm_hints_t *hints)
|
||||
{
|
||||
hints->initial_state = XCB_ICCCM_WM_STATE_NORMAL;
|
||||
hints->flags |= XCB_ICCCM_WM_HINT_STATE;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_wm_hints_set_withdrawn(xcb_icccm_wm_hints_t *hints)
|
||||
{
|
||||
hints->initial_state = XCB_ICCCM_WM_STATE_WITHDRAWN;
|
||||
hints->flags |= XCB_ICCCM_WM_HINT_STATE;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_wm_hints_set_none(xcb_icccm_wm_hints_t *hints)
|
||||
{
|
||||
hints->flags &= ~XCB_ICCCM_WM_HINT_STATE;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_wm_hints_set_icon_pixmap(xcb_icccm_wm_hints_t *hints, xcb_pixmap_t icon_pixmap)
|
||||
{
|
||||
hints->icon_pixmap = icon_pixmap;
|
||||
hints->flags |= XCB_ICCCM_WM_HINT_ICON_PIXMAP;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_wm_hints_set_icon_mask(xcb_icccm_wm_hints_t *hints, xcb_pixmap_t icon_mask)
|
||||
{
|
||||
hints->icon_mask = icon_mask;
|
||||
hints->flags |= XCB_ICCCM_WM_HINT_ICON_MASK;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_wm_hints_set_icon_window(xcb_icccm_wm_hints_t *hints, xcb_window_t icon_window)
|
||||
{
|
||||
hints->icon_window = icon_window;
|
||||
hints->flags |= XCB_ICCCM_WM_HINT_ICON_WINDOW;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_wm_hints_set_window_group(xcb_icccm_wm_hints_t *hints, xcb_window_t window_group)
|
||||
{
|
||||
hints->window_group = window_group;
|
||||
hints->flags |= XCB_ICCCM_WM_HINT_WINDOW_GROUP;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_wm_hints_set_urgency(xcb_icccm_wm_hints_t *hints)
|
||||
{
|
||||
hints->flags |= XCB_ICCCM_WM_HINT_X_URGENCY;
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_hints_checked(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_icccm_wm_hints_t *hints)
|
||||
{
|
||||
return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, XCB_ATOM_WM_HINTS,
|
||||
XCB_ATOM_WM_HINTS, 32, sizeof(*hints) >> 2, hints);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_hints(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_icccm_wm_hints_t *hints)
|
||||
{
|
||||
return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, XCB_ATOM_WM_HINTS,
|
||||
XCB_ATOM_WM_HINTS, 32, sizeof(*hints) >> 2, hints);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_hints(xcb_connection_t *c,
|
||||
xcb_window_t window)
|
||||
{
|
||||
return xcb_get_property(c, 0, window, XCB_ATOM_WM_HINTS, XCB_ATOM_WM_HINTS, 0L,
|
||||
XCB_ICCCM_NUM_WM_HINTS_ELEMENTS);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_hints_unchecked(xcb_connection_t *c,
|
||||
xcb_window_t window)
|
||||
{
|
||||
return xcb_get_property_unchecked(c, 0, window, XCB_ATOM_WM_HINTS, XCB_ATOM_WM_HINTS, 0L,
|
||||
XCB_ICCCM_NUM_WM_HINTS_ELEMENTS);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_hints_from_reply(xcb_icccm_wm_hints_t *hints,
|
||||
xcb_get_property_reply_t *reply)
|
||||
{
|
||||
if(!reply || reply->type != XCB_ATOM_WM_HINTS || reply->format != 32)
|
||||
return 0;
|
||||
|
||||
int length = xcb_get_property_value_length(reply);
|
||||
int num_elem = length / (reply->format / 8);
|
||||
|
||||
if(num_elem < XCB_ICCCM_NUM_WM_HINTS_ELEMENTS - 1)
|
||||
return 0;
|
||||
|
||||
if(length > sizeof(xcb_size_hints_t))
|
||||
length = sizeof(xcb_size_hints_t);
|
||||
|
||||
memcpy(hints, (xcb_size_hints_t *) xcb_get_property_value(reply), length);
|
||||
|
||||
if(num_elem < XCB_ICCCM_NUM_WM_HINTS_ELEMENTS)
|
||||
hints->window_group = XCB_NONE;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_hints_reply(xcb_connection_t *c,
|
||||
xcb_get_property_cookie_t cookie,
|
||||
xcb_icccm_wm_hints_t *hints,
|
||||
xcb_generic_error_t **e)
|
||||
{
|
||||
xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e);
|
||||
int ret = xcb_icccm_get_wm_hints_from_reply(hints, reply);
|
||||
free(reply);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* WM_PROTOCOLS */
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_protocols_checked(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_atom_t wm_protocols, uint32_t list_len,
|
||||
xcb_atom_t *list)
|
||||
{
|
||||
return xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window,
|
||||
wm_protocols, XCB_ATOM_ATOM, 32, list_len, list);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_icccm_set_wm_protocols(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_atom_t wm_protocols, uint32_t list_len, xcb_atom_t *list)
|
||||
{
|
||||
return xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, wm_protocols,
|
||||
XCB_ATOM_ATOM, 32, list_len, list);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_protocols(xcb_connection_t *c, xcb_window_t window,
|
||||
xcb_atom_t wm_protocol_atom)
|
||||
{
|
||||
return xcb_get_property(c, 0, window, wm_protocol_atom, XCB_ATOM_ATOM, 0, UINT_MAX);
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t
|
||||
xcb_icccm_get_wm_protocols_unchecked(xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
xcb_atom_t wm_protocol_atom)
|
||||
{
|
||||
return xcb_get_property_unchecked(c, 0, window, wm_protocol_atom, XCB_ATOM_ATOM, 0,
|
||||
UINT_MAX);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_icccm_get_wm_protocols_from_reply(xcb_get_property_reply_t *reply, xcb_icccm_get_wm_protocols_reply_t *protocols)
|
||||
{
|
||||
if(!reply || reply->type != XCB_ATOM_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_icccm_get_wm_protocols_reply(xcb_connection_t *c,
|
||||
xcb_get_property_cookie_t cookie,
|
||||
xcb_icccm_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_icccm_get_wm_protocols_from_reply(reply, protocols);
|
||||
if(!ret)
|
||||
free(reply);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_icccm_get_wm_protocols_reply_wipe(xcb_icccm_get_wm_protocols_reply_t *protocols)
|
||||
{
|
||||
free(protocols->_reply);
|
||||
}
|
76
src/3rdparty/xcb/xcb-util/atoms.c
vendored
76
src/3rdparty/xcb/xcb-util/atoms.c
vendored
@ -1,76 +0,0 @@
|
||||
/* Rely on vasprintf (GNU extension) instead of vsnprintf if
|
||||
possible... */
|
||||
#ifdef HAVE_VASPRINTF
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include "xcb_atom.h"
|
||||
|
||||
static char *makename(const char *fmt, ...)
|
||||
{
|
||||
char *ret;
|
||||
int n;
|
||||
va_list ap;
|
||||
|
||||
#ifndef HAVE_VASPRINTF
|
||||
char *np;
|
||||
int size = 64;
|
||||
|
||||
/* First allocate 'size' bytes, should be enough usually */
|
||||
if((ret = malloc(size)) == NULL)
|
||||
return NULL;
|
||||
|
||||
while(1)
|
||||
{
|
||||
va_start(ap, fmt);
|
||||
n = vsnprintf(ret, size, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if(n < 0)
|
||||
return NULL;
|
||||
|
||||
if(n < size)
|
||||
return ret;
|
||||
|
||||
size = n + 1;
|
||||
if((np = realloc(ret, size)) == NULL)
|
||||
{
|
||||
free(ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = np;
|
||||
}
|
||||
#else
|
||||
va_start(ap, fmt);
|
||||
n = vasprintf(&ret, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if(n < 0)
|
||||
return NULL;
|
||||
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
char *xcb_atom_name_by_screen(const char *base, uint8_t screen)
|
||||
{
|
||||
return makename("%s_S%u", base, screen);
|
||||
}
|
||||
|
||||
char *xcb_atom_name_by_resource(const char *base, uint32_t resource)
|
||||
{
|
||||
return makename("%s_R%08X", base, resource);
|
||||
}
|
||||
|
||||
char *xcb_atom_name_unique(const char *base, uint32_t id)
|
||||
{
|
||||
if(base)
|
||||
return makename("%s_U%lu", base, id);
|
||||
else
|
||||
return makename("U%lu", id);
|
||||
}
|
257
src/3rdparty/xcb/xcb-util/event.c
vendored
257
src/3rdparty/xcb/xcb-util/event.c
vendored
@ -1,257 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2008-2009 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.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "xcb_event.h"
|
||||
|
||||
#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]))
|
||||
|
||||
static const char *labelError[] =
|
||||
{
|
||||
"Success",
|
||||
"BadRequest",
|
||||
"BadValue",
|
||||
"BadWindow",
|
||||
"BadPixmap",
|
||||
"BadAtom",
|
||||
"BadCursor",
|
||||
"BadFont",
|
||||
"BadMatch",
|
||||
"BadDrawable",
|
||||
"BadAccess",
|
||||
"BadAlloc",
|
||||
"BadColor",
|
||||
"BadGC",
|
||||
"BadIDChoice",
|
||||
"BadName",
|
||||
"BadLength",
|
||||
"BadImplementation",
|
||||
};
|
||||
|
||||
static const char *labelRequest[] =
|
||||
{
|
||||
"no request",
|
||||
"CreateWindow",
|
||||
"ChangeWindowAttributes",
|
||||
"GetWindowAttributes",
|
||||
"DestroyWindow",
|
||||
"DestroySubwindows",
|
||||
"ChangeSaveSet",
|
||||
"ReparentWindow",
|
||||
"MapWindow",
|
||||
"MapSubwindows",
|
||||
"UnmapWindow",
|
||||
"UnmapSubwindows",
|
||||
"ConfigureWindow",
|
||||
"CirculateWindow",
|
||||
"GetGeometry",
|
||||
"QueryTree",
|
||||
"InternAtom",
|
||||
"GetAtomName",
|
||||
"ChangeProperty",
|
||||
"DeleteProperty",
|
||||
"GetProperty",
|
||||
"ListProperties",
|
||||
"SetSelectionOwner",
|
||||
"GetSelectionOwner",
|
||||
"ConvertSelection",
|
||||
"SendEvent",
|
||||
"GrabPointer",
|
||||
"UngrabPointer",
|
||||
"GrabButton",
|
||||
"UngrabButton",
|
||||
"ChangeActivePointerGrab",
|
||||
"GrabKeyboard",
|
||||
"UngrabKeyboard",
|
||||
"GrabKey",
|
||||
"UngrabKey",
|
||||
"AllowEvents",
|
||||
"GrabServer",
|
||||
"UngrabServer",
|
||||
"QueryPointer",
|
||||
"GetMotionEvents",
|
||||
"TranslateCoords",
|
||||
"WarpPointer",
|
||||
"SetInputFocus",
|
||||
"GetInputFocus",
|
||||
"QueryKeymap",
|
||||
"OpenFont",
|
||||
"CloseFont",
|
||||
"QueryFont",
|
||||
"QueryTextExtents",
|
||||
"ListFonts",
|
||||
"ListFontsWithInfo",
|
||||
"SetFontPath",
|
||||
"GetFontPath",
|
||||
"CreatePixmap",
|
||||
"FreePixmap",
|
||||
"CreateGC",
|
||||
"ChangeGC",
|
||||
"CopyGC",
|
||||
"SetDashes",
|
||||
"SetClipRectangles",
|
||||
"FreeGC",
|
||||
"ClearArea",
|
||||
"CopyArea",
|
||||
"CopyPlane",
|
||||
"PolyPoint",
|
||||
"PolyLine",
|
||||
"PolySegment",
|
||||
"PolyRectangle",
|
||||
"PolyArc",
|
||||
"FillPoly",
|
||||
"PolyFillRectangle",
|
||||
"PolyFillArc",
|
||||
"PutImage",
|
||||
"GetImage",
|
||||
"PolyText",
|
||||
"PolyText",
|
||||
"ImageText",
|
||||
"ImageText",
|
||||
"CreateColormap",
|
||||
"FreeColormap",
|
||||
"CopyColormapAndFree",
|
||||
"InstallColormap",
|
||||
"UninstallColormap",
|
||||
"ListInstalledColormaps",
|
||||
"AllocColor",
|
||||
"AllocNamedColor",
|
||||
"AllocColorCells",
|
||||
"AllocColorPlanes",
|
||||
"FreeColors",
|
||||
"StoreColors",
|
||||
"StoreNamedColor",
|
||||
"QueryColors",
|
||||
"LookupColor",
|
||||
"CreateCursor",
|
||||
"CreateGlyphCursor",
|
||||
"FreeCursor",
|
||||
"RecolorCursor",
|
||||
"QueryBestSize",
|
||||
"QueryExtension",
|
||||
"ListExtensions",
|
||||
"ChangeKeyboardMapping",
|
||||
"GetKeyboardMapping",
|
||||
"ChangeKeyboardControl",
|
||||
"GetKeyboardControl",
|
||||
"Bell",
|
||||
"ChangePointerControl",
|
||||
"GetPointerControl",
|
||||
"SetScreenSaver",
|
||||
"GetScreenSaver",
|
||||
"ChangeHosts",
|
||||
"ListHosts",
|
||||
"SetAccessControl",
|
||||
"SetCloseDownMode",
|
||||
"KillClient",
|
||||
"RotateProperties",
|
||||
"ForceScreenSaver",
|
||||
"SetPointerMapping",
|
||||
"GetPointerMapping",
|
||||
"SetModifierMapping",
|
||||
"GetModifierMapping",
|
||||
"major 120",
|
||||
"major 121",
|
||||
"major 122",
|
||||
"major 123",
|
||||
"major 124",
|
||||
"major 125",
|
||||
"major 126",
|
||||
"NoOperation",
|
||||
};
|
||||
|
||||
static const char *labelEvent[] =
|
||||
{
|
||||
"error",
|
||||
"reply",
|
||||
"KeyPress",
|
||||
"KeyRelease",
|
||||
"ButtonPress",
|
||||
"ButtonRelease",
|
||||
"MotionNotify",
|
||||
"EnterNotify",
|
||||
"LeaveNotify",
|
||||
"FocusIn",
|
||||
"FocusOut",
|
||||
"KeymapNotify",
|
||||
"Expose",
|
||||
"GraphicsExpose",
|
||||
"NoExpose",
|
||||
"VisibilityNotify",
|
||||
"CreateNotify",
|
||||
"DestroyNotify",
|
||||
"UnmapNotify",
|
||||
"MapNotify",
|
||||
"MapRequest",
|
||||
"ReparentNotify",
|
||||
"ConfigureNotify",
|
||||
"ConfigureRequest",
|
||||
"GravityNotify",
|
||||
"ResizeRequest",
|
||||
"CirculateNotify",
|
||||
"CirculateRequest",
|
||||
"PropertyNotify",
|
||||
"SelectionClear",
|
||||
"SelectionRequest",
|
||||
"SelectionNotify",
|
||||
"ColormapNotify",
|
||||
"ClientMessage",
|
||||
"MappingNotify",
|
||||
};
|
||||
|
||||
const char *
|
||||
xcb_event_get_label(uint8_t type)
|
||||
{
|
||||
if(type < countof(labelEvent))
|
||||
return labelEvent[type];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *
|
||||
xcb_event_get_error_label(uint8_t type)
|
||||
{
|
||||
if(type < countof(labelError))
|
||||
return labelError[type];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *
|
||||
xcb_event_get_request_label(uint8_t type)
|
||||
{
|
||||
if(type < countof(labelRequest))
|
||||
return labelRequest[type];
|
||||
return NULL;
|
||||
}
|
374
src/3rdparty/xcb/xcb-util/xcb_aux.c
vendored
374
src/3rdparty/xcb/xcb-util/xcb_aux.c
vendored
@ -1,374 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2008 Bart Massey <bart@cs.pdx.edu>
|
||||
* Copyright © 2008 Ian Osgood <iano@quirkster.com>
|
||||
* Copyright © 2008 Jamey Sharp <jamey@minilop.net>
|
||||
* Copyright © 2008 Josh Triplett <josh@freedesktop.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
#include "xcb_aux.h"
|
||||
|
||||
/* Connection related functions */
|
||||
|
||||
uint8_t
|
||||
xcb_aux_get_depth (xcb_connection_t *c,
|
||||
xcb_screen_t *screen)
|
||||
{
|
||||
xcb_drawable_t drawable;
|
||||
xcb_get_geometry_reply_t *geom;
|
||||
int depth = 0;
|
||||
|
||||
drawable = screen->root;
|
||||
geom = xcb_get_geometry_reply (c, xcb_get_geometry(c, drawable), 0);
|
||||
|
||||
if (geom) {
|
||||
depth = geom->depth;
|
||||
free (geom);
|
||||
}
|
||||
|
||||
return depth;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
xcb_aux_get_depth_of_visual (xcb_screen_t *screen,
|
||||
xcb_visualid_t id)
|
||||
{
|
||||
xcb_depth_iterator_t i;
|
||||
xcb_visualtype_iterator_t j;
|
||||
for (i = xcb_screen_allowed_depths_iterator(screen);
|
||||
i.rem; xcb_depth_next(&i))
|
||||
for (j = xcb_depth_visuals_iterator(i.data);
|
||||
j.rem; xcb_visualtype_next(&j))
|
||||
if (j.data->visual_id == id)
|
||||
return i.data->depth;
|
||||
return 0;
|
||||
}
|
||||
|
||||
xcb_screen_t *
|
||||
xcb_aux_get_screen (xcb_connection_t *c,
|
||||
int screen)
|
||||
{
|
||||
xcb_screen_iterator_t i = xcb_setup_roots_iterator(xcb_get_setup(c));
|
||||
for (; i.rem; --screen, xcb_screen_next(&i))
|
||||
if (screen == 0)
|
||||
return i.data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
xcb_visualtype_t *
|
||||
xcb_aux_get_visualtype (xcb_connection_t *c,
|
||||
int scr,
|
||||
xcb_visualid_t vid)
|
||||
{
|
||||
xcb_screen_t *screen;
|
||||
xcb_depth_t *depth;
|
||||
xcb_visualtype_iterator_t iter;
|
||||
int cur;
|
||||
|
||||
screen = xcb_aux_get_screen (c, scr);
|
||||
if (!screen) return NULL;
|
||||
|
||||
depth = xcb_screen_allowed_depths_iterator(screen).data;
|
||||
if (!depth) return NULL;
|
||||
|
||||
iter = xcb_depth_visuals_iterator(depth);
|
||||
for (cur = 0 ; cur < iter.rem ; xcb_visualtype_next(&iter), ++cur)
|
||||
if (vid == iter.data->visual_id)
|
||||
return iter.data;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
xcb_visualtype_t *
|
||||
xcb_aux_find_visual_by_id (xcb_screen_t *screen,
|
||||
xcb_visualid_t id)
|
||||
{
|
||||
xcb_depth_iterator_t i;
|
||||
xcb_visualtype_iterator_t j;
|
||||
for (i = xcb_screen_allowed_depths_iterator(screen);
|
||||
i.rem; xcb_depth_next(&i))
|
||||
for (j = xcb_depth_visuals_iterator(i.data);
|
||||
j.rem; xcb_visualtype_next(&j))
|
||||
if (j.data->visual_id == id)
|
||||
return j.data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
xcb_visualtype_t *
|
||||
xcb_aux_find_visual_by_attrs (xcb_screen_t *screen,
|
||||
int8_t class,
|
||||
int8_t depth)
|
||||
{
|
||||
xcb_depth_iterator_t i;
|
||||
xcb_visualtype_iterator_t j;
|
||||
for (i = xcb_screen_allowed_depths_iterator(screen);
|
||||
i.rem; xcb_depth_next(&i)) {
|
||||
if (depth != -1 && i.data->depth != depth)
|
||||
continue;
|
||||
for (j = xcb_depth_visuals_iterator(i.data);
|
||||
j.rem; xcb_visualtype_next(&j))
|
||||
if (class == -1 || j.data->_class == class)
|
||||
return j.data;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
xcb_aux_sync (xcb_connection_t *c)
|
||||
{
|
||||
free(xcb_get_input_focus_reply(c, xcb_get_input_focus(c), NULL));
|
||||
}
|
||||
|
||||
/* structs instead of value lists */
|
||||
/* TODO: generate the struct types and functions from protocol masks and descriptions */
|
||||
|
||||
/* This generic implementation of pack_list depends on:
|
||||
a) structs packed to uint32_t size
|
||||
b) structs consist of just uint32_t/int32_t fields in the same order as bitmask
|
||||
*/
|
||||
|
||||
static void
|
||||
pack_list( uint32_t mask, const uint32_t *src, uint32_t *dest )
|
||||
{
|
||||
for ( ; mask; mask >>= 1, src++)
|
||||
if (mask & 1)
|
||||
*dest++ = *src;
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_create_window (xcb_connection_t *c,
|
||||
uint8_t depth,
|
||||
xcb_window_t wid,
|
||||
xcb_window_t parent,
|
||||
int16_t x,
|
||||
int16_t y,
|
||||
uint16_t width,
|
||||
uint16_t height,
|
||||
uint16_t border_width,
|
||||
uint16_t _class,
|
||||
xcb_visualid_t visual,
|
||||
uint32_t mask,
|
||||
const xcb_params_cw_t *params)
|
||||
{
|
||||
uint32_t value_list[16];
|
||||
pack_list(mask, (const uint32_t *)params, value_list);
|
||||
return xcb_create_window(c, depth, wid, parent,
|
||||
x, y, width, height, border_width,
|
||||
_class, visual, mask, value_list);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_create_window_checked (xcb_connection_t *c,
|
||||
uint8_t depth,
|
||||
xcb_window_t wid,
|
||||
xcb_window_t parent,
|
||||
int16_t x,
|
||||
int16_t y,
|
||||
uint16_t width,
|
||||
uint16_t height,
|
||||
uint16_t border_width,
|
||||
uint16_t _class,
|
||||
xcb_visualid_t visual,
|
||||
uint32_t mask,
|
||||
const xcb_params_cw_t *params)
|
||||
{
|
||||
uint32_t value_list[16];
|
||||
pack_list(mask, (const uint32_t *)params, value_list);
|
||||
return xcb_create_window_checked(c, depth, wid, parent,
|
||||
x, y, width, height, border_width,
|
||||
_class, visual, mask, value_list);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_change_window_attributes_checked (xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
uint32_t mask,
|
||||
const xcb_params_cw_t *params)
|
||||
{
|
||||
uint32_t value_list[16];
|
||||
pack_list(mask, (const uint32_t *)params, value_list);
|
||||
return xcb_change_window_attributes_checked( c, window, mask, value_list );
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_change_window_attributes (xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
uint32_t mask,
|
||||
const xcb_params_cw_t *params)
|
||||
{
|
||||
uint32_t value_list[16];
|
||||
pack_list(mask, (const uint32_t *)params, value_list);
|
||||
return xcb_change_window_attributes( c, window, mask, value_list );
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_configure_window (xcb_connection_t *c,
|
||||
xcb_window_t window,
|
||||
uint16_t mask,
|
||||
const xcb_params_configure_window_t *params)
|
||||
{
|
||||
uint32_t value_list[8];
|
||||
pack_list(mask, (const uint32_t *)params, value_list);
|
||||
return xcb_configure_window( c, window, mask, value_list );
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_create_gc (xcb_connection_t *c,
|
||||
xcb_gcontext_t gid,
|
||||
xcb_drawable_t drawable,
|
||||
uint32_t mask,
|
||||
const xcb_params_gc_t *params)
|
||||
{
|
||||
uint32_t value_list[32];
|
||||
pack_list(mask, (const uint32_t *)params, value_list);
|
||||
return xcb_create_gc( c, gid, drawable, mask, value_list );
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_create_gc_checked (xcb_connection_t *c,
|
||||
xcb_gcontext_t gid,
|
||||
xcb_drawable_t drawable,
|
||||
uint32_t mask,
|
||||
const xcb_params_gc_t *params)
|
||||
{
|
||||
uint32_t value_list[32];
|
||||
pack_list(mask, (const uint32_t *)params, value_list);
|
||||
return xcb_create_gc_checked( c, gid, drawable, mask, value_list);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_change_gc (xcb_connection_t *c,
|
||||
xcb_gcontext_t gc,
|
||||
uint32_t mask,
|
||||
const xcb_params_gc_t *params)
|
||||
{
|
||||
uint32_t value_list[32];
|
||||
pack_list(mask, (const uint32_t *)params, value_list);
|
||||
return xcb_change_gc( c, gc, mask, value_list );
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_change_gc_checked (xcb_connection_t *c,
|
||||
xcb_gcontext_t gc,
|
||||
uint32_t mask,
|
||||
const xcb_params_gc_t *params)
|
||||
{
|
||||
uint32_t value_list[32];
|
||||
pack_list(mask, (const uint32_t *)params, value_list);
|
||||
return xcb_change_gc_checked( c, gc, mask, value_list );
|
||||
}
|
||||
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_change_keyboard_control (xcb_connection_t *c,
|
||||
uint32_t mask,
|
||||
const xcb_params_keyboard_t *params)
|
||||
{
|
||||
uint32_t value_list[16];
|
||||
pack_list(mask, (const uint32_t *)params, value_list);
|
||||
return xcb_change_keyboard_control( c, mask, value_list );
|
||||
}
|
||||
|
||||
/* Color related functions */
|
||||
|
||||
/* Return true if the given color name can be translated locally,
|
||||
in which case load the components. Otherwise, a lookup_color request
|
||||
will be needed, so return false. */
|
||||
int
|
||||
xcb_aux_parse_color(char *color_name,
|
||||
uint16_t *red, uint16_t *green, uint16_t *blue)
|
||||
{
|
||||
int n, r, g, b, i;
|
||||
if (!color_name || *color_name != '#')
|
||||
return 0;
|
||||
/*
|
||||
* Excitingly weird RGB parsing code from Xlib.
|
||||
*/
|
||||
n = strlen (color_name);
|
||||
color_name++;
|
||||
n--;
|
||||
if (n != 3 && n != 6 && n != 9 && n != 12)
|
||||
return 0;
|
||||
n /= 3;
|
||||
g = b = 0;
|
||||
do {
|
||||
r = g;
|
||||
g = b;
|
||||
b = 0;
|
||||
for (i = n; --i >= 0; ) {
|
||||
char c = *color_name++;
|
||||
b <<= 4;
|
||||
if (c >= '0' && c <= '9')
|
||||
b |= c - '0';
|
||||
else if (c >= 'A' && c <= 'F')
|
||||
b |= c - ('A' - 10);
|
||||
else if (c >= 'a' && c <= 'f')
|
||||
b |= c - ('a' - 10);
|
||||
else return 0;
|
||||
}
|
||||
} while (*color_name != '\0');
|
||||
n <<= 2;
|
||||
n = 16 - n;
|
||||
*red = r << n;
|
||||
*green = g << n;
|
||||
*blue = b << n;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Drawing related functions */
|
||||
|
||||
/* Adapted from Xlib */
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_set_line_attributes_checked (xcb_connection_t *dpy,
|
||||
xcb_gcontext_t gc,
|
||||
uint16_t linewidth,
|
||||
int32_t linestyle,
|
||||
int32_t capstyle,
|
||||
int32_t joinstyle)
|
||||
{
|
||||
uint32_t mask = 0;
|
||||
xcb_params_gc_t gv;
|
||||
|
||||
XCB_AUX_ADD_PARAM(&mask, &gv, line_width, linewidth);
|
||||
XCB_AUX_ADD_PARAM(&mask, &gv, line_style, linestyle);
|
||||
XCB_AUX_ADD_PARAM(&mask, &gv, cap_style, capstyle);
|
||||
XCB_AUX_ADD_PARAM(&mask, &gv, join_style, joinstyle);
|
||||
return xcb_aux_change_gc_checked(dpy, gc, mask, &gv);
|
||||
}
|
||||
|
||||
/* Adapted from Xlib */
|
||||
/* XXX It would be wiser for apps just to call
|
||||
clear_area() directly. */
|
||||
xcb_void_cookie_t
|
||||
xcb_aux_clear_window(xcb_connection_t * dpy,
|
||||
xcb_window_t w)
|
||||
{
|
||||
return xcb_clear_area(dpy, 0, w, 0, 0, 0, 0);
|
||||
}
|
@ -41,11 +41,10 @@
|
||||
"sm": { "type": "boolean", "name": "sessionmanager" },
|
||||
"tslib": "boolean",
|
||||
"vulkan": "boolean",
|
||||
"xcb": { "type": "enum", "values": [ "no", "yes", "qt", "system" ] },
|
||||
"xcb": "boolean",
|
||||
"bundled-xcb-xinput": "boolean",
|
||||
"xcb-native-painting": "boolean",
|
||||
"xcb-xlib": "boolean",
|
||||
"xcb-xinput": "boolean",
|
||||
"xkb": "boolean",
|
||||
"xkbcommon": "boolean"
|
||||
}
|
||||
},
|
||||
@ -573,18 +572,22 @@
|
||||
]
|
||||
},
|
||||
"xcb": {
|
||||
"label": "XCB >= 1.9",
|
||||
"label": "XCB >= 1.11",
|
||||
"test": {
|
||||
"main": [
|
||||
"int primaryScreen = 0;",
|
||||
"(void)xcb_connect(\"\", &primaryScreen);",
|
||||
"// This won't compile unless libxcb >= 1.9 which defines XCB_CONN_CLOSED_INVALID_SCREEN.",
|
||||
"int xcbScreenError = XCB_CONN_CLOSED_INVALID_SCREEN;"
|
||||
"/* XCB_PACKED define was added in libxcb 1.11 */",
|
||||
"#ifdef XCB_PACKED",
|
||||
" return 0;",
|
||||
"#else",
|
||||
" return -1;",
|
||||
"#endif"
|
||||
]
|
||||
},
|
||||
"headers": "xcb/xcb.h",
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "xcb >= 1.9" },
|
||||
{ "type": "pkgConfig", "args": "xcb >= 1.11" },
|
||||
"-lxcb"
|
||||
]
|
||||
},
|
||||
@ -691,21 +694,10 @@
|
||||
"use": "xcb xlib"
|
||||
},
|
||||
"xcb_xkb": {
|
||||
"label": "XCB XKB >= 1.10",
|
||||
"test": {
|
||||
"head": [
|
||||
"// xkb.h is using a variable called 'explicit', which is a reserved keyword in C++",
|
||||
"#define explicit dont_use_cxx_explicit"
|
||||
],
|
||||
"tail": "#undef explicit",
|
||||
"main": [
|
||||
"// This takes more arguments in xcb-xkb < 1.10.",
|
||||
"xcb_xkb_get_kbd_by_name_unchecked(NULL, 0, 0, 0, 0);"
|
||||
]
|
||||
},
|
||||
"label": "XCB XKB",
|
||||
"headers": "xcb/xkb.h",
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "xcb-xkb >= 1.10" },
|
||||
{ "type": "pkgConfig", "args": "xcb-xkb" },
|
||||
"-lxcb-xkb"
|
||||
],
|
||||
"use": "xcb"
|
||||
@ -769,7 +761,7 @@
|
||||
"xkbcommon_x11": {
|
||||
"label": "xkbcommon-x11",
|
||||
"test": {
|
||||
"main": "xkb_x11_get_core_keyboard_device_id(nullptr);"
|
||||
"main": "xkb_x11_setup_xkb_extension_flags flag = XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS;"
|
||||
},
|
||||
"headers": [ "xkbcommon/xkbcommon-x11.h" ],
|
||||
"sources": [
|
||||
@ -1056,6 +1048,11 @@
|
||||
"label": "XCB (extensions)",
|
||||
"type": "compile",
|
||||
"test": {
|
||||
"head": [
|
||||
"// xkb.h is using a variable called 'explicit', which is a reserved keyword in C++",
|
||||
"#define explicit dont_use_cxx_explicit"
|
||||
],
|
||||
"tail": "#undef explicit",
|
||||
"include": [
|
||||
"xcb/xcb.h",
|
||||
"xcb/xcb_image.h",
|
||||
@ -1068,7 +1065,8 @@
|
||||
"xcb/xfixes.h",
|
||||
"xcb/xinerama.h",
|
||||
"xcb/xcb_icccm.h",
|
||||
"xcb/xcb_renderutil.h"
|
||||
"xcb/xcb_renderutil.h",
|
||||
"xcb/xkb.h"
|
||||
],
|
||||
"main": [
|
||||
"int primaryScreen = 0;",
|
||||
@ -1082,10 +1080,13 @@
|
||||
" xcb_render_query_pict_formats_reply(c, formatsCookie, &error);",
|
||||
|
||||
"/* RENDERUTIL: xcb_renderutil.h include won't compile unless version >= 0.3.9 */",
|
||||
"xcb_render_util_find_standard_format(nullptr, XCB_PICT_STANDARD_ARGB_32);"
|
||||
"xcb_render_util_find_standard_format(nullptr, XCB_PICT_STANDARD_ARGB_32);",
|
||||
|
||||
"/* XKB: This takes more arguments in xcb-xkb < 1.11 */",
|
||||
"xcb_xkb_get_kbd_by_name_replies_key_names_value_list_sizeof(nullptr, 0, 0, 0, 0, 0, 0, 0, 0);"
|
||||
]
|
||||
},
|
||||
"use": "xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb"
|
||||
"use": "xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb_xkb xcb"
|
||||
},
|
||||
"x11prefix": {
|
||||
"label": "X11 prefix",
|
||||
@ -1514,16 +1515,7 @@
|
||||
"label": "XCB",
|
||||
"section": "Platform plugins",
|
||||
"autoDetect": "!config.darwin",
|
||||
"enable": "input.xcb == 'system' || input.xcb == 'qt' || input.xcb == 'yes'",
|
||||
"condition": "features.thread && features.xkbcommon && libs.xcb",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"system-xcb": {
|
||||
"label": "Using system-provided XCB libraries",
|
||||
"enable": "input.xcb == 'system'",
|
||||
"disable": "input.xcb == 'qt'",
|
||||
"autoDetect": "!config.darwin",
|
||||
"condition": "features.xcb && tests.xcb_syslibs",
|
||||
"condition": "features.thread && libs.xcb && tests.xcb_syslibs && features.xkbcommon-x11",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"x11-prefix": {
|
||||
@ -1562,12 +1554,6 @@
|
||||
"condition": "features.xcb-native-painting",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"xkb": {
|
||||
"label": "XCB XKB",
|
||||
"emitIf": "features.xcb",
|
||||
"condition": "(!features.system-xcb || libs.xcb_xkb) && libs.xkbcommon_x11",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"xcb-xlib": {
|
||||
"label": "XCB Xlib",
|
||||
"condition": "features.xlib && libs.xcb_xlib",
|
||||
@ -1579,10 +1565,12 @@
|
||||
"condition": "features.sessionmanager && libs.x11sm",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"xcb-xinput": {
|
||||
"label": "XCB XInput",
|
||||
"system-xcb-xinput": {
|
||||
"label": "Using system-provided xcb-xinput",
|
||||
"emitIf": "features.xcb",
|
||||
"condition": "!features.system-xcb || libs.xcb_xinput",
|
||||
"disable": "input.bundled-xcb-xinput == 'yes'",
|
||||
"enable": "input.bundled-xcb-xinput == 'no'",
|
||||
"condition": "libs.xcb_xinput",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"xkbcommon": {
|
||||
@ -1590,6 +1578,11 @@
|
||||
"condition": "libs.xkbcommon",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"xkbcommon-x11": {
|
||||
"label": "xkbcommon-x11",
|
||||
"condition": "features.xkbcommon && libs.xkbcommon_x11",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"xlib": {
|
||||
"label": "XLib",
|
||||
"autoDetect": "!config.darwin || features.xcb",
|
||||
@ -1831,7 +1824,7 @@
|
||||
{
|
||||
"type": "error",
|
||||
"condition": "input.xcb != '' && input.xcb != 'no' && input.xkbcommon == 'no'",
|
||||
"message": "XCB plugin requires xkbcommon, but -no-xkbcommon was provided."
|
||||
"message": "XCB plugin requires xkbcommon and xkbcommon-x11, but -no-xkbcommon was provided."
|
||||
}
|
||||
],
|
||||
|
||||
@ -1953,7 +1946,8 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
|
||||
"entries": [
|
||||
"xlib",
|
||||
"xcb-xlib",
|
||||
"egl_x11"
|
||||
"egl_x11",
|
||||
"xkbcommon-x11"
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -1986,7 +1980,7 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
|
||||
"section": "XCB",
|
||||
"condition": "features.xcb",
|
||||
"entries": [
|
||||
"system-xcb", "xkb", "xcb-xinput", "xcb-native-painting",
|
||||
"system-xcb-xinput", "xcb-native-painting",
|
||||
{
|
||||
"section": "GL integrations",
|
||||
"entries": [
|
||||
|
@ -66,14 +66,10 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include <xcb/xfixes.h>
|
||||
#if QT_CONFIG(xkb)
|
||||
#define explicit dont_use_cxx_explicit
|
||||
#include <xcb/xkb.h>
|
||||
#undef explicit
|
||||
#endif
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
#include <xcb/xinput.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -88,12 +84,6 @@ Q_LOGGING_CATEGORY(lcQpaKeyboard, "qt.qpa.xkeyboard")
|
||||
Q_LOGGING_CATEGORY(lcQpaClipboard, "qt.qpa.clipboard")
|
||||
Q_LOGGING_CATEGORY(lcQpaXDnd, "qt.qpa.xdnd")
|
||||
|
||||
// this event type was added in libxcb 1.10,
|
||||
// but we support also older version
|
||||
#ifndef XCB_GE_GENERIC
|
||||
#define XCB_GE_GENERIC 35
|
||||
#endif
|
||||
|
||||
QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName)
|
||||
: QXcbBasicConnection(displayName)
|
||||
, m_canGrabServer(canGrabServer)
|
||||
@ -112,12 +102,10 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
|
||||
|
||||
initializeScreens();
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
if (hasXInput2()) {
|
||||
xi2SetupDevices();
|
||||
xi2SelectStateEvents();
|
||||
}
|
||||
#endif
|
||||
|
||||
m_wmSupport.reset(new QXcbWMSupport(this));
|
||||
m_keyboard = new QXcbKeyboard(this);
|
||||
@ -518,7 +506,6 @@ Qt::MouseButton QXcbConnection::translateMouseButton(xcb_button_t s)
|
||||
}
|
||||
}
|
||||
|
||||
#if QT_CONFIG(xkb)
|
||||
namespace {
|
||||
typedef union {
|
||||
/* All XKB events share these fields. */
|
||||
@ -534,7 +521,6 @@ namespace {
|
||||
xcb_xkb_state_notify_event_t state_notify;
|
||||
} _xkb_event;
|
||||
}
|
||||
#endif
|
||||
|
||||
void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
|
||||
{
|
||||
@ -611,16 +597,12 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
|
||||
HANDLE_PLATFORM_WINDOW_EVENT(xcb_client_message_event_t, window, handleClientMessageEvent);
|
||||
}
|
||||
case XCB_ENTER_NOTIFY:
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
if (hasXInput2() && !xi2MouseEventsDisabled())
|
||||
break;
|
||||
#endif
|
||||
HANDLE_PLATFORM_WINDOW_EVENT(xcb_enter_notify_event_t, event, handleEnterNotifyEvent);
|
||||
case XCB_LEAVE_NOTIFY:
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
if (hasXInput2() && !xi2MouseEventsDisabled())
|
||||
break;
|
||||
#endif
|
||||
m_keyboard->updateXKBStateFromCore(reinterpret_cast<xcb_leave_notify_event_t *>(event)->state);
|
||||
HANDLE_PLATFORM_WINDOW_EVENT(xcb_leave_notify_event_t, event, handleLeaveNotifyEvent);
|
||||
case XCB_FOCUS_IN:
|
||||
@ -682,13 +664,11 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
case XCB_GE_GENERIC:
|
||||
// Here the windowEventListener is invoked from xi2HandleEvent()
|
||||
if (hasXInput2() && isXIEvent(event))
|
||||
xi2HandleEvent(reinterpret_cast<xcb_ge_event_t *>(event));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
handled = false; // event type not recognized
|
||||
break;
|
||||
@ -712,7 +692,6 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
|
||||
auto change_event = reinterpret_cast<xcb_randr_screen_change_notify_event_t *>(event);
|
||||
if (auto virtualDesktop = virtualDesktopForRootWindow(change_event->root))
|
||||
virtualDesktop->handleScreenChange(change_event);
|
||||
#if QT_CONFIG(xkb)
|
||||
} else if (isXkbType(response_type)) {
|
||||
auto xkb_event = reinterpret_cast<_xkb_event *>(event);
|
||||
if (xkb_event->any.deviceID == m_keyboard->coreDeviceId()) {
|
||||
@ -735,7 +714,6 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
handled = false; // event type still not recognized
|
||||
}
|
||||
@ -912,7 +890,6 @@ bool QXcbConnection::compressEvent(xcb_generic_event_t *event) const
|
||||
});
|
||||
}
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
// compress XI_* events
|
||||
if (responseType == XCB_GE_GENERIC) {
|
||||
if (!hasXInput2())
|
||||
@ -948,7 +925,6 @@ bool QXcbConnection::compressEvent(xcb_generic_event_t *event) const
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (responseType == XCB_CONFIGURE_NOTIFY) {
|
||||
// compress multiple configure notify events for the same window
|
||||
@ -978,7 +954,6 @@ bool QXcbConnection::isUserInputEvent(xcb_generic_event_t *event) const
|
||||
if (isInputEvent)
|
||||
return true;
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
if (connection()->hasXInput2()) {
|
||||
isInputEvent = isXIType(event, XCB_INPUT_BUTTON_PRESS) ||
|
||||
isXIType(event, XCB_INPUT_BUTTON_RELEASE) ||
|
||||
@ -993,7 +968,6 @@ bool QXcbConnection::isUserInputEvent(xcb_generic_event_t *event) const
|
||||
}
|
||||
if (isInputEvent)
|
||||
return true;
|
||||
#endif
|
||||
|
||||
if (eventType == XCB_CLIENT_MESSAGE) {
|
||||
auto clientMessage = reinterpret_cast<const xcb_client_message_event_t *>(event);
|
||||
|
@ -104,10 +104,8 @@ public:
|
||||
virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {}
|
||||
virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {}
|
||||
virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {}
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {}
|
||||
virtual void handleXIEnterLeave(xcb_ge_event_t *) {}
|
||||
#endif
|
||||
virtual QXcbWindow *toWindow() { return nullptr; }
|
||||
};
|
||||
|
||||
@ -225,7 +223,6 @@ public:
|
||||
|
||||
bool isUserInputEvent(xcb_generic_event_t *event) const;
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
void xi2SelectStateEvents();
|
||||
void xi2SelectDeviceEvents(xcb_window_t window);
|
||||
void xi2SelectDeviceEventsCompatibility(xcb_window_t window);
|
||||
@ -236,7 +233,6 @@ public:
|
||||
bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner);
|
||||
void abortSystemMoveResizeForTouch();
|
||||
bool isTouchScreen(int id);
|
||||
#endif
|
||||
|
||||
bool canGrab() const { return m_canGrabServer; }
|
||||
|
||||
@ -267,7 +263,6 @@ private:
|
||||
inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const
|
||||
{ return static_cast<int32_t>(a - b) > 0 || b == XCB_CURRENT_TIME; }
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
void xi2SetupDevice(void *info, bool removeExisting = true);
|
||||
void xi2SetupDevices();
|
||||
struct TouchDeviceData {
|
||||
@ -341,7 +336,6 @@ private:
|
||||
uint32_t pointid;
|
||||
int corner;
|
||||
} m_startSystemMoveResizeInfo;
|
||||
#endif // QT_CONFIG(xcb_xinput)
|
||||
|
||||
const bool m_canGrabServer;
|
||||
const xcb_visualid_t m_defaultVisualId;
|
||||
@ -389,12 +383,10 @@ private:
|
||||
QTimer m_focusInTimer;
|
||||
|
||||
};
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
#if QT_CONFIG(tabletevent)
|
||||
Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE);
|
||||
Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
class QXcbConnectionGrabber
|
||||
{
|
||||
|
@ -45,14 +45,10 @@
|
||||
#include <xcb/xfixes.h>
|
||||
#include <xcb/xinerama.h>
|
||||
#include <xcb/render.h>
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
#include <xcb/xinput.h>
|
||||
#endif
|
||||
#if QT_CONFIG(xkb)
|
||||
#define explicit dont_use_cxx_explicit
|
||||
#include <xcb/xkb.h>
|
||||
#undef explicit
|
||||
#endif
|
||||
|
||||
#if QT_CONFIG(xcb_xlib)
|
||||
#define register /* C++17 deprecated register */
|
||||
@ -138,14 +134,7 @@ QXcbBasicConnection::QXcbBasicConnection(const char *displayName)
|
||||
|
||||
xcb_extension_t *extensions[] = {
|
||||
&xcb_shm_id, &xcb_xfixes_id, &xcb_randr_id, &xcb_shape_id, &xcb_sync_id,
|
||||
&xcb_render_id,
|
||||
#if QT_CONFIG(xkb)
|
||||
&xcb_xkb_id,
|
||||
#endif
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
&xcb_input_id,
|
||||
#endif
|
||||
0
|
||||
&xcb_render_id, &xcb_xkb_id, &xcb_input_id, 0
|
||||
};
|
||||
|
||||
for (xcb_extension_t **ext_it = extensions; *ext_it; ++ext_it)
|
||||
@ -160,10 +149,8 @@ QXcbBasicConnection::QXcbBasicConnection(const char *displayName)
|
||||
initializeXinerama();
|
||||
initializeXFixes();
|
||||
initializeXRender();
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
if (!qEnvironmentVariableIsSet("QT_XCB_NO_XI2"))
|
||||
initializeXInput2();
|
||||
#endif
|
||||
initializeXShape();
|
||||
initializeXKB();
|
||||
}
|
||||
@ -213,7 +200,6 @@ bool QXcbBasicConnection::hasBigRequest() const
|
||||
return m_maximumRequestLength > m_setup->maximum_request_length;
|
||||
}
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
// Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed:
|
||||
// - "pad0" became "extension"
|
||||
// - "pad1" and "pad" became "pad0"
|
||||
@ -240,7 +226,6 @@ bool QXcbBasicConnection::isXIType(xcb_generic_event_t *event, uint16_t type) co
|
||||
auto *e = reinterpret_cast<qt_xcb_ge_event_t *>(event);
|
||||
return e->event_type == type;
|
||||
}
|
||||
#endif // QT_CONFIG(xcb_xinput)
|
||||
|
||||
bool QXcbBasicConnection::isXFixesType(uint responseType, int eventType) const
|
||||
{
|
||||
@ -370,7 +355,6 @@ void QXcbBasicConnection::initializeXRandr()
|
||||
m_xrandrFirstEvent = reply->first_event;
|
||||
}
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
void QXcbBasicConnection::initializeXInput2()
|
||||
{
|
||||
const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_xcbConnection, &xcb_input_id);
|
||||
@ -393,7 +377,6 @@ void QXcbBasicConnection::initializeXInput2()
|
||||
m_xinputFirstEvent = reply->first_event;
|
||||
m_xi2Minor = xinputQuery->minor_version;
|
||||
}
|
||||
#endif
|
||||
|
||||
void QXcbBasicConnection::initializeXShape()
|
||||
{
|
||||
@ -417,7 +400,6 @@ void QXcbBasicConnection::initializeXShape()
|
||||
|
||||
void QXcbBasicConnection::initializeXKB()
|
||||
{
|
||||
#if QT_CONFIG(xkb)
|
||||
const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_xcbConnection, &xcb_xkb_id);
|
||||
if (!reply || !reply->present) {
|
||||
qCWarning(lcQpaXcb, "XKeyboard extension not present on the X server");
|
||||
@ -439,7 +421,6 @@ void QXcbBasicConnection::initializeXKB()
|
||||
|
||||
m_hasXkb = true;
|
||||
m_xkbFirstEvent = reply->first_event;
|
||||
#endif
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -99,12 +99,10 @@ public:
|
||||
bool hasXinerama() const { return m_hasXinerama; }
|
||||
bool hasBigRequest() const;
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; }
|
||||
bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; }
|
||||
bool isXIEvent(xcb_generic_event_t *event) const;
|
||||
bool isXIType(xcb_generic_event_t *event, uint16_t type) const;
|
||||
#endif
|
||||
|
||||
bool isXFixesType(uint responseType, int eventType) const;
|
||||
bool isXRandrType(uint responseType, int eventType) const;
|
||||
@ -119,9 +117,7 @@ protected:
|
||||
void initializeXShape();
|
||||
void initializeXKB();
|
||||
void initializeXSync();
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
void initializeXInput2();
|
||||
#endif
|
||||
|
||||
private:
|
||||
#if QT_CONFIG(xcb_xlib)
|
||||
@ -147,11 +143,9 @@ private:
|
||||
QPair<int, int> m_xrenderVersion;
|
||||
|
||||
bool m_xi2Enabled = false;
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
int m_xi2Minor = -1;
|
||||
int m_xiOpCode = -1;
|
||||
uint32_t m_xinputFirstEvent = 0;
|
||||
#endif
|
||||
|
||||
uint32_t m_xfixesFirstEvent = 0;
|
||||
uint32_t m_xrandrFirstEvent = 0;
|
||||
|
@ -49,13 +49,7 @@
|
||||
|
||||
#include <private/qguiapplication_p.h>
|
||||
|
||||
#if QT_CONFIG(xkb)
|
||||
#include <xkbcommon/xkbcommon-x11.h>
|
||||
#endif
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
#include <xcb/xinput.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -392,20 +386,16 @@ void QXcbKeyboard::updateKeymap()
|
||||
xkb_context_set_log_level(m_xkbContext.get(), logLevel);
|
||||
}
|
||||
|
||||
#if QT_CONFIG(xkb)
|
||||
if (connection()->hasXKB()) {
|
||||
m_xkbKeymap.reset(xkb_x11_keymap_new_from_device(m_xkbContext.get(), xcb_connection(),
|
||||
core_device_id, XKB_KEYMAP_COMPILE_NO_FLAGS));
|
||||
if (m_xkbKeymap)
|
||||
m_xkbState.reset(xkb_x11_state_new_from_device(m_xkbKeymap.get(), xcb_connection(), core_device_id));
|
||||
} else {
|
||||
#endif
|
||||
m_xkbKeymap.reset(keymapFromCore(keysymMods));
|
||||
if (m_xkbKeymap)
|
||||
m_xkbState.reset(xkb_state_new(m_xkbKeymap.get()));
|
||||
#if QT_CONFIG(xkb)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!m_xkbKeymap) {
|
||||
qCWarning(lcQpaKeyboard, "failed to compile a keymap");
|
||||
@ -428,7 +418,6 @@ QList<int> QXcbKeyboard::possibleKeys(const QKeyEvent *event) const
|
||||
return QXkbCommon::possibleKeys(m_xkbState.get(), event, m_superAsMeta, m_hyperAsMeta);
|
||||
}
|
||||
|
||||
#if QT_CONFIG(xkb)
|
||||
void QXcbKeyboard::updateXKBState(xcb_xkb_state_notify_event_t *state)
|
||||
{
|
||||
if (m_config && connection()->hasXKB()) {
|
||||
@ -444,7 +433,6 @@ void QXcbKeyboard::updateXKBState(xcb_xkb_state_notify_event_t *state)
|
||||
handleStateChanges(changedComponents);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static xkb_layout_index_t lockedGroup(quint16 state)
|
||||
{
|
||||
@ -473,7 +461,6 @@ void QXcbKeyboard::updateXKBStateFromCore(quint16 state)
|
||||
}
|
||||
}
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
void QXcbKeyboard::updateXKBStateFromXI(void *modInfo, void *groupInfo)
|
||||
{
|
||||
if (m_config && !connection()->hasXKB()) {
|
||||
@ -491,7 +478,6 @@ void QXcbKeyboard::updateXKBStateFromXI(void *modInfo, void *groupInfo)
|
||||
handleStateChanges(changedComponents);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void QXcbKeyboard::handleStateChanges(xkb_state_component changedComponents)
|
||||
{
|
||||
@ -541,7 +527,6 @@ void QXcbKeyboard::updateXKBMods()
|
||||
QXcbKeyboard::QXcbKeyboard(QXcbConnection *connection)
|
||||
: QXcbObject(connection)
|
||||
{
|
||||
#if QT_CONFIG(xkb)
|
||||
core_device_id = 0;
|
||||
if (connection->hasXKB()) {
|
||||
selectEvents();
|
||||
@ -551,11 +536,9 @@ QXcbKeyboard::QXcbKeyboard(QXcbConnection *connection)
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
m_key_symbols = xcb_key_symbols_alloc(xcb_connection());
|
||||
#if QT_CONFIG(xkb)
|
||||
}
|
||||
#endif
|
||||
|
||||
updateKeymap();
|
||||
}
|
||||
|
||||
@ -573,7 +556,6 @@ void QXcbKeyboard::initialize()
|
||||
|
||||
void QXcbKeyboard::selectEvents()
|
||||
{
|
||||
#if QT_CONFIG(xkb)
|
||||
const uint16_t required_map_parts = (XCB_XKB_MAP_PART_KEY_TYPES |
|
||||
XCB_XKB_MAP_PART_KEY_SYMS |
|
||||
XCB_XKB_MAP_PART_MODIFIER_MAP |
|
||||
@ -604,12 +586,10 @@ void QXcbKeyboard::selectEvents()
|
||||
free(error);
|
||||
qCWarning(lcQpaXcb, "failed to select notify events from XKB");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void QXcbKeyboard::updateVModMapping()
|
||||
{
|
||||
#if QT_CONFIG(xkb)
|
||||
xcb_xkb_get_names_value_list_t names_list;
|
||||
|
||||
memset(&vmod_masks, 0, sizeof(vmod_masks));
|
||||
@ -667,12 +647,10 @@ void QXcbKeyboard::updateVModMapping()
|
||||
else if (qstrcmp(vmod_name, "Hyper") == 0)
|
||||
vmod_masks.hyper = bit;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void QXcbKeyboard::updateVModToRModMapping()
|
||||
{
|
||||
#if QT_CONFIG(xkb)
|
||||
xcb_xkb_get_map_map_t map;
|
||||
|
||||
memset(&rmod_masks, 0, sizeof(rmod_masks));
|
||||
@ -729,7 +707,6 @@ void QXcbKeyboard::updateVModToRModMapping()
|
||||
else if (vmod_masks.hyper == bit)
|
||||
rmod_masks.hyper = modmap;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Small helper: set modifier bit, if modifier position is valid
|
||||
|
@ -43,14 +43,12 @@
|
||||
#include "qxcbobject.h"
|
||||
|
||||
#include <xcb/xcb_keysyms.h>
|
||||
#if QT_CONFIG(xkb)
|
||||
#define explicit dont_use_cxx_explicit
|
||||
#include <xcb/xkb.h>
|
||||
#undef explicit
|
||||
#endif
|
||||
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
#include <QtXkbCommonSupport/private/qxkbcommon_p.h>
|
||||
#include <xkbcommon/xkbcommon-x11.h>
|
||||
|
||||
#include <QEvent>
|
||||
|
||||
@ -74,18 +72,14 @@ public:
|
||||
void updateKeymap();
|
||||
QList<int> possibleKeys(const QKeyEvent *event) const;
|
||||
|
||||
// when XKEYBOARD not present on the X server
|
||||
void updateXKBMods();
|
||||
xkb_mod_mask_t xkbModMask(quint16 state);
|
||||
void updateXKBStateFromCore(quint16 state);
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
void updateXKBStateFromXI(void *modInfo, void *groupInfo);
|
||||
#endif
|
||||
#if QT_CONFIG(xkb)
|
||||
// when XKEYBOARD is present on the X server
|
||||
|
||||
int coreDeviceId() const { return core_device_id; }
|
||||
void updateXKBState(xcb_xkb_state_notify_event_t *state);
|
||||
#endif
|
||||
|
||||
void handleStateChanges(xkb_state_component changedComponents);
|
||||
|
||||
protected:
|
||||
@ -97,10 +91,9 @@ protected:
|
||||
typedef QMap<xcb_keysym_t, int> KeysymModifierMap;
|
||||
struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods);
|
||||
|
||||
// when XKEYBOARD not present on the X server
|
||||
void updateModifiers(const KeysymModifierMap &keysymMods);
|
||||
KeysymModifierMap keysymsToModifiers();
|
||||
// when XKEYBOARD is present on the X server
|
||||
|
||||
void updateVModMapping();
|
||||
void updateVModToRModMapping();
|
||||
|
||||
@ -119,7 +112,6 @@ private:
|
||||
|
||||
_mod_masks rmod_masks;
|
||||
|
||||
// when XKEYBOARD not present on the X server
|
||||
xcb_key_symbols_t *m_key_symbols = nullptr;
|
||||
struct _xkb_mods {
|
||||
xkb_mod_index_t shift;
|
||||
@ -132,11 +124,9 @@ private:
|
||||
xkb_mod_index_t mod5;
|
||||
};
|
||||
_xkb_mods xkb_mods;
|
||||
#if QT_CONFIG(xkb)
|
||||
// when XKEYBOARD is present on the X server
|
||||
|
||||
_mod_masks vmod_masks;
|
||||
int core_device_id;
|
||||
#endif
|
||||
|
||||
QXkbCommon::ScopedXKBState m_xkbState;
|
||||
QXkbCommon::ScopedXKBKeymap m_xkbKeymap;
|
||||
|
@ -67,9 +67,7 @@
|
||||
#include <xcb/xcb_icccm.h>
|
||||
#include <xcb/xfixes.h>
|
||||
#include <xcb/shape.h>
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
#include <xcb/xinput.h>
|
||||
#endif
|
||||
|
||||
#include <private/qguiapplication_p.h>
|
||||
#include <private/qwindow_p.h>
|
||||
@ -492,14 +490,12 @@ void QXcbWindow::create()
|
||||
atom(QXcbAtom::_XEMBED_INFO),
|
||||
32, 2, (void *)data);
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
if (connection()->hasXInput2()) {
|
||||
if (connection()->xi2MouseEventsDisabled())
|
||||
connection()->xi2SelectDeviceEventsCompatibility(m_window);
|
||||
else
|
||||
connection()->xi2SelectDeviceEvents(m_window);
|
||||
}
|
||||
#endif
|
||||
|
||||
setWindowState(window()->windowStates());
|
||||
setWindowFlags(window()->flags());
|
||||
@ -1895,9 +1891,7 @@ void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, in
|
||||
QPoint global(root_x, root_y);
|
||||
|
||||
if (isWheel) {
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
if (!connection()->isAtLeastXI21()) {
|
||||
#endif
|
||||
QPoint angleDelta;
|
||||
if (detail == 4)
|
||||
angleDelta.setY(120);
|
||||
@ -1910,9 +1904,7 @@ void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, in
|
||||
if (modifiers & Qt::AltModifier)
|
||||
angleDelta = angleDelta.transposed();
|
||||
QWindowSystemInterface::handleWheelEvent(window(), timestamp, local, global, QPoint(), angleDelta, modifiers);
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1948,13 +1940,8 @@ static inline bool doCheckUnGrabAncestor(QXcbConnection *conn)
|
||||
* not pressed, otherwise (e.g. on Alt+Tab) it can igonre important enter/leave events.
|
||||
*/
|
||||
if (conn) {
|
||||
|
||||
const bool mouseButtonsPressed = (conn->buttonState() != Qt::NoButton);
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
return mouseButtonsPressed || (conn->hasXInput2() && !conn->xi2MouseEventsDisabled());
|
||||
#else
|
||||
return mouseButtonsPressed;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -1986,10 +1973,9 @@ void QXcbWindow::handleEnterNotifyEvent(int event_x, int event_y, int root_x, in
|
||||
|
||||
if (ignoreEnterEvent(mode, detail, connection()) || connection()->mousePressWindow())
|
||||
return;
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
|
||||
// Updates scroll valuators, as user might have done some scrolling outside our X client.
|
||||
connection()->xi2UpdateScrollingDevices();
|
||||
#endif
|
||||
|
||||
const QPoint local(event_x, event_y);
|
||||
QWindowSystemInterface::handleEnterEvent(window(), local, global);
|
||||
@ -2064,7 +2050,6 @@ void QXcbWindow::handleMotionNotifyEvent(const xcb_motion_notify_event_t *event)
|
||||
event->time, QEvent::MouseMove);
|
||||
}
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
static inline int fixed1616ToInt(xcb_input_fp1616_t val)
|
||||
{
|
||||
return int(qreal(val) / 0x10000);
|
||||
@ -2165,7 +2150,6 @@ void QXcbWindow::handleXIEnterLeave(xcb_ge_event_t *event)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
QXcbWindow *QXcbWindow::toWindow() { return this; }
|
||||
|
||||
@ -2301,14 +2285,12 @@ bool QXcbWindow::setMouseGrabEnabled(bool grab)
|
||||
if (grab && !connection()->canGrab())
|
||||
return false;
|
||||
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
if (connection()->hasXInput2() && !connection()->xi2MouseEventsDisabled()) {
|
||||
bool result = connection()->xi2SetMouseGrabEnabled(m_window, grab);
|
||||
if (grab && result)
|
||||
connection()->setMouseGrabber(this);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!grab) {
|
||||
xcb_ungrab_pointer(xcb_connection(), XCB_TIME_CURRENT_TIME);
|
||||
@ -2376,7 +2358,7 @@ bool QXcbWindow::startSystemMoveResize(const QPoint &pos, int corner)
|
||||
return false;
|
||||
|
||||
const QPoint globalPos = QHighDpi::toNativePixels(window()->mapToGlobal(pos), window()->screen());
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
|
||||
// ### FIXME QTBUG-53389
|
||||
bool startedByTouch = connection()->startSystemMoveResizeForTouchBegin(m_window, globalPos, corner);
|
||||
if (startedByTouch) {
|
||||
@ -2386,9 +2368,7 @@ bool QXcbWindow::startSystemMoveResize(const QPoint &pos, int corner)
|
||||
return false;
|
||||
}
|
||||
// KWin, Openbox, AwesomeWM have been tested to work with _NET_WM_MOVERESIZE.
|
||||
} else
|
||||
#endif
|
||||
{ // Started by mouse press.
|
||||
} else { // Started by mouse press.
|
||||
if (connection()->isUnity())
|
||||
return false; // _NET_WM_MOVERESIZE on this WM is bouncy (WM bug?).
|
||||
|
||||
|
@ -137,10 +137,8 @@ public:
|
||||
void handleFocusInEvent(const xcb_focus_in_event_t *event) override;
|
||||
void handleFocusOutEvent(const xcb_focus_out_event_t *event) override;
|
||||
void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override;
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override;
|
||||
void handleXIEnterLeave(xcb_ge_event_t *) override;
|
||||
#endif
|
||||
|
||||
QXcbWindow *toWindow() override;
|
||||
|
||||
|
@ -1,80 +0,0 @@
|
||||
#
|
||||
# Statically compile in code for
|
||||
# libxcb-fixes, libxcb-randr, libxcb-shm, libxcb-sync, libxcb-image,
|
||||
# libxcb-keysyms, libxcb-icccm, libxcb-renderutil, libxcb-xkb,
|
||||
# libxcb-xinerama, libxcb-xinput
|
||||
#
|
||||
CONFIG += static
|
||||
|
||||
XCB_DIR = $$QT_SOURCE_TREE/src/3rdparty/xcb
|
||||
|
||||
MODULE_INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/sysinclude
|
||||
INCLUDEPATH += $$XCB_DIR/include/xcb
|
||||
|
||||
QMAKE_USE += xcb/nolink
|
||||
|
||||
# ignore compiler warnings in 3rdparty code
|
||||
QMAKE_CFLAGS_STATIC_LIB+=-w
|
||||
|
||||
#
|
||||
# libxcb
|
||||
#
|
||||
LIBXCB_DIR = $$XCB_DIR/libxcb
|
||||
|
||||
SOURCES += \
|
||||
$$LIBXCB_DIR/xfixes.c \
|
||||
$$LIBXCB_DIR/randr.c \
|
||||
$$LIBXCB_DIR/shm.c \
|
||||
$$LIBXCB_DIR/sync.c \
|
||||
$$LIBXCB_DIR/render.c \
|
||||
$$LIBXCB_DIR/shape.c \
|
||||
$$LIBXCB_DIR/xkb.c \
|
||||
$$LIBXCB_DIR/xinerama.c \
|
||||
$$LIBXCB_DIR/xinput.c
|
||||
|
||||
#
|
||||
# xcb-util
|
||||
#
|
||||
XCB_UTIL_DIR = $$XCB_DIR/xcb-util
|
||||
|
||||
|
||||
SOURCES += \
|
||||
$$XCB_UTIL_DIR/xcb_aux.c \
|
||||
$$XCB_UTIL_DIR/atoms.c \
|
||||
$$XCB_UTIL_DIR/event.c
|
||||
|
||||
#
|
||||
# xcb-util-image
|
||||
#
|
||||
XCB_IMAGE_DIR = $$XCB_DIR/xcb-util-image
|
||||
|
||||
SOURCES += $$XCB_IMAGE_DIR/xcb_image.c
|
||||
|
||||
#
|
||||
# xcb-util-keysyms
|
||||
#
|
||||
XCB_KEYSYMS_DIR = $$XCB_DIR/xcb-util-keysyms
|
||||
|
||||
SOURCES += $$XCB_KEYSYMS_DIR/keysyms.c
|
||||
|
||||
#
|
||||
# xcb-util-renderutil
|
||||
#
|
||||
|
||||
XCB_RENDERUTIL_DIR = $$XCB_DIR/xcb-util-renderutil
|
||||
|
||||
SOURCES += $$XCB_RENDERUTIL_DIR/util.c
|
||||
|
||||
#
|
||||
# xcb-util-wm
|
||||
#
|
||||
XCB_WM_DIR = $$XCB_DIR/xcb-util-wm
|
||||
|
||||
SOURCES += \
|
||||
$$XCB_WM_DIR/icccm.c
|
||||
|
||||
OTHER_FILES = $$XCB_DIR/README
|
||||
|
||||
TR_EXCLUDE += $$XCB_DIR/*
|
||||
|
||||
load(qt_helper_lib)
|
@ -2,8 +2,6 @@ TEMPLATE = subdirs
|
||||
CONFIG += ordered
|
||||
QT_FOR_CONFIG += gui-private
|
||||
|
||||
!qtConfig(system-xcb): SUBDIRS += xcb-static
|
||||
|
||||
SUBDIRS += xcb_qpa_lib.pro
|
||||
SUBDIRS += xcb-plugin.pro
|
||||
SUBDIRS += gl_integrations
|
||||
|
@ -35,6 +35,7 @@ SOURCES = \
|
||||
qxcbeventdispatcher.cpp \
|
||||
qxcbconnection_basic.cpp \
|
||||
qxcbconnection_screens.cpp \
|
||||
qxcbconnection_xi2.cpp \
|
||||
qxcbatom.cpp
|
||||
|
||||
HEADERS = \
|
||||
@ -71,10 +72,6 @@ qtConfig(xcb-xlib) {
|
||||
QMAKE_USE += xcb_xlib
|
||||
}
|
||||
|
||||
qtConfig(xcb-xinput) {
|
||||
SOURCES += qxcbconnection_xi2.cpp
|
||||
}
|
||||
|
||||
qtConfig(xcb-sm) {
|
||||
QMAKE_USE += x11sm
|
||||
SOURCES += qxcbsessionmanager.cpp
|
||||
@ -94,20 +91,19 @@ qtConfig(vulkan) {
|
||||
qxcbvulkanwindow.h
|
||||
}
|
||||
|
||||
!qtConfig(system-xcb) {
|
||||
QMAKE_USE += xcb-static
|
||||
} else {
|
||||
qtConfig(xcb-xinput): QMAKE_USE += xcb_xinput
|
||||
QMAKE_USE += \
|
||||
xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil \
|
||||
xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama
|
||||
}
|
||||
QMAKE_USE += xcb
|
||||
QMAKE_USE += \
|
||||
xcb xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil \
|
||||
xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb_xkb xkbcommon xkbcommon_x11
|
||||
|
||||
QMAKE_USE += xkbcommon
|
||||
qtConfig(xkb) {
|
||||
QMAKE_USE += xkbcommon_x11
|
||||
qtConfig(system-xcb): QMAKE_USE += xcb_xkb
|
||||
qtConfig(system-xcb-xinput) {
|
||||
QMAKE_USE += xcb_xinput
|
||||
} else {
|
||||
# Use bundled xcb-xinput sources.
|
||||
XCB_DIR = $$QT_SOURCE_TREE/src/3rdparty/xcb
|
||||
INCLUDEPATH += $$XCB_DIR/include/
|
||||
SOURCES += $$XCB_DIR/libxcb/xinput.c
|
||||
# Ignore compiler warnings in 3rdparty C code.
|
||||
QMAKE_CFLAGS+=-w
|
||||
}
|
||||
|
||||
qtConfig(dlopen): QMAKE_USE += libdl
|
||||
|
Loading…
Reference in New Issue
Block a user