]> git.sur5r.net Git - glabels/blob - glabels2/src/bc.h
Initial revision
[glabels] / glabels2 / src / bc.h
1 /*
2  *  (GLABELS) Label and Business Card Creation program for GNOME
3  *
4  *  bc.h:  GLabels barcode module header file
5  *
6  *  Copyright (C) 2001-2002  Jim Evins <evins@snaught.com>.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21  */
22 #ifndef __BC_H__
23 #define __BC_H__
24
25 #include <glib.h>
26
27 typedef enum {
28         GL_BARCODE_STYLE_POSTNET,
29         GL_BARCODE_STYLE_EAN,
30         GL_BARCODE_STYLE_UPC,
31         GL_BARCODE_STYLE_ISBN,
32         GL_BARCODE_STYLE_39,
33         GL_BARCODE_STYLE_128,
34         GL_BARCODE_STYLE_128C,
35         GL_BARCODE_STYLE_128B,
36         GL_BARCODE_STYLE_I25,
37         GL_BARCODE_STYLE_128RAW,
38         GL_BARCODE_STYLE_CBR,
39         GL_BARCODE_STYLE_MSI,
40         GL_BARCODE_STYLE_PLS,
41 } glBarcodeStyle;
42
43 typedef struct {
44         gdouble x, y, length, width;
45 } glBarcodeLine;
46
47 typedef struct {
48         gdouble x, y, fsize;
49         gchar c;
50 } glBarcodeChar;
51
52 typedef struct {
53         gdouble width, height;
54         GList *lines;           /* List of glBarcodeLine */
55         GList *chars;           /* List of glBarcodeChar */
56 } glBarcode;
57
58 #define GL_BARCODE_FONT_FAMILY      "Helvetica"
59 #define GL_BARCODE_FONT_WEIGHT      GNOME_FONT_BOOK
60
61 extern glBarcode *gl_barcode_new (glBarcodeStyle style,
62                                   gboolean text_flag,
63                                   gdouble scale,
64                                   gchar * digits);
65
66 extern void
67  gl_barcode_free (glBarcode ** bc);
68
69 extern gchar *gl_barcode_default_digits (glBarcodeStyle style);
70 extern const gchar *gl_barcode_style_to_text (glBarcodeStyle style);
71 extern glBarcodeStyle gl_barcode_text_to_style (const gchar * text);
72
73 #endif