Changeset View
Changeset View
Standalone View
Standalone View
src/server/xdgshell_v6_interface_p.h
- This file was added.
1 | /**************************************************************************** | ||||
---|---|---|---|---|---|
2 | Copyright 2017 David Edmundson <davidedmundson@kde.org> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Lesser General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2.1 of the License, or (at your option) version 3, or any | ||||
8 | later version accepted by the membership of KDE e.V. (or its | ||||
9 | successor approved by the membership of KDE e.V.), which shall | ||||
10 | act as a proxy defined in Section 6 of version 3 of the license. | ||||
11 | | ||||
12 | This library is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
15 | Lesser General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU Lesser General Public | ||||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | ****************************************************************************/ | ||||
20 | #ifndef KWAYLAND_SERVER_XDGSHELL_V6_INTERFACE_P_H | ||||
21 | #define KWAYLAND_SERVER_XDGSHELL_V6_INTERFACE_P_H | ||||
22 | | ||||
23 | #include "global.h" | ||||
24 | #include "resource.h" | ||||
25 | #include "xdgshell_interface.h" | ||||
26 | | ||||
27 | #include <KWayland/Server/kwaylandserver_export.h> | ||||
28 | | ||||
29 | #include <QSize> | ||||
30 | | ||||
31 | namespace KWayland | ||||
32 | { | ||||
33 | namespace Server | ||||
34 | { | ||||
35 | | ||||
36 | class Display; | ||||
37 | class OutputInterface; | ||||
38 | class SeatInterface; | ||||
39 | class SurfaceInterface; | ||||
40 | class XdgTopLevelV6Interface; | ||||
41 | class XdgPopupV6Interface; | ||||
42 | class XdgPositionerV6Interface; | ||||
43 | class XdgSurfaceV6Interface; | ||||
44 | template <typename T> | ||||
45 | class GenericShellSurface; | ||||
46 | | ||||
47 | class XdgShellV6Interface : public XdgShellInterface | ||||
48 | { | ||||
49 | Q_OBJECT | ||||
50 | public: | ||||
51 | virtual ~XdgShellV6Interface(); | ||||
52 | | ||||
53 | /** | ||||
54 | * @returns The XdgTopLevelV6Interface for the @p native resource. | ||||
55 | **/ | ||||
56 | XdgTopLevelV6Interface *getSurface(wl_resource *native); | ||||
57 | //DAVE we want to rename this, as it's bloody confusing. But XdgShellInterface::getSurface exists and expects that | ||||
58 | //also use a less terrible argument name than native. It's obvious it's native from the type | ||||
59 | | ||||
60 | XdgPositionerV6Interface *getPositioner(wl_resource *native); | ||||
61 | | ||||
62 | XdgSurfaceV6Interface *realGetSurface(wl_resource *native); | ||||
63 | | ||||
64 | Display *display() const; | ||||
65 | | ||||
66 | void ping(); | ||||
67 | | ||||
68 | private: | ||||
69 | explicit XdgShellV6Interface(Display *display, QObject *parent = nullptr); | ||||
70 | friend class Display; | ||||
71 | class Private; | ||||
72 | Private *d_func() const; | ||||
73 | }; | ||||
74 | | ||||
75 | class XdgSurfaceV6Interface : public KWayland::Server::Resource | ||||
76 | { | ||||
77 | Q_OBJECT | ||||
78 | public: | ||||
79 | virtual ~XdgSurfaceV6Interface(); | ||||
80 | SurfaceInterface* surface() const; | ||||
81 | XdgTopLevelV6Interface* topLevel() const; | ||||
82 | XdgPopupV6Interface *popup() const; | ||||
83 | | ||||
84 | private: | ||||
85 | explicit XdgSurfaceV6Interface(XdgShellV6Interface *parent, SurfaceInterface *surface, wl_resource *parentResource); | ||||
86 | friend class XdgShellV6Interface; | ||||
87 | | ||||
88 | class Private; | ||||
89 | Private *d_func() const; | ||||
90 | }; | ||||
91 | | ||||
92 | class XdgTopLevelV6Interface : public | ||||
93 | XdgShellSurfaceInterface | ||||
94 | { | ||||
95 | Q_OBJECT | ||||
96 | public: | ||||
97 | virtual ~XdgTopLevelV6Interface(); | ||||
98 | | ||||
99 | private: | ||||
100 | explicit XdgTopLevelV6Interface(XdgShellV6Interface *parent, SurfaceInterface *surface, wl_resource *parentResource); | ||||
101 | friend class XdgShellV6Interface; | ||||
102 | friend class XdgSurfaceV6Interface; | ||||
103 | | ||||
104 | class Private; | ||||
105 | Private *d_func() const; | ||||
106 | }; | ||||
107 | | ||||
108 | class XdgPopupV6Interface : public XdgShellPopupInterface | ||||
109 | { | ||||
110 | Q_OBJECT | ||||
111 | public: | ||||
112 | virtual ~XdgPopupV6Interface(); | ||||
113 | | ||||
114 | private: | ||||
115 | explicit XdgPopupV6Interface(XdgShellV6Interface *parent, SurfaceInterface *surface, wl_resource *parentResource); | ||||
116 | friend class XdgShellV6Interface; | ||||
117 | friend class XdgSurfaceV6Interface; | ||||
118 | friend class GenericShellSurface<XdgPopupV6Interface>; | ||||
119 | | ||||
120 | class Private; | ||||
121 | Private *d_func() const; | ||||
122 | }; | ||||
123 | | ||||
124 | /* | ||||
125 | * This is a private internal class that keeps track of sent data | ||||
126 | * At the time of PopupCreation these values are copied to the popup | ||||
127 | */ | ||||
128 | class XdgPositionerV6Interface: public KWayland::Server::Resource | ||||
129 | { | ||||
130 | public: | ||||
131 | QSize initialSize() const; | ||||
132 | QRect anchorRect() const; | ||||
133 | Qt::Edges anchorEdge() const; | ||||
134 | Qt::Edges gravity() const; | ||||
135 | PositionerConstraints constraintAdjustments() const; | ||||
136 | QPoint anchorOffset() const; | ||||
137 | private: | ||||
138 | explicit XdgPositionerV6Interface(XdgShellV6Interface *parent, wl_resource *parentResource); | ||||
139 | friend class XdgShellV6Interface; | ||||
140 | | ||||
141 | class Private; | ||||
142 | Private *d_func() const; | ||||
143 | }; | ||||
144 | | ||||
145 | } | ||||
146 | } | ||||
147 | | ||||
148 | #endif |