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

#line 1 "xs/GdkKeys.xs"
/*
 * Copyright (c) 2003, 2009 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"

/* the _orclass type effectively allows a class name and silently maps it to
   NULL.  used as the first argument this allows a method to be invoked in two
   ways: as an object method and as a class static method. */
typedef GdkKeymap GdkKeymap_orclass;
#define SvGdkKeymap_orclass(sv) ((gperl_sv_is_defined (sv) && SvROK (sv)) ? SvGdkKeymap (sv) : NULL)

static GdkKeymapKey *
SvGdkKeymapKey (SV *sv)
{
	HV *hv;
	SV **value;
	GdkKeymapKey *key;

	if (!gperl_sv_is_hash_ref (sv))
		croak ("GdkKeymapKey must be a hash reference");

	key = gperl_alloc_temp (sizeof (GdkKeymapKey));

	hv = (HV *) SvRV (sv);

	if ((value = hv_fetch (hv, "keycode", 7, 0)) && gperl_sv_is_defined (*value))
		key->keycode = SvUV (*value);
	if ((value = hv_fetch (hv, "group", 5, 0)) && gperl_sv_is_defined (*value))
		key->group = SvIV (*value);
	if ((value = hv_fetch (hv, "level", 5, 0)) && gperl_sv_is_defined (*value))
		key->level = SvIV (*value);

	return key;
}

static SV *
newSVGdkKeymapKey (GdkKeymapKey *key)
{
	HV *hv;

	hv = newHV ();

	gperl_hv_take_sv_s (hv, "keycode", newSVuv (key->keycode));
	gperl_hv_take_sv_s (hv, "group", newSViv (key->group));
	gperl_hv_take_sv_s (hv, "level", newSViv (key->level));

	return newRV_noinc ((SV *) hv);
}

#line 77 "xs/GdkKeys.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 221 "xs/GdkKeys.c"

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

	RETVAL = gdk_keymap_get_default(/* (void) */);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGdkKeymap (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

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


XS_EUPXS(XS_Gtk2__Gdk__Keymap_get_for_display); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Keymap_get_for_display)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, display");
    {
	GdkDisplay *	display = SvGdkDisplay (ST(1))
;
	GdkKeymap *	RETVAL;

	RETVAL = gdk_keymap_get_for_display(display);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGdkKeymap (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#endif

XS_EUPXS(XS_Gtk2__Gdk__Keymap_lookup_key); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Keymap_lookup_key)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "keymap, key");
    {
	GdkKeymap_orclass *	keymap = SvGdkKeymap_orclass (ST(0))
;
	SV *	key = ST(1)
;
#line 95 "xs/GdkKeys.xs"
	GdkKeymapKey * real_key = NULL;
#line 284 "xs/GdkKeys.c"
	guint	RETVAL;
	dXSTARG;
#line 97 "xs/GdkKeys.xs"
	real_key = SvGdkKeymapKey (key);
	RETVAL = gdk_keymap_lookup_key (keymap, real_key);
#line 290 "xs/GdkKeys.c"
	XSprePUSH; PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk__Keymap_translate_keyboard_state); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Keymap_translate_keyboard_state)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "keymap, hardware_keycode, state, group");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GdkKeymap_orclass *	keymap = SvGdkKeymap_orclass (ST(0))
;
	guint	hardware_keycode = (guint)SvUV(ST(1))
;
	GdkModifierType	state = SvGdkModifierType (ST(2))
;
	gint	group = (gint)SvIV(ST(3))
;
#line 113 "xs/GdkKeys.xs"
	guint keyval;
	gint effective_group;
	gint level;
	GdkModifierType consumed_modifiers;
#line 319 "xs/GdkKeys.c"
#line 118 "xs/GdkKeys.xs"
	if (!gdk_keymap_translate_keyboard_state (keymap, hardware_keycode,
						  state, group, &keyval,
						  &effective_group, &level,
						  &consumed_modifiers))
		XSRETURN_EMPTY;
	EXTEND (SP, 4);
	PUSHs (sv_2mortal (newSViv (keyval)));
	PUSHs (sv_2mortal (newSViv (effective_group)));
	PUSHs (sv_2mortal (newSViv (level)));
	PUSHs (sv_2mortal (newSVGdkModifierType (consumed_modifiers)));
#line 331 "xs/GdkKeys.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__Gdk__Keymap_get_entries_for_keyval); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Keymap_get_entries_for_keyval)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "keymap, keyval");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GdkKeymap_orclass *	keymap = SvGdkKeymap_orclass (ST(0))
;
	guint	keyval = (guint)SvUV(ST(1))
;
#line 149 "xs/GdkKeys.xs"
	GdkKeymapKey * keys = NULL;
	gint n_keys;
	int i;
#line 355 "xs/GdkKeys.c"
#line 153 "xs/GdkKeys.xs"
	if (!gdk_keymap_get_entries_for_keyval (keymap, keyval, &keys, &n_keys))
		XSRETURN_EMPTY;
	EXTEND (SP, n_keys);
	for (i = 0; i < n_keys; i++)
		PUSHs (sv_2mortal (newSVGdkKeymapKey (&keys[i])));
	g_free (keys);
