/** Set the default arrow type that the toolbox will supply for new objects. * @param arrow An arrow object to be used for the end of new connectors. */ void attributes_set_default_end_arrow(Arrow arrow) { attributes_end_arrow = arrow; persistence_set_string("end-arrow-type", arrow_get_name_from_type(arrow.type)); persistence_set_real("end-arrow-width", arrow.width); persistence_set_real("end-arrow-length", arrow.length); }
/** Set the default line style (dashes, dots etc) * @param style The style (number of dots and dashes) * @param dash_length The length of a dash (0.0 < dash_length < ???) * @see dia-enums.h for possible values for style. */ void attributes_set_default_line_style(LineStyle style, real dash_length) { attributes_linestyle = style; attributes_dash_length = dash_length; persistence_set_integer("line-style", style); persistence_set_real("dash-length", dash_length); }
void prefs_save(void) { int i; gpointer ptr; for (i=0;i<NUM_PREFS_DATA;i++) { if ((prefs_data[i].type == PREF_NONE) || (prefs_data[i].type == PREF_END_GROUP)) continue; ptr = (char *)&prefs + prefs_data[i].offset; switch (prefs_data[i].type) { case PREF_BOOLEAN: persistence_set_boolean(prefs_data[i].name, *(gint *)ptr); break; case PREF_INT: case PREF_UINT: persistence_set_integer(prefs_data[i].name, *(gint *)ptr); break; case PREF_REAL: case PREF_UREAL: persistence_set_real(prefs_data[i].name, *(real *)ptr); break; case PREF_COLOUR: persistence_set_color(prefs_data[i].name, (Color *)ptr); break; case PREF_CHOICE: case PREF_STRING: persistence_set_string(prefs_data[i].name, *(gchar **)ptr); break; case PREF_NONE: case PREF_END_GROUP: break; } } }
/** Set the default line width. * @param width The line width (0.0 < linewidth < 10.0) to use for new objects. */ void attributes_set_default_linewidth(real width) { attributes_default_linewidth = width; persistence_set_real("linewidth", width); }