![]() |
![]() |
![]() |
Gnome Scan Reference Manual | ![]() |
---|---|---|---|---|
GnomeScanBackend; GnomeScanBackend* gnome_scan_backend_new (GType backend_type); void gnome_scan_backend_probe_scanners (GnomeScanBackend *backend); void gnome_scan_backend_add_scanner (GnomeScanBackend *backend, GnomeScanner *scanner); void gnome_scan_backend_remove_scanner (GnomeScanBackend *backend, GnomeScanner *scanner); void gnome_scan_backend_probe_done (GnomeScanBackend *backend);
In Gnome Scan, the so called "backend" is only responsible to probe devices. In fact, the scanner is only responsible to detect scanner plug and unplug and trigger signal about that. Probing is just a way to add already plugged scanner just like adding a hotplugged scanner.
The backend itseld does not maintain a public list of scanner, it's up to the UI to maintain a list of scanner (e.g. through a GtkListStore).
GnomeScanBackend is the base class for real backend. If you want
to instanciate all backends, just initialize all GnomeScanModules
and instanciate each g_type_children()
of GnomeScanBackend.
typedef struct _GnomeScanBackend GnomeScanBackend;
The GnomeScanBackend is only responsible to probe scanners, emitting signal on scanner plug or unplug. Ideally, most of the acquisition work is done through GnomeScanner.
GnomeScanBackend* gnome_scan_backend_new (GType backend_type);
Instanciate a new backend of type type
. It check wether type
is a
child type of GnomeScanBackend.
|
the top level backend GType |
Returns : |
a new GnomeScanBackend. |
void gnome_scan_backend_probe_scanners (GnomeScanBackend *backend);
Trigger probe. Ideally called in a new thread through g_thread_create()
.
See: g_thread_create()
|
a GnomeScanBackend |
void gnome_scan_backend_add_scanner (GnomeScanBackend *backend, GnomeScanner *scanner);
This function is used by child class to trigger "scanner-added" signal.
|
a GnomeScanBackend |
|
a new GnomeScanner |
void gnome_scan_backend_remove_scanner (GnomeScanBackend *backend, GnomeScanner *scanner);
Trigger "scanner-removed" upon scanner
. This
function is to be used only by child class.
|
a GnomeScanBackend |
|
a deprecated GnomeScanner |
void gnome_scan_backend_probe_done (GnomeScanBackend *backend);
Trigger "probe-done" signal. Used by child class.
|
a GnomeScanBackend |
"probe-done"
signalvoid user_function (GnomeScanBackend *backend, gpointer user_data) : Run Last
This signal allow app to know if the backend has found a scanner during probe. If the "probe-done" signal is emitted and no "scanner-added" signal has been sent, this mean that no scanner has been found at all. Remember the backend does not handle a list of GnomeScanner.
|
the emitting GnomeScanBackend |
|
user data set when the signal handler was connected. |
"scanner-added"
signalvoid user_function (GnomeScanBackend *backend, GnomeScanner *scanner, gpointer user_data) : Run Last
This backend is triggered each time it discover a new scanner during probe or on plug.
|
the emitting GnomeScanBackend |
|
the newly added GnomeScanner |
|
user data set when the signal handler was connected. |
"scanner-removed"
signalvoid user_function (GnomeScanBackend *backend, GnomeScanner *scanner, gpointer user_data) : Run First
This signal is emitted as a scanner is lost. Every reference to this scanner must be removed.
|
the emitting GnomeScanBackend |
|
the scanner removed |
|
user data set when the signal handler was connected. |