![]() |
![]() |
![]() |
GNOME Scan Reference Manual | ![]() |
---|---|---|---|---|
enum GnomeScannerOptionFlags; GnomeScannerOption; enum GnomeScannerOptionError; gint gnome_scanner_option_get_int (GnomeScannerOption *option); void gnome_scanner_option_set_int (GnomeScannerOption *option, gint value); gfloat gnome_scanner_option_get_float (GnomeScannerOption *option); void gnome_scanner_option_set_float (GnomeScannerOption *option, gfloat value); gpointer gnome_scanner_option_get_id (GnomeScannerOption *option); const gchar* gnome_scanner_option_get_name (GnomeScannerOption *option); const gchar* gnome_scanner_option_get_title (GnomeScannerOption *option); const gchar* gnome_scanner_option_get_desc (GnomeScannerOption *option); GValue* gnome_scanner_option_get_value (GnomeScannerOption *option); GType gnome_scanner_option_get_value_type (GnomeScannerOption *option); GnomeScannerOptionFlags gnome_scanner_option_get_flags (GnomeScannerOption *option); GnomeScanUnit gnome_scanner_option_get_unit (GnomeScannerOption *option); GnomeScannerOptionConstraint* gnome_scanner_option_get_constraint (GnomeScannerOption *option); void gnome_scanner_option_set_value (GnomeScannerOption *option, GValue *value);
"constraint" gpointer : Read / Write / Construct Only "desc" gchararray : Read / Write / Construct Only "flags" GnomeScannerOptionFlags : Read / Write / Construct Only "id" gpointer : Read / Write / Construct Only "name" gchararray : Read / Write / Construct Only "title" gchararray : Read / Write / Construct Only "type" GType : Read / Write / Construct Only "unit" gint : Read / Write / Construct Only "value" gpointer : Read / Write
Each devices has a variable list of options. Each option is represented by a GnomeScannerOption widget which hold meta-data and data concerning one option. This object must be instanciate only by the GnomeScanBackend.
The GnomeScan project distinguish two kind of options. Device options and Scan options. GnomeScannerOption handle both because of a sane heritage. This is not intend to continue like this. Device option are light management and such. They are un common and often misdocumented. Applications must not us GnomeScannerOption to handle Scan option such as resolution or area, because GnomeScannerOption depend on one device. If the user choose another device, option value is lost. See GnomeScanContext to handle Scan options.
typedef enum { GNOME_SCANNER_OPTION_READONLY = 1 << 0, GNOME_SCANNER_OPTION_INACTIVE = 1 << 1, GNOME_SCANNER_OPTION_ADVANCED = 1 << 2, GNOME_SCANNER_OPTION_AUTOMATIC = 1 << 3, GNOME_SCANNER_OPTION_ENUMERATION = 1 << 4, GNOME_SCANNER_OPTION_RANGE = 1 << 5, /* Emulated ? soft detect ? */ } GnomeScannerOptionFlags;
typedef enum { GNOME_SCANNER_OPTION_ERROR_FAILED } GnomeScannerOptionError;
gint gnome_scanner_option_get_int (GnomeScannerOption *option);
Convenient function similar to g_value_get_int()
to get an integer
value from a GnomeScannerOption.
option : |
a GnomeScannerOption |
Returns : | An integer value or 0 if the option doesn't holds an integer |
void gnome_scanner_option_set_int (GnomeScannerOption *option, gint value);
Convenient function to set an integer value to an option.
option : |
a GnomeScannerOption |
value : |
an integer |
gfloat gnome_scanner_option_get_float (GnomeScannerOption *option);
Convenient function similar to g_value_get_float()
for a
GnomeScannerOption.
option : |
a GnomeScannerOption |
Returns : | a float or 0 |
void gnome_scanner_option_set_float (GnomeScannerOption *option, gfloat value);
Convenient function similar to g_value_set_float()
for a
GnomeScannerOption.
option : |
a GnomeScannerOption |
value : |
a float |
gpointer gnome_scanner_option_get_id (GnomeScannerOption *option);
Return the unique id of the option. This function should be called only by GnomeScanBackend.
option : |
a GnomeScannerOption |
Returns : | The option unique id |
const gchar* gnome_scanner_option_get_name (GnomeScannerOption *option);
Returns a string containing the name of the option.
option : |
a GnomeScannerOption |
Returns : | The option's name |
const gchar* gnome_scanner_option_get_title (GnomeScannerOption *option);
Returns a string containing the title of the option.
option : |
a GnomeScannerOption |
Returns : | The option's title |
const gchar* gnome_scanner_option_get_desc (GnomeScannerOption *option);
Returns a string containing a description of the option
option : |
a GnomeScannerOption |
Returns : | The option's description |
GValue* gnome_scanner_option_get_value (GnomeScannerOption *option);
Return the value of the option as a GValue..
option : |
a GnomeScannerOption |
Returns : | The option's value |
GType gnome_scanner_option_get_value_type (GnomeScannerOption *option);
Retreive the type of the option's value.
option : |
a GnomeScannerOption |
Returns : | The type of the option's value |
GnomeScannerOptionFlags gnome_scanner_option_get_flags (GnomeScannerOption *option);
Get Option's flags.
option : |
a GnomeScannerOption |
Returns : | Option's flags See: GnomeScannerOptionFlags |
GnomeScanUnit gnome_scanner_option_get_unit (GnomeScannerOption *option);
Retreive the unit of the option value.
option : |
a GnomeScannerOption |
Returns : | the unit of the option |
GnomeScannerOptionConstraint* gnome_scanner_option_get_constraint (GnomeScannerOption *option);
The option constraint or NULL.
option : |
a GnomeScannerOption |
Returns : |
void gnome_scanner_option_set_value (GnomeScannerOption *option, GValue *value);
The value is copied to the option value this mean that value's types must correspond.
option : |
a GnomeScannerOption |
value : |
a GValue to copy to the option value |
constraint
" property"constraint" gpointer : Read / Write / Construct Only
The constraint value.
desc
" property"desc" gchararray : Read / Write / Construct Only
Long description of the option.
Default value: ""
flags
" property"flags" GnomeScannerOptionFlags : Read / Write / Construct Only
Options flags.
Default value: GNOME_SCANNER_OPTION_INACTIVE
id
" property"id" gpointer : Read / Write / Construct Only
Unique identifier used by the backend.
name
" property"name" gchararray : Read / Write / Construct Only
String without spaces nor special characters describing the option.
Default value: ""
title
" property"title" gchararray : Read / Write / Construct Only
String containing the title of the option.
Default value: ""
unit
" property"unit" gint : Read / Write / Construct Only
Physical unit of options value if float or integer.
Allowed values: >= 0
Default value: 0
void user_function (GnomeScannerOption *option, gpointer user_data) : Run first
Emitted when the value is changed.
option : |
The emitting GnomeScannerOption |
user_data : |
user data set when the signal handler was connected. |