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

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

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

#define GDK2PERL_TEXT_LIST_DECLARE	\
	guchar *real_text = NULL;	\
	STRLEN length;			\
	gchar **list = NULL;		\
	int i, elements = 0;

#define GDK2PERL_TEXT_LIST_FETCH	\
	real_text = (guchar *) SvPV (text, length);

#define GDK2PERL_TEXT_LIST_STORE	\
	if (elements == 0)		\
		XSRETURN_EMPTY;		\
					\
	EXTEND (sp, elements);		\
					\
	for (i = 0; i < elements; i++)	\
		PUSHs (sv_2mortal (newSVpv (list[i], 0)));

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

#define GDK2PERL_TEXT_CONVERSION_DECALRE	\
	GdkAtom encoding;			\
	gint format;				\
	guchar *ctext = NULL;			\
	gint length;

#define GDK2PERL_TEXT_CONVERSION_STORE			\
	EXTEND (sp, 3);					\
	PUSHs (sv_2mortal (newSVGdkAtom (encoding)));	\
	PUSHs (sv_2mortal (newSViv (format)));		\
	PUSHs (sv_2mortal (newSVpv ((gchar *) ctext, length)));

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

#line 69 "xs/GdkProperty.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 211 "xs/GdkProperty.c"

XS_EUPXS(XS_Gtk2__Gdk__Atom_eq); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Atom_eq)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "left, right, swap=FALSE");
    {
	GdkAtom	left = SvGdkAtom (ST(0))
;
	GdkAtom	right = SvGdkAtom (ST(1))
;
	gboolean	RETVAL;
#line 74 "xs/GdkProperty.xs"
	switch (ix) {
	    case 0: RETVAL = left == right; break;
	    case 1: RETVAL = left != right; break;
	    default: croak ("incorrect alias value encountered"); RETVAL = FALSE;
	}
#line 232 "xs/GdkProperty.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk__Atom_intern); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Atom_intern)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "class, atom_name, only_if_exists=FALSE");
    {
	const gchar *	atom_name;
	gboolean	only_if_exists;
	GdkAtom	RETVAL;

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

	if (items < 3)
	    only_if_exists = FALSE;
	else {
	    only_if_exists = (bool)SvTRUE(ST(2))
;
	}

	RETVAL = gdk_atom_intern(atom_name, only_if_exists);
	ST(0) = newSVGdkAtom (RETVAL);
	sv_2mortal(ST(0));
#line 92 "xs/GdkProperty.xs"
	PERL_UNUSED_VAR (ix);
#line 268 "xs/GdkProperty.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk__Atom_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Atom_name)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "atom");
    {
	GdkAtom	atom = SvGdkAtom (ST(0))
;
	gchar_own *	RETVAL;

	RETVAL = gdk_atom_name(atom);
	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__Gdk__Window_property_get); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Window_property_get)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "window, property, type, offset, length, pdelete");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GdkWindow *	window = SvGdkWindow (ST(0))
;
	GdkAtom	property = SvGdkAtom (ST(1))
;
	GdkAtom	type = SvGdkAtom (ST(2))
;
	gulong	offset = (gulong)SvUV(ST(3))
;
	gulong	length = (gulong)SvUV(ST(4))
;
	gint	pdelete = (gint)SvIV(ST(5))
;
#line 123 "xs/GdkProperty.xs"
	GdkAtom actual_property_type;
	gint actual_format;
	gint actual_length;
	guchar *data;
	guint i;
#line 325 "xs/GdkProperty.c"
#line 129 "xs/GdkProperty.xs"
	if (! gdk_property_get (window, property, type, offset, length, pdelete,
	                        &actual_property_type, &actual_format,
	                        &actual_length, &data))
		XSRETURN_EMPTY;

	EXTEND (SP, 2);
	PUSHs (sv_2mortal (newSVGdkAtom (actual_property_type)));
	PUSHs (sv_2mortal (newSViv (actual_format)));

	if (data) {
		switch (actual_format) {
			case 8: {
				gchar *char_data = (gchar *) data;
				XPUSHs (sv_2mortal (newSVpv (char_data, actual_length)));
				break;
			}
			case 16: {
				gushort *short_data = (gushort *) data;
				for (i = 0; i < (actual_length / sizeof (gushort)); i++)
					XPUSHs (sv_2mortal (newSVuv (short_data[i])));
				break;
			}
			case 32: {
				gulong *long_data = (gulong *) data;
				for (i = 0; i < (actual_length / sizeof (gulong)); i++)
					XPUSHs (sv_2mortal (newSVuv (long_data[i])));
				break;
			}
			default:
				warn ("Unhandled format value %d in gdk_property_get, should not happen",
				      actual_format);
		}

		g_free (data);
	}
