Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorServiceNightLight::GammaBackend Class Referenceabstract

What NightLight drives: something that can tint every output. More...

#include <PhosphorServiceNightLight/GammaBackend.h>

Inheritance diagram for PhosphorServiceNightLight::GammaBackend:
[legend]

Signals

void availableChanged ()

Public Member Functions

 GammaBackend (QObject *parent=nullptr)
 ~GammaBackend () override
virtual bool isAvailable () const =0
 Whether the backend can tint at least one output.
virtual void setActive (bool active)=0
 Take (true) or release (false) the outputs' gamma.
virtual void setWhitePoint (const WhitePoint &white)=0
 The colour to tint every controlled output with.
virtual void retry ()=0
 Try again on outputs whose control failed (for example after another program that held their gamma has quit).

Detailed Description

What NightLight drives: something that can tint every output.

The default backend is a wlr-gamma-control-unstable-v1 client (NightLight's one-argument constructor creates it). Another backend, or a fake in a test, is handed to NightLight's injecting constructor.

A backend holds the outputs' gamma only while active. Releasing it gives each output back its original ramps.

Constructor & Destructor Documentation

◆ GammaBackend()

PhosphorServiceNightLight::GammaBackend::GammaBackend ( QObject * parent = nullptr)
explicit

◆ ~GammaBackend()

PhosphorServiceNightLight::GammaBackend::~GammaBackend ( )
override

Member Function Documentation

◆ availableChanged

void PhosphorServiceNightLight::GammaBackend::availableChanged ( )
signal

◆ isAvailable()

virtual bool PhosphorServiceNightLight::GammaBackend::isAvailable ( ) const
nodiscardpure virtual

Whether the backend can tint at least one output.

Before the first activation this is the best the backend knows without taking the outputs (for the Wayland backend: the compositor offers gamma control and has an output). An output whose control failed stops counting until retry().

◆ retry()

virtual void PhosphorServiceNightLight::GammaBackend::retry ( )
pure virtual

Try again on outputs whose control failed (for example after another program that held their gamma has quit).

◆ setActive()

virtual void PhosphorServiceNightLight::GammaBackend::setActive ( bool active)
pure virtual

Take (true) or release (false) the outputs' gamma.

While active the backend applies the last white point to every output it controls, including outputs that appear later.

◆ setWhitePoint()

virtual void PhosphorServiceNightLight::GammaBackend::setWhitePoint ( const WhitePoint & white)
pure virtual

The colour to tint every controlled output with.

Remembered while inactive and applied on activation.


The documentation for this class was generated from the following file:
  • phosphor-service-nightlight/include/PhosphorServiceNightLight/GammaBackend.h