+2007-09-27 Jim Evins <evins@snaught.com>
+
+ * docs/libglabels/libglabels-decl-list.txt:
+ * docs/libglabels/libglabels-docs.sgml:
+ * docs/libglabels/libglabels-sections.txt:
+ * docs/libglabels/libglabels-undocumented.txt:
+ * docs/libglabels/tmpl/enums.sgml:
+ * docs/libglabels/tmpl/init.sgml:
+ * docs/libglabels/tmpl/libglabels-unused.sgml:
+ * docs/libglabels/tmpl/paper.sgml:
+ * docs/libglabels/tmpl/template.sgml:
+ * docs/libglabels/tmpl/xml-paper.sgml:
+ * docs/libglabels/tmpl/xml-template.sgml:
+ * docs/libglabels/tmpl/xml.sgml:
+ * libglabels/Makefile.am:
+ * libglabels/category.c:
+ * libglabels/category.h:
+ * libglabels/enums.h:
+ * libglabels/init.c:
+ * libglabels/init.h:
+ * libglabels/libglabels-private.h:
+ * libglabels/libglabels.h:
+ * libglabels/paper.c:
+ * libglabels/paper.h:
+ * libglabels/template.c:
+ * libglabels/template.h:
+ * libglabels/xml-category.c:
+ * libglabels/xml-category.h:
+ * libglabels/xml-paper.c:
+ * libglabels/xml-paper.h:
+ * libglabels/xml-template.c:
+ * libglabels/xml-template.h:
+ * libglabels/xml.c:
+ * libglabels/xml.h:
+ * src/cairo-label-path.c:
+ * src/cairo-label-path.h:
+ * src/cairo-markup-path.c:
+ * src/cairo-markup-path.h:
+ * src/file.c:
+ * src/glabels-batch.c:
+ * src/glabels.c:
+ * src/label-object.c:
+ * src/label.c:
+ * src/label.h:
+ * src/mini-preview-pixbuf-cache.c:
+ * src/mini-preview-pixbuf.c:
+ * src/mini-preview-pixbuf.h:
+ * src/prefs-dialog.c:
+ * src/prefs-model.c:
+ * src/prefs-model.h:
+ * src/prefs.c:
+ * src/prefs.h:
+ * src/print-op.c:
+ * src/print.c:
+ * src/template-designer.c:
+ * src/view-barcode.c:
+ * src/view-box.c:
+ * src/view-ellipse.c:
+ * src/view-image.c:
+ * src/view-line.c:
+ * src/view.c:
+ * src/wdgt-media-select.c:
+ * src/wdgt-mini-preview.c:
+ * src/wdgt-mini-preview.h:
+ * src/wdgt-print-copies.c:
+ * src/wdgt-print-merge.c:
+ * src/wdgt-rotate-label.c:
+ * src/xml-label-04.c:
+ * src/xml-label.c:
+ Major cleanup of libglabels API -- this breaks API compatibility with older
+ development and stable versions -- as far as I know, there are currently
+ no external users of this library yet.
+
2007-09-14 Jim Evins <evins@snaught.com>
* src/marshal.list:
<SECTION>
<FILE>xml</FILE>
-GL_XML_NAME_SPACE
-gl_xml_get_prop_string
-gl_xml_get_prop_i18n_string
-gl_xml_get_prop_double
-gl_xml_get_prop_boolean
-gl_xml_get_prop_int
-gl_xml_get_prop_uint
-gl_xml_get_prop_length
-gl_xml_set_prop_string
-gl_xml_set_prop_double
-gl_xml_set_prop_boolean
-gl_xml_set_prop_int
-gl_xml_set_prop_uint_hex
-gl_xml_set_prop_length
-gl_xml_is_node
-gl_xml_get_node_content
-gl_xml_set_default_units
+LGL_XML_NAME_SPACE
+lgl_xml_get_prop_string
+lgl_xml_get_prop_i18n_string
+lgl_xml_get_prop_double
+lgl_xml_get_prop_boolean
+lgl_xml_get_prop_int
+lgl_xml_get_prop_uint
+lgl_xml_get_prop_length
+lgl_xml_set_prop_string
+lgl_xml_set_prop_double
+lgl_xml_set_prop_boolean
+lgl_xml_set_prop_int
+lgl_xml_set_prop_uint_hex
+lgl_xml_set_prop_length
+lgl_xml_is_node
+lgl_xml_get_node_content
+lgl_xml_set_default_units
</SECTION>
<SECTION>
<FILE>xml-template</FILE>
-gl_xml_template_read_templates_from_file
-gl_xml_template_parse_templates_doc
-gl_xml_template_parse_template_node
-gl_xml_template_write_templates_to_file
-gl_xml_template_write_template_to_file
-gl_xml_template_create_templates_doc
-gl_xml_template_create_template_node
+lgl_xml_template_read_templates_from_file
+lgl_xml_template_parse_templates_doc
+lgl_xml_template_parse_template_node
+lgl_xml_template_write_templates_to_file
+lgl_xml_template_write_template_to_file
+lgl_xml_template_create_templates_doc
+lgl_xml_template_create_template_node
</SECTION>
<SECTION>
<SECTION>
<FILE>enums</FILE>
-glUnitsType
+lglUnitsType
</SECTION>
<SECTION>
<FILE>template</FILE>
-glTemplate
-glTemplateLabelType
-glTemplateLayout
-glTemplateMarkup
-glTemplateOrigin
-glTemplateLabelShape
-glTemplateMarkupType
-gl_template_init
-gl_template_register
-gl_template_get_name_list_unique
-gl_template_get_name_list_all
-gl_template_free_name_list
-gl_template_from_name
-gl_template_get_first_label_type
-gl_template_does_page_size_match
-gl_template_does_category_match
-gl_template_get_label_size
-gl_template_get_n_labels
-gl_template_get_origins
-gl_template_new
-gl_template_add_category
-gl_template_add_label_type
-gl_template_add_alias
-gl_template_rect_label_type_new
-gl_template_round_label_type_new
-gl_template_cd_label_type_new
-gl_template_add_layout
-gl_template_add_markup
-gl_template_layout_new
-gl_template_markup_margin_new
-gl_template_markup_line_new
-gl_template_markup_circle_new
-gl_template_dup
-gl_template_free
-gl_template_label_type_dup
-gl_template_label_type_free
-gl_template_layout_dup
-gl_template_layout_free
-gl_template_markup_dup
-gl_template_markup_free
-gl_template_print_known_templates
-gl_template_print_aliases
+lglTemplate
+lglTemplateFrameAll
+lglTemplateFrameRect
+lglTemplateFrameRound
+lglTemplateFrameCD
+lglTemplateLayout
+lglTemplateMarkupMargin
+lglTemplateMarkupLine
+lglTemplateMarkupCircle
+lglTemplateMarkupRect
+lglTemplateOrigin
+lglTemplateFrameShape
+lglTemplateFrame
+lglTemplateMarkupType
+lglTemplateMarkup
+lgl_template_init
+lgl_template_register
+lgl_template_get_name_list_unique
+lgl_template_get_name_list_all
+lgl_template_free_name_list
+lgl_template_from_name
+lgl_template_get_first_frame
+lgl_template_does_page_size_match
+lgl_template_does_category_match
+lgl_template_frame_get_size
+lgl_template_frame_get_n_labels
+lgl_template_frame_get_origins
+lgl_template_new
+lgl_template_add_category
+lgl_template_add_frame
+lgl_template_add_alias
+lgl_template_frame_rect_new
+lgl_template_frame_round_new
+lgl_template_frame_cd_new
+lgl_template_add_layout
+lgl_template_add_markup
+lgl_template_layout_new
+lgl_template_markup_margin_new
+lgl_template_markup_line_new
+lgl_template_markup_circle_new
+lgl_template_markup_rect_new
+lgl_template_dup
+lgl_template_free
+lgl_template_frame_dup
+lgl_template_frame_free
+lgl_template_layout_dup
+lgl_template_layout_free
+lgl_template_markup_dup
+lgl_template_markup_free
+lgl_template_print_known_templates
+lgl_template_print_aliases
</SECTION>
<SECTION>
<FILE>xml-paper</FILE>
-gl_xml_paper_read_papers_from_file
-gl_xml_paper_parse_papers_doc
-gl_xml_paper_parse_paper_node
+lgl_xml_paper_read_papers_from_file
+lgl_xml_paper_parse_papers_doc
+lgl_xml_paper_parse_paper_node
</SECTION>
<SECTION>
<FILE>xml-category</FILE>
-gl_xml_category_read_categories_from_file
-gl_xml_category_parse_categories_doc
-gl_xml_category_parse_category_node
+lgl_xml_category_read_categories_from_file
+lgl_xml_category_parse_categories_doc
+lgl_xml_category_parse_category_node
+</SECTION>
+
+<SECTION>
+<FILE>init</FILE>
+lgl_init
</SECTION>
<SECTION>
<FILE>category</FILE>
-glCategory
-gl_category_init
-gl_category_new
-gl_category_dup
-gl_category_free
-gl_category_get_name_list
-gl_category_free_name_list
-gl_category_from_name
-gl_category_from_id
-gl_category_lookup_id_from_name
-gl_category_lookup_name_from_id
+lglCategory
+lgl_category_init
+lgl_category_new
+lgl_category_dup
+lgl_category_free
+lgl_category_get_name_list
+lgl_category_free_name_list
+lgl_category_from_name
+lgl_category_from_id
+lgl_category_lookup_id_from_name
+lgl_category_lookup_name_from_id
</SECTION>
<SECTION>
<FILE>paper</FILE>
-glPaper
-gl_paper_init
-gl_paper_new
-gl_paper_dup
-gl_paper_free
-gl_paper_get_id_list
-gl_paper_free_id_list
-gl_paper_get_name_list
-gl_paper_free_name_list
-gl_paper_is_id_known
-gl_paper_is_id_other
-gl_paper_from_id
-gl_paper_from_name
-gl_paper_lookup_id_from_name
-gl_paper_lookup_name_from_id
-gl_paper_print_known_papers
+lglPaper
+lgl_paper_init
+lgl_paper_new
+lgl_paper_dup
+lgl_paper_free
+lgl_paper_get_id_list
+lgl_paper_free_id_list
+lgl_paper_get_name_list
+lgl_paper_free_name_list
+lgl_paper_is_id_known
+lgl_paper_is_id_other
+lgl_paper_from_id
+lgl_paper_from_name
+lgl_paper_lookup_id_from_name
+lgl_paper_lookup_name_from_id
+lgl_paper_print_known_papers
</SECTION>
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
+
<bookinfo>
<title>LibGlabels Reference Manual</title>
</bookinfo>
<chapter>
- <title>LibGlabels</title>
- <xi:include href="xml/enums.xml"/>
- <xi:include href="xml/paper.xml"/>
+ <title>Basic LibGlabels Usage</title>
+ <xi:include href="xml/init.xml"/>
<xi:include href="xml/template.xml"/>
+ <xi:include href="xml/paper.xml"/>
+ <xi:include href="xml/category.xml"/>
+ <xi:include href="xml/enums.xml"/>
+ </chapter>
+
+ <chapter>
+ <title>Working Directly With LibGlabels XML</title>
<xi:include href="xml/xml-paper.xml"/>
+ <xi:include href="xml/xml-category.xml"/>
<xi:include href="xml/xml-template.xml"/>
<xi:include href="xml/xml.xml"/>
</chapter>
+
</book>
<SECTION>
-<FILE>libglabels</FILE>
+<FILE>init</FILE>
<INCLUDE>libglabels/libglabels.h</INCLUDE>
+lgl_init
</SECTION>
<SECTION>
<FILE>enums</FILE>
<INCLUDE>libglabels/enums.h</INCLUDE>
-glUnitsType
+lglUnitsType
</SECTION>
<SECTION>
<FILE>paper</FILE>
<INCLUDE>libglabels/paper.h</INCLUDE>
-glPaper
-gl_paper_init
-gl_paper_new
-gl_paper_dup
-gl_paper_free
-gl_paper_get_id_list
-gl_paper_free_id_list
-gl_paper_get_name_list
-gl_paper_free_name_list
-gl_paper_is_id_known
-gl_paper_is_id_other
-gl_paper_from_id
-gl_paper_from_name
-gl_paper_lookup_id_from_name
-gl_paper_lookup_name_from_id
-gl_paper_print_known_papers
+lglPaper
+lgl_paper_init
+lgl_paper_new
+lgl_paper_dup
+lgl_paper_free
+lgl_paper_get_id_list
+lgl_paper_free_id_list
+lgl_paper_get_name_list
+lgl_paper_free_name_list
+lgl_paper_is_id_known
+lgl_paper_is_id_other
+lgl_paper_from_id
+lgl_paper_from_name
+lgl_paper_lookup_id_from_name
+lgl_paper_lookup_name_from_id
+lgl_paper_print_known_papers
+</SECTION>
+
+<SECTION>
+<FILE>category</FILE>
+<INCLUDE>libglabels/category.h</INCLUDE>
+lglCategory
+lgl_category_init
+lgl_category_new
+lgl_category_dup
+lgl_category_free
+lgl_category_get_name_list
+lgl_category_free_name_list
+lgl_category_from_name
+lgl_category_from_id
+lgl_category_lookup_id_from_name
+lgl_category_lookup_name_from_id
</SECTION>
<SECTION>
<FILE>template</FILE>
<INCLUDE>libglabels/template.h</INCLUDE>
-glTemplate
-glTemplateLabelType
-glTemplateLayout
-glTemplateMarkup
-glTemplateOrigin
-glTemplateLabelShape
-glTemplateMarkupType
-gl_template_init
-gl_template_register
-gl_template_get_name_list
-gl_template_free_name_list
-gl_template_from_name
-gl_template_get_name_with_desc
-gl_template_get_first_label_type
-gl_template_get_label_size
-gl_template_get_n_labels
-gl_template_get_origins
-gl_template_new
-gl_template_add_label_type
-gl_template_add_alias
-gl_template_rect_label_type_new
-gl_template_round_label_type_new
-gl_template_cd_label_type_new
-gl_template_add_layout
-gl_template_add_markup
-gl_template_layout_new
-gl_template_markup_margin_new
-gl_template_markup_line_new
-gl_template_markup_circle_new
-gl_template_dup
-gl_template_free
-gl_template_label_type_dup
-gl_template_label_type_free
-gl_template_layout_dup
-gl_template_layout_free
-gl_template_markup_dup
-gl_template_markup_free
-gl_template_print_known_templates
-gl_template_print_aliases
+lglTemplate
+lglTemplateFrameAll
+lglTemplateFrameRect
+lglTemplateFrameRound
+lglTemplateFrameCD
+lglTemplateLayout
+lglTemplateMarkupMargin
+lglTemplateMarkupLine
+lglTemplateMarkupCircle
+lglTemplateMarkupRect
+lglTemplateOrigin
+lglTemplateFrameShape
+lglTemplateFrame
+lglTemplateMarkupType
+lglTemplateMarkup
+lgl_template_init
+lgl_template_register
+lgl_template_get_name_list_unique
+lgl_template_get_name_list_all
+lgl_template_free_name_list
+lgl_template_from_name
+lgl_template_get_first_frame
+lgl_template_does_page_size_match
+lgl_template_does_category_match
+lgl_template_frame_get_size
+lgl_template_frame_get_n_labels
+lgl_template_frame_get_origins
+lgl_template_new
+lgl_template_add_category
+lgl_template_add_frame
+lgl_template_add_alias
+lgl_template_frame_rect_new
+lgl_template_frame_round_new
+lgl_template_frame_cd_new
+lgl_template_add_layout
+lgl_template_add_markup
+lgl_template_layout_new
+lgl_template_markup_margin_new
+lgl_template_markup_line_new
+lgl_template_markup_circle_new
+lgl_template_markup_rect_new
+lgl_template_dup
+lgl_template_free
+lgl_template_frame_dup
+lgl_template_frame_free
+lgl_template_layout_dup
+lgl_template_layout_free
+lgl_template_markup_dup
+lgl_template_markup_free
+lgl_template_print_known_templates
+lgl_template_print_aliases
</SECTION>
<SECTION>
<FILE>xml-paper</FILE>
<INCLUDE>libglabels/xml-paper.h</INCLUDE>
-gl_xml_paper_read_papers_from_file
-gl_xml_paper_parse_papers_doc
-gl_xml_paper_parse_paper_node
+lgl_xml_paper_read_papers_from_file
+lgl_xml_paper_parse_papers_doc
+lgl_xml_paper_parse_paper_node
+</SECTION>
+
+<SECTION>
+<FILE>xml-category</FILE>
+<INCLUDE>libglabels/xml-category.h</INCLUDE>
+lgl_xml_category_read_categories_from_file
+lgl_xml_category_parse_categories_doc
+lgl_xml_category_parse_category_node
</SECTION>
<SECTION>
<FILE>xml-template</FILE>
<INCLUDE>libglabels/xml-templates.h</INCLUDE>
-gl_xml_template_read_templates_from_file
-gl_xml_template_parse_templates_doc
-gl_xml_template_parse_template_node
-gl_xml_template_write_templates_to_file
-gl_xml_template_write_template_to_file
-gl_xml_template_create_templates_doc
-gl_xml_template_create_template_node
+lgl_xml_template_read_templates_from_file
+lgl_xml_template_parse_templates_doc
+lgl_xml_template_parse_template_node
+lgl_xml_template_write_templates_to_file
+lgl_xml_template_write_template_to_file
+lgl_xml_template_create_templates_doc
+lgl_xml_template_create_template_node
</SECTION>
<SECTION>
<FILE>xml</FILE>
<INCLUDE>libglabels/xml.h</INCLUDE>
-gl_xml_get_prop_double
-gl_xml_get_prop_boolean
-gl_xml_get_prop_int
-gl_xml_get_prop_uint
-gl_xml_get_prop_length
-gl_xml_set_prop_double
-gl_xml_set_prop_boolean
-gl_xml_set_prop_int
-gl_xml_set_prop_uint_hex
-gl_xml_set_prop_length
-gl_xml_set_default_units
+LGL_XML_NAME_SPACE
+lgl_xml_get_prop_string
+lgl_xml_get_prop_i18n_string
+lgl_xml_get_prop_double
+lgl_xml_get_prop_boolean
+lgl_xml_get_prop_int
+lgl_xml_get_prop_uint
+lgl_xml_get_prop_length
+lgl_xml_set_prop_string
+lgl_xml_set_prop_double
+lgl_xml_set_prop_boolean
+lgl_xml_set_prop_int
+lgl_xml_set_prop_uint_hex
+lgl_xml_set_prop_length
+lgl_xml_is_node
+lgl_xml_get_node_content
+lgl_xml_set_default_units
</SECTION>
-52% symbol docs coverage.
-46 symbols documented.
-1 symbols incomplete.
-43 not documented.
+55% symbol docs coverage.
+71 symbols documented.
+0 symbols incomplete.
+57 not documented.
-glPaper
-glTemplate
-glTemplateLabelShape
-glTemplateLabelType
-glTemplateLayout
-glTemplateMarkup
-glTemplateMarkupType
-glTemplateOrigin
-glUnitsType (GL_UNITS_POINT, GL_UNITS_INCH, GL_UNITS_MM, GL_UNITS_CM, GL_UNITS_PICA, GL_UNITS_FIRST, GL_UNITS_LAST)
-gl_template_add_alias
-gl_template_add_label_type
-gl_template_add_layout
-gl_template_add_markup
-gl_template_cd_label_type_new
-gl_template_dup
-gl_template_free
-gl_template_free_name_list
-gl_template_from_name
-gl_template_get_first_label_type
-gl_template_get_label_size
-gl_template_get_n_labels
-gl_template_get_origins
-gl_template_init
-gl_template_label_type_dup
-gl_template_label_type_free
-gl_template_layout_dup
-gl_template_layout_free
-gl_template_layout_new
-gl_template_markup_circle_new
-gl_template_markup_dup
-gl_template_markup_free
-gl_template_markup_line_new
-gl_template_markup_margin_new
-gl_template_new
-gl_template_print_aliases
-gl_template_print_known_templates
-gl_template_rect_label_type_new
-gl_template_register
-gl_template_round_label_type_new
-gl_xml_template_create_templates_doc
+LGL_XML_NAME_SPACE
+lglCategory
+lglPaper
+lglTemplate
+lglTemplateFrame
+lglTemplateFrameAll
+lglTemplateFrameCD
+lglTemplateFrameRect
+lglTemplateFrameRound
+lglTemplateFrameShape
+lglTemplateLayout
+lglTemplateMarkup
+lglTemplateMarkupCircle
+lglTemplateMarkupLine
+lglTemplateMarkupMargin
+lglTemplateMarkupRect
+lglTemplateMarkupType
+lglTemplateOrigin
+lglUnitsType
+lgl_template_add_alias
+lgl_template_add_category
+lgl_template_add_frame
+lgl_template_add_layout
+lgl_template_add_markup
+lgl_template_does_category_match
+lgl_template_does_page_size_match
+lgl_template_dup
+lgl_template_frame_cd_new
+lgl_template_frame_dup
+lgl_template_frame_free
+lgl_template_frame_get_n_labels
+lgl_template_frame_get_origins
+lgl_template_frame_get_size
+lgl_template_frame_rect_new
+lgl_template_frame_round_new
+lgl_template_free
+lgl_template_free_name_list
+lgl_template_from_name
+lgl_template_get_first_frame
+lgl_template_get_name_list_all
+lgl_template_get_name_list_unique
+lgl_template_init
+lgl_template_layout_dup
+lgl_template_layout_free
+lgl_template_layout_new
+lgl_template_markup_circle_new
+lgl_template_markup_dup
+lgl_template_markup_free
+lgl_template_markup_line_new
+lgl_template_markup_margin_new
+lgl_template_markup_rect_new
+lgl_template_new
+lgl_template_print_aliases
+lgl_template_print_known_templates
+lgl_template_register
+lgl_xml_template_create_templates_doc
-libglabels:Long_Description
-libglabels:Short_Description
-template:Long_Description
-template:Short_Description
+init:Long_Description
<!-- ##### SECTION Stability_Level ##### -->
-<!-- ##### ENUM glUnitsType ##### -->
+<!-- ##### ENUM lglUnitsType ##### -->
<para>
-Enumerations for the units of length supported by libglabels. Internally
-all lengths are in points. Externally libglabels supports points ("pt"),
-inches ("in"), millimeters ("mm"), centimeters ("cm"), and picas ("pc").
-These units are identical to the absolute length units supported in
-the CSS2 Specification (Section 4.3.2).
+
</para>
-@GL_UNITS_POINT:
-@GL_UNITS_INCH:
-@GL_UNITS_MM:
-@GL_UNITS_CM:
-@GL_UNITS_PICA:
-@GL_UNITS_FIRST:
-@GL_UNITS_LAST:
+@LGL_UNITS_POINT:
+@LGL_UNITS_INCH:
+@LGL_UNITS_MM:
+@LGL_UNITS_CM:
+@LGL_UNITS_PICA:
+@LGL_UNITS_FIRST:
+@LGL_UNITS_LAST:
--- /dev/null
+<!-- ##### SECTION Title ##### -->
+Library Initialization
+
+<!-- ##### SECTION Short_Description ##### -->
+Initialization of the LibGlabels library.
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### FUNCTION lgl_init ##### -->
+<para>
+
+</para>
+
+
+
+<!-- ##### SECTION ./tmpl/libglabels.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/libglabels.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/libglabels.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/libglabels.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/libglabels.sgml:Title ##### -->
+libglabels
+
+
<!-- ##### MACRO GL_XML_NAME_SPACE ##### -->
<para>
</para>
-<!-- ##### FUNCTION gl_template_get_name_list ##### -->
+<!-- ##### STRUCT glCategory ##### -->
+<para>
+
+</para>
+
+@id:
+@name:
+
+<!-- ##### STRUCT glPaper ##### -->
+<para>
+
+</para>
+
+@id:
+@name:
+@width:
+@height:
+
+<!-- ##### STRUCT glTemplate ##### -->
+<para>
+
+</para>
+
+@name:
+@description:
+@page_size:
+@page_width:
+@page_height:
+@categories:
+@frames:
+@aliases:
+
+<!-- ##### UNION glTemplateFrame ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### STRUCT glTemplateFrameAll ##### -->
+<para>
+
+</para>
+
+@shape:
+@id:
+@layouts:
+@markups:
+
+<!-- ##### STRUCT glTemplateFrameCD ##### -->
+<para>
+
+</para>
+
+@shape:
+@id:
+@layouts:
+@markups:
+@r1:
+@r2:
+@w:
+@h:
+@waste:
+
+<!-- ##### STRUCT glTemplateFrameRect ##### -->
+<para>
+
+</para>
+
+@shape:
+@id:
+@layouts:
+@markups:
+@w:
+@h:
+@r:
+@x_waste:
+@y_waste:
+
+<!-- ##### STRUCT glTemplateFrameRound ##### -->
+<para>
+
+</para>
+
+@shape:
+@id:
+@layouts:
+@markups:
+@r:
+@waste:
+
+<!-- ##### ENUM glTemplateFrameShape ##### -->
+<para>
+
+</para>
+
+@GL_TEMPLATE_FRAME_SHAPE_RECT:
+@GL_TEMPLATE_FRAME_SHAPE_ROUND:
+@GL_TEMPLATE_FRAME_SHAPE_CD:
+
+<!-- ##### ENUM glTemplateLabelShape ##### -->
+<para>
+
+</para>
+
+@GL_TEMPLATE_SHAPE_RECT:
+@GL_TEMPLATE_SHAPE_ROUND:
+@GL_TEMPLATE_SHAPE_CD:
+
+<!-- ##### STRUCT glTemplateLabelType ##### -->
+<para>
+
+</para>
+
+@id:
+@layouts:
+@markups:
+@shape:
+
+<!-- ##### STRUCT glTemplateLayout ##### -->
+<para>
+
+</para>
+
+@nx:
+@ny:
+@x0:
+@y0:
+@dx:
+@dy:
+
+<!-- ##### UNION glTemplateMarkup ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### STRUCT glTemplateMarkupCircle ##### -->
+<para>
+
+</para>
+
+@type:
+@x0:
+@y0:
+@r:
+
+<!-- ##### STRUCT glTemplateMarkupLine ##### -->
+<para>
+
+</para>
+
+@type:
+@x1:
+@y1:
+@x2:
+@y2:
+
+<!-- ##### STRUCT glTemplateMarkupMargin ##### -->
+<para>
+
+</para>
+
+@type:
+@size:
+
+<!-- ##### STRUCT glTemplateMarkupRect ##### -->
+<para>
+
+</para>
+
+@type:
+@x1:
+@y1:
+@w:
+@h:
+@r:
+
+<!-- ##### ENUM glTemplateMarkupType ##### -->
+<para>
+
+</para>
+
+@GL_TEMPLATE_MARKUP_MARGIN:
+@GL_TEMPLATE_MARKUP_LINE:
+@GL_TEMPLATE_MARKUP_CIRCLE:
+@GL_TEMPLATE_MARKUP_RECT:
+
+<!-- ##### STRUCT glTemplateOrigin ##### -->
+<para>
+
+</para>
+
+@x:
+@y:
+
+<!-- ##### ENUM glUnitsType ##### -->
+<para>
+Enumerations for the units of length supported by libglabels. Internally
+all lengths are in points. Externally libglabels supports points ("pt"),
+inches ("in"), millimeters ("mm"), centimeters ("cm"), and picas ("pc").
+These units are identical to the absolute length units supported in
+the CSS2 Specification (Section 4.3.2).
+</para>
+
+@GL_UNITS_POINT:
+@GL_UNITS_INCH:
+@GL_UNITS_MM:
+@GL_UNITS_CM:
+@GL_UNITS_PICA:
+@GL_UNITS_FIRST:
+@GL_UNITS_LAST:
+
+<!-- ##### FUNCTION gl_category_dup ##### -->
+<para>
+
+</para>
+
+@orig:
+@Returns:
+
+<!-- ##### FUNCTION gl_category_free ##### -->
+<para>
+
+</para>
+
+@category:
+
+<!-- ##### FUNCTION gl_category_free_name_list ##### -->
+<para>
+
+</para>
+
+@names:
+
+<!-- ##### FUNCTION gl_category_from_id ##### -->
+<para>
+
+</para>
+
+@id:
+@Returns:
+
+<!-- ##### FUNCTION gl_category_from_name ##### -->
+<para>
+
+</para>
+
+@name:
+@Returns:
+
+<!-- ##### FUNCTION gl_category_get_name_list ##### -->
+<para>
+
+</para>
+
+@Returns:
+
+<!-- ##### FUNCTION gl_category_init ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION gl_category_lookup_id_from_name ##### -->
+<para>
+
+</para>
+
+@name:
+@Returns:
+
+<!-- ##### FUNCTION gl_category_lookup_name_from_id ##### -->
+<para>
+
+</para>
+
+@id:
+@Returns:
+
+<!-- ##### FUNCTION gl_category_new ##### -->
+<para>
+
+</para>
+
+@id:
+@name:
+@Returns:
+
+<!-- ##### FUNCTION gl_paper_dup ##### -->
+<para>
+
+</para>
+
+@orig:
+@Returns:
+
+<!-- ##### FUNCTION gl_paper_free ##### -->
+<para>
+
+</para>
+
+@paper:
+
+<!-- ##### FUNCTION gl_paper_free_id_list ##### -->
+<para>
+
+</para>
+
+@ids:
+
+<!-- ##### FUNCTION gl_paper_free_name_list ##### -->
+<para>
+
+</para>
+
+@names:
+
+<!-- ##### FUNCTION gl_paper_from_id ##### -->
+<para>
+
+</para>
+
+@id:
+@Returns:
+
+<!-- ##### FUNCTION gl_paper_from_name ##### -->
+<para>
+
+</para>
+
+@name:
+@Returns:
+
+<!-- ##### FUNCTION gl_paper_get_id_list ##### -->
+<para>
+
+</para>
+
+@Returns:
+
+<!-- ##### FUNCTION gl_paper_get_name_list ##### -->
+<para>
+
+</para>
+
+@Returns:
+
+<!-- ##### FUNCTION gl_paper_init ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION gl_paper_is_id_known ##### -->
+<para>
+
+</para>
+
+@id:
+@Returns:
+
+<!-- ##### FUNCTION gl_paper_is_id_other ##### -->
+<para>
+
+</para>
+
+@id:
+@Returns:
+
+<!-- ##### FUNCTION gl_paper_lookup_id_from_name ##### -->
+<para>
+
+</para>
+
+@name:
+@Returns:
+
+<!-- ##### FUNCTION gl_paper_lookup_name_from_id ##### -->
+<para>
+
+</para>
+
+@id:
+@Returns:
+
+<!-- ##### FUNCTION gl_paper_new ##### -->
+<para>
+
+</para>
+
+@id:
+@name:
+@width:
+@height:
+@Returns:
+
+<!-- ##### FUNCTION gl_paper_print_known_papers ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION gl_template_add_alias ##### -->
+<para>
+
+</para>
+
+@template:
+@alias:
+
+<!-- ##### FUNCTION gl_template_add_category ##### -->
+<para>
+
+</para>
+
+@template:
+@category:
+
+<!-- ##### FUNCTION gl_template_add_frame ##### -->
+<para>
+
+</para>
+
+@template:
+@frame:
+
+<!-- ##### FUNCTION gl_template_add_label_type ##### -->
+<para>
+
+</para>
+
+@template:
+@label_type:
+
+<!-- ##### FUNCTION gl_template_add_layout ##### -->
+<para>
+
+</para>
+
+@frame:
+@layout:
+
+<!-- ##### FUNCTION gl_template_add_markup ##### -->
+<para>
+
+</para>
+
+@frame:
+@markup:
+
+<!-- ##### FUNCTION gl_template_cd_label_type_new ##### -->
+<para>
+
+</para>
+
+@id:
+@r1:
+@r2:
+@w:
+@h:
+@waste:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_does_category_match ##### -->
+<para>
+
+</para>
+
+@template:
+@category:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_does_page_size_match ##### -->
+<para>
+
+</para>
+
+@template:
+@page_size:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_dup ##### -->
+<para>
+
+</para>
+
+@orig:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_frame_cd_new ##### -->
+<para>
+
+</para>
+
+@id:
+@r1:
+@r2:
+@w:
+@h:
+@waste:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_frame_dup ##### -->
+<para>
+
+</para>
+
+@orig_frame:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_frame_free ##### -->
+<para>
+
+</para>
+
+@frame:
+
+<!-- ##### FUNCTION gl_template_frame_get_n_labels ##### -->
+<para>
+
+</para>
+
+@frame:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_frame_get_origins ##### -->
+<para>
+
+</para>
+
+@frame:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_frame_get_size ##### -->
+<para>
+
+</para>
+
+@frame:
+@w:
+@h:
+
+<!-- ##### FUNCTION gl_template_frame_rect_new ##### -->
+<para>
+
+</para>
+
+@id:
+@w:
+@h:
+@r:
+@x_waste:
+@y_waste:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_frame_round_new ##### -->
+<para>
+
+</para>
+
+@id:
+@r:
+@waste:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_free ##### -->
+<para>
+
+</para>
+
+@template:
+
+<!-- ##### FUNCTION gl_template_free_name_list ##### -->
+<para>
+
+</para>
+
+@names:
+
+<!-- ##### FUNCTION gl_template_from_name ##### -->
+<para>
+
+</para>
+
+@name:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_get_first_frame ##### -->
+<para>
+
+</para>
+
+@template:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_get_first_label_type ##### -->
+<para>
+
+</para>
+
+@template:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_get_label_size ##### -->
+<para>
+
+</para>
+
+@label_type:
+@w:
+@h:
+
+<!-- ##### FUNCTION gl_template_get_n_labels ##### -->
+<para>
+
+</para>
+
+@label_type:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_get_name_list ##### -->
+<para>
+
+</para>
+
+@page_size:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_get_name_list_all ##### -->
+<para>
+
+</para>
+
+@page_size:
+@category:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_get_name_list_unique ##### -->
+<para>
+
+</para>
+
+@page_size:
+@category:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_get_name_with_desc ##### -->
+<para>
+
+</para>
+
+@template:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_get_origins ##### -->
+<para>
+
+</para>
+
+@label_type:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_init ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION gl_template_label_type_dup ##### -->
+<para>
+
+</para>
+
+@orig_ltype:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_label_type_free ##### -->
+<para>
+
+</para>
+
+@ltype:
+
+<!-- ##### FUNCTION gl_template_layout_dup ##### -->
+<para>
+
+</para>
+
+@orig_layout:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_layout_free ##### -->
+<para>
+
+</para>
+
+@layout:
+
+<!-- ##### FUNCTION gl_template_layout_new ##### -->
+<para>
+
+</para>
+
+@nx:
+@ny:
+@x0:
+@y0:
+@dx:
+@dy:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_markup_circle_new ##### -->
+<para>
+
+</para>
+
+@x0:
+@y0:
+@r:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_markup_dup ##### -->
+<para>
+
+</para>
+
+@orig_markup:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_markup_free ##### -->
+<para>
+
+</para>
+
+@markup:
+
+<!-- ##### FUNCTION gl_template_markup_line_new ##### -->
+<para>
+
+</para>
+
+@x1:
+@y1:
+@x2:
+@y2:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_markup_margin_new ##### -->
+<para>
+
+</para>
+
+@size:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_markup_rect_new ##### -->
+<para>
+
+</para>
+
+@x1:
+@y1:
+@w:
+@h:
+@r:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_new ##### -->
<para>
</para>
+@name:
+@description:
@page_size:
+@page_width:
+@page_height:
@Returns:
-<!-- ##### FUNCTION gl_template_get_name_with_desc ##### -->
+<!-- ##### FUNCTION gl_template_print_aliases ##### -->
+<para>
+
+</para>
+
+@template:
+
+<!-- ##### FUNCTION gl_template_print_known_templates ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION gl_template_rect_label_type_new ##### -->
+<para>
+
+</para>
+
+@id:
+@w:
+@h:
+@r:
+@x_waste:
+@y_waste:
+@Returns:
+
+<!-- ##### FUNCTION gl_template_register ##### -->
+<para>
+
+</para>
+
+@template:
+
+<!-- ##### FUNCTION gl_template_round_label_type_new ##### -->
+<para>
+
+</para>
+
+@id:
+@r:
+@waste:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_category_parse_categories_doc ##### -->
+<para>
+
+</para>
+
+@categories_doc:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_category_parse_category_node ##### -->
+<para>
+
+</para>
+
+@category_node:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_category_read_categories_from_file ##### -->
+<para>
+
+</para>
+
+@utf8_filename:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_get_node_content ##### -->
+<para>
+
+</para>
+
+@node:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_get_prop_boolean ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@default_val:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_get_prop_double ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@default_val:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_get_prop_i18n_string ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@default_val:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_get_prop_int ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@default_val:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_get_prop_length ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@default_val:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_get_prop_string ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@default_val:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_get_prop_uint ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@default_val:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_is_node ##### -->
+<para>
+
+</para>
+
+@node:
+@name:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_paper_parse_paper_node ##### -->
+<para>
+
+</para>
+
+@paper_node:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_paper_parse_papers_doc ##### -->
+<para>
+
+</para>
+
+@papers_doc:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_paper_read_papers_from_file ##### -->
+<para>
+
+</para>
+
+@utf8_filename:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_set_default_units ##### -->
+<para>
+
+</para>
+
+@units:
+
+<!-- ##### FUNCTION gl_xml_set_prop_boolean ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@val:
+
+<!-- ##### FUNCTION gl_xml_set_prop_double ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@val:
+
+<!-- ##### FUNCTION gl_xml_set_prop_int ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@val:
+
+<!-- ##### FUNCTION gl_xml_set_prop_length ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@val:
+
+<!-- ##### FUNCTION gl_xml_set_prop_string ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@val:
+
+<!-- ##### FUNCTION gl_xml_set_prop_uint_hex ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@val:
+
+<!-- ##### FUNCTION gl_xml_template_create_template_node ##### -->
<para>
</para>
@template:
+@root:
+@ns:
+
+<!-- ##### FUNCTION gl_xml_template_create_templates_doc ##### -->
+<para>
+
+</para>
+
+@templates:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_template_parse_template_node ##### -->
+<para>
+
+</para>
+
+@template_node:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_template_parse_templates_doc ##### -->
+<para>
+
+</para>
+
+@templates_doc:
+@Returns:
+
+<!-- ##### FUNCTION gl_xml_template_read_templates_from_file ##### -->
+<para>
+
+</para>
+
+@utf8_filename:
@Returns:
+<!-- ##### FUNCTION gl_xml_template_write_template_to_file ##### -->
+<para>
+
+</para>
+
+@template:
+@utf8_filename:
+
+<!-- ##### FUNCTION gl_xml_template_write_templates_to_file ##### -->
+<para>
+
+</para>
+
+@templates:
+@utf8_filename:
+
<!-- ##### SECTION Title ##### -->
-Paper Definitions
+Paper Sizes
<!-- ##### SECTION Short_Description ##### -->
Paper size definitions
<!-- ##### SECTION Stability_Level ##### -->
-<!-- ##### STRUCT glPaper ##### -->
+<!-- ##### STRUCT lglPaper ##### -->
<para>
</para>
@width:
@height:
-<!-- ##### FUNCTION gl_paper_init ##### -->
+<!-- ##### FUNCTION lgl_paper_init ##### -->
<para>
</para>
-<!-- ##### FUNCTION gl_paper_new ##### -->
+<!-- ##### FUNCTION lgl_paper_new ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_paper_dup ##### -->
+<!-- ##### FUNCTION lgl_paper_dup ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_paper_free ##### -->
+<!-- ##### FUNCTION lgl_paper_free ##### -->
<para>
</para>
@paper:
-<!-- ##### FUNCTION gl_paper_get_id_list ##### -->
+<!-- ##### FUNCTION lgl_paper_get_id_list ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_paper_free_id_list ##### -->
+<!-- ##### FUNCTION lgl_paper_free_id_list ##### -->
<para>
</para>
@ids:
-<!-- ##### FUNCTION gl_paper_get_name_list ##### -->
+<!-- ##### FUNCTION lgl_paper_get_name_list ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_paper_free_name_list ##### -->
+<!-- ##### FUNCTION lgl_paper_free_name_list ##### -->
<para>
</para>
@names:
-<!-- ##### FUNCTION gl_paper_is_id_known ##### -->
+<!-- ##### FUNCTION lgl_paper_is_id_known ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_paper_is_id_other ##### -->
+<!-- ##### FUNCTION lgl_paper_is_id_other ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_paper_from_id ##### -->
+<!-- ##### FUNCTION lgl_paper_from_id ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_paper_from_name ##### -->
+<!-- ##### FUNCTION lgl_paper_from_name ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_paper_lookup_id_from_name ##### -->
+<!-- ##### FUNCTION lgl_paper_lookup_id_from_name ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_paper_lookup_name_from_id ##### -->
+<!-- ##### FUNCTION lgl_paper_lookup_name_from_id ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_paper_print_known_papers ##### -->
+<!-- ##### FUNCTION lgl_paper_print_known_papers ##### -->
<para>
</para>
<!-- ##### SECTION Title ##### -->
-template
+Templates
<!-- ##### SECTION Short_Description ##### -->
-
+Template definitions
<!-- ##### SECTION Long_Description ##### -->
<para>
-
+This section describes a set of structures representing stationary templates and related
+functions.
</para>
<!-- ##### SECTION See_Also ##### -->
<!-- ##### SECTION Stability_Level ##### -->
-<!-- ##### STRUCT glTemplate ##### -->
+<!-- ##### STRUCT lglTemplate ##### -->
<para>
</para>
@page_width:
@page_height:
@categories:
-@label_types:
+@frames:
@aliases:
-<!-- ##### STRUCT glTemplateLabelType ##### -->
+<!-- ##### STRUCT lglTemplateFrameAll ##### -->
<para>
</para>
+@shape:
@id:
@layouts:
@markups:
+
+<!-- ##### STRUCT lglTemplateFrameRect ##### -->
+<para>
+
+</para>
+
+@shape:
+@id:
+@layouts:
+@markups:
+@w:
+@h:
+@r:
+@x_waste:
+@y_waste:
+
+<!-- ##### STRUCT lglTemplateFrameRound ##### -->
+<para>
+
+</para>
+
@shape:
+@id:
+@layouts:
+@markups:
+@r:
+@waste:
-<!-- ##### STRUCT glTemplateLayout ##### -->
+<!-- ##### STRUCT lglTemplateFrameCD ##### -->
+<para>
+
+</para>
+
+@shape:
+@id:
+@layouts:
+@markups:
+@r1:
+@r2:
+@w:
+@h:
+@waste:
+
+<!-- ##### STRUCT lglTemplateLayout ##### -->
<para>
</para>
@dx:
@dy:
-<!-- ##### STRUCT glTemplateMarkup ##### -->
+<!-- ##### STRUCT lglTemplateMarkupMargin ##### -->
+<para>
+
+</para>
+
+@type:
+@size:
+
+<!-- ##### STRUCT lglTemplateMarkupLine ##### -->
+<para>
+
+</para>
+
+@type:
+@x1:
+@y1:
+@x2:
+@y2:
+
+<!-- ##### STRUCT lglTemplateMarkupCircle ##### -->
+<para>
+
+</para>
+
+@type:
+@x0:
+@y0:
+@r:
+
+<!-- ##### STRUCT lglTemplateMarkupRect ##### -->
<para>
</para>
@type:
+@x1:
+@y1:
+@w:
+@h:
+@r:
-<!-- ##### STRUCT glTemplateOrigin ##### -->
+<!-- ##### STRUCT lglTemplateOrigin ##### -->
<para>
</para>
@x:
@y:
-<!-- ##### ENUM glTemplateLabelShape ##### -->
+<!-- ##### ENUM lglTemplateFrameShape ##### -->
<para>
</para>
-@GL_TEMPLATE_SHAPE_RECT:
-@GL_TEMPLATE_SHAPE_ROUND:
-@GL_TEMPLATE_SHAPE_CD:
+@LGL_TEMPLATE_FRAME_SHAPE_RECT:
+@LGL_TEMPLATE_FRAME_SHAPE_ROUND:
+@LGL_TEMPLATE_FRAME_SHAPE_CD:
-<!-- ##### ENUM glTemplateMarkupType ##### -->
+<!-- ##### UNION lglTemplateFrame ##### -->
<para>
</para>
-@GL_TEMPLATE_MARKUP_MARGIN:
-@GL_TEMPLATE_MARKUP_LINE:
-@GL_TEMPLATE_MARKUP_CIRCLE:
-<!-- ##### FUNCTION gl_template_init ##### -->
+<!-- ##### ENUM lglTemplateMarkupType ##### -->
<para>
</para>
+@LGL_TEMPLATE_MARKUP_MARGIN:
+@LGL_TEMPLATE_MARKUP_LINE:
+@LGL_TEMPLATE_MARKUP_CIRCLE:
+@LGL_TEMPLATE_MARKUP_RECT:
+
+<!-- ##### UNION lglTemplateMarkup ##### -->
+<para>
+
+</para>
-<!-- ##### FUNCTION gl_template_register ##### -->
+<!-- ##### FUNCTION lgl_template_init ##### -->
+<para>
+
+</para>
+
+
+
+<!-- ##### FUNCTION lgl_template_register ##### -->
<para>
</para>
@template:
-<!-- ##### FUNCTION gl_template_free_name_list ##### -->
+<!-- ##### FUNCTION lgl_template_get_name_list_unique ##### -->
+<para>
+
+</para>
+
+@page_size:
+@category:
+@Returns:
+
+
+<!-- ##### FUNCTION lgl_template_get_name_list_all ##### -->
+<para>
+
+</para>
+
+@page_size:
+@category:
+@Returns:
+
+
+<!-- ##### FUNCTION lgl_template_free_name_list ##### -->
<para>
</para>
@names:
-<!-- ##### FUNCTION gl_template_from_name ##### -->
+<!-- ##### FUNCTION lgl_template_from_name ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_get_first_label_type ##### -->
+<!-- ##### FUNCTION lgl_template_get_first_frame ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_get_label_size ##### -->
+<!-- ##### FUNCTION lgl_template_does_page_size_match ##### -->
<para>
</para>
-@label_type:
+@template:
+@page_size:
+@Returns:
+
+
+<!-- ##### FUNCTION lgl_template_does_category_match ##### -->
+<para>
+
+</para>
+
+@template:
+@category:
+@Returns:
+
+
+<!-- ##### FUNCTION lgl_template_frame_get_size ##### -->
+<para>
+
+</para>
+
+@frame:
@w:
@h:
-<!-- ##### FUNCTION gl_template_get_n_labels ##### -->
+<!-- ##### FUNCTION lgl_template_frame_get_n_labels ##### -->
<para>
</para>
-@label_type:
+@frame:
@Returns:
-<!-- ##### FUNCTION gl_template_get_origins ##### -->
+<!-- ##### FUNCTION lgl_template_frame_get_origins ##### -->
<para>
</para>
-@label_type:
+@frame:
@Returns:
-<!-- ##### FUNCTION gl_template_new ##### -->
+<!-- ##### FUNCTION lgl_template_new ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_add_label_type ##### -->
+<!-- ##### FUNCTION lgl_template_add_category ##### -->
<para>
</para>
@template:
-@label_type:
+@category:
-<!-- ##### FUNCTION gl_template_add_alias ##### -->
+<!-- ##### FUNCTION lgl_template_add_frame ##### -->
+<para>
+
+</para>
+
+@template:
+@frame:
+
+
+<!-- ##### FUNCTION lgl_template_add_alias ##### -->
<para>
</para>
@alias:
-<!-- ##### FUNCTION gl_template_rect_label_type_new ##### -->
+<!-- ##### FUNCTION lgl_template_frame_rect_new ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_round_label_type_new ##### -->
+<!-- ##### FUNCTION lgl_template_frame_round_new ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_cd_label_type_new ##### -->
+<!-- ##### FUNCTION lgl_template_frame_cd_new ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_add_layout ##### -->
+<!-- ##### FUNCTION lgl_template_add_layout ##### -->
<para>
</para>
-@label_type:
+@frame:
@layout:
-<!-- ##### FUNCTION gl_template_add_markup ##### -->
+<!-- ##### FUNCTION lgl_template_add_markup ##### -->
<para>
</para>
-@label_type:
+@frame:
@markup:
-<!-- ##### FUNCTION gl_template_layout_new ##### -->
+<!-- ##### FUNCTION lgl_template_layout_new ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_markup_margin_new ##### -->
+<!-- ##### FUNCTION lgl_template_markup_margin_new ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_markup_line_new ##### -->
+<!-- ##### FUNCTION lgl_template_markup_line_new ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_markup_circle_new ##### -->
+<!-- ##### FUNCTION lgl_template_markup_circle_new ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_dup ##### -->
+<!-- ##### FUNCTION lgl_template_markup_rect_new ##### -->
+<para>
+
+</para>
+
+@x1:
+@y1:
+@w:
+@h:
+@r:
+@Returns:
+
+
+<!-- ##### FUNCTION lgl_template_dup ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_free ##### -->
+<!-- ##### FUNCTION lgl_template_free ##### -->
<para>
</para>
@template:
-<!-- ##### FUNCTION gl_template_label_type_dup ##### -->
+<!-- ##### FUNCTION lgl_template_frame_dup ##### -->
<para>
</para>
-@orig_ltype:
+@orig_frame:
@Returns:
-<!-- ##### FUNCTION gl_template_label_type_free ##### -->
+<!-- ##### FUNCTION lgl_template_frame_free ##### -->
<para>
</para>
-@ltype:
+@frame:
-<!-- ##### FUNCTION gl_template_layout_dup ##### -->
+<!-- ##### FUNCTION lgl_template_layout_dup ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_layout_free ##### -->
+<!-- ##### FUNCTION lgl_template_layout_free ##### -->
<para>
</para>
@layout:
-<!-- ##### FUNCTION gl_template_markup_dup ##### -->
+<!-- ##### FUNCTION lgl_template_markup_dup ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_template_markup_free ##### -->
+<!-- ##### FUNCTION lgl_template_markup_free ##### -->
<para>
</para>
@markup:
-<!-- ##### FUNCTION gl_template_print_known_templates ##### -->
+<!-- ##### FUNCTION lgl_template_print_known_templates ##### -->
<para>
</para>
-<!-- ##### FUNCTION gl_template_print_aliases ##### -->
+<!-- ##### FUNCTION lgl_template_print_aliases ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
-<!-- ##### FUNCTION gl_xml_paper_read_papers_from_file ##### -->
+<!-- ##### FUNCTION lgl_xml_paper_read_papers_from_file ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_xml_paper_parse_papers_doc ##### -->
+<!-- ##### FUNCTION lgl_xml_paper_parse_papers_doc ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_xml_paper_parse_paper_node ##### -->
+<!-- ##### FUNCTION lgl_xml_paper_parse_paper_node ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
-<!-- ##### FUNCTION gl_xml_template_read_templates_from_file ##### -->
+<!-- ##### FUNCTION lgl_xml_template_read_templates_from_file ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_xml_template_parse_templates_doc ##### -->
+<!-- ##### FUNCTION lgl_xml_template_parse_templates_doc ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_xml_template_parse_template_node ##### -->
+<!-- ##### FUNCTION lgl_xml_template_parse_template_node ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_xml_template_write_templates_to_file ##### -->
+<!-- ##### FUNCTION lgl_xml_template_write_templates_to_file ##### -->
<para>
</para>
@utf8_filename:
-<!-- ##### FUNCTION gl_xml_template_write_template_to_file ##### -->
+<!-- ##### FUNCTION lgl_xml_template_write_template_to_file ##### -->
<para>
</para>
@utf8_filename:
-<!-- ##### FUNCTION gl_xml_template_create_templates_doc ##### -->
+<!-- ##### FUNCTION lgl_xml_template_create_templates_doc ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_xml_template_create_template_node ##### -->
+<!-- ##### FUNCTION lgl_xml_template_create_template_node ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
-<!-- ##### FUNCTION gl_xml_get_prop_double ##### -->
+<!-- ##### MACRO LGL_XML_NAME_SPACE ##### -->
+<para>
+
+</para>
+
+
+
+<!-- ##### FUNCTION lgl_xml_get_prop_string ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@default_val:
+@Returns:
+
+
+<!-- ##### FUNCTION lgl_xml_get_prop_i18n_string ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@default_val:
+@Returns:
+
+
+<!-- ##### FUNCTION lgl_xml_get_prop_double ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_xml_get_prop_boolean ##### -->
+<!-- ##### FUNCTION lgl_xml_get_prop_boolean ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_xml_get_prop_int ##### -->
+<!-- ##### FUNCTION lgl_xml_get_prop_int ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_xml_get_prop_uint ##### -->
+<!-- ##### FUNCTION lgl_xml_get_prop_uint ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_xml_get_prop_length ##### -->
+<!-- ##### FUNCTION lgl_xml_get_prop_length ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gl_xml_set_prop_double ##### -->
+<!-- ##### FUNCTION lgl_xml_set_prop_string ##### -->
<para>
</para>
@val:
-<!-- ##### FUNCTION gl_xml_set_prop_boolean ##### -->
+<!-- ##### FUNCTION lgl_xml_set_prop_double ##### -->
<para>
</para>
@val:
-<!-- ##### FUNCTION gl_xml_set_prop_int ##### -->
+<!-- ##### FUNCTION lgl_xml_set_prop_boolean ##### -->
<para>
</para>
@val:
-<!-- ##### FUNCTION gl_xml_set_prop_uint_hex ##### -->
+<!-- ##### FUNCTION lgl_xml_set_prop_int ##### -->
<para>
</para>
@val:
-<!-- ##### FUNCTION gl_xml_set_prop_length ##### -->
+<!-- ##### FUNCTION lgl_xml_set_prop_uint_hex ##### -->
<para>
</para>
@val:
-<!-- ##### FUNCTION gl_xml_set_default_units ##### -->
+<!-- ##### FUNCTION lgl_xml_set_prop_length ##### -->
+<para>
+
+</para>
+
+@node:
+@property:
+@val:
+
+
+<!-- ##### FUNCTION lgl_xml_is_node ##### -->
+<para>
+
+</para>
+
+@node:
+@name:
+@Returns:
+
+
+<!-- ##### FUNCTION lgl_xml_get_node_content ##### -->
+<para>
+
+</para>
+
+@node:
+@Returns:
+
+
+<!-- ##### FUNCTION lgl_xml_set_default_units ##### -->
<para>
</para>
libglabels_la_SOURCES = \
libglabels-private.h \
+ init.h \
+ init.c \
enums.h \
paper.h \
paper.c \
/**
- * gl_category_init:
+ * lgl_category_init:
*
* Initialize libglabels category module by reading all category definition
* files located in system and user template directories.
+ *
+ * The end user would typically call lgl_init() instead.
*/
void
-gl_category_init (void)
+lgl_category_init (void)
{
- glCategory *other;
-
if (categories) {
return; /* Already initialized. */
}
/**
- * gl_category_new:
+ * lgl_category_new:
* @id: Id of category definition. (E.g. label, card, etc.) Should be
* unique.
* @name: Localized name of category.
*
- * Allocates and constructs a new #glCategory structure.
+ * Allocates and constructs a new #lglCategory structure.
*
- * Returns: a pointer to a newly allocated #glCategory structure.
+ * Returns: a pointer to a newly allocated #lglCategory structure.
*
*/
-glCategory *
-gl_category_new (gchar *id,
- gchar *name)
+lglCategory *
+lgl_category_new (gchar *id,
+ gchar *name)
{
- glCategory *category;
+ lglCategory *category;
- category = g_new0 (glCategory,1);
+ category = g_new0 (lglCategory,1);
category->id = g_strdup (id);
category->name = g_strdup (name);
/**
- * gl_category_dup:
- * @orig: #glCategory structure to be duplicated.
+ * lgl_category_dup:
+ * @orig: #lglCategory structure to be duplicated.
*
- * Duplicates an existing #glCategory structure.
+ * Duplicates an existing #lglCategory structure.
*
- * Returns: a pointer to a newly allocated #glCategory structure.
+ * Returns: a pointer to a newly allocated #lglCategory structure.
*
*/
-glCategory *gl_category_dup (const glCategory *orig)
+lglCategory *lgl_category_dup (const lglCategory *orig)
{
- glCategory *category;
+ lglCategory *category;
g_return_val_if_fail (orig, NULL);
- category = g_new0 (glCategory,1);
+ category = g_new0 (lglCategory,1);
category->id = g_strdup (orig->id);
category->name = g_strdup (orig->name);
/**
- * gl_category_free:
- * @category: pointer to #glCategory structure to be freed.
+ * lgl_category_free:
+ * @category: pointer to #lglCategory structure to be freed.
*
- * Free all memory associated with an existing #glCategory structure.
+ * Free all memory associated with an existing #lglCategory structure.
*
*/
-void gl_category_free (glCategory *category)
+void lgl_category_free (lglCategory *category)
{
if ( category != NULL ) {
/**
- * gl_category_get_name_list:
+ * lgl_category_get_name_list:
*
- * Get a list of all localized category names known to libglabels.
+ * Get a list of all localized category names known to liblglabels.
*
* Returns: a list of localized category names.
*
*/
GList *
-gl_category_get_name_list (void)
+lgl_category_get_name_list (void)
{
GList *names = NULL;
GList *p;
- glCategory *category;
+ lglCategory *category;
if (!categories) {
- gl_category_init ();
+ lgl_category_init ();
}
for ( p=categories; p != NULL; p=p->next ) {
- category = (glCategory *)p->data;
+ category = (lglCategory *)p->data;
names = g_list_append (names, g_strdup (category->name));
}
/**
- * gl_category_free_name_list:
+ * lgl_category_free_name_list:
* @names: List of localized category name strings to be freed.
*
* Free up all storage associated with a name list obtained with
- * gl_category_get_name_list().
+ * lgl_category_get_name_list().
*
*/
void
-gl_category_free_name_list (GList *names)
+lgl_category_free_name_list (GList *names)
{
GList *p;
/**
- * gl_category_from_id:
+ * lgl_category_from_id:
* @id: category id string
*
* Lookup category definition from id string.
*
- * Returns: pointer to a newly allocated #glCategory structure.
+ * Returns: pointer to a newly allocated #lglCategory structure.
*
*/
-glCategory *
-gl_category_from_id (const gchar *id)
+lglCategory *
+lgl_category_from_id (const gchar *id)
{
- GList *p;
- glCategory *category;
+ GList *p;
+ lglCategory *category;
if (!categories) {
- gl_category_init ();
+ lgl_category_init ();
}
if (id == NULL) {
/* If no id, return first category as a default */
- return gl_category_dup ((glCategory *) categories->data);
+ return lgl_category_dup ((lglCategory *) categories->data);
}
for (p = categories; p != NULL; p = p->next) {
- category = (glCategory *) p->data;
+ category = (lglCategory *) p->data;
if (g_strcasecmp (category->id, id) == 0) {
- return gl_category_dup (category);
+ return lgl_category_dup (category);
}
}
/**
- * gl_category_from_name:
+ * lgl_category_from_name:
* @name: localized category name string
*
* Lookup category definition from localized category name string.
*
- * Returns: pointer to a newly allocated #glCategory structure.
+ * Returns: pointer to a newly allocated #lglCategory structure.
*
*/
-glCategory *
-gl_category_from_name (const gchar *name)
+lglCategory *
+lgl_category_from_name (const gchar *name)
{
- GList *p;
- glCategory *category;
+ GList *p;
+ lglCategory *category;
if (!categories) {
- gl_category_init ();
+ lgl_category_init ();
}
if (name == NULL) {
/* If no name, return first category as a default */
- return gl_category_dup ((glCategory *) categories->data);
+ return lgl_category_dup ((lglCategory *) categories->data);
}
for (p = categories; p != NULL; p = p->next) {
- category = (glCategory *) p->data;
+ category = (lglCategory *) p->data;
if (g_strcasecmp (category->name, name) == 0) {
- return gl_category_dup (category);
+ return lgl_category_dup (category);
}
}
/**
- * gl_category_lookup_id_from_name:
+ * lgl_category_lookup_id_from_name:
* @name: localized category name stringp
*
* Lookup category name string from localized category name string.
*
*/
gchar *
-gl_category_lookup_id_from_name (const gchar *name)
+lgl_category_lookup_id_from_name (const gchar *name)
{
- glCategory *category = NULL;
- gchar *id = NULL;
+ lglCategory *category = NULL;
+ gchar *id = NULL;
if (name != NULL)
{
- category = gl_category_from_name (name);
+ category = lgl_category_from_name (name);
if ( category != NULL )
{
id = g_strdup (category->id);
- gl_category_free (category);
+ lgl_category_free (category);
category = NULL;
}
}
}
/**
- * gl_category_lookup_name_from_id:
+ * lgl_category_lookup_name_from_id:
* @id: category id string
*
* Lookup localized category name string from category id string.
*
*/
gchar *
-gl_category_lookup_name_from_id (const gchar *id)
+lgl_category_lookup_name_from_id (const gchar *id)
{
- glCategory *category = NULL;
- gchar *name = NULL;
+ lglCategory *category = NULL;
+ gchar *name = NULL;
if (id != NULL)
{
- category = gl_category_from_id (id);
+ category = lgl_category_from_id (id);
if ( category != NULL )
{
name = g_strdup (category->name);
- gl_category_free (category);
+ lgl_category_free (category);
category = NULL;
}
}
gchar *data_dir;
GList *categories = NULL;
- data_dir = GL_SYSTEM_DATA_DIR;
+ data_dir = LGL_SYSTEM_DATA_DIR;
categories = read_category_files_from_dir (categories, data_dir);
g_free (data_dir);
- data_dir = GL_USER_DATA_DIR;
+ data_dir = LGL_USER_DATA_DIR;
categories = read_category_files_from_dir (categories, data_dir);
g_free (data_dir);
full_filename =
g_build_filename (dirname, filename, NULL);
new_categories =
- gl_xml_category_read_categories_from_file (full_filename);
+ lgl_xml_category_read_categories_from_file (full_filename);
g_free (full_filename);
categories = g_list_concat (categories, new_categories);
/*
* Template class
*/
-typedef struct _glCategory glCategory;
+typedef struct _lglCategory lglCategory;
-struct _glCategory {
- gchar *id; /* Unique ID of paper definition */
- gchar *name; /* Localized name of paper */
+struct _lglCategory {
+ gchar *id; /* Unique ID of category */
+ gchar *name; /* Localized name of category */
};
/*
* Module initialization
*/
-void gl_category_init (void);
+void lgl_category_init (void);
/*
* Category construction
*/
-glCategory *gl_category_new (gchar *id,
- gchar *name);
+lglCategory *lgl_category_new (gchar *id,
+ gchar *name);
-glCategory *gl_category_dup (const glCategory *orig);
-void gl_category_free (glCategory *category);
+lglCategory *lgl_category_dup (const lglCategory *orig);
+void lgl_category_free (lglCategory *category);
/*
* Known category name lists
*/
-GList *gl_category_get_name_list (void);
-void gl_category_free_name_list (GList *names);
+GList *lgl_category_get_name_list (void);
+void lgl_category_free_name_list (GList *names);
/*
* Query functions
*/
-glCategory *gl_category_from_name (const gchar *name);
-glCategory *gl_category_from_id (const gchar *id);
-gchar *gl_category_lookup_id_from_name (const gchar *name);
-gchar *gl_category_lookup_name_from_id (const gchar *id);
+lglCategory *lgl_category_from_name (const gchar *name);
+lglCategory *lgl_category_from_id (const gchar *id);
+gchar *lgl_category_lookup_id_from_name (const gchar *name);
+gchar *lgl_category_lookup_name_from_id (const gchar *id);
G_END_DECLS
/* Units of distance */
typedef enum {
- GL_UNITS_POINT, /* encoded as "pt" */
- GL_UNITS_INCH, /* encoded as "in" */
- GL_UNITS_MM, /* encoded as "mm" */
- GL_UNITS_CM, /* encoded as "cm" */
- GL_UNITS_PICA, /* encoded as "pc" */
-
- GL_UNITS_FIRST = GL_UNITS_POINT,
- GL_UNITS_LAST = GL_UNITS_PICA,
-} glUnitsType;
+ LGL_UNITS_POINT, /* encoded as "pt" */
+ LGL_UNITS_INCH, /* encoded as "in" */
+ LGL_UNITS_MM, /* encoded as "mm" */
+ LGL_UNITS_CM, /* encoded as "cm" */
+ LGL_UNITS_PICA, /* encoded as "pc" */
+
+ LGL_UNITS_FIRST = LGL_UNITS_POINT,
+ LGL_UNITS_LAST = LGL_UNITS_PICA,
+} lglUnitsType;
G_END_DECLS
--- /dev/null
+/*
+ * (LIBGLABELS) Template library for GLABELS
+ *
+ * init.c: initialization module
+ *
+ * Copyright (C) 2003, 2004 Jim Evins <evins@snaught.com>.
+ *
+ * This file is part of the LIBGLABELS library.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA
+ */
+#include <config.h>
+
+#include "init.h"
+
+#include "paper.h"
+#include "category.h"
+#include "template.h"
+
+/*===========================================*/
+/* Private types */
+/*===========================================*/
+
+/*===========================================*/
+/* Private globals */
+/*===========================================*/
+
+
+
+/*===========================================*/
+/* Local function prototypes */
+/*===========================================*/
+
+/**
+ * lgl_init:
+ *
+ * Initialize all libglabels subsystems. This function reads in all files
+ * containing paper definitions, category definitions, and templates to build
+ * its template data base. This function will search both system and user template
+ * directories for these files.
+ */
+void
+lgl_init (void)
+{
+ static gboolean initialized = FALSE;
+
+ if (!initialized)
+ {
+
+ lgl_paper_init();
+ lgl_category_init();
+ lgl_template_init();
+
+ initialized = TRUE;
+ }
+}
--- /dev/null
+/*
+ * (LIBGLABELS) Template library for GLABELS
+ *
+ * init.h: initialization module header file
+ *
+ * Copyright (C) 2007 Jim Evins <evins@snaught.com>.
+ *
+ * This file is part of the LIBGLABELS library.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA
+ */
+
+#ifndef __INIT_H__
+#define __INIT_H__
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+
+/*
+ * Module initialization
+ */
+void lgl_init (void);
+
+
+G_END_DECLS
+
+#endif
#include <glib/gfileutils.h>
/* Data system and user data directories. (must free w/ g_free()) */
-#define GL_SYSTEM_DATA_DIR g_build_filename (LIBGLABELS_TEMPLATE_DIR, NULL)
-#define GL_USER_DATA_DIR g_build_filename (g_get_home_dir (), ".glabels", NULL)
+#define LGL_SYSTEM_DATA_DIR g_build_filename (LIBGLABELS_TEMPLATE_DIR, NULL)
+#define LGL_USER_DATA_DIR g_build_filename (g_get_home_dir (), ".glabels", NULL)
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "LibGlabels"
#ifndef __LIBGLABELS_H__
#define __LIBGLABELS_H__
+#include <libglabels/init.h>
#include <libglabels/enums.h>
#include <libglabels/paper.h>
#include <libglabels/category.h>
const gchar *dirname);
/**
- * gl_paper_init:
+ * lgl_paper_init:
*
* Initialize libglabels paper module by reading all paper definition
* files located in system and user template directories.
+ *
+ * The end user would typically call lgl_init() instead.
*/
void
-gl_paper_init (void)
+lgl_paper_init (void)
{
- glPaper *other;
+ lglPaper *other;
if (papers) {
return; /* Already initialized. */
papers = read_papers ();
/* Create and append an "Other" entry. */
- other = gl_paper_new ("Other", _("Other"), 0.0, 0.0);
+ other = lgl_paper_new ("Other", _("Other"), 0.0, 0.0);
papers = g_list_append (papers, other);
}
/**
- * gl_paper_new:
+ * lgl_paper_new:
* @id: Id of paper definition. (E.g. US-Letter, A4, etc.) Should be
* unique.
* @name: Localized name of paper.
* @width: Width of paper in points.
* @height: Height of paper in points.
*
- * Allocates and constructs a new #glPaper structure.
+ * Allocates and constructs a new #lglPaper structure.
*
- * Returns: a pointer to a newly allocated #glPaper structure.
+ * Returns: a pointer to a newly allocated #lglPaper structure.
*
*/
-glPaper *
-gl_paper_new (gchar *id,
- gchar *name,
- gdouble width,
- gdouble height)
+lglPaper *
+lgl_paper_new (gchar *id,
+ gchar *name,
+ gdouble width,
+ gdouble height)
{
- glPaper *paper;
+ lglPaper *paper;
- paper = g_new0 (glPaper,1);
+ paper = g_new0 (lglPaper,1);
paper->id = g_strdup (id);
paper->name = g_strdup (name);
paper->width = width;
/**
- * gl_paper_dup:
- * @orig: #glPaper structure to be duplicated.
+ * lgl_paper_dup:
+ * @orig: #lglPaper structure to be duplicated.
*
- * Duplicates an existing #glPaper structure.
+ * Duplicates an existing #lglPaper structure.
*
- * Returns: a pointer to a newly allocated #glPaper structure.
+ * Returns: a pointer to a newly allocated #lglPaper structure.
*
*/
-glPaper *gl_paper_dup (const glPaper *orig)
+lglPaper *lgl_paper_dup (const lglPaper *orig)
{
- glPaper *paper;
+ lglPaper *paper;
g_return_val_if_fail (orig, NULL);
- paper = g_new0 (glPaper,1);
+ paper = g_new0 (lglPaper,1);
paper->id = g_strdup (orig->id);
paper->name = g_strdup (orig->name);
/**
- * gl_paper_free:
- * @paper: pointer to #glPaper structure to be freed.
+ * lgl_paper_free:
+ * @paper: pointer to #lglPaper structure to be freed.
*
- * Free all memory associated with an existing #glPaper structure.
+ * Free all memory associated with an existing #lglPaper structure.
*
*/
-void gl_paper_free (glPaper *paper)
+void lgl_paper_free (lglPaper *paper)
{
if ( paper != NULL ) {
/**
- * gl_paper_get_id_list:
+ * lgl_paper_get_id_list:
*
* Get a list of all paper ids known to libglabels.
*
*
*/
GList *
-gl_paper_get_id_list (void)
+lgl_paper_get_id_list (void)
{
GList *ids = NULL;
GList *p;
- glPaper *paper;
+ lglPaper *paper;
if (!papers) {
- gl_paper_init ();
+ lgl_paper_init ();
}
for ( p=papers; p != NULL; p=p->next ) {
- paper = (glPaper *)p->data;
+ paper = (lglPaper *)p->data;
ids = g_list_append (ids, g_strdup (paper->id));
}
}
/**
- * gl_paper_free_id_list:
+ * lgl_paper_free_id_list:
* @ids: List of id strings to be freed.
*
* Free up all storage associated with an id list obtained with
- * gl_paper_get_id_list().
+ * lgl_paper_get_id_list().
*
*/
void
-gl_paper_free_id_list (GList *ids)
+lgl_paper_free_id_list (GList *ids)
{
GList *p;
/**
- * gl_paper_get_name_list:
+ * lgl_paper_get_name_list:
*
* Get a list of all localized paper names known to libglabels.
*
*
*/
GList *
-gl_paper_get_name_list (void)
+lgl_paper_get_name_list (void)
{
GList *names = NULL;
GList *p;
- glPaper *paper;
+ lglPaper *paper;
if (!papers) {
- gl_paper_init ();
+ lgl_paper_init ();
}
for ( p=papers; p != NULL; p=p->next ) {
- paper = (glPaper *)p->data;
+ paper = (lglPaper *)p->data;
names = g_list_append (names, g_strdup (paper->name));
}
/**
- * gl_paper_free_name_list:
+ * lgl_paper_free_name_list:
* @names: List of localized paper name strings to be freed.
*
* Free up all storage associated with a name list obtained with
- * gl_paper_get_name_list().
+ * lgl_paper_get_name_list().
*
*/
void
-gl_paper_free_name_list (GList *names)
+lgl_paper_free_name_list (GList *names)
{
GList *p;
/**
- * gl_paper_is_id_known:
+ * lgl_paper_is_id_known:
* @id: paper id to test
*
* Determine if given paper id is known to libglabels.
*
*/
gboolean
-gl_paper_is_id_known (const gchar *id)
+lgl_paper_is_id_known (const gchar *id)
{
GList *p;
- glPaper *paper;
+ lglPaper *paper;
if (!papers) {
- gl_paper_init ();
+ lgl_paper_init ();
}
if (id == NULL) {
}
for (p = papers; p != NULL; p = p->next) {
- paper = (glPaper *) p->data;
+ paper = (lglPaper *) p->data;
if (g_strcasecmp (paper->id, id) == 0) {
return TRUE;
}
/**
- * gl_paper_is_id_other:
+ * lgl_paper_is_id_other:
* @id: paper id to test
*
* Determine if given paper id is the special id "Other."
*
*/
gboolean
-gl_paper_is_id_other (const gchar *id)
+lgl_paper_is_id_other (const gchar *id)
{
if (id == NULL) {
return FALSE;
/**
- * gl_paper_from_id:
+ * lgl_paper_from_id:
* @id: paper id string
*
* Lookup paper definition from id string.
*
- * Returns: pointer to a newly allocated #glPaper structure.
+ * Returns: pointer to a newly allocated #lglPaper structure.
*
*/
-glPaper *
-gl_paper_from_id (const gchar *id)
+lglPaper *
+lgl_paper_from_id (const gchar *id)
{
GList *p;
- glPaper *paper;
+ lglPaper *paper;
if (!papers) {
- gl_paper_init ();
+ lgl_paper_init ();
}
if (id == NULL) {
/* If no id, return first paper as a default */
- return gl_paper_dup ((glPaper *) papers->data);
+ return lgl_paper_dup ((lglPaper *) papers->data);
}
for (p = papers; p != NULL; p = p->next) {
- paper = (glPaper *) p->data;
+ paper = (lglPaper *) p->data;
if (g_strcasecmp (paper->id, id) == 0) {
- return gl_paper_dup (paper);
+ return lgl_paper_dup (paper);
}
}
/**
- * gl_paper_from_name:
+ * lgl_paper_from_name:
* @name: localized paper name string
*
* Lookup paper definition from localized paper name string.
*
- * Returns: pointer to a newly allocated #glPaper structure.
+ * Returns: pointer to a newly allocated #lglPaper structure.
*
*/
-glPaper *
-gl_paper_from_name (const gchar *name)
+lglPaper *
+lgl_paper_from_name (const gchar *name)
{
GList *p;
- glPaper *paper;
+ lglPaper *paper;
if (!papers) {
- gl_paper_init ();
+ lgl_paper_init ();
}
if (name == NULL) {
/* If no name, return first paper as a default */
- return gl_paper_dup ((glPaper *) papers->data);
+ return lgl_paper_dup ((lglPaper *) papers->data);
}
for (p = papers; p != NULL; p = p->next) {
- paper = (glPaper *) p->data;
+ paper = (lglPaper *) p->data;
if (g_strcasecmp (paper->name, name) == 0) {
- return gl_paper_dup (paper);
+ return lgl_paper_dup (paper);
}
}
/**
- * gl_paper_lookup_id_from_name:
+ * lgl_paper_lookup_id_from_name:
* @name: localized paper name stringp
*
* Lookup paper name string from localized paper name string.
*
*/
gchar *
-gl_paper_lookup_id_from_name (const gchar *name)
+lgl_paper_lookup_id_from_name (const gchar *name)
{
- glPaper *paper = NULL;
- gchar *id = NULL;
+ lglPaper *paper = NULL;
+ gchar *id = NULL;
if (name != NULL)
{
- paper = gl_paper_from_name (name);
+ paper = lgl_paper_from_name (name);
if ( paper != NULL )
{
id = g_strdup (paper->id);
- gl_paper_free (paper);
+ lgl_paper_free (paper);
paper = NULL;
}
}
}
/**
- * gl_paper_lookup_name_from_id:
+ * lgl_paper_lookup_name_from_id:
* @id: paper id string
*
* Lookup localized paper name string from paper id string.
*
*/
gchar *
-gl_paper_lookup_name_from_id (const gchar *id)
+lgl_paper_lookup_name_from_id (const gchar *id)
{
- glPaper *paper = NULL;
- gchar *name = NULL;
+ lglPaper *paper = NULL;
+ gchar *name = NULL;
if (id != NULL)
{
- paper = gl_paper_from_id (id);
+ paper = lgl_paper_from_id (id);
if ( paper != NULL )
{
name = g_strdup (paper->name);
- gl_paper_free (paper);
+ lgl_paper_free (paper);
paper = NULL;
}
}
gchar *data_dir;
GList *papers = NULL;
- data_dir = GL_SYSTEM_DATA_DIR;
+ data_dir = LGL_SYSTEM_DATA_DIR;
papers = read_paper_files_from_dir (papers, data_dir);
g_free (data_dir);
- data_dir = GL_USER_DATA_DIR;
+ data_dir = LGL_USER_DATA_DIR;
papers = read_paper_files_from_dir (papers, data_dir);
g_free (data_dir);
full_filename =
g_build_filename (dirname, filename, NULL);
new_papers =
- gl_xml_paper_read_papers_from_file (full_filename);
+ lgl_xml_paper_read_papers_from_file (full_filename);
g_free (full_filename);
papers = g_list_concat (papers, new_papers);
/**
- * gl_paper_print_known_papers:
+ * lgl_paper_print_known_papers:
*
* For debugging purposes: print a list of all paper definitions known to
* libglabels.
*
*/
void
-gl_paper_print_known_papers (void)
+lgl_paper_print_known_papers (void)
{
GList *p;
- glPaper *paper;
+ lglPaper *paper;
if (!papers) {
- gl_paper_init ();
+ lgl_paper_init ();
}
g_print ("%s():\n", __FUNCTION__);
for (p = papers; p != NULL; p = p->next) {
- paper = (glPaper *) p->data;
+ paper = (lglPaper *) p->data;
g_print ("PAPER id=\"%s\", name=\"%s\", width=%gpts, height=%gpts\n",
paper->id, paper->name, paper->width, paper->height);
/*
- * glPaper structure
+ * lglPaper structure
*/
-typedef struct _glPaper glPaper;
+typedef struct _lglPaper lglPaper;
-struct _glPaper {
+struct _lglPaper {
gchar *id; /* Unique ID of paper definition */
gchar *name; /* Localized name of paper */
gdouble width; /* Width (in points) */
/*
* Module initialization
*/
-void gl_paper_init (void);
+void lgl_paper_init (void);
/*
* Paper construction
*/
-glPaper *gl_paper_new (gchar *id,
- gchar *name,
- gdouble width,
- gdouble height);
+lglPaper *lgl_paper_new (gchar *id,
+ gchar *name,
+ gdouble width,
+ gdouble height);
-glPaper *gl_paper_dup (const glPaper *orig);
+lglPaper *lgl_paper_dup (const lglPaper *orig);
-void gl_paper_free (glPaper *paper);
+void lgl_paper_free (lglPaper *paper);
/*
* ID lists
*/
-GList *gl_paper_get_id_list (void);
-void gl_paper_free_id_list (GList *ids);
+GList *lgl_paper_get_id_list (void);
+void lgl_paper_free_id_list (GList *ids);
/*
* Name lists
*/
-GList *gl_paper_get_name_list (void);
-void gl_paper_free_name_list (GList *names);
+GList *lgl_paper_get_name_list (void);
+void lgl_paper_free_name_list (GList *names);
/*
* Query functions
*/
-gboolean gl_paper_is_id_known (const gchar *id);
-gboolean gl_paper_is_id_other (const gchar *id);
+gboolean lgl_paper_is_id_known (const gchar *id);
+gboolean lgl_paper_is_id_other (const gchar *id);
-glPaper *gl_paper_from_id (const gchar *id);
-glPaper *gl_paper_from_name (const gchar *name);
+lglPaper *lgl_paper_from_id (const gchar *id);
+lglPaper *lgl_paper_from_name (const gchar *name);
-gchar *gl_paper_lookup_id_from_name (const gchar *name);
-gchar *gl_paper_lookup_name_from_id (const gchar *id);
+gchar *lgl_paper_lookup_id_from_name (const gchar *name);
+gchar *lgl_paper_lookup_name_from_id (const gchar *id);
/*
* Debugging
*/
-void gl_paper_print_known_papers (void);
+void lgl_paper_print_known_papers (void);
G_END_DECLS
#include <glib/gdir.h>
#include <glib/gmessages.h>
#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include "libglabels-private.h"
#include "xml.h"
/*===========================================*/
/* Local function prototypes */
/*===========================================*/
-static glTemplate *template_full_page (const gchar *page_size);
+static lglTemplate *template_full_page (const gchar *page_size);
-static GList *read_templates (void);
+static GList *read_templates (void);
-static GList *read_template_files_from_dir (GList *templates,
- const gchar *dirname);
-static gint compare_origins (gconstpointer a,
- gconstpointer b,
- gpointer user_data);
+static GList *read_template_files_from_dir (GList *templates,
+ const gchar *dirname);
+
+static gint compare_origins (gconstpointer a,
+ gconstpointer b,
+ gpointer user_data);
/*****************************************************************************/
/* Initialize module. */
/*****************************************************************************/
void
-gl_template_init (void)
+lgl_template_init (void)
{
GList *page_sizes, *p;
templates = read_templates ();
- page_sizes = gl_paper_get_id_list ();
+ page_sizes = lgl_paper_get_id_list ();
for ( p=page_sizes; p != NULL; p=p->next ) {
- if ( !gl_paper_is_id_other (p->data) ) {
+ if ( !lgl_paper_is_id_other (p->data) ) {
templates = g_list_append (templates,
template_full_page (p->data));
}
}
- gl_paper_free_id_list (page_sizes);
+ lgl_paper_free_id_list (page_sizes);
}
/*****************************************************************************/
/* Register template: if not in current list, add it. */
/*****************************************************************************/
void
-gl_template_register (const glTemplate *template)
+lgl_template_register (const lglTemplate *template)
{
- GList *p_tmplt, *pa1;
- glTemplate *template1;
+ GList *p_tmplt, *pa1;
+ lglTemplate *template1;
if (!templates) {
- gl_template_init ();
+ lgl_template_init ();
}
for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) {
- template1 = (glTemplate *) p_tmplt->data;
+ template1 = (lglTemplate *) p_tmplt->data;
for (pa1=template1->aliases; pa1!=NULL; pa1=pa1->next) {
}
- if (gl_paper_is_id_known (template->page_size)) {
+ if (lgl_paper_is_id_known (template->page_size)) {
gchar *dir, *filename, *abs_filename;
templates = g_list_append (templates,
- gl_template_dup (template));
+ lgl_template_dup (template));
/* FIXME: make sure filename is unique */
- dir = GL_USER_DATA_DIR;
+ dir = LGL_USER_DATA_DIR;
mkdir (dir, 0775); /* Try to make sure directory exists. */
filename = g_strconcat (template->name, ".template", NULL);
abs_filename = g_build_filename (dir, filename, NULL);
- gl_xml_template_write_template_to_file (template, abs_filename);
+ lgl_xml_template_write_template_to_file (template, abs_filename);
g_free (dir);
g_free (filename);
g_free (abs_filename);
/* Get a list of valid names of unique templates for given page size */
/*********************************************************************************/
GList *
-gl_template_get_name_list_unique (const gchar *page_size,
- const gchar *category)
+lgl_template_get_name_list_unique (const gchar *page_size,
+ const gchar *category)
{
- GList *p_tmplt;
- glTemplate *template;
- GList *names = NULL;
+ GList *p_tmplt;
+ lglTemplate *template;
+ GList *names = NULL;
if (!templates)
{
- gl_template_init ();
+ lgl_template_init ();
}
for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next)
{
- template = (glTemplate *) p_tmplt->data;
- if (gl_template_does_page_size_match (template, page_size) &&
- gl_template_does_category_match (template, category))
+ template = (lglTemplate *) p_tmplt->data;
+ if (lgl_template_does_page_size_match (template, page_size) &&
+ lgl_template_does_category_match (template, category))
{
names = g_list_insert_sorted (names, g_strdup (template->name),
(GCompareFunc)g_strcasecmp);
/* Get a list of all valid template names for given page size (includes aliases) */
/*********************************************************************************/
GList *
-gl_template_get_name_list_all (const gchar *page_size,
- const gchar *category)
+lgl_template_get_name_list_all (const gchar *page_size,
+ const gchar *category)
{
- GList *p_tmplt, *p_alias;
- glTemplate *template;
- gchar *str;
- GList *names = NULL;
+ GList *p_tmplt, *p_alias;
+ lglTemplate *template;
+ gchar *str;
+ GList *names = NULL;
if (!templates)
{
- gl_template_init ();
+ lgl_template_init ();
}
for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next)
{
- template = (glTemplate *) p_tmplt->data;
- if (gl_template_does_page_size_match (template, page_size) &&
- gl_template_does_category_match (template, category))
+ template = (lglTemplate *) p_tmplt->data;
+ if (lgl_template_does_page_size_match (template, page_size) &&
+ lgl_template_does_category_match (template, category))
{
for (p_alias = template->aliases; p_alias != NULL;
p_alias = p_alias->next)
/* Free a list of template names. */
/*****************************************************************************/
void
-gl_template_free_name_list (GList *names)
+lgl_template_free_name_list (GList *names)
{
GList *p_name;
/*****************************************************************************/
/* Return a template structure from a name. */
/*****************************************************************************/
-glTemplate *
-gl_template_from_name (const gchar *name)
+lglTemplate *
+lgl_template_from_name (const gchar *name)
{
- GList *p_tmplt, *p_alias;
- glTemplate *template;
+ GList *p_tmplt, *p_alias;
+ lglTemplate *template;
if (!templates) {
- gl_template_init ();
+ lgl_template_init ();
}
if (name == NULL) {
/* If no name, return first template as a default */
- return gl_template_dup ((glTemplate *) templates->data);
+ return lgl_template_dup ((lglTemplate *) templates->data);
}
for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) {
- template = (glTemplate *) p_tmplt->data;
+ template = (lglTemplate *) p_tmplt->data;
for (p_alias = template->aliases; p_alias != NULL;
p_alias = p_alias->next) {
if (g_strcasecmp (p_alias->data, name) == 0) {
- return gl_template_dup (template);
+ return lgl_template_dup (template);
}
}
}
/* No matching template has been found so return the first template */
- return gl_template_dup ((glTemplate *) templates->data);
+ return lgl_template_dup ((lglTemplate *) templates->data);
}
/*****************************************************************************/
/* Get first label type in template. */
/*****************************************************************************/
-const glTemplateLabelType *
-gl_template_get_first_label_type (const glTemplate *template)
+const lglTemplateFrame *
+lgl_template_get_first_frame (const lglTemplate *template)
{
g_return_val_if_fail (template, NULL);
- return (glTemplateLabelType *)template->label_types->data;
+ return (lglTemplateFrame *)template->frames->data;
}
/****************************************************************************/
/* Get raw label size (width and height). */
/****************************************************************************/
void
-gl_template_get_label_size (const glTemplateLabelType *label_type,
- gdouble *w,
- gdouble *h)
+lgl_template_frame_get_size (const lglTemplateFrame *frame,
+ gdouble *w,
+ gdouble *h)
{
- g_return_if_fail (label_type);
+ g_return_if_fail (frame);
- switch (label_type->shape) {
- case GL_TEMPLATE_SHAPE_RECT:
- *w = label_type->size.rect.w;
- *h = label_type->size.rect.h;
+ switch (frame->shape) {
+ case LGL_TEMPLATE_FRAME_SHAPE_RECT:
+ *w = frame->rect.w;
+ *h = frame->rect.h;
break;
- case GL_TEMPLATE_SHAPE_ROUND:
- *w = 2.0 * label_type->size.round.r;
- *h = 2.0 * label_type->size.round.r;
+ case LGL_TEMPLATE_FRAME_SHAPE_ROUND:
+ *w = 2.0 * frame->round.r;
+ *h = 2.0 * frame->round.r;
break;
- case GL_TEMPLATE_SHAPE_CD:
- if (label_type->size.cd.w == 0.0) {
- *w = 2.0 * label_type->size.cd.r1;
+ case LGL_TEMPLATE_FRAME_SHAPE_CD:
+ if (frame->cd.w == 0.0) {
+ *w = 2.0 * frame->cd.r1;
} else {
- *w = label_type->size.cd.w;
+ *w = frame->cd.w;
}
- if (label_type->size.cd.h == 0.0) {
- *h = 2.0 * label_type->size.cd.r1;
+ if (frame->cd.h == 0.0) {
+ *h = 2.0 * frame->cd.r1;
} else {
- *h = label_type->size.cd.h;
+ *h = frame->cd.h;
}
break;
default:
/* Get total number of labels per sheet of a label type. */
/****************************************************************************/
gint
-gl_template_get_n_labels (const glTemplateLabelType *label_type)
+lgl_template_frame_get_n_labels (const lglTemplateFrame *frame)
{
- gint n_labels = 0;
- GList *p;
- glTemplateLayout *layout;
+ gint n_labels = 0;
+ GList *p;
+ lglTemplateLayout *layout;
- g_return_val_if_fail (label_type, 0);
+ g_return_val_if_fail (frame, 0);
- for ( p=label_type->layouts; p != NULL; p=p->next ) {
- layout = (glTemplateLayout *)p->data;
+ for ( p=frame->all.layouts; p != NULL; p=p->next ) {
+ layout = (lglTemplateLayout *)p->data;
n_labels += layout->nx * layout->ny;
}
/****************************************************************************/
/* Get array of origins of individual labels. */
/****************************************************************************/
-glTemplateOrigin *
-gl_template_get_origins (const glTemplateLabelType *label_type)
+lglTemplateOrigin *
+lgl_template_frame_get_origins (const lglTemplateFrame *frame)
{
- gint i_label, n_labels, ix, iy;
- glTemplateOrigin *origins;
- GList *p;
- glTemplateLayout *layout;
+ gint i_label, n_labels, ix, iy;
+ lglTemplateOrigin *origins;
+ GList *p;
+ lglTemplateLayout *layout;
- g_return_val_if_fail (label_type, NULL);
+ g_return_val_if_fail (frame, NULL);
- n_labels = gl_template_get_n_labels (label_type);
- origins = g_new0 (glTemplateOrigin, n_labels);
+ n_labels = lgl_template_frame_get_n_labels (frame);
+ origins = g_new0 (lglTemplateOrigin, n_labels);
i_label = 0;
- for ( p=label_type->layouts; p != NULL; p=p->next ) {
- layout = (glTemplateLayout *)p->data;
+ for ( p=frame->all.layouts; p != NULL; p=p->next ) {
+ layout = (lglTemplateLayout *)p->data;
for (iy = 0; iy < layout->ny; iy++) {
for (ix = 0; ix < layout->nx; ix++, i_label++) {
}
}
- g_qsort_with_data (origins, n_labels, sizeof(glTemplateOrigin),
+ g_qsort_with_data (origins, n_labels, sizeof(lglTemplateOrigin),
compare_origins, NULL);
return origins;
/*****************************************************************************/
/* Create a new template with given properties. */
/*****************************************************************************/
-glTemplate *
-gl_template_new (const gchar *name,
- const gchar *description,
- const gchar *page_size,
- gdouble page_width,
- gdouble page_height)
+lglTemplate *
+lgl_template_new (const gchar *name,
+ const gchar *description,
+ const gchar *page_size,
+ gdouble page_width,
+ gdouble page_height)
{
- glTemplate *template;
+ lglTemplate *template;
- template = g_new0 (glTemplate,1);
+ template = g_new0 (lglTemplate,1);
template->name = g_strdup (name);
template->description = g_strdup (description);
/* Does page size match given id? */
/*****************************************************************************/
gboolean
-gl_template_does_page_size_match (const glTemplate *template,
- const gchar *page_size)
+lgl_template_does_page_size_match (const lglTemplate *template,
+ const gchar *page_size)
{
- g_return_if_fail (template);
+ g_return_val_if_fail (template, FALSE);
/* NULL matches everything. */
if (page_size == NULL)
/* Does category match given id? */
/*****************************************************************************/
gboolean
-gl_template_does_category_match (const glTemplate *template,
- const gchar *category)
+lgl_template_does_category_match (const lglTemplate *template,
+ const gchar *category)
{
GList *p;
- g_return_if_fail (template);
+ g_return_val_if_fail (template, FALSE);
/* NULL matches everything. */
if (category == NULL)
/* Add category to category list of template. */
/*****************************************************************************/
void
-gl_template_add_category (glTemplate *template,
- const gchar *category)
+lgl_template_add_category (lglTemplate *template,
+ const gchar *category)
{
g_return_if_fail (template);
g_return_if_fail (category);
/* Add label type structure to label type list of template. */
/*****************************************************************************/
void
-gl_template_add_label_type (glTemplate *template,
- glTemplateLabelType *label_type)
+lgl_template_add_frame (lglTemplate *template,
+ lglTemplateFrame *frame)
{
g_return_if_fail (template);
- g_return_if_fail (label_type);
+ g_return_if_fail (frame);
- template->label_types = g_list_append (template->label_types,
- label_type);
+ template->frames = g_list_append (template->frames, frame);
}
/*****************************************************************************/
/* Add alias to alias list of template. */
/*****************************************************************************/
void
-gl_template_add_alias (glTemplate *template,
- const gchar *alias)
+lgl_template_add_alias (lglTemplate *template,
+ const gchar *alias)
{
g_return_if_fail (template);
g_return_if_fail (alias);
/*****************************************************************************/
/* Create a new label type structure for a rectangular label. */
/*****************************************************************************/
-glTemplateLabelType *
-gl_template_rect_label_type_new (const gchar *id,
- gdouble w,
- gdouble h,
- gdouble r,
- gdouble x_waste,
- gdouble y_waste)
+lglTemplateFrame *
+lgl_template_frame_rect_new (const gchar *id,
+ gdouble w,
+ gdouble h,
+ gdouble r,
+ gdouble x_waste,
+ gdouble y_waste)
{
- glTemplateLabelType *label_type;
+ lglTemplateFrame *frame;
- label_type = g_new0 (glTemplateLabelType, 1);
+ frame = g_new0 (lglTemplateFrame, 1);
- label_type->id = g_strdup (id);
- label_type->shape = GL_TEMPLATE_SHAPE_RECT;
+ frame->shape = LGL_TEMPLATE_FRAME_SHAPE_RECT;
+ frame->rect.id = g_strdup (id);
- label_type->size.rect.w = w;
- label_type->size.rect.h = h;
- label_type->size.rect.r = r;
- label_type->size.rect.x_waste = x_waste;
- label_type->size.rect.y_waste = y_waste;
+ frame->rect.w = w;
+ frame->rect.h = h;
+ frame->rect.r = r;
+ frame->rect.x_waste = x_waste;
+ frame->rect.y_waste = y_waste;
- return label_type;
+ return frame;
}
/*****************************************************************************/
/* Create a new label type structure for a round label. */
/*****************************************************************************/
-glTemplateLabelType *
-gl_template_round_label_type_new (const gchar *id,
- gdouble r,
- gdouble waste)
+lglTemplateFrame *
+lgl_template_frame_round_new (const gchar *id,
+ gdouble r,
+ gdouble waste)
{
- glTemplateLabelType *label_type;
+ lglTemplateFrame *frame;
- label_type = g_new0 (glTemplateLabelType, 1);
+ frame = g_new0 (lglTemplateFrame, 1);
- label_type->id = g_strdup (id);
- label_type->shape = GL_TEMPLATE_SHAPE_ROUND;
+ frame->shape = LGL_TEMPLATE_FRAME_SHAPE_ROUND;
+ frame->round.id = g_strdup (id);
- label_type->size.round.r = r;
- label_type->size.round.waste = waste;
+ frame->round.r = r;
+ frame->round.waste = waste;
- return label_type;
+ return frame;
}
/*****************************************************************************/
/* Create a new label type structure for a CD/DVD label. */
/*****************************************************************************/
-glTemplateLabelType *
-gl_template_cd_label_type_new (const gchar *id,
- gdouble r1,
- gdouble r2,
- gdouble w,
- gdouble h,
- gdouble waste)
+lglTemplateFrame *
+lgl_template_frame_cd_new (const gchar *id,
+ gdouble r1,
+ gdouble r2,
+ gdouble w,
+ gdouble h,
+ gdouble waste)
{
- glTemplateLabelType *label_type;
+ lglTemplateFrame *frame;
- label_type = g_new0 (glTemplateLabelType, 1);
+ frame = g_new0 (lglTemplateFrame, 1);
- label_type->id = g_strdup (id);
- label_type->shape = GL_TEMPLATE_SHAPE_CD;
+ frame->shape = LGL_TEMPLATE_FRAME_SHAPE_CD;
+ frame->cd.id = g_strdup (id);
- label_type->size.cd.r1 = r1;
- label_type->size.cd.r2 = r2;
- label_type->size.cd.w = w;
- label_type->size.cd.h = h;
- label_type->size.cd.waste = waste;
+ frame->cd.r1 = r1;
+ frame->cd.r2 = r2;
+ frame->cd.w = w;
+ frame->cd.h = h;
+ frame->cd.waste = waste;
- return label_type;
+ return frame;
}
/*****************************************************************************/
/* Add a layout to a label type. */
/*****************************************************************************/
void
-gl_template_add_layout (glTemplateLabelType *label_type,
- glTemplateLayout *layout)
+lgl_template_add_layout (lglTemplateFrame *frame,
+ lglTemplateLayout *layout)
{
- g_return_if_fail (label_type);
+ g_return_if_fail (frame);
g_return_if_fail (layout);
- label_type->layouts = g_list_append (label_type->layouts,
- layout);
+ frame->all.layouts = g_list_append (frame->all.layouts, layout);
}
/*****************************************************************************/
/* Add a markup item to a label type. */
/*****************************************************************************/
void
-gl_template_add_markup (glTemplateLabelType *label_type,
- glTemplateMarkup *markup)
+lgl_template_add_markup (lglTemplateFrame *frame,
+ lglTemplateMarkup *markup)
{
- g_return_if_fail (label_type);
+ g_return_if_fail (frame);
g_return_if_fail (markup);
- label_type->markups = g_list_append (label_type->markups,
- markup);
+ frame->all.markups = g_list_append (frame->all.markups, markup);
}
/*****************************************************************************/
/* Create new layout structure. */
/*****************************************************************************/
-glTemplateLayout *
-gl_template_layout_new (gint nx,
- gint ny,
- gdouble x0,
- gdouble y0,
- gdouble dx,
- gdouble dy)
+lglTemplateLayout *
+lgl_template_layout_new (gint nx,
+ gint ny,
+ gdouble x0,
+ gdouble y0,
+ gdouble dx,
+ gdouble dy)
{
- glTemplateLayout *layout;
+ lglTemplateLayout *layout;
- layout = g_new0 (glTemplateLayout, 1);
+ layout = g_new0 (lglTemplateLayout, 1);
layout->nx = nx;
layout->ny = ny;
/*****************************************************************************/
/* Create new margin markup structure. */
/*****************************************************************************/
-glTemplateMarkup *
-gl_template_markup_margin_new (gdouble size)
+lglTemplateMarkup *
+lgl_template_markup_margin_new (gdouble size)
{
- glTemplateMarkup *markup;
+ lglTemplateMarkup *markup;
- markup = g_new0 (glTemplateMarkup, 1);
+ markup = g_new0 (lglTemplateMarkup, 1);
- markup->type = GL_TEMPLATE_MARKUP_MARGIN;
- markup->data.margin.size = size;
+ markup->type = LGL_TEMPLATE_MARKUP_MARGIN;
+ markup->margin.size = size;
return markup;
}
/*****************************************************************************/
/* Create new markup line structure. */
/*****************************************************************************/
-glTemplateMarkup *
-gl_template_markup_line_new (gdouble x1,
- gdouble y1,
- gdouble x2,
- gdouble y2)
+lglTemplateMarkup *
+lgl_template_markup_line_new (gdouble x1,
+ gdouble y1,
+ gdouble x2,
+ gdouble y2)
{
- glTemplateMarkup *markup;
+ lglTemplateMarkup *markup;
- markup = g_new0 (glTemplateMarkup, 1);
+ markup = g_new0 (lglTemplateMarkup, 1);
- markup->type = GL_TEMPLATE_MARKUP_LINE;
- markup->data.line.x1 = x1;
- markup->data.line.y1 = y1;
- markup->data.line.x2 = x2;
- markup->data.line.y2 = y2;
+ markup->type = LGL_TEMPLATE_MARKUP_LINE;
+ markup->line.x1 = x1;
+ markup->line.y1 = y1;
+ markup->line.x2 = x2;
+ markup->line.y2 = y2;
return markup;
}
/*****************************************************************************/
/* Create new markup circle structure. */
/*****************************************************************************/
-glTemplateMarkup *
-gl_template_markup_circle_new (gdouble x0,
- gdouble y0,
- gdouble r)
+lglTemplateMarkup *
+lgl_template_markup_circle_new (gdouble x0,
+ gdouble y0,
+ gdouble r)
{
- glTemplateMarkup *markup;
+ lglTemplateMarkup *markup;
- markup = g_new0 (glTemplateMarkup, 1);
+ markup = g_new0 (lglTemplateMarkup, 1);
- markup->type = GL_TEMPLATE_MARKUP_CIRCLE;
- markup->data.circle.x0 = x0;
- markup->data.circle.y0 = y0;
- markup->data.circle.r = r;
+ markup->type = LGL_TEMPLATE_MARKUP_CIRCLE;
+ markup->circle.x0 = x0;
+ markup->circle.y0 = y0;
+ markup->circle.r = r;
return markup;
}
/*****************************************************************************/
/* Create new markup rect structure. */
/*****************************************************************************/
-glTemplateMarkup *
-gl_template_markup_rect_new (gdouble x1,
- gdouble y1,
- gdouble w,
- gdouble h,
- gdouble r)
+lglTemplateMarkup *
+lgl_template_markup_rect_new (gdouble x1,
+ gdouble y1,
+ gdouble w,
+ gdouble h,
+ gdouble r)
{
- glTemplateMarkup *markup;
+ lglTemplateMarkup *markup;
- markup = g_new0 (glTemplateMarkup, 1);
+ markup = g_new0 (lglTemplateMarkup, 1);
- markup->type = GL_TEMPLATE_MARKUP_RECT;
- markup->data.rect.x1 = x1;
- markup->data.rect.y1 = y1;
- markup->data.rect.w = w;
- markup->data.rect.h = h;
- markup->data.rect.r = r;
+ markup->type = LGL_TEMPLATE_MARKUP_RECT;
+ markup->rect.x1 = x1;
+ markup->rect.y1 = y1;
+ markup->rect.w = w;
+ markup->rect.h = h;
+ markup->rect.r = r;
return markup;
}
/*****************************************************************************/
/* Copy a template. */
/*****************************************************************************/
-glTemplate *
-gl_template_dup (const glTemplate *orig_template)
+lglTemplate *
+lgl_template_dup (const lglTemplate *orig_template)
{
- glTemplate *template;
+ lglTemplate *template;
GList *p;
- glTemplateLabelType *label_type;
+ lglTemplateFrame *frame;
g_return_val_if_fail (orig_template, NULL);
- template = gl_template_new (orig_template->name,
- orig_template->description,
- orig_template->page_size,
- orig_template->page_width,
- orig_template->page_height);
+ template = lgl_template_new (orig_template->name,
+ orig_template->description,
+ orig_template->page_size,
+ orig_template->page_width,
+ orig_template->page_height);
for ( p=orig_template->categories; p != NULL; p=p->next ) {
- gl_template_add_category (template, p->data);
+ lgl_template_add_category (template, p->data);
}
- for ( p=orig_template->label_types; p != NULL; p=p->next ) {
+ for ( p=orig_template->frames; p != NULL; p=p->next ) {
- label_type = (glTemplateLabelType *)p->data;
+ frame = (lglTemplateFrame *)p->data;
- gl_template_add_label_type (template,
- gl_template_label_type_dup (label_type));
+ lgl_template_add_frame (template, lgl_template_frame_dup (frame));
}
for ( p=orig_template->aliases; p != NULL; p=p->next ) {
if (g_strcasecmp (template->name, p->data) != 0) {
- gl_template_add_alias (template, p->data);
+ lgl_template_add_alias (template, p->data);
}
}
/* Free up a template. */
/*****************************************************************************/
void
-gl_template_free (glTemplate *template)
+lgl_template_free (lglTemplate *template)
{
- GList *p;
- glTemplateLabelType *label_type;
+ GList *p;
+ lglTemplateFrame *frame;
if ( template != NULL ) {
g_list_free (template->categories);
template->categories = NULL;
- for ( p=template->label_types; p != NULL; p=p->next ) {
+ for ( p=template->frames; p != NULL; p=p->next ) {
- label_type = (glTemplateLabelType *)p->data;
+ frame = (lglTemplateFrame *)p->data;
- gl_template_label_type_free (label_type);
+ lgl_template_frame_free (frame);
p->data = NULL;
}
- g_list_free (template->label_types);
- template->label_types = NULL;
+ g_list_free (template->frames);
+ template->frames = NULL;
for ( p=template->aliases; p != NULL; p=p->next ) {
/*****************************************************************************/
/* Copy a template label type. */
/*****************************************************************************/
-glTemplateLabelType *
-gl_template_label_type_dup (const glTemplateLabelType *orig_label_type)
+lglTemplateFrame *
+lgl_template_frame_dup (const lglTemplateFrame *orig_frame)
{
- glTemplateLabelType *label_type;
+ lglTemplateFrame *frame;
GList *p;
- glTemplateLayout *layout;
- glTemplateMarkup *markup;
+ lglTemplateLayout *layout;
+ lglTemplateMarkup *markup;
- g_return_val_if_fail (orig_label_type, NULL);
+ g_return_val_if_fail (orig_frame, NULL);
- switch (orig_label_type->shape) {
+ switch (orig_frame->shape) {
- case GL_TEMPLATE_SHAPE_RECT:
- label_type =
- gl_template_rect_label_type_new (orig_label_type->id,
- orig_label_type->size.rect.w,
- orig_label_type->size.rect.h,
- orig_label_type->size.rect.r,
- orig_label_type->size.rect.x_waste,
- orig_label_type->size.rect.y_waste);
+ case LGL_TEMPLATE_FRAME_SHAPE_RECT:
+ frame =
+ lgl_template_frame_rect_new (orig_frame->all.id,
+ orig_frame->rect.w,
+ orig_frame->rect.h,
+ orig_frame->rect.r,
+ orig_frame->rect.x_waste,
+ orig_frame->rect.y_waste);
break;
- case GL_TEMPLATE_SHAPE_ROUND:
- label_type =
- gl_template_round_label_type_new (orig_label_type->id,
- orig_label_type->size.round.r,
- orig_label_type->size.round.waste);
+ case LGL_TEMPLATE_FRAME_SHAPE_ROUND:
+ frame =
+ lgl_template_frame_round_new (orig_frame->all.id,
+ orig_frame->round.r,
+ orig_frame->round.waste);
break;
- case GL_TEMPLATE_SHAPE_CD:
- label_type =
- gl_template_cd_label_type_new (orig_label_type->id,
- orig_label_type->size.cd.r1,
- orig_label_type->size.cd.r2,
- orig_label_type->size.cd.w,
- orig_label_type->size.cd.h,
- orig_label_type->size.cd.waste);
+ case LGL_TEMPLATE_FRAME_SHAPE_CD:
+ frame =
+ lgl_template_frame_cd_new (orig_frame->all.id,
+ orig_frame->cd.r1,
+ orig_frame->cd.r2,
+ orig_frame->cd.w,
+ orig_frame->cd.h,
+ orig_frame->cd.waste);
break;
default:
break;
}
- for ( p=orig_label_type->layouts; p != NULL; p=p->next ) {
+ for ( p=orig_frame->all.layouts; p != NULL; p=p->next ) {
- layout = (glTemplateLayout *)p->data;
+ layout = (lglTemplateLayout *)p->data;
- gl_template_add_layout (label_type,
- gl_template_layout_dup (layout));
+ lgl_template_add_layout (frame, lgl_template_layout_dup (layout));
}
- for ( p=orig_label_type->markups; p != NULL; p=p->next ) {
+ for ( p=orig_frame->all.markups; p != NULL; p=p->next ) {
- markup = (glTemplateMarkup *)p->data;
+ markup = (lglTemplateMarkup *)p->data;
- gl_template_add_markup (label_type,
- gl_template_markup_dup (markup));
+ lgl_template_add_markup (frame, lgl_template_markup_dup (markup));
}
- return label_type;
+ return frame;
}
/*****************************************************************************/
/* Free up a template label type. */
/*****************************************************************************/
void
-gl_template_label_type_free (glTemplateLabelType *label_type)
+lgl_template_frame_free (lglTemplateFrame *frame)
{
- GList *p;
- glTemplateLayout *layout;
- glTemplateMarkup *markup;
+ GList *p;
+ lglTemplateLayout *layout;
+ lglTemplateMarkup *markup;
- if ( label_type != NULL ) {
+ if ( frame != NULL ) {
- g_free (label_type->id);
- label_type->id = NULL;
+ g_free (frame->all.id);
+ frame->all.id = NULL;
- for ( p=label_type->layouts; p != NULL; p=p->next ) {
+ for ( p=frame->all.layouts; p != NULL; p=p->next ) {
- layout = (glTemplateLayout *)p->data;
+ layout = (lglTemplateLayout *)p->data;
- gl_template_layout_free (layout);
+ lgl_template_layout_free (layout);
p->data = NULL;
}
- g_list_free (label_type->layouts);
- label_type->layouts = NULL;
+ g_list_free (frame->all.layouts);
+ frame->all.layouts = NULL;
- for ( p=label_type->markups; p != NULL; p=p->next ) {
+ for ( p=frame->all.markups; p != NULL; p=p->next ) {
- markup = (glTemplateMarkup *)p->data;
+ markup = (lglTemplateMarkup *)p->data;
- gl_template_markup_free (markup);
+ lgl_template_markup_free (markup);
p->data = NULL;
}
- g_list_free (label_type->markups);
- label_type->markups = NULL;
+ g_list_free (frame->all.markups);
+ frame->all.markups = NULL;
- g_free (label_type);
+ g_free (frame);
}
/*****************************************************************************/
/* Duplicate layout structure. */
/*****************************************************************************/
-glTemplateLayout *
-gl_template_layout_dup (const glTemplateLayout *orig_layout)
+lglTemplateLayout *
+lgl_template_layout_dup (const lglTemplateLayout *orig_layout)
{
- glTemplateLayout *layout;
+ lglTemplateLayout *layout;
g_return_val_if_fail (orig_layout, NULL);
- layout = g_new0 (glTemplateLayout, 1);
+ layout = g_new0 (lglTemplateLayout, 1);
/* copy contents */
*layout = *orig_layout;
/* Free layout structure. */
/*****************************************************************************/
void
-gl_template_layout_free (glTemplateLayout *layout)
+lgl_template_layout_free (lglTemplateLayout *layout)
{
g_free (layout);
}
/*****************************************************************************/
/* Duplicate markup structure. */
/*****************************************************************************/
-glTemplateMarkup *
-gl_template_markup_dup (const glTemplateMarkup *orig_markup)
+lglTemplateMarkup *
+lgl_template_markup_dup (const lglTemplateMarkup *orig_markup)
{
- glTemplateMarkup *markup;
+ lglTemplateMarkup *markup;
g_return_val_if_fail (orig_markup, NULL);
- markup = g_new0 (glTemplateMarkup, 1);
+ markup = g_new0 (lglTemplateMarkup, 1);
*markup = *orig_markup;
/* Free markup structure. */
/*****************************************************************************/
void
-gl_template_markup_free (glTemplateMarkup *markup)
+lgl_template_markup_free (lglTemplateMarkup *markup)
{
g_free (markup);
}
/*--------------------------------------------------------------------------*/
/* PRIVATE. Make a template for a full page of the given page size. */
/*--------------------------------------------------------------------------*/
-static glTemplate *
+static lglTemplate *
template_full_page (const gchar *page_size)
{
- glPaper *paper = NULL;
- glTemplate *template = NULL;
- glTemplateLabelType *label_type = NULL;
+ lglPaper *paper = NULL;
+ lglTemplate *template = NULL;
+ lglTemplateFrame *frame = NULL;
gchar *name;
g_return_val_if_fail (page_size, NULL);
- paper = gl_paper_from_id (page_size);
+ paper = lgl_paper_from_id (page_size);
if ( paper == NULL ) {
return NULL;
}
name = g_strdup_printf (_("Generic %s full page"), page_size);
- template = gl_template_new (name,
- FULL_PAGE,
- page_size,
- paper->width,
- paper->height);
+ template = lgl_template_new (name,
+ FULL_PAGE,
+ page_size,
+ paper->width,
+ paper->height);
- label_type = gl_template_rect_label_type_new ("0",
- paper->width,
- paper->height,
- 0.0,
- 0.0,
- 0.0);
- gl_template_add_label_type (template, label_type);
+ frame = lgl_template_frame_rect_new ("0",
+ paper->width,
+ paper->height,
+ 0.0,
+ 0.0,
+ 0.0);
+ lgl_template_add_frame (template, frame);
- gl_template_add_layout (label_type,
- gl_template_layout_new (1, 1, 0., 0., 0., 0.));
+ lgl_template_add_layout (frame, lgl_template_layout_new (1, 1, 0., 0., 0., 0.));
- gl_template_add_markup (label_type,
- gl_template_markup_margin_new (9.0));
+ lgl_template_add_markup (frame, lgl_template_markup_margin_new (9.0));
g_free (name);
name = NULL;
- gl_paper_free (paper);
+ lgl_paper_free (paper);
paper = NULL;
return template;
gchar *data_dir;
GList *templates = NULL;
- data_dir = GL_SYSTEM_DATA_DIR;
+ data_dir = LGL_SYSTEM_DATA_DIR;
templates = read_template_files_from_dir (templates, data_dir);
g_free (data_dir);
- data_dir = GL_USER_DATA_DIR;
+ data_dir = LGL_USER_DATA_DIR;
templates = read_template_files_from_dir (templates, data_dir);
g_free (data_dir);
full_filename = g_build_filename (dirname, filename, NULL);
new_templates =
- gl_xml_template_read_templates_from_file (full_filename);
+ lgl_xml_template_read_templates_from_file (full_filename);
g_free (full_filename);
templates = g_list_concat (templates, new_templates);
gconstpointer b,
gpointer user_data)
{
- const glTemplateOrigin *a_origin = a, *b_origin = b;
+ const lglTemplateOrigin *a_origin = a, *b_origin = b;
if ( a_origin->y < b_origin->y ) {
return -1;
/* Print all known templates (for debugging purposes). */
/*****************************************************************************/
void
-gl_template_print_known_templates (void)
+lgl_template_print_known_templates (void)
{
- GList *p;
- glTemplate *template;
+ GList *p;
+ lglTemplate *template;
g_print ("%s():\n", __FUNCTION__);
for (p=templates; p!=NULL; p=p->next) {
- template = (glTemplate *)p->data;
+ template = (lglTemplate *)p->data;
g_print("TEMPLATE name=\"%s\", description=\"%s\"\n",
template->name, template->description);
/* Print all aliases of a template (for debugging purposes). */
/*****************************************************************************/
void
-gl_template_print_aliases (const glTemplate *template)
+lgl_template_print_aliases (const lglTemplate *template)
{
GList *p;
g_print ("%s():\n", __FUNCTION__);
for (p=template->aliases; p!=NULL; p=p->next) {
- g_print("Alias = \"%s\"\n", p->data);
+ g_print("Alias = \"%s\"\n", (gchar *)p->data);
}
g_print ("\n");
G_BEGIN_DECLS
-typedef struct _glTemplate glTemplate;
-typedef struct _glTemplateLabelType glTemplateLabelType;
-typedef struct _glTemplateLayout glTemplateLayout;
-typedef struct _glTemplateMarkup glTemplateMarkup;
-typedef struct _glTemplateOrigin glTemplateOrigin;
+typedef struct _lglTemplate lglTemplate;
+
+typedef union _lglTemplateFrame lglTemplateFrame;
+typedef struct _lglTemplateFrameAll lglTemplateFrameAll;
+typedef struct _lglTemplateFrameRect lglTemplateFrameRect;
+typedef struct _lglTemplateFrameRound lglTemplateFrameRound;
+typedef struct _lglTemplateFrameCD lglTemplateFrameCD;
+
+typedef struct _lglTemplateLayout lglTemplateLayout;
+
+typedef union _lglTemplateMarkup lglTemplateMarkup;
+typedef struct _lglTemplateMarkupMargin lglTemplateMarkupMargin;
+typedef struct _lglTemplateMarkupLine lglTemplateMarkupLine;
+typedef struct _lglTemplateMarkupCircle lglTemplateMarkupCircle;
+typedef struct _lglTemplateMarkupRect lglTemplateMarkupRect;
+
+typedef struct _lglTemplateOrigin lglTemplateOrigin;
/*
* Top-level Template Structure
*/
-struct _glTemplate {
+struct _lglTemplate {
gchar *name;
gchar *description;
/* List of (gchar *) category ids. */
GList *categories;
- /* List of (glTemplateLabelType *) label type structures.
- * Currently glabels only supports a single label type per
+ /* List of (lglTemplateFrame *) label frame structures.
+ * Currently glabels only supports a single label frame per
* template. */
- GList *label_types;
+ GList *frames;
/* List of (gchar *) aliases. */
GList *aliases;
/*
- * Possible Label Shapes
+ * Possible Frame Shapes
*/
typedef enum {
- GL_TEMPLATE_SHAPE_RECT,
- GL_TEMPLATE_SHAPE_ROUND,
- GL_TEMPLATE_SHAPE_CD,
-} glTemplateLabelShape;
+ LGL_TEMPLATE_FRAME_SHAPE_RECT,
+ LGL_TEMPLATE_FRAME_SHAPE_ROUND,
+ LGL_TEMPLATE_FRAME_SHAPE_CD,
+} lglTemplateFrameShape;
/*
- * Label Type Structure
+ * Frame Structure
*/
-struct _glTemplateLabelType{
+struct _lglTemplateFrameAll {
+
+ /* Begin Common Fields */
+ lglTemplateFrameShape shape;
+
+ gchar *id; /* Id, currently always "0" */
+ GList *layouts; /* List of lglTemplateLayouts */
+ GList *markups; /* List of lglTemplateMarkups */
+ /* End Common Fields */
+};
+
+struct _lglTemplateFrameRect {
+
+ /* Begin Common Fields */
+ lglTemplateFrameShape shape; /* Always LGL_TEMPLATE_FRAME_SHAPE_RECT. */
gchar *id; /* Id, currently always "0" */
- GList *layouts; /* List of glTemplateLayouts */
- GList *markups; /* List of glTemplateMarkups */
+ GList *layouts; /* List of lglTemplateLayouts */
+ GList *markups; /* List of lglTemplateMarkups */
+ /* End Common Fields */
+
+ gdouble w; /* Width */
+ gdouble h; /* Height */
+ gdouble r; /* Corner radius */
+ gdouble x_waste; /* Amount of horiz overprint allowed. */
+ gdouble y_waste; /* Amount of vert overprint allowed. */
+};
- glTemplateLabelShape shape;
+struct _lglTemplateFrameRound {
+
+ /* Begin Common Fields */
+ lglTemplateFrameShape shape; /* Always LGL_TEMPLATE_FRAME_SHAPE_ROUND. */
+
+ gchar *id; /* Id, currently always "0" */
+ GList *layouts; /* List of lglTemplateLayouts */
+ GList *markups; /* List of lglTemplateMarkups */
+ /* End Common Fields */
- union {
+ gdouble r; /* Radius */
+ gdouble waste; /* Amount of overprint allowed. */
+};
- struct {
- gdouble w; /* Width */
- gdouble h; /* Height */
- gdouble r; /* Corner radius */
- gdouble x_waste; /* Amount of horiz overprint allowed. */
- gdouble y_waste; /* Amount of vert overprint allowed. */
- } rect;
+struct _lglTemplateFrameCD {
- struct {
- gdouble r; /* Radius */
- gdouble waste; /* Amount of overprint allowed. */
+ /* Begin Common Fields */
+ lglTemplateFrameShape shape; /* Always LGL_TEMPLATE_FRAME_SHAPE_CD. */
- } round;
+ gchar *id; /* Id, currently always "0" */
+ GList *layouts; /* List of lglTemplateLayouts */
+ GList *markups; /* List of lglTemplateMarkups */
+ /* End Common Fields */
+
+ gdouble r1; /* Outer radius */
+ gdouble r2; /* Inner radius (hole) */
+ gdouble w; /* Clip width, business card CDs */
+ gdouble h; /* Clip height, business card CDs */
+ gdouble waste; /* Amount of overprint allowed. */
+};
- struct {
- gdouble r1; /* Outer radius */
- gdouble r2; /* Inner radius (hole) */
- gdouble w; /* Clip width, business card CDs */
- gdouble h; /* Clip height, business card CDs */
- gdouble waste; /* Amount of overprint allowed. */
- } cd;
+union _lglTemplateFrame{
- } size;
+ lglTemplateFrameShape shape;
+ lglTemplateFrameAll all;
+ lglTemplateFrameRect rect;
+ lglTemplateFrameRound round;
+ lglTemplateFrameCD cd;
};
/*
* Label Layout Structure
*/
-struct _glTemplateLayout {
+struct _lglTemplateLayout {
gint nx; /* Number of labels across */
gint ny; /* Number of labels up and down */
* Possible Markup Types
*/
typedef enum {
- GL_TEMPLATE_MARKUP_MARGIN,
- GL_TEMPLATE_MARKUP_LINE,
- GL_TEMPLATE_MARKUP_CIRCLE,
- GL_TEMPLATE_MARKUP_RECT,
-} glTemplateMarkupType;
+ LGL_TEMPLATE_MARKUP_MARGIN,
+ LGL_TEMPLATE_MARKUP_LINE,
+ LGL_TEMPLATE_MARKUP_CIRCLE,
+ LGL_TEMPLATE_MARKUP_RECT,
+} lglTemplateMarkupType;
/*
* Label Markup Structure (Helpful lines drawn in glabels to help locate objects)
*/
-struct _glTemplateMarkup {
+struct _lglTemplateMarkupMargin {
+
+ lglTemplateMarkupType type; /* Always LGL_TEMPLATE_MARKUP_MARGIN */
+
+ gdouble size; /* Margin size */
+};
+
+struct _lglTemplateMarkupLine {
- glTemplateMarkupType type;
+ lglTemplateMarkupType type; /* Always LGL_TEMPLATE_MARKUP_LINE */
- union {
+ gdouble x1, y1; /* 1st endpoint */
+ gdouble x2, y2; /* 2nd endpoint */
+};
+
+struct _lglTemplateMarkupCircle {
- struct {
- gdouble size; /* Margin size */
- } margin;
+ lglTemplateMarkupType type; /* Always LGL_TEMPLATE_MARKUP_CIRCLE */
+
+ gdouble x0, y0; /* Center of circle */
+ gdouble r; /* Radius of circle */
+};
- struct {
- gdouble x1, y1; /* 1st endpoint */
- gdouble x2, y2; /* 2nd endpoint */
- } line;
+struct _lglTemplateMarkupRect {
+
+ lglTemplateMarkupType type; /* Always LGL_TEMPLATE_MARKUP_RECT */
+
+ gdouble x1, y1; /* Upper left corner */
+ gdouble w, h; /* Width and height. */
+ gdouble r; /* Radius of corners. */
+};
- struct {
- gdouble x0, y0; /* Center of circle */
- gdouble r; /* Radius of circle */
- } circle;
-
- struct {
- gdouble x1, y1; /* Upper left corner */
- gdouble w, h; /* Width and height. */
- gdouble r; /* Radius of corners. */
- } rect;
+union _lglTemplateMarkup {
- } data;
+ lglTemplateMarkupType type;
+ lglTemplateMarkupMargin margin;
+ lglTemplateMarkupLine line;
+ lglTemplateMarkupCircle circle;
+ lglTemplateMarkupRect rect;
};
/*
* Origin coordinates
*/
-struct _glTemplateOrigin {
+struct _lglTemplateOrigin {
gdouble x, y; /* Label origin relative to upper
* upper left hand corner of paper */
/*
* Module Initialization
*/
-void gl_template_init (void);
+void lgl_template_init (void);
-void gl_template_register (const glTemplate *template);
+void lgl_template_register (const lglTemplate *template);
/*
* Known templates query functions
*/
-GList *gl_template_get_name_list_unique (const gchar *page_size,
- const gchar *category);
+GList *lgl_template_get_name_list_unique (const gchar *page_size,
+ const gchar *category);
-GList *gl_template_get_name_list_all (const gchar *page_size,
- const gchar *category);
+GList *lgl_template_get_name_list_all (const gchar *page_size,
+ const gchar *category);
-void gl_template_free_name_list (GList *names);
+void lgl_template_free_name_list (GList *names);
-glTemplate *gl_template_from_name (const gchar *name);
+lglTemplate *lgl_template_from_name (const gchar *name);
/*
* Template query functions
*/
-const glTemplateLabelType *gl_template_get_first_label_type (const glTemplate *template);
+const lglTemplateFrame *lgl_template_get_first_frame (const lglTemplate *template);
-gboolean gl_template_does_page_size_match (const glTemplate *template,
- const gchar *page_size);
+gboolean lgl_template_does_page_size_match (const lglTemplate *template,
+ const gchar *page_size);
-gboolean gl_template_does_category_match (const glTemplate *template,
- const gchar *category);
+gboolean lgl_template_does_category_match (const lglTemplate *template,
+ const gchar *category);
/*
- * Label Type query functions
+ * Frame query functions
*/
-void gl_template_get_label_size (const glTemplateLabelType *label_type,
- gdouble *w,
- gdouble *h);
+void lgl_template_frame_get_size (const lglTemplateFrame *frame,
+ gdouble *w,
+ gdouble *h);
-gint gl_template_get_n_labels (const glTemplateLabelType *label_type);
+gint lgl_template_frame_get_n_labels (const lglTemplateFrame *frame);
-glTemplateOrigin *gl_template_get_origins (const glTemplateLabelType *label_type);
+lglTemplateOrigin *lgl_template_frame_get_origins (const lglTemplateFrame *frame);
/*
* Template Construction
*/
-glTemplate *gl_template_new (const gchar *name,
- const gchar *description,
- const gchar *page_size,
- gdouble page_width,
- gdouble page_height);
+lglTemplate *lgl_template_new (const gchar *name,
+ const gchar *description,
+ const gchar *page_size,
+ gdouble page_width,
+ gdouble page_height);
-void gl_template_add_category (glTemplate *template,
- const gchar *category);
+void lgl_template_add_category (lglTemplate *template,
+ const gchar *category);
-void gl_template_add_label_type (glTemplate *template,
- glTemplateLabelType *label_type);
+void lgl_template_add_frame (lglTemplate *template,
+ lglTemplateFrame *frame);
-void gl_template_add_alias (glTemplate *template,
- const gchar *alias);
+void lgl_template_add_alias (lglTemplate *template,
+ const gchar *alias);
-glTemplateLabelType *gl_template_rect_label_type_new (const gchar *id,
- gdouble w,
- gdouble h,
- gdouble r,
- gdouble x_waste,
- gdouble y_waste);
+lglTemplateFrame *lgl_template_frame_rect_new (const gchar *id,
+ gdouble w,
+ gdouble h,
+ gdouble r,
+ gdouble x_waste,
+ gdouble y_waste);
-glTemplateLabelType *gl_template_round_label_type_new (const gchar *id,
- gdouble r,
- gdouble waste);
+lglTemplateFrame *lgl_template_frame_round_new (const gchar *id,
+ gdouble r,
+ gdouble waste);
-glTemplateLabelType *gl_template_cd_label_type_new (const gchar *id,
- gdouble r1,
- gdouble r2,
- gdouble w,
- gdouble h,
- gdouble waste);
+lglTemplateFrame *lgl_template_frame_cd_new (const gchar *id,
+ gdouble r1,
+ gdouble r2,
+ gdouble w,
+ gdouble h,
+ gdouble waste);
-void gl_template_add_layout (glTemplateLabelType *label_type,
- glTemplateLayout *layout);
+void lgl_template_add_layout (lglTemplateFrame *frame,
+ lglTemplateLayout *layout);
-void gl_template_add_markup (glTemplateLabelType *label_type,
- glTemplateMarkup *markup);
+void lgl_template_add_markup (lglTemplateFrame *frame,
+ lglTemplateMarkup *markup);
-glTemplateLayout *gl_template_layout_new (gint nx,
- gint ny,
- gdouble x0,
- gdouble y0,
- gdouble dx,
- gdouble dy);
+lglTemplateLayout *lgl_template_layout_new (gint nx,
+ gint ny,
+ gdouble x0,
+ gdouble y0,
+ gdouble dx,
+ gdouble dy);
-glTemplateMarkup *gl_template_markup_margin_new (gdouble size);
+lglTemplateMarkup *lgl_template_markup_margin_new (gdouble size);
-glTemplateMarkup *gl_template_markup_line_new (gdouble x1,
- gdouble y1,
- gdouble x2,
- gdouble y2);
+lglTemplateMarkup *lgl_template_markup_line_new (gdouble x1,
+ gdouble y1,
+ gdouble x2,
+ gdouble y2);
-glTemplateMarkup *gl_template_markup_circle_new (gdouble x0,
- gdouble y0,
- gdouble r);
+lglTemplateMarkup *lgl_template_markup_circle_new (gdouble x0,
+ gdouble y0,
+ gdouble r);
-glTemplateMarkup *gl_template_markup_rect_new (gdouble x1,
- gdouble y1,
- gdouble w,
- gdouble h,
- gdouble r);
+lglTemplateMarkup *lgl_template_markup_rect_new (gdouble x1,
+ gdouble y1,
+ gdouble w,
+ gdouble h,
+ gdouble r);
-glTemplate *gl_template_dup (const glTemplate *orig);
+lglTemplate *lgl_template_dup (const lglTemplate *orig);
-void gl_template_free (glTemplate *template);
+void lgl_template_free (lglTemplate *template);
-glTemplateLabelType *gl_template_label_type_dup (const glTemplateLabelType *orig_ltype);
-void gl_template_label_type_free (glTemplateLabelType *ltype);
+lglTemplateFrame *lgl_template_frame_dup (const lglTemplateFrame *orig_frame);
+void lgl_template_frame_free (lglTemplateFrame *frame);
-glTemplateLayout *gl_template_layout_dup (const glTemplateLayout *orig_layout);
-void gl_template_layout_free (glTemplateLayout *layout);
+lglTemplateLayout *lgl_template_layout_dup (const lglTemplateLayout *orig_layout);
+void lgl_template_layout_free (lglTemplateLayout *layout);
-glTemplateMarkup *gl_template_markup_dup (const glTemplateMarkup *orig_markup);
-void gl_template_markup_free (glTemplateMarkup *markup);
+lglTemplateMarkup *lgl_template_markup_dup (const lglTemplateMarkup *orig_markup);
+void lgl_template_markup_free (lglTemplateMarkup *markup);
/*
* Debugging functions
*/
-void gl_template_print_known_templates (void);
-void gl_template_print_aliases (const glTemplate *template);
+void lgl_template_print_known_templates (void);
+void lgl_template_print_aliases (const lglTemplate *template);
G_END_DECLS
/**
- * gl_xml_category_read_categories_from_file:
+ * lgl_xml_category_read_categories_from_file:
* @utf8_filename: Filename of categories file (name encoded as UTF-8)
*
* Read category definitions from a file.
*
- * Returns: a list of #glCategory structures.
+ * Returns: a list of #lglCategory structures.
*
*/
GList *
-gl_xml_category_read_categories_from_file (gchar *utf8_filename)
+lgl_xml_category_read_categories_from_file (gchar *utf8_filename)
{
gchar *filename;
GList *categories;
return NULL;
}
- categories = gl_xml_category_parse_categories_doc (categories_doc);
+ categories = lgl_xml_category_parse_categories_doc (categories_doc);
g_free (filename);
xmlFreeDoc (categories_doc);
/**
- * gl_xml_category_parse_categories_doc:
+ * lgl_xml_category_parse_categories_doc:
* @categories_doc: libxml #xmlDocPtr tree, representing a categories
* definition file.
*
* Read category definitions from a libxml #xmlDocPtr tree.
*
- * Returns: a list of #glCategory structures.
+ * Returns: a list of #lglCategory structures.
*
*/
GList *
-gl_xml_category_parse_categories_doc (xmlDocPtr categories_doc)
+lgl_xml_category_parse_categories_doc (xmlDocPtr categories_doc)
{
- GList *categories = NULL;
- xmlNodePtr root, node;
- glCategory *category;
+ GList *categories = NULL;
+ xmlNodePtr root, node;
+ lglCategory *category;
LIBXML_TEST_VERSION;
xmlFreeDoc (categories_doc);
return categories;
}
- if (!gl_xml_is_node (root, "Glabels-categories")) {
+ if (!lgl_xml_is_node (root, "Glabels-categories")) {
g_message ("\"%s\" is not a glabels category file (wrong root node)",
categories_doc->name);
xmlFreeDoc (categories_doc);
for (node = root->xmlChildrenNode; node != NULL; node = node->next) {
- if (gl_xml_is_node (node, "Category")) {
- category = gl_xml_category_parse_category_node (node);
+ if (lgl_xml_is_node (node, "Category")) {
+ category = lgl_xml_category_parse_category_node (node);
categories = g_list_append (categories, category);
} else {
if ( !xmlNodeIsText(node) ) {
- if (!gl_xml_is_node (node, "comment")) {
+ if (!lgl_xml_is_node (node, "comment")) {
g_message ("bad node = \"%s\"",node->name);
}
}
/**
- * gl_xml_category_parse_category_node:
+ * lgl_xml_category_parse_category_node:
* @category_node: libxml #xmlNodePtr category node from a #xmlDocPtr tree.
*
* Read a single category definition from a libxml #xmlNodePtr node.
*
- * Returns: a pointer to a newly created #glCategory structure.
+ * Returns: a pointer to a newly created #lglCategory structure.
*
*/
-glCategory *
-gl_xml_category_parse_category_node (xmlNodePtr category_node)
+lglCategory *
+lgl_xml_category_parse_category_node (xmlNodePtr category_node)
{
- glCategory *category;
+ lglCategory *category;
gchar *id, *name;
LIBXML_TEST_VERSION;
- id = gl_xml_get_prop_string (category_node, "id", NULL);
- name = gl_xml_get_prop_i18n_string (category_node, "name", NULL);
+ id = lgl_xml_get_prop_string (category_node, "id", NULL);
+ name = lgl_xml_get_prop_i18n_string (category_node, "name", NULL);
- category = gl_category_new (id, name);
+ category = lgl_category_new (id, name);
g_free (id);
g_free (name);
G_BEGIN_DECLS
-GList *gl_xml_category_read_categories_from_file (gchar *utf8_filename);
+GList *lgl_xml_category_read_categories_from_file (gchar *utf8_filename);
-GList *gl_xml_category_parse_categories_doc (xmlDocPtr categories_doc);
+GList *lgl_xml_category_parse_categories_doc (xmlDocPtr categories_doc);
-glCategory *gl_xml_category_parse_category_node (xmlNodePtr category_node);
+lglCategory *lgl_xml_category_parse_category_node (xmlNodePtr category_node);
G_END_DECLS
/**
- * gl_xml_paper_read_papers_from_file:
+ * lgl_xml_paper_read_papers_from_file:
* @utf8_filename: Filename of papers file (name encoded as UTF-8)
*
* Read paper definitions from a file.
*
- * Returns: a list of #glPaper structures.
+ * Returns: a list of #lglPaper structures.
*
*/
GList *
-gl_xml_paper_read_papers_from_file (gchar *utf8_filename)
+lgl_xml_paper_read_papers_from_file (gchar *utf8_filename)
{
gchar *filename;
GList *papers;
return NULL;
}
- papers = gl_xml_paper_parse_papers_doc (papers_doc);
+ papers = lgl_xml_paper_parse_papers_doc (papers_doc);
g_free (filename);
xmlFreeDoc (papers_doc);
/**
- * gl_xml_paper_parse_papers_doc:
+ * lgl_xml_paper_parse_papers_doc:
* @papers_doc: libxml #xmlDocPtr tree, representing a papers definition file.
*
* Read paper definitions from a libxml #xmlDocPtr tree.
*
- * Returns: a list of #glPaper structures.
+ * Returns: a list of #lglPaper structures.
*
*/
GList *
-gl_xml_paper_parse_papers_doc (xmlDocPtr papers_doc)
+lgl_xml_paper_parse_papers_doc (xmlDocPtr papers_doc)
{
GList *papers = NULL;
xmlNodePtr root, node;
- glPaper *paper;
+ lglPaper *paper;
LIBXML_TEST_VERSION;
xmlFreeDoc (papers_doc);
return papers;
}
- if (!gl_xml_is_node (root, "Glabels-paper-sizes")) {
+ if (!lgl_xml_is_node (root, "Glabels-paper-sizes")) {
g_message ("\"%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 (gl_xml_is_node (node, "Paper-size")) {
- paper = gl_xml_paper_parse_paper_node (node);
+ if (lgl_xml_is_node (node, "Paper-size")) {
+ paper = lgl_xml_paper_parse_paper_node (node);
papers = g_list_append (papers, paper);
} else {
if ( !xmlNodeIsText(node) ) {
- if (!gl_xml_is_node (node, "comment")) {
+ if (!lgl_xml_is_node (node, "comment")) {
g_message ("bad node = \"%s\"",node->name);
}
}
/**
- * gl_xml_paper_parse_paper_node:
+ * lgl_xml_paper_parse_paper_node:
* @paper_node: libxml #xmlNodePtr paper node from a #xmlDocPtr tree.
*
* Read a single paper definition from a libxml #xmlNodePtr node.
*
- * Returns: a pointer to a newly created #glPaper structure.
+ * Returns: a pointer to a newly created #lglPaper structure.
*
*/
-glPaper *
-gl_xml_paper_parse_paper_node (xmlNodePtr paper_node)
+lglPaper *
+lgl_xml_paper_parse_paper_node (xmlNodePtr paper_node)
{
- glPaper *paper;
+ lglPaper *paper;
gchar *id, *name;
gdouble width, height;
LIBXML_TEST_VERSION;
- id = gl_xml_get_prop_string (paper_node, "id", NULL);
+ id = lgl_xml_get_prop_string (paper_node, "id", NULL);
- name = gl_xml_get_prop_i18n_string (paper_node, "name", NULL);
+ name = lgl_xml_get_prop_i18n_string (paper_node, "name", NULL);
- width = gl_xml_get_prop_length (paper_node, "width", 0);
- height = gl_xml_get_prop_length (paper_node, "height", 0);
+ width = lgl_xml_get_prop_length (paper_node, "width", 0);
+ height = lgl_xml_get_prop_length (paper_node, "height", 0);
- paper = gl_paper_new (id, name, width, height);
+ paper = lgl_paper_new (id, name, width, height);
g_free (id);
g_free (name);
G_BEGIN_DECLS
-GList *gl_xml_paper_read_papers_from_file (gchar *utf8_filename);
+GList *lgl_xml_paper_read_papers_from_file (gchar *utf8_filename);
-GList *gl_xml_paper_parse_papers_doc (xmlDocPtr papers_doc);
+GList *lgl_xml_paper_parse_papers_doc (xmlDocPtr papers_doc);
-glPaper *gl_xml_paper_parse_paper_node (xmlNodePtr paper_node);
+lglPaper *lgl_xml_paper_parse_paper_node (xmlNodePtr paper_node);
G_END_DECLS
/* Local function prototypes */
/*===========================================*/
static void xml_parse_meta_node (xmlNodePtr label_node,
- glTemplate *template);
+ lglTemplate *template);
static void xml_parse_label_rectangle_node (xmlNodePtr label_node,
- glTemplate *template);
+ lglTemplate *template);
static void xml_parse_label_round_node (xmlNodePtr label_node,
- glTemplate *template);
+ lglTemplate *template);
static void xml_parse_label_cd_node (xmlNodePtr label_node,
- glTemplate *template);
+ lglTemplate *template);
static void xml_parse_layout_node (xmlNodePtr layout_node,
- glTemplateLabelType *label_type);
+ lglTemplateFrame *frame);
static void xml_parse_markup_margin_node (xmlNodePtr markup_node,
- glTemplateLabelType *label_type);
+ lglTemplateFrame *frame);
static void xml_parse_markup_line_node (xmlNodePtr markup_node,
- glTemplateLabelType *label_type);
+ lglTemplateFrame *frame);
static void xml_parse_markup_circle_node (xmlNodePtr markup_node,
- glTemplateLabelType *label_type);
+ lglTemplateFrame *frame);
static void xml_parse_markup_rect_node (xmlNodePtr markup_node,
- glTemplateLabelType *label_type);
+ lglTemplateFrame *frame);
static void xml_parse_alias_node (xmlNodePtr alias_node,
- glTemplate *template);
+ lglTemplate *template);
static void xml_create_meta_node (const gchar *category,
xmlNodePtr root,
const xmlNsPtr ns);
-static void xml_create_label_node (const glTemplateLabelType *label_type,
+static void xml_create_label_node (const lglTemplateFrame *frame,
xmlNodePtr root,
const xmlNsPtr ns);
-static void xml_create_layout_node (const glTemplateLayout *layout,
+static void xml_create_layout_node (const lglTemplateLayout *layout,
xmlNodePtr root,
const xmlNsPtr ns);
-static void xml_create_markup_margin_node (const glTemplateMarkup *margin,
+static void xml_create_markup_margin_node (const lglTemplateMarkup *margin,
xmlNodePtr root,
const xmlNsPtr ns);
-static void xml_create_markup_line_node (const glTemplateMarkup *line,
+static void xml_create_markup_line_node (const lglTemplateMarkup *line,
xmlNodePtr root,
const xmlNsPtr ns);
-static void xml_create_markup_circle_node (const glTemplateMarkup *circle,
+static void xml_create_markup_circle_node (const lglTemplateMarkup *circle,
xmlNodePtr root,
const xmlNsPtr ns);
-static void xml_create_markup_rect_node (const glTemplateMarkup *circle,
+static void xml_create_markup_rect_node (const lglTemplateMarkup *circle,
xmlNodePtr root,
const xmlNsPtr ns);
static void xml_create_alias_node (const gchar *name,
/**
- * gl_xml_template_read_templates_from_file:
+ * lgl_xml_template_read_templates_from_file:
* @utf8_filename: Filename of papers file (name encoded as UTF-8)
*
* Read glabels templates from template file.
*
- * Returns: a list of #glTemplate structures.
+ * Returns: a list of #lglTemplate structures.
*
*/
GList *
-gl_xml_template_read_templates_from_file (const gchar *utf8_filename)
+lgl_xml_template_read_templates_from_file (const gchar *utf8_filename)
{
gchar *filename;
xmlDocPtr templates_doc;
return templates;
}
- templates = gl_xml_template_parse_templates_doc (templates_doc);
+ templates = lgl_xml_template_parse_templates_doc (templates_doc);
g_free (filename);
xmlFreeDoc (templates_doc);
/**
- * gl_xml_template_parse_templates_doc:
+ * lgl_xml_template_parse_templates_doc:
* @templates_doc: libxml #xmlDocPtr tree, representing template file.
*
* Read glabels templates from a libxml #xmlDocPtr tree.
*
- * Returns: a list of #glTemplate structures.
+ * Returns: a list of #lglTemplate structures.
*
*/
GList *
-gl_xml_template_parse_templates_doc (const xmlDocPtr templates_doc)
+lgl_xml_template_parse_templates_doc (const xmlDocPtr templates_doc)
{
- GList *templates = NULL;
- xmlNodePtr root, node;
- glTemplate *template;
+ GList *templates = NULL;
+ xmlNodePtr root, node;
+ lglTemplate *template;
LIBXML_TEST_VERSION;
templates_doc->URL);
return templates;
}
- if (!gl_xml_is_node (root, "Glabels-templates")) {
+ if (!lgl_xml_is_node (root, "Glabels-templates")) {
g_message ("\"%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 (gl_xml_is_node (node, "Template")) {
- template = gl_xml_template_parse_template_node (node);
+ if (lgl_xml_is_node (node, "Template")) {
+ template = lgl_xml_template_parse_template_node (node);
templates = g_list_append (templates, template);
} else {
if ( !xmlNodeIsText(node) ) {
- if (!gl_xml_is_node (node,"comment")) {
+ if (!lgl_xml_is_node (node,"comment")) {
g_message ("bad node = \"%s\"",node->name);
}
}
/**
- * gl_xml_template_parse_template_node:
+ * lgl_xml_template_parse_template_node:
* @template_node: libxml #xmlNodePtr template node from a #xmlDocPtr tree.
*
* Read a single glabels template from a libxml #xmlNodePtr node.
*
- * Returns: a pointer to a newly created #glTemplate structure.
+ * Returns: a pointer to a newly created #lglTemplate structure.
*
*/
-glTemplate *
-gl_xml_template_parse_template_node (const xmlNodePtr template_node)
+lglTemplate *
+lgl_xml_template_parse_template_node (const xmlNodePtr template_node)
{
gchar *name;
gchar *description;
gchar *page_size;
gdouble page_width, page_height;
- glPaper *paper = NULL;
- glTemplate *template;
+ lglPaper *paper = NULL;
+ lglTemplate *template;
xmlNodePtr node;
- name = gl_xml_get_prop_string (template_node, "name", NULL);
- description = gl_xml_get_prop_i18n_string (template_node, "description", NULL);
- page_size = gl_xml_get_prop_string (template_node, "size", NULL);
+ name = lgl_xml_get_prop_string (template_node, "name", NULL);
+ description = lgl_xml_get_prop_i18n_string (template_node, "description", NULL);
+ page_size = lgl_xml_get_prop_string (template_node, "size", NULL);
- if (gl_paper_is_id_other (page_size)) {
+ if (lgl_paper_is_id_other (page_size)) {
- page_width = gl_xml_get_prop_length (template_node, "width", 0);
- page_height = gl_xml_get_prop_length (template_node, "height", 0);
+ page_width = lgl_xml_get_prop_length (template_node, "width", 0);
+ page_height = lgl_xml_get_prop_length (template_node, "height", 0);
} else {
- paper = gl_paper_from_id (page_size);
+ paper = lgl_paper_from_id (page_size);
if (paper == NULL) {
/* This should always be an id, but just in case a name
slips by! */
g_message (_("Unknown page size id \"%s\", trying as name"),
page_size);
- paper = gl_paper_from_name (page_size);
+ paper = lgl_paper_from_name (page_size);
g_free (page_size);
page_size = g_strdup (paper->id);
}
g_message (_("Unknown page size id or name \"%s\""),
page_size);
}
- gl_paper_free (paper);
+ lgl_paper_free (paper);
paper = NULL;
}
- template = gl_template_new (name,
+ template = lgl_template_new (name,
description,
page_size,
page_width, page_height);
for (node = template_node->xmlChildrenNode; node != NULL;
node = node->next) {
- if (gl_xml_is_node (node, "Meta")) {
+ if (lgl_xml_is_node (node, "Meta")) {
xml_parse_meta_node (node, template);
- } else if (gl_xml_is_node (node, "Label-rectangle")) {
+ } else if (lgl_xml_is_node (node, "Label-rectangle")) {
xml_parse_label_rectangle_node (node, template);
- } else if (gl_xml_is_node (node, "Label-round")) {
+ } else if (lgl_xml_is_node (node, "Label-round")) {
xml_parse_label_round_node (node, template);
- } else if (gl_xml_is_node (node, "Label-cd")) {
+ } else if (lgl_xml_is_node (node, "Label-cd")) {
xml_parse_label_cd_node (node, template);
- } else if (gl_xml_is_node (node, "Alias")) {
+ } else if (lgl_xml_is_node (node, "Alias")) {
xml_parse_alias_node (node, template);
} else {
if (!xmlNodeIsText (node)) {
- if (!gl_xml_is_node (node,"comment")) {
+ if (!lgl_xml_is_node (node,"comment")) {
g_message ("bad node = \"%s\"",node->name);
}
}
/* PRIVATE. Parse XML Template->Meta Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_parse_meta_node (xmlNodePtr meta_node,
- glTemplate *template)
+xml_parse_meta_node (xmlNodePtr meta_node,
+ lglTemplate *template)
{
gchar *category;
- category = gl_xml_get_prop_string (meta_node, "category", NULL);
+ category = lgl_xml_get_prop_string (meta_node, "category", NULL);
if (category != NULL)
{
- gl_template_add_category (template, category);
+ lgl_template_add_category (template, category);
g_free (category);
}
}
/* PRIVATE. Parse XML Template->Label-rectangle Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_parse_label_rectangle_node (xmlNodePtr label_node,
- glTemplate *template)
+xml_parse_label_rectangle_node (xmlNodePtr label_node,
+ lglTemplate *template)
{
gchar *id;
gchar *tmp;
gdouble x_waste, y_waste;
gdouble w, h, r;
- glTemplateLabelType *label_type;
+ lglTemplateFrame *frame;
xmlNodePtr node;
- id = gl_xml_get_prop_string (label_node, "id", NULL);
+ id = lgl_xml_get_prop_string (label_node, "id", NULL);
- if (tmp = gl_xml_get_prop_string (label_node, "waste", NULL)) {
+ if ((tmp = lgl_xml_get_prop_string (label_node, "waste", NULL))) {
/* Handle single "waste" property. */
- x_waste = y_waste = gl_xml_get_prop_length (label_node, "waste", 0);
+ x_waste = y_waste = lgl_xml_get_prop_length (label_node, "waste", 0);
g_free (tmp);
} else {
- x_waste = gl_xml_get_prop_length (label_node, "x_waste", 0);
- y_waste = gl_xml_get_prop_length (label_node, "y_waste", 0);
+ x_waste = lgl_xml_get_prop_length (label_node, "x_waste", 0);
+ y_waste = lgl_xml_get_prop_length (label_node, "y_waste", 0);
}
- w = gl_xml_get_prop_length (label_node, "width", 0);
- h = gl_xml_get_prop_length (label_node, "height", 0);
- r = gl_xml_get_prop_length (label_node, "round", 0);
+ w = lgl_xml_get_prop_length (label_node, "width", 0);
+ h = lgl_xml_get_prop_length (label_node, "height", 0);
+ r = lgl_xml_get_prop_length (label_node, "round", 0);
- 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);
+ frame = lgl_template_frame_rect_new ((gchar *)id, w, h, r, x_waste, y_waste);
+ lgl_template_add_frame (template, frame);
for (node = label_node->xmlChildrenNode; node != NULL;
node = node->next) {
- if (gl_xml_is_node (node, "Layout")) {
- xml_parse_layout_node (node, label_type);
- } else if (gl_xml_is_node (node, "Markup-margin")) {
- xml_parse_markup_margin_node (node, label_type);
- } else if (gl_xml_is_node (node, "Markup-line")) {
- xml_parse_markup_line_node (node, label_type);
- } else if (gl_xml_is_node (node, "Markup-circle")) {
- xml_parse_markup_circle_node (node, label_type);
- } else if (gl_xml_is_node (node, "Markup-rect")) {
- xml_parse_markup_rect_node (node, label_type);
+ if (lgl_xml_is_node (node, "Layout")) {
+ xml_parse_layout_node (node, frame);
+ } else if (lgl_xml_is_node (node, "Markup-margin")) {
+ xml_parse_markup_margin_node (node, frame);
+ } else if (lgl_xml_is_node (node, "Markup-line")) {
+ xml_parse_markup_line_node (node, frame);
+ } else if (lgl_xml_is_node (node, "Markup-circle")) {
+ xml_parse_markup_circle_node (node, frame);
+ } else if (lgl_xml_is_node (node, "Markup-rect")) {
+ xml_parse_markup_rect_node (node, frame);
} else if (!xmlNodeIsText (node)) {
- if (!gl_xml_is_node (node, "comment")) {
+ if (!lgl_xml_is_node (node, "comment")) {
g_message ("bad node = \"%s\"",node->name);
}
}
/* PRIVATE. Parse XML Template->Label-round Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_parse_label_round_node (xmlNodePtr label_node,
- glTemplate *template)
+xml_parse_label_round_node (xmlNodePtr label_node,
+ lglTemplate *template)
{
gchar *id;
gdouble waste;
gdouble r;
- glTemplateLabelType *label_type;
+ lglTemplateFrame *frame;
xmlNodePtr node;
- id = gl_xml_get_prop_string (label_node, "id", NULL);
- waste = gl_xml_get_prop_length (label_node, "waste", 0);
- r = gl_xml_get_prop_length (label_node, "radius", 0);
+ id = lgl_xml_get_prop_string (label_node, "id", NULL);
+ waste = lgl_xml_get_prop_length (label_node, "waste", 0);
+ r = lgl_xml_get_prop_length (label_node, "radius", 0);
- label_type = gl_template_round_label_type_new ((gchar *)id, r, waste);
- gl_template_add_label_type (template, label_type);
+ frame = lgl_template_frame_round_new ((gchar *)id, r, waste);
+ lgl_template_add_frame (template, frame);
for (node = label_node->xmlChildrenNode; node != NULL;
node = node->next) {
- if (gl_xml_is_node (node, "Layout")) {
- xml_parse_layout_node (node, label_type);
- } else if (gl_xml_is_node (node, "Markup-margin")) {
- xml_parse_markup_margin_node (node, label_type);
- } else if (gl_xml_is_node (node, "Markup-line")) {
- xml_parse_markup_line_node (node, label_type);
- } else if (gl_xml_is_node (node, "Markup-circle")) {
- xml_parse_markup_circle_node (node, label_type);
- } else if (gl_xml_is_node (node, "Markup-rect")) {
- xml_parse_markup_rect_node (node, label_type);
+ if (lgl_xml_is_node (node, "Layout")) {
+ xml_parse_layout_node (node, frame);
+ } else if (lgl_xml_is_node (node, "Markup-margin")) {
+ xml_parse_markup_margin_node (node, frame);
+ } else if (lgl_xml_is_node (node, "Markup-line")) {
+ xml_parse_markup_line_node (node, frame);
+ } else if (lgl_xml_is_node (node, "Markup-circle")) {
+ xml_parse_markup_circle_node (node, frame);
+ } else if (lgl_xml_is_node (node, "Markup-rect")) {
+ xml_parse_markup_rect_node (node, frame);
} else if (!xmlNodeIsText (node)) {
- if (!gl_xml_is_node (node, "comment")) {
+ if (!lgl_xml_is_node (node, "comment")) {
g_message ("bad node = \"%s\"",node->name);
}
}
/* PRIVATE. Parse XML Template->Label-cd Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_parse_label_cd_node (xmlNodePtr label_node,
- glTemplate *template)
+xml_parse_label_cd_node (xmlNodePtr label_node,
+ lglTemplate *template)
{
gchar *id;
gdouble waste;
gdouble r1, r2, w, h;
- glTemplateLabelType *label_type;
+ lglTemplateFrame *frame;
xmlNodePtr node;
- id = gl_xml_get_prop_string (label_node, "id", NULL);
- 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);
+ id = lgl_xml_get_prop_string (label_node, "id", NULL);
+ waste = lgl_xml_get_prop_length (label_node, "waste", 0);
+ r1 = lgl_xml_get_prop_length (label_node, "radius", 0);
+ r2 = lgl_xml_get_prop_length (label_node, "hole", 0);
+ w = lgl_xml_get_prop_length (label_node, "width", 0);
+ h = lgl_xml_get_prop_length (label_node, "height", 0);
- label_type = gl_template_cd_label_type_new ((gchar *)id, r1, r2, w, h, waste);
- gl_template_add_label_type (template, label_type);
+ frame = lgl_template_frame_cd_new ((gchar *)id, r1, r2, w, h, waste);
+ lgl_template_add_frame (template, frame);
for (node = label_node->xmlChildrenNode; node != NULL;
node = node->next) {
- if (gl_xml_is_node (node, "Layout")) {
- xml_parse_layout_node (node, label_type);
- } else if (gl_xml_is_node (node, "Markup-margin")) {
- xml_parse_markup_margin_node (node, label_type);
- } else if (gl_xml_is_node (node, "Markup-line")) {
- xml_parse_markup_line_node (node, label_type);
- } else if (gl_xml_is_node (node, "Markup-circle")) {
- xml_parse_markup_circle_node (node, label_type);
- } else if (gl_xml_is_node (node, "Markup-rect")) {
- xml_parse_markup_rect_node (node, label_type);
+ if (lgl_xml_is_node (node, "Layout")) {
+ xml_parse_layout_node (node, frame);
+ } else if (lgl_xml_is_node (node, "Markup-margin")) {
+ xml_parse_markup_margin_node (node, frame);
+ } else if (lgl_xml_is_node (node, "Markup-line")) {
+ xml_parse_markup_line_node (node, frame);
+ } else if (lgl_xml_is_node (node, "Markup-circle")) {
+ xml_parse_markup_circle_node (node, frame);
+ } else if (lgl_xml_is_node (node, "Markup-rect")) {
+ xml_parse_markup_rect_node (node, frame);
} else if (!xmlNodeIsText (node)) {
- if (!gl_xml_is_node (node, "comment")) {
+ if (!lgl_xml_is_node (node, "comment")) {
g_message ("bad node = \"%s\"",node->name);
}
}
/* PRIVATE. Parse XML Template->Label->Layout Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_parse_layout_node (xmlNodePtr layout_node,
- glTemplateLabelType *label_type)
+xml_parse_layout_node (xmlNodePtr layout_node,
+ lglTemplateFrame *frame)
{
gint nx, ny;
gdouble x0, y0, dx, dy;
xmlNodePtr node;
- nx = gl_xml_get_prop_int (layout_node, "nx", 1);
- ny = gl_xml_get_prop_int (layout_node, "ny", 1);
+ nx = lgl_xml_get_prop_int (layout_node, "nx", 1);
+ ny = lgl_xml_get_prop_int (layout_node, "ny", 1);
- x0 = gl_xml_get_prop_length (layout_node, "x0", 0);
- y0 = gl_xml_get_prop_length (layout_node, "y0", 0);
+ x0 = lgl_xml_get_prop_length (layout_node, "x0", 0);
+ y0 = lgl_xml_get_prop_length (layout_node, "y0", 0);
- dx = gl_xml_get_prop_length (layout_node, "dx", 0);
- dy = gl_xml_get_prop_length (layout_node, "dy", 0);
+ dx = lgl_xml_get_prop_length (layout_node, "dx", 0);
+ dy = lgl_xml_get_prop_length (layout_node, "dy", 0);
- gl_template_add_layout (label_type,
- gl_template_layout_new (nx, ny, x0, y0, dx, dy));
+ lgl_template_add_layout (frame, lgl_template_layout_new (nx, ny, x0, y0, dx, dy));
for (node = layout_node->xmlChildrenNode; node != NULL;
node = node->next) {
if (!xmlNodeIsText (node)) {
- if (!gl_xml_is_node (node, "comment")) {
+ if (!lgl_xml_is_node (node, "comment")) {
g_message ("bad node = \"%s\"",node->name);
}
}
/* PRIVATE. Parse XML Template->Label->Markup-margin Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_parse_markup_margin_node (xmlNodePtr markup_node,
- glTemplateLabelType *label_type)
+xml_parse_markup_margin_node (xmlNodePtr markup_node,
+ lglTemplateFrame *frame)
{
gdouble size;
xmlNodePtr node;
- size = gl_xml_get_prop_length (markup_node, "size", 0);
+ size = lgl_xml_get_prop_length (markup_node, "size", 0);
- gl_template_add_markup (label_type,
- gl_template_markup_margin_new (size));
+ lgl_template_add_markup (frame, lgl_template_markup_margin_new (size));
for (node = markup_node->xmlChildrenNode; node != NULL;
node = node->next) {
if (!xmlNodeIsText (node)) {
- if (!gl_xml_is_node (node, "comment")) {
+ if (!lgl_xml_is_node (node, "comment")) {
g_message ("bad node = \"%s\"",node->name);
}
}
/* PRIVATE. Parse XML Template->Label->Markup-line Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_parse_markup_line_node (xmlNodePtr markup_node,
- glTemplateLabelType *label_type)
+xml_parse_markup_line_node (xmlNodePtr markup_node,
+ lglTemplateFrame *frame)
{
gdouble x1, y1, x2, y2;
xmlNodePtr node;
- x1 = gl_xml_get_prop_length (markup_node, "x1", 0);
- y1 = gl_xml_get_prop_length (markup_node, "y1", 0);
- x2 = gl_xml_get_prop_length (markup_node, "x2", 0);
- y2 = gl_xml_get_prop_length (markup_node, "y2", 0);
+ x1 = lgl_xml_get_prop_length (markup_node, "x1", 0);
+ y1 = lgl_xml_get_prop_length (markup_node, "y1", 0);
+ x2 = lgl_xml_get_prop_length (markup_node, "x2", 0);
+ y2 = lgl_xml_get_prop_length (markup_node, "y2", 0);
- gl_template_add_markup (label_type,
- gl_template_markup_line_new (x1, y1, x2, y2));
+ lgl_template_add_markup (frame, lgl_template_markup_line_new (x1, y1, x2, y2));
for (node = markup_node->xmlChildrenNode; node != NULL;
node = node->next) {
if (!xmlNodeIsText (node)) {
- if (!gl_xml_is_node (node, "comment")) {
+ if (!lgl_xml_is_node (node, "comment")) {
g_message ("bad node = \"%s\"",node->name);
}
}
/* PRIVATE. Parse XML Template->Label->Markup-circle Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_parse_markup_circle_node (xmlNodePtr markup_node,
- glTemplateLabelType *label_type)
+xml_parse_markup_circle_node (xmlNodePtr markup_node,
+ lglTemplateFrame *frame)
{
gdouble x0, y0, r;
xmlNodePtr node;
- x0 = gl_xml_get_prop_length (markup_node, "x0", 0);
- y0 = gl_xml_get_prop_length (markup_node, "y0", 0);
- r = gl_xml_get_prop_length (markup_node, "radius", 0);
+ x0 = lgl_xml_get_prop_length (markup_node, "x0", 0);
+ y0 = lgl_xml_get_prop_length (markup_node, "y0", 0);
+ r = lgl_xml_get_prop_length (markup_node, "radius", 0);
- gl_template_add_markup (label_type,
- gl_template_markup_circle_new (x0, y0, r));
+ lgl_template_add_markup (frame, lgl_template_markup_circle_new (x0, y0, r));
for (node = markup_node->xmlChildrenNode; node != NULL;
node = node->next) {
if (!xmlNodeIsText (node)) {
- if (!gl_xml_is_node (node, "comment")) {
+ if (!lgl_xml_is_node (node, "comment")) {
g_message ("bad node = \"%s\"",node->name);
}
}
/* PRIVATE. Parse XML Template->Label->Markup-rect Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_parse_markup_rect_node (xmlNodePtr markup_node,
- glTemplateLabelType *label_type)
+xml_parse_markup_rect_node (xmlNodePtr markup_node,
+ lglTemplateFrame *frame)
{
gdouble x1, y1, w, h, r;
xmlNodePtr node;
- x1 = gl_xml_get_prop_length (markup_node, "x1", 0);
- y1 = gl_xml_get_prop_length (markup_node, "y1", 0);
- w = gl_xml_get_prop_length (markup_node, "w", 0);
- h = gl_xml_get_prop_length (markup_node, "h", 0);
- r = gl_xml_get_prop_length (markup_node, "r", 0);
+ x1 = lgl_xml_get_prop_length (markup_node, "x1", 0);
+ y1 = lgl_xml_get_prop_length (markup_node, "y1", 0);
+ w = lgl_xml_get_prop_length (markup_node, "w", 0);
+ h = lgl_xml_get_prop_length (markup_node, "h", 0);
+ r = lgl_xml_get_prop_length (markup_node, "r", 0);
- gl_template_add_markup (label_type,
- gl_template_markup_rect_new (x1, y1, w, h, r));
+ lgl_template_add_markup (frame, lgl_template_markup_rect_new (x1, y1, w, h, r));
for (node = markup_node->xmlChildrenNode; node != NULL;
node = node->next) {
if (!xmlNodeIsText (node)) {
- if (!gl_xml_is_node (node, "comment")) {
+ if (!lgl_xml_is_node (node, "comment")) {
g_message ("bad node = \"%s\"",node->name);
}
}
/* PRIVATE. Parse XML Template->Alias Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_parse_alias_node (xmlNodePtr alias_node,
- glTemplate *template)
+xml_parse_alias_node (xmlNodePtr alias_node,
+ lglTemplate *template)
{
gchar *name;
- name = gl_xml_get_prop_string (alias_node, "name", NULL);
+ name = lgl_xml_get_prop_string (alias_node, "name", NULL);
- gl_template_add_alias (template, (gchar *)name);
+ lgl_template_add_alias (template, (gchar *)name);
g_free (name);
}
/**
- * gl_xml_template_write_templates_to_file:
- * @templates: List of #glTemplate structures
+ * lgl_xml_template_write_templates_to_file:
+ * @templates: List of #lglTemplate structures
* @utf8_filename: Filename of templates file (name encoded as UTF-8)
*
- * Write a list of #glTemplate structures to a glabels XML template file.
+ * Write a list of #lglTemplate structures to a glabels XML template file.
*
*/
void
-gl_xml_template_write_templates_to_file (GList *templates,
- const gchar *utf8_filename)
+lgl_xml_template_write_templates_to_file (GList *templates,
+ const gchar *utf8_filename)
{
xmlDocPtr doc;
xmlNsPtr ns;
gint xml_ret;
GList *p;
- glTemplate *template;
+ lglTemplate *template;
gchar *filename;
doc = xmlNewDoc ((xmlChar *)"1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (xmlChar *)"Glabels-templates", NULL);
- ns = xmlNewNs (doc->xmlRootNode, (xmlChar *)GL_XML_NAME_SPACE, NULL);
+ ns = xmlNewNs (doc->xmlRootNode, (xmlChar *)LGL_XML_NAME_SPACE, NULL);
xmlSetNs (doc->xmlRootNode, ns);
for (p=templates; p!=NULL; p=p->next) {
- template = (glTemplate *)p->data;
- gl_xml_template_create_template_node (template, doc->xmlRootNode, ns);
+ template = (lglTemplate *)p->data;
+ lgl_xml_template_create_template_node (template, doc->xmlRootNode, ns);
}
filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL);
/**
- * gl_xml_template_write_template_to_file:
- * @template: #glTemplate structure to be written
+ * lgl_xml_template_write_template_to_file:
+ * @template: #lglTemplate structure to be written
* @utf8_filename: Filename of templates file (name encoded as UTF-8)
*
- * Write a single #glTemplate structures to a glabels XML template file.
+ * Write a single #lglTemplate structures to a glabels XML template file.
*
*/
void
-gl_xml_template_write_template_to_file (const glTemplate *template,
- const gchar *utf8_filename)
+lgl_xml_template_write_template_to_file (const lglTemplate *template,
+ const gchar *utf8_filename)
{
GList *templates = NULL;
templates = g_list_append (templates, (gpointer)template);
- gl_xml_template_write_templates_to_file (templates, utf8_filename);
+ lgl_xml_template_write_templates_to_file (templates, utf8_filename);
g_list_free (templates);
}
/**
- * gl_xml_template_create_template_node:
- * @template: #glTemplate structure to be written
+ * lgl_xml_template_create_template_node:
+ * @template: #lglTemplate structure to be written
* @root: parent node to receive new child node
* @ns: a libxml #xmlNsPtr
*
- * Add a single #glTemplate child node to given #xmlNodePtr.
+ * Add a single #lglTemplate child node to given #xmlNodePtr.
*
*/
void
-gl_xml_template_create_template_node (const glTemplate *template,
- xmlNodePtr root,
- const xmlNsPtr ns)
+lgl_xml_template_create_template_node (const lglTemplate *template,
+ xmlNodePtr root,
+ const xmlNsPtr ns)
{
- xmlNodePtr node;
- GList *p;
- glTemplateLabelType *label_type;
+ xmlNodePtr node;
+ GList *p;
+ lglTemplateFrame *frame;
node = xmlNewChild (root, ns, (xmlChar *)"Template", NULL);
- gl_xml_set_prop_string (node, "name", template->name);
+ lgl_xml_set_prop_string (node, "name", template->name);
- gl_xml_set_prop_string (node, "size", template->page_size);
+ lgl_xml_set_prop_string (node, "size", 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);
+ lgl_xml_set_prop_length (node, "width", template->page_width);
+ lgl_xml_set_prop_length (node, "height", template->page_height);
}
- gl_xml_set_prop_string (node, "description", template->description);
+ lgl_xml_set_prop_string (node, "description", template->description);
- for ( p=template->label_types; p != NULL; p=p->next ) {
- label_type = (glTemplateLabelType *)p->data;
- xml_create_label_node (label_type, node, ns);
+ for ( p=template->categories; p != NULL; p=p->next ) {
+ xml_create_meta_node ( p->data, node, ns );
+ }
+ for ( p=template->frames; p != NULL; p=p->next ) {
+ frame = (lglTemplateFrame *)p->data;
+ xml_create_label_node (frame, node, ns);
}
for ( p=template->aliases; p != NULL; p=p->next ) {
xmlNodePtr node;
node = xmlNewChild (root, ns, (xmlChar *)"Meta", NULL);
- gl_xml_set_prop_string (node, "category", category);
+ lgl_xml_set_prop_string (node, "category", category);
}
/* PRIVATE. Add XML Template->Label Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_create_label_node (const glTemplateLabelType *label_type,
- xmlNodePtr root,
- const xmlNsPtr ns)
+xml_create_label_node (const lglTemplateFrame *frame,
+ xmlNodePtr root,
+ const xmlNsPtr ns)
{
xmlNodePtr node;
GList *p;
- glTemplateMarkup *markup;
- glTemplateLayout *layout;
+ lglTemplateMarkup *markup;
+ lglTemplateLayout *layout;
- switch (label_type->shape) {
+ switch (frame->shape) {
- case GL_TEMPLATE_SHAPE_RECT:
+ case LGL_TEMPLATE_FRAME_SHAPE_RECT:
node = xmlNewChild(root, ns, (xmlChar *)"Label-rectangle", NULL);
- gl_xml_set_prop_string (node, "id", 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);
- gl_xml_set_prop_length (node, "x_waste", label_type->size.rect.x_waste);
- gl_xml_set_prop_length (node, "y_waste", label_type->size.rect.y_waste);
+ lgl_xml_set_prop_string (node, "id", frame->all.id);
+ lgl_xml_set_prop_length (node, "width", frame->rect.w);
+ lgl_xml_set_prop_length (node, "height", frame->rect.h);
+ lgl_xml_set_prop_length (node, "round", frame->rect.r);
+ lgl_xml_set_prop_length (node, "x_waste", frame->rect.x_waste);
+ lgl_xml_set_prop_length (node, "y_waste", frame->rect.y_waste);
break;
- case GL_TEMPLATE_SHAPE_ROUND:
+ case LGL_TEMPLATE_FRAME_SHAPE_ROUND:
node = xmlNewChild(root, ns, (xmlChar *)"Label-round", NULL);
- gl_xml_set_prop_string (node, "id", 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);
+ lgl_xml_set_prop_string (node, "id", frame->all.id);
+ lgl_xml_set_prop_length (node, "radius", frame->round.r);
+ lgl_xml_set_prop_length (node, "waste", frame->round.waste);
break;
- case GL_TEMPLATE_SHAPE_CD:
+ case LGL_TEMPLATE_FRAME_SHAPE_CD:
node = xmlNewChild(root, ns, (xmlChar *)"Label-cd", NULL);
- gl_xml_set_prop_string (node, "id", 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) {
- gl_xml_set_prop_length (node, "width", label_type->size.cd.w);
+ lgl_xml_set_prop_string (node, "id", frame->all.id);
+ lgl_xml_set_prop_length (node, "radius", frame->cd.r1);
+ lgl_xml_set_prop_length (node, "hole", frame->cd.r2);
+ if (frame->cd.w != 0.0) {
+ lgl_xml_set_prop_length (node, "width", frame->cd.w);
}
- if (label_type->size.cd.h != 0.0) {
- gl_xml_set_prop_length (node, "height", label_type->size.cd.h);
+ if (frame->cd.h != 0.0) {
+ lgl_xml_set_prop_length (node, "height", frame->cd.h);
}
- gl_xml_set_prop_length (node, "waste", label_type->size.cd.waste);
+ lgl_xml_set_prop_length (node, "waste", frame->cd.waste);
break;
default:
}
- for ( p=label_type->markups; p != NULL; p=p->next ) {
- markup = (glTemplateMarkup *)p->data;
+ for ( p=frame->all.markups; p != NULL; p=p->next ) {
+ markup = (lglTemplateMarkup *)p->data;
switch (markup->type) {
- case GL_TEMPLATE_MARKUP_MARGIN:
+ case LGL_TEMPLATE_MARKUP_MARGIN:
xml_create_markup_margin_node (markup, node, ns);
break;
- case GL_TEMPLATE_MARKUP_LINE:
+ case LGL_TEMPLATE_MARKUP_LINE:
xml_create_markup_line_node (markup, node, ns);
break;
- case GL_TEMPLATE_MARKUP_CIRCLE:
+ case LGL_TEMPLATE_MARKUP_CIRCLE:
xml_create_markup_circle_node (markup, node, ns);
break;
- case GL_TEMPLATE_MARKUP_RECT:
+ case LGL_TEMPLATE_MARKUP_RECT:
xml_create_markup_rect_node (markup, node, ns);
break;
default:
}
}
- for ( p=label_type->layouts; p != NULL; p=p->next ) {
- layout = (glTemplateLayout *)p->data;
+ for ( p=frame->all.layouts; p != NULL; p=p->next ) {
+ layout = (lglTemplateLayout *)p->data;
xml_create_layout_node (layout, node, ns);
}
/* PRIVATE. Add XML Template->Label->Layout Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_create_layout_node (const glTemplateLayout *layout,
- xmlNodePtr root,
- const xmlNsPtr ns)
+xml_create_layout_node (const lglTemplateLayout *layout,
+ xmlNodePtr root,
+ const xmlNsPtr ns)
{
xmlNodePtr node;
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);
- gl_xml_set_prop_length (node, "y0", layout->y0);
- gl_xml_set_prop_length (node, "dx", layout->dx);
- gl_xml_set_prop_length (node, "dy", layout->dy);
+ lgl_xml_set_prop_int (node, "nx", layout->nx);
+ lgl_xml_set_prop_int (node, "ny", layout->ny);
+ lgl_xml_set_prop_length (node, "x0", layout->x0);
+ lgl_xml_set_prop_length (node, "y0", layout->y0);
+ lgl_xml_set_prop_length (node, "dx", layout->dx);
+ lgl_xml_set_prop_length (node, "dy", layout->dy);
}
/* PRIVATE. Add XML Template->Label->Markup-margin Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_create_markup_margin_node (const glTemplateMarkup *markup,
- xmlNodePtr root,
- const xmlNsPtr ns)
+xml_create_markup_margin_node (const lglTemplateMarkup *markup,
+ xmlNodePtr root,
+ const xmlNsPtr ns)
{
xmlNodePtr node;
node = xmlNewChild(root, ns, (xmlChar *)"Markup-margin", NULL);
- gl_xml_set_prop_length (node, "size", markup->data.margin.size);
+ lgl_xml_set_prop_length (node, "size", markup->margin.size);
}
/* PRIVATE. Add XML Template->Label->Markup-line Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_create_markup_line_node (const glTemplateMarkup *markup,
- xmlNodePtr root,
- const xmlNsPtr ns)
+xml_create_markup_line_node (const lglTemplateMarkup *markup,
+ xmlNodePtr root,
+ const xmlNsPtr ns)
{
xmlNodePtr node;
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);
- gl_xml_set_prop_length (node, "x2", markup->data.line.x2);
- gl_xml_set_prop_length (node, "y2", markup->data.line.y2);
+ lgl_xml_set_prop_length (node, "x1", markup->line.x1);
+ lgl_xml_set_prop_length (node, "y1", markup->line.y1);
+ lgl_xml_set_prop_length (node, "x2", markup->line.x2);
+ lgl_xml_set_prop_length (node, "y2", markup->line.y2);
}
/* PRIVATE. Add XML Template->Label->Markup-circle Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_create_markup_circle_node (const glTemplateMarkup *markup,
- xmlNodePtr root,
- const xmlNsPtr ns)
+xml_create_markup_circle_node (const lglTemplateMarkup *markup,
+ xmlNodePtr root,
+ const xmlNsPtr ns)
{
xmlNodePtr node;
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);
- gl_xml_set_prop_length (node, "radius", markup->data.circle.r);
+ lgl_xml_set_prop_length (node, "x0", markup->circle.x0);
+ lgl_xml_set_prop_length (node, "y0", markup->circle.y0);
+ lgl_xml_set_prop_length (node, "radius", markup->circle.r);
}
/* PRIVATE. Add XML Template->Label->Markup-rect Node. */
/*--------------------------------------------------------------------------*/
static void
-xml_create_markup_rect_node (const glTemplateMarkup *markup,
- xmlNodePtr root,
- const xmlNsPtr ns)
+xml_create_markup_rect_node (const lglTemplateMarkup *markup,
+ xmlNodePtr root,
+ const xmlNsPtr ns)
{
xmlNodePtr node;
node = xmlNewChild(root, ns, (xmlChar *)"Markup-rect", NULL);
- gl_xml_set_prop_length (node, "x1", markup->data.rect.x1);
- gl_xml_set_prop_length (node, "y1", markup->data.rect.y1);
- gl_xml_set_prop_length (node, "w", markup->data.rect.w);
- gl_xml_set_prop_length (node, "h", markup->data.rect.h);
- gl_xml_set_prop_length (node, "r", markup->data.rect.r);
+ lgl_xml_set_prop_length (node, "x1", markup->rect.x1);
+ lgl_xml_set_prop_length (node, "y1", markup->rect.y1);
+ lgl_xml_set_prop_length (node, "w", markup->rect.w);
+ lgl_xml_set_prop_length (node, "h", markup->rect.h);
+ lgl_xml_set_prop_length (node, "r", markup->rect.r);
}
xmlNodePtr node;
node = xmlNewChild (root, ns, (xmlChar *)"Alias", NULL);
- gl_xml_set_prop_string (node, "name", name);
+ lgl_xml_set_prop_string (node, "name", name);
}
G_BEGIN_DECLS
-GList *gl_xml_template_read_templates_from_file (const gchar *utf8_filename);
+GList *lgl_xml_template_read_templates_from_file (const gchar *utf8_filename);
-GList *gl_xml_template_parse_templates_doc (const xmlDocPtr templates_doc);
+GList *lgl_xml_template_parse_templates_doc (const xmlDocPtr templates_doc);
-glTemplate *gl_xml_template_parse_template_node (const xmlNodePtr template_node);
+lglTemplate *lgl_xml_template_parse_template_node (const xmlNodePtr template_node);
-void gl_xml_template_write_templates_to_file (GList *templates,
- const gchar *utf8_filename);
+void lgl_xml_template_write_templates_to_file (GList *templates,
+ const gchar *utf8_filename);
-void gl_xml_template_write_template_to_file (const glTemplate *template,
- const gchar *utf8_filename);
+void lgl_xml_template_write_template_to_file (const lglTemplate *template,
+ const gchar *utf8_filename);
-xmlDocPtr gl_xml_template_create_templates_doc (GList *templates);
+xmlDocPtr lgl_xml_template_create_templates_doc (GList *templates);
-void gl_xml_template_create_template_node (const glTemplate *template,
- xmlNodePtr root,
- const xmlNsPtr ns);
+void lgl_xml_template_create_template_node (const lglTemplate *template,
+ xmlNodePtr root,
+ const xmlNsPtr ns);
G_END_DECLS
/* These names are identical to the absolute length units supported in
the CSS2 Specification (Section 4.3.2) */
- /* This table must be sorted exactly as the enumerations in glUnitsType */
+ /* This table must be sorted exactly as the enumerations in lglUnitsType */
- /* [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},
+ /* [LGL_UNITS_POINT] */ {(xmlChar *)"pt", POINTS_PER_POINT},
+ /* [LGL_UNITS_INCH] */ {(xmlChar *)"in", POINTS_PER_INCH},
+ /* [LGL_UNITS_MM] */ {(xmlChar *)"mm", POINTS_PER_MM},
+ /* [LGL_UNITS_CM] */ {(xmlChar *)"cm", POINTS_PER_CM},
+ /* [LGL_UNITS_PICA] */ {(xmlChar *)"pc", POINTS_PER_PICA},
};
-static glUnitsType default_units = GL_UNITS_POINT;
+static lglUnitsType default_units = LGL_UNITS_POINT;
/****************************************************************************/
/**
- * gl_xml_get_prop_string:
+ * lgl_xml_get_prop_string:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @default_val: a default value to return if property not found
*
*/
gchar *
-gl_xml_get_prop_string (xmlNodePtr node,
- const gchar *property,
- const gchar *default_val)
+lgl_xml_get_prop_string (xmlNodePtr node,
+ const gchar *property,
+ const gchar *default_val)
{
gchar *val;
xmlChar *string;
/**
- * gl_xml_get_prop_i18n_string:
+ * lgl_xml_get_prop_i18n_string:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @default_val: a default value to return if property not found
*
*/
gchar *
-gl_xml_get_prop_i18n_string (xmlNodePtr node,
- const gchar *property,
- const gchar *default_val)
+lgl_xml_get_prop_i18n_string (xmlNodePtr node,
+ const gchar *property,
+ const gchar *default_val)
{
gchar *_property;
gchar *val;
/**
- * gl_xml_get_prop_double:
+ * lgl_xml_get_prop_double:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @default_val: a default value to return if property not found
*
*/
gdouble
-gl_xml_get_prop_double (xmlNodePtr node,
- const gchar *property,
- gdouble default_val)
+lgl_xml_get_prop_double (xmlNodePtr node,
+ const gchar *property,
+ gdouble default_val)
{
gdouble val;
xmlChar *string;
/**
- * gl_xml_get_prop_boolean:
+ * lgl_xml_get_prop_boolean:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @default_val: a default value to return if property not found
*
*/
gboolean
-gl_xml_get_prop_boolean (xmlNodePtr node,
+lgl_xml_get_prop_boolean (xmlNodePtr node,
const gchar *property,
gboolean default_val)
{
/**
- * gl_xml_get_prop_int:
+ * lgl_xml_get_prop_int:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @default_val: a default value to return if property not found
*
*/
gint
-gl_xml_get_prop_int (xmlNodePtr node,
- const gchar *property,
- gint default_val)
+lgl_xml_get_prop_int (xmlNodePtr node,
+ const gchar *property,
+ gint default_val)
{
gint val;
xmlChar *string;
/**
- * gl_xml_get_prop_uint:
+ * lgl_xml_get_prop_uint:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @default_val: a default value to return if property not found
*
*/
guint
-gl_xml_get_prop_uint (xmlNodePtr node,
- const gchar *property,
- guint default_val)
+lgl_xml_get_prop_uint (xmlNodePtr node,
+ const gchar *property,
+ guint default_val)
{
guint val;
xmlChar *string;
/**
- * gl_xml_get_prop_length:
+ * lgl_xml_get_prop_length:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @default_val: a default value to return if property not found
*
*/
gdouble
-gl_xml_get_prop_length (xmlNodePtr node,
- const gchar *property,
- gdouble default_val)
+lgl_xml_get_prop_length (xmlNodePtr node,
+ const gchar *property,
+ gdouble default_val)
{
gdouble val;
xmlChar *string;
if (unit != string) {
unit = (xmlChar *)g_strchug ((gchar *)unit);
if (strlen ((char *)unit) > 0 ) {
- for (i=GL_UNITS_FIRST; i<=GL_UNITS_LAST; i++) {
+ for (i=LGL_UNITS_FIRST; i<=LGL_UNITS_LAST; i++) {
if (xmlStrcasecmp (unit, unit_table[i].name) == 0) {
val *= unit_table[i].points_per_unit;
break;
}
}
- if (i>GL_UNITS_LAST) {
- g_message ("Line %d, Node \"%s\", Property \"%s\": Unknown unit \"%s\", assuming points",
+ if (i>LGL_UNITS_LAST) {
+ g_message ("Line %ld, Node \"%s\", Property \"%s\": Unknown unit \"%s\", assuming points",
xmlGetLineNo (node), node->name, property,
unit);
}
/**
- * gl_xml_set_prop_string:
+ * lgl_xml_set_prop_string:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @val: the value to set
*
*/
void
-gl_xml_set_prop_string (xmlNodePtr node,
- const gchar *property,
- const gchar *val)
+lgl_xml_set_prop_string (xmlNodePtr node,
+ const gchar *property,
+ const gchar *val)
{
if (val != NULL) {
xmlSetProp (node, (xmlChar *)property, (xmlChar *)val);
/**
- * gl_xml_set_prop_double:
+ * lgl_xml_set_prop_double:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @val: the value to set
*
*/
void
-gl_xml_set_prop_double (xmlNodePtr node,
- const gchar *property,
- gdouble val)
+lgl_xml_set_prop_double (xmlNodePtr node,
+ const gchar *property,
+ gdouble val)
{
gchar *string, buffer[G_ASCII_DTOSTR_BUF_SIZE];
/**
- * gl_xml_set_prop_boolean:
+ * lgl_xml_set_prop_boolean:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @val: the value to set
*
*/
void
-gl_xml_set_prop_boolean (xmlNodePtr node,
- const gchar *property,
- gboolean val)
+lgl_xml_set_prop_boolean (xmlNodePtr node,
+ const gchar *property,
+ gboolean val)
{
xmlSetProp (node, (xmlChar *)property, (xmlChar *)(val ? "True" : "False"));
}
/**
- * gl_xml_set_prop_int:
+ * lgl_xml_set_prop_int:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @val: the value to set
*
*/
void
-gl_xml_set_prop_int (xmlNodePtr node,
- const gchar *property,
- gint val)
+lgl_xml_set_prop_int (xmlNodePtr node,
+ const gchar *property,
+ gint val)
{
gchar *string;
}
/**
- * gl_xml_set_prop_uint_hex:
+ * lgl_xml_set_prop_uint_hex:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @val: the value to set
*
*/
void
-gl_xml_set_prop_uint_hex (xmlNodePtr node,
- const gchar *property,
- guint val)
+lgl_xml_set_prop_uint_hex (xmlNodePtr node,
+ const gchar *property,
+ guint val)
{
gchar *string;
}
/**
- * gl_xml_set_prop_length:
+ * lgl_xml_set_prop_length:
* @node: the libxml2 #xmlNodePtr of the node
* @property: the property name
* @val: the length to set in internal units (points)
* Set a property from a length, performing any necessary conversion.
* Length properties are formatted as a number followed by a units string.
* The units of the formatted property is determined by the most recent call to
- * gl_xml_set_default_units().
+ * lgl_xml_set_default_units().
*
*/
void
-gl_xml_set_prop_length (xmlNodePtr node,
- const gchar *property,
- gdouble val)
+lgl_xml_set_prop_length (xmlNodePtr node,
+ const gchar *property,
+ gdouble val)
{
gchar *string, buffer[G_ASCII_DTOSTR_BUF_SIZE];
gchar *string_unit;
}
/**
- * gl_xml_is_node
+ * lgl_xml_is_node
* @node: the libxml2 #xmlNodePtr of the node
- * @property: the node name
+ * @name : the node name
*
* Test if a node name matches given name.
*
*
*/
gboolean
-gl_xml_is_node (xmlNodePtr node,
- const gchar *name)
+lgl_xml_is_node (xmlNodePtr node,
+ const gchar *name)
{
return xmlStrEqual (node->name, (xmlChar *)name);
}
/**
- * gl_xml_get_node_content
+ * lgl_xml_get_node_content
* @node: the libxml2 #xmlNodePtr of the node
*
* Get the content of a node.
* be freed with g_free().
*/
gchar *
-gl_xml_get_node_content (xmlNodePtr node)
+lgl_xml_get_node_content (xmlNodePtr node)
{
xmlChar *xml_content;
gchar *g_content;
/**
- * gl_xml_set_default_units:
- * @units: default units selection (#glUnitsType)
+ * lgl_xml_set_default_units:
+ * @units: default units selection (#lglUnitsType)
*
* Set the default units when formatting lengths. See
- * gl_xml_set_prop_length().
+ * lgl_xml_set_prop_length().
*
*/
void
-gl_xml_set_default_units (glUnitsType units)
+lgl_xml_set_default_units (lglUnitsType units)
{
- g_return_if_fail ((units >= GL_UNITS_FIRST) && (units <= GL_UNITS_LAST));
+ g_return_if_fail ((units >= LGL_UNITS_FIRST) && (units <= LGL_UNITS_LAST));
default_units = units;
}
#include "enums.h"
-#define GL_XML_NAME_SPACE "http://snaught.com/glabels/2.0/"
+#define LGL_XML_NAME_SPACE "http://snaught.com/glabels/2.0/"
G_BEGIN_DECLS
/*
* Get property functions
*/
-gchar * gl_xml_get_prop_string (xmlNodePtr node,
- const gchar *property,
- const gchar *default_val);
+gchar * lgl_xml_get_prop_string (xmlNodePtr node,
+ const gchar *property,
+ const gchar *default_val);
-gchar * gl_xml_get_prop_i18n_string (xmlNodePtr node,
- const gchar *property,
- const gchar *default_val);
+gchar * lgl_xml_get_prop_i18n_string (xmlNodePtr node,
+ const gchar *property,
+ const gchar *default_val);
-gdouble gl_xml_get_prop_double (xmlNodePtr node,
- const gchar *property,
- gdouble default_val);
+gdouble lgl_xml_get_prop_double (xmlNodePtr node,
+ const gchar *property,
+ gdouble default_val);
-gboolean gl_xml_get_prop_boolean (xmlNodePtr node,
- const gchar *property,
- gboolean default_val);
+gboolean lgl_xml_get_prop_boolean (xmlNodePtr node,
+ const gchar *property,
+ gboolean default_val);
-gint gl_xml_get_prop_int (xmlNodePtr node,
- const gchar *property,
- gint default_val);
+gint lgl_xml_get_prop_int (xmlNodePtr node,
+ const gchar *property,
+ gint default_val);
-guint gl_xml_get_prop_uint (xmlNodePtr node,
- const gchar *property,
- guint default_val);
+guint lgl_xml_get_prop_uint (xmlNodePtr node,
+ const gchar *property,
+ guint default_val);
-gdouble gl_xml_get_prop_length (xmlNodePtr node,
- const gchar *property,
- gdouble default_val);
+gdouble lgl_xml_get_prop_length (xmlNodePtr node,
+ const gchar *property,
+ gdouble default_val);
/*
* Set property functions
*/
-void gl_xml_set_prop_string (xmlNodePtr node,
- const gchar *property,
- const gchar *val);
+void lgl_xml_set_prop_string (xmlNodePtr node,
+ const gchar *property,
+ const gchar *val);
-void gl_xml_set_prop_double (xmlNodePtr node,
- const gchar *property,
- gdouble val);
+void lgl_xml_set_prop_double (xmlNodePtr node,
+ const gchar *property,
+ gdouble val);
-void gl_xml_set_prop_boolean (xmlNodePtr node,
- const gchar *property,
- gboolean val);
+void lgl_xml_set_prop_boolean (xmlNodePtr node,
+ const gchar *property,
+ gboolean val);
-void gl_xml_set_prop_int (xmlNodePtr node,
- const gchar *property,
- gint val);
+void lgl_xml_set_prop_int (xmlNodePtr node,
+ const gchar *property,
+ gint val);
-void gl_xml_set_prop_uint_hex (xmlNodePtr node,
- const gchar *property,
- guint val);
+void lgl_xml_set_prop_uint_hex (xmlNodePtr node,
+ const gchar *property,
+ guint val);
-void gl_xml_set_prop_length (xmlNodePtr node,
- const gchar *property,
- gdouble val);
+void lgl_xml_set_prop_length (xmlNodePtr node,
+ const gchar *property,
+ gdouble val);
/*
* Other node functions
*/
-gboolean gl_xml_is_node (xmlNodePtr node,
- const gchar *name);
+gboolean lgl_xml_is_node (xmlNodePtr node,
+ const gchar *name);
-gchar * gl_xml_get_node_content (xmlNodePtr node);
+gchar * lgl_xml_get_node_content (xmlNodePtr node);
/*
* Misc functions
*/
-void gl_xml_set_default_units (glUnitsType units);
+void lgl_xml_set_default_units (lglUnitsType units);
G_END_DECLS
/*===========================================*/
static void gl_cairo_rect_label_path (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gboolean rotate_flag,
gboolean waste_flag);
static void gl_cairo_round_label_path (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gboolean rotate_flag,
gboolean waste_flag);
static void gl_cairo_cd_label_path (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gboolean rotate_flag,
gboolean waste_flag);
/*--------------------------------------------------------------------------*/
void
gl_cairo_label_path (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gboolean rotate_flag,
gboolean waste_flag)
{
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
gl_debug (DEBUG_PATH, "START");
- label_type = gl_template_get_first_label_type (template);
+ frame = lgl_template_get_first_frame (template);
- switch (label_type->shape) {
+ switch (frame->shape) {
- case GL_TEMPLATE_SHAPE_RECT:
+ case LGL_TEMPLATE_FRAME_SHAPE_RECT:
gl_cairo_rect_label_path (cr, template, rotate_flag, waste_flag);
break;
- case GL_TEMPLATE_SHAPE_ROUND:
+ case LGL_TEMPLATE_FRAME_SHAPE_ROUND:
gl_cairo_round_label_path (cr, template, rotate_flag, waste_flag);
break;
- case GL_TEMPLATE_SHAPE_CD:
+ case LGL_TEMPLATE_FRAME_SHAPE_CD:
gl_cairo_cd_label_path (cr, template, rotate_flag, waste_flag);
break;
/*--------------------------------------------------------------------------*/
static void
gl_cairo_rect_label_path (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gboolean rotate_flag,
gboolean waste_flag)
{
- const glTemplateLabelType *label_type;
- gdouble w, h, r;
- gdouble x_waste, y_waste;
+ const lglTemplateFrame *frame;
+ gdouble w, h, r;
+ gdouble x_waste, y_waste;
gl_debug (DEBUG_PATH, "START");
- label_type = gl_template_get_first_label_type (template);
- r = label_type->size.rect.r;
+ frame = lgl_template_get_first_frame (template);
+ r = frame->rect.r;
x_waste = 0.0;
y_waste = 0.0;
if (rotate_flag)
{
- gl_template_get_label_size (label_type, &h, &w);
+ lgl_template_frame_get_size (frame, &h, &w);
if (waste_flag)
{
- x_waste = label_type->size.rect.y_waste;
- y_waste = label_type->size.rect.x_waste;
+ x_waste = frame->rect.y_waste;
+ y_waste = frame->rect.x_waste;
}
}
else
{
- gl_template_get_label_size (label_type, &w, &h);
+ lgl_template_frame_get_size (frame, &w, &h);
if (waste_flag)
{
- x_waste = label_type->size.rect.x_waste;
- y_waste = label_type->size.rect.y_waste;
+ x_waste = frame->rect.x_waste;
+ y_waste = frame->rect.y_waste;
}
}
/*--------------------------------------------------------------------------*/
static void
gl_cairo_round_label_path (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gboolean rotate_flag,
gboolean waste_flag)
{
- const glTemplateLabelType *label_type;
- gdouble w, h;
- gdouble waste;
+ const lglTemplateFrame *frame;
+ gdouble w, h;
+ gdouble waste;
gl_debug (DEBUG_PATH, "START");
- label_type = gl_template_get_first_label_type (template);
+ frame = lgl_template_get_first_frame (template);
if (rotate_flag)
{
- gl_template_get_label_size (label_type, &h, &w);
+ lgl_template_frame_get_size (frame, &h, &w);
}
else
{
- gl_template_get_label_size (label_type, &w, &h);
+ lgl_template_frame_get_size (frame, &w, &h);
}
if (waste_flag)
{
- waste = label_type->size.round.waste;
+ waste = frame->round.waste;
}
else
{
/*--------------------------------------------------------------------------*/
static void
gl_cairo_cd_label_path (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gboolean rotate_flag,
gboolean waste_flag)
{
- const glTemplateLabelType *label_type;
- gdouble w, h;
- gdouble xc, yc;
- gdouble r1, r2;
- gdouble theta1, theta2;
- gdouble waste;
+ const lglTemplateFrame *frame;
+ gdouble w, h;
+ gdouble xc, yc;
+ gdouble r1, r2;
+ gdouble theta1, theta2;
+ gdouble waste;
gl_debug (DEBUG_PATH, "START");
- label_type = gl_template_get_first_label_type (template);
+ frame = lgl_template_get_first_frame (template);
if (rotate_flag)
{
- gl_template_get_label_size (label_type, &h, &w);
+ lgl_template_frame_get_size (frame, &h, &w);
}
else
{
- gl_template_get_label_size (label_type, &w, &h);
+ lgl_template_frame_get_size (frame, &w, &h);
}
xc = w/2.0;
yc = h/2.0;
- r1 = label_type->size.cd.r1;
- r2 = label_type->size.cd.r2;
+ r1 = frame->cd.r1;
+ r2 = frame->cd.r2;
if (waste_flag)
{
- waste = label_type->size.cd.waste;
+ waste = frame->cd.waste;
}
else
{
G_BEGIN_DECLS
void gl_cairo_label_path (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gboolean rotate_flag,
gboolean waste_flag);
/* Local function prototypes */
/*===========================================*/
-static void gl_cairo_markup_margin_path (cairo_t *cr,
- const glTemplateMarkup *markup,
- glLabel *label);
+static void gl_cairo_markup_margin_path (cairo_t *cr,
+ const lglTemplateMarkup *markup,
+ glLabel *label);
-static void gl_cairo_markup_margin_rect_path (cairo_t *cr,
- const glTemplateMarkup *markup,
- glLabel *label);
+static void gl_cairo_markup_margin_rect_path (cairo_t *cr,
+ const lglTemplateMarkup *markup,
+ glLabel *label);
-static void gl_cairo_markup_margin_round_path (cairo_t *cr,
- const glTemplateMarkup *markup,
- glLabel *label);
+static void gl_cairo_markup_margin_round_path (cairo_t *cr,
+ const lglTemplateMarkup *markup,
+ glLabel *label);
-static void gl_cairo_markup_margin_cd_path (cairo_t *cr,
- const glTemplateMarkup *markup,
- glLabel *label);
+static void gl_cairo_markup_margin_cd_path (cairo_t *cr,
+ const lglTemplateMarkup *markup,
+ glLabel *label);
-static void gl_cairo_markup_line_path (cairo_t *cr,
- const glTemplateMarkup *markup);
+static void gl_cairo_markup_line_path (cairo_t *cr,
+ const lglTemplateMarkup *markup);
-static void gl_cairo_markup_circle_path (cairo_t *cr,
- const glTemplateMarkup *markup);
+static void gl_cairo_markup_circle_path (cairo_t *cr,
+ const lglTemplateMarkup *markup);
-static void gl_cairo_markup_rect_path (cairo_t *cr,
- const glTemplateMarkup *markup);
+static void gl_cairo_markup_rect_path (cairo_t *cr,
+ const lglTemplateMarkup *markup);
\f
/*--------------------------------------------------------------------------*/
/* Create markup path */
/*--------------------------------------------------------------------------*/
void
-gl_cairo_markup_path (cairo_t *cr,
- const glTemplateMarkup *markup,
- glLabel *label)
+gl_cairo_markup_path (cairo_t *cr,
+ const lglTemplateMarkup *markup,
+ glLabel *label)
{
gl_debug (DEBUG_PATH, "START");
switch (markup->type) {
- case GL_TEMPLATE_MARKUP_MARGIN:
+ case LGL_TEMPLATE_MARKUP_MARGIN:
gl_cairo_markup_margin_path (cr, markup, label);
break;
- case GL_TEMPLATE_MARKUP_LINE:
+ case LGL_TEMPLATE_MARKUP_LINE:
gl_cairo_markup_line_path (cr, markup);
break;
- case GL_TEMPLATE_MARKUP_CIRCLE:
+ case LGL_TEMPLATE_MARKUP_CIRCLE:
gl_cairo_markup_circle_path (cr, markup);
break;
- case GL_TEMPLATE_MARKUP_RECT:
+ case LGL_TEMPLATE_MARKUP_RECT:
gl_cairo_markup_rect_path (cr, markup);
break;
default:
/*---------------------------------------------------------------------------*/
static void
gl_cairo_markup_margin_path (cairo_t *cr,
- const glTemplateMarkup *markup,
+ const lglTemplateMarkup *markup,
glLabel *label)
{
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
gl_debug (DEBUG_PATH, "START");
- label_type = gl_template_get_first_label_type (label->template);
+ frame = lgl_template_get_first_frame (label->template);
- switch (label_type->shape) {
+ switch (frame->shape) {
- case GL_TEMPLATE_SHAPE_RECT:
+ case LGL_TEMPLATE_FRAME_SHAPE_RECT:
gl_cairo_markup_margin_rect_path (cr, markup, label);
break;
- case GL_TEMPLATE_SHAPE_ROUND:
+ case LGL_TEMPLATE_FRAME_SHAPE_ROUND:
gl_cairo_markup_margin_round_path (cr, markup, label);
break;
- case GL_TEMPLATE_SHAPE_CD:
+ case LGL_TEMPLATE_FRAME_SHAPE_CD:
gl_cairo_markup_margin_cd_path (cr, markup, label);
break;
/* PRIVATE. Draw simple recangular margin. */
/*---------------------------------------------------------------------------*/
static void
-gl_cairo_markup_margin_rect_path (cairo_t *cr,
- const glTemplateMarkup *markup,
- glLabel *label)
+gl_cairo_markup_margin_rect_path (cairo_t *cr,
+ const lglTemplateMarkup *markup,
+ glLabel *label)
{
- const glTemplateLabelType *label_type;
- gdouble w, h, r, m;
+ const lglTemplateFrame *frame;
+ gdouble w, h, r, m;
gl_debug (DEBUG_PATH, "START");
- label_type = gl_template_get_first_label_type (label->template);
+ frame = lgl_template_get_first_frame (label->template);
- m = markup->data.margin.size;
+ m = markup->margin.size;
gl_label_get_size (label, &w, &h);
w = w - 2*m;
h = h - 2*m;
- r = MAX (label_type->size.rect.r - m, 0.0);
+ r = MAX (frame->rect.r - m, 0.0);
if ( r == 0.0 )
{
/* PRIVATE. Draw round margin. */
/*---------------------------------------------------------------------------*/
static void
-gl_cairo_markup_margin_round_path (cairo_t *cr,
- const glTemplateMarkup *markup,
- glLabel *label)
+gl_cairo_markup_margin_round_path (cairo_t *cr,
+ const lglTemplateMarkup *markup,
+ glLabel *label)
{
- const glTemplateLabelType *label_type;
- gdouble r, m;
+ const lglTemplateFrame *frame;
+ gdouble r, m;
gl_debug (DEBUG_PATH, "START");
- label_type = gl_template_get_first_label_type (label->template);
+ frame = lgl_template_get_first_frame (label->template);
- r = label_type->size.round.r;
- m = markup->data.margin.size;
+ r = frame->round.r;
+ m = markup->margin.size;
cairo_arc (cr, r, r, r-m, 0, 2*G_PI);
cairo_close_path (cr);
/* PRIVATE. Draw CD margins. */
/*---------------------------------------------------------------------------*/
static void
-gl_cairo_markup_margin_cd_path (cairo_t *cr,
- const glTemplateMarkup *markup,
- glLabel *label)
+gl_cairo_markup_margin_cd_path (cairo_t *cr,
+ const lglTemplateMarkup *markup,
+ glLabel *label)
{
- const glTemplateLabelType *label_type;
- gdouble m, r1, r2;
- gdouble theta1, theta2;
- gdouble xc, yc;
- gdouble w, h;
+ const lglTemplateFrame *frame;
+ gdouble m, r1, r2;
+ gdouble theta1, theta2;
+ gdouble xc, yc;
+ gdouble w, h;
gl_debug (DEBUG_PATH, "START");
- label_type = gl_template_get_first_label_type (label->template);
+ frame = lgl_template_get_first_frame (label->template);
gl_label_get_size (label, &w, &h);
xc = w/2.0;
yc = h/2.0;
- m = markup->data.margin.size;
- r1 = label_type->size.cd.r1 - m;
- r2 = label_type->size.cd.r2 + m;
+ m = markup->margin.size;
+ r1 = frame->cd.r1 - m;
+ r2 = frame->cd.r2 + m;
/*
/* PRIVATE. Draw line markup. */
/*---------------------------------------------------------------------------*/
static void
-gl_cairo_markup_line_path (cairo_t *cr,
- const glTemplateMarkup *markup)
+gl_cairo_markup_line_path (cairo_t *cr,
+ const lglTemplateMarkup *markup)
{
gl_debug (DEBUG_PATH, "START");
- cairo_move_to (cr, markup->data.line.x1, markup->data.line.y1);
- cairo_line_to (cr, markup->data.line.x2, markup->data.line.y2);
+ cairo_move_to (cr, markup->line.x1, markup->line.y1);
+ cairo_line_to (cr, markup->line.x2, markup->line.y2);
gl_debug (DEBUG_PATH, "END");
}
/* PRIVATE. Draw circle markup. */
/*---------------------------------------------------------------------------*/
static void
-gl_cairo_markup_circle_path (cairo_t *cr,
- const glTemplateMarkup *markup)
+gl_cairo_markup_circle_path (cairo_t *cr,
+ const lglTemplateMarkup *markup)
{
gl_debug (DEBUG_PATH, "START");
cairo_arc (cr,
- markup->data.circle.x0, markup->data.circle.y0,
- markup->data.circle.r,
+ markup->circle.x0, markup->circle.y0,
+ markup->circle.r,
0.0, 2*G_PI);
cairo_close_path (cr);
/* PRIVATE. Draw rect markup. */
/*---------------------------------------------------------------------------*/
static void
-gl_cairo_markup_rect_path (cairo_t *cr,
- const glTemplateMarkup *markup)
+gl_cairo_markup_rect_path (cairo_t *cr,
+ const lglTemplateMarkup *markup)
{
- gdouble x1 = markup->data.rect.x1;
- gdouble y1 = markup->data.rect.y1;
- gdouble w = markup->data.rect.w;
- gdouble h = markup->data.rect.h;
- gdouble r = markup->data.rect.r;
+ gdouble x1 = markup->rect.x1;
+ gdouble y1 = markup->rect.y1;
+ gdouble w = markup->rect.w;
+ gdouble h = markup->rect.h;
+ gdouble r = markup->rect.r;
gl_debug (DEBUG_PATH, "START");
G_BEGIN_DECLS
-void gl_cairo_markup_path (cairo_t *cr,
- const glTemplateMarkup *markup,
- glLabel *label);
+void gl_cairo_markup_path (cairo_t *cr,
+ const lglTemplateMarkup *markup,
+ glLabel *label);
G_END_DECLS
gint response,
gpointer user_data)
{
- glTemplate *template;
- glLabel *label;
- glWindow *window;
- GtkWidget *new_window;
+ lglTemplate *template;
+ glLabel *label;
+ glWindow *window;
+ GtkWidget *new_window;
gl_debug (DEBUG_FILE, "START");
rotate_flag =
gl_new_label_dialog_get_rotate_state (GL_NEW_LABEL_DIALOG (dialog));
- template = gl_template_from_name (sheet_name);
+ template = lgl_template_from_name (sheet_name);
label = GL_LABEL(gl_label_new ());
gl_label_set_template (label, template);
gl_label_set_rotate_flag (label, rotate_flag);
- gl_template_free (template);
+ lgl_template_free (template);
window =
GL_WINDOW (g_object_get_data (G_OBJECT (dialog),
gint response,
gpointer user_data)
{
- glTemplate *template;
- glLabel *label;
+ lglTemplate *template;
+ glLabel *label;
gl_debug (DEBUG_FILE, "START");
rotate_flag =
gl_new_label_dialog_get_rotate_state (GL_NEW_LABEL_DIALOG (dialog));
- template = gl_template_from_name (sheet_name);
+ template = lgl_template_from_name (sheet_name);
label = GL_LABEL(g_object_get_data (G_OBJECT (dialog), "label"));
gl_label_set_template (label, template);
/* initialize components */
gl_debug_init ();
gl_merge_init ();
- gl_paper_init ();
- gl_template_init ();
+ lgl_init ();
/* now print the files */
for (p = file_list; p; p = p->next) {
/* Initialize subsystems */
gl_debug_init ();
gl_stock_init ();
- gl_paper_init ();
+ lgl_init ();
gl_prefs_init ();
- gl_template_init ();
gl_mini_preview_pixbuf_cache_init ();
gl_merge_init ();
gl_recent_init ();
gl_label_object_finalize (GObject *object)
{
glLabelObject *label_object = GL_LABEL_OBJECT (object);
- glLabel *parent;
gl_debug (DEBUG_LABEL, "START");
g_object_unref (G_OBJECT(p->data));
}
- gl_template_free (label->template);
+ lgl_template_free (label->template);
g_free (label->priv->filename);
if (label->priv->merge != NULL) {
g_object_unref (G_OBJECT(label->priv->merge));
/* set template. */
/****************************************************************************/
extern void
-gl_label_set_template (glLabel *label,
- glTemplate *template)
+gl_label_set_template (glLabel *label,
+ lglTemplate *template)
{
gl_debug (DEBUG_LABEL, "START");
if ((label->template == NULL) ||
(g_strcasecmp (template->name, label->template->name) != 0)) {
- gl_template_free (label->template);
- label->template = gl_template_dup (template);
+ lgl_template_free (label->template);
+ label->template = lgl_template_dup (template);
label->priv->modified_flag = TRUE;
gdouble *w,
gdouble *h)
{
- glTemplate *template;
- const glTemplateLabelType *label_type;
+ lglTemplate *template;
+ const lglTemplateFrame *frame;
gl_debug (DEBUG_LABEL, "START");
*w = *h = 0;
return;
}
- label_type = gl_template_get_first_label_type (template);
+ frame = lgl_template_get_first_frame (template);
if (!label->rotate_flag) {
- gl_template_get_label_size (label_type, w, h);
+ lgl_template_frame_get_size (frame, w, h);
} else {
- gl_template_get_label_size (label_type, h, w);
+ lgl_template_frame_get_size (frame, h, w);
}
gl_debug (DEBUG_LABEL, "END");
struct _glLabel {
GObject object;
- glTemplate *template;
+ lglTemplate *template;
gboolean rotate_flag;
GList *objects;
void gl_label_set_template (glLabel *label,
- glTemplate *template);
+ lglTemplate *template);
void gl_label_set_rotate_flag (glLabel *label,
gboolean rotate_flag);
mini_preview_pixbuf_cache = g_hash_table_new (g_str_hash, g_str_equal);
- names = gl_template_get_name_list_unique (NULL, NULL);
+ names = lgl_template_get_name_list_unique (NULL, NULL);
for ( p=names; p != NULL; p=p->next )
{
gl_mini_preview_pixbuf_cache_add_by_name ((gchar *)p->data);
}
- gl_template_free_name_list (names);
+ lgl_template_free_name_list (names);
gl_debug (DEBUG_PIXBUF_CACHE, "END pixbuf_cache=%p", mini_preview_pixbuf_cache);
}
void
gl_mini_preview_pixbuf_cache_add_by_name (gchar *name)
{
- glTemplate *template;
- GdkPixbuf *pixbuf;
+ lglTemplate *template;
+ GdkPixbuf *pixbuf;
gl_debug (DEBUG_PIXBUF_CACHE, "START");
- template = gl_template_from_name (name);
+ template = lgl_template_from_name (name);
pixbuf = gl_mini_preview_pixbuf_new (template, 72, 72);
- gl_template_free (template);
+ lgl_template_free (template);
g_hash_table_insert (mini_preview_pixbuf_cache, g_strdup (name), pixbuf);
/*===========================================*/
static void draw_paper (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gdouble scale);
static void draw_label_outlines (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gdouble scale);
static void draw_label_outline (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gdouble x0,
gdouble y0);
/* Create new pixbuf with mini preview of template */
/****************************************************************************/
GdkPixbuf *
-gl_mini_preview_pixbuf_new (glTemplate *template,
- gint width,
- gint height)
+gl_mini_preview_pixbuf_new (lglTemplate *template,
+ gint width,
+ gint height)
{
cairo_surface_t *surface;
cairo_t *cr;
/*--------------------------------------------------------------------------*/
static void
draw_paper (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gdouble scale)
{
gl_debug (DEBUG_MINI_PREVIEW, "START");
/*--------------------------------------------------------------------------*/
static void
draw_label_outlines (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gdouble scale)
{
- const glTemplateLabelType *label_type;
- gint i, n_labels;
- glTemplateOrigin *origins;
+ const lglTemplateFrame *frame;
+ gint i, n_labels;
+ lglTemplateOrigin *origins;
gl_debug (DEBUG_MINI_PREVIEW, "START");
cairo_set_line_width (cr, LABEL_OUTLINE_WIDTH_PIXELS/scale);
- label_type = gl_template_get_first_label_type (template);
+ frame = lgl_template_get_first_frame (template);
- n_labels = gl_template_get_n_labels (label_type);
- origins = gl_template_get_origins (label_type);
+ n_labels = lgl_template_frame_get_n_labels (frame);
+ origins = lgl_template_frame_get_origins (frame);
for ( i=0; i < n_labels; i++ ) {
/*--------------------------------------------------------------------------*/
static void
draw_label_outline (cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gdouble x0,
gdouble y0)
{
G_BEGIN_DECLS
-GdkPixbuf *gl_mini_preview_pixbuf_new (glTemplate *template,
- gint width,
- gint height);
+GdkPixbuf *gl_mini_preview_pixbuf_new (lglTemplate *template,
+ gint width,
+ gint height);
G_END_DECLS
dialog->priv->stop_signals = TRUE;
switch (gl_prefs->units) {
- case GL_UNITS_POINT:
+ case LGL_UNITS_POINT:
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON(dialog->priv->units_points_radio),
TRUE);
break;
- case GL_UNITS_INCH:
+ case LGL_UNITS_INCH:
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON(dialog->priv->units_inches_radio),
TRUE);
break;
- case GL_UNITS_MM:
+ case LGL_UNITS_MM:
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON(dialog->priv->units_mm_radio),
TRUE);
if (gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON(dialog->priv->units_points_radio)))
{
- gl_prefs->units = GL_UNITS_POINT;
+ gl_prefs->units = LGL_UNITS_POINT;
}
if (gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON(dialog->priv->units_inches_radio)))
{
- gl_prefs->units = GL_UNITS_INCH;
+ gl_prefs->units = LGL_UNITS_INCH;
}
if (gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON(dialog->priv->units_mm_radio)))
{
- gl_prefs->units = GL_UNITS_MM;
+ gl_prefs->units = LGL_UNITS_MM;
}
if (gtk_toggle_button_get_active (
#define PREF_MAX_RECENTS "/max-recents"
/* Default values */
-#define DEFAULT_UNITS_STRING units_to_string (GL_UNITS_INCH)
+#define DEFAULT_UNITS_STRING units_to_string (LGL_UNITS_INCH)
#define DEFAULT_PAGE_SIZE "US-Letter"
#define DEFAULT_FONT_FAMILY "Sans"
const gchar *key,
gdouble def);
-static glUnitsType string_to_units (const gchar *string);
-static const gchar *units_to_string (glUnitsType units);
+static lglUnitsType string_to_units (const gchar *string);
+static const gchar *units_to_string (lglUnitsType units);
\f
void
gl_prefs_model_load_settings (glPrefsModel *prefs_model)
{
- gchar *string;
- glPaper *paper;
+ gchar *string;
+ lglPaper *paper;
gl_debug (DEBUG_PREFS, "START");
/* Proof read the default page size -- it must be a valid id. */
/* (For compatability with older versions.) */
/* Note: paper module must be initialized for this to work. */
- paper = gl_paper_from_id (prefs_model->default_page_size);
+ paper = lgl_paper_from_id (prefs_model->default_page_size);
if ( paper == NULL ) {
prefs_model->default_page_size = g_strdup (DEFAULT_PAGE_SIZE);
} else {
- gl_paper_free (paper);
+ lgl_paper_free (paper);
paper = NULL;
}
/*---------------------------------------------------------------------------*/
/* PRIVATE. Utilities to deal with units. */
/*---------------------------------------------------------------------------*/
-static glUnitsType
+static lglUnitsType
string_to_units (const gchar *string)
{
- glUnitsType units;
+ lglUnitsType units;
if (g_strcasecmp (string, "Points") == 0) {
- units = GL_UNITS_POINT;
+ units = LGL_UNITS_POINT;
} else if (g_strcasecmp (string, "Inches") == 0) {
- units = GL_UNITS_INCH;
+ units = LGL_UNITS_INCH;
} else if (g_strcasecmp (string, "Millimeters") == 0) {
- units = GL_UNITS_MM;
+ units = LGL_UNITS_MM;
} else {
- units = GL_UNITS_INCH;
+ units = LGL_UNITS_INCH;
}
return units;
}
static const
-gchar *units_to_string (glUnitsType units)
+gchar *units_to_string (lglUnitsType units)
{
switch (units) {
- case GL_UNITS_POINT:
+ case LGL_UNITS_POINT:
return "Points";
break;
- case GL_UNITS_INCH:
+ case LGL_UNITS_INCH:
return "Inches";
break;
- case GL_UNITS_MM:
+ case LGL_UNITS_MM:
return "Millimeters";
break;
default:
GConfClient *gconf_client;
/* Units */
- glUnitsType units;
+ lglUnitsType units;
/* Page size */
gchar *default_page_size;
/****************************************************************************/
/* Get desired units. */
/****************************************************************************/
-glUnitsType
+lglUnitsType
gl_prefs_get_units (void)
{
return gl_prefs->units;
{
switch (gl_prefs->units) {
- case GL_UNITS_POINT:
+ case LGL_UNITS_POINT:
return 1.0; /* points */
- case GL_UNITS_INCH:
+ case LGL_UNITS_INCH:
return 1.0 / 72.0; /* inches */
- case GL_UNITS_MM:
+ case LGL_UNITS_MM:
return 0.35277778; /* mm */
default:
g_message ("Illegal units"); /* Should not happen */
{
switch (gl_prefs->units) {
- case GL_UNITS_POINT:
+ case LGL_UNITS_POINT:
return 1; /* points */
- case GL_UNITS_INCH:
+ case LGL_UNITS_INCH:
return 3; /* inches */
- case GL_UNITS_MM:
+ case LGL_UNITS_MM:
return 1; /* mm */
default:
g_message ("Illegal units"); /* Should not happen */
{
switch (gl_prefs->units) {
- case GL_UNITS_POINT:
+ case LGL_UNITS_POINT:
return 0.1; /* points */
- case GL_UNITS_INCH:
+ case LGL_UNITS_INCH:
return 0.001; /* inches */
- case GL_UNITS_MM:
+ case LGL_UNITS_MM:
return 0.1; /* mm */
default:
g_message ("Illegal units"); /* Should not happen */
{
switch (gl_prefs->units) {
- case GL_UNITS_POINT:
+ case LGL_UNITS_POINT:
return _("points");
- case GL_UNITS_INCH:
+ case LGL_UNITS_INCH:
return _("inches");
- case GL_UNITS_MM:
+ case LGL_UNITS_MM:
return _("mm");
default:
g_message ("Illegal units"); /* Should not happen */
const gchar *gl_prefs_get_page_size (void);
-glUnitsType gl_prefs_get_units (void);
+lglUnitsType gl_prefs_get_units (void);
const gchar *gl_prefs_get_units_string (void);
gl_print_op_construct (glPrintOp *op,
glLabel *label)
{
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
op->priv->label = label;
op->priv->force_outline_flag = FALSE;
- label_type = gl_template_get_first_label_type (label->template);
+ frame = lgl_template_get_first_frame (label->template);
op->priv->n_sheets = 1;
op->priv->first = 1;
- op->priv->last = gl_template_get_n_labels (label_type);
+ op->priv->last = lgl_template_frame_get_n_labels (frame);
op->priv->n_copies = 1;
gtk_print_operation_set_custom_tab_label ( GTK_PRINT_OPERATION (op),
gboolean crop_marks_flag)
{
- glMerge *merge = NULL;
- const glTemplateLabelType *label_type = NULL;
+ glMerge *merge = NULL;
+ const lglTemplateFrame *frame = NULL;
op->priv->label = label;
op->priv->force_outline_flag = FALSE;
merge = gl_label_get_merge (label);
- label_type = gl_template_get_first_label_type (label->template);
+ frame = lgl_template_get_first_frame (label->template);
if (merge == NULL)
{
op->priv->merge_flag = FALSE;
- op->priv->last = gl_template_get_n_labels (label_type);
+ op->priv->last = lgl_template_frame_get_n_labels (frame);
}
else
op->priv->n_sheets =
ceil ((double)(first-1 + n_copies * gl_merge_get_record_count(merge))
- / gl_template_get_n_labels (label_type));;
+ / lgl_template_frame_get_n_labels (frame));;
g_object_unref (G_OBJECT(merge));
cairo_t *cr;
/* gLabels Template */
- glTemplate *template;
- gboolean label_rotate_flag;
+ lglTemplate *template;
+ gboolean label_rotate_flag;
/* page size */
gdouble page_width;
gboolean reverse_flag,
gboolean crop_marks_flag)
{
- PrintInfo *pi;
- const glTemplateLabelType *label_type;
- gint i_label;
- glTemplateOrigin *origins;
+ PrintInfo *pi;
+ const lglTemplateFrame *frame;
+ gint i_label;
+ lglTemplateOrigin *origins;
gl_debug (DEBUG_PRINT, "START");
pi = print_info_new (cr, label);
- label_type = gl_template_get_first_label_type (pi->template);
- origins = gl_template_get_origins (label_type);
+ frame = lgl_template_get_first_frame (pi->template);
+ origins = lgl_template_frame_get_origins (frame);
if (crop_marks_flag) {
print_crop_marks (pi);
glMerge *merge;
const GList *record_list;
PrintInfo *pi;
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
gint i_label, n_labels_per_page, i_copy;
glMergeRecord *record;
GList *p;
- glTemplateOrigin *origins;
+ lglTemplateOrigin *origins;
gl_debug (DEBUG_PRINT, "START");
record_list = gl_merge_get_record_list (merge);
pi = print_info_new (cr, label);
- label_type = gl_template_get_first_label_type (pi->template);
+ frame = lgl_template_get_first_frame (pi->template);
- n_labels_per_page = gl_template_get_n_labels (label_type);
- origins = gl_template_get_origins (label_type);
+ n_labels_per_page = lgl_template_frame_get_n_labels (frame);
+ origins = lgl_template_frame_get_origins (frame);
if (crop_marks_flag) {
print_crop_marks (pi);
glMerge *merge;
const GList *record_list;
PrintInfo *pi;
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
gint i_label, n_labels_per_page, i_copy;
glMergeRecord *record;
GList *p;
- glTemplateOrigin *origins;
+ lglTemplateOrigin *origins;
gl_debug (DEBUG_PRINT, "START");
record_list = gl_merge_get_record_list (merge);
pi = print_info_new (cr, label);
- label_type = gl_template_get_first_label_type (pi->template);
+ frame = lgl_template_get_first_frame (pi->template);
- n_labels_per_page = gl_template_get_n_labels (label_type);
- origins = gl_template_get_origins (label_type);
+ n_labels_per_page = lgl_template_frame_get_n_labels (frame);
+ origins = lgl_template_frame_get_origins (frame);
if (crop_marks_flag) {
print_crop_marks (pi);
static void
print_crop_marks (PrintInfo *pi)
{
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
gdouble w, h, page_w, page_h;
GList *p;
- glTemplateLayout *layout;
+ lglTemplateLayout *layout;
gdouble xmin, ymin, xmax, ymax, dx, dy;
gdouble x1, y1, x2, y2, x3, y3, x4, y4;
gint ix, iy, nx, ny;
gl_debug (DEBUG_PRINT, "START");
- label_type = gl_template_get_first_label_type (pi->template);
+ frame = lgl_template_get_first_frame (pi->template);
- gl_template_get_label_size (label_type, &w, &h);
+ lgl_template_frame_get_size (frame, &w, &h);
page_w = pi->page_width;
page_h = pi->page_height;
cairo_set_source_rgb (pi->cr, OUTLINE_RGB_ARGS);
cairo_set_line_width (pi->cr, OUTLINE_WIDTH);
- for (p=label_type->layouts; p != NULL; p=p->next) {
+ for (p=frame->all.layouts; p != NULL; p=p->next) {
- layout = (glTemplateLayout *)p->data;
+ layout = (lglTemplateLayout *)p->data;
xmin = layout->x0;
ymin = layout->y0;
gboolean outline_flag,
gboolean reverse_flag)
{
- const glTemplateLabelType *label_type;
- gdouble width, height;
+ const lglTemplateFrame *frame;
+ gdouble width, height;
gl_debug (DEBUG_PRINT, "START");
- label_type = gl_template_get_first_label_type (pi->template);
+ frame = lgl_template_get_first_frame (pi->template);
gl_label_get_size (label, &width, &height);
static void print_test_cb (glTemplateDesigner *dialog);
-static glTemplate *build_template (glTemplateDesigner *dialog);
+static lglTemplate *build_template (glTemplateDesigner *dialog);
\f
/*****************************************************************************/
TRUE);
/* Load page size combo */
- page_sizes = gl_paper_get_name_list ();
+ page_sizes = lgl_paper_get_name_list ();
gl_util_combo_box_set_strings (GTK_COMBO_BOX (dialog->priv->pg_size_combo), page_sizes);
- gl_paper_free_name_list (page_sizes);
+ lgl_paper_free_name_list (page_sizes);
default_page_size_id = gl_prefs_get_page_size ();
- default_page_size_name = gl_paper_lookup_name_from_id (default_page_size_id);
+ default_page_size_name = lgl_paper_lookup_name_from_id (default_page_size_id);
gl_util_combo_box_set_active_text (GTK_COMBO_BOX (dialog->priv->pg_size_combo), default_page_size_name);
g_free (default_page_size_name);
static void
apply_cb (glTemplateDesigner *dialog)
{
- glTemplate *template;
+ lglTemplate *template;
template = build_template (dialog);
- gl_template_register (template);
+ lgl_template_register (template);
gl_mini_preview_pixbuf_cache_add_by_name (template->name);
}
static void
pg_size_page_changed_cb (glTemplateDesigner *dialog)
{
- gchar *page_size_name;
- glPaper *paper;
+ gchar *page_size_name;
+ lglPaper *paper;
page_size_name =
if (page_size_name && strlen(page_size_name)) {
- paper = gl_paper_from_name (page_size_name);
+ paper = lgl_paper_from_name (page_size_name);
if ( g_strcasecmp (paper->id, "Other") == 0 ) {
paper->height * dialog->priv->units_per_point);
}
- gl_paper_free (paper);
+ lgl_paper_free (paper);
}
g_free (page_size_name);
gint nlayouts;
gdouble nx_1, ny_1, x0_1, y0_1, dx_1, dy_1;
gdouble nx_2, ny_2, x0_2, y0_2, dx_2, dy_2;
- glTemplate *template;
+ lglTemplate *template;
if (dialog->priv->stop_signals) return;
dialog->priv->stop_signals = TRUE;
template = build_template (dialog);
gl_wdgt_mini_preview_set_template (GL_WDGT_MINI_PREVIEW(dialog->priv->layout_mini_preview),
template);
- gl_template_free (template);
+ lgl_template_free (template);
dialog->priv->stop_signals = FALSE;
static void
layout_page_changed_cb (glTemplateDesigner *dialog)
{
- glTemplate *template;
+ lglTemplate *template;
if (dialog->priv->stop_signals) return;
dialog->priv->stop_signals = TRUE;
gl_wdgt_mini_preview_set_template (GL_WDGT_MINI_PREVIEW(dialog->priv->layout_mini_preview),
template);
- gl_template_free (template);
+ lgl_template_free (template);
dialog->priv->stop_signals = FALSE;
}
static void
print_test_cb (glTemplateDesigner *dialog)
{
- GObject *label;
- glTemplate *template;
- glPrintOp *print_op;
+ GObject *label;
+ lglTemplate *template;
+ glPrintOp *print_op;
label = gl_label_new ();
GTK_WINDOW (dialog),
NULL);
- gl_template_free (template);
+ lgl_template_free (template);
g_object_unref (G_OBJECT(label));
}
/*--------------------------------------------------------------------------*/
/* Build a template based on current assistant settings. */
/*--------------------------------------------------------------------------*/
-static glTemplate *
+static lglTemplate *
build_template (glTemplateDesigner *dialog)
{
gdouble upp;
gchar *brand, *part_num, *name, *desc;
gchar *page_size_name;
- glPaper *paper;
- glTemplateLabelShape shape;
- glTemplateLabelType *label_type=NULL;
+ lglPaper *paper;
+ lglTemplateFrameShape shape;
+ lglTemplateFrame *frame=NULL;
gdouble w=0, h=0, r=0, radius=0, hole=0, waste=0, x_waste=0, y_waste=0, margin=0;
gint nlayouts;
gdouble nx_1, ny_1, x0_1, y0_1, dx_1, dy_1;
gdouble nx_2, ny_2, x0_2, y0_2, dx_2, dy_2;
- glTemplate *template;
+ lglTemplate *template;
upp = dialog->priv->units_per_point;
page_size_name =
gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->pg_size_combo));
- paper = gl_paper_from_name (page_size_name);
+ paper = lgl_paper_from_name (page_size_name);
if ( g_strcasecmp (paper->id, "Other") == 0 ) {
paper->width =
gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin))
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_rect_radio))) {
- shape = GL_TEMPLATE_SHAPE_RECT;
+ shape = LGL_TEMPLATE_FRAME_SHAPE_RECT;
w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin));
h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin));
r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin));
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_round_radio))) {
- shape = GL_TEMPLATE_SHAPE_ROUND;
+ shape = LGL_TEMPLATE_FRAME_SHAPE_ROUND;
r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin));
waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin));
margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin));
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_cd_radio))) {
- shape = GL_TEMPLATE_SHAPE_CD;
+ shape = LGL_TEMPLATE_FRAME_SHAPE_CD;
radius = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin));
hole = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin));
w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_w_spin));
dy_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dy_spin));
- template = gl_template_new (name, desc, paper->id, paper->width, paper->height);
+ template = lgl_template_new (name, desc, paper->id, paper->width, paper->height);
switch (shape) {
- case GL_TEMPLATE_SHAPE_RECT:
- label_type =
- gl_template_rect_label_type_new ("0",
- w/upp, h/upp, r/upp,
- x_waste/upp, y_waste/upp);
+ case LGL_TEMPLATE_FRAME_SHAPE_RECT:
+ frame = lgl_template_frame_rect_new ("0",
+ w/upp, h/upp, r/upp,
+ x_waste/upp, y_waste/upp);
break;
- case GL_TEMPLATE_SHAPE_ROUND:
- label_type =
- gl_template_round_label_type_new ("0", r/upp, waste/upp);
+ case LGL_TEMPLATE_FRAME_SHAPE_ROUND:
+ frame = lgl_template_frame_round_new ("0", r/upp, waste/upp);
break;
- case GL_TEMPLATE_SHAPE_CD:
- label_type =
- gl_template_cd_label_type_new ("0",
- radius/upp, hole/upp,
- w/upp, h/upp,
- waste/upp);
+ case LGL_TEMPLATE_FRAME_SHAPE_CD:
+ frame = lgl_template_frame_cd_new ("0",
+ radius/upp, hole/upp,
+ w/upp, h/upp,
+ waste/upp);
break;
}
- gl_template_add_label_type (template, label_type);
+ lgl_template_add_frame (template, frame);
- gl_template_add_markup (label_type,
- gl_template_markup_margin_new (margin/upp));
+ lgl_template_add_markup (frame,
+ lgl_template_markup_margin_new (margin/upp));
- gl_template_add_layout (label_type,
- gl_template_layout_new (nx_1, ny_1,
+ lgl_template_add_layout (frame,
+ lgl_template_layout_new (nx_1, ny_1,
x0_1/upp,
y0_1/upp,
dx_1/upp,
dy_1/upp));
if (nlayouts > 1) {
- gl_template_add_layout (label_type,
- gl_template_layout_new (nx_2, ny_2,
+ lgl_template_add_layout (frame,
+ lgl_template_layout_new (nx_2, ny_2,
x0_2/upp,
y0_2/upp,
dx_2/upp,
g_free (desc);
g_free (page_size_name);
- gl_paper_free (paper);
+ lgl_paper_free (paper);
return template;
}
GObject *object;
glTextNode *text_node;
glColorNode *line_color_node;
- glViewObject *view_barcode;
gl_view_unselect_all (view);
GObject *object;
glColorNode *fill_color_node;
glColorNode *line_color_node;
- glViewObject *view_box;
gl_view_unselect_all (view);
GObject *object;
glColorNode *fill_color_node;
glColorNode *line_color_node;
- glViewObject *view_ellipse;
gl_view_unselect_all (view);
gdouble y)
{
GObject *object;
- glViewObject *view_image;
gl_view_unselect_all (view);
{
GObject *object;
glColorNode *line_color_node;
- glViewObject *view_line;
gl_view_unselect_all (view);
gdouble w, h;
gdouble x, y;
gdouble x0, y0;
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
gl_debug (DEBUG_VIEW, "START");
if (view->grid_visible)
{
- label_type = gl_template_get_first_label_type (view->label->template);
+ frame = lgl_template_get_first_frame (view->label->template);
gl_label_get_size (view->label, &w, &h);
- if (label_type->shape == GL_TEMPLATE_SHAPE_RECT) {
+ if (frame->shape == LGL_TEMPLATE_FRAME_SHAPE_RECT) {
x0 = 0.0;
y0 = 0.0;
} else {
cairo_t *cr)
{
glLabel *label;
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
GList *p;
- glTemplateMarkup *markup;
+ lglTemplateMarkup *markup;
g_return_if_fail (view && GL_IS_VIEW (view));
g_return_if_fail (view->label && GL_IS_LABEL (view->label));
{
label = view->label;
- label_type = gl_template_get_first_label_type (label->template);
+ frame = lgl_template_get_first_frame (label->template);
cairo_save (cr);
cairo_set_line_width (cr, MARKUP_LINE_WIDTH_PIXELS/(view->home_scale * view->zoom));
cairo_set_source_rgb (cr, MARKUP_RGB_ARGS);
- for ( p=label_type->markups; p != NULL; p=p->next )
+ for ( p=frame->all.markups; p != NULL; p=p->next )
{
- markup = (glTemplateMarkup *)p->data;
+ markup = (lglTemplateMarkup *)p->data;
gl_cairo_markup_path (cr, markup, label);
static void template_selection_changed_cb (GtkTreeSelection *selection,
gpointer user_data);
-static gchar *get_layout_desc (const glTemplate *template);
-static gchar *get_label_size_desc (const glTemplate *template);
+static gchar *get_layout_desc (const lglTemplate *template);
+static gchar *get_label_size_desc (const lglTemplate *template);
static void load_list (GtkListStore *store,
GtkTreeSelection *selection,
GList *list);
g_object_unref (gui);
page_size_id = gl_prefs_get_page_size ();
- page_size_name = gl_paper_lookup_name_from_id (page_size_id);
+ page_size_name = lgl_paper_lookup_name_from_id (page_size_id);
/* Page size selection control */
gl_util_combo_box_add_text_model (GTK_COMBO_BOX (media_select->priv->page_size_combo));
- page_sizes = gl_paper_get_name_list ();
+ page_sizes = lgl_paper_get_name_list ();
page_sizes = g_list_prepend (page_sizes, g_strdup (_("Any")));
gl_util_combo_box_set_strings (GTK_COMBO_BOX (media_select->priv->page_size_combo), page_sizes);
- gl_paper_free_name_list (page_sizes);
+ lgl_paper_free_name_list (page_sizes);
gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->page_size_combo),
page_size_name);
/* Category selection control */
gl_util_combo_box_add_text_model (GTK_COMBO_BOX (media_select->priv->category_combo));
- categories = gl_category_get_name_list ();
+ categories = lgl_category_get_name_list ();
categories = g_list_prepend (categories, g_strdup (_("Any")));
gl_util_combo_box_set_strings (GTK_COMBO_BOX (media_select->priv->category_combo), categories);
gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->category_combo),
_("Any"));
- gl_category_free_name_list (categories);
+ lgl_category_free_name_list (categories);
/* Actual selection control */
media_select->priv->template_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING);
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
gtk_tree_view_append_column (GTK_TREE_VIEW (media_select->priv->template_treeview), column);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->template_treeview));
- template_names = gl_template_get_name_list_all (page_size_id, NULL);
+ template_names = lgl_template_get_name_list_all (page_size_id, NULL);
load_list (media_select->priv->template_store, selection, template_names);
- gl_template_free_name_list (template_names);
+ lgl_template_free_name_list (template_names);
/* Connect signals to controls */
g_signal_connect (G_OBJECT (media_select->priv->page_size_combo), "changed",
{
gl_debug (DEBUG_MEDIA_SELECT, "page_size_name = \"%s\"", page_size_name);
gl_debug (DEBUG_MEDIA_SELECT, "category_name = \"%s\"", category_name);
- page_size_id = gl_paper_lookup_id_from_name (page_size_name);
- category_id = gl_category_lookup_id_from_name (category_name);
+ page_size_id = lgl_paper_lookup_id_from_name (page_size_name);
+ category_id = lgl_category_lookup_id_from_name (category_name);
gl_debug (DEBUG_MEDIA_SELECT, "page_size_id = \"%s\"", page_size_id);
gl_debug (DEBUG_MEDIA_SELECT, "category_id = \"%s\"", category_id);
- template_names = gl_template_get_name_list_all (page_size_id, category_id);
+ template_names = lgl_template_get_name_list_all (page_size_id, category_id);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->template_treeview));
load_list (media_select->priv->template_store, selection, template_names);
- gl_template_free_name_list (template_names);
+ lgl_template_free_name_list (template_names);
g_free (page_size_id);
/* Emit our "changed" signal */
page_size_name =
gtk_combo_box_get_active_text (GTK_COMBO_BOX (media_select->priv->page_size_combo));
- *page_size_id = gl_paper_lookup_id_from_name (page_size_name);
+ *page_size_id = lgl_paper_lookup_id_from_name (page_size_name);
category_name =
gtk_combo_box_get_active_text (GTK_COMBO_BOX (media_select->priv->category_combo));
- *category_id = gl_category_lookup_id_from_name (category_name);
+ *category_id = lgl_category_lookup_id_from_name (category_name);
g_free (page_size_name);
g_free (category_name);
gl_debug (DEBUG_MEDIA_SELECT, "START");
- page_size_name = gl_paper_lookup_name_from_id (page_size_id);
+ page_size_name = lgl_paper_lookup_name_from_id (page_size_id);
if (page_size_name == NULL)
{
page_size_name = g_strdup (_("Any"));
gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->page_size_combo),
page_size_name);
- category_name = gl_category_lookup_name_from_id (category_id);
+ category_name = lgl_category_lookup_name_from_id (category_id);
if (category_name == NULL)
{
category_name = g_strdup (_("Any"));
/* PRIVATE. Get a description of the layout and number of labels. */
/*--------------------------------------------------------------------------*/
static gchar *
-get_layout_desc (const glTemplate *template)
+get_layout_desc (const lglTemplate *template)
{
- const glTemplateLabelType *label_type;
- gint n_labels;
- gchar *string;
+ const lglTemplateFrame *frame;
+ gint n_labels;
+ gchar *string;
- label_type = gl_template_get_first_label_type (template);
+ frame = lgl_template_get_first_frame (template);
- n_labels = gl_template_get_n_labels (label_type);
+ n_labels = lgl_template_frame_get_n_labels (frame);
string = g_strdup_printf (_("%d per sheet"), n_labels);
/* PRIVATE. Get label size description. */
/*--------------------------------------------------------------------------*/
static gchar *
-get_label_size_desc (const glTemplate *template)
+get_label_size_desc (const lglTemplate *template)
{
- glUnitsType units;
+ lglUnitsType units;
const gchar *units_string;
gdouble units_per_point;
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
gchar *string = NULL;
units = gl_prefs_get_units ();
units_string = gl_prefs_get_units_string ();
units_per_point = gl_prefs_get_units_per_point ();
- label_type = gl_template_get_first_label_type (template);
+ frame = lgl_template_get_first_frame (template);
- switch (label_type->shape) {
- case GL_TEMPLATE_SHAPE_RECT:
- if ( units == GL_UNITS_INCH ) {
+ switch (frame->shape) {
+ case LGL_TEMPLATE_FRAME_SHAPE_RECT:
+ if ( units == LGL_UNITS_INCH ) {
gchar *xstr, *ystr;
- xstr = gl_util_fraction (label_type->size.rect.w*units_per_point);
- ystr = gl_util_fraction (label_type->size.rect.h*units_per_point);
+ xstr = gl_util_fraction (frame->rect.w*units_per_point);
+ ystr = gl_util_fraction (frame->rect.h*units_per_point);
string = g_strdup_printf (_("%s x %s %s"),
xstr, ystr, units_string);
g_free (xstr);
g_free (ystr);
} else {
string = g_strdup_printf (_("%.5g x %.5g %s"),
- label_type->size.rect.w*units_per_point,
- label_type->size.rect.h*units_per_point,
+ frame->rect.w*units_per_point,
+ frame->rect.h*units_per_point,
units_string);
}
break;
- case GL_TEMPLATE_SHAPE_ROUND:
- if ( units == GL_UNITS_INCH ) {
+ case LGL_TEMPLATE_FRAME_SHAPE_ROUND:
+ if ( units == LGL_UNITS_INCH ) {
gchar *dstr;
- dstr = gl_util_fraction (2.0*label_type->size.round.r*units_per_point);
+ dstr = gl_util_fraction (2.0*frame->round.r*units_per_point);
string = g_strdup_printf (_("%s %s diameter"),
dstr, units_string);
g_free (dstr);
} else {
string = g_strdup_printf (_("%.5g %s diameter"),
- 2.0*label_type->size.round.r*units_per_point,
+ 2.0*frame->round.r*units_per_point,
units_string);
}
break;
- case GL_TEMPLATE_SHAPE_CD:
- if ( units == GL_UNITS_INCH ) {
+ case LGL_TEMPLATE_FRAME_SHAPE_CD:
+ if ( units == LGL_UNITS_INCH ) {
gchar *dstr;
- dstr = gl_util_fraction (2.0*label_type->size.cd.r1*units_per_point);
+ dstr = gl_util_fraction (2.0*frame->cd.r1*units_per_point);
string = g_strdup_printf (_("%s %s diameter"),
dstr, units_string);
g_free (dstr);
} else {
string = g_strdup_printf (_("%.5g %s diameter"),
- 2.0*label_type->size.cd.r1*units_per_point,
+ 2.0*frame->cd.r1*units_per_point,
units_string);
}
break;
{
GList *p;
GtkTreeIter iter;
- glTemplate *template;
+ lglTemplate *template;
GdkPixbuf *pixbuf;
gchar *size;
gchar *layout;
gl_debug (DEBUG_MEDIA_SELECT, "p->data = \"%s\"", p->data);
- template = gl_template_from_name (p->data);
+ template = lgl_template_from_name (p->data);
pixbuf = gl_mini_preview_pixbuf_cache_get_pixbuf (template->name);
g_free (size);
g_free (layout);
- gl_template_free (template);
+ lgl_template_free (template);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
gint height;
gint width;
- glTemplate *template;
+ lglTemplate *template;
gdouble scale;
gdouble offset_x;
gdouble offset_y;
gdouble line_width);
static void draw_labels (glWdgtMiniPreview *preview,
cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gdouble line_width);
static gint find_closest_label (glWdgtMiniPreview *preview,
g_return_if_fail (object != NULL);
g_return_if_fail (GL_IS_WDGT_MINI_PREVIEW (object));
- gl_template_free (preview->priv->template);
+ lgl_template_free (preview->priv->template);
g_free (preview->priv->centers);
g_free (preview->priv);
void gl_wdgt_mini_preview_set_label_by_name (glWdgtMiniPreview *preview,
const gchar *name)
{
- glTemplate *template;
+ lglTemplate *template;
gl_debug (DEBUG_MINI_PREVIEW, "START");
/* Fetch template */
- template = gl_template_from_name (name);
+ template = lgl_template_from_name (name);
gl_wdgt_mini_preview_set_template (preview, template);
- gl_template_free (template);
+ lgl_template_free (template);
gl_debug (DEBUG_MINI_PREVIEW, "END");
}
/* Set label for mini-preview to determine geometry. */
/****************************************************************************/
void gl_wdgt_mini_preview_set_template (glWdgtMiniPreview *preview,
- const glTemplate *template)
+ const lglTemplate *template)
{
- const glTemplateLabelType *label_type;
- glTemplateOrigin *origins;
+ const lglTemplateFrame *frame;
+ lglTemplateOrigin *origins;
gdouble w, h;
gint i;
gl_debug (DEBUG_MINI_PREVIEW, "START");
- label_type = gl_template_get_first_label_type (template);
+ frame = lgl_template_get_first_frame (template);
/*
* Set template
*/
- gl_template_free (preview->priv->template);
- preview->priv->template = gl_template_dup (template);
+ lgl_template_free (preview->priv->template);
+ preview->priv->template = lgl_template_dup (template);
/*
* Set scale and offsets
/*
* Set labels per sheet
*/
- preview->priv->labels_per_sheet = gl_template_get_n_labels (label_type);
+ preview->priv->labels_per_sheet = lgl_template_frame_get_n_labels (frame);
/*
* Initialize centers
*/
g_free (preview->priv->centers);
preview->priv->centers = g_new0 (LabelCenter, preview->priv->labels_per_sheet);
- origins = gl_template_get_origins (label_type);
- gl_template_get_label_size (label_type, &w, &h);
+ origins = lgl_template_frame_get_origins (frame);
+ lgl_template_frame_get_size (frame, &w, &h);
for ( i=0; i<preview->priv->labels_per_sheet; i++ )
{
preview->priv->centers[i].x = origins[i].x + w/2.0;
draw (glWdgtMiniPreview *preview,
cairo_t *cr)
{
- glTemplate *template = preview->priv->template;
- gdouble shadow_x, shadow_y;
+ lglTemplate *template = preview->priv->template;
+ gdouble shadow_x, shadow_y;
gl_debug (DEBUG_MINI_PREVIEW, "START");
static void
draw_labels (glWdgtMiniPreview *preview,
cairo_t *cr,
- glTemplate *template,
+ lglTemplate *template,
gdouble line_width)
{
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
gint i, n_labels;
- glTemplateOrigin *origins;
+ lglTemplateOrigin *origins;
GtkStyle *style;
guint highlight_color;
gl_debug (DEBUG_MINI_PREVIEW, "START");
- label_type = gl_template_get_first_label_type (template);
+ frame = lgl_template_get_first_frame (template);
- n_labels = gl_template_get_n_labels (label_type);
- origins = gl_template_get_origins (label_type);
+ n_labels = lgl_template_frame_get_n_labels (frame);
+ origins = lgl_template_frame_get_origins (frame);
style = gtk_widget_get_style (GTK_WIDGET(preview));
highlight_color = gl_color_from_gdk_color (&style->base[GTK_STATE_SELECTED]);
const gchar *name);
void gl_wdgt_mini_preview_set_template (glWdgtMiniPreview *preview,
- const glTemplate *template);
+ const lglTemplate *template);
void gl_wdgt_mini_preview_highlight_range (glWdgtMiniPreview *preview,
gint first_label,
gl_wdgt_print_copies_construct (glWdgtPrintCopies *copies,
glLabel *label)
{
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
GtkWidget *whbox, *wvbox, *whbox1;
GSList *radio_group = NULL;
GtkObject *adjust;
whbox = GTK_WIDGET (copies);
- label_type = gl_template_get_first_label_type (label->template);
+ frame = lgl_template_get_first_frame (label->template);
- copies->labels_per_sheet = gl_template_get_n_labels (label_type);
+ copies->labels_per_sheet = lgl_template_frame_get_n_labels (frame);
/* mini_preview canvas */
copies->mini_preview = gl_wdgt_mini_preview_new (WDGT_MINI_PREVIEW_HEIGHT,
gl_wdgt_print_merge_construct (glWdgtPrintMerge * merge,
glLabel * label)
{
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
GtkWidget *whbox, *wvbox, *whbox1;
GtkObject *adjust;
GdkPixbuf *pixbuf;
whbox = GTK_WIDGET (merge);
- label_type = gl_template_get_first_label_type (label->template);
+ frame = lgl_template_get_first_frame (label->template);
- merge->labels_per_sheet = gl_template_get_n_labels (label_type);
+ merge->labels_per_sheet = lgl_template_frame_get_n_labels (frame);
/* mini_preview canvas */
merge->mini_preview = gl_wdgt_mini_preview_new (WDGT_MINI_PREVIEW_HEIGHT,
GtkWidget *rotate_check;
GtkWidget *rotate_drawingarea;
- glTemplate *template;
+ lglTemplate *template;
};
enum {
gpointer user_data);
static void drawingarea_update (GtkDrawingArea *drawing_area,
- glTemplate *template,
+ lglTemplate *template,
gboolean rotate_flag);
static gboolean expose_cb (GtkWidget *drawingarea,
g_return_if_fail (GL_IS_WDGT_ROTATE_LABEL (object));
if (rotate_label->priv->template) {
- gl_template_free (rotate_label->priv->template);
+ lgl_template_free (rotate_label->priv->template);
rotate_label->priv->template = NULL;
}
g_free (rotate_label->priv);
/*--------------------------------------------------------------------------*/
static void
drawingarea_update (GtkDrawingArea *drawing_area,
- glTemplate *template,
+ lglTemplate *template,
gboolean rotate_flag)
{
- const glTemplateLabelType *label_type;
+ const lglTemplateFrame *frame;
gdouble m, m_canvas, w, h, scale;
GtkStyle *style;
guint line_color, fill_color, shadow_color;
return;
}
- label_type = gl_template_get_first_label_type (template);
+ frame = lgl_template_get_first_frame (template);
if (rotate_flag)
{
- gl_template_get_label_size (label_type, &h, &w);
+ lgl_template_frame_get_size (frame, &h, &w);
}
else
{
- gl_template_get_label_size (label_type, &w, &h);
+ lgl_template_frame_get_size (frame, &w, &h);
}
m = MAX (w, h);
scale = MINI_PREVIEW_MAX_PIXELS / m;
gl_wdgt_rotate_label_set_template_name (glWdgtRotateLabel *rotate_label,
gchar *name)
{
- glTemplate *template;
- const glTemplateLabelType *label_type;
+ lglTemplate *template;
+ const lglTemplateFrame *frame;
gdouble raw_w, raw_h;
if (name == NULL)
}
else
{
- template = gl_template_from_name (name);
- label_type = gl_template_get_first_label_type (template);
+ template = lgl_template_from_name (name);
+ frame = lgl_template_get_first_frame (template);
rotate_label->priv->template = template;
- gl_template_get_label_size (label_type, &raw_w, &raw_h);
+ lgl_template_frame_get_size (frame, &raw_w, &raw_h);
gtk_widget_set_sensitive (rotate_label->priv->rotate_check,
(raw_w != raw_h));
label = GL_LABEL (gl_label_new ());
- rotate_flag = gl_xml_get_prop_boolean (root, "rotate", FALSE);
+ rotate_flag = lgl_xml_get_prop_boolean (root, "rotate", FALSE);
gl_label_set_rotate_flag (label, rotate_flag);
for (node = root->xmlChildrenNode; node != NULL; node = node->next) {
xml04_parse_media_description (xmlNodePtr node,
glLabel *label)
{
- xmlChar *template_name;
- glTemplate *template;
- gboolean ret;
+ xmlChar *template_name;
+ lglTemplate *template;
+ gboolean ret;
gl_debug (DEBUG_XML, "START");
template_name = xmlNodeGetContent (node);
- template = gl_template_from_name ((gchar *)template_name);
+ template = lgl_template_from_name ((gchar *)template_name);
if (template == NULL) {
g_message ("Undefined template \"%s\"", template_name);
/* Get a default */
- template = gl_template_from_name (NULL);
+ template = lgl_template_from_name (NULL);
ret = FALSE;
} else {
ret = TRUE;
gl_label_set_template (label, template);
- gl_template_free (template);
+ lgl_template_free (template);
xmlFree (template_name);
gl_debug (DEBUG_XML, "END");
gl_debug (DEBUG_XML, "START");
- x = gl_xml_get_prop_double (object_node, "x", 0);
- y = gl_xml_get_prop_double (object_node, "y", 0);
+ x = lgl_xml_get_prop_double (object_node, "x", 0);
+ y = lgl_xml_get_prop_double (object_node, "y", 0);
gl_label_object_set_position (object, x, y);
gl_debug (DEBUG_XML, "START");
font_family = xmlGetProp (object_node, (xmlChar *)"font_family");
- font_size = gl_xml_get_prop_double (object_node, "font_size", 0);
+ font_size = lgl_xml_get_prop_double (object_node, "font_size", 0);
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);
+ font_italic_flag = lgl_xml_get_prop_boolean (object_node, "font_italic", FALSE);
string = xmlGetProp (object_node, (xmlChar *)"justify");
align = gl_util_string_to_align ((gchar *)string);
xmlFree (string);
color_node = gl_color_node_new_default ();
- color_node->color = gl_xml_get_prop_uint (object_node, "color", 0);
+ color_node->color = lgl_xml_get_prop_uint (object_node, "color", 0);
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_debug (DEBUG_XML, "START");
- w = gl_xml_get_prop_double (node, "w", 0);
- h = gl_xml_get_prop_double (node, "h", 0);
+ w = lgl_xml_get_prop_double (node, "w", 0);
+ h = lgl_xml_get_prop_double (node, "h", 0);
- line_width = gl_xml_get_prop_double (node, "line_width", 0);
+ line_width = lgl_xml_get_prop_double (node, "line_width", 0);
line_color_node = gl_color_node_new_default ();
- line_color_node->color = gl_xml_get_prop_uint (node, "line_color", 0);
+ line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0);
fill_color_node = gl_color_node_new_default ();
- fill_color_node->color = gl_xml_get_prop_uint (node, "fill_color", 0);
+ fill_color_node->color = lgl_xml_get_prop_uint (node, "fill_color", 0);
gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
gl_debug (DEBUG_XML, "START");
- w = gl_xml_get_prop_double (node, "dx", 0);
- h = gl_xml_get_prop_double (node, "dy", 0);
+ w = lgl_xml_get_prop_double (node, "dx", 0);
+ h = lgl_xml_get_prop_double (node, "dy", 0);
- line_width = gl_xml_get_prop_double (node, "line_width", 0);
+ line_width = lgl_xml_get_prop_double (node, "line_width", 0);
line_color_node = gl_color_node_new_default ();
- line_color_node->color = gl_xml_get_prop_uint (node, "line_color", 0);
+ line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0);
gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
gl_debug (DEBUG_XML, "START");
- w = gl_xml_get_prop_double (node, "w", 0);
- h = gl_xml_get_prop_double (node, "h", 0);
+ w = lgl_xml_get_prop_double (node, "w", 0);
+ h = lgl_xml_get_prop_double (node, "h", 0);
- line_width = gl_xml_get_prop_double (node, "line_width", 0);
+ line_width = lgl_xml_get_prop_double (node, "line_width", 0);
line_color_node = gl_color_node_new_default ();
- line_color_node->color = gl_xml_get_prop_uint (node, "line_color", 0);
+ line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0);
fill_color_node = gl_color_node_new_default ();
- fill_color_node->color = gl_xml_get_prop_uint (node, "fill_color", 0);
+ fill_color_node->color = lgl_xml_get_prop_uint (node, "fill_color", 0);
gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
gl_label_image_set_filename (object, filename);
gl_text_node_free (&filename);
- w = gl_xml_get_prop_double (node, "w", 0);
- h = gl_xml_get_prop_double (node, "h", 0);
+ w = lgl_xml_get_prop_double (node, "w", 0);
+ h = lgl_xml_get_prop_double (node, "h", 0);
gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
gl_debug (DEBUG_XML, "END");
gl_debug (DEBUG_XML, "START");
color_node = gl_color_node_new_default ();
- color_node->color = gl_xml_get_prop_uint (node, "color", 0);
+ color_node->color = lgl_xml_get_prop_uint (node, "color", 0);
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);
+ text_flag = lgl_xml_get_prop_boolean (node, "text", FALSE);
+ scale = lgl_xml_get_prop_double (node, "scale", 1.0);
if (scale == 0.0) {
scale = 0.5; /* Set to a valid value */
}
return NULL;
}
- ns = xmlSearchNsByHref (doc, root, (xmlChar *)GL_XML_NAME_SPACE);
+ ns = xmlSearchNsByHref (doc, root, (xmlChar *)LGL_XML_NAME_SPACE);
if (ns != NULL) {
label = xml_parse_label (root, status);
if (label)
xml_parse_label (xmlNodePtr root,
glXMLLabelStatus *status)
{
- xmlNodePtr child_node;
- glLabel *label;
- glTemplate *template;
+ xmlNodePtr child_node;
+ glLabel *label;
+ lglTemplate *template;
gl_debug (DEBUG_XML, "START");
*status = XML_LABEL_OK;
- if (!gl_xml_is_node (root, "Glabels-document")) {
+ if (!lgl_xml_is_node (root, "Glabels-document")) {
g_message (_("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 (gl_xml_is_node (child_node, "Data")) {
+ if (lgl_xml_is_node (child_node, "Data")) {
xml_parse_data (child_node, label);
}
}
child_node != NULL;
child_node = child_node->next) {
- if (gl_xml_is_node (child_node, "Template")) {
- template = gl_xml_template_parse_template_node (child_node);
+ if (lgl_xml_is_node (child_node, "Template")) {
+ template = lgl_xml_template_parse_template_node (child_node);
if (!template) {
g_object_unref (label);
*status = XML_LABEL_UNKNOWN_MEDIA;
return NULL;
}
- gl_template_register (template);
+ lgl_template_register (template);
gl_label_set_template (label, template);
- gl_template_free (template);
- } else if (gl_xml_is_node (child_node, "Objects")) {
+ lgl_template_free (template);
+ } else if (lgl_xml_is_node (child_node, "Objects")) {
xml_parse_objects (child_node, label);
- } else if (gl_xml_is_node (child_node, "Merge")) {
+ } else if (lgl_xml_is_node (child_node, "Merge")) {
xml_parse_merge_fields (child_node, label);
- } else if (gl_xml_is_node (child_node, "Data")) {
+ } else if (lgl_xml_is_node (child_node, "Data")) {
/* Handled in pass 1. */
} else {
if (!xmlNodeIsText (child_node)) {
gl_debug (DEBUG_XML, "START");
- rotate_flag = gl_xml_get_prop_boolean (node, "rotate", FALSE);
+ rotate_flag = lgl_xml_get_prop_boolean (node, "rotate", FALSE);
gl_label_set_rotate_flag (label, rotate_flag);
for (child = node->xmlChildrenNode; child != NULL; child = child->next) {
- if (gl_xml_is_node (child, "Object-text")) {
+ if (lgl_xml_is_node (child, "Object-text")) {
xml_parse_object_text (child, label);
- } else if (gl_xml_is_node (child, "Object-box")) {
+ } else if (lgl_xml_is_node (child, "Object-box")) {
xml_parse_object_box (child, label);
- } else if (gl_xml_is_node (child, "Object-ellipse")) {
+ } else if (lgl_xml_is_node (child, "Object-ellipse")) {
xml_parse_object_ellipse (child, label);
- } else if (gl_xml_is_node (child, "Object-line")) {
+ } else if (lgl_xml_is_node (child, "Object-line")) {
xml_parse_object_line (child, label);
- } else if (gl_xml_is_node (child, "Object-image")) {
+ } else if (lgl_xml_is_node (child, "Object-image")) {
xml_parse_object_image (child, label);
- } else if (gl_xml_is_node (child, "Object-barcode")) {
+ } else if (lgl_xml_is_node (child, "Object-barcode")) {
xml_parse_object_barcode (child, label);
} else {
if (!xmlNodeIsText (child)) {
object = gl_label_text_new (label);
/* position attrs */
- x = gl_xml_get_prop_length (node, "x", 0.0);
- y = gl_xml_get_prop_length (node, "y", 0.0);
+ x = lgl_xml_get_prop_length (node, "x", 0.0);
+ y = lgl_xml_get_prop_length (node, "y", 0.0);
gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y);
/* implied size attrs */
- w = gl_xml_get_prop_length (node, "w", 0);
- h = gl_xml_get_prop_length (node, "h", 0);
+ w = lgl_xml_get_prop_length (node, "w", 0);
+ h = lgl_xml_get_prop_length (node, "h", 0);
gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
/* justify attr */
- string = gl_xml_get_prop_string (node, "justify", NULL);
+ string = lgl_xml_get_prop_string (node, "justify", NULL);
align = gl_util_string_to_align (string);
g_free (string);
gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object), align);
/* auto_shrink attr */
- auto_shrink = gl_xml_get_prop_boolean (node, "auto_shrink", FALSE);
+ auto_shrink = lgl_xml_get_prop_boolean (node, "auto_shrink", FALSE);
gl_label_text_set_auto_shrink (GL_LABEL_TEXT(object), auto_shrink);
/* affine attrs */
/* Process children */
for (child = node->xmlChildrenNode; child != NULL; child = child->next) {
- if (gl_xml_is_node (child, "Span")) {
+ if (lgl_xml_is_node (child, "Span")) {
xml_parse_toplevel_span (child, GL_LABEL_OBJECT(object));
break;
} else {
object = gl_label_box_new (label);
/* position attrs */
- x = gl_xml_get_prop_length (node, "x", 0.0);
- y = gl_xml_get_prop_length (node, "y", 0.0);
+ x = lgl_xml_get_prop_length (node, "x", 0.0);
+ y = lgl_xml_get_prop_length (node, "y", 0.0);
gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y);
/* size attrs */
- w = gl_xml_get_prop_length (node, "w", 0);
- h = gl_xml_get_prop_length (node, "h", 0);
+ w = lgl_xml_get_prop_length (node, "w", 0);
+ h = lgl_xml_get_prop_length (node, "h", 0);
gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
/* line attrs */
- line_width = gl_xml_get_prop_length (node, "line_width", 1.0);
+ line_width = lgl_xml_get_prop_length (node, "line_width", 1.0);
gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
line_color_node = gl_color_node_new_default ();
- string = gl_xml_get_prop_string (node, "line_color_field", NULL);
+ string = lgl_xml_get_prop_string (node, "line_color_field", NULL);
if ( string ) {
line_color_node->field_flag = TRUE;
line_color_node->key = string;
} else {
- line_color_node->color = gl_xml_get_prop_uint (node, "line_color", 0);
+ line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0);
}
gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node);
gl_color_node_free (&line_color_node);
/* fill attrs */
fill_color_node = gl_color_node_new_default ();
- string = gl_xml_get_prop_string (node, "fill_color_field", NULL);
+ string = lgl_xml_get_prop_string (node, "fill_color_field", NULL);
if ( string ) {
fill_color_node->field_flag = TRUE;
fill_color_node->key = string;
} else {
- fill_color_node->color = gl_xml_get_prop_uint (node, "fill_color", 0);
+ fill_color_node->color = lgl_xml_get_prop_uint (node, "fill_color", 0);
}
gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color_node);
gl_color_node_free (&fill_color_node);
object = gl_label_ellipse_new (label);
/* position attrs */
- x = gl_xml_get_prop_length (node, "x", 0.0);
- y = gl_xml_get_prop_length (node, "y", 0.0);
+ x = lgl_xml_get_prop_length (node, "x", 0.0);
+ y = lgl_xml_get_prop_length (node, "y", 0.0);
gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y);
/* size attrs */
- w = gl_xml_get_prop_length (node, "w", 0);
- h = gl_xml_get_prop_length (node, "h", 0);
+ w = lgl_xml_get_prop_length (node, "w", 0);
+ h = lgl_xml_get_prop_length (node, "h", 0);
gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
/* line attrs */
- line_width = gl_xml_get_prop_length (node, "line_width", 1.0);
+ line_width = lgl_xml_get_prop_length (node, "line_width", 1.0);
gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
line_color_node = gl_color_node_new_default ();
- string = gl_xml_get_prop_string (node, "line_color_field", NULL);
+ string = lgl_xml_get_prop_string (node, "line_color_field", NULL);
if ( string ) {
line_color_node->field_flag = TRUE;
line_color_node->key = string;
} else {
- line_color_node->color = gl_xml_get_prop_uint (node, "line_color", 0);
+ line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0);
}
gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node);
gl_color_node_free (&line_color_node);
/* fill attrs */
fill_color_node = gl_color_node_new_default ();
- string = gl_xml_get_prop_string (node, "fill_color_field", NULL);
+ string = lgl_xml_get_prop_string (node, "fill_color_field", NULL);
if ( string ) {
fill_color_node->field_flag = TRUE;
fill_color_node->key = string;
} else {
- fill_color_node->color = gl_xml_get_prop_uint (node, "fill_color", 0);
+ fill_color_node->color = lgl_xml_get_prop_uint (node, "fill_color", 0);
}
gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color_node);
gl_color_node_free (&fill_color_node);
object = gl_label_line_new (label);
/* position attrs */
- x = gl_xml_get_prop_length (node, "x", 0.0);
- y = gl_xml_get_prop_length (node, "y", 0.0);
+ x = lgl_xml_get_prop_length (node, "x", 0.0);
+ y = lgl_xml_get_prop_length (node, "y", 0.0);
gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y);
/* length attrs */
- dx = gl_xml_get_prop_length (node, "dx", 0);
- dy = gl_xml_get_prop_length (node, "dy", 0);
+ dx = lgl_xml_get_prop_length (node, "dx", 0);
+ dy = lgl_xml_get_prop_length (node, "dy", 0);
gl_label_object_set_size (GL_LABEL_OBJECT(object), dx, dy);
/* line attrs */
- line_width = gl_xml_get_prop_length (node, "line_width", 1.0);
+ line_width = lgl_xml_get_prop_length (node, "line_width", 1.0);
gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
line_color_node = gl_color_node_new_default ();
- string = gl_xml_get_prop_string (node, "line_color_field", NULL);
+ string = lgl_xml_get_prop_string (node, "line_color_field", NULL);
if ( string ) {
line_color_node->field_flag = TRUE;
line_color_node->key = string;
} else {
- line_color_node->color = gl_xml_get_prop_uint (node, "line_color", 0);
+ line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0);
}
gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node);
gl_color_node_free (&line_color_node);
object = gl_label_image_new (label);
/* position attrs */
- x = gl_xml_get_prop_length (node, "x", 0.0);
- y = gl_xml_get_prop_length (node, "y", 0.0);
+ x = lgl_xml_get_prop_length (node, "x", 0.0);
+ y = lgl_xml_get_prop_length (node, "y", 0.0);
gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y);
/* src or field attr */
- string = gl_xml_get_prop_string (node, "src", NULL);
+ string = lgl_xml_get_prop_string (node, "src", NULL);
if ( string ) {
filename = g_new0 (glTextNode, 1);
filename->field_flag = FALSE;
gl_text_node_free (&filename);
xmlFree (string);
} else {
- string = gl_xml_get_prop_string (node, "field", NULL);
+ string = lgl_xml_get_prop_string (node, "field", NULL);
if ( string ) {
filename = g_new0 (glTextNode, 1);
filename->field_flag = TRUE;
}
/* size attrs */
- w = gl_xml_get_prop_length (node, "w", 0);
- h = gl_xml_get_prop_length (node, "h", 0);
+ w = lgl_xml_get_prop_length (node, "w", 0);
+ h = lgl_xml_get_prop_length (node, "h", 0);
gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
/* affine attrs */
object = gl_label_barcode_new (label);
/* position attrs */
- x = gl_xml_get_prop_length (node, "x", 0.0);
- y = gl_xml_get_prop_length (node, "y", 0.0);
+ x = lgl_xml_get_prop_length (node, "x", 0.0);
+ y = lgl_xml_get_prop_length (node, "y", 0.0);
gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y);
/* size attrs */
- w = gl_xml_get_prop_length (node, "w", 0);
- h = gl_xml_get_prop_length (node, "h", 0);
+ w = lgl_xml_get_prop_length (node, "w", 0);
+ h = lgl_xml_get_prop_length (node, "h", 0);
gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
/* prop attrs */
- id = gl_xml_get_prop_string (node, "style", NULL);
- 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);
+ id = lgl_xml_get_prop_string (node, "style", NULL);
+ text_flag = lgl_xml_get_prop_boolean (node, "text", FALSE);
+ checksum_flag = lgl_xml_get_prop_boolean (node, "checksum", TRUE);
+ format_digits = lgl_xml_get_prop_uint (node, "format", 10);
gl_label_barcode_set_props (GL_LABEL_BARCODE(object),
(gchar *)id, text_flag, checksum_flag, format_digits);
g_free (id);
color_node = gl_color_node_new_default ();
- string = gl_xml_get_prop_string (node, "color_field", NULL);
+ string = lgl_xml_get_prop_string (node, "color_field", NULL);
if ( string ) {
color_node->field_flag = TRUE;
color_node->key = string;
} else {
- color_node->color = gl_xml_get_prop_uint (node, "color", 0);
+ color_node->color = lgl_xml_get_prop_uint (node, "color", 0);
}
gl_label_object_set_line_color (GL_LABEL_OBJECT(object), color_node);
gl_color_node_free (&color_node);
/* data or field attr */
- string = gl_xml_get_prop_string (node, "data", NULL);
+ string = lgl_xml_get_prop_string (node, "data", NULL);
if ( string ) {
text_node = g_new0 (glTextNode, 1);
text_node->field_flag = FALSE;
gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node);
gl_text_node_free (&text_node);
} else {
- string = gl_xml_get_prop_string (node, "field", NULL);
+ string = lgl_xml_get_prop_string (node, "field", NULL);
if ( string ) {
text_node = g_new0 (glTextNode, 1);
text_node->field_flag = TRUE;
gl_debug (DEBUG_XML, "START");
- string = gl_xml_get_prop_string (node, "type", NULL);
+ string = lgl_xml_get_prop_string (node, "type", NULL);
merge = gl_merge_new (string);
g_free (string);
- string = gl_xml_get_prop_string (node, "src", NULL);
+ string = lgl_xml_get_prop_string (node, "src", NULL);
gl_merge_set_src (merge, string);
g_free (string);
for (child = node->xmlChildrenNode; child != NULL; child = child->next) {
- if (gl_xml_is_node (child, "Pixdata")) {
+ if (lgl_xml_is_node (child, "Pixdata")) {
xml_parse_pixdata (child, label);
} else {
if (!xmlNodeIsText (child)) {
gl_debug (DEBUG_XML, "START");
- name = gl_xml_get_prop_string (node, "name", NULL);
- base64 = gl_xml_get_node_content (node);
+ name = lgl_xml_get_prop_string (node, "name", NULL);
+ base64 = lgl_xml_get_node_content (node);
stream = gl_base64_decode ((gchar *)base64, &stream_length);
pixdata = g_new0 (GdkPixdata, 1);
gl_debug (DEBUG_XML, "START");
/* Font family attr */
- font_family = gl_xml_get_prop_string (node, "font_family", "Sans");
+ font_family = lgl_xml_get_prop_string (node, "font_family", "Sans");
gl_label_object_set_font_family (object, font_family);
g_free (font_family);
/* Font size attr */
- font_size = gl_xml_get_prop_double (node, "font_size", 0.0);
+ font_size = lgl_xml_get_prop_double (node, "font_size", 0.0);
gl_label_object_set_font_size (object, font_size);
/* Font weight attr */
- string = gl_xml_get_prop_string (node, "font_weight", NULL);
+ string = lgl_xml_get_prop_string (node, "font_weight", NULL);
font_weight = gl_util_string_to_weight (string);
g_free (string);
gl_label_object_set_font_weight (object, font_weight);
/* Font italic flag attr */
- font_italic_flag = gl_xml_get_prop_boolean (node, "font_italic", FALSE);
+ font_italic_flag = lgl_xml_get_prop_boolean (node, "font_italic", FALSE);
gl_label_object_set_font_italic_flag (object, font_italic_flag);
/* Text color attr */
color_node = gl_color_node_new_default ();
- string = gl_xml_get_prop_string (node, "color_field", NULL);
+ string = lgl_xml_get_prop_string (node, "color_field", NULL);
if ( string ) {
color_node->field_flag = TRUE;
color_node->key = string;
} else {
- color_node->color = gl_xml_get_prop_uint (node, "color", 0);
+ color_node->color = lgl_xml_get_prop_uint (node, "color", 0);
}
gl_label_object_set_text_color (object, color_node);
gl_color_node_free (&color_node);
/* Text line spacing attr */
- text_line_spacing = gl_xml_get_prop_double (node, "line_spacing", 1.0);
+ text_line_spacing = lgl_xml_get_prop_double (node, "line_spacing", 1.0);
gl_label_object_set_text_line_spacing (object, text_line_spacing);
/* Now descend children, and build lines of text nodes */
for (child = node->xmlChildrenNode; child != NULL; child = child->next) {
if (xmlNodeIsText (child)) {
- gchar *data = gl_xml_get_node_content (child);
+ gchar *data = lgl_xml_get_node_content (child);
/* Hack: if the first char is LF, it's an xml formatting string */
if (data[0] != '\n') {
}
g_free (data);
- } else if (gl_xml_is_node (child, "Span")) {
+ } else if (lgl_xml_is_node (child, "Span")) {
g_message ("Unexpected rich text (not supported, yet!)");
- } else if (gl_xml_is_node (child, "Field")) {
+ } else if (lgl_xml_is_node (child, "Field")) {
/* Field node */
- string = gl_xml_get_prop_string (child, "name", NULL);
+ string = lgl_xml_get_prop_string (child, "name", NULL);
text_node = g_new0 (glTextNode, 1);
text_node->field_flag = TRUE;
text_node->data = string;
text_nodes = g_list_append (text_nodes, text_node);
- } else if (gl_xml_is_node (child, "NL")) {
+ } else if (lgl_xml_is_node (child, "NL")) {
/* Store line. */
lines = g_list_append (lines, text_nodes);
gdouble a[6];
cairo_matrix_t matrix;
- a[0] = gl_xml_get_prop_double (node, "a0", 0.0);
- a[1] = gl_xml_get_prop_double (node, "a1", 0.0);
- a[2] = gl_xml_get_prop_double (node, "a2", 0.0);
- a[3] = gl_xml_get_prop_double (node, "a3", 0.0);
- a[4] = gl_xml_get_prop_double (node, "a4", 0.0);
- a[5] = gl_xml_get_prop_double (node, "a5", 0.0);
+ a[0] = lgl_xml_get_prop_double (node, "a0", 0.0);
+ a[1] = lgl_xml_get_prop_double (node, "a1", 0.0);
+ a[2] = lgl_xml_get_prop_double (node, "a2", 0.0);
+ a[3] = lgl_xml_get_prop_double (node, "a3", 0.0);
+ a[4] = lgl_xml_get_prop_double (node, "a4", 0.0);
+ a[5] = lgl_xml_get_prop_double (node, "a5", 0.0);
cairo_matrix_init (&matrix, a[0], a[1], a[2], a[3], a[4], a[5]);
gdouble shadow_opacity;
gchar *string;
- shadow_state = gl_xml_get_prop_boolean (node, "shadow", FALSE);
+ shadow_state = lgl_xml_get_prop_boolean (node, "shadow", FALSE);
gl_label_object_set_shadow_state (object, shadow_state);
if (shadow_state)
{
- shadow_x = gl_xml_get_prop_length (node, "shadow_x", 0.0);
- shadow_y = gl_xml_get_prop_length (node, "shadow_y", 0.0);
+ shadow_x = lgl_xml_get_prop_length (node, "shadow_x", 0.0);
+ shadow_y = lgl_xml_get_prop_length (node, "shadow_y", 0.0);
gl_label_object_set_shadow_offset (object, shadow_x, shadow_y);
shadow_color_node = gl_color_node_new_default ();
- string = gl_xml_get_prop_string (node, "shadow_color_field", NULL);
+ string = lgl_xml_get_prop_string (node, "shadow_color_field", NULL);
if ( string ) {
shadow_color_node->field_flag = TRUE;
shadow_color_node->key = string;
} else {
- shadow_color_node->color = gl_xml_get_prop_uint (node, "shadow_color", 0);
+ shadow_color_node->color = lgl_xml_get_prop_uint (node, "shadow_color", 0);
}
gl_label_object_set_shadow_color (object, shadow_color_node);
gl_color_node_free (&shadow_color_node);
- shadow_opacity = gl_xml_get_prop_double (node, "shadow_opacity", 1.0);
+ shadow_opacity = lgl_xml_get_prop_double (node, "shadow_opacity", 1.0);
gl_label_object_set_shadow_opacity (object, shadow_opacity);
}
}
doc = xmlNewDoc ((xmlChar *)"1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (xmlChar *)"Glabels-document", NULL);
- ns = xmlNewNs (doc->xmlRootNode, (xmlChar *)GL_XML_NAME_SPACE, NULL);
+ ns = xmlNewNs (doc->xmlRootNode, (xmlChar *)LGL_XML_NAME_SPACE, NULL);
xmlSetNs (doc->xmlRootNode, ns);
- gl_xml_template_create_template_node (label->template, doc->xmlRootNode, ns);
+ lgl_xml_template_create_template_node (label->template, doc->xmlRootNode, ns);
xml_create_objects (doc->xmlRootNode, ns, label);
gl_debug (DEBUG_XML, "START");
node = xmlNewChild (root, ns, (xmlChar *)"Objects", NULL);
- gl_xml_set_prop_string (node, "id", "0");
- gl_xml_set_prop_boolean (node, "rotate", label->rotate_flag);
+ lgl_xml_set_prop_string (node, "id", "0");
+ lgl_xml_set_prop_boolean (node, "rotate", label->rotate_flag);
for (p = label->objects; p != NULL; p = p->next) {
/* position attrs */
gl_label_object_get_position (object, &x, &y);
- gl_xml_set_prop_length (node, "x", x);
- gl_xml_set_prop_length (node, "y", y);
+ lgl_xml_set_prop_length (node, "x", x);
+ lgl_xml_set_prop_length (node, "y", y);
/* size attrs */
gl_label_object_get_raw_size ( object, &w, &h);
- gl_xml_set_prop_length (node, "w", w);
- gl_xml_set_prop_length (node, "h", h);
+ lgl_xml_set_prop_length (node, "w", w);
+ lgl_xml_set_prop_length (node, "h", h);
/* justify attr */
align = gl_label_object_get_text_alignment (object);
- gl_xml_set_prop_string (node, "justify", gl_util_align_to_string (align));
+ lgl_xml_set_prop_string (node, "justify", gl_util_align_to_string (align));
/* auto_shrink attr */
auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object));
- gl_xml_set_prop_boolean (node, "auto_shrink", auto_shrink);
+ lgl_xml_set_prop_boolean (node, "auto_shrink", auto_shrink);
/* affine attrs */
xml_create_affine_attrs (node, object);
/* position attrs */
gl_label_object_get_position (object, &x, &y);
- gl_xml_set_prop_length (node, "x", x);
- gl_xml_set_prop_length (node, "y", y);
+ lgl_xml_set_prop_length (node, "x", x);
+ lgl_xml_set_prop_length (node, "y", y);
/* size attrs */
gl_label_object_get_size (object, &w, &h);
- gl_xml_set_prop_length (node, "w", w);
- gl_xml_set_prop_length (node, "h", h);
+ lgl_xml_set_prop_length (node, "w", w);
+ lgl_xml_set_prop_length (node, "h", h);
/* line attrs */
line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
- gl_xml_set_prop_length (node, "line_width", line_width);
+ lgl_xml_set_prop_length (node, "line_width", line_width);
line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
if (line_color_node->field_flag)
{
- gl_xml_set_prop_string (node, "line_color_field", line_color_node->key);
+ lgl_xml_set_prop_string (node, "line_color_field", line_color_node->key);
}
else
{
- gl_xml_set_prop_uint_hex (node, "line_color", line_color_node->color);
+ lgl_xml_set_prop_uint_hex (node, "line_color", line_color_node->color);
}
gl_color_node_free (&line_color_node);
fill_color_node = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object));
if (fill_color_node->field_flag)
{
- gl_xml_set_prop_string (node, "fill_color_field", fill_color_node->key);
+ lgl_xml_set_prop_string (node, "fill_color_field", fill_color_node->key);
}
else
{
- gl_xml_set_prop_uint_hex (node, "fill_color", fill_color_node->color);
+ lgl_xml_set_prop_uint_hex (node, "fill_color", fill_color_node->color);
}
gl_color_node_free (&fill_color_node);
/* position attrs */
gl_label_object_get_position (object, &x, &y);
- gl_xml_set_prop_length (node, "x", x);
- gl_xml_set_prop_length (node, "y", y);
+ lgl_xml_set_prop_length (node, "x", x);
+ lgl_xml_set_prop_length (node, "y", y);
/* size attrs */
gl_label_object_get_size (object, &w, &h);
- gl_xml_set_prop_length (node, "w", w);
- gl_xml_set_prop_length (node, "h", h);
+ lgl_xml_set_prop_length (node, "w", w);
+ lgl_xml_set_prop_length (node, "h", h);
/* line attrs */
line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
- gl_xml_set_prop_length (node, "line_width", line_width);
+ lgl_xml_set_prop_length (node, "line_width", line_width);
line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
if (line_color_node->field_flag)
{
- gl_xml_set_prop_string (node, "line_color_field", line_color_node->key);
+ lgl_xml_set_prop_string (node, "line_color_field", line_color_node->key);
}
else
{
- gl_xml_set_prop_uint_hex (node, "line_color", line_color_node->color);
+ lgl_xml_set_prop_uint_hex (node, "line_color", line_color_node->color);
}
gl_color_node_free (&line_color_node);
fill_color_node = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object));
if (fill_color_node->field_flag)
{
- gl_xml_set_prop_string (node, "fill_color_field", fill_color_node->key);
+ lgl_xml_set_prop_string (node, "fill_color_field", fill_color_node->key);
}
else
{
- gl_xml_set_prop_uint_hex (node, "fill_color", fill_color_node->color);
+ lgl_xml_set_prop_uint_hex (node, "fill_color", fill_color_node->color);
}
gl_color_node_free (&fill_color_node);
/* position attrs */
gl_label_object_get_position (object, &x, &y);
- gl_xml_set_prop_length (node, "x", x);
- gl_xml_set_prop_length (node, "y", y);
+ lgl_xml_set_prop_length (node, "x", x);
+ lgl_xml_set_prop_length (node, "y", y);
/* length attrs */
gl_label_object_get_size (object, &dx, &dy);
- gl_xml_set_prop_length (node, "dx", dx);
- gl_xml_set_prop_length (node, "dy", dy);
+ lgl_xml_set_prop_length (node, "dx", dx);
+ lgl_xml_set_prop_length (node, "dy", dy);
/* line attrs */
line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
- gl_xml_set_prop_length (node, "line_width", line_width);
+ lgl_xml_set_prop_length (node, "line_width", line_width);
line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
if (line_color_node->field_flag)
{
- gl_xml_set_prop_string (node, "line_color_field", line_color_node->key);
+ lgl_xml_set_prop_string (node, "line_color_field", line_color_node->key);
}
else
{
- gl_xml_set_prop_uint_hex (node, "line_color", line_color_node->color);
+ lgl_xml_set_prop_uint_hex (node, "line_color", line_color_node->color);
}
gl_color_node_free (&line_color_node);
/* position attrs */
gl_label_object_get_position (object, &x, &y);
- gl_xml_set_prop_length (node, "x", x);
- gl_xml_set_prop_length (node, "y", y);
+ lgl_xml_set_prop_length (node, "x", x);
+ lgl_xml_set_prop_length (node, "y", y);
/* size attrs */
gl_label_object_get_size (object, &w, &h);
- gl_xml_set_prop_length (node, "w", w);
- gl_xml_set_prop_length (node, "h", h);
+ lgl_xml_set_prop_length (node, "w", w);
+ lgl_xml_set_prop_length (node, "h", h);
/* src OR field attr */
filename = gl_label_image_get_filename (GL_LABEL_IMAGE(object));
if (filename->field_flag) {
- gl_xml_set_prop_string (node, "field", filename->data);
+ lgl_xml_set_prop_string (node, "field", filename->data);
} else {
- gl_xml_set_prop_string (node, "src", filename->data);
+ lgl_xml_set_prop_string (node, "src", filename->data);
}
gl_text_node_free (&filename);
/* position attrs */
gl_label_object_get_position (object, &x, &y);
- gl_xml_set_prop_length (node, "x", x);
- gl_xml_set_prop_length (node, "y", y);
+ lgl_xml_set_prop_length (node, "x", x);
+ lgl_xml_set_prop_length (node, "y", y);
/* size attrs */
gl_label_object_get_raw_size (object, &w, &h);
- gl_xml_set_prop_length (node, "w", w);
- gl_xml_set_prop_length (node, "h", h);
+ lgl_xml_set_prop_length (node, "w", w);
+ lgl_xml_set_prop_length (node, "h", h);
/* Barcode properties attrs */
gl_label_barcode_get_props (GL_LABEL_BARCODE(object),
&id, &text_flag, &checksum_flag, &format_digits);
- gl_xml_set_prop_string (node, "style", id);
- gl_xml_set_prop_boolean (node, "text", text_flag);
- gl_xml_set_prop_boolean (node, "checksum", checksum_flag);
+ lgl_xml_set_prop_string (node, "style", id);
+ lgl_xml_set_prop_boolean (node, "text", text_flag);
+ lgl_xml_set_prop_boolean (node, "checksum", checksum_flag);
g_free (id);
color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
if (color_node->field_flag)
{
- gl_xml_set_prop_string (node, "color_field", color_node->key);
+ lgl_xml_set_prop_string (node, "color_field", color_node->key);
}
else
{
- gl_xml_set_prop_uint_hex (node, "color", color_node->color);
+ lgl_xml_set_prop_uint_hex (node, "color", color_node->color);
}
gl_color_node_free (&color_node);
/* data OR field attr */
text_node = gl_label_barcode_get_data (GL_LABEL_BARCODE(object));
if (text_node->field_flag) {
- gl_xml_set_prop_string (node, "field", text_node->data);
- gl_xml_set_prop_int (node, "format", format_digits);
+ lgl_xml_set_prop_string (node, "field", text_node->data);
+ lgl_xml_set_prop_int (node, "format", format_digits);
} else {
- gl_xml_set_prop_string (node, "data", text_node->data);
+ lgl_xml_set_prop_string (node, "data", text_node->data);
}
gl_text_node_free (&text_node);
node = xmlNewChild (root, ns, (xmlChar *)"Merge", NULL);
string = gl_merge_get_name (merge);
- gl_xml_set_prop_string (node, "type", string);
+ lgl_xml_set_prop_string (node, "type", string);
g_free (string);
string = gl_merge_get_src (merge);
- gl_xml_set_prop_string (node, "src", string);
+ lgl_xml_set_prop_string (node, "src", string);
g_free (string);
g_object_unref (G_OBJECT(merge));
base64 = gl_base64_encode (stream, stream_length);
node = xmlNewChild (root, ns, (xmlChar *)"Pixdata", (xmlChar *)base64);
- gl_xml_set_prop_string (node, "name", name);
- gl_xml_set_prop_string (node, "encoding", "Base64");
+ lgl_xml_set_prop_string (node, "name", name);
+ lgl_xml_set_prop_string (node, "encoding", "Base64");
gl_pixbuf_cache_remove_pixbuf (pixbuf_cache, name);
color_node = gl_label_object_get_text_color (GL_LABEL_OBJECT(object_text));
if (color_node->field_flag)
{
- gl_xml_set_prop_string (node, "color_field", color_node->key);
+ lgl_xml_set_prop_string (node, "color_field", color_node->key);
}
else
{
- gl_xml_set_prop_uint_hex (node, "color", color_node->color);
+ lgl_xml_set_prop_uint_hex (node, "color", color_node->color);
}
gl_color_node_free (&color_node);
align = gl_label_object_get_text_alignment (GL_LABEL_OBJECT(object_text));
- gl_xml_set_prop_string (node, "font_family", font_family);
- gl_xml_set_prop_double (node, "font_size", font_size);
- gl_xml_set_prop_string (node, "font_weight", gl_util_weight_to_string (font_weight));
- gl_xml_set_prop_boolean (node, "font_italic", font_italic_flag);
+ lgl_xml_set_prop_string (node, "font_family", font_family);
+ lgl_xml_set_prop_double (node, "font_size", font_size);
+ lgl_xml_set_prop_string (node, "font_weight", gl_util_weight_to_string (font_weight));
+ lgl_xml_set_prop_boolean (node, "font_italic", font_italic_flag);
- gl_xml_set_prop_double (node, "line_spacing", text_line_spacing);
+ lgl_xml_set_prop_double (node, "line_spacing", text_line_spacing);
/* Build children. */
lines = gl_label_text_get_lines (GL_LABEL_TEXT(object_text));
if (text_node->field_flag) {
child = xmlNewChild (node, ns, (xmlChar *)"Field", NULL);
- gl_xml_set_prop_string (child, "name", text_node->data);
+ lgl_xml_set_prop_string (child, "name", text_node->data);
} else {
xmlNodeAddContent (node, (xmlChar *)text_node->data);
}
gl_label_object_get_matrix (object, &matrix);
- gl_xml_set_prop_double (node, "a0", matrix.xx);
- gl_xml_set_prop_double (node, "a1", matrix.yx);
- gl_xml_set_prop_double (node, "a2", matrix.xy);
- gl_xml_set_prop_double (node, "a3", matrix.yy);
- gl_xml_set_prop_double (node, "a4", matrix.x0);
- gl_xml_set_prop_double (node, "a5", matrix.y0);
+ lgl_xml_set_prop_double (node, "a0", matrix.xx);
+ lgl_xml_set_prop_double (node, "a1", matrix.yx);
+ lgl_xml_set_prop_double (node, "a2", matrix.xy);
+ lgl_xml_set_prop_double (node, "a3", matrix.yy);
+ lgl_xml_set_prop_double (node, "a4", matrix.x0);
+ lgl_xml_set_prop_double (node, "a5", matrix.y0);
}
/*--------------------------------------------------------------------------*/
if (shadow_state)
{
- gl_xml_set_prop_boolean (node, "shadow", shadow_state);
+ lgl_xml_set_prop_boolean (node, "shadow", shadow_state);
gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y);
- gl_xml_set_prop_length (node, "shadow_x", shadow_x);
- gl_xml_set_prop_length (node, "shadow_y", shadow_y);
+ lgl_xml_set_prop_length (node, "shadow_x", shadow_x);
+ lgl_xml_set_prop_length (node, "shadow_y", shadow_y);
shadow_color_node = gl_label_object_get_shadow_color (object);
if (shadow_color_node->field_flag)
{
- gl_xml_set_prop_string (node, "shadow_color_field", shadow_color_node->key);
+ lgl_xml_set_prop_string (node, "shadow_color_field", shadow_color_node->key);
}
else
{
- gl_xml_set_prop_uint_hex (node, "shadow_color", shadow_color_node->color);
+ lgl_xml_set_prop_uint_hex (node, "shadow_color", shadow_color_node->color);
}
gl_color_node_free (&shadow_color_node);
shadow_opacity = gl_label_object_get_shadow_opacity (object);
- gl_xml_set_prop_double (node, "shadow_opacity", shadow_opacity);
+ lgl_xml_set_prop_double (node, "shadow_opacity", shadow_opacity);
}
}