ReactOS  r75214
context.c File Reference
#include "msctf_internal.h"
Include dependency graph for context.c:

Go to the source code of this file.

Classes

struct  tagContext
 
struct  tagEditCookie
 

Typedefs

typedef struct tagContext Context = Context
 
typedef struct tagEditCookie EditCookie
 

Functions

static Contextimpl_from_ITfContext (ITfContext *iface)
 
static Contextimpl_from_ITfSource (ITfSource *iface)
 
static Contextimpl_from_ITfInsertAtSelection (ITfInsertAtSelection *iface)
 
static Contextimpl_from_ITfSourceSingle (ITfSourceSingle *iface)
 
static Contextimpl_from_ITextStoreACPSink (ITextStoreACPSink *iface)
 
static Contextimpl_from_ITextStoreACPServices (ITextStoreACPServices *iface)
 
static void Context_Destructor (Context *This)
 
static HRESULT WINAPI Context_QueryInterface (ITfContext *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI Context_AddRef (ITfContext *iface)
 
static ULONG WINAPI Context_Release (ITfContext *iface)
 
static HRESULT WINAPI Context_RequestEditSession (ITfContext *iface, TfClientId tid, ITfEditSession *pes, DWORD dwFlags, HRESULT *phrSession)
 
static HRESULT WINAPI Context_InWriteSession (ITfContext *iface, TfClientId tid, BOOL *pfWriteSession)
 
static HRESULT WINAPI Context_GetSelection (ITfContext *iface, TfEditCookie ec, ULONG ulIndex, ULONG ulCount, TF_SELECTION *pSelection, ULONG *pcFetched)
 
static HRESULT WINAPI Context_SetSelection (ITfContext *iface, TfEditCookie ec, ULONG ulCount, const TF_SELECTION *pSelection)
 
static HRESULT WINAPI Context_GetStart (ITfContext *iface, TfEditCookie ec, ITfRange **ppStart)
 
static HRESULT WINAPI Context_GetEnd (ITfContext *iface, TfEditCookie ec, ITfRange **ppEnd)
 
static HRESULT WINAPI Context_GetActiveView (ITfContext *iface, ITfContextView **ppView)
 
static HRESULT WINAPI Context_EnumViews (ITfContext *iface, IEnumTfContextViews **ppEnum)
 
static HRESULT WINAPI Context_GetStatus (ITfContext *iface, TF_STATUS *pdcs)
 
static HRESULT WINAPI Context_GetProperty (ITfContext *iface, REFGUID guidProp, ITfProperty **ppProp)
 
static HRESULT WINAPI Context_GetAppProperty (ITfContext *iface, REFGUID guidProp, ITfReadOnlyProperty **ppProp)
 
static HRESULT WINAPI Context_TrackProperties (ITfContext *iface, const GUID **prgProp, ULONG cProp, const GUID **prgAppProp, ULONG cAppProp, ITfReadOnlyProperty **ppProperty)
 
static HRESULT WINAPI Context_EnumProperties (ITfContext *iface, IEnumTfProperties **ppEnum)
 
static HRESULT WINAPI Context_GetDocumentMgr (ITfContext *iface, ITfDocumentMgr **ppDm)
 
static HRESULT WINAPI Context_CreateRangeBackup (ITfContext *iface, TfEditCookie ec, ITfRange *pRange, ITfRangeBackup **ppBackup)
 
static HRESULT WINAPI ContextSource_QueryInterface (ITfSource *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI ContextSource_AddRef (ITfSource *iface)
 
static ULONG WINAPI ContextSource_Release (ITfSource *iface)
 
static HRESULT WINAPI ContextSource_AdviseSink (ITfSource *iface, REFIID riid, IUnknown *punk, DWORD *pdwCookie)
 
static HRESULT WINAPI ContextSource_UnadviseSink (ITfSource *iface, DWORD pdwCookie)
 
static HRESULT WINAPI InsertAtSelection_QueryInterface (ITfInsertAtSelection *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI InsertAtSelection_AddRef (ITfInsertAtSelection *iface)
 
static ULONG WINAPI InsertAtSelection_Release (ITfInsertAtSelection *iface)
 
static HRESULT WINAPI InsertAtSelection_InsertTextAtSelection (ITfInsertAtSelection *iface, TfEditCookie ec, DWORD dwFlags, const WCHAR *pchText, LONG cch, ITfRange **ppRange)
 
static HRESULT WINAPI InsertAtSelection_InsertEmbeddedAtSelection (ITfInsertAtSelection *iface, TfEditCookie ec, DWORD dwFlags, IDataObject *pDataObject, ITfRange **ppRange)
 
static HRESULT WINAPI SourceSingle_QueryInterface (ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI SourceSingle_AddRef (ITfSourceSingle *iface)
 
static ULONG WINAPI SourceSingle_Release (ITfSourceSingle *iface)
 
static HRESULT WINAPI SourceSingle_AdviseSingleSink (ITfSourceSingle *iface, TfClientId tid, REFIID riid, IUnknown *punk)
 
static HRESULT WINAPI SourceSingle_UnadviseSingleSink (ITfSourceSingle *iface, TfClientId tid, REFIID riid)
 
static HRESULT WINAPI TextStoreACPSink_QueryInterface (ITextStoreACPSink *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI TextStoreACPSink_AddRef (ITextStoreACPSink *iface)
 
static ULONG WINAPI TextStoreACPSink_Release (ITextStoreACPSink *iface)
 
static HRESULT WINAPI TextStoreACPSink_OnTextChange (ITextStoreACPSink *iface, DWORD dwFlags, const TS_TEXTCHANGE *pChange)
 
static HRESULT WINAPI TextStoreACPSink_OnSelectionChange (ITextStoreACPSink *iface)
 
static HRESULT WINAPI TextStoreACPSink_OnLayoutChange (ITextStoreACPSink *iface, TsLayoutCode lcode, TsViewCookie vcView)
 
static HRESULT WINAPI TextStoreACPSink_OnStatusChange (ITextStoreACPSink *iface, DWORD dwFlags)
 
static HRESULT WINAPI TextStoreACPSink_OnAttrsChange (ITextStoreACPSink *iface, LONG acpStart, LONG acpEnd, ULONG cAttrs, const TS_ATTRID *paAttrs)
 
static HRESULT WINAPI TextStoreACPSink_OnLockGranted (ITextStoreACPSink *iface, DWORD dwLockFlags)
 
static HRESULT WINAPI TextStoreACPSink_OnStartEditTransaction (ITextStoreACPSink *iface)
 
static HRESULT WINAPI TextStoreACPSink_OnEndEditTransaction (ITextStoreACPSink *iface)
 
static HRESULT WINAPI TextStoreACPServices_QueryInterface (ITextStoreACPServices *iface, REFIID riid, void **obj)
 
static ULONG WINAPI TextStoreACPServices_AddRef (ITextStoreACPServices *iface)
 
static ULONG WINAPI TextStoreACPServices_Release (ITextStoreACPServices *iface)
 
static HRESULT WINAPI TextStoreACPServices_Serialize (ITextStoreACPServices *iface, ITfProperty *prop, ITfRange *range, TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream)
 
static HRESULT WINAPI TextStoreACPServices_Unserialize (ITextStoreACPServices *iface, ITfProperty *prop, const TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream, ITfPersistentPropertyLoaderACP *loader)
 
static HRESULT WINAPI TextStoreACPServices_ForceLoadProperty (ITextStoreACPServices *iface, ITfProperty *prop)
 
static HRESULT WINAPI TextStoreACPServices_CreateRange (ITextStoreACPServices *iface, LONG start, LONG end, ITfRangeACP **range)
 
HRESULT Context_Constructor (TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore)
 
HRESULT Context_Initialize (ITfContext *iface, ITfDocumentMgr *manager)
 
HRESULT Context_Uninitialize (ITfContext *iface)
 

Variables

static const ITfContextVtbl ContextVtbl
 
static const ITfSourceVtbl ContextSourceVtbl
 
static const
ITfInsertAtSelectionVtbl 
InsertAtSelectionVtbl
 
static const ITfSourceSingleVtbl ContextSourceSingleVtbl
 
static const ITextStoreACPSinkVtbl TextStoreACPSinkVtbl
 
static const
ITextStoreACPServicesVtbl 
TextStoreACPServicesVtbl
 

Typedef Documentation

Definition at line 1013 of file acpixf.h.

Function Documentation

static ULONG WINAPI Context_AddRef ( ITfContext iface)
static

Definition at line 159 of file context.c.

160 {
161  Context *This = impl_from_ITfContext(iface);
162  return InterlockedIncrement(&This->refCount);
163 }
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define InterlockedIncrement
Definition: armddk.h:53
HRESULT Context_Constructor ( TfClientId  tidOwner,
IUnknown punk,
ITfDocumentMgr mgr,
ITfContext **  ppOut,
TfEditCookie pecTextStore 
)

Definition at line 947 of file context.c.

Referenced by DocumentMgr_CreateContext().

948 {
949  Context *This;
950  EditCookie *cookie;
951 
953  if (This == NULL)
954  return E_OUTOFMEMORY;
955 
956  cookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie));
957  if (cookie == NULL)
958  {
959  HeapFree(GetProcessHeap(),0,This);
960  return E_OUTOFMEMORY;
961  }
962 
963  TRACE("(%p) %x %p %p %p\n",This, tidOwner, punk, ppOut, pecTextStore);
964 
965  This->ITfContext_iface.lpVtbl= &ContextVtbl;
966  This->ITfSource_iface.lpVtbl = &ContextSourceVtbl;
967  This->ITfInsertAtSelection_iface.lpVtbl = &InsertAtSelectionVtbl;
968  This->ITfSourceSingle_iface.lpVtbl = &ContextSourceSingleVtbl;
969  This->ITextStoreACPSink_iface.lpVtbl = &TextStoreACPSinkVtbl;
970  This->ITextStoreACPServices_iface.lpVtbl = &TextStoreACPServicesVtbl;
971  This->refCount = 1;
972  This->tidOwner = tidOwner;
973  This->connected = FALSE;
974  This->manager = mgr;
975 
976  CompartmentMgr_Constructor((IUnknown*)&This->ITfContext_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr);
977 
978  cookie->lockType = TF_ES_READ;
979  cookie->pOwningContext = This;
980 
981  if (punk)
982  {
983  IUnknown_QueryInterface(punk, &IID_ITextStoreACP,
984  (LPVOID*)&This->pITextStoreACP);
985 
986  IUnknown_QueryInterface(punk, &IID_ITfContextOwnerCompositionSink,
987  (LPVOID*)&This->pITfContextOwnerCompositionSink);
988 
989  if (!This->pITextStoreACP && !This->pITfContextOwnerCompositionSink)
990  FIXME("Unhandled pUnk\n");
991  }
992 
993  This->defaultCookie = generate_Cookie(COOKIE_MAGIC_EDITCOOKIE,cookie);
994  *pecTextStore = This->defaultCookie;
995 
996  list_init(&This->pContextKeyEventSink);
997  list_init(&This->pEditTransactionSink);
998  list_init(&This->pStatusSink);
999  list_init(&This->pTextEditSink);
1000  list_init(&This->pTextLayoutSink);
1001 
1002  *ppOut = &This->ITfContext_iface;
1003  TRACE("returning %p\n", *ppOut);
1004 
1005  return S_OK;
1006 }
const GUID IID_IUnknown
DWORD lockType
Definition: context.c:61
static const ITextStoreACPServicesVtbl TextStoreACPServicesVtbl
Definition: context.c:936
static const ITfSourceVtbl ContextSourceVtbl
Definition: context.c:562
static const ITfContextVtbl ContextVtbl
Definition: context.c:490
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:513
static const ITfInsertAtSelectionVtbl InsertAtSelectionVtbl
Definition: context.c:637
Context * pOwningContext
Definition: context.c:62
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define COOKIE_MAGIC_EDITCOOKIE
#define S_OK
Definition: intsafe.h:59
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut)
static const ITfSourceSingleVtbl ContextSourceSingleVtbl
Definition: context.c:683
#define HeapFree(x, y, z)
Definition: compat.h:394
DWORD generate_Cookie(DWORD magic, LPVOID data)
Definition: msctf.c:173
static const ITextStoreACPSinkVtbl TextStoreACPSinkVtbl
Definition: context.c:864
static HRESULT WINAPI Context_CreateRangeBackup ( ITfContext iface,
TfEditCookie  ec,
ITfRange pRange,
ITfRangeBackup **  ppBackup 
)
static

Definition at line 482 of file context.c.

484 {
485  Context *This = impl_from_ITfContext(iface);
486  FIXME("STUB:(%p)\n",This);
487  return E_NOTIMPL;
488 }
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static void Context_Destructor ( Context This)
static

Definition at line 95 of file context.c.

Referenced by Context_Release().

96 {
97  EditCookie *cookie;
98  TRACE("destroying %p\n", This);
99 
100  if (This->pITextStoreACP)
101  ITextStoreACP_Release(This->pITextStoreACP);
102 
103  if (This->pITfContextOwnerCompositionSink)
104  ITfContextOwnerCompositionSink_Release(This->pITfContextOwnerCompositionSink);
105 
106  if (This->defaultCookie)
107  {
108  cookie = remove_Cookie(This->defaultCookie);
109  HeapFree(GetProcessHeap(),0,cookie);
110  This->defaultCookie = 0;
111  }
112 
113  free_sinks(&This->pContextKeyEventSink);
114  free_sinks(&This->pEditTransactionSink);
115  free_sinks(&This->pStatusSink);
116  free_sinks(&This->pTextEditSink);
117  free_sinks(&This->pTextLayoutSink);
118 
119  CompartmentMgr_Destructor(This->CompartmentMgr);
120  HeapFree(GetProcessHeap(),0,This);
121 }
void free_sinks(struct list *sink_list)
Definition: msctf.c:308
LPVOID remove_Cookie(DWORD id)
Definition: msctf.c:243
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *iface)
#define HeapFree(x, y, z)
Definition: compat.h:394
static HRESULT WINAPI Context_EnumProperties ( ITfContext iface,
IEnumTfProperties **  ppEnum 
)
static

Definition at line 456 of file context.c.

458 {
459  Context *This = impl_from_ITfContext(iface);
460  FIXME("STUB:(%p)\n",This);
461  return E_NOTIMPL;
462 }
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI Context_EnumViews ( ITfContext iface,
IEnumTfContextViews **  ppEnum 
)
static

Definition at line 398 of file context.c.

400 {
401  Context *This = impl_from_ITfContext(iface);
402  FIXME("STUB:(%p)\n",This);
403  return E_NOTIMPL;
404 }
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI Context_GetActiveView ( ITfContext iface,
ITfContextView **  ppView 
)
static

Definition at line 390 of file context.c.

392 {
393  Context *This = impl_from_ITfContext(iface);
394  FIXME("STUB:(%p)\n",This);
395  return E_NOTIMPL;
396 }
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI Context_GetAppProperty ( ITfContext iface,
REFGUID  guidProp,
ITfReadOnlyProperty **  ppProp 
)
static

Definition at line 439 of file context.c.

441 {
442  Context *This = impl_from_ITfContext(iface);
443  FIXME("STUB:(%p)\n",This);
444  return E_NOTIMPL;
445 }
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI Context_GetDocumentMgr ( ITfContext iface,
ITfDocumentMgr **  ppDm 
)
static

Definition at line 464 of file context.c.

466 {
467  Context *This = impl_from_ITfContext(iface);
468  TRACE("(%p) %p\n",This,ppDm);
469 
470  if (!ppDm)
471  return E_INVALIDARG;
472 
473  *ppDm = This->manager;
474  if (!This->manager)
475  return S_FALSE;
476 
477  ITfDocumentMgr_AddRef(This->manager);
478 
479  return S_OK;
480 }
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static HRESULT WINAPI Context_GetEnd ( ITfContext iface,
TfEditCookie  ec,
ITfRange **  ppEnd 
)
static

Definition at line 359 of file context.c.

361 {
362  Context *This = impl_from_ITfContext(iface);
363  EditCookie *cookie;
364  LONG end;
365  TRACE("(%p) %i %p\n",This,ec,ppEnd);
366 
367  if (!ppEnd)
368  return E_INVALIDARG;
369 
370  *ppEnd = NULL;
371 
372  if (!This->connected)
373  return TF_E_DISCONNECTED;
374 
376  return TF_E_NOLOCK;
377 
378  if (!This->pITextStoreACP)
379  {
380  FIXME("Context does not have a ITextStoreACP\n");
381  return E_NOTIMPL;
382  }
383 
384  cookie = get_Cookie_data(ec);
385  ITextStoreACP_GetEndACP(This->pITextStoreACP,&end);
386 
387  return Range_Constructor(iface, This->pITextStoreACP, cookie->lockType, end, end, ppEnd);
388 }
LPVOID get_Cookie_data(DWORD id)
Definition: msctf.c:230
DWORD lockType
Definition: context.c:61
GLuint GLuint end
Definition: gl.h:1545
DWORD get_Cookie_magic(DWORD id)
Definition: msctf.c:217
long LONG
Definition: pedump.c:60
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:513
HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut) DECLSPEC_HIDDEN
Definition: range.c:309
#define TRACE(s)
Definition: solgame.cpp:4
#define COOKIE_MAGIC_EDITCOOKIE
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI Context_GetProperty ( ITfContext iface,
REFGUID  guidProp,
ITfProperty **  ppProp 
)
static

