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

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

#include "GUI.h"

void 
Toolbar_onPreCreate(NOTXSPROC LPPERLWIN32GUI_CREATESTRUCT perlcs) {

    perlcs->cs.lpszClass = TOOLBARCLASSNAME;
    perlcs->cs.style = WS_VISIBLE | WS_CHILD;
}

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

    BOOL retval = TRUE;

    if(strcmp(option, "-imagelist") == 0) {        
        perlcs->hImageList = (HIMAGELIST) handle_From(NOTXSCALL value);
    }
    else if(strcmp(option, "-tooltip") == 0) {
        perlcs->hTooltip = (HWND) handle_From(NOTXSCALL value);        
    } else if BitmaskOptionValue("-adjustable",  perlcs->cs.style, CCS_ADJUSTABLE)
    } else if BitmaskOptionValue("-altdrag",     perlcs->cs.style, TBSTYLE_ALTDRAG )
    } else if BitmaskOptionValue("-flat",        perlcs->cs.style, TBSTYLE_FLAT)
    } else if BitmaskOptionValue("-list",        perlcs->cs.style, TBSTYLE_LIST)
    } else if BitmaskOptionValue("-transparent", perlcs->cs.style, TBSTYLE_TRANSPARENT)
    } else if BitmaskOptionValue("-nodivider",   perlcs->cs.style, CCS_NODIVIDER)
    } else if BitmaskOptionValue("-multiline",   perlcs->cs.style, TBSTYLE_WRAPABLE)
    } else retval = FALSE;

    return retval;
}

void
Toolbar_onPostCreate(NOTXSPROC HWND myhandle, LPPERLWIN32GUI_CREATESTRUCT perlcs) {

    SendMessage(myhandle, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0);
    if(perlcs->hImageList != NULL)
        SendMessage(myhandle, TB_SETIMAGELIST, 0, (LPARAM) perlcs->hImageList);
    if(perlcs->hTooltip != NULL)
        SendMessage(myhandle, TB_SETTOOLTIPS, (WPARAM) perlcs->hTooltip, (LPARAM) 0);
}

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

    BOOL retval = TRUE;

         if Parse_Event("ButtonClick",   PERLWIN32GUI_NEM_CONTROL1)
    else retval = FALSE;

    return retval;
}

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

    int PerlResult = 1;

    switch (uMsg) {
    case WM_COMMAND :
        /*
         * (@)EVENT:ButtonClick(INDEX,[DROPDOWN = 1])
         * Sent when the user presses a button of the Toolbar
         * the INDEX argument identifies the zero-based index of
         * the pressed button. If the button clicked should expand a
         * dropdown menu, then there is a second argument that is
         * set to 1.
         * (@)APPLIES_TO:Toolbar
         */
        PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL1, "ButtonClick",
            PERLWIN32GUI_ARGTYPE_LONG, (LONG) LOWORD(wParam),
            PERLWIN32GUI_ARGTYPE_LONG, 0,
            -1);

        break;

    case WM_NOTIFY :
        {        
            LPNMTOOLBAR tbn = (LPNMTOOLBAR) lParam;

            switch(tbn->hdr.code) {
            case TBN_DROPDOWN:
                PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL1, "ButtonClick",
                    PERLWIN32GUI_ARGTYPE_LONG, (LONG) tbn->iItem,
                    PERLWIN32GUI_ARGTYPE_LONG, 1,
                    -1);
                break;
            }
        }
    }

    return PerlResult;
}

#line 113 "Toolbar.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 257 "Toolbar.c"
#pragma message( "*** PACKAGE Win32::GUI::Toolbar..." )

XS_EUPXS(XS_Win32__GUI__Toolbar_AddBitmap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_AddBitmap)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, bitmap, numbuttons");
    {
	HWND	handle;
	HBITMAP	bitmap;
	WPARAM	numbuttons = (WPARAM)SvUV(ST(2))
;
#line 124 "Toolbar.xs"
    TBADDBITMAP TbAddBitmap;
    HIMAGELIST imagelist;
    LPPERLWIN32GUI_USERDATA perlud;
    BOOL hasBitmaps = 0;
#line 276 "Toolbar.c"
	LRESULT	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)
            bitmap = INT2PTR(HBITMAP,SvIV(*out));
        else
            bitmap = NULL;
    } else
       bitmap = INT2PTR(HBITMAP,SvIV(ST(1)))
;
#line 129 "Toolbar.xs"
    TbAddBitmap.hInst = (HINSTANCE) NULL;
    TbAddBitmap.nID = (UINT_PTR) bitmap;

    perlud = (LPPERLWIN32GUI_USERDATA) GetWindowLongPtr((HWND) handle, GWLP_USERDATA);
    if( ValidUserData(perlud) )  {
        hasBitmaps = (BOOL)(perlud->dwPlStyle & PERLWIN32GUI_TB_HASBITMAPS);
    }

    imagelist = (HIMAGELIST) SendMessage(handle, TB_GETIMAGELIST, 0, 0);
    if(imagelist && !hasBitmaps) {
        CROAK("AddBitmap() cannot be used when the toolbar has imagelist set");
        XSRETURN_UNDEF;
    }

    if( ValidUserData(perlud) )  {
        perlud->dwPlStyle |= PERLWIN32GUI_TB_HASBITMAPS;
    }

    RETVAL = SendMessage(handle, TB_ADDBITMAP, numbuttons,
                         (LPARAM) (LPTBADDBITMAP) &TbAddBitmap);
