]> git.sur5r.net Git - glabels/blob - src/bc.h
Imported Upstream version 2.2.8
[glabels] / src / bc.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
2
3 /*
4  *  (GLABELS) Label and Business Card Creation program for GNOME
5  *
6  *  bc.h:  GLabels barcode module header file
7  *
8  *  Copyright (C) 2001-2003  Jim Evins <evins@snaught.com>.
9  *
10  *  This program is free software; you can redistribute it and/or modify
11  *  it under the terms of the GNU General Public License as published by
12  *  the Free Software Foundation; either version 2 of the License, or
13  *  (at your option) any later version.
14  *
15  *  This program is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *  GNU General Public License for more details.
19  *
20  *  You should have received a copy of the GNU General Public License
21  *  along with this program; if not, write to the Free Software
22  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
23  */
24 #ifndef __BC_H__
25 #define __BC_H__
26
27 #include <glib/gtypes.h>
28 #include <glib/glist.h>
29 #include <pango/pango.h>
30
31 G_BEGIN_DECLS
32
33 typedef struct {
34         gdouble x, y, length, width;
35 } glBarcodeLine;
36
37 typedef struct {
38         gdouble x, y, fsize;
39         gchar c;
40 } glBarcodeChar;
41
42 typedef struct {
43         gdouble width, height;
44         GList *lines;           /* List of glBarcodeLine */
45         GList *chars;           /* List of glBarcodeChar */
46 } glBarcode;
47
48 typedef glBarcode *(*glBarcodeNewFunc) (const gchar    *id,
49                                         gboolean        text_flag,
50                                         gboolean        checksum_flag,
51                                         gdouble         w,
52                                         gdouble         h,
53                                         const gchar    *digits);
54
55
56 #define GL_BARCODE_FONT_FAMILY      "Sans"
57 #define GL_BARCODE_FONT_WEIGHT      PANGO_WEIGHT_NORMAL
58
59
60 glBarcode       *gl_barcode_new              (const gchar    *id,
61                                               gboolean        text_flag,
62                                               gboolean        checksum_flag,
63                                               gdouble         w,
64                                               gdouble         h,
65                                               const gchar    *digits);
66
67 void             gl_barcode_free             (glBarcode     **bc);
68
69 GList           *gl_barcode_get_styles_list  (void);
70 void             gl_barcode_free_styles_list (GList          *styles_list);
71
72 gchar           *gl_barcode_default_digits   (const gchar    *id,
73                                               guint            n);
74
75 gboolean         gl_barcode_can_text         (const gchar    *id);
76 gboolean         gl_barcode_text_optional    (const gchar    *id);
77
78 gboolean         gl_barcode_can_csum         (const gchar    *id);
79 gboolean         gl_barcode_csum_optional    (const gchar    *id);
80
81 gboolean         gl_barcode_can_freeform     (const gchar    *id);
82 guint            gl_barcode_get_prefered_n   (const gchar    *id);
83
84 const gchar     *gl_barcode_id_to_name       (const gchar    *id);
85 const gchar     *gl_barcode_name_to_id       (const gchar    *name);
86
87 G_END_DECLS
88
89 #endif /* __BC_H__ */
90