Commit e00bc2d3 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

msctf: Stub implementation of ITfSourceSingle for ITfContext.

parent 6e6dd21c
...@@ -64,7 +64,7 @@ typedef struct tagContext { ...@@ -64,7 +64,7 @@ typedef struct tagContext {
const ITfInsertAtSelectionVtbl *InsertAtSelectionVtbl; const ITfInsertAtSelectionVtbl *InsertAtSelectionVtbl;
/* const ITfMouseTrackerVtbl *MouseTrackerVtbl; */ /* const ITfMouseTrackerVtbl *MouseTrackerVtbl; */
/* const ITfQueryEmbeddedVtbl *QueryEmbeddedVtbl; */ /* const ITfQueryEmbeddedVtbl *QueryEmbeddedVtbl; */
/* const ITfSourceSingleVtbl *SourceSingleVtbl; */ const ITfSourceSingleVtbl *SourceSingleVtbl;
LONG refCount; LONG refCount;
BOOL connected; BOOL connected;
...@@ -117,6 +117,11 @@ static inline Context *impl_from_ITfInsertAtSelectionVtbl(ITfInsertAtSelection*i ...@@ -117,6 +117,11 @@ static inline Context *impl_from_ITfInsertAtSelectionVtbl(ITfInsertAtSelection*i
return (Context *)((char *)iface - FIELD_OFFSET(Context,InsertAtSelectionVtbl)); return (Context *)((char *)iface - FIELD_OFFSET(Context,InsertAtSelectionVtbl));
} }
static inline Context *impl_from_ITfSourceSingleVtbl(ITfSourceSingle* iface)
{
return (Context *)((char *)iface - FIELD_OFFSET(Context,SourceSingleVtbl));
}
static void free_sink(ContextSink *sink) static void free_sink(ContextSink *sink)
{ {
IUnknown_Release(sink->interfaces.pIUnknown); IUnknown_Release(sink->interfaces.pIUnknown);
...@@ -204,6 +209,10 @@ static HRESULT WINAPI Context_QueryInterface(ITfContext *iface, REFIID iid, LPVO ...@@ -204,6 +209,10 @@ static HRESULT WINAPI Context_QueryInterface(ITfContext *iface, REFIID iid, LPVO
{ {
*ppvOut = This->CompartmentMgr; *ppvOut = This->CompartmentMgr;
} }
else if (IsEqualIID(iid, &IID_ITfSourceSingle))
{
*ppvOut = &This->SourceSingleVtbl;
}
if (*ppvOut) if (*ppvOut)
{ {
...@@ -729,6 +738,53 @@ static const ITfInsertAtSelectionVtbl Context_InsertAtSelectionVtbl = ...@@ -729,6 +738,53 @@ static const ITfInsertAtSelectionVtbl Context_InsertAtSelectionVtbl =
InsertAtSelection_InsertEmbeddedAtSelection, InsertAtSelection_InsertEmbeddedAtSelection,
}; };
/*****************************************************
* ITfSourceSingle functions
*****************************************************/
static HRESULT WINAPI SourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut)
{
Context *This = impl_from_ITfSourceSingleVtbl(iface);
return Context_QueryInterface((ITfContext *)This, iid, *ppvOut);
}
static ULONG WINAPI SourceSingle_AddRef(ITfSourceSingle *iface)
{
Context *This = impl_from_ITfSourceSingleVtbl(iface);
return Context_AddRef((ITfContext *)This);
}
static ULONG WINAPI SourceSingle_Release(ITfSourceSingle *iface)
{
Context *This = impl_from_ITfSourceSingleVtbl(iface);
return Context_Release((ITfContext *)This);
}
static WINAPI HRESULT SourceSingle_AdviseSingleSink( ITfSourceSingle *iface,
TfClientId tid, REFIID riid, IUnknown *punk)
{
Context *This = impl_from_ITfSourceSingleVtbl(iface);
FIXME("STUB:(%p) %i %s %p\n",This, tid, debugstr_guid(riid),punk);
return E_NOTIMPL;
}
static WINAPI HRESULT SourceSingle_UnadviseSingleSink( ITfSourceSingle *iface,
TfClientId tid, REFIID riid)
{
Context *This = impl_from_ITfSourceSingleVtbl(iface);
FIXME("STUB:(%p) %i %s\n",This, tid, debugstr_guid(riid));
return E_NOTIMPL;
}
static const ITfSourceSingleVtbl Context_SourceSingleVtbl =
{
SourceSingle_QueryInterface,
SourceSingle_AddRef,
SourceSingle_Release,
SourceSingle_AdviseSingleSink,
SourceSingle_UnadviseSingleSink,
};
HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore) HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore)
{ {
Context *This; Context *This;
...@@ -750,6 +806,7 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr ...@@ -750,6 +806,7 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr
This->ContextVtbl= &Context_ContextVtbl; This->ContextVtbl= &Context_ContextVtbl;
This->SourceVtbl = &Context_SourceVtbl; This->SourceVtbl = &Context_SourceVtbl;
This->InsertAtSelectionVtbl = &Context_InsertAtSelectionVtbl; This->InsertAtSelectionVtbl = &Context_InsertAtSelectionVtbl;
This->SourceSingleVtbl = &Context_SourceSingleVtbl;
This->refCount = 1; This->refCount = 1;
This->tidOwner = tidOwner; This->tidOwner = tidOwner;
This->connected = FALSE; This->connected = FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment