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/>.
21 #ifndef __LGL_BARCODE_H__
22 #define __LGL_BARCODE_H__
29 /********************************/
30 /* Barcode Intermediate Format. */
31 /********************************/
38 GList *shapes; /* List of lglBarcodeShape drawing primitives */
43 /********************************/
44 /* Barcode Construction. */
45 /********************************/
47 lglBarcode *lgl_barcode_new (void);
49 void lgl_barcode_free (lglBarcode *bc);
51 void lgl_barcode_add_line (lglBarcode *bc,
57 void lgl_barcode_add_box (lglBarcode *bc,
63 void lgl_barcode_add_char (lglBarcode *bc,
69 void lgl_barcode_add_string (lglBarcode *bc,
76 void lgl_barcode_add_ring (lglBarcode *bc,
82 void lgl_barcode_add_hexagon (lglBarcode *bc,
87 /*******************************/
88 /* Barcode Drawing Primitives. */
89 /*******************************/
92 LGL_BARCODE_SHAPE_LINE,
93 LGL_BARCODE_SHAPE_BOX,
94 LGL_BARCODE_SHAPE_CHAR,
95 LGL_BARCODE_SHAPE_STRING,
96 LGL_BARCODE_SHAPE_RING,
97 LGL_BARCODE_SHAPE_HEXAGON,
98 } lglBarcodeShapeType;
102 /* Begin Common Fields */
103 lglBarcodeShapeType type;
106 /* End Common Fields */
108 } lglBarcodeShapeAny;
111 * lglBarcodeShapeLine:
113 * @ = origin (x,y) from top left corner of barcode
128 /* Begin Common Fields */
129 lglBarcodeShapeType type; /* Always LGL_BARCODE_SHAPE_LINE. */
132 /* End Common Fields */
137 } lglBarcodeShapeLine;
140 * lglBarcodeShapeBox:
142 * @ = origin (x,y) from top left corner of barcode
157 /* Begin Common Fields */
158 lglBarcodeShapeType type; /* Always LGL_BARCODE_SHAPE_BOX. */
161 /* End Common Fields */
166 } lglBarcodeShapeBox;
169 * lglBarcodeShapeChar:
171 * @ = origin (x,y) from top left corner of barcode
177 * / ______ \ | ~fsize
181 * @ ----------------------
185 /* Begin Common Fields */
186 lglBarcodeShapeType type; /* Always LGL_BARCODE_SHAPE_CHAR. */
189 /* End Common Fields */
194 } lglBarcodeShapeChar;
197 * lglBarcodeShapeString:
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 lglBarcodeShapeType type; /* Always LGL_BARCODE_SHAPE_STRING. */
218 /* End Common Fields */
223 } lglBarcodeShapeString;
226 * lglBarcodeShapeRing:
228 * @ = origin (x,y) is centre of circle
235 * | | @---|---|------
237 * \ `.____.' / | radius
238 * `._ ...._.'.......|
244 /* Begin Common Fields */
245 lglBarcodeShapeType type; /* Always LGL_BARCODE_SHAPE_RING. */
248 /* End Common Fields */
253 } lglBarcodeShapeRing;
256 * lglBarcodeShapeHexagon;
258 * @ = origin (x,y) is top of hexagon
260 * @ ------------------
273 * " ------------------
279 /* Begin Common Fields */
280 lglBarcodeShapeType type; /* Always LGL_BARCODE_SHAPE_HEXAGON. */
283 /* End Common Fields */
287 } lglBarcodeShapeHexagon;
291 lglBarcodeShapeType type;
292 lglBarcodeShapeAny any;
294 lglBarcodeShapeLine line;
295 lglBarcodeShapeBox box;
296 lglBarcodeShapeChar bchar;
297 lglBarcodeShapeString string;
298 lglBarcodeShapeRing ring;
299 lglBarcodeShapeHexagon hexagon;
306 #endif /* __LGL_BARCODE_H__ */
311 * Local Variables: -- emacs
313 * c-basic-offset: 8 -- emacs
314 * tab-width: 8 -- emacs
315 * indent-tabs-mode: nil -- emacs