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

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

/*
 * GdkGCValues code ported from Gtk-Perl 0.7009.  There's no boxed type
 * support for this structure, but since it's only used in a couple of
 * functions in this file, we can scrape by without typemaps.
 */
SV *
newSVGdkGCValues (GdkGCValues * v)
{
	HV * h;
	SV * r;

	if (!v)
		return newSVsv (&PL_sv_undef);

	h = newHV ();
	r = newRV_noinc ((SV*)h);

	gperl_hv_take_sv_s (h, "foreground", newSVGdkColor_copy (&v->foreground));
	gperl_hv_take_sv_s (h, "background", newSVGdkColor_copy (&v->background));
	if (v->font) gperl_hv_take_sv_s (h, "font", newSVGdkFont (v->font));
	gperl_hv_take_sv_s (h, "function", newSVGdkFunction (v->function));
	gperl_hv_take_sv_s (h, "fill", newSVGdkFill (v->fill));
	if (v->tile) gperl_hv_take_sv_s (h, "tile", newSVGdkPixmap (v->tile));
	if (v->stipple) gperl_hv_take_sv_s (h, "stipple", newSVGdkPixmap (v->stipple));
	if (v->clip_mask) gperl_hv_take_sv_s (h, "clip_mask", newSVGdkPixmap (v->clip_mask));
	gperl_hv_take_sv_s (h, "subwindow_mode", newSVGdkSubwindowMode (v->subwindow_mode));
	gperl_hv_take_sv_s (h, "ts_x_origin", newSViv (v->ts_x_origin));
	gperl_hv_take_sv_s (h, "ts_y_origin", newSViv (v->ts_y_origin));
	gperl_hv_take_sv_s (h, "clip_x_origin", newSViv (v->clip_x_origin));
	gperl_hv_take_sv_s (h, "clip_y_origin", newSViv (v->clip_y_origin));
	gperl_hv_take_sv_s (h, "graphics_exposures", newSViv (v->graphics_exposures));
	gperl_hv_take_sv_s (h, "line_width", newSViv (v->line_width));
	gperl_hv_take_sv_s (h, "line_style", newSVGdkLineStyle (v->line_style));
	gperl_hv_take_sv_s (h, "cap_style", newSVGdkCapStyle (v->cap_style));
	gperl_hv_take_sv_s (h, "join_style", newSVGdkJoinStyle (v->join_style));

	return r;
}