#line 320 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_AddButtons); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_AddButtons)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "handle, number, ...");
    {
	HWND	handle;
	int	number = (int)SvIV(ST(1))
;
#line 192 "Toolbar.xs"
    LPTBBUTTON buttons;
    int i, q, b;
#line 341 "Toolbar.c"
	LRESULT	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 195 "Toolbar.xs"
    if(items != (2 + number * 5)) {
        CROAK("AddButtons: wrong number of parameters (expected %d, got %d)!\n", 2+number*5, items);
    }
    buttons = (LPTBBUTTON) safemalloc(sizeof(TBBUTTON)*number);
    q = 0;
    b = 0;
    for(i = 2; i < items; i++) {
        switch(q) {
        case 0:
            buttons[b].iBitmap = (int) SvIV(ST(i));
            break;
        case 1:
            buttons[b].idCommand = (int) SvIV(ST(i));
            break;
        case 2:
            buttons[b].fsState = (BYTE) SvIV(ST(i));
            break;
        case 3:
            buttons[b].fsStyle = (BYTE) SvIV(ST(i));
            break;
        case 4:
            buttons[b].iString = (int) SvIV(ST(i));
        }
        q++;
        if(q == 5) {
            buttons[b].dwData = 0;
            q = 0;
            b++;
        }
    }
    RETVAL = SendMessage(handle, TB_ADDBUTTONS,
                         (WPARAM) number,
                         (LPARAM) (LPTBBUTTON) buttons);
    safefree(buttons);
#line 389 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_AddString); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_AddString)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, string");
    {
	HWND	handle;
	char *	string = (char *)SvPV_nolen(ST(1))
;
#line 239 "Toolbar.xs"
    char *Strings;
    STRLEN szLen, totLen;
#line 410 "Toolbar.c"
	LRESULT	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 242 "Toolbar.xs"
    totLen = 0;
    // only one string allowed
    Strings = SvPV(ST(1), szLen);
    Strings = (char *) safemalloc(szLen+2);
    strcpy(Strings, string);
    Strings[szLen+1] = '\0';
#ifdef PERLWIN32GUI_DEBUG
        printf("XS(Toolbar::AddString): Strings='%s', len=%d\n", Strings, szLen);
#endif
#ifdef PERLWIN32GUI_DEBUG
        printf("XS(Toolbar::AddString): handle=0x%x\n", handle);
        printf("XS(Toolbar::AddString): Strings=0x%x\n", Strings);
#endif
    RETVAL = SendMessage(handle, TB_ADDSTRING, 0, (LPARAM) Strings);
#ifdef PERLWIN32GUI_DEBUG
        printf("XS(Toolbar::AddString): SendMessage.result=%ld", RETVAL);
#endif
    safefree(Strings);
#line 442 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_AutoSize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_AutoSize)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	LRESULT	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 295 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_AUTOSIZE, 0, 0);
#line 472 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_ButtonCount); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_ButtonCount)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	LRESULT	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 306 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_BUTTONCOUNT, 0, 0);
#line 502 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_ButtonStructSize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_ButtonStructSize)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	LRESULT	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 317 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0);
#line 532 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_ChangeBitmap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_ChangeBitmap)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, button, bitmap");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	HBITMAP	bitmap;
#line 332 "Toolbar.xs"
    HIMAGELIST imagelist;
#line 553 "Toolbar.c"
	LRESULT	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(2))) {
        SV** out=hv_fetch((HV*)SvRV(ST(2)), "-handle", 7, 0);
        if(out != NULL)
            bitmap = INT2PTR(HBITMAP,SvIV(*out));
        else
            bitmap = NULL;
    } else
       bitmap = INT2PTR(HBITMAP,SvIV(ST(2)))
;
#line 334 "Toolbar.xs"
    imagelist = (HIMAGELIST) SendMessage(handle, TB_GETIMAGELIST, 0, 0);
    if(imagelist != NULL) {
        CROAK("ChangeBitmap() should not be used when toolbar has imagelist set");
        XSRETURN_UNDEF;
    }
    RETVAL = SendMessage(handle, TB_CHANGEBITMAP, (WPARAM) button, (LPARAM) bitmap);
#line 583 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_CheckButton); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_CheckButton)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, button, checked");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	BOOL	checked = (BOOL)SvIV(ST(2))
;
	LRESULT	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 354 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_CHECKBUTTON, (WPARAM) button, (LPARAM) MAKELONG(checked,0));
#line 617 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_CommandToIndex); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_CommandToIndex)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, value");
    {
	HWND	handle;
	WPARAM	value = (WPARAM)SvUV(ST(1))
;
	LRESULT	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 366 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_COMMANDTOINDEX, value, 0);
#line 649 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_Customize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_Customize)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	LRESULT	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 377 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_CUSTOMIZE, 0, 0);
#line 679 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_DeleteButton); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_DeleteButton)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	LRESULT	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 390 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_DELETEBUTTON, (WPARAM) button, (LPARAM) 0);
#line 711 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_EnableButton); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_EnableButton)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, button, enable");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	BOOL	enable = (BOOL)SvIV(ST(2))
;
	LRESULT	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 403 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_ENABLEBUTTON, (WPARAM) button, (LPARAM) MAKELONG(enable,0));
