From c8c76f5b5f0cda6063106dc99255c2b6a2ba14d9 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Sun, 31 Oct 2010 16:48:30 +0100 Subject: [PATCH] The magicolor device apparently does not support WAIT_FOR_BUTTON --- backend/magicolor-ops.c | 27 --------------------------- backend/magicolor-ops.h | 1 - backend/magicolor.c | 21 --------------------- backend/magicolor.h | 8 -------- 4 files changed, 57 deletions(-) diff --git a/backend/magicolor-ops.c b/backend/magicolor-ops.c index 65e6c22..86002c9 100644 --- a/backend/magicolor-ops.c +++ b/backend/magicolor-ops.c @@ -536,33 +536,6 @@ mc_copy_image_data(Magicolor_Scanner * s, SANE_Byte * data, SANE_Int max_length, } } -void -mc_wait_button(Magicolor_Scanner * s) -{ - DBG(5, "%s\n", __func__); - - s->hw->wait_for_button = SANE_TRUE; - - while (s->hw->wait_for_button == SANE_TRUE) { - unsigned char button_status = 0; - - if (s->canceling == SANE_TRUE) - s->hw->wait_for_button = SANE_FALSE; - - /* get the button status from the scanner */ - else if (cmd_request_push_button_status(s, &button_status) == - SANE_STATUS_GOOD) { - if (button_status) - s->hw->wait_for_button = SANE_FALSE; - else - sleep(1); - } else { - /* we run into an error condition, just continue */ - s->hw->wait_for_button = SANE_FALSE; - } - } -} - SANE_Status mc_init_parameters(Magicolor_Scanner * s) { diff --git a/backend/magicolor-ops.h b/backend/magicolor-ops.h index 7ebb486..7859cd2 100644 --- a/backend/magicolor-ops.h +++ b/backend/magicolor-ops.h @@ -37,7 +37,6 @@ extern SANE_Status mc_set_scanning_parameters(Magicolor_Scanner *s); extern SANE_Status mc_setup_block_mode (Magicolor_Scanner *s); extern SANE_Status mc_check_adf(Magicolor_Scanner *s); -extern void mc_wait_button(Magicolor_Scanner *s); extern SANE_Status mc_start_scan(Magicolor_Scanner *s); extern SANE_Status mc_read(struct Magicolor_Scanner *s); diff --git a/backend/magicolor.c b/backend/magicolor.c index 4ff3369..5556169 100644 --- a/backend/magicolor.c +++ b/backend/magicolor.c @@ -923,17 +923,6 @@ init_options(Magicolor_Scanner *s) s->opt[OPT_ADVANCED_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_ADVANCED_GROUP].cap = SANE_CAP_ADVANCED; - s->opt[OPT_WAIT_FOR_BUTTON].name = SANE_MAGICOLOR_WAIT_FOR_BUTTON_NAME; - s->opt[OPT_WAIT_FOR_BUTTON].title = SANE_MAGICOLOR_WAIT_FOR_BUTTON_TITLE; - s->opt[OPT_WAIT_FOR_BUTTON].desc = SANE_MAGICOLOR_WAIT_FOR_BUTTON_DESC; - s->opt[OPT_WAIT_FOR_BUTTON].type = SANE_TYPE_BOOL; - s->opt[OPT_WAIT_FOR_BUTTON].unit = SANE_UNIT_NONE; - s->opt[OPT_WAIT_FOR_BUTTON].constraint_type = SANE_CONSTRAINT_NONE; - s->opt[OPT_WAIT_FOR_BUTTON].constraint.range = NULL; - s->opt[OPT_WAIT_FOR_BUTTON].cap |= SANE_CAP_ADVANCED; - if (!s->hw->cmd->/* TODO: request_push_button_status*/unknown2) - s->opt[OPT_WAIT_FOR_BUTTON].cap |= SANE_CAP_INACTIVE; - /* "Preview settings" group: */ s->opt[OPT_PREVIEW_GROUP].title = SANE_TITLE_PREVIEW; s->opt[OPT_PREVIEW_GROUP].desc = ""; @@ -1174,7 +1163,6 @@ getvalue(SANE_Handle handle, SANE_Int option, void *value) case OPT_BIT_DEPTH: case OPT_BRIGHTNESS: case OPT_RESOLUTION: - case OPT_WAIT_FOR_BUTTON: case OPT_PREVIEW: case OPT_TL_X: case OPT_TL_Y: @@ -1352,7 +1340,6 @@ setvalue(SANE_Handle handle, SANE_Int option, void *value, SANE_Int *info) break; case OPT_BRIGHTNESS: - case OPT_WAIT_FOR_BUTTON: case OPT_PREVIEW: /* needed? */ sval->w = *((SANE_Word *) value); break; @@ -1460,14 +1447,6 @@ sane_start(SANE_Handle handle) return status; } - /* - * If WAIT_FOR_BUTTON is active, then do just that: - * Wait until the button is pressed. If the button was already - * pressed, then we will get the button pressed event right away. - */ - if (s->val[OPT_WAIT_FOR_BUTTON].w == SANE_TRUE) - mc_wait_button(s); - /* set the retry count to 0 */ s->retry_count = 0; diff --git a/backend/magicolor.h b/backend/magicolor.h index aa22a1f..7db7a0f 100644 --- a/backend/magicolor.h +++ b/backend/magicolor.h @@ -65,11 +65,6 @@ #define DEVICE_NAME_LEN (16) /* length of device name in extended status */ -/* string constants for GUI elements that are not defined SANE-wide */ - -#define SANE_MAGICOLOR_WAIT_FOR_BUTTON_NAME "wait-for-button" -#define SANE_MAGICOLOR_WAIT_FOR_BUTTON_TITLE SANE_I18N("Wait for Button") -#define SANE_MAGICOLOR_WAIT_FOR_BUTTON_DESC SANE_I18N("After sending the scan command, wait until the button on the scanner is pressed to actually start the scan process."); /* misc constants */ @@ -149,7 +144,6 @@ enum { OPT_BRIGHTNESS, OPT_RESOLUTION, OPT_ADVANCED_GROUP, - OPT_WAIT_FOR_BUTTON, OPT_PREVIEW_GROUP, OPT_PREVIEW, OPT_GEOMETRY_GROUP, @@ -194,8 +188,6 @@ struct Magicolor_Device SANE_Int last_res; /* last selected resolution */ SANE_Int last_res_preview; /* last selected preview resolution */ - SANE_Bool wait_for_button; /* do we have to wait until the scanner button is pressed? */ - struct MagicolorCmd *cmd; struct MagicolorCap *cap; }; -- 2.11.4.GIT