| Gnome Scan Reference Manual | ||||
|---|---|---|---|---|
GnomeScanParamWidget;
GtkWidget* gnome_scan_param_widget_new (GnomeScanSettings *settings,
GnomeScanPlugin *plugin,
GParamSpec *pspec);
GParamSpec* gnome_scan_param_widget_get_param_spec
(GnomeScanParamWidget *widget);
void gnome_scan_param_widget_set_value (GnomeScanParamWidget *widget,
GValue *value);
GValue* gnome_scan_param_widget_get_value (GnomeScanParamWidget *widget);
gboolean gnome_scan_param_widget_shows_label (GnomeScanParamWidget *widget);
gboolean gnome_scan_param_widget_expands (GnomeScanParamWidget *widget);
GObject
+----GInitiallyUnowned
+----GtkObject
+----GtkWidget
+----GtkContainer
+----GtkBox
+----GtkHBox
+----GnomeScanParamWidget
"param-spec" gpointer : Read / Write / Construct Only "plugin" GnomeScanPlugin : Read / Write / Construct Only "settings" GnomeScanSettings : Read / Write / Construct Only "value" GValue : Read / Write
This widget build it self automatically considering the GParamSpec passed to the constructor.
typedef struct {
GnomeScanSettings* settings;
GnomeScanPlugin* plugin;
GParamSpec *pspec;
GValue *value;
gboolean shows_label;
gboolean expands;
gboolean shows_unit;
} GnomeScanParamWidget;
GtkWidget* gnome_scan_param_widget_new (GnomeScanSettings *settings, GnomeScanPlugin *plugin, GParamSpec *pspec);
Convenient constructor that retrieve default value from pspec and
pass it to gnome_scan_param_widget_new_with_value().
See: gnome_scan_param_widget_new_with_value()
settings : |
|
plugin : |
|
pspec : |
a GParamSpec |
| Returns : | The new GnomeScanParamWidget |
GParamSpec* gnome_scan_param_widget_get_param_spec
(GnomeScanParamWidget *widget);
Retrieve the spec the widget is representing.
widget : |
a GnomeScanParamWidget |
| Returns : | a pointer to the widget param spec |
void gnome_scan_param_widget_set_value (GnomeScanParamWidget *widget, GValue *value);
Set the value of the widget. It's up to you to ensure the value correspond to the param spec.
widget : |
a GnomeScanParamWidget |
value : |
a GValue |
GValue* gnome_scan_param_widget_get_value (GnomeScanParamWidget *widget);
Retrieve the current value the user setted.
widget : |
a GnomeScanParamWidget |
| Returns : | a GValue |
gboolean gnome_scan_param_widget_shows_label (GnomeScanParamWidget *widget);
A GnomeScanParamWidget can show itself the param nick or other
label. If not, the parent container can show the pspec nickname in
e.g. a GtkTable. This function allow the parent to know wether the
label is already shown or not.
widget : |
a GnomeScanParamWidget |
| Returns : | TRUE if the widget shows the label.
|
gboolean gnome_scan_param_widget_expands (GnomeScanParamWidget *widget);
This function helps parent to know how to pack/attach the widget
in a container. If the widget is huge (e.g. it contains a preview),
then it make sense to expands this widget. This function returns
wether this widget should expands or not.
widget : |
a GnomeScanParamWidget |
| Returns : | TRUE if the widget should expand.
|