File: Fsvg.h

package info (click to toggle)
fvwm 1:2.6.8-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 15,804 kB
  • sloc: ansic: 145,770; xml: 17,093; perl: 7,302; sh: 4,921; makefile: 1,094; yacc: 688; lex: 187; sed: 11
file content (88 lines) | stat: -rw-r--r-- 2,487 bytes parent folder | download | duplicates (2)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef FSVG_H
#define FSVG_H

#ifdef HAVE_RSVG
#define USE_SVG 1
#else
#define USE_SVG 0
#endif

#include "PictureBase.h"

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

#if USE_SVG
#	include <librsvg/rsvg.h>
#	include <cairo.h>
	typedef RsvgDimensionData		FRsvgDimensionData;
	typedef RsvgHandle			FRsvgHandle;
	typedef cairo_surface_t			Fcairo_surface_t;
	typedef cairo_t				Fcairo_t;

#	define FCAIRO_FORMAT_ARGB32		CAIRO_FORMAT_ARGB32
#	define FCAIRO_STATUS_SUCCESS		CAIRO_STATUS_SUCCESS

#	define FG_OBJECT(a)			G_OBJECT(a)
#	define Fg_object_unref(a)		g_object_unref(a)
#	define Frsvg_handle_get_dimensions(a, b) \
			rsvg_handle_get_dimensions(a, b)
#	define Frsvg_handle_new_from_file(a, b)	rsvg_handle_new_from_file(a, b)
#	define Frsvg_handle_render_cairo(a, b)	rsvg_handle_render_cairo(a, b)

/* TA:  2013-01-22 -- rsvg_init() has been deprecated since version 2.36; but
 * RSVG doesn't define a version of its own to check against.  Since RSVG uses
 * glib, we can check its version instead.
 */
#if !GLIB_CHECK_VERSION (2, 31, 0)
#	define Frsvg_init()			rsvg_init()
#endif

#if !GLIB_CHECK_VERSION(2,35,0)
#	define Frsvg_init()			g_type_init()
#endif

#	define Fcairo_create(a)			cairo_create(a)
#	define Fcairo_destroy(a)		cairo_destroy(a)
#	define Fcairo_image_surface_create_for_data(a,b,c,d,e) \
 			cairo_image_surface_create_for_data(a,b,c,d,e)
#	define Fcairo_rotate(a, b)		cairo_rotate(a, b)
#	define Fcairo_scale(a, b, c)		cairo_scale(a, b, c)
#	define Fcairo_status(a)			cairo_status(a)
#	define Fcairo_surface_destroy(a)	cairo_surface_destroy(a)
#	define Fcairo_surface_status(a)		cairo_surface_status(a)
#	define Fcairo_translate(a, b, c)	cairo_translate(a, b, c)
#else
	typedef struct {
		int width;
		int height;
		double em;
		double ex;
	} FRsvgDimensionData;
	typedef void FRsvgHandle;
	typedef void Fcairo_surface_t;
	typedef void Fcairo_t;

#	define FCAIRO_FORMAT_ARGB32 0
#	define FCAIRO_STATUS_SUCCESS 0

#	define FG_OBJECT(a)
#	define Fg_object_unref(a)
#	define Frsvg_handle_get_dimensions(a, b)
#	define Frsvg_handle_new_from_file(a, b)	0
#	define Frsvg_handle_render_cairo(a, b)
#	define Frsvg_init()

#	define Fcairo_create(a)	0
#	define Fcairo_destroy(a)
#	define Fcairo_image_surface_create_for_data(a,b,c,d,e) 0
#	define Fcairo_rotate(a, b)
#	define Fcairo_scale(a, b, c)
#	define Fcairo_status(a) 0
#	define Fcairo_surface_destroy(a)
#	define Fcairo_surface_status(a) 0
#	define Fcairo_translate(a, b, c)
#endif

#endif /* FSVG_H */