[sane-standard] Button handling (was: SANE2 proposal: split button/option)

Étienne Bersac bersace03 at laposte.net
Thu Jan 18 16:17:07 CET 2007


Hi,

> we could do
> as the fujitsu and avision backends do, and just string compare the
> start of the option name for 'button-'

Agree.

I suggest to add a "poll-button-state" option to sane_open (), and then
have just one "button-*" option of type SANE_TYPE_BUTTON per button. The
frontend then just read the value of this option to know the state of
the button. If the backend does not poll the button state, then the
button is never pressed.

> But we
> > must add a clearer way for the frontend to know which buttons is for
> > what. (But does the backend even know it ?)
> >
> 
> backend may not know it. some scanners only say 'button1' or 'button2'
> pressed, and the backend developer cannot know what the label on the
> outside of the button says, esp. when scanners are sold in many
> markets, they may not use a text label at all, just a picture.

The backend should have a table storing which button is for which
action. This is doable. Some buttons do not have label (e.g. Canon
CanoScan N1220U), then just use "button" label. For other case, that
just suck to let the user attach random action to random button. Also,
if frontend can be aware of button use, it can provide useful default
action to a button.

Regards,
Étienne.
-- 
Verso l'Alto !
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Ceci est une partie de message
	=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=
Url : http://lists.alioth.debian.org/pipermail/sane-standard/attachments/20070118/e4498d46/attachment.pgp


More information about the sane-standard mailing list