/*
 * This file was generated automatically by ExtUtils::ParseXS version 3.35 from the
 * contents of CairoPattern.xs. Do not edit this file, edit CairoPattern.xs instead.
 *
 *    ANY CHANGES MADE HERE WILL BE LOST!
 *
 */

#line 1 "CairoPattern.xs"
/*
 * Copyright (c) 2004-2005 by the cairo perl team (see the file README)
 *
 * Licensed under the LGPL, see LICENSE file for more information.
 *
 * $Id$
 */

#include <cairo-perl.h>
#include <cairo-perl-private.h>

#include "ppport.h"

static const char *
get_package (cairo_pattern_t *pattern)
{
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0)
	cairo_pattern_type_t type;
	const char *package;

	type = cairo_pattern_get_type (pattern);
	switch (type) {
	    case CAIRO_PATTERN_TYPE_SOLID:
		package = "Cairo::SolidPattern";
		break;

	    case CAIRO_PATTERN_TYPE_SURFACE:
		package = "Cairo::SurfacePattern";
		break;

	    case CAIRO_PATTERN_TYPE_LINEAR:
		package = "Cairo::LinearGradient";
		break;

	    case CAIRO_PATTERN_TYPE_RADIAL:
		package = "Cairo::RadialGradient";
		break;

	    default:
		warn ("unknown pattern type %d encountered", type);
		package = "Cairo::Pattern";
		break;
	}

	return package;
#else
	const char *package = cairo_perl_package_table_lookup (pattern);
	return package ? package : "Cairo::Pattern";
#endif
}

SV *
cairo_pattern_to_sv (cairo_pattern_t *pattern)
{
	SV *sv = newSV (0);
	sv_setref_pv(sv, get_package (pattern), pattern);
	return sv;
}

/* ------------------------------------------------------------------------- */

#line 72 "CairoPattern.c"
#ifndef PERL_UNUSED_VAR
#  define PERL_UNUSED_VAR(var) if (0) var = var
#endif

#ifndef dVAR
#  define dVAR		dNOOP
#endif


/* This stuff is not part of the API! You have been warned. */
#ifndef PERL_VERSION_DECIMAL
#  define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
#endif
#ifndef PERL_DECIMAL_VERSION
#  define PERL_DECIMAL_VERSION \
	  PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
