beta-0.89.2
[luatex.git] / source / libs / cairo / cairo-src / src / cairo-surface-backend-private.h
blob955a79ff5c3ddff6455fc6b89f726bda15baa39e
1 /* cairo - a vector graphics library with display and print output
3 * Copyright © 2002 University of Southern California
4 * Copyright © 2005 Red Hat, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it either under the terms of the GNU Lesser General Public
8 * License version 2.1 as published by the Free Software Foundation
9 * (the "LGPL") or, at your option, under the terms of the Mozilla
10 * Public License Version 1.1 (the "MPL"). If you do not alter this
11 * notice, a recipient may use your version of this file under either
12 * the MPL or the LGPL.
14 * You should have received a copy of the LGPL along with this library
15 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
17 * You should have received a copy of the MPL along with this library
18 * in the file COPYING-MPL-1.1
20 * The contents of this file are subject to the Mozilla Public License
21 * Version 1.1 (the "License"); you may not use this file except in
22 * compliance with the License. You may obtain a copy of the License at
23 * http://www.mozilla.org/MPL/
25 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
26 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
27 * the specific language governing rights and limitations.
29 * The Original Code is the cairo graphics library.
31 * The Initial Developer of the Original Code is University of Southern
32 * California.
34 * Contributor(s):
35 * Carl D. Worth <cworth@cworth.org>
38 #ifndef CAIRO_SURFACE_BACKEND_PRIVATE_H
39 #define CAIRO_SURFACE_BACKEND_PRIVATE_H
41 #include "cairo-compiler-private.h"
42 #include "cairo-error-private.h"
44 CAIRO_BEGIN_DECLS
46 struct _cairo_surface_backend {
47 cairo_surface_type_t type;
49 cairo_warn cairo_status_t
50 (*finish) (void *surface);
52 cairo_t *
53 (*create_context) (void *surface);
55 cairo_surface_t *
56 (*create_similar) (void *surface,
57 cairo_content_t content,
58 int width,
59 int height);
60 cairo_surface_t *
61 (*create_similar_image) (void *surface,
62 cairo_format_t format,
63 int width,
64 int height);
66 cairo_image_surface_t *
67 (*map_to_image) (void *surface,
68 const cairo_rectangle_int_t *extents);
69 cairo_int_status_t
70 (*unmap_image) (void *surface,
71 cairo_image_surface_t *image);
73 cairo_surface_t *
74 (*source) (void *abstract_surface,
75 cairo_rectangle_int_t *extents);
77 cairo_warn cairo_status_t
78 (*acquire_source_image) (void *abstract_surface,
79 cairo_image_surface_t **image_out,
80 void **image_extra);
82 cairo_warn void
83 (*release_source_image) (void *abstract_surface,
84 cairo_image_surface_t *image_out,
85 void *image_extra);
87 cairo_surface_t *
88 (*snapshot) (void *surface);
90 cairo_warn cairo_int_status_t
91 (*copy_page) (void *surface);
93 cairo_warn cairo_int_status_t
94 (*show_page) (void *surface);
96 /* Get the extents of the current surface. For many surface types
97 * this will be as simple as { x=0, y=0, width=surface->width,
98 * height=surface->height}.
100 * If this function is not implemented, or if it returns
101 * FALSE the surface is considered to be
102 * boundless and infinite bounds are used for it.
104 cairo_bool_t
105 (*get_extents) (void *surface,
106 cairo_rectangle_int_t *extents);
108 void
109 (*get_font_options) (void *surface,
110 cairo_font_options_t *options);
112 cairo_warn cairo_status_t
113 (*flush) (void *surface,
114 unsigned flags);
116 cairo_warn cairo_status_t
117 (*mark_dirty_rectangle) (void *surface,
118 int x,
119 int y,
120 int width,
121 int height);
123 cairo_warn cairo_int_status_t
124 (*paint) (void *surface,
125 cairo_operator_t op,
126 const cairo_pattern_t *source,
127 const cairo_clip_t *clip);
129 cairo_warn cairo_int_status_t
130 (*mask) (void *surface,
131 cairo_operator_t op,
132 const cairo_pattern_t *source,
133 const cairo_pattern_t *mask,
134 const cairo_clip_t *clip);
136 cairo_warn cairo_int_status_t
137 (*stroke) (void *surface,
138 cairo_operator_t op,
139 const cairo_pattern_t *source,
140 const cairo_path_fixed_t *path,
141 const cairo_stroke_style_t *style,
142 const cairo_matrix_t *ctm,
143 const cairo_matrix_t *ctm_inverse,
144 double tolerance,
145 cairo_antialias_t antialias,
146 const cairo_clip_t *clip);
148 cairo_warn cairo_int_status_t
149 (*fill) (void *surface,
150 cairo_operator_t op,
151 const cairo_pattern_t *source,
152 const cairo_path_fixed_t *path,
153 cairo_fill_rule_t fill_rule,
154 double tolerance,
155 cairo_antialias_t antialias,
156 const cairo_clip_t *clip);
158 cairo_warn cairo_int_status_t
159 (*fill_stroke) (void *surface,
160 cairo_operator_t fill_op,
161 const cairo_pattern_t *fill_source,
162 cairo_fill_rule_t fill_rule,
163 double fill_tolerance,
164 cairo_antialias_t fill_antialias,
165 const cairo_path_fixed_t*path,
166 cairo_operator_t stroke_op,
167 const cairo_pattern_t *stroke_source,
168 const cairo_stroke_style_t *stroke_style,
169 const cairo_matrix_t *stroke_ctm,
170 const cairo_matrix_t *stroke_ctm_inverse,
171 double stroke_tolerance,
172 cairo_antialias_t stroke_antialias,
173 const cairo_clip_t *clip);
175 cairo_warn cairo_int_status_t
176 (*show_glyphs) (void *surface,
177 cairo_operator_t op,
178 const cairo_pattern_t *source,
179 cairo_glyph_t *glyphs,
180 int num_glyphs,
181 cairo_scaled_font_t *scaled_font,
182 const cairo_clip_t *clip);
184 cairo_bool_t
185 (*has_show_text_glyphs) (void *surface);
187 cairo_warn cairo_int_status_t
188 (*show_text_glyphs) (void *surface,
189 cairo_operator_t op,
190 const cairo_pattern_t *source,
191 const char *utf8,
192 int utf8_len,
193 cairo_glyph_t *glyphs,
194 int num_glyphs,
195 const cairo_text_cluster_t *clusters,
196 int num_clusters,
197 cairo_text_cluster_flags_t cluster_flags,
198 cairo_scaled_font_t *scaled_font,
199 const cairo_clip_t *clip);
201 const char **
202 (*get_supported_mime_types) (void *surface);
205 cairo_private cairo_status_t
206 _cairo_surface_default_acquire_source_image (void *surface,
207 cairo_image_surface_t **image_out,
208 void **image_extra);
210 cairo_private void
211 _cairo_surface_default_release_source_image (void *surface,
212 cairo_image_surface_t *image,
213 void *image_extra);
215 cairo_private cairo_surface_t *
216 _cairo_surface_default_source (void *surface,
217 cairo_rectangle_int_t *extents);
219 CAIRO_END_DECLS
221 #endif /* CAIRO_SURFACE_BACKEND_PRIVATE_H */