#line 745 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetAnchorHighlight); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetAnchorHighlight)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	LRESULT	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 414 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_GETANCHORHIGHLIGHT, 0, 0);
#line 775 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetBitmap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetBitmap)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	LRESULT	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 426 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_GETBITMAP, (WPARAM) button, 0);
#line 807 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetBitmapFlags); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetBitmapFlags)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	LRESULT	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 438 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_GETBITMAPFLAGS, 0, 0);
#line 837 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetButton); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetButton)
{
    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 451 "Toolbar.xs"
    TBBUTTON button;
#line 859 "Toolbar.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 453 "Toolbar.xs"
    ZeroMemory(&button, sizeof(TBBUTTON));
    if (SendMessage(handle, TB_GETBUTTON, (WPARAM) index, (LPARAM) &button)) {
        EXTEND(SP, 5);   
        XST_mIV(0, button.iBitmap);
        XST_mIV(1, button.idCommand);
        XST_mIV(2, button.fsState);
        XST_mIV(3, button.fsStyle);
        XST_mIV(4, button.iString);
        XSRETURN(5);
    }
    else
        XSRETURN_UNDEF;
#line 883 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetButtonInfo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetButtonInfo)
{
    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 474 "Toolbar.xs"
    TBBUTTONINFO button;
    char Text[1024];
#line 905 "Toolbar.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 477 "Toolbar.xs"
    ZeroMemory(&button, sizeof(TBBUTTONINFO));
    ZeroMemory(Text, 1024);
    button.cbSize = sizeof(TBBUTTONINFO);
    button.dwMask = TBIF_COMMAND | TBIF_IMAGE | TBIF_LPARAM | TBIF_SIZE | TBIF_STATE | TBIF_STYLE | TBIF_TEXT;
    button.pszText = Text;
    button.cchText = 1024;
    if (SendMessage(handle, TB_GETBUTTONINFO, (WPARAM) index, (LPARAM) &button) != -1) {
        EXTEND(SP, 28);   
        XST_mPV( 0, "-command");
        XST_mIV( 1, button.idCommand);
        XST_mPV( 2, "-image");
        XST_mIV( 3, button.iImage);
        XST_mPV( 4, "-state");
        XST_mIV( 5, button.fsState);
        XST_mPV( 6, "-style");
        XST_mIV( 7, button.fsStyle);
        XST_mPV( 8, "-text");
        XST_mPV( 9, button.pszText);
        XST_mPV(10, "-width");
        XST_mIV(11, button.cx);
        XST_mPV(12, "-checked");
        XST_mIV(13, (button.fsState & TBSTATE_CHECKED)==TBSTATE_CHECKED);
        XST_mPV(14, "-ellipses");
        XST_mIV(15, (button.fsState & TBSTATE_ELLIPSES)==TBSTATE_ELLIPSES);
        XST_mPV(16, "-enabled");
        XST_mIV(17, (button.fsState & TBSTATE_ENABLED)==TBSTATE_ENABLED);
        XST_mPV(18, "-hidden");
        XST_mIV(19, (button.fsState & TBSTATE_HIDDEN)==TBSTATE_HIDDEN);
        XST_mPV(20, "-grayed");
        XST_mIV(21, (button.fsState & TBSTATE_INDETERMINATE)==TBSTATE_INDETERMINATE);
        XST_mPV(22, "-marked");
        XST_mIV(23, (button.fsState & TBSTATE_MARKED)==TBSTATE_MARKED);
        XST_mPV(24, "-pressed");
        XST_mIV(25, (button.fsState & TBSTATE_PRESSED)==TBSTATE_PRESSED);
        XST_mPV(26, "-wrap");
        XST_mIV(27, (button.fsState & TBSTATE_WRAP)==TBSTATE_WRAP);
        XSRETURN(28);
    }
    else
        XSRETURN_UNDEF;
#line 957 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetButtonSize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetButtonSize)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 525 "Toolbar.xs"
    LRESULT res;
#line 976 "Toolbar.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 527 "Toolbar.xs"
    res = SendMessage(handle, TB_GETBUTTONSIZE, 0, 0);
    EXTEND(SP, 2);
    XST_mIV(0, LOWORD(res));
    XST_mIV(1, HIWORD(res));    
    XSRETURN(2);
#line 993 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetButtonText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetButtonText)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	WPARAM	button = (WPARAM)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 541 "Toolbar.xs"
    int res = (int) SendMessage(handle, TB_GETBUTTONTEXT, button, (LPARAM) NULL);
    if (res > 0) {
        char * szString = (char *) safemalloc (res+1);
        res = (int) SendMessage(handle, TB_GETBUTTONTEXT, button, (LPARAM) szString);
        szString[res] = '\0';
        EXTEND(SP, 1);
        XST_mPV(0, szString);
        safefree(szString);
        XSRETURN(1);
    }
    else
        XSRETURN_UNDEF;
#line 1035 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetColorScheme); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetColorScheme)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 565 "Toolbar.xs"
    COLORSCHEME colorscheme;
#line 1054 "Toolbar.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 567 "Toolbar.xs"
    ZeroMemory(&colorscheme, sizeof(COLORSCHEME));
    colorscheme.dwSize = sizeof(COLORSCHEME);
    if (SendMessage(handle, TB_GETCOLORSCHEME , (WPARAM) 0, (LPARAM) &colorscheme) ) {
        EXTEND(SP, 4);
        XST_mPV( 0, "-clrBtnHighlight");
        XST_mIV( 1, (LONG) colorscheme.clrBtnHighlight);
        XST_mPV( 2, "-clrBtnShadow");
        XST_mIV( 3, (LONG) colorscheme.clrBtnShadow );
        XSRETURN(4);
    }
    else {
        XSRETURN_UNDEF;
    }
#line 1079 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetDisabledImageList); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetDisabledImageList)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	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 590 "Toolbar.xs"
    RETVAL = (HIMAGELIST) SendMessage(handle, TB_GETDISABLEDIMAGELIST, 0, 0);
#line 1108 "Toolbar.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetHotImageList); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetHotImageList)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	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 603 "Toolbar.xs"
    RETVAL = (HIMAGELIST) SendMessage(handle, TB_GETHOTIMAGELIST, 0, 0);
#line 1138 "Toolbar.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetHotItem); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetHotItem)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	LRESULT	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 614 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_GETHOTITEM, 0, 0);
#line 1168 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetImageList); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetImageList)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	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 627 "Toolbar.xs"
    RETVAL = (HIMAGELIST) SendMessage(handle, TB_GETIMAGELIST, 0, 0);
#line 1198 "Toolbar.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetInsertMark); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetInsertMark)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 638 "Toolbar.xs"
    TBINSERTMARK im;
#line 1218 "Toolbar.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 640 "Toolbar.xs"
    if (SendMessage(handle, TB_GETINSERTMARK, 0, (LPARAM) &im)) {
        EXTEND(SP, 2);
        XST_mIV(0, im.iButton);
        XST_mIV(1, im.dwFlags);
        XSRETURN(2);
    }
    else
        XSRETURN_UNDEF;
#line 1238 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetInsertMarkColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetInsertMarkColor)
{
    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 657 "Toolbar.xs"
    RETVAL = (COLORREF) SendMessage(handle, TB_GETINSERTMARKCOLOR, 0, 0);
#line 1267 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV) RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetItemRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetItemRect)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	WPARAM	button = (WPARAM)SvUV(ST(1))
;
#line 669 "Toolbar.xs"
    RECT myRect;
#line 1289 "Toolbar.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 671 "Toolbar.xs"
    if (SendMessage(handle, TB_GETITEMRECT, button, (LPARAM) &myRect)) {
        EXTEND(SP, 4);
        XST_mIV(0, myRect.left);
        XST_mIV(1, myRect.top);
        XST_mIV(2, myRect.right);
        XST_mIV(3, myRect.bottom);
        XSRETURN(4);
    }
    else
        XSRETURN_UNDEF;
#line 1311 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetMaxSize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetMaxSize)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 693 "Toolbar.xs"
        SIZE size;
#line 1331 "Toolbar.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 695 "Toolbar.xs"
    if( SendMessage(handle, TB_GETMAXSIZE, 0, (LPARAM) &size) ) {
        EXTEND(SP, 2);
        XST_mIV(0, size.cx);
        XST_mIV(1, size.cy);
        XSRETURN(2);
    } 
    else 
        XSRETURN_UNDEF;
#line 1351 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetPadding); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetPadding)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	LRESULT	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 713 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_GETPADDING, 0, 0);
#line 1380 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetRect)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	WPARAM	button = (WPARAM)SvUV(ST(1))
;
#line 725 "Toolbar.xs"
    RECT myRect;
#line 1402 "Toolbar.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 727 "Toolbar.xs"
    if (SendMessage(handle, TB_GETRECT, button, (LPARAM) &myRect)) {
        EXTEND(SP, 4);
        XST_mIV(0, myRect.left);
        XST_mIV(1, myRect.top);
        XST_mIV(2, myRect.right);
        XST_mIV(3, myRect.bottom);
        XSRETURN(4);
    }
    else
        XSRETURN_UNDEF;
#line 1424 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetRows); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetRows)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	LRESULT	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 745 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_GETROWS, 0, 0);
#line 1453 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetState); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetState)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    {
	HWND	handle;
	WPARAM	button = (WPARAM)SvUV(ST(1))
;
	LRESULT	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 757 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_GETSTATE, button, 0);
#line 1485 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetString); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetString)
{
    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))
;

    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 769 "Toolbar.xs"
    char * szString = (char *) safemalloc (1024);
    int res = (int) SendMessage(handle, TB_GETSTRING, (WPARAM) MAKEWPARAM (1024, index), (LPARAM) (LPTSTR) (szString));
    if(res != -1) {
      szString[1024-1] = '\0';
      EXTEND(SP, 1);
      XST_mPV(0, szString);
      safefree(szString);
      XSRETURN(1);
    } else {
      safefree(szString);
      XSRETURN_UNDEF;
    }
#line 1528 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetStyle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetStyle)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	LRESULT	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 789 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_GETSTYLE, (WPARAM) 0, (LPARAM) 0);
#line 1557 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetTextRows); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_GetTextRows)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
	LRESULT	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 800 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_GETTEXTROWS, 0, 0);
