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
6QT_BEGIN_NAMESPACE
7
8namespace QtWaylandClient {
9
10QWaylandViewport::QWaylandViewport(::wp_viewport *viewport)
11 : QtWayland::wp_viewport(viewport)
12{
13}
14
15QWaylandViewport::~QWaylandViewport()
16{
17 destroy();
18}
19
20void 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
28void QWaylandViewport::setDestination(const QSize &destination)
29{
30 set_destination(destination.width(), destination.height());
31}
32
33}
34
35QT_END_NAMESPACE
36

source code of qtwayland/src/client/qwaylandviewport.cpp