Fwd: [sane-standard] SANE2 proposal: split button/option handling

m. allan noah kitno455 at gmail.com
Wed Jan 17 21:21:50 CET 2007


sorry Étienne, you will get this twice....

On 1/17/07, Étienne Bersac <bersace03 at laposte.net> wrote:
> Hi,
>
> There is something very strange in SANE 1 (and SANE 2 draft): all is
> option. I think that's not easy for frontend to handle devices
> (especially buttons) with this design. It's very confusing.

it seems strange at first, but it actually makes it possible for a
backend to expose new capabilities that were not thought of at the
time sane was designed.

>
> I propose to design three different way to handle devices options and
> buttons. I have only a fuzzy idea of how to design it, however, i'm
> quite sure that all those "button" options is just confusing and make
> developer live harder.

how is writing MORE code in the frontend LESS complicated than the
current situation?

>
> Device options handling keep similar as current implemententation.
>
> Device buttons handling might be like the following braindump :
>
>       * Define a SANE_Button_Descriptor struct which contains name,
>         title and desc of the button.

very much like the name/title/desc of an option?

>       * Define a sane_device_button_lock (device, button) and
>         sane_device_button_unlock (device, button) functions which
>         behave like sane_open () and sane_close ().

why not just use sane_open and close? you cannot have two different
running copies of the backend talking to the scanner at the same
moment, so having an independent lock function gives no advantage.

>       * Define a sane_device_button_get_status (device, button) which
>         allow to monitor button status.
>

just like like sane_control_option?

see how similar it is?

the only change i think we need over the current system is the 'poll'
capability to be added to the option descriptor, and for the frontend
to get the value periodically. i dont see any advantage to adding a
set of button routines?

allan

--
"The truth is an offense, but not a sin"


-- 
"The truth is an offense, but not a sin"



More information about the sane-standard mailing list