From cba39e6ae22742514a61a6c822d26f83613e45a7 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Sun, 23 Oct 2005 02:06:00 +0000 Subject: [PATCH] 2005-10-22 Jim Evins * libglabels/xml-paper.c: * libglabels/xml-template.c: * libglabels/xml.c: * src/base64.c: * src/bc-gnubarcode.c: * src/canvas-hacktext.c: * src/label-text.c: * src/object-editor-data-page.c: * src/print-dialog.c: * src/print.c: * src/recent.c: * src/template-designer.c: * src/text-node.c: * src/ui-property-bar.c: * src/ui.c: * src/view-barcode.c: * src/view-box.c: * src/view-ellipse.c: * src/view-image.c: * src/view-line.c: * src/view-text.c: * src/view.c: * src/wdgt-media-select.c: * src/xml-label-04.c: * src/xml-label-191.c: * src/xml-label.c: Modified to compile warning free with gcc-4.0. Mostly casting to change signedness of characters. Did not attack gnu-barcode library yet. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@553 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/ChangeLog | 32 ++++ glabels2/libglabels/xml-paper.c | 16 +- glabels2/libglabels/xml-template.c | 138 ++++++++-------- glabels2/libglabels/xml.c | 49 +++--- glabels2/src/base64.c | 2 +- glabels2/src/bc-gnubarcode.c | 2 +- glabels2/src/canvas-hacktext.c | 7 +- glabels2/src/label-text.c | 4 +- glabels2/src/object-editor-data-page.c | 1 + glabels2/src/print-dialog.c | 4 +- glabels2/src/print.c | 57 +++---- glabels2/src/recent.c | 2 + glabels2/src/template-designer.c | 3 +- glabels2/src/text-node.c | 2 + glabels2/src/ui-property-bar.c | 1 + glabels2/src/ui.c | 1 + glabels2/src/view-barcode.c | 32 ++-- glabels2/src/view-box.c | 4 +- glabels2/src/view-ellipse.c | 4 +- glabels2/src/view-image.c | 4 +- glabels2/src/view-line.c | 4 +- glabels2/src/view-text.c | 14 +- glabels2/src/view.c | 6 +- glabels2/src/wdgt-media-select.c | 1 + glabels2/src/xml-label-04.c | 56 +++---- glabels2/src/xml-label-191.c | 132 +++++++-------- glabels2/src/xml-label.c | 212 +++++++++++++------------ 27 files changed, 421 insertions(+), 369 deletions(-) diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index b19ea71b..8f9ccd7b 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,35 @@ +2005-10-22 Jim Evins + + * libglabels/xml-paper.c: + * libglabels/xml-template.c: + * libglabels/xml.c: + * src/base64.c: + * src/bc-gnubarcode.c: + * src/canvas-hacktext.c: + * src/label-text.c: + * src/object-editor-data-page.c: + * src/print-dialog.c: + * src/print.c: + * src/recent.c: + * src/template-designer.c: + * src/text-node.c: + * src/ui-property-bar.c: + * src/ui.c: + * src/view-barcode.c: + * src/view-box.c: + * src/view-ellipse.c: + * src/view-image.c: + * src/view-line.c: + * src/view-text.c: + * src/view.c: + * src/wdgt-media-select.c: + * src/xml-label-04.c: + * src/xml-label-191.c: + * src/xml-label.c: + Modified to compile warning free with gcc-4.0. Mostly + casting to change signedness of characters. Did not + attack gnu-barcode library yet. + 2005-10-22 Jim Evins * src/glabels.c: (main): diff --git a/glabels2/libglabels/xml-paper.c b/glabels2/libglabels/xml-paper.c index a2878840..894349a6 100644 --- a/glabels2/libglabels/xml-paper.c +++ b/glabels2/libglabels/xml-paper.c @@ -113,7 +113,7 @@ gl_xml_paper_parse_papers_doc (xmlDocPtr papers_doc) xmlFreeDoc (papers_doc); return papers; } - if (!xmlStrEqual (root->name, "Glabels-paper-sizes")) { + if (!xmlStrEqual (root->name, (xmlChar *)"Glabels-paper-sizes")) { g_warning ("\"%s\" is not a glabels paper file (wrong root node)", papers_doc->name); xmlFreeDoc (papers_doc); @@ -122,12 +122,12 @@ gl_xml_paper_parse_papers_doc (xmlDocPtr papers_doc) for (node = root->xmlChildrenNode; node != NULL; node = node->next) { - if (xmlStrEqual (node->name, "Paper-size")) { + if (xmlStrEqual (node->name, (xmlChar *)"Paper-size")) { paper = gl_xml_paper_parse_paper_node (node); papers = g_list_append (papers, paper); } else { if ( !xmlNodeIsText(node) ) { - if (!xmlStrEqual (node->name,"comment")) { + if (!xmlStrEqual (node->name,(xmlChar *)"comment")) { g_warning ("bad node = \"%s\"",node->name); } } @@ -156,12 +156,12 @@ gl_xml_paper_parse_paper_node (xmlNodePtr paper_node) LIBXML_TEST_VERSION; - id = xmlGetProp (paper_node, "id"); + id = xmlGetProp (paper_node, (xmlChar *)"id"); - name = xmlGetProp (paper_node, "_name"); + name = xmlGetProp (paper_node, (xmlChar *)"_name"); if (name != NULL) { - xmlChar *tmp = gettext (name); + xmlChar *tmp = (xmlChar *)gettext ((char *)name); if (tmp != name) { xmlFree (name); @@ -169,13 +169,13 @@ gl_xml_paper_parse_paper_node (xmlNodePtr paper_node) } } else { - name = xmlGetProp (paper_node, "name"); + name = xmlGetProp (paper_node, (xmlChar *)"name"); } width = gl_xml_get_prop_length (paper_node, "width", 0); height = gl_xml_get_prop_length (paper_node, "height", 0); - paper = gl_paper_new (id, name, width, height); + paper = gl_paper_new ((gchar *)id, (gchar *)name, width, height); xmlFree (id); xmlFree (name); diff --git a/glabels2/libglabels/xml-template.c b/glabels2/libglabels/xml-template.c index 4711c4eb..8994c19c 100644 --- a/glabels2/libglabels/xml-template.c +++ b/glabels2/libglabels/xml-template.c @@ -149,7 +149,7 @@ gl_xml_template_parse_templates_doc (const xmlDocPtr templates_doc) templates_doc->URL); return templates; } - if (!xmlStrEqual (root->name, "Glabels-templates")) { + if (!xmlStrEqual (root->name, (xmlChar *)"Glabels-templates")) { g_warning ("\"%s\" is not a glabels template file (wrong root node)", templates_doc->URL); return templates; @@ -157,12 +157,12 @@ gl_xml_template_parse_templates_doc (const xmlDocPtr templates_doc) for (node = root->xmlChildrenNode; node != NULL; node = node->next) { - if (xmlStrEqual (node->name, "Template")) { + if (xmlStrEqual (node->name, (xmlChar *)"Template")) { template = gl_xml_template_parse_template_node (node); templates = g_list_append (templates, template); } else { if ( !xmlNodeIsText(node) ) { - if (!xmlStrEqual (node->name,"comment")) { + if (!xmlStrEqual (node->name,(xmlChar *)"comment")) { g_warning ("bad node = \"%s\"",node->name); } } @@ -193,12 +193,12 @@ gl_xml_template_parse_template_node (const xmlNodePtr template_node) glTemplate *template; xmlNodePtr node; - name = xmlGetProp (template_node, "name"); + name = xmlGetProp (template_node, (xmlChar *)"name"); - description = xmlGetProp (template_node, "_description"); + description = xmlGetProp (template_node, (xmlChar *)"_description"); if (description != NULL) { - xmlChar *tmp = gettext (description); + xmlChar *tmp = (xmlChar *)gettext ((char *)description); if (tmp != description) { xmlFree (description); @@ -206,25 +206,25 @@ gl_xml_template_parse_template_node (const xmlNodePtr template_node) } } else { - description = xmlGetProp (template_node, "description"); + description = xmlGetProp (template_node, (xmlChar *)"description"); } - page_size = xmlGetProp (template_node, "size"); - if (gl_paper_is_id_other (page_size)) { + page_size = xmlGetProp (template_node, (xmlChar *)"size"); + if (gl_paper_is_id_other ((gchar *)page_size)) { page_width = gl_xml_get_prop_length (template_node, "width", 0); page_height = gl_xml_get_prop_length (template_node, "height", 0); } else { - paper = gl_paper_from_id (page_size); + paper = gl_paper_from_id ((gchar *)page_size); if (paper == NULL) { /* This should always be an id, but just in case a name slips by! */ g_warning (_("Unknown page size id \"%s\", trying as name"), page_size); - paper = gl_paper_from_name (page_size); + paper = gl_paper_from_name ((gchar *)page_size); xmlFree (page_size); - page_size = xmlStrdup (paper->id); + page_size = xmlStrdup ((xmlChar *)paper->id); } if (paper != NULL) { page_width = paper->width; @@ -237,24 +237,24 @@ gl_xml_template_parse_template_node (const xmlNodePtr template_node) paper = NULL; } - template = gl_template_new (name, - description, - page_size, + template = gl_template_new ((gchar *)name, + (gchar *)description, + (gchar *)page_size, page_width, page_height); for (node = template_node->xmlChildrenNode; node != NULL; node = node->next) { - if (xmlStrEqual (node->name, "Label-rectangle")) { + if (xmlStrEqual (node->name, (xmlChar *)"Label-rectangle")) { xml_parse_label_rectangle_node (node, template); - } else if (xmlStrEqual (node->name, "Label-round")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Label-round")) { xml_parse_label_round_node (node, template); - } else if (xmlStrEqual (node->name, "Label-cd")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Label-cd")) { xml_parse_label_cd_node (node, template); - } else if (xmlStrEqual (node->name, "Alias")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Alias")) { xml_parse_alias_node (node, template); } else { if (!xmlNodeIsText (node)) { - if (!xmlStrEqual (node->name,"comment")) { + if (!xmlStrEqual (node->name,(xmlChar *)"comment")) { g_warning ("bad node = \"%s\"",node->name); } } @@ -282,9 +282,9 @@ xml_parse_label_rectangle_node (xmlNodePtr label_node, glTemplateLabelType *label_type; xmlNodePtr node; - id = xmlGetProp (label_node, "id"); + id = xmlGetProp (label_node, (xmlChar *)"id"); - if (tmp = xmlGetProp (label_node, "waste")) { + if (tmp = xmlGetProp (label_node, (xmlChar *)"waste")) { /* Handle single "waste" property. */ x_waste = y_waste = gl_xml_get_prop_length (label_node, "waste", 0); xmlFree (tmp); @@ -297,21 +297,21 @@ xml_parse_label_rectangle_node (xmlNodePtr label_node, h = gl_xml_get_prop_length (label_node, "height", 0); r = gl_xml_get_prop_length (label_node, "round", 0); - label_type = gl_template_rect_label_type_new (id, w, h, r, x_waste, y_waste); + label_type = gl_template_rect_label_type_new ((gchar *)id, w, h, r, x_waste, y_waste); gl_template_add_label_type (template, label_type); for (node = label_node->xmlChildrenNode; node != NULL; node = node->next) { - if (xmlStrEqual (node->name, "Layout")) { + if (xmlStrEqual (node->name, (xmlChar *)"Layout")) { xml_parse_layout_node (node, label_type); - } else if (xmlStrEqual (node->name, "Markup-margin")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Markup-margin")) { xml_parse_markup_margin_node (node, label_type); - } else if (xmlStrEqual (node->name, "Markup-line")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Markup-line")) { xml_parse_markup_line_node (node, label_type); - } else if (xmlStrEqual (node->name, "Markup-circle")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Markup-circle")) { xml_parse_markup_circle_node (node, label_type); } else if (!xmlNodeIsText (node)) { - if (!xmlStrEqual (node->name,"comment")) { + if (!xmlStrEqual (node->name, (xmlChar *)"comment")) { g_warning ("bad node = \"%s\"",node->name); } } @@ -333,25 +333,25 @@ xml_parse_label_round_node (xmlNodePtr label_node, glTemplateLabelType *label_type; xmlNodePtr node; - id = xmlGetProp (label_node, "id"); + id = xmlGetProp (label_node, (xmlChar *)"id"); waste = gl_xml_get_prop_length (label_node, "waste", 0); r = gl_xml_get_prop_length (label_node, "radius", 0); - label_type = gl_template_round_label_type_new (id, r, waste); + label_type = gl_template_round_label_type_new ((gchar *)id, r, waste); gl_template_add_label_type (template, label_type); for (node = label_node->xmlChildrenNode; node != NULL; node = node->next) { - if (xmlStrEqual (node->name, "Layout")) { + if (xmlStrEqual (node->name, (xmlChar *)"Layout")) { xml_parse_layout_node (node, label_type); - } else if (xmlStrEqual (node->name, "Markup-margin")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Markup-margin")) { xml_parse_markup_margin_node (node, label_type); - } else if (xmlStrEqual (node->name, "Markup-line")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Markup-line")) { xml_parse_markup_line_node (node, label_type); - } else if (xmlStrEqual (node->name, "Markup-circle")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Markup-circle")) { xml_parse_markup_circle_node (node, label_type); } else if (!xmlNodeIsText (node)) { - if (!xmlStrEqual (node->name,"comment")) { + if (!xmlStrEqual (node->name, (xmlChar *)"comment")) { g_warning ("bad node = \"%s\"",node->name); } } @@ -373,28 +373,28 @@ xml_parse_label_cd_node (xmlNodePtr label_node, glTemplateLabelType *label_type; xmlNodePtr node; - id = xmlGetProp (label_node, "id"); + id = xmlGetProp (label_node, (xmlChar *)"id"); waste = gl_xml_get_prop_length (label_node, "waste", 0); r1 = gl_xml_get_prop_length (label_node, "radius", 0); r2 = gl_xml_get_prop_length (label_node, "hole", 0); w = gl_xml_get_prop_length (label_node, "width", 0); h = gl_xml_get_prop_length (label_node, "height", 0); - label_type = gl_template_cd_label_type_new (id, r1, r2, w, h, waste); + label_type = gl_template_cd_label_type_new ((gchar *)id, r1, r2, w, h, waste); gl_template_add_label_type (template, label_type); for (node = label_node->xmlChildrenNode; node != NULL; node = node->next) { - if (xmlStrEqual (node->name, "Layout")) { + if (xmlStrEqual (node->name, (xmlChar *)"Layout")) { xml_parse_layout_node (node, label_type); - } else if (xmlStrEqual (node->name, "Markup-margin")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Markup-margin")) { xml_parse_markup_margin_node (node, label_type); - } else if (xmlStrEqual (node->name, "Markup-line")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Markup-line")) { xml_parse_markup_line_node (node, label_type); - } else if (xmlStrEqual (node->name, "Markup-circle")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Markup-circle")) { xml_parse_markup_circle_node (node, label_type); } else if (!xmlNodeIsText (node)) { - if (!xmlStrEqual (node->name,"comment")) { + if (!xmlStrEqual (node->name, (xmlChar *)"comment")) { g_warning ("bad node = \"%s\"",node->name); } } @@ -429,7 +429,7 @@ xml_parse_layout_node (xmlNodePtr layout_node, for (node = layout_node->xmlChildrenNode; node != NULL; node = node->next) { if (!xmlNodeIsText (node)) { - if (!xmlStrEqual (node->name,"comment")) { + if (!xmlStrEqual (node->name, (xmlChar *)"comment")) { g_warning ("bad node = \"%s\"",node->name); } } @@ -455,7 +455,7 @@ xml_parse_markup_margin_node (xmlNodePtr markup_node, for (node = markup_node->xmlChildrenNode; node != NULL; node = node->next) { if (!xmlNodeIsText (node)) { - if (!xmlStrEqual (node->name,"comment")) { + if (!xmlStrEqual (node->name, (xmlChar *)"comment")) { g_warning ("bad node = \"%s\"",node->name); } } @@ -484,7 +484,7 @@ xml_parse_markup_line_node (xmlNodePtr markup_node, for (node = markup_node->xmlChildrenNode; node != NULL; node = node->next) { if (!xmlNodeIsText (node)) { - if (!xmlStrEqual (node->name,"comment")) { + if (!xmlStrEqual (node->name, (xmlChar *)"comment")) { g_warning ("bad node = \"%s\"",node->name); } } @@ -512,7 +512,7 @@ xml_parse_markup_circle_node (xmlNodePtr markup_node, for (node = markup_node->xmlChildrenNode; node != NULL; node = node->next) { if (!xmlNodeIsText (node)) { - if (!xmlStrEqual (node->name,"comment")) { + if (!xmlStrEqual (node->name, (xmlChar *)"comment")) { g_warning ("bad node = \"%s\"",node->name); } } @@ -529,9 +529,9 @@ xml_parse_alias_node (xmlNodePtr alias_node, { xmlChar *name; - name = xmlGetProp (alias_node, "name"); + name = xmlGetProp (alias_node, (xmlChar *)"name"); - gl_template_add_alias (template, name); + gl_template_add_alias (template, (gchar *)name); xmlFree (name); } @@ -555,10 +555,10 @@ gl_xml_template_write_templates_to_file (GList *templates, glTemplate *template; gchar *filename; - doc = xmlNewDoc ("1.0"); - doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Glabels-templates", NULL); + doc = xmlNewDoc ((xmlChar *)"1.0"); + doc->xmlRootNode = xmlNewDocNode (doc, NULL, (xmlChar *)"Glabels-templates", NULL); - ns = xmlNewNs (doc->xmlRootNode, GL_XML_NAME_SPACE, NULL); + ns = xmlNewNs (doc->xmlRootNode, (xmlChar *)GL_XML_NAME_SPACE, NULL); xmlSetNs (doc->xmlRootNode, ns); for (p=templates; p!=NULL; p=p->next) { @@ -624,19 +624,19 @@ gl_xml_template_create_template_node (const glTemplate *template, GList *p; glTemplateLabelType *label_type; - node = xmlNewChild (root, ns, "Template", NULL); + node = xmlNewChild (root, ns, (xmlChar *)"Template", NULL); - xmlSetProp (node, "name", template->name); + xmlSetProp (node, (xmlChar *)"name", (xmlChar *)template->name); - xmlSetProp (node, "size", template->page_size); - if (xmlStrEqual (template->page_size, "Other")) { + xmlSetProp (node, (xmlChar *)"size", (xmlChar *)template->page_size); + if (xmlStrEqual ((xmlChar *)template->page_size, (xmlChar *)"Other")) { gl_xml_set_prop_length (node, "width", template->page_width); gl_xml_set_prop_length (node, "height", template->page_height); } - xmlSetProp (node, "description", template->description); + xmlSetProp (node, (xmlChar *)"description", (xmlChar *)template->description); for ( p=template->label_types; p != NULL; p=p->next ) { label_type = (glTemplateLabelType *)p->data; @@ -644,7 +644,7 @@ gl_xml_template_create_template_node (const glTemplate *template, } for ( p=template->aliases; p != NULL; p=p->next ) { - if (!xmlStrEqual (template->name, p->data)) { + if (!xmlStrEqual ((xmlChar *)template->name, (xmlChar *)p->data)) { xml_create_alias_node ( p->data, node, ns ); } } @@ -667,8 +667,8 @@ xml_create_label_node (const glTemplateLabelType *label_type, switch (label_type->shape) { case GL_TEMPLATE_SHAPE_RECT: - node = xmlNewChild(root, ns, "Label-rectangle", NULL); - xmlSetProp (node, "id", label_type->id); + node = xmlNewChild(root, ns, (xmlChar *)"Label-rectangle", NULL); + xmlSetProp (node, (xmlChar *)"id", (xmlChar *)label_type->id); gl_xml_set_prop_length (node, "width", label_type->size.rect.w); gl_xml_set_prop_length (node, "height", label_type->size.rect.h); gl_xml_set_prop_length (node, "round", label_type->size.rect.r); @@ -677,15 +677,15 @@ xml_create_label_node (const glTemplateLabelType *label_type, break; case GL_TEMPLATE_SHAPE_ROUND: - node = xmlNewChild(root, ns, "Label-round", NULL); - xmlSetProp (node, "id", label_type->id); + node = xmlNewChild(root, ns, (xmlChar *)"Label-round", NULL); + xmlSetProp (node, (xmlChar *)"id", (xmlChar *)label_type->id); gl_xml_set_prop_length (node, "radius", label_type->size.round.r); gl_xml_set_prop_length (node, "waste", label_type->size.round.waste); break; case GL_TEMPLATE_SHAPE_CD: - node = xmlNewChild(root, ns, "Label-cd", NULL); - xmlSetProp (node, "id", label_type->id); + node = xmlNewChild(root, ns, (xmlChar *)"Label-cd", NULL); + xmlSetProp (node, (xmlChar *)"id", (xmlChar *)label_type->id); gl_xml_set_prop_length (node, "radius", label_type->size.cd.r1); gl_xml_set_prop_length (node, "hole", label_type->size.cd.r2); if (label_type->size.cd.w != 0.0) { @@ -739,7 +739,7 @@ xml_create_layout_node (const glTemplateLayout *layout, { xmlNodePtr node; - node = xmlNewChild(root, ns, "Layout", NULL); + node = xmlNewChild(root, ns, (xmlChar *)"Layout", NULL); gl_xml_set_prop_int (node, "nx", layout->nx); gl_xml_set_prop_int (node, "ny", layout->ny); gl_xml_set_prop_length (node, "x0", layout->x0); @@ -759,7 +759,7 @@ xml_create_markup_margin_node (const glTemplateMarkup *markup, { xmlNodePtr node; - node = xmlNewChild(root, ns, "Markup-margin", NULL); + node = xmlNewChild(root, ns, (xmlChar *)"Markup-margin", NULL); gl_xml_set_prop_length (node, "size", markup->data.margin.size); @@ -775,7 +775,7 @@ xml_create_markup_line_node (const glTemplateMarkup *markup, { xmlNodePtr node; - node = xmlNewChild(root, ns, "Markup-line", NULL); + node = xmlNewChild(root, ns, (xmlChar *)"Markup-line", NULL); gl_xml_set_prop_length (node, "x1", markup->data.line.x1); gl_xml_set_prop_length (node, "y1", markup->data.line.y1); @@ -794,7 +794,7 @@ xml_create_markup_circle_node (const glTemplateMarkup *markup, { xmlNodePtr node; - node = xmlNewChild(root, ns, "Markup-circle", NULL); + node = xmlNewChild(root, ns, (xmlChar *)"Markup-circle", NULL); gl_xml_set_prop_length (node, "x0", markup->data.circle.x0); gl_xml_set_prop_length (node, "y0", markup->data.circle.y0); @@ -812,8 +812,8 @@ xml_create_alias_node (const gchar *name, { xmlNodePtr node; - node = xmlNewChild (root, ns, "Alias", NULL); - xmlSetProp (node, "name", name); + node = xmlNewChild (root, ns, (xmlChar *)"Alias", NULL); + xmlSetProp (node, (xmlChar *)"name", (xmlChar *)name); } diff --git a/glabels2/libglabels/xml.c b/glabels2/libglabels/xml.c index d69a048b..d7a876a3 100644 --- a/glabels2/libglabels/xml.c +++ b/glabels2/libglabels/xml.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "libglabels-private.h" @@ -48,7 +49,7 @@ /*========================================================*/ typedef struct { - gchar *name; + xmlChar *name; gdouble points_per_unit; } UnitTableEntry; @@ -63,11 +64,11 @@ static UnitTableEntry unit_table[] = { /* This table must be sorted exactly as the enumerations in glUnitsType */ - /* [GL_UNITS_POINT] */ {"pt", POINTS_PER_POINT}, - /* [GL_UNITS_INCH] */ {"in", POINTS_PER_INCH}, - /* [GL_UNITS_MM] */ {"mm", POINTS_PER_MM}, - /* [GL_UNITS_CM] */ {"cm", POINTS_PER_CM}, - /* [GL_UNITS_PICA] */ {"pc", POINTS_PER_PICA}, + /* [GL_UNITS_POINT] */ {(xmlChar *)"pt", POINTS_PER_POINT}, + /* [GL_UNITS_INCH] */ {(xmlChar *)"in", POINTS_PER_INCH}, + /* [GL_UNITS_MM] */ {(xmlChar *)"mm", POINTS_PER_MM}, + /* [GL_UNITS_CM] */ {(xmlChar *)"cm", POINTS_PER_CM}, + /* [GL_UNITS_PICA] */ {(xmlChar *)"pc", POINTS_PER_PICA}, }; @@ -95,9 +96,9 @@ gl_xml_get_prop_double (xmlNodePtr node, gdouble val; xmlChar *string; - string = xmlGetProp (node, property); + string = xmlGetProp (node, (xmlChar *)property); if ( string != NULL ) { - val = g_strtod (string, NULL); + val = g_strtod ((gchar *)string, NULL); xmlFree (string); return val; } @@ -125,10 +126,10 @@ gl_xml_get_prop_boolean (xmlNodePtr node, gboolean val; xmlChar *string; - string = xmlGetProp (node, property); + string = xmlGetProp (node, (xmlChar *)property); if ( string != NULL ) { - val = !((xmlStrcasecmp (string, "false") == 0) || - xmlStrEqual (string, "0"));; + val = !((xmlStrcasecmp (string, (xmlChar *)"false") == 0) || + xmlStrEqual (string, (xmlChar *)"0"));; xmlFree (string); return val; } @@ -156,9 +157,9 @@ gl_xml_get_prop_int (xmlNodePtr node, gint val; xmlChar *string; - string = xmlGetProp (node, property); + string = xmlGetProp (node, (xmlChar *)property); if ( string != NULL ) { - val = strtol (string, NULL, 0); + val = strtol ((char *)string, NULL, 0); xmlFree (string); return val; } @@ -186,9 +187,9 @@ gl_xml_get_prop_uint (xmlNodePtr node, guint val; xmlChar *string; - string = xmlGetProp (node, property); + string = xmlGetProp (node, (xmlChar *)property); if ( string != NULL ) { - val = strtoul (string, NULL, 0); + val = strtoul ((char *)string, NULL, 0); xmlFree (string); return val; } @@ -223,14 +224,14 @@ gl_xml_get_prop_length (xmlNodePtr node, xmlChar *unit; gint i; - string = xmlGetProp (node, property); + string = xmlGetProp (node, (xmlChar *)property); if ( string != NULL ) { - val = g_strtod (string, (gchar **)&unit); + val = g_strtod ((gchar *)string, (gchar **)&unit); if (unit != string) { - unit = g_strchug (unit); - if (strlen (unit) > 0 ) { + unit = (xmlChar *)g_strchug ((gchar *)unit); + if (strlen ((char *)unit) > 0 ) { for (i=GL_UNITS_FIRST; i<=GL_UNITS_LAST; i++) { if (xmlStrcasecmp (unit, unit_table[i].name) == 0) { val *= unit_table[i].points_per_unit; @@ -275,7 +276,7 @@ gl_xml_set_prop_double (xmlNodePtr node, /* Guarantee "C" locale by use of g_ascii_formatd */ string = g_ascii_formatd (buffer, G_ASCII_DTOSTR_BUF_SIZE, "%g", val); - xmlSetProp (node, property, string); + xmlSetProp (node, (xmlChar *)property, (xmlChar *)string); } @@ -293,7 +294,7 @@ gl_xml_set_prop_boolean (xmlNodePtr node, const gchar *property, gboolean val) { - xmlSetProp (node, property, (val ? "True" : "False")); + xmlSetProp (node, (xmlChar *)property, (xmlChar *)(val ? "True" : "False")); } /** @@ -313,7 +314,7 @@ gl_xml_set_prop_int (xmlNodePtr node, gchar *string; string = g_strdup_printf ("%d", val); - xmlSetProp (node, property, string); + xmlSetProp (node, (xmlChar *)property, (xmlChar *)string); g_free (string); } @@ -334,7 +335,7 @@ gl_xml_set_prop_uint_hex (xmlNodePtr node, gchar *string; string = g_strdup_printf ("0x%08x", val); - xmlSetProp (node, property, string); + xmlSetProp (node, (xmlChar *)property, (xmlChar *)string); g_free (string); } @@ -365,7 +366,7 @@ gl_xml_set_prop_length (xmlNodePtr node, string = g_ascii_formatd (buffer, G_ASCII_DTOSTR_BUF_SIZE, "%g", val); string_unit = g_strdup_printf ("%s%s", string, unit_table[default_units].name); - xmlSetProp (node, property, string_unit); + xmlSetProp (node, (xmlChar *)property, (xmlChar *)string_unit); g_free (string_unit); } diff --git a/glabels2/src/base64.c b/glabels2/src/base64.c index c8de307e..f2927908 100644 --- a/glabels2/src/base64.c +++ b/glabels2/src/base64.c @@ -196,6 +196,6 @@ gl_base64_decode (const gchar *in, guint *outlen) } while (*in && digit4 != '='); - return out; + return (guchar *)out; } diff --git a/glabels2/src/bc-gnubarcode.c b/glabels2/src/bc-gnubarcode.c index 7491b2aa..b2da4231 100644 --- a/glabels2/src/bc-gnubarcode.c +++ b/glabels2/src/bc-gnubarcode.c @@ -230,7 +230,7 @@ render_pass1 (struct Barcode_Item *bci, gdouble f1, f2; gint mode = '-'; /* text below bars */ gdouble x0, y0, yr; - guchar *p, c; + gchar *p, c; if (bci->width > (2*bci->margin)) { bci->width -= 2*bci->margin; diff --git a/glabels2/src/canvas-hacktext.c b/glabels2/src/canvas-hacktext.c index bf45da08..4c5d21c2 100644 --- a/glabels2/src/canvas-hacktext.c +++ b/glabels2/src/canvas-hacktext.c @@ -448,9 +448,10 @@ gl_canvas_hacktext_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_p if (!hacktext->priv->font) return; - hacktext->priv->glyphlist = gnome_glyphlist_from_text_dumb (hacktext->priv->font, hacktext->fill_rgba, - 0.0, 0.0, - hacktext->text); + hacktext->priv->glyphlist = gnome_glyphlist_from_text_dumb ( + hacktext->priv->font, hacktext->fill_rgba, + 0.0, 0.0, + (guchar *)hacktext->text); } if (hacktext->priv->glyphlist) { diff --git a/glabels2/src/label-text.c b/glabels2/src/label-text.c index e03783b6..9d4cdd29 100644 --- a/glabels2/src/label-text.c +++ b/glabels2/src/label-text.c @@ -373,7 +373,7 @@ get_size (glLabelObject *object, } font = gnome_font_find_closest_from_weight_slant ( - ltext->private->font_family, + (guchar *)ltext->private->font_family, ltext->private->font_weight, ltext->private->font_italic_flag, ltext->private->font_size); @@ -392,7 +392,7 @@ get_size (glLabelObject *object, glyphlist = gnome_glyphlist_from_text_dumb (font, 0, 0.0, 0.0, - line[i]); + (guchar *)line[i]); gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox); diff --git a/glabels2/src/object-editor-data-page.c b/glabels2/src/object-editor-data-page.c index 24b7e523..0cc62916 100644 --- a/glabels2/src/object-editor-data-page.c +++ b/glabels2/src/object-editor-data-page.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include "prefs.h" diff --git a/glabels2/src/print-dialog.c b/glabels2/src/print-dialog.c index f9a940c6..1b574c1e 100644 --- a/glabels2/src/print-dialog.c +++ b/glabels2/src/print-dialog.c @@ -558,7 +558,7 @@ print_sheets (GnomePrintConfig *config, if (preview_flag) { GtkWidget *preview_widget = - gnome_print_job_preview_new (job, _("Print preview")); + gnome_print_job_preview_new (job, (guchar *)_("Print preview")); gtk_widget_show (GTK_WIDGET (preview_widget)); } else { gnome_print_job_print (job); @@ -597,7 +597,7 @@ print_sheets_merge (GnomePrintConfig *config, if (preview_flag) { GtkWidget *preview_widget = - gnome_print_job_preview_new (job, _("Print preview")); + gnome_print_job_preview_new (job, (guchar *)_("Print preview")); gtk_widget_show (GTK_WIDGET (preview_widget)); } else { gnome_print_job_print (job); diff --git a/glabels2/src/print.c b/glabels2/src/print.c index 83f5599a..0ef01675 100644 --- a/glabels2/src/print.c +++ b/glabels2/src/print.c @@ -428,11 +428,11 @@ print_info_new (GnomePrintJob *job, "setting page size = \"%s\"", template->page_size); gnome_print_config_set_length (pi->config, - GNOME_PRINT_KEY_PAPER_WIDTH, + (guchar *)GNOME_PRINT_KEY_PAPER_WIDTH, template->page_width, GNOME_PRINT_PS_UNIT); gnome_print_config_set_length (pi->config, - GNOME_PRINT_KEY_PAPER_HEIGHT, + (guchar *)GNOME_PRINT_KEY_PAPER_HEIGHT, template->page_height, GNOME_PRINT_PS_UNIT); @@ -481,7 +481,7 @@ print_page_begin (PrintInfo *pi) pi->sheet++; str = g_strdup_printf ("sheet%02d", pi->sheet); - gnome_print_beginpage (pi->pc, str); + gnome_print_beginpage (pi->pc, (guchar *)str); g_free (str); /* Translate and scale, so that our origin is at the upper left. */ @@ -775,14 +775,16 @@ draw_text_object (PrintInfo *pi, /* auto shrink text size to keep within text box limits. */ for (i = 0; line[i] != NULL; i++) { - font = gnome_font_find_closest_from_weight_slant (font_family, - font_weight, - font_italic_flag, - font_size); - glyphlist = gnome_glyphlist_from_text_dumb (font, - color, - 0.0, 0.0, - line[i]); + font = gnome_font_find_closest_from_weight_slant ( + (guchar *)font_family, + font_weight, + font_italic_flag, + font_size); + glyphlist = gnome_glyphlist_from_text_dumb ( + font, + color, + 0.0, 0.0, + (guchar *)line[i]); gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox); w = bbox.x1; gnome_glyphlist_unref (glyphlist); @@ -795,14 +797,15 @@ draw_text_object (PrintInfo *pi, font_size -= 0.5; font = gnome_font_find_closest_from_weight_slant ( - font_family, + (guchar *)font_family, font_weight, font_italic_flag, font_size); - glyphlist = gnome_glyphlist_from_text_dumb (font, - color, - 0.0, 0.0, - line[i]); + glyphlist = gnome_glyphlist_from_text_dumb ( + font, + color, + 0.0, 0.0, + (guchar *)line[i]); gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox); w = bbox.x1; gnome_glyphlist_unref (glyphlist); @@ -812,7 +815,7 @@ draw_text_object (PrintInfo *pi, } font = gnome_font_find_closest_from_weight_slant ( - font_family, + (guchar *)font_family, font_weight, font_italic_flag, font_size); @@ -828,7 +831,7 @@ draw_text_object (PrintInfo *pi, glyphlist = gnome_glyphlist_from_text_dumb (font, color, 0.0, 0.0, - line[i]); + (guchar *)line[i]); gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox); w = bbox.x1; @@ -862,7 +865,7 @@ draw_text_object (PrintInfo *pi, gnome_print_gsave (pi->pc); gnome_print_scale (pi->pc, 1.0, -1.0); - gnome_print_show (pi->pc, line[i]); + gnome_print_show (pi->pc, (guchar *)line[i]); gnome_print_grestore (pi->pc); } @@ -1107,9 +1110,9 @@ draw_barcode_object (PrintInfo *pi, if (gbc == NULL) { font = gnome_font_find_closest_from_weight_slant ( - GL_BARCODE_FONT_FAMILY, - GL_BARCODE_FONT_WEIGHT, - FALSE, 12.0); + (guchar *)GL_BARCODE_FONT_FAMILY, + GL_BARCODE_FONT_WEIGHT, + FALSE, 12.0); gnome_print_setfont (pi->pc, font); gnome_print_setrgbcolor (pi->pc, @@ -1124,7 +1127,7 @@ draw_barcode_object (PrintInfo *pi, gnome_print_gsave (pi->pc); gnome_print_scale (pi->pc, 1.0, -1.0); - gnome_print_show (pi->pc, _("Invalid barcode data")); + gnome_print_show (pi->pc, (guchar *)_("Invalid barcode data")); gnome_print_grestore (pi->pc); } else { @@ -1148,9 +1151,9 @@ draw_barcode_object (PrintInfo *pi, bchar = (glBarcodeChar *) li->data; font = gnome_font_find_closest_from_weight_slant ( - GL_BARCODE_FONT_FAMILY, - GL_BARCODE_FONT_WEIGHT, - FALSE, bchar->fsize); + (guchar *)GL_BARCODE_FONT_FAMILY, + GL_BARCODE_FONT_WEIGHT, + FALSE, bchar->fsize); gnome_print_setfont (pi->pc, font); gnome_print_setrgbcolor (pi->pc, @@ -1168,7 +1171,7 @@ draw_barcode_object (PrintInfo *pi, cstring = g_strdup_printf ("%c", bchar->c); gnome_print_gsave (pi->pc); gnome_print_scale (pi->pc, 1.0, -1.0); - gnome_print_show (pi->pc, cstring); + gnome_print_show (pi->pc, (guchar *)cstring); gnome_print_grestore (pi->pc); g_free (cstring); diff --git a/glabels2/src/recent.c b/glabels2/src/recent.c index 1559b34a..50a150cc 100644 --- a/glabels2/src/recent.c +++ b/glabels2/src/recent.c @@ -23,6 +23,8 @@ #include "recent.h" +#include + #include "prefs.h" #include "debug.h" diff --git a/glabels2/src/template-designer.c b/glabels2/src/template-designer.c index a05a005e..8b15d3b3 100644 --- a/glabels2/src/template-designer.c +++ b/glabels2/src/template-designer.c @@ -24,7 +24,6 @@ #include "template-designer.h" #include -#include #include #include #include @@ -33,6 +32,8 @@ #include #include #include +#include +#include #include "prefs.h" #include diff --git a/glabels2/src/text-node.c b/glabels2/src/text-node.c index e3c13189..1ab4c6b4 100644 --- a/glabels2/src/text-node.c +++ b/glabels2/src/text-node.c @@ -24,6 +24,8 @@ #include "text-node.h" +#include + #include "merge.h" #include "debug.h" diff --git a/glabels2/src/ui-property-bar.c b/glabels2/src/ui-property-bar.c index a0205563..15825ff7 100644 --- a/glabels2/src/ui-property-bar.c +++ b/glabels2/src/ui-property-bar.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "util.h" #include "mygal/widget-color-combo.h" diff --git a/glabels2/src/ui.c b/glabels2/src/ui.c index 9703cfc4..4465d42b 100644 --- a/glabels2/src/ui.c +++ b/glabels2/src/ui.c @@ -29,6 +29,7 @@ #include #include "recent-files/egg-recent-view.h" #include "recent-files/egg-recent-view-uimanager.h" +#include #include "ui-util.h" #include "ui-commands.h" diff --git a/glabels2/src/view-barcode.c b/glabels2/src/view-barcode.c index b1af536f..35185f56 100644 --- a/glabels2/src/view-barcode.c +++ b/glabels2/src/view-barcode.c @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include "canvas-hacktext.h" #include "view-highlight.h" @@ -401,11 +403,11 @@ gl_view_barcode_get_create_cursor (void) if (!cursor) { pixmap_data = gdk_bitmap_create_from_data (NULL, - cursor_barcode_bits, + (gchar *)cursor_barcode_bits, cursor_barcode_width, cursor_barcode_height); pixmap_mask = gdk_bitmap_create_from_data (NULL, - cursor_barcode_mask_bits, + (gchar *)cursor_barcode_mask_bits, cursor_barcode_mask_width, cursor_barcode_mask_height); cursor = @@ -585,7 +587,7 @@ draw_barcode (glViewBarcode *view_barcode) gl_debug (DEBUG_VIEW, "2"); /* get Gnome Font */ - font = gnome_font_find_closest_from_weight_slant (GL_BARCODE_FONT_FAMILY, + font = gnome_font_find_closest_from_weight_slant ((guchar *)GL_BARCODE_FONT_FAMILY, GL_BARCODE_FONT_WEIGHT, FALSE, 10.0); @@ -597,9 +599,8 @@ draw_barcode (glViewBarcode *view_barcode) glyphlist = gnome_glyphlist_from_text_sized_dumb (font, color_node->color, 0.0, 0.0, - cstring, - strlen - (cstring)); + (guchar *)cstring, + strlen (cstring)); y_offset = 10.0 - fabs (gnome_font_get_descender (font)); item = gl_view_object_item_new (GL_VIEW_OBJECT(view_barcode), gl_canvas_hacktext_get_type (), @@ -637,17 +638,14 @@ draw_barcode (glViewBarcode *view_barcode) bchar = (glBarcodeChar *) li->data; font = gnome_font_find_closest_from_weight_slant ( - GL_BARCODE_FONT_FAMILY, - GL_BARCODE_FONT_WEIGHT, - FALSE, bchar->fsize); - glyphlist = gnome_glyphlist_from_text_sized_dumb (font, - color_node->color, - 0.0, - 0.0, - & - (bchar-> - c), - 1); + (guchar *)GL_BARCODE_FONT_FAMILY, + GL_BARCODE_FONT_WEIGHT, + FALSE, bchar->fsize); + glyphlist = gnome_glyphlist_from_text_sized_dumb ( + font, + color_node->color, + 0.0, 0.0, + (guchar *)&(bchar->c), 1); y_offset = bchar->fsize - fabs (gnome_font_get_descender (font)); diff --git a/glabels2/src/view-box.c b/glabels2/src/view-box.c index 655cdcae..dac1450b 100644 --- a/glabels2/src/view-box.c +++ b/glabels2/src/view-box.c @@ -445,11 +445,11 @@ gl_view_box_get_create_cursor (void) if (!cursor) { pixmap_data = gdk_bitmap_create_from_data (NULL, - cursor_box_bits, + (gchar *)cursor_box_bits, cursor_box_width, cursor_box_height); pixmap_mask = gdk_bitmap_create_from_data (NULL, - cursor_box_mask_bits, + (gchar *)cursor_box_mask_bits, cursor_box_mask_width, cursor_box_mask_height); cursor = diff --git a/glabels2/src/view-ellipse.c b/glabels2/src/view-ellipse.c index b5d22502..e31286ff 100644 --- a/glabels2/src/view-ellipse.c +++ b/glabels2/src/view-ellipse.c @@ -447,11 +447,11 @@ gl_view_ellipse_get_create_cursor (void) if (!cursor) { pixmap_data = gdk_bitmap_create_from_data (NULL, - cursor_ellipse_bits, + (gchar *)cursor_ellipse_bits, cursor_ellipse_width, cursor_ellipse_height); pixmap_mask = gdk_bitmap_create_from_data (NULL, - cursor_ellipse_mask_bits, + (gchar *)cursor_ellipse_mask_bits, cursor_ellipse_mask_width, cursor_ellipse_mask_height); cursor = diff --git a/glabels2/src/view-image.c b/glabels2/src/view-image.c index 7d95aeb5..1bfe44e2 100644 --- a/glabels2/src/view-image.c +++ b/glabels2/src/view-image.c @@ -417,11 +417,11 @@ gl_view_image_get_create_cursor (void) if (!cursor) { pixmap_data = gdk_bitmap_create_from_data (NULL, - cursor_image_bits, + (gchar *)cursor_image_bits, cursor_image_width, cursor_image_height); pixmap_mask = gdk_bitmap_create_from_data (NULL, - cursor_image_mask_bits, + (gchar *)cursor_image_mask_bits, cursor_image_mask_width, cursor_image_mask_height); cursor = diff --git a/glabels2/src/view-line.c b/glabels2/src/view-line.c index 90fc19ec..10262510 100644 --- a/glabels2/src/view-line.c +++ b/glabels2/src/view-line.c @@ -426,11 +426,11 @@ gl_view_line_get_create_cursor (void) if (!cursor) { pixmap_data = gdk_bitmap_create_from_data (NULL, - cursor_line_bits, + (gchar *)cursor_line_bits, cursor_line_width, cursor_line_height); pixmap_mask = gdk_bitmap_create_from_data (NULL, - cursor_line_mask_bits, + (gchar *)cursor_line_mask_bits, cursor_line_mask_width, cursor_line_mask_height); cursor = diff --git a/glabels2/src/view-text.c b/glabels2/src/view-text.c index 2f66ddb4..67a618e7 100644 --- a/glabels2/src/view-text.c +++ b/glabels2/src/view-text.c @@ -497,11 +497,11 @@ gl_view_text_get_create_cursor (void) if (!cursor) { pixmap_data = gdk_bitmap_create_from_data (NULL, - cursor_text_bits, + (gchar *)cursor_text_bits, cursor_text_width, cursor_text_height); pixmap_mask = gdk_bitmap_create_from_data (NULL, - cursor_text_mask_bits, + (gchar *)cursor_text_mask_bits, cursor_text_mask_width, cursor_text_mask_height); cursor = @@ -700,7 +700,7 @@ draw_hacktext (glViewText *view_text) gl_debug (DEBUG_VIEW, "2"); /* get Gnome Font */ - font = gnome_font_find_closest_from_weight_slant (font_family, + font = gnome_font_find_closest_from_weight_slant ((guchar *)font_family, font_weight, font_italic_flag, font_size); @@ -711,7 +711,7 @@ draw_hacktext (glViewText *view_text) glyphlist = gnome_glyphlist_from_text_dumb (font, color_node->color, 0.0, 0.0, - line[i]); + (guchar *)line[i]); gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox); w = bbox.x1; @@ -818,7 +818,7 @@ draw_cursor (glViewText *view_text) selection_flag = !gtk_text_iter_equal (&cursor_iter, &bound_iter); /* get Gnome Font */ - font = gnome_font_find_closest_from_weight_slant (font_family, + font = gnome_font_find_closest_from_weight_slant ((guchar *)font_family, font_weight, font_italic_flag, font_size); @@ -831,7 +831,7 @@ draw_cursor (glViewText *view_text) glyphlist = gnome_glyphlist_from_text_dumb (font, color_node->color, 0.0, 0.0, - line[i]); + (guchar *)line[i]); gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox); gnome_glyphlist_unref (glyphlist); @@ -854,7 +854,7 @@ draw_cursor (glViewText *view_text) glyphlist = gnome_glyphlist_from_text_sized_dumb (font, color_node->color, 0.0, 0.0, - line[i], + (guchar *)line[i], cursor_char); gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox); gnome_glyphlist_unref (glyphlist); diff --git a/glabels2/src/view.c b/glabels2/src/view.c index ec2e9eea..49c1702f 100644 --- a/glabels2/src/view.c +++ b/glabels2/src/view.c @@ -3634,8 +3634,8 @@ selection_get_cb (GtkWidget *widget, buffer = gl_xml_label_save_buffer (view->selection_data, &status); gtk_selection_data_set (selection_data, - GDK_SELECTION_TYPE_STRING, 8, buffer, - strlen (buffer)); + GDK_SELECTION_TYPE_STRING, 8, + (guchar *)buffer, strlen (buffer)); g_free (buffer); } @@ -3670,7 +3670,7 @@ selection_received_cb (GtkWidget *widget, gl_view_unselect_all (view); - label = gl_xml_label_open_buffer (selection_data->data, &status); + label = gl_xml_label_open_buffer ((gchar *)selection_data->data, &status); for (p = label->objects; p != NULL; p = p_next) { p_next = p->next; diff --git a/glabels2/src/wdgt-media-select.c b/glabels2/src/wdgt-media-select.c index 47f563c5..323fc672 100644 --- a/glabels2/src/wdgt-media-select.c +++ b/glabels2/src/wdgt-media-select.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "hig.h" #include "wdgt-mini-preview.h" diff --git a/glabels2/src/xml-label-04.c b/glabels2/src/xml-label-04.c index b845c725..88b0c26e 100644 --- a/glabels2/src/xml-label-04.c +++ b/glabels2/src/xml-label-04.c @@ -72,7 +72,7 @@ glLabel *gl_xml_label_04_parse (xmlNodePtr root, *status = XML_LABEL_OK; - if (!xmlStrEqual (root->name, "Label")) { + if (!xmlStrEqual (root->name, (xmlChar *)"Label")) { g_warning (_("Bad root node = \"%s\""), root->name); *status = XML_LABEL_ERROR_OPEN_PARSE; return NULL; @@ -88,37 +88,37 @@ glLabel *gl_xml_label_04_parse (xmlNodePtr root, gl_debug (DEBUG_XML, "node name = \"%s\"", node->name); if (!xmlNodeIsText (node)) { - if (xmlStrEqual (node->name, "Media_Type")) { + if (xmlStrEqual (node->name, (xmlChar *)"Media_Type")) { if (!xml04_parse_media_description (node, label)) { *status = XML_LABEL_UNKNOWN_MEDIA; } - } else if (xmlStrEqual (node->name, "Text")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Text")) { object = gl_label_text_new (label); xml04_parse_object (node, GL_LABEL_OBJECT(object)); xml04_parse_text_props (node, GL_LABEL_TEXT(object)); - } else if (xmlStrEqual (node->name, "Box")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Box")) { object = gl_label_box_new (label); xml04_parse_object (node, GL_LABEL_OBJECT(object)); xml04_parse_box_props (node, GL_LABEL_BOX(object)); - } else if (xmlStrEqual (node->name, "Line")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Line")) { object = gl_label_line_new (label); xml04_parse_object (node, GL_LABEL_OBJECT(object)); xml04_parse_line_props (node, GL_LABEL_LINE(object)); - } else if (xmlStrEqual (node->name, "Ellipse")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Ellipse")) { object = gl_label_ellipse_new (label); xml04_parse_object (node, GL_LABEL_OBJECT(object)); xml04_parse_ellipse_props (node, GL_LABEL_ELLIPSE(object)); - } else if (xmlStrEqual (node->name, "Image")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Image")) { object = gl_label_image_new (label); xml04_parse_object (node, GL_LABEL_OBJECT(object)); xml04_parse_image_props (node, GL_LABEL_IMAGE(object)); - } else if (xmlStrEqual (node->name, "Barcode")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Barcode")) { object = gl_label_barcode_new (label); xml04_parse_object (node, GL_LABEL_OBJECT(object)); xml04_parse_barcode_props (node, GL_LABEL_BARCODE(object)); - } else if (xmlStrEqual (node->name, "Merge_Properties")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Merge_Properties")) { xml04_parse_merge_properties (node, label); } else { g_warning (_("bad node = \"%s\""), node->name); @@ -146,7 +146,7 @@ xml04_parse_media_description (xmlNodePtr node, template_name = xmlNodeGetContent (node); - template = gl_template_from_name (template_name); + template = gl_template_from_name ((gchar *)template_name); if (template == NULL) { g_warning ("Undefined template \"%s\"", template_name); /* Get a default */ @@ -206,21 +206,21 @@ xml04_parse_text_props (xmlNodePtr object_node, gl_debug (DEBUG_XML, "START"); - font_family = xmlGetProp (object_node, "font_family"); + font_family = xmlGetProp (object_node, (xmlChar *)"font_family"); font_size = gl_xml_get_prop_double (object_node, "font_size", 0); - string = xmlGetProp (object_node, "font_weight"); + string = xmlGetProp (object_node, (xmlChar *)"font_weight"); font_weight = gl_util_string_to_weight (string); xmlFree (string); font_italic_flag = gl_xml_get_prop_boolean (object_node, "font_italic", FALSE); - string = xmlGetProp (object_node, "justify"); + string = xmlGetProp (object_node, (xmlChar *)"justify"); just = gl_util_string_to_just (string); xmlFree (string); color_node = gl_color_node_new_default (); color_node->color = gl_xml_get_prop_uint (object_node, "color", 0); - gl_label_object_set_font_family (GL_LABEL_OBJECT(object), font_family); + gl_label_object_set_font_family (GL_LABEL_OBJECT(object), (gchar *)font_family); gl_label_object_set_font_size (GL_LABEL_OBJECT(object), font_size); gl_label_object_set_font_weight (GL_LABEL_OBJECT(object), font_weight); gl_label_object_set_font_italic_flag (GL_LABEL_OBJECT(object), font_italic_flag); @@ -233,7 +233,7 @@ xml04_parse_text_props (xmlNodePtr object_node, for (line_node = object_node->xmlChildrenNode; line_node != NULL; line_node = line_node->next) { - if (xmlStrEqual (line_node->name, "Line")) { + if (xmlStrEqual (line_node->name, (xmlChar *)"Line")) { gl_debug (DEBUG_XML, "->Line node"); @@ -241,12 +241,12 @@ xml04_parse_text_props (xmlNodePtr object_node, for (text_node = line_node->xmlChildrenNode; text_node != NULL; text_node = text_node->next) { - if (xmlStrEqual (text_node->name, "Field")) { + if (xmlStrEqual (text_node->name, (xmlChar *)"Field")) { gl_debug (DEBUG_XML, "->Line->Field node"); node_text = g_new0 (glTextNode, 1); node_text->field_flag = TRUE; node_text->data = - xmlGetProp (text_node, "name"); + (gchar *)xmlGetProp (text_node, (xmlChar *)"name"); nodes = g_list_append (nodes, node_text); } else if (xmlNodeIsText (text_node)) { @@ -254,7 +254,7 @@ xml04_parse_text_props (xmlNodePtr object_node, node_text = g_new0 (glTextNode, 1); node_text->field_flag = FALSE; node_text->data = - xmlNodeGetContent (text_node); + (gchar *)xmlNodeGetContent (text_node); gl_debug (DEBUG_XML, "text = \"%s\"", node_text->data); nodes = @@ -413,7 +413,7 @@ xml04_parse_image_props (xmlNodePtr node, filename = g_new0 (glTextNode, 1); filename->field_flag = FALSE; - filename->data = xmlGetProp (node, "filename"); + filename->data = (gchar *)xmlGetProp (node, (xmlChar *)"filename"); gl_label_image_set_filename (object, filename); gl_text_node_free (&filename); @@ -443,24 +443,24 @@ xml04_parse_barcode_props (xmlNodePtr node, color_node = gl_color_node_new_default (); color_node->color = gl_xml_get_prop_uint (node, "color", 0); - id = xmlGetProp (node, "style"); + id = xmlGetProp (node, (xmlChar *)"style"); text_flag = gl_xml_get_prop_boolean (node, "text", FALSE); scale = gl_xml_get_prop_double (node, "scale", 1.0); if (scale == 0.0) { scale = 0.5; /* Set to a valid value */ } - gl_label_barcode_set_props (object, id, text_flag, TRUE, 0); + gl_label_barcode_set_props (object, (gchar *)id, text_flag, TRUE, 0); gl_label_object_set_line_color (GL_LABEL_OBJECT(object), color_node); child = node->xmlChildrenNode; text_node = g_new0 (glTextNode, 1); - if (xmlStrEqual (child->name, "Field")) { + if (xmlStrEqual (child->name, (xmlChar *)"Field")) { text_node->field_flag = TRUE; - text_node->data = xmlGetProp (child, "name"); + text_node->data = (gchar *)xmlGetProp (child, (xmlChar *)"name"); } else if (xmlNodeIsText (child)) { text_node->field_flag = FALSE; - text_node->data = xmlNodeGetContent (child); + text_node->data = (gchar *)xmlNodeGetContent (child); } else { g_warning ("Unexpected Barcode child: \"%s\"", child->name); } @@ -486,12 +486,12 @@ xml04_parse_merge_properties (xmlNodePtr node, gl_debug (DEBUG_XML, "START"); - string = xmlGetProp (node, "type"); - merge = gl_merge_new (string); + string = xmlGetProp (node, (xmlChar *)"type"); + merge = gl_merge_new ((gchar *)string); xmlFree (string); - string = xmlGetProp (node, "src"); - gl_merge_set_src (merge, string); + string = xmlGetProp (node, (xmlChar *)"src"); + gl_merge_set_src (merge, (gchar *)string); xmlFree (string); gl_label_set_merge (label, merge); diff --git a/glabels2/src/xml-label-191.c b/glabels2/src/xml-label-191.c index 567b82c9..5f174c24 100644 --- a/glabels2/src/xml-label-191.c +++ b/glabels2/src/xml-label-191.c @@ -127,7 +127,7 @@ gl_xml_label_191_parse (xmlNodePtr root, *status = XML_LABEL_OK; - if (!xmlStrEqual (root->name, "Document")) { + if (!xmlStrEqual (root->name, (xmlChar *)"Document")) { g_warning (_("Bad root node = \"%s\""), root->name); *status = XML_LABEL_ERROR_OPEN_PARSE; return NULL; @@ -137,7 +137,7 @@ gl_xml_label_191_parse (xmlNodePtr root, /* Pass 1, extract data nodes to pre-load cache. */ for (node = root->xmlChildrenNode; node != NULL; node = node->next) { - if (xmlStrEqual (node->name, "Data")) { + if (xmlStrEqual (node->name, (xmlChar *)"Data")) { xml191_parse_data (node, label); } } @@ -145,7 +145,7 @@ gl_xml_label_191_parse (xmlNodePtr root, /* Pass 2, now extract everything else. */ for (node = root->xmlChildrenNode; node != NULL; node = node->next) { - if (xmlStrEqual (node->name, "Sheet")) { + if (xmlStrEqual (node->name, (xmlChar *)"Sheet")) { template = xml191_parse_sheet (node); if (!template) { *status = XML_LABEL_UNKNOWN_MEDIA; @@ -154,11 +154,11 @@ gl_xml_label_191_parse (xmlNodePtr root, gl_template_register (template); gl_label_set_template (label, template); gl_template_free (template); - } else if (xmlStrEqual (node->name, "Objects")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Objects")) { xml191_parse_objects (node, label); - } else if (xmlStrEqual (node->name, "Merge_Fields")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Merge_Fields")) { xml191_parse_merge_fields (node, label); - } else if (xmlStrEqual (node->name, "Data")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Data")) { /* Handled in pass 1. */ } else { if (!xmlNodeIsText (node)) { @@ -190,7 +190,7 @@ xml191_parse_objects (xmlNodePtr objects_node, for (node = objects_node->xmlChildrenNode; node != NULL; node = node->next) { - if (xmlStrEqual (node->name, "Object")) { + if (xmlStrEqual (node->name, (xmlChar *)"Object")) { xml191_parse_object (node, label); } else { if (!xmlNodeIsText (node)) { @@ -216,19 +216,19 @@ xml191_parse_object (xmlNodePtr object_node, gl_debug (DEBUG_XML, "START"); - string = xmlGetProp (object_node, "type"); + string = xmlGetProp (object_node, (xmlChar *)"type"); - if ( xmlStrEqual (string, "Text") ) { + if ( xmlStrEqual (string, (xmlChar *)"Text") ) { object = xml191_parse_text_props (object_node, label); - } else if ( xmlStrEqual (string, "Box") ) { + } else if ( xmlStrEqual (string, (xmlChar *)"Box") ) { object = xml191_parse_box_props (object_node, label); - } else if ( xmlStrEqual (string, "Line") ) { + } else if ( xmlStrEqual (string, (xmlChar *)"Line") ) { object = xml191_parse_line_props (object_node, label); - } else if ( xmlStrEqual (string, "Ellipse") ) { + } else if ( xmlStrEqual (string, (xmlChar *)"Ellipse") ) { object = xml191_parse_ellipse_props (object_node, label); - } else if ( xmlStrEqual (string, "Image") ) { + } else if ( xmlStrEqual (string, (xmlChar *)"Image") ) { object = xml191_parse_image_props (object_node, label); - } else if ( xmlStrEqual (string, "Barcode") ) { + } else if ( xmlStrEqual (string, (xmlChar *)"Barcode") ) { object = xml191_parse_barcode_props (object_node, label); } else { g_warning ("Unknown label object type \"%s\"", string); @@ -285,18 +285,18 @@ xml191_parse_text_props (xmlNodePtr object_node, w = gl_xml_get_prop_length (object_node, "w", 0); h = gl_xml_get_prop_length (object_node, "h", 0); - font_family = xmlGetProp (object_node, "font_family"); + font_family = xmlGetProp (object_node, (xmlChar *)"font_family"); font_size = gl_xml_get_prop_double (object_node, "font_size", 0.0); - string = xmlGetProp (object_node, "font_weight"); - font_weight = gl_util_string_to_weight (string); + string = xmlGetProp (object_node, (xmlChar *)"font_weight"); + font_weight = gl_util_string_to_weight ((gchar *)string); xmlFree (string); font_italic_flag = gl_xml_get_prop_boolean (object_node, "font_italic", FALSE); - string = xmlGetProp (object_node, "justify"); - just = gl_util_string_to_just (string); + string = xmlGetProp (object_node, (xmlChar *)"justify"); + just = gl_util_string_to_just ((gchar *)string); xmlFree (string); color_node = gl_color_node_new_default (); @@ -307,22 +307,22 @@ xml191_parse_text_props (xmlNodePtr object_node, line_node != NULL; line_node = line_node->next) { - if (xmlStrEqual (line_node->name, "Line")) { + if (xmlStrEqual (line_node->name, (xmlChar *)"Line")) { nodes = NULL; for (text_node = line_node->xmlChildrenNode; text_node != NULL; text_node = text_node->next) { - if (xmlStrEqual (text_node->name, "Field")) { + if (xmlStrEqual (text_node->name, (xmlChar *)"Field")) { node_text = g_new0 (glTextNode, 1); node_text->field_flag = TRUE; - node_text->data = xmlGetProp (text_node, "name"); + node_text->data = (gchar *)xmlGetProp (text_node, (xmlChar *)"name"); nodes = g_list_append (nodes, node_text); - } else if (xmlStrEqual (text_node->name, "Literal")) { + } else if (xmlStrEqual (text_node->name, (xmlChar *)"Literal")) { node_text = g_new0 (glTextNode, 1); node_text->field_flag = FALSE; node_text->data = - xmlNodeGetContent (text_node); + (gchar *)xmlNodeGetContent (text_node); nodes = g_list_append (nodes, node_text); } else if (!xmlNodeIsText (text_node)) { @@ -342,7 +342,7 @@ xml191_parse_text_props (xmlNodePtr object_node, gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); gl_label_text_set_lines (GL_LABEL_TEXT(object), lines); - gl_label_object_set_font_family (GL_LABEL_OBJECT(object), font_family); + gl_label_object_set_font_family (GL_LABEL_OBJECT(object), (gchar *)font_family); gl_label_object_set_font_size (GL_LABEL_OBJECT(object), font_size); gl_label_object_set_font_weight (GL_LABEL_OBJECT(object), font_weight); gl_label_object_set_font_italic_flag (GL_LABEL_OBJECT(object), font_italic_flag); @@ -494,12 +494,12 @@ xml191_parse_image_props (xmlNodePtr node, filename = g_new0 (glTextNode, 1); for (child = node->xmlChildrenNode; child != NULL; child = child->next) { - if (xmlStrEqual (child->name, "Field")) { + if (xmlStrEqual (child->name, (xmlChar *)"Field")) { filename->field_flag = TRUE; - filename->data = xmlGetProp (child, "name"); - } else if (xmlStrEqual (child->name, "File")) { + filename->data = (gchar *)xmlGetProp (child, (xmlChar *)"name"); + } else if (xmlStrEqual (child->name, (xmlChar *)"File")) { filename->field_flag = FALSE; - filename->data = xmlGetProp (child, "src"); + filename->data = (gchar *)xmlGetProp (child, (xmlChar *)"src"); } else if (!xmlNodeIsText (child)) { g_warning ("Unexpected Image child: \"%s\"", child->name); } @@ -541,19 +541,19 @@ xml191_parse_barcode_props (xmlNodePtr node, color_node = gl_color_node_new_default (); color_node->color = gl_xml_get_prop_uint (node, "color", 0); - id = xmlGetProp (node, "style"); + id = xmlGetProp (node, (xmlChar *)"style"); text_flag = gl_xml_get_prop_boolean (node, "text", FALSE); checksum_flag = gl_xml_get_prop_boolean (node, "checksum", TRUE); text_node = g_new0 (glTextNode, 1); for (child = node->xmlChildrenNode; child != NULL; child = child->next) { - if (xmlStrEqual (child->name, "Field")) { + if (xmlStrEqual (child->name, (xmlChar *)"Field")) { text_node->field_flag = TRUE; - text_node->data = xmlGetProp (child, "name"); - } else if (xmlStrEqual (child->name, "Literal")) { + text_node->data = (gchar *)xmlGetProp (child, (xmlChar *)"name"); + } else if (xmlStrEqual (child->name, (xmlChar *)"Literal")) { text_node->field_flag = FALSE; - text_node->data = xmlNodeGetContent (child); + text_node->data = (gchar *)xmlNodeGetContent (child); } else if (!xmlNodeIsText (child)) { g_warning ("Unexpected Barcode child: \"%s\"", child->name); } @@ -563,7 +563,7 @@ xml191_parse_barcode_props (xmlNodePtr node, gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node); gl_label_barcode_set_props (GL_LABEL_BARCODE(object), - id, text_flag, checksum_flag, 0); + (gchar *)id, text_flag, checksum_flag, 0); gl_label_object_set_line_color (GL_LABEL_OBJECT(object), color_node); gl_color_node_free (&color_node); @@ -588,12 +588,12 @@ xml191_parse_merge_fields (xmlNodePtr node, gl_debug (DEBUG_XML, "START"); - string = xmlGetProp (node, "type"); - merge = gl_merge_new (string); + string = xmlGetProp (node, (xmlChar *)"type"); + merge = gl_merge_new ((gchar *)string); xmlFree (string); - string = xmlGetProp (node, "src"); - gl_merge_set_src (merge, string); + string = xmlGetProp (node, (xmlChar *)"src"); + gl_merge_set_src (merge, (gchar *)string); xmlFree (string); gl_label_set_merge (label, merge); @@ -616,7 +616,7 @@ xml191_parse_data (xmlNodePtr node, for (child = node->xmlChildrenNode; child != NULL; child = child->next) { - if (xmlStrEqual (child->name, "Pixdata")) { + if (xmlStrEqual (child->name, (xmlChar *)"Pixdata")) { xml191_parse_pixdata (child, label); } else { if (!xmlNodeIsText (child)) { @@ -646,10 +646,10 @@ xml191_parse_pixdata (xmlNodePtr node, gl_debug (DEBUG_XML, "START"); - name = xmlGetProp (node, "name"); + name = xmlGetProp (node, (xmlChar *)"name"); base64 = xmlNodeGetContent (node); - stream = gl_base64_decode (base64, &stream_length); + stream = gl_base64_decode ((gchar *)base64, &stream_length); pixdata = g_new0 (GdkPixdata, 1); ret = gdk_pixdata_deserialize (pixdata, stream_length, stream, NULL); @@ -657,7 +657,7 @@ xml191_parse_pixdata (xmlNodePtr node, pixbuf = gdk_pixbuf_from_pixdata (pixdata, TRUE, NULL); pixbuf_cache = gl_label_get_pixbuf_cache (label); - gl_pixbuf_cache_add_pixbuf (pixbuf_cache, name, pixbuf); + gl_pixbuf_cache_add_pixbuf (pixbuf_cache, (gchar *)name, pixbuf); } xmlFree (name); @@ -683,10 +683,10 @@ xml191_parse_sheet (xmlNodePtr sheet_node) gl_debug (DEBUG_TEMPLATE, "START"); - name = xmlGetProp (sheet_node, "name"); + name = xmlGetProp (sheet_node, (xmlChar *)"name"); - page_size = xmlGetProp (sheet_node, "size"); - if (gl_paper_is_id_other (page_size)) { + page_size = xmlGetProp (sheet_node, (xmlChar *)"size"); + if (gl_paper_is_id_other ((gchar *)page_size)) { page_width = gl_xml_get_prop_length (sheet_node, "width", 0); page_height = gl_xml_get_prop_length (sheet_node, "height", 0); @@ -712,30 +712,30 @@ xml191_parse_sheet (xmlNodePtr sheet_node) gl_paper_free (paper); } - description = xmlGetProp (sheet_node, "_description"); + description = xmlGetProp (sheet_node, (xmlChar *)"_description"); if (description != NULL) { - xmlChar *tmp = gettext (description); + xmlChar *tmp = (xmlChar *)gettext ((char *)description); if (tmp == description) { - template->description = description; + template->description = (gchar *)description; } else { - template->description = g_strdup (tmp); + template->description = g_strdup ((gchar *)tmp); } } else { - template->description = xmlGetProp (sheet_node, "description"); + template->description = (gchar *)xmlGetProp (sheet_node, (xmlChar *)"description"); } - template = gl_template_new (name, description, - page_size, page_width, page_height); + template = gl_template_new ((gchar *)name, (gchar *)description, + (gchar *)page_size, page_width, page_height); for (node = sheet_node->xmlChildrenNode; node != NULL; node = node->next) { - if (xmlStrEqual (node->name, "Label")) { + if (xmlStrEqual (node->name, (xmlChar *)"Label")) { xml191_parse_label (node, template); - } else if (xmlStrEqual (node->name, "Alias")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Alias")) { xml191_parse_alias (node, template); } else { if (!xmlNodeIsText (node)) { @@ -768,12 +768,12 @@ xml191_parse_label (xmlNodePtr label_node, gl_debug (DEBUG_TEMPLATE, "START"); - style = xmlGetProp (label_node, "style"); - if (xmlStrEqual (style, "rectangle")) { + style = xmlGetProp (label_node, (xmlChar *)"style"); + if (xmlStrEqual (style, (xmlChar *)"rectangle")) { shape = GL_TEMPLATE_SHAPE_RECT; - } else if (xmlStrEqual (style, "round")) { + } else if (xmlStrEqual (style, (xmlChar *)"round")) { shape = GL_TEMPLATE_SHAPE_ROUND; - } else if (xmlStrEqual (style, "cd")) { + } else if (xmlStrEqual (style, (xmlChar *)"cd")) { shape = GL_TEMPLATE_SHAPE_CD; } else { shape = GL_TEMPLATE_SHAPE_RECT; @@ -815,9 +815,9 @@ xml191_parse_label (xmlNodePtr label_node, for (node = label_node->xmlChildrenNode; node != NULL; node = node->next) { - if (xmlStrEqual (node->name, "Layout")) { + if (xmlStrEqual (node->name, (xmlChar *)"Layout")) { xml191_parse_layout (node, label_type); - } else if (xmlStrEqual (node->name, "Markup")) { + } else if (xmlStrEqual (node->name, (xmlChar *)"Markup")) { xml191_parse_markup (node, label_type); } else if (!xmlNodeIsText (node)) { g_warning ("bad node = \"%s\"", node->name); @@ -876,15 +876,15 @@ xml191_parse_markup (xmlNodePtr markup_node, gl_debug (DEBUG_TEMPLATE, "START"); - type = xmlGetProp (markup_node, "type"); - if (xmlStrEqual (type, "margin")) { + type = xmlGetProp (markup_node, (xmlChar *)"type"); + if (xmlStrEqual (type, (xmlChar *)"margin")) { size = gl_xml_get_prop_length (markup_node, "size", 0); gl_template_add_markup (label_type, gl_template_markup_margin_new (size)); - } else if (xmlStrEqual (type, "line")) { + } else if (xmlStrEqual (type, (xmlChar *)"line")) { x1 = gl_xml_get_prop_length (markup_node, "x1", 0); y1 = gl_xml_get_prop_length (markup_node, "y1", 0); @@ -917,8 +917,8 @@ xml191_parse_alias (xmlNodePtr alias_node, gl_debug (DEBUG_TEMPLATE, "START"); - name = xmlGetProp (alias_node, "name"); - gl_template_add_alias (template, name); + name = xmlGetProp (alias_node, (xmlChar *)"name"); + gl_template_add_alias (template, (gchar *)name); xmlFree (name); gl_debug (DEBUG_TEMPLATE, "END"); diff --git a/glabels2/src/xml-label.c b/glabels2/src/xml-label.c index f725b139..6f551911 100644 --- a/glabels2/src/xml-label.c +++ b/glabels2/src/xml-label.c @@ -252,14 +252,14 @@ xml_doc_to_label (xmlDocPtr doc, return NULL; } - ns = xmlSearchNsByHref (doc, root, GL_XML_NAME_SPACE); + ns = xmlSearchNsByHref (doc, root, (xmlChar *)GL_XML_NAME_SPACE); if (ns != NULL) { label = xml_parse_label (root, status); if (label) gl_label_set_compression (label, xmlGetDocCompressMode (doc)); } else { /* Try compatability mode 0.1 */ - ns = xmlSearchNsByHref (doc, root, COMPAT01_NAME_SPACE); + ns = xmlSearchNsByHref (doc, root, (xmlChar *)COMPAT01_NAME_SPACE); if (ns != NULL) { g_warning (_("Importing from glabels 0.1 format")); g_warning ("TODO"); @@ -267,14 +267,14 @@ xml_doc_to_label (xmlDocPtr doc, } else { /* Try compatability mode 0.4 */ ns = xmlSearchNsByHref (doc, root, - COMPAT04_NAME_SPACE); + (xmlChar *)COMPAT04_NAME_SPACE); if (ns != NULL) { g_warning (_("Importing from glabels 0.4 format")); label = gl_xml_label_04_parse (root, status); } else { /* Try compatability mode 1.91 */ ns = xmlSearchNsByHref (doc, root, - COMPAT191_NAME_SPACE); + (xmlChar *)COMPAT191_NAME_SPACE); if (ns != NULL) { g_warning (_("Importing from glabels 1.91 format")); label = gl_xml_label_191_parse (root, status); @@ -307,7 +307,7 @@ xml_parse_label (xmlNodePtr root, *status = XML_LABEL_OK; - if (!xmlStrEqual (root->name, "Glabels-document")) { + if (!xmlStrEqual (root->name, (xmlChar *)"Glabels-document")) { g_warning (_("Bad root node = \"%s\""), root->name); *status = XML_LABEL_ERROR_OPEN_PARSE; return NULL; @@ -317,7 +317,7 @@ xml_parse_label (xmlNodePtr root, /* Pass 1, extract data nodes to pre-load cache. */ for (child_node = root->xmlChildrenNode; child_node != NULL; child_node = child_node->next) { - if (xmlStrEqual (child_node->name, "Data")) { + if (xmlStrEqual (child_node->name, (xmlChar *)"Data")) { xml_parse_data (child_node, label); } } @@ -327,7 +327,7 @@ xml_parse_label (xmlNodePtr root, child_node != NULL; child_node = child_node->next) { - if (xmlStrEqual (child_node->name, "Template")) { + if (xmlStrEqual (child_node->name, (xmlChar *)"Template")) { template = gl_xml_template_parse_template_node (child_node); if (!template) { g_object_unref (label); @@ -337,11 +337,11 @@ xml_parse_label (xmlNodePtr root, gl_template_register (template); gl_label_set_template (label, template); gl_template_free (template); - } else if (xmlStrEqual (child_node->name, "Objects")) { + } else if (xmlStrEqual (child_node->name, (xmlChar *)"Objects")) { xml_parse_objects (child_node, label); - } else if (xmlStrEqual (child_node->name, "Merge")) { + } else if (xmlStrEqual (child_node->name, (xmlChar *)"Merge")) { xml_parse_merge_fields (child_node, label); - } else if (xmlStrEqual (child_node->name, "Data")) { + } else if (xmlStrEqual (child_node->name, (xmlChar *)"Data")) { /* Handled in pass 1. */ } else { if (!xmlNodeIsText (child_node)) { @@ -376,17 +376,17 @@ xml_parse_objects (xmlNodePtr node, for (child = node->xmlChildrenNode; child != NULL; child = child->next) { - if (xmlStrEqual (child->name, "Object-text")) { + if (xmlStrEqual (child->name, (xmlChar *)"Object-text")) { xml_parse_object_text (child, label); - } else if (xmlStrEqual (child->name, "Object-box")) { + } else if (xmlStrEqual (child->name, (xmlChar *)"Object-box")) { xml_parse_object_box (child, label); - } else if (xmlStrEqual (child->name, "Object-ellipse")) { + } else if (xmlStrEqual (child->name, (xmlChar *)"Object-ellipse")) { xml_parse_object_ellipse (child, label); - } else if (xmlStrEqual (child->name, "Object-line")) { + } else if (xmlStrEqual (child->name, (xmlChar *)"Object-line")) { xml_parse_object_line (child, label); - } else if (xmlStrEqual (child->name, "Object-image")) { + } else if (xmlStrEqual (child->name, (xmlChar *)"Object-image")) { xml_parse_object_image (child, label); - } else if (xmlStrEqual (child->name, "Object-barcode")) { + } else if (xmlStrEqual (child->name, (xmlChar *)"Object-barcode")) { xml_parse_object_barcode (child, label); } else { if (!xmlNodeIsText (child)) { @@ -430,8 +430,8 @@ xml_parse_object_text (xmlNodePtr node, gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); /* justify attr */ - string = xmlGetProp (node, "justify"); - just = gl_util_string_to_just (string); + string = xmlGetProp (node, (xmlChar *)"justify"); + just = gl_util_string_to_just ((gchar *)string); xmlFree (string); gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object), just); @@ -450,7 +450,7 @@ xml_parse_object_text (xmlNodePtr node, /* Process children */ for (child = node->xmlChildrenNode; child != NULL; child = child->next) { - if (xmlStrEqual (child->name, "Span")) { + if (xmlStrEqual (child->name,(xmlChar *) "Span")) { xml_parse_toplevel_span (child, GL_LABEL_OBJECT(object)); break; } else { @@ -477,7 +477,7 @@ xml_parse_object_box (xmlNodePtr node, gdouble line_width; glColorNode *line_color_node; gdouble affine[6]; - gchar *string; + xmlChar *string; glColorNode *fill_color_node; gl_debug (DEBUG_XML, "START"); @@ -499,10 +499,11 @@ xml_parse_object_box (xmlNodePtr node, gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); line_color_node = gl_color_node_new_default (); - string = xmlGetProp (node, "line_color_field"); + string = xmlGetProp (node, (xmlChar *)"line_color_field"); if ( string ) { line_color_node->field_flag = TRUE; - line_color_node->key = string; + line_color_node->key = g_strdup ((gchar *)string); + xmlFree (string); } else { line_color_node->color = gl_xml_get_prop_uint (node, "line_color", 0); } @@ -512,10 +513,10 @@ xml_parse_object_box (xmlNodePtr node, /* fill attrs */ fill_color_node = gl_color_node_new_default (); - string = xmlGetProp (node, "fill_color_field"); + string = xmlGetProp (node, (xmlChar *)"fill_color_field"); if ( string ) { fill_color_node->field_flag = TRUE; - fill_color_node->key = string; + fill_color_node->key = g_strdup ((gchar *)string); } else { fill_color_node->color = gl_xml_get_prop_uint (node, "fill_color", 0); } @@ -547,7 +548,7 @@ xml_parse_object_ellipse (xmlNodePtr node, gdouble line_width; glColorNode *line_color_node; gdouble affine[6]; - gchar *string; + xmlChar *string; glColorNode *fill_color_node; gl_debug (DEBUG_XML, "START"); @@ -569,10 +570,11 @@ xml_parse_object_ellipse (xmlNodePtr node, gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); line_color_node = gl_color_node_new_default (); - string = xmlGetProp (node, "line_color_field"); + string = xmlGetProp (node, (xmlChar *)"line_color_field"); if ( string ) { line_color_node->field_flag = TRUE; - line_color_node->key = string; + line_color_node->key = g_strdup ((gchar *)string); + xmlFree (string); } else { line_color_node->color = gl_xml_get_prop_uint (node, "line_color", 0); } @@ -582,10 +584,11 @@ xml_parse_object_ellipse (xmlNodePtr node, /* fill attrs */ fill_color_node = gl_color_node_new_default (); - string = xmlGetProp (node, "fill_color_field"); + string = xmlGetProp (node, (xmlChar *)"fill_color_field"); if ( string ) { fill_color_node->field_flag = TRUE; - fill_color_node->key = string; + fill_color_node->key = g_strdup ((gchar *)string); + xmlFree (string); } else { fill_color_node->color = gl_xml_get_prop_uint (node, "fill_color", 0); } @@ -617,7 +620,7 @@ xml_parse_object_line (xmlNodePtr node, gdouble line_width; glColorNode *line_color_node; gdouble affine[6]; - gchar *string; + xmlChar *string; gl_debug (DEBUG_XML, "START"); @@ -638,10 +641,11 @@ xml_parse_object_line (xmlNodePtr node, gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); line_color_node = gl_color_node_new_default (); - string = xmlGetProp (node, "line_color_field"); + string = xmlGetProp (node, (xmlChar *)"line_color_field"); if ( string ) { line_color_node->field_flag = TRUE; - line_color_node->key = string; + line_color_node->key = g_strdup ((gchar *)string); + xmlFree (string); } else { line_color_node->color = gl_xml_get_prop_uint (node, "line_color", 0); } @@ -670,7 +674,7 @@ xml_parse_object_image (xmlNodePtr node, GObject *object; gdouble x, y; gdouble w, h; - gchar *string; + xmlChar *string; glTextNode *filename; gdouble affine[6]; @@ -684,21 +688,23 @@ xml_parse_object_image (xmlNodePtr node, gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); /* src or field attr */ - string = xmlGetProp (node, "src"); + string = xmlGetProp (node, (xmlChar *)"src"); if ( string ) { filename = g_new0 (glTextNode, 1); filename->field_flag = FALSE; - filename->data = string; + filename->data = g_strdup ((gchar *)string); gl_label_image_set_filename (GL_LABEL_IMAGE(object), filename); gl_text_node_free (&filename); + xmlFree (string); } else { - string = xmlGetProp (node, "field"); + string = xmlGetProp (node, (xmlChar *)"field"); if ( string ) { filename = g_new0 (glTextNode, 1); filename->field_flag = TRUE; - filename->data = string; + filename->data = g_strdup ((gchar *)string); gl_label_image_set_filename (GL_LABEL_IMAGE(object), filename); gl_text_node_free (&filename); + xmlFree (string); } else { g_warning ("Missing Object-image src or field attr"); } @@ -755,19 +761,19 @@ xml_parse_object_barcode (xmlNodePtr node, gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); /* prop attrs */ - id = xmlGetProp (node, "style"); + id = xmlGetProp (node, (xmlChar *)"style"); text_flag = gl_xml_get_prop_boolean (node, "text", FALSE); checksum_flag = gl_xml_get_prop_boolean (node, "checksum", TRUE); format_digits = gl_xml_get_prop_uint (node, "format", 10); gl_label_barcode_set_props (GL_LABEL_BARCODE(object), - id, text_flag, checksum_flag, format_digits); + (gchar *)id, text_flag, checksum_flag, format_digits); xmlFree (id); color_node = gl_color_node_new_default (); - string = xmlGetProp (node, "color_field"); + string = xmlGetProp (node, (xmlChar *)"color_field"); if ( string ) { color_node->field_flag = TRUE; - color_node->key = g_strdup (string); + color_node->key = g_strdup ((gchar *)string); xmlFree (string); } else { color_node->color = gl_xml_get_prop_uint (node, "color", 0); @@ -776,20 +782,20 @@ xml_parse_object_barcode (xmlNodePtr node, gl_color_node_free (&color_node); /* data or field attr */ - string = xmlGetProp (node, "data"); + string = xmlGetProp (node, (xmlChar *)"data"); if ( string ) { text_node = g_new0 (glTextNode, 1); text_node->field_flag = FALSE; - text_node->data = g_strdup (string); + text_node->data = g_strdup ((gchar *)string); gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node); gl_text_node_free (&text_node); xmlFree (string); } else { - string = xmlGetProp (node, "field"); + string = xmlGetProp (node, (xmlChar *)"field"); if ( string ) { text_node = g_new0 (glTextNode, 1); text_node->field_flag = TRUE; - text_node->data = g_strdup (string); + text_node->data = g_strdup ((gchar *)string); gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node); gl_text_node_free (&text_node); xmlFree (string); @@ -823,12 +829,12 @@ xml_parse_merge_fields (xmlNodePtr node, gl_debug (DEBUG_XML, "START"); - string = xmlGetProp (node, "type"); - merge = gl_merge_new (string); + string = xmlGetProp (node, (xmlChar *)"type"); + merge = gl_merge_new ((gchar *)string); xmlFree (string); - string = xmlGetProp (node, "src"); - gl_merge_set_src (merge, string); + string = xmlGetProp (node, (xmlChar *)"src"); + gl_merge_set_src (merge, (gchar *)string); xmlFree (string); gl_label_set_merge (label, merge); @@ -851,7 +857,7 @@ xml_parse_data (xmlNodePtr node, for (child = node->xmlChildrenNode; child != NULL; child = child->next) { - if (xmlStrEqual (child->name, "Pixdata")) { + if (xmlStrEqual (child->name, (xmlChar *)"Pixdata")) { xml_parse_pixdata (child, label); } else { if (!xmlNodeIsText (child)) { @@ -881,10 +887,10 @@ xml_parse_pixdata (xmlNodePtr node, gl_debug (DEBUG_XML, "START"); - name = xmlGetProp (node, "name"); + name = xmlGetProp (node, (xmlChar *)"name"); base64 = xmlNodeGetContent (node); - stream = gl_base64_decode (base64, &stream_length); + stream = gl_base64_decode ((gchar *)base64, &stream_length); pixdata = g_new0 (GdkPixdata, 1); ret = gdk_pixdata_deserialize (pixdata, stream_length, stream, NULL); @@ -892,7 +898,7 @@ xml_parse_pixdata (xmlNodePtr node, pixbuf = gdk_pixbuf_from_pixdata (pixdata, TRUE, NULL); pixbuf_cache = gl_label_get_pixbuf_cache (label); - gl_pixbuf_cache_add_pixbuf (pixbuf_cache, name, pixbuf); + gl_pixbuf_cache_add_pixbuf (pixbuf_cache, (gchar *)name, pixbuf); } xmlFree (name); @@ -925,8 +931,8 @@ xml_parse_toplevel_span (xmlNodePtr node, gl_debug (DEBUG_XML, "START"); /* Font family attr */ - font_family = xmlGetProp (node, "font_family"); - gl_label_object_set_font_family (object, font_family); + font_family = xmlGetProp (node, (xmlChar *)"font_family"); + gl_label_object_set_font_family (object, (gchar *)font_family); xmlFree (font_family); /* Font size attr */ @@ -934,8 +940,8 @@ xml_parse_toplevel_span (xmlNodePtr node, gl_label_object_set_font_size (object, font_size); /* Font weight attr */ - string = xmlGetProp (node, "font_weight"); - font_weight = gl_util_string_to_weight (string); + string = xmlGetProp (node, (xmlChar *)"font_weight"); + font_weight = gl_util_string_to_weight ((gchar *)string); xmlFree (string); gl_label_object_set_font_weight (object, font_weight); @@ -945,10 +951,10 @@ xml_parse_toplevel_span (xmlNodePtr node, /* Text color attr */ color_node = gl_color_node_new_default (); - string = xmlGetProp (node, "color_field"); + string = xmlGetProp (node, (xmlChar *)"color_field"); if ( string ) { color_node->field_flag = TRUE; - color_node->key = g_strdup (string); + color_node->key = g_strdup ((gchar *)string); xmlFree (string); } else { color_node->color = gl_xml_get_prop_uint (node, "color", 0); @@ -974,24 +980,26 @@ xml_parse_toplevel_span (xmlNodePtr node, /* Literal text */ text_node = g_new0 (glTextNode, 1); text_node->field_flag = FALSE; - text_node->data = g_strdup (data); + text_node->data = g_strdup ((gchar *)data); text_nodes = g_list_append (text_nodes, text_node); } xmlFree (data); - } else if (xmlStrEqual (child->name, "Span")) { + } else if (xmlStrEqual (child->name, (xmlChar *)"Span")) { g_warning ("Unexpected rich text (not supported, yet!)"); - } else if (xmlStrEqual (child->name, "Field")) { + } else if (xmlStrEqual (child->name, (xmlChar *)"Field")) { /* Field node */ + string = xmlGetProp (child, (xmlChar *)"name"); text_node = g_new0 (glTextNode, 1); text_node->field_flag = TRUE; - text_node->data = xmlGetProp (child, "name"); + text_node->data = g_strdup ((gchar *)string); text_nodes = g_list_append (text_nodes, text_node); + xmlFree (string); - } else if (xmlStrEqual (child->name, "NL")) { + } else if (xmlStrEqual (child->name, (xmlChar *)"NL")) { /* Store line. */ lines = g_list_append (lines, text_nodes); @@ -1094,10 +1102,10 @@ xml_label_to_doc (glLabel *label, LIBXML_TEST_VERSION; - doc = xmlNewDoc ("1.0"); - doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Glabels-document", NULL); + doc = xmlNewDoc ((xmlChar *)"1.0"); + doc->xmlRootNode = xmlNewDocNode (doc, NULL, (xmlChar *)"Glabels-document", NULL); - ns = xmlNewNs (doc->xmlRootNode, GL_XML_NAME_SPACE, NULL); + ns = xmlNewNs (doc->xmlRootNode, (xmlChar *)GL_XML_NAME_SPACE, NULL); xmlSetNs (doc->xmlRootNode, ns); template = gl_label_get_template (label); @@ -1137,8 +1145,8 @@ xml_create_objects (xmlNodePtr root, rotate_flag = gl_label_get_rotate_flag (label); - node = xmlNewChild (root, ns, "Objects", NULL); - xmlSetProp (node, "id", "0"); + node = xmlNewChild (root, ns, (xmlChar *)"Objects", NULL); + xmlSetProp (node, (xmlChar *)"id", (xmlChar *)"0"); gl_xml_set_prop_boolean (node, "rotate", rotate_flag); for (p = label->objects; p != NULL; p = p->next) { @@ -1183,7 +1191,7 @@ xml_create_object_text (xmlNodePtr root, gl_debug (DEBUG_XML, "START"); - node = xmlNewChild (root, ns, "Object-text", NULL); + node = xmlNewChild (root, ns, (xmlChar *)"Object-text", NULL); /* position attrs */ gl_label_object_get_position (object, &x, &y); @@ -1197,7 +1205,7 @@ xml_create_object_text (xmlNodePtr root, /* justify attr */ just = gl_label_object_get_text_alignment (object); - xmlSetProp (node, "justify", gl_util_just_to_string (just)); + xmlSetProp (node, (xmlChar *)"justify", (xmlChar *)gl_util_just_to_string (just)); /* auto_shrink attr */ auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); @@ -1236,7 +1244,7 @@ xml_create_object_box (xmlNodePtr root, gl_debug (DEBUG_XML, "START"); - node = xmlNewChild (root, ns, "Object-box", NULL); + node = xmlNewChild (root, ns, (xmlChar *)"Object-box", NULL); /* position attrs */ gl_label_object_get_position (object, &x, &y); @@ -1255,7 +1263,7 @@ xml_create_object_box (xmlNodePtr root, line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); if (line_color_node->field_flag) { - xmlSetProp (node, "line_color_field", line_color_node->key); + xmlSetProp (node, (xmlChar *)"line_color_field", (xmlChar *)line_color_node->key); } else { @@ -1267,7 +1275,7 @@ xml_create_object_box (xmlNodePtr root, fill_color_node = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object)); if (fill_color_node->field_flag) { - xmlSetProp (node, "fill_color_field", fill_color_node->key); + xmlSetProp (node, (xmlChar *)"fill_color_field", (xmlChar *)fill_color_node->key); } else { @@ -1305,7 +1313,7 @@ xml_create_object_ellipse (xmlNodePtr root, gl_debug (DEBUG_XML, "START"); - node = xmlNewChild (root, ns, "Object-ellipse", NULL); + node = xmlNewChild (root, ns, (xmlChar *)"Object-ellipse", NULL); /* position attrs */ gl_label_object_get_position (object, &x, &y); @@ -1324,7 +1332,7 @@ xml_create_object_ellipse (xmlNodePtr root, line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); if (line_color_node->field_flag) { - xmlSetProp (node, "line_color_field", line_color_node->key); + xmlSetProp (node, (xmlChar *)"line_color_field", (xmlChar *)line_color_node->key); } else { @@ -1337,7 +1345,7 @@ xml_create_object_ellipse (xmlNodePtr root, fill_color_node = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object)); if (fill_color_node->field_flag) { - xmlSetProp (node, "fill_color_field", fill_color_node->key); + xmlSetProp (node, (xmlChar *)"fill_color_field", (xmlChar *)fill_color_node->key); } else { @@ -1374,7 +1382,7 @@ xml_create_object_line (xmlNodePtr root, gl_debug (DEBUG_XML, "START"); - node = xmlNewChild (root, ns, "Object-line", NULL); + node = xmlNewChild (root, ns, (xmlChar *)"Object-line", NULL); /* position attrs */ gl_label_object_get_position (object, &x, &y); @@ -1393,7 +1401,7 @@ xml_create_object_line (xmlNodePtr root, line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); if (line_color_node->field_flag) { - xmlSetProp (node, "line_color_field", line_color_node->key); + xmlSetProp (node, (xmlChar *)"line_color_field", (xmlChar *)line_color_node->key); } else { @@ -1430,7 +1438,7 @@ xml_create_object_image (xmlNodePtr root, gl_debug (DEBUG_XML, "START"); - node = xmlNewChild (root, ns, "Object-image", NULL); + node = xmlNewChild (root, ns, (xmlChar *)"Object-image", NULL); /* position attrs */ gl_label_object_get_position (object, &x, &y); @@ -1445,9 +1453,9 @@ xml_create_object_image (xmlNodePtr root, /* src OR field attr */ filename = gl_label_image_get_filename (GL_LABEL_IMAGE(object)); if (filename->field_flag) { - xmlSetProp (node, "field", filename->data); + xmlSetProp (node, (xmlChar *)"field", (xmlChar *)filename->data); } else { - xmlSetProp (node, "src", filename->data); + xmlSetProp (node, (xmlChar *)"src", (xmlChar *)filename->data); } gl_text_node_free (&filename); @@ -1484,7 +1492,7 @@ xml_create_object_barcode (xmlNodePtr root, gl_debug (DEBUG_XML, "START"); - node = xmlNewChild (root, ns, "Object-barcode", NULL); + node = xmlNewChild (root, ns, (xmlChar *)"Object-barcode", NULL); /* position attrs */ gl_label_object_get_position (object, &x, &y); @@ -1499,7 +1507,7 @@ xml_create_object_barcode (xmlNodePtr root, /* Barcode properties attrs */ gl_label_barcode_get_props (GL_LABEL_BARCODE(object), &id, &text_flag, &checksum_flag, &format_digits); - xmlSetProp (node, "style", id); + xmlSetProp (node, (xmlChar *)"style", (xmlChar *)id); gl_xml_set_prop_boolean (node, "text", text_flag); gl_xml_set_prop_boolean (node, "checksum", checksum_flag); @@ -1508,7 +1516,7 @@ xml_create_object_barcode (xmlNodePtr root, color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); if (color_node->field_flag) { - xmlSetProp (node, "color_field", color_node->key); + xmlSetProp (node, (xmlChar *)"color_field", (xmlChar *)color_node->key); } else { @@ -1520,10 +1528,10 @@ xml_create_object_barcode (xmlNodePtr root, /* data OR field attr */ text_node = gl_label_barcode_get_data (GL_LABEL_BARCODE(object)); if (text_node->field_flag) { - xmlSetProp (node, "field", text_node->data); + xmlSetProp (node, (xmlChar *)"field", (xmlChar *)text_node->data); gl_xml_set_prop_int (node, "format", format_digits); } else { - xmlSetProp (node, "data", text_node->data); + xmlSetProp (node, (xmlChar *)"data", (xmlChar *)text_node->data); } gl_text_node_free (&text_node); @@ -1556,14 +1564,14 @@ xml_create_merge_fields (xmlNodePtr root, merge = gl_label_get_merge (label); - node = xmlNewChild (root, ns, "Merge", NULL); + node = xmlNewChild (root, ns, (xmlChar *)"Merge", NULL); string = gl_merge_get_name (merge); - xmlSetProp (node, "type", string); + xmlSetProp (node, (xmlChar *)"type", (xmlChar *)string); g_free (string); string = gl_merge_get_src (merge); - xmlSetProp (node, "src", string); + xmlSetProp (node, (xmlChar *)"src", (xmlChar *)string); g_free (string); g_object_unref (G_OBJECT(merge)); @@ -1585,7 +1593,7 @@ xml_create_data (xmlNodePtr root, gl_debug (DEBUG_XML, "START"); - node = xmlNewChild (root, ns, "Data", NULL); + node = xmlNewChild (root, ns, (xmlChar *)"Data", NULL); pixbuf_cache = gl_label_get_pixbuf_cache (label); name_list = gl_pixbuf_cache_get_name_list (pixbuf_cache); @@ -1629,9 +1637,9 @@ xml_create_pixdata (xmlNodePtr root, stream = gdk_pixdata_serialize (pixdata, &stream_length); base64 = gl_base64_encode (stream, stream_length); - node = xmlNewChild (root, ns, "Pixdata", base64); - xmlSetProp (node, "name", name); - xmlSetProp (node, "encoding", "Base64"); + node = xmlNewChild (root, ns, (xmlChar *)"Pixdata", (xmlChar *)base64); + xmlSetProp (node, (xmlChar *)"name", (xmlChar *)name); + xmlSetProp (node, (xmlChar *)"encoding", (xmlChar *)"Base64"); gl_pixbuf_cache_remove_pixbuf (pixbuf_cache, name); @@ -1664,7 +1672,7 @@ xml_create_toplevel_span (xmlNodePtr root, glTextNode *text_node; xmlNodePtr child; - node = xmlNewChild (root, ns, "Span", NULL); + node = xmlNewChild (root, ns, (xmlChar *)"Span", NULL); /* All span attrs at top level. */ font_family = gl_label_object_get_font_family (GL_LABEL_OBJECT(object_text)); @@ -1676,7 +1684,7 @@ xml_create_toplevel_span (xmlNodePtr root, color_node = gl_label_object_get_text_color (GL_LABEL_OBJECT(object_text)); if (color_node->field_flag) { - xmlSetProp (node, "color_field", color_node->key); + xmlSetProp (node, (xmlChar *)"color_field", (xmlChar *)color_node->key); } else { @@ -1685,9 +1693,9 @@ xml_create_toplevel_span (xmlNodePtr root, gl_color_node_free (&color_node); just = gl_label_object_get_text_alignment (GL_LABEL_OBJECT(object_text)); - xmlSetProp (node, "font_family", font_family); + xmlSetProp (node, (xmlChar *)"font_family", (xmlChar *)font_family); gl_xml_set_prop_double (node, "font_size", font_size); - xmlSetProp (node, "font_weight", gl_util_weight_to_string (font_weight)); + xmlSetProp (node, (xmlChar *)"font_weight", (xmlChar *)gl_util_weight_to_string (font_weight)); gl_xml_set_prop_boolean (node, "font_italic", font_italic_flag); gl_xml_set_prop_double (node, "line_spacing", text_line_spacing); @@ -1701,16 +1709,16 @@ xml_create_toplevel_span (xmlNodePtr root, text_node = (glTextNode *) p_node->data; if (text_node->field_flag) { - child = xmlNewChild (node, ns, "Field", NULL); - xmlSetProp (child, "name", text_node->data); + child = xmlNewChild (node, ns, (xmlChar *)"Field", NULL); + xmlSetProp (child, (xmlChar *)"name", (xmlChar *)text_node->data); } else { - xmlNodeAddContent (node, text_node->data); + xmlNodeAddContent (node, (xmlChar *)text_node->data); } } if ( p_line->next ) { - child = xmlNewChild (node, ns, "NL", NULL); + child = xmlNewChild (node, ns, (xmlChar *)"NL", NULL); } } -- 2.39.5