/usr/share/gtk-doc/html/libglbarcode-3.0/libglbarcode-intro.html is in glabels-dev 3.4.0-2build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Introduction: LibGlbarcode 3.0 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="LibGlbarcode 3.0 Reference Manual">
<link rel="up" href="overview.html" title="LibGlbarcode Overview">
<link rel="prev" href="overview.html" title="LibGlbarcode Overview">
<link rel="next" href="api.html" title="API Reference">
<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="overview.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="overview.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="api.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libglbarcode-intro"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libglbarcode-intro.top_of_page"></a>Introduction</span></h2>
<p>Introduction —
Introduction to libglbarcode library
</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="id-1.2.2.3"></a><h2>Overview</h2>
<p>
Libglbarcode provides the core barcode functionality for <span class="application">glabels</span>. 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
<span class="application">glabels</span>.
</p>
</div>
<div class="refsect1">
<a name="id-1.2.2.4"></a><h2>Basic Usage</h2>
<pre class="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);
}
</pre>
</div>
<div class="refsect1">
<a name="id-1.2.2.5"></a><h2>Writing Renderers</h2>
<p>
The <a class="link" href="libglbarcode-3.0-lgl-barcode.html#lglBarcode" title="lglBarcode">lglBarcode</a> 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.
</p>
<pre class="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;
}
}
}
</pre>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.24</div>
</body>
</html>
|