#endif
#ifndef PERL_VERSION_GE
#  define PERL_VERSION_GE(r,v,s) \
	  (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
#endif
#ifndef PERL_VERSION_LE
#  define PERL_VERSION_LE(r,v,s) \
	  (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
#endif

/* XS_INTERNAL is the explicit static-linkage variant of the default
 * XS macro.
 *
 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
 * for anything but the BOOT XSUB.
 *
 * See XSUB.h in core!
 */


/* TODO: This might be compatible further back than 5.10.0. */
#if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
#  undef XS_EXTERNAL
#  undef XS_INTERNAL
#  if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
#    define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
#    define XS_INTERNAL(name) STATIC XSPROTO(name)
#  endif
#  if defined(__SYMBIAN32__)
#    define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
#    define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
#  endif
#  ifndef XS_EXTERNAL
#    if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
#      define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
#      define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
#    else
#      ifdef __cplusplus
#        define XS_EXTERNAL(name) extern "C" XSPROTO(name)
#        define XS_INTERNAL(name) static XSPROTO(name)
#      else
#        define XS_EXTERNAL(name) XSPROTO(name)
#        define XS_INTERNAL(name) STATIC XSPROTO(name)
#      endif
#    endif
#  endif
#endif

/* perl >= 5.10.0 && perl <= 5.15.1 */


/* The XS_EXTERNAL macro is used for functions that must not be static
 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
 * macro defined, the best we can do is assume XS is the same.
 * Dito for XS_INTERNAL.
 */
#ifndef XS_EXTERNAL
#  define XS_EXTERNAL(name) XS(name)
#endif
#ifndef XS_INTERNAL
#  define XS_INTERNAL(name) XS(name)
#endif

/* Now, finally, after all this mess, we want an ExtUtils::ParseXS
 * internal macro that we're free to redefine for varying linkage due
 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
 */

#undef XS_EUPXS
#if defined(PERL_EUPXS_ALWAYS_EXPORT)
#  define XS_EUPXS(name) XS_EXTERNAL(name)
#else
   /* default to internal */
#  define XS_EUPXS(name) XS_INTERNAL(name)
#endif

#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)

/* prototype to pass -Wmissing-prototypes */
STATIC void
S_croak_xs_usage(const CV *const cv, const char *const params);

STATIC void
S_croak_xs_usage(const CV *const cv, const char *const params)
{
    const GV *const gv = CvGV(cv);

    PERL_ARGS_ASSERT_CROAK_XS_USAGE;

    if (gv) {
        const char *const gvname = GvNAME(gv);
        const HV *const stash = GvSTASH(gv);
        const char *const hvname = stash ? HvNAME(stash) : NULL;

        if (hvname)
	    Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
        else
	    Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
    } else {
        /* Pants. I don't think that it should be possible to get here. */
	Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
    }
}
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE

#define croak_xs_usage        S_croak_xs_usage

#endif

/* NOTE: the prototype of newXSproto() is different in versions of perls,
 * so we define a portable version of newXSproto()
 */
#ifdef newXS_flags
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
#else
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
#endif /* !defined(newXS_flags) */

#if PERL_VERSION_LE(5, 21, 5)
#  define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
#else
#  define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
#endif

#line 216 "CairoPattern.c"

XS_EUPXS(XS_Cairo__Pattern_DESTROY); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__Pattern_DESTROY)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pattern");
    {
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;
#line 66 "CairoPattern.xs"
	cairo_pattern_destroy (pattern);
#line 229 "CairoPattern.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Cairo__Pattern_set_matrix); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__Pattern_set_matrix)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "pattern, matrix");
    {
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;
	cairo_matrix_t *	matrix = SvCairoMatrix (ST(1))
;

	cairo_pattern_set_matrix(pattern, matrix);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Cairo__Pattern_get_matrix); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__Pattern_get_matrix)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pattern");
    {
#line 73 "CairoPattern.xs"
	cairo_matrix_t matrix;
#line 262 "CairoPattern.c"
	cairo_matrix_t *	RETVAL;
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;
#line 75 "CairoPattern.xs"
	cairo_pattern_get_matrix (pattern, &matrix);
	RETVAL = cairo_perl_copy_matrix (&matrix);
#line 269 "CairoPattern.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVCairoMatrix (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Cairo__Pattern_status); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__Pattern_status)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pattern");
    {
	cairo_status_t	RETVAL;
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;

	RETVAL = cairo_pattern_status(pattern);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVCairoStatus (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Cairo__Pattern_set_extend); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__Pattern_set_extend)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "pattern, extend");
    {
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;
	cairo_extend_t	extend = SvCairoExtend (ST(1))
;

	cairo_pattern_set_extend(pattern, extend);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Cairo__Pattern_set_filter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__Pattern_set_filter)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "pattern, filter");
    {
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;
	cairo_filter_t	filter = SvCairoFilter (ST(1))
;

	cairo_pattern_set_filter(pattern, filter);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Cairo__Pattern_get_filter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__Pattern_get_filter)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pattern");
    {
	cairo_filter_t	RETVAL;
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;

	RETVAL = cairo_pattern_get_filter(pattern);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVCairoFilter (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Cairo__Pattern_get_extend); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__Pattern_get_extend)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pattern");
    {
	cairo_extend_t	RETVAL;
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;

	RETVAL = cairo_pattern_get_extend(pattern);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVCairoExtend (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0)
#define XSubPPtmpAAAA 1


XS_EUPXS(XS_Cairo__Pattern_get_type); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__Pattern_get_type)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pattern");
    {
	cairo_pattern_type_t	RETVAL;
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;

	RETVAL = cairo_pattern_get_type(pattern);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVCairoPatternType (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#endif

XS_EUPXS(XS_Cairo__SolidPattern_create_rgb); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__SolidPattern_create_rgb)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "class, red, green, blue");
    {
	cairo_pattern_t_noinc *	RETVAL;
	double	red = (double)SvNV(ST(1))
;
	double	green = (double)SvNV(ST(2))
;
	double	blue = (double)SvNV(ST(3))
;

	RETVAL = cairo_pattern_create_rgb(red, green, blue);
#line 108 "CairoPattern.xs"
#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0)
	cairo_perl_package_table_insert (RETVAL, "Cairo::SolidPattern");
#endif
#line 433 "CairoPattern.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVCairoPattern_noinc (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Cairo__SolidPattern_create_rgba); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__SolidPattern_create_rgba)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "class, red, green, blue, alpha");
    {
	cairo_pattern_t_noinc *	RETVAL;
	double	red = (double)SvNV(ST(1))
;
	double	green = (double)SvNV(ST(2))
;
	double	blue = (double)SvNV(ST(3))
;
	double	alpha = (double)SvNV(ST(4))
;

	RETVAL = cairo_pattern_create_rgba(red, green, blue, alpha);
#line 117 "CairoPattern.xs"
#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0)
	cairo_perl_package_table_insert (RETVAL, "Cairo::SolidPattern");
#endif
#line 467 "CairoPattern.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVCairoPattern_noinc (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 4, 0)
#define XSubPPtmpAAAB 1


XS_EUPXS(XS_Cairo__SolidPattern_get_rgba); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__SolidPattern_get_rgba)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pattern");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 126 "CairoPattern.xs"
	cairo_status_t status;
	double red, green, blue, alpha;
#line 494 "CairoPattern.c"
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;
#line 129 "CairoPattern.xs"
	status = cairo_pattern_get_rgba (pattern, &red, &green, &blue, &alpha);
	CAIRO_PERL_CHECK_STATUS (status);
	EXTEND (sp, 4);
	PUSHs (sv_2mortal (newSVnv (red)));
	PUSHs (sv_2mortal (newSVnv (green)));
	PUSHs (sv_2mortal (newSVnv (blue)));
	PUSHs (sv_2mortal (newSVnv (alpha)));
#line 505 "CairoPattern.c"
	PUTBACK;
	return;
    }
}

