Forward the RichEdit 1.0 control to the RichEdit 2.0 control.

This commit is contained in:
Mike McCormack 2005-03-10 11:16:35 +00:00 committed by Alexandre Julliard
parent 5ebd4e938e
commit f79863d20f
11 changed files with 41 additions and 6244 deletions

View File

@ -3,11 +3,9 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = riched32.dll
IMPORTS = user32 kernel32
IMPORTS = riched20 user32 kernel32
C_SRCS = \
reader.c \
text-writer.c \
richedit.c
@MAKE_DLL_RULES@

View File

@ -1,211 +0,0 @@
/*
RTF ANSI character set (\ansi) general map
These are taken from the ISO-Latin-1 (ISO-8859-1) encodings, with
a few additions
Field 1 is the standard character name which the character value in
field 2 maps onto. (It doesn't mean "to produce the character in field 1,
use the value in field 2.)
The character value may be given either as a single character (which will be
converted to the ASCII value of the character), or in numeric format, either
in decimal or 0xyy as hex yy. Single or double quotes may be used to quote
characters.*/
int ansi_gen[] =
{
rtfSC_formula ,0x06,
rtfSC_nobrkhyphen ,0x1e,
rtfSC_opthyphen ,0x1f,
rtfSC_space ,' ',
rtfSC_exclam ,'!',
rtfSC_quotedbl ,'"',
rtfSC_numbersign ,'#',
rtfSC_dollar ,'$',
rtfSC_percent ,'%',
rtfSC_ampersand ,'&',
rtfSC_quoteright ,'\\',
rtfSC_parenleft ,'(',
rtfSC_parenright ,')',
rtfSC_asterisk ,'*',
rtfSC_plus ,'+',
rtfSC_comma ,',',
rtfSC_hyphen ,'-',
rtfSC_period ,'.',
rtfSC_slash ,'/',
rtfSC_zero ,'0',
rtfSC_one ,'1',
rtfSC_two ,'2',
rtfSC_three ,'3',
rtfSC_four ,'4',
rtfSC_five ,'5',
rtfSC_six ,'6',
rtfSC_seven ,'7',
rtfSC_eight ,'8',
rtfSC_nine ,'9',
rtfSC_colon ,':',
rtfSC_semicolon ,';',
rtfSC_less ,'<',
rtfSC_equal ,'=',
rtfSC_greater ,'>',
rtfSC_question ,'?',
rtfSC_at ,'@',
rtfSC_A ,'A',
rtfSC_B ,'B',
rtfSC_C ,'C',
rtfSC_D ,'D',
rtfSC_E ,'E',
rtfSC_F ,'F',
rtfSC_G ,'G',
rtfSC_H ,'H',
rtfSC_I ,'I',
rtfSC_J ,'J',
rtfSC_K ,'K',
rtfSC_L ,'L',
rtfSC_M ,'M',
rtfSC_N ,'N',
rtfSC_O ,'O',
rtfSC_P ,'P',
rtfSC_Q ,'Q',
rtfSC_R ,'R',
rtfSC_S ,'S',
rtfSC_T ,'T',
rtfSC_U ,'U',
rtfSC_V ,'V',
rtfSC_W ,'W',
rtfSC_X ,'X',
rtfSC_Y ,'Y',
rtfSC_Z ,'Z',
rtfSC_bracketleft ,'[',
rtfSC_backslash ,'\\',
rtfSC_bracketright ,']',
rtfSC_asciicircum ,'^',
rtfSC_underscore ,'_',
rtfSC_quoteleft ,'`',
rtfSC_a ,'a',
rtfSC_b ,'b',
rtfSC_c ,'c',
rtfSC_d ,'d',
rtfSC_e ,'e',
rtfSC_f ,'f',
rtfSC_g ,'g',
rtfSC_h ,'h',
rtfSC_i ,'i',
rtfSC_j ,'j',
rtfSC_k ,'k',
rtfSC_l ,'l',
rtfSC_m ,'m',
rtfSC_n ,'n',
rtfSC_o ,'o',
rtfSC_p ,'p',
rtfSC_q ,'q',
rtfSC_r ,'r',
rtfSC_s ,'s',
rtfSC_t ,'t',
rtfSC_u ,'u',
rtfSC_v ,'v',
rtfSC_w ,'w',
rtfSC_x ,'x',
rtfSC_y ,'y',
rtfSC_z ,'z',
rtfSC_braceleft ,'{',
rtfSC_bar ,'|',
rtfSC_braceright ,'}',
rtfSC_asciitilde ,'~',
rtfSC_nobrkspace ,0xa0,
rtfSC_exclamdown ,0xa1,
rtfSC_cent ,0xa2,
rtfSC_sterling ,0xa3,
rtfSC_currency ,0xa4,
rtfSC_yen ,0xa5,
rtfSC_brokenbar ,0xa6,
rtfSC_section ,0xa7,
rtfSC_dieresis ,0xa8,
rtfSC_copyright ,0xa9,
rtfSC_ordfeminine ,0xaa,
rtfSC_guillemotleft ,0xab,
rtfSC_logicalnot ,0xac,
rtfSC_opthyphen ,0xad,
rtfSC_registered ,0xae,
rtfSC_macron ,0xaf,
rtfSC_degree ,0xb0,
rtfSC_plusminus ,0xb1,
rtfSC_twosuperior ,0xb2,
rtfSC_threesuperior ,0xb3,
rtfSC_acute ,0xb4,
rtfSC_mu ,0xb5,
rtfSC_paragraph ,0xb6,
rtfSC_periodcentered ,0xb7,
rtfSC_cedilla ,0xb8,
rtfSC_onesuperior ,0xb9,
rtfSC_ordmasculine ,0xba,
rtfSC_guillemotright ,0xbb,
rtfSC_onequarter ,0xbc,
rtfSC_onehalf ,0xbd,
rtfSC_threequarters ,0xbe,
rtfSC_questiondown ,0xbf,
rtfSC_Agrave ,0xc0,
rtfSC_Aacute ,0xc1,
rtfSC_Acircumflex ,0xc2,
rtfSC_Atilde ,0xc3,
rtfSC_Adieresis ,0xc4,
rtfSC_Aring ,0xc5,
rtfSC_AE ,0xc6,
rtfSC_Ccedilla ,0xc7,
rtfSC_Egrave ,0xc8,
rtfSC_Eacute ,0xc9,
rtfSC_Ecircumflex ,0xca,
rtfSC_Edieresis ,0xcb,
rtfSC_Igrave ,0xcc,
rtfSC_Iacute ,0xcd,
rtfSC_Icircumflex ,0xce,
rtfSC_Idieresis ,0xcf,
rtfSC_Eth ,0xd0,
rtfSC_Ntilde ,0xd1,
rtfSC_Ograve ,0xd2,
rtfSC_Oacute ,0xd3,
rtfSC_Ocircumflex ,0xd4,
rtfSC_Otilde ,0xd5,
rtfSC_Odieresis ,0xd6,
rtfSC_multiply ,0xd7,
rtfSC_Oslash ,0xd8,
rtfSC_Ugrave ,0xd9,
rtfSC_Uacute ,0xda,
rtfSC_Ucircumflex ,0xdb,
rtfSC_Udieresis ,0xdc,
rtfSC_Yacute ,0xdd,
rtfSC_Thorn ,0xde,
rtfSC_germandbls ,0xdf,
rtfSC_agrave ,0xe0,
rtfSC_aacute ,0xe1,
rtfSC_acircumflex ,0xe2,
rtfSC_atilde ,0xe3,
rtfSC_adieresis ,0xe4,
rtfSC_aring ,0xe5,
rtfSC_ae ,0xe6,
rtfSC_ccedilla ,0xe7,
rtfSC_egrave ,0xe8,
rtfSC_eacute ,0xe9,
rtfSC_ecircumflex ,0xea,
rtfSC_edieresis ,0xeb,
rtfSC_igrave ,0xec,
rtfSC_iacute ,0xed,
rtfSC_icircumflex ,0xee,
rtfSC_idieresis ,0xef,
rtfSC_eth ,0xf0,
rtfSC_ntilde ,0xf1,
rtfSC_ograve ,0xf2,
rtfSC_oacute ,0xf3,
rtfSC_ocircumflex ,0xf4,
rtfSC_otilde ,0xf5,
rtfSC_odieresis ,0xf6,
rtfSC_divide ,0xf7,
rtfSC_oslash ,0xf8,
rtfSC_ugrave ,0xf9,
rtfSC_uacute ,0xfa,
rtfSC_ucircumflex ,0xfb,
rtfSC_udieresis ,0xfc,
rtfSC_yacute ,0xfd,
rtfSC_thorn ,0xfe,
rtfSC_ydieresis ,0xff
};

