{i} This document state about GnomeScan 0.6 redesign

Introduction

Scanning in Gnome

Currently, Gnome desktop provide nothing about scan. Distro has to include third party software (often xsane) which do not fit Gnome HIG and does not integrate well in Gnome desktop (xsane is just a Gtk+ app including a Gimp plugin).

GnomeScan Lames As For 0.4

GnomeScan has been fastly design in order to provide a proof of concept implementation during the Google Summer of code 2006. Gnome Scan design now shows his lame.

  • No real backend support. There is only a GnomeScanBackend object which is just a sane-calls encapsulation object. There is no real backend API. We need a real backend API implemented by GModule like GtkPrintBackend.

  • No post processing. GnomeScan has just an hard coded rotation mecanism. There is plethora of post processing features app may need : rotation, descreen, denoise and especially OCR.

  • No support for easy store/recover of scan settings (like GtkPrintSettings).

  • Library of widgets leads to very unconsistent dialog accross apps.
  • No calibration

As GnomeScan is moving to full Gnome infrastructure, i (ÉtienneBersac) take that opportunity to fix GnomeScan design. This time, i really want to design Gnome Scan in a way consistent with GtkPrint.

What Exists

  • GEGL for image processing.
  • SANE provides very good hardware support.
  • HAL is going to have scanner support (thanks to Martin Owen and David Zeuthen)
  • TWAIN should be ported to Linux/Unix for 2.0 release.

GnomeScan Goals

  • Provide an easy API for app-developer to implement scan features.
    • Provide HIG scan dialog and widgets to extends UI.
    • Provide common processing features (unpaper, ocr, etc.).
  • Provide apps/plugins to integrate scan features in the desktop

Job

While printing let app do their one pre processing before sending job to printer, scanning imply a lot of post processing. The overall process (called job) is divided in three parts for each page : acquiring, processing, outputing. Acquiring is done through scanner, files, etc.. Processing si done through Gegl. Outputing is done by app. Gnome Scan will provide common output plugin like images, basic PDF and OCR.

Configuring

A job contains all the objects selected to acquire, process and output the data. It also contains all the settings for the objects.

Acquiring

We'll have to implement different backend for scanner. file and sane backends will be implemented, each using a shared object.

Scanner Parameters

An issue with scanner is the huge variety of scanner. SANE solve it partially by using an undefined set of options. The same way, we must implement such option handling in gnome-scan. While GObject properties are fixed in class definition, scanner "params" are not. Also, GObject param specs does not fit scanners needs. We will define our own set of GParamSpecs. All of scanner GParamSpecs will include the following extra properties :

  • gchar * group

  • GnomeScannerParamFlags scanner-flags

Following the list of GSParamSpecs :

  • boolean
  • int
  • float
  • string
  • pointer
  • path (allowed filetypes, single/multiple)
  • area (using GtkRectangle).

  • range
  • select (possible_values, one/multiple)

GParamFlags are also restrictive for scanner. Here is GSParamFlags values :

  • readonly
  • scope in {hidden,advanced,basic}

Scanner Signals

When gnome-scan is running, it own scanner so we must implement our own event monitoring system. A list of signals will be declared. All signals have a signal spec, having the following properties :

  • gchar* name

  • gchar* blurb

  • enum type in {button,sensor,selector}

The scanner object will emit an "event" signal with the SignalSpec and a GValue containing event specific data (e.g. a gboolean for paper-in signal; an error enum value, etc.).

Processing

Gegl is a rocking base for processing. It already includes tons of operation and is easy to integrate in Gnome Scan thanks to GLib type system. GeglProcessor allow to monitor progress. However, GeglOperation are not really UI friendly. We should provide some tiny wrappers around one or more GeglOperation and expose some options to the UI.

Outputing

Outputing means writing to file, importing in app, etc. The output of the process pipeline is a GdkPixbuf. It's then up to the output backend to do whatever he wants. Output must be configurable. However, Output parameters use the same param specs than input, in order to build an efficien user interface.

User Interface

Dialog

The main widget is the GnomeScanDialog with the following spec

  • allow to dynamically select devices.
  • be consistent with GtkPrintUnixDialog (using tab)

  • auto add device/backend specific tabs
  • allow apps to add one or more tabs.
  • allow apps to set a list of pre defined formats (e.g. abiwords set a list of document formats, f-spot a list of photo format, etc.) using GtkPaperSize.

  • monitor device plug/status ?

Option widget

A widget handling all options types.

Progress Dialog

This widget is an internal widget which handle the acquisition process and show post processing progress. It allow user to cancel a running task, and trigger acquisition of next frame.

Preview Area

A good idea is to provide a GnomeScanPreviewArea widget whith the following specs :

  • Allow app to sent a GdkPixbuf (+ resolution ?) to the preview area.

  • Allow app to get a selection in a defined GtkUnit.

Implementation

diagramme.png

This diagram does not contains all class. I added GnomeScanModule and GnomeScanModuleManager for handling plugin loading. Also, the diagram does not documents signals.

App/Plugins

Standalone Scanning App

  • save to various file format
  • print directly (software photocopier)
  • Mail to
  • Fax to

Gimp Plugin

  • Create new image from scan
  • Scan as layer

F-Spot Plugin

  • Import photos (attaching tags, …)

Abiword Plugin

  • Import text (hopefuly with formatting)
  • import image

Evolution Plugin

  • Import vCard

Open questions

  • Does it worth splitting gnomescan and gnomescanui in two library in gnomescanui contains only two widgets (+init + stocks)
  • Could libgnomescan+libgnomescanui be merge into Gtk+ and let GnomeScan being only the app/plugins part ?

Links

Comments

Outreach/SummerOfCode/2006/GnomeScanning/Spec (last edited 2013-12-03 23:50:39 by WilliamJonMcCann)