Definition at line 431 of file context.c.

433 {
434  Context *This = impl_from_ITfContext(iface);
435  FIXME("STUB:(%p)\n",This);
436  return E_NOTIMPL;
437 }
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI Context_GetSelection ( ITfContext iface,
TfEditCookie  ec,
ULONG  ulIndex,
ULONG  ulCount,
TF_SELECTION *  pSelection,
ULONG pcFetched 
)
static

Definition at line 239 of file context.c.

242 {
243  Context *This = impl_from_ITfContext(iface);
244  EditCookie *cookie;
245  ULONG count, i;
246  ULONG totalFetched = 0;
247  HRESULT hr = S_OK;
248 
249  if (!pSelection || !pcFetched)
250  return E_INVALIDARG;
251 
252  *pcFetched = 0;
253 
254  if (!This->connected)
255  return TF_E_DISCONNECTED;
256 
258  return TF_E_NOLOCK;
259 
260  if (!This->pITextStoreACP)
261  {
262  FIXME("Context does not have a ITextStoreACP\n");
263  return E_NOTIMPL;
264  }
265 
266  cookie = get_Cookie_data(ec);
267 
268  if (ulIndex == TF_DEFAULT_SELECTION)
269  count = 1;
270  else
271  count = ulCount;
272 
273  for (i = 0; i < count; i++)
274  {
275  DWORD fetched;
276  TS_SELECTION_ACP acps;
277 
278  hr = ITextStoreACP_GetSelection(This->pITextStoreACP, ulIndex + i,
279  1, &acps, &fetched);
280 
281  if (hr == TS_E_NOLOCK)
282  return TF_E_NOLOCK;
283  else if (SUCCEEDED(hr))
284  {
285  pSelection[totalFetched].style.ase = acps.style.ase;
286  pSelection[totalFetched].style.fInterimChar = acps.style.fInterimChar;
287  Range_Constructor(iface, This->pITextStoreACP, cookie->lockType, acps.acpStart, acps.acpEnd, &pSelection[totalFetched].range);
288  totalFetched ++;
289  }
290  else
291  break;
292  }
293 
294  *pcFetched = totalFetched;
295 
296  return hr;
297 }
TS_SELECTIONSTYLE style
Definition: textstor.idl:94
LPVOID get_Cookie_data(DWORD id)
Definition: msctf.c:230
DWORD lockType
Definition: context.c:61
DWORD get_Cookie_magic(DWORD id)
Definition: msctf.c:217
DWORD DWORD
Definition: winlogon.h:75
GLenum GLclampf GLint i
Definition: glfuncs.h:14
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut) DECLSPEC_HIDDEN
Definition: range.c:309
LONG HRESULT
Definition: typedefs.h:78
#define COOKIE_MAGIC_EDITCOOKIE
GLuint GLuint GLsizei count
Definition: gl.h:1545
ULONG ulIndex
Definition: symbols.c:92
#define S_OK
Definition: intsafe.h:59
TsActiveSelEnd ase
Definition: textstor.idl:86
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT WINAPI Context_GetStart ( ITfContext iface,
TfEditCookie  ec,
ITfRange **  ppStart 
)
static