#line 362 "xs/GdkProperty.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__Gdk__Window_property_change); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Window_property_change)
{
    dVAR; dXSARGS;
    if (items < 5)
       croak_xs_usage(cv,  "window, property, type, format, mode, ...");
    {
	GdkWindow *	window = SvGdkWindow (ST(0))
;
	GdkAtom	property = SvGdkAtom (ST(1))
;
	GdkAtom	type = SvGdkAtom (ST(2))
;
	gint	format = (gint)SvIV(ST(3))
;
	GdkPropMode	mode = SvGdkPropMode (ST(4))
;
#line 190 "xs/GdkProperty.xs"
	guchar *data = NULL;
	int i;
	int first_index = 5;
	STRLEN nelements;
#line 391 "xs/GdkProperty.c"
#line 195 "xs/GdkProperty.xs"
	switch (format) {
		case 8: {
			SV *sv = ST (first_index);

			/* need to use sv_len here because \0's are allowed. */
			data = (guchar *) SvPV (sv, nelements);
			break;
		}
		case 16: {
			gushort *short_data = gperl_alloc_temp (sizeof (gushort) * (items - first_index));

			for (i = first_index; i < items; i++)
				short_data[i - first_index] = (gushort) SvUV (ST (i));

			data = (guchar *) short_data;
			nelements = items - first_index;
			break;
		}
		case 32: {
			gulong *long_data = gperl_alloc_temp (sizeof (gulong) * (items - first_index));

			for (i = first_index; i < items; i++)
				long_data[i - first_index] = (gulong) SvUV (ST (i));

			data = (guchar *) long_data;
			nelements = items - first_index;
			break;
		}
		default:
			croak ("Illegal format value %d used; should be either 8, 16 or 32", 
			       format);
	}

	gdk_property_change (window, property, type, format, mode, data, nelements);
#line 427 "xs/GdkProperty.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Window_property_delete); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Window_property_delete)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "window, property");
    {
	GdkWindow *	window = SvGdkWindow (ST(0))
;
	GdkAtom	property = SvGdkAtom (ST(1))
;

	gdk_property_delete(window, property);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk_text_property_to_text_list); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_text_property_to_text_list)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "class, encoding, format, text");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GdkAtom	encoding = SvGdkAtom (ST(1))
;
	gint	format = (gint)SvIV(ST(2))
;
	SV *	text = ST(3)
;
#line 250 "xs/GdkProperty.xs"
	GDK2PERL_TEXT_LIST_DECLARE;
#line 468 "xs/GdkProperty.c"
#line 252 "xs/GdkProperty.xs"
	GDK2PERL_TEXT_LIST_FETCH;
	elements = gdk_text_property_to_text_list (encoding, format, real_text, length, &list);
	GDK2PERL_TEXT_LIST_STORE;
	gdk_free_text_list (list);
#line 474 "xs/GdkProperty.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__Gdk_text_property_to_utf8_list); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_text_property_to_utf8_list)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "class, encoding, format, text");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GdkAtom	encoding = SvGdkAtom (ST(1))
;
	gint	format = (gint)SvIV(ST(2))
;
	SV *	text = ST(3)
;
#line 267 "xs/GdkProperty.xs"
	GDK2PERL_TEXT_LIST_DECLARE;
#line 498 "xs/GdkProperty.c"
#line 269 "xs/GdkProperty.xs"
	GDK2PERL_TEXT_LIST_FETCH;
	elements = gdk_text_property_to_utf8_list (encoding, format, real_text, length, &list);
	GDK2PERL_TEXT_LIST_STORE;
	g_strfreev (list);
