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

#line 1 "xs/PangoLayout.xs"
/*
 * Copyright (c) 2003-2005, 2014 by the gtk2-perl team (see the AUTHORS
 * file for a full list of authors)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * See the LICENSE file in the top-level directory of this distribution for
 * the full license terms.
 *
 */

#include "pango-perl.h"

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

#if !PANGO_CHECK_VERSION (1, 20, 0)

static gpointer
gtk2perl_pango_layout_iter_copy (gpointer boxed)
{
	croak ("Can't copy a PangoLayoutIter");
	return boxed;
}

#endif

GType
gtk2perl_pango_layout_iter_get_type (void)
{
	static GType t = 0;
	if (!t)
		t = g_boxed_type_register_static ("PangoLayoutIter",
#if PANGO_CHECK_VERSION (1, 20, 0)
		      (GBoxedCopyFunc) pango_layout_iter_copy,
#else
		      (GBoxedCopyFunc) gtk2perl_pango_layout_iter_copy,
#endif
		      (GBoxedFreeFunc) pango_layout_iter_free);
	return t;
}

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

GType
gtk2perl_pango_layout_line_get_type (void)
{
	static GType t = 0;
	if (!t)
		t = g_boxed_type_register_static ("PangoLayoutLine",
		      (GBoxedCopyFunc) pango_layout_line_ref,
		      (GBoxedFreeFunc) pango_layout_line_unref);
	return t;
}

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

SV *
newSVPangoRectangle (PangoRectangle * rectangle)
{
	HV * hv;

	if (!rectangle)
		return &PL_sv_undef;

	hv = newHV ();

	hv_store (hv, "x", 1, newSViv (rectangle->x), 0);
	hv_store (hv, "y", 1, newSViv (rectangle->y), 0);
	hv_store (hv, "width", 5, newSViv (rectangle->width), 0);
	hv_store (hv, "height", 6, newSViv (rectangle->height), 0);

	return newRV_noinc ((SV *) hv);
}

PangoRectangle *
SvPangoRectangle (SV * sv)
{
	PangoRectangle *rectangle;
	SV ** v;

	if (!gperl_sv_is_defined (sv))
		return NULL;

	rectangle = gperl_alloc_temp (sizeof (PangoRectangle));

	if (gperl_sv_is_hash_ref (sv)) {
		HV * hv = (HV *) SvRV (sv);

		v = hv_fetch (hv, "x", 1, 0);
		if (v && gperl_sv_is_defined (*v))
			rectangle->x = SvIV (*v);

		v = hv_fetch (hv, "y", 1, 0);
		if (v && gperl_sv_is_defined (*v))
			rectangle->y = SvIV (*v);

		v = hv_fetch (hv, "width", 5, 0);
		if (v && gperl_sv_is_defined (*v))
			rectangle->width = SvIV (*v);

		v = hv_fetch (hv, "height", 6, 0);
		if (v && gperl_sv_is_defined (*v))
			rectangle->height = SvIV (*v);
	} else if (gperl_sv_is_array_ref (sv)) {
		AV * av = (AV *) SvRV (sv);

		v = av_fetch (av, 0, 0);
		if (v && gperl_sv_is_defined (*v))
			rectangle->x = SvIV (*v);

		v = av_fetch (av, 1, 0);
		if (v && gperl_sv_is_defined (*v))
			rectangle->y = SvIV (*v);

		v = av_fetch (av, 2, 0);
		if (v && gperl_sv_is_defined (*v))
			rectangle->width = SvIV (*v);

		v = av_fetch (av, 3, 0);
		if (v && gperl_sv_is_defined (*v))
			rectangle->height = SvIV (*v);
	} else {
		croak ("a PangoRectangle must be a reference to a hash "
		       "or a reference to an array");
	}

	return rectangle;
}

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

static SV *
newSVPangoLogAttr (PangoLogAttr * logattr)
{
	HV * hv = newHV ();

#define STORE_BIT(key) \
	hv_store (hv, #key, sizeof (#key) - 1, newSVuv (logattr->key), 0)

	STORE_BIT (is_line_break);
	STORE_BIT (is_mandatory_break);
	STORE_BIT (is_char_break);
	STORE_BIT (is_white);
	STORE_BIT (is_cursor_position);
	STORE_BIT (is_word_start);
	STORE_BIT (is_word_end);
	STORE_BIT (is_sentence_boundary);
	STORE_BIT (is_sentence_start);
	STORE_BIT (is_sentence_end);
#if PANGO_CHECK_VERSION (1, 4, 0)
	STORE_BIT (backspace_deletes_character);
#endif
#if PANGO_CHECK_VERSION (1, 18, 0)
	STORE_BIT (is_expandable_space);
#endif

#undef STORE_BIT

	return newRV_noinc ((SV*) hv);
}

#line 179 "xs/PangoLayout.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 323 "xs/PangoLayout.c"

XS_EUPXS(XS_Pango__Layout_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_new)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, context");
    {
	PangoContext *	context = SvPangoContext (ST(1))
;
	PangoLayout_noinc *	RETVAL;

	RETVAL = pango_layout_new(context);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoLayout_noinc (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_copy); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_copy)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "src");
    {
	PangoLayout *	src = SvPangoLayout (ST(0))
;
	PangoLayout_noinc *	RETVAL;

	RETVAL = pango_layout_copy(src);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoLayout_noinc (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_get_context); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_context)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoContext *	RETVAL;

	RETVAL = pango_layout_get_context(layout);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoContext (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_set_attributes); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_set_attributes)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, attrs");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoAttrList_ornull *	attrs = SvPangoAttrList_ornull (ST(1))
