static void attribute_save(Attribute *attribute, ObjectNode obj_node, DiaContext *ctx) { element_save(&attribute->element, obj_node, ctx); data_add_real(new_attribute(obj_node, "border_width"), attribute->border_width, ctx); data_add_color(new_attribute(obj_node, "border_color"), &attribute->border_color, ctx); data_add_color(new_attribute(obj_node, "inner_color"), &attribute->inner_color, ctx); data_add_string(new_attribute(obj_node, "name"), attribute->name, ctx); data_add_boolean(new_attribute(obj_node, "key"), attribute->key, ctx); data_add_boolean(new_attribute(obj_node, "weak_key"), attribute->weakkey, ctx); data_add_boolean(new_attribute(obj_node, "derived"), attribute->derived, ctx); data_add_boolean(new_attribute(obj_node, "multivalued"), attribute->multivalue, ctx); data_add_font (new_attribute (obj_node, "font"), attribute->font, ctx); data_add_real(new_attribute(obj_node, "font_height"), attribute->font_height, ctx); }
static void attribute_save(Attribute *attribute, ObjectNode obj_node, const char *filename) { element_save(&attribute->element, obj_node); data_add_real(new_attribute(obj_node, "border_width"), attribute->border_width); data_add_color(new_attribute(obj_node, "border_color"), &attribute->border_color); data_add_color(new_attribute(obj_node, "inner_color"), &attribute->inner_color); data_add_string(new_attribute(obj_node, "name"), attribute->name); data_add_boolean(new_attribute(obj_node, "key"), attribute->key); data_add_boolean(new_attribute(obj_node, "weak_key"), attribute->weakkey); data_add_boolean(new_attribute(obj_node, "derived"), attribute->derived); data_add_boolean(new_attribute(obj_node, "multivalued"), attribute->multivalue); data_add_font (new_attribute (obj_node, "font"), attribute->font); data_add_real(new_attribute(obj_node, "font_height"), attribute->font_height); }
void data_add_text(AttributeNode attr, Text *text) { DataNode composite; char *str; composite = data_add_composite(attr, "text"); str = text_get_string_copy(text); data_add_string(composite_add_attribute(composite, "string"), str); g_free(str); data_add_font(composite_add_attribute(composite, "font"), text->font); data_add_real(composite_add_attribute(composite, "height"), text->height); data_add_point(composite_add_attribute(composite, "pos"), &text->position); data_add_color(composite_add_attribute(composite, "color"), &text->color); data_add_enum(composite_add_attribute(composite, "alignment"), text->alignment); }