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

#line 1 "xs/GtkFileChooser.xs"
/*
 * Copyright (c) 2003-2005 by the gtk2-perl team (see the file AUTHORS)
 *
 * Licensed under the LGPL, see LICENSE file for more information.
 *
 * $Id$
 */

#include "gtk2perl.h"

#line 21 "xs/GtkFileChooser.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 165 "xs/GtkFileChooser.c"

XS_EUPXS(XS_Gtk2__FileChooser_set_action); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_action)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, action");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	GtkFileChooserAction	action = SvGtkFileChooserAction (ST(1))
;

	gtk_file_chooser_set_action(chooser, action);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_action); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_action)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	GtkFileChooserAction	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_action(chooser);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGtkFileChooserAction (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_set_local_only); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_local_only)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, files_only");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	gboolean	files_only = (bool)SvTRUE(ST(1))
;

	gtk_file_chooser_set_local_only(chooser, files_only);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_local_only); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_local_only)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_local_only(chooser);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_set_select_multiple); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_select_multiple)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, select_multiple");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	gboolean	select_multiple = (bool)SvTRUE(ST(1))
;

	gtk_file_chooser_set_select_multiple(chooser, select_multiple);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_select_multiple); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_select_multiple)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_select_multiple(chooser);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_set_current_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_current_name)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, name");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (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_file_chooser_set_current_name(chooser, name);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_filename); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_filename)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	gchar_own *	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_filename(chooser);
	{
	    SV * RETVALSV;
	    RETVALSV = 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*)RETVALSV, RETVAL);
	    SvUTF8_on (RETVALSV);
	    g_free (RETVAL);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_set_filename); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_filename)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, filename");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	const char *	filename = (const char *)SvPV_nolen(ST(1))
;

	RETVAL = gtk_file_chooser_set_filename(chooser, filename);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_select_filename); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_select_filename)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, filename");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	const char *	filename = (const char *)SvPV_nolen(ST(1))
;

	RETVAL = gtk_file_chooser_select_filename(chooser, filename);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_unselect_filename); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_unselect_filename)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, filename");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	const char *	filename = (const char *)SvPV_nolen(ST(1))
;

	gtk_file_chooser_unselect_filename(chooser, filename);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_select_all); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_select_all)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	gtk_file_chooser_select_all(chooser);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_unselect_all); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_unselect_all)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	gtk_file_chooser_unselect_all(chooser);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_filenames); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_filenames)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 51 "xs/GtkFileChooser.xs"
	GSList * names, * i;
#line 431 "xs/GtkFileChooser.c"
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
#line 53 "xs/GtkFileChooser.xs"
	names = gtk_file_chooser_get_filenames (chooser);
	for (i = names ; i != NULL ; i = i->next) {
		XPUSHs (sv_2mortal (newSVGChar (i->data)));
		g_free (i->data);
	}
	g_slist_free (names);
#line 441 "xs/GtkFileChooser.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__FileChooser_set_current_folder); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_current_folder)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, filename");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	const gchar *	filename;

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

	RETVAL = gtk_file_chooser_set_current_folder(chooser, filename);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_get_current_folder); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_current_folder)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	gchar_own *	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_current_folder(chooser);
	{
	    SV * RETVALSV;
	    RETVALSV = 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*)RETVALSV, RETVAL);
	    SvUTF8_on (RETVALSV);
	    g_free (RETVAL);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_get_uri); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_uri)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	gchar_own *	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_uri(chooser);
	{
	    SV * RETVALSV;
	    RETVALSV = 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*)RETVALSV, RETVAL);
	    SvUTF8_on (RETVALSV);
	    g_free (RETVAL);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_set_uri); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_uri)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, uri");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	const char *	uri = (const char *)SvPV_nolen(ST(1))
;

	RETVAL = gtk_file_chooser_set_uri(chooser, uri);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_select_uri); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_select_uri)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, uri");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	const char *	uri = (const char *)SvPV_nolen(ST(1))
;

	RETVAL = gtk_file_chooser_select_uri(chooser, uri);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_unselect_uri); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_unselect_uri)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, uri");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	const char *	uri = (const char *)SvPV_nolen(ST(1))
;

	gtk_file_chooser_unselect_uri(chooser, uri);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_uris); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_uris)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 78 "xs/GtkFileChooser.xs"
	GSList * uris, * i;
#line 597 "xs/GtkFileChooser.c"
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
#line 80 "xs/GtkFileChooser.xs"
	uris = gtk_file_chooser_get_uris (chooser);
	for (i = uris ; i != NULL ; i = i->next) {
		XPUSHs (sv_2mortal (newSVGChar (i->data)));
		g_free (i->data);
	}
	g_slist_free (uris);
