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

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

#ifndef G_LIKELY  /* new in glib 2.2 */
#define G_LIKELY(cond)  (cond)  /* fallback */
#endif

/*
NOTE:
GdkDrawable descends directly from GObject, so be sure to use GdkDrawable_noinc
for functions that return brand-new objects!  (i don't think there are any,
but there are several functions in other modules returning GdkDrawable
subclasses)
*/

#line 46 "xs/GdkDrawable.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 188 "xs/GdkDrawable.c"

XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_size); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_size)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "drawable");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	gint	width;
	gint	height;

	gdk_drawable_get_size(drawable, &width, &height);
	XSprePUSH;	EXTEND(SP,2);
	PUSHs(sv_newmortal());
	sv_setiv(ST(0), (IV)width);
	PUSHs(sv_newmortal());
	sv_setiv(ST(1), (IV)height);
    }
    XSRETURN(2);
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_set_colormap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_set_colormap)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "drawable, colormap");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkColormap *	colormap = SvGdkColormap (ST(1))
;

	gdk_drawable_set_colormap(drawable, colormap);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_colormap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_colormap)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "drawable");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkColormap_ornull *	RETVAL;

	RETVAL = gdk_drawable_get_colormap(drawable);
	ST(0) = newSVGdkColormap_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_visual); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_visual)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "drawable");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkVisual *	RETVAL;

	RETVAL = gdk_drawable_get_visual(drawable);
	ST(0) = newSVGdkVisual (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_depth); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_depth)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "drawable");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	gint	RETVAL;
	dXSTARG;

	RETVAL = gdk_drawable_get_depth(drawable);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

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


XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_screen); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_screen)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "drawable");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkScreen *	RETVAL;

	RETVAL = gdk_drawable_get_screen(drawable);
	ST(0) = newSVGdkScreen (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_display); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_display)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "drawable");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkDisplay *	RETVAL;

	RETVAL = gdk_drawable_get_display(drawable);
	ST(0) = newSVGdkDisplay (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}

#endif

XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_clip_region); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_clip_region)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "drawable");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkRegion_own *	RETVAL;

	RETVAL = gdk_drawable_get_clip_region(drawable);
	ST(0) = newSVGdkRegion_own (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_visible_region); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_visible_region)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "drawable");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkRegion_own *	RETVAL;

	RETVAL = gdk_drawable_get_visible_region(drawable);
	ST(0) = newSVGdkRegion_own (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_line); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_line)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "drawable, gc, x1_, y1_, x2_, y2_");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
	gint	x1_ = (gint)SvIV(ST(2))
;
	gint	y1_ = (gint)SvIV(ST(3))
;
	gint	x2_ = (gint)SvIV(ST(4))
;
	gint	y2_ = (gint)SvIV(ST(5))
