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 58 of file KisWaylandRegistry.cpp.

59{
60 if (!s_waylandRegistry->d->initialized) {
61 KisWaylandRegistry *registry = s_waylandRegistry;
62 registry->d->initialized = true;
63
64 auto waylandApp = qGuiApp->nativeInterface<QNativeInterface::QWaylandApplication>();
65 auto display = waylandApp->display();
66 auto regisry = ::wl_display_get_registry(display);
67 registry->init(regisry);
68
69 //Wait for the compositor to populate the registry
70 ::wl_display_roundtrip(display);
71 }
72
73 return s_waylandRegistry;
74}
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 if (qEnvironmentVariable("KRITA_FORCE_WAYLAND_INTERFACES").split(u',').contains(interface)) {
35 return true;
36 }
37
38 //Check if the interface is explicitly disabled
39 static QStringList interfaceBlacklist = qEnvironmentVariable("QT_WAYLAND_DISABLED_INTERFACES").split(u',');
40
41 if (interfaceBlacklist.contains(interface)) {
42 return false;
43 }
44
45 Q_FOREACH(auto global, d->globals.values()) {
46 if (global.first == interface)
47 return true;
48 }
49
50 return false;
51}
qreal u
QList< KoSubpath * > split(const KoPathShape &path)

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 53 of file KisWaylandRegistry.cpp.

54{
55 d->globals.remove(name);
56}

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: