Back to index

lightning-sunbird  0.9+nobinonly
cairo-meta-surface-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_META_SURFACE_H
00037 #define CAIRO_META_SURFACE_H
00038 
00039 #include "cairoint.h"
00040 #include "cairo-path-fixed-private.h"
00041 
00042 typedef enum {
00043     CAIRO_COMMAND_COMPOSITE,
00044     CAIRO_COMMAND_FILL_RECTANGLES,
00045     CAIRO_COMMAND_COMPOSITE_TRAPEZOIDS,
00046     CAIRO_COMMAND_SET_CLIP_REGION,
00047     CAIRO_COMMAND_INTERSECT_CLIP_PATH,
00048     CAIRO_COMMAND_SHOW_GLYPHS,
00049     CAIRO_COMMAND_FILL_PATH
00050 } cairo_command_type_t;
00051 
00052 typedef struct _cairo_command_composite {
00053     cairo_command_type_t    type;
00054     cairo_operator_t        operator;
00055     cairo_pattern_union_t   src_pattern;
00056     cairo_pattern_union_t   mask_pattern;
00057     cairo_pattern_t         *mask_pattern_pointer;
00058     int                            src_x;
00059     int                            src_y;
00060     int                            mask_x;
00061     int                            mask_y;
00062     int                            dst_x;
00063     int                            dst_y;
00064     unsigned int            width;
00065     unsigned int            height;
00066 } cairo_command_composite_t;
00067 
00068 typedef struct _cairo_command_fill_rectangles {
00069     cairo_command_type_t    type;
00070     cairo_operator_t        operator;
00071     cairo_color_t           color;
00072     cairo_rectangle_t              *rects;
00073     int                            num_rects;
00074 } cairo_command_fill_rectangles_t;
00075 
00076 typedef struct _cairo_command_composite_trapezoids {
00077     cairo_command_type_t    type;
00078     cairo_operator_t        operator;
00079     cairo_pattern_union_t   pattern;
00080     cairo_antialias_t              antialias;
00081     int                            x_src;
00082     int                            y_src;
00083     int                            x_dst;
00084     int                            y_dst;
00085     unsigned int            width;
00086     unsigned int            height;
00087     cairo_trapezoid_t              *traps;
00088     int                            num_traps;
00089 } cairo_command_composite_trapezoids_t;
00090 
00091 typedef struct _cairo_command_set_clip_region {
00092     cairo_command_type_t    type;
00093     pixman_region16_t              *region;
00094     unsigned int            serial;
00095 } cairo_command_set_clip_region_t;
00096 
00097 typedef struct _cairo_command_intersect_clip_path {
00098     cairo_command_type_t    type;
00099     cairo_path_fixed_t             *path_pointer;
00100     cairo_path_fixed_t             path;
00101     cairo_fill_rule_t              fill_rule;
00102     double                  tolerance;
00103     cairo_antialias_t              antialias;
00104 } cairo_command_intersect_clip_path_t;
00105 
00106 typedef struct _cairo_command_show_glyphs {
00107     cairo_command_type_t    type;
00108     cairo_scaled_font_t            *scaled_font;
00109     cairo_operator_t        operator;
00110     cairo_pattern_union_t   pattern;
00111     int                            source_x;
00112     int                            source_y;
00113     int                            dest_x;
00114     int                            dest_y;
00115     unsigned int            width;
00116     unsigned int            height;
00117     cairo_glyph_t           *glyphs;
00118     int                            num_glyphs;
00119 } cairo_command_show_glyphs_t;
00120 
00121 typedef struct _cairo_command_fill_path {
00122     cairo_command_type_t    type;
00123     cairo_operator_t        operator;
00124     cairo_pattern_union_t   pattern;
00125     cairo_path_fixed_t             path;
00126     cairo_fill_rule_t              fill_rule;
00127     double                  tolerance;
00128     cairo_antialias_t              antialias;
00129 } cairo_command_fill_path_t;
00130 
00131 typedef union _cairo_command {
00132     cairo_command_type_t                  type;
00133     cairo_command_composite_t                    composite;    
00134     cairo_command_fill_rectangles_t              fill_rectangles;
00135     cairo_command_composite_trapezoids_t  composite_trapezoids;
00136     cairo_command_set_clip_region_t              set_clip_region;
00137     cairo_command_intersect_clip_path_t          intersect_clip_path;
00138     cairo_command_show_glyphs_t                  show_glyphs;
00139     cairo_command_fill_path_t                    fill_path;
00140 } cairo_command_t;
00141 
00142 typedef struct _cairo_meta_surface {
00143     cairo_surface_t base;
00144     double width, height;
00145     cairo_array_t commands;
00146 } cairo_meta_surface_t;
00147 
00148 cairo_private cairo_surface_t *
00149 _cairo_meta_surface_create (double width, double height);
00150 
00151 cairo_private cairo_int_status_t
00152 _cairo_meta_surface_replay (cairo_surface_t *surface,
00153                          cairo_surface_t *target);
00154 
00155 #endif /* CAIRO_META_SURFACE_H */