#line 607 "xs/GtkFileChooser.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__FileChooser_set_current_folder_uri); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_current_folder_uri)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, uri");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	const gchar *	uri;

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

	RETVAL = gtk_file_chooser_set_current_folder_uri(chooser, uri);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_get_current_folder_uri); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_current_folder_uri)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	gchar_own *	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_current_folder_uri(chooser);
	{
	    SV * RETVALSV;
	    RETVALSV = 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*)RETVALSV, RETVAL);
	    SvUTF8_on (RETVALSV);
	    g_free (RETVAL);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_set_preview_widget); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_preview_widget)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, preview_widget");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	GtkWidget *	preview_widget = SvGtkWidget (ST(1))
;

	gtk_file_chooser_set_preview_widget(chooser, preview_widget);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_preview_widget); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_preview_widget)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	GtkWidget *	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_preview_widget(chooser);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGtkWidget (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_set_preview_widget_active); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_preview_widget_active)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, active");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	gboolean	active = (bool)SvTRUE(ST(1))
;

	gtk_file_chooser_set_preview_widget_active(chooser, active);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_preview_widget_active); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_preview_widget_active)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_preview_widget_active(chooser);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_get_preview_filename); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_preview_filename)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "file_chooser");
    {
	GPerlFilename_own	RETVAL;
	GtkFileChooser *	file_chooser = SvGtkFileChooser (ST(0))
;
#line 111 "xs/GtkFileChooser.xs"
	RETVAL = gtk_file_chooser_get_preview_filename (file_chooser);
	if (!RETVAL)
		XSRETURN_UNDEF;
#line 757 "xs/GtkFileChooser.c"
	{
	    SV * RETVALSV;
	    RETVALSV = sv_newmortal();
	    sv_setsv (RETVALSV, sv_2mortal (gperl_sv_from_filename (RETVAL)));
	    g_free (RETVAL);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_get_preview_uri); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_preview_uri)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "file_chooser");
    {
	gchar_own *	RETVAL;
	GtkFileChooser *	file_chooser = SvGtkFileChooser (ST(0))
;
#line 120 "xs/GtkFileChooser.xs"
	RETVAL = gtk_file_chooser_get_preview_uri (file_chooser);
	if (!RETVAL)
		XSRETURN_UNDEF;
#line 784 "xs/GtkFileChooser.c"
	{
	    SV * RETVALSV;
	    RETVALSV = 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*)RETVALSV, RETVAL);
	    SvUTF8_on (RETVALSV);
	    g_free (RETVAL);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_set_use_preview_label); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_use_preview_label)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, use_label");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	gboolean	use_label = (bool)SvTRUE(ST(1))
;

	gtk_file_chooser_set_use_preview_label(chooser, use_label);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_use_preview_label); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_use_preview_label)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_use_preview_label(chooser);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_set_extra_widget); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_extra_widget)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, extra_widget");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	GtkWidget *	extra_widget = SvGtkWidget (ST(1))
;

	gtk_file_chooser_set_extra_widget(chooser, extra_widget);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_extra_widget); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_extra_widget)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	GtkWidget *	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_extra_widget(chooser);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGtkWidget (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_add_filter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_add_filter)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, filter");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	GtkFileFilter *	filter = SvGtkFileFilter (ST(1))
;

	gtk_file_chooser_add_filter(chooser, filter);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_remove_filter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_remove_filter)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, filter");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	GtkFileFilter *	filter = SvGtkFileFilter (ST(1))
;

	gtk_file_chooser_remove_filter(chooser, filter);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_list_filters); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_list_filters)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 145 "xs/GtkFileChooser.xs"
	GSList * filters, * i;
#line 925 "xs/GtkFileChooser.c"
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
#line 147 "xs/GtkFileChooser.xs"
	filters = gtk_file_chooser_list_filters (chooser);
	for (i = filters ; i != NULL ; i = i->next)
		XPUSHs (sv_2mortal (newSVGtkFileFilter (i->data)));
	g_slist_free (filters);
