aboutsummaryrefslogtreecommitdiffstats
path: root/src/backend-direct.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/backend-direct.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/backend-direct.c b/src/backend-direct.c
index d0a53eb..5654947 100644
--- a/src/backend-direct.c
+++ b/src/backend-direct.c
@@ -197,6 +197,52 @@ direct_create(struct gamma_state **state_out, int method, const char *method_nam
}
+void
+direct_print_help(FILE *f, int method)
+{
+ struct libgamma_method_capabilities caps;
+
+ if (libgamma_method_capabilities(&caps, sizeof(caps), method)) {
+ fputs(_("Adjustment not available\n"), f);
+ fputs("\n", f);
+ return;
+ }
+
+ if (caps.multiple_partitions && caps.partitions_are_graphics_cards) {
+ /* TRANSLATORS: left column must not be translated */
+ fputs(_(" card=N Graphics card to apply adjustments to\n"), f);
+ } else if (caps.multiple_partitions) {
+ /* TRANSLATORS: left column must not be translated */
+ fputs(_(" screen=N X screen to apply adjustments to\n"), f);
+ }
+
+ if (caps.multiple_crtcs) {
+ /* TRANSLATORS: left column must not be translated */
+ fputs(_(" crtc=N List of comma-separated CRTCs to apply adjustments to\n"), f);
+ }
+
+ if (caps.multiple_partitions || caps.multiple_crtcs)
+ fputs("\n", f);
+}
+
+
+int
+direct_set_option(struct gamma_state *state, const char *key, const char *value)
+{
+ if (state->multiple_partitions && !strcasecmp(key, state->partitions_are_graphics_cards ? "card" : "screen")) {
+ return direct_set_partitions(state, key, value);
+ } else if (state->multiple_crtcs && !strcasecmp(key, "crtc")) {
+ return direct_set_crtcs(state, key, value);
+ } else if (!strcasecmp(key, "preserve")) {
+ weprintf(_("Deprecated method parameter ignored: `%s'."), key);
+ return 0;
+ } else {
+ weprintf(_("Unknown method parameter: `%s'."), key);
+ return -1;
+ }
+}
+
+
int
direct_set_partitions(struct gamma_state *state, const char *key, const char *value)
{