;

	pango_layout_set_attributes(layout, attrs);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Pango__Layout_get_attributes); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_attributes)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoAttrList_ornull *	RETVAL;

	RETVAL = pango_layout_get_attributes(layout);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoAttrList_ornull (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_set_text); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_set_text)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, text");
    {
	STRLEN	STRLEN_length_of_text;
	int	XSauto_length_of_text;
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	const gchar_length *	text;

	XSauto_length_of_text = STRLEN_length_of_text;

	sv_utf8_upgrade (ST(1));
	text = (const gchar_length *)SvPV (ST(1), STRLEN_length_of_text);
        XSauto_length_of_text = STRLEN_length_of_text
;

	pango_layout_set_text(layout, text, XSauto_length_of_text);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Pango__Layout_get_text); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_text)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	const gchar *	RETVAL;

	RETVAL = pango_layout_get_text(layout);
	{
	    SV * RETVALSV;
	    RETVALSV = sv_newmortal();
	    /* same as newSVGChar(), but not in a function */
	    sv_setpv ((SV*)RETVALSV, RETVAL);
	    SvUTF8_on (RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_set_markup); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_set_markup)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, markup");
    {
	STRLEN	STRLEN_length_of_markup;
	int	XSauto_length_of_markup;
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	const gchar_length *	markup;

	XSauto_length_of_markup = STRLEN_length_of_markup;

	sv_utf8_upgrade (ST(1));
	markup = (const gchar_length *)SvPV (ST(1), STRLEN_length_of_markup);
        XSauto_length_of_markup = STRLEN_length_of_markup
;

	pango_layout_set_markup(layout, markup, XSauto_length_of_markup);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Pango__Layout_set_markup_with_accel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_set_markup_with_accel)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "layout, markup, accel_marker");
    {
	STRLEN	STRLEN_length_of_markup;
	int	XSauto_length_of_markup;
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	const char *	markup = (const char *)SvPV(ST(1), STRLEN_length_of_markup);
	gunichar	accel_marker = g_utf8_get_char (SvGChar (ST(2)))
;
	gunichar	accel_char;

	XSauto_length_of_markup = STRLEN_length_of_markup;

	pango_layout_set_markup_with_accel(layout, markup, XSauto_length_of_markup, accel_marker, &accel_char);
	XSprePUSH;	EXTEND(SP,1);
	PUSHs(sv_newmortal());
	{
	gchar temp[6];
	gint length = g_unichar_to_utf8 (accel_char, temp);
	sv_setpvn ((SV*)ST(0), temp, length);
	SvUTF8_on (ST(0));
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_set_font_description); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_set_font_description)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, desc");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoFontDescription_ornull *	desc = SvPangoFontDescription_ornull (ST(1))
;

	pango_layout_set_font_description(layout, desc);
    }
    XSRETURN_EMPTY;
}

#if PANGO_CHECK_VERSION (1, 8, 0)
#define XSubPPtmpAAAA 1


XS_EUPXS(XS_Pango__Layout_get_font_description); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_font_description)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	const PangoFontDescription_ornull *	RETVAL;
	PangoLayout *	layout = SvPangoLayout (ST(0))
;

	RETVAL = pango_layout_get_font_description(layout);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoFontDescription_ornull (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#endif

XS_EUPXS(XS_Pango__Layout_get_width); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_width)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	int	RETVAL;
	dXSTARG;
#line 242 "xs/PangoLayout.xs"
	switch (ix) {
		case 0: RETVAL = pango_layout_get_width (layout); break;
		case 1: RETVAL = pango_layout_get_indent (layout); break;
		case 2: RETVAL = pango_layout_get_spacing (layout); break;
		case 3: RETVAL = pango_layout_get_justify (layout); break;
		case 4: RETVAL = pango_layout_get_single_paragraph_mode (layout); break;
		default:
			RETVAL = 0;
			g_assert_not_reached ();
	}