#line 1587 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetTooltips); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_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 811 "Toolbar.xs"
    RETVAL = (HWND) SendMessage(handle, TB_GETTOOLTIPS, 0, 0);
#line 1617 "Toolbar.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_GetUnicodeFormat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_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 822 "Toolbar.xs"
    RETVAL = (BOOL) SendMessage(handle, TB_GETUNICODEFORMAT, 0, 0);
#line 1647 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_HideButton); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_HideButton)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, button, flag");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	BOOL	flag = (BOOL)SvIV(ST(2))
;
	LRESULT	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 835 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_HIDEBUTTON, (WPARAM) button, (LPARAM) MAKELONG(flag,0));
#line 1681 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_HitTest); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_HitTest)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    {
	HWND	handle;
	LONG	x = (LONG)SvIV(ST(1))
;
	LONG	y = (LONG)SvIV(ST(2))
;
#line 848 "Toolbar.xs"
    POINT pt;
#line 1703 "Toolbar.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 850 "Toolbar.xs"
    pt.x = x; pt.y = y;
    RETVAL = SendMessage(handle, TB_HITTEST, 0, (LPARAM) &pt);
#line 1719 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_Indeterminate); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_Indeterminate)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, button, flag");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	BOOL	flag = (BOOL)SvIV(ST(2))
;
	LRESULT	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 864 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_INDETERMINATE, (WPARAM) button, (LPARAM) MAKELONG(flag,0));
#line 1753 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_InsertButton); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_InsertButton)
{
    dVAR; dXSARGS;
    if (items != 7)
       croak_xs_usage(cv,  "handle, number, iBitmap, idCommand, fsState, fsStyle, iString");
    {
	HWND	handle;
	int	number = (int)SvIV(ST(1))
;
	int	iBitmap = (int)SvIV(ST(2))
;
	int	idCommand = (int)SvIV(ST(3))
;
	int	fsState = (int)SvIV(ST(4))
;
	int	fsStyle = (int)SvIV(ST(5))
;
	int	iString = (int)SvIV(ST(6))
;
#line 881 "Toolbar.xs"
    TBBUTTON button;
#line 1783 "Toolbar.c"
	LRESULT	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 883 "Toolbar.xs"
    button.iBitmap   = iBitmap;
    button.idCommand = idCommand;
    button.fsState   = fsState;
    button.fsStyle   = fsStyle;    
    button.iString   = iString;
    button.dwData    = 0;

    RETVAL = SendMessage(handle, TB_INSERTBUTTON, (WPARAM) number, (LPARAM) &button);
#line 1805 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_InsertMarkHitTest); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_InsertMarkHitTest)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
#line 904 "Toolbar.xs"
    POINT pt;
    TBINSERTMARK im;
#line 1830 "Toolbar.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 907 "Toolbar.xs"
    pt.x = x; pt.y = y;
    if (SendMessage(handle, TB_INSERTMARKHITTEST, (WPARAM) &pt, (LPARAM) &im)) {
        EXTEND(SP, 2);
        XST_mIV(0, im.iButton);
        XST_mIV(1, im.dwFlags);
        XSRETURN(2);
    }
    else
        XSRETURN_UNDEF;
#line 1851 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_IsButtonChecked); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_IsButtonChecked)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	LRESULT	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 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_ISBUTTONCHECKED, (WPARAM) button, 0);
#line 1882 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_IsButtonEnabled); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_IsButtonEnabled)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	LRESULT	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 937 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_ISBUTTONENABLED, (WPARAM) button, 0);
#line 1914 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_IsButtonHidden); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_IsButtonHidden)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	LRESULT	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 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_ISBUTTONHIDDEN, (WPARAM) button, 0);
#line 1946 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_IsButtonHighlighted); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_IsButtonHighlighted)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	LRESULT	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 961 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_ISBUTTONHIGHLIGHTED, (WPARAM) button, 0);
#line 1978 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_IsButtonIndeterminate); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_IsButtonIndeterminate)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	LRESULT	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 973 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_ISBUTTONINDETERMINATE, (WPARAM) button, 0);
#line 2010 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_IsButtonPressed); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_IsButtonPressed)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	LRESULT	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 985 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_ISBUTTONPRESSED, (WPARAM) button, 0);
#line 2042 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_LoadImages); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_LoadImages)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 3)
       croak_xs_usage(cv,  "handle, bitmap=IDB_HIST_LARGE_COLOR, hinst=HINST_COMMCTRL");
    {
	HWND	handle;
	int	bitmap;
	HINSTANCE	hinst;
	LRESULT	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)
	    bitmap = IDB_HIST_LARGE_COLOR;
	else {
	    bitmap = (int)SvIV(ST(1))
;
	}

	if (items < 3)
	    hinst = HINST_COMMCTRL;
	else {
	    hinst = INT2PTR(HINSTANCE,SvIV(ST(2)))
;
	}
#line 1007 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_LOADIMAGES, (WPARAM) bitmap, (LPARAM) hinst);
#line 2088 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_MapAccelerator); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_MapAccelerator)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, acc");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	WPARAM	acc = (WPARAM)SvUV(ST(1))
;
#line 1019 "Toolbar.xs"
    int button;
#line 2110 "Toolbar.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 1021 "Toolbar.xs"
    if(SendMessage(handle, TB_MAPACCELERATOR, acc, (LPARAM) &button)) {
        EXTEND(SP, 1);
        XST_mIV(0, button);
        XSRETURN(1);        
    }
    else
        XSRETURN_UNDEF;
#line 2129 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_MarkButton); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_MarkButton)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, button, flag");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	BOOL	flag = (BOOL)SvIV(ST(2))
;
	LRESULT	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 1038 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_MARKBUTTON, (WPARAM) button, (LPARAM) MAKELONG(flag,0));
#line 2162 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_MoveButton); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_MoveButton)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, oldbutton, newbutton");
    {
	HWND	handle;
	int	oldbutton = (int)SvIV(ST(1))
;
	int	newbutton = (int)SvIV(ST(2))
;
	LRESULT	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 1052 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_MOVEBUTTON, oldbutton, newbutton);
#line 2196 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_PressButton); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_PressButton)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, button, flag");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	BOOL	flag = (BOOL)SvIV(ST(2))
;
	LRESULT	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 1065 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_PRESSBUTTON, (WPARAM) button, (LPARAM) MAKELONG(flag,0));
