summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandviewport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/qwaylandviewport.cpp')
-rw-r--r--src/client/qwaylandviewport.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/client/qwaylandviewport.cpp b/src/client/qwaylandviewport.cpp
new file mode 100644
index 000000000..3252718c0
--- /dev/null
+++ b/src/client/qwaylandviewport.cpp
@@ -0,0 +1,35 @@
+// Copyright (C) 2022 David Edmundson <davidedmundson@kde.org>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwaylandviewport_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace QtWaylandClient {
+
+QWaylandViewport::QWaylandViewport(::wp_viewport *viewport)
+ : QtWayland::wp_viewport(viewport)
+{
+}
+
+QWaylandViewport::~QWaylandViewport()
+{
+ destroy();
+}
+
+void QWaylandViewport::setSource(const QRectF &source)
+{
+ set_source(wl_fixed_from_double(source.x()),
+ wl_fixed_from_double(source.y()),
+ wl_fixed_from_double(source.width()),
+ wl_fixed_from_double(source.height()));
+}
+
+void QWaylandViewport::setDestination(const QSize &destination)
+{
+ set_destination(destination.width(), destination.height());
+}
+
+}
+
+QT_END_NAMESPACE