GnomeScanParamWidget

GnomeScanParamWidget — A generic parameter widget

Synopsis




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

Object Hierarchy


  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBox
                                 +----GtkHBox
                                       +----GnomeScanParamWidget

Implemented Interfaces

GnomeScanParamWidget implements AtkImplementorIface and GtkBuildable.

Properties


  "param-spec"               gpointer              : Read / Write / Construct Only
  "plugin"                   GnomeScanPlugin       : Read / Write / Construct Only
  "settings"                 GnomeScanSettings     : Read / Write / Construct Only
  "value"                    GValue                : Read / Write

Description

This widget build it self automatically considering the GParamSpec passed to the constructor.

Details

GnomeScanParamWidget

typedef struct {
  GnomeScanSettings*	settings;
  GnomeScanPlugin*	plugin;
  GParamSpec		*pspec;
  GValue		*value;

  gboolean		shows_label;
  gboolean		expands;
  gboolean		shows_unit;
} GnomeScanParamWidget;


gnome_scan_param_widget_new ()

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

gnome_scan_param_widget_get_param_spec ()

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

gnome_scan_param_widget_set_value ()

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

gnome_scan_param_widget_get_value ()

GValue*             gnome_scan_param_widget_get_value   (GnomeScanParamWidget *widget);

Retrieve the current value the user setted.

widget : a GnomeScanParamWidget
Returns : a GValue

gnome_scan_param_widget_shows_label ()

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.

gnome_scan_param_widget_expands ()

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.

Property Details

The "param-spec" property

  "param-spec"               gpointer              : Read / Write / Construct Only

The param spec the widget is representing. A widget can handle only one GParamSpec per instance, the widget being builded upon construction depending on the GParamSpec.


The "plugin" property

  "plugin"                   GnomeScanPlugin       : Read / Write / Construct Only


The "settings" property

  "settings"                 GnomeScanSettings     : Read / Write / Construct Only


The "value" property

  "value"                    GValue                : Read / Write

The current value associated with the param-spec.