Upload Tizen2.0 source
[framework/graphics/cairo.git] / src / cairo-clip-private.h
1 /* cairo - a vector graphics library with display and print output
2  *
3  * Copyright © 2005 Red Hat, Inc.
4  *
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.
12  *
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
18  *
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/
23  *
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.
27  *
28  * The Original Code is the cairo graphics library.
29  *
30  * The Initial Developer of the Original Code is Red Hat, Inc.
31  *
32  * Contributor(s):
33  *      Kristian Høgsberg <krh@redhat.com>
34  *      Chris Wilson <chris@chris-wilson.co.uk>
35  */
36
37 #ifndef CAIRO_CLIP_PRIVATE_H
38 #define CAIRO_CLIP_PRIVATE_H
39
40 #include "cairo-types-private.h"
41
42 #include "cairo-boxes-private.h"
43 #include "cairo-error-private.h"
44 #include "cairo-compiler-private.h"
45 #include "cairo-error-private.h"
46 #include "cairo-path-fixed-private.h"
47 #include "cairo-reference-count-private.h"
48
49 extern const cairo_private cairo_rectangle_list_t _cairo_rectangles_nil;
50
51 struct _cairo_clip_path {
52     cairo_reference_count_t      ref_count;
53     cairo_path_fixed_t           path;
54     cairo_fill_rule_t            fill_rule;
55     double                       tolerance;
56     cairo_antialias_t            antialias;
57     cairo_clip_path_t           *prev;
58 };
59
60 struct _cairo_clip {
61     cairo_rectangle_int_t extents;
62     cairo_clip_path_t *path;
63
64     cairo_box_t *boxes;
65     int num_boxes;
66
67     cairo_region_t *region;
68     cairo_bool_t is_region;
69
70     cairo_box_t embedded_box;
71 };
72
73 cairo_private cairo_clip_t *
74 _cairo_clip_create (void);
75
76 cairo_private cairo_clip_path_t *
77 _cairo_clip_path_reference (cairo_clip_path_t *clip_path);
78
79 cairo_private void
80 _cairo_clip_path_destroy (cairo_clip_path_t *clip_path);
81
82 cairo_private void
83 _cairo_clip_destroy (cairo_clip_t *clip);
84
85 cairo_private extern const cairo_clip_t __cairo_clip_all;
86
87 cairo_private cairo_clip_t *
88 _cairo_clip_copy (const cairo_clip_t *clip);
89
90 cairo_private cairo_clip_t *
91 _cairo_clip_copy_region (const cairo_clip_t *clip);
92
93 cairo_private cairo_clip_t *
94 _cairo_clip_copy_path (const cairo_clip_t *clip);
95
96 cairo_private cairo_clip_t *
97 _cairo_clip_translate (cairo_clip_t *clip, int tx, int ty);
98
99 cairo_private cairo_clip_t *
100 _cairo_clip_transform (cairo_clip_t *clip, const cairo_matrix_t *m);
101
102 cairo_private cairo_clip_t *
103 _cairo_clip_copy_with_translation (const cairo_clip_t *clip, int tx, int ty);
104
105 cairo_private cairo_bool_t
106 _cairo_clip_equal (const cairo_clip_t *clip_a,
107                    const cairo_clip_t *clip_b);
108
109 cairo_private cairo_clip_t *
110 _cairo_clip_intersect_rectangle (cairo_clip_t       *clip,
111                                  const cairo_rectangle_int_t *rectangle);
112
113 cairo_private cairo_clip_t *
114 _cairo_clip_intersect_clip (cairo_clip_t *clip,
115                             const cairo_clip_t *other);
116
117 cairo_private cairo_clip_t *
118 _cairo_clip_intersect_box (cairo_clip_t       *clip,
119                            const cairo_box_t *box);
120
121 cairo_private cairo_clip_t *
122 _cairo_clip_intersect_boxes (cairo_clip_t *clip,
123                              const cairo_boxes_t *boxes);
124
125 cairo_private cairo_clip_t *
126 _cairo_clip_intersect_rectilinear_path (cairo_clip_t       *clip,
127                                         const cairo_path_fixed_t *path,
128                                         cairo_fill_rule_t   fill_rule,
129                                         cairo_antialias_t   antialias);
130
131 cairo_private cairo_clip_t *
132 _cairo_clip_intersect_path (cairo_clip_t       *clip,
133                             const cairo_path_fixed_t *path,
134                             cairo_fill_rule_t   fill_rule,
135                             double              tolerance,
136                             cairo_antialias_t   antialias);
137
138 cairo_private const cairo_rectangle_int_t *
139 _cairo_clip_get_extents (const cairo_clip_t *clip);
140
141 cairo_private cairo_surface_t *
142 _cairo_clip_get_surface (const cairo_clip_t *clip, cairo_surface_t *dst, int *tx, int *ty);
143
144 cairo_private cairo_surface_t *
145 _cairo_clip_get_image (const cairo_clip_t *clip,
146                        cairo_surface_t *target,
147                        const cairo_rectangle_int_t *extents);
148
149 cairo_private cairo_status_t
150 _cairo_clip_combine_with_surface (const cairo_clip_t *clip,
151                                   cairo_surface_t *dst,
152                                   int dst_x, int dst_y);
153
154 cairo_private cairo_clip_t *
155 _cairo_clip_from_boxes (const cairo_boxes_t *boxes);
156
157 cairo_private cairo_region_t *
158 _cairo_clip_get_region (const cairo_clip_t *clip);
159
160 cairo_private cairo_bool_t
161 _cairo_clip_is_region (const cairo_clip_t *clip);
162
163 cairo_private cairo_clip_t *
164 _cairo_clip_reduce_to_rectangle (const cairo_clip_t *clip,
165                                  const cairo_rectangle_int_t *r);
166
167 cairo_private cairo_clip_t *
168 _cairo_clip_reduce_for_composite (const cairo_clip_t *clip,
169                                   cairo_composite_rectangles_t *extents);
170
171 cairo_private cairo_bool_t
172 _cairo_clip_contains_rectangle (const cairo_clip_t *clip,
173                                 const cairo_rectangle_int_t *rect);
174
175 cairo_private cairo_bool_t
176 _cairo_clip_contains_box (const cairo_clip_t *clip,
177                           const cairo_box_t *box);
178
179 cairo_private cairo_bool_t
180 _cairo_clip_contains_extents (const cairo_clip_t *clip,
181                               const cairo_composite_rectangles_t *extents);
182
183 cairo_private cairo_rectangle_list_t*
184 _cairo_clip_copy_rectangle_list (cairo_clip_t *clip, cairo_gstate_t *gstate);
185
186 cairo_private cairo_rectangle_list_t *
187 _cairo_rectangle_list_create_in_error (cairo_status_t status);
188
189 cairo_private cairo_bool_t
190 _cairo_clip_is_polygon (const cairo_clip_t *clip);
191
192 cairo_private cairo_int_status_t
193 _cairo_clip_get_polygon (const cairo_clip_t *clip,
194                          cairo_polygon_t *polygon,
195                          cairo_fill_rule_t *fill_rule,
196                          cairo_antialias_t *antialias);
197
198 #endif /* CAIRO_CLIP_PRIVATE_H */