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

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

#include "GUI.h"

void 
ListView_onPreCreate(NOTXSPROC LPPERLWIN32GUI_CREATESTRUCT perlcs) {

    perlcs->cs.lpszClass = WC_LISTVIEW;
    perlcs->cs.style = WS_VISIBLE | WS_CHILD | WS_BORDER | LVS_REPORT | LVS_SHOWSELALWAYS;
    perlcs->cs.dwExStyle = WS_EX_CLIENTEDGE;
}

BOOL
ListView_onParseOption(NOTXSPROC char *option, SV* value, LPPERLWIN32GUI_CREATESTRUCT perlcs) {

    BOOL retval = TRUE;

    if(strcmp(option, "-align") == 0) {
        if(strcmp(SvPV_nolen(value), "left") == 0) {
            SwitchBit(perlcs->cs.style, LVS_ALIGNLEFT, 1);
            SwitchBit(perlcs->cs.style, LVS_ALIGNTOP, 0);
        } else if(strcmp(SvPV_nolen(value), "top") == 0) {
            SwitchBit(perlcs->cs.style, LVS_ALIGNLEFT, 0);
            SwitchBit(perlcs->cs.style, LVS_ALIGNTOP, 1);
        } else {
            W32G_WARN("Win32::GUI: Invalid value for -align!");
        }
    } else if(strcmp(option, "-imagelist") == 0) {
        perlcs->hImageList = (HIMAGELIST) handle_From(NOTXSCALL value);
    
    } else if BitmaskOptionValue("-report",           perlcs->cs.style, LVS_REPORT)
    } else if BitmaskOptionValue("-list",             perlcs->cs.style, LVS_LIST)
    } else if BitmaskOptionValue("-singlesel",        perlcs->cs.style, LVS_SINGLESEL)    
    } else if BitmaskOptionValue("-showselalways",    perlcs->cs.style, LVS_SHOWSELALWAYS)
    } else if BitmaskOptionValue("-sortascending",    perlcs->cs.style, LVS_SORTASCENDING)
    } else if BitmaskOptionValue("-sortdescending",   perlcs->cs.style, LVS_SORTDESCENDING)
    } else if BitmaskOptionValue("-nolabelwrap",      perlcs->cs.style, LVS_NOLABELWRAP)
    } else if BitmaskOptionValue("-autoarrange",      perlcs->cs.style, LVS_AUTOARRANGE)
    } else if BitmaskOptionValue("-editlabel",        perlcs->cs.style, LVS_EDITLABELS)
    } else if BitmaskOptionValue("-noscroll",         perlcs->cs.style, LVS_NOSCROLL)
    } else if BitmaskOptionValue("-alignleft",        perlcs->cs.style, LVS_ALIGNLEFT)
    } else if BitmaskOptionValue("-ownerdrawfixed",   perlcs->cs.style, LVS_OWNERDRAWFIXED)
    } else if BitmaskOptionValue("-nocolumnheader",   perlcs->cs.style, LVS_NOCOLUMNHEADER)
    } else if BitmaskOptionValue("-nosortheader",     perlcs->cs.style, LVS_NOSORTHEADER)
    } else if BitmaskOptionValueMask("-gridlines",        perlcs->dwFlags,  LVS_EX_GRIDLINES)
    } else if BitmaskOptionValueMask("-subitemimages",    perlcs->dwFlags,  LVS_EX_SUBITEMIMAGES)
    } else if BitmaskOptionValueMask("-checkboxes",       perlcs->dwFlags,  LVS_EX_CHECKBOXES)
    } else if BitmaskOptionValueMask("-hottrack",         perlcs->dwFlags,  LVS_EX_TRACKSELECT)
    } else if BitmaskOptionValueMask("-reordercolumns",   perlcs->dwFlags,  LVS_EX_HEADERDRAGDROP)
    } else if BitmaskOptionValueMask("-fullrowselect",    perlcs->dwFlags,  LVS_EX_FULLROWSELECT)
    } else if BitmaskOptionValueMask("-oneclickactivate", perlcs->dwFlags,  LVS_EX_ONECLICKACTIVATE)
    } else if BitmaskOptionValueMask("-twoclickactivate", perlcs->dwFlags,  LVS_EX_TWOCLICKACTIVATE)
    } else if BitmaskOptionValueMask("-flatsb",           perlcs->dwFlags,  LVS_EX_FLATSB)
    } else if BitmaskOptionValueMask("-regional",         perlcs->dwFlags,  LVS_EX_REGIONAL)
    } else if BitmaskOptionValueMask("-infotip",          perlcs->dwFlags,  LVS_EX_INFOTIP)
    } else if BitmaskOptionValueMask("-labeltip",         perlcs->dwFlags,  LVS_EX_LABELTIP) // Version 5.80
    } else if BitmaskOptionValueMask("-underlinehot",     perlcs->dwFlags,  LVS_EX_UNDERLINEHOT)
    } else if BitmaskOptionValueMask("-underlinecold",    perlcs->dwFlags,  LVS_EX_UNDERLINECOLD)
    } else if BitmaskOptionValueMask("-multiworkareas",   perlcs->dwFlags,  LVS_EX_MULTIWORKAREAS)
    } else retval = FALSE;

    return retval;
}

void
ListView_onPostCreate(NOTXSPROC HWND myhandle, LPPERLWIN32GUI_CREATESTRUCT perlcs) {

    if (perlcs->dwFlagsMask != 0)
        ListView_SetExtendedListViewStyleEx(myhandle, perlcs->dwFlagsMask, perlcs->dwFlags);

    if(perlcs->hImageList != NULL) {
        ListView_SetImageList(myhandle, perlcs->hImageList, LVSIL_NORMAL);
        ListView_SetImageList(myhandle, perlcs->hImageList, LVSIL_SMALL);
    }
    if(perlcs->clrBackground != CLR_INVALID) {
        SendMessage((HWND)myhandle, LVM_SETBKCOLOR, (WPARAM) 0, (LPARAM) perlcs->clrBackground);
        perlcs->clrBackground = CLR_INVALID;  // Don't store  
    }
}

BOOL
ListView_onParseEvent(NOTXSPROC char *name, int* eventID) {

    BOOL retval = TRUE;

         if Parse_Event("ItemChanging",   PERLWIN32GUI_NEM_CONTROL1)
    else if Parse_Event("ItemChanged",    PERLWIN32GUI_NEM_CONTROL2)
    else if Parse_Event("ItemClick",      PERLWIN32GUI_NEM_CONTROL3)
    else if Parse_Event("ItemCheck",      PERLWIN32GUI_NEM_CONTROL4)
    else if Parse_Event("ColumnClick",    PERLWIN32GUI_NEM_CONTROL5)
    else if Parse_Event("BeginLabelEdit", PERLWIN32GUI_NEM_CONTROL6)
    else if Parse_Event("EndLabelEdit",   PERLWIN32GUI_NEM_CONTROL7)
    else if Parse_Event("BeginDrag",      PERLWIN32GUI_NEM_CONTROL8)
    else if Parse_Event("KeyDown",        PERLWIN32GUI_NEM_KEYDOWN)
    else retval = FALSE;


    return retval;
}

int
ListView_onEvent (NOTXSPROC LPPERLWIN32GUI_USERDATA perlud, UINT uMsg, WPARAM wParam, LPARAM lParam) {

    int PerlResult = 1;
    LV_ITEM *pItem;

    if ( uMsg == WM_NOTIFY ) {

        LPNM_LISTVIEW lv_notify = (LPNM_LISTVIEW) lParam;

        switch(lv_notify->hdr.code) {

        // TODO :  case LVN_INSERTITEM :
        case LVN_BEGINDRAG:
        /*
         * (@)EVENT:BeginDrag(ITEM)
         * Notifies a list-view control that a drag-and-drop operation involving the left mouse 
         * button is being initiated. Passes the item being dragged.
         * (@)APPLIES_TO:ListView
         */        
          PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL8, "BeginDrag",
                       PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_notify->iItem,-1);
        break;
        /*
         * (@)EVENT:ItemChanging(ITEM, NEWSTATE, OLDSTATE, CHANGED)
         * Sent when the item is about to change state.
         * The event should return 0 to prevent the action, 1 to allow it.
         * ITEM specifies the zero-based index of the selected item.
         * NEWSTATE specifies the new item state (LVIS_).
         * OLDSTATE specifies the old item state (LVIS_).
         * CHANGED specifies the item attributes that have changed (LVIF_).
         * (@)APPLIES_TO:ListView
         */        

        case LVN_ITEMCHANGING:

            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL1, "ItemChanging",
               PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_notify->iItem,
               PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_notify->uNewState,
               PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_notify->uOldState,
               PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_notify->uChanged,
               -1);

           // Force result if event is handle
           if (perlud->dwPlStyle & PERLWIN32GUI_EVENTHANDLING) {
               perlud->forceResult = (PerlResult == 0 ? TRUE : FALSE);
               PerlResult = 0; // MsgLoop return ForceResult
           }

            break;
 
        /*
         * (@)EVENT:ItemChanged(ITEM, NEWSTATE, OLDSTATE, CHANGED)
         * Sent for any change of state of an item in the ListView.
         * ITEM specifies the zero-based index of the selected item.
         * NEWSTATE specifies the new item state (LVIS_).
         * OLDSTATE specifies the old item state (LVIS_).
         * CHANGED specifies the item attributes that have changed (LVIF_).
         * (@)APPLIES_TO:ListView
         */

        case LVN_ITEMCHANGED:

            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL2, "ItemChanged",
               PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_notify->iItem,
               PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_notify->uNewState,
               PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_notify->uOldState,
               PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_notify->uChanged,
               -1);

            if(lv_notify->uChanged & LVIF_STATE &&
               lv_notify->uNewState & LVIS_SELECTED) {
                /*
                 * (@)EVENT:ItemClick(ITEM)
                 * Sent when the user selects an item in the ListView;
                 * ITEM specifies the zero-based index of the selected item.
                 * (@)APPLIES_TO:ListView
                 */
                PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL3, "ItemClick",
                    PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_notify->iItem,
                    -1);
            }
            if(lv_notify->uChanged & LVIF_STATE &&
               (lv_notify->uOldState & LVIS_STATEIMAGEMASK) != (lv_notify->uNewState & LVIS_STATEIMAGEMASK)) {
                /*
                 * (@)EVENT:ItemCheck(ITEM)
                 * Sent when the user changes the checkbox of an item in the ListView;
                 * ITEM specifies the zero-based index of the selected item.
                 * (@)APPLIES_TO:ListView
                 */
                PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL4, "ItemCheck",
                    PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_notify->iItem,
                    -1);
            }

            break;

        // TODO : LVN_DELETEITEM :
        // TODO : LVN_ITEMACTIVATE
 
        case LVN_COLUMNCLICK:
            /*
             * (@)EVENT:ColumnClick(ITEM)
             * Sent when the user clicks on a column header in the
             * ListView; ITEM specifies the one-based index of the
             * selected column.
             * (@)APPLIES_TO:ListView
             */
            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL5, "ColumnClick",
                PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_notify->iSubItem,
                -1);

            break;

           /*
            * (@)EVENT:BeginLabelEdit(ITEM)
            * Sent when the user is about to edit the specified item of the ListView
            * The event should return 0 to prevent the action, 1 to allow it.
            *
            * For a ListView to receive this event, -editlabels need to be set to true.
            * (@)APPLIES_TO:ListView
            */        

        case LVN_BEGINLABELEDIT:
            pItem = &((LV_DISPINFO*)lParam)->item;
            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL6, "BeginLabelEdit",
                PERLWIN32GUI_ARGTYPE_LONG, (LONG) pItem->iItem,
                -1);

           // Force result if event is handle
           if (perlud->dwPlStyle & PERLWIN32GUI_EVENTHANDLING) {
               perlud->forceResult = (PerlResult == 0 ? TRUE : FALSE);
               PerlResult = 0; // MsgLoop return ForceResult
           }

            break;
 
            /*
             * (@)EVENT:EndLabelEdit(ITEM,TEXT)
             * Sent when the user has finished editing a label in the ListView control.
             * You have explicitly set the text of the item to reflect the new changes. 
             * If the user cancels the edit, the text is undef.
             * (@)APPLIES_TO:ListView
             */

        case LVN_ENDLABELEDIT: 

           pItem = &((LV_DISPINFO*)lParam)->item;
           if ( pItem->pszText != NULL) {
             PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL7, "EndLabelEdit",
                PERLWIN32GUI_ARGTYPE_LONG,   (LONG) pItem->iItem,
                PERLWIN32GUI_ARGTYPE_STRING, pItem->pszText,
                -1);
             }
           else {
             //user has canceled the edit
             PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL7, "EndLabelEdit",
                PERLWIN32GUI_ARGTYPE_LONG, (LONG) pItem->iItem,
                -1);           
           }
 
            break;

        case LVN_KEYDOWN:
            {
                LV_KEYDOWN FAR * lv_keydown = (LV_KEYDOWN FAR *) lParam;
                /*
                 * (@)EVENT:KeyDown(KEY)
                 * Sent when the user presses a key while the ListView
                 * control has focus; KEY is the ASCII code of the
                 * key being pressed.
                 * (@)APPLIES_TO:ListView
                 */
                PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_KEYDOWN, "KeyDown",
                    PERLWIN32GUI_ARGTYPE_LONG, (LONG) lv_keydown->wVKey,
                    -1);

            }
            break;
        // TODO : LVN_HOTTRACK
        }
    }

    return PerlResult;
}

#line 304 "ListView.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 448 "ListView.c"
#pragma message( "*** PACKAGE Win32::GUI::ListView..." )

XS_EUPXS(XS_Win32__GUI__ListView_ApproximateViewRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_ApproximateViewRect)
{
    dVAR; dXSARGS;
    if (items < 3 || items > 4)
       croak_xs_usage(cv,  "handle, cx, cy, icount=-1");
    {
	HWND	handle;
	int	cx = (int)SvIV(ST(1))
;
	int	cy = (int)SvIV(ST(2))
;
	int	icount;
	DWORD	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)))
;

	if (items < 4)
	    icount = -1;
	else {
	    icount = (int)SvIV(ST(3))
;
	}
#line 311 "ListView.xs"
    RETVAL = ListView_ApproximateViewRect(handle, cx, cy, icount);
#line 485 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_Arrange); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_Arrange)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, flag=LVA_DEFAULT");
    {
	HWND	handle;
	UINT	flag;
	int	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)))
;

	if (items < 2)
	    flag = LVA_DEFAULT;
	else {
	    flag = (UINT)SvUV(ST(1))
;
	}
#line 328 "ListView.xs"
    RETVAL = ListView_Arrange(handle, flag);
#line 523 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_CreateDragImage); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_CreateDragImage)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "handle, index, xcor, ycor");
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
	int	xcor = (int)SvIV(ST(2))
;
	int	ycor = (int)SvIV(ST(3))
;
#line 343 "ListView.xs"
    POINT pt;
#line 547 "ListView.c"
	HIMAGELIST	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 345 "ListView.xs"
    pt.x=xcor;
    pt.y=ycor;
    RETVAL = (HIMAGELIST) ListView_CreateDragImage(handle, index, &pt);
#line 564 "ListView.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_DeleteAllItems); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_DeleteAllItems)
{
    dVAR; dXSARGS;
    dXSI32;
    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 361 "ListView.xs"
    RETVAL = ListView_DeleteAllItems(handle);
#line 595 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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


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


XS_EUPXS(XS_Win32__GUI__ListView_EditLabel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_EditLabel)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, index");
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
	HWND	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 397 "ListView.xs"
    RETVAL = ListView_EditLabel(handle, index);
#line 691 "ListView.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_EnsureVisible); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_EnsureVisible)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, flag=TRUE");
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
	BOOL	flag;
	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)))
;

	if (items < 3)
	    flag = TRUE;
	else {
	    flag = (BOOL)SvIV(ST(2))
;
	}
#line 410 "ListView.xs"
    RETVAL = ListView_EnsureVisible(handle, index, flag);
#line 731 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_FindItem); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_FindItem)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "handle, ifrom, ...");
    {
	HWND	handle;
	int	ifrom = (int)SvIV(ST(1))
;
#line 430 "ListView.xs"
    LVFINDINFO fi;
    int i, next_i;
    char * option;
#line 753 "ListView.c"
	int	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 434 "ListView.xs"
    ZeroMemory(&fi, sizeof(LVFINDINFO));
    next_i = -1;
    for(i = 2; i < items; i++) {
        if(next_i == -1) {
            option = SvPV_nolen(ST(i));
            if(strcmp(option, "-string") == 0) {
                next_i = i + 1;
                fi.psz  = SvPV_nolen(ST(next_i));
                fi.flags |= LVFI_STRING;
            } else if(strcmp(option, "-prefix") == 0) {
                next_i = i + 1;
                SwitchBit(fi.flags, LVFI_PARTIAL, SvIV(ST(next_i)));
            } else if(strcmp(option, "-wrap") == 0) {
               next_i = i + 1;
               SwitchBit(fi.flags, LVFI_WRAP, SvIV(ST(next_i)));
            }
        } else {
            next_i = -1;
        }
    }

    RETVAL = ListView_FindItem(handle, ifrom, &fi);
#line 789 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetBkColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetBkColor)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	COLORREF	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 466 "ListView.xs"
    RETVAL = ListView_GetBkColor(handle);
#line 819 "ListView.c"
	XSprePUSH;
	PUSHi((IV) RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetBkImage); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetBkImage)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
#line 477 "ListView.xs"
    LVBKIMAGE BkImage;
    char Text [1024];
