new beta-0.90.0
[luatex.git] / source / libs / cairo / cairo-src / src / cairo-backend-private.h
blobb05eca59ab337faba31342752b21c827905bfc34
1 /* cairo - a vector graphics library with display and print output
3 * Copyright © 2010 Intel Corporation
5 * This library is free software; you can redistribute it and/or
6 * modify it either under the terms of the GNU Lesser General Public
7 * License version 2.1 as published by the Free Software Foundation
8 * (the "LGPL") or, at your option, under the terms of the Mozilla
9 * Public License Version 1.1 (the "MPL"). If you do not alter this
10 * notice, a recipient may use your version of this file under either
11 * the MPL or the LGPL.
13 * You should have received a copy of the LGPL along with this library
14 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
16 * You should have received a copy of the MPL along with this library
17 * in the file COPYING-MPL-1.1
19 * The contents of this file are subject to the Mozilla Public License
20 * Version 1.1 (the "License"); you may not use this file except in
21 * compliance with the License. You may obtain a copy of the License at
22 * http://www.mozilla.org/MPL/
24 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
25 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
26 * the specific language governing rights and limitations.
28 * The Original Code is the cairo graphics library.
30 * The Initial Developer of the Original Code is Intel Corporation
32 * Contributor(s):
33 * Chris Wilson <chris@chris-wilson.co.uk>
36 #ifndef CAIRO_BACKEND_PRIVATE_H
37 #define CAIRO_BACKEND_PRIVATE_H
39 #include "cairo-types-private.h"
40 #include "cairo-private.h"
42 typedef enum _cairo_backend_type {
43 CAIRO_TYPE_DEFAULT,
44 CAIRO_TYPE_SKIA,
45 } cairo_backend_type_t;
47 struct _cairo_backend {
48 cairo_backend_type_t type;
49 void (*destroy) (void *cr);
51 cairo_surface_t *(*get_original_target) (void *cr);
52 cairo_surface_t *(*get_current_target) (void *cr);
54 cairo_status_t (*save) (void *cr);
55 cairo_status_t (*restore) (void *cr);
57 cairo_status_t (*push_group) (void *cr, cairo_content_t content);
58 cairo_pattern_t *(*pop_group) (void *cr);
60 cairo_status_t (*set_source_rgba) (void *cr, double red, double green, double blue, double alpha);
61 cairo_status_t (*set_source_surface) (void *cr, cairo_surface_t *surface, double x, double y);
62 cairo_status_t (*set_source) (void *cr, cairo_pattern_t *source);
63 cairo_pattern_t *(*get_source) (void *cr);
65 cairo_status_t (*set_antialias) (void *cr, cairo_antialias_t antialias);
66 cairo_status_t (*set_dash) (void *cr, const double *dashes, int num_dashes, double offset);
67 cairo_status_t (*set_fill_rule) (void *cr, cairo_fill_rule_t fill_rule);
68 cairo_status_t (*set_line_cap) (void *cr, cairo_line_cap_t line_cap);
69 cairo_status_t (*set_line_join) (void *cr, cairo_line_join_t line_join);
70 cairo_status_t (*set_line_width) (void *cr, double line_width);
71 cairo_status_t (*set_miter_limit) (void *cr, double limit);
72 cairo_status_t (*set_opacity) (void *cr, double opacity);
73 cairo_status_t (*set_operator) (void *cr, cairo_operator_t op);
74 cairo_status_t (*set_tolerance) (void *cr, double tolerance);
76 cairo_antialias_t (*get_antialias) (void *cr);
77 void (*get_dash) (void *cr, double *dashes, int *num_dashes, double *offset);
78 cairo_fill_rule_t (*get_fill_rule) (void *cr);
79 cairo_line_cap_t (*get_line_cap) (void *cr);
80 cairo_line_join_t (*get_line_join) (void *cr);
81 double (*get_line_width) (void *cr);
82 double (*get_miter_limit) (void *cr);
83 double (*get_opacity) (void *cr);
84 cairo_operator_t (*get_operator) (void *cr);
85 double (*get_tolerance) (void *cr);
87 cairo_status_t (*translate) (void *cr, double tx, double ty);
88 cairo_status_t (*scale) (void *cr, double sx, double sy);
89 cairo_status_t (*rotate) (void *cr, double theta);
90 cairo_status_t (*transform) (void *cr, const cairo_matrix_t *matrix);
91 cairo_status_t (*set_matrix) (void *cr, const cairo_matrix_t *matrix);
92 cairo_status_t (*set_identity_matrix) (void *cr);
93 void (*get_matrix) (void *cr, cairo_matrix_t *matrix);
95 void (*user_to_device) (void *cr, double *x, double *y);
96 void (*user_to_device_distance) (void *cr, double *x, double *y);
97 void (*device_to_user) (void *cr, double *x, double *y);
98 void (*device_to_user_distance) (void *cr, double *x, double *y);
100 void (*user_to_backend) (void *cr, double *x, double *y);
101 void (*user_to_backend_distance) (void *cr, double *x, double *y);
102 void (*backend_to_user) (void *cr, double *x, double *y);
103 void (*backend_to_user_distance) (void *cr, double *x, double *y);
105 cairo_status_t (*new_path) (void *cr);
106 cairo_status_t (*new_sub_path) (void *cr);
107 cairo_status_t (*move_to) (void *cr, double x, double y);
108 cairo_status_t (*rel_move_to) (void *cr, double dx, double dy);
109 cairo_status_t (*line_to) (void *cr, double x, double y);
110 cairo_status_t (*rel_line_to) (void *cr, double dx, double dy);
111 cairo_status_t (*curve_to) (void *cr, double x1, double y1, double x2, double y2, double x3, double y3);
112 cairo_status_t (*rel_curve_to) (void *cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
113 cairo_status_t (*arc_to) (void *cr, double x1, double y1, double x2, double y2, double radius);
114 cairo_status_t (*rel_arc_to) (void *cr, double dx1, double dy1, double dx2, double dy2, double radius);
115 cairo_status_t (*close_path) (void *cr);
117 cairo_status_t (*arc) (void *cr, double xc, double yc, double radius, double angle1, double angle2, cairo_bool_t forward);
118 cairo_status_t (*rectangle) (void *cr, double x, double y, double width, double height);
120 void (*path_extents) (void *cr, double *x1, double *y1, double *x2, double *y2);
121 cairo_bool_t (*has_current_point) (void *cr);
122 cairo_bool_t (*get_current_point) (void *cr, double *x, double *y);
124 cairo_path_t *(*copy_path) (void *cr);
125 cairo_path_t *(*copy_path_flat) (void *cr);
126 cairo_status_t (*append_path) (void *cr, const cairo_path_t *path);
128 cairo_status_t (*stroke_to_path) (void *cr);
130 cairo_status_t (*clip) (void *cr);
131 cairo_status_t (*clip_preserve) (void *cr);
132 cairo_status_t (*in_clip) (void *cr, double x, double y, cairo_bool_t *inside);
133 cairo_status_t (*clip_extents) (void *cr, double *x1, double *y1, double *x2, double *y2);
134 cairo_status_t (*reset_clip) (void *cr);
135 cairo_rectangle_list_t *(*clip_copy_rectangle_list) (void *cr);
137 cairo_status_t (*paint) (void *cr);
138 cairo_status_t (*paint_with_alpha) (void *cr, double opacity);
139 cairo_status_t (*mask) (void *cr, cairo_pattern_t *pattern);
141 cairo_status_t (*stroke) (void *cr);
142 cairo_status_t (*stroke_preserve) (void *cr);
143 cairo_status_t (*in_stroke) (void *cr, double x, double y, cairo_bool_t *inside);
144 cairo_status_t (*stroke_extents) (void *cr, double *x1, double *y1, double *x2, double *y2);
146 cairo_status_t (*fill) (void *cr);
147 cairo_status_t (*fill_preserve) (void *cr);
148 cairo_status_t (*in_fill) (void *cr, double x, double y, cairo_bool_t *inside);
149 cairo_status_t (*fill_extents) (void *cr, double *x1, double *y1, double *x2, double *y2);
151 cairo_status_t (*set_font_face) (void *cr, cairo_font_face_t *font_face);
152 cairo_font_face_t *(*get_font_face) (void *cr);
153 cairo_status_t (*set_font_size) (void *cr, double size);
154 cairo_status_t (*set_font_matrix) (void *cr, const cairo_matrix_t *matrix);
155 void (*get_font_matrix) (void *cr, cairo_matrix_t *matrix);
156 cairo_status_t (*set_font_options) (void *cr, const cairo_font_options_t *options);
157 void (*get_font_options) (void *cr, cairo_font_options_t *options);
158 cairo_status_t (*set_scaled_font) (void *cr, cairo_scaled_font_t *scaled_font);
159 cairo_scaled_font_t *(*get_scaled_font) (void *cr);
160 cairo_status_t (*font_extents) (void *cr, cairo_font_extents_t *extents);
162 cairo_status_t (*glyphs) (void *cr,
163 const cairo_glyph_t *glyphs, int num_glyphs,
164 cairo_glyph_text_info_t *info);
165 cairo_status_t (*glyph_path) (void *cr,
166 const cairo_glyph_t *glyphs, int num_glyphs);
168 cairo_status_t (*glyph_extents) (void *cr,
169 const cairo_glyph_t *glyphs,
170 int num_glyphs,
171 cairo_text_extents_t *extents);
173 cairo_status_t (*copy_page) (void *cr);
174 cairo_status_t (*show_page) (void *cr);
177 static inline void
178 _cairo_backend_to_user (cairo_t *cr, double *x, double *y)
180 cr->backend->backend_to_user (cr, x, y);
183 static inline void
184 _cairo_backend_to_user_distance (cairo_t *cr, double *x, double *y)
186 cr->backend->backend_to_user_distance (cr, x, y);
189 static inline void
190 _cairo_user_to_backend (cairo_t *cr, double *x, double *y)
192 cr->backend->user_to_backend (cr, x, y);
195 static inline void
196 _cairo_user_to_backend_distance (cairo_t *cr, double *x, double *y)
198 cr->backend->user_to_backend_distance (cr, x, y);
201 #endif /* CAIRO_BACKEND_PRIVATE_H */