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

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

#include "GUI.h"

void 
RichEdit_onPreCreate(NOTXSPROC LPPERLWIN32GUI_CREATESTRUCT perlcs) {

    perlcs->cs.lpszClass = "RichEdit";
    perlcs->cs.style = WS_VISIBLE | WS_CHILD | ES_MULTILINE | ES_AUTOHSCROLL | ES_AUTOVSCROLL;
    perlcs->cs.dwExStyle = WS_EX_CLIENTEDGE;
}

BOOL
RichEdit_onParseOption(NOTXSPROC char *option, SV* value, LPPERLWIN32GUI_CREATESTRUCT perlcs) {
    return Textfield_onParseOption (NOTXSCALL option, value, perlcs);
}

void
RichEdit_onPostCreate(NOTXSPROC HWND myhandle, LPPERLWIN32GUI_CREATESTRUCT perlcs) {

    if(perlcs->clrForeground != CLR_INVALID) {
        CHARFORMAT cf;
        ZeroMemory(&cf, sizeof(CHARFORMAT));
        cf.cbSize = sizeof(CHARFORMAT);
        cf.dwMask = CFM_COLOR;
        cf.crTextColor = perlcs->clrForeground;
        SendMessage (myhandle, EM_SETCHARFORMAT, (WPARAM)SCF_ALL, (LPARAM)&cf);
        perlcs->clrForeground = CLR_INVALID;  // Don't Store
    }

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

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

    return Textfield_onParseEvent(NOTXSCALL name, eventID);
}

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

    return Textfield_onEvent (NOTXSCALL perlud, uMsg, wParam, lParam);
}

#line 67 "RichEdit.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 211 "RichEdit.c"
#pragma message( "*** PACKAGE Win32::GUI::RichEdit..." )

XS_EUPXS(XS_Win32__GUI__RichEdit_AutoURLDetect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_AutoURLDetect)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, flag=TRUE");
    {
	HWND	handle;
	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 < 2)
	    flag = TRUE;
	else {
	    flag = (BOOL)SvIV(ST(1))
;
	}