#line 838 "ListView.c"

    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 480 "ListView.xs"
    ZeroMemory(&BkImage, sizeof(LVBKIMAGE));
    ZeroMemory(Text, 1024);
    BkImage.pszImage = Text;
    BkImage.cchImageMax = 1024;
    if (ListView_GetBkImage (handle, &BkImage)) {
        EXTEND(SP, 8);
        XST_mPV( 0, "-url");
        XST_mPV( 1, BkImage.pszImage);
        XST_mPV( 2, "-tiled");
        XST_mIV( 3, (BkImage.ulFlags & LVBKIF_STYLE_TILE));
        XST_mPV( 4, "-xOffsetPercent");
        XST_mIV( 5, BkImage.xOffsetPercent);
        XST_mPV( 6, "-yOffsetPercent");
        XST_mIV( 7, BkImage.yOffsetPercent);
        XSRETURN(8);
    }
    else {
        XSRETURN_UNDEF;
    }
#line 869 "ListView.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetCallbackMask); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetCallbackMask)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	UINT	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 507 "ListView.xs"
    RETVAL = ListView_GetCallbackMask(handle);
#line 897 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


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


XS_EUPXS(XS_Win32__GUI__ListView_GetColumn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetColumn)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, iCol");
    {
	HWND	handle;
	int	iCol = (int)SvIV(ST(1))
;
#line 531 "ListView.xs"
    LVCOLUMN Column;
    char Text [1024];
#line 950 "ListView.c"

    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 534 "ListView.xs"
    ZeroMemory(&Column, sizeof(LVCOLUMN));
    Column.mask = LVCF_FMT | LVCF_IMAGE | LVCF_ORDER | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
    Column.pszText = Text;
    Column.cchTextMax = 1024;
    if (ListView_GetColumn(handle, iCol, &Column)) {
        EXTEND(SP, 14);
        XST_mPV( 0, "-text");
        XST_mPV( 1, Column.pszText);
        XST_mPV( 2, "-image");
        XST_mIV( 3, Column.iImage);
        XST_mPV( 4, "-bitmaponright");
        XST_mIV( 5, (Column.fmt & LVCFMT_BITMAP_ON_RIGHT));
        XST_mPV( 6, "-width");
        XST_mIV( 7, Column.cx);
        XST_mPV( 8, "-order");
        XST_mIV( 9, Column.iOrder);
        XST_mPV(10, "-align");
        if ( Column.fmt & LVCFMT_CENTER)
            XST_mPV(11, "center");
        else if (Column.fmt & LVCFMT_RIGHT)
            XST_mPV(11, "right");
        else
            XST_mPV(11, "left");
        XST_mPV(12, "-SubItem");
        XST_mIV(13, Column.iSubItem);
        XSRETURN(14);
    } else {
        XSRETURN_UNDEF;
    }
#line 991 "ListView.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetColumnOrderArray); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetColumnOrderArray)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
#line 571 "ListView.xs"
    int iItems, *lpiArray;
#line 1007 "ListView.c"

    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 573 "ListView.xs"
    iItems = Header_GetItemCount(ListView_GetHeader(handle));
    if (iItems >= 0) {
        lpiArray = (int*) safemalloc (iItems * sizeof(int));
        if(ListView_GetColumnOrderArray(handle, iItems, lpiArray)) {
            EXTEND(SP, iItems);
            for (int i = 0; i < iItems; i++)
                XST_mIV(i, lpiArray[i]);
            safefree (lpiArray);
            XSRETURN(iItems);
        }
        else {
            safefree (lpiArray);
            XSRETURN_UNDEF;
        }
    } else {
        XSRETURN_UNDEF;
    }
#line 1036 "ListView.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetColumnWidth); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetColumnWidth)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, index");
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
	UINT	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 599 "ListView.xs"
    RETVAL = ListView_GetColumnWidth(handle, index);
#line 1066 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetCountPerPage); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetCountPerPage)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	int	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 613 "ListView.xs"
    RETVAL = ListView_GetCountPerPage(handle);
#line 1097 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetEditControl); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetEditControl)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	HWND	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 624 "ListView.xs"
    RETVAL = ListView_GetEditControl(handle);
#line 1127 "ListView.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetExtendedListViewStyle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetExtendedListViewStyle)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	DWORD	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 635 "ListView.xs"
    RETVAL = ListView_GetExtendedListViewStyle(handle);
#line 1157 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetHeader); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetHeader)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	HWND	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 646 "ListView.xs"
    RETVAL = ListView_GetHeader(handle);
#line 1187 "ListView.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetHotCursor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetHotCursor)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	HCURSOR	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 657 "ListView.xs"
    RETVAL = ListView_GetHotCursor(handle);
#line 1217 "ListView.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetHotItem); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetHotItem)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	int	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 668 "ListView.xs"
    RETVAL = ListView_GetHotItem(handle);
#line 1247 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetHoverTime); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetHoverTime)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	DWORD	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 679 "ListView.xs"
    RETVAL = ListView_GetHoverTime(handle);
#line 1277 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetImageList); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetImageList)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, type=LVSIL_NORMAL");
    {
	HWND	handle;
	int	type;
	HIMAGELIST	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)))
;

	if (items < 2)
	    type = LVSIL_NORMAL;
	else {
	    type = (int)SvIV(ST(1))
;
	}
#line 695 "ListView.xs"
    RETVAL = ListView_GetImageList(handle,type);
#line 1315 "ListView.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetISearchString); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetISearchString)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, lpsz");
    {
	HWND	handle;
	LPTSTR	lpsz = (LPTSTR)SvPV_nolen(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(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 707 "ListView.xs"
    RETVAL = ListView_GetISearchString(handle, lpsz);
#line 1347 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetItem); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetItem)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, item, subitem=0");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	int	item = (int)SvIV(ST(1))
;
	int	subitem;
#line 731 "ListView.xs"
    LV_ITEM lv_item;
    char pszText[1024];
#line 1372 "ListView.c"

    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)))
;

	if (items < 3)
	    subitem = 0;
	else {
	    subitem = (int)SvIV(ST(2))
;
	}
#line 734 "ListView.xs"
    ZeroMemory(&lv_item, sizeof(LV_ITEM));
    lv_item.iItem = item;
    lv_item.mask = LVIF_IMAGE
                 | LVIF_PARAM
                 | LVIF_TEXT | LVIF_STATE;
    lv_item.pszText = pszText;
    lv_item.cchTextMax = 1024;
    lv_item.iSubItem = subitem;
    if(ListView_GetItem(handle, &lv_item)) {
        EXTEND(SP, 6);
        XST_mPV(0, "-text");
        XST_mPV(1, lv_item.pszText);
        XST_mPV(2, "-image");
        XST_mIV(3, lv_item.iImage);
        XST_mPV(4, "-state");
        XST_mIV(5, lv_item.state);
        XSRETURN(6);
    } else {
        XSRETURN_UNDEF;
    }
#line 1411 "ListView.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__ListView_GetItemCount); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetItemCount)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	int	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 765 "ListView.xs"
    RETVAL = ListView_GetItemCount(handle);
#line 1441 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetItemPosition); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetItemPosition)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, index");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
#line 778 "ListView.xs"
    POINT pt;
#line 1463 "ListView.c"

    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 780 "ListView.xs"
    if (ListView_GetItemPosition(handle,index,&pt) == TRUE) {
        EXTEND(SP, 2);
        XST_mIV(0, pt.x);
        XST_mIV(1, pt.y);
        XSRETURN(2);
    }
    else
        XSRETURN_UNDEF;
#line 1483 "ListView.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__ListView_GetItemRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetItemRect)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, code=LVIR_BOUNDS");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
	int	code;
#line 799 "ListView.xs"
    RECT rect;
#line 1505 "ListView.c"

    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)))
;

	if (items < 3)
	    code = LVIR_BOUNDS;
	else {
	    code = (int)SvIV(ST(2))
;
	}
#line 801 "ListView.xs"
    if (ListView_GetItemRect(handle,index,&rect,code) == TRUE) {
        EXTEND(SP, 4);
        XST_mIV(0, rect.left);
        XST_mIV(1, rect.top);
        XST_mIV(2, rect.right);
        XST_mIV(3, rect.bottom);
        XSRETURN(4);
    }
    else
        XSRETURN_UNDEF;
#line 1534 "ListView.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__ListView_GetItemSpacing); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetItemSpacing)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, flag=FALSE");
    {
	HWND	handle;
	BOOL	flag;
	DWORD	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)))
;

	if (items < 2)
	    flag = FALSE;
	else {
	    flag = (BOOL)SvIV(ST(1))
;
	}
#line 821 "ListView.xs"
    RETVAL = ListView_GetItemSpacing(handle,flag);
#line 1571 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetItemState); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetItemState)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, index, mask");
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
	UINT	mask = (UINT)SvUV(ST(2))
;
	UINT	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 846 "ListView.xs"
    RETVAL = ListView_GetItemState(handle, index, mask);
#line 1605 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetItemText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetItemText)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, subitem=0");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
	int	subitem;
#line 859 "ListView.xs"
    char Text[1024];
#line 1628 "ListView.c"

    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)))
;

	if (items < 3)
	    subitem = 0;
	else {
	    subitem = (int)SvIV(ST(2))
;
	}
#line 861 "ListView.xs"
    ZeroMemory(Text, 1024);
    ListView_GetItemText(handle, index, subitem, Text, 1024);
    EXTEND(SP, 1);
    XST_mPV(0, Text);
    XSRETURN(1);
#line 1652 "ListView.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__ListView_GetNextItem); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetNextItem)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, mask=LVNI_ALL");
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
	UINT	mask;
	UINT	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)))
;

	if (items < 3)
	    mask = LVNI_ALL;
	else {
	    mask = (UINT)SvUV(ST(2))
;
	}
#line 877 "ListView.xs"
    RETVAL = ListView_GetNextItem(handle, index, mask);
#line 1691 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetNumberOfWorkAreas); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetNumberOfWorkAreas)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, mask=LVNI_ALL");
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
#line 889 "ListView.xs"
    UINT value;
#line 1711 "ListView.c"
	UINT	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 891 "ListView.xs"
    ListView_GetNumberOfWorkAreas(handle, &value);
    RETVAL = value;
#line 1727 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetOrigin); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetOrigin)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 904 "ListView.xs"
    POINT pt;
#line 1747 "ListView.c"

    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 906 "ListView.xs"
    if (ListView_GetOrigin(handle,&pt) == TRUE) {
        EXTEND(SP, 2);
        XST_mIV(0, pt.x);
        XST_mIV(1, pt.y);
        XSRETURN(2);
    }
    else
        XSRETURN_UNDEF;
#line 1767 "ListView.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__ListView_GetSelectedCount); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetSelectedCount)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	UINT	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 925 "ListView.xs"
    RETVAL = ListView_GetSelectedCount(handle);
#line 1797 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetSelectionMark); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetSelectionMark)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	UINT	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 936 "ListView.xs"
    RETVAL = ListView_GetSelectionMark(handle);
#line 1827 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetStringWidth); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetStringWidth)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, string");
    {
	HWND	handle;
	LPCSTR	string = (LPCSTR)SvPV_nolen(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(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 949 "ListView.xs"
    RETVAL = ListView_GetStringWidth(handle, string);
#line 1859 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetSubItemRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetSubItemRect)
{
    dVAR; dXSARGS;
    if (items < 3 || items > 4)
       croak_xs_usage(cv,  "handle, index, index2, code=LVIR_BOUNDS");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
	int	index2 = (int)SvIV(ST(2))
;
	int	code;
#line 964 "ListView.xs"
    RECT rect;
#line 1884 "ListView.c"

    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)))
;

	if (items < 4)
	    code = LVIR_BOUNDS;
	else {
	    code = (int)SvIV(ST(3))
;
	}
#line 966 "ListView.xs"
    if (ListView_GetSubItemRect(handle,index,index2,code,&rect) == TRUE) {
        EXTEND(SP, 4);
        XST_mIV(0, rect.left);
        XST_mIV(1, rect.top);
        XST_mIV(2, rect.right);
        XST_mIV(3, rect.bottom);
        XSRETURN(4);
    }
    else
        XSRETURN_UNDEF;
#line 1913 "ListView.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__ListView_GetTextBkColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetTextBkColor)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	COLORREF	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 984 "ListView.xs"
    RETVAL = ListView_GetTextBkColor(handle);
#line 1942 "ListView.c"
	XSprePUSH;
	PUSHi((IV) RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetTextColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetTextColor)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	COLORREF	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 995 "ListView.xs"
    RETVAL = ListView_GetTextColor(handle);
#line 1972 "ListView.c"
	XSprePUSH;
	PUSHi((IV) RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetToolTips); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetToolTips)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	HWND	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 1006 "ListView.xs"
    RETVAL = ListView_GetToolTips(handle);
#line 2002 "ListView.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetTopIndex); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetTopIndex)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	int	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 1019 "ListView.xs"
    RETVAL = ListView_GetTopIndex(handle);
#line 2033 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetUnicodeFormat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetUnicodeFormat)
{
    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 1030 "ListView.xs"
    RETVAL = ListView_GetUnicodeFormat(handle);
#line 2063 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_GetViewRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_GetViewRect)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 1041 "ListView.xs"
    RECT rect;
#line 2083 "ListView.c"

    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 1043 "ListView.xs"
    if (ListView_GetViewRect(handle,&rect) == TRUE) {
        EXTEND(SP, 4);
        XST_mIV(0, rect.left);
        XST_mIV(1, rect.top);
        XST_mIV(2, rect.right);
        XST_mIV(3, rect.bottom);
        XSRETURN(4);
    }
    else
        XSRETURN_UNDEF;
#line 2105 "ListView.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__ListView_HitTest); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_HitTest)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	LONG	x = (LONG)SvIV(ST(1))
;
	LONG	y = (LONG)SvIV(ST(2))
;
#line 1077 "ListView.xs"
    LV_HITTESTINFO ht;
#line 2128 "ListView.c"

    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 1079 "ListView.xs"
    ht.pt.x = x;
    ht.pt.y = y;
    ListView_HitTest(handle, &ht);
    if(GIMME == G_ARRAY) {
        EXTEND(SP, 2);
        XST_mIV(0, (long) ht.iItem);
        XST_mIV(1, ht.flags);
        XSRETURN(2);
    } else {
        XSRETURN_IV((long) ht.iItem);
    }
#line 2151 "ListView.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__ListView_InsertColumn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_InsertColumn)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 1108 "ListView.xs"
    LV_COLUMN Column;
    int iCol = -1;
#line 2169 "ListView.c"
	int	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 1111 "ListView.xs"
    ZeroMemory(&Column, sizeof(LV_COLUMN));
    Column.fmt = LVCFMT_LEFT;
    Column.mask |= LVCF_FMT;
    ParseListViewColumnItemOptions(NOTXSCALL sp, mark, ax, items, 1, &Column, &iCol);
    if (iCol == -1)
      iCol = Header_GetItemCount(ListView_GetHeader(handle)) + 1;
    RETVAL = ListView_InsertColumn(handle, iCol, &Column);
#line 2190 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_InsertItem); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_InsertItem)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 1141 "ListView.xs"
    LV_ITEM Item;
    STRLEN tlen;
    int i, next_i;
    char * option;
    AV* texts;
    SV** t;
#line 2213 "ListView.c"
	int	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 1148 "ListView.xs"
    texts = NULL;
    ZeroMemory(&Item, sizeof(LV_ITEM));
    Item.iItem = ListView_GetItemCount(handle);
    next_i = -1;
    for(i = 1; i < items; i++) {
        if(next_i == -1) {
            option = SvPV_nolen(ST(i));
            if(strcmp(option, "-text") == 0) {
                next_i = i + 1;
                if(SvROK(ST(next_i)) && SvTYPE(SvRV(ST(next_i))) == SVt_PVAV) {
                    texts = (AV*)SvRV(ST(next_i));
                    t = av_fetch(texts, 0, 0);
                    if(t != NULL) {
                        Item.pszText = SvPV(*t, tlen);
                        Item.cchTextMax = tlen;
                        SwitchBit(Item.mask, LVIF_TEXT, 1);
                    }
                } else {
                    Item.pszText = SvPV(ST(next_i), tlen);
                    Item.cchTextMax = tlen;
                    SwitchBit(Item.mask, LVIF_TEXT, 1);
                }
            } else if(strcmp(option, "-item") == 0
            || strcmp(option, "-index") == 0) {
                next_i = i + 1;
                Item.iItem = (int)SvIV(ST(next_i));
            } else if(strcmp(option, "-image") == 0) {
                next_i = i + 1;
                Item.iImage = (int)SvIV(ST(next_i));
                SwitchBit(Item.mask, LVIF_IMAGE, 1);
            } else if(strcmp(option, "-selected") == 0) {
                next_i = i + 1;
                SwitchBit(Item.state, LVIS_SELECTED, SvIV(ST(next_i)));
                SwitchBit(Item.stateMask, LVIS_SELECTED, 1);
                SwitchBit(Item.mask, LVIF_STATE, 1);
            } else if(strcmp(option, "-indent") == 0) {
                next_i = i + 1;
                Item.iIndent = (int)SvIV(ST(next_i));
                SwitchBit(Item.mask, LVIF_INDENT, 1);
            }
        } else {
            next_i = -1;
        }
    }
    RETVAL = ListView_InsertItem(handle, &Item);
    if(texts != NULL) {
        for(i=1; i<=av_len(texts); i++) {
            t = av_fetch(texts, i, 0);
            if(t != NULL) {
                Item.pszText = SvPV(*t, tlen);
                Item.cchTextMax = tlen;
                SwitchBit(Item.mask, LVIF_TEXT, 1);
            }
            Item.iSubItem = i;
            ListView_SetItem(handle, &Item);
        }
    }
#line 2284 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_RedrawItems); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_RedrawItems)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, first, last");
    {
	HWND	handle;
	int	first = (int)SvIV(ST(1))
;
	int	last = (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 1217 "ListView.xs"
    RETVAL = ListView_RedrawItems(handle, first, last);
#line 2318 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_Scroll); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_Scroll)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, dx, dy");
    {
	HWND	handle;
	int	dx = (int)SvIV(ST(1))
;
	int	dy = (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 1230 "ListView.xs"
    RETVAL = ListView_Scroll(handle, dx, dy);
#line 2352 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetBkColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetBkColor)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, color");
    {
	HWND	handle;
	COLORREF    color = SvCOLORREF(NOTXSCALL 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(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 1242 "ListView.xs"
    RETVAL = ListView_SetBkColor(handle, color);
#line 2384 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetBkImage); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetBkImage)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 1263 "ListView.xs"
    LVBKIMAGE BkImage;
    STRLEN tlen;
    int i, next_i;
    char * option;
#line 2405 "ListView.c"
	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 1268 "ListView.xs"
    ZeroMemory(&BkImage, sizeof(LVBKIMAGE));
    next_i = -1;
    for(i = 1; i < items; i++) {
        if(next_i == -1) {
            option = SvPV_nolen(ST(i));
            if(strcmp(option, "-url") == 0) {
                next_i = i + 1;
                BkImage.pszImage = SvPV(ST(next_i), tlen);
                BkImage.cchImageMax = tlen;
                BkImage.ulFlags |= LVBKIF_SOURCE_URL;
            } else if(strcmp(option, "-tiled") == 0) {
                next_i = i + 1;
                BkImage.ulFlags |= (SvIV(ST(next_i)) ? LVBKIF_STYLE_TILE : LVBKIF_STYLE_NORMAL);
            } else if(strcmp(option, "-xOffsetPercent") == 0) {
                next_i = i + 1;
                BkImage.xOffsetPercent = (int)SvIV(ST(next_i));
            } else if(strcmp(option, "-yOffsetPercent") == 0) {
                next_i = i + 1;
                BkImage.yOffsetPercent = (int)SvIV(ST(next_i));
            }
        } else {
            next_i = -1;
        }
    }
    RETVAL = ListView_SetBkImage(handle, &BkImage);
#line 2444 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetCallbackMask); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetCallbackMask)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, mask");
    {
	HWND	handle;
	int	mask = (int)SvIV(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(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 1304 "ListView.xs"
    RETVAL = ListView_SetCallbackMask(handle, mask);
#line 2476 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetColumn); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetColumn)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "handle, iCol, ...");
    {
	HWND	handle;
	int	iCol = (int)SvIV(ST(1))
;
#line 1318 "ListView.xs"
    LV_COLUMN Column;
#line 2496 "ListView.c"
	int	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 1320 "ListView.xs"
    ZeroMemory(&Column, sizeof(LV_COLUMN));
    ParseListViewColumnItemOptions(NOTXSCALL sp, mark, ax, items, 2, &Column, &iCol);
    RETVAL = ListView_SetColumn(handle, iCol, &Column);
#line 2513 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetColumnOrderArray); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetColumnOrderArray)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 1333 "ListView.xs"
    int * lpiArray;
#line 2531 "ListView.c"
	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 1335 "ListView.xs"
    lpiArray = (int *) safemalloc (items * sizeof(int));
    for (int i = 1; i < items; i++)
        lpiArray[i] = (int)SvIV(ST(i));
    RETVAL = ListView_SetColumnOrderArray(handle, items-1, &lpiArray[1]);
    safefree (lpiArray);
#line 2550 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetColumnWidth); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetColumnWidth)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, column, width=-1");
    {
	HWND	handle;
	int	column = (int)SvIV(ST(1))
;
	int	width;
	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)))
;

	if (items < 3)
	    width = -1;
	else {
	    width = (int)SvIV(ST(2))
;
	}
#line 1355 "ListView.xs"
    RETVAL = ListView_SetColumnWidth(handle, column, width);
#line 2590 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetExtendedListViewStyle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetExtendedListViewStyle)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, exstyle");
    {
	HWND	handle;
	DWORD	exstyle = (DWORD)SvUV(ST(1))
;

    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 1367 "ListView.xs"
    ListView_SetExtendedListViewStyle(handle, exstyle);
#line 2620 "ListView.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__ListView_SetExtendedListViewStyleEx); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetExtendedListViewStyleEx)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, mask, exstyle");
    {
	HWND	handle;
	DWORD	mask = (DWORD)SvUV(ST(1))
;
	DWORD	exstyle = (DWORD)SvUV(ST(2))
;

    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 1378 "ListView.xs"
    ListView_SetExtendedListViewStyleEx(handle, mask, exstyle);
#line 2650 "ListView.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__ListView_SetHotCursor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetHotCursor)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, hCursor");
    {
	HWND	handle;
	HCURSOR	hCursor;
	HCURSOR	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)))
;

    if(SvROK(ST(1))) {
        SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
        if(out != NULL)
            hCursor = INT2PTR(HCURSOR,SvIV(*out));
        else
            hCursor = NULL;
    } else
       hCursor = INT2PTR(HCURSOR,SvIV(ST(1)))
;
#line 1388 "ListView.xs"
    RETVAL = ListView_SetHotCursor(handle, hCursor);
#line 2689 "ListView.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


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


XS_EUPXS(XS_Win32__GUI__ListView_SetHoverTime); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetHoverTime)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, time");
    {
	HWND	handle;
	DWORD	time = (DWORD)SvUV(ST(1))
;
	DWORD	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 1412 "ListView.xs"
    RETVAL = ListView_SetHoverTime(handle, time);
#line 2753 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetIconSpacing); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetIconSpacing)
{
    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))
;
	DWORD	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 1425 "ListView.xs"
    RETVAL = ListView_SetIconSpacing(handle, x, y);
#line 2787 "ListView.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetImageList); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetImageList)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, imagelist, type=LVSIL_NORMAL");
    {
	HWND	handle;
	HIMAGELIST	imagelist;
	WPARAM	type;
	HIMAGELIST	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)))
;

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

	if (items < 3)
	    type = LVSIL_NORMAL;
	else {
	    type = (WPARAM)SvUV(ST(2))
;
	}
#line 1445 "ListView.xs"
    RETVAL = ListView_SetImageList(handle, imagelist, type);
#line 2836 "ListView.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetItem); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetItem)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 1461 "ListView.xs"
    LV_ITEM Item;
    STRLEN tlen;
    int i, next_i;
    char * option;
#line 2858 "ListView.c"
	int	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 1466 "ListView.xs"
    ZeroMemory(&Item, sizeof(LV_ITEM));
    next_i = -1;
    for(i = 1; i < items; i++) {
        if(next_i == -1) {
            option = SvPV_nolen(ST(i));
            if(strcmp(option, "-text") == 0) {
                next_i = i + 1;
                Item.pszText = SvPV(ST(next_i), tlen);
                Item.cchTextMax = tlen;
                Item.mask = Item.mask | LVIF_TEXT;
            } else if(strcmp(option, "-item") == 0
            || strcmp(option, "-index") == 0) {
                next_i = i + 1;
                Item.iItem = (int)SvIV(ST(next_i));
            } else if(strcmp(option, "-subitem") == 0) {
                next_i = i + 1;
                Item.iSubItem = (int)SvIV(ST(next_i));
            } else if(strcmp(option, "-image") == 0) {
                next_i = i + 1;
                Item.iImage = (int)SvIV(ST(next_i));
                Item.mask = Item.mask | LVIF_IMAGE;
            }
        } else {
            next_i = -1;
        }
    }
    RETVAL = ListView_SetItem(handle, &Item);
#line 2899 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetItemCount); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetItemCount)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, count");
    {
	HWND	handle;
	int	count = (int)SvIV(ST(1))
;

    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 1504 "ListView.xs"
    ListView_SetItemCount(handle, count);
#line 2929 "ListView.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__ListView_SetItemCountEx); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetItemCountEx)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, count, flag");
    {
	HWND	handle;
	int	count = (int)SvIV(ST(1))
;
	DWORD	flag = (DWORD)SvUV(ST(2))
;

    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 1515 "ListView.xs"
    ListView_SetItemCountEx(handle, count, flag);
#line 2959 "ListView.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__ListView_SetItemPosition); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetItemPosition)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 4)
       croak_xs_usage(cv,  "handle, index, x, y");
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
	int	x = (int)SvIV(ST(2))
;
	int	y = (int)SvIV(ST(3))
;

    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 1531 "ListView.xs"
    ListView_SetItemPosition32(handle, index, x, y);
#line 2992 "ListView.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__ListView_SetItemState); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetItemState)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "handle, index, state, mask");
    {
	HWND	handle;
	UINT	index = (UINT)SvUV(ST(1))
;
	UINT	state = (UINT)SvUV(ST(2))
;
	UINT	mask = (UINT)SvUV(ST(3))
;

    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 1543 "ListView.xs"
    ListView_SetItemState(handle, index, state, mask);
#line 3024 "ListView.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__ListView_SetItemText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetItemText)
{
    dVAR; dXSARGS;
    if (items < 3 || items > 4)
       croak_xs_usage(cv,  "handle, index, texte, subitem=0");
    {
	HWND	handle;
	UINT	index = (UINT)SvUV(ST(1))
;
	LPTSTR	texte = (LPTSTR)SvPV_nolen(ST(2))
;
	UINT	subitem;

    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)))
;

	if (items < 4)
	    subitem = 0;
	else {
	    subitem = (UINT)SvUV(ST(3))
;
	}
#line 1555 "ListView.xs"
    ListView_SetItemText(handle, index, subitem, texte);
#line 3062 "ListView.c"
    }
    XSRETURN_EMPTY;
}


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


XS_EUPXS(XS_Win32__GUI__ListView_SetTextBkColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetTextBkColor)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, color");
    {
	HWND	handle;
	COLORREF    color = SvCOLORREF(NOTXSCALL 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(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 1577 "ListView.xs"
    RETVAL = ListView_SetTextBkColor(handle, color);
#line 3124 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetTextColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetTextColor)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, color");
    {
	HWND	handle;
	COLORREF    color = SvCOLORREF(NOTXSCALL 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(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 1589 "ListView.xs"
    RETVAL = ListView_SetTextColor(handle, color);
#line 3156 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetToolTips); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetToolTips)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, tooltip");
    {
	HWND	handle;
	HWND	tooltip;
	HWND	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)))
;

    if(SvROK(ST(1))) {
        SV** out=hv_fetch((HV*)SvRV(ST(1)), "-handle", 7, 0);
        if(out != NULL)
            tooltip = INT2PTR(HWND,SvIV(*out));
        else
            tooltip = NULL;
    } else
       tooltip = INT2PTR(HWND,SvIV(ST(1)))
;
#line 1601 "ListView.xs"
    if (handle && tooltip) {
			RETVAL = ListView_SetToolTips(handle, (LPARAM)(tooltip));
		} else {
			RETVAL = NULL;
		}
#line 3201 "ListView.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SetUnicodeFormat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SetUnicodeFormat)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, flag");
    {
	HWND	handle;
	BOOL	flag = (BOOL)SvIV(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(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 1617 "ListView.xs"
    RETVAL = ListView_SetUnicodeFormat(handle, flag);
#line 3233 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SubItemHitTest); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SubItemHitTest)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	LONG	x = (LONG)SvIV(ST(1))
;
	LONG	y = (LONG)SvIV(ST(2))
;
#line 1646 "ListView.xs"
    LVHITTESTINFO ht;
#line 3257 "ListView.c"

    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 1648 "ListView.xs"
    ht.pt.x = x;
    ht.pt.y = y;
    if (ListView_SubItemHitTest(handle, &ht) != -1) { 
        EXTEND(SP, 3);
        XST_mIV(0, (long) ht.iItem);
        XST_mIV(1, (long) ht.iSubItem);
        XST_mIV(2, ht.flags);
        XSRETURN(3);
    } 
    else 
        XSRETURN_UNDEF;
#line 3280 "ListView.c"
	PUTBACK;
	return;
    }
}


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


XS_EUPXS(XS_Win32__GUI__ListView_Select); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_Select)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, item");
    {
	HWND	handle;
	int	item = (int)SvIV(ST(1))
;
#line 1685 "ListView.xs"
    int iCount;
    DWORD dwStyle;
    UINT state;
    UINT mask;
#line 3334 "ListView.c"

    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 1690 "ListView.xs"
    iCount = ListView_GetItemCount(handle);
    if (item < -1 || item >= iCount) XSRETURN_UNDEF;
    if (item == -1) {  // All items
        // Get the current window style.
        dwStyle = (DWORD)GetWindowLongPtr(handle, GWL_STYLE);
        if (dwStyle & LVS_SINGLESEL) XSRETURN_UNDEF; // Not in singlesel mode
        mask = LVIS_SELECTED;
        state = 0xFFFFFFFF;    // Select all
        ListView_SetItemState(handle, (UINT) -1, state, mask);
        mask = LVIS_FOCUSED;
        state = 0;             // Remove focus from all
        ListView_SetItemState(handle, (UINT) -1, state, mask);
        state = 0xFFFFFFFF;    // Set focus to item 0
        ListView_SetItemState(handle, (UINT) 0, state, mask);
    } else {  // Specific item
        mask = LVIS_FOCUSED;
        state = 0;             // Remove focus from all
        ListView_SetItemState(handle, (UINT) -1, state, mask);
        mask = LVIS_FOCUSED | LVIS_SELECTED;
        state = 0xFFFFFFFF;    // Select and set focus to given item
        ListView_SetItemState(handle, item, state, mask);
    }
#line 3368 "ListView.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__ListView_SelectAll); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SelectAll)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
#line 1721 "ListView.xs"
    DWORD dwStyle;
    UINT state;
    UINT mask;
#line 3386 "ListView.c"

    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 1725 "ListView.xs"
    // Get the current window style.
    dwStyle = (DWORD)GetWindowLongPtr(handle, GWL_STYLE);
    if (dwStyle & LVS_SINGLESEL) XSRETURN_UNDEF; // Not in singlesel mode
    mask = LVIS_SELECTED;
    state = 0xFFFFFFFF;    // Select all
    ListView_SetItemState(handle, (UINT) -1, state, mask);
    mask = LVIS_FOCUSED;
    state = 0;             // Remove focus from all
    ListView_SetItemState(handle, (UINT) -1, state, mask);
    state = 0xFFFFFFFF;    // Set focus to item 0
    ListView_SetItemState(handle, (UINT) 0, state, mask);
#line 3409 "ListView.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__ListView_Deselect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_Deselect)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, item");
    {
	HWND	handle;
	int	item = (int)SvIV(ST(1))
;
#line 1747 "ListView.xs"
    int iCount;
    UINT state;
    UINT mask;
#line 3429 "ListView.c"

    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 1751 "ListView.xs"
    iCount = ListView_GetItemCount(handle);
    if (item < -1 || item >= iCount) XSRETURN_UNDEF;
    mask = LVIS_SELECTED;
    state = 0;                 // Deselect all
    ListView_SetItemState(handle, item, state, mask);
#line 3446 "ListView.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__ListView_DeselectAll); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_DeselectAll)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
#line 1765 "ListView.xs"
    UINT state;
    UINT mask;
#line 3463 "ListView.c"

    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 1768 "ListView.xs"
    mask = LVIS_SELECTED;
    state = 0;                 // Deselect all
    ListView_SetItemState(handle, (UINT) -1, state, mask);
#line 3478 "ListView.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__ListView_Add); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_Add)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 1781 "ListView.xs"
    LV_ITEM Item;
    STRLEN tlen;
    int item_i, i;
    char * option;
    AV* texts;
    SV** t;
    HV* itemdata;
    SV* sv_value;
    I32 retlen;
    I32 nitems;
    int iir;
#line 3504 "ListView.c"
	int	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 1793 "ListView.xs"
    RETVAL = 0;
    for(item_i = 1; item_i < items; item_i++) {
        texts = NULL;
        if(SvROK(ST(item_i)) && SvTYPE(SvRV(ST(item_i))) == SVt_PVHV) {
            ZeroMemory(&Item, sizeof(LV_ITEM));
            Item.iItem = ListView_GetItemCount(handle);
            itemdata = (HV*)SvRV(ST(item_i));
            nitems = hv_iterinit(itemdata);
            while(nitems--) {
                sv_value = hv_iternextsv(itemdata, &option, &retlen);
                if(strcmp(option, "-text") == 0) {
                    if(SvROK(sv_value) && SvTYPE(SvRV(sv_value)) == SVt_PVAV) {
                        texts = (AV*)SvRV(sv_value);
                        t = av_fetch(texts, 0, 0);
                        if(t != NULL) {
                            Item.pszText = SvPV(*t, tlen);
                            Item.cchTextMax = tlen;
                            SwitchBit(Item.mask, LVIF_TEXT, 1);
                        }
                    } else {
                        Item.pszText = SvPV(sv_value, tlen);
                        Item.cchTextMax = tlen;
                        SwitchBit(Item.mask, LVIF_TEXT, 1);
                    }
                } else if(strcmp(option, "-item") == 0
                || strcmp(option, "-index") == 0) {
                    Item.iItem = (int)SvIV(sv_value);
                } else if(strcmp(option, "-image") == 0) {
                    Item.iImage = (int)SvIV(sv_value);
                    SwitchBit(Item.mask, LVIF_IMAGE, 1);
                } else if(strcmp(option, "-selected") == 0) {
                    SwitchBit(Item.state, LVIS_SELECTED, SvIV(sv_value));
                    SwitchBit(Item.stateMask, LVIS_SELECTED, 1);
                    SwitchBit(Item.mask, LVIF_STATE, 1);
                } else if(strcmp(option, "-indent") == 0) {
                    Item.iIndent = (int)SvIV(sv_value);
                    SwitchBit(Item.mask, LVIF_INDENT, 1);
                }
            }
        }
        iir = ListView_InsertItem(handle, &Item);
        if(iir != -1) RETVAL++;
        if(texts != NULL) {
            for(i=1; i<=av_len(texts); i++) {
                t = av_fetch(texts, i, 0);
                if(t != NULL) {
                    Item.pszText = SvPV(*t, tlen);
                    Item.cchTextMax = tlen;
                    SwitchBit(Item.mask, LVIF_TEXT, 1);
                }
                Item.iSubItem = i;
                ListView_SetItem(handle, &Item);
            }
        }
        Item.iItem = ListView_GetItemCount(handle);
    }
#line 3574 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_View); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_View)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, view=(DWORD) -1");
    {
	HWND	handle;
	DWORD	view;
#line 1859 "ListView.xs"
    DWORD dwStyle;
#line 3593 "ListView.c"
	long	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)))
;

	if (items < 2)
	    view = (DWORD) -1;
	else {
	    view = (DWORD)SvUV(ST(1))
;
	}
#line 1861 "ListView.xs"
    // Get the current window style.
    dwStyle = (DWORD)GetWindowLongPtr(handle, GWL_STYLE);
    if(items == 2) {
        // Only set the window style if the view bits have changed.
        if ((dwStyle & LVS_TYPEMASK) != view)
            SetWindowLongPtr(handle, GWL_STYLE,  (dwStyle & ~LVS_TYPEMASK) | view);
        dwStyle = (DWORD)GetWindowLongPtr(handle, GWL_STYLE);
        RETVAL = (dwStyle & LVS_TYPEMASK);
    } else
        RETVAL = (dwStyle & LVS_TYPEMASK);
#line 3624 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_TextColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_TextColor)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, color=(COLORREF) -1");
    {
	HWND	handle;
	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(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;

	if (items < 2)
	    color = (COLORREF) -1;
	else {
    color = SvCOLORREF(NOTXSCALL ST(1))
;
	}
#line 1882 "ListView.xs"
    if(items == 2) {
        if(ListView_SetTextColor(handle, color))
            RETVAL = ListView_GetTextColor(handle);
        else
            RETVAL = (COLORREF) -1;
    } else
        RETVAL = ListView_GetTextColor(handle);
#line 3668 "ListView.c"
	XSprePUSH;
	PUSHi((IV) RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_TextBkColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_TextBkColor)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, color=(COLORREF) -1");
    {
	HWND	handle;
	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(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;

	if (items < 2)
	    color = (COLORREF) -1;
	else {
    color = SvCOLORREF(NOTXSCALL ST(1))
;
	}
#line 1900 "ListView.xs"
    if(items == 2) {
        if(ListView_SetTextBkColor(handle, color))
            RETVAL = ListView_GetTextBkColor(handle);
        else
            RETVAL = (COLORREF) -1;
    } else
        RETVAL = ListView_GetTextBkColor(handle);
#line 3712 "ListView.c"
	XSprePUSH;
	PUSHi((IV) RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_ColumnWidth); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_ColumnWidth)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, column, width=-1");
    {
	HWND	handle;
	int	column = (int)SvIV(ST(1))
;
	int	width;
	int	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)))
;

	if (items < 3)
	    width = -1;
	else {
	    width = (int)SvIV(ST(2))
;
	}
#line 1922 "ListView.xs"
    if(items == 2)
        RETVAL = ListView_GetColumnWidth(handle, column);
    else
        RETVAL = ListView_SetColumnWidth(handle, column, width);
#line 3755 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_ItemPosition); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_ItemPosition)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 4)
       croak_xs_usage(cv,  "handle, index, x=-1, y=-1");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
	int	x;
	int	y;
#line 1940 "ListView.xs"
    POINT p;
#line 3779 "ListView.c"

    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)))
;

	if (items < 3)
	    x = -1;
	else {
	    x = (int)SvIV(ST(2))
;
	}

	if (items < 4)
	    y = -1;
	else {
	    y = (int)SvIV(ST(3))
;
	}
#line 1942 "ListView.xs"
    if(items == 2) {
        if(ListView_GetItemPosition(handle, index, &p)) {
            EXTEND(SP, 2);
            XST_mIV(0, p.x);
            XST_mIV(1, p.y);
            XSRETURN(2);
        } else {
            XSRETURN_UNDEF;
        }
    } else {
        XSRETURN_IV(ListView_SetItemPosition(handle, index, x, y));
    }
#line 3817 "ListView.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__ListView_ItemCheck); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_ItemCheck)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, value=FALSE");
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
	BOOL	value;
#line 1964 "ListView.xs"
    // LVITEM lvitem;
#line 3837 "ListView.c"
	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)))
;

	if (items < 3)
	    value = FALSE;
	else {
	    value = (BOOL)SvIV(ST(2))
;
	}
#line 1966 "ListView.xs"
    if(items == 3) {
        RETVAL = ListView_GetCheckState(handle, index);
        ListView_SetItemState(handle, index, INDEXTOSTATEIMAGEMASK((value ? 2 : 1)), LVIS_STATEIMAGEMASK);
    } else {
        RETVAL = ListView_GetCheckState(handle, index);
    }
#line 3864 "ListView.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__ListView_SelectedItems); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__ListView_SelectedItems)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 1983 "ListView.xs"
    UINT scount;
    UINT tcount;
    int index;
#line 3886 "ListView.c"

    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 1987 "ListView.xs"
    scount = ListView_GetSelectedCount(handle);
    if(scount > 0) {
        index = -1;
        tcount = 0;
        EXTEND(SP, scount);
        index = ListView_GetNextItem(handle, index, LVNI_SELECTED);
        while(tcount < scount && index != -1) {
            XST_mIV(tcount, (long) index);
            tcount++;
            index = ListView_GetNextItem(handle, index, LVNI_SELECTED);
        }
        XSRETURN(tcount);
    } else {
        XSRETURN_EMPTY;
    }
#line 3913 "ListView.c"
	PUTBACK;
	return;
    }
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Win32__GUI__ListView); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Win32__GUI__ListView)
{
#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::ListView::ApproximateViewRect", XS_Win32__GUI__ListView_ApproximateViewRect);
        newXS_deffile("Win32::GUI::ListView::Arrange", XS_Win32__GUI__ListView_Arrange);
        newXS_deffile("Win32::GUI::ListView::CreateDragImage", XS_Win32__GUI__ListView_CreateDragImage);
        cv = newXS_deffile("Win32::GUI::ListView::Clear", XS_Win32__GUI__ListView_DeleteAllItems);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::ListView::DeleteAllItems", XS_Win32__GUI__ListView_DeleteAllItems);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::ListView::DeleteColumn", XS_Win32__GUI__ListView_DeleteColumn);
        newXS_deffile("Win32::GUI::ListView::DeleteItem", XS_Win32__GUI__ListView_DeleteItem);
        newXS_deffile("Win32::GUI::ListView::EditLabel", XS_Win32__GUI__ListView_EditLabel);
        newXS_deffile("Win32::GUI::ListView::EnsureVisible", XS_Win32__GUI__ListView_EnsureVisible);
        newXS_deffile("Win32::GUI::ListView::FindItem", XS_Win32__GUI__ListView_FindItem);
        newXS_deffile("Win32::GUI::ListView::GetBkColor", XS_Win32__GUI__ListView_GetBkColor);
        newXS_deffile("Win32::GUI::ListView::GetBkImage", XS_Win32__GUI__ListView_GetBkImage);
        newXS_deffile("Win32::GUI::ListView::GetCallbackMask", XS_Win32__GUI__ListView_GetCallbackMask);
        newXS_deffile("Win32::GUI::ListView::GetCheckState", XS_Win32__GUI__ListView_GetCheckState);
        newXS_deffile("Win32::GUI::ListView::GetColumn", XS_Win32__GUI__ListView_GetColumn);
        newXS_deffile("Win32::GUI::ListView::GetColumnOrderArray", XS_Win32__GUI__ListView_GetColumnOrderArray);
        newXS_deffile("Win32::GUI::ListView::GetColumnWidth", XS_Win32__GUI__ListView_GetColumnWidth);
        cv = newXS_deffile("Win32::GUI::ListView::GetCountPerPage", XS_Win32__GUI__ListView_GetCountPerPage);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::ListView::VisibleCount", XS_Win32__GUI__ListView_GetCountPerPage);
        XSANY.any_i32 = 1;
        newXS_deffile("Win32::GUI::ListView::GetEditControl", XS_Win32__GUI__ListView_GetEditControl);
        newXS_deffile("Win32::GUI::ListView::GetExtendedListViewStyle", XS_Win32__GUI__ListView_GetExtendedListViewStyle);
        newXS_deffile("Win32::GUI::ListView::GetHeader", XS_Win32__GUI__ListView_GetHeader);
        newXS_deffile("Win32::GUI::ListView::GetHotCursor", XS_Win32__GUI__ListView_GetHotCursor);
        newXS_deffile("Win32::GUI::ListView::GetHotItem", XS_Win32__GUI__ListView_GetHotItem);
        newXS_deffile("Win32::GUI::ListView::GetHoverTime", XS_Win32__GUI__ListView_GetHoverTime);
        newXS_deffile("Win32::GUI::ListView::GetImageList", XS_Win32__GUI__ListView_GetImageList);
        newXS_deffile("Win32::GUI::ListView::GetISearchString", XS_Win32__GUI__ListView_GetISearchString);
        cv = newXS_deffile("Win32::GUI::ListView::GetItem", XS_Win32__GUI__ListView_GetItem);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::ListView::ItemInfo", XS_Win32__GUI__ListView_GetItem);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::ListView::Count", XS_Win32__GUI__ListView_GetItemCount);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::ListView::GetItemCount", XS_Win32__GUI__ListView_GetItemCount);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::ListView::GetItemPosition", XS_Win32__GUI__ListView_GetItemPosition);
        newXS_deffile("Win32::GUI::ListView::GetItemRect", XS_Win32__GUI__ListView_GetItemRect);
        newXS_deffile("Win32::GUI::ListView::GetItemSpacing", XS_Win32__GUI__ListView_GetItemSpacing);
        newXS_deffile("Win32::GUI::ListView::GetItemState", XS_Win32__GUI__ListView_GetItemState);
        newXS_deffile("Win32::GUI::ListView::GetItemText", XS_Win32__GUI__ListView_GetItemText);
        newXS_deffile("Win32::GUI::ListView::GetNextItem", XS_Win32__GUI__ListView_GetNextItem);
        newXS_deffile("Win32::GUI::ListView::GetNumberOfWorkAreas", XS_Win32__GUI__ListView_GetNumberOfWorkAreas);
        newXS_deffile("Win32::GUI::ListView::GetOrigin", XS_Win32__GUI__ListView_GetOrigin);
        cv = newXS_deffile("Win32::GUI::ListView::GetSelectedCount", XS_Win32__GUI__ListView_GetSelectedCount);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::ListView::SelectCount", XS_Win32__GUI__ListView_GetSelectedCount);
        XSANY.any_i32 = 1;
        newXS_deffile("Win32::GUI::ListView::GetSelectionMark", XS_Win32__GUI__ListView_GetSelectionMark);
        newXS_deffile("Win32::GUI::ListView::GetStringWidth", XS_Win32__GUI__ListView_GetStringWidth);
        newXS_deffile("Win32::GUI::ListView::GetSubItemRect", XS_Win32__GUI__ListView_GetSubItemRect);
        newXS_deffile("Win32::GUI::ListView::GetTextBkColor", XS_Win32__GUI__ListView_GetTextBkColor);
        newXS_deffile("Win32::GUI::ListView::GetTextColor", XS_Win32__GUI__ListView_GetTextColor);
        newXS_deffile("Win32::GUI::ListView::GetToolTips", XS_Win32__GUI__ListView_GetToolTips);
        cv = newXS_deffile("Win32::GUI::ListView::GetFirstVisible", XS_Win32__GUI__ListView_GetTopIndex);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::ListView::GetTopIndex", XS_Win32__GUI__ListView_GetTopIndex);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::ListView::GetUnicodeFormat", XS_Win32__GUI__ListView_GetUnicodeFormat);
        newXS_deffile("Win32::GUI::ListView::GetViewRect", XS_Win32__GUI__ListView_GetViewRect);
        newXS_deffile("Win32::GUI::ListView::HitTest", XS_Win32__GUI__ListView_HitTest);
        newXS_deffile("Win32::GUI::ListView::InsertColumn", XS_Win32__GUI__ListView_InsertColumn);
        newXS_deffile("Win32::GUI::ListView::InsertItem", XS_Win32__GUI__ListView_InsertItem);
        newXS_deffile("Win32::GUI::ListView::RedrawItems", XS_Win32__GUI__ListView_RedrawItems);
        newXS_deffile("Win32::GUI::ListView::Scroll", XS_Win32__GUI__ListView_Scroll);
        newXS_deffile("Win32::GUI::ListView::SetBkColor", XS_Win32__GUI__ListView_SetBkColor);
        newXS_deffile("Win32::GUI::ListView::SetBkImage", XS_Win32__GUI__ListView_SetBkImage);
        newXS_deffile("Win32::GUI::ListView::SetCallbackMask", XS_Win32__GUI__ListView_SetCallbackMask);
        newXS_deffile("Win32::GUI::ListView::SetColumn", XS_Win32__GUI__ListView_SetColumn);
        newXS_deffile("Win32::GUI::ListView::SetColumnOrderArray", XS_Win32__GUI__ListView_SetColumnOrderArray);
        newXS_deffile("Win32::GUI::ListView::SetColumnWidth", XS_Win32__GUI__ListView_SetColumnWidth);
        newXS_deffile("Win32::GUI::ListView::SetExtendedListViewStyle", XS_Win32__GUI__ListView_SetExtendedListViewStyle);
        newXS_deffile("Win32::GUI::ListView::SetExtendedListViewStyleEx", XS_Win32__GUI__ListView_SetExtendedListViewStyleEx);
        newXS_deffile("Win32::GUI::ListView::SetHotCursor", XS_Win32__GUI__ListView_SetHotCursor);
        newXS_deffile("Win32::GUI::ListView::SetHotItem", XS_Win32__GUI__ListView_SetHotItem);
        newXS_deffile("Win32::GUI::ListView::SetHoverTime", XS_Win32__GUI__ListView_SetHoverTime);
        newXS_deffile("Win32::GUI::ListView::SetIconSpacing", XS_Win32__GUI__ListView_SetIconSpacing);
        newXS_deffile("Win32::GUI::ListView::SetImageList", XS_Win32__GUI__ListView_SetImageList);
        cv = newXS_deffile("Win32::GUI::ListView::ChangeItem", XS_Win32__GUI__ListView_SetItem);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::ListView::SetItem", XS_Win32__GUI__ListView_SetItem);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::ListView::SetItemCount", XS_Win32__GUI__ListView_SetItemCount);
        newXS_deffile("Win32::GUI::ListView::SetItemCountEx", XS_Win32__GUI__ListView_SetItemCountEx);
        cv = newXS_deffile("Win32::GUI::ListView::MoveItem", XS_Win32__GUI__ListView_SetItemPosition);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::ListView::SetItemPosition", XS_Win32__GUI__ListView_SetItemPosition);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::ListView::SetItemState", XS_Win32__GUI__ListView_SetItemState);
        newXS_deffile("Win32::GUI::ListView::SetItemText", XS_Win32__GUI__ListView_SetItemText);
        newXS_deffile("Win32::GUI::ListView::SetSelectionMark", XS_Win32__GUI__ListView_SetSelectionMark);
        newXS_deffile("Win32::GUI::ListView::SetTextBkColor", XS_Win32__GUI__ListView_SetTextBkColor);
        newXS_deffile("Win32::GUI::ListView::SetTextColor", XS_Win32__GUI__ListView_SetTextColor);
        newXS_deffile("Win32::GUI::ListView::SetToolTips", XS_Win32__GUI__ListView_SetToolTips);
        newXS_deffile("Win32::GUI::ListView::SetUnicodeFormat", XS_Win32__GUI__ListView_SetUnicodeFormat);
        newXS_deffile("Win32::GUI::ListView::SubItemHitTest", XS_Win32__GUI__ListView_SubItemHitTest);
        newXS_deffile("Win32::GUI::ListView::Update", XS_Win32__GUI__ListView_Update);
        newXS_deffile("Win32::GUI::ListView::Select", XS_Win32__GUI__ListView_Select);
        newXS_deffile("Win32::GUI::ListView::SelectAll", XS_Win32__GUI__ListView_SelectAll);
        newXS_deffile("Win32::GUI::ListView::Deselect", XS_Win32__GUI__ListView_Deselect);
        newXS_deffile("Win32::GUI::ListView::DeselectAll", XS_Win32__GUI__ListView_DeselectAll);
        newXS_deffile("Win32::GUI::ListView::Add", XS_Win32__GUI__ListView_Add);
        newXS_deffile("Win32::GUI::ListView::View", XS_Win32__GUI__ListView_View);
        newXS_deffile("Win32::GUI::ListView::TextColor", XS_Win32__GUI__ListView_TextColor);
        newXS_deffile("Win32::GUI::ListView::TextBkColor", XS_Win32__GUI__ListView_TextBkColor);
        newXS_deffile("Win32::GUI::ListView::ColumnWidth", XS_Win32__GUI__ListView_ColumnWidth);
        newXS_deffile("Win32::GUI::ListView::ItemPosition", XS_Win32__GUI__ListView_ItemPosition);
        newXS_deffile("Win32::GUI::ListView::ItemCheck", XS_Win32__GUI__ListView_ItemCheck);
        newXS_deffile("Win32::GUI::ListView::SelectedItems", XS_Win32__GUI__ListView_SelectedItems);
#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
}

