[RICHED20] Sync with Wine Staging 1.7.47. CORE-9924

svn path=/trunk/; revision=68495
This commit is contained in:
Amine Khaldi 2015-07-20 22:53:23 +00:00
parent 2d643ebc15
commit e917285fba
13 changed files with 4587 additions and 2272 deletions

View file

@ -42,7 +42,15 @@ list(APPEND ADDITIONAL_SOURCE
version.rc
${CMAKE_CURRENT_BINARY_DIR}/riched20.def)
list(APPEND riched20_rc_deps
${CMAKE_CURRENT_SOURCE_DIR}/riched_tom.rgs
${CMAKE_CURRENT_BINARY_DIR}/riched_tom.tlb)
set_source_files_properties(version.rc PROPERTIES OBJECT_DEPENDS "${riched20_rc_deps}")
add_library(riched20 SHARED ${SOURCE} ${ADDITIONAL_SOURCE})
add_typelib(riched_tom.idl)
add_dependencies(riched20 stdole2)
set_module_type(riched20 win32dll)
target_link_libraries(riched20 wine uuid)
add_importlibs(riched20 ole32 oleaut32 usp10 imm32 user32 gdi32 msvcrt kernel32 ntdll)

View file

@ -227,6 +227,7 @@
#include "editor.h"
#include <commdlg.h>
#include <undocuser.h>
#include "rtf.h"
#include "res.h"
@ -1704,7 +1705,7 @@ ME_StreamInRTFString(ME_TextEditor *editor, BOOL selection, char *string)
data.pos = 0;
es.dwCookie = (DWORD_PTR)&data;
es.pfnCallback = ME_ReadFromRTFString;
ME_StreamIn(editor, SF_RTF | (selection ? SFF_SELECTION : 0), &es, FALSE);
ME_StreamIn(editor, SF_RTF | (selection ? SFF_SELECTION : 0), &es, TRUE);
}
@ -1868,7 +1869,7 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, const CHARRANGE *chrg, const WCH
if (nCurEnd == 0)
{
ME_PrevRun(&pCurPara, &pCurItem);
nCurEnd = pCurItem->member.run.len + nMatched;
nCurEnd = pCurItem->member.run.len;
}
while (pCurItem && ME_CharCompare( *get_text( &pCurItem->member.run, nCurEnd - nMatched - 1 ),
@ -2923,6 +2924,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
UnregisterClassW(REComboBox20W, 0);
LookupCleanup();
HeapDestroy (me_heap);
release_typelib();
break;
}
return TRUE;
@ -3129,13 +3131,108 @@ static void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM
}
}
void ME_ReplaceSel(ME_TextEditor *editor, BOOL can_undo, const WCHAR *str, int len)
{
int from, to, nStartCursor;
ME_Style *style;
nStartCursor = ME_GetSelectionOfs(editor, &from, &to);
style = ME_GetSelectionInsertStyle(editor);
ME_InternalDeleteText(editor, &editor->pCursors[nStartCursor], to-from, FALSE);
ME_InsertTextFromCursor(editor, 0, str, len, style);
ME_ReleaseStyle(style);
/* drop temporary style if line end */
/*
* FIXME question: does abc\n mean: put abc,
* clear temp style, put \n? (would require a change)
*/
if (len>0 && str[len-1] == '\n')
ME_ClearTempStyle(editor);
ME_CommitUndo(editor);
ME_UpdateSelectionLinkAttribute(editor);
if (!can_undo)
ME_EmptyUndoStack(editor);
ME_UpdateRepaint(editor, FALSE);
}
static void ME_SetText(ME_TextEditor *editor, void *text, BOOL unicode)
{
LONG codepage = unicode ? CP_UNICODE : CP_ACP;
int textLen;
LPWSTR wszText = ME_ToUnicode(codepage, text, &textLen);
if (textLen > 0)
{
int len = -1;
/* uses default style! */
if (!(editor->styleFlags & ES_MULTILINE))
{
WCHAR *p = wszText;
while (*p != '\0' && *p != '\r' && *p != '\n') p++;
len = p - wszText;
}
ME_InsertTextFromCursor(editor, 0, wszText, len, editor->pBuffer->pDefaultStyle);
}
ME_EndToUnicode(codepage, wszText);
}
static LRESULT ME_WmCreate(ME_TextEditor *editor, LPARAM lParam, BOOL unicode)
{
CREATESTRUCTW *createW = (CREATESTRUCTW*)lParam;
CREATESTRUCTA *createA = (CREATESTRUCTA*)lParam;
void *text = NULL;
INT max;
if (lParam)
text = unicode ? (void*)createW->lpszName : (void*)createA->lpszName;
ME_SetDefaultFormatRect(editor);
max = (editor->styleFlags & ES_DISABLENOSCROLL) ? 1 : 0;
if (~editor->styleFlags & ES_DISABLENOSCROLL || editor->styleFlags & WS_VSCROLL)
ITextHost_TxSetScrollRange(editor->texthost, SB_VERT, 0, max, TRUE);
if (~editor->styleFlags & ES_DISABLENOSCROLL || editor->styleFlags & WS_HSCROLL)
ITextHost_TxSetScrollRange(editor->texthost, SB_HORZ, 0, max, TRUE);
if (editor->styleFlags & ES_DISABLENOSCROLL)
{
if (editor->styleFlags & WS_VSCROLL)
{
ITextHost_TxEnableScrollBar(editor->texthost, SB_VERT, ESB_DISABLE_BOTH);
ITextHost_TxShowScrollBar(editor->texthost, SB_VERT, TRUE);
}
if (editor->styleFlags & WS_HSCROLL)
{
ITextHost_TxEnableScrollBar(editor->texthost, SB_HORZ, ESB_DISABLE_BOTH);
ITextHost_TxShowScrollBar(editor->texthost, SB_HORZ, TRUE);
}
}
if (text)
{
ME_SetText(editor, text, unicode);
ME_SetCursorToStart(editor, &editor->pCursors[0]);
ME_SetCursorToStart(editor, &editor->pCursors[1]);
}
ME_CommitUndo(editor);
ME_WrapMarkedParagraphs(editor);
ME_MoveCaret(editor);
return 0;
}
#define UNSUPPORTED_MSG(e) \
case e: \
FIXME(#e ": stub\n"); \
*phresult = S_FALSE; \
return 0;
/* Handle messages for windowless and windoweded richedit controls.
/* Handle messages for windowless and windowed richedit controls.
*
* The LRESULT that is returned is a return value for window procs,
* and the phresult parameter is the COM return code needed by the
@ -3604,31 +3701,14 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
}
case EM_REPLACESEL:
{
int from, to, nStartCursor;
ME_Style *style;
int len = 0;
LONG codepage = unicode ? CP_UNICODE : CP_ACP;
LPWSTR wszText = ME_ToUnicode(codepage, (void *)lParam, &len);
TRACE("EM_REPLACESEL - %s\n", debugstr_w(wszText));
nStartCursor = ME_GetSelectionOfs(editor, &from, &to);
style = ME_GetSelectionInsertStyle(editor);
ME_InternalDeleteText(editor, &editor->pCursors[nStartCursor], to-from, FALSE);
ME_InsertTextFromCursor(editor, 0, wszText, len, style);
ME_ReleaseStyle(style);
/* drop temporary style if line end */
/*
* FIXME question: does abc\n mean: put abc,
* clear temp style, put \n? (would require a change)
*/
if (len>0 && wszText[len-1] == '\n')
ME_ClearTempStyle(editor);
ME_ReplaceSel(editor, !!wParam, wszText, len);
ME_EndToUnicode(codepage, wszText);
ME_CommitUndo(editor);
ME_UpdateSelectionLinkAttribute(editor);
if (!wParam)
ME_EmptyUndoStack(editor);
ME_UpdateRepaint(editor, FALSE);
return len;
}
case EM_SCROLLCARET:
@ -3677,28 +3757,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
ME_StreamInRTFString(editor, 0, (char *)lParam);
}
else
{
int textLen;
LONG codepage = unicode ? CP_UNICODE : CP_ACP;
LPWSTR wszText = ME_ToUnicode(codepage, (void *)lParam, &textLen);
TRACE("WM_SETTEXT - %s\n", debugstr_w(wszText)); /* debugstr_w() */
if (textLen > 0)
{
int len = -1;
/* uses default style! */
if (!(editor->styleFlags & ES_MULTILINE))
{
WCHAR * p;
p = wszText;
while (*p != '\0' && *p != '\r' && *p != '\n') p++;
len = p - wszText;
}
ME_InsertTextFromCursor(editor, 0, wszText, len, editor->pBuffer->pDefaultStyle);
}
ME_EndToUnicode(codepage, wszText);
}
ME_SetText(editor, (void*)lParam, unicode);
}
else
TRACE("WM_SETTEXT - NULL\n");
@ -4053,66 +4112,16 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
return (wParam >= 0x40000) ? 0 : MAKELONG( pt.x, pt.y );
}
case WM_CREATE:
{
void *text = NULL;
INT max;
ME_SetDefaultFormatRect(editor);
max = (editor->styleFlags & ES_DISABLENOSCROLL) ? 1 : 0;
if (~editor->styleFlags & ES_DISABLENOSCROLL || editor->styleFlags & WS_VSCROLL)
ITextHost_TxSetScrollRange(editor->texthost, SB_VERT, 0, max, TRUE);
if (~editor->styleFlags & ES_DISABLENOSCROLL || editor->styleFlags & WS_HSCROLL)
ITextHost_TxSetScrollRange(editor->texthost, SB_HORZ, 0, max, TRUE);
if (editor->styleFlags & ES_DISABLENOSCROLL)
{
if (editor->styleFlags & WS_VSCROLL)
{
ITextHost_TxEnableScrollBar(editor->texthost, SB_VERT, ESB_DISABLE_BOTH);
ITextHost_TxShowScrollBar(editor->texthost, SB_VERT, TRUE);
}
if (editor->styleFlags & WS_HSCROLL)
{
ITextHost_TxEnableScrollBar(editor->texthost, SB_HORZ, ESB_DISABLE_BOTH);
ITextHost_TxShowScrollBar(editor->texthost, SB_HORZ, TRUE);
}
}
if (lParam)
{
text = (unicode ? (void*)((CREATESTRUCTW*)lParam)->lpszName
: (void*)((CREATESTRUCTA*)lParam)->lpszName);
}
if (text)
{
WCHAR *textW;
int len;
LONG codepage = unicode ? CP_UNICODE : CP_ACP;
textW = ME_ToUnicode(codepage, text, &len);
if (!(editor->styleFlags & ES_MULTILINE))
{
len = 0;
while(textW[len] != '\0' && textW[len] != '\r' && textW[len] != '\n')
len++;
}
ME_InsertTextFromCursor(editor, 0, textW, len, editor->pBuffer->pDefaultStyle);
ME_EndToUnicode(codepage, textW);
ME_SetCursorToStart(editor, &editor->pCursors[0]);
ME_SetCursorToStart(editor, &editor->pCursors[1]);
}
ME_CommitUndo(editor);
ME_WrapMarkedParagraphs(editor);
ME_MoveCaret(editor);
return 0;
}
return ME_WmCreate(editor, lParam, unicode);
case WM_DESTROY:
ME_DestroyEditor(editor);
return 0;
case WM_SETCURSOR:
{
POINT cursor_pos;
if (wParam == (WPARAM)editor->hWnd && GetCursorPos(&cursor_pos) &&
ScreenToClient(editor->hWnd, &cursor_pos))
ME_LinkNotify(editor, msg, 0, MAKELPARAM(cursor_pos.x, cursor_pos.y));
return ME_SetCursor(editor);
}
case WM_LBUTTONDBLCLK:
@ -4127,7 +4136,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
ME_CalculateClickCount(editor, msg, wParam, lParam));
ITextHost_TxSetCapture(editor->texthost, TRUE);
editor->bMouseCaptured = TRUE;
ME_LinkNotify(editor,msg,wParam,lParam);
ME_LinkNotify(editor, msg, wParam, lParam);
if (!ME_SetCursor(editor)) goto do_default;
break;
}
@ -4137,7 +4146,8 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
return 0;
if (editor->bMouseCaptured)
ME_MouseMove(editor, (short)LOWORD(lParam), (short)HIWORD(lParam));
ME_LinkNotify(editor,msg,wParam,lParam);
else
ME_LinkNotify(editor, msg, wParam, lParam);
/* Set cursor if mouse is captured, since WM_SETCURSOR won't be received. */
if (editor->bMouseCaptured)
ME_SetCursor(editor);
@ -4155,15 +4165,17 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
else
{
ME_SetCursor(editor);
ME_LinkNotify(editor,msg,wParam,lParam);
ME_LinkNotify(editor, msg, wParam, lParam);
}
break;
case WM_RBUTTONUP:
case WM_RBUTTONDOWN:
case WM_RBUTTONDBLCLK:
ME_CommitUndo(editor); /* End coalesced undos for typed characters */
if ((editor->nEventMask & ENM_MOUSEEVENTS) &&
!ME_FilterEvent(editor, msg, &wParam, &lParam))
return 0;
ME_LinkNotify(editor, msg, wParam, lParam);
goto do_default;
case WM_CONTEXTMENU:
if (!ME_ShowContextMenu(editor, (short)LOWORD(lParam), (short)HIWORD(lParam)))
@ -4405,10 +4417,12 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
return 0;
case WM_SETREDRAW:
goto do_default;
case WM_SIZE:
case WM_WINDOWPOSCHANGED:
{
RECT clientRect;
WINDOWPOS *winpos = (WINDOWPOS *)lParam;
if (winpos->flags & SWP_NOCLIENTSIZE) goto do_default;
ITextHost_TxGetClientRect(editor->texthost, &clientRect);
if (editor->bDefaultFormatRect) {
ME_SetDefaultFormatRect(editor);

View file

@ -297,6 +297,7 @@ void ME_RTFTblAttrHook(struct _RTF_Info *info) DECLSPEC_HIDDEN;
void ME_RTFSpecialCharHook(struct _RTF_Info *info) DECLSPEC_HIDDEN;
void ME_StreamInFill(ME_InStream *stream) DECLSPEC_HIDDEN;
extern BOOL me_debug DECLSPEC_HIDDEN;
void ME_ReplaceSel(ME_TextEditor *editor, BOOL can_undo, const WCHAR *str, int len) DECLSPEC_HIDDEN;
/* table.c */
BOOL ME_IsInTable(ME_DisplayItem *pItem) DECLSPEC_HIDDEN;
@ -385,4 +386,6 @@ LRESULT ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream)
/* clipboard.c */
HRESULT ME_GetDataObject(ME_TextEditor *editor, const ME_Cursor *start, int nChars, LPDATAOBJECT *lplpdataobj) DECLSPEC_HIDDEN;
void release_typelib(void) DECLSPEC_HIDDEN;
#endif /* _RICHED20_EDITOR_H */

View file

@ -22,7 +22,7 @@
#define __EDITSTR_H
#ifdef __i386__
extern const struct ITextHostVtbl itextHostStdcallVtbl;
extern const struct ITextHostVtbl itextHostStdcallVtbl DECLSPEC_HIDDEN;
#endif /* __i386__ */
typedef struct tagME_String

View file

@ -1,5 +1,5 @@
/*
* Top level resource file for MOUSE driver dll
* Top level resource file for rich edit control
*
* Copyright 2007 Maarten Lankhorst for CodeWeavers
*

View file

@ -0,0 +1,723 @@
/*
* Copyright 2006 Juan Lang
* Copyright 2015 Nikolay Sivov for CodeWeavers
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
import "unknwn.idl";
import "objidl.idl";
import "oaidl.idl";
#pragma makedep regtypelib
cpp_quote("#ifdef WINE_NO_UNICODE_MACROS")
cpp_quote("#undef FindText")
cpp_quote("#endif")
[
uuid(8cc497c9-a1df-11ce-8098-00aa0047be5d),
version(1.0)
]
library tom
{
importlib("stdole2.tlb");
typedef enum tagTomConstants
{
tomFalse = 0,
tomTrue = -1,
tomUndefined = -9999999,
tomToggle = -9999998,
tomAutoColor = -9999997,
tomDefault = -9999996,
tomSuspend = -9999995,
tomResume = -9999994,
/* ITextFont::Reset() modes */
tomApplyNow = 0,
tomApplyLater = 1,
tomTrackParms = 2,
tomCacheParms = 3,
tomApplyTmp = 4,
tomDisableSmartFont = 8,
tomEnableSmartFont = 9,
tomUsePoints = 10,
tomUseTwips = 11,
tomBackward = 0xc0000001,
tomForward = 0x3fffffff,
tomMove = 0,
tomExtend = 1,
tomNoSelection = 0,
tomSelectionIP = 1,
tomSelectionNormal = 2,
tomSelectionFrame = 3,
tomSelectionColumn = 4,
tomSelectionRow = 5,
tomSelectionBlock = 6,
tomSelectionInlineShape = 7,
tomSelectionShape = 8,
tomSelStartActive = 1,
tomSelAtEOL = 2,
tomSelOvertype = 4,
tomSelActive = 8,
tomSelReplace = 16,
tomEnd = 0,
tomStart = 32,
tomCollapseEnd = 0,
tomCollapseStart = 1,
tomClientCoord = 256,
tomNone = 0,
tomSingle = 1,
tomWords = 2,
tomDouble = 3,
tomDotted = 4,
tomDash = 5,
tomDashDot = 6,
tomDashDotDot = 7,
tomWave = 8,
tomThick = 9,
tomHair = 10,
tomLineSpaceSingle = 0,
tomLineSpace1pt5 = 1,
tomLineSpaceDouble = 2,
tomLineSpaceAtLeast = 3,
tomLineSpaceExactly = 4,
tomLineSpaceMultiple = 5,
tomAlignLeft = 0,
tomAlignCenter = 1,
tomAlignRight = 2,
tomAlignJustify = 3,
tomAlignDecimal = 3,
tomAlignBar = 4,
tomAlignInterWord = 3,
tomAlignInterLetter = 4,
tomAlignScaled = 5,
tomAlignGlyphs = 6,
tomAlignSnapGrid = 7,
tomSpaces = 0,
tomDots = 1,
tomDashes = 2,
tomLines = 3,
tomThickLines = 4,
tomEquals = 5,
tomTabBack = -3,
tomTabNext = -2,
tomTabHere = -1,
tomListBullet = 1,
tomListNumberAsArabic = 2,
tomListNumberAsLCLetter = 3,
tomListNumberAsUCLetter = 4,
tomListNumberAsLCRoman = 5,
tomListNumberAsUCRoman = 6,
tomListNumberAsSequence = 7,
tomListParentheses = 0x10000,
tomListPeriod = 0x20000,
tomListPlain = 0x30000,
tomCharacter = 1,
tomWord = 2,
tomSentence = 3,
tomParagraph = 4,
tomLine = 5,
tomStory = 6,
tomScreen = 7,
tomSection = 8,
tomColumn = 9,
tomRow = 10,
tomWindow = 11,
tomCell = 12,
tomCharFormat = 13,
tomParaFormat = 14,
tomTable = 15,
tomObject = 16,
tomMatchWord = 2,
tomMatchCase = 4,
tomMatchPattern = 8,
/* ITextRange story type values */
tomUnknownStory = 0,
tomMainTextStory = 1,
tomFootnotesStory = 2,
tomEndnotesStory = 3,
tomCommentsStory = 4,
tomTextFrameStory = 5,
tomEvenPagesHeaderStory = 6,
tomPrimaryHeaderStory = 7,
tomEvenPagesFooterStory = 8,
tomPrimaryFooterStory = 9,
tomFirstPageHeaderStory = 10,
tomFirstPageFooterStory = 11,
/* ITextFont animation property */
tomNoAnimation = 0,
tomLasVegasLights = 1,
tomBlinkingBackground = 2,
tomSparkleText = 3,
tomMarchingBlackAnts = 4,
tomMarchingRedAnts = 5,
tomShimmer = 6,
tomWipeDown = 7,
tomWipeRight = 8,
tomAnimationMax = 8,
tomLowerCase = 0,
tomUpperCase = 1,
tomTitleCase = 2,
tomSentenceCase = 4,
tomToggleCase = 5,
tomReadOnly = 0x100,
tomShareDenyRead = 0x200,
tomShareDenyWrite = 0x400,
tomPasteFile = 0x1000,
tomCreateNew = 0x10,
tomCreateAlways = 0x20,
tomOpenExisting = 0x30,
tomOpenAlways = 0x40,
tomTruncateExisting = 0x50,
tomRTF = 0x1,
tomText = 0x2,
tomHTML = 0x3,
tomWordDocument = 0x4,
tomBold = 0x80000001,
tomItalic = 0x80000002,
tomUnderline = 0x80000004,
tomStrikeout = 0x80000008,
tomProtected = 0x80000010,
tomLink = 0x80000020,
tomSmallCaps = 0x80000040,
tomAllCaps = 0x80000080,
tomHidden = 0x80000100,
tomOutline = 0x80000200,
tomShadow = 0x80000400,
tomEmboss = 0x80000800,
tomImprint = 0x80001000,
tomDisabled = 0x80002000,
tomRevised = 0x80004000,
tomNormalCaret = 0,
tomKoreanBlockCaret = 0x1,
tomIncludeInset = 0x1,
tomIgnoreCurrentFont = 0,
tomMatchFontCharset = 0x1,
tomMatchFontSignature = 0x2,
tomCharset = 0x80000000,
tomRE10Mode = 0x1,
tomNoIME = 0x80000,
tomSelfIME = 0x40000
} tomConstants;
interface ITextRange;
interface ITextSelection;
interface ITextStoryRanges;
[
uuid(8cc497c0-a1df-11ce-8098-00aa0047be5d),
object,
dual,
oleautomation
]
interface ITextDocument : IDispatch
{
[propget, id(DISPID_VALUE)]
HRESULT Name([retval, out] BSTR *name);
[propget]
HRESULT Selection([retval, out] ITextSelection **selection);
[propget]
HRESULT StoryCount([retval, out] LONG *count);
[propget]
HRESULT StoryRanges([retval, out] ITextStoryRanges **ranges);
[propget]
HRESULT Saved([retval, out] LONG *value);
[propput]
HRESULT Saved([in] LONG value);
[propget]
HRESULT DefaultTabStop([retval, out] float *value);
[propput]
HRESULT DefaultTabStop([in] float value);
HRESULT New();
HRESULT Open([in] VARIANT *var, [in] LONG flags, [in] LONG codepage);
HRESULT Save([in] VARIANT *var, [in] LONG flags, [in] LONG codepage);
HRESULT Freeze([retval, out] LONG *count);
HRESULT Unfreeze([retval, out] LONG *count);
HRESULT BeginEditCollection();
HRESULT EndEditCollection();
HRESULT Undo([in] LONG count, [retval, out] LONG *prop);
HRESULT Redo([in] LONG count, [retval, out] LONG *prop);
HRESULT Range([in] LONG start, [in] LONG end, [retval, out] ITextRange **range);
HRESULT RangeFromPoint([in] LONG x, [in] LONG y, [retval, out] ITextRange **range);
}
interface ITextFont;
interface ITextPara;
[
uuid(8cc497c2-a1df-11ce-8098-00aa0047be5d),
object,
dual,
oleautomation
]
interface ITextRange : IDispatch
{
[propget, id(DISPID_VALUE)]
HRESULT Text([retval, out] BSTR *text);
[propput, id(DISPID_VALUE)]
HRESULT Text([in] BSTR text);
[propget]
HRESULT Char([retval, out] LONG *ch);
[propput]
HRESULT Char([in] LONG ch);
[propget]
HRESULT Duplicate([retval, out] ITextRange **range);
[propget]
HRESULT FormattedText([retval, out] ITextRange **range);
[propput]
HRESULT FormattedText([in] ITextRange *range);
[propget]
HRESULT Start([retval, out] LONG *start);
[propput]
HRESULT Start([in] LONG start);
[propget]
HRESULT End([retval, out] LONG *end);
[propput]
HRESULT End([in] LONG end);
[propget]
HRESULT Font([retval, out] ITextFont **font);
[propput]
HRESULT Font([in] ITextFont *font);
[propget]
HRESULT Para([retval, out] ITextPara **para);
[propput]
HRESULT Para([in] ITextPara *para);
[propget]
HRESULT StoryLength([retval, out] LONG *len);
[propget]
HRESULT StoryType([retval, out] LONG *value);
HRESULT Collapse([in] LONG start);
HRESULT Expand([in] LONG unit, [retval, out] LONG *delta);
HRESULT GetIndex([in] LONG unit, [retval, out] LONG *index);
HRESULT SetIndex([in] LONG unit, [in] LONG index, [in] LONG extend);
HRESULT SetRange([in] LONG anchor, [in] LONG active);
HRESULT InRange([in] ITextRange *range, [retval, out] LONG *pb);
HRESULT InStory([in] ITextRange *range, [retval, out] LONG *pb);
HRESULT IsEqual([in] ITextRange *range, [retval, out] LONG *pb);
HRESULT Select();
HRESULT StartOf([in] LONG unit, [in] LONG extend, [retval, out] LONG *delta);
HRESULT EndOf([in] LONG unit, [in] LONG extend, [retval, out] LONG *delta);
HRESULT Move([in] LONG unit, [in] LONG count, [retval, out] LONG *delta);
HRESULT MoveStart([in] LONG unit, [in] LONG count, [retval, out] LONG *delta);
HRESULT MoveEnd([in] LONG unit, [in] LONG count, [retval, out] LONG *delta);
HRESULT MoveWhile([in] VARIANT *charset, [in] LONG count, [retval, out] LONG *delta);
HRESULT MoveStartWhile([in] VARIANT *charset, [in] LONG count, [retval, out] LONG *delta);
HRESULT MoveEndWhile([in] VARIANT *charset, [in] LONG count, [retval, out] LONG *delta);
HRESULT MoveUntil([in] VARIANT *charset, [in] LONG count, [retval, out] LONG *delta);
HRESULT MoveStartUntil([in] VARIANT *charset, [in] LONG count, [retval, out] LONG *delta);
HRESULT MoveEndUntil([in] VARIANT *charset, [in] LONG count, [retval, out] LONG *delta);
HRESULT FindText([in] BSTR str, [in] LONG ch, [in] LONG flags, [retval, out] LONG *len);
HRESULT FindTextStart([in] BSTR str, [in] LONG cch, [in] LONG flags, [retval, out] LONG *len);
HRESULT FindTextEnd([in] BSTR str, [in] LONG ch, [in] LONG flags, [retval, out] LONG *len);
HRESULT Delete([in] LONG unit, [in] LONG count, [retval, out] LONG *delta);
HRESULT Cut([out] VARIANT *var);
HRESULT Copy([out] VARIANT *var);
HRESULT Paste([in] VARIANT *var, [in] LONG format);
HRESULT CanPaste([in] VARIANT *var, [in] LONG format, [retval, out] LONG *pb);
HRESULT CanEdit([retval, out] LONG *pb);
HRESULT ChangeCase([in] LONG type);
HRESULT GetPoint([in] LONG type, [out] LONG *cx, [out] LONG *cy);
HRESULT SetPoint([in] LONG x, [in] LONG y, [in] LONG type, [in] LONG extend);
HRESULT ScrollIntoView([in] LONG value);
HRESULT GetEmbeddedObject([retval, out] IUnknown **ppv);
}
[
uuid(8cc497c1-a1df-11ce-8098-00aa0047be5d),
object,
dual,
oleautomation
]
interface ITextSelection : ITextRange
{
[propget]
HRESULT Flags([retval, out] LONG *flags);
[propput]
HRESULT Flags([in] LONG flags);
[propget]
HRESULT Type([retval, out] LONG *type);
HRESULT MoveLeft([in] LONG unit, [in] LONG count, [in] LONG extend, [retval, out] LONG *delta);
HRESULT MoveRight([in] LONG unit, [in] LONG count, [in] LONG extend, [retval, out] LONG *delta);
HRESULT MoveUp([in] LONG unit, [in] LONG count, [in] LONG extend, [retval, out] LONG *delta);
HRESULT MoveDown([in] LONG unit, [in] LONG count, [in] LONG extend, [retval, out] LONG *delta);
HRESULT HomeKey([in] LONG unit, [in] LONG extend, [retval, out] LONG *delta);
HRESULT EndKey([in] LONG unit, [in] LONG extend, [retval, out] LONG *delta);
HRESULT TypeText([in] BSTR str);
}
[
uuid(8cc497c3-a1df-11ce-8098-00aa0047be5d),
object,
dual,
oleautomation
]
interface ITextFont : IDispatch
{
[propget, id(DISPID_VALUE)]
HRESULT Duplicate([retval, out] ITextFont **font);
[propput, id(DISPID_VALUE)]
HRESULT Duplicate([in] ITextFont *font);
HRESULT CanChange([out] LONG *pB);
HRESULT IsEqual([in] ITextFont *font, [retval, out] LONG *pB);
HRESULT Reset([in] LONG value);
[propget]
HRESULT GetStyle([retval, out] LONG *value);
[propput]
HRESULT SetStyle([in] LONG value);
[propget]
HRESULT AllCaps([retval, out] LONG *value);
[propput]
HRESULT AllCaps([in] LONG value);
[propget]
HRESULT Animation([retval, out] LONG *value);
[propput]
HRESULT Animation([in] LONG value);
[propget]
HRESULT BackColor([retval, out] LONG *value);
[propput]
HRESULT BackColor([in] LONG value);
[propget]
HRESULT Bold([retval, out] LONG *value);
[propput]
HRESULT Bold([in] LONG value);
[propget]
HRESULT Emboss([retval, out] LONG *value);
[propput]
HRESULT Emboss([in] LONG value);
[propget]
HRESULT ForeColor([retval, out] LONG *value);
[propput]
HRESULT ForeColor([in] LONG value);
[propget]
HRESULT Hidden([retval, out] LONG *value);
[propput]
HRESULT Hidden([in] LONG value);
[propget]
HRESULT Engrave([retval, out] LONG *value);
[propput]
HRESULT Engrave([in] LONG value);
[propget]
HRESULT Italic([retval, out] LONG *value);
[propput]
HRESULT Italic([in] LONG value);
[propget]
HRESULT Kerning([retval, out] float *value);
[propput]
HRESULT Kerning([in] float value);
[propget]
HRESULT LanguageID([retval, out] LONG *value);
[propput]
HRESULT LanguageID([in] LONG value);
[propget]
HRESULT Name([retval, out] BSTR *value);
[propput]
HRESULT Name([in] BSTR value);
[propget]
HRESULT Outline([retval, out] LONG *value);
[propput]
HRESULT Outline([in] LONG value);
[propget]
HRESULT Position([retval, out] float *value);
[propput]
HRESULT Position([in] float value);
[propget]
HRESULT Protected([retval, out] LONG *value);
[propput]
HRESULT Protected([in] LONG value);
[propget]
HRESULT Shadow([retval, out] LONG *value);
[propput]
HRESULT Shadow([in] LONG value);
[propget]
HRESULT Size([retval, out] float *value);
[propput]
HRESULT Size([in] float value);
[propget]
HRESULT SmallCaps([retval, out] LONG *value);
[propput]
HRESULT SmallCaps([in] LONG value);
[propget]
HRESULT Spacing([retval, out] float *value);
[propput]
HRESULT Spacing([in] float value);
[propget]
HRESULT StrikeThrough([retval, out] LONG *value);
[propput]
HRESULT StrikeThrough([in] LONG value);
[propget]
HRESULT Subscript([retval, out] LONG *value);
[propput]
HRESULT Subscript([in] LONG value);
[propget]
HRESULT Superscript([retval, out] LONG *value);
[propput]
HRESULT Superscript([in] LONG value);
[propget]
HRESULT Underline([retval, out] LONG *value);
[propput]
HRESULT Underline([in] LONG value);
[propget]
HRESULT Weight([retval, out] LONG *value);
[propput]
HRESULT Weight([in] LONG value);
}
[
uuid(8cc497c4-a1df-11ce-8098-00aa0047be5d),
object,
dual,
oleautomation
]
interface ITextPara : IDispatch
{
[propget, id(DISPID_VALUE)]
HRESULT Duplicate([retval, out] ITextPara **para);
[propput, id(DISPID_VALUE)]
HRESULT Duplicate([in] ITextPara *para);
HRESULT CanChange([out, retval] LONG *pB);
HRESULT IsEqual([in] ITextPara *para, [retval, out] LONG *pB);
HRESULT Reset([in] LONG value);
[propget]
HRESULT Style([retval, out] LONG *value);
[propput]
HRESULT Style([in] LONG value);
[propget]
HRESULT Alignment([retval, out] LONG *value);
[propput]
HRESULT Alignment([in] LONG value);
[propget]
HRESULT Hyphenation([retval, out]LONG *value);
[propput]
HRESULT Hyphenation([in] LONG value);
[propget]
HRESULT FirstLineIndent([retval, out] float *value);
[propget]
HRESULT KeepTogether([retval, out] LONG *value);
[propput]
HRESULT KeepTogether([in] LONG value);
[propget]
HRESULT KeepWithNext([retval, out] LONG *value);
[propput]
HRESULT KeepWithNext([in] LONG value);
[propget]
HRESULT LeftIndent([retval, out] float *value);
[propget]
HRESULT LineSpacing([retval, out] float *value);
[propget]
HRESULT LineSpacingRule([retval, out] LONG *value);
[propget]
HRESULT ListAlignment([retval, out] LONG *value);
[propput]
HRESULT ListAlignment([in] LONG value);
[propget]
HRESULT ListLevelIndex([retval, out] LONG *value);
[propput]
HRESULT ListLevelIndex([in] LONG value);
[propget]
HRESULT ListStart([retval, out] LONG *value);
[propput]
HRESULT ListStart([in] LONG value);
[propget]
HRESULT ListTab([retval, out] float *value);
[propput]
HRESULT ListTab([in] float value);
[propget]
HRESULT ListType([retval, out] LONG *value);
[propput]
HRESULT ListType([in] LONG value);
[propget]
HRESULT NoLineNumber([retval, out] LONG *value);
[propput]
HRESULT NoLineNumber([in] LONG value);
[propget]
HRESULT PageBreakBefore([retval, out] LONG *value);
[propput]
HRESULT PageBreakBefore([in] LONG value);
[propget]
HRESULT RightIndent([retval, out] float *value);
[propput]
HRESULT RightIndent([in] float value);
HRESULT SetIndents([in] float StartIndent, [in] float LeftIndent, [in] float RightIndent);
HRESULT SetLineSpacing([in] LONG LineSpacingRule, [in] float LineSpacing);
[propget]
HRESULT SpaceAfter([retval, out] float *value);
[propput]
HRESULT SpaceAfter([in] float value);
[propget]
HRESULT SpaceBefore([retval, out] float *value);
[propput]
HRESULT SpaceBefore([in] float value);
[propget]
HRESULT WidowControl([retval, out] LONG *value);
[propput]
HRESULT WidowControl([in] LONG value);
[propget]
HRESULT TabCount([retval, out] LONG *count);
HRESULT AddTab([in] float tbPos, [in] LONG tbAlign, [in] LONG tbLeader);
HRESULT ClearAllTabs();
HRESULT DeleteTab([in] float tbPos);
HRESULT GetTab([in] LONG iTab, [out] float *ptbPos, [out] LONG *ptbAlign, [out] LONG *ptbLeader);
}
[
uuid(8cc497c5-a1df-11ce-8098-00aa0047be5d),
object,
dual,
oleautomation
]
interface ITextStoryRanges : IDispatch
{
[restricted, hidden, id(DISPID_NEWENUM)]
HRESULT _NewEnum([retval, out] IUnknown **ppEnum);
[id(DISPID_VALUE)]
HRESULT Item([in] LONG index, [retval, out] ITextRange **range);
[propget]
HRESULT Count([retval, out] LONG *count);
}
} /* Library tom */