#line 76 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_AUTOURLDETECT, (WPARAM) flag, 0);
#line 244 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_CanPaste); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_CanPaste)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, value=CF_TEXT");
    {
	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 = CF_TEXT;
	else {
	    value = (WPARAM)SvUV(ST(1))
;
	}
#line 89 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_CANPASTE, value, 0);
#line 282 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_CanRedo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_CanRedo)
{
    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 101 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_CANREDO, 0, 0);
#line 312 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_DisplayBand); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_DisplayBand)
{
    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 117 "RichEdit.xs"
    RECT myRect;
#line 338 "RichEdit.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 119 "RichEdit.xs"
    myRect.left   = left;
    myRect.top    = top;
    myRect.right  = right;
    myRect.bottom = bottom;
    RETVAL = SendMessage(handle, EM_DISPLAYBAND, 0, (LPARAM) &myRect);
#line 357 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetSel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetSel)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 138 "RichEdit.xs"
    CHARRANGE cr;
#line 378 "RichEdit.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 140 "RichEdit.xs"
    ZeroMemory(&cr, sizeof(CHARRANGE));
    SendMessage(handle, EM_EXGETSEL, 0, (LPARAM) (CHARRANGE FAR *) &cr);
    EXTEND(SP, 2);
    XST_mIV(0, cr.cpMin);
    XST_mIV(1, cr.cpMax);
    XSRETURN(2);
#line 396 "RichEdit.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__RichEdit_LimiteText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_LimiteText)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "handle, length");
    {
	HWND	handle;
	long	length = (long)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 160 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_EXLIMITTEXT, 0, (LPARAM) length);
#line 428 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_LineFromChar); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_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 172 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_EXLINEFROMCHAR, 0, (LPARAM) index);
#line 460 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_SetSel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_SetSel)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "handle, start, end");
    {
	HWND	handle;
	LONG	start = (LONG)SvIV(ST(1))
;
	LONG	end = (LONG)SvIV(ST(2))
;
#line 188 "RichEdit.xs"
    CHARRANGE cr;
#line 483 "RichEdit.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 190 "RichEdit.xs"
    ZeroMemory(&cr, sizeof(CHARRANGE));
    cr.cpMin = start;
    cr.cpMax = end;
    RETVAL = SendMessage(handle, EM_EXSETSEL, 0, (LPARAM) (CHARRANGE FAR *) &cr);
#line 501 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_FindText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_FindText)
{
    dVAR; dXSARGS;
    if (items < 4 || items > 5)
       croak_xs_usage(cv,  "handle, string, start, end, flag=0");
    {
	HWND	handle;
	LPTSTR	string = (LPTSTR)SvPV_nolen(ST(1))
;
	LONG	start = (LONG)SvIV(ST(2))
;
	LONG	end = (LONG)SvIV(ST(3))
;
	WPARAM	flag;
#line 208 "RichEdit.xs"
    FINDTEXTEX ft;
    LRESULT res;
#line 527 "RichEdit.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 < 5)
	    flag = 0;
	else {
	    flag = (WPARAM)SvUV(ST(4))
;
	}
#line 211 "RichEdit.xs"
    ZeroMemory(&ft, sizeof(FINDTEXTEX));
    ft.chrg.cpMin = start;
    ft.chrg.cpMax = end;
    ft.lpstrText = string;
    res = SendMessage(handle, EM_FINDTEXTEX, flag, (LPARAM) (CHARRANGE FAR *) &ft);

    if(GIMME == G_ARRAY) {
        if (res != -1) {
            EXTEND(SP, 2);
            XST_mIV(0, ft.chrg.cpMin);
            XST_mIV(1, ft.chrg.cpMax);
            XSRETURN(2);
        }
        else
            XSRETURN_UNDEF;
    }
    else {
        EXTEND(SP, 1);
        XST_mIV(0, res);
        XSRETURN(1);
    }
#line 567 "RichEdit.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_FindWordBreak); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_FindWordBreak)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, index, flag=WB_NEXTBREAK");
    {
	HWND	handle;
	LPARAM	index;
	WPARAM	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(SvPOK(ST(1)))
      index = (LPARAM) SvPV_nolen(ST(1));
    else
      index = (LPARAM) SvIV(ST(1))
;

	if (items < 3)
	    flag = WB_NEXTBREAK;
	else {
	    flag = (WPARAM)SvUV(ST(2))
;
	}
#line 242 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_FINDWORDBREAK, flag, index);
#line 610 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetAutoURLDetect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetAutoURLDetect)
{
    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 254 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_GETAUTOURLDETECT, 0, 0);
#line 640 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetCharFormat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetCharFormat)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "handle, flag=1");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	BOOL	flag;
#line 285 "RichEdit.xs"
    CHARFORMAT cf;
    DWORD dwMask;
    int si;
#line 663 "RichEdit.c"

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

	if (items < 2)
	    flag = 1;
	else {
	    flag = (BOOL)SvIV(ST(1))
;
	}
#line 289 "RichEdit.xs"
    ZeroMemory(&cf, sizeof(CHARFORMAT));
    cf.cbSize = sizeof(CHARFORMAT);
    dwMask = SendMessage(
        handle, EM_GETCHARFORMAT, (WPARAM) flag, (LPARAM) (CHARFORMAT FAR *) &cf
    );
    si = 0;
    if(dwMask & CFM_BOLD) {
        EXTEND(SP, 2);
        XST_mPV(si++, "-bold");
        XST_mIV(si++, (cf.dwEffects & CFE_BOLD) ? 1 : 0);
    }
    if(dwMask & CFM_COLOR) {
        EXTEND(SP, 2);
        XST_mPV(si++, "-color");
        XST_mIV(si++, (long) cf.crTextColor);
    }
    if(dwMask & CFM_FACE) {
        EXTEND(SP, 2);
        XST_mPV(si++, "-name");
        XST_mPV(si++, cf.szFaceName);
    }
    if(dwMask & CFM_ITALIC) {
        EXTEND(SP, 2);
        XST_mPV(si++, "-italic");
        XST_mIV(si++, (cf.dwEffects & CFE_ITALIC) ? 1 : 0);
    }
    if(dwMask & CFM_SIZE) {
        EXTEND(SP, 2);
        XST_mPV(si++, "-size");
        XST_mIV(si++, cf.yHeight);
    }
    if(dwMask & CFM_STRIKEOUT) {
        EXTEND(SP, 2);
        XST_mPV(si++, "-strikeout");
        XST_mIV(si++, (cf.dwEffects & CFE_STRIKEOUT) ? 1 : 0);
    }
    if(dwMask & CFM_UNDERLINE) {
        EXTEND(SP, 2);
        XST_mPV(si++, "-underline");
        XST_mIV(si++, (cf.dwEffects & CFE_UNDERLINE) ? 1 : 0);
    }
    XSRETURN(si);
#line 724 "RichEdit.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetEditStyle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetEditStyle)
{
    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 339 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_GETEDITSTYLE, 0, 0);
#line 753 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetEventMask); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetEventMask)
{
    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 350 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_GETEVENTMASK, 0, 0);
#line 783 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetIMEOptions); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetIMEOptions)
{
    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 364 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_GETIMEOPTIONS, 0, 0);
#line 813 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetLangOptions); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetLangOptions)
{
    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 375 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_GETLANGOPTIONS, 0, 0);
#line 843 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetOptions); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetOptions)
{
    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 388 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_GETOPTIONS, 0, 0);
#line 873 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetRedoName); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetRedoName)
{
    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 402 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_GETREDONAME, 0, 0);
#line 903 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetSelText); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetSelText)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
#line 413 "RichEdit.xs"
    CHARRANGE cr;
#line 923 "RichEdit.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 415 "RichEdit.xs"
    ZeroMemory(&cr, sizeof(CHARRANGE));
    SendMessage(handle, EM_EXGETSEL, 0, (LPARAM) (CHARRANGE FAR *) &cr);
    if (cr.cpMin + cr.cpMax > 0) {
        char * pBuf = (char *) safemalloc(cr.cpMin + cr.cpMax + 16); 
        LRESULT size = SendMessage(handle, EM_GETSELTEXT, 0, (LPARAM) pBuf);
        pBuf[size] = '\0';

        EXTEND(SP, 1);
        XST_mPV(0, pBuf);
        safefree (pBuf);
        XSRETURN(1);
    }
    else
        XSRETURN_UNDEF;
#line 949 "RichEdit.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetTextLength); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetTextLength)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	HWND	handle;
#line 439 "RichEdit.xs"
    GETTEXTLENGTHEX tl;
#line 967 "RichEdit.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 441 "RichEdit.xs"
    ZeroMemory(&tl, sizeof(GETTEXTLENGTHEX));
    tl.flags = GTL_DEFAULT;
    tl.codepage = CP_ACP;
    RETVAL = SendMessage(
        handle, EM_GETTEXTLENGTHEX, (WPARAM) (GETTEXTLENGTHEX FAR *) &tl, 0
    );
#line 987 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetTextMode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetTextMode)
{
    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 457 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_GETTEXTMODE, 0, 0);
#line 1017 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetTextRange); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetTextRange)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, start, length");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	HWND	handle;
	LONG	start = (LONG)SvIV(ST(1))
;
	LONG	length = (LONG)SvIV(ST(2))
;
#line 470 "RichEdit.xs"
    TEXTRANGE tr;
    LRESULT count;
#line 1042 "RichEdit.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 473 "RichEdit.xs"
    ZeroMemory(&tr, sizeof(TEXTRANGE));
    if(length < 0) length = 0;
    if(start < 0)   start = 0;

    tr.chrg.cpMin = start;
    tr.chrg.cpMax = start+length;
    tr.lpstrText = (char *) safemalloc(length+1);
    count = SendMessage(handle, EM_GETTEXTRANGE, 0, (LPARAM) (TEXTRANGE FAR *) &tr);
    tr.lpstrText[count] = '\0';
    EXTEND(SP, 1);
    XST_mPV(0, tr.lpstrText);
    safefree(tr.lpstrText);
    XSRETURN(1);
#line 1067 "RichEdit.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetTypographyOptions); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetTypographyOptions)
{
    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 494 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_GETTYPOGRAPHYOPTIONS, 0, 0);
#line 1096 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetUndoName); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetUndoName)
{
    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 505 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_GETUNDONAME, 0, 0);
#line 1126 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_GetWordWrapMode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_GetWordWrapMode)
{
    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 518 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_GETWORDWRAPMODE, 0, 0);
#line 1156 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_HideSelection); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_HideSelection)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 3)
       croak_xs_usage(cv,  "handle, hide=TRUE, style=FALSE");
    {
	HWND	handle;
	BOOL	hide;
	BOOL	style;
	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)
	    hide = TRUE;
	else {
	    hide = (BOOL)SvIV(ST(1))
;
	}

	if (items < 3)
	    style = FALSE;
	else {
	    style = (BOOL)SvIV(ST(2))
;
	}
#line 531 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_HIDESELECTION, (WPARAM) hide, (LPARAM) style);
#line 1202 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_Redo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_Redo)
{
    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 544 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_REDO, 0, 0);
#line 1232 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_RequestResize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_RequestResize)
{
    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 555 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_REQUESTRESIZE, 0, 0);
#line 1262 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_SelectionType); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_SelectionType)
{
    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 566 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_SELECTIONTYPE, 0, 0);
#line 1292 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_SetBkgndColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_SetBkgndColor)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 1 || items > 3)
       croak_xs_usage(cv,  "handle, color=(COLORREF) -1, flag = 0");
    {
	HWND	handle;
	COLORREF	color;
	WPARAM	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 < 2)
	    color = (COLORREF) -1;
	else {
    color = SvCOLORREF(NOTXSCALL ST(1))
;
	}

	if (items < 3)
	    flag = 0;
	else {
	    flag = (WPARAM)SvUV(ST(2))
;
	}
#line 581 "RichEdit.xs"
    if(color < 0) {
        color = 0;
        flag = 1;
    } else {
        flag = 0;
    }
    RETVAL = SendMessage(handle, EM_SETBKGNDCOLOR, flag, (LPARAM) color);
#line 1345 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_SetCharFormat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_SetCharFormat)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 609 "RichEdit.xs"
    CHARFORMAT cf;
    int i, next_i;
    char * option;
#line 1365 "RichEdit.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 613 "RichEdit.xs"
    ZeroMemory(&cf, sizeof(CHARFORMAT));
    cf.cbSize = sizeof(CHARFORMAT);
    next_i = -1;
    for(i = 1; i < items; i++) {
        if(next_i == -1) {
            option = SvPV_nolen(ST(i));
            if(strcmp(option, "-bold") == 0) {
                next_i = i + 1;
                if(SvIV(ST(next_i)) != 0) {
                    cf.dwEffects = cf.dwEffects | CFE_BOLD;
                }
                cf.dwMask = cf.dwMask | CFM_BOLD;
            }
            if(strcmp(option, "-italic") == 0) {
                next_i = i + 1;
                if(SvIV(ST(next_i)) != 0) {
                    cf.dwEffects = cf.dwEffects | CFE_ITALIC;
                }
                cf.dwMask = cf.dwMask | CFM_ITALIC;
            }
            if(strcmp(option, "-underline") == 0) {
                next_i = i + 1;
                if(SvIV(ST(next_i)) != 0) {
                    cf.dwEffects = cf.dwEffects | CFE_UNDERLINE;
                }
                cf.dwMask = cf.dwMask | CFM_UNDERLINE;
            }
            if(strcmp(option, "-strikeout") == 0) {
                next_i = i + 1;
                if(SvIV(ST(next_i)) != 0) {
                    cf.dwEffects = cf.dwEffects | CFE_STRIKEOUT;
                }
                cf.dwMask = cf.dwMask | CFM_STRIKEOUT;
            }
            if(strcmp(option, "-color") == 0) {
                next_i = i + 1;
                cf.crTextColor = SvCOLORREF(NOTXSCALL ST(next_i));
                cf.dwMask = cf.dwMask | CFM_COLOR;
            }
            if(strcmp(option, "-autocolor") == 0) {
                next_i = i + 1;
                if(SvIV(ST(next_i)) != 0) {
                    cf.dwEffects = cf.dwEffects | CFE_AUTOCOLOR;
                    cf.dwMask = cf.dwMask | CFM_COLOR;
                }
            }
            if(strcmp(option, "-height") == 0
            || strcmp(option, "-size") == 0) {
                next_i = i + 1;
                cf.yHeight = (LONG) SvIV(ST(next_i));
                cf.dwMask = cf.dwMask | CFM_SIZE;
            }
            if(strcmp(option, "-name") == 0) {
                next_i = i + 1;
                strncpy((char *)cf.szFaceName, SvPV_nolen(ST(next_i)), 32);
                cf.dwMask = cf.dwMask | CFM_FACE;
            }
        } else {
            next_i = -1;
        }
    }
    RETVAL = SendMessage(handle, EM_SETCHARFORMAT,
                         (WPARAM) (UINT) SCF_SELECTION,
                         (LPARAM) (CHARFORMAT FAR *) &cf);
#line 1443 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_SetEditStyle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_SetEditStyle)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, style, mask");
    {
	HWND	handle;
	DWORD	style = (DWORD)SvUV(ST(1))
;
	DWORD	mask = (DWORD)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 689 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_SETEDITSTYLE, (WPARAM) style, (LPARAM) mask);
#line 1477 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 731 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_SETEVENTMASK, 0, (LPARAM)mask);
#line 1509 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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

    if(SvROK(ST(0))) {
        SV** out=hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0);
        if(out != NULL)
            handle = INT2PTR(HWND,SvIV(*out));
        else
            handle = NULL;
    } else
       handle = INT2PTR(HWND,SvIV(ST(0)))
;
#line 746 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_SETLANGOPTIONS, 0, (LPARAM)mask);
#line 1541 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_SetOptions); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_SetOptions)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, operation, options");
    {
	HWND	handle;
	UINT	operation = (UINT)SvUV(ST(1))
;
	UINT	options = (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 761 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_SETOPTIONS, (WPARAM) operation, (LPARAM) options);
#line 1575 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_SetParaFormat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_SetParaFormat)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "handle, ...");
    {
	HWND	handle;
#line 771 "RichEdit.xs"
    PARAFORMAT pf;
    int i, next_i;
    char * option;
#line 1595 "RichEdit.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 775 "RichEdit.xs"
    ZeroMemory(&pf, sizeof(PARAFORMAT));
    pf.cbSize = sizeof(PARAFORMAT);
    next_i = -1;
    for(i = 1; i < items; i++) {
        if(next_i == -1) {
            option = SvPV_nolen(ST(i));
            if(strcmp(option, "-numbering") == 0
            || strcmp(option, "-bullet") == 0) {
                next_i = i + 1;
                if(SvIV(ST(next_i)) != 0) {
                    pf.wNumbering = PFN_BULLET;
                } else {
                    pf.wNumbering = 0;
                }
                pf.dwMask = pf.dwMask | PFM_NUMBERING;
            } else if(strcmp(option, "-align") == 0) {
                next_i = i + 1;
                if(strcmp(SvPV_nolen(ST(next_i)), "left") == 0) {
                    pf.wAlignment = PFA_LEFT;
                    pf.dwMask = pf.dwMask | PFM_ALIGNMENT;
                } else if(strcmp(SvPV_nolen(ST(next_i)), "center") == 0) {
                    pf.wAlignment = PFA_CENTER;
                    pf.dwMask = pf.dwMask | PFM_ALIGNMENT;
                } else if(strcmp(SvPV_nolen(ST(next_i)), "right") == 0) {
                    pf.wAlignment = PFA_RIGHT;
                    pf.dwMask = pf.dwMask | PFM_ALIGNMENT;
                } else {
                    W32G_WARN("Win32::GUI:: Invalid value for -align!");
                }
            } else if(strcmp(option, "-offset") == 0) {
                next_i = i + 1;
                pf.dxOffset = (LONG)SvIV(ST(next_i));
                pf.dwMask = pf.dwMask | PFM_OFFSET;
            } else if(strcmp(option, "-startindent") == 0) {
                next_i = i + 1;
                pf.dxStartIndent = (LONG)SvIV(ST(next_i));
                pf.dwMask = pf.dwMask | PFM_STARTINDENT;
            } else if(strcmp(option, "-right") == 0) {
                next_i = i + 1;
                pf.dxRightIndent = (LONG)SvIV(ST(next_i));
                pf.dwMask = pf.dwMask | PFM_RIGHTINDENT;
            }
        } else {
            next_i = -1;
        }
    }
    RETVAL = SendMessage(handle, EM_SETPARAFORMAT, 0,
                         (LPARAM) (PARAFORMAT FAR *) &pf);
#line 1657 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_SetTextMode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_SetTextMode)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, mode, undo");
    {
	HWND	handle;
	int	mode = (int)SvIV(ST(1))
;
	int	undo = (int)SvIV(ST(2))
;
#line 838 "RichEdit.xs"
    WPARAM wParam;
#line 1679 "RichEdit.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 840 "RichEdit.xs"
    wParam = 0;
    wParam |= (mode ? TM_RICHTEXT : TM_PLAINTEXT);
    wParam |= (undo ? TM_MULTILEVELUNDO : TM_SINGLELEVELUNDO);

    RETVAL = SendMessage(
        handle, EM_SETTEXTMODE, (WPARAM) wParam, 0
    );
#line 1700 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


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


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


XS_EUPXS(XS_Win32__GUI__RichEdit_ShowScrollBar); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_ShowScrollBar)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "handle, bar, show");
    {
	HWND	handle;
	WPARAM	bar = (WPARAM)SvUV(ST(1))
;
	WPARAM	show = (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 885 "RichEdit.xs"
    RETVAL = SendMessage(handle, EM_SHOWSCROLLBAR, bar, (LPARAM) show);
#line 1798 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_CharFromPos); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_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 906 "RichEdit.xs"
    POINT p;
    LRESULT cfp;
#line 1823 "RichEdit.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 "RichEdit.xs"
    ZeroMemory(&p, sizeof(POINT));
    p.x = x;
    p.y = y;
    cfp = SendMessage(handle, EM_CHARFROMPOS, 0, (LPARAM) &p);
    if(cfp == -1) {
        XSRETURN_IV(-1);
    } else {
        EXTEND(SP, 2);
        XST_mIV(0, LOWORD(cfp));
        XST_mIV(1, HIWORD(cfp));
        XSRETURN(2);
    }
#line 1847 "RichEdit.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__RichEdit_PosFromChar); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_PosFromChar)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "handle, index");
    {
	HWND	handle;
	LPARAM	index;
#line 931 "RichEdit.xs"
    POINT p;
#line 1865 "RichEdit.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(SvPOK(ST(1)))
      index = (LPARAM) SvPV_nolen(ST(1));
    else
      index = (LPARAM) SvIV(ST(1))
;
#line 933 "RichEdit.xs"
    ZeroMemory(&p, sizeof(POINT));
    SendMessage(handle, EM_POSFROMCHAR, (WPARAM) &p, index);
    EXTEND(SP, 2);
    XST_mIV(0, p.x);
    XST_mIV(1, p.y);
    XSRETURN(2);
#line 1889 "RichEdit.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_SetRect); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_SetRect)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "handle, left, top, right, bottom");
    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))
;
#line 950 "RichEdit.xs"
    RECT myRect;
#line 1915 "RichEdit.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 952 "RichEdit.xs"
    myRect.left   = left;
    myRect.top    = top;
    myRect.right  = right;
    myRect.bottom = bottom;
    SendMessage(handle, EM_SETRECT, 0, (LPARAM) &myRect);
#line 1932 "RichEdit.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Win32__GUI__RichEdit_Save); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_Save)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, filename, format=SF_RTF");
    {
	HWND	handle;
	LPCTSTR	filename = (LPCTSTR)SvPV_nolen(ST(1))
;
	WPARAM	format;
#line 981 "RichEdit.xs"
    HANDLE hfile;
    EDITSTREAM estream;
#line 1953 "RichEdit.c"
	LRESULT	RETVAL;
	dXSTARG;

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

	if (items < 3)
	    format = SF_RTF;
	else {
	    format = (WPARAM)SvUV(ST(2))
;
	}
#line 984 "RichEdit.xs"
    hfile = CreateFile(
        filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL
    );
    estream.dwCookie = (DWORD_PTR) hfile;
    estream.dwError = 0;
    estream.pfnCallback = (EDITSTREAMCALLBACK) RichEditSave;

    RETVAL = SendMessage(handle, EM_STREAMOUT,
                         format, (LPARAM) &estream);
    CloseHandle(hfile);
#line 1984 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Win32__GUI__RichEdit_Load); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Win32__GUI__RichEdit_Load)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "handle, filename, format=SF_RTF");
    {
	HWND	handle;
	LPCTSTR	filename = (LPCTSTR)SvPV_nolen(ST(1))
;
	WPARAM	format;
#line 1006 "RichEdit.xs"
    HANDLE hfile;
    EDITSTREAM estream;
#line 2006 "RichEdit.c"
	LRESULT	RETVAL;
	dXSTARG;

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

	if (items < 3)
	    format = SF_RTF;
	else {
	    format = (WPARAM)SvUV(ST(2))
;
	}
#line 1009 "RichEdit.xs"
    hfile = CreateFile(
        filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL
    );
    estream.dwCookie = (DWORD_PTR) hfile;
    estream.dwError = 0;
    estream.pfnCallback = (EDITSTREAMCALLBACK) RichEditLoad;

    RETVAL = SendMessage(handle, EM_STREAMIN,
                         format, (LPARAM) &estream);
    CloseHandle(hfile);
#line 2037 "RichEdit.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#ifdef __cplusplus
extern "C" {
#endif
XS_EXTERNAL(boot_Win32__GUI__RichEdit); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Win32__GUI__RichEdit)
{
#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::RichEdit::AutoURLDetect", XS_Win32__GUI__RichEdit_AutoURLDetect);
        newXS_deffile("Win32::GUI::RichEdit::CanPaste", XS_Win32__GUI__RichEdit_CanPaste);
        newXS_deffile("Win32::GUI::RichEdit::CanRedo", XS_Win32__GUI__RichEdit_CanRedo);
        newXS_deffile("Win32::GUI::RichEdit::DisplayBand", XS_Win32__GUI__RichEdit_DisplayBand);
        cv = newXS_deffile("Win32::GUI::RichEdit::GetSel", XS_Win32__GUI__RichEdit_GetSel);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::Selection", XS_Win32__GUI__RichEdit_GetSel);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::RichEdit::LimitText", XS_Win32__GUI__RichEdit_LimiteText);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("Win32::GUI::RichEdit::LimiteText", XS_Win32__GUI__RichEdit_LimiteText);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::SetMaxLength", XS_Win32__GUI__RichEdit_LimiteText);
        XSANY.any_i32 = 1;
        newXS_deffile("Win32::GUI::RichEdit::LineFromChar", XS_Win32__GUI__RichEdit_LineFromChar);
        cv = newXS_deffile("Win32::GUI::RichEdit::Select", XS_Win32__GUI__RichEdit_SetSel);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::RichEdit::SetSel", XS_Win32__GUI__RichEdit_SetSel);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::RichEdit::FindText", XS_Win32__GUI__RichEdit_FindText);
        newXS_deffile("Win32::GUI::RichEdit::FindWordBreak", XS_Win32__GUI__RichEdit_FindWordBreak);
        newXS_deffile("Win32::GUI::RichEdit::GetAutoURLDetect", XS_Win32__GUI__RichEdit_GetAutoURLDetect);
        newXS_deffile("Win32::GUI::RichEdit::GetCharFormat", XS_Win32__GUI__RichEdit_GetCharFormat);
        newXS_deffile("Win32::GUI::RichEdit::GetEditStyle", XS_Win32__GUI__RichEdit_GetEditStyle);
        newXS_deffile("Win32::GUI::RichEdit::GetEventMask", XS_Win32__GUI__RichEdit_GetEventMask);
        newXS_deffile("Win32::GUI::RichEdit::GetIMEOptions", XS_Win32__GUI__RichEdit_GetIMEOptions);
        newXS_deffile("Win32::GUI::RichEdit::GetLangOptions", XS_Win32__GUI__RichEdit_GetLangOptions);
        newXS_deffile("Win32::GUI::RichEdit::GetOptions", XS_Win32__GUI__RichEdit_GetOptions);
        newXS_deffile("Win32::GUI::RichEdit::GetRedoName", XS_Win32__GUI__RichEdit_GetRedoName);
        newXS_deffile("Win32::GUI::RichEdit::GetSelText", XS_Win32__GUI__RichEdit_GetSelText);
        cv = newXS_deffile("Win32::GUI::RichEdit::GetTextLength", XS_Win32__GUI__RichEdit_GetTextLength);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Win32::GUI::RichEdit::TextLength", XS_Win32__GUI__RichEdit_GetTextLength);
        XSANY.any_i32 = 1;
        newXS_deffile("Win32::GUI::RichEdit::GetTextMode", XS_Win32__GUI__RichEdit_GetTextMode);
        newXS_deffile("Win32::GUI::RichEdit::GetTextRange", XS_Win32__GUI__RichEdit_GetTextRange);
        newXS_deffile("Win32::GUI::RichEdit::GetTypographyOptions", XS_Win32__GUI__RichEdit_GetTypographyOptions);
        newXS_deffile("Win32::GUI::RichEdit::GetUndoName", XS_Win32__GUI__RichEdit_GetUndoName);
        newXS_deffile("Win32::GUI::RichEdit::GetWordWrapMode", XS_Win32__GUI__RichEdit_GetWordWrapMode);
        newXS_deffile("Win32::GUI::RichEdit::HideSelection", XS_Win32__GUI__RichEdit_HideSelection);
        newXS_deffile("Win32::GUI::RichEdit::Redo", XS_Win32__GUI__RichEdit_Redo);
        newXS_deffile("Win32::GUI::RichEdit::RequestResize", XS_Win32__GUI__RichEdit_RequestResize);
        newXS_deffile("Win32::GUI::RichEdit::SelectionType", XS_Win32__GUI__RichEdit_SelectionType);
        cv = newXS_deffile("Win32::GUI::RichEdit::BackColor", XS_Win32__GUI__RichEdit_SetBkgndColor);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Win32::GUI::RichEdit::SetBkgndColor", XS_Win32__GUI__RichEdit_SetBkgndColor);
        XSANY.any_i32 = 0;
        newXS_deffile("Win32::GUI::RichEdit::SetCharFormat", XS_Win32__GUI__RichEdit_SetCharFormat);
        newXS_deffile("Win32::GUI::RichEdit::SetEditStyle", XS_Win32__GUI__RichEdit_SetEditStyle);
        newXS_deffile("Win32::GUI::RichEdit::SetEventMask", XS_Win32__GUI__RichEdit_SetEventMask);
        newXS_deffile("Win32::GUI::RichEdit::SetLangOptions", XS_Win32__GUI__RichEdit_SetLangOptions);
        newXS_deffile("Win32::GUI::RichEdit::SetOptions", XS_Win32__GUI__RichEdit_SetOptions);
        newXS_deffile("Win32::GUI::RichEdit::SetParaFormat", XS_Win32__GUI__RichEdit_SetParaFormat);
        newXS_deffile("Win32::GUI::RichEdit::SetTextMode", XS_Win32__GUI__RichEdit_SetTextMode);
        newXS_deffile("Win32::GUI::RichEdit::SetUndoLimit", XS_Win32__GUI__RichEdit_SetUndoLimit);
        newXS_deffile("Win32::GUI::RichEdit::SetWrapMode", XS_Win32__GUI__RichEdit_SetWrapMode);
        newXS_deffile("Win32::GUI::RichEdit::ShowScrollBar", XS_Win32__GUI__RichEdit_ShowScrollBar);
        newXS_deffile("Win32::GUI::RichEdit::CharFromPos", XS_Win32__GUI__RichEdit_CharFromPos);
        newXS_deffile("Win32::GUI::RichEdit::PosFromChar", XS_Win32__GUI__RichEdit_PosFromChar);
        newXS_deffile("Win32::GUI::RichEdit::SetRect", XS_Win32__GUI__RichEdit_SetRect);
        newXS_deffile("Win32::GUI::RichEdit::Save", XS_Win32__GUI__RichEdit_Save);
        newXS_deffile("Win32::GUI::RichEdit::Load", XS_Win32__GUI__RichEdit_Load);
#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
