path: root/lib/dia_xml.h
diff options
authorHans Breuer <>2012-07-01 21:42:59 +0200
committerHans Breuer <>2012-07-21 18:01:56 +0200
commit7be2dcff8e3faf18f65d0bc563c07f4b919266de (patch)
treef60d58990caf198193f3762100e8a8d4fc0d39e7 /lib/dia_xml.h
parent6796a3ccdcab97560303f9ec3a14e4080059947d (diff)
Reduce GUI coupling by passing DiaContext* down to lib/objects/plug-ins
A lot of low level code was using message_warning() and friends. While convenient this had multiple issues: - message boxes were popped up asynchronous with the task - a single task could create multiple dialogs - the messages were loosing context (or did not gain it) - the classification had to be done by the callee (if it's an error, warning or info depends on the caller) - message_*() was also used for programmers errors ToDo: check all dia_context_release() to do sth useful with the content - decide between warning and error by return value of the function taking the context - maybe do some in display showing like gedit (for import & drop) convert also the save/export stuff to use DiaContext - finally activate autosave in thread - get rid of dia_message_filename() - get rid of strerror() use - it had utf-8 issues
Diffstat (limited to 'lib/dia_xml.h')
1 files changed, 16 insertions, 13 deletions
diff --git a/lib/dia_xml.h b/lib/dia_xml.h
index 8ba81356..d7a4b96e 100644
--- a/lib/dia_xml.h
+++ b/lib/dia_xml.h
@@ -23,6 +23,7 @@
#include "color.h"
#include "font.h"
#include "diavar.h"
+#include "diacontext.h"
#include <libxml/tree.h>
@@ -69,18 +70,18 @@ AttributeNode composite_find_attribute(DataNode composite_node,
int attribute_num_data(AttributeNode attribute);
DataNode attribute_first_data(AttributeNode attribute);
DataNode data_next(DataNode data);
-DataType data_type(DataNode data);
-int data_int(DataNode data);
-int data_enum(DataNode data);
-real data_real(DataNode data);
-int data_boolean(DataNode data);
-void data_color(DataNode data, Color *col);
-void data_point(DataNode data, Point *point);
-void data_bezpoint(DataNode data, BezPoint *point);
-void data_rectangle(DataNode data, Rectangle *rect);
-char *data_string(DataNode data);
-char *data_filename(DataNode data);
-DiaFont *data_font(DataNode data);
+DataType data_type(DataNode data, DiaContext *ctx);
+int data_int(DataNode data, DiaContext *ctx);
+int data_enum(DataNode data, DiaContext *ctx);
+real data_real(DataNode data, DiaContext *ctx);
+int data_boolean(DataNode data, DiaContext *ctx);
+void data_color(DataNode data, Color *col, DiaContext *ctx);
+void data_point(DataNode data, Point *point, DiaContext *ctx);
+void data_bezpoint(DataNode data, BezPoint *point, DiaContext *ctx);
+void data_rectangle(DataNode data, Rectangle *rect, DiaContext *ctx);
+char *data_string(DataNode data, DiaContext *ctx);
+char *data_filename(DataNode data, DiaContext *ctx);
+DiaFont *data_font(DataNode data, DiaContext *ctx);
AttributeNode new_attribute(ObjectNode obj_node, const char *attrname);
AttributeNode composite_add_attribute(DataNode composite_node,
@@ -99,7 +100,7 @@ void data_add_font(AttributeNode attr, const DiaFont *font);
DataNode data_add_composite(AttributeNode attr,
const char *type); /* can be NULL */
-GHashTable *data_dict (DataNode data);
+GHashTable *data_dict (DataNode data, DiaContext *ctx);
void data_add_dict (AttributeNode attr, GHashTable *data);
GdkPixbuf *data_pixbuf (DataNode data);
@@ -108,5 +109,7 @@ void data_add_pixbuf (AttributeNode attr, GdkPixbuf *pixbuf);
DiaMatrix *data_matrix(DataNode data);
void data_add_matrix(AttributeNode attr, DiaMatrix *matrix);
+xmlDocPtr diaXmlParseFile(const char *filename, DiaContext *ctx, gboolean try_harder);
#endif /* DIA_XML_H */