[sane-devel] More front end developer Q's
Mon, 22 Sep 2003 15:55:52 +0200
On Mon, Sep 22, 2003 at 02:02:34PM +0200, Guy Brooker wrote:
> The OS X Image Capture TWAIN bridge requires a TWAIN DS to provide values
> for CAP_XNATIVERESOLUTION and CAP_YNATIVERESOLUTION. I guess all I can do is
> return the highest resolution specified by the backend.
Yes that's probably the only way.
> The Image Capture API also wants the the TWAIN DS to implement DEVICEONLINE
> status, presumably for some UI indicator.
> Checking if the scanner is in the device list isn't really going to work, as
> that will only determine if the device is plugged in. Infact, the way the
> API works on OS X, the data source will only ever be called if the device is
> plugged in, and it will be pulled down if the device is unplugged, so it
> will always be in the device list.
Ok. I don't think that many scanners can be "online" or "not online"
so it hardly matters.
> I could just return TRUE for that call, but I assume there may be some
> scanners which won't scan until the lid is closed, or something like that.
> Would sane_start() be enough to make sure the scanner is ready, or will it
> only fail on the first call to sane_read() ?
Depends on the backend. I don't know of any where you need to call
sane_read() at all. What I mean is: the scanner is made ready when
sane_start is called. If that doesn't work for some reason (lid open,
I/O error) the function just fails. I don't think it makes sense to
call sane_start to make it ready therefore.
Most backends will really start the scanner (move the motor etc.) in
sane_start, so I'd expect it to fail in sane_start. But the standard
doesn't force the backend to do that.
What you would really need was an option "is_online" in SANE. But it
isn't there and in my opinion it doesn't make sense so just tell TWAIN
that the scanner is online.
I guess these two cases just show the difference in TWAIN and SANE