void polyconn_save(PolyConn *poly, ObjectNode obj_node, DiaContext *ctx) { int i; AttributeNode attr; object_save(&poly->object, obj_node, ctx); attr = new_attribute(obj_node, "poly_points"); for (i=0;i<poly->numpoints;i++) { data_add_point(attr, &poly->points[i], ctx); } }
static void textobj_save(Textobj *textobj, ObjectNode obj_node, const char *filename) { object_save(&textobj->object, obj_node); data_add_text(new_attribute(obj_node, "text"), textobj->text); data_add_enum(new_attribute(obj_node, "valign"), textobj->vert_align); if (textobj->show_background) { data_add_color(new_attribute(obj_node, "fill_color"), &textobj->fill_color); data_add_boolean(new_attribute(obj_node, "show_background"), textobj->show_background); } }
static void textobj_save(Textobj *textobj, ObjectNode obj_node, DiaContext *ctx) { object_save(&textobj->object, obj_node, ctx); data_add_text(new_attribute(obj_node, "text"), textobj->text, ctx); data_add_enum(new_attribute(obj_node, "valign"), textobj->vert_align, ctx); if (textobj->show_background) { data_add_color(new_attribute(obj_node, "fill_color"), &textobj->fill_color, ctx); data_add_boolean(new_attribute(obj_node, "show_background"), textobj->show_background, ctx); } if (textobj->margin > 0.0) data_add_real(new_attribute(obj_node, "margin"), textobj->margin, ctx); if (textobj->text_angle != 0.0) data_add_real(new_attribute(obj_node, "text_angle"), textobj->text_angle, ctx); }
static void compound_save (Compound *comp, ObjectNode obj_node, const char * filename) { gint i; AttributeNode attr; DiaObject * obj = &comp->object; compound_sanity_check (comp, "Saving"); object_save (&comp->object, obj_node); attr = new_attribute(obj_node, "comp_points"); for (i = 0; i < obj->num_handles; i++) { Handle *h = obj->handles[i]; data_add_point (attr, &h->pos); } attr = new_attribute (obj_node, PROP_STDNAME_LINE_WIDTH); data_add_real (attr, comp->line_width); attr = new_attribute (obj_node, "line_color"); data_add_color (attr, &comp->line_color); }