From f84a3ba77c61a351e1d7efb67bd40db23a435281 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 16 Mar 2025 22:36:46 +0100 Subject: Refactor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/gamma-w32gdi.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/gamma-w32gdi.c') diff --git a/src/gamma-w32gdi.c b/src/gamma-w32gdi.c index e216a23..533365d 100644 --- a/src/gamma-w32gdi.c +++ b/src/gamma-w32gdi.c @@ -33,15 +33,15 @@ struct gamma_state { static int -w32gdi_init(struct gamma_state **state) +w32gdi_create(struct gamma_state **state_out) { - *state = emalloc(sizeof(**state)); - (*state)->saved_ramps = NULL; + *state_out = emalloc(sizeof(**state_out)); + (*state_out)->saved_ramps = NULL; return 0; } static int -w32gdi_start(struct gamma_state *state, program_mode_t mode) +w32gdi_start(struct gamma_state *state) { HDC hDC; int cmcap; @@ -133,8 +133,7 @@ done: } static int -w32gdi_set_temperature( - struct gamma_state *state, const colour_setting_t *setting, int preserve) +w32gdi_apply(struct gamma_state *state, const colour_setting_t *setting, int preserve) { WORD *gamma_ramps, *gamma_r, *gamma_b, *gamma_g, value; HDC hDC; @@ -192,13 +191,4 @@ done: } -const struct gamma_method w32gdi_gamma_method = { - "wingdi", 1, - &w32gdi_init, - &w32gdi_start, - &w32gdi_free, - &w32gdi_print_help, - &w32gdi_set_option, - &w32gdi_restore, - &w32gdi_set_temperature -}; +const struct gamma_method w32gdi_gamma_method = GAMMA_METHOD_INIT("winfdi", 1, w32gdi); -- cgit v1.2.3-70-g09d2