#line 612 "xs/PangoLayout.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_set_width); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_set_width)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "layout, newval");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	int	newval = (int)SvIV(ST(1))
;
#line 270 "xs/PangoLayout.xs"
	switch (ix) {
		case 0: pango_layout_set_width (layout, newval); break;
		case 1: pango_layout_set_indent (layout, newval); break;
		case 2: pango_layout_set_spacing (layout, newval); break;
		case 3: pango_layout_set_justify (layout, newval); break;
		case 4: pango_layout_set_single_paragraph_mode (layout, newval); break;
		default:
			g_assert_not_reached ();
	}
#line 641 "xs/PangoLayout.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Pango__Layout_set_wrap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_set_wrap)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, wrap");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoWrapMode	wrap = SvPangoWrapMode (ST(1))
;

	pango_layout_set_wrap(layout, wrap);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Pango__Layout_get_wrap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_wrap)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoWrapMode	RETVAL;

	RETVAL = pango_layout_get_wrap(layout);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoWrapMode (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#if PANGO_CHECK_VERSION (1, 6, 0)
#define XSubPPtmpAAAB 1


XS_EUPXS(XS_Pango__Layout_set_ellipsize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_set_ellipsize)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, ellipsize");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoEllipsizeMode	ellipsize = SvPangoEllipsizeMode (ST(1))
;

	pango_layout_set_ellipsize(layout, ellipsize);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Pango__Layout_get_ellipsize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_ellipsize)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoEllipsizeMode	RETVAL;

	RETVAL = pango_layout_get_ellipsize(layout);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoEllipsizeMode (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#endif
#if PANGO_CHECK_VERSION (1, 4, 0)
#define XSubPPtmpAAAC 1


XS_EUPXS(XS_Pango__Layout_set_auto_dir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_set_auto_dir)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, auto_dir");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	gboolean	auto_dir = (bool)SvTRUE(ST(1))
;

	pango_layout_set_auto_dir(layout, auto_dir);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Pango__Layout_get_auto_dir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_auto_dir)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	gboolean	RETVAL;

	RETVAL = pango_layout_get_auto_dir(layout);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}

#endif

XS_EUPXS(XS_Pango__Layout_set_alignment); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_set_alignment)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, alignment");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoAlignment	alignment = SvPangoAlignment (ST(1))
;

	pango_layout_set_alignment(layout, alignment);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Pango__Layout_get_alignment); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_alignment)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoAlignment	RETVAL;

	RETVAL = pango_layout_get_alignment(layout);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoAlignment (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_set_tabs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_set_tabs)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, tabs");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoTabArray_ornull *	tabs = SvPangoTabArray_ornull (ST(1))
;

	pango_layout_set_tabs(layout, tabs);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Pango__Layout_get_tabs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_tabs)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoTabArray_own_ornull *	RETVAL;

	RETVAL = pango_layout_get_tabs(layout);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoTabArray_own_ornull (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_context_changed); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_context_changed)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;

	pango_layout_context_changed(layout);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Pango__Layout_get_log_attrs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_log_attrs)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
#line 358 "xs/PangoLayout.xs"
	PangoLogAttr * attrs = NULL;
	gint n_attrs;
#line 885 "xs/PangoLayout.c"
#line 361 "xs/PangoLayout.xs"
	pango_layout_get_log_attrs (layout, &attrs, &n_attrs);
	if (n_attrs) {
		int i;
		EXTEND (SP, n_attrs);
		for (i = 0 ; i < n_attrs; i++)
			PUSHs (sv_2mortal (newSVPangoLogAttr (attrs+i)));
		g_free (attrs);
	}
#line 895 "xs/PangoLayout.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Pango__Layout_index_to_pos); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_index_to_pos)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, index_");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	int	index_ = (int)SvIV(ST(1))
;
#line 376 "xs/PangoLayout.xs"
	PangoRectangle pos;
#line 915 "xs/PangoLayout.c"
	PangoRectangle *	RETVAL;
#line 378 "xs/PangoLayout.xs"
	pango_layout_index_to_pos (layout, index_, &pos);
	RETVAL = &pos;
#line 920 "xs/PangoLayout.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoRectangle (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_get_cursor_pos); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_cursor_pos)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, index_");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	int	index_ = (int)SvIV(ST(1))
;
#line 392 "xs/PangoLayout.xs"
	PangoRectangle strong_pos;
	PangoRectangle weak_pos;
#line 948 "xs/PangoLayout.c"
#line 395 "xs/PangoLayout.xs"
	pango_layout_get_cursor_pos (layout, index_, &strong_pos, &weak_pos);
	EXTEND (sp, 2);
	PUSHs (sv_2mortal (newSVPangoRectangle (&strong_pos)));
	PUSHs (sv_2mortal (newSVPangoRectangle (&weak_pos)));
