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

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

#include "GUI.h"

void 
Rebar_onPreCreate(NOTXSPROC LPPERLWIN32GUI_CREATESTRUCT perlcs) {

    perlcs->cs.lpszClass = REBARCLASSNAME;
    perlcs->cs.style = WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | RBS_VARHEIGHT | CCS_NODIVIDER;
    perlcs->cs.dwExStyle = WS_EX_TOOLWINDOW;
}

BOOL
Rebar_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("-bandborders", perlcs->cs.style, RBS_BANDBORDERS)
    } else if BitmaskOptionValue("-fixedorder",  perlcs->cs.style, RBS_FIXEDORDER)
    } else if BitmaskOptionValue("-varheight",   perlcs->cs.style, RBS_VARHEIGHT)
    } else if BitmaskOptionValue("-autosize",    perlcs->cs.style, RBS_AUTOSIZE)
    } else if BitmaskOptionValue("-vertical",    perlcs->cs.style, CCS_VERT)
    } else if BitmaskOptionValue("-nodivider",   perlcs->cs.style, CCS_NODIVIDER)    
    } else if BitmaskOptionValue("-doubleclick", perlcs->cs.style, RBS_DBLCLKTOGGLE)
    } else if BitmaskOptionValue("-vgripper",    perlcs->cs.style, RBS_VERTICALGRIPPER)
    } else retval = TRUE;

    return retval;
}

void
Rebar_onPostCreate(NOTXSPROC HWND myhandle, LPPERLWIN32GUI_CREATESTRUCT perlcs) {

    // initialize and send the REBARINFO structure.
    REBARINFO rbi;
    rbi.cbSize = sizeof(REBARINFO);
    if(perlcs->hImageList != NULL) {
        rbi.fMask = RBIM_IMAGELIST;
        rbi.himl = perlcs->hImageList;
    } else {
        rbi.fMask = 0;
        rbi.himl = NULL;
    }
    SendMessage(myhandle, RB_SETBARINFO, 0, (LPARAM) &rbi);

    if (perlcs->hTooltip != NULL) {
        SendMessage(myhandle, RB_SETTOOLTIPS, (WPARAM) perlcs->hTooltip, (LPARAM) 0);
    }

    if(perlcs->clrForeground != CLR_INVALID) {
        SendMessage(myhandle, RB_SETTEXTCOLOR, (WPARAM) 0, (LPARAM) perlcs->clrForeground);
        perlcs->clrForeground = CLR_INVALID;  // Don't Store
    }

    if(perlcs->clrBackground != CLR_INVALID) {
        SendMessage(myhandle, RB_SETBKCOLOR, (WPARAM) 0, (LPARAM) perlcs->clrBackground);
        perlcs->clrBackground = CLR_INVALID;  // Don't Store
    }

}

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

    BOOL retval = TRUE;

         if Parse_Event("HeightChange",    PERLWIN32GUI_NEM_CONTROL1)
    else if Parse_Event("ChevronPushed",   PERLWIN32GUI_NEM_CONTROL2)
    else retval = FALSE;

    return retval;
}

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

    int PerlResult = 1;

    if ( uMsg == WM_NOTIFY ) {

        switch( ((LPNMHDR)lParam)->code ) {

        case RBN_HEIGHTCHANGE :
            /*
             * (@)EVENT:HeightChange()
             * Sent when the height of the Rebar control has changed.
             * (@)APPLIES_TO:Rebar
             */
            {
            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL1, "HeightChange", -1 );
            }
            break;
        case RBN_CHEVRONPUSHED :
            /*
             * (@)EVENT:ChevronPushed(bandindex, left, top, right, bottom)
             * Sent when a chevron on a rebar band is clicked
             * (@)APPLIES_TO:Rebar
             */
            {
            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL2, "ChevronPushed",
                    PERLWIN32GUI_ARGTYPE_INT,  (INT)  ((LPNMREBARCHEVRON)lParam)->uBand,
                    PERLWIN32GUI_ARGTYPE_LONG, (LONG) ((LPNMREBARCHEVRON)lParam)->rc.left,
                    PERLWIN32GUI_ARGTYPE_LONG, (LONG) ((LPNMREBARCHEVRON)lParam)->rc.top,
                    PERLWIN32GUI_ARGTYPE_LONG, (LONG) ((LPNMREBARCHEVRON)lParam)->rc.right,
                    PERLWIN32GUI_ARGTYPE_LONG, (LONG) ((LPNMREBARCHEVRON)lParam)->rc.bottom,
                    -1 );
            }
            break;
        }

    }

    return PerlResult;
}


