diff options
Diffstat (limited to 'src/gamma-quartz.c')
-rw-r--r-- | src/gamma-quartz.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gamma-quartz.c b/src/gamma-quartz.c index d323d33..c05e72d 100644 --- a/src/gamma-quartz.c +++ b/src/gamma-quartz.c @@ -1,4 +1,5 @@ -/* redshift-ng - Automatically adjust display colour temperature according the Sun +/*- + * redshift-ng - Automatically adjust display colour temperature according the Sun * * Copyright (c) 2009-2018 Jon Lund Steffensen <jonlst@gmail.com> * Copyright (c) 2014-2016, 2025 Mattias Andrée <m@maandree.se> @@ -27,6 +28,7 @@ struct quartz_display_state { float *saved_ramps; }; + struct gamma_state { struct quartz_display_state *displays; uint32_t display_count; @@ -41,6 +43,7 @@ quartz_create(struct gamma_state **state_out) return 0; } + static int quartz_start(struct gamma_state *state) { @@ -106,12 +109,14 @@ quartz_start(struct gamma_state *state) return 0; } + static void quartz_restore(struct gamma_state *state) { CGDisplayRestoreColorSyncSettings(); } + static void quartz_free(struct gamma_state *state) { @@ -123,6 +128,7 @@ quartz_free(struct gamma_state *state) free(state); } + static void quartz_print_help(FILE *f) { @@ -130,6 +136,7 @@ quartz_print_help(FILE *f) fputs("\n", f); } + static int quartz_set_option(struct gamma_state *state, const char *key, const char *value) { @@ -143,6 +150,7 @@ quartz_set_option(struct gamma_state *state, const char *key, const char *value) return 0; } + static void quartz_apply_for_display(struct gamma_state *state, int display_index, const colour_setting_t *setting, int preserve) { @@ -183,16 +191,15 @@ quartz_apply_for_display(struct gamma_state *state, int display_index, const col free(gamma_ramps); } + static int quartz_apply(struct gamma_state *state, const colour_setting_t *setting, int preserve) { uint32_t i; - for (i = 0; i < state->display_count; i++) quartz_apply_for_display(state, i, setting, preserve); - return 0; } -const struct gamma_method quartz_gamma_method = GAMMA_METHOD_INIT("quartz", 1, quartz); +const struct gamma_method quartz_gamma_method = GAMMA_METHOD_INIT("quartz", 1, 1, quartz); |