DiaVariable

DiaVariable — Variable value objects used by DiaSolver.

Synopsis

#define             DIA_VARIABLE                        (obj)
struct              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

Signals

  "changed"                                        : Run Last
  "changed-internal"                               : Run Last

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


struct DiaVariable

struct 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.


dia_variable_set_value ()

void                dia_variable_set_value              (DiaVariable *var,
                                                         gdouble value);

Set the value for the variable.


dia_variable_get_strength ()

DiaStrength         dia_variable_get_strength           (DiaVariable *var);

Retrieve the strength of variable 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.

Property Details

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

Signal Details

The "changed" signal

void                user_function                      (DiaVariable *diavariable,
                                                        gpointer     user_data)        : Run Last

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)        : Run Last

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