#endif

XS_EUPXS(XS_Cairo__SurfacePattern_create); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__SurfacePattern_create)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, surface");
    {
	cairo_pattern_t_noinc *	RETVAL;
	cairo_surface_t *	surface = SvCairoSurface (ST(1))
;
#line 148 "CairoPattern.xs"
	RETVAL = cairo_pattern_create_for_surface (surface);
#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0)
	cairo_perl_package_table_insert (RETVAL, "Cairo::SurfacePattern");
#endif
#line 528 "CairoPattern.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVCairoPattern_noinc (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 4, 0)
#define XSubPPtmpAAAC 1


XS_EUPXS(XS_Cairo__SurfacePattern_get_surface); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__SurfacePattern_get_surface)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pattern");
    {
#line 160 "CairoPattern.xs"
	cairo_status_t status;
#line 552 "CairoPattern.c"
	cairo_surface_t *	RETVAL;
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;
#line 162 "CairoPattern.xs"
	status = cairo_pattern_get_surface (pattern, &RETVAL);
	CAIRO_PERL_CHECK_STATUS (status);
#line 559 "CairoPattern.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVCairoSurface (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#endif

XS_EUPXS(XS_Cairo__Gradient_add_color_stop_rgb); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__Gradient_add_color_stop_rgb)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "pattern, offset, red, green, blue");
    {
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;
	double	offset = (double)SvNV(ST(1))
;
	double	red = (double)SvNV(ST(2))
;
	double	green = (double)SvNV(ST(3))
;
	double	blue = (double)SvNV(ST(4))
;

	cairo_pattern_add_color_stop_rgb(pattern, offset, red, green, blue);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Cairo__Gradient_add_color_stop_rgba); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__Gradient_add_color_stop_rgba)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "pattern, offset, red, green, blue, alpha");
    {
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;
	double	offset = (double)SvNV(ST(1))
;
	double	red = (double)SvNV(ST(2))
;
	double	green = (double)SvNV(ST(3))
;
	double	blue = (double)SvNV(ST(4))
;
	double	alpha = (double)SvNV(ST(5))
;

	cairo_pattern_add_color_stop_rgba(pattern, offset, red, green, blue, alpha);
    }
    XSRETURN_EMPTY;
}

#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 4, 0)
#define XSubPPtmpAAAD 1


XS_EUPXS(XS_Cairo__Gradient_get_color_stops); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__Gradient_get_color_stops)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pattern");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 186 "CairoPattern.xs"
	cairo_status_t status;
	int count, i;
	double offset, red, green, blue, alpha;
#line 638 "CairoPattern.c"
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;
#line 190 "CairoPattern.xs"
	status = cairo_pattern_get_color_stop_count (pattern, &count);
	CAIRO_PERL_CHECK_STATUS (status);
	EXTEND (sp, count);
	for (i = 0; i < count; i++) {
		AV *av;
		status = cairo_pattern_get_color_stop_rgba (pattern, i, &offset, &red, &green, &blue, &alpha);
		CAIRO_PERL_CHECK_STATUS (status);
		av = newAV ();
		av_push (av, newSVnv (offset));
		av_push (av, newSVnv (red));
		av_push (av, newSVnv (green));
		av_push (av, newSVnv (blue));
		av_push (av, newSVnv (alpha));
		PUSHs (sv_2mortal (newRV_noinc ((SV *) av)));
	}
