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

#line 1 "StatusBar.xs"
    /*
    ###########################################################################
    # (@)PACKAGE:Win32::GUI::StatusBar
    #
    # $Id: StatusBar.xs,v 1.3 2004/04/08 21:23:39 lrocher Exp $
    #
    ###########################################################################
    */

#include "GUI.h"

void StatusBar_onPreCreate(NOTXSPROC LPPERLWIN32GUI_CREATESTRUCT perlcs) {

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

BOOL
StatusBar_onParseOption(NOTXSPROC char *option, SV* value, LPPERLWIN32GUI_CREATESTRUCT perlcs) {
    BOOL retval = TRUE;

    if BitmaskOptionValue("-sizegrip", perlcs->cs.style, SBARS_SIZEGRIP )
    } else retval = FALSE;

    return retval;
}

void
StatusBar_onPostCreate(NOTXSPROC HWND myhandle, LPPERLWIN32GUI_CREATESTRUCT perlcs) {

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

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

    return FALSE;
}

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

    int PerlResult = 1;

    return PerlResult;
}

#line 61 "StatusBar.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 205 "StatusBar.c"
#pragma message( "*** PACKAGE Win32::GUI::StatusBar..." )

XS_EUPXS(XS_Win32__GUI__StatusBar_GetBorders); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_GetBorders)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 67 "StatusBar.xs"
    int aBorders [3];
#line 220 "StatusBar.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 69 "StatusBar.xs"
    if(SendMessage(handle, SB_GETBORDERS, (WPARAM) 0, (LPARAM) aBorders) == TRUE) {
        EXTEND(SP,3);
        XST_mIV(0,aBorders[0]);
        XST_mIV(1,aBorders[1]);
        XST_mIV(2,aBorders[2]);
        XSRETURN(3);
    }
    else {
        XSRETURN_UNDEF;
    }
