diff options
author | Jon Lund Steffensen <jonlst@gmail.com> | 2010-05-27 02:20:29 +0200 |
---|---|---|
committer | Jon Lund Steffensen <jonlst@gmail.com> | 2010-05-27 02:20:29 +0200 |
commit | 441dae4a44f60665c9f669a80304b688285c9c22 (patch) | |
tree | 572d08dfeeac1e2a4d737513d9e6c8daa4b0f343 /src/gamma-w32gdi.c | |
parent | Let gamma methods and location providers print help on option parameters. (diff) | |
download | redshift-ng-441dae4a44f60665c9f669a80304b688285c9c22.tar.gz redshift-ng-441dae4a44f60665c9f669a80304b688285c9c22.tar.bz2 redshift-ng-441dae4a44f60665c9f669a80304b688285c9c22.tar.xz |
Split init function of methods and providers into init and start.
The set_option function can be called to set options between init
and start.
Diffstat (limited to 'src/gamma-w32gdi.c')
-rw-r--r-- | src/gamma-w32gdi.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/gamma-w32gdi.c b/src/gamma-w32gdi.c index 2dc12f3..ac6fb0f 100644 --- a/src/gamma-w32gdi.c +++ b/src/gamma-w32gdi.c @@ -38,14 +38,18 @@ int -w32gdi_init(w32gdi_state_t *state, char *args) +w32gdi_init(w32gdi_state_t *state) { - BOOL r; + state->saved_ramps = NULL; + state->hDC = NULL; - if (args != NULL) { - fputs(_("Too many arguments.\n"), stderr); - return -1; - } + return 0; +} + +int +w32gdi_init(w32gdi_state_t *state) +{ + BOOL r; /* Open device context */ state->hDC = GetDC(NULL); @@ -88,7 +92,7 @@ w32gdi_free(w32gdi_state_t *state) free(state->saved_ramps); /* Release device context */ - ReleaseDC(NULL, state->hDC); + if (state->hDC != NULL) ReleaseDC(NULL, state->hDC); } @@ -99,6 +103,12 @@ w32gdi_print_help(FILE *f) fputs("\n", f); } +int +w32gdi_set_option(w32gdi_state_t *state, const char *key, const char *value) +{ + return -1; +} + void w32gdi_restore(w32gdi_state_t *state) { |