#line 657 "CairoPattern.c"
	PUTBACK;
	return;
    }
}

#endif

XS_EUPXS(XS_Cairo__LinearGradient_create); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__LinearGradient_create)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "class, x0, y0, x1, y1");
    {
	cairo_pattern_t_noinc *	RETVAL;
	double	x0 = (double)SvNV(ST(1))
;
	double	y0 = (double)SvNV(ST(2))
;
	double	x1 = (double)SvNV(ST(3))
;
	double	y1 = (double)SvNV(ST(4))
;
#line 217 "CairoPattern.xs"
	RETVAL = cairo_pattern_create_linear (x0, y0, x1, y1);
#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0)
	cairo_perl_package_table_insert (RETVAL, "Cairo::LinearGradient");
#endif
#line 686 "CairoPattern.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVCairoPattern_noinc (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 4, 0)
#define XSubPPtmpAAAE 1


XS_EUPXS(XS_Cairo__LinearGradient_get_points); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__LinearGradient_get_points)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pattern");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 229 "CairoPattern.xs"
	cairo_status_t status;
	double x0, y0, x1, y1;
#line 713 "CairoPattern.c"
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;
#line 232 "CairoPattern.xs"
	status = cairo_pattern_get_linear_points (pattern, &x0, &y0, &x1, &y1);
	CAIRO_PERL_CHECK_STATUS (status);
	EXTEND (sp, 4);
	PUSHs (sv_2mortal (newSVnv (x0)));
	PUSHs (sv_2mortal (newSVnv (y0)));
	PUSHs (sv_2mortal (newSVnv (x1)));
	PUSHs (sv_2mortal (newSVnv (y1)));
#line 724 "CairoPattern.c"
	PUTBACK;
	return;
    }
}

#endif

XS_EUPXS(XS_Cairo__RadialGradient_create); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__RadialGradient_create)
{
    dVAR; dXSARGS;
    if (items != 7)
       croak_xs_usage(cv,  "class, cx0, cy0, radius0, cx1, cy1, radius1");
    {
	cairo_pattern_t_noinc *	RETVAL;
	double	cx0 = (double)SvNV(ST(1))
;
	double	cy0 = (double)SvNV(ST(2))
;
	double	radius0 = (double)SvNV(ST(3))
;
	double	cx1 = (double)SvNV(ST(4))
;
	double	cy1 = (double)SvNV(ST(5))
;
	double	radius1 = (double)SvNV(ST(6))
;
#line 251 "CairoPattern.xs"
	RETVAL = cairo_pattern_create_radial (cx0, cy0, radius0, cx1, cy1, radius1);
#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0)
	cairo_perl_package_table_insert (RETVAL, "Cairo::RadialGradient");
#endif
#line 757 "CairoPattern.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVCairoPattern_noinc (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 4, 0)
#define XSubPPtmpAAAF 1


XS_EUPXS(XS_Cairo__RadialGradient_get_circles); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Cairo__RadialGradient_get_circles)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pattern");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 263 "CairoPattern.xs"
	cairo_status_t status;
	double x0, y0, r0, x1, y1, r1;
#line 784 "CairoPattern.c"
	cairo_pattern_t *	pattern = SvCairoPattern (ST(0))
;
#line 266 "CairoPattern.xs"
	status = cairo_pattern_get_radial_circles (pattern, &x0, &y0, &r0, &x1, &y1, &r1);
	CAIRO_PERL_CHECK_STATUS (status);
	EXTEND (sp, 6);
	PUSHs (sv_2mortal (newSVnv (x0)));
	PUSHs (sv_2mortal (newSVnv (y0)));
	PUSHs (sv_2mortal (newSVnv (r0)));
	PUSHs (sv_2mortal (newSVnv (x1)));
	PUSHs (sv_2mortal (newSVnv (y1)));
	PUSHs (sv_2mortal (newSVnv (r1)));
#line 797 "CairoPattern.c"
	PUTBACK;
	return;
    }
}

