doc: update copyright line for 2019
[adg.git] / src / adg / adg-cairo-fallback.c
blob752670cd5a2decfbb2503da1f6f9b880ebeb0253
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.
21 /**
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.
31 * Since: 1.0
32 **/
35 #include "adg-internal.h"
36 #include <string.h>
37 #include <math.h>
39 #include "adg-cairo-fallback.h"
42 #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 14, 0)
44 void
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
55 GType
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,
63 g_free);
65 return matrix_type;
68 cairo_matrix_t *
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
79 GType
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);
89 return pattern_type;
92 #endif /* ADG_MISSING_GBOXED_PATTERN */