Skip to content
Commit 402ff8ef authored by Jonathan Marten's avatar Jonathan Marten
Browse files

Rewrite the KScanOption/KScanDevice/KScanOptSet classes

This is for a cleaner API and to finally eliminate the global
data of KScanDevice.  A KScanOption now remembers the KScanDevice
that it belongs to, so that it can perform SANE operations.

Only the KScanDevice may construct a KScanOption, all other callers
must obtain (and optionally create) one via KScanDevice::getOption().
There is only a single instance of a KScanOption object for a given
scanner parameter.

Since without the global data there can now be more than one
KScanDevice, this is no longer a singleton class and one can be
constructed in the usual way (although Kooka only ever creates
one at a time).

The 'apply' operation is performed by the KScanOption instead of
KScanDevice, so the KScanOption now has 4 orthogonal operations 'set',
'apply', 'reload' and 'get'.

A KScanOptSet stores only the name-value pair of the options, not
the complete KScanOption object.  There is therefore no need for
KScanOption to have a copy constructor or assignment operator, which
in turn means that it does not need the hack for maintaining common
gamma table values.

These 3 classes, plus ScanParams, now have complete API documentation.

Squashed commit of the following:

commit 4a5fe08946b761b8f90dc725384dfa1c20217c4b
Author: Jonathan Marten <jjm@keelhaul.me.uk>
Date:   Wed Mar 9 09:03:10 2011 +0000
parent af5715ca
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment