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

#line 1 "ImageList.xs"
    /*
    ###########################################################################
    # (@)PACKAGE:Win32::GUI::ImageList
    #
    # $Id: ImageList.xs,v 1.10 2006/03/16 23:14:31 robertemay Exp $
    #
    ###########################################################################
    */

#include "GUI.h"

    // TODO : Some methods is missing for MinGW

#line 24 "ImageList.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 168 "ImageList.c"
#pragma message( "*** PACKAGE Win32::GUI::ImageList..." )

XS_EUPXS(XS_Win32__GUI__ImageList_AddBitmap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_AddBitmap)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, bitmap, bitmapMask=NULL");
    {
	HIMAGELIST	handle;
	HBITMAP	bitmap;
	HBITMAP	bitmapMask;
	int	RETVAL;
	dXSTARG;

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

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

	if (items < 3)
	    bitmapMask = NULL;
	else {
    if(SvROK(ST(2))) {
	SV** out=hv_fetch((HV*)SvRV(ST(2)), "-handle", 7, 0);
	if(out != NULL)
	    bitmapMask = INT2PTR(HBITMAP,SvIV(*out));
	else
	    bitmapMask = NULL;
    } else
       bitmapMask = INT2PTR(HBITMAP,SvIV(ST(2)))
;
	}
#line 30 "ImageList.xs"
    RETVAL = ImageList_Add(handle, bitmap, bitmapMask);
#line 219 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_AddBitmapMasked); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_AddBitmapMasked)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, bitmap, color");
    {
	HIMAGELIST	handle;
	HBITMAP	bitmap;
	COLORREF    color = SvCOLORREF(NOTXSCALL 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(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;

    if(SvROK(ST(1))) {
        SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
        if(out != NULL)
            bitmap = INT2PTR(HBITMAP,SvIV(*out));
        else
            bitmap = NULL;
    } else
       bitmap = INT2PTR(HBITMAP,SvIV(ST(1)))
;
#line 44 "ImageList.xs"
    RETVAL = ImageList_AddMasked(handle, bitmap, color);
#line 262 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_BeginDrag); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_BeginDrag)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "handle, index, x, y");
    {
	HIMAGELIST	handle;
	int	index = (int)SvIV(ST(1))
;
	int	x = (int)SvIV(ST(2))
;
	int	y = (int)SvIV(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(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 58 "ImageList.xs"
    RETVAL = ImageList_BeginDrag(handle, index, x, y);
#line 298 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_Copy); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_Copy)
{
    dVAR; dXSARGS;
    if (items < 3 || items > 4)
       croak_xs_usage(cv,  "handle, iDest, iSrc, flag=ILCF_MOVE");
    {
	HIMAGELIST	handle;
	int	iDest = (int)SvIV(ST(1))
;
	int	iSrc = (int)SvIV(ST(2))
;
	UINT	flag;
	BOOL	RETVAL;
	dXSTARG;

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

	if (items < 4)
	    flag = ILCF_MOVE;
	else {
	    flag = (UINT)SvUV(ST(3))
;
	}
#line 72 "ImageList.xs"
    // Not supported in MinGW w32api package prior to v3.2
#ifdef W32G_BROKENW32API
    W32G_WARN_UNSUPPORTED("ImageList_Copy missing from build");
    RETVAL = FALSE;
#else
    RETVAL = ImageList_Copy(handle, iDest, handle, iSrc, flag);
#endif
#line 346 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_Create); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_Create)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "cx, cy, flags, cInitial, cGrow");
    {
	int	cx = (int)SvIV(ST(0))
;
	int	cy = (int)SvIV(ST(1))
;
	UINT	flags = (UINT)SvUV(ST(2))
;
	int	cInitial = (int)SvIV(ST(3))
;
	int	cGrow = (int)SvIV(ST(4))
;
	HIMAGELIST	RETVAL;
	dXSTARG;
#line 94 "ImageList.xs"
    RETVAL = ImageList_Create(cx, cy, flags, cInitial, cGrow);
#line 375 "ImageList.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 105 "ImageList.xs"
    RETVAL = ImageList_Destroy(handle);
#line 405 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_Draw); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_Draw)
{
    dVAR; dXSARGS;
    if (items < 5 || items > 6)
       croak_xs_usage(cv,  "handle, index, dc, x, y, flag=ILD_NORMAL");
    {
	HIMAGELIST	handle;
	int	index = (int)SvIV(ST(1))
;
	HDC	dc;
	int	x = (int)SvIV(ST(3))
;
	int	y = (int)SvIV(ST(4))
;
	UINT	flag;
	BOOL	RETVAL;
	dXSTARG;

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

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

	if (items < 6)
	    flag = ILD_NORMAL;
	else {
	    flag = (UINT)SvUV(ST(5))
;
	}
#line 121 "ImageList.xs"
    RETVAL = ImageList_Draw(handle, index, dc, x, y, flag);
#line 460 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_DrawEx); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_DrawEx)
{
    dVAR; dXSARGS;
    if (items < 9 || items > 10)
       croak_xs_usage(cv,  "handle, index, dc, x, y, dx, dy, color1, color2, flag=ILD_NORMAL");
    {
	HIMAGELIST	handle;
	int	index = (int)SvIV(ST(1))
;
	HDC	dc;
	int	x = (int)SvIV(ST(3))
;
	int	y = (int)SvIV(ST(4))
;
	int	dx = (int)SvIV(ST(5))
;
	int	dy = (int)SvIV(ST(6))
;
	COLORREF    color1 = SvCOLORREF(NOTXSCALL ST(7))
;
	COLORREF    color2 = SvCOLORREF(NOTXSCALL ST(8))
;
	UINT	flag;
	BOOL	RETVAL;
	dXSTARG;

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

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

	if (items < 10)
	    flag = ILD_NORMAL;
	else {
	    flag = (UINT)SvUV(ST(9))
;
	}
#line 142 "ImageList.xs"
    RETVAL = ImageList_DrawEx(handle, index, dc, x, y, dx, dy, color1, color2, flag);
#line 523 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_DrawIndirect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_DrawIndirect)
{
    dVAR; dXSARGS;
    if (items < 11 || items > 13)
       croak_xs_usage(cv,  "handle, index, dc, x, y, cx, cy, xBitmap, yBitmap, color1, color2, flag=ILD_NORMAL, rop=SRCCOPY");
    {
	HIMAGELIST	handle;
	int	index = (int)SvIV(ST(1))
;
	HDC	dc;
	int	x = (int)SvIV(ST(3))
;
	int	y = (int)SvIV(ST(4))
;
	int	cx = (int)SvIV(ST(5))
;
	int	cy = (int)SvIV(ST(6))
;
	int	xBitmap = (int)SvIV(ST(7))
;
	int	yBitmap = (int)SvIV(ST(8))
;
	COLORREF    color1 = SvCOLORREF(NOTXSCALL ST(9))
;
	COLORREF    color2 = SvCOLORREF(NOTXSCALL ST(10))
;
	UINT	flag;
	DWORD	rop;
#line 165 "ImageList.xs"
    IMAGELISTDRAWPARAMS param;
#line 562 "ImageList.c"
	BOOL	RETVAL;
	dXSTARG;

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

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

	if (items < 12)
	    flag = ILD_NORMAL;
	else {
	    flag = (UINT)SvUV(ST(11))
;
	}

	if (items < 13)
	    rop = SRCCOPY;
	else {
	    rop = (DWORD)SvUV(ST(12))
;
	}
#line 167 "ImageList.xs"
    param.cbSize  = sizeof(IMAGELISTDRAWPARAMS);
    param.himl    = handle;
    param.i       = index;
    param.hdcDst  = dc;
    param.x       = x;
    param.y       = y;
    param.cx      = cx;
    param.cy      = cy;
    param.xBitmap = xBitmap;
    param.yBitmap = yBitmap;
    param.rgbBk   = color1;
    param.rgbFg   = color2;
    param.fStyle  = flag;
    param.dwRop   = rop;

    // Not supported in MinGW w32api package prior to v3.2
#ifdef W32G_BROKENW32API
    W32G_WARN_UNSUPPORTED("ImageList_DrawIndirect missing from build");
    RETVAL = FALSE;
#else
    RETVAL = ImageList_DrawIndirect(&param);
#endif
#line 622 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_Duplicate); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_Duplicate)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HIMAGELIST	handle;
#line 199 "ImageList.xs"
    HIMAGELIST  hdup;
#line 642 "ImageList.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 201 "ImageList.xs"
    // Not supported in MinGW w32api package prior to v3.2
#ifdef W32G_BROKENW32API
    W32G_WARN_UNSUPPORTED("ImageList_Duplicate missing from build");
    XSRETURN_UNDEF;
#else
    hdup = ImageList_Duplicate(handle);
    if (hdup == NULL) XSRETURN_UNDEF;
    XPUSHs(CreateObjectWithHandle(NOTXSCALL "Win32::GUI::ImageList", (HWND) hdup));
    XSRETURN(1);
#endif
#line 664 "ImageList.c"
	PUTBACK;
	return;
    }
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 219 "ImageList.xs"
    RETVAL = ImageList_GetBkColor(handle);
#line 693 "ImageList.c"
	XSprePUSH;
	PUSHi((IV) RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_GetIcon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_GetIcon)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, flags=ILD_NORMAL");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HIMAGELIST	handle;
	int	index = (int)SvIV(ST(1))
;
	UINT	flags;
#line 232 "ImageList.xs"
    HICON hicon;
#line 716 "ImageList.c"

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

	if (items < 3)
	    flags = ILD_NORMAL;
	else {
	    flags = (UINT)SvUV(ST(2))
;
	}
#line 234 "ImageList.xs"
    hicon = ImageList_GetIcon(handle, index, flags);
    if (hicon == NULL) XSRETURN_UNDEF;
    XPUSHs(CreateObjectWithHandle(NOTXSCALL "Win32::GUI::Icon", (HWND) hicon));
    XSRETURN(1);
#line 739 "ImageList.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__ImageList_GetIconSize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_GetIconSize)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HIMAGELIST	handle;
#line 246 "ImageList.xs"
    int cx;
    int cy;
#line 759 "ImageList.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 249 "ImageList.xs"
    if(ImageList_GetIconSize(handle, &cx, &cy)) {
        EXTEND(SP, 2);
        XST_mIV(0, cx);
        XST_mIV(1, cy);
        XSRETURN(2);
    } else
        XSRETURN_UNDEF;
#line 778 "ImageList.c"
	PUTBACK;
	return;
    }
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 267 "ImageList.xs"
    RETVAL = ImageList_GetImageCount(handle);
#line 808 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_LoadImage); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_LoadImage)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2 || items > 7)
       croak_xs_usage(cv,  "pbmp, cx, uFlags=LR_LOADFROMFILE, uType=IMAGE_BITMAP, crMask=CLR_DEFAULT, hi=NULL, cGrow=1");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	SV*	pbmp = ST(0)
;
	int	cx = (int)SvIV(ST(1))
;
	UINT	uFlags;
	UINT	uType;
	COLORREF	crMask;
	HINSTANCE	hi;
	int	cGrow;
#line 289 "ImageList.xs"
    HIMAGELIST  handle;
    LPCTSTR lpbmp;
#line 838 "ImageList.c"

	if (items < 3)
	    uFlags = LR_LOADFROMFILE;
	else {
	    uFlags = (UINT)SvUV(ST(2))
;
	}

	if (items < 4)
	    uType = IMAGE_BITMAP;
	else {
	    uType = (UINT)SvUV(ST(3))
;
	}

	if (items < 5)
	    crMask = CLR_DEFAULT;
	else {
    crMask = SvCOLORREF(NOTXSCALL ST(4))
;
	}

	if (items < 6)
	    hi = NULL;
	else {
	    hi = INT2PTR(HINSTANCE,SvIV(ST(5)))
;
	}

	if (items < 7)
	    cGrow = 1;
	else {
	    cGrow = (int)SvIV(ST(6))
;
	}
#line 292 "ImageList.xs"
    if (SvPOK(pbmp))
        lpbmp = SvPV_nolen(pbmp);
    else
        lpbmp = MAKEINTRESOURCE(SvIV(pbmp));
    handle = ImageList_LoadImage(hi, lpbmp, cx, cGrow, crMask, uType, uFlags);
    if (handle == NULL) XSRETURN_UNDEF;
    XPUSHs(CreateObjectWithHandle(NOTXSCALL "Win32::GUI::ImageList", (HWND) handle));
    XSRETURN(1);
#line 883 "ImageList.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__ImageList_Merge); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_Merge)
{
    dVAR; dXSARGS;
    if (items < 5 || items > 6)
       croak_xs_usage(cv,  "handle, i1, i2, dx, dy, handle2=handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HIMAGELIST	handle;
	int	i1 = (int)SvIV(ST(1))
;
	int	i2 = (int)SvIV(ST(2))
;
	int	dx = (int)SvIV(ST(3))
;
	int	dy = (int)SvIV(ST(4))
;
	HIMAGELIST	handle2;
#line 314 "ImageList.xs"
    HIMAGELIST  hnew;
#line 911 "ImageList.c"

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

	if (items < 6)
	    handle2 = handle;
	else {
    if(SvROK(ST(5))) {
	SV** out=hv_fetch((HV*)SvRV(ST(5)), "-handle", 7, 0);
	if(out != NULL)
	    handle2 = INT2PTR(HIMAGELIST,SvIV(*out));
	else
	    handle2 = NULL;
    } else
       handle2 = INT2PTR(HIMAGELIST,SvIV(ST(5)))
;
	}
#line 316 "ImageList.xs"
    hnew = ImageList_Merge(handle,i1,handle2,i2,dx,dy);
    if (hnew == NULL) XSRETURN_UNDEF;
    XPUSHs(CreateObjectWithHandle(NOTXSCALL "Win32::GUI::ImageList", (HWND) hnew));
    XSRETURN(1);       
#line 941 "ImageList.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__ImageList_Remove); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_Remove)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, index");
    {
	HIMAGELIST	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(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 331 "ImageList.xs"
    RETVAL = ImageList_Remove(handle, index);
#line 972 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_Replace); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_Replace)
{
    dVAR; dXSARGS;
    if (items < 3 || items > 4)
       croak_xs_usage(cv,  "handle, index, bitmap, bitmapMask=NULL");
    {
	HIMAGELIST	handle;
	int	index = (int)SvIV(ST(1))
;
	HBITMAP	bitmap;
	HBITMAP	bitmapMask;
	int	RETVAL;
	dXSTARG;

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

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

	if (items < 4)
	    bitmapMask = NULL;
	else {
    if(SvROK(ST(3))) {
	SV** out=hv_fetch((HV*)SvRV(ST(3)), "-handle", 7, 0);
	if(out != NULL)
	    bitmapMask = INT2PTR(HBITMAP,SvIV(*out));
	else
	    bitmapMask = NULL;
    } else
       bitmapMask = INT2PTR(HBITMAP,SvIV(ST(3)))
;
	}
#line 346 "ImageList.xs"
    RETVAL = ImageList_Replace(handle, index, bitmap, bitmapMask);
#line 1030 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_ReplaceIcon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_ReplaceIcon)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, index, icon");
    {
	HIMAGELIST	handle;
	int	index = (int)SvIV(ST(1))
;
	HICON	icon;
	int	RETVAL;
	dXSTARG;

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

    if(SvROK(ST(2))) {
        SV** out=hv_fetch((HV*)SvRV(ST(2)), "-handle", 7, 0);
        if(out != NULL)
            icon = INT2PTR(HICON,SvIV(*out));
        else
            icon = NULL;
    } else
       icon = INT2PTR(HICON,SvIV(ST(2)))
;
#line 360 "ImageList.xs"
    RETVAL = ImageList_ReplaceIcon(handle, index, icon);
#line 1073 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_SetBkColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_SetBkColor)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, color");
    {
	HIMAGELIST	handle;
	COLORREF    color = SvCOLORREF(NOTXSCALL ST(1))
;
	COLORREF	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 372 "ImageList.xs"
    RETVAL = ImageList_SetBkColor(handle, color);
#line 1105 "ImageList.c"
	XSprePUSH;
	PUSHi((IV) RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_SetDragCursorImage); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_SetDragCursorImage)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "handle, index, x, y");
    {
	HIMAGELIST	handle;
	int	index = (int)SvIV(ST(1))
;
	int	x = (int)SvIV(ST(2))
;
	int	y = (int)SvIV(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(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 387 "ImageList.xs"
    RETVAL = ImageList_SetDragCursorImage(handle, index, x, y);
#line 1141 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_SetIconSize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_SetIconSize)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    {
	HIMAGELIST	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(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 400 "ImageList.xs"
    RETVAL = ImageList_SetIconSize(handle, x, y);
#line 1175 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_SetImageCount); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_SetImageCount)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, count");
    {
	HIMAGELIST	handle;
	UINT	count = (UINT)SvUV(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(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 412 "ImageList.xs"
    RETVAL = ImageList_SetImageCount(handle, count);
#line 1207 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_SetOverlayImage); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_SetOverlayImage)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, index, overlay");
    {
	HIMAGELIST	handle;
	int	index = (int)SvIV(ST(1))
;
	int	overlay = (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(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 425 "ImageList.xs"
    RETVAL = ImageList_SetOverlayImage(handle, index, overlay);
#line 1241 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_AddIcon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_AddIcon)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, icon");
    {
	HIMAGELIST	handle;
	HICON	icon;
	int	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,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 439 "ImageList.xs"
    RETVAL = ImageList_AddIcon(handle, icon);
#line 1282 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 453 "ImageList.xs"
    RETVAL = ImageList_RemoveAll(handle);
#line 1313 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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

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

	if (items < 2)
	    color = (COLORREF) -1;
	else {
    color = SvCOLORREF(NOTXSCALL ST(1))
;
	}
#line 469 "ImageList.xs"
    if(items == 2) {
        RETVAL = ImageList_SetBkColor(handle, color);
    } else
        RETVAL = ImageList_GetBkColor(handle);
#line 1354 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_Size); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_Size)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HIMAGELIST	handle;
#line 487 "ImageList.xs"
    int cx, cy;
    BOOL result;
#line 1375 "ImageList.c"

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 490 "ImageList.xs"
    if(items != 1 && items != 3)
        croak("Usage: Size(handle);\n   or: Size(handle, x, y);\n");
    if(items == 1) {
        if(ImageList_GetIconSize(handle, &cx, &cy)) {
            EXTEND(SP, 2);
            XST_mIV(0, cx);
            XST_mIV(1, cy);
            XSRETURN(2);
        } else
            XSRETURN_UNDEF;
    } else {
        result = ImageList_SetIconSize(handle, (int) SvIV(ST(1)), (int) SvIV(ST(2)));
        EXTEND(SP, 1);
        XST_mIV(0, result);
        XSRETURN(1);
    }
#line 1403 "ImageList.c"
	PUTBACK;
	return;
    }
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HIMAGELIST,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HIMAGELIST,SvIV(ST(0)))
;
#line 513 "ImageList.xs"
    RETVAL = ImageList_Destroy(handle);
#line 1432 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_DragEnter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_DragEnter)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    {
	HWND	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(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 533 "ImageList.xs"
    RETVAL = ImageList_DragEnter(handle, x, y);
#line 1466 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_DragLeave); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_DragLeave)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	BOOL	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 547 "ImageList.xs"
    RETVAL = ImageList_DragLeave(handle);
#line 1496 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_DragMove); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_DragMove)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "x, y");
    {
	int	x = (int)SvIV(ST(0))
;
	int	y = (int)SvIV(ST(1))
;
	BOOL	RETVAL;
	dXSTARG;
#line 562 "ImageList.xs"
    RETVAL = ImageList_DragMove(x, y);
#line 1519 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_DragShowNolock); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_DragShowNolock)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "flag");
    {
	BOOL	flag = (BOOL)SvIV(ST(0))
;
	BOOL	RETVAL;
	dXSTARG;
#line 575 "ImageList.xs"
    RETVAL = ImageList_DragShowNolock(flag);
#line 1540 "ImageList.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ImageList_EndDrag); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_EndDrag)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
#line 587 "ImageList.xs"
    ImageList_EndDrag();
#line 1557 "ImageList.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__ImageList_GetDragImage); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ImageList_GetDragImage)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	HIMAGELIST	RETVAL;
	dXSTARG;
#line 597 "ImageList.xs"
    RETVAL = ImageList_GetDragImage(NULL,NULL);
#line 1574 "ImageList.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Win32__GUI__ImageList); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Win32__GUI__ImageList)
{
#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::ImageList::AddBitmap", XS_Win32__GUI__ImageList_AddBitmap);
        newXS_deffile("Win32::GUI::ImageList::AddBitmapMasked", XS_Win32__GUI__ImageList_AddBitmapMasked);
        newXS_deffile("Win32::GUI::ImageList::BeginDrag", XS_Win32__GUI__ImageList_BeginDrag);
        newXS_deffile("Win32::GUI::ImageList::Copy", XS_Win32__GUI__ImageList_Copy);
        newXS_deffile("Win32::GUI::ImageList::Create", XS_Win32__GUI__ImageList_Create);
        newXS_deffile("Win32::GUI::ImageList::Destroy", XS_Win32__GUI__ImageList_Destroy);
        newXS_deffile("Win32::GUI::ImageList::Draw", XS_Win32__GUI__ImageList_Draw);
        newXS_deffile("Win32::GUI::ImageList::DrawEx", XS_Win32__GUI__ImageList_DrawEx);
        newXS_deffile("Win32::GUI::ImageList::DrawIndirect", XS_Win32__GUI__ImageList_DrawIndirect);
        newXS_deffile("Win32::GUI::ImageList::Duplicate", XS_Win32__GUI__ImageList_Duplicate);
        newXS_deffile("Win32::GUI::ImageList::GetBkColor", XS_Win32__GUI__ImageList_GetBkColor);
        newXS_deffile("Win32::GUI::ImageList::GetIcon", XS_Win32__GUI__ImageList_GetIcon);
        newXS_deffile("Win32::GUI::ImageList::GetIconSize", XS_Win32__GUI__ImageList_GetIconSize);
        cv = newXS_deffile("Win32::GUI::ImageList::Count", XS_Win32__GUI__ImageList_GetImageCount);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::ImageList::GetImageCount", XS_Win32__GUI__ImageList_GetImageCount);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::ImageList::LoadImage", XS_Win32__GUI__ImageList_LoadImage);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::ImageList::newFromImage", XS_Win32__GUI__ImageList_LoadImage);
        XSANY.any_i32 = 1;
        newXS_deffile("Win32::GUI::ImageList::Merge", XS_Win32__GUI__ImageList_Merge);
        newXS_deffile("Win32::GUI::ImageList::Remove", XS_Win32__GUI__ImageList_Remove);
        newXS_deffile("Win32::GUI::ImageList::Replace", XS_Win32__GUI__ImageList_Replace);
        newXS_deffile("Win32::GUI::ImageList::ReplaceIcon", XS_Win32__GUI__ImageList_ReplaceIcon);
        newXS_deffile("Win32::GUI::ImageList::SetBkColor", XS_Win32__GUI__ImageList_SetBkColor);
        newXS_deffile("Win32::GUI::ImageList::SetDragCursorImage", XS_Win32__GUI__ImageList_SetDragCursorImage);
        newXS_deffile("Win32::GUI::ImageList::SetIconSize", XS_Win32__GUI__ImageList_SetIconSize);
        newXS_deffile("Win32::GUI::ImageList::SetImageCount", XS_Win32__GUI__ImageList_SetImageCount);
        newXS_deffile("Win32::GUI::ImageList::SetOverlayImage", XS_Win32__GUI__ImageList_SetOverlayImage);
        newXS_deffile("Win32::GUI::ImageList::AddIcon", XS_Win32__GUI__ImageList_AddIcon);
        cv = newXS_deffile("Win32::GUI::ImageList::Clear", XS_Win32__GUI__ImageList_RemoveAll);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::ImageList::RemoveAll", XS_Win32__GUI__ImageList_RemoveAll);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::ImageList::BackColor", XS_Win32__GUI__ImageList_BackColor);
        newXS_deffile("Win32::GUI::ImageList::Size", XS_Win32__GUI__ImageList_Size);
        newXS_deffile("Win32::GUI::ImageList::DESTROY", XS_Win32__GUI__ImageList_DESTROY);
        newXS_deffile("Win32::GUI::ImageList::DragEnter", XS_Win32__GUI__ImageList_DragEnter);
        newXS_deffile("Win32::GUI::ImageList::DragLeave", XS_Win32__GUI__ImageList_DragLeave);
        newXS_deffile("Win32::GUI::ImageList::DragMove", XS_Win32__GUI__ImageList_DragMove);
        newXS_deffile("Win32::GUI::ImageList::DragShowNolock", XS_Win32__GUI__ImageList_DragShowNolock);
        newXS_deffile("Win32::GUI::ImageList::EndDrag", XS_Win32__GUI__ImageList_EndDrag);
        newXS_deffile("Win32::GUI::ImageList::GetDragImage", XS_Win32__GUI__ImageList_GetDragImage);
#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
}

