[sane-devel] Scanner buttons (kind of RFC)

Henning Meier-Geinitz henning at meier-geinitz.de
Fri Sep 6 20:11:13 BST 2002


Hi,

On Thu, Sep 05, 2002 at 02:27:33PM +0200, mh wrote:
> would it be possible, to add an option called "button-state" to saneopts.h ? 
> "button-state" is an option of SANE_TYPE_INT with SANE_UNIT_NONE and 
> SANE_CONSTRAINT_NONE and capability SANE_CAP_SOFT_DETECT (i.e. a read-only 
> option).

Probably yes. But saneopts.h is only a convenience header currently.
It saves every backend author from defining the descriptions of e.g.
brightness. It's not meant as a definition of the meaning of options.
Only the SANE standard's well known options are "if you use them, do
it like documented".

So I guess if we do it, there should be an addition to the list of
well-known options in the standard. On the one hand we shouldn't
change the current standard too much. On the other hand, it's just an
addition of one option that shouldn't render any backend or frontend
incompatible. 

Generally speaking I'm not strictly against adding that one to the
standard but I'm also not that convinced that we shouldn't wait for
SANE 2.0.

Other opinions?

> If a frontend detects such an option, it can use a timer to query the option 
> value repeatedly. The possible return value is one of the following values:
> 
> #define SANE_BUTTON_STATE_NONE  0
> #define SANE_BUTTON_STATE_SCAN  1
> #define SANE_BUTTON_STATE_OCR   2
> #define SANE_BUTTON_STATE_EMAIL 3
> #define SANE_BUTTON_STATE_COPY  4
> ...<and others if required>

Some Mustek scanners use additionally: "FAX" and "PANEL". Probably
there are more.

What should the frontend do when pressing a button? Ask for parameters
or immediately start the action with default/selected parameters?

> Or is there a better/an easier way to make the scanner buttons work? (Or is 
> this already possible, and I'm just missing something :-/)

Write a small program/daemon that polls the scanner's buttons and
calls xsane or any other frontend. But that will only work for one
type of scanner.

Bye,
  Henning



More information about the sane-devel mailing list