Definition at line 337 of file context.c.

339 {
340  Context *This = impl_from_ITfContext(iface);
341  EditCookie *cookie;
342  TRACE("(%p) %i %p\n",This,ec,ppStart);
343 
344  if (!ppStart)
345  return E_INVALIDARG;
346 
347  *ppStart = NULL;
348 
349  if (!This->connected)
350  return TF_E_DISCONNECTED;
351 
353  return TF_E_NOLOCK;
354 
355  cookie = get_Cookie_data(ec);
356  return Range_Constructor(iface, This->pITextStoreACP, cookie->lockType, 0, 0, ppStart);
357 }
LPVOID get_Cookie_data(DWORD id)
Definition: msctf.c:230
DWORD lockType
Definition: context.c:61
DWORD get_Cookie_magic(DWORD id)
Definition: msctf.c:217
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:513
HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut) DECLSPEC_HIDDEN
Definition: range.c:309
#define TRACE(s)
Definition: solgame.cpp:4
#define COOKIE_MAGIC_EDITCOOKIE
static HRESULT WINAPI Context_GetStatus ( ITfContext iface,
TF_STATUS *  pdcs 
)
static

Definition at line 406 of file context.c.

408 {
409  Context *This = impl_from_ITfContext(iface);
410  TRACE("(%p) %p\n",This,pdcs);
411 
412  if (!This->connected)
413  return TF_E_DISCONNECTED;
414 
415  if (!pdcs)
416  return E_INVALIDARG;
417 
418  if (!This->pITextStoreACP)
419  {
420  FIXME("Context does not have a ITextStoreACP\n");
421  return E_NOTIMPL;
422  }
423 
424  ITextStoreACP_GetStatus(This->pITextStoreACP, &This->documentStatus);
425 
426  *pdcs = This->documentStatus;
427 
428  return S_OK;
429 }
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
HRESULT Context_Initialize ( ITfContext iface,
ITfDocumentMgr manager 
)

Definition at line 1008 of file context.c.

Referenced by DocumentMgr_Push().

1009 {
1010  Context *This = impl_from_ITfContext(iface);
1011 
1012  if (This->pITextStoreACP)
1013  ITextStoreACP_AdviseSink(This->pITextStoreACP, &IID_ITextStoreACPSink,
1014  (IUnknown*)&This->ITextStoreACPSink_iface, TS_AS_ALL_SINKS);
1015  This->connected = TRUE;
1016  This->manager = manager;
1017  return S_OK;
1018 }
#define TRUE
Definition: types.h:120
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
const DWORD TS_AS_ALL_SINKS
Definition: textstor.idl:54
#define S_OK
Definition: intsafe.h:59
static HRESULT WINAPI Context_InWriteSession ( ITfContext iface,
TfClientId  tid,
BOOL pfWriteSession 
)
static

