Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwaylandxdgoutputv1_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:critical reason:network-protocol
4
5#ifndef QWAYLANDXDGOUTPUTV1_P_H
6#define QWAYLANDXDGOUTPUTV1_P_H
7
8#include <QtCore/QHash>
9
10#include <QWaylandOutput>
11#include <QWaylandXdgOutputV1>
12#include <QtWaylandCompositor/private/qwaylandcompositorextension_p.h>
13#include <QtWaylandCompositor/private/qwayland-server-xdg-output-unstable-v1.h>
14
15//
16// W A R N I N G
17// -------------
18//
19// This file is not part of the Qt API. It exists purely as an
20// implementation detail. This header file may change from version to
21// version without notice, or even be removed.
22//
23// We mean it.
24//
25
27
28class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandXdgOutputManagerV1Private
29 : public QWaylandCompositorExtensionPrivate
30 , public QtWaylandServer::zxdg_output_manager_v1
31{
32 Q_DECLARE_PUBLIC(QWaylandXdgOutputManagerV1)
33public:
34 explicit QWaylandXdgOutputManagerV1Private() = default;
35
36 void registerXdgOutput(QWaylandOutput *output, QWaylandXdgOutputV1 *xdgOutput);
37 void unregisterXdgOutput(QWaylandOutput *output);
38 QWaylandXdgOutputV1 *xdgOutput(QWaylandOutput *output) const;
39
40 static QWaylandXdgOutputManagerV1Private *get(QWaylandXdgOutputManagerV1 *manager) { return manager ? manager->d_func() : nullptr; }
41
42protected:
43 void zxdg_output_manager_v1_get_xdg_output(Resource *resource, uint32_t id,
44 wl_resource *outputResource) override;
45
46private:
47 QHash<QWaylandOutput *, QWaylandXdgOutputV1 *> xdgOutputs;
48};
49
50class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandXdgOutputV1Private
51 : public QObjectPrivate
52 , public QtWaylandServer::zxdg_output_v1
53{
54 Q_DECLARE_PUBLIC(QWaylandXdgOutputV1)
55public:
56 explicit QWaylandXdgOutputV1Private() = default;
57
58 void sendLogicalPosition(const QPoint &position);
59 void sendLogicalSize(const QSize &size);
60 void sendDone();
61 void maybeSendDone(const Resource *resource);
62
63 void setManager(QWaylandXdgOutputManagerV1 *manager);
64 void setOutput(QWaylandOutput *output);
65
66 static QWaylandXdgOutputV1Private *get(QWaylandXdgOutputV1 *xdgOutput) { return xdgOutput ? xdgOutput->d_func() : nullptr; }
67
68 bool initialized = false;
69 QWaylandOutput *output = nullptr;
70 QWaylandXdgOutputManagerV1 *manager = nullptr;
71 QPoint logicalPos;
72 QSize logicalSize;
73 QString name;
74 QString description;
75
76protected:
77 void zxdg_output_v1_bind_resource(Resource *resource) override;
78 void zxdg_output_v1_destroy(Resource *resource) override;
79};
80
81QT_END_NAMESPACE
82
83#endif // QWAYLANDXDGOUTPUTV1_P_H
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(wayland_compositor_quick)