summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper/qwlregion_p.h
blob: b9e5d42e7794d472b8b7af06a519dc1950a2375b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef WL_REGION_H
#define WL_REGION_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>

#include <QRegion>
#include <private/qglobal_p.h>

#include <wayland-util.h>
#include <QtWaylandCompositor/private/qwayland-server-wayland.h>

QT_BEGIN_NAMESPACE

namespace QtWayland {

class Q_WAYLANDCOMPOSITOR_EXPORT Region : public QtWaylandServer::wl_region
{
public:
    Region(struct wl_client *client, uint32_t id);
    ~Region() override;

    static Region *fromResource(struct ::wl_resource *resource);

    uint id() const { return wl_resource_get_id(resource()->handle); }

    QRegion region() const { return m_region; }

private:
    Q_DISABLE_COPY(Region)

    QRegion m_region;

    void region_destroy_resource(Resource *) override;

    void region_destroy(Resource *resource) override;
    void region_add(Resource *resource, int32_t x, int32_t y, int32_t w, int32_t h) override;
    void region_subtract(Resource *resource, int32_t x, int32_t y, int32_t w, int32_t h) override;
};

}

QT_END_NAMESPACE

#endif // WL_REGION_H