Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorServiceIconTheme Namespace Reference

Classes

class  IconImageProvider
 QML image provider mounted at image://phosphor-service-icontheme/. More...
class  IconThemeResolver
 XDG Icon Theme Specification 0.13 resolver. More...

Functions

PHOSPHORSERVICEICONTHEME_EXPORT void registerQmlTypes ()
 Register the IconThemeResolver QML singleton under the Phosphor.Service.IconTheme module at version 1.0.
PHOSPHORSERVICEICONTHEME_EXPORT void installImageProvider (QQmlEngine *engine)
 Mount the icon image provider on engine under the URL scheme image://phosphor-service-icontheme/.
PHOSPHORSERVICEICONTHEME_EXPORT const char * imageProviderUrlHost ()
 Stable URL host segment for the image provider, exported so publishing call sites (StatusNotifierItemModel::iconUrlFor(), future per-icon publishers) can construct the URL without hard-coding the string.

Function Documentation

◆ imageProviderUrlHost()

PHOSPHORSERVICEICONTHEME_EXPORT const char * PhosphorServiceIconTheme::imageProviderUrlHost ( )

Stable URL host segment for the image provider, exported so publishing call sites (StatusNotifierItemModel::iconUrlFor(), future per-icon publishers) can construct the URL without hard-coding the string.

Bump on any rename so consumers fail to link rather than fail silently at runtime.

◆ installImageProvider()

PHOSPHORSERVICEICONTHEME_EXPORT void PhosphorServiceIconTheme::installImageProvider ( QQmlEngine * engine)

Mount the icon image provider on engine under the URL scheme image://phosphor-service-icontheme/.

The provider is what makes raw QImage payloads (e.g. SNI tray icons that arrive as IconPixmap over D-Bus) reachable from QML's Image.source (a QUrl property; QImage doesn't auto-convert). Per-engine because QQmlEngine takes ownership of its providers and tears them down with itself.

◆ registerQmlTypes()

PHOSPHORSERVICEICONTHEME_EXPORT void PhosphorServiceIconTheme::registerQmlTypes ( )

Register the IconThemeResolver QML singleton under the Phosphor.Service.IconTheme module at version 1.0.

Idempotent on repeat calls: internally guarded by std::call_once so a hot- reloading shell that builds a fresh QQmlEngine per reload can safely call this from every engine setup without triggering Qt's duplicate-registration warning. Must be called after QCoreApplication::instance() exists (the singleton instance is parented to it); calling earlier is a logged no-op.