View file

@ -0,0 +1,56 @@
HKCR
{
NoRemove Typelib
{
NoRemove '{8CC497C9-A1DF-11CE-8098-00AA0047BE5D}'
{
'1.0' = s 'tom'
{
'0' { win32 = s '%MODULE%' }
FLAGS = s '0'
}
}
}
NoRemove Interface
{
'{8CC497C0-A1DF-11CE-8098-00AA0047BE5D}' = s 'ITextDocument'
{
ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
TypeLib = s '{8CC497C9-A1DF-11CE-8098-00AA0047BE5D}' { val Version = s '1.0' }
}
'{8CC497C2-A1DF-11CE-8098-00AA0047BE5D}' = s 'ITextRange'
{
ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
TypeLib = s '{8CC497C9-A1DF-11CE-8098-00AA0047BE5D}' { val Version = s '1.0' }
}
'{8CC497C1-A1DF-11CE-8098-00AA0047BE5D}' = s 'ITextSelection'
{
ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
TypeLib = s '{8CC497C9-A1DF-11CE-8098-00AA0047BE5D}' { val Version = s '1.0' }
}
'{8CC497C3-A1DF-11CE-8098-00AA0047BE5D}' = s 'ITextFont'
{
ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
TypeLib = s '{8CC497C9-A1DF-11CE-8098-00AA0047BE5D}' { val Version = s '1.0' }
}
'{8CC497C4-A1DF-11CE-8098-00AA0047BE5D}' = s 'ITextPara'
{
ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
TypeLib = s '{8CC497C9-A1DF-11CE-8098-00AA0047BE5D}' { val Version = s '1.0' }
}
'{8CC497C5-A1DF-11CE-8098-00AA0047BE5D}' = s 'ITextStoryRanges'
{
ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
TypeLib = s '{8CC497C9-A1DF-11CE-8098-00AA0047BE5D}' { val Version = s '1.0' }
}
}
NoRemove CLSID
{
}
}