#line 2230 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SaveRestore); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SaveRestore)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "handle, flag, SubKey, ValueName");
    {
	HWND	handle;
	BOOL	flag = (BOOL)SvIV(ST(1))
;
	LPCTSTR	SubKey = (LPCTSTR)SvPV_nolen(ST(2))
;
	LPCTSTR	ValueName = (LPCTSTR)SvPV_nolen(ST(3))
;
#line 1089 "Toolbar.xs"
    TBSAVEPARAMS tbsp;
#line 2254 "Toolbar.c"
	LRESULT	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 1091 "Toolbar.xs"
    tbsp.hkr = HKEY_CURRENT_USER;
    tbsp.pszSubKey    = SubKey;
    tbsp.pszValueName = ValueName;
    RETVAL = SendMessage(handle, TB_SAVERESTORE, (WPARAM) flag, (LPARAM) &tbsp);
#line 2272 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetAnchorHighlight); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetAnchorHighlight)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, flag");
    {
	HWND	handle;
	BOOL	flag = (BOOL)SvIV(ST(1))
;
	LRESULT	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 1106 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETANCHORHIGHLIGHT, (WPARAM) flag, 0);
#line 2304 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetBitmapSize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetBitmapSize)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 3)
       croak_xs_usage(cv,  "handle, x=16, y=15");
    {
	HWND	handle;
	int	x;
	int	y;
	LRESULT	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)
	    x = 16;
	else {
	    x = (int)SvIV(ST(1))
;
	}

	if (items < 3)
	    y = 15;
	else {
	    y = (int)SvIV(ST(2))
;
	}
#line 1121 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETBITMAPSIZE, 0, (LPARAM) MAKELONG (x, y));
#line 2350 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetButtonInfo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetButtonInfo)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "handle, index, ...");
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
#line 1163 "Toolbar.xs"
    TBBUTTONINFO button;
    int i, next_i;
    char * option;
    STRLEN tlen;
#line 2373 "Toolbar.c"
	LRESULT	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 1168 "Toolbar.xs"
    ZeroMemory(&button, sizeof(TBBUTTONINFO));
    button.cbSize = sizeof(TBBUTTONINFO);
    next_i = -1;
    for(i = 2; i < items; i++) {
        if(next_i == -1) {
            option = SvPV_nolen(ST(i));
            if(strcmp(option, "-command") == 0) {
                next_i = i + 1;
                button.idCommand = (int)SvIV(ST(next_i));
                button.dwMask |= TBIF_COMMAND;
            } else if (strcmp(option, "-image") == 0) {
                next_i = i + 1;
                button.iImage = (int)SvIV(ST(next_i));
                button.dwMask |= TBIF_IMAGE;
            } else if (strcmp(option, "-state") == 0) {
                next_i = i + 1;
                button.fsState = (BYTE) SvIV(ST(next_i));
                button.dwMask |= TBIF_STATE;
            } else if (strcmp(option, "-style") == 0) {
                next_i = i + 1;
                button.fsStyle = (BYTE) SvIV(ST(next_i));
                button.dwMask |= TBIF_STYLE;
            } else if (strcmp(option, "-width") == 0) {
                next_i = i + 1;
                button.cx = (WORD) SvIV(ST(next_i));
                button.dwMask |= TBIF_SIZE;
            } else if (strcmp(option, "-text") == 0) {
                next_i = i + 1;
                button.pszText = SvPV(ST(next_i), tlen);
                button.cchText = tlen;
                button.dwMask |= TBIF_TEXT;
            } else if (strcmp(option, "-checked") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsState, TBSTATE_CHECKED, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STATE;
            } else if (strcmp(option, "-ellipses") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsState, TBSTATE_ELLIPSES, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STATE;
            } else if (strcmp(option, "-enabled") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsState, TBSTATE_ENABLED, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STATE;
            } else if (strcmp(option, "-hidden") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsState, TBSTATE_HIDDEN, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STATE;
            } else if (strcmp(option, "-grayed") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsState, TBSTATE_INDETERMINATE, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STATE;
            } else if (strcmp(option, "-marked") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsState, TBSTATE_MARKED, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STATE;
            } else if (strcmp(option, "-pressed") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsState, TBSTATE_PRESSED, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STATE;
            } else if (strcmp(option, "-wrapped") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsState, TBSTATE_WRAP, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STATE;
            } else if (strcmp(option, "-autosize") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsStyle, TBSTYLE_AUTOSIZE, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STYLE;
            } else if (strcmp(option, "-check") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsStyle, TBSTYLE_CHECK, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STYLE;
            } else if (strcmp(option, "-checkgroup") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsStyle, TBSTYLE_CHECKGROUP, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STYLE;
            } else if (strcmp(option, "-dropdown") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsStyle, TBSTYLE_DROPDOWN, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STYLE;
            } else if (strcmp(option, "-group") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsStyle, TBSTYLE_GROUP, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STYLE;
            } else if (strcmp(option, "-noprefix") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsStyle, TBSTYLE_NOPREFIX, SvIV(ST(next_i)));
                button.dwMask |= TBIF_STYLE;
            } else if (strcmp(option, "-separator") == 0) {
                next_i = i + 1;
                SwitchBit(button.fsStyle, TBSTYLE_SEP , SvIV(ST(next_i)));
                button.dwMask |= TBIF_STYLE;
            }
        } else {
            next_i = -1;
        }
    }

    RETVAL = SendMessage(handle, TB_SETBUTTONINFO, (WPARAM) index, (LPARAM) &button);
#line 2485 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetButtonSize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetButtonSize)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 3)
       croak_xs_usage(cv,  "handle, x=24, y=22");
    {
	HWND	handle;
	int	x;
	int	y;
	LRESULT	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)
	    x = 24;
	else {
	    x = (int)SvIV(ST(1))
;
	}

	if (items < 3)
	    y = 22;
	else {
	    y = (int)SvIV(ST(2))
;
	}
#line 1280 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETBUTTONSIZE, 0, (LPARAM) MAKELONG (x, y));
#line 2531 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetButtonWidth); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetButtonWidth)
{
    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))
;
	LRESULT	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 1293 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETBUTTONWIDTH, 0, (LPARAM) MAKELONG (x, y));
#line 2565 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetCmdId); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetCmdId)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, button, cmd");
    {
	HWND	handle;
	UINT	button = (UINT)SvUV(ST(1))
;
	UINT	cmd = (UINT)SvUV(ST(2))
;
	LRESULT	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 1306 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETCMDID, (WPARAM) button, (LPARAM) cmd);
#line 2599 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetColorScheme); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetColorScheme)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 1323 "Toolbar.xs"
    COLORSCHEME colorscheme;
    int i, next_i;
