static void dictprop_save(DictProperty *prop, AttributeNode attr) { ObjectNode composite = data_add_composite(attr, "dict"); if (prop->dict) g_hash_table_foreach (prop->dict, _keyvalue_save, composite); }
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); } }
void uml_operation_write(AttributeNode attr_node, UMLOperation *op) { GList *list; UMLParameter *param; DataNode composite; DataNode composite2; AttributeNode attr_node2; composite = data_add_composite(attr_node, "umloperation"); data_add_string(composite_add_attribute(composite, "name"), op->name); data_add_string(composite_add_attribute(composite, "type"), op->type); data_add_enum(composite_add_attribute(composite, "visibility"), op->visibility); data_add_boolean(composite_add_attribute(composite, "abstract"), op->abstract); data_add_boolean(composite_add_attribute(composite, "class_scope"), op->class_scope); attr_node2 = composite_add_attribute(composite, "parameters"); list = op->parameters; while (list != NULL) { param = (UMLParameter *) list->data; composite2 = data_add_composite(attr_node2, "umlparameter"); data_add_string(composite_add_attribute(composite2, "name"), param->name); data_add_string(composite_add_attribute(composite2, "type"), param->type); data_add_string(composite_add_attribute(composite2, "value"), param->value); data_add_enum(composite_add_attribute(composite2, "kind"), param->kind); list = g_list_next(list); } }
void uml_formalparameter_write(AttributeNode attr_node, UMLFormalParameter *param) { DataNode composite; composite = data_add_composite(attr_node, "umlformalparameter"); data_add_string(composite_add_attribute(composite, "name"), param->name); data_add_string(composite_add_attribute(composite, "type"), param->type); }
void data_add_pixbuf (AttributeNode attr, GdkPixbuf *pixbuf) { ObjectNode composite = data_add_composite(attr, "pixbuf"); AttributeNode comp_attr = composite_add_attribute (composite, "data"); gchar *b64; b64 = pixbuf_encode_base64 (pixbuf); if (b64) (void)xmlNewChild (comp_attr, NULL, (const xmlChar *)"data", (xmlChar *)b64); g_free (b64); }
void uml_attribute_write(AttributeNode attr_node, UMLAttribute *attr) { DataNode composite; composite = data_add_composite(attr_node, "umlattribute"); data_add_string(composite_add_attribute(composite, "name"), attr->name); data_add_string(composite_add_attribute(composite, "type"), attr->type); data_add_string(composite_add_attribute(composite, "value"), attr->value); data_add_enum(composite_add_attribute(composite, "visibility"), attr->visibility); data_add_boolean(composite_add_attribute(composite, "abstract"), attr->abstract); data_add_boolean(composite_add_attribute(composite, "class_scope"), attr->class_scope); }
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); }