Back to index

lightning-sunbird  0.9+nobinonly
cairo-clip-private.h
Go to the documentation of this file.
00001 /* cairo - a vector graphics library with display and print output
00002  *
00003  * Copyright © 2005 Red Hat, Inc.
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it either under the terms of the GNU Lesser General Public
00007  * License version 2.1 as published by the Free Software Foundation
00008  * (the "LGPL") or, at your option, under the terms of the Mozilla
00009  * Public License Version 1.1 (the "MPL"). If you do not alter this
00010  * notice, a recipient may use your version of this file under either
00011  * the MPL or the LGPL.
00012  *
00013  * You should have received a copy of the LGPL along with this library
00014  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
00015  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00016  * You should have received a copy of the MPL along with this library
00017  * in the file COPYING-MPL-1.1
00018  *
00019  * The contents of this file are subject to the Mozilla Public License
00020  * Version 1.1 (the "License"); you may not use this file except in
00021  * compliance with the License. You may obtain a copy of the License at
00022  * http://www.mozilla.org/MPL/
00023  *
00024  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
00025  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
00026  * the specific language governing rights and limitations.
00027  *
00028  * The Original Code is the cairo graphics library.
00029  *
00030  * The Initial Developer of the Original Code is Red Hat, Inc.
00031  *
00032  * Contributor(s):
00033  *     Kristian Høgsberg <krh@redhat.com>
00034  */
00035 
00036 #ifndef CAIRO_CLIP_PRIVATE_H
00037 #define CAIRO_CLIP_PRIVATE_H
00038 
00039 #include "cairo-path-fixed-private.h"
00040 
00041 enum _cairo_clip_mode {
00042     CAIRO_CLIP_MODE_PATH,
00043     CAIRO_CLIP_MODE_REGION,
00044     CAIRO_CLIP_MODE_MASK
00045 };
00046 
00047 struct _cairo_clip_path {
00048     unsigned int     ref_count;
00049     cairo_path_fixed_t      path;
00050     cairo_fill_rule_t       fill_rule;
00051     double           tolerance;
00052     cairo_antialias_t       antialias;
00053     cairo_clip_path_t       *prev;
00054 };
00055 
00056 struct _cairo_clip {
00057     cairo_clip_mode_t mode;
00058 
00059     /*
00060      * Mask-based clipping for cases where the backend 
00061      * clipping isn't sufficiently able.
00062      *
00063      * The rectangle here represents the
00064      * portion of the destination surface that this
00065      * clip surface maps to, it does not
00066      * represent the extents of the clip region or
00067      * clip paths
00068      */
00069     cairo_surface_t *surface;
00070     cairo_rectangle_t surface_rect;
00071     /*
00072      * Surface clip serial number to store
00073      * in the surface when this clip is set
00074      */
00075     unsigned int serial;
00076     /*
00077      * A clip region that can be placed in the surface
00078      */
00079     pixman_region16_t *region;
00080     /*
00081      * If the surface supports path clipping, we store the list of
00082      * clipping paths that has been set here as a linked list.
00083      */
00084     cairo_clip_path_t *path;
00085 };
00086 
00087 cairo_private void
00088 _cairo_clip_init (cairo_clip_t *clip, cairo_surface_t *target);
00089 
00090 cairo_private void
00091 _cairo_clip_fini (cairo_clip_t *clip);
00092 
00093 cairo_private void
00094 _cairo_clip_init_copy (cairo_clip_t *clip, cairo_clip_t *other);
00095 
00096 cairo_private cairo_status_t
00097 _cairo_clip_reset (cairo_clip_t *clip);
00098 
00099 cairo_private cairo_status_t
00100 _cairo_clip_clip (cairo_clip_t       *clip,
00101                 cairo_path_fixed_t *path,
00102                 cairo_fill_rule_t   fill_rule,
00103                 double              tolerance,
00104                 cairo_antialias_t   antialias,
00105                 cairo_surface_t    *target);
00106 
00107 cairo_private cairo_status_t
00108 _cairo_clip_intersect_to_rectangle (cairo_clip_t      *clip,
00109                                 cairo_rectangle_t *rectangle);
00110 
00111 cairo_private cairo_status_t
00112 _cairo_clip_intersect_to_region (cairo_clip_t      *clip,
00113                              pixman_region16_t *region);
00114 
00115 cairo_private cairo_status_t
00116 _cairo_clip_combine_to_surface (cairo_clip_t            *clip,
00117                             cairo_operator_t         operator,
00118                             cairo_surface_t         *dst,
00119                             int                      dst_x,
00120                             int                      dst_y,
00121                             const cairo_rectangle_t *extents);
00122 
00123 #endif /* CAIRO_CLIP_PRIVATE_H */