#line 2618 "Toolbar.c"
	LRESULT	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 1326 "Toolbar.xs"
    ZeroMemory(&colorscheme, sizeof(COLORSCHEME));
    colorscheme.dwSize = sizeof(COLORSCHEME);
    next_i = -1;
    for(i = 1; i < items; i++) {
        if(next_i == -1) {
            if(strcmp(SvPV_nolen(ST(i)), "-clrBtnHighlight") == 0) {
                next_i = i + 1;
                colorscheme.clrBtnHighlight = SvCOLORREF(NOTXSCALL ST(next_i));
            }
            else if(strcmp(SvPV_nolen(ST(i)), "-clrBtnShadow") == 0) {
                next_i = i + 1;
                colorscheme.clrBtnShadow = SvCOLORREF(NOTXSCALL ST(next_i));
            }
        } else {
            next_i = -1;
        }
    }
    RETVAL = SendMessage(handle, TB_SETCOLORSCHEME, (WPARAM) 0, (LPARAM) &colorscheme);
#line 2650 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetDisabledImageList); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetDisabledImageList)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, imagelist");
    {
	HWND	handle;
	HIMAGELIST	imagelist;
	LRESULT	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)))
;
#line 1356 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETDISABLEDIMAGELIST, (WPARAM) 0, (LPARAM) imagelist);
#line 2691 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetDrawTextFlags); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetDrawTextFlags)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, mask, flag");
    {
	HWND	handle;
	UINT	mask = (UINT)SvUV(ST(1))
;
	UINT	flag = (UINT)SvUV(ST(2))
;
	LRESULT	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 1369 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETDRAWTEXTFLAGS, (WPARAM) mask, (LPARAM) flag);
#line 2725 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetExtendedStyle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetExtendedStyle)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, style");
    {
	HWND	handle;
	DWORD	style = (DWORD)SvUV(ST(1))
;
	LRESULT	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 1422 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETEXTENDEDSTYLE, (WPARAM) 0,(LPARAM) style);
#line 2757 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetHotImageList); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetHotImageList)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, hotimagelist");
    {
	HWND	handle;
	HIMAGELIST	hotimagelist;
	LRESULT	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)
            hotimagelist = INT2PTR(HIMAGELIST,SvIV(*out));
        else
            hotimagelist = NULL;
    } else
       hotimagelist = INT2PTR(HIMAGELIST,SvIV(ST(1)))
;
#line 1440 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETHOTIMAGELIST, (WPARAM) 0, (LPARAM) hotimagelist);
#line 2798 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetHotItem); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetHotItem)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, button");
    {
	HWND	handle;
	UINT	button = (UINT)SvUV(ST(1))
;
	LRESULT	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 1452 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETHOTITEM, (WPARAM) button, 0);
#line 2830 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetImageList); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetImageList)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, imagelist");
    {
	HWND	handle;
	HIMAGELIST	imagelist;
#line 1467 "Toolbar.xs"
    LPPERLWIN32GUI_USERDATA perlud;
#line 2849 "Toolbar.c"
	LRESULT	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)))
;
#line 1469 "Toolbar.xs"
    perlud = (LPPERLWIN32GUI_USERDATA) GetWindowLongPtr((HWND) handle, GWLP_USERDATA);
    if(perlud->dwPlStyle & PERLWIN32GUI_TB_HASBITMAPS) {
        CROAK("Cannot add imagelist to a toolbar that has already had AddBitmap() called");
        XSRETURN_UNDEF;
    }
    RETVAL = SendMessage(handle, TB_SETIMAGELIST, (WPARAM) 0, (LPARAM) imagelist);
#line 2879 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetIndent); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetIndent)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "handle, value");
    {
	HWND	handle;
	int	value = (int)SvIV(ST(1))
;
	LRESULT	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 1489 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETINDENT, (WPARAM) value, 0);
#line 2912 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetInsertMark); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetInsertMark)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, iButton, dwFlags=0");
    {
	HWND	handle;
	int	iButton = (int)SvIV(ST(1))
;
	int	dwFlags;
#line 1502 "Toolbar.xs"
    TBINSERTMARK im;
#line 2933 "Toolbar.c"
	LRESULT	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)
	    dwFlags = 0;
	else {
	    dwFlags = (int)SvIV(ST(2))
;
	}
#line 1504 "Toolbar.xs"
    im.iButton = iButton;
    im.dwFlags = dwFlags;
    RETVAL = SendMessage(handle, TB_SETINSERTMARK, 0, (LPARAM) &im);
#line 2957 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 1518 "Toolbar.xs"
    RETVAL = (COLORREF) SendMessage(handle, TB_SETINSERTMARKCOLOR, 0, (LPARAM) color);
#line 2989 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV) RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetMaxTextRows); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetMaxTextRows)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, value");
    {
	HWND	handle;
	int	value = (int)SvIV(ST(1))
;
	LRESULT	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 1530 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETMAXTEXTROWS, (WPARAM) value, 0);
#line 3021 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetPadding); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetPadding)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, cx, cy");
    {
	HWND	handle;
	int	cx = (int)SvIV(ST(1))
;
	int	cy = (int)SvIV(ST(2))
;
	LRESULT	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 1543 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETPADDING, 0, MAKELPARAM(cx, cy));
#line 3055 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetParent); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetParent)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, parent");
    {
	HWND	handle;
	HWND	parent;
	LRESULT	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)
            parent = INT2PTR(HWND,SvIV(*out));
        else
            parent = NULL;
    } else
       parent = INT2PTR(HWND,SvIV(ST(1)))
;
#line 1555 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETPARENT, (WPARAM) parent, 0);
#line 3096 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetRows); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetRows)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, rows, flag=TRUE");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	UINT	rows = (UINT)SvUV(ST(1))
;
	BOOL	flag;
#line 1570 "Toolbar.xs"
    RECT myRect;
#line 3119 "Toolbar.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)
	    flag = TRUE;
	else {
	    flag = (BOOL)SvIV(ST(2))
;
	}
#line 1572 "Toolbar.xs"
    SendMessage(handle, TB_SETROWS, (WPARAM) MAKEWPARAM(rows, flag), (LPARAM) &myRect);
    EXTEND(SP, 4);
    XST_mIV(0, myRect.left);
    XST_mIV(1, myRect.top);
    XST_mIV(2, myRect.right);
    XST_mIV(3, myRect.bottom);
    XSRETURN(4);
#line 3145 "Toolbar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetButtonState); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetButtonState)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, button, state");
    {
	HWND	handle;
	int	button = (int)SvIV(ST(1))
;
	int	state = (int)SvIV(ST(2))
;
	LRESULT	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 1608 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETSTATE, (WPARAM) button, (LPARAM) MAKELONG (state, 0));
#line 3178 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetStyle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetStyle)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, style");
    {
	HWND	handle;
	DWORD	style = (DWORD)SvUV(ST(1))
;
	LRESULT	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 1662 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETSTYLE, (WPARAM) 0,(LPARAM) style);
