diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-05-21 23:38:55 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-05-21 23:38:55 +0200 |
commit | 09afa14c7772e010733844574e27d07ea7fe5446 (patch) | |
tree | adfab9bec5865c765f5a816fdd3c4a3499196ec3 /src/gamma-quartz-cg.c | |
parent | misc (diff) | |
download | libgamma-09afa14c7772e010733844574e27d07ea7fe5446.tar.gz libgamma-09afa14c7772e010733844574e27d07ea7fe5446.tar.bz2 libgamma-09afa14c7772e010733844574e27d07ea7fe5446.tar.xz |
misc awesomeness
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/gamma-quartz-cg.c')
-rw-r--r-- | src/gamma-quartz-cg.c | 66 |
1 files changed, 44 insertions, 22 deletions
diff --git a/src/gamma-quartz-cg.c b/src/gamma-quartz-cg.c index bb4e307..582b12a 100644 --- a/src/gamma-quartz-cg.c +++ b/src/gamma-quartz-cg.c @@ -22,6 +22,7 @@ #include "gamma-quartz-cg.h" #include "libgamma-error.h" +#include "gamma-helper.h" /** @@ -31,6 +32,30 @@ */ void libgamma_quartz_cg_method_capabilities(libgamma_method_capabilities_t* restrict this) { + this->crtc_information = CRTC_INFO_GAMMA_SIZE + | CRTC_INFO_GAMMA_DEPTH; + this->default_site_known = NULL; + this->multiple_sites = 0; + this->multiple_partitions = 0; + this->multiple_crtcs = 1; + this->partitions_are_graphics_cards = 0; + this->site_restore = 1; + this->partition_restore = 1; + this->crtc_restore = 0; + this->identical_gamma_sizes = 1; + this->fixed_gamma_size = 0; + this->fixed_gamma_depth = 1; +#ifdef FAKE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS + this->fake = 1; +# ifdef HAVE_GAMMA_METHOD_X_RANDR + this->real = 1; +# else + this->real = 0; +# endif +#else + this->fake = 0; + this->real = 1; +#endif } @@ -102,17 +127,6 @@ void libgamma_quartz_cg_partition_destroy(libgamma_partition_state_t* restrict t /** - * Release all resources held by a partition state - * and free the partition state pointer - * - * @param this The partition state - */ -void libgamma_quartz_cg_partition_free(libgamma_partition_state_t* restrict this) -{ -} - - -/** * Restore the gamma ramps all CRTCS with a partition to the system settings * * @param this The partition state @@ -121,6 +135,7 @@ void libgamma_quartz_cg_partition_free(libgamma_partition_state_t* restrict this */ int libgamma_quartz_cg_partition_restore(libgamma_partition_state_t* restrict this) { + return libgamma_quartz_cg_site_restore(this->site); } @@ -151,17 +166,6 @@ void libgamma_quartz_cg_crtc_destroy(libgamma_crtc_state_t* restrict this) /** - * Release all resources held by a CRTC state - * and free the CRTC state pointer - * - * @param this The CRTC state - */ -void libgamma_quartz_cg_crtc_free(libgamma_crtc_state_t* restrict this) -{ -} - - -/** * Restore the gamma ramps for a CRTC to the system settings for that CRTC * * @param this The CRTC state @@ -170,6 +174,8 @@ void libgamma_quartz_cg_crtc_free(libgamma_crtc_state_t* restrict this) */ int libgamma_quartz_cg_crtc_restore(libgamma_crtc_state_t* restrict this) { + (void) this; + return errno = ENOTSUP, LIBGAMMA_ERRNO_SET; } @@ -199,6 +205,8 @@ int libgamma_quartz_cg_get_crtc_information(libgamma_crtc_information_t* restric int libgamma_quartz_cg_crtc_get_gamma_ramps(libgamma_crtc_state_t* restrict this, libgamma_gamma_ramps_t* restrict ramps) { + return libgamma_translated_ramp_get(this, ramps, 16, -1, + libgamma_quartz_cg_crtc_get_gamma_ramps); } @@ -213,6 +221,8 @@ int libgamma_quartz_cg_crtc_get_gamma_ramps(libgamma_crtc_state_t* restrict this int libgamma_quartz_cg_crtc_set_gamma_ramps(libgamma_crtc_state_t* restrict this, libgamma_gamma_ramps_t ramps) { + return libgamma_translated_ramp_set(this, ramps, 16, -1, + libgamma_quartz_cg_crtc_set_gamma_ramps); } @@ -228,6 +238,8 @@ int libgamma_quartz_cg_crtc_set_gamma_ramps(libgamma_crtc_state_t* restrict this int libgamma_quartz_cg_crtc_get_gamma_ramps32(libgamma_crtc_state_t* restrict this, libgamma_gamma_ramps32_t* restrict ramps) { + return libgamma_translated_ramp_get(this, ramps, 32, -1, + libgamma_quartz_cg_crtc_get_gamma_ramps); } @@ -242,6 +254,8 @@ int libgamma_quartz_cg_crtc_get_gamma_ramps32(libgamma_crtc_state_t* restrict th int libgamma_quartz_cg_crtc_set_gamma_ramps32(libgamma_crtc_state_t* restrict this, libgamma_gamma_ramps32_t ramps) { + return libgamma_translated_ramp_set(this, ramps, 32, -1, + libgamma_quartz_cg_crtc_set_gamma_ramps); } @@ -257,6 +271,8 @@ int libgamma_quartz_cg_crtc_set_gamma_ramps32(libgamma_crtc_state_t* restrict th int libgamma_quartz_cg_crtc_get_gamma_ramps64(libgamma_crtc_state_t* restrict this, libgamma_gamma_ramps64_t* restrict ramps) { + return libgamma_translated_ramp_get(this, ramps, 64, -1, + libgamma_quartz_cg_crtc_get_gamma_ramps); } @@ -271,6 +287,8 @@ int libgamma_quartz_cg_crtc_get_gamma_ramps64(libgamma_crtc_state_t* restrict th int libgamma_quartz_cg_crtc_set_gamma_ramps64(libgamma_crtc_state_t* restrict this, libgamma_gamma_ramps64_t ramps) { + return libgamma_translated_ramp_set(this, ramps, 64, -1, + libgamma_quartz_cg_crtc_set_gamma_ramps); } @@ -314,6 +332,8 @@ int libgamma_quartz_cg_crtc_set_gamma_rampsf(libgamma_crtc_state_t* restrict thi int libgamma_quartz_cg_crtc_get_gamma_rampsd(libgamma_crtc_state_t* restrict this, libgamma_gamma_rampsd_t* restrict ramps) { + return libgamma_translated_ramp_get(this, ramps, -2, -1, + libgamma_quartz_cg_crtc_get_gamma_ramps); } @@ -328,5 +348,7 @@ int libgamma_quartz_cg_crtc_get_gamma_rampsd(libgamma_crtc_state_t* restrict thi int libgamma_quartz_cg_crtc_set_gamma_rampsd(libgamma_crtc_state_t* restrict this, libgamma_gamma_rampsd_t ramps) { + return libgamma_translated_ramp_set(this, ramps, -2, -1, + libgamma_quartz_cg_crtc_set_gamma_ramps); } |