| 1 | // Copyright (C) 2022 David Edmundson <davidedmundson@kde.org> |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QWAYLANDFRACTIONALSCALE_P_H |
| 5 | #define QWAYLANDFRACTIONALSCALE_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtWaylandClient/private/qwayland-fractional-scale-v1.h> |
| 19 | #include <QtWaylandClient/qtwaylandclientglobal.h> |
| 20 | |
| 21 | #include <QObject> |
| 22 | |
| 23 | #include <optional> |
| 24 | |
| 25 | QT_BEGIN_NAMESPACE |
| 26 | |
| 27 | namespace QtWaylandClient { |
| 28 | |
| 29 | class QWaylandFractionalScale : public QObject, public QtWayland::wp_fractional_scale_v1 |
| 30 | { |
| 31 | Q_OBJECT |
| 32 | public: |
| 33 | explicit QWaylandFractionalScale(struct ::wp_fractional_scale_v1 *object); |
| 34 | ~QWaylandFractionalScale(); |
| 35 | |
| 36 | std::optional<qreal> preferredScale() const { return mPreferredScale; } |
| 37 | |
| 38 | Q_SIGNALS: |
| 39 | void preferredScaleChanged(); |
| 40 | |
| 41 | protected: |
| 42 | void wp_fractional_scale_v1_preferred_scale(uint scale) override; |
| 43 | |
| 44 | private: |
| 45 | std::optional<qreal> mPreferredScale; |
| 46 | }; |
| 47 | |
| 48 | } |
| 49 | |
| 50 | QT_END_NAMESPACE |
| 51 | |
| 52 | #endif |
| 53 | |