+2005-10-22 Jim Evins <evins@snaught.com>
+
+ * 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 <evins@snaught.com>
* src/glabels.c: (main):
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);
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);
}
}
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);
}
} 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);
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;
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);
}
}
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);
}
} 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;
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);
}
}
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);
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
{
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);
}
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) {
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;
}
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 );
}
}
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);
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) {
{
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);
{
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);
{
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);
{
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);
{
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);
}
#include <glib/gi18n.h>
#include <glib/gstrfuncs.h>
#include <glib/gmessages.h>
+#include <string.h>
#include "libglabels-private.h"
/*========================================================*/
typedef struct {
- gchar *name;
+ xmlChar *name;
gdouble points_per_unit;
} UnitTableEntry;
/* 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},
};
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;
}
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;
}
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;
}
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;
}
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;
/* 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);
}
const gchar *property,
gboolean val)
{
- xmlSetProp (node, property, (val ? "True" : "False"));
+ xmlSetProp (node, (xmlChar *)property, (xmlChar *)(val ? "True" : "False"));
}
/**
gchar *string;
string = g_strdup_printf ("%d", val);
- xmlSetProp (node, property, string);
+ xmlSetProp (node, (xmlChar *)property, (xmlChar *)string);
g_free (string);
}
gchar *string;
string = g_strdup_printf ("0x%08x", val);
- xmlSetProp (node, property, string);
+ xmlSetProp (node, (xmlChar *)property, (xmlChar *)string);
g_free (string);
}
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);
}
} while (*in && digit4 != '=');
- return out;
+ return (guchar *)out;
}
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;
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) {
}
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);
glyphlist = gnome_glyphlist_from_text_dumb (font, 0,
0.0, 0.0,
- line[i]);
+ (guchar *)line[i]);
gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox);
#include <gtk/gtkeditable.h>
#include <gtk/gtkcombobox.h>
#include <gtk/gtktogglebutton.h>
+#include <string.h>
#include <math.h>
#include "prefs.h"
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);
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);
"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);
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. */
/* 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);
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);
}
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]);
+ (guchar *)line[i]);
gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox);
w = bbox.x1;
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);
}
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,
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 {
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,
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);
#include "recent.h"
+#include <string.h>
+
#include "prefs.h"
#include "debug.h"
#include "template-designer.h"
#include <glib/gi18n.h>
-#include <math.h>
#include <glade/glade-xml.h>
#include <libgnome/gnome-program.h>
#include <libgnomeui/gnome-druid.h>
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkcombobox.h>
#include <gtk/gtkspinbutton.h>
+#include <string.h>
+#include <math.h>
#include "prefs.h"
#include <libglabels/paper.h>
#include "text-node.h"
+#include <string.h>
+
#include "merge.h"
#include "debug.h"
#include <gtk/gtktoggletoolbutton.h>
#include <libgnomeprint/gnome-font.h>
#include <gtk/gtktooltips.h>
+#include <string.h>
#include "util.h"
#include "mygal/widget-color-combo.h"
#include <gconf/gconf-client.h>
#include "recent-files/egg-recent-view.h"
#include "recent-files/egg-recent-view-uimanager.h"
+#include <string.h>
#include "ui-util.h"
#include "ui-commands.h"
#include <glib/glist.h>
#include <gtk/gtkmenu.h>
#include <libgnomeprint/gnome-glyphlist.h>
+#include <string.h>
+#include <math.h>
#include "canvas-hacktext.h"
#include "view-highlight.h"
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 =
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);
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 (),
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));
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 =
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 =
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 =
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 =
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 =
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);
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;
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);
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);
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);
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);
}
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;
#include <gtk/gtklabel.h>
#include <gtk/gtkcombobox.h>
#include <gtk/gtksizegroup.h>
+#include <string.h>
#include "hig.h"
#include "wdgt-mini-preview.h"
*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;
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);
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 */
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);
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");
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)) {
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 =
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);
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);
}
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);
*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;
/* 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);
}
}
/* 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;
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)) {
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)) {
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);
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 ();
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)) {
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);
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);
}
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);
}
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);
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);
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)) {
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);
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);
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);
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)) {
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;
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);
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);
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");
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");
} 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);
*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;
/* 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);
}
}
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);
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)) {
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)) {
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);
/* 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 {
gdouble line_width;
glColorNode *line_color_node;
gdouble affine[6];
- gchar *string;
+ xmlChar *string;
glColorNode *fill_color_node;
gl_debug (DEBUG_XML, "START");
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);
}
/* 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);
}
gdouble line_width;
glColorNode *line_color_node;
gdouble affine[6];
- gchar *string;
+ xmlChar *string;
glColorNode *fill_color_node;
gl_debug (DEBUG_XML, "START");
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);
}
/* 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);
}
gdouble line_width;
glColorNode *line_color_node;
gdouble affine[6];
- gchar *string;
+ xmlChar *string;
gl_debug (DEBUG_XML, "START");
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);
}
GObject *object;
gdouble x, y;
gdouble w, h;
- gchar *string;
+ xmlChar *string;
glTextNode *filename;
gdouble affine[6];
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");
}
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);
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);
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);
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)) {
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);
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);
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 */
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);
/* 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);
/* 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);
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);
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) {
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);
/* 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));
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);
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
{
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
{
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);
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
{
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
{
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);
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
{
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);
/* 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);
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);
/* 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);
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
{
/* 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);
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));
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);
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);
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));
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
{
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);
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);
}
}