;

	gdk_draw_line(drawable, gc, x1_, y1_, x2_, y2_);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_rectangle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_rectangle)
{
    dVAR; dXSARGS;
    if (items != 7)
       croak_xs_usage(cv,  "drawable, gc, filled, x, y, width, height");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
	gboolean	filled = (bool)SvTRUE(ST(2))
;
	gint	x = (gint)SvIV(ST(3))
;
	gint	y = (gint)SvIV(ST(4))
;
	gint	width = (gint)SvIV(ST(5))
;
	gint	height = (gint)SvIV(ST(6))
;

	gdk_draw_rectangle(drawable, gc, filled, x, y, width, height);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_arc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_arc)
{
    dVAR; dXSARGS;
    if (items != 9)
       croak_xs_usage(cv,  "drawable, gc, filled, x, y, width, height, angle1, angle2");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
	gboolean	filled = (bool)SvTRUE(ST(2))
;
	gint	x = (gint)SvIV(ST(3))
;
	gint	y = (gint)SvIV(ST(4))
;
	gint	width = (gint)SvIV(ST(5))
;
	gint	height = (gint)SvIV(ST(6))
;
	gint	angle1 = (gint)SvIV(ST(7))
;
	gint	angle2 = (gint)SvIV(ST(8))
;

	gdk_draw_arc(drawable, gc, filled, x, y, width, height, angle1, angle2);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_polygon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_polygon)
{
    dVAR; dXSARGS;
    if (items < 5)
       croak_xs_usage(cv,  "drawable, gc, filled, x1, y1, ...");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
	gboolean	filled = (bool)SvTRUE(ST(2))
;
#line 141 "xs/GdkDrawable.xs"
	GdkPoint * points;
	gint npoints;
	gint i, j;
#line 471 "xs/GdkDrawable.c"
#line 145 "xs/GdkDrawable.xs"
	npoints = (items-3)/2;
	points = g_new (GdkPoint, npoints);
	for (i = 0, j = 3; i < npoints ; i++, j+=2) {
		points[i].x = SvIV (ST (j));
		points[i].y = SvIV (ST (j+1));
	}
	gdk_draw_polygon (drawable, gc, filled, points, npoints);
	g_free (points);
#line 481 "xs/GdkDrawable.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_drawable); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_drawable)
{
    dVAR; dXSARGS;
    if (items != 9)
       croak_xs_usage(cv,  "drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
	GdkDrawable *	src = SvGdkDrawable (ST(2))
;
	gint	xsrc = (gint)SvIV(ST(3))
;
	gint	ysrc = (gint)SvIV(ST(4))
;
	gint	xdest = (gint)SvIV(ST(5))
;
	gint	ydest = (gint)SvIV(ST(6))
;
	gint	width = (gint)SvIV(ST(7))
;
	gint	height = (gint)SvIV(ST(8))
;

	gdk_draw_drawable(drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_image); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_image)
{
    dVAR; dXSARGS;
    if (items != 9)
       croak_xs_usage(cv,  "drawable, gc, image, xsrc, ysrc, xdest, ydest, width, height");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
	GdkImage *	image = SvGdkImage (ST(2))
;
	gint	xsrc = (gint)SvIV(ST(3))
;
	gint	ysrc = (gint)SvIV(ST(4))
;
	gint	xdest = (gint)SvIV(ST(5))
;
	gint	ydest = (gint)SvIV(ST(6))
;
	gint	width = (gint)SvIV(ST(7))
;
	gint	height = (gint)SvIV(ST(8))
;

	gdk_draw_image(drawable, gc, image, xsrc, ysrc, xdest, ydest, width, height);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_point); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_point)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "drawable, gc, x, y");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
	gint	x = (gint)SvIV(ST(2))
;
	gint	y = (gint)SvIV(ST(3))
;

	gdk_draw_point(drawable, gc, x, y);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_points); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_points)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2)
       croak_xs_usage(cv,  "drawable, gc, ...");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
#line 211 "xs/GdkDrawable.xs"
	GdkPoint * points;
	gint npoints;
	gint i, j;
#line 589 "xs/GdkDrawable.c"
#line 215 "xs/GdkDrawable.xs"
	npoints = (items-2)/2;
	/* gdk_draw_points() and gdk_draw_lines() both accept npoints==0 but
	   can skip entirely with a couple of bytes of code. */
	if (G_LIKELY (npoints != 0)) {
		points = g_new (GdkPoint, npoints);
		for (i = 0, j = 2; i < npoints ; i++, j+=2) {
			points[i].x = SvIV (ST (j));
			points[i].y = SvIV (ST (j+1));
		}
		if (ix == 1)
			gdk_draw_lines (drawable, gc, points, npoints);
		else
			gdk_draw_points (drawable, gc, points, npoints);
		g_free (points);
	}
#line 606 "xs/GdkDrawable.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_segments); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_segments)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "drawable, gc, ...");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
#line 243 "xs/GdkDrawable.xs"
	GdkSegment * segs;
	gint nsegs;
	gint i, j;
#line 627 "xs/GdkDrawable.c"
#line 247 "xs/GdkDrawable.xs"
	nsegs = (items-2)/4;
	segs = g_new (GdkSegment, nsegs);
	for (i = 0, j = 2; i < nsegs ; i++, j+=4) {
		segs[i].x1 = SvIV (ST (j+0));
		segs[i].y1 = SvIV (ST (j+1));
		segs[i].x2 = SvIV (ST (j+2));
		segs[i].y2 = SvIV (ST (j+3));
	}
	gdk_draw_segments (drawable, gc, segs, nsegs);
	g_free (segs);
