DiaVariable

DiaVariable — Variable value objects used by DiaSolver.

Synopsis




#define     DIA_VARIABLE                    (obj)
            DiaVariable;
DiaVariable* dia_variable_new               (void);
gdouble     dia_variable_get_value          (DiaVariable *var);
void        dia_variable_set_value          (DiaVariable *var,
                                             gdouble value);
DiaStrength dia_variable_get_strength       (DiaVariable *var);
void        dia_variable_set_strength       (DiaVariable *var,
                                             DiaStrength strength);

Object Hierarchy


  GObject
   +----DiaVariable

Properties


  "strength"             DiaStrength           : Read / Write
  "value"                gdouble               : Read / Write

Signal Prototypes


"changed"   void        user_function      (DiaVariable *diavariable,
                                            gpointer user_data);
"changed-internal"
            void        user_function      (DiaVariable *diavariable,
                                            gpointer user_data);

Description

Variables hold values that can be changed by the constraint solver. Every variable is assigned a strength. The weakest variables are most likely to change if the solver starts resolving the constraints.

Details

DIA_VARIABLE()

#define DIA_VARIABLE(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), DIA_TYPE_VARIABLE, DiaVariable))

obj :

DiaVariable

typedef struct _DiaVariable DiaVariable;


dia_variable_new ()

DiaVariable* dia_variable_new               (void);

Create a new variable.

Returns : a newly-created variable.

dia_variable_get_value ()

gdouble     dia_variable_get_value          (DiaVariable *var);

Get the value of the variable.

var :
Returns :

dia_variable_set_value ()

void        dia_variable_set_value          (DiaVariable *var,
                                             gdouble value);

Set the value for the variable.

var :
value :

dia_variable_get_strength ()

DiaStrength dia_variable_get_strength       (DiaVariable *var);

Retrieve the strength of variable var.

var :
Returns : Return the strength of the variable.

dia_variable_set_strength ()

void        dia_variable_set_strength       (DiaVariable *var,
                                             DiaStrength strength);

Set the strength of the variable. Stronger variables are less likely to change if they are used in a DiaConstraint.

var :
strength :

Properties

The "strength" property

  "strength"             DiaStrength           : Read / Write

Strength of the variable.

Default value: DIA_STRENGTH_WEAK


The "value" property

  "value"                gdouble               : Read / Write

Value held by this variable.

Default value: 0

Signals

The "changed" signal

void        user_function                  (DiaVariable *diavariable,
                                            gpointer user_data);

Notify the outer world that the value has changed.

diavariable :the object which received the signal.
user_data :user data set when the signal handler was connected.

The "changed-internal" signal

void        user_function                  (DiaVariable *diavariable,
                                            gpointer user_data);

Changed signal used only inside the constraint solver. You should not connect to it.

diavariable :the object which received the signal.
user_data :user data set when the signal handler was connected.

See Also

DiaSolver, DiaConstraint, DiaExpression, DiaStrength