From 2d4a5ad26bfb46b2839b176798dd1d0261cf2210 Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Mon, 9 Dec 2013 10:48:45 -0500 Subject: Add dummy gamma adjustment method This method does not do anything but print the temperature to the terminal. An external program implementing a color temperature adjustment scheme that is not supported by redshift can use this method to determine the desired color temperature. It is also useful for testing other parts of redshift on systems where neither RandR nor VidMode works. --- src/redshift.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/redshift.c') diff --git a/src/redshift.c b/src/redshift.c index 1569f50..08c06b5 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -51,11 +51,7 @@ #define MAX(x,y) ((x) > (y) ? (x) : (y)) -#if !(defined(ENABLE_RANDR) || \ - defined(ENABLE_VIDMODE) || \ - defined(ENABLE_WINGDI)) -# error "At least one of RANDR, VidMode or WinGDI must be enabled." -#endif +#include "gamma-dummy.h" #ifdef ENABLE_RANDR # include "gamma-randr.h" @@ -133,6 +129,16 @@ static const gamma_method_t gamma_methods[] = { (gamma_method_set_temperature_func *)w32gdi_set_temperature }, #endif + { + "dummy", + (gamma_method_init_func *)gamma_dummy_init, + (gamma_method_start_func *)gamma_dummy_start, + (gamma_method_free_func *)gamma_dummy_free, + (gamma_method_print_help_func *)gamma_dummy_print_help, + (gamma_method_set_option_func *)gamma_dummy_set_option, + (gamma_method_restore_func *)gamma_dummy_restore, + (gamma_method_set_temperature_func *)gamma_dummy_set_temperature + }, { NULL } }; -- cgit v1.2.3-70-g09d2