ReactOS  0.4.14-dev-1036-g3c5b10f
txtsrv.c File Reference
#include "editor.h"
#include "ole2.h"
#include "oleauto.h"
#include "richole.h"
#include "tom.h"
#include "imm.h"
#include "textserv.h"
#include "wine/asm.h"
#include "wine/debug.h"
#include "editstr.h"
Include dependency graph for txtsrv.c:

Go to the source code of this file.

Classes

struct  ITextServicesImpl
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct ITextServicesImpl ITextServicesImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (richedit)
 
static ITextServicesImplimpl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI ITextServicesImpl_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ITextServicesImpl_AddRef (IUnknown *iface)
 
static ULONG WINAPI ITextServicesImpl_Release (IUnknown *iface)
 
static ITextServicesImplimpl_from_ITextServices (ITextServices *iface)
 
static HRESULT WINAPI fnTextSrv_QueryInterface (ITextServices *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI fnTextSrv_AddRef (ITextServices *iface)
 
static ULONG WINAPI fnTextSrv_Release (ITextServices *iface)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxSendMessage (ITextServices *iface, UINT msg, WPARAM wparam, LPARAM lparam, LRESULT *plresult)
 
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)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetHScroll (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)
 
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)
 
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)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxInplaceActivate (ITextServices *iface, LPCRECT prcClient)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxInplaceDeactivate (ITextServices *iface)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxUIActivate (ITextServices *iface)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxUIDeactivate (ITextServices *iface)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetText (ITextServices *iface, BSTR *pbstrText)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxSetText (ITextServices *iface, LPCWSTR pszText)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetCurTargetX (ITextServices *iface, LONG *x)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetBaseLinePos (ITextServices *iface, LONG *x)
 
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)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetDropTarget (ITextServices *iface, IDropTarget **ppDropTarget)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxPropertyBitsChange (ITextServices *iface, DWORD dwMask, DWORD dwBits)
 
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetCachedSize (ITextServices *iface, DWORD *pdwWidth, DWORD *pdwHeight)
 
HRESULT WINAPI CreateTextServices (IUnknown *pUnkOuter, ITextHost *pITextHost, IUnknown **ppUnk)
 

Variables

static const IUnknownVtbl textservices_inner_vtbl
 
static const ITextServicesVtbl textservices_vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file txtsrv.c.

Typedef Documentation

◆ ITextServicesImpl

Function Documentation

◆ CreateTextServices()

HRESULT WINAPI CreateTextServices ( IUnknown pUnkOuter,
ITextHost *  pITextHost,
IUnknown **  ppUnk 
)

Definition at line 387 of file txtsrv.c.

388 {
389  ITextServicesImpl *ITextImpl;
390 
391  TRACE("%p %p --> %p\n", pUnkOuter, pITextHost, ppUnk);
392  if (pITextHost == NULL)
393  return E_POINTER;
394 
395  ITextImpl = CoTaskMemAlloc(sizeof(*ITextImpl));
396  if (ITextImpl == NULL)
397  return E_OUTOFMEMORY;
398  InitializeCriticalSection(&ITextImpl->csTxtSrv);
399  ITextImpl->csTxtSrv.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ITextServicesImpl.csTxtSrv");
400  ITextImpl->ref = 1;
401  ITextHost_AddRef(pITextHost);
402  ITextImpl->pMyHost = pITextHost;
403  ITextImpl->IUnknown_inner.lpVtbl = &textservices_inner_vtbl;
404  ITextImpl->ITextServices_iface.lpVtbl = &textservices_vtbl;
405  ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE);
406 
407  if (pUnkOuter)
408  ITextImpl->outer_unk = pUnkOuter;
409  else
410  ITextImpl->outer_unk = &ITextImpl->IUnknown_inner;
411 
412  *ppUnk = &ITextImpl->IUnknown_inner;
413  return S_OK;
414 }
static const IUnknownVtbl textservices_inner_vtbl
Definition: txtsrv.c:105
#define DWORD_PTR
Definition: treelist.c:76
ITextServices ITextServices_iface
Definition: txtsrv.c:38
CRITICAL_SECTION csTxtSrv
Definition: txtsrv.c:42
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
ME_TextEditor * editor
Definition: txtsrv.c:43
ME_TextEditor * ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
Definition: editor.c:3052
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:866
IUnknown IUnknown_inner
Definition: txtsrv.c:37
IUnknown * outer_unk
Definition: txtsrv.c:39
#define S_OK
Definition: intsafe.h:59
static const ITextServicesVtbl textservices_vtbl
Definition: txtsrv.c:359
#define E_POINTER
Definition: winerror.h:2365
ITextHost * pMyHost
Definition: txtsrv.c:41
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:859

