diff --git a/sane/scanner.cpp b/sane/scanner.cpp index c5ad8bb..b7632bf 100644 --- a/sane/scanner.cpp +++ b/sane/scanner.cpp @@ -2926,6 +2926,18 @@ COM_API_IMPLEMENT(scanner, bool, get_option_info(int sn, value_type* type, value \ return true; \ } +#define SIMPLE_BOOL_INFO(id, rdo) \ + if (sn == id) \ + { \ + if (type) \ + *type = VAL_TYPE_BOOL; \ + if (limit) \ + *limit = rdo ? VAL_LIMIT_READONLY : VAL_LIMIT_NONE; \ + if (bytes) \ + *bytes = sizeof(int); \ + \ + return true; \ + } SIMPLE_STR_INFO(SANE_OPT_ID_DRIVER_VERSION, true); @@ -2951,6 +2963,7 @@ COM_API_IMPLEMENT(scanner, bool, get_option_info(int sn, value_type* type, value SIMPLE_INT_INFO(SANE_OPT_ID_PID, true); SIMPLE_INT_INFO(SANE_OPT_ID_ROLLER_LIFE, true); SIMPLE_STR_INFO(SANE_OPT_ID_INITIAL_BOOT_TIME, true); + SIMPLE_BOOL_INFO(SANE_OPT_ID_LENS_DIRTY, false); sn = transfer_id(sn); if (sn == -1) diff --git a/twain/twain/huagaods.cpp b/twain/twain/huagaods.cpp index bb7d26c..bab02c9 100644 --- a/twain/twain/huagaods.cpp +++ b/twain/twain/huagaods.cpp @@ -3530,7 +3530,8 @@ void huagao_ds::init_support_caps_ex(void) ADD_SANE_CAP(FOLD_TYPE); ADD_SANE_CAP(COLOR_CORRECTION); ADD_SANE_CAP(DISCARDBLANK); - + ADD_SANE_CAP(LENS_DIRTY); + #define GET_ONLY_CAP(name, ctype, ttype) \ m_query[(CapType)SANE_OPT_ID_##name] = MsgSupport::GetCurrent; \ m_caps[(CapType)SANE_OPT_ID_##name] = [this](Msg msg, Capability& data) -> Result { \