![]() | ![]() | ![]() | DiaCanvas2 Reference Manual | ![]() |
---|
DiaVariableDiaVariable — Variable value objects used by DiaSolver. |
#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);
"changed" void user_function (DiaVariable *diavariable, gpointer user_data); "changed-internal" void user_function (DiaVariable *diavariable, gpointer user_data);
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.
#define DIA_VARIABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIA_TYPE_VARIABLE, DiaVariable))
obj : |
DiaVariable* dia_variable_new (void);
Create a new variable.
Returns : | a newly-created variable. |
gdouble dia_variable_get_value (DiaVariable *var);
Get the value of the variable.
var : | |
Returns : |
void dia_variable_set_value (DiaVariable *var, gdouble value);
Set the value for the variable.
var : | |
value : |
DiaStrength dia_variable_get_strength (DiaVariable *var);
Retrieve the strength of variable var.
var : | |
Returns : | Return the strength of the variable. |
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 : |
"strength" DiaStrength : Read / Write
Strength of the variable.
Default value: DIA_STRENGTH_WEAK
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. |
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. |
<< DiaStrength | DiaExpression >> |