#line 3210 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetToolTips); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetToolTips)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, tooltips");
    {
	HWND	handle;
	HWND	tooltips;
	LRESULT	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)
            tooltips = INT2PTR(HWND,SvIV(*out));
        else
            tooltips = NULL;
    } else
       tooltips = INT2PTR(HWND,SvIV(ST(1)))
;
#line 1677 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETTOOLTIPS, (WPARAM) tooltips, (LPARAM) 0);
#line 3251 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_SetUnicodeFormat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_SetUnicodeFormat)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, flag");
    {
	HWND	handle;
	BOOL	flag = (BOOL)SvIV(ST(1))
;
	LRESULT	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 1690 "Toolbar.xs"
    RETVAL = SendMessage(handle, TB_SETUNICODEFORMAT, (WPARAM) flag, (LPARAM) 0);
#line 3283 "Toolbar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Toolbar_Padding); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Toolbar_Padding)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 3)
       croak_xs_usage(cv,  "handle, x=-1, y=-1");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	int	x;
	int	y;
#line 1709 "Toolbar.xs"
        LRESULT pad;
#line 3305 "Toolbar.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 < 2)
	    x = -1;
	else {
	    x = (int)SvIV(ST(1))
;
	}

	if (items < 3)
	    y = -1;
	else {
	    y = (int)SvIV(ST(2))
;
	}
#line 1711 "Toolbar.xs"
    if(items == 1) {
        pad = SendMessage(handle, TB_GETPADDING, 0, 0);
        EXTEND(SP, 2);
        XST_mIV(0, LOWORD(pad));
        XST_mIV(1, HIWORD(pad));
        XSRETURN(2);
    } else {
        if(items == 2) y = x;
        XSRETURN_IV( SendMessage(handle, TB_SETPADDING, 0, MAKELPARAM(x, y)) );
    }
#line 3341 "Toolbar.c"
	PUTBACK;
	return;
    }
}

