diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2007-04-20 03:33:58 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2007-04-21 02:51:22 -0400 |
commit | 3885fff3e6215023e801dd2c72fc39560a4e22fd (patch) | |
tree | 48b296216b6eac07a6e72c703e4040c5469ed0b1 /boilerplate | |
parent | 57dc972d6e5fe715a83cbcaad9c6cc3d38bf8129 (diff) |
[ps] Get rid of _cairo_ps_test_force_fallbacks
in favor of cairo_boilerplate_ps_surface_force_fallbacks.
Diffstat (limited to 'boilerplate')
-rw-r--r-- | boilerplate/Makefile.am | 1 | ||||
-rw-r--r-- | boilerplate/cairo-boilerplate-ps.c | 15 | ||||
-rw-r--r-- | boilerplate/cairo-boilerplate-ps.h | 33 |
3 files changed, 49 insertions, 0 deletions
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am index 8092c1b7..1528409a 100644 --- a/boilerplate/Makefile.am +++ b/boilerplate/Makefile.am @@ -44,6 +44,7 @@ endif if CAIRO_HAS_PS_SURFACE libcairoboilerplate_la_SOURCES += cairo-boilerplate-ps.c +libcairoboilerplate_la_SOURCES += cairo-boilerplate-ps.h libcairoboilerplate_la_SOURCES += cairo-boilerplate-ps-private.h endif diff --git a/boilerplate/cairo-boilerplate-ps.c b/boilerplate/cairo-boilerplate-ps.c index 676d3e86..291ac2e9 100644 --- a/boilerplate/cairo-boilerplate-ps.c +++ b/boilerplate/cairo-boilerplate-ps.c @@ -25,9 +25,11 @@ */ #include "cairo-boilerplate.h" +#include "cairo-boilerplate-ps.h" #include "cairo-boilerplate-ps-private.h" #include <cairo-ps.h> +#include <cairo-ps-surface-private.h> cairo_user_data_key_t ps_closure_key; @@ -136,3 +138,16 @@ _cairo_boilerplate_ps_cleanup (void *closure) free (ptc->filename); free (ptc); } + +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; + + if (cairo_surface_get_type (abstract_surface) != CAIRO_SURFACE_TYPE_PS) + return CAIRO_STATUS_SURFACE_TYPE_MISMATCH; + + surface->force_fallbacks = TRUE; + + return CAIRO_STATUS_SUCCESS; +} diff --git a/boilerplate/cairo-boilerplate-ps.h b/boilerplate/cairo-boilerplate-ps.h new file mode 100644 index 00000000..5cc5c18f --- /dev/null +++ b/boilerplate/cairo-boilerplate-ps.h @@ -0,0 +1,33 @@ +/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */ +/* + * Copyright © 2007 Red Hat, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without + * fee, provided that the above copyright notice appear in all copies + * and that both that copyright notice and this permission notice + * appear in supporting documentation, and that the name of + * Red Hat, Inc. not be used in advertising or publicity pertaining to + * distribution of the software without specific, written prior + * permission. Red Hat, Inc. makes no representations about the + * suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR + * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Behdad Esfahbod <behdad@behdad.org> + */ + +#ifndef _CAIRO_BOILERPLATE_PS_H_ +#define _CAIRO_BOILERPLATE_PS_H_ + +cairo_status_t +cairo_boilerplate_ps_surface_force_fallbacks (cairo_surface_t *surface); + +#endif |