1/****************************************************************************
2**
3** Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
4** Copyright (C) 2017 The Qt Company Ltd.
5** Contact: https://www.qt.io/licensing/
6**
7** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:GPL$
10** Commercial License Usage
11** Licensees holding valid commercial Qt licenses may use this file in
12** accordance with the commercial license agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and The Qt Company. For licensing terms
15** and conditions see https://www.qt.io/terms-conditions. For further
16** information use the contact form at https://www.qt.io/contact-us.
17**
18** GNU General Public License Usage
19** Alternatively, this file may be used under the terms of the GNU
20** General Public License version 3 or (at your option) any later version
21** approved by the KDE Free Qt Foundation. The licenses are as published by
22** the Free Software Foundation and appearing in the file LICENSE.GPL3
23** included in the packaging of this file. Please review the following
24** information to ensure the GNU General Public License requirements will
25** be met: https://www.gnu.org/licenses/gpl-3.0.html.
26**
27** $QT_END_LICENSE$
28**
29****************************************************************************/
30
31#ifndef QWAYLANDQUICKOUTPUT_H
32#define QWAYLANDQUICKOUTPUT_H
33
34#include <QtQuick/QQuickWindow>
35#include <QtWaylandCompositor/qwaylandoutput.h>
36#include <QtWaylandCompositor/qwaylandquickchildren.h>
37
38QT_BEGIN_NAMESPACE
39
40class QWaylandQuickCompositor;
41class QQuickWindow;
42
43class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickOutput : public QWaylandOutput, public QQmlParserStatus
44{
45 Q_INTERFACES(QQmlParserStatus)
46 Q_OBJECT
47 Q_WAYLAND_COMPOSITOR_DECLARE_QUICK_CHILDREN(QWaylandQuickOutput)
48 Q_PROPERTY(bool automaticFrameCallback READ automaticFrameCallback WRITE setAutomaticFrameCallback NOTIFY automaticFrameCallbackChanged)
49public:
50 QWaylandQuickOutput();
51 QWaylandQuickOutput(QWaylandCompositor *compositor, QWindow *window);
52
53 void update() override;
54
55 bool automaticFrameCallback() const;
56 void setAutomaticFrameCallback(bool automatic);
57
58 QQuickItem *pickClickableItem(const QPointF &position);
59
60public Q_SLOTS:
61 void updateStarted();
62
63Q_SIGNALS:
64 void automaticFrameCallbackChanged();
65
66protected:
67 void initialize() override;
68 void classBegin() override;
69 void componentComplete() override;
70
71private:
72 void doFrameCallbacks();
73
74 bool m_updateScheduled = false;
75 bool m_automaticFrameCallback = true;
76};
77
78QT_END_NAMESPACE
79
80#endif
81

source code of qtwayland/src/compositor/compositor_api/qwaylandquickoutput.h