6#include <PhosphorServiceNightLight/phosphorservicenightlight_export.h>
48class PHOSPHORSERVICENIGHTLIGHT_EXPORT
NightLight :
public QObject
191 Q_INVOKABLE uint
inhibit(
bool untilNextTransition = false);
220 std::unique_ptr<Private> d;
What NightLight drives: something that can tint every output.
Definition GammaBackend.h:24
void transitionDurationChanged()
bool setLocation(double latitude, double longitude)
Set the location for the Location schedule.
int fadeDuration() const
How long a user change fades, milliseconds, clamped to [0, MaximumFadeDuration].
Mode
Definition NightLight.h:71
static constexpr int MaximumTransitionDuration
The longest transition the library accepts, in seconds.
Definition NightLight.h:81
QTime eveningStart() const
The Hours schedule's evening start (the transition toward night begins).
static constexpr int DefaultNightTemperature
The night temperature used until the app sets one, in kelvin.
Definition NightLight.h:87
void setEnabled(bool enabled)
void setFadeDuration(int milliseconds)
void clearLocation()
Forget the location.
bool isActive() const
Whether the night temperature is at least partly in effect: available, enabled, not inhibited,...
void fadeDurationChanged()
double latitude() const
Degrees north. 0 without a location.
void refresh()
Re-read the clock and try again on outputs whose gamma control failed.
void dayTemperatureChanged()
Mode mode() const
The schedule. Default Hours.
bool hasLocation() const
Whether a location is set.
int nightTemperature() const
The night temperature, kelvin, clamped like the day temperature.
bool isAvailable() const
Whether the compositor offers gamma control and at least one output accepts it.
uint inhibit(bool untilNextTransition=false)
Hold the night light off.
void nightTemperatureChanged()
double longitude() const
Degrees east. 0 without a location.
void currentTemperatureChanged()
void uninhibit(uint cookie)
Release the inhibition cookie. Unknown cookies are ignored.
int dayTemperature() const
The day temperature, kelvin, clamped to [ColorTemperature::Minimum, ColorTemperature::Maximum].
bool isInhibited() const
Whether at least one inhibition is held.
bool setHours(QTime eveningStart, QTime morningStart)
Set both hours.
static constexpr int DefaultTransitionDuration
The transition length used until the app sets one, in seconds.
Definition NightLight.h:79
bool isEnabled() const
The user's on/off switch. Default false.
void nextTransitionChanged()
void setTransitionDuration(int seconds)
void targetTemperatureChanged()
void setDayTemperature(int kelvin)
static constexpr int MaximumFadeDuration
The longest fade the library accepts, in milliseconds.
Definition NightLight.h:85
int transitionDuration() const
The requested length of each Hours transition, seconds, clamped to [0, MaximumTransitionDuration].
static constexpr int DefaultFadeDuration
The fade length used until the app sets one, in milliseconds.
Definition NightLight.h:83
QTime morningStart() const
The Hours schedule's morning start (the transition toward day begins).
int currentTemperature() const
The temperature on the screen now, kelvin.
QDateTime nextTransition() const
When the next scheduled transition starts (the one after any transition in progress).
NightLight(QObject *parent=nullptr)
The production night light: a wlr-gamma-control client on the session's Wayland display and the syste...
int targetTemperature() const
The temperature the screen is heading for now, kelvin.
void setNightTemperature(int kelvin)
Definition ColorTemperature.h:11