◆ fnTextSrv_AddRef()

static ULONG WINAPI fnTextSrv_AddRef ( ITextServices *  iface)
static

Definition at line 123 of file txtsrv.c.

124 {
126  return IUnknown_AddRef(This->outer_unk);
127 }
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112

◆ fnTextSrv_OnTxInplaceActivate()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxInplaceActivate ( ITextServices *  iface,
LPCRECT  prcClient 
)

Definition at line 216 of file txtsrv.c.

217 {
219 
220  FIXME("%p: STUB\n", This);
221  return E_NOTIMPL;
222 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_OnTxInplaceDeactivate()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxInplaceDeactivate ( ITextServices *  iface)

Definition at line 224 of file txtsrv.c.

225 {
227 
228  FIXME("%p: STUB\n", This);
229  return E_NOTIMPL;
230 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_OnTxPropertyBitsChange()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxPropertyBitsChange ( ITextServices *  iface,
DWORD  dwMask,
DWORD  dwBits 
)

Definition at line 324 of file txtsrv.c.

325 {
327 
328  FIXME("%p: STUB\n", This);
329  return E_NOTIMPL;
330 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_OnTxSetCursor()

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 
)

Definition at line 195 of file txtsrv.c.

198 {
200 
201  FIXME("%p: STUB\n", This);
202  return E_NOTIMPL;
203 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_OnTxUIActivate()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxUIActivate ( ITextServices *  iface)

Definition at line 232 of file txtsrv.c.

233 {
235 
236  FIXME("%p: STUB\n", This);
237  return E_NOTIMPL;
238 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_OnTxUIDeactivate()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxUIDeactivate ( ITextServices *  iface)

Definition at line 240 of file txtsrv.c.

241 {
243 
244  FIXME("%p: STUB\n", This);
245  return E_NOTIMPL;
246 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_QueryInterface()

static HRESULT WINAPI fnTextSrv_QueryInterface ( ITextServices *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 117 of file txtsrv.c.

118 {
120  return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
121 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112

◆ fnTextSrv_Release()

static ULONG WINAPI fnTextSrv_Release ( ITextServices *  iface)
static

Definition at line 129 of file txtsrv.c.

130 {
132  return IUnknown_Release(This->outer_unk);
133 }
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112

◆ fnTextSrv_TxDraw()

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 
)

Definition at line 147 of file txtsrv.c.

152 {
154 
155  FIXME("%p: STUB\n", This);
156  return E_NOTIMPL;
157 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_TxGetBaseLinePos()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetBaseLinePos ( ITextServices *  iface,
LONG x 
)

Definition at line 298 of file txtsrv.c.

299 {
301 
302  FIXME("%p: STUB\n", This);
303  return E_NOTIMPL;
304 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_TxGetCachedSize()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetCachedSize ( ITextServices *  iface,
DWORD pdwWidth,
DWORD pdwHeight 
)

Definition at line 332 of file txtsrv.c.

333 {
335 
336  FIXME("%p: STUB\n", This);
337  return E_NOTIMPL;
338 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_TxGetCurTargetX()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetCurTargetX ( ITextServices *  iface,
LONG x 
)

Definition at line 290 of file txtsrv.c.

291 {
293 
294  FIXME("%p: STUB\n", This);
295  return E_NOTIMPL;
296 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_TxGetDropTarget()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetDropTarget ( ITextServices *  iface,
IDropTarget **  ppDropTarget 
)

Definition at line 316 of file txtsrv.c.

317 {
319 
320  FIXME("%p: STUB\n", This);
321  return E_NOTIMPL;
322 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_TxGetHScroll()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetHScroll ( ITextServices *  iface,
LONG plMin,
LONG plMax,
LONG plPos,
LONG plPage,
BOOL pfEnabled 
)

Definition at line 159 of file txtsrv.c.

161 {
163 
164  if (plMin)
165  *plMin = This->editor->horz_si.nMin;
166  if (plMax)
167  *plMax = This->editor->horz_si.nMax;
168  if (plPos)
169  *plPos = This->editor->horz_si.nPos;
170  if (plPage)
171  *plPage = This->editor->horz_si.nPage;
172  if (pfEnabled)
173  *pfEnabled = (This->editor->styleFlags & WS_HSCROLL) != 0;
174  return S_OK;
175 }
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define WS_HSCROLL
Definition: pedump.c:628
#define S_OK
Definition: intsafe.h:59

◆ fnTextSrv_TxGetNaturalSize()

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 
)

Definition at line 306 of file txtsrv.c.

309 {
311 
312  FIXME("%p: STUB\n", This);
313  return E_NOTIMPL;
314 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_TxGetText()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetText ( ITextServices *  iface,
BSTR pbstrText 
)

Definition at line 248 of file txtsrv.c.

249 {
251  int length;
252 
253  length = ME_GetTextLength(This->editor);
254  if (length)
255  {
257  BSTR bstr;
258  bstr = SysAllocStringByteLen(NULL, length * sizeof(WCHAR));
259  if (bstr == NULL)
260  return E_OUTOFMEMORY;
261 
262  ME_CursorFromCharOfs(This->editor, 0, &start);
263  ME_GetTextW(This->editor, bstr, length, &start, INT_MAX, FALSE, FALSE);
264  *pbstrText = bstr;
265  } else {
266  *pbstrText = NULL;
267  }
268 
269  return S_OK;
270 }
void ME_CursorFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_Cursor *pCursor) DECLSPEC_HIDDEN
Definition: run.c:171
#define INT_MAX
Definition: limits.h:40
OLECHAR * BSTR
Definition: compat.h:1942
int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen, const ME_Cursor *start, int srcChars, BOOL bCRLF, BOOL bEOP)
Definition: editor.c:5134
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
BSTR WINAPI DECLSPEC_HOTPATCH SysAllocStringByteLen(LPCSTR str, UINT len)
Definition: oleaut.c:428
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define S_OK
Definition: intsafe.h:59
GLuint start
Definition: gl.h:1545
int ME_GetTextLength(ME_TextEditor *editor)
Definition: caret.c:83

◆ fnTextSrv_TxGetVScroll()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetVScroll ( ITextServices *  iface,
LONG plMin,
LONG plMax,
LONG plPos,
LONG plPage,
BOOL pfEnabled 
)

Definition at line 177 of file txtsrv.c.

179 {
181 
182  if (plMin)
183  *plMin = This->editor->vert_si.nMin;
184  if (plMax)
185  *plMax = This->editor->vert_si.nMax;
186  if (plPos)
187  *plPos = This->editor->vert_si.nPos;
188  if (plPage)
189  *plPage = This->editor->vert_si.nPage;
190  if (pfEnabled)
191  *pfEnabled = (This->editor->styleFlags & WS_VSCROLL) != 0;
192  return S_OK;
193 }
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define S_OK
Definition: intsafe.h:59
#define WS_VSCROLL
Definition: pedump.c:627

◆ fnTextSrv_TxQueryHitPoint()

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 
)

Definition at line 205 of file txtsrv.c.

209 {
211 
212  FIXME("%p: STUB\n", This);
213  return E_NOTIMPL;
214 }
#define FIXME(fmt,...)
Definition: debug.h:110
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnTextSrv_TxSendMessage()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxSendMessage ( ITextServices *  iface,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam,
LRESULT plresult 
)

Definition at line 135 of file txtsrv.c.

137 {
139  HRESULT hresult;
140  LRESULT lresult;
141 
142  lresult = ME_HandleMessage(This->editor, msg, wparam, lparam, TRUE, &hresult);
143  if (plresult) *plresult = lresult;
144  return hresult;
145 }
#define TRUE
Definition: types.h:120
LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode, HRESULT *phresult)
Definition: editor.c:3600
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
LONG HRESULT
Definition: typedefs.h:78
#define msg(x)
Definition: auth_time.c:54
LONG_PTR LRESULT
Definition: windef.h:209
static UINT WPARAM wparam
Definition: combo.c:716

◆ fnTextSrv_TxSetText()

DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxSetText ( ITextServices *  iface,
LPCWSTR  pszText 
)

Definition at line 272 of file txtsrv.c.

273 {
276 
277  ME_SetCursorToStart(This->editor, &cursor);
279  if(pszText)
280  ME_InsertTextFromCursor(This->editor, 0, pszText, -1, This->editor->pBuffer->pDefaultStyle);
281  set_selection_cursors(This->editor, 0, 0);
282  This->editor->nModifyStep = 0;
284  ME_EmptyUndoStack(This->editor);
285  ME_UpdateRepaint(This->editor, FALSE);
286 
287  return S_OK;
288 }
void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style)
Definition: caret.c:550
int set_selection_cursors(ME_TextEditor *editor, int from, int to)
Definition: caret.c:132
void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now) DECLSPEC_HIDDEN
Definition: paint.c:116
static ITextServicesImpl * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:112
void ME_SetCursorToStart(ME_TextEditor *editor, ME_Cursor *cursor)
Definition: caret.c:27
BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start, int nChars, BOOL bForce)
Definition: caret.c:315
#define S_OK
Definition: intsafe.h:59
const char cursor[]
Definition: icontest.c:13
HRESULT WINAPI OleFlushClipboard(void)
Definition: clipboard.c:2293
void ME_EmptyUndoStack(ME_TextEditor *editor) DECLSPEC_HIDDEN
Definition: undo.c:53
int ME_GetTextLength(ME_TextEditor *editor)
Definition: caret.c:83

◆ impl_from_ITextServices()

static ITextServicesImpl* impl_from_ITextServices ( ITextServices *  iface)
inlinestatic

◆ impl_from_IUnknown()

static ITextServicesImpl* impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 47 of file txtsrv.c.

48 {
49  return CONTAINING_RECORD(iface, ITextServicesImpl, IUnknown_inner);
50 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by ITextServicesImpl_AddRef(), ITextServicesImpl_QueryInterface(), and ITextServicesImpl_Release().

◆ ITextServicesImpl_AddRef()

static ULONG WINAPI ITextServicesImpl_AddRef ( IUnknown iface)
static

Definition at line 78 of file txtsrv.c.

79 {
82 
83  TRACE("(%p) ref=%d\n", This, ref);
84 
85  return ref;
86 }
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
static ITextServicesImpl * impl_from_IUnknown(IUnknown *iface)
Definition: txtsrv.c:47
#define InterlockedIncrement
Definition: armddk.h:53

◆ ITextServicesImpl_QueryInterface()

static HRESULT WINAPI ITextServicesImpl_QueryInterface ( IUnknown iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 52 of file txtsrv.c.

53 {
55 
56  TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
57 
59  *ppv = &This->IUnknown_inner;
60  else if (IsEqualIID(riid, &IID_ITextServices))
61  *ppv = &This->ITextServices_iface;
62  else if (IsEqualIID(riid, &IID_IRichEditOle) || IsEqualIID(riid, &IID_ITextDocument) ||
63  IsEqualIID(riid, &IID_ITextDocument2Old)) {
64  if (!This->editor->reOle)
65  if (!CreateIRichEditOle(This->outer_unk, This->editor, (void **)(&This->editor->reOle)))
66  return E_OUTOFMEMORY;
67  return IUnknown_QueryInterface(This->editor->reOle, riid, ppv);
68  } else {
69  *ppv = NULL;
70  FIXME("Unknown interface: %s\n", debugstr_guid(riid));
71  return E_NOINTERFACE;
72  }
73 
74  IUnknown_AddRef((IUnknown*)*ppv);
75  return S_OK;
76 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *ppvObj) DECLSPEC_HIDDEN
Definition: richole.c:5688
const GUID IID_IUnknown
static ITextServicesImpl * impl_from_IUnknown(IUnknown *iface)
Definition: txtsrv.c:47
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ ITextServicesImpl_Release()

static ULONG WINAPI ITextServicesImpl_Release ( IUnknown iface)
static

Definition at line 88 of file txtsrv.c.

89 {
92 
93  TRACE("(%p) ref=%d\n", This, ref);
94 
95  if (!ref)
96  {
97  ME_DestroyEditor(This->editor);
98  This->csTxtSrv.DebugInfo->Spare[0] = 0;
99  DeleteCriticalSection(&This->csTxtSrv);
101  }
102  return ref;
103 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
void ME_DestroyEditor(ME_TextEditor *editor)
Definition: editor.c:3190
#define TRACE(s)
Definition: solgame.cpp:4
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
static ITextServicesImpl * impl_from_IUnknown(IUnknown *iface)
Definition: txtsrv.c:47
#define InterlockedDecrement
Definition: armddk.h:52

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( richedit  )

Variable Documentation

◆ textservices_inner_vtbl

const IUnknownVtbl textservices_inner_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI ITextServicesImpl_AddRef(IUnknown *iface)
Definition: txtsrv.c:78
static ULONG WINAPI ITextServicesImpl_Release(IUnknown *iface)
Definition: txtsrv.c:88
static HRESULT WINAPI ITextServicesImpl_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
Definition: txtsrv.c:52

Definition at line 105 of file txtsrv.c.

Referenced by CreateTextServices().

◆ textservices_vtbl

const ITextServicesVtbl textservices_vtbl
static
Initial value:
=
{
}
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)
Definition: txtsrv.c:195
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxUIDeactivate(ITextServices *iface)
Definition: txtsrv.c:240
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)
Definition: txtsrv.c:205
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxSetText(ITextServices *iface, LPCWSTR pszText)
Definition: txtsrv.c:272
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxInplaceDeactivate(ITextServices *iface)
Definition: txtsrv.c:224
static HRESULT WINAPI fnTextSrv_QueryInterface(ITextServices *iface, REFIID riid, void **ppv)
Definition: txtsrv.c:117
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)
Definition: txtsrv.c:147
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetBaseLinePos(ITextServices *iface, LONG *x)
Definition: txtsrv.c:298
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetText(ITextServices *iface, BSTR *pbstrText)
Definition: txtsrv.c:248
static ULONG WINAPI fnTextSrv_AddRef(ITextServices *iface)
Definition: txtsrv.c:123
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetDropTarget(ITextServices *iface, IDropTarget **ppDropTarget)
Definition: txtsrv.c:316
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetVScroll(ITextServices *iface, LONG *plMin, LONG *plMax, LONG *plPos, LONG *plPage, BOOL *pfEnabled)
Definition: txtsrv.c:177
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxInplaceActivate(ITextServices *iface, LPCRECT prcClient)
Definition: txtsrv.c:216
#define THISCALL(func)
Definition: asm.h:145
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxPropertyBitsChange(ITextServices *iface, DWORD dwMask, DWORD dwBits)
Definition: txtsrv.c:324
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)
Definition: txtsrv.c:306
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetHScroll(ITextServices *iface, LONG *plMin, LONG *plMax, LONG *plPos, LONG *plPage, BOOL *pfEnabled)
Definition: txtsrv.c:159
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxSendMessage(ITextServices *iface, UINT msg, WPARAM wparam, LPARAM lparam, LRESULT *plresult)
Definition: txtsrv.c:135
static ULONG WINAPI fnTextSrv_Release(ITextServices *iface)
Definition: txtsrv.c:129
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_OnTxUIActivate(ITextServices *iface)
Definition: txtsrv.c:232
DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetCurTargetX(ITextServices *iface, LONG *x)
Definition: txtsrv.c:290

Definition at line 359 of file txtsrv.c.

Referenced by CreateTextServices().