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

#line 1 "xs/GtkTextBuffer.xs"
/*
 * Copyright (c) 2003-2006 by the gtk2-perl team (see the file 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 GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
 * Boston, MA  02111-1307  USA.
 *
 * $Id$
 */

#include "gtk2perl.h"

/* is a GObject */

#line 36 "xs/GtkTextBuffer.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(pTHX_ const CV *const cv, const char *const params);

STATIC void
S_croak_xs_usage(pTHX_ 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(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params);
        else
            Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params);
    } else {
        /* Pants. I don't think that it should be possible to get here. */
        Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
    }
}
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE

#ifdef PERL_IMPLICIT_CONTEXT
#define croak_xs_usage(a,b)    S_croak_xs_usage(aTHX_ a,b)
#else
#define croak_xs_usage        S_croak_xs_usage
#endif

#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) */

#line 178 "xs/GtkTextBuffer.c"

XS_EUPXS(XS_Gtk2__TextBuffer_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_new)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "class, tagtable=NULL");
    {
	GtkTextTagTable_ornull *	tagtable;
	GtkTextBuffer_noinc *	RETVAL;

	if (items < 2)
	    tagtable = NULL;
	else {
	    tagtable = SvGtkTextTagTable_ornull (ST(1))
;
	}

	RETVAL = gtk_text_buffer_new(tagtable);
	ST(0) = newSVGtkTextBuffer_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_line_count); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_line_count)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	gint	RETVAL;
	dXSTARG;

	RETVAL = gtk_text_buffer_get_line_count(buffer);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_char_count); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_char_count)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	gint	RETVAL;
	dXSTARG;

	RETVAL = gtk_text_buffer_get_char_count(buffer);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_tag_table); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_tag_table)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextTagTable *	RETVAL;

	RETVAL = gtk_text_buffer_get_tag_table(buffer);
	ST(0) = newSVGtkTextTagTable (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_insert); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_insert)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, iter, text");
    {
	STRLEN	STRLEN_length_of_text;
	int	XSauto_length_of_text;
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	iter = SvGtkTextIter (ST(1))
;
	const gchar_length *	text;

	XSauto_length_of_text = STRLEN_length_of_text;

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

	gtk_text_buffer_insert(buffer, iter, text, XSauto_length_of_text);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_insert_at_cursor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_insert_at_cursor)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, text");
    {
	STRLEN	STRLEN_length_of_text;
	int	XSauto_length_of_text;
	GtkTextBuffer *	buffer = SvGtkTextBuffer (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
;

	gtk_text_buffer_insert_at_cursor(buffer, text, XSauto_length_of_text);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_insert_interactive); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_insert_interactive)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "buffer, iter, text, default_editable");
    {
	gboolean	RETVAL;
	STRLEN	STRLEN_length_of_text;
	int	XSauto_length_of_text;
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	iter = SvGtkTextIter (ST(1))
;
	const gchar_length *	text;
	gboolean	default_editable = (bool)SvTRUE(ST(3))
;

	XSauto_length_of_text = STRLEN_length_of_text;

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

	RETVAL = gtk_text_buffer_insert_interactive(buffer, iter, text, XSauto_length_of_text, default_editable);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_insert_interactive_at_cursor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_insert_interactive_at_cursor)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, text, default_editable");
    {
	gboolean	RETVAL;
	STRLEN	STRLEN_length_of_text;
	int	XSauto_length_of_text;
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	const gchar_length *	text;
	gboolean	default_editable = (bool)SvTRUE(ST(2))
;

	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
;

	RETVAL = gtk_text_buffer_insert_interactive_at_cursor(buffer, text, XSauto_length_of_text, default_editable);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_insert_range); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_insert_range)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "buffer, iter, start, end");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	iter = SvGtkTextIter (ST(1))
;
	GtkTextIter *	start = SvGtkTextIter (ST(2))
;
	GtkTextIter *	end = SvGtkTextIter (ST(3))
;

	gtk_text_buffer_insert_range(buffer, iter, start, end);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_insert_range_interactive); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_insert_range_interactive)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "buffer, iter, start, end, default_editable");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	iter = SvGtkTextIter (ST(1))
;
	GtkTextIter *	start = SvGtkTextIter (ST(2))
;
	GtkTextIter *	end = SvGtkTextIter (ST(3))
;
	gboolean	default_editable = (bool)SvTRUE(ST(4))
;
	gboolean	RETVAL;

	RETVAL = gtk_text_buffer_insert_range_interactive(buffer, iter, start, end, default_editable);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_insert_with_tags); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_insert_with_tags)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "buffer, iter, text, ...");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	iter = SvGtkTextIter (ST(1))
;
	const gchar *	text;
#line 83 "xs/GtkTextBuffer.xs"
	int i;
	gint start_offset;
	GtkTextIter start;
#line 442 "xs/GtkTextBuffer.c"

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(2));
	text = (const gchar *)SvPV_nolen (ST(2))
;
#line 87 "xs/GtkTextBuffer.xs"
	start_offset = gtk_text_iter_get_offset (iter);
	gtk_text_buffer_insert (buffer, iter, text, -1);
	gtk_text_buffer_get_iter_at_offset (buffer, &start, start_offset);
	for (i = 3 ; i < items ; i++) {
		gtk_text_buffer_apply_tag (buffer, SvGtkTextTag (ST (i)),
					   &start, iter);
	}
#line 456 "xs/GtkTextBuffer.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_insert_with_tags_by_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_insert_with_tags_by_name)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "buffer, iter, text, ...");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	iter = SvGtkTextIter (ST(1))
;
	const gchar *	text;
#line 106 "xs/GtkTextBuffer.xs"
	int i;
	gint start_offset;
	GtkTextTagTable * tag_table;
	GtkTextIter start;
#line 479 "xs/GtkTextBuffer.c"

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(2));
	text = (const gchar *)SvPV_nolen (ST(2))
;
#line 111 "xs/GtkTextBuffer.xs"
	start_offset = gtk_text_iter_get_offset (iter);
	gtk_text_buffer_insert (buffer, iter, text, -1);
	tag_table = gtk_text_buffer_get_tag_table (buffer);
	gtk_text_buffer_get_iter_at_offset (buffer, &start, start_offset);
	for (i = 3 ; i < items ; i++) {
		char * tag_name;
		GtkTextTag * tag;

		tag_name = SvGChar (ST (i));
		tag = gtk_text_tag_table_lookup (tag_table, tag_name);
		if (!tag)
			warn ("no tag with name %s", tag_name);
		else
			gtk_text_buffer_apply_tag (buffer, tag, &start, iter);
	}
#line 501 "xs/GtkTextBuffer.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_delete); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_delete)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, start, end");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	start = SvGtkTextIter (ST(1))
;
	GtkTextIter *	end = SvGtkTextIter (ST(2))
;

	gtk_text_buffer_delete(buffer, start, end);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_delete_interactive); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_delete_interactive)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "buffer, start_iter, end_iter, default_editable");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	start_iter = SvGtkTextIter (ST(1))
;
	GtkTextIter *	end_iter = SvGtkTextIter (ST(2))
;
	gboolean	default_editable = (bool)SvTRUE(ST(3))
;
	gboolean	RETVAL;

	RETVAL = gtk_text_buffer_delete_interactive(buffer, start_iter, end_iter, default_editable);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_set_text); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_set_text)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, text");
    {
	STRLEN	STRLEN_length_of_text;
	int	XSauto_length_of_text;
	GtkTextBuffer *	buffer = SvGtkTextBuffer (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
;

	gtk_text_buffer_set_text(buffer, text, XSauto_length_of_text);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_text); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_text)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "buffer, start, end, include_hidden_chars");
    {
	gchar_own *	RETVAL;
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	start = SvGtkTextIter (ST(1))
;
	GtkTextIter *	end = SvGtkTextIter (ST(2))
;
	gboolean	include_hidden_chars = (bool)SvTRUE(ST(3))
;

	RETVAL = gtk_text_buffer_get_text(buffer, start, end, include_hidden_chars);
	ST(0) = sv_newmortal();
	/* used when we can directly own the returned string. */
	/* we have to copy in the case when perl's malloc != gtk's malloc,
         * so best copy all the time. */
	sv_setpv ((SV*)ST(0), RETVAL);
	SvUTF8_on (ST(0));
        g_free (RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_slice); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_slice)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "buffer, start, end, include_hidden_chars");
    {
	gchar_own *	RETVAL;
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	start = SvGtkTextIter (ST(1))
;
	GtkTextIter *	end = SvGtkTextIter (ST(2))
;
	gboolean	include_hidden_chars = (bool)SvTRUE(ST(3))
;

	RETVAL = gtk_text_buffer_get_slice(buffer, start, end, include_hidden_chars);
	ST(0) = sv_newmortal();
	/* used when we can directly own the returned string. */
	/* we have to copy in the case when perl's malloc != gtk's malloc,
         * so best copy all the time. */
	sv_setpv ((SV*)ST(0), RETVAL);
	SvUTF8_on (ST(0));
        g_free (RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_insert_pixbuf); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_insert_pixbuf)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, iter, pixbuf");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	iter = SvGtkTextIter (ST(1))