#line 933 "xs/GtkFileChooser.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__FileChooser_set_filter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_filter)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, filter");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	GtkFileFilter *	filter = SvGtkFileFilter (ST(1))
;

	gtk_file_chooser_set_filter(chooser, filter);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_filter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_filter)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	GtkFileFilter *	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_filter(chooser);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGtkFileFilter (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__FileChooser_add_shortcut_folder); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_add_shortcut_folder)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, folder");
    {
#line 170 "xs/GtkFileChooser.xs"
	GError * error = NULL;
	gboolean ret = FALSE;
#line 992 "xs/GtkFileChooser.c"
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	const char *	folder = (const char *)SvPV_nolen(ST(1))
;
#line 173 "xs/GtkFileChooser.xs"
	switch (ix) {
	    case 0: ret = gtk_file_chooser_add_shortcut_folder (chooser, folder, &error); break;
	    case 1: ret = gtk_file_chooser_remove_shortcut_folder (chooser, folder, &error); break;
	    case 2: ret = gtk_file_chooser_add_shortcut_folder_uri (chooser, folder, &error); break;
	    case 3: ret = gtk_file_chooser_remove_shortcut_folder_uri (chooser, folder, &error); break;
	    default:
		g_assert_not_reached ();
	}
	if (!ret)
		gperl_croak_gerror (NULL, error);
#line 1008 "xs/GtkFileChooser.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_list_shortcut_folders); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_list_shortcut_folders)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 192 "xs/GtkFileChooser.xs"
	GSList * slist, * i;
#line 1026 "xs/GtkFileChooser.c"
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
#line 194 "xs/GtkFileChooser.xs"
	if (ix == 0)
		slist = gtk_file_chooser_list_shortcut_folders (chooser);
	else
		slist = gtk_file_chooser_list_shortcut_folder_uris (chooser);
	for (i = slist ; i != NULL ; i = i->next) {
		XPUSHs (sv_2mortal (newSVGChar (i->data)));
		g_free (i->data);
	}
	g_slist_free (slist);
#line 1039 "xs/GtkFileChooser.c"
	PUTBACK;
	return;
    }
}

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


XS_EUPXS(XS_Gtk2__FileChooser_set_show_hidden); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_show_hidden)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, show_hidden");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	gboolean	show_hidden = (bool)SvTRUE(ST(1))
;

	gtk_file_chooser_set_show_hidden(chooser, show_hidden);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_show_hidden); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_show_hidden)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_show_hidden(chooser);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}

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


XS_EUPXS(XS_Gtk2__FileChooser_set_do_overwrite_confirmation); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_do_overwrite_confirmation)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, do_overwrite_confirmation");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	gboolean	do_overwrite_confirmation = (bool)SvTRUE(ST(1))
;

	gtk_file_chooser_set_do_overwrite_confirmation(chooser, do_overwrite_confirmation);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_do_overwrite_confirmation); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_do_overwrite_confirmation)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_do_overwrite_confirmation(chooser);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}

#endif
#if GTK_CHECK_VERSION (2, 18, 0)
#define XSubPPtmpAAAC 1


XS_EUPXS(XS_Gtk2__FileChooser_set_create_folders); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_set_create_folders)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "chooser, create_folders");
    {
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;
	gboolean	create_folders = (bool)SvTRUE(ST(1))
;

	gtk_file_chooser_set_create_folders(chooser, create_folders);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__FileChooser_get_create_folders); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__FileChooser_get_create_folders)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "chooser");
    {
	gboolean	RETVAL;
	GtkFileChooser *	chooser = SvGtkFileChooser (ST(0))
;

	RETVAL = gtk_file_chooser_get_create_folders(chooser);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}

