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

#line 1 "xs/GtkRecentManager.xs"
/*
 * Copyright (C) 2006, 2010 by the gtk2-perl team (see the file AUTHORS for a
 * complete listing)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser 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.
 */

#include "gtk2perl.h"

/* Also used in GtkRecentFilter.xs */
const gchar **
gtk2perl_sv_to_strv (SV *sv)
{
	AV *av;
	SV **svp;
	int i;
	gchar **retval;

	if (!gperl_sv_is_array_ref (sv))
		croak ("invalid groups value - expecting an array reference");

	av = (AV *) SvRV (sv);
	retval = gperl_alloc_temp (sizeof (gchar*) * (av_len (av) + 2));
	for (i = 0; i <= av_len (av); i++)
		if ((svp = av_fetch (av, i, 0)))
			retval[i] = SvGChar (*svp);
	retval[i] = NULL;

	return (const gchar **) retval;
}

/* Used in GtkRecentFilter.xs */
SV *
gtk2perl_sv_from_strv (const gchar **strv)
{
	AV *av;
	int i;

	av = newAV ();
	i = 0;
	while (strv[i])
		av_push (av, newSVGChar (strv[i++]));

	return newRV_noinc ((SV *) av);
}

/*
struct _GtkRecentData
{
  gchar *display_name;
  gchar *description;

  gchar *mime_type;

  gchar *app_name;
  gchar *app_exec;

  gchar **groups;

  gboolean is_private;
};
*/

static GtkRecentData *
SvGtkRecentData (SV *sv)
{
  GtkRecentData *data;
  HV *hv;
  SV **svp;

  if (!gperl_sv_is_hash_ref (sv))
	  croak ("invalid recent data - expecting a hash reference");

  hv = (HV *) SvRV (sv);

  data = gperl_alloc_temp (sizeof (GtkRecentData));

  if ((svp = hv_fetch (hv, "display_name", 12, 0)))
	  data->display_name = SvGChar (*svp);

  if ((svp = hv_fetch (hv, "description", 11, 0)))
	  data->description = SvGChar (*svp);

  if ((svp = hv_fetch (hv, "mime_type", 9, 0)))
	  data->mime_type = SvGChar (*svp);

  if ((svp = hv_fetch (hv, "app_name", 8, 0)))
	  data->app_name = SvGChar (*svp);

  if ((svp = hv_fetch (hv, "app_exec", 8, 0)))
	  data->app_exec = SvGChar (*svp);

  if ((svp = hv_fetch (hv, "is_private", 10, 0)))
	  data->is_private = SvIV (*svp);

  if ((svp = hv_fetch (hv, "groups", 6, 0)))
	  data->groups = (gchar **) gtk2perl_sv_to_strv (*svp);

  return data;
}

#line 125 "xs/GtkRecentManager.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 267 "xs/GtkRecentManager.c"

XS_EUPXS(XS_Gtk2__RecentManager_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_new)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "class");
    {
	GtkRecentManager_noinc *	RETVAL;

	RETVAL = gtk_recent_manager_new(/* void */);
	ST(0) = newSVGtkRecentManager_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentManager_get_default); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_get_default)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "class");
    {
	GtkRecentManager *	RETVAL;

	RETVAL = gtk_recent_manager_get_default(/* void */);
	ST(0) = newSVGtkRecentManager (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentManager_get_for_screen); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_get_for_screen)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, screen");
    {
	GtkRecentManager *	RETVAL;
	GdkScreen *	screen = SvGdkScreen (ST(1))
;

	RETVAL = gtk_recent_manager_get_for_screen(screen);
	ST(0) = newSVGtkRecentManager (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentManager_set_screen); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_set_screen)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "manager, screen");
    {
	GtkRecentManager *	manager = SvGtkRecentManager (ST(0))
;
	GdkScreen *	screen = SvGdkScreen (ST(1))
;

	gtk_recent_manager_set_screen(manager, screen);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__RecentManager_add_item); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_add_item)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "manager, uri");
    {
	gboolean	RETVAL;
	GtkRecentManager *	manager = SvGtkRecentManager (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_recent_manager_add_item(manager, uri);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentManager_add_full); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_add_full)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "manager, uri, data");
    {
	gboolean	RETVAL;
	GtkRecentManager *	manager = SvGtkRecentManager (ST(0))
;
	const gchar *	uri;
	SV *	data = ST(2)
;

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

	RETVAL = gtk_recent_manager_add_full(manager, uri, SvGtkRecentData (data));
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentManager_remove_item); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_remove_item)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "manager, uri");
    {
#line 202 "xs/GtkRecentManager.xs"
        GError *error = NULL;
#line 399 "xs/GtkRecentManager.c"
	GtkRecentManager *	manager = SvGtkRecentManager (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))