;
	GdkPixbuf *	pixbuf = SvGdkPixbuf (ST(2))
;

	gtk_text_buffer_insert_pixbuf(buffer, iter, pixbuf);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_insert_child_anchor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_insert_child_anchor)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, iter, anchor");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	iter = SvGtkTextIter (ST(1))
;
	GtkTextChildAnchor *	anchor = SvGtkTextChildAnchor (ST(2))
;

	gtk_text_buffer_insert_child_anchor(buffer, iter, anchor);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_create_mark); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_create_mark)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "buffer, mark_name, where, left_gravity");
    {
	GtkTextMark *	RETVAL;
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	const gchar_ornull *	mark_name;
	GtkTextIter *	where = SvGtkTextIter (ST(2))
;
	gboolean	left_gravity = (bool)SvTRUE(ST(3))
;

	/* same as SvGChar(), but allows undef as NULL */
	if (gperl_sv_is_defined (ST(1))) {
		sv_utf8_upgrade (ST(1));
		mark_name = (const gchar_ornull *)SvPV_nolen (ST(1));
	} else {
		mark_name = NULL;
	}
;

	RETVAL = gtk_text_buffer_create_mark(buffer, mark_name, where, left_gravity);
	ST(0) = newSVGtkTextMark (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_move_mark); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_move_mark)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, mark, where");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextMark *	mark = SvGtkTextMark (ST(1))
;
	GtkTextIter *	where = SvGtkTextIter (ST(2))
;

	gtk_text_buffer_move_mark(buffer, mark, where);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_delete_mark); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_delete_mark)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, mark");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextMark *	mark = SvGtkTextMark (ST(1))
;

	gtk_text_buffer_delete_mark(buffer, mark);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_mark); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_mark)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, name");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	const gchar *	name;
	GtkTextMark_ornull *	RETVAL;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	name = (const gchar *)SvPV_nolen (ST(1))
;

	RETVAL = gtk_text_buffer_get_mark(buffer, name);
	ST(0) = newSVGtkTextMark_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_move_mark_by_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_move_mark_by_name)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, name, where");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	const gchar *	name;
	GtkTextIter *	where = SvGtkTextIter (ST(2))
;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	name = (const gchar *)SvPV_nolen (ST(1))
;

	gtk_text_buffer_move_mark_by_name(buffer, name, where);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_delete_mark_by_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_delete_mark_by_name)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, name");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	const gchar *	name;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	name = (const gchar *)SvPV_nolen (ST(1))
;

	gtk_text_buffer_delete_mark_by_name(buffer, name);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_insert); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_insert)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextMark *	RETVAL;

	RETVAL = gtk_text_buffer_get_insert(buffer);
	ST(0) = newSVGtkTextMark (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_selection_bound); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_selection_bound)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextMark *	RETVAL;

	RETVAL = gtk_text_buffer_get_selection_bound(buffer);
	ST(0) = newSVGtkTextMark (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_place_cursor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_place_cursor)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, where");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	where = SvGtkTextIter (ST(1))
;

	gtk_text_buffer_place_cursor(buffer, where);
    }
    XSRETURN_EMPTY;
}

#if GTK_CHECK_VERSION(2,4,0)
#define XSubPPtmpAAAA 1


XS_EUPXS(XS_Gtk2__TextBuffer_select_range); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_select_range)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, ins, bound");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	ins = SvGtkTextIter (ST(1))
;
	GtkTextIter *	bound = SvGtkTextIter (ST(2))
;

	gtk_text_buffer_select_range(buffer, ins, bound);
    }
    XSRETURN_EMPTY;
}

#endif

XS_EUPXS(XS_Gtk2__TextBuffer_apply_tag); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_apply_tag)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "buffer, tag, start, end");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextTag *	tag = SvGtkTextTag (ST(1))
;
	GtkTextIter *	start = SvGtkTextIter (ST(2))
;
	GtkTextIter *	end = SvGtkTextIter (ST(3))
;

	gtk_text_buffer_apply_tag(buffer, tag, start, end);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_remove_tag); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_remove_tag)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "buffer, tag, start, end");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextTag *	tag = SvGtkTextTag (ST(1))
;
	GtkTextIter *	start = SvGtkTextIter (ST(2))
;
	GtkTextIter *	end = SvGtkTextIter (ST(3))
;

	gtk_text_buffer_remove_tag(buffer, tag, start, end);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_apply_tag_by_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_apply_tag_by_name)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "buffer, name, start, end");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	const gchar *	name;
	GtkTextIter *	start = SvGtkTextIter (ST(2))