#line 639 "xs/GdkDrawable.c"
    }
    XSRETURN_EMPTY;
}

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


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_pixbuf); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_pixbuf)
{
    dVAR; dXSARGS;
    if (items != 12)
       croak_xs_usage(cv,  "drawable, gc, pixbuf, src_x, src_y, dest_x, dest_y, width, height, dither, x_dither, y_dither");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC_ornull *	gc = SvGdkGC_ornull (ST(1))
;
	GdkPixbuf *	pixbuf = SvGdkPixbuf (ST(2))
;
	gint	src_x = (gint)SvIV(ST(3))
;
	gint	src_y = (gint)SvIV(ST(4))
;
	gint	dest_x = (gint)SvIV(ST(5))
;
	gint	dest_y = (gint)SvIV(ST(6))
;
	gint	width = (gint)SvIV(ST(7))
;
	gint	height = (gint)SvIV(ST(8))
;
	GdkRgbDither	dither = SvGdkRgbDither (ST(9))
;
	gint	x_dither = (gint)SvIV(ST(10))
;
	gint	y_dither = (gint)SvIV(ST(11))
;

	gdk_draw_pixbuf(drawable, gc, pixbuf, src_x, src_y, dest_x, dest_y, width, height, dither, x_dither, y_dither);
    }
    XSRETURN_EMPTY;
}

#endif

XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_layout_line); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_layout_line)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "drawable, gc, x, y, line");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
	gint	x = (gint)SvIV(ST(2))
;
	gint	y = (gint)SvIV(ST(3))
;
	PangoLayoutLine *	line = SvPangoLayoutLine (ST(4))
;

	gdk_draw_layout_line(drawable, gc, x, y, line);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_layout); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_layout)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "drawable, gc, x, y, layout");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
	gint	x = (gint)SvIV(ST(2))
;
	gint	y = (gint)SvIV(ST(3))
;
	PangoLayout *	layout = SvPangoLayout (ST(4))
;

	gdk_draw_layout(drawable, gc, x, y, layout);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_layout_line_with_colors); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_layout_line_with_colors)
{
    dVAR; dXSARGS;
    if (items != 7)
       croak_xs_usage(cv,  "drawable, gc, x, y, line, foreground, background");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
	gint	x = (gint)SvIV(ST(2))
;
	gint	y = (gint)SvIV(ST(3))
;
	PangoLayoutLine *	line = SvPangoLayoutLine (ST(4))
;
	GdkColor_ornull *	foreground = SvGdkColor_ornull (ST(5))
;
	GdkColor_ornull *	background = SvGdkColor_ornull (ST(6))
;

	gdk_draw_layout_line_with_colors(drawable, gc, x, y, line, foreground, background);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_layout_with_colors); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_draw_layout_with_colors)
{
    dVAR; dXSARGS;
    if (items != 7)
       croak_xs_usage(cv,  "drawable, gc, x, y, layout, foreground, background");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkGC *	gc = SvGdkGC (ST(1))
;
	gint	x = (gint)SvIV(ST(2))
;
	gint	y = (gint)SvIV(ST(3))
;
	PangoLayout *	layout = SvPangoLayout (ST(4))
;
	GdkColor_ornull *	foreground = SvGdkColor_ornull (ST(5))
;
	GdkColor_ornull *	background = SvGdkColor_ornull (ST(6))
;

	gdk_draw_layout_with_colors(drawable, gc, x, y, layout, foreground, background);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_image); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_get_image)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "drawable, x, y, width, height");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	gint	x = (gint)SvIV(ST(1))
;
	gint	y = (gint)SvIV(ST(2))
;
	gint	width = (gint)SvIV(ST(3))
;
	gint	height = (gint)SvIV(ST(4))
;
	GdkImage_noinc *	RETVAL;

	RETVAL = gdk_drawable_get_image(drawable, x, y, width, height);
	ST(0) = newSVGdkImage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}

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


