From 037b945a9f253b97faffc02d8475574e75203516 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 27 Mar 2025 18:36:26 +0100 Subject: one dir per subproject MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- redshift/gamma-dummy.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 redshift/gamma-dummy.c (limited to 'redshift/gamma-dummy.c') diff --git a/redshift/gamma-dummy.c b/redshift/gamma-dummy.c new file mode 100644 index 0000000..de4b687 --- /dev/null +++ b/redshift/gamma-dummy.c @@ -0,0 +1,89 @@ +/*- + * redshift-ng - Automatically adjust display colour temperature according the Sun + * + * Copyright (c) 2009-2018 Jon Lund Steffensen + * Copyright (c) 2014-2016, 2025 Mattias Andrée + * + * redshift-ng is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * redshift-ng is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with redshift-ng. If not, see . + */ +#include "common.h" + + +static int +dummy_is_available(void) +{ + return 1; +} + + +static int +dummy_create(struct gamma_state **state_out) +{ + *state_out = NULL; + return 0; +} + + +static int +dummy_start(struct gamma_state *state) +{ + (void) state; + weprintf(_("WARNING: Using dummy gamma method! Display will not be affected by this gamma method.\n")); + return 0; +} + + +static void +dummy_restore(struct gamma_state *state) +{ + (void) state; +} + + +static void +dummy_free(struct gamma_state *state) +{ + (void) state; +} + + +static void +dummy_print_help(void) +{ + printf(_("Does not affect the display but prints the color temperature to the terminal.\n")); + printf("\n"); +} + + +static int +dummy_set_option(struct gamma_state *state, const char *key, const char *value) +{ + (void) state; + (void) value; + weprintf(_("Unknown method parameter: `%s'."), key); + return -1; +} + + +static int +dummy_apply(struct gamma_state *state, const struct colour_setting *setting, int preserve) +{ + (void) state; + (void) preserve; + printf(_("Temperature: %lu\n"), setting->temperature); + return 0; +} + + +const struct gamma_method dummy_gamma_method = GAMMA_METHOD_INIT("dummy", 0, 0, dummy); -- cgit v1.2.3-70-g09d2