[sane-devel] SANE2 standard revisited: message callback

Oliver Rauch oliver.rauch@rauch-domain.de
Mon, 9 Dec 2002 23:39:50 +0100

On Friday 06 December 2002 23:54, Henning Meier-Geinitz wrote:
> Hi,
> Now the new function for a message callback. I'm citing the SANE2 TODO:
> http://www.meier-geinitz.de/sane/sane2/sane2-api-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 =3D=3D 0, close the window
> For a command-line interface
> - print the message(s)
> - If text =3D=3D 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.

> |    this has to be done with a callback, eg.:
> |      sane_frontend_dialog_display(**window, text, ok_text, cancel_tex=
> | 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.