#ifdef __cplusplus
extern "C" {
#endif
XS_EXTERNAL(boot_Win32__GUI__Toolbar); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Win32__GUI__Toolbar)
{
#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::Toolbar::AddBitmap", XS_Win32__GUI__Toolbar_AddBitmap);
        newXS_deffile("Win32::GUI::Toolbar::AddButtons", XS_Win32__GUI__Toolbar_AddButtons);
        newXS_deffile("Win32::GUI::Toolbar::AddString", XS_Win32__GUI__Toolbar_AddString);
        newXS_deffile("Win32::GUI::Toolbar::AutoSize", XS_Win32__GUI__Toolbar_AutoSize);
        newXS_deffile("Win32::GUI::Toolbar::ButtonCount", XS_Win32__GUI__Toolbar_ButtonCount);
        newXS_deffile("Win32::GUI::Toolbar::ButtonStructSize", XS_Win32__GUI__Toolbar_ButtonStructSize);
        newXS_deffile("Win32::GUI::Toolbar::ChangeBitmap", XS_Win32__GUI__Toolbar_ChangeBitmap);
        newXS_deffile("Win32::GUI::Toolbar::CheckButton", XS_Win32__GUI__Toolbar_CheckButton);
        newXS_deffile("Win32::GUI::Toolbar::CommandToIndex", XS_Win32__GUI__Toolbar_CommandToIndex);
        newXS_deffile("Win32::GUI::Toolbar::Customize", XS_Win32__GUI__Toolbar_Customize);
        newXS_deffile("Win32::GUI::Toolbar::DeleteButton", XS_Win32__GUI__Toolbar_DeleteButton);
        newXS_deffile("Win32::GUI::Toolbar::EnableButton", XS_Win32__GUI__Toolbar_EnableButton);
        newXS_deffile("Win32::GUI::Toolbar::GetAnchorHighlight", XS_Win32__GUI__Toolbar_GetAnchorHighlight);
        newXS_deffile("Win32::GUI::Toolbar::GetBitmap", XS_Win32__GUI__Toolbar_GetBitmap);
        newXS_deffile("Win32::GUI::Toolbar::GetBitmapFlags", XS_Win32__GUI__Toolbar_GetBitmapFlags);
        newXS_deffile("Win32::GUI::Toolbar::GetButton", XS_Win32__GUI__Toolbar_GetButton);
        newXS_deffile("Win32::GUI::Toolbar::GetButtonInfo", XS_Win32__GUI__Toolbar_GetButtonInfo);
        newXS_deffile("Win32::GUI::Toolbar::GetButtonSize", XS_Win32__GUI__Toolbar_GetButtonSize);
        newXS_deffile("Win32::GUI::Toolbar::GetButtonText", XS_Win32__GUI__Toolbar_GetButtonText);
        newXS_deffile("Win32::GUI::Toolbar::GetColorScheme", XS_Win32__GUI__Toolbar_GetColorScheme);
        newXS_deffile("Win32::GUI::Toolbar::GetDisabledImageList", XS_Win32__GUI__Toolbar_GetDisabledImageList);
        newXS_deffile("Win32::GUI::Toolbar::GetHotImageList", XS_Win32__GUI__Toolbar_GetHotImageList);
        newXS_deffile("Win32::GUI::Toolbar::GetHotItem", XS_Win32__GUI__Toolbar_GetHotItem);
        newXS_deffile("Win32::GUI::Toolbar::GetImageList", XS_Win32__GUI__Toolbar_GetImageList);
        newXS_deffile("Win32::GUI::Toolbar::GetInsertMark", XS_Win32__GUI__Toolbar_GetInsertMark);
        newXS_deffile("Win32::GUI::Toolbar::GetInsertMarkColor", XS_Win32__GUI__Toolbar_GetInsertMarkColor);
        newXS_deffile("Win32::GUI::Toolbar::GetItemRect", XS_Win32__GUI__Toolbar_GetItemRect);
        cv = newXS_deffile("Win32::GUI::Toolbar::GetMaxSize", XS_Win32__GUI__Toolbar_GetMaxSize);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::Toolbar::MaxSize", XS_Win32__GUI__Toolbar_GetMaxSize);
        XSANY.any_i32 = 1;
        newXS_deffile("Win32::GUI::Toolbar::GetPadding", XS_Win32__GUI__Toolbar_GetPadding);
        newXS_deffile("Win32::GUI::Toolbar::GetRect", XS_Win32__GUI__Toolbar_GetRect);
        newXS_deffile("Win32::GUI::Toolbar::GetRows", XS_Win32__GUI__Toolbar_GetRows);
        newXS_deffile("Win32::GUI::Toolbar::GetState", XS_Win32__GUI__Toolbar_GetState);
        newXS_deffile("Win32::GUI::Toolbar::GetString", XS_Win32__GUI__Toolbar_GetString);
        newXS_deffile("Win32::GUI::Toolbar::GetStyle", XS_Win32__GUI__Toolbar_GetStyle);
        newXS_deffile("Win32::GUI::Toolbar::GetTextRows", XS_Win32__GUI__Toolbar_GetTextRows);
        newXS_deffile("Win32::GUI::Toolbar::GetTooltips", XS_Win32__GUI__Toolbar_GetTooltips);
        newXS_deffile("Win32::GUI::Toolbar::GetUnicodeFormat", XS_Win32__GUI__Toolbar_GetUnicodeFormat);
        newXS_deffile("Win32::GUI::Toolbar::HideButton", XS_Win32__GUI__Toolbar_HideButton);
        newXS_deffile("Win32::GUI::Toolbar::HitTest", XS_Win32__GUI__Toolbar_HitTest);
        newXS_deffile("Win32::GUI::Toolbar::Indeterminate", XS_Win32__GUI__Toolbar_Indeterminate);
        newXS_deffile("Win32::GUI::Toolbar::InsertButton", XS_Win32__GUI__Toolbar_InsertButton);
        newXS_deffile("Win32::GUI::Toolbar::InsertMarkHitTest", XS_Win32__GUI__Toolbar_InsertMarkHitTest);
        newXS_deffile("Win32::GUI::Toolbar::IsButtonChecked", XS_Win32__GUI__Toolbar_IsButtonChecked);
        newXS_deffile("Win32::GUI::Toolbar::IsButtonEnabled", XS_Win32__GUI__Toolbar_IsButtonEnabled);
        newXS_deffile("Win32::GUI::Toolbar::IsButtonHidden", XS_Win32__GUI__Toolbar_IsButtonHidden);
        newXS_deffile("Win32::GUI::Toolbar::IsButtonHighlighted", XS_Win32__GUI__Toolbar_IsButtonHighlighted);
        newXS_deffile("Win32::GUI::Toolbar::IsButtonIndeterminate", XS_Win32__GUI__Toolbar_IsButtonIndeterminate);
        newXS_deffile("Win32::GUI::Toolbar::IsButtonPressed", XS_Win32__GUI__Toolbar_IsButtonPressed);
        newXS_deffile("Win32::GUI::Toolbar::LoadImages", XS_Win32__GUI__Toolbar_LoadImages);
        newXS_deffile("Win32::GUI::Toolbar::MapAccelerator", XS_Win32__GUI__Toolbar_MapAccelerator);
        newXS_deffile("Win32::GUI::Toolbar::MarkButton", XS_Win32__GUI__Toolbar_MarkButton);
        newXS_deffile("Win32::GUI::Toolbar::MoveButton", XS_Win32__GUI__Toolbar_MoveButton);
        newXS_deffile("Win32::GUI::Toolbar::PressButton", XS_Win32__GUI__Toolbar_PressButton);
        newXS_deffile("Win32::GUI::Toolbar::SaveRestore", XS_Win32__GUI__Toolbar_SaveRestore);
        newXS_deffile("Win32::GUI::Toolbar::SetAnchorHighlight", XS_Win32__GUI__Toolbar_SetAnchorHighlight);
        newXS_deffile("Win32::GUI::Toolbar::SetBitmapSize", XS_Win32__GUI__Toolbar_SetBitmapSize);
        newXS_deffile("Win32::GUI::Toolbar::SetButtonInfo", XS_Win32__GUI__Toolbar_SetButtonInfo);
        newXS_deffile("Win32::GUI::Toolbar::SetButtonSize", XS_Win32__GUI__Toolbar_SetButtonSize);
        newXS_deffile("Win32::GUI::Toolbar::SetButtonWidth", XS_Win32__GUI__Toolbar_SetButtonWidth);
        newXS_deffile("Win32::GUI::Toolbar::SetCmdId", XS_Win32__GUI__Toolbar_SetCmdId);
        newXS_deffile("Win32::GUI::Toolbar::SetColorScheme", XS_Win32__GUI__Toolbar_SetColorScheme);
        newXS_deffile("Win32::GUI::Toolbar::SetDisabledImageList", XS_Win32__GUI__Toolbar_SetDisabledImageList);
        newXS_deffile("Win32::GUI::Toolbar::SetDrawTextFlags", XS_Win32__GUI__Toolbar_SetDrawTextFlags);
        newXS_deffile("Win32::GUI::Toolbar::SetExtendedStyle", XS_Win32__GUI__Toolbar_SetExtendedStyle);
        newXS_deffile("Win32::GUI::Toolbar::SetHotImageList", XS_Win32__GUI__Toolbar_SetHotImageList);
        newXS_deffile("Win32::GUI::Toolbar::SetHotItem", XS_Win32__GUI__Toolbar_SetHotItem);
        newXS_deffile("Win32::GUI::Toolbar::SetImageList", XS_Win32__GUI__Toolbar_SetImageList);
        cv = newXS_deffile("Win32::GUI::Toolbar::Indent", XS_Win32__GUI__Toolbar_SetIndent);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Toolbar::SetIndent", XS_Win32__GUI__Toolbar_SetIndent);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::Toolbar::SetInsertMark", XS_Win32__GUI__Toolbar_SetInsertMark);
        newXS_deffile("Win32::GUI::Toolbar::SetInsertMarkColor", XS_Win32__GUI__Toolbar_SetInsertMarkColor);
        newXS_deffile("Win32::GUI::Toolbar::SetMaxTextRows", XS_Win32__GUI__Toolbar_SetMaxTextRows);
        newXS_deffile("Win32::GUI::Toolbar::SetPadding", XS_Win32__GUI__Toolbar_SetPadding);
        newXS_deffile("Win32::GUI::Toolbar::SetParent", XS_Win32__GUI__Toolbar_SetParent);
        newXS_deffile("Win32::GUI::Toolbar::SetRows", XS_Win32__GUI__Toolbar_SetRows);
        newXS_deffile("Win32::GUI::Toolbar::SetButtonState", XS_Win32__GUI__Toolbar_SetButtonState);
        newXS_deffile("Win32::GUI::Toolbar::SetStyle", XS_Win32__GUI__Toolbar_SetStyle);
        newXS_deffile("Win32::GUI::Toolbar::SetToolTips", XS_Win32__GUI__Toolbar_SetToolTips);
        newXS_deffile("Win32::GUI::Toolbar::SetUnicodeFormat", XS_Win32__GUI__Toolbar_SetUnicodeFormat);
        newXS_deffile("Win32::GUI::Toolbar::Padding", XS_Win32__GUI__Toolbar_Padding);
#if PERL_VERSION_LE(5, 21, 5)
#  if PERL_VERSION_GE(5, 9, 0)
    if (PL_unitcheckav)
        call_list(PL_scopestack_ix, PL_unitcheckav);
#  endif
    XSRETURN_YES;
#else
    Perl_xs_boot_epilog(aTHX_ ax);
#endif
}

#ifdef __cplusplus
}
#endif
