From e3e2ca1aabf85f58931537ab34599f91b2380bd7 Mon Sep 17 00:00:00 2001 From: Rolf Bensch Date: Mon, 27 Feb 2012 15:31:37 +0100 Subject: [PATCH] constraint range for threshold --- backend/pixma.c | 1 + backend/pixma_sane_options.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/pixma.c b/backend/pixma.c index c306a5bf9..4a8483dff 100644 --- a/backend/pixma.c +++ b/backend/pixma.c @@ -1692,6 +1692,7 @@ type group type int threshold unit PERCENT default 50 + constraint (0,100,1) title @SANE_TITLE_THRESHOLD desc @SANE_DESC_THRESHOLD cap soft_select soft_detect automatic inactive diff --git a/backend/pixma_sane_options.c b/backend/pixma_sane_options.c index 4a466363d..b0619ce76 100644 --- a/backend/pixma_sane_options.c +++ b/backend/pixma_sane_options.c @@ -2,6 +2,7 @@ static const SANE_Range constraint_gamma_table = { 0, 255, 0 }; static const SANE_Range constraint_gamma = { SANE_FIX (0.3), SANE_FIX (5), SANE_FIX (0) }; +static const SANE_Range constraint_threshold = { 0, 100, 1 }; static int find_string_in_list (SANE_String_Const str, const SANE_String_Const * list) @@ -285,7 +286,8 @@ build_option_descriptors (struct pixma_sane_t *ss) sod->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_AUTOMATIC | SANE_CAP_INACTIVE; - sod->constraint_type = SANE_CONSTRAINT_NONE; + sod->constraint_type = SANE_CONSTRAINT_RANGE; + sod->constraint.range = &constraint_threshold; OPT_IN_CTX[opt_threshold].info = 0; opt->def.w = 50; opt->val.w = 50;