Updates on local work, step 1 : the main dialog
December 1, 2008
Hi,
The rewrite is going on. I can’t publish it yet because it is incomplete et break a lot of things. Anyway, i want you to know that the project is far from dead. I manage to work on it about few hours a day allowing to make some visible progress.
These days, i almost finished the first two steps : reworking the maindialog. This work consists of merging configuration and acquisition dialog, splitting acquisition dialog into several widgets for handling scanner selector, options (page, box, widgets) and preview. All those rework mean rewriting one way or another. I just choose to rewrite in Vala.
This rework imply a lot of rework in the ground base of the library : options and pipeline représentation. Options are now far more smarter. Options replace old ParamSpec. The difference is in the intelligence in it. Options will handle themselves signaling their changes to other object, they handle their value themselves including saving and storing to GConf (not yet). This will allow saving to GConf high level option like paper size, lists, areas and every boxed type you can find in options.
The option handling has changed a bit in order to completely split engine from GUI. There is now an option manager which stores rules to determine which widget handle one option. It allow to specify a widget to handle an option considering its name or its type. This is far more grained and finally efficient since there is one rule for each instance of option rather than on type stored in each option.
Other area of rework are the pipeline. The job is now constituted of nodes (instead of plugins) with a scanner at begin and a sink at the end. Each node has a status (initializing, unconfigured, ready, processing, etc.) and the job take the status of the least status node (e.g. if scanner is initializing and sink is ready, then gnome-scan is still initializing). Since option are self signaling, nodes knows on the fly the actual value from users, allowing to update their status accordingly (from unconfigured to ready and vice-versa).
On top of that, the new dialog looks exactly the same and behave mostly the same. Changes includes dynamic building of the UI (just to save some CPU cycle before showing dialog), dynamic handling of status (exposing actual status in selector and disabling buttons according to status). This status handling will avoid user to launch unusable scan configuration leading to unpredictable result (i.e. crash).
Options widget are now packed in option box (with bold title), themselves packed in option page (each per tab). All of these widgets are auto-hidden and auto-expanded allowing the dialog to not care about packing option while providing high level widget to build custom dialog.
Also, configuration and acquisition has been merged in the same dialog. This allow to go back and forth. Imagine you just want to change to orientation of the next photo … now you can ! I wonder whether i should expose some options for each scan (like orientation and file name) just below the progress bar. This will allow to name each frame of a scan (be it for flegita filename of f-spot photo description or GIMP layer name). This UI will be greyed during scan. Feedback welcome.
About Vala. This language is pretty cool. Writing 1 line of vala produce about 3,2 lines of C. This helps a lot. In the mean time vala is still a 0.X software (like GEGL, like … GNOME Scan !) and i have to send some patches againts vala binding or vala itself. All in all, vala allows me to write pretty good code and faster. 0.5 rewrite was fast thanks to Anjuta GObject class generator. Vala helps me a lot in rewriting GNOME Scan.
The next step is to build a single instance of the GEGL pipeline allowing dynamic preview. Actually implement acquisition. Then preview and processing will take place. Commit. Then porting gSANE backend and gimp plugin to new API and writing flegita-print (the GNOME photocopier). I have no clue whether i’ll be able to publish a 0.7.1 with feature parity against 0.6.
Oh, i was forgetting the screencast i made, showing some UI changes 🙂
December 2, 2008 at 10:07 am
This dialog doesn’t make sense. What on earth is the scan options thing where you have to select files?
December 2, 2008 at 11:30 am
Hi,
The “Files” scanner is a software fake scanner allowing me to develop quickly the library. It also allow to process image inside an application (e.g. do OCR on jpeg’s received from mail).
Of course, this is not the primary use of GNOME Scan, but as said in the post, porting the SANe backend will be done later once the library is ready.
Regards,
Étienne.
December 2, 2008 at 12:36 pm
Great stuff!
I think you should let it land in svn soon to enable other people to jump in as well.
Maybe we find someone to develop a TWAIN backend to use on windows platform.