File diff suppressed because it is too large Load diff

View file

@ -781,6 +781,7 @@ void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod)
style = ME_ApplyStyle(editor->pBuffer->pDefaultStyle, mod);
editor->pBuffer->pDefaultStyle->fmt = style->fmt;
editor->pBuffer->pDefaultStyle->tm = style->tm;
ScriptFreeCache( &editor->pBuffer->pDefaultStyle->script_cache );
ME_ReleaseStyle(style);
ME_MarkAllForWrapping(editor);
/* pcf = editor->pBuffer->pDefaultStyle->fmt; */

View file

@ -387,7 +387,7 @@ static const ITextServicesVtbl textservices_vtbl =
HRESULT WINAPI CreateTextServices(IUnknown *pUnkOuter, ITextHost *pITextHost, IUnknown **ppUnk)
{
ITextServicesImpl *ITextImpl;
HRESULT hres;
TRACE("%p %p --> %p\n", pUnkOuter, pITextHost, ppUnk);
if (pITextHost == NULL)
return E_POINTER;
@ -409,8 +409,6 @@ HRESULT WINAPI CreateTextServices(IUnknown *pUnkOuter, ITextHost *pITextHost, I
ITextImpl->editor->rcFormat.right = 0;
ITextImpl->editor->rcFormat.bottom = 0;
ME_HandleMessage(ITextImpl->editor, WM_CREATE, 0, 0, TRUE, &hres);
if (pUnkOuter)
ITextImpl->outer_unk = pUnkOuter;
else

View file

@ -28,3 +28,6 @@
#include "res.h"
OCR_REVERSE CURSOR ocr_reverse.cur
1 TYPELIB riched_tom.tlb
1 WINE_REGISTRY riched_tom.rgs

View file

@ -46,29 +46,18 @@ ME_StreamOutInit(ME_TextEditor *editor, EDITSTREAM *stream)
static BOOL
ME_StreamOutFlush(ME_OutStream *pStream)
{
LONG nStart = 0;
LONG nWritten = 0;
LONG nRemaining = 0;
EDITSTREAM *stream = pStream->stream;
while (nStart < pStream->pos) {
TRACE("sending %u bytes\n", pStream->pos - nStart);
/* Some apps seem not to set *pcb unless a problem arises, relying
on initial random nWritten value, which is usually >STREAMOUT_BUFFER_SIZE */
nRemaining = pStream->pos - nStart;
nWritten = 0xDEADBEEF;
stream->dwError = stream->pfnCallback(stream->dwCookie, (LPBYTE)pStream->buffer + nStart,
pStream->pos - nStart, &nWritten);
if (pStream->pos) {
TRACE("sending %u bytes\n", pStream->pos);
nWritten = pStream->pos;
stream->dwError = stream->pfnCallback(stream->dwCookie, (LPBYTE)pStream->buffer,
pStream->pos, &nWritten);
TRACE("error=%u written=%u\n", stream->dwError, nWritten);
if (nWritten > (pStream->pos - nStart) || nWritten<0) {
FIXME("Invalid returned written size *pcb: 0x%x (%d) instead of %d\n",
(unsigned)nWritten, nWritten, nRemaining);
nWritten = nRemaining;
}
if (nWritten == 0 || stream->dwError)
return FALSE;
pStream->written += nWritten;
nStart += nWritten;
/* Don't resend partial chunks if nWritten < pStream->pos */
}
pStream->pos = 0;
return TRUE;
@ -796,8 +785,11 @@ static BOOL ME_StreamOutRTF(ME_TextEditor *editor, ME_OutStream *pStream,
ME_Cursor cursor = *start;
ME_DisplayItem *prev_para = cursor.pPara;
ME_Cursor endCur = cursor;
int actual_chars;
ME_MoveCursorChars(editor, &endCur, nChars);
actual_chars = ME_MoveCursorChars(editor, &endCur, nChars);
/* Include the final \r which MoveCursorChars will ignore. */
if (actual_chars != nChars) endCur.nOffset++;
if (!ME_StreamOutRTFHeader(pStream, dwFormat))
return FALSE;

View file

@ -164,7 +164,7 @@ reactos/dll/win32/qmgrprxy # Synced to WineStaging-1.7.47
reactos/dll/win32/query # Synced to WineStaging-1.7.37
reactos/dll/win32/rasapi32 # Synced to WineStaging-1.7.47
reactos/dll/win32/resutils # Synced to WineStaging-1.7.37
reactos/dll/win32/riched20 # Synced to WineStaging-1.7.37
reactos/dll/win32/riched20 # Synced to WineStaging-1.7.47
reactos/dll/win32/riched32 # Synced to WineStaging-1.7.37
reactos/dll/win32/rpcrt4 # Synced to Wine-1.7.17
reactos/dll/win32/rsabase # Synced to WineStaging-1.7.37