#line 954 "xs/PangoLayout.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Pango__Layout_move_cursor_visually); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_move_cursor_visually)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "layout, strong, old_index, old_trailing, direction");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	gboolean	strong = (bool)SvTRUE(ST(1))
;
	int	old_index = (int)SvIV(ST(2))
;
	int	old_trailing = (int)SvIV(ST(3))
;
	int	direction = (int)SvIV(ST(4))
;
	int	new_index;
	int	new_trailing;

	pango_layout_move_cursor_visually(layout, strong, old_index, old_trailing, direction, &new_index, &new_trailing);
	XSprePUSH;	EXTEND(SP,2);
	PUSHs(sv_newmortal());
	sv_setiv(ST(0), (IV)new_index);
	PUSHs(sv_newmortal());
	sv_setiv(ST(1), (IV)new_trailing);
    }
    XSRETURN(2);
}


XS_EUPXS(XS_Pango__Layout_xy_to_index); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_xy_to_index)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "layout, x, y");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
#line 413 "xs/PangoLayout.xs"
	int index_;
	int trailing;
#line 1010 "xs/PangoLayout.c"
#line 416 "xs/PangoLayout.xs"
	if (pango_layout_xy_to_index (layout, x, y, &index_, &trailing)) {
		EXTEND (SP, 2);
		PUSHs (sv_2mortal (newSViv (index_)));
		PUSHs (sv_2mortal (newSViv (trailing)));
	}
#line 1017 "xs/PangoLayout.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Pango__Layout_get_extents); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_extents)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
#line 433 "xs/PangoLayout.xs"
	PangoRectangle ink_rect;
	PangoRectangle logical_rect;
#line 1039 "xs/PangoLayout.c"
#line 436 "xs/PangoLayout.xs"
	switch (ix) {
		case 0:
			pango_layout_get_extents (layout, &ink_rect, &logical_rect);
			break;
		case 1:
			pango_layout_get_pixel_extents (layout, &ink_rect, &logical_rect);
			break;
		default:
			g_assert_not_reached ();
	}
	EXTEND (sp, 2);
	PUSHs (sv_2mortal (newSVPangoRectangle (&ink_rect)));
	PUSHs (sv_2mortal (newSVPangoRectangle (&logical_rect)));
#line 1054 "xs/PangoLayout.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Pango__Layout_get_size); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_size)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	int	width;
	int	height;

	pango_layout_get_size(layout, &width, &height);
	XSprePUSH;	EXTEND(SP,2);
	PUSHs(sv_newmortal());
	sv_setiv(ST(0), (IV)width);
	PUSHs(sv_newmortal());
	sv_setiv(ST(1), (IV)height);
    }
    XSRETURN(2);
}


XS_EUPXS(XS_Pango__Layout_get_pixel_size); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_pixel_size)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	int	width;
	int	height;

	pango_layout_get_pixel_size(layout, &width, &height);
	XSprePUSH;	EXTEND(SP,2);
	PUSHs(sv_newmortal());
	sv_setiv(ST(0), (IV)width);
	PUSHs(sv_newmortal());
	sv_setiv(ST(1), (IV)height);
    }
    XSRETURN(2);
}


XS_EUPXS(XS_Pango__Layout_get_line_count); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_line_count)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	int	RETVAL;
	dXSTARG;

	RETVAL = pango_layout_get_line_count(layout);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_get_line); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_line)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, line");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	int	line = (int)SvIV(ST(1))
;
	PangoLayoutLine_ornull *	RETVAL;

	RETVAL = pango_layout_get_line(layout, line);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoLayoutLine_ornull (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_get_lines); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_lines)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
#line 472 "xs/PangoLayout.xs"
	GSList * lines, * i;
#line 1164 "xs/PangoLayout.c"
#line 474 "xs/PangoLayout.xs"
	lines = pango_layout_get_lines (layout);
	for (i = lines ; i != NULL ; i = i->next)
		XPUSHs (sv_2mortal (newSVPangoLayoutLine (i->data)));
	/* the list is owned by the layout. */
#line 1170 "xs/PangoLayout.c"
	PUTBACK;
	return;
    }
}

#if PANGO_CHECK_VERSION (1, 16, 0)
#define XSubPPtmpAAAD 1


XS_EUPXS(XS_Pango__Layout_get_line_readonly); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_line_readonly)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, line");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	int	line = (int)SvIV(ST(1))
;
	PangoLayoutLine_ornull *	RETVAL;

	RETVAL = pango_layout_get_line_readonly(layout, line);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoLayoutLine_ornull (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_get_lines_readonly); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_lines_readonly)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
#line 492 "xs/PangoLayout.xs"
	GSList * lines, * i;
