From f9f75ca068f66e3d9f8c442789b7582595b947b4 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Sat, 19 Sep 2020 10:13:43 +0200 Subject: [PATCH] saneopts: add entries for focus/autofocus coolscan2 has focus entries already reused in coolscan3. Because I want to add the same options to epson2, it makes sense to make them available globally. Add i18n while here. Signed-off-by: Wolfram Sang --- backend/coolscan2.c | 12 ++++++------ backend/coolscan3.c | 12 ++++++------ include/sane/saneopts.h | 8 ++++++++ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/backend/coolscan2.c b/backend/coolscan2.c index 04c4d104d..53de94bed 100644 --- a/backend/coolscan2.c +++ b/backend/coolscan2.c @@ -924,9 +924,9 @@ sane_open (SANE_String_Const name, SANE_Handle * h) o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case CS2_OPTION_FOCUS: - o.name = "focus"; - o.title = "Focus position"; - o.desc = "Focus position for manual focus"; + o.name = SANE_NAME_FOCUS; + o.title = SANE_TITLE_FOCUS; + o.desc = SANE_DESC_FOCUS; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_NONE; o.size = WSIZE; @@ -944,9 +944,9 @@ sane_open (SANE_String_Const name, SANE_Handle * h) } break; case CS2_OPTION_AUTOFOCUS: - o.name = "autofocus"; - o.title = "Autofocus now"; - o.desc = "Autofocus now"; + o.name = SANE_NAME_AUTOFOCUS; + o.title = SANE_TITLE_AUTOFOCUS; + o.desc = SANE_DESC_AUTOFOCUS; o.type = SANE_TYPE_BUTTON; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; diff --git a/backend/coolscan3.c b/backend/coolscan3.c index 6163ec9db..5bc5b5eda 100644 --- a/backend/coolscan3.c +++ b/backend/coolscan3.c @@ -911,9 +911,9 @@ sane_open(SANE_String_Const name, SANE_Handle * h) o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case CS3_OPTION_FOCUS: - o.name = "focus"; - o.title = "Focus position"; - o.desc = "Focus position for manual focus"; + o.name = SANE_NAME_FOCUS; + o.title = SANE_TITLE_FOCUS; + o.desc = SANE_DESC_FOCUS; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_NONE; o.size = WSIZE; @@ -931,9 +931,9 @@ sane_open(SANE_String_Const name, SANE_Handle * h) } break; case CS3_OPTION_AUTOFOCUS: - o.name = "autofocus"; - o.title = "Autofocus"; - o.desc = "Perform autofocus before scan"; + o.name = SANE_NAME_AUTOFOCUS; + o.title = SANE_TITLE_AUTOFOCUS; + o.desc = SANE_DESC_AUTOFOCUS; o.type = SANE_TYPE_BOOL; o.size = WSIZE; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; diff --git a/include/sane/saneopts.h b/include/sane/saneopts.h index 4a4b8cc94..35c714850 100644 --- a/include/sane/saneopts.h +++ b/include/sane/saneopts.h @@ -140,6 +140,8 @@ #define SANE_NAME_SCAN_LAMP_DEN "scan-lamp-density" #define SANE_NAME_SELECT_LAMP_DENSITY "select-lamp-density" #define SANE_NAME_LAMP_OFF_AT_EXIT "lamp-off-at-exit" +#define SANE_NAME_FOCUS "focus" +#define SANE_NAME_AUTOFOCUS "autofocus" /* well known options from 'SENSORS' group*/ #define SANE_NAME_SCAN "scan" @@ -229,6 +231,8 @@ #define SANE_TITLE_SCAN_LAMP_DEN SANE_I18N("Scan lamp density") #define SANE_TITLE_SELECT_LAMP_DENSITY SANE_I18N("Set lamp density") #define SANE_TITLE_LAMP_OFF_AT_EXIT SANE_I18N("Lamp off at exit") +#define SANE_TITLE_FOCUS SANE_I18N("Focus position") +#define SANE_TITLE_AUTOFOCUS SANE_I18N("Autofocus") /* well known options from 'SENSORS' group*/ #define SANE_TITLE_SCAN "Scan button" @@ -439,6 +443,10 @@ SANE_I18N("Define lamp density for scan") SANE_I18N("Enable selection of lamp density") #define SANE_DESC_LAMP_OFF_AT_EXIT \ SANE_I18N("Turn off lamp when program exits") +#define SANE_DESC_FOCUS \ +SANE_I18N("Focus position for manual focus") +#define SANE_DESC_AUTOFOCUS \ +SANE_I18N("Perform autofocus before scan") /* well known options from 'SENSORS' group*/ #define SANE_DESC_SCAN SANE_I18N("Scan button")