diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-03-31 13:58:46 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-04-06 09:13:19 (GMT) |
commit | 58b426fb62774b328be77f0c1b7bd31e0321daf0 (patch) | |
tree | 3345ee52ba6997e474e2229c4a9aa0f156785bf5 /src/plugins/platforms/wayland/qwaylanddisplay.h | |
parent | db566040b68dd175200c1e99a0ae410ed89df25d (diff) | |
download | Qt-58b426fb62774b328be77f0c1b7bd31e0321daf0.zip Qt-58b426fb62774b328be77f0c1b7bd31e0321daf0.tar.gz Qt-58b426fb62774b328be77f0c1b7bd31e0321daf0.tar.bz2 |
Lighthouse: Make wayland event handling happen in a separate thread
Diffstat (limited to 'src/plugins/platforms/wayland/qwaylanddisplay.h')
-rw-r--r-- | src/plugins/platforms/wayland/qwaylanddisplay.h | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.h b/src/plugins/platforms/wayland/qwaylanddisplay.h index 481f829..4cfb7b5 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.h +++ b/src/plugins/platforms/wayland/qwaylanddisplay.h @@ -45,6 +45,8 @@ #include <QtCore/QObject> #include <QtCore/QRect> +#include <QtCore/QWaitCondition> + #include <wayland-client.h> class QWaylandInputDevice; @@ -53,6 +55,7 @@ class QWaylandBuffer; class QPlatformScreen; class QWaylandScreen; class QWaylandGLIntegration; +class QWaylandEventThread; class QWaylandDisplay : public QObject { Q_OBJECT @@ -61,7 +64,6 @@ public: QWaylandDisplay(void); ~QWaylandDisplay(void); - void createNewScreen(struct wl_output *output, QRect geometry); QList<QPlatformScreen *> screens() const { return mScreens; } struct wl_surface *createSurface(void *handle); struct wl_buffer *createShmBuffer(int fd, int width, int height, @@ -76,49 +78,33 @@ public: #endif void setCursor(QWaylandBuffer *buffer, int32_t x, int32_t y); + void syncCallback(wl_display_sync_func_t func, void *data); void frameCallback(wl_display_frame_func_t func, void *data); - void iterate(); - struct wl_display *wl_display() const { return mDisplay; } public slots: - void readEvents(void); - void flushRequests(void); + void createNewScreen(struct wl_output *output, QRect geometry); + void displayHandleGlobal(uint32_t id, QByteArray interface, uint32_t version); private: struct wl_display *mDisplay; + QWaylandEventThread *mEventThread; struct wl_compositor *mCompositor; struct wl_shm *mShm; struct wl_shell *mShell; - char *mDeviceName; - int mFd; QList<QPlatformScreen *> mScreens; QList<QWaylandInputDevice *> mInputDevices; - QSocketNotifier *mReadNotifier; - QSocketNotifier *mWriteNotifier; + #ifdef QT_WAYLAND_GL_SUPPORT QWaylandGLIntegration *mEglIntegration; #endif - static void displayHandleGlobal(struct wl_display *display, - uint32_t id, - const char *interface, - uint32_t version, void *data); - - static void outputHandleGeometry(void *data, - struct wl_output *output, - int32_t x, int32_t y, - int32_t width, int32_t height); - static void shellHandleConfigure(void *data, struct wl_shell *shell, uint32_t time, uint32_t edges, struct wl_surface *surface, int32_t width, int32_t height); - static int sourceUpdate(uint32_t mask, void *data); - - static const struct wl_output_listener outputListener; static const struct wl_shell_listener shellListener; }; |