#endif
#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Cairo__Pattern); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Cairo__Pattern)
{
#if PERL_VERSION_LE(5, 21, 5)
    dVAR; dXSARGS;
#else
    dVAR; dXSBOOTARGSXSAPIVERCHK;
#endif
#if (PERL_REVISION == 5 && PERL_VERSION < 9)
    char* file = __FILE__;
#else
    const char* file = __FILE__;
#endif

    PERL_UNUSED_VAR(file);

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
#if PERL_VERSION_LE(5, 21, 5)
    XS_VERSION_BOOTCHECK;
#  ifdef XS_APIVERSION_BOOTCHECK
    XS_APIVERSION_BOOTCHECK;
#  endif
#endif

        newXS_deffile("Cairo::Pattern::DESTROY", XS_Cairo__Pattern_DESTROY);
        newXS_deffile("Cairo::Pattern::set_matrix", XS_Cairo__Pattern_set_matrix);
        newXS_deffile("Cairo::Pattern::get_matrix", XS_Cairo__Pattern_get_matrix);
        newXS_deffile("Cairo::Pattern::status", XS_Cairo__Pattern_status);
        newXS_deffile("Cairo::Pattern::set_extend", XS_Cairo__Pattern_set_extend);
        newXS_deffile("Cairo::Pattern::set_filter", XS_Cairo__Pattern_set_filter);
        newXS_deffile("Cairo::Pattern::get_filter", XS_Cairo__Pattern_get_filter);
        newXS_deffile("Cairo::Pattern::get_extend", XS_Cairo__Pattern_get_extend);
#if XSubPPtmpAAAA
        newXS_deffile("Cairo::Pattern::get_type", XS_Cairo__Pattern_get_type);
#endif
        newXS_deffile("Cairo::SolidPattern::create_rgb", XS_Cairo__SolidPattern_create_rgb);
        newXS_deffile("Cairo::SolidPattern::create_rgba", XS_Cairo__SolidPattern_create_rgba);
#if XSubPPtmpAAAB
        newXS_deffile("Cairo::SolidPattern::get_rgba", XS_Cairo__SolidPattern_get_rgba);
#endif
        newXS_deffile("Cairo::SurfacePattern::create", XS_Cairo__SurfacePattern_create);
#if XSubPPtmpAAAC
        newXS_deffile("Cairo::SurfacePattern::get_surface", XS_Cairo__SurfacePattern_get_surface);
#endif
        newXS_deffile("Cairo::Gradient::add_color_stop_rgb", XS_Cairo__Gradient_add_color_stop_rgb);
        newXS_deffile("Cairo::Gradient::add_color_stop_rgba", XS_Cairo__Gradient_add_color_stop_rgba);
#if XSubPPtmpAAAD
        newXS_deffile("Cairo::Gradient::get_color_stops", XS_Cairo__Gradient_get_color_stops);
#endif
        newXS_deffile("Cairo::LinearGradient::create", XS_Cairo__LinearGradient_create);
#if XSubPPtmpAAAE
        newXS_deffile("Cairo::LinearGradient::get_points", XS_Cairo__LinearGradient_get_points);
#endif
        newXS_deffile("Cairo::RadialGradient::create", XS_Cairo__RadialGradient_create);
#if XSubPPtmpAAAF
        newXS_deffile("Cairo::RadialGradient::get_circles", XS_Cairo__RadialGradient_get_circles);
#endif

    /* Initialisation Section */

#if XSubPPtmpAAAA
#endif
#line 101 "CairoPattern.xs"
	cairo_perl_set_isa ("Cairo::SolidPattern", "Cairo::Pattern");

#if XSubPPtmpAAAB
#endif
#line 144 "CairoPattern.xs"
	cairo_perl_set_isa ("Cairo::SurfacePattern", "Cairo::Pattern");

#if XSubPPtmpAAAC
#endif
#line 174 "CairoPattern.xs"
	cairo_perl_set_isa ("Cairo::Gradient", "Cairo::Pattern");

#if XSubPPtmpAAAD
#endif
#line 213 "CairoPattern.xs"
	cairo_perl_set_isa ("Cairo::LinearGradient", "Cairo::Gradient");

#if XSubPPtmpAAAE
#endif
#line 247 "CairoPattern.xs"
	cairo_perl_set_isa ("Cairo::RadialGradient", "Cairo::Gradient");

#if XSubPPtmpAAAF
#endif
#line 895 "CairoPattern.c"

    /* End of Initialisation Section */

#if PERL_VERSION_LE(5, 21, 5)
#  if PERL_VERSION_GE(5, 9, 0)
    if (PL_unitcheckav)
        call_list(PL_scopestack_ix, PL_unitcheckav);
#  endif
    XSRETURN_YES;
#else
    Perl_xs_boot_epilog(aTHX_ ax);
#endif
}

