]> git.sur5r.net Git - glabels/blob - libglabels/lgl-units.h
Upload to unstable
[glabels] / libglabels / lgl-units.h
1 /*
2  *  lgl-units.h
3  *  Copyright (C) 2003-2010  Jim Evins <evins@snaught.com>.
4  *
5  *  This file is part of libglabels.
6  *
7  *  libglabels is free software: you can redistribute it and/or modify
8  *  it under the terms of the GNU Lesser 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  *  libglabels 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 Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public License
18  *  along with libglabels.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21 #ifndef __LGL_UNITS_H__
22 #define __LGL_UNITS_H__
23
24 #include <glib.h>
25
26 G_BEGIN_DECLS
27
28
29 /*
30  * Units of distance
31  */
32 typedef enum {
33         LGL_UNITS_POINT, /* encoded as "pt" */
34         LGL_UNITS_INCH,  /* encoded as "in" */
35         LGL_UNITS_MM,    /* encoded as "mm" */
36         LGL_UNITS_CM,    /* encoded as "cm" */
37         LGL_UNITS_PICA,  /* encoded as "pc" */
38
39         LGL_UNITS_FIRST = LGL_UNITS_POINT,
40         LGL_UNITS_LAST  = LGL_UNITS_PICA,
41
42         LGL_UNITS_INVALID = -1
43 } lglUnits;
44
45
46 const gchar *lgl_units_get_id               (lglUnits     units);
47 lglUnits     lgl_units_from_id              (const gchar *id);
48
49 const gchar *lgl_units_get_name             (lglUnits     units);
50 lglUnits     lgl_units_from_name            (const gchar *name);
51
52 gdouble      lgl_units_get_points_per_unit  (lglUnits     units);
53 gdouble      lgl_units_get_units_per_point  (lglUnits     units);
54
55
56 G_END_DECLS
57
58
59 #endif /* __LGL_UNITS_H__ */
60
61
62
63 /*
64  * Local Variables:       -- emacs
65  * mode: C                -- emacs
66  * c-basic-offset: 8      -- emacs
67  * tab-width: 8           -- emacs
68  * indent-tabs-mode: nil  -- emacs
69  * End:                   -- emacs
70  */