qwaylandquickoutput.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
  4. ** Copyright (C) 2015 The Qt Company Ltd.
  5. ** Contact: http://www.qt.io/licensing/
  6. **
  7. ** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
  8. **
  9. ** $QT_BEGIN_LICENSE:LGPL3$
  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 http://www.qt.io/terms-conditions. For further
  16. ** information use the contact form at http://www.qt.io/contact-us.
  17. **
  18. ** GNU Lesser General Public License Usage
  19. ** Alternatively, this file may be used under the terms of the GNU Lesser
  20. ** General Public License version 3 as published by the Free Software
  21. ** Foundation and appearing in the file LICENSE.LGPLv3 included in the
  22. ** packaging of this file. Please review the following information to
  23. ** ensure the GNU Lesser General Public License version 3 requirements
  24. ** will be met: https://www.gnu.org/licenses/lgpl.html.
  25. **
  26. ** GNU General Public License Usage
  27. ** Alternatively, this file may be used under the terms of the GNU
  28. ** General Public License version 2.0 or later as published by the Free
  29. ** Software Foundation and appearing in the file LICENSE.GPL included in
  30. ** the packaging of this file. Please review the following information to
  31. ** ensure the GNU General Public License version 2.0 requirements will be
  32. ** met: http://www.gnu.org/licenses/gpl-2.0.html.
  33. **
  34. ** $QT_END_LICENSE$
  35. **
  36. ****************************************************************************/
  37. #ifndef QWAYLANDQUICKOUTPUT_H
  38. #define QWAYLANDQUICKOUTPUT_H
  39. #include <QtQuick/QQuickWindow>
  40. #include <QtWaylandCompositor/qwaylandoutput.h>
  41. QT_BEGIN_NAMESPACE
  42. class QWaylandQuickCompositor;
  43. class QQuickWindow;
  44. class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickOutput : public QWaylandOutput
  45. {
  46. Q_OBJECT
  47. Q_PROPERTY(bool automaticFrameCallback READ automaticFrameCallback WRITE setAutomaticFrameCallback NOTIFY automaticFrameCallbackChanged)
  48. public:
  49. QWaylandQuickOutput();
  50. QWaylandQuickOutput(QWaylandCompositor *compositor, QWindow *window);
  51. void update() Q_DECL_OVERRIDE;
  52. bool automaticFrameCallback() const;
  53. void setAutomaticFrameCallback(bool automatic);
  54. public Q_SLOTS:
  55. void updateStarted();
  56. Q_SIGNALS:
  57. void automaticFrameCallbackChanged();
  58. protected:
  59. void initialize() Q_DECL_OVERRIDE;
  60. private:
  61. void doFrameCallbacks();
  62. bool m_updateScheduled;
  63. bool m_automaticFrameCallback;
  64. };
  65. QT_END_NAMESPACE
  66. #endif