#line 504 "xs/GdkProperty.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__Gdk_string_to_compound_text); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_string_to_compound_text)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, str");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	const gchar *	str;
#line 282 "xs/GdkProperty.xs"
	GDK2PERL_TEXT_CONVERSION_DECALRE;
#line 523 "xs/GdkProperty.c"

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	str = (const gchar *)SvPV_nolen (ST(1))
;
#line 284 "xs/GdkProperty.xs"
	if (0 != gdk_string_to_compound_text (str, &encoding, &format, &ctext, &length))
		XSRETURN_EMPTY;

	GDK2PERL_TEXT_CONVERSION_STORE;

	gdk_free_compound_text (ctext);
#line 536 "xs/GdkProperty.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__Gdk_utf8_to_compound_text); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_utf8_to_compound_text)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, str");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	const gchar *	str;
#line 299 "xs/GdkProperty.xs"
	GDK2PERL_TEXT_CONVERSION_DECALRE;
#line 555 "xs/GdkProperty.c"

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	str = (const gchar *)SvPV_nolen (ST(1))
;
#line 301 "xs/GdkProperty.xs"
	if (! gdk_utf8_to_compound_text (str, &encoding, &format, &ctext, &length))
		XSRETURN_EMPTY;

	GDK2PERL_TEXT_CONVERSION_STORE;

	gdk_free_compound_text (ctext);
#line 568 "xs/GdkProperty.c"
	PUTBACK;
	return;
    }
}

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


XS_EUPXS(XS_Gtk2__Gdk_text_property_to_text_list_for_display); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_text_property_to_text_list_for_display)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "class, display, encoding, format, text");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GdkDisplay *	display = SvGdkDisplay (ST(1))
;
	GdkAtom	encoding = SvGdkAtom (ST(2))
;
	gint	format = (gint)SvIV(ST(3))
;
	SV *	text = ST(4)
;
#line 321 "xs/GdkProperty.xs"
	GDK2PERL_TEXT_LIST_DECLARE;
#line 597 "xs/GdkProperty.c"
#line 323 "xs/GdkProperty.xs"
	GDK2PERL_TEXT_LIST_FETCH;
	elements = gdk_text_property_to_text_list_for_display (display, encoding, format, real_text, length, &list);
	GDK2PERL_TEXT_LIST_STORE;
	gdk_free_text_list (list);
#line 603 "xs/GdkProperty.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__Gdk_text_property_to_utf8_list_for_display); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_text_property_to_utf8_list_for_display)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "class, display, encoding, format, text");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GdkDisplay *	display = SvGdkDisplay (ST(1))
;
	GdkAtom	encoding = SvGdkAtom (ST(2))
;
	gint	format = (gint)SvIV(ST(3))
;
	SV *	text = ST(4)
;
#line 339 "xs/GdkProperty.xs"
	GDK2PERL_TEXT_LIST_DECLARE;
#line 629 "xs/GdkProperty.c"
#line 341 "xs/GdkProperty.xs"
	GDK2PERL_TEXT_LIST_FETCH;
	elements = gdk_text_property_to_utf8_list_for_display (display, encoding, format, real_text, length, &list);
	GDK2PERL_TEXT_LIST_STORE;
	g_strfreev (list);
#line 635 "xs/GdkProperty.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__Gdk_string_to_compound_text_for_display); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_string_to_compound_text_for_display)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "class, display, str");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GdkDisplay *	display = SvGdkDisplay (ST(1))
;
	const gchar *	str;
#line 355 "xs/GdkProperty.xs"
	GDK2PERL_TEXT_CONVERSION_DECALRE;
#line 656 "xs/GdkProperty.c"

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(2));
	str = (const gchar *)SvPV_nolen (ST(2))
;
#line 357 "xs/GdkProperty.xs"
	if (0 != gdk_string_to_compound_text_for_display (display, str, &encoding, &format, &ctext, &length))
		XSRETURN_EMPTY;

	GDK2PERL_TEXT_CONVERSION_STORE;

	gdk_free_compound_text (ctext);