#line 1218 "xs/PangoLayout.c"
#line 494 "xs/PangoLayout.xs"
	lines = pango_layout_get_lines_readonly (layout);
	for (i = lines ; i != NULL ; i = i->next)
		XPUSHs (sv_2mortal (newSVPangoLayoutLine (i->data)));
	/* the list is owned by the layout. */
#line 1224 "xs/PangoLayout.c"
	PUTBACK;
	return;
    }
}

#endif

XS_EUPXS(XS_Pango__Layout_get_iter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_iter)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	PangoLayoutIter_own *	RETVAL;

	RETVAL = pango_layout_get_iter(layout);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoLayoutIter_own (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#if PANGO_CHECK_VERSION (1, 16, 0)
#define XSubPPtmpAAAE 1


XS_EUPXS(XS_Pango__Layout_is_wrapped); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_is_wrapped)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	gboolean	RETVAL;
	PangoLayout *	layout = SvPangoLayout (ST(0))
;

	RETVAL = pango_layout_is_wrapped(layout);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_is_ellipsized); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_is_ellipsized)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	gboolean	RETVAL;
	PangoLayout *	layout = SvPangoLayout (ST(0))
;

	RETVAL = pango_layout_is_ellipsized(layout);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__Layout_get_unknown_glyphs_count); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_unknown_glyphs_count)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	int	RETVAL;
	dXSTARG;
	PangoLayout *	layout = SvPangoLayout (ST(0))
;

	RETVAL = pango_layout_get_unknown_glyphs_count(layout);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#endif
#if PANGO_CHECK_VERSION (1, 20, 0)
#define XSubPPtmpAAAF 1


XS_EUPXS(XS_Pango__Layout_set_height); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_set_height)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "layout, height");
    {
	PangoLayout *	layout = SvPangoLayout (ST(0))
;
	int	height = (int)SvIV(ST(1))
;

	pango_layout_set_height(layout, height);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Pango__Layout_get_height); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_height)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	int	RETVAL;
	dXSTARG;
	PangoLayout *	layout = SvPangoLayout (ST(0))
;

	RETVAL = pango_layout_get_height(layout);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#endif
#if PANGO_CHECK_VERSION (1, 22, 0)
#define XSubPPtmpAAAG 1


XS_EUPXS(XS_Pango__Layout_get_baseline); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__Layout_get_baseline)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layout");
    {
	int	RETVAL;
	dXSTARG;
	PangoLayout *	layout = SvPangoLayout (ST(0))
;

	RETVAL = pango_layout_get_baseline(layout);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#endif

XS_EUPXS(XS_Pango__LayoutLine_x_to_index); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutLine_x_to_index)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "line, x_pos");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 538 "xs/PangoLayout.xs"
	gboolean retval;
	int index_;
	int trailing;
#line 1391 "xs/PangoLayout.c"
	PangoLayoutLine *	line = SvPangoLayoutLine (ST(0))
;
	int	x_pos = (int)SvIV(ST(1))
;
#line 542 "xs/PangoLayout.xs"
	retval = pango_layout_line_x_to_index (line, x_pos, &index_, &trailing);
	EXTEND (SP, 3);
	PUSHs (sv_2mortal (boolSV (retval)));
	PUSHs (sv_2mortal (newSViv (index_)));
	PUSHs (sv_2mortal (newSViv (trailing)));
#line 1402 "xs/PangoLayout.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Pango__LayoutLine_index_to_x); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutLine_index_to_x)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "line, index_, trailing");
    {
	PangoLayoutLine *	line = SvPangoLayoutLine (ST(0))
;
	int	index_ = (int)SvIV(ST(1))
;
	gboolean	trailing = (bool)SvTRUE(ST(2))
;
	int	x_pos;

	pango_layout_line_index_to_x(line, index_, trailing, &x_pos);
	XSprePUSH;	EXTEND(SP,1);
	PUSHs(sv_newmortal());
	sv_setiv(ST(0), (IV)x_pos);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__LayoutLine_get_x_ranges); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutLine_get_x_ranges)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "line, start_index, end_index");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	PangoLayoutLine *	line = SvPangoLayoutLine (ST(0))
;
	int	start_index = (int)SvIV(ST(1))
;
	int	end_index = (int)SvIV(ST(2))
;
#line 558 "xs/PangoLayout.xs"
	int *ranges;
	int n_ranges, i;
#line 1451 "xs/PangoLayout.c"
#line 561 "xs/PangoLayout.xs"
	pango_layout_line_get_x_ranges (line, start_index, end_index, &ranges, &n_ranges);
	EXTEND (SP, n_ranges);
	for (i = 0; i < 2*n_ranges; i += 2) {
		AV *av = newAV ();
		av_push (av, newSViv (ranges[i]));
		av_push (av, newSViv (ranges[i + 1]));
		PUSHs (sv_2mortal (newRV_noinc ((SV *) av)));
	}
	g_free (ranges);
