summaryrefslogtreecommitdiffstats
path: root/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.h
blob: 14d9770a813530a6d95a04aa65cea4a522ca0b41 (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
// Copyright (C) 2017 ITAGE Corporation, author: <yusuke.binsaki@itage.co.jp>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QWAYLANDIVIINTEGRATION_H
#define QWAYLANDIVIINTEGRATION_H

#include <QtCore/qmutex.h>

#include <QtWaylandClient/private/qwaylandshellintegration_p.h>
#include "qwayland-ivi-application.h"
#include "qwayland-ivi-controller.h"

QT_BEGIN_NAMESPACE

namespace QtWaylandClient {

class QWaylandWindow;
class QWaylandDisplay;
class QWaylandIviController;

class Q_WAYLANDCLIENT_EXPORT QWaylandIviShellIntegration
    : public QWaylandShellIntegrationTemplate<QWaylandIviShellIntegration>,
      public QtWayland::ivi_application
{
public:
    QWaylandIviShellIntegration();

    bool initialize(QWaylandDisplay *display) override;
    QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override;

private:
    uint32_t getNextUniqueSurfaceId();

private:
    QScopedPointer<QWaylandIviController> m_iviController;
    uint32_t m_lastSurfaceId = 0;
    uint32_t m_surfaceNumber = 0;
    bool m_useEnvSurfaceId = false;
    QRecursiveMutex m_mutex;
};

}

QT_END_NAMESPACE

#endif //  QWAYLANDIVIINTEGRATION_H