4#ifndef QXCBCONNECTION_H
5#define QXCBCONNECTION_H
10#include <QtCore/QTimer>
11#include <QtGui/qpointingdevice.h>
12#include <QtGui/private/qtguiglobal_p.h>
16#include <qpa/qwindowsysteminterface.h>
17#include <QtCore/QLoggingCategory>
18#include <QtCore/private/qglobal_p.h>
23#if QT_CONFIG(tabletevent)
24#include <QTabletEvent>
109 const xcb_format_t *formatForDepth(uint8_t
depth)
const;
115#if Q_BYTE_ORDER == Q_BIG_ENDIAN
116 return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST;
118 return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST;
124#ifndef QT_NO_CLIPBOARD
127#if QT_CONFIG(draganddrop)
128 QXcbDrag *drag()
const {
return m_drag; }
132 xcb_window_t rootWindow();
133 xcb_window_t clientLeader();
140 void handleXcbError(xcb_generic_error_t *
error);
141 void printXcbError(
const char *
message, xcb_generic_error_t *
error);
142 void handleXcbEvent(xcb_generic_event_t *
event);
144 xcb_generic_event_t *
event)
const;
147 void removeWindowEventListener(xcb_window_t
id);
149 QXcbWindow *platformWindowFromId(xcb_window_t
id);
151 inline xcb_timestamp_t
time()
const {
return m_time; }
152 inline void setTime(xcb_timestamp_t
t) {
if (timeGreaterThan(
t, m_time)) m_time =
t; }
155 inline void setNetWmUserTime(xcb_timestamp_t
t) {
if (timeGreaterThan(
t, m_netWmUserTime)) m_netWmUserTime =
t; }
157 xcb_timestamp_t getTimestamp();
158 xcb_window_t selectionOwner(xcb_atom_t atom)
const;
159 xcb_window_t qtSelectionOwner();
167 void setFocusWindow(
QWindow *);
179 QString windowManagerName()
const;
186 Qt::KeyboardModifiers queryKeyboardModifiers()
const;
190 void xi2SelectStateEvents();
191 void xi2SelectDeviceEvents(xcb_window_t
window);
192 bool xi2SetMouseGrabEnabled(xcb_window_t
w,
bool grab);
195 void xi2UpdateScrollingDevices();
196 bool isTouchScreen(
int id);
198 bool startSystemMoveResizeForTouch(xcb_window_t
window,
int edges);
199 void abortSystemMoveResize(xcb_window_t
window);
200 bool isDuringSystemMoveResize()
const;
201 void setDuringSystemMoveResize(
bool during);
203 bool canGrab()
const {
return m_canGrabServer; }
208 void processXcbEvents(QEventLoop::ProcessEventsFlags
flags);
216 void xrandrSelectEvents();
217 QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc)
const;
218 QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t
output)
const;
220 void updateScreens(
const xcb_randr_notify_event_t *
event);
221 bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t
output);
222 void updateScreen(
QXcbScreen *
screen,
const xcb_randr_output_change_t &outputChange);
224 const xcb_randr_output_change_t &outputChange,
225 xcb_randr_get_output_info_reply_t *outputInfo);
227 void initializeScreens(
bool initialized);
228 void initializeScreensWithoutXRandR(xcb_screen_iterator_t *
it,
int screenNumber,
QXcbScreen **primaryScreen);
229 void initializeScreensFromOutput(xcb_screen_iterator_t *
it,
int screenNumber,
QXcbScreen **primaryScreen);
231 void updateScreen_monitor(
QXcbScreen *
screen, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE);
233 xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE);
236 void initializeScreensFromMonitor(xcb_screen_iterator_t *
it,
int screenNumber,
QXcbScreen **primaryScreen,
bool initialized);
238 bool compressEvent(xcb_generic_event_t *
event)
const;
239 inline bool timeGreaterThan(xcb_timestamp_t
a, xcb_timestamp_t
b)
const
240 {
return static_cast<int32_t
>(
a -
b) > 0 ||
b == XCB_CURRENT_TIME; }
242 void xi2SetupSlavePointerDevice(
void *
info,
bool removeExisting =
true,
QPointingDevice *master =
nullptr);
243 void xi2SetupDevices();
245 struct TouchDeviceData {
259 QPointF firstPressedNormalPosition;
261 bool providesTouchOrientation =
false;
264 TouchDeviceData *touchDeviceForId(
int id);
265 void xi2HandleEvent(xcb_ge_event_t *
event);
266 void xi2HandleGesturePinchEvent(
void *
event);
267 void xi2HandleGestureSwipeEvent(
void *
event);
268 void xi2HandleHierarchyEvent(
void *
event);
269 void xi2HandleDeviceChangedEvent(
void *
event);
270 void xi2ProcessTouch(
void *xiDevEvent,
QXcbWindow *platformWindow);
271#if QT_CONFIG(tabletevent)
278 Qt::MouseButtons buttons;
280 bool inProximity =
false;
281 struct ValuatorClassInfo {
290 friend class QTypeInfo<TabletData::ValuatorClassInfo>;
291 bool xi2HandleTabletEvent(const void *event, TabletData *tabletData);
292 void xi2ReportTabletEvent(const void *event, TabletData *tabletData);
293 QList<TabletData> m_tabletData;
294 TabletData *tabletDataForDevice(int id);
296 void xi2HandleScrollEvent(void *event, const QPointingDevice *scrollingDevice);
297 void xi2UpdateScrollingDevice(QInputDevice *scrollingDevice);
300 static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value);
302 QHash<int, TouchDeviceData> m_touchDevices;
304 struct StartSystemMoveResizeInfo {
305 xcb_window_t
window = XCB_NONE;
309 } m_startSystemMoveResizeInfo;
310 bool m_duringSystemMoveResize;
312 const bool m_canGrabServer;
313 const xcb_visualid_t m_defaultVisualId;
318 xcb_timestamp_t m_time = XCB_CURRENT_TIME;
319 xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME;
322#ifndef QT_NO_CLIPBOARD
325#if QT_CONFIG(draganddrop)
335 Qt::MouseButtons m_buttonState;
342#if QT_CONFIG(gestures)
343 qreal m_lastPinchScale = 0;
346 xcb_window_t m_clientLeader = 0;
350 mutable bool m_glIntegrationInitialized =
false;
351 bool m_xiGrab =
false;
355 xcb_window_t m_qtSelectionOwner = 0;
362#if QT_CONFIG(tabletevent)
\inmodule QtCore\reentrant
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
PointerType
This enum represents what is interacting with the pointing device.
\macro QT_RESTRICTED_CAST_FROM_ASCII
int primaryScreenNumber() const
xcb_connection_t * xcb_connection() const
const xcb_setup_t * setup() const
QXcbKeyboard * keyboard() const
QXcbWindow * mouseGrabber() const
QXcbWindow * mousePressWindow() const
Qt::MouseButtons buttonState() const
void setTime(xcb_timestamp_t t)
QXcbConnection * connection() const
xcb_visualid_t defaultVisualId() const
QXcbWindow * focusWindow() const
void setNetWmUserTime(xcb_timestamp_t t)
bool hasDefaultVisualId() const
bool imageNeedsEndianSwap() const
xcb_timestamp_t time() const
QXcbWMSupport * wmSupport() const
QXcbVirtualDesktop * primaryVirtualDesktop() const
const QList< QXcbVirtualDesktop * > & virtualDesktops() const
QXcbEventQueue * eventQueue() const
const QList< QXcbScreen * > & screens() const
Qt::MouseButton button() const
QXcbNativeInterface * nativeInterface() const
xcb_timestamp_t netWmUserTime() const
QXcbClipboard * clipboard() const
QXcbWindow * window() const
QXcbSyncWindowRequest(QXcbWindow *w)
virtual ~QXcbWindowEventListener()
virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *)
virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *)
virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource=Qt::MouseEventNotSynthesized)
virtual void handleButtonPressEvent(const xcb_button_press_event_t *)
virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *)
virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *)
virtual void handleClientMessageEvent(const xcb_client_message_event_t *)
virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *)
virtual void handleXIEnterLeave(xcb_ge_event_t *)
virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *)
virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *)
virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *)
virtual void handleExposeEvent(const xcb_expose_event_t *)
virtual void handleFocusOutEvent(const xcb_focus_out_event_t *)
virtual void handleFocusInEvent(const xcb_focus_in_event_t *)
virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *)
virtual bool handleNativeEvent(xcb_generic_event_t *)
virtual QXcbWindow * toWindow()
QSet< QString >::iterator it
Combined button and popup list for selecting options.
@ MouseEventNotSynthesized
static bool isUserInputEvent(NSEvent *event)
static QString displayName(CGDirectDisplayID displayID)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection const char DBusError * error
DBusConnection * connection
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLboolean GLboolean GLboolean b
GLint GLenum GLsizei GLsizei GLsizei depth
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLsizei const GLchar * message
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
QT_BEGIN_NAMESPACE typedef uchar * output
static Qt::MouseButtons queryMouseButtons()
static QPointingDevice::PointerType pointerType(unsigned currentCursor)
QHash< xcb_window_t, QXcbWindowEventListener * > WindowMapper
static QXcbSystemTrayTracker * systemTrayTracker(const QScreen *s)
QFileInfo info(fileName)
[8]