#line 669 "xs/GdkProperty.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gtk2__Gdk_utf8_to_compound_text_for_display); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk_utf8_to_compound_text_for_display)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "class, display, str");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GdkDisplay *	display = SvGdkDisplay (ST(1))
;
	const gchar *	str;
#line 373 "xs/GdkProperty.xs"
	GDK2PERL_TEXT_CONVERSION_DECALRE;
#line 690 "xs/GdkProperty.c"

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(2));
	str = (const gchar *)SvPV_nolen (ST(2))
;
#line 375 "xs/GdkProperty.xs"
	if (! gdk_utf8_to_compound_text_for_display (display, str, &encoding, &format, &ctext, &length))
		XSRETURN_EMPTY;

	GDK2PERL_TEXT_CONVERSION_STORE;

	gdk_free_compound_text (ctext);
#line 703 "xs/GdkProperty.c"
	PUTBACK;
	return;
    }
}

#endif /* 2.2.0 */

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

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

	RETVAL = gdk_utf8_to_string_target(str);
	ST(0) = sv_newmortal();
	/* newSVGChar() allows NULL, but T_GCHAR does not. allow NULL. */
	if (RETVAL) {
		sv_setpv ((SV*)ST(0), RETVAL);
		SvUTF8_on (ST(0));
	} else {
		SvSetSV (ST(0), &PL_sv_undef);
	}
    }
    XSRETURN(1);
}

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

        cv = newXS("Gtk2::Gdk::Atom::eq", XS_Gtk2__Gdk__Atom_eq, file);
        XSANY.any_i32 = 0;
        cv = newXS("Gtk2::Gdk::Atom::ne", XS_Gtk2__Gdk__Atom_eq, file);
        XSANY.any_i32 = 1;
        cv = newXS("Gtk2::Gdk::Atom::intern", XS_Gtk2__Gdk__Atom_intern, file);
        XSANY.any_i32 = 0;
        cv = newXS("Gtk2::Gdk::Atom::new", XS_Gtk2__Gdk__Atom_intern, file);
        XSANY.any_i32 = 1;
        newXS("Gtk2::Gdk::Atom::name", XS_Gtk2__Gdk__Atom_name, file);
        newXS("Gtk2::Gdk::Window::property_get", XS_Gtk2__Gdk__Window_property_get, file);
        newXS("Gtk2::Gdk::Window::property_change", XS_Gtk2__Gdk__Window_property_change, file);
        newXS("Gtk2::Gdk::Window::property_delete", XS_Gtk2__Gdk__Window_property_delete, file);
        newXS("Gtk2::Gdk::text_property_to_text_list", XS_Gtk2__Gdk_text_property_to_text_list, file);
        newXS("Gtk2::Gdk::text_property_to_utf8_list", XS_Gtk2__Gdk_text_property_to_utf8_list, file);
        newXS("Gtk2::Gdk::string_to_compound_text", XS_Gtk2__Gdk_string_to_compound_text, file);
        newXS("Gtk2::Gdk::utf8_to_compound_text", XS_Gtk2__Gdk_utf8_to_compound_text, file);
#if XSubPPtmpAAAA
        newXS("Gtk2::Gdk::text_property_to_text_list_for_display", XS_Gtk2__Gdk_text_property_to_text_list_for_display, file);
        newXS("Gtk2::Gdk::text_property_to_utf8_list_for_display", XS_Gtk2__Gdk_text_property_to_utf8_list_for_display, file);
        newXS("Gtk2::Gdk::string_to_compound_text_for_display", XS_Gtk2__Gdk_string_to_compound_text_for_display, file);
        newXS("Gtk2::Gdk::utf8_to_compound_text_for_display", XS_Gtk2__Gdk_utf8_to_compound_text_for_display, file);
#endif
        newXS("Gtk2::Gdk::utf8_to_string_target", XS_Gtk2__Gdk_utf8_to_string_target, file);
    }

    /* Initialisation Section */

#if XSubPPtmpAAAA
#endif
#line 791 "xs/GdkProperty.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;
}

