调整twain 部分流程

This commit is contained in:
13038267101 2023-04-24 17:23:43 +08:00
parent 1ed767d373
commit cce0eee3f0
1 changed files with 24 additions and 4 deletions

View File

@ -2933,16 +2933,37 @@ COM_API_IMPLEMENT(scanner, bool, ui_show_setting(HWND parent, bool with_scan, bo
return true; return true;
} }
COM_API_IMPLEMENT(scanner, bool, ui_show_progress(HWND parent)) COM_API_IMPLEMENT(scanner, bool, ui_show_progress(HWND parent))
{ {
if (callback::show_progress_ui) if (callback::show_progress_ui)
{ {
auto ui_process = [](ui_result) auto ui_process = [this](ui_result res)
{ {
int uev = SANE_EVENT_SCAN_FINISHED;
switch (res)
{
case UI_RESULT_FAILED:
break;
case UI_RESULT_OK:
break;
case UI_RESULT_CLOSE_NORMAL:
uev = SANE_EVENT_UI_CLOSE_NORMAL;
on_ui_event(uev, (void*)uev);
break;
case UI_RESULT_CLOSE_CANCEL:
uev = SANE_EVENT_UI_CLOSE_CANCEL;
sane_api_.sane_cancel_api(handle_);
//on_ui_event(uev, (void*)uev);
break;
case UI_RESULT_START_SCAN:
break;
default:
break;
}
}; };
callback::show_progress_ui(parent, ui_process,&ui_notify); callback::show_progress_ui(parent, ui_process,&ui_notify);
} }
else else
@ -3037,7 +3058,6 @@ int scanner::handle_device_event(int ev_code, void* data, unsigned int* len)
else if (callback::show_progress_ui) else if (callback::show_progress_ui)
{ {
ui_notify(ev_code, data, 0); ui_notify(ev_code, data, 0);
on_ui_event(ev_code, (void*)ev_code);
} }
else else
{ {