#line 363 "xs/GdkKeys.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__Gdk__Keymap_get_entries_for_keycode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Keymap_get_entries_for_keycode)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "keymap, hardware_keycode");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GdkKeymap_orclass *	keymap = SvGdkKeymap_orclass (ST(0))
;
	guint	hardware_keycode = (guint)SvUV(ST(1))
;
#line 171 "xs/GdkKeys.xs"
	GdkKeymapKey * keys = NULL;
	guint * keyvals = NULL;
	gint n_entries;
	int i;
	HV * hv;
#line 389 "xs/GdkKeys.c"
#line 177 "xs/GdkKeys.xs"
	if (!gdk_keymap_get_entries_for_keycode (keymap, hardware_keycode,
						 &keys, &keyvals, &n_entries))
		XSRETURN_EMPTY;
	EXTEND (SP, n_entries);
	for (i = 0; i < n_entries; i++) {
		hv = newHV ();
		gperl_hv_take_sv_s (hv, "key", newSVGdkKeymapKey (&keys[i]));
		gperl_hv_take_sv_s (hv, "keyval", newSVuv (keyvals[i]));
		PUSHs (sv_2mortal (newRV_noinc ((SV*) hv)));
	}
#line 401 "xs/GdkKeys.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__Gdk__Keymap_get_direction); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Keymap_get_direction)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "keymap");
    {
	GdkKeymap_orclass *	keymap = SvGdkKeymap_orclass (ST(0))
;
	PangoDirection	RETVAL;

	RETVAL = gdk_keymap_get_direction(keymap);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVPangoDirection (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

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


XS_EUPXS(XS_Gtk2__Gdk__Keymap_have_bidi_layouts); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Keymap_have_bidi_layouts)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "keymap");
    {
	gboolean	RETVAL;
	GdkKeymap *	keymap = SvGdkKeymap (ST(0))
;

	RETVAL = gdk_keymap_have_bidi_layouts(keymap);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}

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


XS_EUPXS(XS_Gtk2__Gdk__Keymap_get_caps_lock_state); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Keymap_get_caps_lock_state)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "keymap");
    {
	gboolean	RETVAL;
	GdkKeymap *	keymap = SvGdkKeymap (ST(0))
;

	RETVAL = gdk_keymap_get_caps_lock_state(keymap);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}

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


XS_EUPXS(XS_Gtk2__Gdk__Keymap_add_virtual_modifiers); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Keymap_add_virtual_modifiers)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "keymap, state");
    {
	GdkModifierType	RETVAL;
	GdkKeymap *	keymap = SvGdkKeymap (ST(0))
;
	GdkModifierType	state = SvGdkModifierType (ST(1))
;
#line 209 "xs/GdkKeys.xs"
	gdk_keymap_add_virtual_modifiers (keymap, &state);
	RETVAL = state;
#line 493 "xs/GdkKeys.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGdkModifierType (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk__Keymap_map_virtual_modifiers); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Keymap_map_virtual_modifiers)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "keymap, state");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 220 "xs/GdkKeys.xs"
	gboolean result;
#line 516 "xs/GdkKeys.c"
	GdkKeymap *	keymap = SvGdkKeymap (ST(0))
;
	GdkModifierType	state = SvGdkModifierType (ST(1))
;
#line 222 "xs/GdkKeys.xs"
	result = gdk_keymap_map_virtual_modifiers (keymap, &state);
	EXTEND (SP, 2);
	PUSHs (sv_2mortal (boolSV (result)));
	PUSHs (sv_2mortal (newSVGdkModifierType (state)));
#line 526 "xs/GdkKeys.c"
	PUTBACK;
	return;
    }
}

#endif /* 2.20 */

XS_EUPXS(XS_Gtk2__Gdk_keyval_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_keyval_name)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, keyval");
    {
	guint	keyval = (guint)SvUV(ST(1))
;
	gchar *	RETVAL;

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


XS_EUPXS(XS_Gtk2__Gdk_keyval_from_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_keyval_from_name)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, keyval_name");
    {
	const gchar *	keyval_name;
	guint	RETVAL;
	dXSTARG;

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

	RETVAL = gdk_keyval_from_name(keyval_name);
	XSprePUSH; PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk_keyval_convert_case); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_keyval_convert_case)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, symbol");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guint	symbol = (guint)SvUV(ST(1))
;
#line 252 "xs/GdkKeys.xs"
	guint lower;
	guint upper;
#line 596 "xs/GdkKeys.c"
#line 255 "xs/GdkKeys.xs"
	gdk_keyval_convert_case (symbol, &lower, &upper);
	EXTEND (SP, 2);
	PUSHs (sv_2mortal (newSViv (lower)));
	PUSHs (sv_2mortal (newSViv (upper)));