#line 1462 "xs/PangoLayout.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Pango__LayoutLine_get_extents); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutLine_get_extents)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "line");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	PangoLayoutLine *	line = SvPangoLayoutLine (ST(0))
;
#line 584 "xs/PangoLayout.xs"
	PangoRectangle ink_rect;
	PangoRectangle logical_rect;
#line 1484 "xs/PangoLayout.c"
#line 587 "xs/PangoLayout.xs"
	switch (ix) {
		case 0:
			pango_layout_line_get_extents (line, &ink_rect, &logical_rect);
			break;
		case 1:
			pango_layout_line_get_pixel_extents (line, &ink_rect, &logical_rect);
			break;
		default:
			g_assert_not_reached ();
	}
	EXTEND (sp, 2);
	PUSHs (sv_2mortal (newSVPangoRectangle (&ink_rect)));
	PUSHs (sv_2mortal (newSVPangoRectangle (&logical_rect)));
#line 1499 "xs/PangoLayout.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Pango__LayoutIter_get_index); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_get_index)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;
	int	RETVAL;
	dXSTARG;

	RETVAL = pango_layout_iter_get_index(iter);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__LayoutIter_get_line); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_get_line)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;
	PangoLayoutLine *	RETVAL;

	RETVAL = pango_layout_iter_get_line(iter);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoLayoutLine (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#if PANGO_CHECK_VERSION (1, 16, 0)
#define XSubPPtmpAAAH 1


XS_EUPXS(XS_Pango__LayoutIter_get_line_readonly); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_get_line_readonly)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;
	PangoLayoutLine *	RETVAL;

	RETVAL = pango_layout_iter_get_line_readonly(iter);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoLayoutLine (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#endif

XS_EUPXS(XS_Pango__LayoutIter_at_last_line); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_at_last_line)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;
	gboolean	RETVAL;

	RETVAL = pango_layout_iter_at_last_line(iter);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__LayoutIter_next_char); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_next_char)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;
	gboolean	RETVAL;

	RETVAL = pango_layout_iter_next_char(iter);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__LayoutIter_next_cluster); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_next_cluster)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;
	gboolean	RETVAL;

	RETVAL = pango_layout_iter_next_cluster(iter);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__LayoutIter_next_run); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_next_run)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;
	gboolean	RETVAL;

	RETVAL = pango_layout_iter_next_run(iter);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__LayoutIter_next_line); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_next_line)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;
	gboolean	RETVAL;

	RETVAL = pango_layout_iter_next_line(iter);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__LayoutIter_get_char_extents); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_get_char_extents)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;
#line 668 "xs/PangoLayout.xs"
	PangoRectangle logical_rect;
#line 1676 "xs/PangoLayout.c"
	PangoRectangle *	RETVAL;
#line 670 "xs/PangoLayout.xs"
	pango_layout_iter_get_char_extents (iter, &logical_rect);
	RETVAL = &logical_rect;
#line 1681 "xs/PangoLayout.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoRectangle (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Pango__LayoutIter_get_cluster_extents); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_get_cluster_extents)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;
#line 684 "xs/PangoLayout.xs"
	PangoRectangle ink_rect;
	PangoRectangle logical_rect;
#line 1708 "xs/PangoLayout.c"
#line 687 "xs/PangoLayout.xs"
	switch (ix) {
		case 0:
			pango_layout_iter_get_cluster_extents (iter, &ink_rect, &logical_rect);
			break;
		case 1:
			pango_layout_iter_get_run_extents (iter, &ink_rect, &logical_rect);
			break;
		case 2:
			pango_layout_iter_get_line_extents (iter, &ink_rect, &logical_rect);
			break;
		case 3:
			pango_layout_iter_get_layout_extents (iter, &ink_rect, &logical_rect);
			break;
		default:
			g_assert_not_reached ();
	}
	EXTEND (sp, 2);
	PUSHs (sv_2mortal (newSVPangoRectangle (&ink_rect)));
	PUSHs (sv_2mortal (newSVPangoRectangle (&logical_rect)));
#line 1729 "xs/PangoLayout.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Pango__LayoutIter_get_line_yrange); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_get_line_yrange)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;
	int	y0_;
	int	y1_;

	pango_layout_iter_get_line_yrange(iter, &y0_, &y1_);
	XSprePUSH;	EXTEND(SP,2);
	PUSHs(sv_newmortal());
	sv_setiv(ST(0), (IV)y0_);
	PUSHs(sv_newmortal());
	sv_setiv(ST(1), (IV)y1_);
    }
    XSRETURN(2);
}


