diff options
author | Mattias Andrée <maandree@kth.se> | 2021-03-05 18:23:13 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-03-05 18:33:49 +0100 |
commit | f52513b09580c1533e6c48a4162d3d5f61f3b081 (patch) | |
tree | 141d0974a777f4ec5b51daed9879a2cb0d781505 /libgamma_x_vidmode_method_capabilities.c | |
parent | Split source files, merge public header files, eliminite use gpp, rewrite makefile (diff) | |
download | libgamma-f52513b09580c1533e6c48a4162d3d5f61f3b081.tar.gz libgamma-f52513b09580c1533e6c48a4162d3d5f61f3b081.tar.bz2 libgamma-f52513b09580c1533e6c48a4162d3d5f61f3b081.tar.xz |
misc
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | libgamma_x_vidmode_method_capabilities.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libgamma_x_vidmode_method_capabilities.c b/libgamma_x_vidmode_method_capabilities.c new file mode 100644 index 0000000..5ef885d --- /dev/null +++ b/libgamma_x_vidmode_method_capabilities.c @@ -0,0 +1,37 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + + +/** + * Return the capabilities of the adjustment method + * + * @param this The data structure to fill with the method's capabilities + */ +void +libgamma_x_vidmode_method_capabilities(libgamma_method_capabilities_t *restrict this) +{ + char *restrict display = getenv("DISPLAY"); + /* Gamma ramps size and depth can be queried */ + this->crtc_information = LIBGAMMA_CRTC_INFO_GAMMA_SIZE | LIBGAMMA_CRTC_INFO_GAMMA_DEPTH; + /* X VidMode supports multiple sites and partitions but not CRTC:s */ + this->default_site_known = (display && *display) ? 1 : 0; + this->multiple_sites = 1; + this->multiple_partitions = 1; + this->multiple_crtcs = 0; + /* Partitions are screens and not graphics cards in X */ + this->partitions_are_graphics_cards = 0; + /* X does not have system restore capabilities */ + this->site_restore = 0; + this->partition_restore = 0; + this->crtc_restore = 0; + /* Gamma ramp sizes are identical but not fixed */ + this->identical_gamma_sizes = 1; + this->fixed_gamma_size = 0; + /* Gamma ramp depths are fixed */ + this->fixed_gamma_depth = 1; + /* X VidMode is a real non-faked adjustment method */ + this->real = 1; + this->fake = 0; + /* Gamma ramp adjustments are persistent */ + this->auto_restore = 0; +} |