]> git.sur5r.net Git - glabels/blob - glabels2/src/bc.h
1e62a6fa879da42cc50cbaae31905cd925927b83
[glabels] / glabels2 / src / bc.h
1 /*
2  *  bc.h
3  *  Copyright (C) 2001-2009  Jim Evins <evins@snaught.com>.
4  *
5  *  This file is part of gLabels.
6  *
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.
11  *
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.
16  *
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/>.
19  */
20
21 #ifndef __BC_H__
22 #define __BC_H__
23
24 #include <glib.h>
25 #include <pango/pango.h>
26
27 G_BEGIN_DECLS
28
29 typedef struct {
30         gdouble x, y, length, width;
31 } glBarcodeLine;
32
33 typedef struct {
34         gdouble x, y, fsize;
35         gchar c;
36 } glBarcodeChar;
37
38 typedef struct {
39         gdouble width, height;
40         GList *lines;           /* List of glBarcodeLine */
41         GList *chars;           /* List of glBarcodeChar */
42 } glBarcode;
43
44 typedef glBarcode *(*glBarcodeNewFunc) (const gchar    *id,
45                                         gboolean        text_flag,
46                                         gboolean        checksum_flag,
47                                         gdouble         w,
48                                         gdouble         h,
49                                         const gchar    *digits);
50
51
52 #define GL_BARCODE_FONT_FAMILY      "Sans"
53 #define GL_BARCODE_FONT_WEIGHT      PANGO_WEIGHT_NORMAL
54
55
56 glBarcode       *gl_barcode_new              (const gchar    *id,
57                                               gboolean        text_flag,
58                                               gboolean        checksum_flag,
59                                               gdouble         w,
60                                               gdouble         h,
61                                               const gchar    *digits);
62
63 void             gl_barcode_free             (glBarcode     **bc);
64
65 GList           *gl_barcode_get_styles_list  (void);
66 void             gl_barcode_free_styles_list (GList          *styles_list);
67
68 gchar           *gl_barcode_default_digits   (const gchar    *id,
69                                               guint            n);
70
71 gboolean         gl_barcode_can_text         (const gchar    *id);
72 gboolean         gl_barcode_text_optional    (const gchar    *id);
73
74 gboolean         gl_barcode_can_csum         (const gchar    *id);
75 gboolean         gl_barcode_csum_optional    (const gchar    *id);
76
77 gboolean         gl_barcode_can_freeform     (const gchar    *id);
78 guint            gl_barcode_get_prefered_n   (const gchar    *id);
79
80 const gchar     *gl_barcode_id_to_name       (const gchar    *id);
81 const gchar     *gl_barcode_name_to_id       (const gchar    *name);
82
83 G_END_DECLS
84
85 #endif /* __BC_H__ */
86
87
88
89 /*
90  * Local Variables:       -- emacs
91  * mode: C                -- emacs
92  * c-basic-offset: 8      -- emacs
93  * tab-width: 8           -- emacs
94  * indent-tabs-mode: nil  -- emacs
95  * End:                   -- emacs
96  */