View File

@ -1,112 +0,0 @@
/*
* RTF ANSI character set (\ansi) Symbol font map
*
* Field 1 is the standard character name which the character value in
* field 2 maps onto. (It doesn't mean "to produce the character in field 1,
* use the value in field 2.)
*
* The character value may be given either as a single character (which will be
* converted to the ASCII value of the character), or in numeric format, either
* in decimal or 0xyy as hex yy. Single or double quotes may be used to quote
* characters.
*
*/
int ansi_sym[] =
{
rtfSC_formula ,0x06,
rtfSC_nobrkhyphen ,0x1e,
rtfSC_opthyphen ,0x1f,
rtfSC_space ,' ',
rtfSC_exclam ,'!',
rtfSC_universal ,'"',
rtfSC_mathnumbersign ,'#',
rtfSC_existential ,'$',
rtfSC_percent ,'%',
rtfSC_ampersand ,'&',
rtfSC_suchthat ,'\\',
rtfSC_parenleft ,'(',
rtfSC_parenright ,')',
rtfSC_mathasterisk ,'*',
rtfSC_mathplus ,'+',
rtfSC_comma ,',',
rtfSC_mathminus ,'-',
rtfSC_period ,'.',
rtfSC_slash ,'/',
rtfSC_zero ,'0',
rtfSC_one ,'1',
rtfSC_two ,'2',
rtfSC_three ,'3',
rtfSC_four ,'4',
rtfSC_five ,'5',
rtfSC_six ,'6',
rtfSC_seven ,'7',
rtfSC_eight ,'8',
rtfSC_nine ,'9',
rtfSC_colon ,':',
rtfSC_semicolon ,';',
rtfSC_less ,'<',
rtfSC_mathequal ,'=',
rtfSC_greater ,'>',
rtfSC_question ,'?',
rtfSC_congruent ,'@',
rtfSC_Alpha ,'A',
rtfSC_Beta ,'B',
rtfSC_Chi ,'C',
rtfSC_Delta ,'D',
rtfSC_Epsilon ,'E',
rtfSC_Phi ,'F',
rtfSC_Gamma ,'G',
rtfSC_Eta ,'H',
rtfSC_Iota ,'I',
rtfSC_Kappa ,'K',
rtfSC_Lambda ,'L',
rtfSC_Mu ,'M',
rtfSC_Nu ,'N',
rtfSC_Omicron ,'O',
rtfSC_Pi ,'P',
rtfSC_Theta ,'Q',
rtfSC_Rho ,'R',
rtfSC_Sigma ,'S',
rtfSC_Tau ,'T',
rtfSC_Upsilon ,'U',
rtfSC_varsigma ,'V',
rtfSC_Omega ,'W',
rtfSC_Xi ,'X',
rtfSC_Psi ,'Y',
rtfSC_Zeta ,'Z',
rtfSC_bracketleft ,'[',
rtfSC_backslash ,'\\',
rtfSC_bracketright ,']',
rtfSC_asciicircum ,'^',
rtfSC_underscore ,'_',
rtfSC_quoteleft ,'`',
rtfSC_alpha ,'a',
rtfSC_beta ,'b',
rtfSC_chi ,'c',
rtfSC_delta ,'d',
rtfSC_epsilon ,'e',
rtfSC_phi ,'f',
rtfSC_gamma ,'g',
rtfSC_eta ,'h',
rtfSC_iota ,'i',
rtfSC_kappa ,'k',
rtfSC_lambda ,'l',
rtfSC_mu ,'m',
rtfSC_nu ,'n',
rtfSC_omicron ,'o',
rtfSC_pi ,'p',
rtfSC_theta ,'q',
rtfSC_rho ,'r',
rtfSC_sigma ,'s',
rtfSC_tau ,'t',
rtfSC_upsilon ,'u',
rtfSC_omega ,'w',
rtfSC_xi ,'x',
rtfSC_psi ,'y',
rtfSC_zeta ,'z',
rtfSC_braceleft ,'{',
rtfSC_bar ,'|',
rtfSC_braceright ,'}',
rtfSC_mathtilde ,'~'
};

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +0,0 @@
/*
* Ritch Edit 32 class extra info
*
* Copyright 2000 Jean-Clauyde Batista
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_RICHED32_H
#define __WINE_RICHED32_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "richedit.h"
extern VOID RICHED32_Register (VOID);
extern VOID RICHED32_Unregister (VOID);
#endif /* __WINE_RICHED32_H */

View File

