1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include "qwlregion_p.h"
5
6#include <QtWaylandCompositor/private/qwaylandutils_p.h>
7
8QT_BEGIN_NAMESPACE
9
10namespace QtWayland {
11
12Region::Region(struct wl_client *client, uint32_t id)
13 : QtWaylandServer::wl_region(client, id, 1)
14{
15}
16
17Region::~Region()
18{
19}
20
21Region *Region::fromResource(struct ::wl_resource *resource)
22{
23 return QtWayland::fromResource<Region *>(resource);
24}
25
26void Region::region_destroy_resource(Resource *)
27{
28 delete this;
29}
30
31void Region::region_destroy(Resource *resource)
32{
33 wl_resource_destroy(resource->handle);
34}
35
36void Region::region_add(Resource *, int32_t x, int32_t y, int32_t w, int32_t h)
37{
38 m_region += QRect(x, y, w, h);
39}
40
41void Region::region_subtract(Resource *, int32_t x, int32_t y, int32_t w, int32_t h)
42{
43 m_region -= QRect(x, y, w, h);
44}
45
46}
47
48QT_END_NAMESPACE
49

source code of qtwayland/src/compositor/wayland_wrapper/qwlregion.cpp