Fixes#188
When I moved the macro definition below all of the includes, I got the
following compiler warning:
/usr/include/glib-2.0/glib/gmacros.h:246:0: note: this is the location
of the previous definition
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low))
? (low) : (x)))
So, that's the macro definition that was being used whenever "CLAMP" was
used. It's pretty obvious what went wrong.
This change adds the preserve option to the quartz method which makes it
base the temperature adjustments on the existing gamma ramps when set. This
requires that the existing gamma ramps are saved at start-up which this
commit also adds.
One drawback is that the list of displays is enumerated at start-up now which
means that Redshift will likely not affect displays that are connected after
start-up. This could be fixed in the future by listening to reconfiguration
events.
This changes colorramp_fill() to base the ramp calculations on the
existing values in the supplied tables, instead of basing it on a pure
`i/size` value computed on the fly.
All gamma adjustment methods are changed to explicitly initialize the ramps
to the `i/size` value before calls to colorramp_fill().
This changes the transition_levels_t to transition_scheme_t and
adds two fields day, night of type color_setting_t. This
encapsulates all the information needed to calculate the current
color setting from an elevation.
Build failed on windows platform since pause() is not available. The
function is not needed on the windows platform so we just define a
noop pause() macro.
The gamma adjustments made with the Quartz (OSX) method are tied
to the process so when we exit, the gamma adjustments are reset.
Therefore we need to run a loop that breaks on CTRL-C, after the
gamma adjustments are made.
Clarify use of options and `list` for for methods and providers.
Add missing information on configuration file options.
Update issue tracker web address.
Fix missing include of windows.h on windows platform. Change check
for _POSIX_TIMERS to check that it is greater than 0. On OS X, the
POSIX timers are not available and _POSIX_TIMERS is -1.
Hooks are executable scripts in ~/.config/redshift/hooks/ that
are run when a certain event happens. The first parameter to the
script indicates the event and further parameters may indicate
more details about the event.
The event "period-changed" is indicated when the period changes
("night", "daytime", "transition"). The second parameter is the old
period and the third is the new period. The event is signaled when
Redshift starts up with the old period set to "none".