mirror of
https://github.com/reactos/reactos.git
synced 2024-07-04 19:54:58 +00:00
Sync to Wine-20050524:
Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. Ivan Leo Puoti <ivanleo@gmail.com> - Fix crash in ME_GetRunSizeCommon(). Turn a FIXME into a TRACE. Michael Stefaniuc <mstefani@redhat.de> - Change an assert to a WARN. Hannu Valtonen <Hannu.Valtonen@hut.fi> - Use correct background color for the whole richedit control. - Implement EM_LINESCROLL message handling - Fix a problem with scrolling over the end of the text in WM_WHEELMOUSE. Vincent Beron <vberon@mecano.gme.usherb.ca> - Provide minimal API documentation in advapi/eventlog.c to silence some winapi_check output. - Move around functions in riched20, richedit and rpcrt4 to achieve the same goal. Krzysztof Foltman <wdev@foltman.com> - Added stubs for a couple of missing 2.0 and 3.0 messages. Phil Krylov <phil@newstar.rinet.ru> - Fixed an error in my previous commit which caused an infinite loop in IE6 installer. svn path=/trunk/; revision=15578
This commit is contained in:
parent
8264539518
commit
9a3e5b9dad
|
@ -3,6 +3,7 @@ TOPOBJDIR = ../..
|
||||||
SRCDIR = @srcdir@
|
SRCDIR = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
MODULE = riched20.dll
|
MODULE = riched20.dll
|
||||||
|
IMPORTLIB = libriched20.$(IMPLIBEXT)
|
||||||
IMPORTS = user32 gdi32 kernel32
|
IMPORTS = user32 gdi32 kernel32
|
||||||
EXTRALIBS = -luuid
|
EXTRALIBS = -luuid
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,10 @@
|
||||||
- EM_FINDWORDBREAK
|
- EM_FINDWORDBREAK
|
||||||
- EM_FMTLINES
|
- EM_FMTLINES
|
||||||
- EM_FORMATRANGE
|
- EM_FORMATRANGE
|
||||||
|
- EM_GETAUTOURLDETECT 2.0
|
||||||
|
- EM_GETBIDIOPTIONS 3.0
|
||||||
- EM_GETCHARFORMAT (partly done)
|
- EM_GETCHARFORMAT (partly done)
|
||||||
|
- EM_GETEDITSTYLE
|
||||||
+ EM_GETEVENTMASK
|
+ EM_GETEVENTMASK
|
||||||
- EM_GETFIRSTVISIBLELINE
|
- EM_GETFIRSTVISIBLELINE
|
||||||
- EM_GETIMECOLOR 1.0asian
|
- EM_GETIMECOLOR 1.0asian
|
||||||
|
@ -53,24 +56,30 @@
|
||||||
- EM_GETOLEINTERFACE
|
- EM_GETOLEINTERFACE
|
||||||
- EM_GETOPTIONS
|
- EM_GETOPTIONS
|
||||||
+ EM_GETPARAFORMAT
|
+ EM_GETPARAFORMAT
|
||||||
|
- EM_GETPASSWORDCHAR 2.0
|
||||||
- EM_GETPUNCTUATION 1.0asian
|
- EM_GETPUNCTUATION 1.0asian
|
||||||
- EM_GETRECT
|
- EM_GETRECT
|
||||||
- EM_GETREDONAME 2.0
|
- EM_GETREDONAME 2.0
|
||||||
+ EM_GETSEL
|
+ EM_GETSEL
|
||||||
+ EM_GETSELTEXT (ANSI&Unicode)
|
+ EM_GETSELTEXT (ANSI&Unicode)
|
||||||
|
- EM_GETSCROLLPOS 3.0
|
||||||
! - EM_GETTHUMB
|
! - EM_GETTHUMB
|
||||||
|
- EM_GETTEXTEX 2.0
|
||||||
|
- EM_GETTEXTLENGTHEX
|
||||||
- EM_GETTEXTMODE 2.0
|
- EM_GETTEXTMODE 2.0
|
||||||
? + EM_GETTEXTRANGE (ANSI&Unicode)
|
? + EM_GETTEXTRANGE (ANSI&Unicode)
|
||||||
|
- EM_GETTYPOGRAPHYOPTIONS 3.0
|
||||||
- EM_GETUNDONAME
|
- EM_GETUNDONAME
|
||||||
- EM_GETWORDBREAKPROC
|
- EM_GETWORDBREAKPROC
|
||||||
- EM_GETWORDBREAKPROCEX
|
- EM_GETWORDBREAKPROCEX
|
||||||
- EM_GETWORDWRAPMODE 1.0asian
|
- EM_GETWORDWRAPMODE 1.0asian
|
||||||
|
- EM_SETZOOM 3.0
|
||||||
- EM_HIDESELECTION
|
- EM_HIDESELECTION
|
||||||
- EM_LIMITTEXT
|
- EM_LIMITTEXT
|
||||||
- EM_LINEFROMCHAR
|
- EM_LINEFROMCHAR
|
||||||
- EM_LINEINDEX
|
- EM_LINEINDEX
|
||||||
- EM_LINELENGTH
|
- EM_LINELENGTH
|
||||||
- EM_LINESCROLL
|
+ EM_LINESCROLL
|
||||||
- EM_PASTESPECIAL
|
- EM_PASTESPECIAL
|
||||||
- EM_POSFROMCHARS
|
- EM_POSFROMCHARS
|
||||||
+ EM_REDO 2.0
|
+ EM_REDO 2.0
|
||||||
|
@ -79,9 +88,12 @@
|
||||||
- EM_SCROLL
|
- EM_SCROLL
|
||||||
- EM_SCROLLCARET
|
- EM_SCROLLCARET
|
||||||
- EM_SELECTIONTYPE
|
- EM_SELECTIONTYPE
|
||||||
|
- EM_SETBIDIOPTIONS 3.0
|
||||||
+ EM_SETBKGNDCOLOR
|
+ EM_SETBKGNDCOLOR
|
||||||
- EM_SETCHARFORMAT (partly done, no ANSI)
|
- EM_SETCHARFORMAT (partly done, no ANSI)
|
||||||
|
- EM_SETEDITSTYLE
|
||||||
+ EM_SETEVENTMASK (few notifications supported)
|
+ EM_SETEVENTMASK (few notifications supported)
|
||||||
|
- EM_SETFONTSIZE
|
||||||
- EM_SETIMECOLOR 1.0asian
|
- EM_SETIMECOLOR 1.0asian
|
||||||
- EM_SETIMEOPTIONS 1.0asian
|
- EM_SETIMEOPTIONS 1.0asian
|
||||||
- EM_SETLANGOPTIONS 2.0
|
- EM_SETLANGOPTIONS 2.0
|
||||||
|
@ -89,18 +101,26 @@
|
||||||
+ EM_SETMODIFY (not sure if implementation is correct)
|
+ EM_SETMODIFY (not sure if implementation is correct)
|
||||||
- EM_SETOLECALLBACK
|
- EM_SETOLECALLBACK
|
||||||
- EM_SETOPTIONS
|
- EM_SETOPTIONS
|
||||||
|
- EM_SETPALETTE 2.0
|
||||||
+ EM_SETPARAFORMAT
|
+ EM_SETPARAFORMAT
|
||||||
|
- EM_SETPASSWORDCHAR 2.0
|
||||||
- EM_SETPUNCTUATION 1.0asian
|
- EM_SETPUNCTUATION 1.0asian
|
||||||
+ EM_SETREADONLY no beep on modification attempt
|
+ EM_SETREADONLY no beep on modification attempt
|
||||||
- EM_SETRECT
|
- EM_SETRECT
|
||||||
- EM_SETRECTNP (EM_SETRECT without repainting) - not supported in RICHEDIT
|
- EM_SETRECTNP (EM_SETRECT without repainting) - not supported in RICHEDIT
|
||||||
+ EM_SETSEL
|
+ EM_SETSEL
|
||||||
|
- EM_SETSCROLLPOS 3.0
|
||||||
|
- EM_SETTABSTOPS 3.0
|
||||||
- EM_SETTARGETDEVICE
|
- EM_SETTARGETDEVICE
|
||||||
|
- EM_SETTEXTEX 3.0
|
||||||
- EM_SETTEXTMODE 2.0
|
- EM_SETTEXTMODE 2.0
|
||||||
|
- EM_SETTYPOGRAPHYOPTIONS 3.0
|
||||||
- EM_SETUNDOLIMIT 2.0
|
- EM_SETUNDOLIMIT 2.0
|
||||||
- EM_SETWORDBREAKPROC
|
- EM_SETWORDBREAKPROC
|
||||||
- EM_SETWORDBREAKPROCEX
|
- EM_SETWORDBREAKPROCEX
|
||||||
- EM_SETWORDWRAPMODE 1.0asian
|
- EM_SETWORDWRAPMODE 1.0asian
|
||||||
|
- EM_SETZOOM 3.0
|
||||||
|
- EM_SHOWSCROLLBAR 2.0
|
||||||
- EM_STOPGROUPTYPING 2.0
|
- EM_STOPGROUPTYPING 2.0
|
||||||
+ EM_STREAMIN (can't fall back to text when the RTF isn't really RTF)
|
+ EM_STREAMIN (can't fall back to text when the RTF isn't really RTF)
|
||||||
+ EM_STREAMOUT
|
+ EM_STREAMOUT
|
||||||
|
@ -268,6 +288,7 @@ static LRESULT ME_StreamInText(ME_TextEditor *editor, DWORD dwFormat, ME_InStrea
|
||||||
ME_InsertTextFromCursor(editor, 0, pText, nWideChars, style);
|
ME_InsertTextFromCursor(editor, 0, pText, nWideChars, style);
|
||||||
if (stream->dwSize < STREAMIN_BUFFER_SIZE)
|
if (stream->dwSize < STREAMIN_BUFFER_SIZE)
|
||||||
break;
|
break;
|
||||||
|
stream->dwSize = 0;
|
||||||
} while(1);
|
} while(1);
|
||||||
ME_CommitUndo(editor);
|
ME_CommitUndo(editor);
|
||||||
ME_Repaint(editor);
|
ME_Repaint(editor);
|
||||||
|
@ -485,7 +506,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
|
||||||
int nEventMask = editor->nEventMask;
|
int nEventMask = editor->nEventMask;
|
||||||
ME_InStream inStream;
|
ME_InStream inStream;
|
||||||
|
|
||||||
TRACE("%p %p\n", stream, editor->hWnd);
|
TRACE("stream==%p hWnd==%p format==0x%X\n", stream, editor->hWnd, (UINT)format);
|
||||||
editor->nEventMask = 0;
|
editor->nEventMask = 0;
|
||||||
|
|
||||||
ME_GetSelection(editor, &from, &to);
|
ME_GetSelection(editor, &from, &to);
|
||||||
|
@ -740,6 +761,33 @@ void ME_DestroyEditor(ME_TextEditor *editor)
|
||||||
FREE_OBJ(editor);
|
FREE_OBJ(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static WCHAR wszClassName[] = {'R', 'i', 'c', 'h', 'E', 'd', 'i', 't', '2', '0', 'W', 0};
|
||||||
|
static WCHAR wszClassName50[] = {'R', 'i', 'c', 'h', 'E', 'd', 'i', 't', '5', '0', 'W', 0};
|
||||||
|
|
||||||
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||||
|
{
|
||||||
|
TRACE("\n");
|
||||||
|
switch (fdwReason)
|
||||||
|
{
|
||||||
|
case DLL_PROCESS_ATTACH:
|
||||||
|
DisableThreadLibraryCalls(hinstDLL);
|
||||||
|
me_heap = HeapCreate (0, 0x10000, 0);
|
||||||
|
ME_RegisterEditorClass(hinstDLL);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DLL_PROCESS_DETACH:
|
||||||
|
UnregisterClassW(wszClassName, 0);
|
||||||
|
UnregisterClassW(wszClassName50, 0);
|
||||||
|
UnregisterClassA("RichEdit20A", 0);
|
||||||
|
UnregisterClassA("RichEdit50A", 0);
|
||||||
|
HeapDestroy (me_heap);
|
||||||
|
me_heap = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#define UNSUPPORTED_MSG(e) \
|
#define UNSUPPORTED_MSG(e) \
|
||||||
case e: \
|
case e: \
|
||||||
FIXME(#e ": stub\n"); \
|
FIXME(#e ": stub\n"); \
|
||||||
|
@ -766,6 +814,9 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||||
UNSUPPORTED_MSG(EM_FINDWORDBREAK)
|
UNSUPPORTED_MSG(EM_FINDWORDBREAK)
|
||||||
UNSUPPORTED_MSG(EM_FMTLINES)
|
UNSUPPORTED_MSG(EM_FMTLINES)
|
||||||
UNSUPPORTED_MSG(EM_FORMATRANGE)
|
UNSUPPORTED_MSG(EM_FORMATRANGE)
|
||||||
|
UNSUPPORTED_MSG(EM_GETAUTOURLDETECT)
|
||||||
|
UNSUPPORTED_MSG(EM_GETBIDIOPTIONS)
|
||||||
|
UNSUPPORTED_MSG(EM_GETEDITSTYLE)
|
||||||
UNSUPPORTED_MSG(EM_GETFIRSTVISIBLELINE)
|
UNSUPPORTED_MSG(EM_GETFIRSTVISIBLELINE)
|
||||||
UNSUPPORTED_MSG(EM_GETIMECOMPMODE)
|
UNSUPPORTED_MSG(EM_GETIMECOMPMODE)
|
||||||
/* UNSUPPORTED_MSG(EM_GETIMESTATUS) missing in Wine headers */
|
/* UNSUPPORTED_MSG(EM_GETIMESTATUS) missing in Wine headers */
|
||||||
|
@ -775,34 +826,50 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||||
UNSUPPORTED_MSG(EM_GETLINECOUNT)
|
UNSUPPORTED_MSG(EM_GETLINECOUNT)
|
||||||
/* UNSUPPORTED_MSG(EM_GETOLEINTERFACE) separate stub */
|
/* UNSUPPORTED_MSG(EM_GETOLEINTERFACE) separate stub */
|
||||||
UNSUPPORTED_MSG(EM_GETOPTIONS)
|
UNSUPPORTED_MSG(EM_GETOPTIONS)
|
||||||
|
UNSUPPORTED_MSG(EM_GETPASSWORDCHAR)
|
||||||
UNSUPPORTED_MSG(EM_GETRECT)
|
UNSUPPORTED_MSG(EM_GETRECT)
|
||||||
UNSUPPORTED_MSG(EM_GETREDONAME)
|
UNSUPPORTED_MSG(EM_GETREDONAME)
|
||||||
|
UNSUPPORTED_MSG(EM_GETSCROLLPOS)
|
||||||
|
UNSUPPORTED_MSG(EM_GETTEXTEX)
|
||||||
|
UNSUPPORTED_MSG(EM_GETTEXTLENGTHEX)
|
||||||
UNSUPPORTED_MSG(EM_GETTEXTMODE)
|
UNSUPPORTED_MSG(EM_GETTEXTMODE)
|
||||||
|
UNSUPPORTED_MSG(EM_GETTYPOGRAPHYOPTIONS)
|
||||||
UNSUPPORTED_MSG(EM_GETUNDONAME)
|
UNSUPPORTED_MSG(EM_GETUNDONAME)
|
||||||
UNSUPPORTED_MSG(EM_GETWORDBREAKPROC)
|
UNSUPPORTED_MSG(EM_GETWORDBREAKPROC)
|
||||||
UNSUPPORTED_MSG(EM_GETWORDBREAKPROCEX)
|
UNSUPPORTED_MSG(EM_GETWORDBREAKPROCEX)
|
||||||
|
UNSUPPORTED_MSG(EM_GETZOOM)
|
||||||
UNSUPPORTED_MSG(EM_HIDESELECTION)
|
UNSUPPORTED_MSG(EM_HIDESELECTION)
|
||||||
UNSUPPORTED_MSG(EM_LIMITTEXT) /* also known as EM_SETLIMITTEXT */
|
UNSUPPORTED_MSG(EM_LIMITTEXT) /* also known as EM_SETLIMITTEXT */
|
||||||
UNSUPPORTED_MSG(EM_LINEFROMCHAR)
|
UNSUPPORTED_MSG(EM_LINEFROMCHAR)
|
||||||
UNSUPPORTED_MSG(EM_LINEINDEX)
|
UNSUPPORTED_MSG(EM_LINEINDEX)
|
||||||
UNSUPPORTED_MSG(EM_LINELENGTH)
|
UNSUPPORTED_MSG(EM_LINELENGTH)
|
||||||
UNSUPPORTED_MSG(EM_LINESCROLL)
|
|
||||||
UNSUPPORTED_MSG(EM_PASTESPECIAL)
|
UNSUPPORTED_MSG(EM_PASTESPECIAL)
|
||||||
/* UNSUPPORTED_MSG(EM_POSFROMCHARS) missing in Wine headers */
|
/* UNSUPPORTED_MSG(EM_POSFROMCHARS) missing in Wine headers */
|
||||||
UNSUPPORTED_MSG(EM_REQUESTRESIZE)
|
UNSUPPORTED_MSG(EM_REQUESTRESIZE)
|
||||||
UNSUPPORTED_MSG(EM_SCROLL)
|
UNSUPPORTED_MSG(EM_SCROLL)
|
||||||
UNSUPPORTED_MSG(EM_SCROLLCARET)
|
UNSUPPORTED_MSG(EM_SCROLLCARET)
|
||||||
UNSUPPORTED_MSG(EM_SELECTIONTYPE)
|
UNSUPPORTED_MSG(EM_SELECTIONTYPE)
|
||||||
|
UNSUPPORTED_MSG(EM_SETBIDIOPTIONS)
|
||||||
|
UNSUPPORTED_MSG(EM_SETEDITSTYLE)
|
||||||
|
UNSUPPORTED_MSG(EM_SETFONTSIZE)
|
||||||
UNSUPPORTED_MSG(EM_SETLANGOPTIONS)
|
UNSUPPORTED_MSG(EM_SETLANGOPTIONS)
|
||||||
UNSUPPORTED_MSG(EM_SETOLECALLBACK)
|
UNSUPPORTED_MSG(EM_SETOLECALLBACK)
|
||||||
UNSUPPORTED_MSG(EM_SETOPTIONS)
|
UNSUPPORTED_MSG(EM_SETOPTIONS)
|
||||||
|
UNSUPPORTED_MSG(EM_SETPALETTE)
|
||||||
|
UNSUPPORTED_MSG(EM_SETPASSWORDCHAR)
|
||||||
UNSUPPORTED_MSG(EM_SETRECT)
|
UNSUPPORTED_MSG(EM_SETRECT)
|
||||||
UNSUPPORTED_MSG(EM_SETRECTNP)
|
UNSUPPORTED_MSG(EM_SETRECTNP)
|
||||||
|
UNSUPPORTED_MSG(EM_SETSCROLLPOS)
|
||||||
|
UNSUPPORTED_MSG(EM_SETTABSTOPS)
|
||||||
UNSUPPORTED_MSG(EM_SETTARGETDEVICE)
|
UNSUPPORTED_MSG(EM_SETTARGETDEVICE)
|
||||||
|
UNSUPPORTED_MSG(EM_SETTEXTEX)
|
||||||
UNSUPPORTED_MSG(EM_SETTEXTMODE)
|
UNSUPPORTED_MSG(EM_SETTEXTMODE)
|
||||||
|
UNSUPPORTED_MSG(EM_SETTYPOGRAPHYOPTIONS)
|
||||||
UNSUPPORTED_MSG(EM_SETUNDOLIMIT)
|
UNSUPPORTED_MSG(EM_SETUNDOLIMIT)
|
||||||
UNSUPPORTED_MSG(EM_SETWORDBREAKPROC)
|
UNSUPPORTED_MSG(EM_SETWORDBREAKPROC)
|
||||||
UNSUPPORTED_MSG(EM_SETWORDBREAKPROCEX)
|
UNSUPPORTED_MSG(EM_SETWORDBREAKPROCEX)
|
||||||
|
UNSUPPORTED_MSG(EM_SHOWSCROLLBAR)
|
||||||
|
UNSUPPORTED_MSG(EM_SETZOOM)
|
||||||
UNSUPPORTED_MSG(WM_SETFONT)
|
UNSUPPORTED_MSG(WM_SETFONT)
|
||||||
UNSUPPORTED_MSG(WM_STYLECHANGING)
|
UNSUPPORTED_MSG(WM_STYLECHANGING)
|
||||||
UNSUPPORTED_MSG(WM_STYLECHANGED)
|
UNSUPPORTED_MSG(WM_STYLECHANGED)
|
||||||
|
@ -950,6 +1017,22 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||||
case EM_GETPARAFORMAT:
|
case EM_GETPARAFORMAT:
|
||||||
ME_GetSelectionParaFormat(editor, (PARAFORMAT2 *)lParam);
|
ME_GetSelectionParaFormat(editor, (PARAFORMAT2 *)lParam);
|
||||||
return 0;
|
return 0;
|
||||||
|
case EM_LINESCROLL:
|
||||||
|
{
|
||||||
|
int nPos = editor->nScrollPosY, nEnd= editor->nTotalLength - editor->sizeWindow.cy;
|
||||||
|
nPos += 8 * lParam; /* FIXME follow the original */
|
||||||
|
if (nPos>=nEnd)
|
||||||
|
nPos = nEnd;
|
||||||
|
if (nPos<0)
|
||||||
|
nPos = 0;
|
||||||
|
if (nPos != editor->nScrollPosY) {
|
||||||
|
ScrollWindow(hWnd, 0, editor->nScrollPosY-nPos, NULL, NULL);
|
||||||
|
editor->nScrollPosY = nPos;
|
||||||
|
SetScrollPos(hWnd, SB_VERT, nPos, TRUE);
|
||||||
|
UpdateWindow(hWnd);
|
||||||
|
}
|
||||||
|
return TRUE; /* Should return false if a single line richedit control */
|
||||||
|
}
|
||||||
case WM_CLEAR:
|
case WM_CLEAR:
|
||||||
{
|
{
|
||||||
int from, to;
|
int from, to;
|
||||||
|
@ -1246,16 +1329,15 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||||
}
|
}
|
||||||
case WM_MOUSEWHEEL:
|
case WM_MOUSEWHEEL:
|
||||||
{
|
{
|
||||||
int gcWheelDelta = 0, nPos = editor->nScrollPosY;
|
int gcWheelDelta = 0, nPos = editor->nScrollPosY, nEnd = editor->nTotalLength - editor->sizeWindow.cy;
|
||||||
UINT pulScrollLines;
|
UINT pulScrollLines;
|
||||||
|
|
||||||
SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0);
|
SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0);
|
||||||
gcWheelDelta -= GET_WHEEL_DELTA_WPARAM(wParam);
|
gcWheelDelta -= GET_WHEEL_DELTA_WPARAM(wParam);
|
||||||
if (abs(gcWheelDelta) >= WHEEL_DELTA && pulScrollLines)
|
if (abs(gcWheelDelta) >= WHEEL_DELTA && pulScrollLines)
|
||||||
nPos += pulScrollLines * (gcWheelDelta / WHEEL_DELTA) * 8;
|
nPos += pulScrollLines * (gcWheelDelta / WHEEL_DELTA) * 8; /* FIXME follow the original */
|
||||||
if(nPos>=editor->nTotalLength)
|
if (nPos>=nEnd)
|
||||||
nPos = editor->nTotalLength - 1;
|
nPos = nEnd;
|
||||||
if (nPos<0)
|
if (nPos<0)
|
||||||
nPos = 0;
|
nPos = 0;
|
||||||
if (nPos != editor->nScrollPosY) {
|
if (nPos != editor->nScrollPosY) {
|
||||||
ScrollWindow(hWnd, 0, editor->nScrollPosY-nPos, NULL, NULL);
|
ScrollWindow(hWnd, 0, editor->nScrollPosY-nPos, NULL, NULL);
|
||||||
|
@ -1376,9 +1458,6 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in
|
||||||
return nWritten;
|
return nWritten;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WCHAR wszClassName[] = {'R', 'i', 'c', 'h', 'E', 'd', 'i', 't', '2', '0', 'W', 0};
|
|
||||||
static WCHAR wszClassName50[] = {'R', 'i', 'c', 'h', 'E', 'd', 'i', 't', '5', '0', 'W', 0};
|
|
||||||
|
|
||||||
void ME_RegisterEditorClass(HINSTANCE hInstance)
|
void ME_RegisterEditorClass(HINSTANCE hInstance)
|
||||||
{
|
{
|
||||||
BOOL bResult;
|
BOOL bResult;
|
||||||
|
@ -1417,30 +1496,6 @@ void ME_RegisterEditorClass(HINSTANCE hInstance)
|
||||||
bResult = RegisterClassA(&wcA);
|
bResult = RegisterClassA(&wcA);
|
||||||
assert(bResult);
|
assert(bResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|
||||||
{
|
|
||||||
TRACE("\n");
|
|
||||||
switch (fdwReason)
|
|
||||||
{
|
|
||||||
case DLL_PROCESS_ATTACH:
|
|
||||||
DisableThreadLibraryCalls(hinstDLL);
|
|
||||||
me_heap = HeapCreate (0, 0x10000, 0);
|
|
||||||
ME_RegisterEditorClass(hinstDLL);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DLL_PROCESS_DETACH:
|
|
||||||
UnregisterClassW(wszClassName, 0);
|
|
||||||
UnregisterClassW(wszClassName50, 0);
|
|
||||||
UnregisterClassA("RichEdit20A", 0);
|
|
||||||
UnregisterClassA("RichEdit50A", 0);
|
|
||||||
HeapDestroy (me_heap);
|
|
||||||
me_heap = NULL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* CreateTextServices (RICHED20.4)
|
* CreateTextServices (RICHED20.4)
|
||||||
*
|
*
|
||||||
|
|
|
@ -76,23 +76,19 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, RECT *rcUpda
|
||||||
if (rcUpdate->bottom < ye)
|
if (rcUpdate->bottom < ye)
|
||||||
ye = rcUpdate->bottom;
|
ye = rcUpdate->bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.left = xs; /* FIXME remove if it's not necessary anymore */
|
|
||||||
rc.top = c.pt.y;
|
|
||||||
rc.right = xe;
|
|
||||||
rc.bottom = c.pt.y+1;
|
|
||||||
FillRect(hDC, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
|
|
||||||
|
|
||||||
if (ys == c.pt.y) /* don't overwrite the top bar */
|
|
||||||
ys++;
|
|
||||||
if (ye>ys) {
|
if (ye>ys) {
|
||||||
|
HBRUSH hbr;
|
||||||
|
hbr = CreateSolidBrush(ME_GetBackColor(c.editor));
|
||||||
rc.left = xs;
|
rc.left = xs;
|
||||||
rc.top = ys;
|
rc.top = ys;
|
||||||
rc.right = xe;
|
rc.right = xe;
|
||||||
rc.bottom = ye;
|
rc.bottom = ye;
|
||||||
/* this is not supposed to be gray, I know, but lets keep it gray for now for debugging purposes */
|
FillRect(hDC, &rc, hbr);
|
||||||
FillRect(hDC, &rc, (HBRUSH)GetStockObject(LTGRAY_BRUSH));
|
DeleteObject(hbr);
|
||||||
}
|
}
|
||||||
|
if (ys == c.pt.y) /* don't overwrite the top bar */
|
||||||
|
ys++;
|
||||||
}
|
}
|
||||||
editor->nLastTotalLength = editor->nTotalLength;
|
editor->nLastTotalLength = editor->nTotalLength;
|
||||||
ME_DestroyContext(&c);
|
ME_DestroyContext(&c);
|
||||||
|
|
|
@ -466,8 +466,6 @@ SIZE ME_GetRunSizeCommon(ME_Context *c, ME_Paragraph *para, ME_Run *run, int nLe
|
||||||
* in practice
|
* in practice
|
||||||
*/
|
*/
|
||||||
ME_GetTextExtent(c, run->strText->szData, nLen, run->style, &size);
|
ME_GetTextExtent(c, run->strText->szData, nLen, run->style, &size);
|
||||||
assert(run->style->tm.tmAscent>0);
|
|
||||||
assert(run->style->tm.tmDescent>0);
|
|
||||||
*pAscent = run->style->tm.tmAscent;
|
*pAscent = run->style->tm.tmAscent;
|
||||||
*pDescent = run->style->tm.tmDescent;
|
*pDescent = run->style->tm.tmDescent;
|
||||||
size.cy = *pAscent + *pDescent;
|
size.cy = *pAscent + *pDescent;
|
||||||
|
@ -519,7 +517,8 @@ void ME_CalcRunExtent(ME_Context *c, ME_Paragraph *para, ME_Run *run)
|
||||||
int nEnd = ME_StrVLen(run->strText);
|
int nEnd = ME_StrVLen(run->strText);
|
||||||
SIZE size = ME_GetRunSizeCommon(c, para, run, nEnd, &run->nAscent, &run->nDescent);
|
SIZE size = ME_GetRunSizeCommon(c, para, run, nEnd, &run->nAscent, &run->nDescent);
|
||||||
run->nWidth = size.cx;
|
run->nWidth = size.cx;
|
||||||
assert(size.cx);
|
if (!size.cx)
|
||||||
|
WARN("size.cx == 0\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ME_MustBeWrapped(ME_Context *c, ME_DisplayItem *para)
|
void ME_MustBeWrapped(ME_Context *c, ME_DisplayItem *para)
|
||||||
|
|
|
@ -383,7 +383,7 @@ void ME_ReleaseStyle(ME_Style *s)
|
||||||
TRACE("destroy style %p, total refs=%d\n", s, all_refs);
|
TRACE("destroy style %p, total refs=%d\n", s, all_refs);
|
||||||
else
|
else
|
||||||
TRACE("release style %p, new refs=%d, total refs=%d\n", s, s->nRefs, all_refs);
|
TRACE("release style %p, new refs=%d, total refs=%d\n", s, s->nRefs, all_refs);
|
||||||
if (!all_refs) FIXME("all style references freed (good!)\n");
|
if (!all_refs) TRACE("all style references freed (good!)\n");
|
||||||
assert(s->nRefs>=0);
|
assert(s->nRefs>=0);
|
||||||
if (!s->nRefs)
|
if (!s->nRefs)
|
||||||
ME_DestroyStyle(s);
|
ME_DestroyStyle(s);
|
||||||
|
|
Loading…
Reference in a new issue