-
Notifications
You must be signed in to change notification settings - Fork 2
/
embeddedshellsurface.h
96 lines (77 loc) · 3.04 KB
/
embeddedshellsurface.h
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
// SPDX-License-Identifier: LGPL-3.0-only
#ifndef EMBEDDEDSHELLSURFACE_H
#define EMBEDDEDSHELLSURFACE_H
#include "embeddedplatform.h"
#include <QObject>
class EmbeddedShellSurfaceView;
class EmbeddedShellSurfaceViewPrivate;
class EmbeddedShellSurfacePrivate;
struct embedded_shell_surface;
struct surface_view;
class QWindow;
namespace QtWaylandClient {
class QWaylandWindow;
class QWaylandShellSurface;
} // namespace QtWaylandClient
class Q_DECL_EXPORT EmbeddedShellSurface : public QObject {
Q_OBJECT
Q_DECLARE_PRIVATE(EmbeddedShellSurface)
QScopedPointer<EmbeddedShellSurfacePrivate> d_ptr;
public:
EmbeddedShellSurface(struct ::embedded_shell_surface *shell_surface,
QtWaylandClient::QWaylandWindow *window,
const QSize &size,
EmbeddedShellTypes::Anchor anchor, uint32_t margin,
uint32_t sort_index);
~EmbeddedShellSurface() override;
QSize getSize() const;
EmbeddedShellTypes::Anchor getAnchor() const;
unsigned int getSortIndex() const;
EmbeddedShellSurfaceView *createView(const QString &label,
const QString &icon,
uint32_t sort_index);
EmbeddedShellSurfaceView *createView(const QString &appId,
const QString &label,
const QString &icon,
uint32_t sort_index);
EmbeddedShellSurfaceView *createView(const QString &appId,
const QString &appLabel,
const QString &appIcon,
const QString &label,
const QString &icon,
uint32_t sort_index);
QtWaylandClient::QWaylandShellSurface *shellSurface();
signals:
public slots:
void sendSize(const QSize &size);
void sendAnchor(EmbeddedShellTypes::Anchor anchor);
void sendMargin(int margin);
void sendSortIndex(unsigned int sortIndex);
};
class EmbeddedShellSurfaceView : public QObject {
Q_OBJECT
Q_DECLARE_PRIVATE(EmbeddedShellSurfaceView)
QScopedPointer<EmbeddedShellSurfaceViewPrivate> d_ptr;
Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged)
public:
~EmbeddedShellSurfaceView() override;
QString appLabel() const;
void setAppLabel(const QString &appLabel);
Q_SIGNAL void appLabelChanged(const QString &appLabel);
QString appIcon() const;
void setAppIcon(const QString &appIcon);
Q_SIGNAL void appIconChanged(const QString &appIcon);
QString label() const;
void setLabel(const QString &label);
Q_SIGNAL void labelChanged(const QString &label);
QString icon() const;
void setIcon(const QString &icon);
Q_SIGNAL void iconChanged(const QString &icon);
signals:
void selected();
private:
friend class EmbeddedShellSurface;
EmbeddedShellSurfaceView(struct ::surface_view *view,
EmbeddedShellSurface *surf);
};
#endif // EMBEDDEDSHELLSURFACE_H