;
#line 204 "xs/GtkRecentManager.xs"
        gtk_recent_manager_remove_item (manager, uri, &error);
	if (error)
		gperl_croak_gerror (NULL, error);
#line 412 "xs/GtkRecentManager.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__RecentManager_lookup_item); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_lookup_item)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "manager, uri");
    {
#line 213 "xs/GtkRecentManager.xs"
        GError *error = NULL;
#line 427 "xs/GtkRecentManager.c"
	GtkRecentInfo *	RETVAL;
	GtkRecentManager *	manager = SvGtkRecentManager (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))
;
#line 215 "xs/GtkRecentManager.xs"
        RETVAL = gtk_recent_manager_lookup_item (manager, uri, &error);
	if (error)
		gperl_croak_gerror (NULL, error);
#line 441 "xs/GtkRecentManager.c"
	ST(0) = newSVGtkRecentInfo (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentManager_has_item); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_has_item)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "manager, uri");
    {
	gboolean	RETVAL;
	GtkRecentManager *	manager = SvGtkRecentManager (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_recent_manager_has_item(manager, uri);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentManager_move_item); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_move_item)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "manager, old_uri, new_uri");
    {
	GtkRecentManager *	manager = SvGtkRecentManager (ST(0))
;
	const gchar *	old_uri;
	const gchar_ornull *	new_uri;
#line 232 "xs/GtkRecentManager.xs"
        GError *error = NULL;
#line 486 "xs/GtkRecentManager.c"

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

	/* same as SvGChar(), but allows undef as NULL */
	if (gperl_sv_is_defined (ST(2))) {
		sv_utf8_upgrade (ST(2));
		new_uri = (const gchar_ornull *)SvPV_nolen (ST(2));
	} else {
		new_uri = NULL;
	}
;
#line 234 "xs/GtkRecentManager.xs"
        gtk_recent_manager_move_item (manager, old_uri, new_uri, &error);
	if (error)
		gperl_croak_gerror (NULL, error);
#line 505 "xs/GtkRecentManager.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__RecentManager_set_limit); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_set_limit)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "manager, limit");
    {
	GtkRecentManager *	manager = SvGtkRecentManager (ST(0))
;
	gint	limit = (gint)SvIV(ST(1))
;

	gtk_recent_manager_set_limit(manager, limit);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__RecentManager_get_limit); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_get_limit)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "manager");
    {
	gint	RETVAL;
	dXSTARG;
	GtkRecentManager *	manager = SvGtkRecentManager (ST(0))
;

	RETVAL = gtk_recent_manager_get_limit(manager);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentManager_get_items); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_get_items)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "manager");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 250 "xs/GtkRecentManager.xs"
        GList *items, *l;
#line 559 "xs/GtkRecentManager.c"
	GtkRecentManager *	manager = SvGtkRecentManager (ST(0))
;
#line 252 "xs/GtkRecentManager.xs"
        items = gtk_recent_manager_get_items (manager);
	for (l = items; l != NULL; l = l->next)
		XPUSHs (sv_2mortal (newSVGtkRecentInfo_own (l->data)));
	g_list_free (items);
#line 567 "xs/GtkRecentManager.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__RecentManager_purge_items); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentManager_purge_items)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "manager");
    {
#line 262 "xs/GtkRecentManager.xs"
        GError *error = NULL;
#line 583 "xs/GtkRecentManager.c"
	gint	RETVAL;
	dXSTARG;
	GtkRecentManager *	manager = SvGtkRecentManager (ST(0))
;
#line 264 "xs/GtkRecentManager.xs"
        RETVAL = gtk_recent_manager_purge_items (manager, &error);
	if (error)
		gperl_croak_gerror (NULL, error);
#line 592 "xs/GtkRecentManager.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentInfo_get_uri); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_get_uri)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    {
	const gchar *	RETVAL;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;
#line 304 "xs/GtkRecentManager.xs"
        switch (ix) {
		case 0: RETVAL = gtk_recent_info_get_uri          (info); break;
		case 1: RETVAL = gtk_recent_info_get_display_name (info); break;
		case 2: RETVAL = gtk_recent_info_get_description  (info); break;
		case 3: RETVAL = gtk_recent_info_get_mime_type    (info); break;
		default:
			RETVAL = NULL;
			g_assert_not_reached ();
	}
#line 620 "xs/GtkRecentManager.c"
	ST(0) = sv_newmortal();
	/* same as newSVGChar(), but not in a function */
	sv_setpv ((SV*)ST(0), RETVAL);
	SvUTF8_on (ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentInfo_get_added); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_get_added)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    {
	time_t	RETVAL;
	dXSTARG;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;
#line 336 "xs/GtkRecentManager.xs"
        switch (ix) {
		case 0: RETVAL = gtk_recent_info_get_added    (info); break;
		case 1: RETVAL = gtk_recent_info_get_modified (info); break;
		case 2: RETVAL = gtk_recent_info_get_visited  (info); break;
		default:
			RETVAL = (time_t) -1;
			g_assert_not_reached ();
	}
#line 651 "xs/GtkRecentManager.c"
	XSprePUSH; PUSHn((NV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentInfo_get_private_hint); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_get_private_hint)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    {
	gboolean	RETVAL;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;

	RETVAL = gtk_recent_info_get_private_hint(info);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentInfo_get_application_info); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_get_application_info)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "info, app_name");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;
	const gchar *	app_name;