#line 138 "Rebar.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 282 "Rebar.c"
#pragma message( "*** PACKAGE Win32::GUI::Rebar..." )

XS_EUPXS(XS_Win32__GUI__Rebar_BeginDrag); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_BeginDrag)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, position=(DWORD)-1");
    {
	HWND	handle;
	UINT	index = (UINT)SvUV(ST(1))
;
	DWORD	position;
	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)
	    position = (DWORD)-1;
	else {
	    position = (DWORD)SvUV(ST(2))
;
	}
#line 143 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_BEGINDRAG, (WPARAM) index, (LPARAM) position);
#line 317 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_DeleteBand); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_DeleteBand)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, index");
    {
	HWND	handle;
	UINT	index = (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 156 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_DELETEBAND, (WPARAM) index, 0);
#line 349 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_DragMove); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_DragMove)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, position=(DWORD)-1");
    {
	HWND	handle;
	DWORD	position;
	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)
	    position = (DWORD)-1;
	else {
	    position = (DWORD)SvUV(ST(1))
;
	}
#line 168 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_DRAGMOVE, (WPARAM) 0, (LPARAM) position);
#line 387 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_EndDrag); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_EndDrag)
{
    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 179 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_ENDDRAG, (WPARAM) 0, (LPARAM) 0);
#line 417 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_GetBandBorder); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_GetBandBorder)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, index");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	UINT	index = (UINT)SvUV(ST(1))
;
#line 195 "Rebar.xs"
    RECT myRect;
#line 439 "Rebar.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 197 "Rebar.xs"
    if(SendMessage(handle, RB_GETBANDBORDERS, (WPARAM) index, (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 461 "Rebar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Rebar_GetBandCount); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_GetBandCount)
{
    dVAR; dXSARGS;
    dXSI32;
    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 219 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_GETBANDCOUNT, 0, 0);
#line 491 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_GetBandInfo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_GetBandInfo)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "handle, index");
    {
	HWND	handle;
	UINT	index = (UINT)SvUV(ST(1))
;
#line 248 "Rebar.xs"
    REBARBANDINFO rbbi;
    char Buffer [256];
#line 513 "Rebar.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 251 "Rebar.xs"
    ZeroMemory(&rbbi, sizeof(REBARBANDINFO));
    rbbi.cbSize = sizeof(REBARBANDINFO);
    rbbi.fMask =
        RBBIM_BACKGROUND | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_COLORS |
        RBBIM_HEADERSIZE | RBBIM_IDEALSIZE | RBBIM_ID | RBBIM_IMAGE |
        RBBIM_LPARAM | RBBIM_SIZE | RBBIM_STYLE | RBBIM_TEXT;
    rbbi.lpText = Buffer;
    rbbi.cch = 255;
    if(SendMessage(handle, RB_GETBANDINFO, (WPARAM) index, (LPARAM) &rbbi)) {
        EXTEND(SP, 22);
        XST_mPV( 0, "-text");
        XST_mPV( 1, rbbi.lpText);
        XST_mPV( 2, "-foreground");
        XST_mIV( 3, rbbi.clrFore);
        XST_mPV( 4, "-background");
        XST_mIV( 5, rbbi.clrBack);
        XST_mPV( 6, "-image");
        XST_mIV( 7, rbbi.iImage);
        XST_mPV( 8, "-child");
        XST_mIV( 9, PTR2IV(rbbi.hwndChild));
        XST_mPV(10, "-bitmap");
        XST_mIV(11, PTR2IV(rbbi.hbmBack));
        XST_mPV(12, "-width");
        XST_mIV(13, rbbi.cx);
        XST_mPV(14, "-minwidth");
        XST_mIV(15, rbbi.cxMinChild);
        XST_mPV(16, "-minheight");
        XST_mIV(17, rbbi.cyMinChild);
        XST_mPV(18, "-style");
        XST_mIV(19, rbbi.fStyle);
        XST_mPV(20, "-idealwidth");
        XST_mIV(21, rbbi.cxIdeal);
        XSRETURN(22);
    } else {
        XSRETURN_UNDEF;
    }
#line 561 "Rebar.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_GetBarHeight); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_GetBarHeight)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, flag=1");
    {
	HWND	handle;
	UINT	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 295 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_GETBARHEIGHT , (WPARAM) 0, (LPARAM) 0);
#line 589 "Rebar.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_GetBarInfo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_GetBarInfo)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 308 "Rebar.xs"
    REBARINFO rbinfo;
#line 609 "Rebar.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 310 "Rebar.xs"
    ZeroMemory(&rbinfo, sizeof(REBARINFO));
    rbinfo.cbSize =  sizeof(REBARINFO);
    rbinfo.fMask = RBIM_IMAGELIST;
    if (SendMessage(handle, RB_GETBARINFO , (WPARAM) 0, (LPARAM) &rbinfo) ) {
        EXTEND(SP, 2);
        XST_mPV( 0, "-imagelist");
        XST_mIV( 1, PTR2IV(rbinfo.himl));
        XSRETURN(2);
    }
    else {
        XSRETURN_UNDEF;
    }
#line 633 "Rebar.c"
	PUTBACK;
	return;
    }
}


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

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


XS_EUPXS(XS_Win32__GUI__Rebar_GetColorScheme); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_GetColorScheme)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 348 "Rebar.xs"
    COLORSCHEME colorscheme;
#line 682 "Rebar.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 350 "Rebar.xs"
    ZeroMemory(&colorscheme, sizeof(COLORSCHEME));
    colorscheme.dwSize = sizeof(COLORSCHEME);
    if (SendMessage(handle, RB_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 707 "Rebar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Rebar_GetPallette); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_GetPallette)
{
    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 372 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_GETPALETTE , (WPARAM) 0, (LPARAM) 0);
#line 736 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_GetRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_GetRect)
{
    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 384 "Rebar.xs"
    RECT Rect;
#line 758 "Rebar.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 386 "Rebar.xs"
    if(SendMessage(handle, RB_GETRECT, (WPARAM) index, (LPARAM) &Rect) == TRUE) {
        EXTEND(SP, 4);
        XST_mIV(0,Rect.left);
        XST_mIV(1,Rect.top);
        XST_mIV(2,Rect.right);
        XST_mIV(3,Rect.bottom);
        XSRETURN(4);
    }
    else {
        XSRETURN_UNDEF;
    }
#line 781 "Rebar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Rebar_GetRowCount); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_GetRowCount)
{
    dVAR; dXSARGS;
    dXSI32;
    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 409 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_GETROWCOUNT, 0, 0);
#line 811 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_GetRowHeight); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_GetRowHeight)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, row");
    {
	HWND	handle;
	UINT	row = (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 422 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_GETROWHEIGHT, (WPARAM) row, 0);
#line 843 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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

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


XS_EUPXS(XS_Win32__GUI__Rebar_GetTooltips); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_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 446 "Rebar.xs"
    RETVAL = (HWND) SendMessage(handle, RB_GETTOOLTIPS , (WPARAM) 0, (LPARAM) 0);
#line 903 "Rebar.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_GetUnicodeFormat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_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 458 "Rebar.xs"
    RETVAL = (BOOL) SendMessage(handle, RB_GETUNICODEFORMAT , (WPARAM) 0, (LPARAM) 0);
#line 933 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_HitTest); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_HitTest)
{
    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))
;
#line 472 "Rebar.xs"
    RBHITTESTINFO rb;
#line 955 "Rebar.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 474 "Rebar.xs"
    rb.pt.x = x; rb.pt.y = y;
    RETVAL = SendMessage(handle, RB_HITTEST, (WPARAM) 0, (LPARAM) &rb);
#line 971 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_IdToIndex); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_IdToIndex)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, id");
    {
	HWND	handle;
	UINT	id = (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 488 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_IDTOINDEX , (WPARAM) id, (LPARAM) 0);
#line 1003 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_InsertBand); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_InsertBand)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 570 "Rebar.xs"
    REBARBANDINFO rbbi;
    int index = -1;
#line 1022 "Rebar.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 573 "Rebar.xs"
    ZeroMemory(&rbbi, sizeof(REBARBANDINFO));
    rbbi.cbSize = sizeof(REBARBANDINFO);
    rbbi.fStyle = RBBS_CHILDEDGE | RBBS_FIXEDBMP;
    rbbi.fMask |= RBBIM_STYLE;
    ParseRebarBandOptions(NOTXSCALL sp, mark, ax, items, 1, &rbbi, &index);
    RETVAL = SendMessage(handle, RB_INSERTBAND, (WPARAM) index, (LPARAM) &rbbi);
#line 1042 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_MaximizeBand); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_MaximizeBand)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, flag=0");
    {
	HWND	handle;
	UINT	index = (UINT)SvUV(ST(1))
;
	BOOL	flag;
	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)
	    flag = 0;
	else {
	    flag = (BOOL)SvIV(ST(2))
;
	}
#line 592 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_MAXIMIZEBAND, (WPARAM) index, (LPARAM) flag);
#line 1082 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_MinimizeBand); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_MinimizeBand)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, index");
    {
	HWND	handle;
	UINT	index = (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 605 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_MINIMIZEBAND, (WPARAM) index, 0);
#line 1114 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_MoveBand); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_MoveBand)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, iFrom, iTo");
    {
	HWND	handle;
	UINT	iFrom = (UINT)SvUV(ST(1))
;
	UINT	iTo = (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 619 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_MOVEBAND, (WPARAM) iFrom, (LPARAM) iTo);
#line 1148 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_SetBandInfo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_SetBandInfo)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "handle, index, ...");
    {
	HWND	handle;
	int	index = (int)SvIV(ST(1))
;
#line 632 "Rebar.xs"
    REBARBANDINFO rbbi;    
#line 1168 "Rebar.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 634 "Rebar.xs"
    ZeroMemory(&rbbi, sizeof(REBARBANDINFO));
    rbbi.cbSize = sizeof(REBARBANDINFO);
    ParseRebarBandOptions(NOTXSCALL sp, mark, ax, items, 2, &rbbi, &index);
    RETVAL = SendMessage(handle, RB_SETBANDINFO, (WPARAM) index, (LPARAM) &rbbi);
#line 1186 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_SetBarInfo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_SetBarInfo)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 652 "Rebar.xs"
    REBARINFO rbi;
    int i, next_i;
#line 1205 "Rebar.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 655 "Rebar.xs"
    ZeroMemory(&rbi, sizeof(REBARINFO));
    rbi.cbSize = sizeof(REBARINFO);
    next_i = -1;
    for(i = 1; i < items; i++) {
        if(next_i == -1) {
            if(strcmp(SvPV_nolen(ST(i)), "-imagelist") == 0) {
                next_i = i + 1;
                rbi.himl = (HIMAGELIST) handle_From(NOTXSCALL ST(next_i));
                rbi.fMask |= RBIM_IMAGELIST;
            }
        } else {
            next_i = -1;
        }
    }
    RETVAL = SendMessage(handle, RB_SETBARINFO, (WPARAM) 0, (LPARAM) &rbi);
#line 1234 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_SetBkColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_SetBkColor)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, color");
    {
	HWND	handle;
	COLORREF    color = SvCOLORREF(NOTXSCALL 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 682 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_SETBKCOLOR, (WPARAM) 0, (LPARAM) color);
#line 1266 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_SetColorScheme); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_SetColorScheme)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 700 "Rebar.xs"
    COLORSCHEME colorscheme;
    int i, next_i;
#line 1285 "Rebar.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 703 "Rebar.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, RB_SETCOLORSCHEME, (WPARAM) 0, (LPARAM) &colorscheme);
#line 1317 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_SetPalette); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_SetPalette)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, palette");
    {
	HWND	handle;
	WPARAM	palette = (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 733 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_SETPALETTE, (WPARAM) 0, (LPARAM) palette);
#line 1349 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_SetParent); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_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 746 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_SETPARENT, (WPARAM) parent, (LPARAM) 0);
#line 1390 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_SetTextColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_SetTextColor)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, color");
    {
	HWND	handle;
	COLORREF    color = SvCOLORREF(NOTXSCALL 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 759 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_SETTEXTCOLOR, (WPARAM) 0, (LPARAM) color);
#line 1422 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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


XS_EUPXS(XS_Win32__GUI__Rebar_SetUnicodeFormat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_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 785 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_SETUNICODEFORMAT, (WPARAM) flag, (LPARAM) 0);
#line 1495 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_ShowBand); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_ShowBand)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, flag=1");
    {
	HWND	handle;
	UINT	index = (UINT)SvUV(ST(1))
;
	BOOL	flag;
	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)
	    flag = 1;
	else {
	    flag = (BOOL)SvIV(ST(2))
;
	}
#line 799 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_SHOWBAND, (WPARAM) index, (LPARAM) flag);
#line 1535 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_SizeToRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_SizeToRect)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "handle, left, top, right, bottom");
    {
	HWND	handle;
	int	left = (int)SvIV(ST(1))
;
	int	top = (int)SvIV(ST(2))
;
	int	right = (int)SvIV(ST(3))
;
	int	bottom = (int)SvIV(ST(4))
;
#line 814 "Rebar.xs"
    RECT myRect;
#line 1561 "Rebar.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 816 "Rebar.xs"
    myRect.left   = left;
    myRect.top    = top;
    myRect.right  = right;
    myRect.bottom = bottom;
    RETVAL = SendMessage(handle, RB_SIZETORECT, (WPARAM) 0, (LPARAM) &myRect);
#line 1580 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Rebar_HideBand); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Rebar_HideBand)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, flag=0");
    {
	HWND	handle;
	UINT	index = (UINT)SvUV(ST(1))
;
	BOOL	flag;
	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)
	    flag = 0;
	else {
	    flag = (BOOL)SvIV(ST(2))
;
	}
#line 838 "Rebar.xs"
    RETVAL = SendMessage(handle, RB_SHOWBAND, (WPARAM) index, (LPARAM) flag);
#line 1620 "Rebar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#ifdef __cplusplus
extern "C" {
#endif
XS_EXTERNAL(boot_Win32__GUI__Rebar); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Win32__GUI__Rebar)
{
#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::Rebar::BeginDrag", XS_Win32__GUI__Rebar_BeginDrag);
        newXS_deffile("Win32::GUI::Rebar::DeleteBand", XS_Win32__GUI__Rebar_DeleteBand);
        newXS_deffile("Win32::GUI::Rebar::DragMove", XS_Win32__GUI__Rebar_DragMove);
        newXS_deffile("Win32::GUI::Rebar::EndDrag", XS_Win32__GUI__Rebar_EndDrag);
        newXS_deffile("Win32::GUI::Rebar::GetBandBorder", XS_Win32__GUI__Rebar_GetBandBorder);
        cv = newXS_deffile("Win32::GUI::Rebar::BandCount", XS_Win32__GUI__Rebar_GetBandCount);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Rebar::GetBandCount", XS_Win32__GUI__Rebar_GetBandCount);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::Rebar::BandInfo", XS_Win32__GUI__Rebar_GetBandInfo);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Rebar::GetBandInfo", XS_Win32__GUI__Rebar_GetBandInfo);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::Rebar::GetBarHeight", XS_Win32__GUI__Rebar_GetBarHeight);
        newXS_deffile("Win32::GUI::Rebar::GetBarInfo", XS_Win32__GUI__Rebar_GetBarInfo);
        newXS_deffile("Win32::GUI::Rebar::GetBkColor", XS_Win32__GUI__Rebar_GetBkColor);
        newXS_deffile("Win32::GUI::Rebar::GetColorScheme", XS_Win32__GUI__Rebar_GetColorScheme);
        newXS_deffile("Win32::GUI::Rebar::GetPallette", XS_Win32__GUI__Rebar_GetPallette);
        newXS_deffile("Win32::GUI::Rebar::GetRect", XS_Win32__GUI__Rebar_GetRect);
        cv = newXS_deffile("Win32::GUI::Rebar::GetRowCount", XS_Win32__GUI__Rebar_GetRowCount);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::Rebar::RowCount", XS_Win32__GUI__Rebar_GetRowCount);
        XSANY.any_i32 = 1;
        newXS_deffile("Win32::GUI::Rebar::GetRowHeight", XS_Win32__GUI__Rebar_GetRowHeight);
        newXS_deffile("Win32::GUI::Rebar::GetTextColor", XS_Win32__GUI__Rebar_GetTextColor);
        newXS_deffile("Win32::GUI::Rebar::GetTooltips", XS_Win32__GUI__Rebar_GetTooltips);
        newXS_deffile("Win32::GUI::Rebar::GetUnicodeFormat", XS_Win32__GUI__Rebar_GetUnicodeFormat);
        newXS_deffile("Win32::GUI::Rebar::HitTest", XS_Win32__GUI__Rebar_HitTest);
        newXS_deffile("Win32::GUI::Rebar::IdToIndex", XS_Win32__GUI__Rebar_IdToIndex);
        newXS_deffile("Win32::GUI::Rebar::InsertBand", XS_Win32__GUI__Rebar_InsertBand);
        newXS_deffile("Win32::GUI::Rebar::MaximizeBand", XS_Win32__GUI__Rebar_MaximizeBand);
        newXS_deffile("Win32::GUI::Rebar::MinimizeBand", XS_Win32__GUI__Rebar_MinimizeBand);
        newXS_deffile("Win32::GUI::Rebar::MoveBand", XS_Win32__GUI__Rebar_MoveBand);
        newXS_deffile("Win32::GUI::Rebar::SetBandInfo", XS_Win32__GUI__Rebar_SetBandInfo);
        newXS_deffile("Win32::GUI::Rebar::SetBarInfo", XS_Win32__GUI__Rebar_SetBarInfo);
        newXS_deffile("Win32::GUI::Rebar::SetBkColor", XS_Win32__GUI__Rebar_SetBkColor);
        newXS_deffile("Win32::GUI::Rebar::SetColorScheme", XS_Win32__GUI__Rebar_SetColorScheme);
        newXS_deffile("Win32::GUI::Rebar::SetPalette", XS_Win32__GUI__Rebar_SetPalette);
        newXS_deffile("Win32::GUI::Rebar::SetParent", XS_Win32__GUI__Rebar_SetParent);
        newXS_deffile("Win32::GUI::Rebar::SetTextColor", XS_Win32__GUI__Rebar_SetTextColor);
        newXS_deffile("Win32::GUI::Rebar::SetToolTips", XS_Win32__GUI__Rebar_SetToolTips);
        newXS_deffile("Win32::GUI::Rebar::SetUnicodeFormat", XS_Win32__GUI__Rebar_SetUnicodeFormat);
        newXS_deffile("Win32::GUI::Rebar::ShowBand", XS_Win32__GUI__Rebar_ShowBand);
        newXS_deffile("Win32::GUI::Rebar::SizeToRect", XS_Win32__GUI__Rebar_SizeToRect);
        newXS_deffile("Win32::GUI::Rebar::HideBand", XS_Win32__GUI__Rebar_HideBand);
#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