Definition at line 230 of file context.c.

233 {
234  Context *This = impl_from_ITfContext(iface);
235  FIXME("STUB:(%p)\n",This);
236  return E_NOTIMPL;
237 }
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI Context_QueryInterface ( ITfContext iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 123 of file context.c.

124 {
125  Context *This = impl_from_ITfContext(iface);
126  *ppvOut = NULL;
127 
128  if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfContext))
129  {
130  *ppvOut = &This->ITfContext_iface;
131  }
132  else if (IsEqualIID(iid, &IID_ITfSource))
133  {
134  *ppvOut = &This->ITfSource_iface;
135  }
136  else if (IsEqualIID(iid, &IID_ITfInsertAtSelection))
137  {
138  *ppvOut = &This->ITfInsertAtSelection_iface;
139  }
140  else if (IsEqualIID(iid, &IID_ITfCompartmentMgr))
141  {
142  *ppvOut = This->CompartmentMgr;
143  }
144  else if (IsEqualIID(iid, &IID_ITfSourceSingle))
145  {
146  *ppvOut = &This->ITfSourceSingle_iface;
147  }
148 
149  if (*ppvOut)
150  {
151  ITfContext_AddRef(iface);
152  return S_OK;
153  }
154 
155  WARN("unsupported interface: %s\n", debugstr_guid(iid));
156  return E_NOINTERFACE;
157 }
#define E_NOINTERFACE
Definition: winerror.h:2364
const GUID IID_IUnknown
#define WARN(fmt,...)
Definition: debug.h:111
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
smooth NULL
Definition: ftsmooth.c:513
#define debugstr_guid
Definition: kernel32.h:35
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
static ULONG WINAPI Context_Release ( ITfContext iface)
static

Definition at line 165 of file context.c.

166 {
167  Context *This = impl_from_ITfContext(iface);
168  ULONG ret;
169 
170  ret = InterlockedDecrement(&This->refCount);
171  if (ret == 0)
172  Context_Destructor(This);
173  return ret;
174 }
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
int ret
#define InterlockedDecrement
Definition: armddk.h:52
static void Context_Destructor(Context *This)
Definition: context.c:95
unsigned int ULONG
Definition: retypes.h:1
static HRESULT WINAPI Context_RequestEditSession ( ITfContext iface,
TfClientId  tid,
ITfEditSession pes,
DWORD  dwFlags,
HRESULT phrSession 
)
static

Definition at line 179 of file context.c.

182 {
183  Context *This = impl_from_ITfContext(iface);
184  HRESULT hr;
185  DWORD dwLockFlags = 0x0;
186 
187  TRACE("(%p) %i %p %x %p\n",This, tid, pes, dwFlags, phrSession);
188 
189  if (!(dwFlags & TF_ES_READ) && !(dwFlags & TF_ES_READWRITE))
190  {
191  *phrSession = E_FAIL;
192  return E_INVALIDARG;
193  }
194 
195  if (!This->pITextStoreACP)
196  {
197  FIXME("No ITextStoreACP available\n");
198  *phrSession = E_FAIL;
199  return E_FAIL;
200  }
201 
202  if (!(dwFlags & TF_ES_ASYNC))
203  dwLockFlags |= TS_LF_SYNC;
204 
205  if ((dwFlags & TF_ES_READWRITE) == TF_ES_READWRITE)
206  dwLockFlags |= TS_LF_READWRITE;
207  else if (dwFlags & TF_ES_READ)
208  dwLockFlags |= TS_LF_READ;
209 
210  if (!This->documentStatus.dwDynamicFlags)
211  ITextStoreACP_GetStatus(This->pITextStoreACP, &This->documentStatus);
212 
213  if (((dwFlags & TF_ES_READWRITE) == TF_ES_READWRITE) && (This->documentStatus.dwDynamicFlags & TS_SD_READONLY))
214  {
215  *phrSession = TS_E_READONLY;
216  return S_OK;
217  }
218 
219  if (FAILED (ITfEditSession_QueryInterface(pes, &IID_ITfEditSession, (LPVOID*)&This->currentEditSession)))
220  {
221  *phrSession = E_FAIL;
222  return E_INVALIDARG;
223  }
224 
225  hr = ITextStoreACP_RequestLock(This->pITextStoreACP, dwLockFlags, phrSession);
226 
227  return hr;
228 }
const DWORD TS_LF_READWRITE
Definition: textstor.idl:58
#define E_FAIL
Definition: ddrawi.h:102
DWORD DWORD
Definition: winlogon.h:75
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
const DWORD TS_LF_READ
Definition: textstor.idl:57
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1170
const DWORD TS_LF_SYNC
Definition: textstor.idl:56
#define S_OK
Definition: intsafe.h:59
const DWORD TS_SD_READONLY
Definition: textstor.idl:40
static TfClientId tid
static HRESULT WINAPI Context_SetSelection ( ITfContext iface,
TfEditCookie  ec,
ULONG  ulCount,
const TF_SELECTION *  pSelection 
)
static

Definition at line 299 of file context.c.

301 {
302  Context *This = impl_from_ITfContext(iface);
303  TS_SELECTION_ACP *acp;
304  ULONG i;
305  HRESULT hr;
306 
307  TRACE("(%p) %i %i %p\n",This,ec,ulCount,pSelection);
308 
309  if (!This->pITextStoreACP)
310  {
311  FIXME("Context does not have a ITextStoreACP\n");
312  return E_NOTIMPL;
313  }
314 
316  return TF_E_NOLOCK;
317 
318  acp = HeapAlloc(GetProcessHeap(), 0, sizeof(TS_SELECTION_ACP) * ulCount);
319  if (!acp)
320  return E_OUTOFMEMORY;
321 
322  for (i = 0; i < ulCount; i++)
323  if (FAILED(TF_SELECTION_to_TS_SELECTION_ACP(&pSelection[i], &acp[i])))
324  {
325  TRACE("Selection Conversion Failed\n");
326  HeapFree(GetProcessHeap(), 0 , acp);
327  return E_FAIL;
328  }
329 
330  hr = ITextStoreACP_SetSelection(This->pITextStoreACP, ulCount, acp);
331 
332  HeapFree(GetProcessHeap(), 0, acp);
333 
334  return hr;
335 }
DWORD get_Cookie_magic(DWORD id)
Definition: msctf.c:217
#define E_FAIL
Definition: ddrawi.h:102
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:78
#define COOKIE_MAGIC_EDITCOOKIE
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int ULONG
Definition: retypes.h:1
HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp) DECLSPEC_HIDDEN
Definition: range.c:335
#define HeapFree(x, y, z)
Definition: compat.h:394
static HRESULT WINAPI Context_TrackProperties ( ITfContext iface,
const GUID **  prgProp,
ULONG  cProp,
const GUID **  prgAppProp,
ULONG  cAppProp,
ITfReadOnlyProperty **  ppProperty 
)
static

Definition at line 447 of file context.c.

450 {
451  Context *This = impl_from_ITfContext(iface);
452  FIXME("STUB:(%p)\n",This);
453  return E_NOTIMPL;
454 }
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
HRESULT Context_Uninitialize ( ITfContext iface)

Definition at line 1020 of file context.c.

Referenced by DocumentMgr_Pop().

1021 {
1022  Context *This = impl_from_ITfContext(iface);
1023 
1024  if (This->pITextStoreACP)
1025  ITextStoreACP_UnadviseSink(This->pITextStoreACP, (IUnknown*)&This->ITextStoreACPSink_iface);
1026  This->connected = FALSE;
1027  This->manager = NULL;
1028  return S_OK;
1029 }
#define FALSE
Definition: types.h:117
static Context * impl_from_ITfContext(ITfContext *iface)
Definition: context.c:65
smooth NULL
Definition: ftsmooth.c:513
#define S_OK
Definition: intsafe.h:59
static ULONG WINAPI ContextSource_AddRef ( ITfSource iface)
static

