sane-project-website/old-archive/1998-06/0052.html

92 wiersze
4.7 KiB
HTML

<!-- received="Sat Jun 6 13:23:19 1998 PDT" -->
<!-- sent="Sat, 6 Jun 1998 14:22:10 -0600 (MDT)" -->
<!-- name="charter@cs.ualberta.ca" -->
<!-- email="charter@cs.ualberta.ca" -->
<!-- subject="Re: SANE options" -->
<!-- id="19980606202217Z13342-2383+128@scapa.cs.ualberta.ca" -->
<!-- inreplyto="m0yiH9n-0000XoC@charon.beck-sw.de" -->
<title>sane-devel: Re: SANE options</title>
<h1>Re: SANE options</h1>
<a href="mailto:charter@cs.ualberta.ca"><i>charter@cs.ualberta.ca</i></a><br>
<i>Sat, 6 Jun 1998 14:22:10 -0600 (MDT)</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#52">[ date ]</a><a href="index.html#52">[ thread ]</a><a href="subject.html#52">[ subject ]</a><a href="author.html#52">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0053.html">John Warren Duprey: "Re: no SANE devices found.."</a>
<li> <b>Previous message:</b> <a href="0051.html">Hugo van der Kooij: "Re: Scanace NDA for your perusal."</a>
<li> <b>In reply to:</b> <a href="0047.html">becka@rz.uni-duesseldorf.de: "Re: SANE options"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0065.html">becka@rz.uni-duesseldorf.de: "Re: SANE options"</a>
<li> <b>Reply:</b> <a href="0065.html">becka@rz.uni-duesseldorf.de: "Re: SANE options"</a>
<!-- reply="end" -->
</ul>
<!-- body="start" -->
<i>&gt; &gt; Peter&gt; Oh yes, another one, though I suspect I know the answer to</i><br>
<i>&gt; &gt; Peter&gt; this one. Is there any way for a backend to put up it's own</i><br>
<i>&gt; &gt; Peter&gt; dialog boxes for warnings or confirmations?</i><br>
<i>&gt; &gt; </i><br>
<i>&gt; &gt; Nope, not at this point. Printing messages wouldn't be hard to do,</i><br>
<i>&gt; &gt; but dialog boxes are a bit trickier because sometimes there is no user</i><br>
<i>&gt; &gt; to dialog with. What exactly did you have in mind?</i><br>
<p>
It might be useful if there were a way for the backend to say to the<br>
frontend "I have a status message", or "I have a yes/no/cancel<br>
question", and then let the frontend handle it and return any user<br>
response back. Additional return codes for the sane API functions<br>
aren't quite enough, because the backend might want to ask a question<br>
in the middle of an API function call, and then the call has to exit<br>
and somehow be restarted with the information it didn't have. So what<br>
about frontends supplying callback functions to the backend at<br>
initialization time? For example, a callback that answers a<br>
yes/no/cancel question might have prototype<br>
<p>
SANE_Answer sane_ask (SANE_String question)<br>
<p>
where SANE_Answer = {SANE_YES, SANE_NO, SANE_CANCEL, SANE_UNSUPPORTED}<br>
<p>
The frontend then puts the question to the user if it's interactive,<br>
or returns SANE_UNSUPPORTED if it isn't.<br>
<p>
Though the most useful callback would be one that just reports a<br>
status message. If the backend detects some kind of special failure<br>
whose details can't be communicated through the SANE_Status codes,<br>
this would come in handy. It also potentially works over the network,<br>
whereas calling printf() doesn't.<br>
<p>
Of course, the return type of the backend functions could just change to<br>
struct {SANE_Status, SANE_String} where the string part is an optional<br>
elaboration on the status. But doing this means that every return statement<br>
in every backend has to change. <br>
<p>
Obviously either approach involves an API change so it would have to<br>
be for a future version. I imagine this kind of thing has been<br>
suggested before, and there is a good reason not to do it.<br>
<p>
<p>
Kevin<br>
<pre>
--
Kevin Charter /\ Grad Studies
<a href="mailto:charter@cs.ualberta.ca">charter@cs.ualberta.ca</a> /\/ \ Department of Computing Science
<a href="http://web.cs.ualberta.ca/~charter">http://web.cs.ualberta.ca/~charter</a> \ -------- University of Alberta
-------------- Edmonton AB CANADA
<p>
<pre>
--
Source code, list archive, and docs: <a href="http://www.mostang.com/sane/">http://www.mostang.com/sane/</a>
To unsubscribe: echo unsubscribe sane-devel | mail <a href="mailto:majordomo@mostang.com">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0053.html">John Warren Duprey: "Re: no SANE devices found.."</a>
<li> <b>Previous message:</b> <a href="0051.html">Hugo van der Kooij: "Re: Scanace NDA for your perusal."</a>
<li> <b>In reply to:</b> <a href="0047.html">becka@rz.uni-duesseldorf.de: "Re: SANE options"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0065.html">becka@rz.uni-duesseldorf.de: "Re: SANE options"</a>
<li> <b>Reply:</b> <a href="0065.html">becka@rz.uni-duesseldorf.de: "Re: SANE options"</a>
<!-- reply="end" -->
</ul>