KWin
Loading...
Searching...
No Matches
idleinhibit_v1.cpp
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2017 Martin Flöser <mgraesslin@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6#include "display.h"
7#include "idleinhibit_v1_p.h"
8#include "surface_p.h"
9
10namespace KWin
11{
12static const quint32 s_version = 1;
13
15 : QtWaylandServer::zwp_idle_inhibit_manager_v1(*display, s_version)
16 , q(_q)
17{
18}
19
21{
22 wl_resource_destroy(resource->handle);
23}
24
25void IdleInhibitManagerV1InterfacePrivate::zwp_idle_inhibit_manager_v1_create_inhibitor(Resource *resource, uint32_t id, wl_resource *wlsurface)
26{
27 const auto surface = SurfaceInterface::get(wlsurface);
28 const auto inhibitor = new IdleInhibitorV1Interface(resource->client(), id, resource->version(), surface);
30}
31
33 : QObject(parent)
34 , d(new IdleInhibitManagerV1InterfacePrivate(this, display))
35{
36}
37
39
40IdleInhibitorV1Interface::IdleInhibitorV1Interface(wl_client *client, uint32_t id, uint32_t version, SurfaceInterface *surface)
41 : QtWaylandServer::zwp_idle_inhibitor_v1(client, id, version)
42 , m_surface(surface)
43{
44}
45
52
54{
55 wl_resource_destroy(resource->handle);
56}
57
59{
60 delete this;
61}
62
63}
64
65#include "moc_idleinhibit_v1.cpp"
66#include "moc_idleinhibit_v1_p.cpp"
Class holding the Wayland server display loop.
Definition display.h:34
IdleInhibitManagerV1Interface(Display *display, QObject *parent=nullptr)
IdleInhibitManagerV1InterfacePrivate(IdleInhibitManagerV1Interface *_q, Display *display)
void zwp_idle_inhibit_manager_v1_create_inhibitor(Resource *resource, uint32_t id, wl_resource *surface) override
void zwp_idle_inhibit_manager_v1_destroy(Resource *resource) override
const QPointer< SurfaceInterface > m_surface
void zwp_idle_inhibitor_v1_destroy(Resource *resource) override
IdleInhibitorV1Interface(wl_client *client, uint32_t id, uint32_t version, SurfaceInterface *surface)
void zwp_idle_inhibitor_v1_destroy_resource(Resource *resource) override
Resource representing a wl_surface.
Definition surface.h:80
static SurfaceInterface * get(wl_resource *native)
Definition surface.cpp:819
void installIdleInhibitor(IdleInhibitorV1Interface *inhibitor)
Definition surface.cpp:257
void removeIdleInhibitor(IdleInhibitorV1Interface *inhibitor)
Definition surface.cpp:265
static SurfaceInterfacePrivate * get(SurfaceInterface *surface)
Definition surface_p.h:99
constexpr int version