Definition at line 518 of file context.c.

519 {
520  Context *This = impl_from_ITfSource(iface);
521  return ITfContext_AddRef(&This->ITfContext_iface);
522 }
static Context * impl_from_ITfSource(ITfSource *iface)
Definition: context.c:70
static HRESULT WINAPI ContextSource_AdviseSink ( ITfSource iface,
REFIID  riid,
IUnknown punk,
DWORD pdwCookie 
)
static

Definition at line 533 of file context.c.

535 {
536  Context *This = impl_from_ITfSource(iface);
537 
538  TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
539 
540  if (!riid || !punk || !pdwCookie)
541  return E_INVALIDARG;
542 
543  if (IsEqualIID(riid, &IID_ITfTextEditSink))
544  return advise_sink(&This->pTextEditSink, &IID_ITfTextEditSink, COOKIE_MAGIC_CONTEXTSINK, punk, pdwCookie);
545 
546  FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid));
547  return E_NOTIMPL;
548 }
REFIID riid
Definition: precomp.h:44
HRESULT advise_sink(struct list *sink_list, REFIID riid, DWORD cookie_magic, IUnknown *unk, DWORD *cookie)
Definition: msctf.c:269
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static Context * impl_from_ITfSource(ITfSource *iface)
Definition: context.c:70
#define COOKIE_MAGIC_CONTEXTSINK
#define E_NOTIMPL
Definition: ddrawi.h:99
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
static HRESULT WINAPI ContextSource_QueryInterface ( ITfSource iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 512 of file context.c.

513 {
514  Context *This = impl_from_ITfSource(iface);
515  return ITfContext_QueryInterface(&This->ITfContext_iface, iid, ppvOut);
516 }
static Context * impl_from_ITfSource(ITfSource *iface)
Definition: context.c:70
static ULONG WINAPI ContextSource_Release ( ITfSource iface)
static

Definition at line 524 of file context.c.

525 {
526  Context *This = impl_from_ITfSource(iface);
527  return ITfContext_Release(&This->ITfContext_iface);
528 }
static Context * impl_from_ITfSource(ITfSource *iface)
Definition: context.c:70
static HRESULT WINAPI ContextSource_UnadviseSink ( ITfSource iface,
DWORD  pdwCookie 
)
static

Definition at line 550 of file context.c.

551 {
552  Context *This = impl_from_ITfSource(iface);
553 
554  TRACE("(%p) %x\n",This,pdwCookie);
555 
557  return E_INVALIDARG;
558 
559  return unadvise_sink(pdwCookie);
560 }
DWORD get_Cookie_magic(DWORD id)
Definition: msctf.c:217
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
static Context * impl_from_ITfSource(ITfSource *iface)
Definition: context.c:70
#define COOKIE_MAGIC_CONTEXTSINK
HRESULT unadvise_sink(DWORD cookie)
Definition: msctf.c:296
static Context* impl_from_ITextStoreACPServices ( ITextStoreACPServices iface)
inlinestatic
static Context* impl_from_ITfInsertAtSelection ( ITfInsertAtSelection iface)
inlinestatic

Definition at line 75 of file context.c.

Referenced by InsertAtSelection_AddRef(), InsertAtSelection_InsertEmbeddedAtSelection(), InsertAtSelection_InsertTextAtSelection(), InsertAtSelection_QueryInterface(), and InsertAtSelection_Release().

76 {
77  return CONTAINING_RECORD(iface, Context, ITfInsertAtSelection_iface);
78 }
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
static Context* impl_from_ITfSource ( ITfSource iface)
inlinestatic

Definition at line 70 of file context.c.

Referenced by ContextSource_AddRef(), ContextSource_AdviseSink(), ContextSource_QueryInterface(), ContextSource_Release(), and ContextSource_UnadviseSink().

71 {
72  return CONTAINING_RECORD(iface, Context, ITfSource_iface);
73 }
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
static Context* impl_from_ITfSourceSingle ( ITfSourceSingle iface)
inlinestatic

Definition at line 80 of file context.c.

Referenced by SourceSingle_AddRef(), SourceSingle_AdviseSingleSink(), SourceSingle_QueryInterface(), SourceSingle_Release(), and SourceSingle_UnadviseSingleSink().

81 {
82  return CONTAINING_RECORD(iface, Context, ITfSourceSingle_iface);
83 }
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
static ULONG WINAPI InsertAtSelection_AddRef ( ITfInsertAtSelection iface)
static

Definition at line 580 of file context.c.

581 {
583  return ITfContext_AddRef(&This->ITfContext_iface);
584 }
static Context * impl_from_ITfInsertAtSelection(ITfInsertAtSelection *iface)
Definition: context.c:75
static HRESULT WINAPI InsertAtSelection_InsertEmbeddedAtSelection ( ITfInsertAtSelection iface,
TfEditCookie  ec,
DWORD  dwFlags,
IDataObject pDataObject,
ITfRange **  ppRange 
)
static

Definition at line 628 of file context.c.

631 {
633  FIXME("STUB:(%p)\n",This);
634  return E_NOTIMPL;
635 }
#define FIXME(fmt,...)
Definition: debug.h:110
static Context * impl_from_ITfInsertAtSelection(ITfInsertAtSelection *iface)
Definition: context.c:75
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI InsertAtSelection_InsertTextAtSelection ( ITfInsertAtSelection iface,
TfEditCookie  ec,
DWORD  dwFlags,
const WCHAR pchText,
LONG  cch,
ITfRange **  ppRange 
)
static

Definition at line 592 of file context.c.

595 {
597  EditCookie *cookie;
598  LONG acpStart, acpEnd;
599  TS_TEXTCHANGE change;
600  HRESULT hr;
601 
602  TRACE("(%p) %i %x %s %p\n",This, ec, dwFlags, debugstr_wn(pchText,cch), ppRange);
603 
604  if (!This->connected)
605  return TF_E_DISCONNECTED;
606 
608  return TF_E_NOLOCK;
609 
610  cookie = get_Cookie_data(ec);
611 
612  if ((cookie->lockType & TS_LF_READWRITE) != TS_LF_READWRITE )
613  return TS_E_READONLY;
614 
615  if (!This->pITextStoreACP)
616  {
617  FIXME("Context does not have a ITextStoreACP\n");
618  return E_NOTIMPL;
619  }
620 
621  hr = ITextStoreACP_InsertTextAtSelection(This->pITextStoreACP, dwFlags, pchText, cch, &acpStart, &acpEnd, &change);
622  if (SUCCEEDED(hr))
623  Range_Constructor(&This->ITfContext_iface, This->pITextStoreACP, cookie->lockType, change.acpStart, change.acpNewEnd, ppRange);
624 
625  return hr;
626 }
LPVOID get_Cookie_data(DWORD id)
Definition: msctf.c:230
DWORD lockType
Definition: context.c:61
const DWORD TS_LF_READWRITE
Definition: textstor.idl:58
DWORD get_Cookie_magic(DWORD id)
Definition: msctf.c:217
LONG acpNewEnd
Definition: textstor.idl:81
long LONG
Definition: pedump.c:60
#define FIXME(fmt,...)
Definition: debug.h:110
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:201
static Context * impl_from_ITfInsertAtSelection(ITfInsertAtSelection *iface)
Definition: context.c:75
HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut) DECLSPEC_HIDDEN
Definition: range.c:309
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
#define COOKIE_MAGIC_EDITCOOKIE
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1170
#define debugstr_wn
Definition: kernel32.h:33
#define E_NOTIMPL
Definition: ddrawi.h:99
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT WINAPI InsertAtSelection_QueryInterface ( ITfInsertAtSelection iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 574 of file context.c.

575 {
577  return ITfContext_QueryInterface(&This->ITfContext_iface, iid, ppvOut);
578 }
static Context * impl_from_ITfInsertAtSelection(ITfInsertAtSelection *iface)
Definition: context.c:75
static ULONG WINAPI InsertAtSelection_Release ( ITfInsertAtSelection iface)
static

Definition at line 586 of file context.c.

587 {
589  return ITfContext_Release(&This->ITfContext_iface);
590 }
static Context * impl_from_ITfInsertAtSelection(ITfInsertAtSelection *iface)
Definition: context.c:75
static ULONG WINAPI SourceSingle_AddRef ( ITfSourceSingle iface)
static

Definition at line 655 of file context.c.

656 {
657  Context *This = impl_from_ITfSourceSingle(iface);
658  return ITfContext_AddRef(&This->ITfContext_iface);
659 }
static Context * impl_from_ITfSourceSingle(ITfSourceSingle *iface)
Definition: context.c:80
static HRESULT WINAPI SourceSingle_AdviseSingleSink ( ITfSourceSingle iface,
TfClientId  tid,
REFIID  riid,
IUnknown punk 
)
static

Definition at line 667 of file context.c.

669 {
670  Context *This = impl_from_ITfSourceSingle(iface);
671  FIXME("STUB:(%p) %i %s %p\n",This, tid, debugstr_guid(riid),punk);
672  return E_NOTIMPL;
673 }
static Context * impl_from_ITfSourceSingle(ITfSourceSingle *iface)
Definition: context.c:80
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define E_NOTIMPL
Definition: ddrawi.h:99
static TfClientId tid
static HRESULT WINAPI SourceSingle_QueryInterface ( ITfSourceSingle iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 649 of file context.c.

650 {
651  Context *This = impl_from_ITfSourceSingle(iface);
652  return ITfContext_QueryInterface(&This->ITfContext_iface, iid, ppvOut);
653 }
static Context * impl_from_ITfSourceSingle(ITfSourceSingle *iface)
Definition: context.c:80
static ULONG WINAPI SourceSingle_Release ( ITfSourceSingle iface)
static

Definition at line 661 of file context.c.

662 {
663  Context *This = impl_from_ITfSourceSingle(iface);
664  return ITfContext_Release(&This->ITfContext_iface);
665 }
static Context * impl_from_ITfSourceSingle(ITfSourceSingle *iface)
Definition: context.c:80
static HRESULT WINAPI SourceSingle_UnadviseSingleSink ( ITfSourceSingle iface,
TfClientId  tid,
REFIID  riid 
)
static

Definition at line 675 of file context.c.

677 {
678  Context *This = impl_from_ITfSourceSingle(iface);
679  FIXME("STUB:(%p) %i %s\n",This, tid, debugstr_guid(riid));
680  return E_NOTIMPL;
681 }
static Context * impl_from_ITfSourceSingle(ITfSourceSingle *iface)
Definition: context.c:80
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define E_NOTIMPL
Definition: ddrawi.h:99
static TfClientId tid
static ULONG WINAPI TextStoreACPServices_AddRef ( ITextStoreACPServices iface)
static

Definition at line 885 of file context.c.

886 {
888  return ITextStoreACPSink_AddRef(&This->ITextStoreACPSink_iface);
889 }
static Context * impl_from_ITextStoreACPServices(ITextStoreACPServices *iface)
Definition: context.c:90
static HRESULT WINAPI TextStoreACPServices_CreateRange ( ITextStoreACPServices iface,
LONG  start,
LONG  end,
ITfRangeACP **  range 
)
static

Definition at line 926 of file context.c.

928 {
930 
931  FIXME("stub: %p %d %d %p\n", This, start, end, range);
932 
933  return S_OK;
934 }
static Context * impl_from_ITextStoreACPServices(ITextStoreACPServices *iface)
Definition: context.c:90
GLuint GLuint end
Definition: gl.h:1545
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
GLuint start
Definition: gl.h:1545
static HRESULT WINAPI TextStoreACPServices_ForceLoadProperty ( ITextStoreACPServices iface,
ITfProperty prop 
)
static

Definition at line 917 of file context.c.

918 {
920 
921  FIXME("stub: %p %p\n", This, prop);
922 
923  return E_NOTIMPL;
924 }
static Context * impl_from_ITextStoreACPServices(ITextStoreACPServices *iface)
Definition: context.c:90
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI TextStoreACPServices_QueryInterface ( ITextStoreACPServices iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 879 of file context.c.

880 {
882  return ITextStoreACPSink_QueryInterface(&This->ITextStoreACPSink_iface, riid, obj);
883 }
REFIID riid
Definition: precomp.h:44
static Context * impl_from_ITextStoreACPServices(ITextStoreACPServices *iface)
Definition: context.c:90
static ULONG WINAPI TextStoreACPServices_Release ( ITextStoreACPServices iface)
static

Definition at line 891 of file context.c.

892 {
894  return ITextStoreACPSink_Release(&This->ITextStoreACPSink_iface);
895 }
static Context * impl_from_ITextStoreACPServices(ITextStoreACPServices *iface)
Definition: context.c:90
static HRESULT WINAPI TextStoreACPServices_Serialize ( ITextStoreACPServices iface,
ITfProperty prop,
ITfRange range,
TF_PERSISTENT_PROPERTY_HEADER_ACP header,
IStream stream 
)
static

Definition at line 897 of file context.c.

899 {
901 
902  FIXME("stub: %p %p %p %p %p\n", This, prop, range, header, stream);
903 
904  return E_NOTIMPL;
905 }
static Context * impl_from_ITextStoreACPServices(ITextStoreACPServices *iface)
Definition: context.c:90
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI TextStoreACPServices_Unserialize ( ITextStoreACPServices iface,
ITfProperty prop,
const TF_PERSISTENT_PROPERTY_HEADER_ACP header,
IStream stream,
ITfPersistentPropertyLoaderACP loader 
)
static

Definition at line 907 of file context.c.

909 {
911 
912  FIXME("stub: %p %p %p %p %p\n", This, prop, header, stream, loader);
913 
914  return E_NOTIMPL;
915 }
static Context * impl_from_ITextStoreACPServices(ITextStoreACPServices *iface)
Definition: context.c:90
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static ULONG WINAPI TextStoreACPSink_AddRef ( ITextStoreACPSink iface)
static

Definition at line 719 of file context.c.

720 {
721  Context *This = impl_from_ITextStoreACPSink(iface);
722  return ITfContext_AddRef(&This->ITfContext_iface);
723 }
static Context * impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
Definition: context.c:85
static HRESULT WINAPI TextStoreACPSink_OnAttrsChange ( ITextStoreACPSink iface,
LONG  acpStart,
LONG  acpEnd,
ULONG  cAttrs,
const TS_ATTRID paAttrs 
)
static

Definition at line 780 of file context.c.

782 {
783  Context *This = impl_from_ITextStoreACPSink(iface);
784  FIXME("STUB:(%p)\n",This);
785  return E_NOTIMPL;
786 }
#define FIXME(fmt,...)
Definition: debug.h:110
static Context * impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
Definition: context.c:85
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI TextStoreACPSink_OnEndEditTransaction ( ITextStoreACPSink iface)
static

Definition at line 857 of file context.c.

858 {
859  Context *This = impl_from_ITextStoreACPSink(iface);
860  FIXME("STUB:(%p)\n",This);
861  return E_NOTIMPL;
862 }
#define FIXME(fmt,...)
Definition: debug.h:110
static Context * impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
Definition: context.c:85
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI TextStoreACPSink_OnLayoutChange ( ITextStoreACPSink iface,
TsLayoutCode  lcode,
TsViewCookie  vcView 
)
static

Definition at line 750 of file context.c.

752 {
753  Context *This = impl_from_ITextStoreACPSink(iface);
754  FIXME("STUB:(%p)\n",This);
755  return E_NOTIMPL;
756 }
#define FIXME(fmt,...)
Definition: debug.h:110
static Context * impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
Definition: context.c:85
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI TextStoreACPSink_OnLockGranted ( ITextStoreACPSink iface,
DWORD  dwLockFlags 
)
static

Definition at line 788 of file context.c.

790 {
791  Context *This = impl_from_ITextStoreACPSink(iface);
792  HRESULT hr;
793  EditCookie *cookie,*sinkcookie;
794  TfEditCookie ec;
795  struct list *cursor;
796 
797  TRACE("(%p) %x\n",This, dwLockFlags);
798 
799  if (!This->currentEditSession)
800  {
801  FIXME("OnLockGranted called for something other than an EditSession\n");
802  return S_OK;
803  }
804 
805  cookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie));
806  if (!cookie)
807  return E_OUTOFMEMORY;
808 
809  sinkcookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie));
810  if (!sinkcookie)
811  {
812  HeapFree(GetProcessHeap(), 0, cookie);
813  return E_OUTOFMEMORY;
814  }
815 
816  cookie->lockType = dwLockFlags;
817  cookie->pOwningContext = This;
819 
820  hr = ITfEditSession_DoEditSession(This->currentEditSession, ec);
821 
822  if ((dwLockFlags&TS_LF_READWRITE) == TS_LF_READWRITE)
823  {
825  TfEditCookie sc;
826 
827  sinkcookie->lockType = TS_LF_READ;
828  sinkcookie->pOwningContext = This;
829  sc = generate_Cookie(COOKIE_MAGIC_EDITCOOKIE, sinkcookie);
830 
831  /*TODO: implement ITfEditRecord */
832  SINK_FOR_EACH(cursor, &This->pTextEditSink, ITfTextEditSink, sink)
833  {
834  ITfTextEditSink_OnEndEdit(sink, (ITfContext*) &This->ITfContext_iface, sc, NULL);
835  }
836  sinkcookie = remove_Cookie(sc);
837  }
838  HeapFree(GetProcessHeap(),0,sinkcookie);
839 
840  ITfEditSession_Release(This->currentEditSession);
841  This->currentEditSession = NULL;
842 
843  /* Edit Cookie is only valid during the edit session */
844  cookie = remove_Cookie(ec);
845  HeapFree(GetProcessHeap(),0,cookie);
846 
847  return hr;
848 }
DWORD lockType
Definition: context.c:61
DWORD TfEditCookie
Definition: msctf.idl:67
#define SINK_FOR_EACH(cursor, list, type, elem)
const DWORD TS_LF_READWRITE
Definition: textstor.idl:58
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LPVOID remove_Cookie(DWORD id)
Definition: msctf.c:243
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:513
Context * pOwningContext
Definition: context.c:62
static Context * impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
Definition: context.c:85
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:78
#define COOKIE_MAGIC_EDITCOOKIE
const DWORD TS_LF_READ
Definition: textstor.idl:57
Definition: _list.h:228
#define S_OK
Definition: intsafe.h:59
const char cursor[]
Definition: icontest.c:13
#define HeapFree(x, y, z)
Definition: compat.h:394
DWORD generate_Cookie(DWORD magic, LPVOID data)
Definition: msctf.c:173
static HRESULT WINAPI TextStoreACPSink_OnSelectionChange ( ITextStoreACPSink iface)
static