void
SvGdkGCValues (SV * data, GdkGCValues * v, GdkGCValuesMask * m)
{
	HV * h;
	SV ** s;
	GdkGCValuesMask mask = 0;

	if (!gperl_sv_is_hash_ref (data))
		return;

	h = (HV*) SvRV (data);

	if (!v)
		v = gperl_alloc_temp (sizeof(GdkGCValues));

	if ((s=hv_fetch (h, "foreground", 10, 0)) && gperl_sv_is_defined (*s)) {
		v->foreground = *((GdkColor*) SvGdkColor (*s));
		mask |= GDK_GC_FOREGROUND;
	}
	if ((s=hv_fetch (h, "background", 10, 0)) && gperl_sv_is_defined (*s)) {
		v->background = *((GdkColor*) SvGdkColor (*s));
		mask |= GDK_GC_BACKGROUND;
	}
	if ((s=hv_fetch (h, "font", 4, 0)) && gperl_sv_is_defined (*s)) {
		v->font = SvGdkFont (*s);
		mask |= GDK_GC_FONT;
	}
	if ((s=hv_fetch (h, "function", 8, 0)) && gperl_sv_is_defined (*s)) {
		v->function = SvGdkFunction (*s);
		mask |= GDK_GC_FUNCTION;
	}
	if ((s=hv_fetch (h, "fill", 4, 0)) && gperl_sv_is_defined (*s)) {
		v->fill = SvGdkFill (*s);
		mask |= GDK_GC_FILL;
	}
	if ((s=hv_fetch (h, "tile", 4, 0)) && gperl_sv_is_defined (*s)) {
		v->tile = SvGdkPixmap (*s);
		mask |= GDK_GC_TILE;
	}
	if ((s=hv_fetch (h, "stipple", 7, 0)) && gperl_sv_is_defined (*s)) {
		v->stipple = SvGdkPixmap (*s);
		mask |= GDK_GC_STIPPLE;
	}
	if ((s=hv_fetch (h, "clip_mask", 9, 0)) && gperl_sv_is_defined (*s)) {
		v->clip_mask = SvGdkPixmap (*s);
		mask |= GDK_GC_CLIP_MASK;
	}
	if ((s=hv_fetch (h, "subwindow_mode", 14, 0)) && gperl_sv_is_defined (*s)) {
		v->subwindow_mode = SvGdkSubwindowMode (*s);
		mask |= GDK_GC_SUBWINDOW;
	}
	if ((s=hv_fetch (h, "ts_x_origin", 11, 0)) && gperl_sv_is_defined (*s)) {
		v->ts_x_origin = SvIV (*s);
		mask |= GDK_GC_TS_X_ORIGIN;
	}
	if ((s=hv_fetch (h, "ts_y_origin", 11, 0)) && gperl_sv_is_defined (*s)) {
		v->ts_y_origin = SvIV (*s);
		mask |= GDK_GC_TS_Y_ORIGIN;
	}
	if ((s=hv_fetch (h, "clip_x_origin", 13, 0)) && gperl_sv_is_defined (*s)) {
		v->clip_x_origin = SvIV (*s);
		mask |= GDK_GC_CLIP_X_ORIGIN;
	}
	if ((s=hv_fetch (h, "clip_y_origin", 13, 0)) && gperl_sv_is_defined (*s)) {
		v->clip_y_origin = SvIV (*s);
		mask |= GDK_GC_CLIP_Y_ORIGIN;
	}
	if ((s=hv_fetch (h, "graphics_exposures", 18, 0)) && gperl_sv_is_defined (*s)) {
		v->graphics_exposures = SvIV (*s);
		mask |= GDK_GC_EXPOSURES;
	}
	if ((s=hv_fetch (h, "line_width", 10, 0)) && gperl_sv_is_defined (*s)) {
		v->line_width= SvIV (*s);
		mask |= GDK_GC_LINE_WIDTH;
	}
	if ((s=hv_fetch (h, "line_style", 10, 0)) && gperl_sv_is_defined (*s)) {
		v->line_style= SvGdkLineStyle (*s);
		mask |= GDK_GC_LINE_STYLE;
	}
	if ((s=hv_fetch (h, "cap_style", 9, 0)) && gperl_sv_is_defined (*s)) {
		v->cap_style = SvGdkCapStyle (*s);
		mask |= GDK_GC_CAP_STYLE;
	}
	if ((s=hv_fetch (h, "join_style", 10, 0)) && gperl_sv_is_defined (*s)) {
		v->join_style = SvGdkJoinStyle (*s);
		mask |= GDK_GC_JOIN_STYLE;
	}

	if (m)
		*m = mask;
}

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

XS_EUPXS(XS_Gtk2__Gdk__GC_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_new)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "class, drawable, values=NULL");
    {
	GdkGC_noinc *	RETVAL;
	GdkDrawable *	drawable = SvGdkDrawable (ST(1))
;
	SV *	values;

	if (items < 3)
	    values = NULL;
	else {
	    values = ST(2)
;
	}
#line 214 "xs/GdkGC.xs"
	if (gperl_sv_is_defined (values)) {
		GdkGCValuesMask m;
		GdkGCValues v;
		SvGdkGCValues (values, &v, &m);
		RETVAL = gdk_gc_new_with_values (drawable, &v, m);
	} else {
		if (ix == 1)
			warn ("passed empty values to new_with_values");
		RETVAL = gdk_gc_new (drawable);
	}
#line 339 "xs/GdkGC.c"
	ST(0) = newSVGdkGC_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk__GC_get_values); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_get_values)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "gc");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
#line 241 "xs/GdkGC.xs"
	GdkGCValues values;
#line 358 "xs/GdkGC.c"
	SV *	RETVAL;
#line 243 "xs/GdkGC.xs"
	gdk_gc_get_values (gc, &values);
	RETVAL = newSVGdkGCValues (&values);
#line 363 "xs/GdkGC.c"
	ST(0) = RETVAL;
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_values); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_values)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, values");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	SV *	values = ST(1)
;
#line 259 "xs/GdkGC.xs"
	GdkGCValues v;
	GdkGCValuesMask m;
#line 385 "xs/GdkGC.c"
#line 262 "xs/GdkGC.xs"
	SvGdkGCValues (values, &v, &m);
	gdk_gc_set_values (gc, &v, m);
#line 389 "xs/GdkGC.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_foreground); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_foreground)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, color");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkColor *	color = SvGdkColor (ST(1))
;

	gdk_gc_set_foreground(gc, color);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_background); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_background)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, color");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkColor *	color = SvGdkColor (ST(1))
