-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathwoutput.h
More file actions
136 lines (111 loc) · 4.03 KB
/
Copy pathwoutput.h
File metadata and controls
136 lines (111 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Copyright (C) 2023 JiDe Zhang <zhangjide@deepin.org>.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#pragma once
#include <wglobal.h>
#include <wtypes.h>
#include <qwoutput.h>
#include <QObject>
#include <QSize>
#include <QPoint>
#include <QQmlEngine>
#include <QImage>
Q_MOC_INCLUDE("wcursor.h")
QT_BEGIN_NAMESPACE
class QScreen;
class QQuickWindow;
QT_END_NAMESPACE
QW_BEGIN_NAMESPACE
class qw_renderer;
class qw_swapchain;
class qw_allocator;
QW_END_NAMESPACE
WAYLIB_SERVER_BEGIN_NAMESPACE
class QWlrootsScreen;
class QWlrootsIntegration;
class WOutputLayout;
class WCursor;
class WBackend;
class WServer;
class WOutputPrivate;
class WAYLIB_SERVER_EXPORT WOutput : public WWrapObject
{
Q_OBJECT
W_DECLARE_PRIVATE(WOutput)
Q_PROPERTY(bool enabled READ isEnabled NOTIFY enabledChanged)
Q_PROPERTY(QSize size READ effectiveSize NOTIFY effectiveSizeChanged)
Q_PROPERTY(Transform orientation READ orientation NOTIFY orientationChanged)
Q_PROPERTY(float scale READ scale NOTIFY scaleChanged)
Q_PROPERTY(bool forceSoftwareCursor READ forceSoftwareCursor WRITE setForceSoftwareCursor NOTIFY forceSoftwareCursorChanged)
Q_PROPERTY(QString name READ name CONSTANT)
QML_NAMED_ELEMENT(WaylandOutput)
QML_UNCREATABLE("Can't create in qml")
public:
enum Transform {
Normal = WLR::Transform::Normal,
R90 = WLR::Transform::R90,
R180 = WLR::Transform::R180,
R270 = WLR::Transform::R270,
Flipped = WLR::Transform::Flipped,
Flipped90 = WLR::Transform::Flipped90,
Flipped180 = WLR::Transform::Flipped180,
Flipped270 = WLR::Transform::Flipped270
};
Q_ENUM(Transform)
explicit WOutput(QW_NAMESPACE::qw_output *handle, WBackend *backend);
~WOutput();
WBackend *backend() const;
WServer *server() const;
QW_NAMESPACE::qw_renderer *renderer() const;
QW_NAMESPACE::qw_swapchain *swapchain() const;
QW_NAMESPACE::qw_allocator *allocator() const;
bool configurePrimarySwapchain(const QSize &size, uint32_t format,
QW_NAMESPACE::qw_swapchain **swapchain,
bool doTest = true,
QW_NAMESPACE::qw_swapchain **replacedSwapchain = nullptr);
bool configureCursorSwapchain(const QSize &size, uint32_t format,
QW_NAMESPACE::qw_swapchain **swapchain,
QW_NAMESPACE::qw_swapchain **replacedSwapchain = nullptr);
QW_NAMESPACE::qw_output *handle() const;
wlr_output *nativeHandle() const;
static WOutput *fromHandle(const QW_NAMESPACE::qw_output *handle);
static WOutput *fromScreen(const QScreen *screen);
QString name() const;
bool isEnabled() const;
QPoint position() const;
QSize size() const;
QSize transformedSize() const;
QSize effectiveSize() const;
Transform orientation() const;
float scale() const;
void attach(QQuickWindow *window);
QQuickWindow *attachedWindow() const;
void setLayout(WOutputLayout *layout);
WOutputLayout *layout() const;
void addCursor(WCursor *cursor);
void removeCursor(WCursor *cursor);
const QList<WCursor *> &cursorList() const;
bool forceSoftwareCursor() const;
void setForceSoftwareCursor(bool on);
void scheduleFrame();
Q_SIGNALS:
void enabledChanged();
void positionChanged(const QPoint &pos);
void modeChanged();
void transformedSizeChanged();
void effectiveSizeChanged();
void orientationChanged();
void scaleChanged();
void forceSoftwareCursorChanged();
void bufferCommitted();
void cursorAdded(WAYLIB_SERVER_NAMESPACE::WCursor *cursor);
void cursorRemoved(WAYLIB_SERVER_NAMESPACE::WCursor *cursor);
void cursorListChanged();
private:
friend class QWlrootsIntegration;
void setScreen(QWlrootsScreen *screen);
QWlrootsScreen *screen() const;
friend class WServer;
friend class WServerPrivate;
};
WAYLIB_SERVER_END_NAMESPACE
Q_DECLARE_METATYPE(WAYLIB_SERVER_NAMESPACE::WOutput*)