GnomeScanJob

GnomeScanJob — Handling acquisition, processing and outputting

Synopsis




                    GnomeScanJob;
GnomeScanJob*       gnome_scan_job_new                  (GnomeScanSettings *settings,
                                                         GnomeScanSink *sink);
GnomeScanSettings*  gnome_scan_job_get_settings         (GnomeScanJob *job);
void                gnome_scan_job_set_scanner          (GnomeScanJob *job,
                                                         GnomeScanner *scanner);
GnomeScanner*       gnome_scan_job_get_scanner          (GnomeScanJob *job);
void                gnome_scan_job_set_sink             (GnomeScanJob *job,
                                                         GnomeScanSink *sink);
GnomeScanSink*      gnome_scan_job_get_sink             (GnomeScanJob *job);
void                gnome_scan_job_run                  (GnomeScanJob *job);
void                gnome_scan_job_cancel               (GnomeScanJob *job);

Object Hierarchy


  GObject
   +----GnomeScanJob

Properties


  "scanner"                  GnomeScanner          : Read / Write
  "settings"                 GnomeScanSettings     : Read / Write
  "sink"                     GnomeScanSink         : Read / Write

Description

In Gnome Scan, the job of scanning is divided in three parts : acquiring, processing and outputting. The first stage is handled by GnomeScanner plugin. The second is handled using GeglOperation. The latter is handled by GnomeScanSink plugin.

The purpose of GnomeScanJob is to marshal the configuration and execution of these three part, allowing to easily delegate job execution in a worker thread.

Details

GnomeScanJob

typedef struct {
	gdouble		progress;
	gchar*		stage;
	gboolean	done;
} GnomeScanJob;

A GnomeScanJob object handle the acquisition, processing and outputing of images. Use gnome_scan_job_run() to execute the job. During its execution, the job will fill progress and stage in order you to know what he is doing. This way, the main thread can know what the worker thread is doing.

gdouble progress; a fraction indicating the progress of the execution (from 0 to 1)
gchar *stage; a description of the current stage being executed.
gboolean done;

gnome_scan_job_new ()

GnomeScanJob*       gnome_scan_job_new                  (GnomeScanSettings *settings,
                                                         GnomeScanSink *sink);

Instanciate a new job. The job create its own GnomeScanSettings upon construction. Well, i don't like that, this may change later.

settings :
sink :
Returns : a new GnomeScanJob

gnome_scan_job_get_settings ()

GnomeScanSettings*  gnome_scan_job_get_settings         (GnomeScanJob *job);

Retrieve the settings used by the job.

job : a GnomeScanJob
Returns : the job GnomeScanSettings

gnome_scan_job_set_scanner ()

void                gnome_scan_job_set_scanner          (GnomeScanJob *job,
                                                         GnomeScanner *scanner);

Set the source of the acquisition.

job : a GnomeScanJob
scanner : a GnomeScanner

gnome_scan_job_get_scanner ()

GnomeScanner*       gnome_scan_job_get_scanner          (GnomeScanJob *job);

Retrieve the scanner used to acquire image.

job : a GnomeScanJob
Returns : a GnomeScanner

gnome_scan_job_set_sink ()

void                gnome_scan_job_set_sink             (GnomeScanJob *job,
                                                         GnomeScanSink *sink);

Set the scan sink.

job : a GnomeScanJob
sink : a GnomeScanSink

gnome_scan_job_get_sink ()

GnomeScanSink*      gnome_scan_job_get_sink             (GnomeScanJob *job);

Retrieve the sink used to output acquired image.

job : a GnomeScanJob
Returns : a GnomeScanSink

gnome_scan_job_run ()

void                gnome_scan_job_run                  (GnomeScanJob *job);

Configure, iterate each part of the job and monitor task progress. You should call this function in a new thread. Ideally, you should never use this function directly and use GnomeScanAcquisitionDialog instead.

See: GnomeScanAcquisitionDialog or g_thread_create()

job : a GnomeScanJob

gnome_scan_job_cancel ()

void                gnome_scan_job_cancel               (GnomeScanJob *job);

Ask the job to stop.

job : a running GnomeScanJob

Property Details

The "scanner" property

  "scanner"                  GnomeScanner          : Read / Write

The GnomeScanner responsible of image acquisition.


The "settings" property

  "settings"                 GnomeScanSettings     : Read / Write

The GnomeScanSettings object containing all user settings for plugins.


The "sink" property

  "sink"                     GnomeScanSink         : Read / Write

The sink responsible to output acquired images.