;

	gdk_gc_set_background(gc, color);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_font); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_font)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, font");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkFont *	font = SvGdkFont (ST(1))
;

	gdk_gc_set_font(gc, font);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_function); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_function)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, function");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkFunction	function = SvGdkFunction (ST(1))
;

	gdk_gc_set_function(gc, function);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_fill); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_fill)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, fill");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkFill	fill = SvGdkFill (ST(1))
;

	gdk_gc_set_fill(gc, fill);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_tile); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_tile)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, tile");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkPixmap *	tile = SvGdkPixmap (ST(1))
;

	gdk_gc_set_tile(gc, tile);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_stipple); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_stipple)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, stipple");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkPixmap *	stipple = SvGdkPixmap (ST(1))
;

	gdk_gc_set_stipple(gc, stipple);
    }
    XSRETURN_EMPTY;
}


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

	gdk_gc_set_ts_origin(gc, x, y);
    }
    XSRETURN_EMPTY;
}


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

	gdk_gc_set_clip_origin(gc, x, y);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_clip_mask); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_clip_mask)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, mask");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	SV *	mask = ST(1)
;
#line 327 "xs/GdkGC.xs"
	gdk_gc_set_clip_mask (gc, SvGdkBitmap_ornull (mask));
#line 574 "xs/GdkGC.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_clip_rectangle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_clip_rectangle)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, rectangle");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkRectangle_ornull *	rectangle = SvGdkRectangle_ornull (ST(1))
;

	gdk_gc_set_clip_rectangle(gc, rectangle);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_clip_region); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_clip_region)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, region");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkRegion_ornull *	region = SvGdkRegion_ornull (ST(1))
;

	gdk_gc_set_clip_region(gc, region);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_subwindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_subwindow)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, mode");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkSubwindowMode	mode = SvGdkSubwindowMode (ST(1))
;

	gdk_gc_set_subwindow(gc, mode);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_exposures); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_exposures)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, exposures");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	gboolean	exposures = (bool)SvTRUE(ST(1))
;

	gdk_gc_set_exposures(gc, exposures);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_line_attributes); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_line_attributes)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "gc, line_width, line_style, cap_style, join_style");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	gint	line_width = (gint)SvIV(ST(1))
;
	GdkLineStyle	line_style = SvGdkLineStyle (ST(2))
;
	GdkCapStyle	cap_style = SvGdkCapStyle (ST(3))
;
	GdkJoinStyle	join_style = SvGdkJoinStyle (ST(4))
;

	gdk_gc_set_line_attributes(gc, line_width, line_style, cap_style, join_style);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_dashes); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_dashes)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "gc, dash_offset, ...");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	gint	dash_offset = (gint)SvIV(ST(1))
;
#line 375 "xs/GdkGC.xs"
	gint8 * dash_list;
	gint    n;
#line 690 "xs/GdkGC.c"
#line 378 "xs/GdkGC.xs"
	n = --items-1;
	dash_list = g_new(gint8, n);
	for( ; items > 1; items-- )
		dash_list[items-2] = (gint8) SvIV(ST(items));
	gdk_gc_set_dashes(gc, dash_offset, dash_list, n);
	g_free(dash_list);
#line 698 "xs/GdkGC.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_offset); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_offset)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "gc, x_offset, y_offset");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	gint	x_offset = (gint)SvIV(ST(1))
;
	gint	y_offset = (gint)SvIV(ST(2))
;

	gdk_gc_offset(gc, x_offset, y_offset);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_copy); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_copy)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "dst_gc, src_gc");
    {
	GdkGC *	dst_gc = SvGdkGC (ST(0))
;
	GdkGC *	src_gc = SvGdkGC (ST(1))
;

	gdk_gc_copy(dst_gc, src_gc);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_colormap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_colormap)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, colormap");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkColormap *	colormap = SvGdkColormap (ST(1))
;

	gdk_gc_set_colormap(gc, colormap);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_get_colormap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_get_colormap)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "gc");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkColormap *	RETVAL;

	RETVAL = gdk_gc_get_colormap(gc);
	ST(0) = newSVGdkColormap (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_rgb_fg_color); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_rgb_fg_color)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, color");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkColor *	color = SvGdkColor (ST(1))
;

	gdk_gc_set_rgb_fg_color(gc, color);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gtk2__Gdk__GC_set_rgb_bg_color); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_set_rgb_bg_color)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "gc, color");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkColor *	color = SvGdkColor (ST(1))