Definition at line 743 of file context.c.

744 {
745  Context *This = impl_from_ITextStoreACPSink(iface);
746  FIXME("STUB:(%p)\n",This);
747  return E_NOTIMPL;
748 }
#define FIXME(fmt,...)
Definition: debug.h:110
static Context * impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
Definition: context.c:85
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI TextStoreACPSink_OnStartEditTransaction ( ITextStoreACPSink iface)
static

Definition at line 850 of file context.c.

851 {
852  Context *This = impl_from_ITextStoreACPSink(iface);
853  FIXME("STUB:(%p)\n",This);
854  return E_NOTIMPL;
855 }
#define FIXME(fmt,...)
Definition: debug.h:110
static Context * impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
Definition: context.c:85
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI TextStoreACPSink_OnStatusChange ( ITextStoreACPSink iface,
DWORD  dwFlags 
)
static

Definition at line 758 of file context.c.

760 {
761  Context *This = impl_from_ITextStoreACPSink(iface);
762  HRESULT hr, hrSession;
763 
764  TRACE("(%p) %x\n",This, dwFlags);
765 
766  if (!This->pITextStoreACP)
767  {
768  FIXME("Context does not have a ITextStoreACP\n");
769  return E_NOTIMPL;
770  }
771 
772  hr = ITextStoreACP_RequestLock(This->pITextStoreACP, TS_LF_READ, &hrSession);
773 
774  if(SUCCEEDED(hr) && SUCCEEDED(hrSession))
775  This->documentStatus.dwDynamicFlags = dwFlags;
776 
777  return S_OK;
778 }
#define FIXME(fmt,...)
Definition: debug.h:110
static Context * impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
Definition: context.c:85
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
const DWORD TS_LF_READ
Definition: textstor.idl:57
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1170
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT WINAPI TextStoreACPSink_OnTextChange ( ITextStoreACPSink iface,
DWORD  dwFlags,
const TS_TEXTCHANGE pChange 
)
static