XS_EUPXS(XS_Pango__LayoutIter_get_baseline); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_get_baseline)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;
	int	RETVAL;
	dXSTARG;

	RETVAL = pango_layout_iter_get_baseline(iter);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#if PANGO_CHECK_VERSION (1, 20, 0)
#define XSubPPtmpAAAI 1


XS_EUPXS(XS_Pango__LayoutIter_get_layout); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Pango__LayoutIter_get_layout)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	PangoLayout *	RETVAL;
	PangoLayoutIter *	iter = SvPangoLayoutIter (ST(0))
;

	RETVAL = pango_layout_iter_get_layout(iter);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoLayout (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#endif
#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Pango__Layout); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Pango__Layout)
{
#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("Pango::Layout::new", XS_Pango__Layout_new);
        newXS_deffile("Pango::Layout::copy", XS_Pango__Layout_copy);
        newXS_deffile("Pango::Layout::get_context", XS_Pango__Layout_get_context);
        newXS_deffile("Pango::Layout::set_attributes", XS_Pango__Layout_set_attributes);
        newXS_deffile("Pango::Layout::get_attributes", XS_Pango__Layout_get_attributes);
        newXS_deffile("Pango::Layout::set_text", XS_Pango__Layout_set_text);
        newXS_deffile("Pango::Layout::get_text", XS_Pango__Layout_get_text);
        newXS_deffile("Pango::Layout::set_markup", XS_Pango__Layout_set_markup);
        newXS_deffile("Pango::Layout::set_markup_with_accel", XS_Pango__Layout_set_markup_with_accel);
        newXS_deffile("Pango::Layout::set_font_description", XS_Pango__Layout_set_font_description);
#if XSubPPtmpAAAA
        newXS_deffile("Pango::Layout::get_font_description", XS_Pango__Layout_get_font_description);
#endif
        cv = newXS_deffile("Pango::Layout::get_indent", XS_Pango__Layout_get_width);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Pango::Layout::get_justify", XS_Pango__Layout_get_width);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("Pango::Layout::get_single_paragraph_mode", XS_Pango__Layout_get_width);
        XSANY.any_i32 = 4;
        cv = newXS_deffile("Pango::Layout::get_spacing", XS_Pango__Layout_get_width);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("Pango::Layout::get_width", XS_Pango__Layout_get_width);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Pango::Layout::set_indent", XS_Pango__Layout_set_width);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Pango::Layout::set_justify", XS_Pango__Layout_set_width);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("Pango::Layout::set_single_paragraph_mode", XS_Pango__Layout_set_width);
        XSANY.any_i32 = 4;
        cv = newXS_deffile("Pango::Layout::set_spacing", XS_Pango__Layout_set_width);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("Pango::Layout::set_width", XS_Pango__Layout_set_width);
        XSANY.any_i32 = 0;
        newXS_deffile("Pango::Layout::set_wrap", XS_Pango__Layout_set_wrap);
        newXS_deffile("Pango::Layout::get_wrap", XS_Pango__Layout_get_wrap);
#if XSubPPtmpAAAB
        newXS_deffile("Pango::Layout::set_ellipsize", XS_Pango__Layout_set_ellipsize);
        newXS_deffile("Pango::Layout::get_ellipsize", XS_Pango__Layout_get_ellipsize);
#endif
#if XSubPPtmpAAAC
        newXS_deffile("Pango::Layout::set_auto_dir", XS_Pango__Layout_set_auto_dir);
        newXS_deffile("Pango::Layout::get_auto_dir", XS_Pango__Layout_get_auto_dir);
#endif
        newXS_deffile("Pango::Layout::set_alignment", XS_Pango__Layout_set_alignment);
        newXS_deffile("Pango::Layout::get_alignment", XS_Pango__Layout_get_alignment);
        newXS_deffile("Pango::Layout::set_tabs", XS_Pango__Layout_set_tabs);
        newXS_deffile("Pango::Layout::get_tabs", XS_Pango__Layout_get_tabs);
        newXS_deffile("Pango::Layout::context_changed", XS_Pango__Layout_context_changed);
        newXS_deffile("Pango::Layout::get_log_attrs", XS_Pango__Layout_get_log_attrs);
        newXS_deffile("Pango::Layout::index_to_pos", XS_Pango__Layout_index_to_pos);
        newXS_deffile("Pango::Layout::get_cursor_pos", XS_Pango__Layout_get_cursor_pos);
        newXS_deffile("Pango::Layout::move_cursor_visually", XS_Pango__Layout_move_cursor_visually);
        newXS_deffile("Pango::Layout::xy_to_index", XS_Pango__Layout_xy_to_index);
        cv = newXS_deffile("Pango::Layout::get_extents", XS_Pango__Layout_get_extents);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Pango::Layout::get_pixel_extents", XS_Pango__Layout_get_extents);
        XSANY.any_i32 = 1;
        newXS_deffile("Pango::Layout::get_size", XS_Pango__Layout_get_size);
        newXS_deffile("Pango::Layout::get_pixel_size", XS_Pango__Layout_get_pixel_size);
        newXS_deffile("Pango::Layout::get_line_count", XS_Pango__Layout_get_line_count);
        newXS_deffile("Pango::Layout::get_line", XS_Pango__Layout_get_line);
        newXS_deffile("Pango::Layout::get_lines", XS_Pango__Layout_get_lines);
#if XSubPPtmpAAAD
        newXS_deffile("Pango::Layout::get_line_readonly", XS_Pango__Layout_get_line_readonly);
        newXS_deffile("Pango::Layout::get_lines_readonly", XS_Pango__Layout_get_lines_readonly);
#endif
        newXS_deffile("Pango::Layout::get_iter", XS_Pango__Layout_get_iter);
#if XSubPPtmpAAAE
        newXS_deffile("Pango::Layout::is_wrapped", XS_Pango__Layout_is_wrapped);
        newXS_deffile("Pango::Layout::is_ellipsized", XS_Pango__Layout_is_ellipsized);
        newXS_deffile("Pango::Layout::get_unknown_glyphs_count", XS_Pango__Layout_get_unknown_glyphs_count);
#endif
#if XSubPPtmpAAAF
        newXS_deffile("Pango::Layout::set_height", XS_Pango__Layout_set_height);
        newXS_deffile("Pango::Layout::get_height", XS_Pango__Layout_get_height);
#endif
#if XSubPPtmpAAAG
        newXS_deffile("Pango::Layout::get_baseline", XS_Pango__Layout_get_baseline);
#endif
        newXS_deffile("Pango::LayoutLine::x_to_index", XS_Pango__LayoutLine_x_to_index);
        newXS_deffile("Pango::LayoutLine::index_to_x", XS_Pango__LayoutLine_index_to_x);
        newXS_deffile("Pango::LayoutLine::get_x_ranges", XS_Pango__LayoutLine_get_x_ranges);
        cv = newXS_deffile("Pango::LayoutLine::get_extents", XS_Pango__LayoutLine_get_extents);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Pango::LayoutLine::get_pixel_extents", XS_Pango__LayoutLine_get_extents);
        XSANY.any_i32 = 1;
        newXS_deffile("Pango::LayoutIter::get_index", XS_Pango__LayoutIter_get_index);
        newXS_deffile("Pango::LayoutIter::get_line", XS_Pango__LayoutIter_get_line);
#if XSubPPtmpAAAH
        newXS_deffile("Pango::LayoutIter::get_line_readonly", XS_Pango__LayoutIter_get_line_readonly);
#endif
        newXS_deffile("Pango::LayoutIter::at_last_line", XS_Pango__LayoutIter_at_last_line);
        newXS_deffile("Pango::LayoutIter::next_char", XS_Pango__LayoutIter_next_char);
        newXS_deffile("Pango::LayoutIter::next_cluster", XS_Pango__LayoutIter_next_cluster);
        newXS_deffile("Pango::LayoutIter::next_run", XS_Pango__LayoutIter_next_run);
        newXS_deffile("Pango::LayoutIter::next_line", XS_Pango__LayoutIter_next_line);
        newXS_deffile("Pango::LayoutIter::get_char_extents", XS_Pango__LayoutIter_get_char_extents);
        cv = newXS_deffile("Pango::LayoutIter::get_cluster_extents", XS_Pango__LayoutIter_get_cluster_extents);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Pango::LayoutIter::get_layout_extents", XS_Pango__LayoutIter_get_cluster_extents);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("Pango::LayoutIter::get_line_extents", XS_Pango__LayoutIter_get_cluster_extents);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("Pango::LayoutIter::get_run_extents", XS_Pango__LayoutIter_get_cluster_extents);
        XSANY.any_i32 = 1;
        newXS_deffile("Pango::LayoutIter::get_line_yrange", XS_Pango__LayoutIter_get_line_yrange);
        newXS_deffile("Pango::LayoutIter::get_baseline", XS_Pango__LayoutIter_get_baseline);
#if XSubPPtmpAAAI
        newXS_deffile("Pango::LayoutIter::get_layout", XS_Pango__LayoutIter_get_layout);
#endif

    /* Initialisation Section */

#if XSubPPtmpAAAA
#endif
#if XSubPPtmpAAAB
#endif
#if XSubPPtmpAAAC
#endif
#if XSubPPtmpAAAD
#endif
#if XSubPPtmpAAAE
#endif
#if XSubPPtmpAAAF
#endif
#if XSubPPtmpAAAG
#endif
#if XSubPPtmpAAAH
#endif
#if XSubPPtmpAAAI
#endif
#line 1963 "xs/PangoLayout.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
}

