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
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"
46 struct _cairo_surface_backend
{
47 cairo_surface_type_t type
;
49 cairo_warn cairo_status_t
50 (*finish
) (void *surface
);
53 (*create_context
) (void *surface
);
56 (*create_similar
) (void *surface
,
57 cairo_content_t content
,
61 (*create_similar_image
) (void *surface
,
62 cairo_format_t format
,
66 cairo_image_surface_t
*
67 (*map_to_image
) (void *surface
,
68 const cairo_rectangle_int_t
*extents
);
70 (*unmap_image
) (void *surface
,
71 cairo_image_surface_t
*image
);
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
,
83 (*release_source_image
) (void *abstract_surface
,
84 cairo_image_surface_t
*image_out
,
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.
105 (*get_extents
) (void *surface
,
106 cairo_rectangle_int_t
*extents
);
109 (*get_font_options
) (void *surface
,
110 cairo_font_options_t
*options
);
112 cairo_warn cairo_status_t
113 (*flush
) (void *surface
,
116 cairo_warn cairo_status_t
117 (*mark_dirty_rectangle
) (void *surface
,
123 cairo_warn cairo_int_status_t
124 (*paint
) (void *surface
,
126 const cairo_pattern_t
*source
,
127 const cairo_clip_t
*clip
);
129 cairo_warn cairo_int_status_t
130 (*mask
) (void *surface
,
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
,
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
,
145 cairo_antialias_t antialias
,
146 const cairo_clip_t
*clip
);
148 cairo_warn cairo_int_status_t
149 (*fill
) (void *surface
,
151 const cairo_pattern_t
*source
,
152 const cairo_path_fixed_t
*path
,
153 cairo_fill_rule_t fill_rule
,
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
,
178 const cairo_pattern_t
*source
,
179 cairo_glyph_t
*glyphs
,
181 cairo_scaled_font_t
*scaled_font
,
182 const cairo_clip_t
*clip
);
185 (*has_show_text_glyphs
) (void *surface
);
187 cairo_warn cairo_int_status_t
188 (*show_text_glyphs
) (void *surface
,
190 const cairo_pattern_t
*source
,
193 cairo_glyph_t
*glyphs
,
195 const cairo_text_cluster_t
*clusters
,
197 cairo_text_cluster_flags_t cluster_flags
,
198 cairo_scaled_font_t
*scaled_font
,
199 const cairo_clip_t
*clip
);
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
,
211 _cairo_surface_default_release_source_image (void *surface
,
212 cairo_image_surface_t
*image
,
215 cairo_private cairo_surface_t
*
216 _cairo_surface_default_source (void *surface
,
217 cairo_rectangle_int_t
*extents
);
221 #endif /* CAIRO_SURFACE_BACKEND_PRIVATE_H */