Changeset View
Changeset View
Standalone View
Standalone View
src/server/viewporter_interface.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | Copyright © 2019 Roman Gilg <subdiff@gmail.com> | ||||
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 | #pragma once | ||||
21 | | ||||
22 | #include <KWayland/Server/kwaylandserver_export.h> | ||||
23 | | ||||
24 | #include "global.h" | ||||
25 | #include "resource.h" | ||||
26 | | ||||
27 | namespace KWayland | ||||
28 | { | ||||
29 | namespace Server | ||||
30 | { | ||||
31 | | ||||
32 | class Display; | ||||
33 | class SurfaceInterface; | ||||
34 | class ViewportInterface; | ||||
35 | | ||||
36 | /** | ||||
37 | * @brief Represents the Global for wp_viewporter interface. | ||||
38 | * | ||||
39 | * This class creates ViewportInterfaces and attaches them to SurfaceInterfaces. | ||||
40 | * | ||||
41 | * @see ViewportInterface | ||||
42 | * @see SurfaceInterface | ||||
43 | * @since 5.66 | ||||
44 | **/ | ||||
45 | class KWAYLANDSERVER_EXPORT ViewporterInterface : public Global | ||||
46 | { | ||||
47 | Q_OBJECT | ||||
48 | public: | ||||
49 | ~ViewporterInterface() override; | ||||
50 | | ||||
51 | Q_SIGNALS: | ||||
52 | /** | ||||
53 | * Emitted whenever this ViewporterInterface created a ViewportInterface. | ||||
54 | **/ | ||||
55 | void viewportCreated(ViewportInterface*); | ||||
56 | | ||||
57 | private: | ||||
58 | explicit ViewporterInterface(Display *display, QObject *parent = nullptr); | ||||
59 | friend class Display; | ||||
60 | class Private; | ||||
61 | }; | ||||
62 | | ||||
63 | /** | ||||
64 | * @brief Resource for the wp_viewport interface. | ||||
65 | * | ||||
66 | **/ | ||||
67 | class KWAYLANDSERVER_EXPORT ViewportInterface : public Resource | ||||
68 | { | ||||
69 | Q_OBJECT | ||||
70 | public: | ||||
71 | ~ViewportInterface() override; | ||||
72 | | ||||
73 | Q_SIGNALS: | ||||
74 | void destinationSizeSet(const QSize &size); | ||||
75 | void sourceRectangleSet(const QRectF &rect); | ||||
76 | | ||||
77 | private: | ||||
78 | explicit ViewportInterface(ViewporterInterface *viewporter, wl_resource *parentResource, | ||||
79 | SurfaceInterface *surface); | ||||
80 | friend class ViewporterInterface; | ||||
81 | | ||||
82 | class Private; | ||||
83 | Private *d_func() const; | ||||
84 | }; | ||||
85 | | ||||
86 | } | ||||
87 | } |