* Sync to Wine 1.3.37.
svn path=/trunk/; revision=55303
}
p = &editor->pCursors[nCursor];
- if (p->nOffset) {
- ME_SplitRunSimple(editor, p->pRun, p->nOffset);
- p = &editor->pCursors[nCursor];
- }
+ if (p->nOffset)
+ ME_SplitRunSimple(editor, p);
tmp_style = ME_GetInsertStyle(editor, nCursor);
/* ME_SplitParagraph increases style refcount */
tp = ME_SplitParagraph(editor, p->pRun, p->pRun->member.run.style, eol_str, 0);
ME_DisplayItem *pNext, *pLastRun;
pNext = ME_FindItemFwd(pRow, diRunOrStartRow);
assert(pNext->type == diRun);
- pLastRun = pNext;
if (pbCaretAtEnd) *pbCaretAtEnd = FALSE;
if (pOffset) *pOffset = 0;
do {
static UINT cfRTF = 0;
typedef struct DataObjectImpl {
- const IDataObjectVtbl *lpVtbl;
+ IDataObject IDataObject_iface;
LONG ref;
FORMATETC *fmtetc;
} DataObjectImpl;
typedef struct EnumFormatImpl {
- const IEnumFORMATETCVtbl *lpVtbl;
+ IEnumFORMATETC IEnumFORMATETC_iface;
LONG ref;
FORMATETC *fmtetc;
static HRESULT EnumFormatImpl_Create(const FORMATETC *fmtetc, UINT size, LPENUMFORMATETC *lplpformatetc);
+static inline DataObjectImpl *impl_from_IDataObject(IDataObject *iface)
+{
+ return CONTAINING_RECORD(iface, DataObjectImpl, IDataObject_iface);
+}
+
+static inline EnumFormatImpl *impl_from_IEnumFORMATETC(IEnumFORMATETC *iface)
+{
+ return CONTAINING_RECORD(iface, EnumFormatImpl, IEnumFORMATETC_iface);
+}
+
static HRESULT WINAPI EnumFormatImpl_QueryInterface(IEnumFORMATETC *iface, REFIID riid, LPVOID *ppvObj)
{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ EnumFormatImpl *This = impl_from_IEnumFORMATETC(iface);
TRACE("%p %s\n", This, debugstr_guid(riid));
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IEnumFORMATETC)) {
static ULONG WINAPI EnumFormatImpl_AddRef(IEnumFORMATETC *iface)
{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ EnumFormatImpl *This = impl_from_IEnumFORMATETC(iface);
LONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
return ref;
static ULONG WINAPI EnumFormatImpl_Release(IEnumFORMATETC *iface)
{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ EnumFormatImpl *This = impl_from_IEnumFORMATETC(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
static HRESULT WINAPI EnumFormatImpl_Next(IEnumFORMATETC *iface, ULONG celt,
FORMATETC *rgelt, ULONG *pceltFetched)
{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ EnumFormatImpl *This = impl_from_IEnumFORMATETC(iface);
ULONG count = 0;
TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched);
static HRESULT WINAPI EnumFormatImpl_Skip(IEnumFORMATETC *iface, ULONG celt)
{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ EnumFormatImpl *This = impl_from_IEnumFORMATETC(iface);
ULONG count = 0;
TRACE("(%p)->(%d)\n", This, celt);
static HRESULT WINAPI EnumFormatImpl_Reset(IEnumFORMATETC *iface)
{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ EnumFormatImpl *This = impl_from_IEnumFORMATETC(iface);
TRACE("(%p)\n", This);
This->cur = 0;
static HRESULT WINAPI EnumFormatImpl_Clone(IEnumFORMATETC *iface, IEnumFORMATETC **ppenum)
{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ EnumFormatImpl *This = impl_from_IEnumFORMATETC(iface);
HRESULT hr;
TRACE("(%p)->(%p)\n", This, ppenum);
TRACE("\n");
ret = heap_alloc(sizeof(EnumFormatImpl));
- ret->lpVtbl = &VT_EnumFormatImpl;
+ ret->IEnumFORMATETC_iface.lpVtbl = &VT_EnumFormatImpl;
ret->ref = 1;
ret->cur = 0;
ret->fmtetc_cnt = fmtetc_cnt;
static HRESULT WINAPI DataObjectImpl_QueryInterface(IDataObject *iface, REFIID riid, LPVOID *ppvObj)
{
- DataObjectImpl *This = (DataObjectImpl*)iface;
+ DataObjectImpl *This = impl_from_IDataObject(iface);
TRACE("(%p)->(%s)\n", This, debugstr_guid(riid));
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDataObject)) {
static ULONG WINAPI DataObjectImpl_AddRef(IDataObject* iface)
{
- DataObjectImpl *This = (DataObjectImpl*)iface;
+ DataObjectImpl *This = impl_from_IDataObject(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
return ref;
static ULONG WINAPI DataObjectImpl_Release(IDataObject* iface)
{
- DataObjectImpl *This = (DataObjectImpl*)iface;
+ DataObjectImpl *This = impl_from_IDataObject(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%d\n",This, ref);
static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pformatetc, STGMEDIUM *pmedium)
{
- DataObjectImpl *This = (DataObjectImpl*)iface;
+ DataObjectImpl *This = impl_from_IDataObject(iface);
TRACE("(%p)->(fmt=0x%08x tym=0x%08x)\n", This, pformatetc->cfFormat, pformatetc->tymed);
if(pformatetc->lindex != -1)
static HRESULT WINAPI DataObjectImpl_GetDataHere(IDataObject* iface, FORMATETC *pformatetc, STGMEDIUM *pmedium)
{
- DataObjectImpl *This = (DataObjectImpl*)iface;
+ DataObjectImpl *This = impl_from_IDataObject(iface);
FIXME("(%p): stub\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI DataObjectImpl_QueryGetData(IDataObject* iface, FORMATETC *pformatetc)
{
- DataObjectImpl *This = (DataObjectImpl*)iface;
+ DataObjectImpl *This = impl_from_IDataObject(iface);
UINT i;
BOOL foundFormat = FALSE;
TRACE("(%p)->(fmt=0x%08x tym=0x%08x)\n", This, pformatetc->cfFormat, pformatetc->tymed);
static HRESULT WINAPI DataObjectImpl_GetCanonicalFormatEtc(IDataObject* iface, FORMATETC *pformatetcIn,
FORMATETC *pformatetcOut)
{
- DataObjectImpl *This = (DataObjectImpl*)iface;
+ DataObjectImpl *This = impl_from_IDataObject(iface);
TRACE("(%p)->(%p,%p)\n", This, pformatetcIn, pformatetcOut);
if(pformatetcOut) {
static HRESULT WINAPI DataObjectImpl_SetData(IDataObject* iface, FORMATETC *pformatetc,
STGMEDIUM *pmedium, BOOL fRelease)
{
- DataObjectImpl *This = (DataObjectImpl*)iface;
+ DataObjectImpl *This = impl_from_IDataObject(iface);
FIXME("(%p): stub\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI DataObjectImpl_EnumFormatEtc(IDataObject* iface, DWORD dwDirection,
IEnumFORMATETC **ppenumFormatEtc)
{
- DataObjectImpl *This = (DataObjectImpl*)iface;
+ DataObjectImpl *This = impl_from_IDataObject(iface);
TRACE("(%p)->(%d)\n", This, dwDirection);
if(dwDirection != DATADIR_GET) {
static HRESULT WINAPI DataObjectImpl_DAdvise(IDataObject* iface, FORMATETC *pformatetc, DWORD advf,
IAdviseSink *pAdvSink, DWORD *pdwConnection)
{
- DataObjectImpl *This = (DataObjectImpl*)iface;
+ DataObjectImpl *This = impl_from_IDataObject(iface);
FIXME("(%p): stub\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI DataObjectImpl_DUnadvise(IDataObject* iface, DWORD dwConnection)
{
- DataObjectImpl *This = (DataObjectImpl*)iface;
+ DataObjectImpl *This = impl_from_IDataObject(iface);
FIXME("(%p): stub\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI DataObjectImpl_EnumDAdvise(IDataObject* iface, IEnumSTATDATA **ppenumAdvise)
{
- DataObjectImpl *This = (DataObjectImpl*)iface;
+ DataObjectImpl *This = impl_from_IDataObject(iface);
FIXME("(%p): stub\n", This);
return E_NOTIMPL;
}
if(cfRTF == 0)
cfRTF = RegisterClipboardFormatA("Rich Text Format");
- obj->lpVtbl = &VT_DataObjectImpl;
+ obj->IDataObject_iface.lpVtbl = &VT_DataObjectImpl;
obj->ref = 1;
obj->unicode = get_unicode_text(editor, start, nChars);
obj->rtf = NULL;
{
WCHAR wszText[STREAMIN_BUFFER_SIZE+1];
WCHAR *pText;
-
+ LRESULT total_bytes_read = 0;
+
TRACE("%08x %p\n", dwFormat, stream);
-
+
do {
LONG nWideChars = 0;
break;
if (!stream->dwSize)
break;
+ total_bytes_read += stream->dwSize;
}
-
+
if (!(dwFormat & SF_UNICODE))
{
/* FIXME? this is doomed to fail on true MBCS like UTF-8, luckily they're unlikely to be used as CP_ACP */
nWideChars = stream->dwSize >> 1;
pText = (WCHAR *)stream->buffer;
}
-
+
ME_InsertTextFromCursor(editor, 0, pText, nWideChars, style);
if (stream->dwSize == 0)
break;
stream->dwSize = 0;
} while(1);
- ME_CommitUndo(editor);
- ME_UpdateRepaint(editor);
- return 0;
+ return total_bytes_read;
}
static void ME_ApplyBorderProperties(RTF_Info *info,
fmt.dyLineSpacing = info->rtfParam;
fmt.bLineSpacingRule = 4;
}
+ break;
case rtfSpaceMultiply:
fmt.dwMask = PFM_LINESPACING;
fmt.dyLineSpacing = info->rtfParam * 20;
ME_InStream inStream;
BOOL invalidRTF = FALSE;
ME_Cursor *selStart, *selEnd;
+ LRESULT num_read = 0; /* bytes read for SF_TEXT, non-control chars inserted for SF_RTF */
TRACE("stream==%p editor==%p format==0x%X\n", stream, editor, format);
editor->nEventMask = 0;
if (!invalidRTF && !inStream.editstream->dwError)
{
if (format & SF_RTF) {
+ from = ME_GetCursorOfs(&editor->pCursors[0]);
+
/* setup the RTF parser */
memset(&parser, 0, sizeof parser);
RTFSetEditStream(&parser, &inStream);
}
}
}
+ to = ME_GetCursorOfs(&editor->pCursors[0]);
+ num_read = to - from;
style = parser.style;
}
else if (format & SF_TEXT)
- ME_StreamInText(editor, format, &inStream, style);
+ num_read = ME_StreamInText(editor, format, &inStream, style);
else
ERR("EM_STREAMIN without SF_TEXT or SF_RTF\n");
/* put the cursor at the top */
ME_ReleaseStyle(style);
editor->nEventMask = nEventMask;
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
if (!(format & SFF_SELECTION)) {
ME_ClearTempStyle(editor);
}
ME_SendSelChange(editor);
ME_SendRequestResize(editor, FALSE);
- return 0;
+ return num_read;
}
return TRUE;
ME_MoveCursorFromTableRowStartParagraph(editor);
ME_UpdateSelectionLinkAttribute(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
ME_SendRequestResize(editor, FALSE);
return TRUE;
case VK_RETURN:
editor->pCursors[1] = editor->pCursors[0];
ME_CommitUndo(editor);
ME_CheckTablesForCorruption(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
return TRUE;
}
else if (para == editor->pCursors[1].pPara &&
para->member.para.next_para->member.para.nFlags |= MEPF_ROWSTART;
ME_CommitCoalescingUndo(editor);
ME_CheckTablesForCorruption(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
return TRUE;
}
} else { /* v1.0 - 3.0 */
editor->pCursors[0].nOffset = 0;
editor->pCursors[1] = editor->pCursors[0];
ME_CommitCoalescingUndo(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
return TRUE;
}
} else {
editor->pCursors[1] = editor->pCursors[0];
}
ME_CommitCoalescingUndo(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
return TRUE;
}
}
SetCursor(NULL);
ME_UpdateSelectionLinkAttribute(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
}
return TRUE;
}
{
ME_InternalDeleteText(editor, selStart, nChars, FALSE);
ME_CommitUndo(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, TRUE);
}
return result;
}
}
ME_UpdateSelectionLinkAttribute(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
}
return 0;
}
editor->nModifyStep = oldModify;
ME_EmptyUndoStack(editor);
}
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
return len;
}
case EM_SETBKGNDCOLOR:
BOOL bRepaint = TRUE;
p = ME_ToCF2W(&buf, (CHARFORMAT2W *)lParam);
if (p == NULL) return 0;
- if (!wParam)
- ME_SetDefaultCharFormat(editor, p);
- else if (wParam == (SCF_WORD | SCF_SELECTION)) {
- FIXME("EM_SETCHARFORMAT: word selection not supported\n");
- return 0;
- } else if (wParam == SCF_ALL) {
- if (editor->mode & TM_PLAINTEXT)
+ if (wParam & SCF_ALL) {
+ if (editor->mode & TM_PLAINTEXT) {
ME_SetDefaultCharFormat(editor, p);
- else {
+ } else {
ME_Cursor start;
ME_SetCursorToStart(editor, &start);
ME_SetCharFormat(editor, &start, NULL, p);
editor->nModifyStep = 1;
}
- } else if (editor->mode & TM_PLAINTEXT) {
- return 0;
- } else {
+ } else if (wParam & SCF_SELECTION) {
+ if (editor->mode & TM_PLAINTEXT)
+ return 0;
+ if (wParam & SCF_WORD) {
+ FIXME("EM_SETCHARFORMAT: word selection not supported\n");
+ return 0;
+ }
bRepaint = ME_IsSelection(editor);
ME_SetSelectionCharFormat(editor, p);
if (bRepaint) editor->nModifyStep = 1;
+ } else { /* SCF_DEFAULT */
+ ME_SetDefaultCharFormat(editor, p);
}
ME_CommitUndo(editor);
if (bRepaint)
int nStartCursor = ME_GetSelectionOfs(editor, &from, &to);
ME_InternalDeleteText(editor, &editor->pCursors[nStartCursor], to-from, FALSE);
ME_CommitUndo(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, TRUE);
return 0;
}
case EM_REPLACESEL:
ME_UpdateSelectionLinkAttribute(editor);
if (!wParam)
ME_EmptyUndoStack(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
return len;
}
case EM_SCROLLCARET:
editor->nModifyStep = 0;
ME_CommitUndo(editor);
ME_EmptyUndoStack(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
return 1;
}
case EM_CANPASTE:
{
ME_InternalDeleteText(editor, selStart, nChars, FALSE);
ME_CommitUndo(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, TRUE);
}
return 0;
}
editor->imeStartIndex=ME_GetCursorOfs(&editor->pCursors[0]);
ME_DeleteSelection(editor);
ME_CommitUndo(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
return 0;
}
case WM_IME_COMPOSITION:
}
ME_ReleaseStyle(style);
ME_CommitUndo(editor);
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
return 0;
}
case WM_IME_ENDCOMPOSITION:
return editor->mode;
case EM_SETTEXTMODE:
{
- LRESULT ret;
int mask = 0;
int changes = 0;
- GETTEXTLENGTHEX how;
- /* CR/LF conversion required in 2.0 mode, verbatim in 1.0 mode */
- how.flags = GTL_CLOSE | (editor->bEmulateVersion10 ? 0 : GTL_USECRLF) | GTL_NUMCHARS;
- how.codepage = unicode ? 1200 : CP_ACP;
- ret = ME_GetTextLengthEx(editor, &how);
- if (!ret)
+ if (ME_GetTextLength(editor) || editor->pUndoStack || editor->pRedoStack)
+ return E_UNEXPECTED;
+
+ /* Check for mutually exclusive flags in adjacent bits of wParam */
+ if ((wParam & (TM_RICHTEXT | TM_MULTILEVELUNDO | TM_MULTICODEPAGE)) &
+ (wParam & (TM_PLAINTEXT | TM_SINGLELEVELUNDO | TM_SINGLECODEPAGE)) << 1)
+ return E_INVALIDARG;
+
+ if (wParam & (TM_RICHTEXT | TM_PLAINTEXT))
{
- /*Check for valid wParam*/
- if ((((wParam & TM_RICHTEXT) && ((wParam & TM_PLAINTEXT) << 1))) ||
- (((wParam & TM_MULTILEVELUNDO) && ((wParam & TM_SINGLELEVELUNDO) << 1))) ||
- (((wParam & TM_MULTICODEPAGE) && ((wParam & TM_SINGLECODEPAGE) << 1))))
- return 1;
- else
- {
- if (wParam & (TM_RICHTEXT | TM_PLAINTEXT))
- {
- mask |= (TM_RICHTEXT | TM_PLAINTEXT);
- changes |= (wParam & (TM_RICHTEXT | TM_PLAINTEXT));
- }
- /*FIXME: Currently no support for undo level and code page options*/
- editor->mode = (editor->mode & (~mask)) | changes;
- return 0;
+ mask |= TM_RICHTEXT | TM_PLAINTEXT;
+ changes |= wParam & (TM_RICHTEXT | TM_PLAINTEXT);
+ if (wParam & TM_PLAINTEXT) {
+ /* Clear selection since it should be possible to select the
+ * end of text run for rich text */
+ ME_InvalidateSelection(editor);
+ ME_SetCursorToStart(editor, &editor->pCursors[0]);
+ editor->pCursors[1] = editor->pCursors[0];
+ /* plain text can only have the default style. */
+ ME_ClearTempStyle(editor);
+ ME_AddRefStyle(editor->pBuffer->pDefaultStyle);
+ ME_ReleaseStyle(editor->pCursors[0].pRun->member.run.style);
+ editor->pCursors[0].pRun->member.run.style = editor->pBuffer->pDefaultStyle;
}
}
- return ret;
+ /* FIXME: Currently no support for undo level and code page options */
+ editor->mode = (editor->mode & ~mask) | changes;
+ return 0;
}
case EM_SETPASSWORDCHAR:
{
PAINTSTRUCT ps;
hDC = BeginPaint(editor->hWnd, &ps);
+ if (!editor->bEmulateVersion10 || (editor->nEventMask & ENM_UPDATE))
+ ME_SendOldNotify(editor, EN_UPDATE);
/* Erase area outside of the formatting rectangle */
if (ps.rcPaint.top < editor->rcFormat.top)
{
struct _RTF_Info;
-extern HANDLE me_heap;
+extern HANDLE me_heap DECLSPEC_HIDDEN;
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc( size_t len )
{
};
/* style.c */
-ME_Style *ME_MakeStyle(CHARFORMAT2W *style);
-void ME_AddRefStyle(ME_Style *item);
-void ME_ReleaseStyle(ME_Style *item);
-ME_Style *ME_GetInsertStyle(ME_TextEditor *editor, int nCursor);
-ME_Style *ME_ApplyStyle(ME_Style *sSrc, CHARFORMAT2W *style);
-HFONT ME_SelectStyleFont(ME_Context *c, ME_Style *s);
-void ME_UnselectStyleFont(ME_Context *c, ME_Style *s, HFONT hOldFont);
-void ME_InitCharFormat2W(CHARFORMAT2W *pFmt);
-void ME_SaveTempStyle(ME_TextEditor *editor);
-void ME_ClearTempStyle(ME_TextEditor *editor);
-void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048]);
-void ME_DumpStyle(ME_Style *s);
-CHARFORMAT2W *ME_ToCF2W(CHARFORMAT2W *to, CHARFORMAT2W *from);
-void ME_CopyToCFAny(CHARFORMAT2W *to, CHARFORMAT2W *from);
-void ME_CopyCharFormat(CHARFORMAT2W *pDest, const CHARFORMAT2W *pSrc); /* only works with 2W structs */
-void ME_CharFormatFromLogFont(HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt); /* ditto */
+ME_Style *ME_MakeStyle(CHARFORMAT2W *style) DECLSPEC_HIDDEN;
+void ME_AddRefStyle(ME_Style *item) DECLSPEC_HIDDEN;
+void ME_ReleaseStyle(ME_Style *item) DECLSPEC_HIDDEN;
+ME_Style *ME_GetInsertStyle(ME_TextEditor *editor, int nCursor) DECLSPEC_HIDDEN;
+ME_Style *ME_ApplyStyle(ME_Style *sSrc, CHARFORMAT2W *style) DECLSPEC_HIDDEN;
+HFONT ME_SelectStyleFont(ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN;
+void ME_UnselectStyleFont(ME_Context *c, ME_Style *s, HFONT hOldFont) DECLSPEC_HIDDEN;
+void ME_InitCharFormat2W(CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN;
+void ME_SaveTempStyle(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_ClearTempStyle(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048]) DECLSPEC_HIDDEN;
+void ME_DumpStyle(ME_Style *s) DECLSPEC_HIDDEN;
+CHARFORMAT2W *ME_ToCF2W(CHARFORMAT2W *to, CHARFORMAT2W *from) DECLSPEC_HIDDEN;
+void ME_CopyToCFAny(CHARFORMAT2W *to, CHARFORMAT2W *from) DECLSPEC_HIDDEN;
+void ME_CopyCharFormat(CHARFORMAT2W *pDest, const CHARFORMAT2W *pSrc) DECLSPEC_HIDDEN; /* only works with 2W structs */
+void ME_CharFormatFromLogFont(HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt) DECLSPEC_HIDDEN; /* ditto */
/* list.c */
-void ME_InsertBefore(ME_DisplayItem *diWhere, ME_DisplayItem *diWhat);
-void ME_Remove(ME_DisplayItem *diWhere);
-BOOL ME_NextRun(ME_DisplayItem **para, ME_DisplayItem **run);
-BOOL ME_PrevRun(ME_DisplayItem **para, ME_DisplayItem **run);
-ME_DisplayItem *ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass);
-ME_DisplayItem *ME_FindItemFwd(ME_DisplayItem *di, ME_DIType nTypeOrClass);
-ME_DisplayItem *ME_FindItemBackOrHere(ME_DisplayItem *di, ME_DIType nTypeOrClass);
-ME_DisplayItem *ME_MakeDI(ME_DIType type);
-void ME_DestroyDisplayItem(ME_DisplayItem *item);
-void ME_DumpDocument(ME_TextBuffer *buffer);
-const char *ME_GetDITypeName(ME_DIType type);
+void ME_InsertBefore(ME_DisplayItem *diWhere, ME_DisplayItem *diWhat) DECLSPEC_HIDDEN;
+void ME_Remove(ME_DisplayItem *diWhere) DECLSPEC_HIDDEN;
+BOOL ME_NextRun(ME_DisplayItem **para, ME_DisplayItem **run) DECLSPEC_HIDDEN;
+BOOL ME_PrevRun(ME_DisplayItem **para, ME_DisplayItem **run) DECLSPEC_HIDDEN;
+ME_DisplayItem *ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN;
+ME_DisplayItem *ME_FindItemFwd(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN;
+ME_DisplayItem *ME_FindItemBackOrHere(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN;
+ME_DisplayItem *ME_MakeDI(ME_DIType type) DECLSPEC_HIDDEN;
+void ME_DestroyDisplayItem(ME_DisplayItem *item) DECLSPEC_HIDDEN;
+void ME_DumpDocument(ME_TextBuffer *buffer) DECLSPEC_HIDDEN;
+const char *ME_GetDITypeName(ME_DIType type) DECLSPEC_HIDDEN;
/* string.c */
-ME_String *ME_MakeStringN(LPCWSTR szText, int nMaxChars);
-ME_String *ME_MakeStringR(WCHAR cRepeat, int nMaxChars);
-ME_String *ME_StrDup(const ME_String *s);
-void ME_DestroyString(ME_String *s);
-void ME_AppendString(ME_String *s1, const ME_String *s2);
-ME_String *ME_VSplitString(ME_String *orig, int nVPos);
-int ME_IsWhitespaces(const ME_String *s);
-int ME_IsSplitable(const ME_String *s);
-int ME_FindNonWhitespaceV(const ME_String *s, int nVChar);
-int ME_CallWordBreakProc(ME_TextEditor *editor, ME_String *str, INT start, INT code);
-void ME_StrDeleteV(ME_String *s, int nVChar, int nChars);
+ME_String *ME_MakeStringN(LPCWSTR szText, int nMaxChars) DECLSPEC_HIDDEN;
+ME_String *ME_MakeStringR(WCHAR cRepeat, int nMaxChars) DECLSPEC_HIDDEN;
+ME_String *ME_StrDup(const ME_String *s) DECLSPEC_HIDDEN;
+void ME_DestroyString(ME_String *s) DECLSPEC_HIDDEN;
+void ME_AppendString(ME_String *s1, const ME_String *s2) DECLSPEC_HIDDEN;
+ME_String *ME_VSplitString(ME_String *orig, int nVPos) DECLSPEC_HIDDEN;
+int ME_IsWhitespaces(const ME_String *s) DECLSPEC_HIDDEN;
+int ME_IsSplitable(const ME_String *s) DECLSPEC_HIDDEN;
+int ME_FindNonWhitespaceV(const ME_String *s, int nVChar) DECLSPEC_HIDDEN;
+int ME_CallWordBreakProc(ME_TextEditor *editor, ME_String *str, INT start, INT code) DECLSPEC_HIDDEN;
+void ME_StrDeleteV(ME_String *s, int nVChar, int nChars) DECLSPEC_HIDDEN;
/* smart helpers for A<->W conversions, they reserve/free memory and call MultiByte<->WideChar functions */
-LPWSTR ME_ToUnicode(BOOL unicode, LPVOID psz);
-void ME_EndToUnicode(BOOL unicode, LPVOID psz);
+LPWSTR ME_ToUnicode(BOOL unicode, LPVOID psz) DECLSPEC_HIDDEN;
+void ME_EndToUnicode(BOOL unicode, LPVOID psz) DECLSPEC_HIDDEN;
static inline int ME_IsWSpace(WCHAR ch)
{
/* note: those two really return the first matching offset (starting from EOS)+1
* in other words, an offset of the first trailing white/black */
-int ME_ReverseFindNonWhitespaceV(const ME_String *s, int nVChar);
-int ME_ReverseFindWhitespaceV(const ME_String *s, int nVChar);
+int ME_ReverseFindNonWhitespaceV(const ME_String *s, int nVChar) DECLSPEC_HIDDEN;
+int ME_ReverseFindWhitespaceV(const ME_String *s, int nVChar) DECLSPEC_HIDDEN;
/* row.c */
-ME_DisplayItem *ME_RowStart(ME_DisplayItem *item);
+ME_DisplayItem *ME_RowStart(ME_DisplayItem *item) DECLSPEC_HIDDEN;
/* ME_DisplayItem *ME_RowEnd(ME_DisplayItem *item); */
-ME_DisplayItem *ME_FindRowWithNumber(ME_TextEditor *editor, int nRow);
-int ME_RowNumberFromCharOfs(ME_TextEditor *editor, int nOfs);
+ME_DisplayItem *ME_FindRowWithNumber(ME_TextEditor *editor, int nRow) DECLSPEC_HIDDEN;
+int ME_RowNumberFromCharOfs(ME_TextEditor *editor, int nOfs) DECLSPEC_HIDDEN;
/* run.c */
-ME_DisplayItem *ME_MakeRun(ME_Style *s, ME_String *strData, int nFlags);
+ME_DisplayItem *ME_MakeRun(ME_Style *s, ME_String *strData, int nFlags) DECLSPEC_HIDDEN;
ME_DisplayItem *ME_InsertRunAtCursor(ME_TextEditor *editor, ME_Cursor *cursor,
- ME_Style *style, const WCHAR *str, int len, int flags);
-void ME_CheckCharOffsets(ME_TextEditor *editor);
-void ME_PropagateCharOffset(ME_DisplayItem *p, int shift);
-int ME_CharFromPoint(ME_Context *c, int cx, ME_Run *run);
+ ME_Style *style, const WCHAR *str, int len, int flags) DECLSPEC_HIDDEN;
+void ME_CheckCharOffsets(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_PropagateCharOffset(ME_DisplayItem *p, int shift) DECLSPEC_HIDDEN;
+int ME_CharFromPoint(ME_Context *c, int cx, ME_Run *run) DECLSPEC_HIDDEN;
/* this one accounts for 1/2 char tolerance */
-int ME_CharFromPointCursor(ME_TextEditor *editor, int cx, ME_Run *run);
-int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset);
-int ME_CanJoinRuns(const ME_Run *run1, const ME_Run *run2);
-void ME_JoinRuns(ME_TextEditor *editor, ME_DisplayItem *p);
-ME_DisplayItem *ME_SplitRun(ME_WrapContext *wc, ME_DisplayItem *item, int nChar);
-ME_DisplayItem *ME_SplitRunSimple(ME_TextEditor *editor, ME_DisplayItem *item, int nChar);
-void ME_UpdateRunFlags(ME_TextEditor *editor, ME_Run *run);
-void ME_CalcRunExtent(ME_Context *c, const ME_Paragraph *para, int startx, ME_Run *run);
-SIZE ME_GetRunSize(ME_Context *c, const ME_Paragraph *para, ME_Run *run, int nLen, int startx);
-void ME_CursorFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_Cursor *pCursor);
-void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem **ppPara, ME_DisplayItem **ppRun, int *pOfs);
-int ME_CharOfsFromRunOfs(ME_TextEditor *editor, const ME_DisplayItem *pPara, const ME_DisplayItem *pRun, int nOfs);
-void ME_SkipAndPropagateCharOffset(ME_DisplayItem *p, int shift);
-void ME_SetCharFormat(ME_TextEditor *editor, ME_Cursor *start, ME_Cursor *end, CHARFORMAT2W *pFmt);
-void ME_SetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt);
+int ME_CharFromPointCursor(ME_TextEditor *editor, int cx, ME_Run *run) DECLSPEC_HIDDEN;
+int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset) DECLSPEC_HIDDEN;
+int ME_CanJoinRuns(const ME_Run *run1, const ME_Run *run2) DECLSPEC_HIDDEN;
+void ME_JoinRuns(ME_TextEditor *editor, ME_DisplayItem *p) DECLSPEC_HIDDEN;
+ME_DisplayItem *ME_SplitRun(ME_WrapContext *wc, ME_DisplayItem *item, int nChar) DECLSPEC_HIDDEN;
+ME_DisplayItem *ME_SplitRunSimple(ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN;
+void ME_UpdateRunFlags(ME_TextEditor *editor, ME_Run *run) DECLSPEC_HIDDEN;
+void ME_CalcRunExtent(ME_Context *c, const ME_Paragraph *para, int startx, ME_Run *run) DECLSPEC_HIDDEN;
+SIZE ME_GetRunSize(ME_Context *c, const ME_Paragraph *para, ME_Run *run, int nLen, int startx) DECLSPEC_HIDDEN;
+void ME_CursorFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_Cursor *pCursor) DECLSPEC_HIDDEN;
+void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem **ppPara, ME_DisplayItem **ppRun, int *pOfs) DECLSPEC_HIDDEN;
+int ME_CharOfsFromRunOfs(ME_TextEditor *editor, const ME_DisplayItem *pPara, const ME_DisplayItem *pRun, int nOfs) DECLSPEC_HIDDEN;
+void ME_SkipAndPropagateCharOffset(ME_DisplayItem *p, int shift) DECLSPEC_HIDDEN;
+void ME_SetCharFormat(ME_TextEditor *editor, ME_Cursor *start, ME_Cursor *end, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN;
+void ME_SetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN;
void ME_GetCharFormat(ME_TextEditor *editor, const ME_Cursor *from,
- const ME_Cursor *to, CHARFORMAT2W *pFmt);
-void ME_GetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt);
-void ME_GetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt);
-void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod);
+ const ME_Cursor *to, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN;
+void ME_GetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN;
+void ME_GetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN;
+void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod) DECLSPEC_HIDDEN;
/* caret.c */
-void ME_SetCursorToStart(ME_TextEditor *editor, ME_Cursor *cursor);
-int ME_SetSelection(ME_TextEditor *editor, int from, int to);
-void ME_HideCaret(ME_TextEditor *ed);
-void ME_ShowCaret(ME_TextEditor *ed);
-void ME_MoveCaret(ME_TextEditor *ed);
-BOOL ME_CharFromPos(ME_TextEditor *editor, int x, int y, ME_Cursor *cursor, BOOL *isExact);
-void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum);
-void ME_MouseMove(ME_TextEditor *editor, int x, int y);
-BOOL ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, int nChars);
+void ME_SetCursorToStart(ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN;
+int ME_SetSelection(ME_TextEditor *editor, int from, int to) DECLSPEC_HIDDEN;
+void ME_HideCaret(ME_TextEditor *ed) DECLSPEC_HIDDEN;
+void ME_ShowCaret(ME_TextEditor *ed) DECLSPEC_HIDDEN;
+void ME_MoveCaret(ME_TextEditor *ed) DECLSPEC_HIDDEN;
+BOOL ME_CharFromPos(ME_TextEditor *editor, int x, int y, ME_Cursor *cursor, BOOL *isExact) DECLSPEC_HIDDEN;
+void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum) DECLSPEC_HIDDEN;
+void ME_MouseMove(ME_TextEditor *editor, int x, int y) DECLSPEC_HIDDEN;
+BOOL ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, int nChars) DECLSPEC_HIDDEN;
void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
- const WCHAR *str, int len, ME_Style *style);
-void ME_InsertEndRowFromCursor(ME_TextEditor *editor, int nCursor);
-int ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs);
-BOOL ME_ArrowKey(ME_TextEditor *ed, int nVKey, BOOL extend, BOOL ctrl);
-
-int ME_GetCursorOfs(const ME_Cursor *cursor);
-int ME_GetSelectionOfs(ME_TextEditor *editor, int *from, int *to);
-int ME_GetSelection(ME_TextEditor *editor, ME_Cursor **from, ME_Cursor **to);
-BOOL ME_IsSelection(ME_TextEditor *editor);
-void ME_DeleteSelection(ME_TextEditor *editor);
-void ME_SendSelChange(ME_TextEditor *editor);
-void ME_InsertOLEFromCursor(ME_TextEditor *editor, const REOBJECT* reo, int nCursor);
-BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start, int nChars, BOOL bForce);
-int ME_GetTextLength(ME_TextEditor *editor);
-int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how);
-ME_Style *ME_GetSelectionInsertStyle(ME_TextEditor *editor);
+ const WCHAR *str, int len, ME_Style *style) DECLSPEC_HIDDEN;
+void ME_InsertEndRowFromCursor(ME_TextEditor *editor, int nCursor) DECLSPEC_HIDDEN;
+int ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) DECLSPEC_HIDDEN;
+BOOL ME_ArrowKey(ME_TextEditor *ed, int nVKey, BOOL extend, BOOL ctrl) DECLSPEC_HIDDEN;
+
+int ME_GetCursorOfs(const ME_Cursor *cursor) DECLSPEC_HIDDEN;
+int ME_GetSelectionOfs(ME_TextEditor *editor, int *from, int *to) DECLSPEC_HIDDEN;
+int ME_GetSelection(ME_TextEditor *editor, ME_Cursor **from, ME_Cursor **to) DECLSPEC_HIDDEN;
+BOOL ME_IsSelection(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_DeleteSelection(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_SendSelChange(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_InsertOLEFromCursor(ME_TextEditor *editor, const REOBJECT* reo, int nCursor) DECLSPEC_HIDDEN;
+BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start, int nChars, BOOL bForce) DECLSPEC_HIDDEN;
+int ME_GetTextLength(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how) DECLSPEC_HIDDEN;
+ME_Style *ME_GetSelectionInsertStyle(ME_TextEditor *editor) DECLSPEC_HIDDEN;
/* context.c */
-void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC);
-void ME_DestroyContext(ME_Context *c);
+void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC) DECLSPEC_HIDDEN;
+void ME_DestroyContext(ME_Context *c) DECLSPEC_HIDDEN;
/* wrap.c */
-BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor);
-void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor);
-void ME_SendRequestResize(ME_TextEditor *editor, BOOL force);
+BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_SendRequestResize(ME_TextEditor *editor, BOOL force) DECLSPEC_HIDDEN;
/* para.c */
-ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *run);
-void ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayItem **para_end);
-void ME_MakeFirstParagraph(ME_TextEditor *editor);
-ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style, ME_String *eol_str, int paraFlags);
+ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *run) DECLSPEC_HIDDEN;
+void ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayItem **para_end) DECLSPEC_HIDDEN;
+void ME_MakeFirstParagraph(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style, ME_String *eol_str, int paraFlags) DECLSPEC_HIDDEN;
ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp,
- BOOL keepFirstParaFormat);
-void ME_DumpParaStyle(ME_Paragraph *s);
-void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048]);
-BOOL ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt);
-void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt);
+ BOOL keepFirstParaFormat) DECLSPEC_HIDDEN;
+void ME_DumpParaStyle(ME_Paragraph *s) DECLSPEC_HIDDEN;
+void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048]) DECLSPEC_HIDDEN;
+BOOL ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN;
+void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN;
/* marks from first up to (but not including) last */
-void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last);
-void ME_MarkAllForWrapping(ME_TextEditor *editor);
-void ME_SetDefaultParaFormat(PARAFORMAT2 *pFmt);
+void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last) DECLSPEC_HIDDEN;
+void ME_MarkAllForWrapping(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_SetDefaultParaFormat(PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN;
/* paint.c */
-void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *rcUpdate);
-void ME_Repaint(ME_TextEditor *editor);
-void ME_RewrapRepaint(ME_TextEditor *editor);
-void ME_UpdateRepaint(ME_TextEditor *editor);
-void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor);
-void ME_InvalidateSelection(ME_TextEditor *editor);
-BOOL ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator);
-int ME_twips2pointsX(ME_Context *c, int x);
-int ME_twips2pointsY(ME_Context *c, int y);
+void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *rcUpdate) DECLSPEC_HIDDEN;
+void ME_Repaint(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_RewrapRepaint(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now) DECLSPEC_HIDDEN;
+void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor) DECLSPEC_HIDDEN;
+void ME_InvalidateSelection(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+BOOL ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator) DECLSPEC_HIDDEN;
+int ME_twips2pointsX(const ME_Context *c, int x) DECLSPEC_HIDDEN;
+int ME_twips2pointsY(const ME_Context *c, int y) DECLSPEC_HIDDEN;
/* scroll functions in paint.c */
-void ME_ScrollAbs(ME_TextEditor *editor, int x, int y);
-void ME_HScrollAbs(ME_TextEditor *editor, int x);
-void ME_VScrollAbs(ME_TextEditor *editor, int y);
-void ME_ScrollUp(ME_TextEditor *editor, int cy);
-void ME_ScrollDown(ME_TextEditor *editor, int cy);
-void ME_ScrollLeft(ME_TextEditor *editor, int cx);
-void ME_ScrollRight(ME_TextEditor *editor, int cx);
-void ME_UpdateScrollBar(ME_TextEditor *editor);
+void ME_ScrollAbs(ME_TextEditor *editor, int x, int y) DECLSPEC_HIDDEN;
+void ME_HScrollAbs(ME_TextEditor *editor, int x) DECLSPEC_HIDDEN;
+void ME_VScrollAbs(ME_TextEditor *editor, int y) DECLSPEC_HIDDEN;
+void ME_ScrollUp(ME_TextEditor *editor, int cy) DECLSPEC_HIDDEN;
+void ME_ScrollDown(ME_TextEditor *editor, int cy) DECLSPEC_HIDDEN;
+void ME_ScrollLeft(ME_TextEditor *editor, int cx) DECLSPEC_HIDDEN;
+void ME_ScrollRight(ME_TextEditor *editor, int cx) DECLSPEC_HIDDEN;
+void ME_UpdateScrollBar(ME_TextEditor *editor) DECLSPEC_HIDDEN;
/* other functions in paint.c */
-int ME_GetParaBorderWidth(ME_Context *c, int flags);
+int ME_GetParaBorderWidth(const ME_Context *c, int flags) DECLSPEC_HIDDEN;
/* richole.c */
-LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *);
-void ME_DrawOLE(ME_Context *c, int x, int y, ME_Run* run, ME_Paragraph *para, BOOL selected);
-void ME_GetOLEObjectSize(ME_Context *c, ME_Run *run, SIZE *pSize);
-void ME_CopyReObject(REOBJECT* dst, const REOBJECT* src);
-void ME_DeleteReObject(REOBJECT* reo);
+LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *) DECLSPEC_HIDDEN;
+void ME_DrawOLE(ME_Context *c, int x, int y, ME_Run* run, ME_Paragraph *para, BOOL selected) DECLSPEC_HIDDEN;
+void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize) DECLSPEC_HIDDEN;
+void ME_CopyReObject(REOBJECT* dst, const REOBJECT* src) DECLSPEC_HIDDEN;
+void ME_DeleteReObject(REOBJECT* reo) DECLSPEC_HIDDEN;
/* editor.c */
-ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10);
+ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) DECLSPEC_HIDDEN;
LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
- LPARAM lParam, BOOL unicode, HRESULT* phresult);
-void ME_SendOldNotify(ME_TextEditor *editor, int nCode);
+ LPARAM lParam, BOOL unicode, HRESULT* phresult) DECLSPEC_HIDDEN;
+void ME_SendOldNotify(ME_TextEditor *editor, int nCode) DECLSPEC_HIDDEN;
int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen,
- const ME_Cursor *start, int srcChars, BOOL bCRLF);
-void ME_RTFCharAttrHook(struct _RTF_Info *info);
-void ME_RTFParAttrHook(struct _RTF_Info *info);
-void ME_RTFTblAttrHook(struct _RTF_Info *info);
-void ME_RTFSpecialCharHook(struct _RTF_Info *info);
-void ME_StreamInFill(ME_InStream *stream);
-extern int me_debug;
+ const ME_Cursor *start, int srcChars, BOOL bCRLF) DECLSPEC_HIDDEN;
+void ME_RTFCharAttrHook(struct _RTF_Info *info) DECLSPEC_HIDDEN;
+void ME_RTFParAttrHook(struct _RTF_Info *info) DECLSPEC_HIDDEN;
+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 int me_debug DECLSPEC_HIDDEN;
/* table.c */
-BOOL ME_IsInTable(ME_DisplayItem *pItem);
-ME_DisplayItem *ME_InsertTableRowStartFromCursor(ME_TextEditor *editor);
+BOOL ME_IsInTable(ME_DisplayItem *pItem) DECLSPEC_HIDDEN;
+ME_DisplayItem *ME_InsertTableRowStartFromCursor(ME_TextEditor *editor) DECLSPEC_HIDDEN;
ME_DisplayItem *ME_InsertTableRowStartAtParagraph(ME_TextEditor *editor,
- ME_DisplayItem *para);
-ME_DisplayItem *ME_InsertTableCellFromCursor(ME_TextEditor *editor);
-ME_DisplayItem *ME_InsertTableRowEndFromCursor(ME_TextEditor *editor);
-ME_DisplayItem *ME_GetTableRowEnd(ME_DisplayItem *para);
-ME_DisplayItem *ME_GetTableRowStart(ME_DisplayItem *para);
-void ME_CheckTablesForCorruption(ME_TextEditor *editor);
-void ME_ProtectPartialTableDeletion(ME_TextEditor *editor, ME_Cursor *c, int *nChars);
-ME_DisplayItem* ME_AppendTableRow(ME_TextEditor *editor, ME_DisplayItem *table_row);
-void ME_TabPressedInTable(ME_TextEditor *editor, BOOL bSelectedRow);
-void ME_MoveCursorFromTableRowStartParagraph(ME_TextEditor *editor);
-struct RTFTable *ME_MakeTableDef(ME_TextEditor *editor);
-void ME_InitTableDef(ME_TextEditor *editor, struct RTFTable *tableDef);
+ ME_DisplayItem *para) DECLSPEC_HIDDEN;
+ME_DisplayItem *ME_InsertTableCellFromCursor(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+ME_DisplayItem *ME_InsertTableRowEndFromCursor(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+ME_DisplayItem *ME_GetTableRowEnd(ME_DisplayItem *para) DECLSPEC_HIDDEN;
+ME_DisplayItem *ME_GetTableRowStart(ME_DisplayItem *para) DECLSPEC_HIDDEN;
+void ME_CheckTablesForCorruption(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_ProtectPartialTableDeletion(ME_TextEditor *editor, ME_Cursor *c, int *nChars) DECLSPEC_HIDDEN;
+ME_DisplayItem* ME_AppendTableRow(ME_TextEditor *editor, ME_DisplayItem *table_row) DECLSPEC_HIDDEN;
+void ME_TabPressedInTable(ME_TextEditor *editor, BOOL bSelectedRow) DECLSPEC_HIDDEN;
+void ME_MoveCursorFromTableRowStartParagraph(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+struct RTFTable *ME_MakeTableDef(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_InitTableDef(ME_TextEditor *editor, struct RTFTable *tableDef) DECLSPEC_HIDDEN;
/* txthost.c */
-ITextHost *ME_CreateTextHost(HWND hwnd, CREATESTRUCTW *cs, BOOL bEmulateVersion10);
+ITextHost *ME_CreateTextHost(HWND hwnd, CREATESTRUCTW *cs, BOOL bEmulateVersion10) DECLSPEC_HIDDEN;
#ifdef __i386__ /* Use wrappers to perform thiscall on i386 */
#define TXTHOST_VTABLE(This) (&itextHostStdcallVtbl)
#else /* __i386__ */
#define ITextHost_TxGetSelectionBarWidth(This,a) TXTHOST_VTABLE(This)->TxGetSelectionBarWidth(This,a)
/* undo.c */
-ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_DisplayItem *pdi);
-void ME_CommitUndo(ME_TextEditor *editor);
-void ME_ContinueCoalescingTransaction(ME_TextEditor *editor);
-void ME_CommitCoalescingUndo(ME_TextEditor *editor);
-BOOL ME_Undo(ME_TextEditor *editor);
-BOOL ME_Redo(ME_TextEditor *editor);
-void ME_EmptyUndoStack(ME_TextEditor *editor);
+ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_DisplayItem *pdi) DECLSPEC_HIDDEN;
+void ME_CommitUndo(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_ContinueCoalescingTransaction(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_CommitCoalescingUndo(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+BOOL ME_Undo(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+BOOL ME_Redo(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_EmptyUndoStack(ME_TextEditor *editor) DECLSPEC_HIDDEN;
/* writer.c */
-LRESULT ME_StreamOutRange(ME_TextEditor *editor, DWORD dwFormat, const ME_Cursor *start, int nChars, EDITSTREAM *stream);
-LRESULT ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream);
+LRESULT ME_StreamOutRange(ME_TextEditor *editor, DWORD dwFormat, const ME_Cursor *start, int nChars, EDITSTREAM *stream) DECLSPEC_HIDDEN;
+LRESULT ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream) DECLSPEC_HIDDEN;
/* clipboard.c */
-HRESULT ME_GetDataObject(ME_TextEditor *editor, const ME_Cursor *start, int nChars, LPDATAOBJECT *lplpdataobj);
+HRESULT ME_GetDataObject(ME_TextEditor *editor, const ME_Cursor *start, int nChars, LPDATAOBJECT *lplpdataobj) DECLSPEC_HIDDEN;
#define MERF_ENDWHITE 0x004000
/* run is completely made of whitespaces */
#define MERF_WHITESPACE 0x008000
-/* run is a last (dummy) run in the paragraph */
-#define MERF_SKIPPED 0x010000
-/* flags that are calculated during text wrapping */
-#define MERF_CALCBYWRAP 0x0F0000
/* the "end of paragraph" run, contains 1 character */
#define MERF_ENDPARA 0x100000
/* forcing the "end of row" run, contains 1 character */
ME_DisplayItem *pRowStart;
ME_DisplayItem *pLastSplittableRun;
- POINT ptLastSplittableRun;
} ME_WrapContext;
#endif
if (!bOnlyNew || (item->member.para.nFlags & MEPF_REPAINT))
{
- /* Draw the pargraph if any of the paragraph is in the update region. */
+ /* Draw the paragraph if any of the paragraph is in the update region. */
if (ys < rcUpdate->bottom && ye > rcUpdate->top)
{
ME_DrawParagraph(&c, item);
ME_UpdateScrollBar(editor);
FIXME("ME_Repaint had to call ME_WrapMarkedParagraphs\n");
}
- if (!editor->bEmulateVersion10 || (editor->nEventMask & ENM_UPDATE))
- ME_SendOldNotify(editor, EN_UPDATE);
ITextHost_TxViewChange(editor->texthost, TRUE);
}
-void ME_UpdateRepaint(ME_TextEditor *editor)
+void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now)
{
/* Should be called whenever the contents of the control have changed */
BOOL wrappedParagraphs;
/* Ensure that the cursor is visible */
ME_EnsureVisible(editor, &editor->pCursors[0]);
+ ITextHost_TxViewChange(editor->texthost, update_now);
+
ME_SendSelChange(editor);
/* send EN_CHANGE if the event mask asks for it */
ME_SendOldNotify(editor, EN_CHANGE);
editor->nEventMask |= ENM_CHANGE;
}
- ME_Repaint(editor);
}
void
ME_Repaint(editor);
}
-int ME_twips2pointsX(ME_Context *c, int x)
+int ME_twips2pointsX(const ME_Context *c, int x)
{
if (c->editor->nZoomNumerator == 0)
return x * c->dpi.cx / 1440;
return x * c->dpi.cx * c->editor->nZoomNumerator / 1440 / c->editor->nZoomDenominator;
}
-int ME_twips2pointsY(ME_Context *c, int y)
+int ME_twips2pointsY(const ME_Context *c, int y)
{
if (c->editor->nZoomNumerator == 0)
return y * c->dpi.cy / 1440;
/* Dark gray */ RGB(0x80, 0x80, 0x80), /* Light gray */ RGB(0xc0, 0xc0, 0xc0),
};
-static int ME_GetBorderPenWidth(ME_Context* c, int idx)
+static int ME_GetBorderPenWidth(const ME_Context* c, int idx)
{
int width = border_details[idx].width;
return width;
}
-int ME_GetParaBorderWidth(ME_Context* c, int flags)
+int ME_GetParaBorderWidth(const ME_Context* c, int flags)
{
int idx = (flags >> 8) & 0xF;
int width;
rc.left = c->pt.x + run->pt.x;
rc.right = rc.left + run->nWidth;
rc.top = c->pt.y + para->pt.y + run->pt.y;
- rc.bottom = rc.bottom + height;
+ rc.bottom = rc.top + height;
TRACE("rc = (%d, %d, %d, %d)\n", rc.left, rc.top, rc.right, rc.bottom);
- if (run->nFlags & MERF_SKIPPED)
- DrawFocusRect(c->hDC, &rc);
- else
- FrameRect(c->hDC, &rc, GetSysColorBrush(COLOR_GRAYTEXT));
+ FrameRect(c->hDC, &rc, GetSysColorBrush(COLOR_GRAYTEXT));
}
if (visible)
ME_DrawRun(c, c->pt.x + run->pt.x,
ME_HScrollAbs(editor, editor->horz_si.nPos + cx);
}
-/* Calculates the visiblity after a call to SetScrollRange or
+/* Calculates the visibility after a call to SetScrollRange or
* SetScrollInfo with SIF_RANGE. */
static BOOL ME_PostSetScrollRangeVisibility(SCROLLINFO *si)
{
/* we take for granted that PFE_xxx is the hiword of the corresponding PFM_xxx */
#define DUMP_EFFECT(mask, name) \
- p += sprintf(p, "%-22s%s\n", name, (pFmt->dwMask & (mask)) ? ((pFmt->wEffects & ((mask) >> 8)) ? "yes" : "no") : "N/A");
+ p += sprintf(p, "%-22s%s\n", name, (pFmt->dwMask & (mask)) ? ((pFmt->wEffects & ((mask) >> 16)) ? "yes" : "no") : "N/A");
DUMP(PFM_NUMBERING, "Numbering:", "%u", wNumbering);
DUMP_EFFECT(PFM_DONOTHYPHEN, "Disable auto-hyphen:");
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define OCR_REVERSE 32768
+#define OCR_REVERSE 107
/* there is no way to be consistent across different sets of headers - mingw, Wine, Win32 SDK*/
-/* FIXME: the next 6 lines should be in textserv.h */
#include "initguid.h"
-#define TEXTSERV_GUID(name, l, w1, w2, b1, b2) \
- DEFINE_GUID(name, l, w1, w2, b1, b2, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5)
-
-TEXTSERV_GUID(IID_ITextServices, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d);
-TEXTSERV_GUID(IID_ITextHost, 0xc5bdd8d0, 0xd26e, 0x11ce, 0xa8, 0x9e);
-TEXTSERV_GUID(IID_ITextHost2, 0xc5bdd8d0, 0xd26e, 0x11ce, 0xa8, 0x9e);
+DEFINE_GUID(IID_ITextServices, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5);
+DEFINE_GUID(IID_ITextHost, 0x13e670f4,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
+DEFINE_GUID(IID_ITextHost2, 0x13e670f5,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
DEFINE_GUID(IID_ITextDocument, 0x8cc497c0, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
DEFINE_GUID(IID_ITextRange, 0x8cc497c2, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
DEFINE_GUID(IID_ITextSelection, 0x8cc497c1, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
typedef struct IOleClientSiteImpl IOleClientSiteImpl;
typedef struct IRichEditOleImpl {
- const IRichEditOleVtbl *lpRichEditOleVtbl;
- const ITextDocumentVtbl *lpTextDocumentVtbl;
+ IRichEditOle IRichEditOle_iface;
+ ITextDocument ITextDocument_iface;
LONG ref;
ME_TextEditor *editor;
} IRichEditOleImpl;
struct ITextSelectionImpl {
- const ITextSelectionVtbl *lpVtbl;
+ ITextSelection ITextSelection_iface;
LONG ref;
IRichEditOleImpl *reOle;
};
struct IOleClientSiteImpl {
- const IOleClientSiteVtbl *lpVtbl;
+ IOleClientSite IOleClientSite_iface;
LONG ref;
IRichEditOleImpl *reOle;
static inline IRichEditOleImpl *impl_from_IRichEditOle(IRichEditOle *iface)
{
- return (IRichEditOleImpl *)((BYTE*)iface - FIELD_OFFSET(IRichEditOleImpl, lpRichEditOleVtbl));
+ return CONTAINING_RECORD(iface, IRichEditOleImpl, IRichEditOle_iface);
}
static inline IRichEditOleImpl *impl_from_ITextDocument(ITextDocument *iface)
{
- return (IRichEditOleImpl *)((BYTE*)iface - FIELD_OFFSET(IRichEditOleImpl, lpTextDocumentVtbl));
+ return CONTAINING_RECORD(iface, IRichEditOleImpl, ITextDocument_iface);
}
static HRESULT WINAPI
*ppvObj = NULL;
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IRichEditOle))
- *ppvObj = &This->lpRichEditOleVtbl;
+ *ppvObj = &This->IRichEditOle_iface;
else if (IsEqualGUID(riid, &IID_ITextDocument))
- *ppvObj = &This->lpTextDocumentVtbl;
+ *ppvObj = &This->ITextDocument_iface;
if (*ppvObj)
{
IRichEditOle_AddRef(me);
{
TRACE ("Destroying %p\n", This);
This->txtSel->reOle = NULL;
- ITextSelection_Release((ITextSelection *) This->txtSel);
- IOleClientSite_Release((IOleClientSite *) This->clientSite);
+ ITextSelection_Release(&This->txtSel->ITextSelection_iface);
+ IOleClientSite_Release(&This->clientSite->IOleClientSite_iface);
heap_free(This);
}
return ref;
return E_NOTIMPL;
}
+static inline IOleClientSiteImpl *impl_from_IOleClientSite(IOleClientSite *iface)
+{
+ return CONTAINING_RECORD(iface, IOleClientSiteImpl, IOleClientSite_iface);
+}
+
static HRESULT WINAPI
IOleClientSite_fnQueryInterface(IOleClientSite *me, REFIID riid, LPVOID *ppvObj)
{
return E_NOINTERFACE;
}
-static ULONG WINAPI
-IOleClientSite_fnAddRef(IOleClientSite *me)
+static ULONG WINAPI IOleClientSite_fnAddRef(IOleClientSite *iface)
{
- IOleClientSiteImpl *This = (IOleClientSiteImpl *) me;
+ IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
return InterlockedIncrement(&This->ref);
}
-static ULONG WINAPI
-IOleClientSite_fnRelease(IOleClientSite *me)
+static ULONG WINAPI IOleClientSite_fnRelease(IOleClientSite *iface)
{
- IOleClientSiteImpl *This = (IOleClientSiteImpl *) me;
+ IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
ULONG ref = InterlockedDecrement(&This->ref);
if (ref == 0)
heap_free(This);
return ref;
}
-static HRESULT WINAPI
-IOleClientSite_fnSaveObject(IOleClientSite *me)
+static HRESULT WINAPI IOleClientSite_fnSaveObject(IOleClientSite *iface)
{
- IOleClientSiteImpl *This = (IOleClientSiteImpl *) me;
+ IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("stub %p\n",me);
+ FIXME("stub %p\n", iface);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-IOleClientSite_fnGetMoniker(IOleClientSite *me, DWORD dwAssign, DWORD dwWhichMoniker,
- IMoniker **ppmk)
+static HRESULT WINAPI IOleClientSite_fnGetMoniker(IOleClientSite *iface, DWORD dwAssign,
+ DWORD dwWhichMoniker, IMoniker **ppmk)
{
- IOleClientSiteImpl *This = (IOleClientSiteImpl *) me;
+ IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("stub %p\n",me);
+ FIXME("stub %p\n", iface);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-IOleClientSite_fnGetContainer(IOleClientSite *me, IOleContainer **ppContainer)
+static HRESULT WINAPI IOleClientSite_fnGetContainer(IOleClientSite *iface,
+ IOleContainer **ppContainer)
{
- IOleClientSiteImpl *This = (IOleClientSiteImpl *) me;
+ IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("stub %p\n",me);
+ FIXME("stub %p\n", iface);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-IOleClientSite_fnShowObject(IOleClientSite *me)
+static HRESULT WINAPI IOleClientSite_fnShowObject(IOleClientSite *iface)
{
- IOleClientSiteImpl *This = (IOleClientSiteImpl *) me;
+ IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("stub %p\n",me);
+ FIXME("stub %p\n", iface);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-IOleClientSite_fnOnShowWindow(IOleClientSite *me, BOOL fShow)
+static HRESULT WINAPI IOleClientSite_fnOnShowWindow(IOleClientSite *iface, BOOL fShow)
{
- IOleClientSiteImpl *This = (IOleClientSiteImpl *) me;
+ IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("stub %p\n",me);
+ FIXME("stub %p\n", iface);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-IOleClientSite_fnRequestNewObjectLayout(IOleClientSite *me)
+static HRESULT WINAPI IOleClientSite_fnRequestNewObjectLayout(IOleClientSite *iface)
{
- IOleClientSiteImpl *This = (IOleClientSiteImpl *) me;
+ IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("stub %p\n",me);
+ FIXME("stub %p\n", iface);
return E_NOTIMPL;
}
if (!clientSite)
return NULL;
- clientSite->lpVtbl = &ocst;
+ clientSite->IOleClientSite_iface.lpVtbl = &ocst;
clientSite->ref = 1;
clientSite->reOle = reOle;
return clientSite;
if(!lplpolesite)
return E_INVALIDARG;
- *lplpolesite = (IOleClientSite *) This->clientSite;
+ *lplpolesite = &This->clientSite->IOleClientSite_iface;
IOleClientSite_fnAddRef(*lplpolesite);
return S_OK;
}
ME_InsertOLEFromCursor(This->editor, reo, 0);
ME_CommitUndo(This->editor);
- ME_UpdateRepaint(This->editor);
+ ME_UpdateRepaint(This->editor, FALSE);
return S_OK;
}
void** ppvObject)
{
IRichEditOleImpl *This = impl_from_ITextDocument(me);
- return IRichEditOle_fnQueryInterface((IRichEditOle*)&This->lpRichEditOleVtbl,
- riid, ppvObject);
+ return IRichEditOle_fnQueryInterface(&This->IRichEditOle_iface, riid, ppvObject);
}
static ULONG WINAPI
ITextDocument_fnAddRef(ITextDocument* me)
{
IRichEditOleImpl *This = impl_from_ITextDocument(me);
- return IRichEditOle_fnAddRef((IRichEditOle*)&This->lpRichEditOleVtbl);
+ return IRichEditOle_fnAddRef(&This->IRichEditOle_iface);
}
static ULONG WINAPI
ITextDocument_fnRelease(ITextDocument* me)
{
IRichEditOleImpl *This = impl_from_ITextDocument(me);
- return IRichEditOle_fnRelease((IRichEditOle*)&This->lpRichEditOleVtbl);
+ return IRichEditOle_fnRelease(&This->IRichEditOle_iface);
}
static HRESULT WINAPI
{
IRichEditOleImpl *This = impl_from_ITextDocument(me);
TRACE("(%p)\n", me);
- *ppSel = (ITextSelection *) This->txtSel;
+ *ppSel = &This->txtSel->ITextSelection_iface;
ITextSelection_AddRef(*ppSel);
return S_OK;
}
ITextDocument_fnRangeFromPoint
};
+static inline ITextSelectionImpl *impl_from_ITextSelection(ITextSelection *iface)
+{
+ return CONTAINING_RECORD(iface, ITextSelectionImpl, ITextSelection_iface);
+}
+
static HRESULT WINAPI ITextSelection_fnQueryInterface(
ITextSelection *me,
REFIID riid,
return E_NOINTERFACE;
}
-static ULONG WINAPI ITextSelection_fnAddRef(
- ITextSelection *me)
+static ULONG WINAPI ITextSelection_fnAddRef(ITextSelection *me)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
return InterlockedIncrement(&This->ref);
}
-static ULONG WINAPI ITextSelection_fnRelease(
- ITextSelection *me)
+static ULONG WINAPI ITextSelection_fnRelease(ITextSelection *me)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
ULONG ref = InterlockedDecrement(&This->ref);
if (ref == 0)
heap_free(This);
return ref;
}
-static HRESULT WINAPI ITextSelection_fnGetTypeInfoCount(
- ITextSelection *me,
- UINT *pctinfo)
+static HRESULT WINAPI ITextSelection_fnGetTypeInfoCount(ITextSelection *me, UINT *pctinfo)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetTypeInfo(
- ITextSelection *me,
- UINT iTInfo,
- LCID lcid,
+static HRESULT WINAPI ITextSelection_fnGetTypeInfo(ITextSelection *me, UINT iTInfo, LCID lcid,
ITypeInfo **ppTInfo)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetIDsOfNames(
- ITextSelection *me,
- REFIID riid,
- LPOLESTR *rgszNames,
- UINT cNames,
- LCID lcid,
- DISPID *rgDispId)
+static HRESULT WINAPI ITextSelection_fnGetIDsOfNames(ITextSelection *me, REFIID riid,
+ LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
}
/*** ITextRange methods ***/
-static HRESULT WINAPI ITextSelection_fnGetText(
- ITextSelection *me,
- BSTR *pbstr)
+static HRESULT WINAPI ITextSelection_fnGetText(ITextSelection *me, BSTR *pbstr)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnSetText(
- ITextSelection *me,
- BSTR bstr)
+static HRESULT WINAPI ITextSelection_fnSetText(ITextSelection *me, BSTR bstr)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetChar(
- ITextSelection *me,
- LONG *pch)
+static HRESULT WINAPI ITextSelection_fnGetChar(ITextSelection *me, LONG *pch)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnSetChar(
- ITextSelection *me,
- LONG ch)
+static HRESULT WINAPI ITextSelection_fnSetChar(ITextSelection *me, LONG ch)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetDuplicate(
- ITextSelection *me,
- ITextRange **ppRange)
+static HRESULT WINAPI ITextSelection_fnGetDuplicate(ITextSelection *me, ITextRange **ppRange)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetFormattedText(
- ITextSelection *me,
- ITextRange **ppRange)
+static HRESULT WINAPI ITextSelection_fnGetFormattedText(ITextSelection *me, ITextRange **ppRange)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnSetFormattedText(
- ITextSelection *me,
- ITextRange *pRange)
+static HRESULT WINAPI ITextSelection_fnSetFormattedText(ITextSelection *me, ITextRange *pRange)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetStart(
- ITextSelection *me,
- LONG *pcpFirst)
+static HRESULT WINAPI ITextSelection_fnGetStart(ITextSelection *me, LONG *pcpFirst)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnSetStart(
- ITextSelection *me,
- LONG cpFirst)
+static HRESULT WINAPI ITextSelection_fnSetStart(ITextSelection *me, LONG cpFirst)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetEnd(
- ITextSelection *me,
- LONG *pcpLim)
+static HRESULT WINAPI ITextSelection_fnGetEnd(ITextSelection *me, LONG *pcpLim)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnSetEnd(
- ITextSelection *me,
- LONG cpLim)
+static HRESULT WINAPI ITextSelection_fnSetEnd(ITextSelection *me, LONG cpLim)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetFont(
- ITextSelection *me,
- ITextFont **pFont)
+static HRESULT WINAPI ITextSelection_fnGetFont(ITextSelection *me, ITextFont **pFont)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnSetFont(
- ITextSelection *me,
- ITextFont *pFont)
+static HRESULT WINAPI ITextSelection_fnSetFont(ITextSelection *me, ITextFont *pFont)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetPara(
- ITextSelection *me,
- ITextPara **ppPara)
+static HRESULT WINAPI ITextSelection_fnGetPara(ITextSelection *me, ITextPara **ppPara)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnSetPara(
- ITextSelection *me,
- ITextPara *pPara)
+static HRESULT WINAPI ITextSelection_fnSetPara(ITextSelection *me, ITextPara *pPara)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetStoryLength(
- ITextSelection *me,
- LONG *pcch)
+static HRESULT WINAPI ITextSelection_fnGetStoryLength(ITextSelection *me, LONG *pcch)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetStoryType(
- ITextSelection *me,
- LONG *pValue)
+static HRESULT WINAPI ITextSelection_fnGetStoryType(ITextSelection *me, LONG *pValue)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnCollapse(
- ITextSelection *me,
- LONG bStart)
+static HRESULT WINAPI ITextSelection_fnCollapse(ITextSelection *me, LONG bStart)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnExpand(
- ITextSelection *me,
- LONG Unit,
- LONG *pDelta)
+static HRESULT WINAPI ITextSelection_fnExpand(ITextSelection *me, LONG Unit, LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetIndex(
- ITextSelection *me,
- LONG Unit,
- LONG *pIndex)
+static HRESULT WINAPI ITextSelection_fnGetIndex(ITextSelection *me, LONG Unit, LONG *pIndex)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnSetIndex(
- ITextSelection *me,
- LONG Unit,
- LONG Index,
+static HRESULT WINAPI ITextSelection_fnSetIndex(ITextSelection *me, LONG Unit, LONG Index,
LONG Extend)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnSetRange(
- ITextSelection *me,
- LONG cpActive,
- LONG cpOther)
+static HRESULT WINAPI ITextSelection_fnSetRange(ITextSelection *me, LONG cpActive, LONG cpOther)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnInRange(
- ITextSelection *me,
- ITextRange *pRange,
- LONG *pb)
+static HRESULT WINAPI ITextSelection_fnInRange(ITextSelection *me, ITextRange *pRange, LONG *pb)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnInStory(
- ITextSelection *me,
- ITextRange *pRange,
- LONG *pb)
+static HRESULT WINAPI ITextSelection_fnInStory(ITextSelection *me, ITextRange *pRange, LONG *pb)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnIsEqual(
- ITextSelection *me,
- ITextRange *pRange,
- LONG *pb)
+static HRESULT WINAPI ITextSelection_fnIsEqual(ITextSelection *me, ITextRange *pRange, LONG *pb)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnSelect(
- ITextSelection *me)
+static HRESULT WINAPI ITextSelection_fnSelect(ITextSelection *me)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnStartOf(
- ITextSelection *me,
- LONG Unit,
- LONG Extend,
+static HRESULT WINAPI ITextSelection_fnStartOf(ITextSelection *me, LONG Unit, LONG Extend,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnEndOf(
- ITextSelection *me,
- LONG Unit,
- LONG Extend,
+static HRESULT WINAPI ITextSelection_fnEndOf(ITextSelection *me, LONG Unit, LONG Extend,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMove(
- ITextSelection *me,
- LONG Unit,
- LONG Count,
- LONG *pDelta)
+static HRESULT WINAPI ITextSelection_fnMove(ITextSelection *me, LONG Unit, LONG Count, LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMoveStart(
- ITextSelection *me,
- LONG Unit,
- LONG Count,
+static HRESULT WINAPI ITextSelection_fnMoveStart(ITextSelection *me, LONG Unit, LONG Count,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMoveEnd(
- ITextSelection *me,
- LONG Unit,
- LONG Count,
+static HRESULT WINAPI ITextSelection_fnMoveEnd(ITextSelection *me, LONG Unit, LONG Count,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMoveWhile(
- ITextSelection *me,
- VARIANT *Cset,
- LONG Count,
+static HRESULT WINAPI ITextSelection_fnMoveWhile(ITextSelection *me, VARIANT *Cset, LONG Count,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMoveStartWhile(
- ITextSelection *me,
- VARIANT *Cset,
- LONG Count,
+static HRESULT WINAPI ITextSelection_fnMoveStartWhile(ITextSelection *me, VARIANT *Cset, LONG Count,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMoveEndWhile(
- ITextSelection *me,
- VARIANT *Cset,
- LONG Count,
+static HRESULT WINAPI ITextSelection_fnMoveEndWhile(ITextSelection *me, VARIANT *Cset, LONG Count,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMoveUntil(
- ITextSelection *me,
- VARIANT *Cset,
- LONG Count,
+static HRESULT WINAPI ITextSelection_fnMoveUntil(ITextSelection *me, VARIANT *Cset, LONG Count,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMoveStartUntil(
- ITextSelection *me,
- VARIANT *Cset,
- LONG Count,
+static HRESULT WINAPI ITextSelection_fnMoveStartUntil(ITextSelection *me, VARIANT *Cset, LONG Count,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMoveEndUntil(
- ITextSelection *me,
- VARIANT *Cset,
- LONG Count,
+static HRESULT WINAPI ITextSelection_fnMoveEndUntil(ITextSelection *me, VARIANT *Cset, LONG Count,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnFindText(
- ITextSelection *me,
- BSTR bstr,
- LONG cch,
- LONG Flags,
+static HRESULT WINAPI ITextSelection_fnFindText(ITextSelection *me, BSTR bstr, LONG cch, LONG Flags,
LONG *pLength)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnFindTextStart(
- ITextSelection *me,
- BSTR bstr,
- LONG cch,
- LONG Flags,
- LONG *pLength)
+static HRESULT WINAPI ITextSelection_fnFindTextStart(ITextSelection *me, BSTR bstr, LONG cch,
+ LONG Flags, LONG *pLength)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnFindTextEnd(
- ITextSelection *me,
- BSTR bstr,
- LONG cch,
- LONG Flags,
- LONG *pLength)
+static HRESULT WINAPI ITextSelection_fnFindTextEnd(ITextSelection *me, BSTR bstr, LONG cch,
+ LONG Flags, LONG *pLength)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnDelete(
- ITextSelection *me,
- LONG Unit,
- LONG Count,
+static HRESULT WINAPI ITextSelection_fnDelete(ITextSelection *me, LONG Unit, LONG Count,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnCut(
- ITextSelection *me,
- VARIANT *pVar)
+static HRESULT WINAPI ITextSelection_fnCut(ITextSelection *me, VARIANT *pVar)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnCopy(
- ITextSelection *me,
- VARIANT *pVar)
+static HRESULT WINAPI ITextSelection_fnCopy(ITextSelection *me, VARIANT *pVar)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnPaste(
- ITextSelection *me,
- VARIANT *pVar,
- LONG Format)
+static HRESULT WINAPI ITextSelection_fnPaste(ITextSelection *me, VARIANT *pVar, LONG Format)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnCanPaste(
- ITextSelection *me,
- VARIANT *pVar,
- LONG Format,
+static HRESULT WINAPI ITextSelection_fnCanPaste(ITextSelection *me, VARIANT *pVar, LONG Format,
LONG *pb)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnCanEdit(
- ITextSelection *me,
- LONG *pb)
+static HRESULT WINAPI ITextSelection_fnCanEdit(ITextSelection *me, LONG *pb)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnChangeCase(
- ITextSelection *me,
- LONG Type)
+static HRESULT WINAPI ITextSelection_fnChangeCase(ITextSelection *me, LONG Type)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetPoint(
- ITextSelection *me,
- LONG Type,
- LONG *cx,
- LONG *cy)
+static HRESULT WINAPI ITextSelection_fnGetPoint(ITextSelection *me, LONG Type, LONG *cx, LONG *cy)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnSetPoint(
- ITextSelection *me,
- LONG x,
- LONG y,
- LONG Type,
+static HRESULT WINAPI ITextSelection_fnSetPoint(ITextSelection *me, LONG x, LONG y, LONG Type,
LONG Extend)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnScrollIntoView(
- ITextSelection *me,
- LONG Value)
+static HRESULT WINAPI ITextSelection_fnScrollIntoView(ITextSelection *me, LONG Value)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetEmbeddedObject(
- ITextSelection *me,
- IUnknown **ppv)
+static HRESULT WINAPI ITextSelection_fnGetEmbeddedObject(ITextSelection *me, IUnknown **ppv)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
}
/*** ITextSelection methods ***/
-static HRESULT WINAPI ITextSelection_fnGetFlags(
- ITextSelection *me,
- LONG *pFlags)
+static HRESULT WINAPI ITextSelection_fnGetFlags(ITextSelection *me, LONG *pFlags)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnSetFlags(
- ITextSelection *me,
- LONG Flags)
+static HRESULT WINAPI ITextSelection_fnSetFlags(ITextSelection *me, LONG Flags)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnGetType(
- ITextSelection *me,
- LONG *pType)
+static HRESULT WINAPI ITextSelection_fnGetType(ITextSelection *me, LONG *pType)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMoveLeft(
- ITextSelection *me,
- LONG Unit,
- LONG Count,
- LONG Extend,
- LONG *pDelta)
+static HRESULT WINAPI ITextSelection_fnMoveLeft(ITextSelection *me, LONG Unit, LONG Count,
+ LONG Extend, LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMoveRight(
- ITextSelection *me,
- LONG Unit,
- LONG Count,
- LONG Extend,
- LONG *pDelta)
+static HRESULT WINAPI ITextSelection_fnMoveRight(ITextSelection *me, LONG Unit, LONG Count,
+ LONG Extend, LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMoveUp(
- ITextSelection *me,
- LONG Unit,
- LONG Count,
- LONG Extend,
- LONG *pDelta)
+static HRESULT WINAPI ITextSelection_fnMoveUp(ITextSelection *me, LONG Unit, LONG Count,
+ LONG Extend, LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnMoveDown(
- ITextSelection *me,
- LONG Unit,
- LONG Count,
- LONG Extend,
- LONG *pDelta)
+static HRESULT WINAPI ITextSelection_fnMoveDown(ITextSelection *me, LONG Unit, LONG Count,
+ LONG Extend, LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnHomeKey(
- ITextSelection *me,
- LONG Unit,
- LONG Extend,
+static HRESULT WINAPI ITextSelection_fnHomeKey(ITextSelection *me, LONG Unit, LONG Extend,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnEndKey(
- ITextSelection *me,
- LONG Unit,
- LONG Extend,
+static HRESULT WINAPI ITextSelection_fnEndKey(ITextSelection *me, LONG Unit, LONG Extend,
LONG *pDelta)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
return E_NOTIMPL;
}
-static HRESULT WINAPI ITextSelection_fnTypeText(
- ITextSelection *me,
- BSTR bstr)
+static HRESULT WINAPI ITextSelection_fnTypeText(ITextSelection *me, BSTR bstr)
{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
+ ITextSelectionImpl *This = impl_from_ITextSelection(me);
if (!This->reOle)
return CO_E_RELEASED;
if (!txtSel)
return NULL;
- txtSel->lpVtbl = &tsvt;
+ txtSel->ITextSelection_iface.lpVtbl = &tsvt;
txtSel->ref = 1;
txtSel->reOle = reOle;
return txtSel;
if (!reo)
return 0;
- reo->lpRichEditOleVtbl = &revt;
- reo->lpTextDocumentVtbl = &tdvt;
+ reo->IRichEditOle_iface.lpVtbl = &revt;
+ reo->ITextDocument_iface.lpVtbl = &tdvt;
reo->ref = 1;
reo->editor = editor;
reo->txtSel = CreateTextSelection(reo);
reo->clientSite = CreateOleClientSite(reo);
if (!reo->txtSel)
{
- ITextSelection_Release((ITextSelection *) reo->txtSel);
+ ITextSelection_Release(&reo->txtSel->ITextSelection_iface);
heap_free(reo);
return 0;
}
return 1;
}
-static void convert_sizel(ME_Context *c, const SIZEL* szl, SIZE* sz)
+static void convert_sizel(const ME_Context *c, const SIZEL* szl, SIZE* sz)
{
/* sizel is in .01 millimeters, sz in pixels */
sz->cx = MulDiv(szl->cx, c->dpi.cx, 2540);
*
* Sets run extent for OLE objects.
*/
-void ME_GetOLEObjectSize(ME_Context *c, ME_Run *run, SIZE *pSize)
+void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize)
{
IDataObject* ido;
FORMATETC fmt;
* Public RTF reader routines
*/
-void RTFInit (RTF_Info *);
-void RTFDestroy(RTF_Info *info);
-void RTFSetDestinationCallback (RTF_Info *, int, RTFFuncPtr);
-void RTFRead (RTF_Info *);
-int RTFGetToken (RTF_Info *); /* writer should rarely need this */
-void RTFSetReadHook (RTF_Info *, RTFFuncPtr);
-void RTFRouteToken (RTF_Info *);
-void RTFSkipGroup (RTF_Info *);
-void RTFReadGroup (RTF_Info *);
-int RTFCheckCM (const RTF_Info *, int, int);
-int RTFCheckCMM (const RTF_Info *, int, int, int);
-int RTFCheckMM (const RTF_Info *, int, int);
-RTFFont *RTFGetFont (const RTF_Info *, int);
-RTFColor *RTFGetColor (const RTF_Info *, int);
-int RTFCharToHex ( char);
-
-void RTFFlushOutputBuffer( RTF_Info *info );
-void RTFSetEditStream(RTF_Info *info, ME_InStream *stream);
-
-void WriterInit (RTF_Info *);
-int BeginFile (RTF_Info *);
-
-int RTFCharSetToCodePage(RTF_Info *info, int charset);
-
-void LookupInit (void);
-void LookupCleanup (void);
+void RTFInit (RTF_Info *) DECLSPEC_HIDDEN;
+void RTFDestroy(RTF_Info *info) DECLSPEC_HIDDEN;
+void RTFSetDestinationCallback (RTF_Info *, int, RTFFuncPtr) DECLSPEC_HIDDEN;
+void RTFRead (RTF_Info *) DECLSPEC_HIDDEN;
+int RTFGetToken (RTF_Info *) DECLSPEC_HIDDEN; /* writer should rarely need this */
+void RTFSetReadHook (RTF_Info *, RTFFuncPtr) DECLSPEC_HIDDEN;
+void RTFRouteToken (RTF_Info *) DECLSPEC_HIDDEN;
+void RTFSkipGroup (RTF_Info *) DECLSPEC_HIDDEN;
+void RTFReadGroup (RTF_Info *) DECLSPEC_HIDDEN;
+int RTFCheckCM (const RTF_Info *, int, int) DECLSPEC_HIDDEN;
+int RTFCheckCMM (const RTF_Info *, int, int, int) DECLSPEC_HIDDEN;
+int RTFCheckMM (const RTF_Info *, int, int) DECLSPEC_HIDDEN;
+RTFFont *RTFGetFont (const RTF_Info *, int) DECLSPEC_HIDDEN;
+RTFColor *RTFGetColor (const RTF_Info *, int) DECLSPEC_HIDDEN;
+int RTFCharToHex ( char) DECLSPEC_HIDDEN;
+
+void RTFFlushOutputBuffer( RTF_Info *info ) DECLSPEC_HIDDEN;
+void RTFSetEditStream(RTF_Info *info, ME_InStream *stream) DECLSPEC_HIDDEN;
+
+void WriterInit (RTF_Info *) DECLSPEC_HIDDEN;
+int BeginFile (RTF_Info *) DECLSPEC_HIDDEN;
+
+int RTFCharSetToCodePage(RTF_Info *info, int charset) DECLSPEC_HIDDEN;
+
+void LookupInit (void) DECLSPEC_HIDDEN;
+void LookupCleanup (void) DECLSPEC_HIDDEN;
#endif
ME_DisplayItem *ME_SplitRun(ME_WrapContext *wc, ME_DisplayItem *item, int nVChar)
{
ME_TextEditor *editor = wc->context->editor;
- ME_DisplayItem *item2 = NULL;
ME_Run *run, *run2;
- ME_Paragraph *para = &ME_GetParagraph(item)->member.para;
+ ME_Paragraph *para = &wc->pPara->member.para;
+ ME_Cursor cursor = {wc->pPara, item, nVChar};
assert(item->member.run.nCharOfs != -1);
if(TRACE_ON(richedit))
TRACE("Before split: %s(%d, %d)\n", debugstr_w(run->strText->szData),
run->pt.x, run->pt.y);
- item2 = ME_SplitRunSimple(editor, item, nVChar);
+ ME_SplitRunSimple(editor, &cursor);
- run2 = &item2->member.run;
+ run2 = &cursor.pRun->member.run;
ME_CalcRunExtent(wc->context, para, wc->nRow ? wc->nLeftMargin : wc->nFirstMargin, run);
- ME_CalcRunExtent(wc->context, para, wc->nRow ? wc->nLeftMargin : wc->nFirstMargin, run2);
run2->pt.x = run->pt.x+run->nWidth;
run2->pt.y = run->pt.y;
debugstr_w(run2->strText->szData), run2->pt.x, run2->pt.y);
}
- return item2;
+ return cursor.pRun;
}
/******************************************************************************
* ME_SplitRunSimple
- *
+ *
* Does the most basic job of splitting a run into two - it does not
- * update the positions and extents.
- */
-ME_DisplayItem *ME_SplitRunSimple(ME_TextEditor *editor, ME_DisplayItem *item, int nVChar)
+ * update the positions and extents.
+ */
+ME_DisplayItem *ME_SplitRunSimple(ME_TextEditor *editor, ME_Cursor *cursor)
{
- ME_Run *run = &item->member.run;
- ME_DisplayItem *item2;
- ME_Run *run2;
+ ME_DisplayItem *run = cursor->pRun;
+ ME_DisplayItem *new_run;
int i;
- assert(nVChar > 0 && nVChar < run->strText->nLen);
- assert(item->type == diRun);
- assert(!(item->member.run.nFlags & MERF_NONTEXT));
- assert(item->member.run.nCharOfs != -1);
+ int nOffset = cursor->nOffset;
- item2 = ME_MakeRun(run->style,
- ME_VSplitString(run->strText, nVChar), run->nFlags&MERF_SPLITMASK);
+ assert(!(run->member.run.nFlags & MERF_NONTEXT));
- item2->member.run.nCharOfs = item->member.run.nCharOfs + nVChar;
+ new_run = ME_MakeRun(run->member.run.style,
+ ME_VSplitString(run->member.run.strText, nOffset),
+ run->member.run.nFlags & MERF_SPLITMASK);
- run2 = &item2->member.run;
- ME_InsertBefore(item->next, item2);
+ new_run->member.run.nCharOfs = run->member.run.nCharOfs + nOffset;
+ cursor->pRun = new_run;
+ cursor->nOffset = 0;
- ME_UpdateRunFlags(editor, run);
- ME_UpdateRunFlags(editor, run2);
- for (i=0; i<editor->nCursors; i++) {
- if (editor->pCursors[i].pRun == item &&
- editor->pCursors[i].nOffset >= nVChar) {
- assert(item2->type == diRun);
- editor->pCursors[i].pRun = item2;
- editor->pCursors[i].nOffset -= nVChar;
+ ME_InsertBefore(run->next, new_run);
+
+ ME_UpdateRunFlags(editor, &run->member.run);
+ ME_UpdateRunFlags(editor, &new_run->member.run);
+ for (i = 0; i < editor->nCursors; i++) {
+ if (editor->pCursors[i].pRun == run &&
+ editor->pCursors[i].nOffset >= nOffset) {
+ editor->pCursors[i].pRun = new_run;
+ editor->pCursors[i].nOffset -= nOffset;
}
}
- ME_GetParagraph(item)->member.para.nFlags |= MEPF_REWRAP;
- return item2;
+ cursor->pPara->member.para.nFlags |= MEPF_REWRAP;
+ return run;
}
/******************************************************************************
ME_DisplayItem *pDI;
ME_UndoItem *pUI;
- if (cursor->nOffset) {
- /* We're inserting at the middle of the existing run, which means that
- * that run must be split. It isn't always necessary, but */
- cursor->pRun = ME_SplitRunSimple(editor, cursor->pRun, cursor->nOffset);
- cursor->nOffset = 0;
- }
+ if (cursor->nOffset)
+ ME_SplitRunSimple(editor, cursor);
pUI = ME_AddUndoItem(editor, diUndoDeleteRun, NULL);
if (pUI) {
{
/* SplitRunSimple may or may not update the cursors, depending on whether they
* are selection cursors, but we need to make sure they are valid. */
- ME_DisplayItem *split_run = start->pRun;
int split_offset = start->nOffset;
- start->pRun = ME_SplitRunSimple(editor, split_run, split_offset);
- start->nOffset = 0;
+ ME_DisplayItem *split_run = ME_SplitRunSimple(editor, start);
if (end && end->pRun == split_run)
{
end->pRun = start->pRun;
}
if (end && end->nOffset)
- {
- end_run = end->pRun = ME_SplitRunSimple(editor, end->pRun, end->nOffset);
- end->nOffset = 0;
- } else if (end) {
- end_run = end->pRun;
- }
+ ME_SplitRunSimple(editor, end);
+ end_run = end ? end->pRun : NULL;
run = start->pRun;
para = start->pPara;
do {
/* FIXME add more style feature comparisons */
- int nAttribs = CFM_SIZE | CFM_FACE | CFM_COLOR | CFM_UNDERLINETYPE;
- int nEffects = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT | CFM_PROTECTED | CFM_LINK | CFM_SUPERSCRIPT;
+ DWORD dwAttribs = CFM_SIZE | CFM_FACE | CFM_COLOR | CFM_UNDERLINETYPE;
+ DWORD dwEffects = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT | CFM_PROTECTED | CFM_LINK | CFM_SUPERSCRIPT;
run = ME_FindItemFwd(run, diRun);
tmp.cbSize = sizeof(tmp);
ME_GetRunCharFormat(editor, run, &tmp);
- assert((tmp.dwMask & nAttribs) == nAttribs);
+ assert((tmp.dwMask & dwAttribs) == dwAttribs);
/* reset flags that differ */
if (pFmt->yHeight != tmp.yHeight)
}
}
- pFmt->dwMask &= ~((pFmt->dwEffects ^ tmp.dwEffects) & nEffects);
+ pFmt->dwMask &= ~((pFmt->dwEffects ^ tmp.dwEffects) & dwEffects);
pFmt->dwEffects = tmp.dwEffects;
} while(run != run_end);
CopyMemory(to, from, to->cbSize);
}
-ME_Style *ME_MakeStyle(CHARFORMAT2W *style) {
- CHARFORMAT2W styledata;
+ME_Style *ME_MakeStyle(CHARFORMAT2W *style)
+{
ME_Style *s = ALLOC_OBJ(ME_Style);
-
- style = ME_ToCF2W(&styledata, style);
- memset(s, 0, sizeof(ME_Style));
- if (style->cbSize <= sizeof(CHARFORMAT2W))
- CopyMemory(&s->fmt, style, style->cbSize);
- else
- s->fmt = *style;
- s->fmt.cbSize = sizeof(CHARFORMAT2W);
+ assert(style->cbSize == sizeof(CHARFORMAT2W));
+ s->fmt = *style;
s->nSequence = -2;
s->nRefs = 1;
s->hFont = NULL;
+ memset(&s->tm, 0, sizeof(s->tm));
s->tm.tmAscent = -1;
all_refs++;
TRACE_(richedit_style)("ME_MakeStyle %p, total refs=%d\n", s, all_refs);
s->fmt.dwMask |= mask;\
CopyMemory(s->fmt.member, style->member, sizeof(style->member));\
}
-
+
void ME_InitCharFormat2W(CHARFORMAT2W *pFmt)
{
ZeroMemory(pFmt, sizeof(CHARFORMAT2W));
ME_Style *ME_ApplyStyle(ME_Style *sSrc, CHARFORMAT2W *style)
{
- CHARFORMAT2W styledata;
ME_Style *s = ME_MakeStyle(&sSrc->fmt);
- style = ME_ToCF2W(&styledata, style);
+ assert(style->cbSize == sizeof(CHARFORMAT2W));
COPY_STYLE_ITEM(CFM_ANIMATION, bAnimation);
COPY_STYLE_ITEM(CFM_BACKCOLOR, crBackColor);
COPY_STYLE_ITEM(CFM_CHARSET, bCharSet);
ME_Style *pStyle = ME_GetInsertStyle(editor, nCursor);
ME_DisplayItem *tp;
ME_Cursor* cursor = &editor->pCursors[nCursor];
- if (cursor->nOffset) {
- ME_SplitRunSimple(editor, cursor->pRun, cursor->nOffset);
- cursor = &editor->pCursors[nCursor];
- }
+ if (cursor->nOffset)
+ ME_SplitRunSimple(editor, cursor);
tp = ME_SplitParagraph(editor, cursor->pRun, pStyle, eol_str, paraFlags);
ME_ReleaseStyle(pStyle);
{
assert(!(p->member.para.nFlags & (MEPF_ROWSTART|MEPF_ROWEND|MEPF_CELL)));
assert(p->member.para.pFmt->dwMask & PFM_TABLE);
- assert(!(p->member.para.pFmt->wEffects & PFM_TABLEROWDELIMITER));
+ assert(!(p->member.para.pFmt->wEffects & PFE_TABLEROWDELIMITER));
assert(!p->member.para.pCell);
p = p->member.para.next_para;
}
WINE_DEFAULT_DEBUG_CHANNEL(richedit);
typedef struct ITextHostImpl {
- const ITextHostVtbl *lpVtbl;
+ ITextHost ITextHost_iface;
LONG ref;
HWND hWnd;
BOOL bEmulateVersion10;
{
ME_TextEditor *editor;
- texthost->lpVtbl = &textHostVtbl;
+ texthost->ITextHost_iface.lpVtbl = &textHostVtbl;
texthost->ref = 1;
texthost->hWnd = hwnd;
texthost->bEmulateVersion10 = bEmulateVersion10;
- editor = ME_MakeEditor((ITextHost*)texthost, bEmulateVersion10);
+ editor = ME_MakeEditor(&texthost->ITextHost_iface, bEmulateVersion10);
editor->exStyleFlags = GetWindowLongW(hwnd, GWL_EXSTYLE);
editor->styleFlags |= GetWindowLongW(hwnd, GWL_STYLE) & ES_WANTRETURN;
editor->hWnd = hwnd; /* FIXME: Remove editor's dependence on hWnd */
SetWindowLongPtrW(hwnd, 0, (LONG_PTR)editor);
}
- return (ITextHost*)texthost;
+ return &texthost->ITextHost_iface;
}
-static HRESULT WINAPI ITextHostImpl_QueryInterface(ITextHost *iface,
- REFIID riid,
- LPVOID *ppvObject)
+static inline ITextHostImpl *impl_from_ITextHost(ITextHost *iface)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ return CONTAINING_RECORD(iface, ITextHostImpl, ITextHost_iface);
+}
+
+static HRESULT WINAPI ITextHostImpl_QueryInterface(ITextHost *iface, REFIID riid, void **ppvObject)
+{
+ ITextHostImpl *This = impl_from_ITextHost(iface);
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextHost)) {
*ppvObject = This;
static ULONG WINAPI ITextHostImpl_AddRef(ITextHost *iface)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
ULONG ref = InterlockedIncrement(&This->ref);
return ref;
}
static ULONG WINAPI ITextHostImpl_Release(ITextHost *iface)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
ULONG ref = InterlockedDecrement(&This->ref);
if (!ref)
return ref;
}
-HDC WINAPI ITextHostImpl_TxGetDC(ITextHost *iface)
+DECLSPEC_HIDDEN HDC WINAPI ITextHostImpl_TxGetDC(ITextHost *iface)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
return GetDC(This->hWnd);
}
-INT WINAPI ITextHostImpl_TxReleaseDC(ITextHost *iface,
- HDC hdc)
+DECLSPEC_HIDDEN INT WINAPI ITextHostImpl_TxReleaseDC(ITextHost *iface, HDC hdc)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
return ReleaseDC(This->hWnd, hdc);
}
-BOOL WINAPI ITextHostImpl_TxShowScrollBar(ITextHost *iface,
- INT fnBar,
- BOOL fShow)
+DECLSPEC_HIDDEN BOOL WINAPI ITextHostImpl_TxShowScrollBar(ITextHost *iface, INT fnBar, BOOL fShow)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
return ShowScrollBar(This->hWnd, fnBar, fShow);
}
-BOOL WINAPI ITextHostImpl_TxEnableScrollBar(ITextHost *iface,
- INT fuSBFlags,
- INT fuArrowflags)
+DECLSPEC_HIDDEN BOOL WINAPI ITextHostImpl_TxEnableScrollBar(ITextHost *iface, INT fuSBFlags, INT fuArrowflags)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
return EnableScrollBar(This->hWnd, fuSBFlags, fuArrowflags);
}
-BOOL WINAPI ITextHostImpl_TxSetScrollRange(ITextHost *iface,
- INT fnBar,
- LONG nMinPos,
- INT nMaxPos,
+DECLSPEC_HIDDEN BOOL WINAPI ITextHostImpl_TxSetScrollRange(ITextHost *iface, INT fnBar, LONG nMinPos, INT nMaxPos,
BOOL fRedraw)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
return SetScrollRange(This->hWnd, fnBar, nMinPos, nMaxPos, fRedraw);
}
-BOOL WINAPI ITextHostImpl_TxSetScrollPos(ITextHost *iface,
- INT fnBar,
- INT nPos,
- BOOL fRedraw)
+DECLSPEC_HIDDEN BOOL WINAPI ITextHostImpl_TxSetScrollPos(ITextHost *iface, INT fnBar, INT nPos, BOOL fRedraw)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
int pos = SetScrollPos(This->hWnd, fnBar, nPos, fRedraw);
return (pos ? TRUE : FALSE);
}
-void WINAPI ITextHostImpl_TxInvalidateRect(ITextHost *iface,
- LPCRECT prc,
- BOOL fMode)
+DECLSPEC_HIDDEN void WINAPI ITextHostImpl_TxInvalidateRect(ITextHost *iface, LPCRECT prc, BOOL fMode)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
InvalidateRect(This->hWnd, prc, fMode);
}
-void WINAPI ITextHostImpl_TxViewChange(ITextHost *iface,
- BOOL fUpdate)
+DECLSPEC_HIDDEN void WINAPI ITextHostImpl_TxViewChange(ITextHost *iface, BOOL fUpdate)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
if (fUpdate)
UpdateWindow(This->hWnd);
}
-BOOL WINAPI ITextHostImpl_TxCreateCaret(ITextHost *iface,
- HBITMAP hbmp,
- INT xWidth, INT yHeight)
+DECLSPEC_HIDDEN BOOL WINAPI ITextHostImpl_TxCreateCaret(ITextHost *iface, HBITMAP hbmp, INT xWidth, INT yHeight)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
return CreateCaret(This->hWnd, hbmp, xWidth, yHeight);
}
-BOOL WINAPI ITextHostImpl_TxShowCaret(ITextHost *iface, BOOL fShow)
+DECLSPEC_HIDDEN BOOL WINAPI ITextHostImpl_TxShowCaret(ITextHost *iface, BOOL fShow)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
if (fShow)
return ShowCaret(This->hWnd);
else
return HideCaret(This->hWnd);
}
-BOOL WINAPI ITextHostImpl_TxSetCaretPos(ITextHost *iface,
+DECLSPEC_HIDDEN BOOL WINAPI ITextHostImpl_TxSetCaretPos(ITextHost *iface,
INT x, INT y)
{
return SetCaretPos(x, y);
}
-BOOL WINAPI ITextHostImpl_TxSetTimer(ITextHost *iface,
- UINT idTimer, UINT uTimeout)
+DECLSPEC_HIDDEN BOOL WINAPI ITextHostImpl_TxSetTimer(ITextHost *iface, UINT idTimer, UINT uTimeout)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
return SetTimer(This->hWnd, idTimer, uTimeout, NULL) != 0;
}
-void WINAPI ITextHostImpl_TxKillTimer(ITextHost *iface,
- UINT idTimer)
+DECLSPEC_HIDDEN void WINAPI ITextHostImpl_TxKillTimer(ITextHost *iface, UINT idTimer)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
KillTimer(This->hWnd, idTimer);
}
-void WINAPI ITextHostImpl_TxScrollWindowEx(ITextHost *iface,
- INT dx, INT dy,
- LPCRECT lprcScroll,
- LPCRECT lprcClip,
- HRGN hRgnUpdate,
- LPRECT lprcUpdate,
+DECLSPEC_HIDDEN void WINAPI ITextHostImpl_TxScrollWindowEx(ITextHost *iface, INT dx, INT dy, LPCRECT lprcScroll,
+ LPCRECT lprcClip, HRGN hRgnUpdate, LPRECT lprcUpdate,
UINT fuScroll)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
ScrollWindowEx(This->hWnd, dx, dy, lprcScroll, lprcClip,
hRgnUpdate, lprcUpdate, fuScroll);
}
-void WINAPI ITextHostImpl_TxSetCapture(ITextHost *iface,
- BOOL fCapture)
+DECLSPEC_HIDDEN void WINAPI ITextHostImpl_TxSetCapture(ITextHost *iface, BOOL fCapture)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
if (fCapture)
SetCapture(This->hWnd);
else
ReleaseCapture();
}
-void WINAPI ITextHostImpl_TxSetFocus(ITextHost *iface)
+DECLSPEC_HIDDEN void WINAPI ITextHostImpl_TxSetFocus(ITextHost *iface)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
SetFocus(This->hWnd);
}
-void WINAPI ITextHostImpl_TxSetCursor(ITextHost *iface,
+DECLSPEC_HIDDEN void WINAPI ITextHostImpl_TxSetCursor(ITextHost *iface,
HCURSOR hcur,
BOOL fText)
{
SetCursor(hcur);
}
-BOOL WINAPI ITextHostImpl_TxScreenToClient(ITextHost *iface,
- LPPOINT lppt)
+DECLSPEC_HIDDEN BOOL WINAPI ITextHostImpl_TxScreenToClient(ITextHost *iface, LPPOINT lppt)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
return ScreenToClient(This->hWnd, lppt);
}
-BOOL WINAPI ITextHostImpl_TxClientToScreen(ITextHost *iface,
- LPPOINT lppt)
+DECLSPEC_HIDDEN BOOL WINAPI ITextHostImpl_TxClientToScreen(ITextHost *iface, LPPOINT lppt)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
return ClientToScreen(This->hWnd, lppt);
}
-HRESULT WINAPI ITextHostImpl_TxActivate(ITextHost *iface,
- LONG *plOldState)
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxActivate(ITextHost *iface, LONG *plOldState)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
*plOldState = HandleToLong(SetActiveWindow(This->hWnd));
return (*plOldState ? S_OK : E_FAIL);
}
-HRESULT WINAPI ITextHostImpl_TxDeactivate(ITextHost *iface,
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxDeactivate(ITextHost *iface,
LONG lNewState)
{
HWND ret = SetActiveWindow(LongToHandle(lNewState));
return (ret ? S_OK : E_FAIL);
}
-HRESULT WINAPI ITextHostImpl_TxGetClientRect(ITextHost *iface,
- LPRECT prc)
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetClientRect(ITextHost *iface, LPRECT prc)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
int ret = GetClientRect(This->hWnd, prc);
return (ret ? S_OK : E_FAIL);
}
-HRESULT WINAPI ITextHostImpl_TxGetViewInset(ITextHost *iface,
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetViewInset(ITextHost *iface,
LPRECT prc)
{
prc->top = 0;
return S_OK;
}
-HRESULT WINAPI ITextHostImpl_TxGetCharFormat(ITextHost *iface,
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetCharFormat(ITextHost *iface,
const CHARFORMATW **ppCF)
{
return E_NOTIMPL;
}
-HRESULT WINAPI ITextHostImpl_TxGetParaFormat(ITextHost *iface,
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetParaFormat(ITextHost *iface,
const PARAFORMAT **ppPF)
{
return E_NOTIMPL;
}
-COLORREF WINAPI ITextHostImpl_TxGetSysColor(ITextHost *iface,
+DECLSPEC_HIDDEN COLORREF WINAPI ITextHostImpl_TxGetSysColor(ITextHost *iface,
int nIndex)
{
return GetSysColor(nIndex);
}
-HRESULT WINAPI ITextHostImpl_TxGetBackStyle(ITextHost *iface,
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetBackStyle(ITextHost *iface,
TXTBACKSTYLE *pStyle)
{
*pStyle = TXTBACK_OPAQUE;
return S_OK;
}
-HRESULT WINAPI ITextHostImpl_TxGetMaxLength(ITextHost *iface,
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetMaxLength(ITextHost *iface,
DWORD *pLength)
{
*pLength = INFINITE;
return S_OK;
}
-HRESULT WINAPI ITextHostImpl_TxGetScrollBars(ITextHost *iface,
- DWORD *pdwScrollBar)
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetScrollBars(ITextHost *iface, DWORD *pdwScrollBar)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW(This->hWnd, 0);
const DWORD mask = WS_VSCROLL|
WS_HSCROLL|
return S_OK;
}
-HRESULT WINAPI ITextHostImpl_TxGetPasswordChar(ITextHost *iface,
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetPasswordChar(ITextHost *iface,
WCHAR *pch)
{
*pch = '*';
return S_OK;
}
-HRESULT WINAPI ITextHostImpl_TxGetAcceleratorPos(ITextHost *iface,
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetAcceleratorPos(ITextHost *iface,
LONG *pch)
{
*pch = -1;
return S_OK;
}
-HRESULT WINAPI ITextHostImpl_TxGetExtent(ITextHost *iface,
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetExtent(ITextHost *iface,
LPSIZEL lpExtent)
{
return E_NOTIMPL;
}
-HRESULT WINAPI ITextHostImpl_OnTxCharFormatChange(ITextHost *iface,
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_OnTxCharFormatChange(ITextHost *iface,
const CHARFORMATW *pcf)
{
return S_OK;
}
-HRESULT WINAPI ITextHostImpl_OnTxParaFormatChange(ITextHost *iface,
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_OnTxParaFormatChange(ITextHost *iface,
const PARAFORMAT *ppf)
{
return S_OK;
}
-HRESULT WINAPI ITextHostImpl_TxGetPropertyBits(ITextHost *iface,
- DWORD dwMask,
- DWORD *pdwBits)
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetPropertyBits(ITextHost *iface, DWORD dwMask, DWORD *pdwBits)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(This->hWnd, 0);
DWORD style;
DWORD dwBits = 0;
return S_OK;
}
-HRESULT WINAPI ITextHostImpl_TxNotify(ITextHost *iface,
- DWORD iNotify,
- void *pv)
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxNotify(ITextHost *iface, DWORD iNotify, void *pv)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW(This->hWnd, 0);
HWND hwnd = This->hWnd;
UINT id;
return S_OK;
}
-HIMC WINAPI ITextHostImpl_TxImmGetContext(ITextHost *iface)
+DECLSPEC_HIDDEN HIMC WINAPI ITextHostImpl_TxImmGetContext(ITextHost *iface)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
return ImmGetContext(This->hWnd);
}
-void WINAPI ITextHostImpl_TxImmReleaseContext(ITextHost *iface,
- HIMC himc)
+DECLSPEC_HIDDEN void WINAPI ITextHostImpl_TxImmReleaseContext(ITextHost *iface, HIMC himc)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
ImmReleaseContext(This->hWnd, himc);
}
-HRESULT WINAPI ITextHostImpl_TxGetSelectionBarWidth(ITextHost *iface,
- LONG *lSelBarWidth)
+DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetSelectionBarWidth(ITextHost *iface, LONG *lSelBarWidth)
{
- ITextHostImpl *This = (ITextHostImpl *)iface;
+ ITextHostImpl *This = impl_from_ITextHost(iface);
ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(This->hWnd, 0);
DWORD style = editor ? editor->styleFlags
WINE_DEFAULT_DEBUG_CHANNEL(richedit);
typedef struct ITextServicesImpl {
- const ITextServicesVtbl *lpVtbl;
+ ITextServices ITextServices_iface;
ITextHost *pMyHost;
LONG ref;
CRITICAL_SECTION csTxtSrv;
ITextImpl->ref = 1;
ITextHost_AddRef(pITextHost);
ITextImpl->pMyHost = pITextHost;
- ITextImpl->lpVtbl = &textservices_Vtbl;
+ ITextImpl->ITextServices_iface.lpVtbl = &textservices_Vtbl;
ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE);
ITextImpl->editor->exStyleFlags = 0;
ITextImpl->editor->rcFormat.left = 0;
ITextImpl->editor->rcFormat.top = 0;
ITextImpl->editor->rcFormat.right = 0;
ITextImpl->editor->rcFormat.bottom = 0;
+
ME_HandleMessage(ITextImpl->editor, WM_CREATE, 0, 0, TRUE, &hres);
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
}
- *ppUnk = (IUnknown *)ITextImpl;
+ *ppUnk = (IUnknown *)&ITextImpl->ITextServices_iface;
return S_OK;
}
-#define ICOM_THIS_MULTI(impl,field,iface) \
- impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
+static inline ITextServicesImpl *impl_from_ITextServices(ITextServices *iface)
+{
+ return CONTAINING_RECORD(iface, ITextServicesImpl, ITextServices_iface);
+}
-static HRESULT WINAPI fnTextSrv_QueryInterface(ITextServices * iface,
- REFIID riid,
- LPVOID * ppv)
+static HRESULT WINAPI fnTextSrv_QueryInterface(ITextServices *iface, REFIID riid, void **ppv)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
+
TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppv);
*ppv = NULL;
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextServices))
static ULONG WINAPI fnTextSrv_AddRef(ITextServices *iface)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
DWORD ref = InterlockedIncrement(&This->ref);
TRACE("(%p/%p)->() AddRef from %d\n", This, iface, ref - 1);
static ULONG WINAPI fnTextSrv_Release(ITextServices *iface)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
DWORD ref = InterlockedDecrement(&This->ref);
TRACE("(%p/%p)->() Release from %d\n", This, iface, ref + 1);
return ref;
}
-HRESULT WINAPI fnTextSrv_TxSendMessage(ITextServices *iface,
- UINT msg,
- WPARAM wparam,
- LPARAM lparam,
- LRESULT* plresult)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxSendMessage(ITextServices *iface, UINT msg, WPARAM wparam,
+ LPARAM lparam, LRESULT *plresult)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
HRESULT hresult;
LRESULT lresult;
return hresult;
}
-HRESULT WINAPI fnTextSrv_TxDraw(ITextServices *iface,
- DWORD dwDrawAspect,
- LONG lindex,
- void* pvAspect,
- DVTARGETDEVICE* ptd,
- HDC hdcDraw,
- HDC hdcTargetDev,
- LPCRECTL lprcBounds,
- LPCRECTL lprcWBounds,
- LPRECT lprcUpdate,
- BOOL (CALLBACK * pfnContinue)(DWORD),
- DWORD dwContinue,
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxDraw(ITextServices *iface, DWORD dwDrawAspect, LONG lindex,
+ void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcDraw, HDC hdcTargetDev,
+ LPCRECTL lprcBounds, LPCRECTL lprcWBounds, LPRECT lprcUpdate,
+ BOOL (CALLBACK * pfnContinue)(DWORD), DWORD dwContinue,
LONG lViewId)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
-HRESULT WINAPI fnTextSrv_TxGetHScroll(ITextServices *iface,
- LONG* plMin,
- LONG* plMax,
- LONG* plPos,
- LONG* plPage,
- BOOL* pfEnabled)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetHScroll(ITextServices *iface, LONG *plMin, LONG *plMax, LONG *plPos,
+ LONG *plPage, BOOL *pfEnabled)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
*plMin = This->editor->horz_si.nMin;
*plMax = This->editor->horz_si.nMax;
return S_OK;
}
-HRESULT WINAPI fnTextSrv_TxGetVScroll(ITextServices *iface,
- LONG* plMin,
- LONG* plMax,
- LONG* plPos,
- LONG* plPage,
- BOOL* pfEnabled)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetVScroll(ITextServices *iface, LONG *plMin, LONG *plMax, LONG *plPos,
+ LONG *plPage, BOOL *pfEnabled)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
*plMin = This->editor->vert_si.nMin;
*plMax = This->editor->vert_si.nMax;
return S_OK;
}
-HRESULT WINAPI fnTextSrv_OnTxSetCursor(ITextServices *iface,
- DWORD dwDrawAspect,
- LONG lindex,
- void* pvAspect,
- DVTARGETDEVICE* ptd,
- HDC hdcDraw,
- HDC hicTargetDev,
- LPCRECT lprcClient,
- INT x, INT y)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxSetCursor(ITextServices *iface, DWORD dwDrawAspect, LONG lindex,
+ void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcDraw,
+ HDC hicTargetDev, LPCRECT lprcClient, INT x, INT y)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
-HRESULT WINAPI fnTextSrv_TxQueryHitPoint(ITextServices *iface,
- DWORD dwDrawAspect,
- LONG lindex,
- void* pvAspect,
- DVTARGETDEVICE* ptd,
- HDC hdcDraw,
- HDC hicTargetDev,
- LPCRECT lprcClient,
- INT x, INT y,
- DWORD* pHitResult)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxQueryHitPoint(ITextServices *iface, DWORD dwDrawAspect, LONG lindex,
+ void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcDraw,
+ HDC hicTargetDev, LPCRECT lprcClient, INT x, INT y,
+ DWORD *pHitResult)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
-HRESULT WINAPI fnTextSrv_OnTxInplaceActivate(ITextServices *iface,
- LPCRECT prcClient)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxInplaceActivate(ITextServices *iface, LPCRECT prcClient)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
-HRESULT WINAPI fnTextSrv_OnTxInplaceDeactivate(ITextServices *iface)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxInplaceDeactivate(ITextServices *iface)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
-HRESULT WINAPI fnTextSrv_OnTxUIActivate(ITextServices *iface)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxUIActivate(ITextServices *iface)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
-HRESULT WINAPI fnTextSrv_OnTxUIDeactivate(ITextServices *iface)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxUIDeactivate(ITextServices *iface)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
-HRESULT WINAPI fnTextSrv_TxGetText(ITextServices *iface,
- BSTR* pbstrText)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetText(ITextServices *iface, BSTR *pbstrText)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
int length;
length = ME_GetTextLength(This->editor);
return S_OK;
}
-HRESULT WINAPI fnTextSrv_TxSetText(ITextServices *iface,
- LPCWSTR pszText)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxSetText(ITextServices *iface, LPCWSTR pszText)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
ME_Cursor cursor;
ME_SetCursorToStart(This->editor, &cursor);
This->editor->nModifyStep = 0;
OleFlushClipboard();
ME_EmptyUndoStack(This->editor);
- ME_UpdateRepaint(This->editor);
+ ME_UpdateRepaint(This->editor, FALSE);
return S_OK;
}
-HRESULT WINAPI fnTextSrv_TxGetCurrentTargetX(ITextServices *iface,
- LONG* x)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetCurrentTargetX(ITextServices *iface, LONG *x)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
-HRESULT WINAPI fnTextSrv_TxGetBaseLinePos(ITextServices *iface,
- LONG* x)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetBaseLinePos(ITextServices *iface, LONG *x)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
-HRESULT WINAPI fnTextSrv_TxGetNaturalSize(ITextServices *iface,
- DWORD dwAspect,
- HDC hdcDraw,
- HDC hicTargetDev,
- DVTARGETDEVICE* ptd,
- DWORD dwMode,
- const SIZEL* psizelExtent,
- LONG* pwidth,
- LONG* pheight)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetNaturalSize(ITextServices *iface, DWORD dwAspect, HDC hdcDraw,
+ HDC hicTargetDev, DVTARGETDEVICE *ptd, DWORD dwMode,
+ const SIZEL *psizelExtent, LONG *pwidth, LONG *pheight)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
-HRESULT WINAPI fnTextSrv_TxGetDropTarget(ITextServices *iface,
- IDropTarget** ppDropTarget)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetDropTarget(ITextServices *iface, IDropTarget **ppDropTarget)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
-HRESULT WINAPI fnTextSrv_OnTxPropertyBitsChange(ITextServices *iface,
- DWORD dwMask,
- DWORD dwBits)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxPropertyBitsChange(ITextServices *iface, DWORD dwMask, DWORD dwBits)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
-HRESULT WINAPI fnTextSrv_TxGetCachedSize(ITextServices *iface,
- DWORD* pdwWidth,
- DWORD* pdwHeight)
+DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetCachedSize(ITextServices *iface, DWORD *pdwWidth, DWORD *pdwHeight)
{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ ITextServicesImpl *This = impl_from_ITextServices(iface);
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
}
/**
- * Groups supsequent changes with previous ones for an undo if coalescing.
+ * Groups subsequent changes with previous ones for an undo if coalescing.
*
* Has no effect if the previous changes were followed by a ME_CommitUndo. This
* function will only have an affect if the previous changes were followed by
int paraFlags = pItem->member.para.nFlags & (MEPF_ROWSTART|MEPF_CELL|MEPF_ROWEND);
ME_CursorFromCharOfs(editor, pUItem->nStart, &tmp);
if (tmp.nOffset)
- tmp.pRun = ME_SplitRunSimple(editor, tmp.pRun, tmp.nOffset);
+ ME_SplitRunSimple(editor, &tmp);
assert(pUItem->eol_str);
this_para = tmp.pPara;
bFixRowStart = this_para->member.para.nFlags & MEPF_ROWSTART;
ME_CheckTablesForCorruption(editor);
editor->nUndoStackSize--;
editor->nUndoMode = nMode;
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
return TRUE;
}
ME_AddUndoItem(editor, diUndoEndTransaction, NULL);
ME_CheckTablesForCorruption(editor);
editor->nUndoMode = nMode;
- ME_UpdateRepaint(editor);
+ ME_UpdateRepaint(editor, FALSE);
return TRUE;
}
{
if (wc->pLastSplittableRun->member.run.nFlags & (MERF_GRAPHICS|MERF_TAB))
{
- wc->pt = wc->ptLastSplittableRun;
+ wc->pt = wc->pLastSplittableRun->member.run.pt;
return wc->pLastSplittableRun;
}
else if (wc->pLastSplittableRun->member.run.nFlags & MERF_SPLITTABLE)
else
{
/* restart from the first run beginning with spaces */
- wc->pt = wc->ptLastSplittableRun;
+ wc->pt = wc->pLastSplittableRun->member.run.pt;
return wc->pLastSplittableRun;
}
}
return p->next;
if (run->nFlags & MERF_WHITESPACE) {
- p->member.run.nFlags |= MERF_SKIPPED;
wc->pt.x += run->nWidth;
/* skip runs consisting of only whitespaces */
return p->next;
if (black) {
wc->bOverflown = FALSE;
pp = ME_SplitRun(wc, p, black);
- p->member.run.nFlags |= MERF_SKIPPED;
+ ME_CalcRunExtent(wc->context, &wc->pPara->member.para,
+ wc->nRow ? wc->nLeftMargin : wc->nFirstMargin,
+ &pp->member.run);
ME_InsertRowStart(wc, pp);
return pp;
}
|| ((run->nFlags & (MERF_GRAPHICS|MERF_TAB)) && (p != wc->pRowStart)))
{
wc->pLastSplittableRun = p;
- wc->ptLastSplittableRun = wc->pt;
}
wc->pt.x += run->nWidth;
return p->next;
return sp * c->editor->nZoomNumerator / c->editor->nZoomDenominator;
}
-static void ME_PrepareParagraphForWrapping(ME_Context *c, ME_DisplayItem *tp);
+static void ME_PrepareParagraphForWrapping(ME_Context *c, ME_DisplayItem *tp) {
+ ME_DisplayItem *p;
+
+ tp->member.para.nWidth = 0;
+ /* remove row start items as they will be reinserted by the
+ * paragraph wrapper anyway */
+ tp->member.para.nRows = 0;
+ for (p = tp->next; p != tp->member.para.next_para; p = p->next) {
+ if (p->type == diStartRow) {
+ ME_DisplayItem *pRow = p;
+ p = p->prev;
+ ME_Remove(pRow);
+ ME_DestroyDisplayItem(pRow);
+ }
+ }
+ /* join runs that can be joined */
+ for (p = tp->next; p != tp->member.para.next_para; p = p->next) {
+ assert(p->type != diStartRow); /* should have been deleted above */
+ if (p->type == diRun) {
+ while (p->next->type == diRun && /* FIXME */
+ ME_CanJoinRuns(&p->member.run, &p->next->member.run)) {
+ ME_JoinRuns(c->editor, p);
+ }
+ }
+ }
+}
static void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp) {
ME_DisplayItem *p;
tp->member.para.nRows = wc.nRow;
}
-
-static void ME_PrepareParagraphForWrapping(ME_Context *c, ME_DisplayItem *tp) {
- ME_DisplayItem *p, *pRow;
-
- tp->member.para.nWidth = 0;
- /* remove all items that will be reinserted by paragraph wrapper anyway */
- tp->member.para.nRows = 0;
- for (p = tp->next; p!=tp->member.para.next_para; p = p->next) {
- switch(p->type) {
- case diStartRow:
- pRow = p;
- p = p->prev;
- ME_Remove(pRow);
- ME_DestroyDisplayItem(pRow);
- break;
- default:
- break;
- }
- }
- /* join runs that can be joined, set up flags */
- for (p = tp->next; p!=tp->member.para.next_para; p = p->next) {
- switch(p->type) {
- case diStartRow: assert(0); break; /* should have deleted it */
- case diRun:
- while (p->next->type == diRun) { /* FIXME */
- if (ME_CanJoinRuns(&p->member.run, &p->next->member.run)) {
- ME_JoinRuns(c->editor, p);
- }
- else
- break;
- }
- p->member.run.nFlags &= ~MERF_CALCBYWRAP;
- break;
- default:
- break;
- }
- }
-}
-
BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
{
ME_DisplayItem *item;
LONG nRemaining = 0;
EDITSTREAM *stream = pStream->stream;
- do {
+ 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 */
return FALSE;
pStream->written += nWritten;
nStart += nWritten;
- } while (nStart < pStream->pos);
+ }
pStream->pos = 0;
return TRUE;
}
if (!editor->bEmulateVersion10 && cursor.pRun->member.run.nFlags & MERF_ENDPARA)
{
- static const WCHAR szEOL[2] = { '\r', '\n' };
+ static const WCHAR szEOL[] = { '\r', '\n' };
/* richedit 2.0 - all line breaks are \r\n */
if (dwFormat & SF_UNICODE)
reactos/dll/win32/query # Synced to Wine-1.3.37
reactos/dll/win32/rasapi32 # Synced to Wine-1.3.37
reactos/dll/win32/resutils # Autosync
-reactos/dll/win32/riched20 # Autosync
+reactos/dll/win32/riched20 # Synced to Wine-1.3.37
reactos/dll/win32/riched32 # Autosync
reactos/dll/win32/rpcrt4 # Synced to Wine-1.3.26
reactos/dll/win32/rsabase # Autosync