[sane-devel] SANE2 standard revisited: message callback

Henning Meier-Geinitz henning@meier-geinitz.de
Fri, 6 Dec 2002 23:54:25 +0100


Now the new function for a message callback. I'm citing the SANE2 TODO:


| !- let backend display a frontend-info or -selection (ok/cancel)
|    dialog-box (e.g. "Calibration in progress: wait 10/9/8/... seconds")

Are there any other uses then for claibration? Keep in mind that
errors can be returned by the extended error message function. If the
backend wants the frontend's or user's decision about something, it
should provide an option.

So do we need yes/no or ok/cancel at all? Is an info box or print to
the text console with a cancel button/the possibility to press ctrl-c
not enough? The frontend would simply call sane_cancel when the cance
button/ctrl-c was pressed.

What about:

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

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

|    the frontend function has to be implemented in a way that the backend
|    can change the text. 

Should work like above.

|    A good place to define the callback functions could be sane_init,
|    where already the authorization_callback is defined.

We should check if this doesn't interfere with saned/net version
control which is done in sane_init. Otherwise that's ok.