]> git.sur5r.net Git - glabels/blob - glabels2/libglabels/paper.h
2004-01-06 Jim Evins <evins@snaught.com>
[glabels] / glabels2 / libglabels / paper.h
1 /*
2  *  (LIBGLABELS) Template library for GLABELS
3  *
4  *  paper.h:  paper module header file
5  *
6  *  Copyright (C) 2003, 2004  Jim Evins <evins@snaught.com>.
7  *
8  *  This file is part of the LIBGLABELS library.
9  *
10  *  This library is free software; you can redistribute it and/or
11  *  modify it under the terms of the GNU Library General Public
12  *  License as published by the Free Software Foundation; either
13  *  version 2 of the License, or (at your option) any later version.
14  *
15  *  This library 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 GNU
18  *  Library General Public License for more details.
19  *
20  *  You should have received a copy of the GNU Library General Public
21  *  License along with this library; if not, write to the Free
22  *  Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
23  *  MA 02111-1307, USA
24  */
25
26 #ifndef __PAPER_H__
27 #define __PAPER_H__
28
29 #include <glib.h>
30
31 G_BEGIN_DECLS
32
33
34 /*
35  *   glPaper structure
36  */
37 typedef struct _glPaper glPaper;
38
39 struct _glPaper {
40         gchar               *id;
41         gchar               *name;
42         gdouble              width;
43         gdouble              height;
44 };
45
46
47 /*
48  * Module initialization
49  */
50 void                 gl_paper_init                (void);
51
52
53 /*
54  * Paper construction
55  */
56 glPaper             *gl_paper_new                 (gchar           *id,
57                                                    gchar           *name,
58                                                    gdouble          width,
59                                                    gdouble          height);
60
61 glPaper             *gl_paper_dup                 (const glPaper   *orig);
62
63 void                 gl_paper_free                (glPaper         *paper);
64
65
66 /*
67  * ID lists
68  */
69 GList               *gl_paper_get_id_list         (void);
70 void                 gl_paper_free_id_list        (GList           *ids);
71
72
73 /*
74  * Name lists
75  */
76 GList               *gl_paper_get_name_list       (void);
77 void                 gl_paper_free_name_list      (GList           *names);
78
79
80 /*
81  * Query functions
82  */
83 gboolean             gl_paper_is_id_known         (const gchar     *id);
84 gboolean             gl_paper_is_id_other         (const gchar     *id);
85
86 glPaper             *gl_paper_from_id             (const gchar     *id);
87 glPaper             *gl_paper_from_name           (const gchar     *name);
88
89 gchar               *gl_paper_lookup_id_from_name (const gchar     *name);
90 gchar               *gl_paper_lookup_name_from_id (const gchar     *id);
91
92
93 /*
94  * Debugging
95  */
96 void                 gl_paper_print_known_papers  (void);
97
98
99 G_END_DECLS
100
101 #endif