GnomeScanBackend

GnomeScanBackend — The glue between SANE and GnomeScan APIs

Synopsis




                    GnomeScanBackend;
GnomeScanBackend*   gnome_scan_backend_new              (GError **error);
void                gnome_scan_backend_destroy          (GnomeScanBackend *backend);
GSList*             gnome_scan_backend_probe_scanners   (GnomeScanBackend *backend,
                                                         GError **error);
GnomeScanForecast*  gnome_scan_backend_forecast         (GnomeScanBackend *backend,
                                                         GnomeScanContextInfo *info,
                                                         GError **error);
void                gnome_scan_backend_acquire          (GnomeScanBackend *backend,
                                                         GnomeScanContextInfo *info,
                                                         GError **error);
void                gnome_scan_backend_stop             (GnomeScanBackend *backend,
                                                         GnomeScanner *scanner);

Object Hierarchy


  GObject
   +----GnomeScanBackend

Signals


  "data-received"                                  : Run First
  "image-acquired"                                 : Run First

Description

Just remember that : YOU MUST NOT USE GnomeScanBackend !

GnomeScanBackend is actually a glib-ish SANE wrapper. SANE has a procedural API that does not fit the glib GObject paradigm. The backend retreive data from the backend and convert them into glib type such as the one declared by the GnomeScan. For example, the GnomeScanBackend is responsible to instanciate all GnomeScanner and GnomeScannerOption. GnomeScanBackend also convert raw data into GdkPixbuf.

Details

GnomeScanBackend

typedef struct _GnomeScanBackend GnomeScanBackend;


gnome_scan_backend_new ()

GnomeScanBackend*   gnome_scan_backend_new              (GError **error);

Instanciate a new backend. This function is also responsible to init the third party backend (e.g. SANE).

error : A GError
Returns : a new GnomeScanBackend

gnome_scan_backend_destroy ()

void                gnome_scan_backend_destroy          (GnomeScanBackend *backend);

Destroy a backend and free SANE resources (i.e. SANE).

backend : a GnomeScanBackend

gnome_scan_backend_probe_scanners ()

GSList*             gnome_scan_backend_probe_scanners   (GnomeScanBackend *backend,
                                                         GError **error);

Do the long device probe task and return a GSList of GnomeScanner.

backend : a GnomeScanBackend
error : a GError
Returns : the scanners list.

gnome_scan_backend_forecast ()

GnomeScanForecast*  gnome_scan_backend_forecast         (GnomeScanBackend *backend,
                                                         GnomeScanContextInfo *info,
                                                         GError **error);

Compute acquisition forecast.

backend : a GnomeScanBackend
info : a scan context
error : a GError
Returns : The forecast or NULL if error.

gnome_scan_backend_acquire ()

void                gnome_scan_backend_acquire          (GnomeScanBackend *backend,
                                                         GnomeScanContextInfo *info,
                                                         GError **error);

Do the acquisition work and return the picture in a GdkPixbuf. The GnomeScanBackend::"data-received" signal is emitted each time the device sent data. You should use gnome_scan_context_start_acquisition().

backend : a GnomeScanBackend
info : a GnomeScanContextInfo
error : a GError or NULL

gnome_scan_backend_stop ()

void                gnome_scan_backend_stop             (GnomeScanBackend *backend,
                                                         GnomeScanner *scanner);

Cancel acquisition (preview or final). You should use gnome_scan_context_stop_acquisition() instead.

backend : a GnomeScanBackend
scanner :

Signal Details

The "data-received" signal

void                user_function                      (GnomeScanBackend *backend,
                                                        gint              data_received,
                                                        gpointer          user_data)          : Run First

Emitted when the backend received data from the scanner during an acquisition.

backend : the emitting GnomeScanBackend
data_received : the amount of value received
user_data : user data set when the signal handler was connected.

The "image-acquired" signal

void                user_function                      (GnomeScanBackend *backend,
                                                        GnomeScanResult  *result,
                                                        gpointer          user_data)      : Run First

Emitted when the backend successfully acquired an image.

backend : the emitting GnomeScanBackend
result : the scan result containing the acquired image
user_data : user data set when the signal handler was connected.