void aadlbox_save(Aadlbox *aadlbox, ObjectNode obj_node, DiaContext *ctx) { int i; AttributeNode attr; DataNode composite; element_save(&aadlbox->element, obj_node, ctx); object_save_props(&aadlbox->element.object, obj_node, ctx); attr = new_attribute(obj_node, "aadlbox_ports"); for (i=0;i<aadlbox->num_ports;i++) { composite = data_add_composite(attr, "aadlport", ctx); data_add_point(composite_add_attribute(composite, "point"), &aadlbox->ports[i]->handle->pos, ctx); data_add_enum(composite_add_attribute(composite, "port_type"), aadlbox->ports[i]->type, ctx); data_add_string(composite_add_attribute(composite, "port_declaration"), aadlbox->ports[i]->declaration, ctx); } attr = new_attribute(obj_node, "aadlbox_connections"); for (i=0;i<aadlbox->num_connections;i++) { data_add_point(attr, &aadlbox->connections[i]->pos, ctx); } }
static void pointarrayprop_save(PointarrayProperty *prop, AttributeNode attr, DiaContext *ctx) { guint i; for (i = 0; i < prop->pointarray_data->len; i++) data_add_point(attr, &g_array_index(prop->pointarray_data,Point,i), ctx); }
static void constraint_save(Constraint *constraint, ObjectNode obj_node, const char *filename) { connection_save(&constraint->connection, obj_node); data_add_string(new_attribute(obj_node, "text"), constraint->text); data_add_point(new_attribute(obj_node, "text_pos"), &constraint->text_pos); }
static void message_save(Message *message, ObjectNode obj_node, const char *filename) { connection_save(&message->connection, obj_node); data_add_string(new_attribute(obj_node, "text"), message->text); data_add_point(new_attribute(obj_node, "text_pos"), &message->text_pos); data_add_int(new_attribute(obj_node, "type"), message->type); }
static void implements_save(Implements *implements, ObjectNode obj_node, const char *filename) { connection_save(&implements->connection, obj_node); data_add_real(new_attribute(obj_node, "diameter"), implements->circle_diameter); data_add_string(new_attribute(obj_node, "text"), implements->text); data_add_point(new_attribute(obj_node, "text_pos"), &implements->text_pos); }
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 bus_save(Bus *bus, ObjectNode obj_node, const char *filename) { int i; AttributeNode attr; connection_save(&bus->connection, obj_node); data_add_color( new_attribute(obj_node, "line_color"), &bus->line_color); attr = new_attribute(obj_node, "bus_handles"); for (i=0;i<bus->num_handles;i++) { data_add_point(attr, &bus->handles[i]->pos); } }
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); }
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); }
static void endpointsprop_save(EndpointsProperty *prop, AttributeNode attr, DiaContext *ctx) { data_add_point(attr, &prop->endpoints_data[0], ctx); data_add_point(attr, &prop->endpoints_data[1], ctx); }
static void pointprop_save(PointProperty *prop, AttributeNode attr, DiaContext *ctx) { data_add_point(attr, &prop->point_data, ctx); }