kopia lustrzana https://gitlab.com/sane-project/website
218 wiersze
9.7 KiB
HTML
218 wiersze
9.7 KiB
HTML
<!-- received="Sat Aug 21 06:18:14 1999 PDT" -->
|
||
<!-- sent="Sat, 21 Aug 1999 15:20:05 +0200" -->
|
||
<!-- name="Oliver Rauch" -->
|
||
<!-- email="oliver.rauch@Wolfsburg.DE" -->
|
||
<!-- subject="Re: Starting a discussion about SANE and TWAIN..." -->
|
||
<!-- id="" -->
|
||
<!-- inreplyto="Starting a discussion about SANE and TWAIN..." -->
|
||
<title>sane-devel: Re: Starting a discussion about SANE and TWAIN...</title>
|
||
<h1>Re: Starting a discussion about SANE and TWAIN...</h1>
|
||
<b>Oliver Rauch</b> (<a href="mailto:oliver.rauch@Wolfsburg.DE"><i>oliver.rauch@Wolfsburg.DE</i></a>)<br>
|
||
<i>Sat, 21 Aug 1999 15:20:05 +0200</i>
|
||
<p>
|
||
<ul>
|
||
<li> <b>Messages sorted by:</b> <a href="date.html#255">[ date ]</a><a href="index.html#255">[ thread ]</a><a href="subject.html#255">[ subject ]</a><a href="author.html#255">[ author ]</a>
|
||
<!-- next="start" -->
|
||
<li> <b>Next message:</b> <a href="0256.html">Oliver Rauch: "Re: SANE frames"</a>
|
||
<li> <b>Previous message:</b> <a href="0254.html">Oliver Rauch: "Re: SANE 1.0.1 on FreeBSD 3.2-RELEASE"</a>
|
||
<li> <b>Maybe in reply to:</b> <a href="0084.html">252353N@knotes.kodak.com: "Starting a discussion about SANE and TWAIN..."</a>
|
||
<!-- nextthread="start" -->
|
||
<li> <b>Next in thread:</b> <a href="0355.html">Oliver Rauch: "Re: Starting a discussion about SANE and TWAIN..."</a>
|
||
<!-- reply="end" -->
|
||
</ul>
|
||
<!-- body="start" -->
|
||
<a href="mailto:252353N@knotes.kodak.com">252353N@knotes.kodak.com</a> wrote:<br>
|
||
<p>
|
||
<i>> From: Mark McLaughlin</i><br>
|
||
<i>></i><br>
|
||
<i>> Hi Oliver...</i><br>
|
||
<i>></i><br>
|
||
<i>> First off, my apologies for slowing down the pace of the discussion.</i><br>
|
||
<p>
|
||
Hello Mark,<br>
|
||
<p>
|
||
No probelm,<br>
|
||
I also have to read and answer some of your mails because I do not have<br>
|
||
always the time for it.<br>
|
||
<p>
|
||
<p>
|
||
<i>> The application loads the TWAIN Source Manager</i><br>
|
||
<i>> ( TWAIN_32.DLL) into memory with a LoadLibrary()</i><br>
|
||
<i>> call. It then gets a pointer to the DSM_Entry() function</i><br>
|
||
<i>> inside of TWAIN_32.DLL using GetProcAddress().</i><br>
|
||
<i>> All communication with TWAIN is done through</i><br>
|
||
<i>> DSM_entry().</i><br>
|
||
<i>></i><br>
|
||
<i>> When the application requests it, the Source Manager</i><br>
|
||
<i>> discovers the available Sources by searching for</i><br>
|
||
<i>> any files with the extension ".ds" in either the</i><br>
|
||
<i>> %windir%\TWAIN or %windir%\TWAIN_32 directory</i><br>
|
||
<i>> (the search is recursive down the directory tree).</i><br>
|
||
<i>></i><br>
|
||
<i>> The ".ds" files are really DLL's. The Source Manager</i><br>
|
||
<i>> loads each one in turn with LoadLibrary() and looks</i><br>
|
||
<i>> for the DS_Entry() function. If uses that call to find out</i><br>
|
||
<i>> the identifying information for the Source, which is</i><br>
|
||
<i>> bubbled up to the application so that it can select</i><br>
|
||
<i>> which Source it wants to use. Once a Source is</i><br>
|
||
<i>> selected and opened, the Source Manager acts</i><br>
|
||
<i>> primarily as a passthru until the application indicates</i><br>
|
||
<i>> that it wants to close up the session.</i><br>
|
||
<p>
|
||
Ok, now I understand it better.<br>
|
||
<p>
|
||
<p>
|
||
<i>></i><br>
|
||
<i>> Now, as for this sane.ds thingy. With a change to the</i><br>
|
||
<i>> Source Manager, we can modify the diagram above</i><br>
|
||
<i>> to look like...</i><br>
|
||
<i>></i><br>
|
||
<i>> +-------------+</i><br>
|
||
<i>> | Application |</i><br>
|
||
<i>> +-------------+</i><br>
|
||
<i>> +--------------+</i><br>
|
||
<i>> | TWAIN_32.DLL |</i><br>
|
||
<i>> +--------------+</i><br>
|
||
<i>> +--------+ +-------+ +------------------------------+</i><br>
|
||
<i>> | aaa.ds | | bbb.ds| | 'sane.ds' [aaa.ds bbb.ds...] |</i><br>
|
||
<i>> +--------+ +-------+ or +------------------------------+</i><br>
|
||
<i>> +-----+ +-----+ +-----+ +-----+</i><br>
|
||
<i>> | aaa | | bbb | | aaa | | bbb |</i><br>
|
||
<i>> +-----+ +-----+ +-----+ +-----+</i><br>
|
||
<i>></i><br>
|
||
<i>> One way of connecting to a SANE driver is to write a</i><br>
|
||
<i>> generic TWAIN Source and copy it, so we get</i><br>
|
||
<i>> aaa.ds and bbb.ds which are identical code, but</i><br>
|
||
<i>> which interface with two different SANE drivers. The</i><br>
|
||
<i>> benefit of this is that no changes have to be made to</i><br>
|
||
<i>> TWAIN as it stands to make this work...</i><br>
|
||
<i>></i><br>
|
||
<i>> The sane.ds notion involves the creation of a new</i><br>
|
||
<i>> kind of Source, one that can enumerate a list of</i><br>
|
||
<i>> identities. This would allow the one Source to show</i><br>
|
||
<i>> a list of any number of SANE devices. I like this</i><br>
|
||
<i>> model more, but it would require a change to the</i><br>
|
||
<i>> TWAIN Source Manager to make it work. Since we</i><br>
|
||
<i>> are targeting UNIX with this change, it shouldn't be</i><br>
|
||
<i>> too much of a problem. And it should be possible to</i><br>
|
||
<i>> craft this in such a way that only the Source Manager</i><br>
|
||
<i>> is affected. Applications would never know the</i><br>
|
||
<i>> difference.</i><br>
|
||
<p>
|
||
I think we really have to split this question into<br>
|
||
Windows, Max and Unix questions.<br>
|
||
<p>
|
||
For Windows and Mac I would suggest not to<br>
|
||
change the TWAIN Source Manager. I think it is ok<br>
|
||
if there are sane1.ds, sane2.ds,..., saneN.ds.<br>
|
||
This way sane.ds also works with older<br>
|
||
TWAIN versions!<br>
|
||
<p>
|
||
For Unix we have to talk about the communication<br>
|
||
(messages/events) between the apllication and the<br>
|
||
source manager/driver at first.<br>
|
||
<p>
|
||
Andreas and I already talked a bit about it, please could<br>
|
||
you explain us a bit at first:<br>
|
||
1) Are the events that are sent from the application to the<br>
|
||
source manager and the driver only window events<br>
|
||
(redraw window, button pressed, ...) or are there<br>
|
||
any other TWAIN relevant events that are sent from<br>
|
||
the application to the soruce manager or driver?<br>
|
||
If the source manager and the driver run as an own<br>
|
||
process that gets it own window events (for unix),<br>
|
||
do we need the events from the application to the<br>
|
||
source manager and driver any more?<br>
|
||
<p>
|
||
2) The handling of the events from the driver to<br>
|
||
the application are already handled different for<br>
|
||
Windows/Mac. So it would not break a standard<br>
|
||
if we define an own event system for unix?!<br>
|
||
<p>
|
||
We do not want to froce the usage of one graphics toolkit<br>
|
||
for the applications and we do not want to force the usage of<br>
|
||
X if this is not really necessary. So we talked about the usage<br>
|
||
of pipes for the message flow from the driver to the application.<br>
|
||
<p>
|
||
<p>
|
||
<p>
|
||
<i>> Okay...last bit. I would like to be involved in any coding</i><br>
|
||
<i>> effort.</i><br>
|
||
<p>
|
||
That is very good.<br>
|
||
<p>
|
||
<i>> I've many years of UNIX and Windows programming</i><br>
|
||
<i>> in my past, so I feel it's something that would be fun to do.</i><br>
|
||
<i>> However, I'd be lying if I said I have a lot of time to play</i><br>
|
||
<i>> with right now, so I'm not sure how much of my time I will</i><br>
|
||
<i>> be able to commit at this point.</i><br>
|
||
<i>></i><br>
|
||
<i>> What I am going to do is look over the Windows version</i><br>
|
||
<i>> of the TWAIN Source Manager and access how much</i><br>
|
||
<i>> effort is needed to abstract out the WIN32 portions into</i><br>
|
||
<i>> something that could run on UNIX. Once I have that</i><br>
|
||
<i>> accessment in place, we can try to decide on who is</i><br>
|
||
<i>> going to do it (and if I can scratch out the time, then I'll</i><br>
|
||
<i>> do what I can).</i><br>
|
||
<i>></i><br>
|
||
<i>> As for the application, I would very much like to use some</i><br>
|
||
<i>> third party package to see if we can build and run our</i><br>
|
||
<i>> WIN32 test program on UNIX.</i><br>
|
||
<p>
|
||
Do you have an application in mind that already is ported to unix<br>
|
||
but without TWAIN support?<br>
|
||
<p>
|
||
<p>
|
||
<i>> The only code remaining then is the SANE.DS (and I</i><br>
|
||
<i>> would recommend going for the simple version of this</i><br>
|
||
<i>> first). This would be a TWAIN Source this is capable</i><br>
|
||
<i>> of negotiating a couple of image processing parametes</i><br>
|
||
<i>> (like resolution and contrast) and transferring an image</i><br>
|
||
<i>> from a SANE driver. Most of the work will be spent on</i><br>
|
||
<i>> this code, I think...</i><br>
|
||
<p>
|
||
If the question with the messages/events is solved,<br>
|
||
I think it is not a great problem to do this.<br>
|
||
<p>
|
||
<p>
|
||
<i>> Anywho, those are my ideas. I've not had enough time to</i><br>
|
||
<i>> really dig into the SANE code the way I want to. If you</i><br>
|
||
<i>> have some samples you can share they would be much</i><br>
|
||
<i>> appreciated...</i><br>
|
||
<p>
|
||
I do not have a sample backend code.<br>
|
||
The small sources I know (e.g. pnm backend)<br>
|
||
are not very good as a sample code.<br>
|
||
The umax backend is very big (about 6000 lines)<br>
|
||
but if you only take a look at the sane routines<br>
|
||
(sane_start, sane_read and so on) it is better<br>
|
||
than nothing.<br>
|
||
<p>
|
||
Bye<br>
|
||
Oliver<br>
|
||
<p>
|
||
<pre>
|
||
--
|
||
EMAIL: <a href="mailto:Oliver.Rauch@Wolfsburg.DE">Oliver.Rauch@Wolfsburg.DE</a>
|
||
WWW: <a href="http://www.wolfsburg.de/~rauch">http://www.wolfsburg.de/~rauch</a>
|
||
<p>
|
||
<p>
|
||
<p>
|
||
<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="0256.html">Oliver Rauch: "Re: SANE frames"</a>
|
||
<li> <b>Previous message:</b> <a href="0254.html">Oliver Rauch: "Re: SANE 1.0.1 on FreeBSD 3.2-RELEASE"</a>
|
||
<li> <b>Maybe in reply to:</b> <a href="0084.html">252353N@knotes.kodak.com: "Starting a discussion about SANE and TWAIN..."</a>
|
||
<!-- nextthread="start" -->
|
||
<li> <b>Next in thread:</b> <a href="0355.html">Oliver Rauch: "Re: Starting a discussion about SANE and TWAIN..."</a>
|
||
<!-- reply="end" -->
|
||
</ul>
|