Krita Source Code Documentation
Loading...
Searching...
No Matches
KisWaylandRegistry Class Reference

Wayland registry for tracking wayland globals. More...

#include <KisWaylandRegistry.h>

+ Inheritance diagram for KisWaylandRegistry:

Classes

struct  Private
 

Public Member Functions

bool globalExists (const QString &interface)
 
 KisWaylandRegistry ()
 
 ~KisWaylandRegistry ()
 

Static Public Member Functions

static KisWaylandRegistrygetOrCreate ()
 

Protected Member Functions

void registry_global (uint32_t name, const QString &interface, uint32_t version) override
 
void registry_global_remove (uint32_t name) override
 

Private Attributes

QScopedPointer< Privated
 

Detailed Description

Wayland registry for tracking wayland globals.

Definition at line 13 of file KisWaylandRegistry.h.

Constructor & Destructor Documentation

◆ KisWaylandRegistry()

KisWaylandRegistry::KisWaylandRegistry ( )

Definition at line 18 of file KisWaylandRegistry.cpp.

19 : d(new Private)
20{
21}
QScopedPointer< Private > d

◆ ~KisWaylandRegistry()

KisWaylandRegistry::~KisWaylandRegistry ( )

Definition at line 23 of file KisWaylandRegistry.cpp.

24{
25}

Member Function Documentation

◆ getOrCreate()

KisWaylandRegistry * KisWaylandRegistry::getOrCreate ( )
static

Definition at line 54 of file KisWaylandRegistry.cpp.

55{
56 if (!s_waylandRegistry->d->initialized) {
57 KisWaylandRegistry *registry = s_waylandRegistry;
58 registry->d->initialized = true;
59
60 auto waylandApp = qGuiApp->nativeInterface<QNativeInterface::QWaylandApplication>();
61 auto display = waylandApp->display();
62 auto regisry = ::wl_display_get_registry(display);
63 registry->init(regisry);
64
65 //Wait for the compositor to populate the registry
66 ::wl_display_roundtrip(display);
67 }
68
69 return s_waylandRegistry;
70}
Wayland registry for tracking wayland globals.

References d.

◆ globalExists()

bool KisWaylandRegistry::globalExists ( const QString & interface)

Definition at line 32 of file KisWaylandRegistry.cpp.

33{
34 //Check if the interface is explicitly disabled
35 static QStringList interfaceBlacklist = qEnvironmentVariable("QT_WAYLAND_DISABLED_INTERFACES").split(u',');
36
37 if (interfaceBlacklist.contains(interface)) {
38 return false;
39 }
40
41 Q_FOREACH(auto global, d->globals.values()) {
42 if (global.first == interface)
43 return true;
44 }
45
46 return false;
47}
qreal u

References d, and u.

◆ registry_global()

void KisWaylandRegistry::registry_global ( uint32_t name,
const QString & interface,
uint32_t version )
overrideprotected

Definition at line 27 of file KisWaylandRegistry.cpp.

28{
29 d->globals.insert(name, std::pair<QString, uint32_t>(interface, version));
30}

References d.

◆ registry_global_remove()

void KisWaylandRegistry::registry_global_remove ( uint32_t name)
overrideprotected

Definition at line 49 of file KisWaylandRegistry.cpp.

50{
51 d->globals.remove(name);
52}

References d.

Member Data Documentation

◆ d

QScopedPointer<Private> KisWaylandRegistry::d
private

Definition at line 27 of file KisWaylandRegistry.h.


The documentation for this class was generated from the following files: