diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2007-04-21 02:50:53 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2007-04-21 02:50:53 -0400 |
commit | 20ce190e71f838dea598cbd5267f047b75945cee (patch) | |
tree | 879197162175ed1e01be8363c152e60c3d772115 /boilerplate | |
parent | 03477064fa639ab1c735467d1889bde7c99313c4 (diff) |
[pdf] Get rid of _cairo_pdf_test_force_fallbacks
in favor of cairo_boilerplate_pdf_surface_force_fallbacks.
Diffstat (limited to 'boilerplate')
-rw-r--r-- | boilerplate/Makefile.am | 1 | ||||
-rw-r--r-- | boilerplate/cairo-boilerplate-pdf.c | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am index cccec915..8092c1b7 100644 --- a/boilerplate/Makefile.am +++ b/boilerplate/Makefile.am @@ -38,6 +38,7 @@ endif if CAIRO_HAS_PDF_SURFACE libcairoboilerplate_la_SOURCES += cairo-boilerplate-pdf.c +libcairoboilerplate_la_SOURCES += cairo-boilerplate-pdf.h libcairoboilerplate_la_SOURCES += cairo-boilerplate-pdf-private.h endif diff --git a/boilerplate/cairo-boilerplate-pdf.c b/boilerplate/cairo-boilerplate-pdf.c index 13f9ef86..e0a610e7 100644 --- a/boilerplate/cairo-boilerplate-pdf.c +++ b/boilerplate/cairo-boilerplate-pdf.c @@ -25,9 +25,12 @@ */ #include "cairo-boilerplate.h" +#include "cairo-boilerplate-pdf.h" #include "cairo-boilerplate-pdf-private.h" #include <cairo-pdf.h> +#include <cairo-pdf-surface-private.h> +#include <cairo-paginated-surface-private.h> cairo_user_data_key_t pdf_closure_key; @@ -132,3 +135,19 @@ _cairo_boilerplate_pdf_cleanup (void *closure) free (ptc->filename); free (ptc); } + +cairo_status_t +cairo_boilerplate_pdf_surface_force_fallbacks (cairo_surface_t *abstract_surface) +{ + cairo_paginated_surface_t *paginated = (cairo_paginated_surface_t*) abstract_surface; + cairo_pdf_surface_t *surface; + + if (cairo_surface_get_type (abstract_surface) != CAIRO_SURFACE_TYPE_PDF) + return CAIRO_STATUS_SURFACE_TYPE_MISMATCH; + + surface = (cairo_pdf_surface_t*) paginated->target; + + surface->force_fallbacks = TRUE; + + return CAIRO_STATUS_SUCCESS; +} |