Definition at line 735 of file context.c.

737 {
738  Context *This = impl_from_ITextStoreACPSink(iface);
739  FIXME("STUB:(%p)\n",This);
740  return E_NOTIMPL;
741 }
#define FIXME(fmt,...)
Definition: debug.h:110
static Context * impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
Definition: context.c:85
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI TextStoreACPSink_QueryInterface ( ITextStoreACPSink iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 696 of file context.c.

697 {
698  Context *This = impl_from_ITextStoreACPSink(iface);
699 
700  *ppvOut = NULL;
701 
702  if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITextStoreACPSink))
703  {
704  *ppvOut = &This->ITextStoreACPSink_iface;
705  }
706  else if (IsEqualIID(iid, &IID_ITextStoreACPServices))
707  *ppvOut = &This->ITextStoreACPServices_iface;
708 
709  if (*ppvOut)
710  {
711  ITextStoreACPSink_AddRef(iface);
712  return S_OK;
713  }
714 
715  WARN("unsupported interface: %s\n", debugstr_guid(iid));
716  return E_NOINTERFACE;
717 }
#define E_NOINTERFACE
Definition: winerror.h:2364
const GUID IID_IUnknown
#define WARN(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:513
#define debugstr_guid
Definition: kernel32.h:35
static Context * impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
Definition: context.c:85
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
static ULONG WINAPI TextStoreACPSink_Release ( ITextStoreACPSink iface)
static

Definition at line 725 of file context.c.

726 {
727  Context *This = impl_from_ITextStoreACPSink(iface);
728  return ITfContext_Release(&This->ITfContext_iface);
729 }
static Context * impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
Definition: context.c:85

Variable Documentation

const ITfSourceSingleVtbl ContextSourceSingleVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI SourceSingle_AdviseSingleSink(ITfSourceSingle *iface, TfClientId tid, REFIID riid, IUnknown *punk)
Definition: context.c:667
static ULONG WINAPI SourceSingle_Release(ITfSourceSingle *iface)
Definition: context.c:661
static HRESULT WINAPI SourceSingle_UnadviseSingleSink(ITfSourceSingle *iface, TfClientId tid, REFIID riid)
Definition: context.c:675
static ULONG WINAPI SourceSingle_AddRef(ITfSourceSingle *iface)
Definition: context.c:655
static HRESULT WINAPI SourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut)
Definition: context.c:649

