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

Henning Meier-Geinitz henning@meier-geinitz.de
Fri, 6 Sep 2002 21:11:13 +0200


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

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:
> ...<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.