From 7e0ae8bd43dfd8b052d021601912b46956b2921e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 21 Apr 2007 02:57:55 -0400 Subject: [PATCH] [svg] Move cairo_svg_surface_t to cairo-svg-surface-private.h --- boilerplate/cairo-boilerplate-ps.c | 6 ++- src/Makefile.am | 2 +- src/cairo-svg-surface-private.h | 71 ++++++++++++++++++++++++++++++ src/cairo-svg-surface.c | 24 +--------- 4 files changed, 78 insertions(+), 25 deletions(-) create mode 100644 src/cairo-svg-surface-private.h diff --git a/boilerplate/cairo-boilerplate-ps.c b/boilerplate/cairo-boilerplate-ps.c index 291ac2e96..0e7a764a1 100644 --- a/boilerplate/cairo-boilerplate-ps.c +++ b/boilerplate/cairo-boilerplate-ps.c @@ -30,6 +30,7 @@ #include #include +#include cairo_user_data_key_t ps_closure_key; @@ -142,11 +143,14 @@ _cairo_boilerplate_ps_cleanup (void *closure) cairo_status_t cairo_boilerplate_ps_surface_force_fallbacks (cairo_surface_t *abstract_surface) { - cairo_ps_surface_t *surface = (cairo_ps_surface_t*) abstract_surface; + cairo_paginated_surface_t *paginated = (cairo_paginated_surface_t*) abstract_surface; + cairo_ps_surface_t *surface; if (cairo_surface_get_type (abstract_surface) != CAIRO_SURFACE_TYPE_PS) return CAIRO_STATUS_SURFACE_TYPE_MISMATCH; + surface = (cairo_ps_surface_t*) paginated->target; + surface->force_fallbacks = TRUE; return CAIRO_STATUS_SUCCESS; diff --git a/src/Makefile.am b/src/Makefile.am index d3ab669ad..b7bfaf563 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -34,7 +34,7 @@ endif if CAIRO_HAS_SVG_SURFACE libcairo_svg_headers = cairo-svg.h -libcairo_svg_sources = cairo-svg-surface.c cairo-svg-test.h +libcairo_svg_sources = cairo-svg-surface.c cairo-svg-surface-private.h cairo-svg-test.h libcairo_font_subset_sources = $(font_subset_sources) backend_pkgconfigs += cairo-svg.pc endif diff --git a/src/cairo-svg-surface-private.h b/src/cairo-svg-surface-private.h new file mode 100644 index 000000000..5699350a3 --- /dev/null +++ b/src/cairo-svg-surface-private.h @@ -0,0 +1,71 @@ +/* cairo - a vector graphics library with display and print output + * + * Copyright © 2004 Red Hat, Inc + * Copyright © 2005-2006 Emmanuel Pacaud + * Copyright © 2006 Red Hat, Inc + * + * This library is free software; you can redistribute it and/or + * modify it either under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation + * (the "LGPL") or, at your option, under the terms of the Mozilla + * Public License Version 1.1 (the "MPL"). If you do not alter this + * notice, a recipient may use your version of this file under either + * the MPL or the LGPL. + * + * You should have received a copy of the LGPL along with this library + * in the file COPYING-LGPL-2.1; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the MPL along with this library + * in the file COPYING-MPL-1.1 + * + * The contents of this file are subject to the Mozilla Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY + * OF ANY KIND, either express or implied. See the LGPL or the MPL for + * the specific language governing rights and limitations. + * + * The Original Code is the cairo graphics library. + * + * The Initial Developer of the Original Code is University of Southern + * California. + * + * Contributor(s): + * Kristian Høgsberg + * Emmanuel Pacaud + * Carl Worth + */ + +#ifndef CAIRO_SVG_SURFACE_PRIVATE_H +#define CAIRO_SVG_SURFACE_PRIVATE_H + +#include "cairo-svg.h" + +#include "cairo-surface-private.h" + +typedef struct cairo_svg_document cairo_svg_document_t; + +typedef struct cairo_svg_surface { + cairo_surface_t base; + + cairo_content_t content; + + unsigned int id; + + double width; + double height; + + cairo_svg_document_t *document; + + cairo_output_stream_t *xml_node; + cairo_array_t page_set; + + unsigned int clip_level; + unsigned int base_clip; + + cairo_paginated_mode_t paginated_mode; +} cairo_svg_surface_t; + +#endif /* CAIRO_SVG_SURFACE_PRIVATE_H */ diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c index 24a990c9c..3c7157c2b 100644 --- a/src/cairo-svg-surface.c +++ b/src/cairo-svg-surface.c @@ -40,6 +40,7 @@ #include "cairoint.h" #include "cairo-svg.h" +#include "cairo-svg-surface-private.h" #include "cairo-svg-test.h" #include "cairo-path-fixed-private.h" #include "cairo-meta-surface-private.h" @@ -47,8 +48,6 @@ #include "cairo-scaled-font-subsets-private.h" #include "cairo-output-stream-private.h" -typedef struct cairo_svg_document cairo_svg_document_t; -typedef struct cairo_svg_surface cairo_svg_surface_t; typedef struct cairo_svg_page cairo_svg_page_t; static const int invalid_pattern_id = -1; @@ -115,27 +114,6 @@ struct cairo_svg_document { cairo_scaled_font_subsets_t *font_subsets; }; -struct cairo_svg_surface { - cairo_surface_t base; - - cairo_content_t content; - - unsigned int id; - - double width; - double height; - - cairo_svg_document_t *document; - - cairo_output_stream_t *xml_node; - cairo_array_t page_set; - - unsigned int clip_level; - unsigned int base_clip; - - cairo_paginated_mode_t paginated_mode; -}; - typedef struct { unsigned int id; cairo_meta_surface_t *meta;