#line 602 "xs/GdkKeys.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__Gdk_keyval_to_upper); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_keyval_to_upper)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, keyval");
    {
	guint	keyval = (guint)SvUV(ST(1))
;
	guint	RETVAL;
	dXSTARG;

	RETVAL = gdk_keyval_to_upper(keyval);
	XSprePUSH; PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk_keyval_to_lower); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_keyval_to_lower)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, keyval");
    {
	guint	keyval = (guint)SvUV(ST(1))
;
	guint	RETVAL;
	dXSTARG;

	RETVAL = gdk_keyval_to_lower(keyval);
	XSprePUSH; PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk_keyval_is_upper); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_keyval_is_upper)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, keyval");
    {
	guint	keyval = (guint)SvUV(ST(1))
;
	gboolean	RETVAL;

	RETVAL = gdk_keyval_is_upper(keyval);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk_keyval_is_lower); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_keyval_is_lower)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, keyval");
    {
	guint	keyval = (guint)SvUV(ST(1))
;
	gboolean	RETVAL;

	RETVAL = gdk_keyval_is_lower(keyval);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk_keyval_to_unicode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_keyval_to_unicode)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, keyval");
    {
	guint	keyval = (guint)SvUV(ST(1))
;
	guint32	RETVAL;
	dXSTARG;

	RETVAL = gdk_keyval_to_unicode(keyval);
	XSprePUSH; PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk_unicode_to_keyval); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_unicode_to_keyval)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, wc");
    {
	guint32	wc = (guint32)SvUV(ST(1))
;
	guint	RETVAL;
	dXSTARG;

	RETVAL = gdk_unicode_to_keyval(wc);
	XSprePUSH; PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Gtk2__Gdk__Keys); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Gtk2__Gdk__Keys)
{
#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::Gdk::Keymap::get_default", XS_Gtk2__Gdk__Keymap_get_default);
#if XSubPPtmpAAAA
        newXS_deffile("Gtk2::Gdk::Keymap::get_for_display", XS_Gtk2__Gdk__Keymap_get_for_display);
#endif
        newXS_deffile("Gtk2::Gdk::Keymap::lookup_key", XS_Gtk2__Gdk__Keymap_lookup_key);
        newXS_deffile("Gtk2::Gdk::Keymap::translate_keyboard_state", XS_Gtk2__Gdk__Keymap_translate_keyboard_state);
        newXS_deffile("Gtk2::Gdk::Keymap::get_entries_for_keyval", XS_Gtk2__Gdk__Keymap_get_entries_for_keyval);
        newXS_deffile("Gtk2::Gdk::Keymap::get_entries_for_keycode", XS_Gtk2__Gdk__Keymap_get_entries_for_keycode);
        newXS_deffile("Gtk2::Gdk::Keymap::get_direction", XS_Gtk2__Gdk__Keymap_get_direction);
#if XSubPPtmpAAAB
        newXS_deffile("Gtk2::Gdk::Keymap::have_bidi_layouts", XS_Gtk2__Gdk__Keymap_have_bidi_layouts);
#endif
#if XSubPPtmpAAAC
        newXS_deffile("Gtk2::Gdk::Keymap::get_caps_lock_state", XS_Gtk2__Gdk__Keymap_get_caps_lock_state);
#endif
#if XSubPPtmpAAAD
        newXS_deffile("Gtk2::Gdk::Keymap::add_virtual_modifiers", XS_Gtk2__Gdk__Keymap_add_virtual_modifiers);
        newXS_deffile("Gtk2::Gdk::Keymap::map_virtual_modifiers", XS_Gtk2__Gdk__Keymap_map_virtual_modifiers);
#endif
        newXS_deffile("Gtk2::Gdk::keyval_name", XS_Gtk2__Gdk_keyval_name);
        newXS_deffile("Gtk2::Gdk::keyval_from_name", XS_Gtk2__Gdk_keyval_from_name);
        newXS_deffile("Gtk2::Gdk::keyval_convert_case", XS_Gtk2__Gdk_keyval_convert_case);
        newXS_deffile("Gtk2::Gdk::keyval_to_upper", XS_Gtk2__Gdk_keyval_to_upper);
        newXS_deffile("Gtk2::Gdk::keyval_to_lower", XS_Gtk2__Gdk_keyval_to_lower);
        newXS_deffile("Gtk2::Gdk::keyval_is_upper", XS_Gtk2__Gdk_keyval_is_upper);
        newXS_deffile("Gtk2::Gdk::keyval_is_lower", XS_Gtk2__Gdk_keyval_is_lower);
        newXS_deffile("Gtk2::Gdk::keyval_to_unicode", XS_Gtk2__Gdk_keyval_to_unicode);
        newXS_deffile("Gtk2::Gdk::unicode_to_keyval", XS_Gtk2__Gdk_unicode_to_keyval);

    /* Initialisation Section */

#line 70 "xs/GdkKeys.xs"
	gperl_object_set_no_warn_unreg_subclass (GDK_TYPE_KEYMAP, TRUE);

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

