richedit: Implemented ITextServices_TxSendMessage.

This commit is contained in:
Dylan Smith 2009-01-20 01:41:40 -05:00 committed by Alexandre Julliard
parent 902afbc65b
commit e7b68a20fd
5 changed files with 16 additions and 7 deletions

View File

@ -29,8 +29,12 @@ void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC)
c->pt.y = 0;
c->hbrMargin = CreateSolidBrush(RGB(224,224,224));
c->rcView = editor->rcFormat;
c->dpi.cx = GetDeviceCaps(hDC, LOGPIXELSX);
c->dpi.cy = GetDeviceCaps(hDC, LOGPIXELSY);
if (hDC) {
c->dpi.cx = GetDeviceCaps(hDC, LOGPIXELSX);
c->dpi.cy = GetDeviceCaps(hDC, LOGPIXELSY);
} else {
c->dpi.cx = c->dpi.cy = 96;
}
}
void ME_DestroyContext(ME_Context *c)

View File

@ -3024,7 +3024,7 @@ void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam
* The LRESULT that is returned is a return value for window procs,
* and the phresult parameter is the COM return code needed by the
* text services interface. */
static LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
LPARAM lParam, BOOL unicode, HRESULT* phresult)
{
*phresult = S_OK;

View File

@ -262,6 +262,8 @@ void ME_DeleteReObject(REOBJECT* reo);
/* editor.c */
ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10);
LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
LPARAM lParam, BOOL unicode, HRESULT* phresult);
void ME_SendOldNotify(ME_TextEditor *editor, int nCode);
int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, BOOL bCRLF);
ME_DisplayItem *ME_FindItemAtOffset(ME_TextEditor *editor, ME_DIType nItemType, int nOffset, int *nItemOffset);

View File

@ -373,7 +373,6 @@ HFONT ME_SelectStyleFont(ME_Context *c, ME_Style *s)
LOGFONTW lf;
int i, nEmpty, nAge = 0x7FFFFFFF;
ME_FontCacheItem *item;
assert(c->hDC);
assert(s);
ME_LogFontFromStyle(c, &lf, s);
@ -426,7 +425,6 @@ void ME_UnselectStyleFont(ME_Context *c, ME_Style *s, HFONT hOldFont)
{
int i;
assert(c->hDC);
assert(s);
SelectObject(c->hDC, hOldFont);
for (i=0; i<HFONT_CACHE_SIZE; i++)

View File

@ -57,6 +57,7 @@ typedef struct ITextServicesImpl {
ITextHost *pMyHost;
LONG ref;
CRITICAL_SECTION csTxtSrv;
ME_TextEditor *editor;
char spare[256];
} ITextServicesImpl;
@ -70,6 +71,7 @@ HRESULT WINAPI CreateTextServices(IUnknown * pUnkOuter,
IUnknown **ppUnk)
{
ITextServicesImpl *ITextImpl;
HRESULT hres;
TRACE("%p %p --> %p\n", pUnkOuter, pITextHost, ppUnk);
if (pITextHost == NULL)
return E_POINTER;
@ -83,6 +85,8 @@ HRESULT WINAPI CreateTextServices(IUnknown * pUnkOuter,
ITextHost_AddRef(pITextHost);
ITextImpl->pMyHost = pITextHost;
ITextImpl->lpVtbl = &textservices_Vtbl;
ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE);
ME_HandleMessage(ITextImpl->editor, WM_CREATE, 0, 0, TRUE, &hres);
if (pUnkOuter)
{
@ -150,9 +154,10 @@ HRESULT WINAPI fnTextSrv_TxSendMessage(ITextServices *iface,
LRESULT* plresult)
{
ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
HRESULT hresult;
FIXME("%p: STUB\n", This);
return E_NOTIMPL;
*plresult = ME_HandleMessage(This->editor, msg, wparam, lparam, TRUE, &hresult);
return hresult;
}
HRESULT WINAPI fnTextSrv_TxDraw(ITextServices *iface,