diff options
Diffstat (limited to 'backend/canon_dr.c')
-rw-r--r-- | backend/canon_dr.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/backend/canon_dr.c b/backend/canon_dr.c index 359005a..9607e3c 100644 --- a/backend/canon_dr.c +++ b/backend/canon_dr.c @@ -464,6 +464,7 @@ #define STRING_IMPRINTER_ADDON_BoI SANE_I18N("Black-on-Image") #define STRING_IMPRINTER_ADDON_WoB SANE_I18N("White-on-Black") + /* Also set via config file. */ static int global_buffer_size; static int global_buffer_size_default = 2 * 1024 * 1024; @@ -1564,6 +1565,7 @@ init_model (struct scanner *s) s->fcal_dest = FCAL_DEST_SW; s->sw_lut = 1; s->invert_tly = 1; + s->has_function_number = 1; /*only in Y direction, so we trash them in X*/ s->std_res_x[DPI_100]=0; @@ -3214,6 +3216,22 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->cap = SANE_CAP_INACTIVE; } + if(option==OPT_FUNCTION_NUMBER){ + opt->name = "function-number"; + opt->title = "Function number"; + opt->desc = "Function number set on panel"; + opt->type = SANE_TYPE_INT; + opt->unit = SANE_UNIT_NONE; + opt->constraint_type = SANE_CONSTRAINT_RANGE; + opt->constraint.range = &s->counter_range; + s->counter_range.min=1; + s->counter_range.max=9; + s->counter_range.quant=1; + opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; + if(!s->can_read_panel || !s->has_function_number) + opt->cap = SANE_CAP_INACTIVE; + } + if(option==OPT_ADF_LOADED){ opt->name = "adf-loaded"; opt->title = "ADF Loaded"; @@ -3654,6 +3672,11 @@ sane_control_option (SANE_Handle handle, SANE_Int option, *val_p = s->total_counter; return ret; + case OPT_FUNCTION_NUMBER: + ret = read_panel(s, OPT_FUNCTION_NUMBER); + *val_p = s->panel_function_number; + return ret; + case OPT_ADF_LOADED: ret = read_sensors(s,OPT_ADF_LOADED); *val_p = s->sensor_adf_loaded; @@ -4674,6 +4697,7 @@ read_panel(struct scanner *s,SANE_Int option) s->panel_bypass_mode = get_R_PANEL_bypass_mode(in); s->panel_enable_led = get_R_PANEL_enable_led(in); s->panel_counter = get_R_PANEL_counter(in); + s->panel_function_number = get_R_PANEL_function_number(in); ret = SANE_STATUS_GOOD; } |