| 1 | // Copyright (C) 2025 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QWAYLANDEVENTDISPATCHER_P_H |
| 5 | #define QWAYLANDEVENTDISPATCHER_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtGui/private/qunixeventdispatcher_qpa_p.h> |
| 19 | #if !defined(QT_NO_GLIB) && !defined(Q_OS_WIN) |
| 20 | #include <QtGui/private/qeventdispatcher_glib_p.h> |
| 21 | #endif |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | namespace QtWaylandClient { |
| 26 | |
| 27 | class QWaylandEventDispatcher |
| 28 | { |
| 29 | public: |
| 30 | static QAbstractEventDispatcher *createEventDispatcher(); |
| 31 | |
| 32 | static QWaylandEventDispatcher *eventDispatcher; |
| 33 | |
| 34 | public: |
| 35 | QWaylandEventDispatcher(); |
| 36 | virtual ~QWaylandEventDispatcher(); |
| 37 | |
| 38 | virtual QEventLoop::ProcessEventsFlags flags() const = 0; |
| 39 | }; |
| 40 | |
| 41 | class QWaylandUnixEventDispatcher : public QUnixEventDispatcherQPA, QWaylandEventDispatcher |
| 42 | { |
| 43 | Q_OBJECT |
| 44 | public: |
| 45 | bool processEvents(QEventLoop::ProcessEventsFlags flags) override; |
| 46 | |
| 47 | QEventLoop::ProcessEventsFlags flags() const override; |
| 48 | |
| 49 | private: |
| 50 | QEventLoop::ProcessEventsFlags m_flags; |
| 51 | }; |
| 52 | |
| 53 | #if !defined(QT_NO_GLIB) && !defined(Q_OS_WIN) |
| 54 | |
| 55 | class QWaylandGlibEventDispatcher : public QPAEventDispatcherGlib, QWaylandEventDispatcher |
| 56 | { |
| 57 | Q_OBJECT |
| 58 | public: |
| 59 | QEventLoop::ProcessEventsFlags flags() const override; |
| 60 | }; |
| 61 | |
| 62 | #endif |
| 63 | |
| 64 | } |
| 65 | |
| 66 | QT_END_NAMESPACE |
| 67 | |
| 68 | #endif |
| 69 |