@ -1,11 +1,10 @@
/*
* RichEdit32 functions
*
* This module is a simple wrapper for the edit controls.
* At the point, it is good only for application who use the RICHEDIT
* control to display RTF text.
* This module is a simple wrapper for the RichEdit 2.0 control
*
* Copyright 2000 by Jean-Claude Batista
* Copyright 2005 Mike McCormack
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -29,728 +28,29 @@
#include "wingdi.h"
#include "winreg.h"
#include "winerror.h"
#include "riched32.h"
#include "winuser.h"
#include "richedit.h"
#define NO_SHLWAPI_STREAM
#include "shlwapi.h"
#include "rtf.h"
#include "rtf2text.h"
#include "wine/debug.h"
#define ID_EDIT 1
WINE_DEFAULT_DEBUG_CHANNEL(richedit);
HANDLE RICHED32_hHeap = NULL;
/* LPSTR RICHED32_aSubclass = NULL; */
static WNDPROC lpfnEditWndProc = NULL;
static INT RTFInfoOffset = 0;
/* Window procedure of the RichEdit 1.0 control in riched20.dll */
extern LRESULT WINAPI RichEdit10ANSIWndProc(HWND, UINT, WPARAM, LPARAM);
#define TRACE_EDIT_MSG32(str) \
TRACE(\
"32 bit : " str ": hwnd=%p, wParam=%08x, lParam=%08x\n"\
, \
hwnd, (UINT)wParam, (UINT)lParam)
VOID RICHEDIT_InitEditControlInfo(void);
/***********************************************************************
* DllMain [Internal] Initializes the internal 'RICHED32.DLL'.
*
* PARAMS
* hinstDLL [I] handle to the DLL's instance
* fdwReason [I]
* lpvReserved [I] reserved, must be NULL
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
TRACE("\n");
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinstDLL);
/* create private heap */
RICHED32_hHeap = HeapCreate (0, 0x10000, 0);
/* Retrieve edit control class info */
RICHEDIT_InitEditControlInfo();
/* register the Rich Edit class */
RICHED32_Register ();
break;
case DLL_PROCESS_DETACH:
/* unregister all common control classes */
RICHED32_Unregister ();
HeapDestroy (RICHED32_hHeap);
RICHED32_hHeap = NULL;
break;
}
return TRUE;
}
/* Support routines for window procedure */
INT RICHEDIT_GetTextRange(HWND hwnd,TEXTRANGEA *tr);
INT RICHEDIT_GetSelText(HWND hwnd,LPSTR lpstrBuffer);
typedef struct _RTFControl_info
{
HWND hwndParent;
char* rtfBuffer;
RTF_Info *parser;
} RTFControl_Info;
/*
*
* DESCRIPTION:
* Window procedure of the RichEdit control.
*
*/
static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
LPARAM lParam)
{
LONG newstyle = 0;
RTFControl_Info *info;
CHARRANGE *cr;
info = (RTFControl_Info *) GetWindowLongW( hwnd, RTFInfoOffset );
TRACE("uMsg: 0x%x hwnd: %p\n",uMsg,hwnd);
switch (uMsg)
{
case WM_CREATE:
TRACE_EDIT_MSG32("WM_CREATE Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_NCCREATE :
TRACE_EDIT_MSG32("WM_NCCREATE");
info = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof (RTFControl_Info));
info->parser = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof (RTF_Info));
SetWindowLongW( hwnd, RTFInfoOffset, (LONG)info );
/* remove SCROLLBARS from the current window style */
info->hwndParent = ((LPCREATESTRUCTA) lParam)->hwndParent;
newstyle = ((LPCREATESTRUCTA) lParam)->style;
newstyle &= ~ES_NUMBER; /* Reused as ES_DISABLENOSCROLL */
SetWindowLongA(hwnd,GWL_STYLE, newstyle);
/* Note that SetWindowLongA(hwnd,GWL_STYLE...) does not update
the style field in the text window as the edit structure is
not initialized until it processes this message. Therefore
update the style in the message itself */
((LPCREATESTRUCTA) lParam)->style = newstyle;
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_SETFOCUS :
TRACE_EDIT_MSG32("WM_SETFOCUS");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_SIZE :
TRACE_EDIT_MSG32("WM_SIZE");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_COMMAND :
TRACE_EDIT_MSG32("WM_COMMAND");
switch(HIWORD(wParam)) {
case EN_CHANGE:
case EN_HSCROLL:
case EN_KILLFOCUS:
case EN_SETFOCUS:
case EN_UPDATE:
case EN_VSCROLL:
return SendMessageA(info->hwndParent, WM_COMMAND,
wParam, (LPARAM)(hwnd));
case EN_ERRSPACE:
case EN_MAXTEXT:
MessageBoxA (hwnd, "RichEdit control out of space.",
"ERROR", MB_OK | MB_ICONSTOP) ;
return 0 ;
}
case EM_STREAMIN:
TRACE_EDIT_MSG32("EM_STREAMIN");
/* setup the RTF parser */
RTFSetEditStream(info->parser,( EDITSTREAM*)lParam);
info->parser->rtfFormat = wParam&(SF_TEXT|SF_RTF);
info->parser->hwndEdit = hwnd;
WriterInit(info->parser);
RTFInit (info->parser);
BeginFile(info->parser);
/* do the parsing */
RTFRead (info->parser);
RTFFlushOutputBuffer( info->parser );
/* put the cursor at the top */
SendMessageA( hwnd, EM_SETSEL, 0, 0 );
return 0;
/* Messages specific to Richedit controls */
case EM_AUTOURLDETECT:
TRACE_EDIT_MSG32("EM_AUTOURLDETECT Ignored");
return 0;
case EM_CANPASTE:
TRACE_EDIT_MSG32("EM_CANPASTE Ignored");
return 0;
case EM_CANREDO:
TRACE_EDIT_MSG32("EM_CANREDO Ignored");
return 0;
case EM_DISPLAYBAND:
TRACE_EDIT_MSG32("EM_DISPLAYBAND Ignored");
return 0;
case EM_EXGETSEL:
TRACE_EDIT_MSG32("EM_EXGETSEL -> EM_GETSEL");
cr = (VOID *) lParam;
CallWindowProcA(lpfnEditWndProc, hwnd, EM_GETSEL, (INT)&cr->cpMin, (INT)&cr->cpMax);
TRACE("cpMin: 0x%x cpMax: 0x%x\n",(INT)cr->cpMin,(INT)cr->cpMax);
return 0;
case EM_EXLIMITTEXT:
{
DWORD limit = lParam;
TRACE_EDIT_MSG32("EM_EXLIMITTEXT");
if (limit > 65534)
{
limit = 0xFFFFFFFF;
}
return CallWindowProcA(lpfnEditWndProc, hwnd, EM_SETLIMITTEXT, limit, 0);
}
case EM_EXLINEFROMCHAR:
TRACE_EDIT_MSG32("EM_EXLINEFROMCHAR -> LINEFROMCHAR");
return CallWindowProcA(lpfnEditWndProc, hwnd, EM_LINEFROMCHAR, lParam, wParam);
case EM_EXSETSEL:
TRACE_EDIT_MSG32("EM_EXSETSEL -> EM_SETSEL");
cr = (VOID *) lParam;
return CallWindowProcA(lpfnEditWndProc, hwnd, EM_SETSEL, cr->cpMin, cr->cpMax);
case EM_FINDTEXT:
TRACE_EDIT_MSG32("EM_FINDTEXT Ignored");
return 0;
case EM_FINDTEXTEX:
TRACE_EDIT_MSG32("EM_FINDTEXTEX Ignored");
return 0;
case EM_FINDTEXTEXW:
TRACE_EDIT_MSG32("EM_FINDTEXTEXW Ignored");
return 0;
case EM_FINDTEXTW:
TRACE_EDIT_MSG32("EM_FINDTEXTW Ignored");
return 0;
case EM_FINDWORDBREAK:
TRACE_EDIT_MSG32("EM_FINDWORDBREAK Ignored");
return 0;
case EM_FORMATRANGE:
TRACE_EDIT_MSG32("EM_FORMATRANGE Ignored");
return 0;
case EM_GETAUTOURLDETECT:
TRACE_EDIT_MSG32("EM_GETAUTOURLDETECT Ignored");
return 0;
case EM_GETBIDIOPTIONS:
TRACE_EDIT_MSG32("EM_GETBIDIOPTIONS Ignored");
return 0;
case EM_GETCHARFORMAT:
TRACE_EDIT_MSG32("EM_GETCHARFORMAT Ignored");
return 0;
case EM_GETEDITSTYLE:
TRACE_EDIT_MSG32("EM_GETEDITSTYLE Ignored");
return 0;
case EM_GETEVENTMASK:
TRACE_EDIT_MSG32("EM_GETEVENTMASK Ignored");
return 0;
case EM_GETIMECOLOR:
TRACE_EDIT_MSG32("EM_GETIMECOLOR Ignored");
return 0;
case EM_GETIMECOMPMODE:
TRACE_EDIT_MSG32("EM_GETIMECOMPMODE Ignored");
return 0;
case EM_GETIMEOPTIONS:
TRACE_EDIT_MSG32("EM_GETIMEOPTIONS Ignored");
return 0;
case EM_GETLANGOPTIONS:
TRACE_EDIT_MSG32("STUB: EM_GETLANGOPTIONS");
return 0;
case EM_GETOLEINTERFACE:
TRACE_EDIT_MSG32("EM_GETOLEINTERFACE Ignored");
return 0;
case EM_GETOPTIONS:
TRACE_EDIT_MSG32("EM_GETOPTIONS Ignored");
return 0;
case EM_GETPARAFORMAT:
TRACE_EDIT_MSG32("EM_GETPARAFORMAT Ignored");
return 0;
case EM_GETPUNCTUATION:
TRACE_EDIT_MSG32("EM_GETPUNCTUATION Ignored");
return 0;
case EM_GETREDONAME:
TRACE_EDIT_MSG32("EM_GETREDONAME Ignored");
return 0;
case EM_GETSCROLLPOS:
TRACE_EDIT_MSG32("EM_GETSCROLLPOS Ignored");
return 0;
case EM_GETSELTEXT:
TRACE_EDIT_MSG32("EM_GETSELTEXT");
return RICHEDIT_GetSelText(hwnd,(void *)lParam);
case EM_GETTEXTEX:
TRACE_EDIT_MSG32("EM_GETTEXTEX Ignored");
return 0;
case EM_GETTEXTLENGTHEX:
TRACE_EDIT_MSG32("EM_GETTEXTLENGTHEX Ignored");
return 0;
case EM_GETTEXTMODE:
TRACE_EDIT_MSG32("EM_GETTEXTMODE Ignored");
return 0;
case EM_GETTEXTRANGE:
TRACE_EDIT_MSG32("EM_GETTEXTRANGE");
return RICHEDIT_GetTextRange(hwnd,(TEXTRANGEA *)lParam);
case EM_GETTYPOGRAPHYOPTIONS:
TRACE_EDIT_MSG32("EM_GETTYPOGRAPHYOPTIONS Ignored");
return 0;
case EM_GETUNDONAME:
TRACE_EDIT_MSG32("EM_GETUNDONAME Ignored");
return 0;
case EM_GETWORDBREAKPROCEX:
TRACE_EDIT_MSG32("EM_GETWORDBREAKPROCEX Ignored");
return 0;
case EM_GETWORDWRAPMODE:
TRACE_EDIT_MSG32("EM_GETWORDWRAPMODE Ignored");
return 0;
case EM_GETZOOM:
TRACE_EDIT_MSG32("EM_GETZOOM Ignored");
return 0;
case EM_HIDESELECTION:
TRACE_EDIT_MSG32("EM_HIDESELECTION Ignored");
return 0;
case EM_PASTESPECIAL:
TRACE_EDIT_MSG32("EM_PASTESPECIAL Ignored");
return 0;
case EM_RECONVERSION:
TRACE_EDIT_MSG32("EM_RECONVERSION Ignored");
return 0;
case EM_REDO:
TRACE_EDIT_MSG32("EM_REDO Ignored");
return 0;
case EM_REQUESTRESIZE:
TRACE_EDIT_MSG32("EM_REQUESTRESIZE Ignored");
return 0;
case EM_SELECTIONTYPE:
TRACE_EDIT_MSG32("EM_SELECTIONTYPE Ignored");
return 0;
case EM_SETBIDIOPTIONS:
TRACE_EDIT_MSG32("EM_SETBIDIOPTIONS Ignored");
return 0;
case EM_SETBKGNDCOLOR:
TRACE_EDIT_MSG32("EM_SETBKGNDCOLOR Ignored");
return 0;
case EM_SETCHARFORMAT:
TRACE_EDIT_MSG32("EM_SETCHARFORMAT Ignored");
return 0;
case EM_SETEDITSTYLE:
TRACE_EDIT_MSG32("EM_SETEDITSTYLE Ignored");
return 0;
case EM_SETEVENTMASK:
TRACE_EDIT_MSG32("EM_SETEVENTMASK Ignored");
return 0;
case EM_SETFONTSIZE:
TRACE_EDIT_MSG32("EM_SETFONTSIZE Ignored");
return 0;
case EM_SETIMECOLOR:
TRACE_EDIT_MSG32("EM_SETIMECOLO Ignored");
return 0;
case EM_SETIMEOPTIONS:
TRACE_EDIT_MSG32("EM_SETIMEOPTIONS Ignored");
return 0;
case EM_SETLANGOPTIONS:
TRACE_EDIT_MSG32("EM_SETLANGOPTIONS Ignored");
return 0;
case EM_SETOLECALLBACK:
TRACE_EDIT_MSG32("EM_SETOLECALLBACK Ignored");
return 0;
case EM_SETOPTIONS:
TRACE_EDIT_MSG32("EM_SETOPTIONS Ignored");
return 0;
case EM_SETPALETTE:
TRACE_EDIT_MSG32("EM_SETPALETTE Ignored");
return 0;
case EM_SETPARAFORMAT:
TRACE_EDIT_MSG32("EM_SETPARAFORMAT Ignored");
return 0;
case EM_SETPUNCTUATION:
TRACE_EDIT_MSG32("EM_SETPUNCTUATION Ignored");
return 0;
case EM_SETSCROLLPOS:
TRACE_EDIT_MSG32("EM_SETSCROLLPOS Ignored");
return 0;
case EM_SETTARGETDEVICE:
TRACE_EDIT_MSG32("EM_SETTARGETDEVICE Ignored");
return 0;
case EM_SETTEXTEX:
TRACE_EDIT_MSG32("EM_SETTEXTEX Ignored");
return 0;
case EM_SETTEXTMODE:
TRACE_EDIT_MSG32("EM_SETTEXTMODE Ignored");
return 0;
case EM_SETTYPOGRAPHYOPTIONS:
TRACE_EDIT_MSG32("EM_SETTYPOGRAPHYOPTIONS Ignored");
return 0;
case EM_SETUNDOLIMIT:
TRACE_EDIT_MSG32("EM_SETUNDOLIMIT Ignored");
return 0;
case EM_SETWORDBREAKPROCEX:
TRACE_EDIT_MSG32("EM_SETWORDBREAKPROCEX Ignored");
return 0;
case EM_SETWORDWRAPMODE:
TRACE_EDIT_MSG32("EM_SETWORDWRAPMODE Ignored");
return 0;
case EM_SETZOOM:
TRACE_EDIT_MSG32("EM_SETZOOM Ignored");
return 0;
case EM_SHOWSCROLLBAR:
TRACE_EDIT_MSG32("EM_SHOWSCROLLBAR Ignored");
return 0;
case EM_STOPGROUPTYPING:
TRACE_EDIT_MSG32("EM_STOPGROUPTYPING Ignored");
return 0;
case EM_STREAMOUT:
TRACE_EDIT_MSG32("EM_STREAMOUT Ignored");
return 0;
/* Messages dispatched to the edit control */
case EM_CANUNDO:
TRACE_EDIT_MSG32("EM_CANUNDO Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_CHARFROMPOS:
TRACE_EDIT_MSG32("EM_CHARFROMPOS Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_EMPTYUNDOBUFFER:
TRACE_EDIT_MSG32("EM_EMPTYUNDOBUFFER Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_FMTLINES:
TRACE_EDIT_MSG32("EM_FMTLINES Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_GETFIRSTVISIBLELINE:
TRACE_EDIT_MSG32("EM_GETFIRSTVISIBLELINE Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_GETHANDLE:
TRACE_EDIT_MSG32("EM_GETHANDLE Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
/* case EM_GETIMESTATUS:*/
case EM_GETLIMITTEXT:
TRACE_EDIT_MSG32("EM_GETLIMITTEXT Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_GETLINE:
TRACE_EDIT_MSG32("EM_GETLINE Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_GETLINECOUNT:
TRACE_EDIT_MSG32("EM_GETLINECOUNT Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_GETMARGINS:
TRACE_EDIT_MSG32("EM_GETMARGINS Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_GETMODIFY:
TRACE_EDIT_MSG32("EM_GETMODIFY Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_GETPASSWORDCHAR:
TRACE_EDIT_MSG32("EM_GETPASSWORDCHAR Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_GETRECT:
TRACE_EDIT_MSG32("EM_GETRECT Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_GETSEL:
TRACE_EDIT_MSG32("EM_GETSEL Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_GETTHUMB:
TRACE_EDIT_MSG32("EM_GETTHUMB Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_GETWORDBREAKPROC:
TRACE_EDIT_MSG32("EM_GETWORDBREAKPROC Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_LINEFROMCHAR:
TRACE_EDIT_MSG32("EM_LINEFROMCHAR Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_LINEINDEX:
TRACE_EDIT_MSG32("EM_LINEINDEX Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_LINELENGTH:
TRACE_EDIT_MSG32("EM_LINELENGTH Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_LINESCROLL:
TRACE_EDIT_MSG32("EM_LINESCROLL Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_POSFROMCHAR:
TRACE_EDIT_MSG32("EM_POSFROMCHAR Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_REPLACESEL:
TRACE_EDIT_MSG32("case EM_REPLACESEL Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_SCROLL:
TRACE_EDIT_MSG32("case EM_SCROLL Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_SCROLLCARET:
case WM_USER+49: /* EM_SCROLLCARET too */
TRACE_EDIT_MSG32("EM_SCROLLCARET Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, EM_SCROLLCARET, wParam, lParam);
case EM_SETHANDLE:
TRACE_EDIT_MSG32("EM_SETHANDLE Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
/* case EM_SETIMESTATUS:*/
case EM_SETLIMITTEXT:
TRACE_EDIT_MSG32("EM_SETLIMITTEXT Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_SETMARGINS:
TRACE_EDIT_MSG32("case EM_SETMARGINS Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_SETMODIFY:
TRACE_EDIT_MSG32("EM_SETMODIFY Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_SETPASSWORDCHAR:
TRACE_EDIT_MSG32("EM_SETPASSWORDCHAR Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_SETREADONLY:
TRACE_EDIT_MSG32("EM_SETREADONLY Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_SETRECT:
TRACE_EDIT_MSG32("EM_SETRECT Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_SETRECTNP:
TRACE_EDIT_MSG32("EM_SETRECTNP Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_SETSEL:
TRACE_EDIT_MSG32("EM_SETSEL Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_SETTABSTOPS:
TRACE_EDIT_MSG32("EM_SETTABSTOPS Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_SETWORDBREAKPROC:
TRACE_EDIT_MSG32("EM_SETWORDBREAKPROC Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case EM_UNDO:
TRACE_EDIT_MSG32("EM_UNDO Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_STYLECHANGING:
TRACE_EDIT_MSG32("WM_STYLECHANGING Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_STYLECHANGED:
TRACE_EDIT_MSG32("WM_STYLECHANGED Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_GETTEXT:
TRACE_EDIT_MSG32("WM_GETTEXT Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_GETTEXTLENGTH:
TRACE_EDIT_MSG32("WM_GETTEXTLENGTH Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_SETTEXT:
TRACE_EDIT_MSG32("WM_SETTEXT Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_CUT:
TRACE_EDIT_MSG32("WM_CUT Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_COPY:
TRACE_EDIT_MSG32("WM_COPY Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_PASTE:
TRACE_EDIT_MSG32("WM_PASTE Passed to edit control");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
/* Messages passed to default handler. */
case WM_NCCALCSIZE:
TRACE_EDIT_MSG32("WM_NCCALCSIZE Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_NCPAINT:
TRACE_EDIT_MSG32("WM_NCPAINT Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_PAINT:
TRACE_EDIT_MSG32("WM_PAINT Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_ERASEBKGND:
TRACE_EDIT_MSG32("WM_ERASEBKGND Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_KILLFOCUS:
TRACE_EDIT_MSG32("WM_KILLFOCUS Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_DESTROY:
TRACE_EDIT_MSG32("WM_DESTROY Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_CHILDACTIVATE:
TRACE_EDIT_MSG32("WM_CHILDACTIVATE Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_WINDOWPOSCHANGING:
TRACE_EDIT_MSG32("WM_WINDOWPOSCHANGING Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_WINDOWPOSCHANGED:
TRACE_EDIT_MSG32("WM_WINDOWPOSCHANGED Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
/* case WM_INITIALUPDATE:
TRACE_EDIT_MSG32("WM_INITIALUPDATE Passed to default");
return DefWindowProcA( hwnd,uMsg,wParam,lParam); */
case WM_CTLCOLOREDIT:
TRACE_EDIT_MSG32("WM_CTLCOLOREDIT Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_SETCURSOR:
TRACE_EDIT_MSG32("WM_SETCURSOR Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_MOVE:
TRACE_EDIT_MSG32("WM_MOVE Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_SHOWWINDOW:
TRACE_EDIT_MSG32("WM_SHOWWINDOW Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_PARENTNOTIFY:
TRACE_EDIT_MSG32("WM_PARENTNOTIFY Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_SETREDRAW:
TRACE_EDIT_MSG32("WM_SETREDRAW Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_NCDESTROY:
{
TRACE_EDIT_MSG32("WM_NCDESTROY Passed to default");
HeapFree( GetProcessHeap(), 0, info->parser );
HeapFree( GetProcessHeap(), 0, info );
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
}
case WM_NCHITTEST:
TRACE_EDIT_MSG32("WM_NCHITTEST Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_CTLCOLORSTATIC:
TRACE_EDIT_MSG32("WM_CTLCOLORSTATIC Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_NCMOUSEMOVE:
TRACE_EDIT_MSG32("WM_NCMOUSEMOVE Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_CLEAR:
TRACE_EDIT_MSG32("WM_CLEAR Passed to default");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
/*
* used by IE in the EULA box
*/
case WM_ALTTABACTIVE:
TRACE_EDIT_MSG32("WM_ALTTABACTIVE");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_GETDLGCODE:
TRACE_EDIT_MSG32("WM_GETDLGCODE");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
case WM_SETFONT:
TRACE_EDIT_MSG32("WM_SETFONT");
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
}
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) {
FIXME("Unknown message 0x%x Passed to default hwnd=%p, wParam=%08x, lParam=%08x\n",
uMsg, hwnd, (UINT)wParam, (UINT)lParam);
}
return CallWindowProcA(lpfnEditWndProc, hwnd, uMsg, wParam, lParam);
}
/***********************************************************************
* DllGetVersion [RICHED32.2]
*
* Retrieves version information of the 'RICHED32.DLL'
*
* PARAMS
* pdvi [O] pointer to version information structure.
*
* RETURNS
* Success: S_OK
* Failure: E_INVALIDARG
*
* NOTES
* Returns version of a comctl32.dll from IE4.01 SP1.
* Retrieves version information
*/
HRESULT WINAPI
RICHED32_DllGetVersion (DLLVERSIONINFO *pdvi)
HRESULT WINAPI RICHED32_DllGetVersion (DLLVERSIONINFO *pdvi)
{
TRACE("\n");
if (pdvi->cbSize != sizeof(DLLVERSIONINFO)) {
if (pdvi->cbSize != sizeof(DLLVERSIONINFO))
return E_INVALIDARG;
}
pdvi->dwMajorVersion = 4;
pdvi->dwMinorVersion = 0;
@ -760,99 +60,47 @@ RICHED32_DllGetVersion (DLLVERSIONINFO *pdvi)
return S_OK;
}
/***
* DESCRIPTION:
* Registers the window class.
*
* PARAMETER(S):
* None
*
* RETURN:
* None
*/
VOID RICHED32_Register(void)
/* Unregisters the window class. */
static BOOL RICHED32_Unregister(void)
{
TRACE("\n");
UnregisterClassA(RICHEDIT_CLASS10A, NULL);
return TRUE;
}
/* Registers the window class. */
static BOOL RICHED32_Register(void)
{
WNDCLASSA wndClass;
TRACE("\n");
ZeroMemory(&wndClass, sizeof(WNDCLASSA));
wndClass.style = CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS;
wndClass.lpfnWndProc = RICHED32_WindowProc;
wndClass.lpfnWndProc = RichEdit10ANSIWndProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = RTFInfoOffset + sizeof(RTFControl_Info*);
wndClass.cbWndExtra = 4;
wndClass.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wndClass.lpszClassName = RICHEDIT_CLASS10A; /* WC_RICHED32A; */
RegisterClassA(&wndClass);
return TRUE;
}
/***
* DESCRIPTION:
* Unregisters the window class.
*
* PARAMETER(S):
* None
*
* RETURN:
* None
*/
VOID RICHED32_Unregister(void)
/* Initialization function */
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
TRACE("\n");
UnregisterClassA(RICHEDIT_CLASS10A, NULL);
}
/***
* DESCRIPTION:
* Initialize edit control class info
*/
VOID RICHEDIT_InitEditControlInfo(void)
switch (fdwReason)
{
WNDCLASSA wcEdit;
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinstDLL);
return RICHED32_Register();
if (GetClassInfoA(0, "edit", &wcEdit))
{
lpfnEditWndProc = wcEdit.lpfnWndProc;
RTFInfoOffset = wcEdit.cbWndExtra;
case DLL_PROCESS_DETACH:
return RICHED32_Unregister();
}
else
ERR("Failed to retrieve edit control class info\n");
}
INT RICHEDIT_GetTextRange(HWND hwnd,TEXTRANGEA *tr)
{
UINT alloc_size, text_size, range_size;
char *text;
TRACE("start: 0x%x stop: 0x%x\n",(INT)tr->chrg.cpMin,(INT)tr->chrg.cpMax);
if (!(alloc_size = SendMessageA(hwnd,WM_GETTEXTLENGTH,0,0))) return FALSE;
if (!(text = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (alloc_size+1))))
return FALSE;
text_size = SendMessageA(hwnd,WM_GETTEXT,alloc_size,(INT)text);
if (text_size > tr->chrg.cpMin)
{
range_size = (text_size> tr->chrg.cpMax) ? (tr->chrg.cpMax - tr->chrg.cpMin) : (text_size - tr->chrg.cpMin);
TRACE("EditText: %.30s ...\n",text+tr->chrg.cpMin);
memcpy(tr->lpstrText,text+tr->chrg.cpMin,range_size);
}
else range_size = 0;
HeapFree(GetProcessHeap(), 0, text);
return range_size;
}
INT RICHEDIT_GetSelText(HWND hwnd,LPSTR lpstrBuffer)
{
TEXTRANGEA textrange;
textrange.lpstrText = lpstrBuffer;
SendMessageA(hwnd,EM_GETSEL,(INT)&textrange.chrg.cpMin,(INT)&textrange.chrg.cpMax);
return RICHEDIT_GetTextRange(hwnd,&textrange);
return TRUE;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
void WriterInit (RTF_Info *);
int BeginFile (RTF_Info *);

View File

@ -1,356 +0,0 @@
const char *stdCharName[] =
{
"nothing",
"space",
"exclam",
"quotedbl",
"numbersign",
"dollar",
"percent",
"ampersand",
"quoteright",
"parenleft",
"parenright",
"asterisk",
"plus",
"comma",
"hyphen",
"period",
"slash",
"zero",
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
"eight",
"nine",
"colon",
"semicolon",
"less",
"equal",
"greater",
"question",
"at",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
"bracketleft",
"backslash",
"bracketright",
"asciicircum",
"underscore",
"quoteleft",
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
"braceleft",
"bar",
"braceright",
"asciitilde",
"exclamdown",
"cent",
"sterling",
"fraction",
"yen",
"florin",
"section",
"currency",
"quotedblleft",
"guillemotleft",
"guilsinglleft",
"guilsinglright",
"fi",
"fl",
"endash",
"dagger",
"daggerdbl",
"periodcentered",
"paragraph",
"bullet",
"quotesinglbase",
"quotedblbase",
"quotedblright",
"guillemotright",
"ellipsis",
"perthousand",
"questiondown",
"grave",
"acute",
"circumflex",
"tilde",
"macron",
"breve",
"dotaccent",
"dieresis",
"ring",
"cedilla",
"hungarumlaut",
"ogonek",
"caron",
"emdash",
"AE",
"ordfeminine",
"Lslash",
"Oslash",
"OE",
"ordmasculine",
"ae",
"dotlessi",
"lslash",
"oslash",
"oe",
"germandbls",
"Aacute",
"Acircumflex",
"Adieresis",
"Agrave",
"Aring",
"Atilde",
"Ccedilla",
"Eacute",
"Ecircumflex",
"Edieresis",
"Egrave",
"Eth",
"Iacute",
"Icircumflex",
"Idieresis",
"Igrave",
"Ntilde",
"Oacute",
"Ocircumflex",
"Odieresis",
"Ograve",
"Otilde",
"Scaron",
"Thorn",
"Uacute",
"Ucircumflex",
"Udieresis",
"Ugrave",
"Yacute",
"Ydieresis",
"aacute",
"acircumflex",
"adieresis",
"agrave",
"aring",
"atilde",
"brokenbar",
"ccedilla",
"copyright",
"degree",
"divide",
"eacute",
"ecircumflex",
"edieresis",
"egrave",
"eth",
"iacute",
"icircumflex",
"idieresis",
"igrave",
"logicalnot",
"minus",
"multiply",
"ntilde",
"oacute",
"ocircumflex",
"odieresis",
"ograve",
"onehalf",
"onequarter",
"onesuperior",
"otilde",
"plusminus",
"registered",
"thorn",
"threequarters",
"threesuperior",
"trademark",
"twosuperior",
"uacute",
"ucircumflex",
"udieresis",
"ugrave",
"yacute",
"ydieresis",
"Alpha",
"Beta",
"Chi",
"Delta",
"Epsilon",
"Phi",
"Gamma",
"Eta",
"Iota",
"Kappa",
"Lambda",
"Mu",
"Nu",
"Omicron",
"Pi",
"Theta",
"Rho",
"Sigma",
"Tau",
"Upsilon",
"varUpsilon",
"Omega",
"Xi",
"Psi",
"Zeta",
"alpha",
"beta",
"chi",
"delta",
"epsilon",
"phi",
"varphi",
"gamma",
"eta",
"iota",
"kappa",
"lambda",
"mu",
"nu",
"omicron",
"pi",
"varpi",
"theta",
"vartheta",
"rho",
"sigma",
"varsigma",
"tau",
"upsilon",
"omega",
"xi",
"psi",
"zeta",
"nobrkspace",
"nobrkhyphen",
"lessequal",
"greaterequal",
"infinity",
"integral",
"notequal",
"radical",
"radicalex",
"approxequal",
"apple",
"partialdiff",
"opthyphen",
"formula",
"lozenge",
"universal",
"existential",
"suchthat",
"congruent",
"therefore",
"perpendicular",
"minute",
"club",
"diamond",
"heart",
"spade",
"arrowboth",
"arrowleft",
"arrowup",
"arrowright",
"arrowdown",
"second",
"proportional",
"equivalence",
"arrowvertex",
"arrowhorizex",
"carriagereturn",
"aleph",
"Ifraktur",
"Rfraktur",
"weierstrass",
"circlemultiply",
"circleplus",
"emptyset",
"intersection",
"union",
"propersuperset",
"reflexsuperset",
"notsubset",
"propersubset",
"reflexsubset",
"element",
"notelement",
"angle",
"gradient",
"product",
"logicaland",
"logicalor",
"arrowdblboth",
"arrowdblleft",
"arrowdblup",
"arrowdblright",
"arrowdbldown",
"angleleft",
"registersans",
"copyrightsans",
"trademarksans",
"angleright",
"mathplus",
"mathminus",
"mathasterisk",
"mathnumbersign",
"dotmath",
"mathequal",
"mathtilde",
(char *) NULL
};

View File

@ -1,269 +0,0 @@
/*
* text-writer -- RTF-to-text translation writer code.
*
* Read RTF input, write text of document (text extraction).
*
* Wrapper must call WriterInit() once before processing any files,
* then set up input and call BeginFile() for each input file.
*
* This installs callbacks for the text and control token classes.
* The control class is necessary so that special characters such as
* \par, \tab, \sect, etc. can be converted.
*
* It's problematic what to do with text in headers and footers, and
* what to do about tables.
*
* This really is quite a stupid program, for instance, it could keep
* track of the current leader character and dump that out when a tab
* is encountered.
*
* 04 Feb 91 Paul DuBois dubois@primate.wisc.edu
*
* This software may be redistributed without restriction and used for
* any purpose whatsoever.
*
* 04 Feb 91
* -Created.
* 27 Feb 91
* - Updated for distribution 1.05.
* 13 Jul 93
* - Updated to compile under THINK C 6.0.
* 31 Aug 93
* - Added Mike Sendall's entries for Macintosh char map.
* 07 Sep 93
* - Uses charset map and output sequence map for character translation.
* 11 Mar 94
* - Updated for 1.10 distribution.
*/
#include <stdio.h>
#include "rtf.h"
#include "rtf2text.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(richedit);
static void TextClass (RTF_Info *info);
static void ControlClass (RTF_Info *info);
static void Destination (RTF_Info *info);
static void SpecialChar (RTF_Info *info);
static void PutStdChar (RTF_Info *info, int stdCode);
static void PutLitChar (RTF_Info *info, int c);
static void PutLitStr (RTF_Info *info, char *s);
/*
* Initialize the writer.
*/
void
WriterInit (RTF_Info *info )
{
RTFReadOutputMap (info, info->outMap,1);
}
int
BeginFile (RTF_Info *info )
{
/* install class callbacks */
RTFSetClassCallback (info, rtfText, TextClass);
RTFSetClassCallback (info, rtfControl, ControlClass);
return (1);
}
/*
* Write out a character. rtfMajor contains the input character, rtfMinor
* contains the corresponding standard character code.
*
* If the input character isn't in the charset map, try to print some
* representation of it.
*/
static void
TextClass (RTF_Info *info)
{
char buf[rtfBufSiz];
TRACE("\n");
if (info->rtfFormat == SF_TEXT)
PutLitChar (info, info->rtfMajor);
else if (info->rtfMinor != rtfSC_nothing)
PutStdChar (info, info->rtfMinor);
else
{
if (info->rtfMajor < 128) /* in ASCII range */
sprintf (buf, "[[%c]]", info->rtfMajor);
else
sprintf (buf, "[[\\'%02x]]", info->rtfMajor);
PutLitStr (info, buf);
}
}
static void
ControlClass (RTF_Info *info)
{
TRACE("\n");
switch (info->rtfMajor)
{
case rtfDestination:
Destination (info);
break;
case rtfSpecialChar:
SpecialChar (info);
break;
}
}
/*
* This function notices destinations that should be ignored
* and skips to their ends. This keeps, for instance, picture
* data from being considered as plain text.
*/
static void
Destination (RTF_Info *info)
{
TRACE("\n");
switch (info->rtfMinor)
{
case rtfPict:
case rtfFNContSep:
case rtfFNContNotice:
case rtfInfo:
case rtfIndexRange:
case rtfITitle:
case rtfISubject:
case rtfIAuthor:
case rtfIOperator:
case rtfIKeywords:
case rtfIComment:
case rtfIVersion:
case rtfIDoccomm:
RTFSkipGroup (info);
break;
}
}
/*
* The reason these use the rtfSC_xxx thingies instead of just writing
* out ' ', '-', '"', etc., is so that the mapping for these characters
* can be controlled by the text-map file.
*/
void SpecialChar (RTF_Info *info)
{
TRACE("\n");
switch (info->rtfMinor)
{
case rtfPage:
case rtfSect:
case rtfRow:
case rtfLine:
case rtfPar:
PutLitChar (info, '\n');
break;
case rtfCell:
PutStdChar (info, rtfSC_space); /* make sure cells are separated */
break;
case rtfNoBrkSpace:
PutStdChar (info, rtfSC_nobrkspace);
break;
case rtfTab:
PutLitChar (info, '\t');
break;
case rtfNoBrkHyphen:
PutStdChar (info, rtfSC_nobrkhyphen);
break;
case rtfBullet:
PutStdChar (info, rtfSC_bullet);
break;
case rtfEmDash:
PutStdChar (info, rtfSC_emdash);
break;
case rtfEnDash:
PutStdChar (info, rtfSC_endash);
break;
case rtfLQuote:
PutStdChar (info, rtfSC_quoteleft);
break;
case rtfRQuote:
PutStdChar (info, rtfSC_quoteright);
break;
case rtfLDblQuote:
PutStdChar (info, rtfSC_quotedblleft);
break;
case rtfRDblQuote:
PutStdChar (info, rtfSC_quotedblright);
break;
}
}
/*
* Eventually this should keep track of the destination of the
* current state and only write text when in the initial state.
*
* If the output sequence is unspecified in the output map, write
* the character's standard name instead. This makes map deficiencies
* obvious and provides incentive to fix it. :-)
*/
void PutStdChar (RTF_Info *info, int stdCode)
{
char *oStr = (char *) NULL;
char buf[rtfBufSiz];
/* if (stdCode == rtfSC_nothing)
RTFPanic ("Unknown character code, logic error\n");
*/
TRACE("\n");
oStr = info->outMap[stdCode];
if (oStr == (char *) NULL) /* no output sequence in map */
{
sprintf (buf, "[[%s]]", RTFStdCharName (info, stdCode));
oStr = buf;
}
PutLitStr (info, oStr);
}
void PutLitChar (RTF_Info *info, int c)
{
if( info->dwOutputCount >= ( sizeof info->OutputBuffer - 1 ) )
RTFFlushOutputBuffer( info );
info->OutputBuffer[info->dwOutputCount++] = c;
}
void RTFFlushOutputBuffer( RTF_Info *info )
{
info->OutputBuffer[info->dwOutputCount] = 0;
SendMessageA( info->hwndEdit, EM_REPLACESEL, FALSE, (LPARAM) info->OutputBuffer );
info->dwOutputCount = 0;
}
static void PutLitStr (RTF_Info *info, char *str )
{
int len = strlen( str );
if( ( len + info->dwOutputCount + 1 ) > sizeof info->OutputBuffer )
RTFFlushOutputBuffer( info );
if( ( len + 1 ) >= sizeof info->OutputBuffer )
{
SendMessageA( info->hwndEdit, EM_REPLACESEL, FALSE, (LPARAM) str );
return;
}
strcpy( &info->OutputBuffer[info->dwOutputCount], str );
info->dwOutputCount += len;
}

View File

@ -1,172 +0,0 @@
/*
* Output sequence map for rtf2text
*
* Field 1 is the standard character name. Field 2 is the output sequence
* to produce for that character.
*
* The output sequence is simply a string of characters. If it contains
* whitespace, it may be quoted. If it contains quotes, it may be quoted
* with a different quote character.
*
* characters in ASCII range (32-127
*/
const char *text_map[] = {
"space" ," ",
"exclam" ,"!",
"quotedbl" ,"\"",
"numbersign" ,"#",
"dollar" ,"$",
"percent" ,"%",
"ampersand" ,"&",
"quoteright" ,"'",
"parenleft" ,"(",
"parenright" ,")",
"asterisk" ,"*",
"plus" ,"+",
"comma" ,",",
"hyphen" ,"-",
"period" ,".",
"slash" ,"/",
"zero" ,"0",
"one" ,"1",
"two" ,"2",
"three" ,"3",
"four" ,"4",
"five" ,"5",
"six" ,"6",
"seven" ,"7",
"eight" ,"8",
"nine" ,"9",
"colon" ,":",
"semicolon" ,";",
"less" ,"<",
"equal" ,"=",
"greater" ,">",
"question" ,"?",
"at" ,"@",
"A" ,"A",
"B" ,"B",
"C" ,"C",
"D" ,"D",
"E" ,"E",
"F" ,"F",
"G" ,"G",
"H" ,"H",
"I" ,"I",
"J" ,"J",
"K" ,"K",
"L" ,"L",
"M" ,"M",
"N" ,"N",
"O" ,"O",
"P" ,"P",
"Q" ,"Q",
"R" ,"R",
"S" ,"S",
"T" ,"T",
"U" ,"U",
"V" ,"V",
"W" ,"W",
"X" ,"X",
"Y" ,"Y",
"Z" ,"Z",
"bracketleft" ,"[",
"backslash" ,"\\",
"bracketright" ,"]",
"asciicircum" ,"^",
"underscore" ,"_",
"quoteleft" ,"`",
"a" ,"a",
"b" ,"b",
"c" ,"c",
"d" ,"d",
"e" ,"e",
"f" ,"f",
"g" ,"g",
"h" ,"h",
"i" ,"i",
"j" ,"j",
"k" ,"k",
"l" ,"l",
"m" ,"m",
"n" ,"n",
"o" ,"o",
"p" ,"p",
"q" ,"q",
"r" ,"r",
"s" ,"s",
"t" ,"t",
"u" ,"u",
"v" ,"v",
"w" ,"w",
"x" ,"x",
"y" ,"y",
"z" ,"z",
"braceleft" ,"{",
"bar" ,"|",
"braceright" ,"}",
"asciitilde" ,"~",
"AE" ,"AE",
"OE" ,"OE",
"acute" ,"'",
"ae" ,"ae",
"angleleft" ,"<",
"angleright" ,">",
"arrowboth" ,"<->",
"arrowdblboth" ,"<=>",
"arrowdblleft" ,"<=",
"arrowdblright" ,"=>",
"arrowleft" ,"<-",
"arrowright" ,"->",
"bullet" ,"o",
"cent" ,"cent",
"circumflex" ,"^",
"copyright" ,"(c)",
"copyrightsans" ,"(c)",
"degree" ,"deg.",
"divide" ,"/",
"dotlessi" ,"i",
"ellipsis" ,"...",
"emdash" ,"--",
"endash" ,"-",
"fi" ,"fi",
"fl" ,"fl",
"fraction" ,"/",
"germandbls" ,"ss",
"grave" ,"`",
"greaterequal" ,">=",
"guillemotleft" ,"<<",
"guillemotright" ,">>",
"guilsinglleft" ,"<",
"guilsinglright" ,">",
"lessequal" ,"<=",
"logicalnot" ,"~",
"mathasterisk" ,"*",
"mathequal" ,"=",
"mathminus" ,"-",
"mathnumbersign" ,"#",
"mathplus" ,"+",
"mathtilde" ,"~",
"minus" ,"-",
"mu" ,"u",
"multiply" ,"x",
"nobrkhyphen" ,"-",
"nobrkspace" ," ",
"notequal" ,"!=",
"oe" ,"oe",
"onehalf" ,"1/2",
"onequarter" ,"1/4",
"periodcentered" ,".",
"plusminus" ,"+/-",
"quotedblbase" ,",,",
"quotedblleft" ,"\"",
"quotedblright" ,"\"",
"quotesinglbase" ,",",
"registered" ,"reg.",
"registersans" ,"reg.",
"threequarters" ,"3/4",
"tilde" ,"~",
"trademark" ,"(TM)",
"trademarksans" ,"(TM)"
};