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);

Object Hierarchy


  GObject
   +----GnomeScanBackend

Signals


"data-received"
            void        user_function      (GnomeScanBackend *backend,
                                            gint              data_received,
                                            gpointer          user_data)          : Run first
"image-acquired"
            void        user_function      (GnomeScanBackend *backend,
                                            gpointer          result,
                                            gpointer          user_data)      : 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

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,
                                            gpointer          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.