Aric Stewart : msctf: Add ITfSource interface to ThreadMgr.
Alexandre Julliard
julliard at winehq.org
Tue Feb 3 09:13:27 CST 2009
Module: wine
Branch: master
Commit: bc7dd32e6765f5708dfde1c068253e202f51cef4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bc7dd32e6765f5708dfde1c068253e202f51cef4
Author: Aric Stewart <aric at codeweavers.com>
Date: Mon Feb 2 10:25:49 2009 -0600
msctf: Add ITfSource interface to ThreadMgr.
---
dlls/msctf/threadmgr.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 58 insertions(+), 0 deletions(-)
diff --git a/dlls/msctf/threadmgr.c b/dlls/msctf/threadmgr.c
index 7385f0b..76c1fd6 100644
--- a/dlls/msctf/threadmgr.c
+++ b/dlls/msctf/threadmgr.c
@@ -42,11 +42,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf);
typedef struct tagACLMulti {
const ITfThreadMgrVtbl *ThreadMgrVtbl;
+ const ITfSourceVtbl *SourceVtbl;
LONG refCount;
ITfDocumentMgr *focus;
} ThreadMgr;
+static inline ThreadMgr *impl_from_ITfSourceVtbl(ITfSource *iface)
+{
+ return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,SourceVtbl));
+}
+
static void ThreadMgr_Destructor(ThreadMgr *This)
{
TlsSetValue(tlsIndex,NULL);
@@ -65,6 +71,10 @@ static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid,
{
*ppvOut = This;
}
+ else if (IsEqualIID(iid, &IID_ITfSource))
+ {
+ *ppvOut = &This->SourceVtbl;
+ }
if (*ppvOut)
{
@@ -222,6 +232,53 @@ static const ITfThreadMgrVtbl ThreadMgr_ThreadMgrVtbl =
ThreadMgr_GetGlobalCompartment
};
+
+static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
+{
+ ThreadMgr *This = impl_from_ITfSourceVtbl(iface);
+ return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut);
+}
+
+static ULONG WINAPI Source_AddRef(ITfSource *iface)
+{
+ ThreadMgr *This = impl_from_ITfSourceVtbl(iface);
+ return ThreadMgr_AddRef((ITfThreadMgr*)This);
+}
+
+static ULONG WINAPI Source_Release(ITfSource *iface)
+{
+ ThreadMgr *This = impl_from_ITfSourceVtbl(iface);
+ return ThreadMgr_Release((ITfThreadMgr *)This);
+}
+
+/*****************************************************
+ * ITfSource functions
+ *****************************************************/
+static WINAPI HRESULT ThreadMgrSource_AdviseSink(ITfSource *iface,
+ REFIID riid, IUnknown *punk, DWORD *pdwCookie)
+{
+ ThreadMgr *This = impl_from_ITfSourceVtbl(iface);
+ FIXME("STUB:(%p)\n",This);
+ return E_NOTIMPL;
+}
+
+static WINAPI HRESULT ThreadMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
+{
+ ThreadMgr *This = impl_from_ITfSourceVtbl(iface);
+ FIXME("STUB:(%p)\n",This);
+ return E_NOTIMPL;
+}
+
+static const ITfSourceVtbl ThreadMgr_SourceVtbl =
+{
+ Source_QueryInterface,
+ Source_AddRef,
+ Source_Release,
+
+ ThreadMgrSource_AdviseSink,
+ ThreadMgrSource_UnadviseSink,
+};
+
HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
{
ThreadMgr *This;
@@ -242,6 +299,7 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
return E_OUTOFMEMORY;
This->ThreadMgrVtbl= &ThreadMgr_ThreadMgrVtbl;
+ This->SourceVtbl = &ThreadMgr_SourceVtbl;
This->refCount = 1;
TlsSetValue(tlsIndex,This);
More information about the wine-cvs
mailing list