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

#line 1 "DC.xs"
    /*
    ###########################################################################
    #(@)PACKAGE:Win32::GUI::DC
    #
    # $Id: DC.xs,v 1.20 2010/04/08 21:26:48 jwgui Exp $
    #
    ###########################################################################
    */

#include "GUI.h"

#line 22 "DC.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 166 "DC.c"
#pragma message( "*** PACKAGE Win32::GUI::DC..." )

XS_EUPXS(XS_Win32__GUI__DC_CancelDC); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_CancelDC)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 29 "DC.xs"
    RETVAL = CancelDC(handle);
#line 191 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_CreateCompatibleDC); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_CreateCompatibleDC)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HDC	handle;
#line 40 "DC.xs"
    HDC hnew;
#line 211 "DC.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 42 "DC.xs"
    hnew = CreateCompatibleDC(handle);
    if (hnew== NULL) XSRETURN_UNDEF;
    XPUSHs(CreateObjectWithHandle(NOTXSCALL "Win32::GUI::DC", (HWND) hnew));
    XSRETURN(1);
#line 227 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__DC_CreateCompatibleBitmap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_CreateCompatibleBitmap)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, width, height");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HDC	handle;
	int	width = (int)SvIV(ST(1))
;
	int	height = (int)SvIV(ST(2))
;
#line 57 "DC.xs"
    HBITMAP hnew;
#line 250 "DC.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 59 "DC.xs"
    hnew = CreateCompatibleBitmap(handle,width,height);
    if (hnew== NULL) XSRETURN_UNDEF;
    XPUSHs(CreateObjectWithHandle(NOTXSCALL "Win32::GUI::Bitmap", (HWND) hnew));
    XSRETURN(1);
