summaryrefslogtreecommitdiff
path: root/glabels1/src/template.h
blob: 9e72c6bf7dcc6906cc690cc2d60aac11bbb27c5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
 *  (GLABELS) Label and Business Card Creation program for GNOME
 *
 *  template.h:  template module header file
 *
 *  Copyright (C) 2001-2002  Jim Evins <evins@snaught.com>.
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 */

#ifndef __TEMPLATE_H__
#define __TEMPLATE_H__

#include <gnome.h>

/* LibXML */
#include <tree.h>
#include <parser.h>

typedef enum {
	GL_TEMPLATE_STYLE_RECT,
	GL_TEMPLATE_STYLE_ROUND,
	GL_TEMPLATE_STYLE_CD,
} glTemplateStyle;

typedef struct {
	GList *name;
	gchar *description;
	gchar *page_size;
	glTemplateStyle style;

	/* Suggested margin */
	gdouble label_margin;

	/* Simple and rounded rectangles. */
	gdouble label_width, label_height, label_round;

	/* CD/DVD labels */
	gdouble label_radius, label_hole;

	/* Layout */
	gint nx, ny;
	gdouble x0, y0, dx, dy;
} glTemplate;

extern void gl_template_init (void);

extern GList *gl_template_get_name_list (const gchar * page_size);
extern void gl_template_free_name_list (GList ** names);

extern glTemplate *gl_template_from_name (const gchar * name);

extern glTemplate *gl_template_copy(const glTemplate *orig_template);
extern void gl_template_free(glTemplate **template);

extern void gl_template_xml_parse_sheet (glTemplate * template,
					 xmlNodePtr sheet_node);
extern void gl_template_xml_add_sheet (glTemplate * template,
				       xmlNodePtr root, xmlNsPtr ns);
#endif