#line 360 "xs/GtkRecentManager.xs"
	const gchar *app_exec;
	guint count;
	time_t timestamp;
	gboolean res;
#line 693 "xs/GtkRecentManager.c"

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	app_name = (const gchar *)SvPV_nolen (ST(1))
;
#line 365 "xs/GtkRecentManager.xs"
        res = gtk_recent_info_get_application_info (info, app_name,
						    &app_exec,
						    &count,
						    &timestamp);
	if (!res)
		XSRETURN_EMPTY;
	EXTEND (SP, 3);
	PUSHs (sv_2mortal (newSVGChar (app_exec)));
	PUSHs (sv_2mortal (newSVuv (count)));
	PUSHs (sv_2mortal (newSViv (timestamp)));
#line 710 "xs/GtkRecentManager.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__RecentInfo_get_applications); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_get_applications)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 382 "xs/GtkRecentManager.xs"
        gchar **apps;
        gsize length, i;
#line 729 "xs/GtkRecentManager.c"
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;
#line 385 "xs/GtkRecentManager.xs"
        apps = gtk_recent_info_get_applications (info, &length);
	if (length > 0) {
		EXTEND (SP, length);
		for (i = 0; i < length; i++) {
			if (apps[i])
				PUSHs (sv_2mortal (newSVGChar (apps[i])));
		}
		g_strfreev (apps);
	}
	else
		XSRETURN_EMPTY;
#line 744 "xs/GtkRecentManager.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__RecentInfo_last_application); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_last_application)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    {
	gchar_own *	RETVAL;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;

	RETVAL = gtk_recent_info_last_application(info);
	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__RecentInfo_has_application); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_has_application)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "info, app_name");
    {
	gboolean	RETVAL;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;
	const gchar *	app_name;

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

	RETVAL = gtk_recent_info_has_application(info, app_name);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentInfo_get_groups); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_get_groups)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 409 "xs/GtkRecentManager.xs"
        gchar **groups;
	gsize length, i;
#line 811 "xs/GtkRecentManager.c"
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;
#line 412 "xs/GtkRecentManager.xs"
        groups = gtk_recent_info_get_groups (info, &length);
	if (length > 0) {
		EXTEND (SP, length);
		for (i = 0; i < length; i++) {
			if (groups[i])
				PUSHs (sv_2mortal (newSVGChar (groups[i])));
		}
		g_strfreev (groups);
	}
	else
		XSRETURN_EMPTY;
