summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandeventthread.h
blob: ba7e33e099898e2c5516945be4f58e9eb08974f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef QWAYLANDEVENTTHREAD_H
#define QWAYLANDEVENTTHREAD_H

#include <QObject>
#include <QMutex>
#include <wayland-client.h>

#include <QtWaylandClient/qwaylandclientexport.h>

QT_BEGIN_NAMESPACE

class QSocketNotifier;

class Q_WAYLAND_CLIENT_EXPORT QWaylandEventThread : public QObject
{
    Q_OBJECT
public:
    explicit QWaylandEventThread(QObject *parent = 0);
    ~QWaylandEventThread();

    void displayConnect();

    wl_display *display() const;

private slots:
    void readWaylandEvents();

    void waylandDisplayConnect();

signals:
    void newEventsRead();

private:

    struct wl_display *m_display;
    int m_fileDescriptor;

    QSocketNotifier *m_readNotifier;

    QMutex *m_displayLock;

};

QT_END_NAMESPACE

#endif // QWAYLANDEVENTTHREAD_H