[sane-devel] scanner buttons

Rene Rebe rene@rocklinux-consulting.de
Fri, 09 Jul 2004 11:51:02 +0200 (CEST)


Hi,

On: Fri, 9 Jul 2004 10:09:31 +0200,
    Gerhard Jaeger <gerhard@gjaeger.de> wrote:
> Hi Rene,
> =

> I'm somewhat curious on your implementation ;-) How will you solve th=
is?
> Are you using some kind of background process or thread to update
> peridodically the status? What is the callback, or the corresponding
> sane_ function, that a frontend can use?

As mentioned in the last button thread (from January or so), I use
normal options. Proposed capabilities have been SANE_CAP_SOFT_DETECT |
SANE_CAP_HARD_SELECT (| SANE_CAP_ADVANCED). But I think
SANE_CAP_HARD_SELECT is missleading:

"The option value can be set by user-intervention (e.g., by flipping a
switch).  The user-interface should prompt the user to execute the
appropriate action to set such an option.  This capability is mutually
exclusive with SANE_CAP_SOFT_SELECT (either one of them can be set,
but not both simultaneously)."

The user should not be able to toggle the option in the interface ...

So currently I use "SANE_CAP_SOFT_DETECT (|SANE_CAP_ADVANCED)".

Since there is yet no way to mark it as "auto-pull" / "auto-refresh"
or whatever I must rely, on the tiny example "buttond" program to
reload options with the name "button" periodically. So I have no
thread or singalling in the backend.

And as work around for my "when to flush the state to false" for the
buttons I only re-fetch them from the scanner if sane_control_option
is called for the first button available.

Of course the interface details can be easily changed - and I'm open
for suggestions or interfaace additions to mark to-be-polled options.

Sincerely yours,
  Ren=E9 Rebe
    - ROCK Linux stable release maintainer

--  =

Ren=E9 Rebe - Europe/Germany/Berlin
  rene@rocklinux.org rene@rocklinux-consulting.de
http://www.rocklinux.org http://www.rocklinux-consulting.de