#line 826 "xs/GtkRecentManager.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__RecentInfo_has_group); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_has_group)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "info, group_name");
    {
	gboolean	RETVAL;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;
	const gchar *	group_name;

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

	RETVAL = gtk_recent_info_has_group(info, group_name);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentInfo_get_icon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_get_icon)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "info, size");
    {
	GdkPixbuf_noinc *	RETVAL;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;
	gint	size = (gint)SvIV(ST(1))
;

	RETVAL = gtk_recent_info_get_icon(info, size);
	ST(0) = newSVGdkPixbuf_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentInfo_get_short_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_get_short_name)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    {
	gchar_own *	RETVAL;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;

	RETVAL = gtk_recent_info_get_short_name(info);
	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__RecentInfo_get_uri_display); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_get_uri_display)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    {
	gchar_own *	RETVAL;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;

	RETVAL = gtk_recent_info_get_uri_display(info);
	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__RecentInfo_get_age); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_get_age)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    {
	gint	RETVAL;
	dXSTARG;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;

	RETVAL = gtk_recent_info_get_age(info);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentInfo_is_local); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_is_local)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    {
	gboolean	RETVAL;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;

	RETVAL = gtk_recent_info_is_local(info);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentInfo_exists); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_exists)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    {
	gboolean	RETVAL;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;

	RETVAL = gtk_recent_info_exists(info);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__RecentInfo_match); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__RecentInfo_match)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "info, other_info");
    {
	gboolean	RETVAL;
	GtkRecentInfo *	info = SvGtkRecentInfo (ST(0))
;
	GtkRecentInfo *	other_info = SvGtkRecentInfo (ST(1))
;

	RETVAL = gtk_recent_info_match(info, other_info);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Gtk2__RecentManager); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Gtk2__RecentManager)
{
    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;

        newXS("Gtk2::RecentManager::new", XS_Gtk2__RecentManager_new, file);
        newXS("Gtk2::RecentManager::get_default", XS_Gtk2__RecentManager_get_default, file);
        newXS("Gtk2::RecentManager::get_for_screen", XS_Gtk2__RecentManager_get_for_screen, file);
        newXS("Gtk2::RecentManager::set_screen", XS_Gtk2__RecentManager_set_screen, file);
        newXS("Gtk2::RecentManager::add_item", XS_Gtk2__RecentManager_add_item, file);
        newXS("Gtk2::RecentManager::add_full", XS_Gtk2__RecentManager_add_full, file);
        newXS("Gtk2::RecentManager::remove_item", XS_Gtk2__RecentManager_remove_item, file);
        newXS("Gtk2::RecentManager::lookup_item", XS_Gtk2__RecentManager_lookup_item, file);
        newXS("Gtk2::RecentManager::has_item", XS_Gtk2__RecentManager_has_item, file);
        newXS("Gtk2::RecentManager::move_item", XS_Gtk2__RecentManager_move_item, file);
        newXS("Gtk2::RecentManager::set_limit", XS_Gtk2__RecentManager_set_limit, file);
        newXS("Gtk2::RecentManager::get_limit", XS_Gtk2__RecentManager_get_limit, file);
        newXS("Gtk2::RecentManager::get_items", XS_Gtk2__RecentManager_get_items, file);
        newXS("Gtk2::RecentManager::purge_items", XS_Gtk2__RecentManager_purge_items, file);
        cv = newXS("Gtk2::RecentInfo::get_description", XS_Gtk2__RecentInfo_get_uri, file);
        XSANY.any_i32 = 2;
        cv = newXS("Gtk2::RecentInfo::get_display_name", XS_Gtk2__RecentInfo_get_uri, file);
        XSANY.any_i32 = 1;
        cv = newXS("Gtk2::RecentInfo::get_mime_type", XS_Gtk2__RecentInfo_get_uri, file);
        XSANY.any_i32 = 3;
        cv = newXS("Gtk2::RecentInfo::get_uri", XS_Gtk2__RecentInfo_get_uri, file);
        XSANY.any_i32 = 0;
        cv = newXS("Gtk2::RecentInfo::get_added", XS_Gtk2__RecentInfo_get_added, file);
        XSANY.any_i32 = 0;
        cv = newXS("Gtk2::RecentInfo::get_modified", XS_Gtk2__RecentInfo_get_added, file);
        XSANY.any_i32 = 1;
        cv = newXS("Gtk2::RecentInfo::get_visited", XS_Gtk2__RecentInfo_get_added, file);
        XSANY.any_i32 = 2;
        newXS("Gtk2::RecentInfo::get_private_hint", XS_Gtk2__RecentInfo_get_private_hint, file);
        newXS("Gtk2::RecentInfo::get_application_info", XS_Gtk2__RecentInfo_get_application_info, file);
        newXS("Gtk2::RecentInfo::get_applications", XS_Gtk2__RecentInfo_get_applications, file);
        newXS("Gtk2::RecentInfo::last_application", XS_Gtk2__RecentInfo_last_application, file);
        newXS("Gtk2::RecentInfo::has_application", XS_Gtk2__RecentInfo_has_application, file);
        newXS("Gtk2::RecentInfo::get_groups", XS_Gtk2__RecentInfo_get_groups, file);
        newXS("Gtk2::RecentInfo::has_group", XS_Gtk2__RecentInfo_has_group, file);
        newXS("Gtk2::RecentInfo::get_icon", XS_Gtk2__RecentInfo_get_icon, file);
        newXS("Gtk2::RecentInfo::get_short_name", XS_Gtk2__RecentInfo_get_short_name, file);
        newXS("Gtk2::RecentInfo::get_uri_display", XS_Gtk2__RecentInfo_get_uri_display, file);
        newXS("Gtk2::RecentInfo::get_age", XS_Gtk2__RecentInfo_get_age, file);
        newXS("Gtk2::RecentInfo::is_local", XS_Gtk2__RecentInfo_is_local, file);
        newXS("Gtk2::RecentInfo::exists", XS_Gtk2__RecentInfo_exists, file);
        newXS("Gtk2::RecentInfo::match", XS_Gtk2__RecentInfo_match, file);
#if (PERL_REVISION == 5 && PERL_VERSION >= 9)
  if (PL_unitcheckav)
       call_list(PL_scopestack_ix, PL_unitcheckav);
#endif
    XSRETURN_YES;
}

