summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandoutputmode.h
diff options
context:
space:
mode:
authorPier Luigi Fiorini <pierluigi.fiorini@gmail.com>2015-04-10 17:52:49 +0200
committerPier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>2016-10-03 15:15:58 +0000
commit7ee4be6af2c92c345539bb4950dd48d7a740847d (patch)
tree2acbcfb9fd0a2dbc995cb0d700e7e14ad4afd759 /src/compositor/compositor_api/qwaylandoutputmode.h
parent59c8598958959de943a0782093f020ae1c348edf (diff)
Add mode support to QWaylandOutput
Outputs usually have more than one mode, add an API to support them. When sizeFollowsWindow is true, modes are replaced by one with the window size and refresh rate. In that circumstance the mode changes when the window is resized. The sizeFollowsWindow property default value is no longer true. The setGeometry() method is gone as it doesn't make sense now, the setWidth() and setHeight() methods are now private slots to resize the resolution as the window resizes (and sizeFollowsWindow is true). Refresh rate is expressed in mHz rather than Hz just like the Wayland protocol. A compositor implementation may choose to add modes if it has access to hardware information, it will call addMode() for each mode and then invoke the setCurrentMode() method that sends the modes list to the client. The preferred mode is indicated with a boolean parameter to the addMode() method. Change-Id: Iffed4784ccef695c276ebd800172957f4cff3324 Task-number: QTBUG-49814 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandoutputmode.h')
-rw-r--r--src/compositor/compositor_api/qwaylandoutputmode.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandoutputmode.h b/src/compositor/compositor_api/qwaylandoutputmode.h
new file mode 100644
index 000000000..4ef57f2ee
--- /dev/null
+++ b/src/compositor/compositor_api/qwaylandoutputmode.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWAYLANDOUTPUTMODE_H
+#define QWAYLANDOUTPUTMODE_H
+
+#include <QtWaylandCompositor/qwaylandexport.h>
+#include <QtCore/QSize>
+
+QT_BEGIN_NAMESPACE
+
+class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandOutputMode
+{
+public:
+ explicit QWaylandOutputMode();
+ QWaylandOutputMode(const QSize &size, int refreshRate);
+ QWaylandOutputMode(const QWaylandOutputMode &other);
+ ~QWaylandOutputMode();
+
+ QWaylandOutputMode &operator=(const QWaylandOutputMode &other);
+ bool operator==(const QWaylandOutputMode &other) const;
+ bool operator!=(const QWaylandOutputMode &other) const;
+
+ bool isValid() const;
+
+ QSize size() const;
+ int refreshRate() const;
+
+private:
+ class QWaylandOutputModePrivate *const d;
+ friend class QWaylandOutput;
+
+ void setWidth(int width);
+ void setHeight(int height);
+};
+
+QT_END_NAMESPACE
+
+#endif // QWAYLANDOUTPUTMODE_H