1 | // Copyright (C) 2022 David Edmundson <davidedmundson@kde.org> |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #include "qwaylandviewport_p.h" |
5 | |
6 | QT_BEGIN_NAMESPACE |
7 | |
8 | namespace QtWaylandClient { |
9 | |
10 | QWaylandViewport::QWaylandViewport(::wp_viewport *viewport) |
11 | : QtWayland::wp_viewport(viewport) |
12 | { |
13 | } |
14 | |
15 | QWaylandViewport::~QWaylandViewport() |
16 | { |
17 | destroy(); |
18 | } |
19 | |
20 | void QWaylandViewport::setSource(const QRectF &source) |
21 | { |
22 | set_source(wl_fixed_from_double(source.x()), |
23 | wl_fixed_from_double(source.y()), |
24 | wl_fixed_from_double(source.width()), |
25 | wl_fixed_from_double(source.height())); |
26 | } |
27 | |
28 | void QWaylandViewport::setDestination(const QSize &destination) |
29 | { |
30 | set_destination(destination.width(), destination.height()); |
31 | } |
32 | |
33 | } |
34 | |
35 | QT_END_NAMESPACE |
36 |