#line 266 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__DC_CreateDC); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_CreateDC)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "driver, device");
    {
	LPCTSTR	driver = (LPCTSTR)SvPV_nolen(ST(0))
;
	LPCTSTR	device = (LPCTSTR)SvPV_nolen(ST(1))
;
	HDC	RETVAL;
	dXSTARG;
#line 73 "DC.xs"
    RETVAL = CreateDC(driver, device, NULL, NULL);
#line 288 "DC.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_DeleteDC); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_DeleteDC)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 84 "DC.xs"
    RETVAL = DeleteDC(handle);
#line 318 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_DeleteObject); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_DeleteObject)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HGDIOBJ	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HGDIOBJ,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HGDIOBJ,SvIV(ST(0)))
;
#line 96 "DC.xs"
    RETVAL = DeleteObject(handle);
#line 348 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_GetCurrentObject); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GetCurrentObject)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, Object");
    {
	HDC	handle;
	UINT	Object = (UINT)SvUV(ST(1))
;
	HGDIOBJ	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 111 "DC.xs"
    RETVAL = GetCurrentObject(handle, Object);
#line 380 "DC.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_GetDC); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GetDC)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	HDC	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 124 "DC.xs"
    RETVAL = GetDC(handle);
#line 410 "DC.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_GetDeviceCaps); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GetDeviceCaps)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, index");
    {
	HDC	handle;
	int	index = (int)SvIV(ST(1))
;
	int	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 139 "DC.xs"
    RETVAL = GetDeviceCaps(handle, index);
#line 442 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_GetObjectType); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GetObjectType)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HGDIOBJ	handle;
	DWORD	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HGDIOBJ,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HGDIOBJ,SvIV(ST(0)))
;
#line 150 "DC.xs"
    RETVAL = GetObjectType(handle);
#line 472 "DC.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_GetStockObject); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GetStockObject)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "Object");
    {
	int	Object = (int)SvIV(ST(0))
;
	HGDIOBJ	RETVAL;
	dXSTARG;
#line 161 "DC.xs"
    RETVAL = GetStockObject(Object);
#line 493 "DC.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_ReleaseDC); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_ReleaseDC)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "hwnd, hdc");
    {
	HWND	hwnd;
	HDC	hdc;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            hwnd = INT2PTR(HWND,SvIV(*out));
        else
            hwnd = NULL;
    } else
       hwnd = INT2PTR(HWND,SvIV(ST(0)))
;

    if(SvROK(ST(1))) {
        SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
        if(out != NULL)
            hdc = INT2PTR(HDC,SvIV(*out));
        else
            hdc = NULL;
    } else
       hdc = INT2PTR(HDC,SvIV(ST(1)))
;
#line 173 "DC.xs"
    RETVAL = ReleaseDC(hwnd, hdc);
#line 534 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_RestoreDC); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_RestoreDC)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, state=-1");
    {
	HDC	handle;
	int	state;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 2)
	    state = -1;
	else {
	    state = (int)SvIV(ST(1))
;
	}
#line 196 "DC.xs"
    RETVAL = RestoreDC(handle, state);
#line 573 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_SaveDC); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_SaveDC)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	int	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 215 "DC.xs"
    RETVAL = SaveDC(handle);
#line 604 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_SelectObject); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_SelectObject)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, object");
    {
	HDC	handle;
	HGDIOBJ	object;
	HGDIOBJ	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

    if(SvROK(ST(1))) {
        SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
        if(out != NULL)
            object = INT2PTR(HGDIOBJ,SvIV(*out));
        else
            object = NULL;
    } else
       object = INT2PTR(HGDIOBJ,SvIV(ST(1)))
;
#line 228 "DC.xs"
    RETVAL = SelectObject(handle, object);
#line 645 "DC.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_Chord); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_Chord)
{
    dVAR; dXSARGS;
    if (items != 9)
       croak_xs_usage(cv,  "handle, left, top, right, bottom, xf, yf, xs, ys");
    {
	HDC	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
	int	xf = (int)SvIV(ST(5))
;
	int	yf = (int)SvIV(ST(6))
;
	int	xs = (int)SvIV(ST(7))
;
	int	ys = (int)SvIV(ST(8))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 253 "DC.xs"
    RETVAL = Chord(handle, left, top, right, bottom, xf, yf, xs, ys);
#line 691 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_Ellipse); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_Ellipse)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "handle, left, top, right, bottom");
    {
	HDC	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 271 "DC.xs"
    RETVAL = Ellipse(handle, left, top, right, bottom);
#line 729 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_Circle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_Circle)
{
    dVAR; dXSARGS;
    if (items < 4 || items > 5)
       croak_xs_usage(cv,  "handle, x, y, width, height=-1");
    {
	HDC	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
	int	width = (int)SvIV(ST(3))
;
	int	height;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 5)
	    height = -1;
	else {
	    height = (int)SvIV(ST(4))
;
	}
#line 289 "DC.xs"
    if(height == -1) {
        width *= 2;
        height = width;
    }
    width /= 2; height /= 2;
    RETVAL = Ellipse(handle, x-width, y-height, x+width, y+height);
#line 778 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_FillRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_FillRect)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "handle, left, top, right, bottom, hbr");
    {
	HDC	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
	HBRUSH	hbr;
#line 312 "DC.xs"
    RECT rc;
#line 805 "DC.c"
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

    if(SvROK(ST(5))) {
        SV** out=hv_fetch((HV*)SvRV(ST(5)), "-handle", 7, 0);
        if(out != NULL)
            hbr = INT2PTR(HBRUSH,SvIV(*out));
        else
            hbr = NULL;
    } else
       hbr = INT2PTR(HBRUSH,SvIV(ST(5)))
;
#line 314 "DC.xs"
    rc.left = left;
    rc.top = top;
    rc.right = right;
    rc.bottom = bottom;
    RETVAL = FillRect(handle, &rc, hbr);
#line 834 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_FrameRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_FrameRect)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "handle, left, top, right, bottom, hbr");
    {
	HDC	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
	HBRUSH	hbr;
#line 335 "DC.xs"
    RECT rc;
#line 861 "DC.c"
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

    if(SvROK(ST(5))) {
        SV** out=hv_fetch((HV*)SvRV(ST(5)), "-handle", 7, 0);
        if(out != NULL)
            hbr = INT2PTR(HBRUSH,SvIV(*out));
        else
            hbr = NULL;
    } else
       hbr = INT2PTR(HBRUSH,SvIV(ST(5)))
;
#line 337 "DC.xs"
    rc.left = left;
    rc.top = top;
    rc.right = right;
    rc.bottom = bottom;
    RETVAL = FrameRect(handle, &rc, hbr);
#line 890 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_InvertRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_InvertRect)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "handle, left, top, right, bottom");
    {
	HDC	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
#line 357 "DC.xs"
    RECT rc;
#line 916 "DC.c"
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 359 "DC.xs"
    rc.left = left;
    rc.top = top;
    rc.right = right;
    rc.bottom = bottom;
    RETVAL = InvertRect(handle, &rc);
#line 935 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_Pie); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_Pie)
{
    dVAR; dXSARGS;
    if (items != 9)
       croak_xs_usage(cv,  "handle, left, top, right, bottom, xf, yf, xs, ys");
    {
	HDC	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
	int	xf = (int)SvIV(ST(5))
;
	int	yf = (int)SvIV(ST(6))
;
	int	xs = (int)SvIV(ST(7))
;
	int	ys = (int)SvIV(ST(8))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 384 "DC.xs"
    RETVAL = Pie(handle, left, top, right, bottom, xf, yf, xs, ys);
#line 981 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_Polygon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_Polygon)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HDC	handle;
#line 396 "DC.xs"
    POINT *lpPoints;
    int nCount, i, j;
#line 1000 "DC.c"
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 399 "DC.xs"
    if (items < 5 || (items - 5) % 2 != 0)
        croak("Usage: Polygon(X1, Y1, X2, Y2, [ X, Y, ... ]);\n");

    nCount   = (items - 1) / 2;
    lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));

    for (i = 1, j = 0; i < items; i += 2, j++) {
        lpPoints[j].x = (LONG)SvIV(ST(i));
        lpPoints[j].y = (LONG)SvIV(ST(i+1));
    }

    RETVAL = Polygon(handle, lpPoints, nCount);
    safefree(lpPoints);
#line 1027 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_Rectangle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_Rectangle)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "handle, left, top, right, bottom");
    {
	HDC	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 430 "DC.xs"
    RETVAL = Rectangle(handle, left, top, right, bottom);
#line 1065 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_RoundRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_RoundRect)
{
    dVAR; dXSARGS;
    if (items != 7)
       croak_xs_usage(cv,  "handle, left, top, right, bottom, width, height");
    {
	HDC	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
	int	width = (int)SvIV(ST(5))
;
	int	height = (int)SvIV(ST(6))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 449 "DC.xs"
    RETVAL = RoundRect(handle, left, top, right, bottom, width, height);
#line 1107 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_DrawText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_DrawText)
{
    dVAR; dXSARGS;
    if (items < 6 || items > 7)
       croak_xs_usage(cv,  "handle, string, left, top, right, bottom, format=DT_LEFT|DT_SINGLELINE|DT_TOP");
    {
	HDC	handle;
	LPCTSTR	string = (LPCTSTR)SvPV_nolen(ST(1))
;
	int	left = (int)SvIV(ST(2))
;
	int	top = (int)SvIV(ST(3))
;
	int	right = (int)SvIV(ST(4))
;
	int	bottom = (int)SvIV(ST(5))
;
	UINT	format;
#line 471 "DC.xs"
    RECT rc;
#line 1136 "DC.c"
	int	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 7)
	    format = DT_LEFT|DT_SINGLELINE|DT_TOP;
	else {
	    format = (UINT)SvUV(ST(6))
;
	}
#line 473 "DC.xs"
    rc.left = left;
    rc.top = top;
    rc.right = right;
    rc.bottom = bottom;
    RETVAL = DrawText(handle, string, -1, &rc, format);
#line 1162 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_TextAlign); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_TextAlign)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, Align=(UINT) -1");
    {
	HDC	handle;
	UINT	Align;
	UINT	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 2)
	    Align = (UINT) -1;
	else {
	    Align = (UINT)SvUV(ST(1))
;
	}
#line 491 "DC.xs"
    if(items == 1) {
        RETVAL = GetTextAlign(handle);
    } else {
        RETVAL = SetTextAlign(handle, Align);
    }
#line 1204 "DC.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_TextCharacterExtra); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_TextCharacterExtra)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, extra= -1");
    {
	HDC	handle;
	int	extra;
	UINT	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 2)
	    extra = -1;
	else {
	    extra = (int)SvIV(ST(1))
;
	}
#line 507 "DC.xs"
    if(items == 1) {
        RETVAL = GetTextCharacterExtra(handle);
    } else {
        RETVAL = SetTextCharacterExtra(handle, extra);
    }
#line 1246 "DC.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_TextColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_TextColor)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, color=(COLORREF) -1");
    {
	HDC	handle;
	COLORREF	color;
	long	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 2)
	    color = (COLORREF) -1;
	else {
    color = SvCOLORREF(NOTXSCALL ST(1))
;
	}
#line 523 "DC.xs"
    if(items == 1) {
        RETVAL = GetTextColor(handle);
    } else {
        RETVAL = SetTextColor(handle, color);
    }
#line 1288 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_GetTextExtentPoint); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GetTextExtentPoint)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, string");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HDC	handle;
	LPCTSTR	string = (LPCTSTR)SvPV_nolen(ST(1))
;
#line 539 "DC.xs"
    SIZE size;
#line 1310 "DC.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 541 "DC.xs"
    if (GetTextExtentPoint32(handle, string, strlen(string), &size)) {
        EXTEND(SP, 2);
        XST_mIV(0, size.cx);
        XST_mIV(1, size.cy);
        XSRETURN(2);
    } else {
        XSRETURN_UNDEF;
    }
#line 1330 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__DC_GetTextFace); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GetTextFace)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HDC	handle;
#line 558 "DC.xs"
    char Text[1024];
#line 1349 "DC.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 560 "DC.xs"
    GetTextFace(handle, 1024, Text);
    EXTEND(SP, 1);
    XST_mPV(0, Text);
    XSRETURN(1);
#line 1365 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__DC_SetTextJustification); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_SetTextJustification)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, nBreakExtra, nBreakCount");
    {
	HDC	handle;
	int	nBreakExtra = (int)SvIV(ST(1))
;
	int	nBreakCount = (int)SvIV(ST(2))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 575 "DC.xs"
    RETVAL = SetTextJustification(handle, nBreakExtra, nBreakCount);
#line 1398 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_TextOut); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_TextOut)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "handle, x, y, text");
    {
	HDC	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
	LPCTSTR	text = (LPCTSTR)SvPV_nolen(ST(3))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 590 "DC.xs"
    RETVAL = TextOut(handle, x, y, text, strlen(text));
#line 1434 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_Arc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_Arc)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "handle, x, y, radius, start, sweep");
    {
	HDC	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
	DWORD	radius = (DWORD)SvUV(ST(3))
;
	FLOAT	start = (float)SvNV(ST(4))
;
	FLOAT	sweep = (float)SvNV(ST(5))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 614 "DC.xs"
    RETVAL = AngleArc(handle, x, y, radius, start, sweep);
#line 1474 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_ArcDirection); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_ArcDirection)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, direction = -1");
    {
	HDC	handle;
	int	direction;
	int	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 2)
	    direction = -1;
	else {
	    direction = (int)SvIV(ST(1))
;
	}
#line 627 "DC.xs"
    if(items == 1) {
        RETVAL = GetArcDirection(handle);
    } else {
        RETVAL = SetArcDirection(handle, direction);
    }
#line 1516 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_ArcTo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_ArcTo)
{
    dVAR; dXSARGS;
    if (items != 9)
       croak_xs_usage(cv,  "handle, left, top, right, bottom, xf, yf, xs, ys");
    {
	HDC	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
	int	xf = (int)SvIV(ST(5))
;
	int	yf = (int)SvIV(ST(6))
;
	int	xs = (int)SvIV(ST(7))
;
	int	ys = (int)SvIV(ST(8))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 650 "DC.xs"
    RETVAL = ArcTo (handle, left, top, right, bottom, xf, yf, xs, ys);
#line 1562 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_Line); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_Line)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "handle, x, y, x1, y1");
    {
	HDC	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
	int	x1 = (int)SvIV(ST(3))
;
	int	y1 = (int)SvIV(ST(4))
;
	long	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 665 "DC.xs"
    MoveToEx(handle, x, y, NULL);
    RETVAL = LineTo(handle, x1, y1);
#line 1601 "DC.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_LineTo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_LineTo)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    {
	HDC	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
	long	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 680 "DC.xs"
    RETVAL = LineTo(handle, x, y);
#line 1633 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_MoveTo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_MoveTo)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    {
	HDC	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
	long	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 694 "DC.xs"
    RETVAL = MoveToEx(handle, x, y, NULL);
#line 1667 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_PolyBezier); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_PolyBezier)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HDC	handle;
#line 711 "DC.xs"
    POINT *lpPoints;
    int nCount, i, j;
#line 1686 "DC.c"
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 714 "DC.xs"
    if (items < 9 || (items - 9) % 6 != 0)
        croak("Usage: PolyBezier(X1, Y1, X2, Y2, X3, Y3, X4, Y4, [ X, Y, ... ]);\n");

    nCount   = (items - 1) / 2;
    lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));

    for (i = 1, j = 0; i < items; i += 2, j++) {
        lpPoints[j].x = (LONG)SvIV(ST(i));
        lpPoints[j].y = (LONG)SvIV(ST(i+1));
    }

    RETVAL = PolyBezier(handle, lpPoints, nCount);
    safefree(lpPoints);
#line 1713 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_PolyBezierTo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_PolyBezierTo)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HDC	handle;
#line 741 "DC.xs"
    POINT *lpPoints;
    int nCount, i, j;
#line 1732 "DC.c"
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 744 "DC.xs"
    if (items < 7 || (items - 7) % 6 != 0)
        croak("Usage: PolyBezier(X1, Y1, X2, Y2, X3, Y3, [ X, Y, ... ]);\n");

    nCount   = (items - 1) / 2;
    lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));

    for (i = 1, j = 0; i < items; i += 2, j++) {
        lpPoints[j].x = (LONG)SvIV(ST(i));
        lpPoints[j].y = (LONG)SvIV(ST(i+1));
    }

    RETVAL = PolyBezierTo (handle, lpPoints, nCount);
    safefree(lpPoints);
#line 1759 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_Polyline); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_Polyline)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HDC	handle;
#line 769 "DC.xs"
    POINT *lpPoints;
    int nCount, i, j;
#line 1778 "DC.c"
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 772 "DC.xs"
    if (items < 5 || (items - 5) % 2 != 0)
        croak("Usage: Polyline(X1, Y1, X2, Y2, [ X, Y, ... ]);\n");

    nCount   = (items - 1) / 2;
    lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));

    for (i = 1, j = 0; i < items; i += 2, j++) {
        lpPoints[j].x = (LONG)SvIV(ST(i));
        lpPoints[j].y = (LONG)SvIV(ST(i+1));
    }

    RETVAL = Polyline (handle, lpPoints, nCount);
    safefree(lpPoints);
#line 1805 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_PolylineTo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_PolylineTo)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HDC	handle;
#line 795 "DC.xs"
    POINT *lpPoints;
    int nCount, i, j;
#line 1824 "DC.c"
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 798 "DC.xs"
    if (items < 3 || (items - 3) % 2 != 0)
        croak("Usage: PolylineTo(X1, Y2, [ X, Y, ... ]);\n");

    nCount   = (items - 1) / 2;
    lpPoints = (POINT *) safemalloc(nCount * sizeof(POINT));

    for (i = 1, j = 0; i < items; i += 2, j++) {
        lpPoints[j].x = (LONG)SvIV(ST(i));
        lpPoints[j].y = (LONG)SvIV(ST(i+1));
    }

    RETVAL = PolylineTo(handle, lpPoints, nCount);
    safefree(lpPoints);
#line 1851 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_DrawEdge); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_DrawEdge)
{
    dVAR; dXSARGS;
    if (items < 5 || items > 7)
       croak_xs_usage(cv,  "handle, left, top, right, bottom, edge=EDGE_RAISED, flags=BF_RECT");
    {
	HDC	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
	UINT	edge;
	UINT	flags;
#line 834 "DC.xs"
    RECT rc;
#line 1879 "DC.c"
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 6)
	    edge = EDGE_RAISED;
	else {
	    edge = (UINT)SvUV(ST(5))
;
	}

	if (items < 7)
	    flags = BF_RECT;
	else {
	    flags = (UINT)SvUV(ST(6))
;
	}
#line 836 "DC.xs"
    rc.left = left;
    rc.top = top;
    rc.right = right;
    rc.bottom = bottom;
    RETVAL = DrawEdge(handle, &rc, edge, flags);
#line 1912 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_DrawFocusRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_DrawFocusRect)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "handle, left, top, right, bottom");
    {
	HDC	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
#line 856 "DC.xs"
    RECT rc;
#line 1938 "DC.c"
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 858 "DC.xs"
    rc.left = left;
    rc.top = top;
    rc.right = right;
    rc.bottom = bottom;
    RETVAL = DrawFocusRect(handle, &rc);
#line 1957 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_DrawFrameControl); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_DrawFrameControl)
{
    dVAR; dXSARGS;
    if (items != 7)
       croak_xs_usage(cv,  "handle, left, top, right, bottom, type, state");
    {
	HDC	handle;
	RECT	rc = { (LONG)SvIV(ST(1)), (LONG)SvIV(ST(2)), (LONG)SvIV(ST(3)), (LONG)SvIV(ST(4)) };
	UINT	type = (UINT)SvUV(ST(5))
;
	UINT	state = (UINT)SvUV(ST(6))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	RETVAL = DrawFrameControl(handle, &rc, type, state);
#line 883 "DC.xs"
    if (state & DFCS_ADJUSTRECT) {
        if(!SvREADONLY(ST(1))) { sv_setiv_mg(ST(1), (IV)rc.left);   }
        if(!SvREADONLY(ST(2))) { sv_setiv_mg(ST(2), (IV)rc.top);    }
        if(!SvREADONLY(ST(3))) { sv_setiv_mg(ST(3), (IV)rc.right);  }
        if(!SvREADONLY(ST(4))) { sv_setiv_mg(ST(4), (IV)rc.bottom); }
    }
#line 1999 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_BackColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_BackColor)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, color=(COLORREF) -1");
    {
	HDC	handle;
	COLORREF	color;
	long	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 2)
	    color = (COLORREF) -1;
	else {
    color = SvCOLORREF(NOTXSCALL ST(1))
;
	}
#line 898 "DC.xs"
    if(items == 1) {
        RETVAL = (long) GetBkColor(handle);
    } else {
        RETVAL = (long) SetBkColor(handle, color);
    }
#line 2041 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_BkMode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_BkMode)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, mode=-1");
    {
	HDC	handle;
	int	mode;
	long	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 2)
	    mode = -1;
	else {
	    mode = (int)SvIV(ST(1))
;
	}
#line 917 "DC.xs"
    if(items == 1) {
        RETVAL = (long) GetBkMode(handle);
    } else {
        RETVAL = (long) SetBkMode(handle, mode);
    }
#line 2083 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_ROP2); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_ROP2)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, mode=-1");
    {
	HDC	handle;
	int	mode;
	long	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 2)
	    mode = -1;
	else {
	    mode = (int)SvIV(ST(1))
;
	}
#line 935 "DC.xs"
    if(items == 1) {
        RETVAL = (long) GetROP2(handle);
    } else {
        RETVAL = (long) SetROP2(handle, mode);
    }
#line 2125 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_GetUpdateRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GetUpdateRect)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, erase=0");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	SV*	handle = ST(0)
;
	BOOL	erase;
#line 959 "DC.xs"
    HWND hwnd;
    SV** window;
    HV* self;
    RECT myRect;
#line 2150 "DC.c"

	if (items < 2)
	    erase = 0;
	else {
	    erase = (BOOL)SvIV(ST(1))
;
	}
#line 964 "DC.xs"
    if(NULL != handle)  {
        if(SvROK(handle)) {
            self = (HV*) SvRV(handle);
            window = hv_fetch_mg(NOTXSCALL self, "-window", 7, 0);
            if(window != NULL) {
                hwnd = INT2PTR(HWND,SvIV(*window));
            } else {
                XSRETURN_UNDEF;
            }
        } else {
            XSRETURN_UNDEF;
        }
    } else {
        XSRETURN_UNDEF;
    }
    ZeroMemory(&myRect, sizeof(RECT));
    if(GetUpdateRect(hwnd, &myRect, erase)) {
        EXTEND(SP, 4);
        XST_mIV(0, myRect.left);
        XST_mIV(1, myRect.top);
        XST_mIV(2, myRect.right);
        XST_mIV(3, myRect.bottom);
        XSRETURN(4);
    } else {
        XSRETURN_UNDEF;
    }
#line 2185 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__DC_PaintDesktop); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_PaintDesktop)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 999 "DC.xs"
    RETVAL = PaintDesktop(handle);
#line 2214 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_Validate); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_Validate)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	SV*	handle = ST(0)
;
	BOOL	RETVAL;
	dXSTARG;
#line 1013 "DC.xs"
    HWND hwnd;
    SV** window;
    HV* self;
    char szKey[] = "-window";

    if(NULL != handle)  {
        if(SvROK(handle)) {
            self = (HV*) SvRV(handle);
            window = hv_fetch_mg(NOTXSCALL self, szKey, strlen(szKey), 0);
            if(window != NULL) {
                hwnd = INT2PTR(HWND,SvIV(*window));
            } else {
                XSRETURN_NO;
            }
        } else {
            XSRETURN_NO;
        }
    } else {
        XSRETURN_NO;
    }
    RETVAL = ValidateRect(hwnd, NULL);
#line 2255 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_AbortPath); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_AbortPath)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1048 "DC.xs"
    RETVAL = AbortPath(handle);
#line 2285 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_BeginPath); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_BeginPath)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1059 "DC.xs"
    RETVAL = BeginPath(handle);
#line 2315 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_CloseFigure); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_CloseFigure)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1070 "DC.xs"
    RETVAL = CloseFigure(handle);
#line 2345 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_EndPath); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_EndPath)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1081 "DC.xs"
    RETVAL = EndPath(handle);
#line 2375 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_FillPath); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_FillPath)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1093 "DC.xs"
    RETVAL = FillPath(handle);
#line 2405 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_FlattenPath); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_FlattenPath)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1104 "DC.xs"
    RETVAL = FlattenPath(handle);
#line 2435 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_GetMiterLimit); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GetMiterLimit)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
#line 1115 "DC.xs"
    FLOAT limit;
#line 2453 "DC.c"
	FLOAT	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1117 "DC.xs"
    GetMiterLimit(handle, &limit);
    RETVAL = limit;
#line 2469 "DC.c"
	XSprePUSH;
	PUSHn((double)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_PathToRegion); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_PathToRegion)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	HRGN	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1132 "DC.xs"
    RETVAL = PathToRegion(handle);
#line 2499 "DC.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_SetMiterLimit); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_SetMiterLimit)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, limit");
    {
	HDC	handle;
	FLOAT	limit = (float)SvNV(ST(1))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1144 "DC.xs"
    RETVAL = SetMiterLimit(handle, limit, NULL);
#line 2531 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_StrokeAndFillPath); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_StrokeAndFillPath)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1156 "DC.xs"
    RETVAL = StrokeAndFillPath(handle);
#line 2561 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_StrokePath); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_StrokePath)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1167 "DC.xs"
    RETVAL = StrokePath(handle);
#line 2591 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_WidenPath); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_WidenPath)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1180 "DC.xs"
    RETVAL = WidenPath(handle);
#line 2621 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_BitBlt); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_BitBlt)
{
    dVAR; dXSARGS;
    if (items < 8 || items > 9)
       croak_xs_usage(cv,  "handle, xd, yd, w, h, source, xs, ys, dwRop=SRCCOPY");
    {
	HDC	handle;
	int	xd = (int)SvIV(ST(1))
;
	int	yd = (int)SvIV(ST(2))
;
	int	w = (int)SvIV(ST(3))
;
	int	h = (int)SvIV(ST(4))
;
	HDC	source;
	int	xs = (int)SvIV(ST(6))
;
	int	ys = (int)SvIV(ST(7))
;
	DWORD	dwRop;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

    if(SvROK(ST(5))) {
        SV** out=hv_fetch((HV*)SvRV(ST(5)), "-handle", 7, 0);
        if(out != NULL)
            source = INT2PTR(HDC,SvIV(*out));
        else
            source = NULL;
    } else
       source = INT2PTR(HDC,SvIV(ST(5)))
;

	if (items < 9)
	    dwRop = SRCCOPY;
	else {
	    dwRop = (DWORD)SvUV(ST(8))
;
	}
#line 1205 "DC.xs"
    RETVAL = BitBlt (handle, xd, yd, w, h, source, xs, ys, dwRop);
#line 2682 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_StretchBlt); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_StretchBlt)
{
    dVAR; dXSARGS;
    if (items < 10 || items > 11)
       croak_xs_usage(cv,  "handle, xd, yd, wd, hd, source, xs, ys, ws, hs, dwRop=SRCCOPY");
    {
	HDC	handle;
	int	xd = (int)SvIV(ST(1))
;
	int	yd = (int)SvIV(ST(2))
;
	int	wd = (int)SvIV(ST(3))
;
	int	hd = (int)SvIV(ST(4))
;
	HDC	source;
	int	xs = (int)SvIV(ST(6))
;
	int	ys = (int)SvIV(ST(7))
;
	int	ws = (int)SvIV(ST(8))
;
	int	hs = (int)SvIV(ST(9))
;
	DWORD	dwRop;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

    if(SvROK(ST(5))) {
        SV** out=hv_fetch((HV*)SvRV(ST(5)), "-handle", 7, 0);
        if(out != NULL)
            source = INT2PTR(HDC,SvIV(*out));
        else
            source = NULL;
    } else
       source = INT2PTR(HDC,SvIV(ST(5)))
;

	if (items < 11)
	    dwRop = SRCCOPY;
	else {
	    dwRop = (DWORD)SvUV(ST(10))
;
	}
#line 1230 "DC.xs"
    RETVAL = StretchBlt (handle, xd, yd, wd, hd, source, xs, ys, ws, hs, dwRop);
#line 2747 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_ExtFloodFill); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_ExtFloodFill)
{
    dVAR; dXSARGS;
    if (items < 4 || items > 5)
       croak_xs_usage(cv,  "handle, xs, ys, color, type=FLOODFILLSURFACE");
    {
	HDC	handle;
	int	xs = (int)SvIV(ST(1))
;
	int	ys = (int)SvIV(ST(2))
;
	COLORREF    color = SvCOLORREF(NOTXSCALL ST(3))
;
	UINT	type;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 5)
	    type = FLOODFILLSURFACE;
	else {
	    type = (UINT)SvUV(ST(4))
;
	}
#line 1245 "DC.xs"
    RETVAL = ExtFloodFill (handle, xs, ys, color, type);
#line 2791 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_FloodFill); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_FloodFill)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "handle, xs, ys, color");
    {
	HDC	handle;
	int	xs = (int)SvIV(ST(1))
;
	int	ys = (int)SvIV(ST(2))
;
	COLORREF    color = SvCOLORREF(NOTXSCALL ST(3))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1259 "DC.xs"
    RETVAL = ExtFloodFill(handle, xs, ys, color, FLOODFILLBORDER);
#line 2827 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_GradientFillTriangle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GradientFillTriangle)
{
    dVAR; dXSARGS;
    if (items != 10)
       croak_xs_usage(cv,  "handle, x0, y0, color0, x1, y1, color1, x2, y2, color2");
    {
	HDC	handle;
	int	x0 = (int)SvIV(ST(1))
;
	int	y0 = (int)SvIV(ST(2))
;
	COLORREF    color0 = SvCOLORREF(NOTXSCALL ST(3))
;
	int	x1 = (int)SvIV(ST(4))
;
	int	y1 = (int)SvIV(ST(5))
;
	COLORREF    color1 = SvCOLORREF(NOTXSCALL ST(6))
;
	int	x2 = (int)SvIV(ST(7))
;
	int	y2 = (int)SvIV(ST(8))
;
	COLORREF    color2 = SvCOLORREF(NOTXSCALL ST(9))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1282 "DC.xs"
    TRIVERTEX vertex[3];
    vertex[0].x     = x0;
    vertex[0].y     = y0;
    vertex[0].Red   = (COLOR16) (GetRValue(color0) << 8);;
    vertex[0].Green = (COLOR16) (GetGValue(color0) << 8);;
    vertex[0].Blue  = (COLOR16) (GetBValue(color0) << 8);;
    vertex[0].Alpha = 0x0000;

    vertex[1].x     = x1;
    vertex[1].y     = y1;
    vertex[1].Red   = (COLOR16) (GetRValue(color1) << 8);;
    vertex[1].Green = (COLOR16) (GetGValue(color1) << 8);;
    vertex[1].Blue  = (COLOR16) (GetBValue(color1) << 8);;
    vertex[1].Alpha = 0x0000;

    vertex[2].x     = x2;
    vertex[2].y     = y2; 
    vertex[2].Red   = (COLOR16) (GetRValue(color2) << 8);;
    vertex[2].Green = (COLOR16) (GetGValue(color2) << 8);;
    vertex[2].Blue  = (COLOR16) (GetBValue(color2) << 8);; 
    vertex[2].Alpha = 0x0000;

    GRADIENT_TRIANGLE gTriangle;
    gTriangle.Vertex1 = 0;
    gTriangle.Vertex2 = 1;
    gTriangle.Vertex3 = 2;

    RETVAL = GradientFill(handle, vertex, 3, &gTriangle, 1, GRADIENT_FILL_TRIANGLE);
#line 2902 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_GradientFillRectangle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GradientFillRectangle)
{
    dVAR; dXSARGS;
    if (items < 7 || items > 8)
       croak_xs_usage(cv,  "handle, x0, y0, x1, y1, color0, color1, direction=GRADIENT_FILL_RECT_H");
    {
	HDC	handle;
	int	x0 = (int)SvIV(ST(1))
;
	int	y0 = (int)SvIV(ST(2))
;
	int	x1 = (int)SvIV(ST(3))
;
	int	y1 = (int)SvIV(ST(4))
;
	COLORREF    color0 = SvCOLORREF(NOTXSCALL ST(5))
;
	COLORREF    color1 = SvCOLORREF(NOTXSCALL ST(6))
;
	int	direction;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 8)
	    direction = GRADIENT_FILL_RECT_H;
	else {
	    direction = (int)SvIV(ST(7))
;
	}
#line 1331 "DC.xs"
    if (direction!=GRADIENT_FILL_RECT_H) {
      direction = GRADIENT_FILL_RECT_V;
    }
    TRIVERTEX vertex[2] ;
    vertex[0].x     = x0;
    vertex[0].y     = y0;
    vertex[0].Red   = (COLOR16) (GetRValue(color0) << 8);
    vertex[0].Green = (COLOR16) (GetGValue(color0) << 8);
    vertex[0].Blue  = (COLOR16) (GetBValue(color0) << 8);
    vertex[0].Alpha = 0x0000;

    vertex[1].x     = x1;
    vertex[1].y     = x1; 
    vertex[1].Red   = (COLOR16) (GetRValue(color1) << 8);
    vertex[1].Green = (COLOR16) (GetGValue(color1) << 8);
    vertex[1].Blue  = (COLOR16) (GetBValue(color1) << 8);
    vertex[1].Alpha = 0x0000;

    GRADIENT_RECT gRect;
    gRect.UpperLeft  = 0;
    gRect.LowerRight = 1;

    RETVAL = GradientFill(handle, vertex, 2, &gRect, 1, direction);
#line 2974 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_GetPixel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GetPixel)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    {
	HDC	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
	COLORREF	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1366 "DC.xs"
    RETVAL = GetPixel(handle, x, y);
#line 3008 "DC.c"
	XSprePUSH;
	PUSHi((IV) RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_StretchBltMode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_StretchBltMode)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, mode=-1");
    {
	HDC	handle;
	int	mode;
	int	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 2)
	    mode = -1;
	else {
	    mode = (int)SvIV(ST(1))
;
	}
#line 1378 "DC.xs"
    if(items == 1)
        RETVAL = GetStretchBltMode(handle);
    else
        RETVAL = SetStretchBltMode(handle, mode);
#line 3049 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_DrawIcon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_DrawIcon)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "handle, Icon, x, y");
    {
	HDC	handle;
	HICON	Icon;
	int	x = (int)SvIV(ST(2))
;
	int	y = (int)SvIV(ST(3))
;
	int	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

    if(SvROK(ST(1))) {
        SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
        if(out != NULL)
            Icon = INT2PTR(HICON,SvIV(*out));
        else
            Icon = NULL;
    } else
       Icon = INT2PTR(HICON,SvIV(ST(1)))
;
#line 1396 "DC.xs"
    RETVAL = DrawIcon(handle, x, y,Icon);
#line 3094 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_SetBrushOrgEx); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_SetBrushOrgEx)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    {
	HDC	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
#line 1411 "DC.xs"
    POINT myPt;
#line 3116 "DC.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1413 "DC.xs"
    SetBrushOrgEx(handle, x, y,&myPt);
    EXTEND(SP, 2);
    XST_mIV(0, myPt.x);
    XST_mIV(1, myPt.y);
    XSRETURN(2);
#line 3133 "DC.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_GetBrushOrgEx); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_GetBrushOrgEx)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HDC	handle;
#line 1427 "DC.xs"
    POINT myPt;
#line 3149 "DC.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;
#line 1429 "DC.xs"
    GetBrushOrgEx(handle,&myPt);
    EXTEND(SP, 2);
    XST_mIV(0, myPt.x);
    XST_mIV(1, myPt.y);
    XSRETURN(2);
#line 3166 "DC.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_SetPixel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_SetPixel)
{
    dVAR; dXSARGS;
    if (items < 3 || items > 4)
       croak_xs_usage(cv,  "handle, x, y, color=(COLORREF)-1");
    {
	HDC	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
	COLORREF	color;
	COLORREF	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 4)
	    color = (COLORREF)-1;
	else {
    color = SvCOLORREF(NOTXSCALL ST(3))
;
	}
#line 1446 "DC.xs"
    if(items == 3) {
        color = GetTextColor(handle);
    }
    RETVAL = SetPixel(handle, x, y, color);
#line 3209 "DC.c"
	XSprePUSH;
	PUSHi((IV) RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_MapMode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_MapMode)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, mode=-1");
    {
	HDC	handle;
	int	mode;
	int	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 2)
	    mode = -1;
	else {
	    mode = (int)SvIV(ST(1))
;
	}
#line 1465 "DC.xs"
    if(items == 1) {
        RETVAL = GetMapMode(handle);
    } else {
        RETVAL = SetMapMode(handle, mode);
    }
#line 3251 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_Fill); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_Fill)
{
    dVAR; dXSARGS;
    if (items < 3 || items > 5)
       croak_xs_usage(cv,  "handle, x, y, color=(COLORREF) -1, type=FLOODFILLSURFACE");
    {
	HDC	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
	COLORREF	color;
	UINT	type;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 4)
	    color = (COLORREF) -1;
	else {
    color = SvCOLORREF(NOTXSCALL ST(3))
;
	}

	if (items < 5)
	    type = FLOODFILLSURFACE;
	else {
	    type = (UINT)SvUV(ST(4))
;
	}
#line 1484 "DC.xs"
    if(items == 3) {
        color = GetPixel(handle, x, y);
    }
    RETVAL = ExtFloodFill(handle, x, y, color, type);
#line 3304 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_FillRgn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_FillRgn)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, hrgn, hbr");
    {
	HDC	handle;
	HRGN	hrgn;
	HBRUSH	hbr;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

    if(SvROK(ST(1))) {
        SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
        if(out != NULL)
            hrgn = INT2PTR(HRGN,SvIV(*out));
        else
            hrgn = NULL;
    } else
       hrgn = INT2PTR(HRGN,SvIV(ST(1)))
;

    if(SvROK(ST(2))) {
        SV** out=hv_fetch((HV*)SvRV(ST(2)), "-handle", 7, 0);
        if(out != NULL)
            hbr = INT2PTR(HBRUSH,SvIV(*out));
        else
            hbr = NULL;
    } else
       hbr = INT2PTR(HBRUSH,SvIV(ST(2)))
;
#line 1504 "DC.xs"
    RETVAL = FillRgn(handle,hrgn,hbr);
#line 3356 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_InvertRgn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_InvertRgn)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, hrgn");
    {
	HDC	handle;
	HRGN	hrgn;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

    if(SvROK(ST(1))) {
        SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
        if(out != NULL)
            hrgn = INT2PTR(HRGN,SvIV(*out));
        else
            hrgn = NULL;
    } else
       hrgn = INT2PTR(HRGN,SvIV(ST(1)))
;
#line 1516 "DC.xs"
    RETVAL = InvertRgn(handle,hrgn);
#line 3397 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_PaintRgn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_PaintRgn)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, hrgn");
    {
	HDC	handle;
	HRGN	hrgn;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

    if(SvROK(ST(1))) {
        SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
        if(out != NULL)
            hrgn = INT2PTR(HRGN,SvIV(*out));
        else
            hrgn = NULL;
    } else
       hrgn = INT2PTR(HRGN,SvIV(ST(1)))
;
#line 1529 "DC.xs"
    RETVAL = PaintRgn(handle,hrgn);
#line 3438 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_FrameRgn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_FrameRgn)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "handle, hrgn, hbr, width, height");
    {
	HDC	handle;
	HRGN	hrgn;
	HBRUSH	hbr;
	int	width = (int)SvIV(ST(3))
;
	int	height = (int)SvIV(ST(4))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

    if(SvROK(ST(1))) {
        SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
        if(out != NULL)
            hrgn = INT2PTR(HRGN,SvIV(*out));
        else
            hrgn = NULL;
    } else
       hrgn = INT2PTR(HRGN,SvIV(ST(1)))
;

    if(SvROK(ST(2))) {
        SV** out=hv_fetch((HV*)SvRV(ST(2)), "-handle", 7, 0);
        if(out != NULL)
            hbr = INT2PTR(HBRUSH,SvIV(*out));
        else
            hbr = NULL;
    } else
       hbr = INT2PTR(HBRUSH,SvIV(ST(2)))
;
#line 1548 "DC.xs"
    RETVAL = FrameRgn(handle,hrgn,hbr,width,height);
#line 3494 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__DC_SelectClipRgn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__DC_SelectClipRgn)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, hrgn=NULL");
    {
	HDC	handle;
	HRGN	hrgn;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HDC,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HDC,SvIV(ST(0)))
;

	if (items < 2)
	    hrgn = NULL;
	else {
    if(SvROK(ST(1))) {
	SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
	if(out != NULL)
	    hrgn = INT2PTR(HRGN,SvIV(*out));
	else
	    hrgn = NULL;
    } else
       hrgn = INT2PTR(HRGN,SvIV(ST(1)))
;
	}
#line 1564 "DC.xs"
    RETVAL = SelectClipRgn(handle,hrgn);
#line 3539 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#pragma message( "*** PACKAGE Win32::GUI::Brush..." )

XS_EUPXS(XS_Win32__GUI__Brush_Create); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Brush_Create)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 1582 "DC.xs"
    LOGBRUSH lb;
    char *option;
    int i, next_i;
#line 3561 "DC.c"
#line 1586 "DC.xs"
    ZeroMemory(&lb, sizeof(LOGBRUSH));
    if(items == 1) {
        lb.lbStyle = BS_SOLID;
        lb.lbColor = SvCOLORREF(NOTXSCALL ST(0));
    } else {
        next_i = -1;
        for(i = 0; i < items; i++) {
            if(next_i == -1) {
                option = SvPV_nolen(ST(i));
                if(strcmp(option, "-pattern") == 0) {
                    next_i = i + 1;
                    lb.lbStyle = BS_PATTERN;
                    lb.lbHatch = (LONG_PTR) handle_From(NOTXSCALL ST(next_i));
                } else if(strcmp(option, "-hatch") == 0) {
                    next_i = i + 1;
                    lb.lbStyle = BS_HATCHED;
                    lb.lbHatch = (LONG_PTR) SvIV(ST(next_i));
                } else if(strcmp(option, "-color") == 0) {
                    next_i = i + 1;
                    lb.lbColor = SvCOLORREF(NOTXSCALL ST(next_i));
                } else if(strcmp(option, "-system") == 0) {
                    next_i = i + 1;
                    XSRETURN_IV(PTR2IV(GetSysColorBrush((int)SvIV(ST(next_i)))));
                }
            } else {
                next_i = -1;
            }
        }
    }
    XSRETURN_IV(PTR2IV(CreateBrushIndirect(&lb)));
#line 3593 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Brush_Info); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Brush_Info)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HBRUSH	handle;
#line 1625 "DC.xs"
    LOGBRUSH brush;
#line 3612 "DC.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HBRUSH,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HBRUSH,SvIV(ST(0)))
;
#line 1627 "DC.xs"
    ZeroMemory(&brush, sizeof(LOGBRUSH));
    if(GetObject((HGDIOBJ) handle, sizeof(LOGBRUSH), &brush)) {
        if(brush.lbStyle & BS_PATTERN) {
            EXTEND(SP, 4);
            XST_mPV( 0, "-pattern");
            XST_mIV( 1, brush.lbHatch);
            XST_mPV( 2, "-color");
            XST_mIV( 3, brush.lbColor);
            XSRETURN(4);
        } else if(brush.lbStyle & BS_HATCHED) {
            EXTEND(SP, 4);
            XST_mPV( 0, "-hatch");
            XST_mIV( 1, brush.lbHatch);
            XST_mPV( 2, "-color");
            XST_mIV( 3, brush.lbColor);
            XSRETURN(4);
        } else {
            EXTEND(SP, 6);
            XST_mPV( 0, "-style");
            XST_mIV( 1, brush.lbStyle);
            XST_mPV( 2, "-hatch");
            XST_mIV( 3, brush.lbHatch);
            XST_mPV( 4, "-color");
            XST_mIV( 5, brush.lbColor);
            XSRETURN(6);
        }
    } else {
        XSRETURN_UNDEF;
    }
#line 3653 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Brush_DESTROY); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Brush_DESTROY)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HBRUSH	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HBRUSH,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HBRUSH,SvIV(ST(0)))
;
#line 1663 "DC.xs"
    RETVAL = DeleteObject((HGDIOBJ) handle);
#line 3682 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#pragma message( "*** PACKAGE Win32::GUI::Pen..." )

XS_EUPXS(XS_Win32__GUI__Pen_Create); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Pen_Create)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 1680 "DC.xs"
    int penstyle;
    int penwidth;
    COLORREF pencolor;
    char *option;
    int i, next_i;
    penstyle = PS_SOLID;
    penwidth = 0;
    pencolor = RGB(0, 0, 0);
    if(items == 1) {
        pencolor = SvCOLORREF(NOTXSCALL ST(0));
    } else {
        next_i = -1;
        for(i = 0; i < items; i++) {
            if(next_i == -1) {
                option = SvPV_nolen(ST(i));
                if(strcmp(option, "-style") == 0) {
                    next_i = i + 1;
                    penstyle = (int) SvIV(ST(next_i));
                }
                if(strcmp(option, "-width") == 0) {
                    next_i = i + 1;
                    penwidth = (int) SvIV(ST(next_i));
                }
                if(strcmp(option, "-color") == 0) {
                    next_i = i + 1;
                    pencolor = SvCOLORREF(NOTXSCALL ST(next_i));
                }
            } else {
                next_i = -1;
            }
        }
    }
    XSRETURN_IV(PTR2IV(CreatePen(penstyle, penwidth, pencolor)));
#line 3734 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Pen_Info); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Pen_Info)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HPEN	handle;
#line 1722 "DC.xs"
    LOGPEN pen;
#line 3753 "DC.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HPEN,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HPEN,SvIV(ST(0)))
;
#line 1724 "DC.xs"
    ZeroMemory(&pen, sizeof(LOGPEN));
    if(GetObject((HGDIOBJ) handle, sizeof(LOGPEN), &pen)) {
        EXTEND(SP, 6);
        XST_mPV( 0, "-style");
        XST_mIV( 1, pen.lopnStyle);
        XST_mPV( 2, "-width");
        XST_mIV( 3, pen.lopnWidth.x);
        XST_mPV( 4, "-color");
        XST_mIV( 5, pen.lopnColor);
        XSRETURN(6);
    } else {
        XSRETURN_UNDEF;
    }
#line 3778 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Pen_DESTROY); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Pen_DESTROY)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HPEN	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HPEN,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HPEN,SvIV(ST(0)))
;
#line 1744 "DC.xs"
    RETVAL = DeleteObject((HGDIOBJ) handle);
#line 3807 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#pragma message( "*** PACKAGE Win32::GUI::Region..." )

XS_EUPXS(XS_Win32__GUI__Region_CreateRectRgn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_CreateRectRgn)
{
    dVAR; dXSARGS;
    if (items < 4 || items > 5)
       croak_xs_usage(cv,  "Class=\"Win32::GUI::Region\", left, top, right, bottom");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	char *	Class;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
#line 1769 "DC.xs"
    HRGN hrgn;
#line 3836 "DC.c"

	if (items < 1)
	    Class = "Win32::GUI::Region";
	else {
	    Class = (char *)SvPV_nolen(ST(0))
;
	}
#line 1771 "DC.xs"
    hrgn = CreateRectRgn(left, top, right, bottom);
    if (hrgn== NULL) XSRETURN_UNDEF;
    XPUSHs(CreateObjectWithHandle(NOTXSCALL "Win32::GUI::Region", (HWND) hrgn));
    XSRETURN(1);
#line 3849 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Region_CreateEllipticRgn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_CreateEllipticRgn)
{
    dVAR; dXSARGS;
    if (items < 4 || items > 5)
       croak_xs_usage(cv,  "Class=\"Win32::GUI::Region\", left, top, right, bottom");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	char *	Class;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
#line 1794 "DC.xs"
    HRGN hrgn;
#line 3876 "DC.c"

	if (items < 1)
	    Class = "Win32::GUI::Region";
	else {
	    Class = (char *)SvPV_nolen(ST(0))
;
	}
#line 1796 "DC.xs"
    hrgn = CreateEllipticRgn(left, top, right, bottom);
    if (hrgn== NULL) XSRETURN_UNDEF;
    XPUSHs(CreateObjectWithHandle(NOTXSCALL "Win32::GUI::Region", (HWND) hrgn));
#line 3888 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Region_CreateRoundRectRgn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_CreateRoundRectRgn)
{
    dVAR; dXSARGS;
    if (items < 6 || items > 7)
       croak_xs_usage(cv,  "Class=\"Win32::GUI::Region\", left, top, right, bottom, width, height");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	char *	Class;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
	int	width = (int)SvIV(ST(5))
;
	int	height = (int)SvIV(ST(6))
;
#line 1817 "DC.xs"
    HRGN hrgn;
#line 3919 "DC.c"

	if (items < 1)
	    Class = "Win32::GUI::Region";
	else {
	    Class = (char *)SvPV_nolen(ST(0))
;
	}
#line 1819 "DC.xs"
    hrgn = CreateRoundRectRgn(left, top, right, bottom,width,height);
    if (hrgn== NULL) XSRETURN_UNDEF;
    XPUSHs(CreateObjectWithHandle(NOTXSCALL "Win32::GUI::Region", (HWND) hrgn));
#line 3931 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Region_ExtCreateRegion); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_ExtCreateRegion)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "Class=\"Win32::GUI::Region\", svrgndata");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	char *	Class;
	SV *	svrgndata = ST(1)
;
#line 1841 "DC.xs"
    HRGN hrgn;
    LPRGNDATA rgndata;
    STRLEN len;
#line 3954 "DC.c"

	if (items < 1)
	    Class = "Win32::GUI::Region";
	else {
	    Class = (char *)SvPV_nolen(ST(0))
;
	}
#line 1845 "DC.xs"
    rgndata = (LPRGNDATA)SvPV(svrgndata, len);
    /* TODO: XFORM transformation as first param? */
    hrgn = ExtCreateRegion(NULL, (DWORD)len, rgndata);
    if (hrgn== NULL) XSRETURN_UNDEF;
    XPUSHs(CreateObjectWithHandle(NOTXSCALL "Win32::GUI::Region", (HWND) hrgn));
#line 3968 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Region_GetRegionData); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_GetRegionData)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HRGN	handle;
#line 1863 "DC.xs"
    SV *svrgndata;
    STRLEN len1, len2;
#line 3988 "DC.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HRGN,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HRGN,SvIV(ST(0)))
;
#line 1866 "DC.xs"
    len1 = (STRLEN)GetRegionData(handle, 0, NULL);
    svrgndata = sv_2mortal(newSV(len1));
    SvPOK_on(svrgndata);
    SvCUR_set(svrgndata,len1);
    len2 = (STRLEN)GetRegionData(handle, (DWORD)len1, (LPRGNDATA)SvPV_nolen(svrgndata));

    if(len1 == len2) { /* success */
        XPUSHs(svrgndata);
        XSRETURN(1);
    }
    else {             /* failure */
        XSRETURN_UNDEF;
    }
#line 4013 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Region_CombineRgn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_CombineRgn)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "destination, source1, source2, CombineMode");
    {
	HRGN	destination;
	HRGN	source1;
	HRGN	source2;
	long	CombineMode = (long)SvIV(ST(3))
;
	int	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            destination = INT2PTR(HRGN,SvIV(*out));
        else
            destination = NULL;
    } else
       destination = INT2PTR(HRGN,SvIV(ST(0)))
;

    if(SvROK(ST(1))) {
        SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
        if(out != NULL)
            source1 = INT2PTR(HRGN,SvIV(*out));
        else
            source1 = NULL;
    } else
       source1 = INT2PTR(HRGN,SvIV(ST(1)))
;

    if(SvROK(ST(2))) {
        SV** out=hv_fetch((HV*)SvRV(ST(2)), "-handle", 7, 0);
        if(out != NULL)
            source2 = INT2PTR(HRGN,SvIV(*out));
        else
            source2 = NULL;
    } else
       source2 = INT2PTR(HRGN,SvIV(ST(2)))
;
#line 1905 "DC.xs"
    RETVAL = CombineRgn(destination,source1,source2,CombineMode);
#line 4066 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Region_PtInRegion); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_PtInRegion)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    {
	HRGN	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HRGN,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HRGN,SvIV(ST(0)))
;
#line 1922 "DC.xs"
    RETVAL = PtInRegion(handle,x,y);
#line 4100 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Region_RectInRegion); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_RectInRegion)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "handle, left, top, right, bottom");
    {
	HRGN	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
#line 1944 "DC.xs"
    RECT rc;
#line 4126 "DC.c"
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HRGN,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HRGN,SvIV(ST(0)))
;
#line 1946 "DC.xs"
    rc.left = left;
    rc.top = top;
    rc.right = right;
    rc.bottom = bottom;
    RETVAL = RectInRegion(handle,&rc);
#line 4145 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Region_GetRgnBox); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_GetRgnBox)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HRGN	handle;
#line 1964 "DC.xs"
    RECT rc;
#line 4165 "DC.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HRGN,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HRGN,SvIV(ST(0)))
;
#line 1966 "DC.xs"
  GetRgnBox(handle,&rc); 
  EXTEND(SP, 4);
  XST_mIV(0, rc.left);
  XST_mIV(1, rc.top);
  XST_mIV(2, rc.right);
  XST_mIV(3, rc.bottom);
  XSRETURN(4);
#line 4184 "DC.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Region_EqualRgn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_EqualRgn)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, other");
    {
	HRGN	handle;
	HRGN	other;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HRGN,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HRGN,SvIV(ST(0)))
;

    if(SvROK(ST(1))) {
        SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
        if(out != NULL)
            other = INT2PTR(HRGN,SvIV(*out));
        else
            other = NULL;
    } else
       other = INT2PTR(HRGN,SvIV(ST(1)))
;
#line 1984 "DC.xs"
    RETVAL = EqualRgn(handle,other);
#line 4224 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Region_SetRectRgn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_SetRectRgn)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "handle, left, top, right, bottom");
    {
	HRGN	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HRGN,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HRGN,SvIV(ST(0)))
;
#line 2001 "DC.xs"
    RETVAL = SetRectRgn(handle,left, top, right, bottom);
#line 4262 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Region_OffsetRgn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_OffsetRgn)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    {
	HRGN	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
	int	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HRGN,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HRGN,SvIV(ST(0)))
;
#line 2023 "DC.xs"
    RETVAL = OffsetRgn (handle,x,y);
#line 4296 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Region_DESTROY); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Region_DESTROY)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HRGN	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HRGN,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HRGN,SvIV(ST(0)))
;
#line 2033 "DC.xs"
    RETVAL = DeleteObject((HGDIOBJ) handle);
#line 4326 "DC.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#ifdef __cplusplus
extern "C" {
#endif
XS_EXTERNAL(boot_Win32__GUI__DC); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Win32__GUI__DC)
{
#if PERL_VERSION_LE(5, 21, 5)
    dVAR; dXSARGS;
#else
    dVAR; dXSBOOTARGSXSAPIVERCHK;
#endif
#if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
    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("Win32::GUI::DC::CancelDC", XS_Win32__GUI__DC_CancelDC);
        newXS_deffile("Win32::GUI::DC::CreateCompatibleDC", XS_Win32__GUI__DC_CreateCompatibleDC);
        newXS_deffile("Win32::GUI::DC::CreateCompatibleBitmap", XS_Win32__GUI__DC_CreateCompatibleBitmap);
        newXS_deffile("Win32::GUI::DC::CreateDC", XS_Win32__GUI__DC_CreateDC);
        newXS_deffile("Win32::GUI::DC::DeleteDC", XS_Win32__GUI__DC_DeleteDC);
        newXS_deffile("Win32::GUI::DC::DeleteObject", XS_Win32__GUI__DC_DeleteObject);
        newXS_deffile("Win32::GUI::DC::GetCurrentObject", XS_Win32__GUI__DC_GetCurrentObject);
        newXS_deffile("Win32::GUI::DC::GetDC", XS_Win32__GUI__DC_GetDC);
        newXS_deffile("Win32::GUI::DC::GetDeviceCaps", XS_Win32__GUI__DC_GetDeviceCaps);
        newXS_deffile("Win32::GUI::DC::GetObjectType", XS_Win32__GUI__DC_GetObjectType);
        newXS_deffile("Win32::GUI::DC::GetStockObject", XS_Win32__GUI__DC_GetStockObject);
        newXS_deffile("Win32::GUI::DC::ReleaseDC", XS_Win32__GUI__DC_ReleaseDC);
        cv = newXS_deffile("Win32::GUI::DC::Restore", XS_Win32__GUI__DC_RestoreDC);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::DC::RestoreDC", XS_Win32__GUI__DC_RestoreDC);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::DC::Save", XS_Win32__GUI__DC_SaveDC);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::DC::SaveDC", XS_Win32__GUI__DC_SaveDC);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::DC::SelectObject", XS_Win32__GUI__DC_SelectObject);
        newXS_deffile("Win32::GUI::DC::Chord", XS_Win32__GUI__DC_Chord);
        newXS_deffile("Win32::GUI::DC::Ellipse", XS_Win32__GUI__DC_Ellipse);
        newXS_deffile("Win32::GUI::DC::Circle", XS_Win32__GUI__DC_Circle);
        newXS_deffile("Win32::GUI::DC::FillRect", XS_Win32__GUI__DC_FillRect);
        newXS_deffile("Win32::GUI::DC::FrameRect", XS_Win32__GUI__DC_FrameRect);
        newXS_deffile("Win32::GUI::DC::InvertRect", XS_Win32__GUI__DC_InvertRect);
        newXS_deffile("Win32::GUI::DC::Pie", XS_Win32__GUI__DC_Pie);
        newXS_deffile("Win32::GUI::DC::Polygon", XS_Win32__GUI__DC_Polygon);
        newXS_deffile("Win32::GUI::DC::Rectangle", XS_Win32__GUI__DC_Rectangle);
        newXS_deffile("Win32::GUI::DC::RoundRect", XS_Win32__GUI__DC_RoundRect);
        newXS_deffile("Win32::GUI::DC::DrawText", XS_Win32__GUI__DC_DrawText);
        newXS_deffile("Win32::GUI::DC::TextAlign", XS_Win32__GUI__DC_TextAlign);
        newXS_deffile("Win32::GUI::DC::TextCharacterExtra", XS_Win32__GUI__DC_TextCharacterExtra);
        newXS_deffile("Win32::GUI::DC::TextColor", XS_Win32__GUI__DC_TextColor);
        newXS_deffile("Win32::GUI::DC::GetTextExtentPoint", XS_Win32__GUI__DC_GetTextExtentPoint);
        newXS_deffile("Win32::GUI::DC::GetTextFace", XS_Win32__GUI__DC_GetTextFace);
        newXS_deffile("Win32::GUI::DC::SetTextJustification", XS_Win32__GUI__DC_SetTextJustification);
        newXS_deffile("Win32::GUI::DC::TextOut", XS_Win32__GUI__DC_TextOut);
        newXS_deffile("Win32::GUI::DC::Arc", XS_Win32__GUI__DC_Arc);
        newXS_deffile("Win32::GUI::DC::ArcDirection", XS_Win32__GUI__DC_ArcDirection);
        newXS_deffile("Win32::GUI::DC::ArcTo", XS_Win32__GUI__DC_ArcTo);
        newXS_deffile("Win32::GUI::DC::Line", XS_Win32__GUI__DC_Line);
        newXS_deffile("Win32::GUI::DC::LineTo", XS_Win32__GUI__DC_LineTo);
        newXS_deffile("Win32::GUI::DC::MoveTo", XS_Win32__GUI__DC_MoveTo);
        newXS_deffile("Win32::GUI::DC::PolyBezier", XS_Win32__GUI__DC_PolyBezier);
        newXS_deffile("Win32::GUI::DC::PolyBezierTo", XS_Win32__GUI__DC_PolyBezierTo);
        newXS_deffile("Win32::GUI::DC::Polyline", XS_Win32__GUI__DC_Polyline);
        newXS_deffile("Win32::GUI::DC::PolylineTo", XS_Win32__GUI__DC_PolylineTo);
        newXS_deffile("Win32::GUI::DC::DrawEdge", XS_Win32__GUI__DC_DrawEdge);
        newXS_deffile("Win32::GUI::DC::DrawFocusRect", XS_Win32__GUI__DC_DrawFocusRect);
        newXS_deffile("Win32::GUI::DC::DrawFrameControl", XS_Win32__GUI__DC_DrawFrameControl);
        newXS_deffile("Win32::GUI::DC::BackColor", XS_Win32__GUI__DC_BackColor);
        newXS_deffile("Win32::GUI::DC::BkMode", XS_Win32__GUI__DC_BkMode);
        newXS_deffile("Win32::GUI::DC::ROP2", XS_Win32__GUI__DC_ROP2);
        newXS_deffile("Win32::GUI::DC::GetUpdateRect", XS_Win32__GUI__DC_GetUpdateRect);
        newXS_deffile("Win32::GUI::DC::PaintDesktop", XS_Win32__GUI__DC_PaintDesktop);
        newXS_deffile("Win32::GUI::DC::Validate", XS_Win32__GUI__DC_Validate);
        newXS_deffile("Win32::GUI::DC::AbortPath", XS_Win32__GUI__DC_AbortPath);
        newXS_deffile("Win32::GUI::DC::BeginPath", XS_Win32__GUI__DC_BeginPath);
        newXS_deffile("Win32::GUI::DC::CloseFigure", XS_Win32__GUI__DC_CloseFigure);
        newXS_deffile("Win32::GUI::DC::EndPath", XS_Win32__GUI__DC_EndPath);
        newXS_deffile("Win32::GUI::DC::FillPath", XS_Win32__GUI__DC_FillPath);
        newXS_deffile("Win32::GUI::DC::FlattenPath", XS_Win32__GUI__DC_FlattenPath);
        newXS_deffile("Win32::GUI::DC::GetMiterLimit", XS_Win32__GUI__DC_GetMiterLimit);
        newXS_deffile("Win32::GUI::DC::PathToRegion", XS_Win32__GUI__DC_PathToRegion);
        newXS_deffile("Win32::GUI::DC::SetMiterLimit", XS_Win32__GUI__DC_SetMiterLimit);
        newXS_deffile("Win32::GUI::DC::StrokeAndFillPath", XS_Win32__GUI__DC_StrokeAndFillPath);
        newXS_deffile("Win32::GUI::DC::StrokePath", XS_Win32__GUI__DC_StrokePath);
        newXS_deffile("Win32::GUI::DC::WidenPath", XS_Win32__GUI__DC_WidenPath);
        newXS_deffile("Win32::GUI::DC::BitBlt", XS_Win32__GUI__DC_BitBlt);
        newXS_deffile("Win32::GUI::DC::StretchBlt", XS_Win32__GUI__DC_StretchBlt);
        newXS_deffile("Win32::GUI::DC::ExtFloodFill", XS_Win32__GUI__DC_ExtFloodFill);
        newXS_deffile("Win32::GUI::DC::FloodFill", XS_Win32__GUI__DC_FloodFill);
        newXS_deffile("Win32::GUI::DC::GradientFillTriangle", XS_Win32__GUI__DC_GradientFillTriangle);
        newXS_deffile("Win32::GUI::DC::GradientFillRectangle", XS_Win32__GUI__DC_GradientFillRectangle);
        newXS_deffile("Win32::GUI::DC::GetPixel", XS_Win32__GUI__DC_GetPixel);
        newXS_deffile("Win32::GUI::DC::StretchBltMode", XS_Win32__GUI__DC_StretchBltMode);
        newXS_deffile("Win32::GUI::DC::DrawIcon", XS_Win32__GUI__DC_DrawIcon);
        newXS_deffile("Win32::GUI::DC::SetBrushOrgEx", XS_Win32__GUI__DC_SetBrushOrgEx);
        newXS_deffile("Win32::GUI::DC::GetBrushOrgEx", XS_Win32__GUI__DC_GetBrushOrgEx);
        newXS_deffile("Win32::GUI::DC::SetPixel", XS_Win32__GUI__DC_SetPixel);
        newXS_deffile("Win32::GUI::DC::MapMode", XS_Win32__GUI__DC_MapMode);
        newXS_deffile("Win32::GUI::DC::Fill", XS_Win32__GUI__DC_Fill);
        newXS_deffile("Win32::GUI::DC::FillRgn", XS_Win32__GUI__DC_FillRgn);
        newXS_deffile("Win32::GUI::DC::InvertRgn", XS_Win32__GUI__DC_InvertRgn);
        newXS_deffile("Win32::GUI::DC::PaintRgn", XS_Win32__GUI__DC_PaintRgn);
        newXS_deffile("Win32::GUI::DC::FrameRgn", XS_Win32__GUI__DC_FrameRgn);
        newXS_deffile("Win32::GUI::DC::SelectClipRgn", XS_Win32__GUI__DC_SelectClipRgn);
        newXS_deffile("Win32::GUI::Brush::Create", XS_Win32__GUI__Brush_Create);
        newXS_deffile("Win32::GUI::Brush::Info", XS_Win32__GUI__Brush_Info);
        newXS_deffile("Win32::GUI::Brush::DESTROY", XS_Win32__GUI__Brush_DESTROY);
        newXS_deffile("Win32::GUI::Pen::Create", XS_Win32__GUI__Pen_Create);
        newXS_deffile("Win32::GUI::Pen::Info", XS_Win32__GUI__Pen_Info);
        newXS_deffile("Win32::GUI::Pen::DESTROY", XS_Win32__GUI__Pen_DESTROY);
        newXS_deffile("Win32::GUI::Region::CreateRectRgn", XS_Win32__GUI__Region_CreateRectRgn);
        newXS_deffile("Win32::GUI::Region::CreateEllipticRgn", XS_Win32__GUI__Region_CreateEllipticRgn);
        newXS_deffile("Win32::GUI::Region::CreateRoundRectRgn", XS_Win32__GUI__Region_CreateRoundRectRgn);
        newXS_deffile("Win32::GUI::Region::ExtCreateRegion", XS_Win32__GUI__Region_ExtCreateRegion);
        newXS_deffile("Win32::GUI::Region::GetRegionData", XS_Win32__GUI__Region_GetRegionData);
        newXS_deffile("Win32::GUI::Region::CombineRgn", XS_Win32__GUI__Region_CombineRgn);
        newXS_deffile("Win32::GUI::Region::PtInRegion", XS_Win32__GUI__Region_PtInRegion);
        newXS_deffile("Win32::GUI::Region::RectInRegion", XS_Win32__GUI__Region_RectInRegion);
        newXS_deffile("Win32::GUI::Region::GetRgnBox", XS_Win32__GUI__Region_GetRgnBox);
        newXS_deffile("Win32::GUI::Region::EqualRgn", XS_Win32__GUI__Region_EqualRgn);
        newXS_deffile("Win32::GUI::Region::SetRectRgn", XS_Win32__GUI__Region_SetRectRgn);
        newXS_deffile("Win32::GUI::Region::OffsetRgn", XS_Win32__GUI__Region_OffsetRgn);
        newXS_deffile("Win32::GUI::Region::DESTROY", XS_Win32__GUI__Region_DESTROY);
#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
}

#ifdef __cplusplus
}
#endif