;

	gdk_gc_set_rgb_bg_color(gc, color);
    }
    XSRETURN_EMPTY;
}

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


XS_EUPXS(XS_Gtk2__Gdk__GC_get_screen); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gtk2__Gdk__GC_get_screen)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "gc");
    {
	GdkGC *	gc = SvGdkGC (ST(0))
;
	GdkScreen *	RETVAL;

	RETVAL = gdk_gc_get_screen(gc);
	ST(0) = newSVGdkScreen (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}

#endif /* have GdkScreen */
#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Gtk2__Gdk__GC); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Gtk2__Gdk__GC)
{
    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 = newXS("Gtk2::Gdk::GC::new", XS_Gtk2__Gdk__GC_new, file);
        XSANY.any_i32 = 0;
        cv = newXS("Gtk2::Gdk::GC::new_with_values", XS_Gtk2__Gdk__GC_new, file);
        XSANY.any_i32 = 1;
        newXS("Gtk2::Gdk::GC::get_values", XS_Gtk2__Gdk__GC_get_values, file);
        newXS("Gtk2::Gdk::GC::set_values", XS_Gtk2__Gdk__GC_set_values, file);
        newXS("Gtk2::Gdk::GC::set_foreground", XS_Gtk2__Gdk__GC_set_foreground, file);
        newXS("Gtk2::Gdk::GC::set_background", XS_Gtk2__Gdk__GC_set_background, file);
        newXS("Gtk2::Gdk::GC::set_font", XS_Gtk2__Gdk__GC_set_font, file);
        newXS("Gtk2::Gdk::GC::set_function", XS_Gtk2__Gdk__GC_set_function, file);
        newXS("Gtk2::Gdk::GC::set_fill", XS_Gtk2__Gdk__GC_set_fill, file);
        newXS("Gtk2::Gdk::GC::set_tile", XS_Gtk2__Gdk__GC_set_tile, file);
        newXS("Gtk2::Gdk::GC::set_stipple", XS_Gtk2__Gdk__GC_set_stipple, file);
        newXS("Gtk2::Gdk::GC::set_ts_origin", XS_Gtk2__Gdk__GC_set_ts_origin, file);
        newXS("Gtk2::Gdk::GC::set_clip_origin", XS_Gtk2__Gdk__GC_set_clip_origin, file);
        newXS("Gtk2::Gdk::GC::set_clip_mask", XS_Gtk2__Gdk__GC_set_clip_mask, file);
        newXS("Gtk2::Gdk::GC::set_clip_rectangle", XS_Gtk2__Gdk__GC_set_clip_rectangle, file);
        newXS("Gtk2::Gdk::GC::set_clip_region", XS_Gtk2__Gdk__GC_set_clip_region, file);
        newXS("Gtk2::Gdk::GC::set_subwindow", XS_Gtk2__Gdk__GC_set_subwindow, file);
        newXS("Gtk2::Gdk::GC::set_exposures", XS_Gtk2__Gdk__GC_set_exposures, file);
        newXS("Gtk2::Gdk::GC::set_line_attributes", XS_Gtk2__Gdk__GC_set_line_attributes, file);
        newXS("Gtk2::Gdk::GC::set_dashes", XS_Gtk2__Gdk__GC_set_dashes, file);
        newXS("Gtk2::Gdk::GC::offset", XS_Gtk2__Gdk__GC_offset, file);
        newXS("Gtk2::Gdk::GC::copy", XS_Gtk2__Gdk__GC_copy, file);
        newXS("Gtk2::Gdk::GC::set_colormap", XS_Gtk2__Gdk__GC_set_colormap, file);
        newXS("Gtk2::Gdk::GC::get_colormap", XS_Gtk2__Gdk__GC_get_colormap, file);
        newXS("Gtk2::Gdk::GC::set_rgb_fg_color", XS_Gtk2__Gdk__GC_set_rgb_fg_color, file);
        newXS("Gtk2::Gdk::GC::set_rgb_bg_color", XS_Gtk2__Gdk__GC_set_rgb_bg_color, file);
#if XSubPPtmpAAAA
        newXS("Gtk2::Gdk::GC::get_screen", XS_Gtk2__Gdk__GC_get_screen, file);
#endif

    /* Initialisation Section */

#line 158 "xs/GdkGC.xs"
	/* the gdk backends override the public GdkGC with private,
	 * back-end-specific types.  tell gperl_get_object not to
	 * complain about them.  */
	gperl_object_set_no_warn_unreg_subclass (GDK_TYPE_GC, TRUE);

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

