[PATCH 2/2] msctf: Added stub ITextStoreACPServices support for context ITextStoreACPSink
Nikolay Sivov
nsivov at codeweavers.com
Tue Mar 22 02:09:37 CDT 2016
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
For https://bugs.winehq.org/show_bug.cgi?id=19538
dlls/msctf/context.c | 77 +++++++++++++++++++++++++++++++++++++++
dlls/msctf/tests/inputprocessor.c | 8 +++-
include/msctf.idl | 30 +++++++++++++++
3 files changed, 114 insertions(+), 1 deletion(-)
diff --git a/dlls/msctf/context.c b/dlls/msctf/context.c
index a649c38..5a45466 100644
--- a/dlls/msctf/context.c
+++ b/dlls/msctf/context.c
@@ -66,6 +66,7 @@ typedef struct tagContext {
/* const ITfQueryEmbeddedVtbl *QueryEmbeddedVtbl; */
ITfSourceSingle ITfSourceSingle_iface;
ITextStoreACPSink ITextStoreACPSink_iface;
+ ITextStoreACPServices ITextStoreACPServices_iface;
LONG refCount;
BOOL connected;
@@ -121,6 +122,11 @@ static inline Context *impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
return CONTAINING_RECORD(iface, Context, ITextStoreACPSink_iface);
}
+static inline Context *impl_from_ITextStoreACPServices(ITextStoreACPServices *iface)
+{
+ return CONTAINING_RECORD(iface, Context, ITextStoreACPServices_iface);
+}
+
static void free_sink(ContextSink *sink)
{
IUnknown_Release(sink->interfaces.pIUnknown);
@@ -791,6 +797,8 @@ static HRESULT WINAPI TextStoreACPSink_QueryInterface(ITextStoreACPSink *iface,
{
*ppvOut = &This->ITextStoreACPSink_iface;
}
+ else if (IsEqualIID(iid, &IID_ITextStoreACPServices))
+ *ppvOut = &This->ITextStoreACPServices_iface;
if (*ppvOut)
{
@@ -963,6 +971,74 @@ static const ITextStoreACPSinkVtbl TextStoreACPSinkVtbl =
TextStoreACPSink_OnEndEditTransaction
};
+static HRESULT WINAPI TextStoreACPServices_QueryInterface(ITextStoreACPServices *iface, REFIID riid, void **obj)
+{
+ Context *This = impl_from_ITextStoreACPServices(iface);
+ return ITextStoreACPSink_QueryInterface(&This->ITextStoreACPSink_iface, riid, obj);
+}
+
+static ULONG WINAPI TextStoreACPServices_AddRef(ITextStoreACPServices *iface)
+{
+ Context *This = impl_from_ITextStoreACPServices(iface);
+ return ITextStoreACPSink_AddRef(&This->ITextStoreACPSink_iface);
+}
+
+static ULONG WINAPI TextStoreACPServices_Release(ITextStoreACPServices *iface)
+{
+ Context *This = impl_from_ITextStoreACPServices(iface);
+ return ITextStoreACPSink_Release(&This->ITextStoreACPSink_iface);
+}
+
+static HRESULT WINAPI TextStoreACPServices_Serialize(ITextStoreACPServices *iface, ITfProperty *prop, ITfRange *range,
+ TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream)
+{
+ Context *This = impl_from_ITextStoreACPServices(iface);
+
+ FIXME("stub: %p %p %p %p %p\n", This, prop, range, header, stream);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TextStoreACPServices_Unserialize(ITextStoreACPServices *iface, ITfProperty *prop,
+ const TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream, ITfPersistentPropertyLoaderACP *loader)
+{
+ Context *This = impl_from_ITextStoreACPServices(iface);
+
+ FIXME("stub: %p %p %p %p %p\n", This, prop, header, stream, loader);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TextStoreACPServices_ForceLoadProperty(ITextStoreACPServices *iface, ITfProperty *prop)
+{
+ Context *This = impl_from_ITextStoreACPServices(iface);
+
+ FIXME("stub: %p %p\n", This, prop);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TextStoreACPServices_CreateRange(ITextStoreACPServices *iface,
+ LONG start, LONG end, ITfRangeACP **range)
+{
+ Context *This = impl_from_ITextStoreACPServices(iface);
+
+ FIXME("stub: %p %d %d %p\n", This, start, end, range);
+
+ return S_OK;
+}
+
+static const ITextStoreACPServicesVtbl TextStoreACPServicesVtbl =
+{
+ TextStoreACPServices_QueryInterface,
+ TextStoreACPServices_AddRef,
+ TextStoreACPServices_Release,
+ TextStoreACPServices_Serialize,
+ TextStoreACPServices_Unserialize,
+ TextStoreACPServices_ForceLoadProperty,
+ TextStoreACPServices_CreateRange
+};
+
HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore)
{
Context *This;
@@ -986,6 +1062,7 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr
This->ITfInsertAtSelection_iface.lpVtbl = &InsertAtSelectionVtbl;
This->ITfSourceSingle_iface.lpVtbl = &ContextSourceSingleVtbl;
This->ITextStoreACPSink_iface.lpVtbl = &TextStoreACPSinkVtbl;
+ This->ITextStoreACPServices_iface.lpVtbl = &TextStoreACPServicesVtbl;
This->refCount = 1;
This->tidOwner = tidOwner;
This->connected = FALSE;
diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c
index a873345..080d7f0 100644
--- a/dlls/msctf/tests/inputprocessor.c
+++ b/dlls/msctf/tests/inputprocessor.c
@@ -226,12 +226,18 @@ static ULONG WINAPI TextStoreACP_Release(ITextStoreACP *iface)
static HRESULT WINAPI TextStoreACP_AdviseSink(ITextStoreACP *iface,
REFIID riid, IUnknown *punk, DWORD dwMask)
{
+ ITextStoreACPServices *services;
HRESULT hr;
sink_fire_ok(&test_ACP_AdviseSink,"TextStoreACP_AdviseSink");
- hr = IUnknown_QueryInterface(punk, &IID_ITextStoreACPSink,(LPVOID*)(&ACPSink));
+ hr = IUnknown_QueryInterface(punk, &IID_ITextStoreACPSink, (void**)&ACPSink);
ok(SUCCEEDED(hr),"Unable to QueryInterface on sink\n");
+
+ hr = ITextStoreACPSink_QueryInterface(ACPSink, &IID_ITextStoreACPServices, (void**)&services);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ITextStoreACPServices_Release(services);
+
return S_OK;
}
diff --git a/include/msctf.idl b/include/msctf.idl
index 0cfaacf..62dc0d6 100644
--- a/include/msctf.idl
+++ b/include/msctf.idl
@@ -97,6 +97,8 @@ interface ITfReadOnlyProperty;
interface IEnumTfLanguageProfiles;
interface ITfCompositionView;
interface ITfKeyEventSink;
+interface ITfPersistentPropertyLoaderACP;
+interface ITfRangeACP;
cpp_quote("#if 0")
typedef [uuid(4f5d560f-5ab5-4dde-8c4d-404592857ab0)] UINT_PTR HKL;
@@ -352,6 +354,34 @@ interface ITfRangeBackup : IUnknown
[
object,
+ uuid(aa80e901-2021-11d2-93e0-0060b067b86e),
+ pointer_default(unique)
+]
+interface ITextStoreACPServices : IUnknown
+{
+ HRESULT Serialize(
+ [in] ITfProperty *prop,
+ [in] ITfRange *range,
+ [out] TF_PERSISTENT_PROPERTY_HEADER_ACP *header,
+ [in] IStream *stream);
+
+ HRESULT Unserialize(
+ [in] ITfProperty *prop,
+ [in] const TF_PERSISTENT_PROPERTY_HEADER_ACP *header,
+ [in] IStream *stream,
+ [in] ITfPersistentPropertyLoaderACP *loader);
+
+ HRESULT ForceLoadProperty(
+ [in] ITfProperty *prop);
+
+ HRESULT CreateRange(
+ [in] LONG start,
+ [in] LONG end,
+ [out] ITfRangeACP **range);
+}
+
+[
+ object,
uuid(aa80e7fd-2021-11d2-93e0-0060b067b86e),
pointer_default(unique)
]
--
2.7.0
More information about the wine-patches
mailing list