3 * Copyright (C) 2001-2010 Jim Evins <evins@snaught.com>.
5 * This file is part of gLabels.
7 * gLabels is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * gLabels is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with gLabels. If not, see <http://www.gnu.org/licenses/>.
25 #include <pango/pango.h>
30 #define GL_BARCODE_FONT_FAMILY "Sans"
31 #define GL_BARCODE_FONT_WEIGHT PANGO_WEIGHT_NORMAL
34 /********************************/
35 /* Barcode Intermediate Format. */
36 /********************************/
43 GList *shapes; /* List of glBarcodeShape drawing primitives */
48 glBarcode *gl_barcode_new (void);
50 void gl_barcode_free (glBarcode **bc);
52 void gl_barcode_add_line (glBarcode *bc,
58 void gl_barcode_add_box (glBarcode *bc,
64 void gl_barcode_add_char (glBarcode *bc,
70 void gl_barcode_add_string (glBarcode *bc,
77 void gl_barcode_add_ring (glBarcode *bc,
83 void gl_barcode_add_hexagon (glBarcode *bc,
87 /*******************************/
88 /* Barcode Drawing Primitives. */
89 /*******************************/
92 GL_BARCODE_SHAPE_LINE,
94 GL_BARCODE_SHAPE_CHAR,
95 GL_BARCODE_SHAPE_STRING,
96 GL_BARCODE_SHAPE_RING,
97 GL_BARCODE_SHAPE_HEXAGON,
102 /* Begin Common Fields */
103 glBarcodeShapeType type;
106 /* End Common Fields */
111 * glBarcodeShapeLine:
113 * @ = origin (x,y) from top left corner of barcode
128 /* Begin Common Fields */
129 glBarcodeShapeType type; /* Always GL_BARCODE_SHAPE_LINE. */
132 /* End Common Fields */
137 } glBarcodeShapeLine;
142 * @ = origin (x,y) from top left corner of barcode
157 /* Begin Common Fields */
158 glBarcodeShapeType type; /* Always GL_BARCODE_SHAPE_BOX. */
161 /* End Common Fields */
169 * glBarcodeShapeChar:
171 * @ = origin (x,y) from top left corner of barcode
177 * / ______ \ | ~fsize
181 * @ ----------------------
185 /* Begin Common Fields */
186 glBarcodeShapeType type; /* Always GL_BARCODE_SHAPE_CHAR. */
189 /* End Common Fields */
194 } glBarcodeShapeChar;
197 * glBarcodeShapeString:
199 * @ = origin (x,y) from top left corner of barcode
201 * ____ _ ------------------
204 * / /__\ \ | |___ ____ |
205 * / ______ \ | ._ \ / __| | ~fsize
206 * / / \ \ | |_) | | (__ |
207 * /__/ \__\ |_.___/ \____| |
209 * @ ------------------
210 * x = horizontal center
214 /* Begin Common Fields */
215 glBarcodeShapeType type; /* Always GL_BARCODE_SHAPE_STRING. */
218 /* End Common Fields */
223 } glBarcodeShapeString;
226 * glBarcodeShapeRing:
228 * @ = origin (x,y) is centre of circle
235 * | | @---|---|------
237 * \ `.____.' / | radius
238 * `._ ...._.'.......|
244 /* Begin Common Fields */
245 glBarcodeShapeType type; /* Always GL_BARCODE_SHAPE_RING. */
248 /* End Common Fields */
253 } glBarcodeShapeRing;
256 * glBarcodeShapeHexagon;
258 * @ = origin (x,y) is top of hexagon
275 * NOTE: For Maxicode hexagons height is always 1.02mm, width is always 0.88mm
280 /* Begin Common Fields */
281 glBarcodeShapeType type; /* Always GL_BARCODE_SHAPE_HEXAGON. */
284 /* End Common Fields */
286 } glBarcodeShapeHexagon;
290 glBarcodeShapeType type;
291 glBarcodeShapeAny any;
293 glBarcodeShapeLine line;
294 glBarcodeShapeBox box;
295 glBarcodeShapeChar bchar;
296 glBarcodeShapeString string;
297 glBarcodeShapeRing ring;
298 glBarcodeShapeHexagon hexagon;
305 #endif /* __BC_H__ */
310 * Local Variables: -- emacs
312 * c-basic-offset: 8 -- emacs
313 * tab-width: 8 -- emacs
314 * indent-tabs-mode: nil -- emacs