XS_EUPXS(XS_Gtk2__Gdk__Drawable_copy_to_image); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__Drawable_copy_to_image)
{
    dVAR; dXSARGS;
    if (items != 8)
       croak_xs_usage(cv,  "drawable, image, src_x, src_y, dest_x, dest_y, width, height");
    {
	GdkDrawable *	drawable = SvGdkDrawable (ST(0))
;
	GdkImage_ornull *	image = SvGdkImage_ornull (ST(1))
;
	gint	src_x = (gint)SvIV(ST(2))
;
	gint	src_y = (gint)SvIV(ST(3))
;
	gint	dest_x = (gint)SvIV(ST(4))
;
	gint	dest_y = (gint)SvIV(ST(5))
;
	gint	width = (gint)SvIV(ST(6))
;
	gint	height = (gint)SvIV(ST(7))
;
	GdkImage *	RETVAL;

	RETVAL = gdk_drawable_copy_to_image(drawable, image, src_x, src_y, dest_x, dest_y, width, height);
	ST(0) = newSVGdkImage (RETVAL);
	sv_2mortal(ST(0));
#line 362 "xs/GdkDrawable.xs"
	/* if the return value has been allocated anew,
	 * the caller will own it. */
	if (!image)
		g_object_unref (RETVAL);
#line 854 "xs/GdkDrawable.c"
    }
    XSRETURN(1);
}

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

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

    {
        CV * cv;

        newXS("Gtk2::Gdk::Drawable::get_size", XS_Gtk2__Gdk__Drawable_get_size, file);
        newXS("Gtk2::Gdk::Drawable::set_colormap", XS_Gtk2__Gdk__Drawable_set_colormap, file);
        newXS("Gtk2::Gdk::Drawable::get_colormap", XS_Gtk2__Gdk__Drawable_get_colormap, file);
        newXS("Gtk2::Gdk::Drawable::get_visual", XS_Gtk2__Gdk__Drawable_get_visual, file);
        newXS("Gtk2::Gdk::Drawable::get_depth", XS_Gtk2__Gdk__Drawable_get_depth, file);
#if XSubPPtmpAAAA
        newXS("Gtk2::Gdk::Drawable::get_screen", XS_Gtk2__Gdk__Drawable_get_screen, file);
        newXS("Gtk2::Gdk::Drawable::get_display", XS_Gtk2__Gdk__Drawable_get_display, file);
#endif
        newXS("Gtk2::Gdk::Drawable::get_clip_region", XS_Gtk2__Gdk__Drawable_get_clip_region, file);
        newXS("Gtk2::Gdk::Drawable::get_visible_region", XS_Gtk2__Gdk__Drawable_get_visible_region, file);
        newXS("Gtk2::Gdk::Drawable::draw_line", XS_Gtk2__Gdk__Drawable_draw_line, file);
        newXS("Gtk2::Gdk::Drawable::draw_rectangle", XS_Gtk2__Gdk__Drawable_draw_rectangle, file);
        newXS("Gtk2::Gdk::Drawable::draw_arc", XS_Gtk2__Gdk__Drawable_draw_arc, file);
        newXS("Gtk2::Gdk::Drawable::draw_polygon", XS_Gtk2__Gdk__Drawable_draw_polygon, file);
        newXS("Gtk2::Gdk::Drawable::draw_drawable", XS_Gtk2__Gdk__Drawable_draw_drawable, file);
        newXS("Gtk2::Gdk::Drawable::draw_image", XS_Gtk2__Gdk__Drawable_draw_image, file);
        newXS("Gtk2::Gdk::Drawable::draw_point", XS_Gtk2__Gdk__Drawable_draw_point, file);
        cv = newXS("Gtk2::Gdk::Drawable::draw_lines", XS_Gtk2__Gdk__Drawable_draw_points, file);
        XSANY.any_i32 = 1;
        cv = newXS("Gtk2::Gdk::Drawable::draw_points", XS_Gtk2__Gdk__Drawable_draw_points, file);
        XSANY.any_i32 = 0;
        newXS("Gtk2::Gdk::Drawable::draw_segments", XS_Gtk2__Gdk__Drawable_draw_segments, file);
#if XSubPPtmpAAAB
        newXS("Gtk2::Gdk::Drawable::draw_pixbuf", XS_Gtk2__Gdk__Drawable_draw_pixbuf, file);
#endif
        newXS("Gtk2::Gdk::Drawable::draw_layout_line", XS_Gtk2__Gdk__Drawable_draw_layout_line, file);
        newXS("Gtk2::Gdk::Drawable::draw_layout", XS_Gtk2__Gdk__Drawable_draw_layout, file);
        newXS("Gtk2::Gdk::Drawable::draw_layout_line_with_colors", XS_Gtk2__Gdk__Drawable_draw_layout_line_with_colors, file);
        newXS("Gtk2::Gdk::Drawable::draw_layout_with_colors", XS_Gtk2__Gdk__Drawable_draw_layout_with_colors, file);
        newXS("Gtk2::Gdk::Drawable::get_image", XS_Gtk2__Gdk__Drawable_get_image, file);
#if XSubPPtmpAAAC
        newXS("Gtk2::Gdk::Drawable::copy_to_image", XS_Gtk2__Gdk__Drawable_copy_to_image, file);
#endif
    }

    /* Initialisation Section */

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

