KWaylandServer

region_interface.cpp
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3  SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 */
7 #include "region_interface_p.h"
8 #include "utils.h"
9 
10 namespace KWaylandServer
11 {
12 RegionInterface::RegionInterface(wl_resource *resource)
13  : QtWaylandServer::wl_region(resource)
14 {
15 }
16 
17 void RegionInterface::region_destroy_resource(Resource *)
18 {
19  delete this;
20 }
21 
22 void RegionInterface::region_destroy(Resource *resource)
23 {
24  wl_resource_destroy(resource->handle);
25 }
26 
27 void RegionInterface::region_add(Resource *, int32_t x, int32_t y, int32_t width, int32_t height)
28 {
29  m_region += QRegion(x, y, width, height);
30 }
31 
32 void RegionInterface::region_subtract(Resource *, int32_t x, int32_t y, int32_t width, int32_t height)
33 {
34  m_region -= QRegion(x, y, width, height);
35 }
36 
37 QRegion RegionInterface::region() const
38 {
39  return m_region;
40 }
41 
42 RegionInterface *RegionInterface::get(wl_resource *native)
43 {
44  return resource_cast<RegionInterface *>(native);
45 }
46 
47 } // namespace KWaylandServer
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 16 2021 23:10:15 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.