* lib/text.h: Added text_get_line() declaration
[dia.git] / lib / dia_xml.h
blob6c578dc8ca47624dc105dbbd2366f4659389af8a
1 /* dia -- an diagram creation/manipulation program
2 * Copyright (C) 1998 Alexander Larsson
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 #ifndef DIA_XML_H
19 #define DIA_XML_H
21 #include <glib.h>
22 #include "geometry.h"
23 #include "color.h"
24 #include "font.h"
25 #include "diavar.h"
26 #include <libxml/tree.h>
29 * Though the Dia homepage is now http://www.gnome.org/projects/dia
30 * Dia's xml namespace definition still needs to point to the
31 * original site. In fact the xml namespace definition has nothing to do
32 * with existing website, they just need to be unique to allow to
33 * differentiate between varying definitions. Changing the namespace
34 * from the old to the new site would strictly speaking break all
35 * older diagrams - although some tools may not take the actual
36 * key into account.
37 * See also : doc/diagram.dtd
39 #define DIA_XML_NAME_SPACE_BASE "http://www.lysator.liu.se/~alla/dia/"
41 DIAVAR int pretty_formated_xml;
43 typedef xmlNodePtr XML_NODE;
45 typedef XML_NODE ObjectNode;
46 typedef XML_NODE AttributeNode;
47 typedef XML_NODE DataNode;
49 typedef enum{
50 DATATYPE_COMPOSITE,
51 DATATYPE_INT,
52 DATATYPE_ENUM,
53 DATATYPE_REAL,
54 DATATYPE_BOOLEAN,
55 DATATYPE_COLOR,
56 DATATYPE_POINT,
57 DATATYPE_RECTANGLE,
58 DATATYPE_STRING,
59 DATATYPE_FONT
60 } DataType;
62 AttributeNode object_find_attribute(ObjectNode obj_node,
63 const char *attrname);
64 AttributeNode composite_find_attribute(DataNode composite_node,
65 const char *attrname);
66 int attribute_num_data(AttributeNode attribute);
67 DataNode attribute_first_data(AttributeNode attribute);
68 DataNode data_next(DataNode data);
69 DataType data_type(DataNode data);
70 int data_int(DataNode data);
71 int data_enum(DataNode data);
72 real data_real(DataNode data);
73 int data_boolean(DataNode data);
74 void data_color(DataNode data, Color *col);
75 void data_point(DataNode data, Point *point);
76 void data_rectangle(DataNode data, Rectangle *rect);
77 char *data_string(DataNode data);
78 char *data_filename(DataNode data);
79 DiaFont *data_font(DataNode data);
81 AttributeNode new_attribute(ObjectNode obj_node, const char *attrname);
82 AttributeNode composite_add_attribute(DataNode composite_node,
83 const char *attrname);
84 void data_add_int(AttributeNode attr, int data);
85 void data_add_enum(AttributeNode attr, int data);
86 void data_add_real(AttributeNode attr, real data);
87 void data_add_boolean(AttributeNode attr, int data);
88 void data_add_color(AttributeNode attr, const Color *col);
89 void data_add_point(AttributeNode attr, const Point *point);
90 void data_add_rectangle(AttributeNode attr, const Rectangle *rect);
91 void data_add_string(AttributeNode attr, const char *str);
92 void data_add_filename(AttributeNode attr, const char *str);
93 void data_add_font(AttributeNode attr, const DiaFont *font);
94 DataNode data_add_composite(AttributeNode attr,
95 const char *type); /* can be NULL */
97 #endif /* DIA_XML_H */