Definition at line 683 of file context.c.

Referenced by Context_Constructor().

const ITfSourceVtbl ContextSourceVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI ContextSource_AdviseSink(ITfSource *iface, REFIID riid, IUnknown *punk, DWORD *pdwCookie)
Definition: context.c:533
static HRESULT WINAPI ContextSource_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
Definition: context.c:512
static ULONG WINAPI ContextSource_Release(ITfSource *iface)
Definition: context.c:524
static HRESULT WINAPI ContextSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
Definition: context.c:550
static ULONG WINAPI ContextSource_AddRef(ITfSource *iface)
Definition: context.c:518

Definition at line 562 of file context.c.

Referenced by Context_Constructor().

const ITfContextVtbl ContextVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI Context_TrackProperties(ITfContext *iface, const GUID **prgProp, ULONG cProp, const GUID **prgAppProp, ULONG cAppProp, ITfReadOnlyProperty **ppProperty)
Definition: context.c:447
static HRESULT WINAPI Context_RequestEditSession(ITfContext *iface, TfClientId tid, ITfEditSession *pes, DWORD dwFlags, HRESULT *phrSession)
Definition: context.c:179
static HRESULT WINAPI Context_CreateRangeBackup(ITfContext *iface, TfEditCookie ec, ITfRange *pRange, ITfRangeBackup **ppBackup)
Definition: context.c:482
static HRESULT WINAPI Context_GetDocumentMgr(ITfContext *iface, ITfDocumentMgr **ppDm)
Definition: context.c:464
static HRESULT WINAPI Context_EnumViews(ITfContext *iface, IEnumTfContextViews **ppEnum)
Definition: context.c:398
static HRESULT WINAPI Context_SetSelection(ITfContext *iface, TfEditCookie ec, ULONG ulCount, const TF_SELECTION *pSelection)
Definition: context.c:299
static HRESULT WINAPI Context_GetStatus(ITfContext *iface, TF_STATUS *pdcs)
Definition: context.c:406
void Context_AddRef(context_t *context)
Definition: context.c:73
void Context_Release(context_t *context)
Definition: context.c:101
static HRESULT WINAPI Context_GetProperty(ITfContext *iface, REFGUID guidProp, ITfProperty **ppProp)
Definition: context.c:431
static HRESULT WINAPI Context_GetSelection(ITfContext *iface, TfEditCookie ec, ULONG ulIndex, ULONG ulCount, TF_SELECTION *pSelection, ULONG *pcFetched)
Definition: context.c:239
static HRESULT WINAPI Context_GetStart(ITfContext *iface, TfEditCookie ec, ITfRange **ppStart)
Definition: context.c:337
static HRESULT WINAPI Context_EnumProperties(ITfContext *iface, IEnumTfProperties **ppEnum)
Definition: context.c:456
static HRESULT WINAPI Context_QueryInterface(ITfContext *iface, REFIID iid, LPVOID *ppvOut)
Definition: context.c:123
static HRESULT WINAPI Context_GetActiveView(ITfContext *iface, ITfContextView **ppView)
Definition: context.c:390
static HRESULT WINAPI Context_InWriteSession(ITfContext *iface, TfClientId tid, BOOL *pfWriteSession)
Definition: context.c:230
static HRESULT WINAPI Context_GetAppProperty(ITfContext *iface, REFGUID guidProp, ITfReadOnlyProperty **ppProp)
Definition: context.c:439
static HRESULT WINAPI Context_GetEnd(ITfContext *iface, TfEditCookie ec, ITfRange **ppEnd)
Definition: context.c:359

Definition at line 490 of file context.c.

Referenced by Context_Constructor().

const ITfInsertAtSelectionVtbl InsertAtSelectionVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI InsertAtSelection_InsertEmbeddedAtSelection(ITfInsertAtSelection *iface, TfEditCookie ec, DWORD dwFlags, IDataObject *pDataObject, ITfRange **ppRange)
Definition: context.c:628
static ULONG WINAPI InsertAtSelection_Release(ITfInsertAtSelection *iface)
Definition: context.c:586
static ULONG WINAPI InsertAtSelection_AddRef(ITfInsertAtSelection *iface)
Definition: context.c:580
static HRESULT WINAPI InsertAtSelection_QueryInterface(ITfInsertAtSelection *iface, REFIID iid, LPVOID *ppvOut)
Definition: context.c:574
static HRESULT WINAPI InsertAtSelection_InsertTextAtSelection(ITfInsertAtSelection *iface, TfEditCookie ec, DWORD dwFlags, const WCHAR *pchText, LONG cch, ITfRange **ppRange)
Definition: context.c:592

Definition at line 637 of file context.c.

Referenced by Context_Constructor().

const ITextStoreACPServicesVtbl TextStoreACPServicesVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI TextStoreACPServices_Unserialize(ITextStoreACPServices *iface, ITfProperty *prop, const TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream, ITfPersistentPropertyLoaderACP *loader)
Definition: context.c:907
static HRESULT WINAPI TextStoreACPServices_QueryInterface(ITextStoreACPServices *iface, REFIID riid, void **obj)
Definition: context.c:879
static HRESULT WINAPI TextStoreACPServices_CreateRange(ITextStoreACPServices *iface, LONG start, LONG end, ITfRangeACP **range)
Definition: context.c:926
static HRESULT WINAPI TextStoreACPServices_ForceLoadProperty(ITextStoreACPServices *iface, ITfProperty *prop)
Definition: context.c:917
static HRESULT WINAPI TextStoreACPServices_Serialize(ITextStoreACPServices *iface, ITfProperty *prop, ITfRange *range, TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream)
Definition: context.c:897
static ULONG WINAPI TextStoreACPServices_AddRef(ITextStoreACPServices *iface)
Definition: context.c:885
static ULONG WINAPI TextStoreACPServices_Release(ITextStoreACPServices *iface)
Definition: context.c:891

Definition at line 936 of file context.c.

Referenced by Context_Constructor().

const ITextStoreACPSinkVtbl TextStoreACPSinkVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI TextStoreACPSink_OnAttrsChange(ITextStoreACPSink *iface, LONG acpStart, LONG acpEnd, ULONG cAttrs, const TS_ATTRID *paAttrs)
Definition: context.c:780
static HRESULT WINAPI TextStoreACPSink_QueryInterface(ITextStoreACPSink *iface, REFIID iid, LPVOID *ppvOut)
Definition: context.c:696
static ULONG WINAPI TextStoreACPSink_Release(ITextStoreACPSink *iface)
Definition: context.c:725
static HRESULT WINAPI TextStoreACPSink_OnEndEditTransaction(ITextStoreACPSink *iface)
Definition: context.c:857
static HRESULT WINAPI TextStoreACPSink_OnStatusChange(ITextStoreACPSink *iface, DWORD dwFlags)
Definition: context.c:758
static ULONG WINAPI TextStoreACPSink_AddRef(ITextStoreACPSink *iface)
Definition: context.c:719
static HRESULT WINAPI TextStoreACPSink_OnStartEditTransaction(ITextStoreACPSink *iface)
Definition: context.c:850
static HRESULT WINAPI TextStoreACPSink_OnLayoutChange(ITextStoreACPSink *iface, TsLayoutCode lcode, TsViewCookie vcView)
Definition: context.c:750
static HRESULT WINAPI TextStoreACPSink_OnTextChange(ITextStoreACPSink *iface, DWORD dwFlags, const TS_TEXTCHANGE *pChange)
Definition: context.c:735
static HRESULT WINAPI TextStoreACPSink_OnSelectionChange(ITextStoreACPSink *iface)
Definition: context.c:743
static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface, DWORD dwLockFlags)
Definition: context.c:788

Definition at line 864 of file context.c.

Referenced by Context_Constructor().