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

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

#include "GUI.h"


void
Textfield_onPreCreate(NOTXSPROC LPPERLWIN32GUI_CREATESTRUCT perlcs) {

    perlcs->cs.lpszClass = "EDIT";
    perlcs->cs.style = WS_VISIBLE | WS_CHILD | WS_BORDER | ES_LEFT | ES_AUTOHSCROLL | ES_AUTOVSCROLL; // evtl. DS_3DLOOK?
    perlcs->cs.dwExStyle = WS_EX_CLIENTEDGE;
}

BOOL
Textfield_onParseOption(NOTXSPROC char *option, SV* value, LPPERLWIN32GUI_CREATESTRUCT perlcs) {
    BOOL retval;

    if(strcmp(option, "-align") == 0) {
        if(strcmp(SvPV_nolen(value), "left") == 0) {
            SwitchBit(perlcs->cs.style, ES_LEFT, 1);
            SwitchBit(perlcs->cs.style, ES_CENTER, 0);
            SwitchBit(perlcs->cs.style, ES_RIGHT, 0);
        } else if(strcmp(SvPV_nolen(value), "center") == 0) {
            SwitchBit(perlcs->cs.style, ES_LEFT, 0);
            SwitchBit(perlcs->cs.style, ES_CENTER, 1);
            SwitchBit(perlcs->cs.style, ES_RIGHT, 0);
        } else if(strcmp(SvPV_nolen(value), "right") == 0) {
            SwitchBit(perlcs->cs.style, ES_LEFT, 0);
            SwitchBit(perlcs->cs.style, ES_CENTER, 0);
            SwitchBit(perlcs->cs.style, ES_RIGHT, 1);
        } else {
            W32G_WARN("Win32::GUI: Invalid value for -align!");
        }
    } else if(strcmp(option, "-multiline") == 0) {
        if(SvIV(value)) {
            SwitchBit(perlcs->cs.style, ES_MULTILINE, 1);
            SwitchBit(perlcs->cs.style, ES_AUTOHSCROLL, 0);
        } else {
            SwitchBit(perlcs->cs.style, ES_MULTILINE, 0);
            SwitchBit(perlcs->cs.style, ES_AUTOHSCROLL, 1);
        }
    } else if BitmaskOptionValue("-keepselection", perlcs->cs.style, ES_NOHIDESEL)
    } else if BitmaskOptionValue("-readonly",      perlcs->cs.style, ES_READONLY)
    } else if BitmaskOptionValue("-password",      perlcs->cs.style, ES_PASSWORD)
    } else if BitmaskOptionValue("-lowercase",     perlcs->cs.style, ES_LOWERCASE)
    } else if BitmaskOptionValue("-uppercase",     perlcs->cs.style, ES_UPPERCASE)
    } else if BitmaskOptionValue("-autohscroll",   perlcs->cs.style, ES_AUTOHSCROLL)
    } else if BitmaskOptionValue("-autovscroll",   perlcs->cs.style, ES_AUTOVSCROLL)
    } else if BitmaskOptionValue("-number",        perlcs->cs.style, ES_NUMBER)
    } else if BitmaskOptionValue("-wantreturn",    perlcs->cs.style, ES_WANTRETURN)
    } else retval = FALSE;

    return retval;
}

void
Textfield_onPostCreate(NOTXSPROC HWND myhandle, LPPERLWIN32GUI_CREATESTRUCT perlcs) {
}

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

    BOOL retval = TRUE;

         if Parse_Event("GotFocus",   PERLWIN32GUI_NEM_GOTFOCUS)
    else if Parse_Event("LostFocus",  PERLWIN32GUI_NEM_LOSTFOCUS)
    else if Parse_Event("Change",     PERLWIN32GUI_NEM_CONTROL1)
    else if Parse_Event("Anonymous",  PERLWIN32GUI_NEM_CONTROL2)
    else if Parse_Event("Scroll",     PERLWIN32GUI_NEM_CONTROL3)
    else if Parse_Event("MaxText",    PERLWIN32GUI_NEM_CONTROL4)
    else if Parse_Event("Update",     PERLWIN32GUI_NEM_CONTROL5)
    else retval = FALSE;

    return retval;
}

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

    int PerlResult = 1;

    if ( uMsg == WM_COMMAND ) {

        switch(HIWORD(wParam)) {
        case EN_SETFOCUS:
            /*
             * (@)EVENT:GotFocus()
             * Sent when the control is activated.
             * (@)APPLIES_TO:Textfield, RichEdit
             */
            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_GOTFOCUS, "GotFocus", -1 );
            break;
        case EN_KILLFOCUS:
            /*
             * (@)EVENT:LostFocus()
             * Sent when the control is deactivated.
             * (@)APPLIES_TO:Textfield, RichEdit
             */
            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_LOSTFOCUS, "LostFocus", -1 );
            break;
        case EN_CHANGE:
            /*
             * (@)EVENT:Change()
             * Sent when the text in the field is changed by the user.
             * (@)APPLIES_TO:Textfield, RichEdit
             */
            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL1, "Change", -1 );
            break;
        case EN_HSCROLL:
        case EN_VSCROLL:
            /*
             * (@)EVENT:Scroll(SCROLLBAR)
             * Sent when one of the window scrollbars is moved. SCROLLBAR identifies
             * which bar was moved, 0 for horizontal and 1 for vertical.
             * (@)APPLIES_TO:Textfield, RichEdit
             */
            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL3, "Scroll",
                                 PERLWIN32GUI_ARGTYPE_INT, (uMsg == EN_HSCROLL ? 0 : 1),
                                 -1 );
            break;
        case EN_MAXTEXT :
            /*
             * (@)EVENT:MaxText()
             * Sent when text has exceeded the specified number of characters
             * (@)APPLIES_TO:Textfield, RichEdit
             */
            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL4, "MaxText", -1 );
            break;
        case EN_UPDATE:
            /*
             * (@)EVENT:Update()
             * Sent when an edit control is about to display altered text.
             * (@)APPLIES_TO:Textfield, RichEdit
             */
            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL5, "Update", -1 );
            break;

        default:
            PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL2, "Anonymous",
                PERLWIN32GUI_ARGTYPE_INT, HIWORD(wParam),
                -1 );
            break;

        }
    }

    return PerlResult;
}

   /*
    ###########################################################################
    # (@)PACKAGE:Win32::GUI::Textfield
    ###########################################################################
    */

#line 173 "Textfield.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 317 "Textfield.c"
#pragma message( "*** PACKAGE Win32::GUI::Textfield..." )

XS_EUPXS(XS_Win32__GUI__Textfield_CanUndo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_CanUndo)
{
    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 178 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_CANUNDO, 0, 0);
#line 343 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_CharFromPos); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_CharFromPos)
{
    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 194 "Textfield.xs"
    LRESULT cfp;
#line 367 "Textfield.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 196 "Textfield.xs"
    cfp = SendMessage(handle, EM_CHARFROMPOS, 0, (LPARAM) MAKELPARAM(x, y));
    if(cfp == -1) {
        XSRETURN_UNDEF;
    } else {
        EXTEND(SP, 2);
        XST_mIV(0, LOWORD(cfp));
        XST_mIV(1, HIWORD(cfp));
        XSRETURN(2);
    }
#line 388 "Textfield.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Textfield_EmptyUndoBuffer); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_EmptyUndoBuffer)
{
    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 215 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_EMPTYUNDOBUFFER, 0, 0);
#line 418 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_FmtLines); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_FmtLines)
{
    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 229 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_FMTLINES, value, 0);
#line 450 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_GetFirstVisibleLine); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_GetFirstVisibleLine)
{
    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 245 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_GETFIRSTVISIBLELINE, 0, 0);
#line 481 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_GetLimitText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_GetLimitText)
{
    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 261 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_GETLIMITTEXT, 0, 0);
#line 512 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_GetLine); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_GetLine)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "handle, line");
    {
	HWND	handle;
	WPARAM	line = (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 279 "Textfield.xs"
    LONG   index;
    WORD   size;
    LPTSTR pBuf;

    index = (LONG)SendMessage(handle, EM_LINEINDEX, line, 0);
    if (index < 0) { /* -1 if line greater than number of lines in control */
        XSRETURN_UNDEF;
    }

    size = (WORD)SendMessage(handle, EM_LINELENGTH, (WPARAM)index, 0);
    /* we don't check the error condition of size == 0, as we have
     * already checked the return value from EM_LINEINDEX, and have a valid
     * index.  A return value of zero means we have an empty line, and
     * should return that.
     */

    /* ensure buffer is big enough to hold a WORD */
    if (size < sizeof(WORD) ) {
        size = (sizeof(WORD)/sizeof(TCHAR));
    }
    /* allocate buffer, adding one for the NUL termination */
    /* TODO: The strategy used here results in the buffer being
    * copied twice: once from the textfield to pBuf, and then
    * a second time from pBuf into the SV.  We should create
    * an SV of the correct size, and pass the pointer to it's
    * buffer to EM_GETLINE
    */
    New(0, pBuf, (int)(size+1), TCHAR);

    /* put the size into the first word of the buffer */
    *((WORD*)pBuf) = size;

    /* get the text */
    size = (WORD)SendMessage(handle, EM_GETLINE, line, (LPARAM)pBuf);
    /* Again, we don't check the error condition of size == 0, as we have
     * already checked the return value from EM_LINEINDEX, and have a valid
     * line.  A return value of zero means we have an empty line, and
     * should return that.
     */

    /* ensure we are NUL terminated  - this is NOT done by EM_GETLINE */
    pBuf[size] = 0;

    /* return the text */
    EXTEND(SP, 1);
    XST_mPV(0, pBuf);
    Safefree(pBuf);
    XSRETURN(1);
#line 590 "Textfield.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_GetLineCount); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_GetLineCount)
{
    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 338 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_GETLINECOUNT, 0, 0);
#line 619 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_GetMargins); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_GetMargins)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 351 "Textfield.xs"
    LRESULT res;
#line 640 "Textfield.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 353 "Textfield.xs"
    res = SendMessage(handle, EM_GETMARGINS, 0, 0);
    EXTEND(SP, 2);
    XST_mIV(0, LOWORD(res));
    XST_mIV(1, HIWORD(res));
    XSRETURN(2);
#line 657 "Textfield.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Textfield_GetModify); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_GetModify)
{
    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 369 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_GETMODIFY, 0, 0);
#line 687 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_GetPasswordChar); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_GetPasswordChar)
{
    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 381 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_GETPASSWORDCHAR, 0, 0);
#line 717 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_GetRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_GetRect)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 395 "Textfield.xs"
    RECT myRect;
#line 738 "Textfield.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 397 "Textfield.xs"
    SendMessage(handle, EM_GETRECT, 0, (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 757 "Textfield.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Textfield_GetSel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_GetSel)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 417 "Textfield.xs"
    DWORD start;
    DWORD end;
#line 778 "Textfield.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 420 "Textfield.xs"
    SendMessage(handle, EM_GETSEL, (WPARAM) &start, (LPARAM) &end);
    EXTEND(SP, 2);
    XST_mIV(0, (long) start);
    XST_mIV(1, (long) end);
    XSRETURN(2);
#line 795 "Textfield.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Textfield_GetThumb); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_GetThumb)
{
    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 436 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_GETTHUMB, 0, 0);
#line 825 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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


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


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


XS_EUPXS(XS_Win32__GUI__Textfield_LineScroll); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_LineScroll)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "handle, x, y");
    {
	HWND	handle;
	WPARAM	x = (WPARAM)SvUV(ST(1))
;
	WPARAM	y = (WPARAM)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 491 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_LINESCROLL, x, (LPARAM) y);
#line 958 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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


XS_EUPXS(XS_Win32__GUI__Textfield_ReplaceSel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_ReplaceSel)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, string, flag=TRUE");
    {
	HWND	handle;
	LPCTSTR	string = (LPCTSTR)SvPV_nolen(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 = TRUE;
	else {
	    flag = (BOOL)SvIV(ST(2))
;
	}
#line 519 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_REPLACESEL, (WPARAM) flag, (LPARAM) string);
#line 1031 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_Scroll); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_Scroll)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, line, otherdirection=0");
    {
	SV*	handle = ST(0)
;
	SV*	line = ST(1)
;
	DWORD	otherdirection;
#line 533 "Textfield.xs"
    HWND hwnd;
    WPARAM wparam;
    char *arg;
#line 1056 "Textfield.c"
	LRESULT	RETVAL;
	dXSTARG;

	if (items < 3)
	    otherdirection = 0;
	else {
	    otherdirection = (DWORD)SvUV(ST(2))
;
	}
#line 537 "Textfield.xs"
    hwnd = handle_From(NOTXSCALL handle);
    if(items == 2) {
        if(SvPOK(line)) {
            arg = strlwr( SvPV_nolen(line) );

            if(0 == strcmp( arg, "bottom" )) {
                RETVAL = SendMessage( hwnd, EM_GETLINECOUNT, 0, 0 );
                wparam = RETVAL;
                RETVAL = SendMessage( hwnd, EM_GETFIRSTVISIBLELINE, 0, 0);
                wparam -= RETVAL;
                RETVAL = SendMessage( hwnd, EM_LINESCROLL, 0, wparam);
            } else if(0 == strcmp( arg, "top" )) {
                wparam = SendMessage( hwnd, EM_GETFIRSTVISIBLELINE, 0, 0);
                RETVAL = SendMessage( hwnd, EM_LINESCROLL, 0, (LPARAM) -((INT)wparam));
            } else {
                if(0 == strcmp( arg, "up" )) {
                    wparam = SB_LINEUP;
                } else if(0 == strcmp( arg, "down" )
                ||        0 == strcmp( arg, "dn" )) {
                    wparam = SB_LINEDOWN;
                } else if(0 == strcmp( arg, "pageup" )
                ||        0 == strcmp( arg, "pgup" )) {
                    wparam = SB_PAGEUP;
                } else if(0 == strcmp( arg, "pagedown" )
                ||        0 == strcmp( arg, "pagedn" )
                ||        0 == strcmp( arg, "pgdown" )
                ||        0 == strcmp( arg, "pgdn")) {
                    wparam = SB_PAGEDOWN;
                }
                RETVAL = SendMessage(
                    hwnd, EM_SCROLL, (WPARAM) wparam, (LPARAM) 0
                );
            }
        } else {
            RETVAL = SendMessage(
                hwnd, EM_LINESCROLL, 0, (WPARAM) SvIV(line)
            );
        }
    } else {
        if(sv_derived_from(handle, "Win32::GUI::RichEdit")) {
            RETVAL = SendMessage(
                hwnd, EM_LINESCROLL, 0, (WPARAM) otherdirection
            );
        } else {
            RETVAL = SendMessage(
                hwnd, EM_LINESCROLL, (LPARAM) SvIV(line), (WPARAM) otherdirection
            );
        }
    }
    SendMessage( hwnd , EM_SCROLLCARET, 0, 0);
#line 1117 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_ScrollCaret); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_ScrollCaret)
{
    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 599 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_SCROLLCARET, 0, 0);
#line 1148 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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


XS_EUPXS(XS_Win32__GUI__Textfield_SetMargins); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_SetMargins)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 3)
       croak_xs_usage(cv,  "handle, Left=0, Right=0");
    {
	HWND	handle;
	int	Left;
	int	Right;
	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)
	    Left = 0;
	else {
	    Left = (int)SvIV(ST(1))
;
	}

	if (items < 3)
	    Right = 0;
	else {
	    Right = (int)SvIV(ST(2))
;
	}
#line 627 "Textfield.xs"
    WPARAM flag = EC_USEFONTINFO;
    if (items == 2)
        flag = EC_LEFTMARGIN;
    else if (items == 3)
        flag = EC_LEFTMARGIN | EC_RIGHTMARGIN;
    RETVAL = SendMessage(handle, EM_SETMARGINS, flag, (LPARAM) MAKELONG(Left, Right));
#line 1232 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_SetModify); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_SetModify)
{
    dVAR; dXSARGS;
    dXSI32;
    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 646 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_SETMODIFY, value, 0);
#line 1265 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_SetPasswordChar); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_SetPasswordChar)
{
    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 658 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_SETPASSWORDCHAR, value, 0);
#line 1297 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_SetReadOnly); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_SetReadOnly)
{
    dVAR; dXSARGS;
    dXSI32;
    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 672 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_SETREADONLY, value, 0);
#line 1330 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_SetRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_SetRect)
{
    dVAR; dXSARGS;
    if (items < 5 || items > 6)
       croak_xs_usage(cv,  "handle, left, top, right, bottom, flag=1");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	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))
;
	int	flag;
#line 688 "Textfield.xs"
    RECT myRect;
#line 1359 "Textfield.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 < 6)
	    flag = 1;
	else {
	    flag = (int)SvIV(ST(5))
;
	}
#line 690 "Textfield.xs"
    myRect.left   = left;
    myRect.top    = top;
    myRect.right  = right;
    myRect.bottom = bottom;
    SendMessage(handle, (flag ? EM_SETRECT : EM_SETRECTNP), 0, (LPARAM) &myRect);
#line 1383 "Textfield.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__Textfield_SetSel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_SetSel)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "handle, start, end");
    {
	HWND	handle;
	WPARAM	start = (WPARAM)SvUV(ST(1))
;
	WPARAM	end = (WPARAM)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 709 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_SETSEL, start, (LPARAM) end);
#line 1417 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_SetTabStops); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_SetTabStops)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "handle, tab, ...");
    {
	HWND	handle;
	UINT	tab = (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 721 "Textfield.xs"
    DWORD * pBuf = (DWORD *) safemalloc(items * sizeof(DWORD));
    for (int i = 1; i < items; i++)
        pBuf[i] = (DWORD)SvIV(ST(i));
    RETVAL = SendMessage(handle, EM_SETTABSTOPS, items-1, (LPARAM) pBuf);
    safefree(pBuf);
#line 1453 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 745 "Textfield.xs"
    RETVAL = SendMessage(handle, WM_UNDO, 0, 0);
#line 1484 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 758 "Textfield.xs"
    RETVAL = SendMessage(handle, WM_CLEAR, 0, 0);
#line 1515 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 771 "Textfield.xs"
    RETVAL = SendMessage(handle, WM_COPY, 0, 0);
#line 1546 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 784 "Textfield.xs"
    RETVAL = SendMessage(handle, WM_CUT, 0, 0);
#line 1577 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 797 "Textfield.xs"
    RETVAL = SendMessage(handle, WM_PASTE, 0, 0);
#line 1608 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_CanPaste); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_CanPaste)
{
    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 808 "Textfield.xs"
    RETVAL = IsClipboardFormatAvailable(CF_TEXT);
#line 1638 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_ReadOnly); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_ReadOnly)
{
    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 819 "Textfield.xs"
    if(items > 1)
        RETVAL = SendMessage(handle, EM_SETREADONLY, (WPARAM) (BOOL) SvIV(ST(1)), 0);
    else
        RETVAL = (((LONG)GetWindowLongPtr(handle, GWL_STYLE)) & ES_READONLY);
#line 1671 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_Modify); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_Modify)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
	BOOL	RETVAL;
	dXSTARG;

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 835 "Textfield.xs"
    if(items > 1)
        RETVAL = SendMessage(handle, EM_SETMODIFY, (WPARAM) (UINT) SvIV(ST(1)), 0);
    else
        RETVAL = SendMessage(handle, EM_GETMODIFY, 0, 0);
#line 1705 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_LimitText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_LimitText)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, value=0");
    {
	HWND	handle;
	WPARAM	value;
	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)
	    value = 0;
	else {
	    value = (WPARAM)SvUV(ST(1))
;
	}
#line 852 "Textfield.xs"
    if(items == 1) {
        RETVAL = SendMessage(handle, EM_GETLIMITTEXT, 0, 0);
    } else {
        RETVAL = SendMessage(handle, EM_SETLIMITTEXT, (WPARAM) value, 0);
    }
#line 1748 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_PasswordChar); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_PasswordChar)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, passchar=0");
    {
	HWND	handle;
	UINT	passchar;
	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)
	    passchar = 0;
	else {
	    passchar = (UINT)SvUV(ST(1))
;
	}
#line 867 "Textfield.xs"
    if(items == 1) {
        RETVAL = SendMessage(handle, EM_GETPASSWORDCHAR, 0, 0);
    } else {
        RETVAL = SendMessage(handle, EM_SETPASSWORDCHAR, (WPARAM) passchar, 0);
    }
#line 1790 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_HaveSel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_HaveSel)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
#line 882 "Textfield.xs"
    DWORD start;
    DWORD end;
#line 1809 "Textfield.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 885 "Textfield.xs"
    SendMessage(handle, EM_GETSEL, (WPARAM) &start, (LPARAM) &end);
    RETVAL = (start != end);
#line 1825 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_SelectAll); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_SelectAll)
{
    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 896 "Textfield.xs"
    RETVAL = SendMessage(handle, EM_SETSEL, 0, -1);
#line 1855 "Textfield.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__Textfield_Append); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__Textfield_Append)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, text");
    {
	HWND	handle;
	char *	text = (char *)SvPV_nolen(ST(1))
;
#line 907 "Textfield.xs"
    int length;
#line 1875 "Textfield.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 909 "Textfield.xs"
    length = GetWindowTextLength(handle);
    SendMessage(handle, EM_SETSEL, length, length);
    SendMessage(handle, EM_REPLACESEL, (WPARAM) TRUE, (LPARAM) text);
#line 1890 "Textfield.c"
    }
    XSRETURN_EMPTY;
}

#ifdef __cplusplus
extern "C" {
#endif
XS_EXTERNAL(boot_Win32__GUI__Textfield); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Win32__GUI__Textfield)
{
#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

        cv = newXS_deffile("Win32::GUI::RichEdit::CanUndo", XS_Win32__GUI__Textfield_CanUndo);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::CanUndo", XS_Win32__GUI__Textfield_CanUndo);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::Textfield::CharFromPos", XS_Win32__GUI__Textfield_CharFromPos);
        cv = newXS_deffile("Win32::GUI::RichEdit::EmptyUndoBuffer", XS_Win32__GUI__Textfield_EmptyUndoBuffer);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::EmptyUndoBuffer", XS_Win32__GUI__Textfield_EmptyUndoBuffer);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::Textfield::FmtLines", XS_Win32__GUI__Textfield_FmtLines);
        cv = newXS_deffile("Win32::GUI::RichEdit::FirstVisibleLine", XS_Win32__GUI__Textfield_GetFirstVisibleLine);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("Win32::GUI::RichEdit::GetFirstVisibleLine", XS_Win32__GUI__Textfield_GetFirstVisibleLine);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("Win32::GUI::Textfield::FirstVisibleLine", XS_Win32__GUI__Textfield_GetFirstVisibleLine);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::GetFirstVisibleLine", XS_Win32__GUI__Textfield_GetFirstVisibleLine);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::GetLimitText", XS_Win32__GUI__Textfield_GetLimitText);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::GetLimitText", XS_Win32__GUI__Textfield_GetLimitText);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::GetLine", XS_Win32__GUI__Textfield_GetLine);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::GetLine", XS_Win32__GUI__Textfield_GetLine);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::GetLineCount", XS_Win32__GUI__Textfield_GetLineCount);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::GetLineCount", XS_Win32__GUI__Textfield_GetLineCount);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::GetMargins", XS_Win32__GUI__Textfield_GetMargins);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::GetMargins", XS_Win32__GUI__Textfield_GetMargins);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::GetModify", XS_Win32__GUI__Textfield_GetModify);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::GetModify", XS_Win32__GUI__Textfield_GetModify);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::Textfield::GetPasswordChar", XS_Win32__GUI__Textfield_GetPasswordChar);
        cv = newXS_deffile("Win32::GUI::RichEdit::GetRect", XS_Win32__GUI__Textfield_GetRect);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::GetRect", XS_Win32__GUI__Textfield_GetRect);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::Textfield::GetSel", XS_Win32__GUI__Textfield_GetSel);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::Textfield::Selection", XS_Win32__GUI__Textfield_GetSel);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::RichEdit::GetThumb", XS_Win32__GUI__Textfield_GetThumb);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::GetThumb", XS_Win32__GUI__Textfield_GetThumb);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::Textfield::LineFromChar", XS_Win32__GUI__Textfield_LineFromChar);
        cv = newXS_deffile("Win32::GUI::RichEdit::LineIndex", XS_Win32__GUI__Textfield_LineIndex);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::LineIndex", XS_Win32__GUI__Textfield_LineIndex);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::LineLength", XS_Win32__GUI__Textfield_LineLength);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::LineLength", XS_Win32__GUI__Textfield_LineLength);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::LineScroll", XS_Win32__GUI__Textfield_LineScroll);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::LineScroll", XS_Win32__GUI__Textfield_LineScroll);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::Textfield::PosFromChar", XS_Win32__GUI__Textfield_PosFromChar);
        cv = newXS_deffile("Win32::GUI::RichEdit::ReplaceSel", XS_Win32__GUI__Textfield_ReplaceSel);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::ReplaceSel", XS_Win32__GUI__Textfield_ReplaceSel);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::Scroll", XS_Win32__GUI__Textfield_Scroll);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::Scroll", XS_Win32__GUI__Textfield_Scroll);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::ScrollCaret", XS_Win32__GUI__Textfield_ScrollCaret);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::ScrollCaret", XS_Win32__GUI__Textfield_ScrollCaret);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::SetLimitText", XS_Win32__GUI__Textfield_SetLimitText);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::SetLimitText", XS_Win32__GUI__Textfield_SetLimitText);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::Textfield::SetMargins", XS_Win32__GUI__Textfield_SetMargins);
        cv = newXS_deffile("Win32::GUI::RichEdit::SetModify", XS_Win32__GUI__Textfield_SetModify);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::SetModify", XS_Win32__GUI__Textfield_SetModify);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::Textfield::SetPasswordChar", XS_Win32__GUI__Textfield_SetPasswordChar);
        cv = newXS_deffile("Win32::GUI::RichEdit::SetReadOnly", XS_Win32__GUI__Textfield_SetReadOnly);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::SetReadOnly", XS_Win32__GUI__Textfield_SetReadOnly);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::Textfield::SetRect", XS_Win32__GUI__Textfield_SetRect);
        cv = newXS_deffile("Win32::GUI::Textfield::Select", XS_Win32__GUI__Textfield_SetSel);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::SetSel", XS_Win32__GUI__Textfield_SetSel);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::Textfield::SetTabStops", XS_Win32__GUI__Textfield_SetTabStops);
        cv = newXS_deffile("Win32::GUI::RichEdit::Undo", XS_Win32__GUI__Textfield_Undo);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::Undo", XS_Win32__GUI__Textfield_Undo);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::Clear", XS_Win32__GUI__Textfield_Clear);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::Clear", XS_Win32__GUI__Textfield_Clear);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::Copy", XS_Win32__GUI__Textfield_Copy);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::Copy", XS_Win32__GUI__Textfield_Copy);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::Cut", XS_Win32__GUI__Textfield_Cut);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::Cut", XS_Win32__GUI__Textfield_Cut);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::Paste", XS_Win32__GUI__Textfield_Paste);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::Paste", XS_Win32__GUI__Textfield_Paste);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::Textfield::CanPaste", XS_Win32__GUI__Textfield_CanPaste);
        newXS_deffile("Win32::GUI::Textfield::ReadOnly", XS_Win32__GUI__Textfield_ReadOnly);
        cv = newXS_deffile("Win32::GUI::TextField::Modified", XS_Win32__GUI__Textfield_Modify);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::Textfield::Modify", XS_Win32__GUI__Textfield_Modify);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::Textfield::LimitText", XS_Win32__GUI__Textfield_LimitText);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::Textfield::MaxLength", XS_Win32__GUI__Textfield_LimitText);
        XSANY.any_i32 = 1;
        newXS_deffile("Win32::GUI::Textfield::PasswordChar", XS_Win32__GUI__Textfield_PasswordChar);
        newXS_deffile("Win32::GUI::Textfield::HaveSel", XS_Win32__GUI__Textfield_HaveSel);
        newXS_deffile("Win32::GUI::Textfield::SelectAll", XS_Win32__GUI__Textfield_SelectAll);
        newXS_deffile("Win32::GUI::Textfield::Append", XS_Win32__GUI__Textfield_Append);
#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