#line 242 "StatusBar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__StatusBar_GetIcon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_GetIcon)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, index");
    {
	HWND	handle;
	WPARAM	index = (WPARAM)SvUV(ST(1))
;
	HICON	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 88 "StatusBar.xs"
    RETVAL = (HICON) SendMessage(handle, SB_GETICON, index, 0);
#line 273 "StatusBar.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__StatusBar_GetParts); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_GetParts)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 101 "StatusBar.xs"
    int aWidths [256];
    int count;
#line 294 "StatusBar.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 104 "StatusBar.xs"
    count = (int) SendMessage(handle, SB_GETPARTS, (WPARAM) 256, (LPARAM) aWidths);
    if(GIMME_V == G_ARRAY) {
        EXTEND(SP, count);
        for(int i = 0; i < count; i++) {
            XST_mIV(i, aWidths[i]);
        }
        XSRETURN(count);
    }
    else {
        EXTEND(SP, 1);
        XST_mIV(0, count);
        XSRETURN(1);
    }
#line 319 "StatusBar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__StatusBar_GetRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_GetRect)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, part");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	int	part = (int)SvIV(ST(1))
;
#line 129 "StatusBar.xs"
    RECT Rect;
#line 340 "StatusBar.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 131 "StatusBar.xs"
    if(SendMessage(handle, SB_GETRECT, (WPARAM) part, (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 363 "StatusBar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__StatusBar_GetText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_GetText)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, part");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	int	part = (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 152 "StatusBar.xs"
    int gettextlength = (INT) SendMessage(handle, SB_GETTEXTLENGTH, (WPARAM) part, (LPARAM) 0); 

    short length = (short) LOWORD(gettextlength);
    short style  = (short) HIWORD(gettextlength);

    char * text = (char *) safemalloc(length + 1);
    SendMessage(handle, SB_GETTEXT, (WPARAM) part, (LPARAM) text);

    if(GIMME_V == G_ARRAY) {
        EXTEND(SP, 2);
        XST_mPV(0, text);
        safefree(text);
        XST_mIV(1, (I32) style);
        XSRETURN(2);
    }
    else {
        EXTEND(SP, 1);
        XST_mPV(0, text);
        safefree(text);
        XSRETURN(1);
    }
#line 414 "StatusBar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__StatusBar_GetTextLength); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_GetTextLength)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, part");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	int	part = (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 183 "StatusBar.xs"
    int gettextlength = (INT) SendMessage(handle, SB_GETTEXTLENGTH, (WPARAM) part, (LPARAM) 0); 

    short length = (short) LOWORD(gettextlength);
    short style  = (short) HIWORD(gettextlength);

    if(GIMME_V == G_ARRAY) {
        EXTEND(SP, 2);
        XST_mIV(0, (I32) length);
        XST_mIV(1, (I32) style);
        XSRETURN(2);
    }
    else {
        EXTEND(SP, 1);
        XST_mIV(0, (I32) length);
        XSRETURN(1);
    }
#line 460 "StatusBar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__StatusBar_GetTipText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_GetTipText)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, part");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	int	part = (int)SvIV(ST(1))
;
#line 208 "StatusBar.xs"
    char buffer [256];
#line 481 "StatusBar.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 210 "StatusBar.xs"
    SendMessage(handle, SB_GETTIPTEXT, (WPARAM) MAKEWPARAM(part, 255), (LPARAM) buffer);
    EXTEND(SP, 1);
    XST_mPV(0, buffer);
    XSRETURN(1);    
#line 497 "StatusBar.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__StatusBar_GetUnicodeFormat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_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 222 "StatusBar.xs"
    RETVAL = (BOOL) SendMessage(handle, SB_GETUNICODEFORMAT, 0, 0);
#line 526 "StatusBar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__StatusBar_IsSimple); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_IsSimple)
{
    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 233 "StatusBar.xs"
    RETVAL = (BOOL) SendMessage(handle, SB_ISSIMPLE, 0, 0);
#line 556 "StatusBar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__StatusBar_SetBkColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_SetBkColor)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, color = CLR_DEFAULT");
    {
	HWND	handle;
	COLORREF	color;

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

	if (items < 2)
	    color = CLR_DEFAULT;
	else {
    color = SvCOLORREF(NOTXSCALL ST(1))
;
	}
#line 247 "StatusBar.xs"
    SendMessage(handle,SB_SETBKCOLOR,(WPARAM) 0,(LPARAM) color);
#line 592 "StatusBar.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__StatusBar_SetIcon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_SetIcon)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, part, icon=NULL");
    {
	HWND	handle;
	int	part = (int)SvIV(ST(1))
;
	HICON	icon;
	BOOL	RETVAL;
	dXSTARG;

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

	if (items < 3)
	    icon = NULL;
	else {
    if(SvROK(ST(2))) {
	SV** out=hv_fetch((HV*)SvRV(ST(2)), "-handle", 7, 0);
	if(out != NULL)
	    icon = INT2PTR(HICON,SvIV(*out));
	else
	    icon = NULL;
    } else
       icon = INT2PTR(HICON,SvIV(ST(2)))
;
	}
#line 264 "StatusBar.xs"
    RETVAL = SendMessage(handle, SB_SETICON, (WPARAM) part, (LPARAM) icon);
#line 638 "StatusBar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__StatusBar_SetMinHeight); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_SetMinHeight)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, height");
    {
	HWND	handle;
	int	height = (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 280 "StatusBar.xs"
    SendMessage(handle, SB_SETMINHEIGHT, (WPARAM) height, (LPARAM) 0);
    SendMessage(handle, WM_SIZE, (WPARAM) 0, (LPARAM) 0);
#line 669 "StatusBar.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__StatusBar_SetParts); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_SetParts)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "handle, part, ...");
    {
	HWND	handle;
	UINT	part = (UINT)SvUV(ST(1))
;
#line 292 "StatusBar.xs"
    int     aWidths [256];
#line 687 "StatusBar.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 294 "StatusBar.xs"
    for(int i = 1; i < items; i++) {
        aWidths[i - 1] = (int) SvIV(ST(i));
    }
    RETVAL = SendMessage(handle, SB_SETPARTS, (WPARAM) items - 1, (LPARAM) aWidths);
#line 705 "StatusBar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__StatusBar_SetText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_SetText)
{
    dVAR; dXSARGS;
    if (items < 3 || items > 4)
       croak_xs_usage(cv,  "handle, part, text, type=0");
    {
	HWND	handle;
	UINT	part = (UINT)SvUV(ST(1))
;
	LPTSTR	text = (LPTSTR)SvPV_nolen(ST(2))
;
	UINT	type;
	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 < 4)
	    type = 0;
	else {
	    type = (UINT)SvUV(ST(3))
;
	}
#line 318 "StatusBar.xs"
    RETVAL = SendMessage(handle, SB_SETTEXT , (WPARAM) part | type, (LPARAM) text);
#line 747 "StatusBar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__StatusBar_SetTipText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_SetTipText)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "handle, part, text");
    {
	HWND	handle;
	int	part = (int)SvIV(ST(1))
;
	LPCTSTR	text = (LPCTSTR)SvPV_nolen(ST(2))
;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 340 "StatusBar.xs"
    SendMessage(handle, SB_SETTIPTEXT, (WPARAM) part, (LPARAM) text);
#line 780 "StatusBar.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Win32__GUI__StatusBar_SetUnicodeFormat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_SetUnicodeFormat)
{
    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 349 "StatusBar.xs"
    RETVAL = SendMessage(handle, SB_SETUNICODEFORMAT, 0, 0);
#line 808 "StatusBar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__StatusBar_Simple); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_Simple)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, mode=0");
    {
	HWND	handle;
	BOOL	mode;
	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)
	    mode = 0;
	else {
	    mode = (BOOL)SvIV(ST(1))
;
	}
#line 365 "StatusBar.xs"
    if(items == 2) {
        SendMessage(handle, SB_SIMPLE, (WPARAM) mode, (LPARAM) 0);
    }
    RETVAL = SendMessage(handle, SB_ISSIMPLE, (WPARAM) 0, (LPARAM) 0);
#line 849 "StatusBar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__StatusBar_Parts); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_Parts)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 388 "StatusBar.xs"
    int     aWidths [256];
#line 867 "StatusBar.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 390 "StatusBar.xs"
    if(items > 1) {
        for(int i = 1; i < items; i++) {
            aWidths[i - 1] = (int) SvIV(ST(i));
        }
        SendMessage(handle, SB_SETPARTS, (WPARAM) items - 1, (LPARAM) aWidths);
    }

    RETVAL = (int) SendMessage(handle, SB_GETPARTS, (WPARAM) 256, (LPARAM) aWidths);
    if(GIMME_V == G_ARRAY) {
        EXTEND(SP, RETVAL);
        for(int i = 0; i < RETVAL; i++) {
        XST_mIV(i, aWidths[i]);
    }
        XSRETURN(RETVAL);
    }
#line 896 "StatusBar.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__StatusBar_PartText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__StatusBar_PartText)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "handle, part, ...");
    {
	HWND	handle;
	int	part = (int)SvIV(ST(1))
;
#line 441 "StatusBar.xs"
    LRESULT gettextlength;
    short length;
    short style;
    char* text;
#line 919 "StatusBar.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 446 "StatusBar.xs"
    if(items == 4) {
        if(SendMessage(handle, SB_SETTEXT, (WPARAM) part | SvIV(ST(3)), (LPARAM) (LPCTSTR) SvPV_nolen(ST(2))) != TRUE)
            XSRETURN_YES;
    }
    else if (items == 3) {
        if(SendMessage(handle, SB_SETTEXT, (WPARAM) part, (LPARAM) (LPCTSTR) SvPV_nolen(ST(2))) == TRUE)
            XSRETURN_YES;
    }
    else if (items == 2) {
        gettextlength = SendMessage(handle, SB_GETTEXTLENGTH, (WPARAM) part, (LPARAM) 0);

        length = (short) LOWORD(gettextlength);
        style  = (short) HIWORD(gettextlength);

        text = (char *) safemalloc(length + 1);
        SendMessage(handle, SB_GETTEXT, (WPARAM) part, (LPARAM) text);

        if(GIMME_V == G_ARRAY) {
            EXTEND(SP, 2);
            XST_mPV(0, text);
            safefree(text);
            XST_mIV(1, (I32) style);
            XSRETURN(2);
        }
        else {
            EXTEND(SP, 1);
            XST_mPV(0, text);
            safefree(text);
            XSRETURN(1);
        }
    }
    XSRETURN_NO;
#line 963 "StatusBar.c"
    }
    XSRETURN(1);
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Win32__GUI__StatusBar); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Win32__GUI__StatusBar)
{
#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::StatusBar::GetBorders", XS_Win32__GUI__StatusBar_GetBorders);
        newXS_deffile("Win32::GUI::StatusBar::GetIcon", XS_Win32__GUI__StatusBar_GetIcon);
        newXS_deffile("Win32::GUI::StatusBar::GetParts", XS_Win32__GUI__StatusBar_GetParts);
        newXS_deffile("Win32::GUI::StatusBar::GetRect", XS_Win32__GUI__StatusBar_GetRect);
        newXS_deffile("Win32::GUI::StatusBar::GetText", XS_Win32__GUI__StatusBar_GetText);
        newXS_deffile("Win32::GUI::StatusBar::GetTextLength", XS_Win32__GUI__StatusBar_GetTextLength);
        newXS_deffile("Win32::GUI::StatusBar::GetTipText", XS_Win32__GUI__StatusBar_GetTipText);
        newXS_deffile("Win32::GUI::StatusBar::GetUnicodeFormat", XS_Win32__GUI__StatusBar_GetUnicodeFormat);
        newXS_deffile("Win32::GUI::StatusBar::IsSimple", XS_Win32__GUI__StatusBar_IsSimple);
        newXS_deffile("Win32::GUI::StatusBar::SetBkColor", XS_Win32__GUI__StatusBar_SetBkColor);
        cv = newXS_deffile("Win32::GUI::StatusBar::Icon", XS_Win32__GUI__StatusBar_SetIcon);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::StatusBar::SetIcon", XS_Win32__GUI__StatusBar_SetIcon);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::StatusBar::SetMinHeight", XS_Win32__GUI__StatusBar_SetMinHeight);
        newXS_deffile("Win32::GUI::StatusBar::SetParts", XS_Win32__GUI__StatusBar_SetParts);
        newXS_deffile("Win32::GUI::StatusBar::SetText", XS_Win32__GUI__StatusBar_SetText);
        cv = newXS_deffile("Win32::GUI::StatusBar::SetTipText", XS_Win32__GUI__StatusBar_SetTipText);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::StatusBar::Tip", XS_Win32__GUI__StatusBar_SetTipText);
        XSANY.any_i32 = 1;
        newXS_deffile("Win32::GUI::StatusBar::SetUnicodeFormat", XS_Win32__GUI__StatusBar_SetUnicodeFormat);
        newXS_deffile("Win32::GUI::StatusBar::Simple", XS_Win32__GUI__StatusBar_Simple);
        newXS_deffile("Win32::GUI::StatusBar::Parts", XS_Win32__GUI__StatusBar_Parts);
        newXS_deffile("Win32::GUI::StatusBar::PartText", XS_Win32__GUI__StatusBar_PartText);
#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
}

