aboutsummaryrefslogtreecommitdiffstats
path: root/src/gamma-w32gdi.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-03-16 22:36:46 +0100
committerMattias Andrée <m@maandree.se>2025-03-16 22:36:46 +0100
commitf84a3ba77c61a351e1d7efb67bd40db23a435281 (patch)
tree83948f9074f2c761913cbb648f8b36bcdae43367 /src/gamma-w32gdi.c
parentMajor refactoring and some fixes (diff)
downloadredshift-ng-f84a3ba77c61a351e1d7efb67bd40db23a435281.tar.gz
redshift-ng-f84a3ba77c61a351e1d7efb67bd40db23a435281.tar.bz2
redshift-ng-f84a3ba77c61a351e1d7efb67bd40db23a435281.tar.xz
Refactor
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'src/gamma-w32gdi.c')
-rw-r--r--src/gamma-w32gdi.c22
1 files changed, 6 insertions, 16 deletions
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);