;
	GtkTextIter *	end = SvGtkTextIter (ST(3))
;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	name = (const gchar *)SvPV_nolen (ST(1))
;

	gtk_text_buffer_apply_tag_by_name(buffer, name, start, end);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_remove_tag_by_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_remove_tag_by_name)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "buffer, name, start, end");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	const gchar *	name;
	GtkTextIter *	start = SvGtkTextIter (ST(2))
;
	GtkTextIter *	end = SvGtkTextIter (ST(3))
;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	name = (const gchar *)SvPV_nolen (ST(1))
;

	gtk_text_buffer_remove_tag_by_name(buffer, name, start, end);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_remove_all_tags); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_remove_all_tags)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, start, end");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	start = SvGtkTextIter (ST(1))
;
	GtkTextIter *	end = SvGtkTextIter (ST(2))
;

	gtk_text_buffer_remove_all_tags(buffer, start, end);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_create_tag); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_create_tag)
{
    dVAR; dXSARGS;
    if (items < 4)
       croak_xs_usage(cv,  "buffer, tag_name, property_name1, property_value1, ...");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	const gchar_ornull *	tag_name;
#line 276 "xs/GtkTextBuffer.xs"
	GtkTextTagTable * tag_table;
	int i;
#line 1028 "xs/GtkTextBuffer.c"
	GtkTextTag *	RETVAL;

	/* same as SvGChar(), but allows undef as NULL */
	if (gperl_sv_is_defined (ST(1))) {
		sv_utf8_upgrade (ST(1));
		tag_name = (const gchar_ornull *)SvPV_nolen (ST(1));
	} else {
		tag_name = NULL;
	}
;
#line 279 "xs/GtkTextBuffer.xs"
	if ((items - 2) % 2)
		croak ("expecting tag name followed by name=>value pairs");
	/*
	 * since we can't really pass on the varargs call from perl to C,
	 * we'll have to reimplement this convenience function ourselves.
	 */
	RETVAL = gtk_text_tag_new (tag_name);
	tag_table = gtk_text_buffer_get_tag_table (buffer);
	gtk_text_tag_table_add (tag_table, RETVAL);
	g_object_unref (RETVAL); /* the tag table owns the object now */
	for (i = 2 ; i < items ; i+= 2) {
		GValue gvalue = {0, };
		GParamSpec * pspec;
		const gchar * propname = SvGChar (ST (i));
		pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (RETVAL),
		                                      propname);
		if (!pspec)
			warn ("   unknown property %s for class %s",
				propname, G_OBJECT_TYPE_NAME (RETVAL));
		else {
			g_value_init (&gvalue, pspec->value_type);
			gperl_value_from_sv (&gvalue, ST (i+1));
			g_object_set_property (G_OBJECT (RETVAL), propname,
			                       &gvalue);
			g_value_unset (&gvalue);
		}
	}
#line 1067 "xs/GtkTextBuffer.c"
	ST(0) = newSVGtkTextTag (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_iter_at_line_offset); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_iter_at_line_offset)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, line_number, char_offset");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	gint	line_number = (gint)SvIV(ST(1))
;
	gint	char_offset = (gint)SvIV(ST(2))
;
#line 316 "xs/GtkTextBuffer.xs"
	GtkTextIter iter;
#line 1090 "xs/GtkTextBuffer.c"
	GtkTextIter_copy *	RETVAL;
#line 318 "xs/GtkTextBuffer.xs"
	gtk_text_buffer_get_iter_at_line_offset (buffer, &iter,
	                                         line_number, char_offset);
	RETVAL = &iter;
#line 1096 "xs/GtkTextBuffer.c"
	ST(0) = newSVGtkTextIter_copy (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_iter_at_line_index); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_iter_at_line_index)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, line_number, byte_index");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	gint	line_number = (gint)SvIV(ST(1))
;
	gint	byte_index = (gint)SvIV(ST(2))
;
#line 332 "xs/GtkTextBuffer.xs"
	GtkTextIter iter;
#line 1119 "xs/GtkTextBuffer.c"
	GtkTextIter_copy *	RETVAL;
#line 334 "xs/GtkTextBuffer.xs"
	gtk_text_buffer_get_iter_at_line_index (buffer, &iter,
	                                        line_number, byte_index);
	RETVAL = &iter;
#line 1125 "xs/GtkTextBuffer.c"
	ST(0) = newSVGtkTextIter_copy (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_iter_at_offset); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_iter_at_offset)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, char_offset");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	gint	char_offset = (gint)SvIV(ST(1))
