[sane-devel] SANE2 standard revisited: message callback

Henning Meier-Geinitz henning at meier-geinitz.de
Tue Dec 10 00:35:30 GMT 2002


Hi,

On Mon, Dec 09, 2002 at 11:39:50PM +0100, Oliver Rauch wrote:
> > SANE_Status sane_message_callback (SANE_String_Const text);
> >
> > Only one function. We don't need multiple open messages boxes, do we?
> > For more than one function, we would need multiple callbacks.
> >
> > For a graphical interface:
> > - Open a window, print the text, add a cancel button.
> > - If the window is already open, change the text. (10/9/8... if someone
> >   likes countdowns)
> > - If text == 0, close the window
> >
> > For a command-line interface
> > - print the message(s)
> > - If text == 0, do nothing
> 
> Keep in mind that a frontend can open multiple backends/scanners
> and so a frontend must be able to handle multiple backend messages.
> I suggest to keep the **window field, this makes it much easier for
> a frontend to handle it.

Depends when the callback pointer is transmitted to the backend. If
it's done in sane_open, the frontend knows for which handle it is.
And that's a good idea anyway because the user probably wants to know
about which of his scanners the message is talking.

> > |    this has to be done with a callback, eg.:
> > |      sane_frontend_dialog_display(**window, text, ok_text, cancel_text,
> > | backend_dialog_callback_function) sane_frontend_dialog_close(window)
> >
> > That would be a callback of a callback...
> 
> I do not need a selection "ok", "cancel" but someone asked for it.

I don't even know how to implement the "simple" callback over the
network. For a double callback, oh well. I don't want to think about
it :-)

Bye,
  Henning



More information about the sane-devel mailing list