#endif
#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Gtk2__FileChooser); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Gtk2__FileChooser)
{
#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("Gtk2::FileChooser::set_action", XS_Gtk2__FileChooser_set_action);
        newXS_deffile("Gtk2::FileChooser::get_action", XS_Gtk2__FileChooser_get_action);
        newXS_deffile("Gtk2::FileChooser::set_local_only", XS_Gtk2__FileChooser_set_local_only);
        newXS_deffile("Gtk2::FileChooser::get_local_only", XS_Gtk2__FileChooser_get_local_only);
        newXS_deffile("Gtk2::FileChooser::set_select_multiple", XS_Gtk2__FileChooser_set_select_multiple);
        newXS_deffile("Gtk2::FileChooser::get_select_multiple", XS_Gtk2__FileChooser_get_select_multiple);
        newXS_deffile("Gtk2::FileChooser::set_current_name", XS_Gtk2__FileChooser_set_current_name);
        newXS_deffile("Gtk2::FileChooser::get_filename", XS_Gtk2__FileChooser_get_filename);
        newXS_deffile("Gtk2::FileChooser::set_filename", XS_Gtk2__FileChooser_set_filename);
        newXS_deffile("Gtk2::FileChooser::select_filename", XS_Gtk2__FileChooser_select_filename);
        newXS_deffile("Gtk2::FileChooser::unselect_filename", XS_Gtk2__FileChooser_unselect_filename);
        newXS_deffile("Gtk2::FileChooser::select_all", XS_Gtk2__FileChooser_select_all);
        newXS_deffile("Gtk2::FileChooser::unselect_all", XS_Gtk2__FileChooser_unselect_all);
        newXS_deffile("Gtk2::FileChooser::get_filenames", XS_Gtk2__FileChooser_get_filenames);
        newXS_deffile("Gtk2::FileChooser::set_current_folder", XS_Gtk2__FileChooser_set_current_folder);
        newXS_deffile("Gtk2::FileChooser::get_current_folder", XS_Gtk2__FileChooser_get_current_folder);
        newXS_deffile("Gtk2::FileChooser::get_uri", XS_Gtk2__FileChooser_get_uri);
        newXS_deffile("Gtk2::FileChooser::set_uri", XS_Gtk2__FileChooser_set_uri);
        newXS_deffile("Gtk2::FileChooser::select_uri", XS_Gtk2__FileChooser_select_uri);
        newXS_deffile("Gtk2::FileChooser::unselect_uri", XS_Gtk2__FileChooser_unselect_uri);
        newXS_deffile("Gtk2::FileChooser::get_uris", XS_Gtk2__FileChooser_get_uris);
        newXS_deffile("Gtk2::FileChooser::set_current_folder_uri", XS_Gtk2__FileChooser_set_current_folder_uri);
        newXS_deffile("Gtk2::FileChooser::get_current_folder_uri", XS_Gtk2__FileChooser_get_current_folder_uri);
        newXS_deffile("Gtk2::FileChooser::set_preview_widget", XS_Gtk2__FileChooser_set_preview_widget);
        newXS_deffile("Gtk2::FileChooser::get_preview_widget", XS_Gtk2__FileChooser_get_preview_widget);
        newXS_deffile("Gtk2::FileChooser::set_preview_widget_active", XS_Gtk2__FileChooser_set_preview_widget_active);
        newXS_deffile("Gtk2::FileChooser::get_preview_widget_active", XS_Gtk2__FileChooser_get_preview_widget_active);
        newXS_deffile("Gtk2::FileChooser::get_preview_filename", XS_Gtk2__FileChooser_get_preview_filename);
        newXS_deffile("Gtk2::FileChooser::get_preview_uri", XS_Gtk2__FileChooser_get_preview_uri);
        newXS_deffile("Gtk2::FileChooser::set_use_preview_label", XS_Gtk2__FileChooser_set_use_preview_label);
        newXS_deffile("Gtk2::FileChooser::get_use_preview_label", XS_Gtk2__FileChooser_get_use_preview_label);
        newXS_deffile("Gtk2::FileChooser::set_extra_widget", XS_Gtk2__FileChooser_set_extra_widget);
        newXS_deffile("Gtk2::FileChooser::get_extra_widget", XS_Gtk2__FileChooser_get_extra_widget);
        newXS_deffile("Gtk2::FileChooser::add_filter", XS_Gtk2__FileChooser_add_filter);
        newXS_deffile("Gtk2::FileChooser::remove_filter", XS_Gtk2__FileChooser_remove_filter);
        newXS_deffile("Gtk2::FileChooser::list_filters", XS_Gtk2__FileChooser_list_filters);
        newXS_deffile("Gtk2::FileChooser::set_filter", XS_Gtk2__FileChooser_set_filter);
        newXS_deffile("Gtk2::FileChooser::get_filter", XS_Gtk2__FileChooser_get_filter);
        cv = newXS_deffile("Gtk2::FileChooser::add_shortcut_folder", XS_Gtk2__FileChooser_add_shortcut_folder);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gtk2::FileChooser::add_shortcut_folder_uri", XS_Gtk2__FileChooser_add_shortcut_folder);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("Gtk2::FileChooser::remove_shortcut_folder", XS_Gtk2__FileChooser_add_shortcut_folder);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gtk2::FileChooser::remove_shortcut_folder_uri", XS_Gtk2__FileChooser_add_shortcut_folder);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("Gtk2::FileChooser::list_shortcut_folder_uris", XS_Gtk2__FileChooser_list_shortcut_folders);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gtk2::FileChooser::list_shortcut_folders", XS_Gtk2__FileChooser_list_shortcut_folders);
        XSANY.any_i32 = 0;
#if XSubPPtmpAAAA
        newXS_deffile("Gtk2::FileChooser::set_show_hidden", XS_Gtk2__FileChooser_set_show_hidden);
        newXS_deffile("Gtk2::FileChooser::get_show_hidden", XS_Gtk2__FileChooser_get_show_hidden);
#endif
#if XSubPPtmpAAAB
        newXS_deffile("Gtk2::FileChooser::set_do_overwrite_confirmation", XS_Gtk2__FileChooser_set_do_overwrite_confirmation);
        newXS_deffile("Gtk2::FileChooser::get_do_overwrite_confirmation", XS_Gtk2__FileChooser_get_do_overwrite_confirmation);
#endif
#if XSubPPtmpAAAC
        newXS_deffile("Gtk2::FileChooser::set_create_folders", XS_Gtk2__FileChooser_set_create_folders);
        newXS_deffile("Gtk2::FileChooser::get_create_folders", XS_Gtk2__FileChooser_get_create_folders);
#endif

    /* Initialisation Section */

#if XSubPPtmpAAAA
#endif
#if XSubPPtmpAAAB
#endif
#if XSubPPtmpAAAC
#endif
#line 1264 "xs/GtkFileChooser.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
}

