/xmldocs.make
/libglabels/libglabels*.pc
+/libglbarcode/libglbarcode*.pc
/src/marshal.[ch]
/src/stock-pixmaps/stockpixbufs.h
help/Makefile
docs/Makefile
docs/libglabels/Makefile
+docs/libglbarcode/Makefile
glabels.spec
])
AC_OUTPUT
## Process this file with automake to produce Makefile.in.
-SUBDIRS = libglabels
+SUBDIRS = \
+ libglabels \
+ libglbarcode
--- /dev/null
+## Process this file with automake to produce Makefile.in
+
+# We require automake 1.6 at least.
+AUTOMAKE_OPTIONS = 1.6
+
+# This is a blank Makefile.am for using gtk-doc.
+# Copy this to your project's API docs directory and modify the variables to
+# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
+# of using the various options.
+
+# The name of the module, e.g. 'glib'.
+DOC_MODULE=libglbarcode-3.0
+
+# The top-level SGML file. You can change this if you want to.
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
+
+# The directory containing the source code. Relative to $(srcdir).
+# gtk-doc will search all .c & .h files beneath here for inline comments
+# documenting the functions and macros.
+# e.g. DOC_SOURCE_DIR=../../../gtk
+DOC_SOURCE_DIR=../../libglbarcode
+
+# Extra options to pass to gtkdoc-scangobj. Not normally needed.
+SCANGOBJ_OPTIONS=
+
+# Extra options to supply to gtkdoc-scan.
+# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
+SCAN_OPTIONS=
+
+# Extra options to supply to gtkdoc-mkdb.
+# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
+MKDB_OPTIONS=--sgml-mode --output-format=xml
+
+# Extra options to supply to gtkdoc-fixref. Not normally needed.
+# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
+FIXXREF_OPTIONS=
+
+# Used for dependencies. The docs will be rebuilt if any of these change.
+# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
+# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
+HFILE_GLOB=
+CFILE_GLOB=
+
+# Header files to ignore when scanning.
+# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
+IGNORE_HFILES= \
+ lgl-barcode-code39.h \
+ lgl-barcode-onecode.h \
+ lgl-barcode-postnet.h
+
+# Images to copy into HTML directory.
+# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
+HTML_IMAGES=
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
+# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
+content_files= \
+ intro.sgml
+
+# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
+# Only needed if you are using gtkdoc-scangobj to dynamically query widget
+# signals and properties.
+# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
+# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
+INCLUDES=
+GTKDOC_LIBS=
+
+# This includes the standard gtk-doc make rules, copied by gtkdocize.
+include $(top_srcdir)/gtk-doc.make
+
+# Other files to distribute
+# e.g. EXTRA_DIST += version.xml.in
+EXTRA_DIST +=
--- /dev/null
+<refentry id="libglbarcode-intro" revision="07 Nov 2010">
+<refmeta>
+<refentrytitle role="top_of_page" id="libglbarcode-intro.top_of_page">Introduction</refentrytitle>
+<manvolnum>3</manvolnum>
+<refmiscinfo>
+ LIBGLBARCODE-3.0 Library
+</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>Introduction</refname>
+<refpurpose>
+Introduction to libglbarcode library
+</refpurpose>
+</refnamediv>
+
+
+<refsect1>
+<title>Overview</title>
+
+<para>
+Libglbarcode provides the core barcode functionality for <application>glabels</application>. It provides
+an intermediate barcode format, a small set of built-in barcode back-ends, and a cairo renderer. While
+libglbarcode does not currently include a large set of built-in barcode back-ends or renderers, its
+simple architecture would easily support extending its functionality beyond the needs of
+<application>glabels</application>.
+</para>
+
+</refsect1>
+
+
+<refsect1>
+<title>Basic Usage</title>
+
+<programlisting>
+
+#include <libglbarcode/lgl-barcode-create.h>
+#include <libglbarcode/lgl-barcode-render-to-cairo.h>
+
+void
+example (gchar *data,
+ cairo_t *cr)
+{
+ glBarcode *bc;
+
+ bc = lgl_barcode_create (LGL_BARCODE_TYPE_CODE39, TRUE, FALSE, 0, 0, data);
+
+ /* Render to cairo context. Assume context has appropriate scale and translation.
+ * Scale should be such that world units are points (1 point = 1/72 inch) and that
+ * positive y values go downward.
+ */
+ lgl_barcode_render_to_cairo (bc, cr);
+
+ lgl_free (bc);
+}
+
+</programlisting>
+
+
+</refsect1>
+
+
+<refsect1>
+<title>Writing Renderers</title>
+
+<para>
+The <link linkend="lglBarcode">lglBarcode</link> structure is independent of
+barcode type, and consists of a simple list of drawing primitives.
+A renderer simply traverses this list translating these primitives into native
+drawing commands for its target format or device.
+All renderers will follow this simple pattern as illustrated in the example
+below.
+</para>
+
+<programlisting>
+
+#include <libglbarcode/lgl-barcode.h>
+#include <xxx.h>
+
+void
+lgl_barcode_render_to_xxx (const lglBarcode *bc)
+{
+ GList *p;
+
+ lglBarcodeShape *shape;
+ lglBarcodeShapeLine *line;
+ lglBarcodeShapeBox *box;
+ lglBarcodeShapeChar *bchar;
+ lglBarcodeShapeString *bstring;
+ lglBarcodeShapeRing *ring;
+ lglBarcodeShapeHexagon *hexagon;
+
+
+ for (p = bc->shapes; p != NULL; p = p->next) {
+
+ shape = (lglBarcodeShape *)p->data;
+
+ switch (shape->type)
+ {
+
+ case LGL_BARCODE_SHAPE_LINE:
+ line = (lglBarcodeShapeLine *) shape;
+
+ xxx_plot_line (line->x, line->y,
+ line->x, line->y + line->length,
+ line->width );
+ break;
+
+ case LGL_BARCODE_SHAPE_BOX:
+ box = (lglBarcodeShapeBox *) shape;
+
+ xxx_plot_rectangle (box->x, box->y,
+ box->width, box->height);
+ break;
+
+ case LGL_BARCODE_SHAPE_CHAR:
+ bchar = (lglBarcodeShapeChar *) shape;
+
+ ...
+ xxx_plot_char (...);
+ break;
+
+ case LGL_BARCODE_SHAPE_STRING:
+ bstring = (lglBarcodeShapeString *) shape;
+
+ ...
+ xxx_plot_string (...);
+ break;
+
+ case LGL_BARCODE_SHAPE_RING:
+ ring = (lglBarcodeShapeRing *) shape;
+
+ ...
+ xxx_plot_circle (...);
+ break;
+
+ case LGL_BARCODE_SHAPE_HEXAGON:
+ hexagon = (lglBarcodeShapeHexagon *) shape;
+
+ ...
+ xxx_plot_polygon (...);
+ break;
+
+ default:
+ g_assert_not_reached ();
+ break;
+
+ }
+
+ }
+
+}
+
+
+</programlisting>
+
+
+</refsect1>
+
+
+</refentry>
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+[
+ <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
+ <!ENTITY libglbarcode-intro SYSTEM "intro.sgml">
+]>
+<book id="index">
+
+ <bookinfo>
+ <title>LibGlbarcode 3.0 Reference Manual</title>
+ </bookinfo>
+
+ <chapter id="overview">
+ <title>LibGlbarcode Overview</title>
+
+ &libglbarcode-intro;
+
+ </chapter>
+
+ <chapter id="api">
+ <title>API Reference</title>
+
+ <xi:include href="xml/lgl-barcode.xml"/>
+ <xi:include href="xml/lgl-barcode-create.xml"/>
+ <xi:include href="xml/lgl-barcode-render-to-cairo.xml"/>
+ <xi:include href="xml/lgl-barcode-type.xml"/>
+
+ </chapter>
+
+</book>
--- /dev/null
+<SECTION>
+<FILE>lgl-barcode</FILE>
+<INCLUDE>libglbarcode/lgl-barcode.h</INCLUDE>
+<SUBSECTION Barcode Structure>
+lglBarcode
+<SUBSECTION Barcode Structure Management>
+lgl_barcode_new
+lgl_barcode_free
+<SUBSECTION Barcode Drawing Primitives>
+lglBarcodeShapeType
+lglBarcodeShape
+lglBarcodeShapeAny
+lglBarcodeShapeLine
+lglBarcodeShapeBox
+lglBarcodeShapeChar
+lglBarcodeShapeString
+lglBarcodeShapeRing
+lglBarcodeShapeHexagon
+<SUBSECTION Barcode Construction>
+lgl_barcode_add_line
+lgl_barcode_add_box
+lgl_barcode_add_char
+lgl_barcode_add_string
+lgl_barcode_add_ring
+lgl_barcode_add_hexagon
+</SECTION>
+
+<SECTION>
+<FILE>lgl-barcode-create</FILE>
+<INCLUDE>libglbarcode/lgl-barcode-create.h</INCLUDE>
+lgl_barcode_create
+</SECTION>
+
+<SECTION>
+<FILE>lgl-barcode-render-to-cairo</FILE>
+<INCLUDE>libglbarcode/lgl-barcode-render-to-cairo.h</INCLUDE>
+lgl_barcode_render_to_cairo
+lgl_barcode_render_to_cairo_path
+</SECTION>
+
+<SECTION>
+<FILE>lgl-barcode-type</FILE>
+<INCLUDE>libglbarcode/lgl-barcode-type.h</INCLUDE>
+lglBarcodeType
+</SECTION>
+
--- /dev/null
+<!-- ##### SECTION Title ##### -->
+Barcode Factory
+
+<!-- ##### SECTION Short_Description ##### -->
+Basic end-user barcode creation API
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+This section describes a simple API to select and create #glBarcode structures using a built-in
+barcode backend.
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### SECTION Image ##### -->
+
+
+<!-- ##### FUNCTION lgl_barcode_create ##### -->
+<para>
+
+</para>
+
+@type:
+@text_flag:
+@checksum_flag:
+@w:
+@h:
+@data:
+@Returns:
+
+
--- /dev/null
+<!-- ##### SECTION Title ##### -->
+Cairo Renderer
+
+<!-- ##### SECTION Short_Description ##### -->
+Render barcode to cairo context
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+This section describes the cairo barcode renderer.
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### SECTION Image ##### -->
+
+
+<!-- ##### FUNCTION lgl_barcode_render_to_cairo ##### -->
+<para>
+
+</para>
+
+@bc:
+@cr:
+
+
+<!-- ##### FUNCTION lgl_barcode_render_to_cairo_path ##### -->
+<para>
+
+</para>
+
+@bc:
+@cr:
+
+
--- /dev/null
+<!-- ##### SECTION Title ##### -->
+Barcode Types
+
+<!-- ##### SECTION Short_Description ##### -->
+Enumeration of supported barcode types
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+This section describes an enumeration for selecting one of the barcode types supported by libglbarcode.
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### SECTION Image ##### -->
+
+
+<!-- ##### ENUM lglBarcodeType ##### -->
+<para>
+This enumeration is used to select a built-in barcode type. The currently supported barcode types are
+</para>
+
+@LGL_BARCODE_TYPE_POSTNET: USPS Postnet Barcode (5, 9, or 11 digits)
+@LGL_BARCODE_TYPE_POSTNET_5: USPS Postnet Barcode (5 digits)
+@LGL_BARCODE_TYPE_POSTNET_9: USPS Postnet Barcode (9 digits)
+@LGL_BARCODE_TYPE_POSTNET_11: USPS Postnet Barcode (11 digits)
+@LGL_BARCODE_TYPE_CEPNET: Brazilian Postal Code
+@LGL_BARCODE_TYPE_ONECODE: USPS Intelligent Mail Barcode
+@LGL_BARCODE_TYPE_CODE39: Code 39
+@LGL_BARCODE_TYPE_CODE39_EXT: Extended Code 39 (Supports full ASCII character set)
+
--- /dev/null
+<!-- ##### SECTION Title ##### -->
+lglBarcode
+
+<!-- ##### SECTION Short_Description ##### -->
+Barcode structure
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+This section describes the #lglBarcode structure and the #lglBarcodeShape family of simple drawing primitives.
+These structures form the basic intermediate barcode representation used by libglbarcode.
+The section also defines a set of functions for constructing an #lglBarcode structure and populating it with drawing primitives.
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### SECTION Image ##### -->
+
+
+<!-- ##### STRUCT lglBarcode ##### -->
+<para>
+
+</para>
+
+@width:
+@height:
+@shapes:
+
+<!-- ##### FUNCTION lgl_barcode_new ##### -->
+<para>
+
+</para>
+
+@void:
+@Returns:
+
+
+<!-- ##### FUNCTION lgl_barcode_free ##### -->
+<para>
+
+</para>
+
+@bc:
+
+
+<!-- ##### ENUM lglBarcodeShapeType ##### -->
+<para>
+
+</para>
+
+@LGL_BARCODE_SHAPE_LINE:
+@LGL_BARCODE_SHAPE_BOX:
+@LGL_BARCODE_SHAPE_CHAR:
+@LGL_BARCODE_SHAPE_STRING:
+@LGL_BARCODE_SHAPE_RING:
+@LGL_BARCODE_SHAPE_HEXAGON:
+
+<!-- ##### UNION lglBarcodeShape ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### STRUCT lglBarcodeShapeAny ##### -->
+<para>
+
+</para>
+
+@type:
+@x:
+@y:
+
+<!-- ##### STRUCT lglBarcodeShapeLine ##### -->
+<para>
+
+</para>
+
+@type:
+@x:
+@y:
+@length:
+@width:
+
+<!-- ##### STRUCT lglBarcodeShapeBox ##### -->
+<para>
+
+</para>
+
+@type:
+@x:
+@y:
+@width:
+@height:
+
+<!-- ##### STRUCT lglBarcodeShapeChar ##### -->
+<para>
+
+</para>
+
+@type:
+@x:
+@y:
+@fsize:
+@c:
+
+<!-- ##### STRUCT lglBarcodeShapeString ##### -->
+<para>
+
+</para>
+
+@type:
+@x:
+@y:
+@fsize:
+@string:
+
+<!-- ##### STRUCT lglBarcodeShapeRing ##### -->
+<para>
+
+</para>
+
+@type:
+@x:
+@y:
+@radius:
+@line_width:
+
+<!-- ##### STRUCT lglBarcodeShapeHexagon ##### -->
+<para>
+
+</para>
+
+@type:
+@x:
+@y:
+@height:
+
+<!-- ##### FUNCTION lgl_barcode_add_line ##### -->
+<para>
+
+</para>
+
+@bc:
+@x:
+@y:
+@length:
+@width:
+
+
+<!-- ##### FUNCTION lgl_barcode_add_box ##### -->
+<para>
+
+</para>
+
+@bc:
+@x:
+@y:
+@width:
+@height:
+
+
+<!-- ##### FUNCTION lgl_barcode_add_char ##### -->
+<para>
+
+</para>
+
+@bc:
+@x:
+@y:
+@fsize:
+@c:
+
+
+<!-- ##### FUNCTION lgl_barcode_add_string ##### -->
+<para>
+
+</para>
+
+@bc:
+@x:
+@y:
+@fsize:
+@string:
+@length:
+
+
+<!-- ##### FUNCTION lgl_barcode_add_ring ##### -->
+<para>
+
+</para>
+
+@bc:
+@x:
+@y:
+@radius:
+@line_width:
+
+
+<!-- ##### FUNCTION lgl_barcode_add_hexagon ##### -->
+<para>
+
+</para>
+
+@bc:
+@x:
+@y:
+@height:
+
+
/****************************************************************************/
-/* Lookup barcode type and create appropriate barcode. */
-/****************************************************************************/
+/**
+ * lgl_barcode_create:
+ * @type: Barcode type selection (#lglBarcodeType)
+ * @text_flag: %TRUE to show text, if supported by barcode type
+ * @checksum_flag: %TRUE to include checksum, if supported or optional for barcode type
+ * @w: Suggested width of barcode
+ * @h: Suggested height of barcode
+ * @data: Data to encode into barcode
+ *
+ * Create a new barcode structure, encoding @data with selected barcode type and
+ * characteristics.
+ *
+ * Barcode dimensions (@w and @h) are in points ( 1 point = 1/72 inch ).
+ * If either @w or @h are zero, the barcode will be rendered in a nominal size
+ * appropriate for the barcode type and data. The actual size of the resulting
+ * barcode may also be limited by required tolerances of line sizes and spacing
+ * for the given barcode type.
+ *
+ *
+ * Returns: A newly allocated #lglBarcode structure. Use lgl_barcode_free() to
+ * free it.
+ */
lglBarcode *
lgl_barcode_create (lglBarcodeType type,
gboolean text_flag,
/****************************************************************************/
-/* Render barcode to cairo context. */
-/****************************************************************************/
+/**
+ * lgl_barcode_render_to_cairo:
+ * @bc: An #lglBarcode structure
+ * @cr: A #cairo_t context
+ *
+ * Render barcode to cairo context. Context should be prepared with desired
+ * translation and appropriate scale. Context should be translated such that
+ * the origin is at the desired location of the upper left hand corner of the
+ * barcode bounding box. Context should be scaled such that all dimensions
+ * are in points ( 1 point = 1/72 inch ) and that positive y coordinates
+ * go down the surface.
+ */
void
lgl_barcode_render_to_cairo (const lglBarcode *bc,
cairo_t *cr)
/****************************************************************************/
-/* Render barcode to cairo context (creating a path only). */
-/****************************************************************************/
+/**
+ * lgl_barcode_render_to_cairo_path:
+ * @bc: An #lglBarcode structure
+ * @cr: A #cairo_t context
+ *
+ * Render barcode to cairo context, but only create a path to be filled or
+ * tested against. Context should be prepared with desired
+ * translation and appropriate scale. Context should be translated such that
+ * the origin is at the desired location of the upper left hand corner of the
+ * barcode bounding box. Context should be scaled such that all dimensions
+ * are in points ( 1 point = 1/72 inch ) and that positive y coordinates
+ * go down the surface.
+ */
void
lgl_barcode_render_to_cairo_path (const lglBarcode *bc,
cairo_t *cr)
typedef enum {
- LGL_BARCODE_TYPE_POSTNET,
- LGL_BARCODE_TYPE_POSTNET_5,
- LGL_BARCODE_TYPE_POSTNET_9,
- LGL_BARCODE_TYPE_POSTNET_11,
- LGL_BARCODE_TYPE_CEPNET,
- LGL_BARCODE_TYPE_ONECODE,
- LGL_BARCODE_TYPE_CODE39,
- LGL_BARCODE_TYPE_CODE39_EXT,
+ LGL_BARCODE_TYPE_POSTNET, /* USPS Postnet Barcode (5, 9, or 11 digits) */
+ LGL_BARCODE_TYPE_POSTNET_5, /* USPS Postnet Barcode (5 digits) */
+ LGL_BARCODE_TYPE_POSTNET_9, /* USPS Postnet Barcode (9 digits) */
+ LGL_BARCODE_TYPE_POSTNET_11, /* USPS Postnet Barcode (11 digits) */
+ LGL_BARCODE_TYPE_CEPNET, /* Brazilian Postal Code */
+ LGL_BARCODE_TYPE_ONECODE, /* USPS Intelligent Mail Barcode */
+
+ LGL_BARCODE_TYPE_CODE39, /* Code 39 */
+ LGL_BARCODE_TYPE_CODE39_EXT, /* Extended Code 39 (Supports full ASCII character set) */
+
+ /*< private >*/
LGL_BARCODE_N_TYPES
} lglBarcodeType;
/*****************************************************************************/
-/* Allocate new empty lglBarcode structure. */
-/*****************************************************************************/
+/**
+ * lgl_barcode_new:
+ *
+ * Allocate a new #lglBarcode structure.
+ *
+ * This function allocates a new #lglBarcode structure.
+ *
+ * <note><para>
+ * This function is intended to be used internally by barcode implementations.
+ * Typically an end-user would use lgl_barcode_create() instead.
+ * </para></note>
+ *
+ *
+ * Returns: A newly allocated #lglBarcode structure. Use lgl_barcode_free() to
+ * free it.
+ *
+ */
lglBarcode *
lgl_barcode_new (void)
{
/*****************************************************************************/
-/* Free previously created barcode. */
-/*****************************************************************************/
+/**
+ * lgl_barcode_free:
+ * @bc: The #lglBarcode structure to free
+ *
+ * Free a previously allocated #lglBarcode structure.
+ *
+ */
void
lgl_barcode_free (lglBarcode *bc)
{
/*****************************************************************************/
-/* Add a line. */
-/*****************************************************************************/
+/**
+ * lgl_barcode_add_line:
+ * @bc: An #lglBarcode structure
+ * @x: x coordinate of top of line
+ * @y: y coordinate of top of line
+ * @length: Length of line
+ * @width: Width of line
+ *
+ * Add a vertical line to barcode. Coordinates are relative to top left corner
+ * of barcode. All units are in points ( 1 point = 1/72 inch ).
+ *
+ * <note><para>
+ * This function is intended to be used internally by barcode implementations.
+ * </para></note>
+ *
+ */
void
lgl_barcode_add_line (lglBarcode *bc,
gdouble x,
/*****************************************************************************/
-/* Add box. */
-/*****************************************************************************/
+/**
+ * lgl_barcode_add_box:
+ * @bc: An #lglBarcode structure
+ * @x: x coordinate of top left corner of box
+ * @y: y coordinate of top left corner of box
+ * @width: Width of box
+ * @height: Height of box
+ *
+ * Add a box to barcode. Coordinates are relative to top left corner
+ * of barcode. All units are in points ( 1 point = 1/72 inch ).
+ *
+ * <note><para>
+ * This function is intended to be used internally by barcode implementations.
+ * </para></note>
+ *
+ */
void
lgl_barcode_add_box (lglBarcode *bc,
gdouble x,
/*****************************************************************************/
-/* Add character. */
-/*****************************************************************************/
+/**
+ * lgl_barcode_add_char:
+ * @bc: An #lglBarcode structure
+ * @x: x coordinate of left baseline of character
+ * @y: y coordinate of left baseline of character
+ * @fsize: Font size
+ * @c: Character to add
+ *
+ * Add an ASCII character to barcode. Coordinates are relative to top left corner
+ * of barcode. All units are in points ( 1 point = 1/72 inch ).
+ *
+ * <note><para>
+ * This function is intended to be used internally by barcode implementations.
+ * </para></note>
+ *
+ */
void
lgl_barcode_add_char (lglBarcode *bc,
gdouble x,
/*****************************************************************************/
-/* Add string. */
-/*****************************************************************************/
+/**
+ * lgl_barcode_add_string:
+ * @bc: An #lglBarcode structure
+ * @x: x coordinate of horizontal center of baseline of string
+ * @y: y coordinate of horizontal center of baseline of string
+ * @fsize: Font size
+ * @string: String to add
+ * @length: Number of bytes in string
+ *
+ * Add a character string to barcode. Coordinates are relative to top left corner
+ * of barcode. All units are in points ( 1 point = 1/72 inch ).
+ *
+ * <note><para>
+ * This function is intended to be used internally by barcode implementations.
+ * </para></note>
+ *
+ */
void
lgl_barcode_add_string (lglBarcode *bc,
gdouble x,
}
/*****************************************************************************/
-/* Add ring. */
-/*****************************************************************************/
+/**
+ * lgl_barcode_add_ring:
+ * @bc: An #lglBarcode structure
+ * @x: x coordinate of center of circle
+ * @y: y coordinate of center of circle
+ * @radius: Radius of ring (center of line)
+ * @line_width: Width of line
+ *
+ * Add a ring to barcode. Coordinates are relative to top left corner
+ * of barcode. All units are in points ( 1 point = 1/72 inch ).
+ *
+ * <note><para>
+ * This function is intended to be used internally by barcode implementations.
+ * </para></note>
+ *
+ */
void
lgl_barcode_add_ring (lglBarcode *bc,
gdouble x,
}
/*****************************************************************************/
-/* Add hexagon. */
-/*****************************************************************************/
+/**
+ * lgl_barcode_add_hexagon:
+ * @bc: An #lglBarcode structure
+ * @x: x coordinate of top point of hexagon
+ * @y: y coordinate of top point of hexagon
+ * @height: Height of hexagon
+ *
+ * Add a regular hexagon (oriented with vertexes at top and bottom) to barcode.
+ * Coordinates are relative to top left corner of barcode. All units are in
+ * points ( 1 point = 1/72 inch ).
+ *
+ * <note><para>
+ * This function is intended to be used internally by barcode implementations.
+ * </para></note>
+ *
+ */
void
lgl_barcode_add_hexagon (lglBarcode *bc,
gdouble x,
/* Barcode Intermediate Format. */
/********************************/
+/**
+ * lglBarcode:
+ * @width: Width of barcode bounding box (points)
+ * @height: Height of barcode bounding box (points)
+ * @shapes: List of #lglBarcodeShape drawing primitives
+ *
+ * This structure contains the libglbarcode intermediate barcode format. This
+ * structure contains a simple vectorized representation of the barcode. This
+ * vectorized representation is easy to interpret by a rendering backend for
+ * either vector or raster formats. A simple API is provided for constructing
+ * barcodes in this format.
+ *
+ */
typedef struct {
gdouble width;
LGL_BARCODE_SHAPE_HEXAGON,
} lglBarcodeShapeType;
+
typedef struct {
/* Begin Common Fields */
} lglBarcodeShapeAny;
-/*
+
+/**
* lglBarcodeShapeLine:
+ * @type: Always %LGL_BARCODE_SHAPE_LINE
+ * @x: x coordinate of top of line
+ * @y: y coordinate of top of line
+ * @length: Length of line
+ * @width: Width of line
+ *
+ * A vertical line drawing primitive.
+ *
+ *<programlisting>
*
* @ = origin (x,y) from top left corner of barcode
*
* | |
* +-----+
* width
+ *
+ *</programlisting>
+ *
+ * All units are in points ( 1 point = 1/72 inch ).
*/
typedef struct {
} lglBarcodeShapeLine;
-/*
+
+/**
* lglBarcodeShapeBox:
+ * @type: Always %LGL_BARCODE_SHAPE_BOX
+ * @x: x coordinate of top left corner of box
+ * @y: y coordinate of top left corner of box
+ * @width: Width of box
+ * @height: Height of box
+ *
+ * A solid box drawing primitive.
+ *
+ *<programlisting>
*
* @ = origin (x,y) from top left corner of barcode
*
* | |
* +---------+
* width
+ *
+ *</programlisting>
+ *
+ * All units are in points ( 1 point = 1/72 inch ).
*/
typedef struct {
} lglBarcodeShapeBox;
-/*
+
+/**
* lglBarcodeShapeChar:
+ * @type: Always %LGL_BARCODE_SHAPE_CHAR
+ * @x: x coordinate of left baseline of character
+ * @y: y coordinate of left baseline of character
+ * @fsize: Font size
+ * @c: Character to add
+ *
+ * An single byte character drawing primitive.
+ *
+ *<programlisting>
*
* @ = origin (x,y) from top left corner of barcode
*
* /__/ \__\ |
* v
* @ ----------------------
+ *
+ *</programlisting>
+ *
+ * All units are in points ( 1 point = 1/72 inch ).
*/
typedef struct {
} lglBarcodeShapeChar;
-/*
+
+/**
* lglBarcodeShapeString:
+ * @type: Always %LGL_BARCODE_SHAPE_STRING
+ * @x: x coordinate of horizontal center of baseline of string
+ * @y: y coordinate of horizontal center of baseline of string
+ * @fsize: Font size
+ * @string: String to add
+ * @length: Number of bytes in string
+ *
+ * A character string drawing primitive.
+ *
+ *<programlisting>
*
* @ = origin (x,y) from top left corner of barcode
*
* v
* @ ------------------
* x = horizontal center
+ *
+ *</programlisting>
+ *
+ * All units are in points ( 1 point = 1/72 inch ).
*/
typedef struct {
} lglBarcodeShapeString;
-/*
+
+/**
* lglBarcodeShapeRing:
+ * @type: Always %LGL_BARCODE_SHAPE_RING
+ * @x: x coordinate of center of circle
+ * @y: y coordinate of center of circle
+ * @radius: Radius of ring (center of line)
+ * @line_width: Width of line
+ *
+ * A ring (an open circle) drawing primitive.
+ *
+ *<programlisting>
*
* @ = origin (x,y) is centre of circle
*
* \ `.____.' / | radius
* `._ ...._.'.......|
* `-....-'
+ *
+ *</programlisting>
+ *
+ * All units are in points ( 1 point = 1/72 inch ).
*/
typedef struct {
} lglBarcodeShapeRing;
-/*
- * lglBarcodeShapeHexagon;
+
+/**
+ * lglBarcodeShapeHexagon:
+ * @type: Always %LGL_BARCODE_SHAPE_HEXAGON
+ * @x: x coordinate of top point of hexagon
+ * @y: y coordinate of top point of hexagon
+ * @height: Height of hexagon
+ *
+ * A solid regular hexagon (oriented with vertexes at top and bottom) drawing primitive.
+ *
+ *<programlisting>
*
* @ = origin (x,y) is top of hexagon
*
* "-_ _-" v
* " ------------------
*
+ *</programlisting>
+ *
+ * All units are in points ( 1 point = 1/72 inch ).
*/
typedef struct {
} lglBarcodeShapeHexagon;
+
typedef union {
lglBarcodeShapeType type;
Requires: glib-2.0 cairo pango
Version: @VERSION@
Libs: -L${libdir} -lglbarcode-3.0
+Libs.private: -lm
Cflags: -I${includedir}/@LIBGLBARCODE_BRANCH@
#include <libglbarcode/lgl-barcode-render-to-cairo.h>
-#include <libglbarcode/lgl-barcode-postnet.h>
+#include <libglbarcode/lgl-barcode-code39.h>
#include <libglbarcode/lgl-barcode-onecode.h>
+#include <libglbarcode/lgl-barcode-postnet.h>
#endif /* __LIBGLBARCODE_H__ */