122 if (
This->pITextStoreACP)
123 ITextStoreACP_Release(
This->pITextStoreACP);
125 if (
This->pITfContextOwnerCompositionSink)
126 ITfContextOwnerCompositionSink_Release(
This->pITfContextOwnerCompositionSink);
128 if (
This->defaultCookie)
132 This->defaultCookie = 0;
152 *ppvOut = &
This->ITfContext_iface;
156 *ppvOut = &
This->ITfSource_iface;
158 else if (
IsEqualIID(iid, &IID_ITfContextOwnerCompositionServices))
160 *ppvOut = &
This->ITfContextOwnerCompositionServices_iface;
162 else if (
IsEqualIID(iid, &IID_ITfInsertAtSelection))
164 *ppvOut = &
This->ITfInsertAtSelection_iface;
166 else if (
IsEqualIID(iid, &IID_ITfCompartmentMgr))
168 *ppvOut =
This->CompartmentMgr;
170 else if (
IsEqualIID(iid, &IID_ITfSourceSingle))
172 *ppvOut = &
This->ITfSourceSingle_iface;
177 ITfContext_AddRef(iface);
211 DWORD dwLockFlags = 0x0;
221 if (!
This->pITextStoreACP)
223 FIXME(
"No ITextStoreACP available\n");
231 if ((
dwFlags & TF_ES_READWRITE) == TF_ES_READWRITE)
236 if (!
This->documentStatus.dwDynamicFlags)
237 ITextStoreACP_GetStatus(
This->pITextStoreACP, &
This->documentStatus);
241 *phrSession = TS_E_READONLY;
245 if (
FAILED (ITfEditSession_QueryInterface(pes, &IID_ITfEditSession, (
LPVOID*)&
This->currentEditSession)))
251 hr = ITextStoreACP_RequestLock(
This->pITextStoreACP, dwLockFlags, phrSession);
258 BOOL *pfWriteSession)
267 TF_SELECTION *pSelection,
ULONG *pcFetched)
272 ULONG totalFetched = 0;
275 if (!pSelection || !pcFetched)
280 if (!
This->connected)
281 return TF_E_DISCONNECTED;
286 if (!
This->pITextStoreACP)
288 FIXME(
"Context does not have a ITextStoreACP\n");
294 if (ulIndex == TF_DEFAULT_SELECTION)
304 hr = ITextStoreACP_GetSelection(
This->pITextStoreACP, ulIndex +
i,
307 if (
hr == TS_E_NOLOCK)
311 pSelection[totalFetched].style.ase = acps.
style.
ase;
320 *pcFetched = totalFetched;
333 TRACE(
"(%p) %i %i %p\n",
This,ec,ulCount,pSelection);
335 if (!
This->pITextStoreACP)
337 FIXME(
"Context does not have a ITextStoreACP\n");
348 for (
i = 0;
i < ulCount;
i++)
351 TRACE(
"Selection Conversion Failed\n");
356 hr = ITextStoreACP_SetSelection(
This->pITextStoreACP, ulCount, acp);
375 if (!
This->connected)
376 return TF_E_DISCONNECTED;
398 if (!
This->connected)
399 return TF_E_DISCONNECTED;
404 if (!
This->pITextStoreACP)
406 FIXME(
"Context does not have a ITextStoreACP\n");
411 ITextStoreACP_GetEndACP(
This->pITextStoreACP,&
end);
438 if (!
This->connected)
439 return TF_E_DISCONNECTED;
444 if (!
This->pITextStoreACP)
446 FIXME(
"Context does not have a ITextStoreACP\n");
450 ITextStoreACP_GetStatus(
This->pITextStoreACP, &
This->documentStatus);
452 *pdcs =
This->documentStatus;
499 *ppDm =
This->manager;
503 ITfDocumentMgr_AddRef(
This->manager);
544 return ITfContext_QueryInterface(&
This->ITfContext_iface, iid, ppvOut);
550 return ITfContext_AddRef(&
This->ITfContext_iface);
556 return ITfContext_Release(&
This->ITfContext_iface);
566 if (!
riid || !punk || !pdwCookie)
604 return ITfContext_QueryInterface(&
This->ITfContext_iface, iid, ppvOut);
610 return ITfContext_AddRef(&
This->ITfContext_iface);
616 return ITfContext_Release(&
This->ITfContext_iface);
623 FIXME(
"STUB:(%p) %#x %p %p %p\n",
This, ecWrite, pCompositionRange, pSink, ppComposition);
639 FIXME(
"STUB:(%p) %#x %p %p\n",
This, ecRead, pTestRange, ppEnum);
647 FIXME(
"STUB:(%p) %#x %p %p %p\n",
This, ecWrite, pComposition, pSink, ppComposition);
655 FIXME(
"STUB:(%p) %p\n",
This, pComposition);
677 return ITfContext_QueryInterface(&
This->ITfContext_iface, iid, ppvOut);
683 return ITfContext_AddRef(&
This->ITfContext_iface);
689 return ITfContext_Release(&
This->ITfContext_iface);
698 LONG acpStart, acpEnd;
704 if (!
This->connected)
705 return TF_E_DISCONNECTED;
713 return TS_E_READONLY;
715 if (!
This->pITextStoreACP)
717 FIXME(
"Context does not have a ITextStoreACP\n");
721 hr = ITextStoreACP_InsertTextAtSelection(
This->pITextStoreACP,
dwFlags, pchText,
cch, &acpStart, &acpEnd, &change);
752 return ITfContext_QueryInterface(&
This->ITfContext_iface, iid, ppvOut);
758 return ITfContext_AddRef(&
This->ITfContext_iface);
764 return ITfContext_Release(&
This->ITfContext_iface);
804 *ppvOut = &
This->ITextStoreACPSink_iface;
806 else if (
IsEqualIID(iid, &IID_ITextStoreACPServices))
807 *ppvOut = &
This->ITextStoreACPServices_iface;
811 ITextStoreACPSink_AddRef(iface);
822 return ITfContext_AddRef(&
This->ITfContext_iface);
828 return ITfContext_Release(&
This->ITfContext_iface);
866 if (!
This->pITextStoreACP)
868 FIXME(
"Context does not have a ITextStoreACP\n");
872 hr = ITextStoreACP_RequestLock(
This->pITextStoreACP,
TS_LF_READ, &hrSession);
899 if (!
This->currentEditSession)
901 FIXME(
"OnLockGranted called for something other than an EditSession\n");
916 cookie->lockType = dwLockFlags;
920 hr = ITfEditSession_DoEditSession(
This->currentEditSession, ec);
934 ITfTextEditSink_OnEndEdit(
sink, &
This->ITfContext_iface, sc,
NULL);
940 ITfEditSession_Release(
This->currentEditSession);
982 return ITextStoreACPSink_QueryInterface(&
This->ITextStoreACPSink_iface,
riid,
obj);
988 return ITextStoreACPSink_AddRef(&
This->ITextStoreACPSink_iface);
994 return ITextStoreACPSink_Release(&
This->ITextStoreACPSink_iface);
1063 TRACE(
"(%p) %x %p %p %p\n",
This, tidOwner, punk, ppOut, pecTextStore);
1073 This->tidOwner = tidOwner;
1075 This->manager = mgr;
1079 cookie->lockType = TF_ES_READ;
1084 IUnknown_QueryInterface(punk, &IID_ITextStoreACP,
1087 IUnknown_QueryInterface(punk, &IID_ITfContextOwnerCompositionSink,
1088 (
LPVOID*)&
This->pITfContextOwnerCompositionSink);
1090 if (!
This->pITextStoreACP && !
This->pITfContextOwnerCompositionSink)
1091 FIXME(
"Unhandled pUnk\n");
1095 *pecTextStore =
This->defaultCookie;
1103 *ppOut = &
This->ITfContext_iface;
1104 TRACE(
"returning %p\n", *ppOut);
1113 if (
This->pITextStoreACP)
1114 ITextStoreACP_AdviseSink(
This->pITextStoreACP, &IID_ITextStoreACPSink,
1117 This->manager = manager;
1125 if (
This->pITextStoreACP)
1126 ITextStoreACP_UnadviseSink(
This->pITextStoreACP, (
IUnknown*)&
This->ITextStoreACPSink_iface);
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_init(struct list_entry *head)
HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *iface)
HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut)
void Context_AddRef(context_t *context)
void Context_Release(context_t *context)
#define HeapFree(x, y, z)
static HRESULT WINAPI TextStoreACPServices_Serialize(ITextStoreACPServices *iface, ITfProperty *prop, ITfRange *range, TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream)
static HRESULT WINAPI Context_GetActiveView(ITfContext *iface, ITfContextView **ppView)
static HRESULT WINAPI Context_GetStart(ITfContext *iface, TfEditCookie ec, ITfRange **ppStart)
static ULONG WINAPI TextStoreACPSink_AddRef(ITextStoreACPSink *iface)
static const ITfContextVtbl ContextVtbl
static HRESULT WINAPI ContextOwnerCompositionServices_StartComposition(ITfContextOwnerCompositionServices *iface, TfEditCookie ecWrite, ITfRange *pCompositionRange, ITfCompositionSink *pSink, ITfComposition **ppComposition)
static const ITextStoreACPSinkVtbl TextStoreACPSinkVtbl
static HRESULT WINAPI ContextOwnerCompositionServices_TakeOwnership(ITfContextOwnerCompositionServices *iface, TfEditCookie ecWrite, ITfCompositionView *pComposition, ITfCompositionSink *pSink, ITfComposition **ppComposition)
HRESULT Context_Uninitialize(ITfContext *iface)
static HRESULT WINAPI SourceSingle_UnadviseSingleSink(ITfSourceSingle *iface, TfClientId tid, REFIID riid)
static Context * impl_from_ITfContextOwnerCompositionServices(ITfContextOwnerCompositionServices *iface)
static ULONG WINAPI ContextOwnerCompositionServices_AddRef(ITfContextOwnerCompositionServices *iface)
static HRESULT WINAPI Context_TrackProperties(ITfContext *iface, const GUID **prgProp, ULONG cProp, const GUID **prgAppProp, ULONG cAppProp, ITfReadOnlyProperty **ppProperty)
static HRESULT WINAPI InsertAtSelection_InsertEmbeddedAtSelection(ITfInsertAtSelection *iface, TfEditCookie ec, DWORD dwFlags, IDataObject *pDataObject, ITfRange **ppRange)
static HRESULT WINAPI Context_SetSelection(ITfContext *iface, TfEditCookie ec, ULONG ulCount, const TF_SELECTION *pSelection)
static HRESULT WINAPI TextStoreACPSink_QueryInterface(ITextStoreACPSink *iface, REFIID iid, LPVOID *ppvOut)
static ULONG WINAPI InsertAtSelection_Release(ITfInsertAtSelection *iface)
static Context * impl_from_ITfSourceSingle(ITfSourceSingle *iface)
static Context * impl_from_ITextStoreACPServices(ITextStoreACPServices *iface)
static HRESULT WINAPI Context_GetAppProperty(ITfContext *iface, REFGUID guidProp, ITfReadOnlyProperty **ppProp)
static HRESULT WINAPI ContextOwnerCompositionServices_TerminateComposition(ITfContextOwnerCompositionServices *iface, ITfCompositionView *pComposition)
static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface, DWORD dwLockFlags)
static void Context_Destructor(Context *This)
static ULONG WINAPI ContextOwnerCompositionServices_Release(ITfContextOwnerCompositionServices *iface)
static HRESULT WINAPI InsertAtSelection_QueryInterface(ITfInsertAtSelection *iface, REFIID iid, LPVOID *ppvOut)
static HRESULT WINAPI TextStoreACPServices_Unserialize(ITextStoreACPServices *iface, ITfProperty *prop, const TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream, ITfPersistentPropertyLoaderACP *loader)
static HRESULT WINAPI ContextOwnerCompositionServices_QueryInterface(ITfContextOwnerCompositionServices *iface, REFIID iid, LPVOID *ppvOut)
static HRESULT WINAPI TextStoreACPSink_OnLayoutChange(ITextStoreACPSink *iface, TsLayoutCode lcode, TsViewCookie vcView)
static HRESULT WINAPI TextStoreACPServices_QueryInterface(ITextStoreACPServices *iface, REFIID riid, void **obj)
static ULONG WINAPI InsertAtSelection_AddRef(ITfInsertAtSelection *iface)
static HRESULT WINAPI Context_GetStatus(ITfContext *iface, TF_STATUS *pdcs)
HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore)
static ULONG WINAPI SourceSingle_AddRef(ITfSourceSingle *iface)
static HRESULT WINAPI TextStoreACPSink_OnTextChange(ITextStoreACPSink *iface, DWORD dwFlags, const TS_TEXTCHANGE *pChange)
static ULONG WINAPI ContextSource_AddRef(ITfSource *iface)
static HRESULT WINAPI Context_GetEnd(ITfContext *iface, TfEditCookie ec, ITfRange **ppEnd)
static const ITextStoreACPServicesVtbl TextStoreACPServicesVtbl
static HRESULT WINAPI SourceSingle_AdviseSingleSink(ITfSourceSingle *iface, TfClientId tid, REFIID riid, IUnknown *punk)
struct tagEditCookie EditCookie
static ULONG WINAPI TextStoreACPServices_Release(ITextStoreACPServices *iface)
static Context * impl_from_ITfSource(ITfSource *iface)
static HRESULT WINAPI TextStoreACPServices_ForceLoadProperty(ITextStoreACPServices *iface, ITfProperty *prop)
static Context * impl_from_ITfContext(ITfContext *iface)
static HRESULT WINAPI Context_EnumProperties(ITfContext *iface, IEnumTfProperties **ppEnum)
static Context * impl_from_ITfInsertAtSelection(ITfInsertAtSelection *iface)
static HRESULT WINAPI Context_RequestEditSession(ITfContext *iface, TfClientId tid, ITfEditSession *pes, DWORD dwFlags, HRESULT *phrSession)
static HRESULT WINAPI TextStoreACPSink_OnAttrsChange(ITextStoreACPSink *iface, LONG acpStart, LONG acpEnd, ULONG cAttrs, const TS_ATTRID *paAttrs)
static ULONG WINAPI TextStoreACPServices_AddRef(ITextStoreACPServices *iface)
static HRESULT WINAPI TextStoreACPSink_OnSelectionChange(ITextStoreACPSink *iface)
static HRESULT WINAPI TextStoreACPSink_OnStatusChange(ITextStoreACPSink *iface, DWORD dwFlags)
static HRESULT WINAPI TextStoreACPServices_CreateRange(ITextStoreACPServices *iface, LONG start, LONG end, ITfRangeACP **range)
static HRESULT WINAPI SourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut)
HRESULT Context_Initialize(ITfContext *iface, ITfDocumentMgr *manager)
static HRESULT WINAPI TextStoreACPSink_OnStartEditTransaction(ITextStoreACPSink *iface)
static HRESULT WINAPI Context_InWriteSession(ITfContext *iface, TfClientId tid, BOOL *pfWriteSession)
static ULONG WINAPI TextStoreACPSink_Release(ITextStoreACPSink *iface)
static HRESULT WINAPI Context_EnumViews(ITfContext *iface, IEnumTfContextViews **ppEnum)
static HRESULT WINAPI ContextSource_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
static HRESULT WINAPI ContextOwnerCompositionServices_FindComposition(ITfContextOwnerCompositionServices *iface, TfEditCookie ecRead, ITfRange *pTestRange, IEnumITfCompositionView **ppEnum)
static const ITfSourceSingleVtbl ContextSourceSingleVtbl
static const ITfInsertAtSelectionVtbl InsertAtSelectionVtbl
static HRESULT WINAPI Context_GetSelection(ITfContext *iface, TfEditCookie ec, ULONG ulIndex, ULONG ulCount, TF_SELECTION *pSelection, ULONG *pcFetched)
static HRESULT WINAPI TextStoreACPSink_OnEndEditTransaction(ITextStoreACPSink *iface)
static const ITfSourceVtbl ContextSourceVtbl
static const ITfContextOwnerCompositionServicesVtbl ContextOwnerCompositionServicesVtbl
static HRESULT WINAPI Context_GetProperty(ITfContext *iface, REFGUID guidProp, ITfProperty **ppProp)
static HRESULT WINAPI Context_GetDocumentMgr(ITfContext *iface, ITfDocumentMgr **ppDm)
static HRESULT WINAPI ContextSource_AdviseSink(ITfSource *iface, REFIID riid, IUnknown *punk, DWORD *pdwCookie)
static HRESULT WINAPI ContextOwnerCompositionServices_EnumCompositions(ITfContextOwnerCompositionServices *iface, IEnumITfCompositionView **ppEnum)
static HRESULT WINAPI ContextSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
static Context * impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
static ULONG WINAPI ContextSource_Release(ITfSource *iface)
static HRESULT WINAPI Context_QueryInterface(ITfContext *iface, REFIID iid, LPVOID *ppvOut)
static ULONG WINAPI SourceSingle_Release(ITfSourceSingle *iface)
static HRESULT WINAPI InsertAtSelection_InsertTextAtSelection(ITfInsertAtSelection *iface, TfEditCookie ec, DWORD dwFlags, const WCHAR *pchText, LONG cch, ITfRange **ppRange)
static HRESULT WINAPI Context_CreateRangeBackup(ITfContext *iface, TfEditCookie ec, ITfRange *pRange, ITfRangeBackup **ppBackup)
GLuint GLuint GLsizei count
GLsizei GLenum GLboolean sink
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static DWORD DWORD void LPSTR DWORD cch
DWORD get_Cookie_magic(DWORD id)
LPVOID remove_Cookie(DWORD id)
HRESULT unadvise_sink(DWORD cookie)
void free_sinks(struct list *sink_list)
DWORD generate_Cookie(DWORD magic, LPVOID data)
HRESULT advise_sink(struct list *sink_list, REFIID riid, DWORD cookie_magic, IUnknown *unk, DWORD *cookie)
LPVOID get_Cookie_data(DWORD id)
HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut) DECLSPEC_HIDDEN
#define SINK_FOR_EACH(cursor, list, type, elem)
#define COOKIE_MAGIC_EDITCOOKIE
HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp) DECLSPEC_HIDDEN
#define COOKIE_MAGIC_CONTEXTSINK
#define IsEqualIID(riid1, riid2)
ITfInsertAtSelection ITfInsertAtSelection_iface
struct list pContextKeyEventSink
struct list pTextEditSink
ITfContextOwnerCompositionServices ITfContextOwnerCompositionServices_iface
ITfCompartmentMgr * CompartmentMgr
ITfSourceSingle ITfSourceSingle_iface
ITfSource ITfSource_iface
TfEditCookie defaultCookie
ITfEditSession * currentEditSession
ITextStoreACPServices ITextStoreACPServices_iface
struct list pEditTransactionSink
struct list pTextLayoutSink
ITfContextOwnerCompositionSink * pITfContextOwnerCompositionSink
ITextStoreACPSink ITextStoreACPSink_iface
ITfContext ITfContext_iface
ITextStoreACP * pITextStoreACP
const DWORD TS_LF_READWRITE
const DWORD TS_SD_READONLY
const DWORD TS_AS_ALL_SINKS
#define CONTAINING_RECORD(address, type, field)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags