diff options
Diffstat (limited to 'src/common.h')
-rw-r--r-- | src/common.h | 198 |
1 files changed, 184 insertions, 14 deletions
diff --git a/src/common.h b/src/common.h index cc1852d..e6d62da 100644 --- a/src/common.h +++ b/src/common.h @@ -431,6 +431,85 @@ enum setting_source { /** + * SIGUSR2 signal values as bitmask values + */ +enum signals { + /** + * Block SIGUSR2 until all signals have been processed + */ + SIGNAL_ORDER_BARRIER = 1 << 0, + + /** + * Disable the effects of redshift + */ + SIGNAL_DISABLE = 1 << 1, + + /** + * Enable the effects of redshift + */ + SIGNAL_ENABLE = 1 << 2, + + /** + * Reload the configuration file + * + * Settings from the command line will be overriden + */ + SIGNAL_RELOAD = 1 << 3, + + /** + * Execute into the currently installed version of redshift + */ + SIGNAL_REEXEC = 1 << 4, + + /** + * Set the "fade" setting to off + */ + SIGNAL_USE_FADE_OFF = 1 << 5, + + /** + * Set the "fade" setting to on + */ + SIGNAL_USE_FADE_ON = 1 << 6, + + /** + * Set the "preserve-gamma" setting to off + */ + SIGNAL_PRESERVE_GAMMA_OFF = 1 << 7, + + /** + * Set the "preserve-gamma" setting to on + */ + SIGNAL_PRESERVE_GAMMA_ON = 1 << 8, + + /** + * Exit the process without removing the its effects + * + * If the used adjustment method does not support + * leaving the effects, they will be removed + */ + SIGNAL_EXIT_WITHOUT_RESET = 1 << 9, + + /** + * Do not terminate redshift the standard output + * and standard error are closed + */ + SIGNAL_IGNORE_SIGPIPE = 1 << 10, + + /** + * Enable verbose mode + */ + SIGNAL_VERBOSE_ON = 1 << 11, + + /** + * Disable verbose mode + * + * Ignore if started in verbose mode (-v option) + */ + SIGNAL_VERBOSE_OFF = 1 << 12 +}; + + +/** * Specification for a path that consists of a two parts: * the first being defined by the environment, and the * seocnd being a static string @@ -611,34 +690,79 @@ struct config_ini_state { }; +/** + * `int` valued setting (used for booleans) with setting source + */ struct setting_i { - enum setting_source source; - int value; + enum setting_source source; /**< Setting source */ + int value; /**< Setting value */ }; +/** + * `unsigned long int` valued setting with setting source + */ struct setting_lu { - enum setting_source source; - unsigned long int value; + enum setting_source source; /**< Setting source */ + unsigned long int value; /**< Setting value */ }; +/** + * `double` valued setting with setting source + */ struct setting_f { - enum setting_source source; - double value; + enum setting_source source; /**< Setting source */ + double value; /**< Setting value */ }; +/** + * `double[3]` valued setting with setting source + */ struct setting_f3 { - enum setting_source source; - double value[3]; + enum setting_source source; /**< Setting source */ + double value[3]; /**< Setting values */ }; +/** + * `time_t` valued setting with setting source + */ struct setting_time { - enum setting_source source; - time_t value; + enum setting_source source; /**< Setting source */ + time_t value; /**< Setting value */ }; +/** + * Intermediate settings representation of colour settings + * (for a non-transitional period) with settings sources + * used for determining whether settings from the configuration + * file (which is parsed after the command line) applied or are + * specified multiple times in the configuration file + */ struct setting_colour { + /** + * Colour temperature, in Kelvin + * + * Set by the "-t" and "-o" options and the "temperature" + * ("temp") settings, optionally suffixed "-day" if + * a daytime setting or "-night" if a nighttime setting + */ struct setting_lu temperature; + + /** + * Whitepoint brightness level, as a [0, 1] value + * + * Set by the "-b" option and the "brightness" settings, + * optionally suffixed "-day" if a daytime setting or + * "-night" if a nighttime setting + */ struct setting_f brightness; + + /** + * Gamma values, in the order red, green, blue + * + * Set by the "-g" option and the "gamma" settings, + * optionally suffixed "-day" if a daytime setting or + * "-night" if a nighttime setting + */ struct setting_f3 gamma; }; @@ -705,12 +829,53 @@ struct settings { */ struct setting_colour night; + /** + * The lowest solar elevation, in degrees, at daytime, + * when using solar scheme + * + * This represents the "elevation-high" setting + */ struct setting_f elevation_high; /* TODO no cmdline option */ + + /** + * The highest solar elevation, in degrees, at nighttime, + * when using solar scheme + * + * This represents the "elevation-high" setting + */ struct setting_f elevation_low; /* TODO no cmdline option */ - struct { - struct setting_time start; - struct setting_time end; - } dawn, dusk; /* TODO no cmdline option */ + + /** + * The wall-clock time that marks the end of nighttime, + * when using clock scheme + * + * This represents the left value of the "dawn-time" setting + */ + struct setting_time dawn_start; /* TODO no cmdline option */ + + /** + * The wall-clock time that marks the start of daytime, + * when using clock scheme + * + * This represents the right value of the "dawn-time" setting + */ + struct setting_time dawn_end; /* TODO no cmdline option */ + + /** + * The wall-clock time that marks the end of daytime, + * when using clock scheme + * + * This represents the left value of the "dusk-time" setting + */ + struct setting_time dusk_start; /* TODO no cmdline option */ + + /** + * The wall-clock time that marks the start of nighttime, + * when using clock scheme + * + * This represents the right value of the "dusk-time" setting + */ + struct setting_time dusk_end; /* TODO no cmdline option */ /* Selected gamma method */ const struct gamma_method *method; @@ -956,6 +1121,11 @@ extern volatile sig_atomic_t exiting; extern volatile sig_atomic_t disable; /** + * Bitwise or OR of received SIGUSR2 signal values + */ +extern volatile enum signals signals; + +/** * The colour settings applied at daytime */ extern struct colour_setting day_settings; |