Scanner infrastructure in freedesktop

Donald Straney burntfuse at
Sat Feb 10 18:19:20 EET 2007

> Ok, i will do it.

Great, thanks (I also got sort of lost in the autoconf manual).

> The problem is that SANE backends are even slightly different from each
> other which can make a frontend dev crazy. So you should really write a
> tiny dbus wrapper around SANE types.

> That's far from a solution. Modify your code, not someone else code.

Ok, in that case, I guess that for data types it can keep around two
copies - the dbus type and the SANE type.  For example:

dbus_int32_t optionvalue_dbus;
SANE_Int optionvalue_sane;
dbus_message_iter_read_basic (&iter, &optionvalue_dbus); [or whatever
the syntax is]
optionvalue_sane = optionvalue_dbus;
sane_control_option(intjobhandle, SANE_OPTION_SET, optionnum,
&optionvalue_sane); [or whatever the syntax is]

I don't remember the exact syntax for the functions at the moment, but
you should get the idea.  That way, it can rely on the compiler for
moving data between possibly different-sized vars, which it does very
well already, and it doesn't need to assume anything about the
internal sizes.  Sound good?

> Keep up the good work. I intend to build GnomeScan on top of imcad for
> this summer (SoC).

Wow, it'll be nice to get this actually used in a desktop!  Good luck with that.

Also, what are your thoughts on starting this on-demand?  I'd really
rather not add yet another daemon to the system that has to be started
at boot and kept running all the time (especially for people who don't
have scanners), and fortunately it seems like it wouldn't be hard to
have it run only when needed.  For one thing, it could be registered
as a dbus service that could be remotely activated, so when a program
requests a device list or something, the daemon would start up and
handle the request.  Also, to handle button presses from scanners, it
would have to be running the whole time the scanner's plugged in, so
there could also be an entry for it in HAL's list of programs that are
started whenever a device is plugged in.  When started by HAL, it
could check to see if the new device was a scanner, and if not, exit.
Of course it wouldn't detect scanners on the printer port being
hotplugged, but they wouldn't be able to send any kinds of button
events to the system anyways, and wouldn't need to be monitored the
whole time they're plugged in.  When there are no active jobs and no
methods have been called for a certain amount of time (maybe 30
seconds) and there isn't a scanner or the scanner doesn't have any
buttons to monitor, the daemon can then shut down since it won't be

Donald Straney

More information about the xdg mailing list