KWin
Loading...
Searching...
No Matches
region.cpp
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
3 SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7#include "region_p.h"
8#include "utils/resource.h"
9
10namespace KWin
11{
13 : QtWaylandServer::wl_region(resource)
14{
15}
16
18{
19 delete this;
20}
21
22void RegionInterface::region_destroy(Resource *resource)
23{
24 wl_resource_destroy(resource->handle);
25}
26
27void 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
32void 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
38{
39 return m_region;
40}
41
43{
44 return resource_cast<RegionInterface *>(native);
45}
46
47} // namespace KWin
static RegionInterface * get(wl_resource *native)
Definition region.cpp:42
void region_destroy_resource(Resource *resource) override
Definition region.cpp:17
void region_destroy(Resource *resource) override
Definition region.cpp:22
void region_add(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override
Definition region.cpp:27
void region_subtract(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override
Definition region.cpp:32
QRegion region() const
Definition region.cpp:37
RegionInterface(wl_resource *resource)
Definition region.cpp:12