KWayland
6 #include "idleinhibit.h"
7 #include "event_queue.h"
9 #include "wayland_pointer_p.h"
11 #include <wayland-idle-inhibit-unstable-v1-client-protocol.h>
17 class Q_DECL_HIDDEN IdleInhibitManager::Private
22 void setup(zwp_idle_inhibit_manager_v1 *arg);
24 WaylandPointer<zwp_idle_inhibit_manager_v1, zwp_idle_inhibit_manager_v1_destroy> idleinhibitmanager;
25 EventQueue *queue =
nullptr;
34 void IdleInhibitManager::Private::setup(zwp_idle_inhibit_manager_v1 *arg)
37 Q_ASSERT(!idleinhibitmanager);
38 idleinhibitmanager.setup(arg);
41 IdleInhibitManager::~IdleInhibitManager()
48 d->setup(idleinhibitmanager);
53 d->idleinhibitmanager.release();
58 d->idleinhibitmanager.destroy();
61 IdleInhibitManager::operator zwp_idle_inhibit_manager_v1 *()
63 return d->idleinhibitmanager;
66 IdleInhibitManager::operator zwp_idle_inhibit_manager_v1 *()
const
68 return d->idleinhibitmanager;
73 return d->idleinhibitmanager.isValid();
90 auto w = zwp_idle_inhibit_manager_v1_create_inhibitor(d->idleinhibitmanager, *surface);
92 d->queue->addProxy(w);
101 void setup(zwp_idle_inhibitor_v1 *arg);
103 WaylandPointer<zwp_idle_inhibitor_v1, zwp_idle_inhibitor_v1_destroy> idleinhibitor;
106 IdleInhibitor::IdleInhibitor(
QObject *parent)
112 void IdleInhibitor::Private::setup(zwp_idle_inhibitor_v1 *arg)
115 Q_ASSERT(!idleinhibitor);
116 idleinhibitor.setup(arg);
119 IdleInhibitor::~IdleInhibitor()
126 d->setup(idleinhibitor);
131 d->idleinhibitor.release();
136 d->idleinhibitor.destroy();
139 IdleInhibitor::operator zwp_idle_inhibitor_v1 *()
141 return d->idleinhibitor;
144 IdleInhibitor::operator zwp_idle_inhibitor_v1 *()
const
146 return d->idleinhibitor;
151 return d->idleinhibitor.isValid();
EventQueue * eventQueue()
Wrapper for the wl_surface interface.
void destroy()
Destroys the data held by this IdleInhibitManager.
An IdleInhibitor prevents the Output that the associated Surface is visible on from being set to a st...
void setEventQueue(EventQueue *queue)
Sets the queue to use for creating objects with this IdleInhibitManager.
void release()
Releases the zwp_idle_inhibitor_v1 interface.
IdleInhibitManager(QObject *parent=nullptr)
Creates a new IdleInhibitManager.
Wrapper class for wl_event_queue interface.
void setup(zwp_idle_inhibit_manager_v1 *idleinhibitmanager)
Setup this IdleInhibitManager to manage the idleinhibitmanager.
void setup(zwp_idle_inhibitor_v1 *idleinhibitor)
Setup this IdleInhibitor to manage the idleinhibitor.
void destroy()
Destroys the data held by this IdleInhibitor.
void release()
Releases the zwp_idle_inhibit_manager_v1 interface.
IdleInhibitor * createInhibitor(Surface *surface, QObject *parent=nullptr)
Creates an IdleInhibitor for the given surface.
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Jan 30 2023 03:56:24 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.