1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2007-2019 Nicola Fontana <ntd at entidi.it>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
22 * SECTION:adg-cairo-fallback
23 * @title: Cairo wrappers
24 * @short_description: GObject wrappers for cairo structs
26 * If GObject support has not been compiled in cairo, either by
27 * explicitely disabling it or because the installed cairo version
28 * does not provide them, a compatible selection of wrappers used
29 * by ADG is provided anyway.
35 #include "adg-internal.h"
39 #include "adg-cairo-fallback.h"
42 #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 14, 0)
45 cairo_surface_set_device_scale(cairo_surface_t
*surface
,
46 double x_scale
, double y_scale
)
50 #endif /* cairo < 1.14.0 */
53 #ifdef ADG_MISSING_GBOXED_MATRIX
56 cairo_gobject_matrix_get_type(void)
58 static GType matrix_type
= 0;
60 if (G_UNLIKELY(matrix_type
== 0))
61 matrix_type
= g_boxed_type_register_static("CairoMatrix",
62 (GBoxedCopyFunc
) cairo_gobject_cairo_matrix_copy
,
69 cairo_gobject_cairo_matrix_copy(const cairo_matrix_t
*matrix
)
71 return g_memdup(matrix
, sizeof(cairo_matrix_t
));
74 #endif /* ADG_MISSING_GBOXED_MATRIX */
77 #ifdef ADG_MISSING_GBOXED_PATTERN
80 cairo_gobject_pattern_get_type(void)
82 static GType pattern_type
= 0;
84 if (G_UNLIKELY(pattern_type
== 0))
85 pattern_type
= g_boxed_type_register_static("CairoPattern",
86 (GBoxedCopyFunc
) cairo_pattern_reference
,
87 (GBoxedFreeFunc
) cairo_pattern_destroy
);
92 #endif /* ADG_MISSING_GBOXED_PATTERN */