;
#line 346 "xs/GtkTextBuffer.xs"
	GtkTextIter iter;
#line 1146 "xs/GtkTextBuffer.c"
	GtkTextIter_copy *	RETVAL;
#line 348 "xs/GtkTextBuffer.xs"
	gtk_text_buffer_get_iter_at_offset (buffer, &iter, char_offset);
	RETVAL = &iter;
#line 1151 "xs/GtkTextBuffer.c"
	ST(0) = newSVGtkTextIter_copy (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_iter_at_line); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_iter_at_line)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, line_number");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	gint	line_number = (gint)SvIV(ST(1))
;
#line 359 "xs/GtkTextBuffer.xs"
	GtkTextIter iter;
#line 1172 "xs/GtkTextBuffer.c"
	GtkTextIter_copy *	RETVAL;
#line 361 "xs/GtkTextBuffer.xs"
	gtk_text_buffer_get_iter_at_line (buffer, &iter, line_number);
	RETVAL = &iter;
#line 1177 "xs/GtkTextBuffer.c"
	ST(0) = newSVGtkTextIter_copy (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_start_iter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_start_iter)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
#line 374 "xs/GtkTextBuffer.xs"
	GtkTextIter iter;
#line 1197 "xs/GtkTextBuffer.c"
	GtkTextIter_copy *	RETVAL;
#line 376 "xs/GtkTextBuffer.xs"
	if (ix == 1)
		gtk_text_buffer_get_end_iter (buffer, &iter);
	else
		gtk_text_buffer_get_start_iter (buffer, &iter);
	RETVAL = &iter;
#line 1205 "xs/GtkTextBuffer.c"
	ST(0) = newSVGtkTextIter_copy (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_bounds); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_bounds)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
#line 395 "xs/GtkTextBuffer.xs"
	GtkTextIter start = {0, };
	GtkTextIter end = {0, };
#line 1227 "xs/GtkTextBuffer.c"
#line 398 "xs/GtkTextBuffer.xs"
	gtk_text_buffer_get_bounds (buffer, &start, &end);
	EXTEND (SP, 2);
	PUSHs (sv_2mortal (newSVGtkTextIter_copy (&start)));
	PUSHs (sv_2mortal (newSVGtkTextIter_copy (&end)));
#line 1233 "xs/GtkTextBuffer.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_iter_at_mark); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_iter_at_mark)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, mark");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextMark *	mark = SvGtkTextMark (ST(1))
;
#line 409 "xs/GtkTextBuffer.xs"
	GtkTextIter iter;
#line 1253 "xs/GtkTextBuffer.c"
	GtkTextIter_copy *	RETVAL;
#line 411 "xs/GtkTextBuffer.xs"
	gtk_text_buffer_get_iter_at_mark (buffer, &iter, mark);
	RETVAL = &iter;
#line 1258 "xs/GtkTextBuffer.c"
	ST(0) = newSVGtkTextIter_copy (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_iter_at_child_anchor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_iter_at_child_anchor)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, anchor");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextChildAnchor *	anchor = SvGtkTextChildAnchor (ST(1))
;
#line 422 "xs/GtkTextBuffer.xs"
	GtkTextIter iter;
#line 1279 "xs/GtkTextBuffer.c"
	GtkTextIter_copy *	RETVAL;
#line 424 "xs/GtkTextBuffer.xs"
	gtk_text_buffer_get_iter_at_child_anchor (buffer, &iter, anchor);
	RETVAL = &iter;
#line 1284 "xs/GtkTextBuffer.c"
	ST(0) = newSVGtkTextIter_copy (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_modified); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_modified)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	gboolean	RETVAL;

	RETVAL = gtk_text_buffer_get_modified(buffer);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_set_modified); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_set_modified)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, setting");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	gboolean	setting = (bool)SvTRUE(ST(1))
;

	gtk_text_buffer_set_modified(buffer, setting);
    }
    XSRETURN_EMPTY;
}

#if GTK_CHECK_VERSION(2,2,0)
#define XSubPPtmpAAAB 1


XS_EUPXS(XS_Gtk2__TextBuffer_add_selection_clipboard); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_add_selection_clipboard)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, clipboard");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkClipboard *	clipboard = SvGtkClipboard (ST(1))
;

	gtk_text_buffer_add_selection_clipboard(buffer, clipboard);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_remove_selection_clipboard); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_remove_selection_clipboard)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, clipboard");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkClipboard *	clipboard = SvGtkClipboard (ST(1))
;

	gtk_text_buffer_remove_selection_clipboard(buffer, clipboard);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_cut_clipboard); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_cut_clipboard)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, clipboard, default_editable");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkClipboard *	clipboard = SvGtkClipboard (ST(1))
