1 /*
2  * $Id: engine_t.h 143 2006-09-22 10:45:39Z csl $
3  *
4  * Copyright (C) 2006 Christian Stigen Larsen <csl@sublevel3.org>
5  * http://csl.sublevel3.org
6  *
7  * Distributed under the GNU General Public License v2.
8  *
9  */
10 
11 #ifndef INC_ENGINE_T_H
12 #define INC_ENGINE_T_H
13 
14 #include "a2png.h"
15 #include "image_point_t.h"
16 
17 #ifdef ENABLE_GD
18 typedef enum {
19 	A8,
20 	RGB24,
21 	ARGB32
22 } format_t;
23 #endif
24 
25 typedef struct engine_t_ {
26 	int status_ok;
27 	int tab_length;
28 	int fixed_font;
29 	int bold_font;
30 	int linespacing_px;
31 	int charspacing_px;
32 
33 	image_points_t pos;
34 	image_points_t inc;
35 
36 	double fontsize;
37 	const char* fontname;
38 
39 	#ifdef ENABLE_CAIRO
40 	cairo_format_t output_cairo_format;
41 	cairo_surface_t *surface;
42 	cairo_t *cr;
43 	cairo_status_t cairo_error;
44 	#endif
45 
46 	#ifdef ENABLE_GD
47 	gdImagePtr im;
48 	double font_conversion_factor;
49 	int col_bg;
50 	int col_fg;
51 	format_t format;
52 	#endif
53 
54 } engine_t;
55 
56 void set_defaults_engine(engine_t *p);
57 
58 #endif
59