[PATCH 0/2] MR11063: sane.ds: TWAIN improvements.
From: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> --- dlls/sane.ds/ds_ctrl.c | 3 ++- dlls/sane.ds/sane_main.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/sane.ds/ds_ctrl.c b/dlls/sane.ds/ds_ctrl.c index 13055b9c30e..e41319baa0f 100644 --- a/dlls/sane.ds/ds_ctrl.c +++ b/dlls/sane.ds/ds_ctrl.c @@ -239,6 +239,7 @@ TW_UINT16 SANE_PendingXfersEndXfer (pTW_IDENTITY pOrigin, SANE_Cancel(); } } + TRACE("Count %d, currentState %d\n", pPendingXfers->Count, activeDS.currentState); twRC = TWRC_SUCCESS; activeDS.twCC = TWCC_SUCCESS; } @@ -355,7 +356,7 @@ TW_UINT16 SANE_GetDSStatus (pTW_IDENTITY pOrigin, { pTW_STATUS pSourceStatus = (pTW_STATUS) pData; - TRACE ("DG_CONTROL/DAT_STATUS/MSG_GET\n"); + TRACE ("DG_CONTROL/DAT_STATUS/MSG_GET => %u\n", activeDS.twCC); pSourceStatus->ConditionCode = activeDS.twCC; /* Reset the condition code */ activeDS.twCC = TWCC_SUCCESS; diff --git a/dlls/sane.ds/sane_main.c b/dlls/sane.ds/sane_main.c index 2f31c89cd09..54ebf7a633e 100644 --- a/dlls/sane.ds/sane_main.c +++ b/dlls/sane.ds/sane_main.c @@ -387,6 +387,7 @@ DS_Entry ( pTW_IDENTITY pOrigin, void SANE_Notify (TW_UINT16 message) { + TRACE("%04x\n", message); SANE_dsmentry (&activeDS.identity, &activeDS.appIdentity, DG_CONTROL, DAT_NULL, message, NULL); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11063
From: Dmitry Timoshkov <dmitry@baikal.ru> Page 739 of the TWAIN Specification Version 2.4 https://github.com/twain/twain-specification/blob/master/versions/2.4/TWAIN-... describes the LOOP as 4. Application issues DAT_IMAGENATIVEXFER to get image and goes to state 7. 5. Application issues MSG_ENDXFER to return to state 6, and it displays the image. Then if it wants the next preview image, examines pTW_PENDINGXFERS->Count to verify that there is another image, and it goes to LOOP. Source, upon receiving the MSG_ENDXFER message, takes the next picture and returns -1 in the pTW_PENDINGXFERS->Count. END LOOP 6. If the application wants to end preview mode, it issues DAT_PENDINGXFERS / MSG_RESET. This forces the Source to go to state 5 (CAP_XFERCOUNT is set to 0). If the Source is unable to deliver preview images, it sets pTW_PENDINGXFERS->Count to 0 in reply to the application’s MSG_ENDXFER command, and returns to state 5. 7. The application can then issue MSG_DISABLEDS, which returns it to state 4, and now the application can use DG_CONTROL / DAT_FILESYSTEM / MSG_CHANGEDIRECTORY to change directory to the camera device to take a full resolution picture. So, the step 6 (DAT_PENDINGXFERS / MSG_RESET) that forces the Source to go to state 5 is optional, and when an application issues MSG_DISABLEDS the state could be 5 or 6. Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> --- dlls/sane.ds/ds_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/sane.ds/ds_ctrl.c b/dlls/sane.ds/ds_ctrl.c index e41319baa0f..9f18ff2fe97 100644 --- a/dlls/sane.ds/ds_ctrl.c +++ b/dlls/sane.ds/ds_ctrl.c @@ -371,7 +371,7 @@ TW_UINT16 SANE_DisableDSUserInterface (pTW_IDENTITY pOrigin, TRACE ("DG_CONTROL/DAT_USERINTERFACE/MSG_DISABLEDS\n"); - if (activeDS.currentState != 5) + if (activeDS.currentState != 5 && activeDS.currentState != 6) { twRC = TWRC_FAILURE; activeDS.twCC = TWCC_SEQERROR; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11063
This merge request was approved by Esme Povirk. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11063
participants (3)
-
Dmitry Timoshkov -
Dmitry Timoshkov (@dmitry) -
Esme Povirk (@madewokherd)