;
	gboolean	default_editable = (bool)SvTRUE(ST(2))
;

	gtk_text_buffer_cut_clipboard(buffer, clipboard, default_editable);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_copy_clipboard); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_copy_clipboard)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, clipboard");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkClipboard *	clipboard = SvGtkClipboard (ST(1))
;

	gtk_text_buffer_copy_clipboard(buffer, clipboard);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_paste_clipboard); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_paste_clipboard)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "buffer, clipboard, override_location, default_editable");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkClipboard *	clipboard = SvGtkClipboard (ST(1))
;
	GtkTextIter_ornull *	override_location = SvGtkTextIter_ornull (ST(2))
;
	gboolean	default_editable = (bool)SvTRUE(ST(3))
;

	gtk_text_buffer_paste_clipboard(buffer, clipboard, override_location, default_editable);
    }
    XSRETURN_EMPTY;
}

#endif /* defined GTK_TYPE_CLIPBOARD */

XS_EUPXS(XS_Gtk2__TextBuffer_get_selection_bounds); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_selection_bounds)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
#line 490 "xs/GtkTextBuffer.xs"
	GtkTextIter start;
	GtkTextIter end;
#line 1442 "xs/GtkTextBuffer.c"
#line 493 "xs/GtkTextBuffer.xs"
	if (!gtk_text_buffer_get_selection_bounds (buffer, &start, &end))
		XSRETURN_EMPTY;
	EXTEND (SP, 2);
	PUSHs (sv_2mortal (newSVGtkTextIter_copy (&start)));
	PUSHs (sv_2mortal (newSVGtkTextIter_copy (&end)));
#line 1449 "xs/GtkTextBuffer.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__TextBuffer_delete_selection); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_delete_selection)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, interactive, default_editable");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	gboolean	interactive = (bool)SvTRUE(ST(1))
;
	gboolean	default_editable = (bool)SvTRUE(ST(2))
;
	gboolean	RETVAL;

	RETVAL = gtk_text_buffer_delete_selection(buffer, interactive, default_editable);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_begin_user_action); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_begin_user_action)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;

	gtk_text_buffer_begin_user_action(buffer);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_end_user_action); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_end_user_action)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;

	gtk_text_buffer_end_user_action(buffer);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__TextBuffer_create_child_anchor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_create_child_anchor)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "buffer, iter");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	iter = SvGtkTextIter (ST(1))
;
	GtkTextChildAnchor *	RETVAL;

	RETVAL = gtk_text_buffer_create_child_anchor(buffer, iter);
	ST(0) = newSVGtkTextChildAnchor (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}

#if GTK_CHECK_VERSION (2, 6, 0)
#define XSubPPtmpAAAC 1


XS_EUPXS(XS_Gtk2__TextBuffer_backspace); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_backspace)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "buffer, iter, interactive, default_editable");
    {
	gboolean	RETVAL;
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextIter *	iter = SvGtkTextIter (ST(1))
;
	gboolean	interactive = (bool)SvTRUE(ST(2))
;
	gboolean	default_editable = (bool)SvTRUE(ST(3))
;

	RETVAL = gtk_text_buffer_backspace(buffer, iter, interactive, default_editable);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}

#endif
#if GTK_CHECK_VERSION (2, 10, 0)
#define XSubPPtmpAAAD 1


XS_EUPXS(XS_Gtk2__TextBuffer_get_has_selection); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_has_selection)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    {
	gboolean	RETVAL;
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;

	RETVAL = gtk_text_buffer_get_has_selection(buffer);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_copy_target_list); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_copy_target_list)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    {
	GtkTargetList *	RETVAL;
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;

	RETVAL = gtk_text_buffer_get_copy_target_list(buffer);
	ST(0) = newSVGtkTargetList (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__TextBuffer_get_paste_target_list); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_get_paste_target_list)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "buffer");
    {
	GtkTargetList *	RETVAL;
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;

	RETVAL = gtk_text_buffer_get_paste_target_list(buffer);
	ST(0) = newSVGtkTargetList (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}

#endif /* 2.10 */
#if GTK_CHECK_VERSION (2, 12, 0)
#define XSubPPtmpAAAE 1


XS_EUPXS(XS_Gtk2__TextBuffer_add_mark); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__TextBuffer_add_mark)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "buffer, mark, where");
    {
	GtkTextBuffer *	buffer = SvGtkTextBuffer (ST(0))
;
	GtkTextMark *	mark = SvGtkTextMark (ST(1))
;
	GtkTextIter *	where = SvGtkTextIter (ST(2))
;

	gtk_text_buffer_add_mark(buffer, mark, where);
    }
    XSRETURN_EMPTY;
}

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

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
#ifdef XS_APIVERSION_BOOTCHECK
    XS_APIVERSION_BOOTCHECK;
