![]() |
![]() |
![]() |
GNOME Scan Reference Manual | ![]() |
---|---|---|---|---|
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);
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.
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 |
void gnome_scan_backend_destroy (GnomeScanBackend *backend);
Destroy a backend and free SANE resources (i.e. SANE).
backend : |
a GnomeScanBackend |
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. |
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. |
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 |
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 : |
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. |
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. |