Options handling. More...
#include "common.h"#include "gamma.h"Data Structures | |
| struct | pair |
| Pairs for elevation to temperature map. More... | |
Defines | |
| #define | MIN_LAT -90.0 |
| Minimum latitude. | |
| #define | MAX_LAT 90.0 |
| Maximum latitude. | |
| #define | MIN_LON -180.0 |
| Minimum longitude. | |
| #define | MAX_LON 180.0 |
| Maximum longitude. | |
| #define | MIN_SPEED 1 |
| Minimum transition speed. | |
| #define | MAX_SPEED 1000 |
| Maximum transition speed. | |
| #define | DEFAULT_TRANSPEED 1000 |
| Default transition speed. | |
Functions | |
| int | opt_get_config_file (char buffer[], size_t bufsize) |
| Retrieves full path of the configuration file. | |
| void | opt_init (void) |
| Load default values for all fields. | |
| int | opt_set_brightness (double brightness) |
| Sets the brightness value. | |
| int | opt_set_crtc (int val) |
| Sets the CRTC to apply adjustment to. | |
| int | opt_set_gamma (float r, float g, float b) |
| Sets additional gamma adjustment. | |
| int | opt_parse_gamma (char *val) |
| Parses a string containing gamma adjustment. | |
| int | opt_set_location (float lat, float lon) |
| Sets the location with latitude/longitude. | |
| int | opt_parse_location (char *val) |
| Parses a string containing location. | |
| int | opt_set_nogui (int val) |
| Sets console mode. | |
| int | opt_set_method (gamma_method_t method) |
| Sets the method of gamma adjustment. | |
| int | opt_parse_method (char *val) |
| Parses a string of the method. | |
| int | opt_set_oneshot (int onoff) |
| Sets one shot mode (adjust and then exit). | |
| int | opt_set_transpeed (int tpersec) |
| Sets transition speed. | |
| int | opt_set_screen (int val) |
| Sets the screen to apply adjustment to. | |
| int | opt_set_temperatures (int tday, int tnight) |
| Sets the temperatures for day/night. | |
| int | opt_parse_temperatures (char *val) |
| Parse the temperatures from string. | |
| int | opt_set_verbose (int val) |
| Sets the verbosity of the logging level. | |
| int | opt_parse_map (char *map) |
| Parses temperature map. | |
| float | opt_get_brightness (void) |
| Retrieves brightness. | |
| int | opt_get_crtc (void) |
| Retrieves CRTC. | |
| gamma_s | opt_get_gamma (void) |
| Retrieves Gamma. | |
| float | opt_get_lat (void) |
| Retrieves latitude. | |
| float | opt_get_lon (void) |
| Retrieves longitude. | |
| int | opt_get_nogui (void) |
| Retrieves no GUI mode. | |
| gamma_method_t | opt_get_method (void) |
| Retrieves method. | |
| int | opt_get_oneshot (void) |
| Retrieves oneshot mode. | |
| int | opt_get_trans_speed (void) |
| Retrieves transition speed. | |
| int | opt_get_screen (void) |
| Retrieves screen. | |
| int | opt_get_temp_day (void) |
| Retrieves day temperature. | |
| int | opt_get_temp_night (void) |
| Retrieves night temperature. | |
| int | opt_get_verbosity (void) |
| Retrieves verbosity level. | |
| pair * | opt_get_map (int *size) |
| Retrieves current temperature map. | |
| void | opt_write_config (void) |
| Writes the configuration file with current settings. | |
| void | opt_free (void) |
| Frees resources used by options. | |
Options handling.
| int opt_get_config_file | ( | char | buffer[], | |
| size_t | bufsize | |||
| ) |
Retrieves full path of the configuration file.
| buffer | buffer to store the configuration file. | |
| bufsize | size of the buffer. |
| int opt_parse_gamma | ( | char * | val | ) |
Parses a string containing gamma adjustment.
| val | string containing text in the form of R:G:B |
| int opt_parse_location | ( | char * | val | ) |
Parses a string containing location.
| val | string containing text in the form of LAT:LON |
| int opt_parse_map | ( | char * | map | ) |
Parses temperature map.
| map | String containing new temperature map. |
| int opt_parse_method | ( | char * | val | ) |
Parses a string of the method.
| val | string containing either "randr" (or "RANDR"), "vidmode" (or "VidMode"), or "wingdi" (or "WinGDI") |
| int opt_parse_temperatures | ( | char * | val | ) |
Parse the temperatures from string.
| val | String containing text in the form of "DAY:NIGHT" |
| int opt_set_brightness | ( | double | brightness | ) |
Sets the brightness value.
| brightness | Brightness scale (0.1 - 1) |
| int opt_set_crtc | ( | int | val | ) |
Sets the CRTC to apply adjustment to.
| val | integer value of CRTC |
| int opt_set_gamma | ( | float | r, | |
| float | g, | |||
| float | b | |||
| ) |
Sets additional gamma adjustment.
| r | red value | |
| g | green value | |
| b | blue value |
| int opt_set_location | ( | float | lat, | |
| float | lon | |||
| ) |
Sets the location with latitude/longitude.
| lat | latitude | |
| lon | longitude |
| int opt_set_method | ( | gamma_method_t | method | ) |
Sets the method of gamma adjustment.
| method | gamma_method_t argument |
| int opt_set_nogui | ( | int | val | ) |
Sets console mode.
| val | 0 for GUI mode, 1 for console mode |
| int opt_set_oneshot | ( | int | onoff | ) |
Sets one shot mode (adjust and then exit).
| onoff | set to 1 to enable |
| int opt_set_screen | ( | int | val | ) |
Sets the screen to apply adjustment to.
| val | integer value of the screen. |
| int opt_set_temperatures | ( | int | tday, | |
| int | tnight | |||
| ) |
Sets the temperatures for day/night.
| tday | temperature for daytime (defaults to DEFAULT_DAY_TEMP) | |
| tnight | temperature for nighttime (defaults to DEFAULT_NIGHT_TEMP) |
| int opt_set_transpeed | ( | int | tpersec | ) |
Sets transition speed.
| tpersec | temperature per second, defaults to 100k/s |
| int opt_set_verbose | ( | int | val | ) |
Sets the verbosity of the logging level.
| val | verbosity |
1.7.1