#endif
    XS_VERSION_BOOTCHECK;

    {
        CV * cv;

        newXS("Gtk2::TextBuffer::new", XS_Gtk2__TextBuffer_new, file);
        newXS("Gtk2::TextBuffer::get_line_count", XS_Gtk2__TextBuffer_get_line_count, file);
        newXS("Gtk2::TextBuffer::get_char_count", XS_Gtk2__TextBuffer_get_char_count, file);
        newXS("Gtk2::TextBuffer::get_tag_table", XS_Gtk2__TextBuffer_get_tag_table, file);
        newXS("Gtk2::TextBuffer::insert", XS_Gtk2__TextBuffer_insert, file);
        newXS("Gtk2::TextBuffer::insert_at_cursor", XS_Gtk2__TextBuffer_insert_at_cursor, file);
        newXS("Gtk2::TextBuffer::insert_interactive", XS_Gtk2__TextBuffer_insert_interactive, file);
        newXS("Gtk2::TextBuffer::insert_interactive_at_cursor", XS_Gtk2__TextBuffer_insert_interactive_at_cursor, file);
        newXS("Gtk2::TextBuffer::insert_range", XS_Gtk2__TextBuffer_insert_range, file);
        newXS("Gtk2::TextBuffer::insert_range_interactive", XS_Gtk2__TextBuffer_insert_range_interactive, file);
        newXS("Gtk2::TextBuffer::insert_with_tags", XS_Gtk2__TextBuffer_insert_with_tags, file);
        newXS("Gtk2::TextBuffer::insert_with_tags_by_name", XS_Gtk2__TextBuffer_insert_with_tags_by_name, file);
        newXS("Gtk2::TextBuffer::delete", XS_Gtk2__TextBuffer_delete, file);
        newXS("Gtk2::TextBuffer::delete_interactive", XS_Gtk2__TextBuffer_delete_interactive, file);
        newXS("Gtk2::TextBuffer::set_text", XS_Gtk2__TextBuffer_set_text, file);
        newXS("Gtk2::TextBuffer::get_text", XS_Gtk2__TextBuffer_get_text, file);
        newXS("Gtk2::TextBuffer::get_slice", XS_Gtk2__TextBuffer_get_slice, file);
        newXS("Gtk2::TextBuffer::insert_pixbuf", XS_Gtk2__TextBuffer_insert_pixbuf, file);
        newXS("Gtk2::TextBuffer::insert_child_anchor", XS_Gtk2__TextBuffer_insert_child_anchor, file);
        newXS("Gtk2::TextBuffer::create_mark", XS_Gtk2__TextBuffer_create_mark, file);
        newXS("Gtk2::TextBuffer::move_mark", XS_Gtk2__TextBuffer_move_mark, file);
        newXS("Gtk2::TextBuffer::delete_mark", XS_Gtk2__TextBuffer_delete_mark, file);
        newXS("Gtk2::TextBuffer::get_mark", XS_Gtk2__TextBuffer_get_mark, file);
        newXS("Gtk2::TextBuffer::move_mark_by_name", XS_Gtk2__TextBuffer_move_mark_by_name, file);
        newXS("Gtk2::TextBuffer::delete_mark_by_name", XS_Gtk2__TextBuffer_delete_mark_by_name, file);
        newXS("Gtk2::TextBuffer::get_insert", XS_Gtk2__TextBuffer_get_insert, file);
        newXS("Gtk2::TextBuffer::get_selection_bound", XS_Gtk2__TextBuffer_get_selection_bound, file);
        newXS("Gtk2::TextBuffer::place_cursor", XS_Gtk2__TextBuffer_place_cursor, file);
#if XSubPPtmpAAAA
        newXS("Gtk2::TextBuffer::select_range", XS_Gtk2__TextBuffer_select_range, file);
#endif
        newXS("Gtk2::TextBuffer::apply_tag", XS_Gtk2__TextBuffer_apply_tag, file);
        newXS("Gtk2::TextBuffer::remove_tag", XS_Gtk2__TextBuffer_remove_tag, file);
        newXS("Gtk2::TextBuffer::apply_tag_by_name", XS_Gtk2__TextBuffer_apply_tag_by_name, file);
        newXS("Gtk2::TextBuffer::remove_tag_by_name", XS_Gtk2__TextBuffer_remove_tag_by_name, file);
        newXS("Gtk2::TextBuffer::remove_all_tags", XS_Gtk2__TextBuffer_remove_all_tags, file);
        newXS("Gtk2::TextBuffer::create_tag", XS_Gtk2__TextBuffer_create_tag, file);
        newXS("Gtk2::TextBuffer::get_iter_at_line_offset", XS_Gtk2__TextBuffer_get_iter_at_line_offset, file);
        newXS("Gtk2::TextBuffer::get_iter_at_line_index", XS_Gtk2__TextBuffer_get_iter_at_line_index, file);
        newXS("Gtk2::TextBuffer::get_iter_at_offset", XS_Gtk2__TextBuffer_get_iter_at_offset, file);
        newXS("Gtk2::TextBuffer::get_iter_at_line", XS_Gtk2__TextBuffer_get_iter_at_line, file);
        cv = newXS("Gtk2::TextBuffer::get_end_iter", XS_Gtk2__TextBuffer_get_start_iter, file);
        XSANY.any_i32 = 1;
        cv = newXS("Gtk2::TextBuffer::get_start_iter", XS_Gtk2__TextBuffer_get_start_iter, file);
        XSANY.any_i32 = 0;
        newXS("Gtk2::TextBuffer::get_bounds", XS_Gtk2__TextBuffer_get_bounds, file);
        newXS("Gtk2::TextBuffer::get_iter_at_mark", XS_Gtk2__TextBuffer_get_iter_at_mark, file);
        newXS("Gtk2::TextBuffer::get_iter_at_child_anchor", XS_Gtk2__TextBuffer_get_iter_at_child_anchor, file);
        newXS("Gtk2::TextBuffer::get_modified", XS_Gtk2__TextBuffer_get_modified, file);
        newXS("Gtk2::TextBuffer::set_modified", XS_Gtk2__TextBuffer_set_modified, file);
#if XSubPPtmpAAAB
        newXS("Gtk2::TextBuffer::add_selection_clipboard", XS_Gtk2__TextBuffer_add_selection_clipboard, file);
        newXS("Gtk2::TextBuffer::remove_selection_clipboard", XS_Gtk2__TextBuffer_remove_selection_clipboard, file);
        newXS("Gtk2::TextBuffer::cut_clipboard", XS_Gtk2__TextBuffer_cut_clipboard, file);
        newXS("Gtk2::TextBuffer::copy_clipboard", XS_Gtk2__TextBuffer_copy_clipboard, file);
        newXS("Gtk2::TextBuffer::paste_clipboard", XS_Gtk2__TextBuffer_paste_clipboard, file);
#endif
        newXS("Gtk2::TextBuffer::get_selection_bounds", XS_Gtk2__TextBuffer_get_selection_bounds, file);
        newXS("Gtk2::TextBuffer::delete_selection", XS_Gtk2__TextBuffer_delete_selection, file);
        newXS("Gtk2::TextBuffer::begin_user_action", XS_Gtk2__TextBuffer_begin_user_action, file);
        newXS("Gtk2::TextBuffer::end_user_action", XS_Gtk2__TextBuffer_end_user_action, file);
        newXS("Gtk2::TextBuffer::create_child_anchor", XS_Gtk2__TextBuffer_create_child_anchor, file);
#if XSubPPtmpAAAC
        newXS("Gtk2::TextBuffer::backspace", XS_Gtk2__TextBuffer_backspace, file);
#endif
#if XSubPPtmpAAAD
        newXS("Gtk2::TextBuffer::get_has_selection", XS_Gtk2__TextBuffer_get_has_selection, file);
        newXS("Gtk2::TextBuffer::get_copy_target_list", XS_Gtk2__TextBuffer_get_copy_target_list, file);
        newXS("Gtk2::TextBuffer::get_paste_target_list", XS_Gtk2__TextBuffer_get_paste_target_list, file);
#endif
#if XSubPPtmpAAAE
        newXS("Gtk2::TextBuffer::add_mark", XS_Gtk2__TextBuffer_add_mark, file);
#endif
    }

    /* Initialisation Section */

#if XSubPPtmpAAAA
#endif
#if XSubPPtmpAAAB
#endif
#if XSubPPtmpAAAC
#endif
#if XSubPPtmpAAAD
#endif
#if XSubPPtmpAAAE
#endif
#line 1752 "xs/GtkTextBuffer.c"

    /* End of Initialisation Section */

#if (PERL_REVISION == 5 && PERL_VERSION >= 9)
  if (PL_unitcheckav)
       call_list(PL_scopestack_ix, PL_unitcheckav);
#endif
    XSRETURN_YES;
}

