beta-0.89.2
[luatex.git] / source / libs / cairo / cairo-src / src / cairo-surface-private.h
blobf20ab073932da68a7f407c355ac1b1166d26f5be
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_PRIVATE_H
39 #define CAIRO_SURFACE_PRIVATE_H
41 #include "cairo.h"
43 #include "cairo-types-private.h"
44 #include "cairo-list-private.h"
45 #include "cairo-reference-count-private.h"
46 #include "cairo-clip-private.h"
47 #include "cairo-surface-backend-private.h"
49 typedef void (*cairo_surface_func_t) (cairo_surface_t *);
51 struct _cairo_surface {
52 const cairo_surface_backend_t *backend;
53 cairo_device_t *device;
55 /* We allow surfaces to override the backend->type by shoving something
56 * else into surface->type. This is for "wrapper" surfaces that want to
57 * hide their internal type from the user-level API. */
58 cairo_surface_type_t type;
60 cairo_content_t content;
62 cairo_reference_count_t ref_count;
63 cairo_status_t status;
64 unsigned int unique_id;
65 unsigned int serial;
66 cairo_damage_t *damage;
68 unsigned _finishing : 1;
69 unsigned finished : 1;
70 unsigned is_clear : 1;
71 unsigned has_font_options : 1;
72 unsigned owns_device : 1;
74 cairo_user_data_array_t user_data;
75 cairo_user_data_array_t mime_data;
77 cairo_matrix_t device_transform;
78 cairo_matrix_t device_transform_inverse;
79 cairo_list_t device_transform_observers;
81 /* The actual resolution of the device, in dots per inch. */
82 double x_resolution;
83 double y_resolution;
85 /* The resolution that should be used when generating image-based
86 * fallback; generally only used by the analysis/paginated
87 * surfaces
89 double x_fallback_resolution;
90 double y_fallback_resolution;
92 /* A "snapshot" surface is immutable. See _cairo_surface_snapshot. */
93 cairo_surface_t *snapshot_of;
94 cairo_surface_func_t snapshot_detach;
95 /* current snapshots of this surface*/
96 cairo_list_t snapshots;
97 /* place upon snapshot list */
98 cairo_list_t snapshot;
101 * Surface font options, falling back to backend's default options,
102 * and set using _cairo_surface_set_font_options(), and propagated by
103 * cairo_surface_create_similar().
105 cairo_font_options_t font_options;
108 cairo_private cairo_surface_t *
109 _cairo_surface_create_in_error (cairo_status_t status);
111 cairo_private cairo_surface_t *
112 _cairo_int_surface_create_in_error (cairo_int_status_t status);
114 cairo_private cairo_surface_t *
115 _cairo_surface_get_source (cairo_surface_t *surface,
116 cairo_rectangle_int_t *extents);
118 cairo_private cairo_status_t
119 _cairo_surface_flush (cairo_surface_t *surface, unsigned flags);
121 #endif /* CAIRO_SURFACE_PRIVATE_H */