Revision 402ff8e...
Go back to digest for 24th April 2011Features in Graphics
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
Date: Wed Mar 9 09:03:10 2011 +0000
M +1 -1 kooka/formatdialog.cpp
M +1 -1 kooka/kookaview.cpp
M +8 -12 kooka/photocopyprintdialogpage.cpp
M +12 -8 kooka/scanparamsdialog.cpp
M +255 -412 libkscan/kscandevice.cpp
M +338 -245 libkscan/kscandevice.h
M +1 -1 libkscan/kscandoc.h
M +148 -142 libkscan/kscanoption.cpp
M +318 -77 libkscan/kscanoption.h
M +76 -137 libkscan/kscanoptset.cpp
M +132 -53 libkscan/kscanoptset.h
M +113 -114 libkscan/scanparams.cpp
M +162 -42 libkscan/scanparams.h
http://commits.kde.org/kooka/402ff8ef566106b2c019983909217e28dfab3420
File Changes
- /kooka/formatdialog.cpp
- /kooka/kookaview.cpp
- /kooka/photocopyprintdialogpage.cpp
- /kooka/scanparamsdialog.cpp
- /libkscan/kscandevice.cpp
- /libkscan/kscandevice.h
- /libkscan/kscandoc.h
- /libkscan/kscanoption.cpp
- /libkscan/kscanoption.h
- /libkscan/kscanoptset.cpp
- /libkscan/kscanoptset.h
- /libkscan/scanparams.cpp
- /libkscan/scanparams.h