diff options
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rw-r--r-- | src/cairo-output-stream-private.h | 2 | ||||
-rw-r--r-- | src/cairo-pdf-surface-private.h | 83 | ||||
-rw-r--r-- | src/cairo-pdf-surface.c | 42 | ||||
-rw-r--r-- | src/cairo-scaled-font-subsets-private.h | 2 | ||||
-rw-r--r-- | src/cairo-types-private.h | 3 |
6 files changed, 90 insertions, 45 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 83e0bca7..683a28fa 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,7 +21,8 @@ endif if CAIRO_HAS_PDF_SURFACE libcairo_pdf_headers = cairo-pdf.h -libcairo_pdf_sources = cairo-pdf-surface.c cairo-deflate-stream.c cairo-pdf-test.h +libcairo_pdf_sources = cairo-pdf-surface.c cairo-pdf-surface-private.h \ + cairo-deflate-stream.c cairo-pdf-test.h libcairo_font_subset_sources = $(font_subset_sources) backend_pkgconfigs += cairo-pdf.pc endif diff --git a/src/cairo-output-stream-private.h b/src/cairo-output-stream-private.h index 26c18cb5..0600431e 100644 --- a/src/cairo-output-stream-private.h +++ b/src/cairo-output-stream-private.h @@ -37,7 +37,7 @@ #ifndef CAIRO_OUTPUT_STREAM_PRIVATE_H #define CAIRO_OUTPUT_STREAM_PRIVATE_H -typedef struct _cairo_output_stream cairo_output_stream_t; +#include "cairo-types-private.h" typedef cairo_status_t (*cairo_output_stream_write_func_t) (cairo_output_stream_t *output_stream, const unsigned char *data, diff --git a/src/cairo-pdf-surface-private.h b/src/cairo-pdf-surface-private.h new file mode 100644 index 00000000..2d35a116 --- /dev/null +++ b/src/cairo-pdf-surface-private.h @@ -0,0 +1,83 @@ +/* Cairo - a vector graphics library with display and print output + * + * Copyright © 2005 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 Red Hat, Inc. + */ + +#ifndef CAIRO_PDF_SURFACE_PRIVATE_H +#define CAIRO_PDF_SURFACE_PRIVATE_H + +#include "cairo-pdf.h" + +#include "cairo-surface-private.h" + +typedef struct _cairo_pdf_resource { + unsigned int id; +} cairo_pdf_resource_t; + +typedef struct _cairo_pdf_surface cairo_pdf_surface_t; + +struct _cairo_pdf_surface { + cairo_surface_t base; + + /* Prefer the name "output" here to avoid confusion over the + * structure within a PDF document known as a "stream". */ + cairo_output_stream_t *output; + + double width; + double height; + + cairo_array_t objects; + cairo_array_t pages; + cairo_array_t patterns; + cairo_array_t xobjects; + cairo_array_t streams; + cairo_array_t alphas; + + cairo_scaled_font_subsets_t *font_subsets; + cairo_array_t fonts; + + cairo_pdf_resource_t next_available_resource; + cairo_pdf_resource_t pages_resource; + + struct { + cairo_bool_t active; + cairo_pdf_resource_t self; + cairo_pdf_resource_t length; + long start_offset; + cairo_bool_t compressed; + cairo_output_stream_t *old_output; + } current_stream; + + cairo_bool_t has_clip; + + cairo_paginated_mode_t paginated_mode; +}; + +#endif /* CAIRO_PDF_SURFACE_PRIVATE_H */ diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index f4e6f900..5c033041 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -39,6 +39,7 @@ #include "cairoint.h" #include "cairo-pdf.h" #include "cairo-pdf-test.h" +#include "cairo-pdf-surface-private.h" #include "cairo-scaled-font-subsets-private.h" #include "cairo-paginated-surface-private.h" #include "cairo-path-fixed-private.h" @@ -91,53 +92,12 @@ typedef struct _cairo_pdf_object { long offset; } cairo_pdf_object_t; -typedef struct _cairo_pdf_resource { - unsigned int id; -} cairo_pdf_resource_t; - typedef struct _cairo_pdf_font { unsigned int font_id; unsigned int subset_id; cairo_pdf_resource_t subset_resource; } cairo_pdf_font_t; -typedef struct _cairo_pdf_surface { - cairo_surface_t base; - - /* Prefer the name "output" here to avoid confusion over the - * structure within a PDF document known as a "stream". */ - cairo_output_stream_t *output; - - double width; - double height; - - cairo_array_t objects; - cairo_array_t pages; - cairo_array_t patterns; - cairo_array_t xobjects; - cairo_array_t streams; - cairo_array_t alphas; - - cairo_scaled_font_subsets_t *font_subsets; - cairo_array_t fonts; - - cairo_pdf_resource_t next_available_resource; - cairo_pdf_resource_t pages_resource; - - struct { - cairo_bool_t active; - cairo_pdf_resource_t self; - cairo_pdf_resource_t length; - long start_offset; - cairo_bool_t compressed; - cairo_output_stream_t *old_output; - } current_stream; - - cairo_bool_t has_clip; - - cairo_paginated_mode_t paginated_mode; -} cairo_pdf_surface_t; - static cairo_pdf_resource_t _cairo_pdf_surface_new_object (cairo_pdf_surface_t *surface); diff --git a/src/cairo-scaled-font-subsets-private.h b/src/cairo-scaled-font-subsets-private.h index e4e320c7..5b9467a9 100644 --- a/src/cairo-scaled-font-subsets-private.h +++ b/src/cairo-scaled-font-subsets-private.h @@ -39,8 +39,6 @@ #include "cairoint.h" -typedef struct _cairo_scaled_font_subsets cairo_scaled_font_subsets_t; - typedef struct _cairo_scaled_font_subsets_glyph { unsigned int font_id; unsigned int subset_id; diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h index ce68c8dd..bb6de79e 100644 --- a/src/cairo-types-private.h +++ b/src/cairo-types-private.h @@ -59,6 +59,9 @@ struct _cairo_font_options { typedef struct _cairo_surface_backend cairo_surface_backend_t; typedef struct _cairo_clip cairo_clip_t; +typedef struct _cairo_output_stream cairo_output_stream_t; +typedef struct _cairo_scaled_font_subsets cairo_scaled_font_subsets_t; + typedef struct _cairo_xlib_screen_info cairo_xlib_screen_info_t; |