|
|
|
@@ -57,7 +57,7 @@ typedef struct tagAssociatedWindow
|
|
|
|
|
} AssociatedWindow;
|
|
|
|
|
|
|
|
|
|
typedef struct tagACLMulti {
|
|
|
|
|
ITfThreadMgr ITfThreadMgr_iface;
|
|
|
|
|
ITfThreadMgrEx ITfThreadMgrEx_iface;
|
|
|
|
|
ITfSource ITfSource_iface;
|
|
|
|
|
ITfKeystrokeMgr ITfKeystrokeMgr_iface;
|
|
|
|
|
ITfMessagePump ITfMessagePump_iface;
|
|
|
|
@@ -65,7 +65,7 @@ typedef struct tagACLMulti {
|
|
|
|
|
/* const ITfThreadMgrExVtbl *ThreadMgrExVtbl; */
|
|
|
|
|
/* const ITfConfigureSystemKeystrokeFeedVtbl *ConfigureSystemKeystrokeFeedVtbl; */
|
|
|
|
|
/* const ITfLangBarItemMgrVtbl *LangBarItemMgrVtbl; */
|
|
|
|
|
/* const ITfUIElementMgrVtbl *UIElementMgrVtbl; */
|
|
|
|
|
ITfUIElementMgr ITfUIElementMgr_iface;
|
|
|
|
|
ITfSourceSingle ITfSourceSingle_iface;
|
|
|
|
|
LONG refCount;
|
|
|
|
|
|
|
|
|
@@ -105,9 +105,9 @@ typedef struct tagEnumTfDocumentMgr {
|
|
|
|
|
|
|
|
|
|
static HRESULT EnumTfDocumentMgr_Constructor(struct list* head, IEnumTfDocumentMgrs **ppOut);
|
|
|
|
|
|
|
|
|
|
static inline ThreadMgr *impl_from_ITfThreadMgr(ITfThreadMgr *iface)
|
|
|
|
|
static inline ThreadMgr *impl_from_ITfThreadMgrEx(ITfThreadMgrEx *iface)
|
|
|
|
|
{
|
|
|
|
|
return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgr_iface);
|
|
|
|
|
return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline ThreadMgr *impl_from_ITfSource(ITfSource *iface)
|
|
|
|
@@ -135,6 +135,11 @@ static inline ThreadMgr *impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink *
|
|
|
|
|
return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEventSink_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline ThreadMgr *impl_from_ITfUIElementMgr(ITfUIElementMgr *iface)
|
|
|
|
|
{
|
|
|
|
|
return CONTAINING_RECORD(iface, ThreadMgr, ITfUIElementMgr_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline ThreadMgr *impl_from_ITfSourceSingle(ITfSourceSingle *iface)
|
|
|
|
|
{
|
|
|
|
|
return CONTAINING_RECORD(iface, ThreadMgr, ITfSourceSingle_iface);
|
|
|
|
@@ -230,14 +235,15 @@ static void ThreadMgr_Destructor(ThreadMgr *This)
|
|
|
|
|
HeapFree(GetProcessHeap(),0,This);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid, LPVOID *ppvOut)
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgrEx *iface, REFIID iid, LPVOID *ppvOut)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
*ppvOut = NULL;
|
|
|
|
|
|
|
|
|
|
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfThreadMgr))
|
|
|
|
|
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfThreadMgr)
|
|
|
|
|
|| IsEqualIID(iid, &IID_ITfThreadMgrEx))
|
|
|
|
|
{
|
|
|
|
|
*ppvOut = &This->ITfThreadMgr_iface;
|
|
|
|
|
*ppvOut = &This->ITfThreadMgrEx_iface;
|
|
|
|
|
}
|
|
|
|
|
else if (IsEqualIID(iid, &IID_ITfSource))
|
|
|
|
|
{
|
|
|
|
@@ -259,6 +265,10 @@ static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid,
|
|
|
|
|
{
|
|
|
|
|
*ppvOut = This->CompartmentMgr;
|
|
|
|
|
}
|
|
|
|
|
else if (IsEqualIID(iid, &IID_ITfUIElementMgr))
|
|
|
|
|
{
|
|
|
|
|
*ppvOut = &This->ITfUIElementMgr_iface;
|
|
|
|
|
}
|
|
|
|
|
else if (IsEqualIID(iid, &IID_ITfSourceSingle))
|
|
|
|
|
{
|
|
|
|
|
*ppvOut = &This->ITfSourceSingle_iface;
|
|
|
|
@@ -266,7 +276,7 @@ static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid,
|
|
|
|
|
|
|
|
|
|
if (*ppvOut)
|
|
|
|
|
{
|
|
|
|
|
ITfThreadMgr_AddRef(iface);
|
|
|
|
|
ITfThreadMgrEx_AddRef(iface);
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -274,15 +284,15 @@ static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid,
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI ThreadMgr_AddRef(ITfThreadMgr *iface)
|
|
|
|
|
static ULONG WINAPI ThreadMgr_AddRef(ITfThreadMgrEx *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
return InterlockedIncrement(&This->refCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI ThreadMgr_Release(ITfThreadMgr *iface)
|
|
|
|
|
static ULONG WINAPI ThreadMgr_Release(ITfThreadMgrEx *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
ULONG ret;
|
|
|
|
|
|
|
|
|
|
ret = InterlockedDecrement(&This->refCount);
|
|
|
|
@@ -295,31 +305,17 @@ static ULONG WINAPI ThreadMgr_Release(ITfThreadMgr *iface)
|
|
|
|
|
* ITfThreadMgr functions
|
|
|
|
|
*****************************************************/
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_fnActivate( ITfThreadMgr* iface, TfClientId *ptid)
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_Activate(ITfThreadMgrEx *iface, TfClientId *id)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
|
|
|
|
|
TRACE("(%p) %p\n",This, ptid);
|
|
|
|
|
|
|
|
|
|
if (!ptid)
|
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
|
|
if (!processId)
|
|
|
|
|
{
|
|
|
|
|
GUID guid;
|
|
|
|
|
CoCreateGuid(&guid);
|
|
|
|
|
ITfClientId_GetClientId(&This->ITfClientId_iface, &guid, &processId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
activate_textservices(iface);
|
|
|
|
|
This->activationCount++;
|
|
|
|
|
*ptid = processId;
|
|
|
|
|
return S_OK;
|
|
|
|
|
TRACE("(%p) %p\n", This, id);
|
|
|
|
|
return ITfThreadMgrEx_ActivateEx(iface, id, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_fnDeactivate( ITfThreadMgr* iface)
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_Deactivate(ITfThreadMgrEx *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
TRACE("(%p)\n",This);
|
|
|
|
|
|
|
|
|
|
if (This->activationCount == 0)
|
|
|
|
@@ -342,9 +338,9 @@ static HRESULT WINAPI ThreadMgr_fnDeactivate( ITfThreadMgr* iface)
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_CreateDocumentMgr(ITfThreadMgr* iface, ITfDocumentMgr **ppdim)
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_CreateDocumentMgr(ITfThreadMgrEx *iface, ITfDocumentMgr **ppdim)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
DocumentMgrEntry *mgrentry;
|
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
|
@@ -366,9 +362,9 @@ static HRESULT WINAPI ThreadMgr_CreateDocumentMgr(ITfThreadMgr* iface, ITfDocume
|
|
|
|
|
return hr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_EnumDocumentMgrs( ITfThreadMgr* iface, IEnumTfDocumentMgrs **ppEnum)
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_EnumDocumentMgrs(ITfThreadMgrEx *iface, IEnumTfDocumentMgrs **ppEnum)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
TRACE("(%p) %p\n",This,ppEnum);
|
|
|
|
|
|
|
|
|
|
if (!ppEnum)
|
|
|
|
@@ -377,10 +373,9 @@ static HRESULT WINAPI ThreadMgr_EnumDocumentMgrs( ITfThreadMgr* iface, IEnumTfDo
|
|
|
|
|
return EnumTfDocumentMgr_Constructor(&This->CreatedDocumentMgrs, ppEnum);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_GetFocus( ITfThreadMgr* iface, ITfDocumentMgr
|
|
|
|
|
**ppdimFocus)
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_GetFocus(ITfThreadMgrEx *iface, ITfDocumentMgr **ppdimFocus)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
TRACE("(%p)\n",This);
|
|
|
|
|
|
|
|
|
|
if (!ppdimFocus)
|
|
|
|
@@ -398,9 +393,9 @@ static HRESULT WINAPI ThreadMgr_GetFocus( ITfThreadMgr* iface, ITfDocumentMgr
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_SetFocus( ITfThreadMgr* iface, ITfDocumentMgr *pdimFocus)
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_SetFocus(ITfThreadMgrEx *iface, ITfDocumentMgr *pdimFocus)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
ITfDocumentMgr *check;
|
|
|
|
|
|
|
|
|
|
TRACE("(%p) %p\n",This,pdimFocus);
|
|
|
|
@@ -446,7 +441,7 @@ static LRESULT CALLBACK ThreadFocusHookProc(int nCode, WPARAM wParam, LPARAM lPa
|
|
|
|
|
{
|
|
|
|
|
TRACE("Triggering Associated window focus\n");
|
|
|
|
|
if (This->focus != wnd->docmgr)
|
|
|
|
|
ThreadMgr_SetFocus((ITfThreadMgr*)This, wnd->docmgr);
|
|
|
|
|
ThreadMgr_SetFocus(&This->ITfThreadMgrEx_iface, wnd->docmgr);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -471,10 +466,10 @@ static HRESULT SetupWindowsHook(ThreadMgr *This)
|
|
|
|
|
return S_FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_AssociateFocus( ITfThreadMgr* iface, HWND hwnd,
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_AssociateFocus(ITfThreadMgrEx *iface, HWND hwnd,
|
|
|
|
|
ITfDocumentMgr *pdimNew, ITfDocumentMgr **ppdimPrev)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
struct list *cursor, *cursor2;
|
|
|
|
|
AssociatedWindow *wnd;
|
|
|
|
|
|
|
|
|
@@ -513,9 +508,9 @@ ITfDocumentMgr *pdimNew, ITfDocumentMgr **ppdimPrev)
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_IsThreadFocus( ITfThreadMgr* iface, BOOL *pfThreadFocus)
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_IsThreadFocus(ITfThreadMgrEx *iface, BOOL *pfThreadFocus)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
HWND focus;
|
|
|
|
|
|
|
|
|
|
TRACE("(%p) %p\n",This,pfThreadFocus);
|
|
|
|
@@ -524,26 +519,26 @@ static HRESULT WINAPI ThreadMgr_IsThreadFocus( ITfThreadMgr* iface, BOOL *pfThre
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_GetFunctionProvider( ITfThreadMgr* iface, REFCLSID clsid,
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_GetFunctionProvider(ITfThreadMgrEx *iface, REFCLSID clsid,
|
|
|
|
|
ITfFunctionProvider **ppFuncProv)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_EnumFunctionProviders( ITfThreadMgr* iface,
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_EnumFunctionProviders(ITfThreadMgrEx *iface,
|
|
|
|
|
IEnumTfFunctionProviders **ppEnum)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_GetGlobalCompartment( ITfThreadMgr* iface,
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_GetGlobalCompartment(ITfThreadMgrEx *iface,
|
|
|
|
|
ITfCompartmentMgr **ppCompMgr)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
HRESULT hr;
|
|
|
|
|
TRACE("(%p) %p\n",This, ppCompMgr);
|
|
|
|
|
|
|
|
|
@@ -562,13 +557,46 @@ ITfCompartmentMgr **ppCompMgr)
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const ITfThreadMgrVtbl ThreadMgrVtbl =
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_ActivateEx(ITfThreadMgrEx *iface, TfClientId *id, DWORD flags)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
|
|
|
|
|
TRACE("(%p) %p, %#x\n", This, id, flags);
|
|
|
|
|
|
|
|
|
|
if (!id)
|
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
|
|
if (flags)
|
|
|
|
|
FIXME("Unimplemented flags %#x\n", flags);
|
|
|
|
|
|
|
|
|
|
if (!processId)
|
|
|
|
|
{
|
|
|
|
|
GUID guid;
|
|
|
|
|
CoCreateGuid(&guid);
|
|
|
|
|
ITfClientId_GetClientId(&This->ITfClientId_iface, &guid, &processId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
activate_textservices((ITfThreadMgr *)iface);
|
|
|
|
|
This->activationCount++;
|
|
|
|
|
*id = processId;
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgr_GetActiveFlags(ITfThreadMgrEx *iface, DWORD *flags)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx(iface);
|
|
|
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n", This);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const ITfThreadMgrExVtbl ThreadMgrExVtbl =
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr_QueryInterface,
|
|
|
|
|
ThreadMgr_AddRef,
|
|
|
|
|
ThreadMgr_Release,
|
|
|
|
|
ThreadMgr_fnActivate,
|
|
|
|
|
ThreadMgr_fnDeactivate,
|
|
|
|
|
ThreadMgr_Activate,
|
|
|
|
|
ThreadMgr_Deactivate,
|
|
|
|
|
ThreadMgr_CreateDocumentMgr,
|
|
|
|
|
ThreadMgr_EnumDocumentMgrs,
|
|
|
|
|
ThreadMgr_GetFocus,
|
|
|
|
@@ -577,25 +605,28 @@ static const ITfThreadMgrVtbl ThreadMgrVtbl =
|
|
|
|
|
ThreadMgr_IsThreadFocus,
|
|
|
|
|
ThreadMgr_GetFunctionProvider,
|
|
|
|
|
ThreadMgr_EnumFunctionProviders,
|
|
|
|
|
ThreadMgr_GetGlobalCompartment
|
|
|
|
|
ThreadMgr_GetGlobalCompartment,
|
|
|
|
|
|
|
|
|
|
ThreadMgr_ActivateEx,
|
|
|
|
|
ThreadMgr_GetActiveFlags
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfSource(iface);
|
|
|
|
|
return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
|
|
|
|
|
return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI Source_AddRef(ITfSource *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfSource(iface);
|
|
|
|
|
return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
|
|
|
|
|
return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI Source_Release(ITfSource *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfSource(iface);
|
|
|
|
|
return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
|
|
|
|
|
return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************
|
|
|
|
@@ -672,19 +703,19 @@ static const ITfSourceVtbl ThreadMgrSourceVtbl =
|
|
|
|
|
static HRESULT WINAPI KeystrokeMgr_QueryInterface(ITfKeystrokeMgr *iface, REFIID iid, LPVOID *ppvOut)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
|
|
|
|
|
return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
|
|
|
|
|
return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI KeystrokeMgr_AddRef(ITfKeystrokeMgr *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
|
|
|
|
|
return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
|
|
|
|
|
return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI KeystrokeMgr_Release(ITfKeystrokeMgr *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
|
|
|
|
|
return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
|
|
|
|
|
return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI KeystrokeMgr_AdviseKeyEventSink(ITfKeystrokeMgr *iface,
|
|
|
|
@@ -964,19 +995,19 @@ static const ITfKeystrokeMgrVtbl KeystrokeMgrVtbl =
|
|
|
|
|
static HRESULT WINAPI MessagePump_QueryInterface(ITfMessagePump *iface, REFIID iid, LPVOID *ppvOut)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfMessagePump(iface);
|
|
|
|
|
return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
|
|
|
|
|
return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI MessagePump_AddRef(ITfMessagePump *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfMessagePump(iface);
|
|
|
|
|
return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
|
|
|
|
|
return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI MessagePump_Release(ITfMessagePump *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfMessagePump(iface);
|
|
|
|
|
return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
|
|
|
|
|
return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI MessagePump_PeekMessageA(ITfMessagePump *iface,
|
|
|
|
@@ -1037,19 +1068,19 @@ static const ITfMessagePumpVtbl MessagePumpVtbl =
|
|
|
|
|
static HRESULT WINAPI ClientId_QueryInterface(ITfClientId *iface, REFIID iid, LPVOID *ppvOut)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfClientId(iface);
|
|
|
|
|
return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
|
|
|
|
|
return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI ClientId_AddRef(ITfClientId *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfClientId(iface);
|
|
|
|
|
return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
|
|
|
|
|
return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI ClientId_Release(ITfClientId *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfClientId(iface);
|
|
|
|
|
return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
|
|
|
|
|
return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClientId_GetClientId(ITfClientId *iface,
|
|
|
|
@@ -1083,19 +1114,19 @@ static const ITfClientIdVtbl ClientIdVtbl =
|
|
|
|
|
static HRESULT WINAPI ThreadMgrEventSink_QueryInterface(ITfThreadMgrEventSink *iface, REFIID iid, LPVOID *ppvOut)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface);
|
|
|
|
|
return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
|
|
|
|
|
return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI ThreadMgrEventSink_AddRef(ITfThreadMgrEventSink *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface);
|
|
|
|
|
return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
|
|
|
|
|
return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI ThreadMgrEventSink_Release(ITfThreadMgrEventSink *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface);
|
|
|
|
|
return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
|
|
|
|
|
return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1197,25 +1228,105 @@ static const ITfThreadMgrEventSinkVtbl ThreadMgrEventSinkVtbl =
|
|
|
|
|
ThreadMgrEventSink_OnPopContext
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*****************************************************
|
|
|
|
|
* ITfUIElementMgr functions
|
|
|
|
|
*****************************************************/
|
|
|
|
|
static HRESULT WINAPI UIElementMgr_QueryInterface(ITfUIElementMgr *iface, REFIID iid, void **ppvOut)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfUIElementMgr(iface);
|
|
|
|
|
|
|
|
|
|
return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, *ppvOut);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI UIElementMgr_AddRef(ITfUIElementMgr *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfUIElementMgr(iface);
|
|
|
|
|
|
|
|
|
|
return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI UIElementMgr_Release(ITfUIElementMgr *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfUIElementMgr(iface);
|
|
|
|
|
|
|
|
|
|
return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI UIElementMgr_BeginUIElement(ITfUIElementMgr *iface, ITfUIElement *element,
|
|
|
|
|
BOOL *show, DWORD *id)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfUIElementMgr(iface);
|
|
|
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n", This);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI UIElementMgr_UpdateUIElement(ITfUIElementMgr *iface, DWORD id)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfUIElementMgr(iface);
|
|
|
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n", This);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI UIElementMgr_EndUIElement(ITfUIElementMgr *iface, DWORD id)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfUIElementMgr(iface);
|
|
|
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n", This);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI UIElementMgr_GetUIElement(ITfUIElementMgr *iface, DWORD id,
|
|
|
|
|
ITfUIElement **element)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfUIElementMgr(iface);
|
|
|
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n", This);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI UIElementMgr_EnumUIElements(ITfUIElementMgr *iface,
|
|
|
|
|
IEnumTfUIElements **enum_elements)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfUIElementMgr(iface);
|
|
|
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n", This);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const ITfUIElementMgrVtbl ThreadMgrUIElementMgrVtbl =
|
|
|
|
|
{
|
|
|
|
|
UIElementMgr_QueryInterface,
|
|
|
|
|
UIElementMgr_AddRef,
|
|
|
|
|
UIElementMgr_Release,
|
|
|
|
|
|
|
|
|
|
UIElementMgr_BeginUIElement,
|
|
|
|
|
UIElementMgr_UpdateUIElement,
|
|
|
|
|
UIElementMgr_EndUIElement,
|
|
|
|
|
UIElementMgr_GetUIElement,
|
|
|
|
|
UIElementMgr_EnumUIElements
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*****************************************************
|
|
|
|
|
* ITfSourceSingle functions
|
|
|
|
|
*****************************************************/
|
|
|
|
|
static HRESULT WINAPI ThreadMgrSourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfSourceSingle(iface);
|
|
|
|
|
return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
|
|
|
|
|
return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI ThreadMgrSourceSingle_AddRef(ITfSourceSingle *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfSourceSingle(iface);
|
|
|
|
|
return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
|
|
|
|
|
return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI ThreadMgrSourceSingle_Release(ITfSourceSingle *iface)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfSourceSingle(iface);
|
|
|
|
|
return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
|
|
|
|
|
return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI ThreadMgrSourceSingle_AdviseSingleSink( ITfSourceSingle *iface,
|
|
|
|
@@ -1253,8 +1364,8 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
|
|
|
|
|
This = TlsGetValue(tlsIndex);
|
|
|
|
|
if (This)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr_AddRef(&This->ITfThreadMgr_iface);
|
|
|
|
|
*ppOut = (IUnknown*)&This->ITfThreadMgr_iface;
|
|
|
|
|
ThreadMgr_AddRef(&This->ITfThreadMgrEx_iface);
|
|
|
|
|
*ppOut = (IUnknown*)&This->ITfThreadMgrEx_iface;
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1262,12 +1373,13 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
|
|
|
|
|
if (This == NULL)
|
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
|
|
This->ITfThreadMgr_iface.lpVtbl= &ThreadMgrVtbl;
|
|
|
|
|
This->ITfThreadMgrEx_iface.lpVtbl = &ThreadMgrExVtbl;
|
|
|
|
|
This->ITfSource_iface.lpVtbl = &ThreadMgrSourceVtbl;
|
|
|
|
|
This->ITfKeystrokeMgr_iface.lpVtbl= &KeystrokeMgrVtbl;
|
|
|
|
|
This->ITfKeystrokeMgr_iface.lpVtbl = &KeystrokeMgrVtbl;
|
|
|
|
|
This->ITfMessagePump_iface.lpVtbl = &MessagePumpVtbl;
|
|
|
|
|
This->ITfClientId_iface.lpVtbl = &ClientIdVtbl;
|
|
|
|
|
This->ITfThreadMgrEventSink_iface.lpVtbl = &ThreadMgrEventSinkVtbl;
|
|
|
|
|
This->ITfUIElementMgr_iface.lpVtbl = &ThreadMgrUIElementMgrVtbl;
|
|
|
|
|
This->ITfSourceSingle_iface.lpVtbl = &SourceSingleVtbl;
|
|
|
|
|
This->refCount = 1;
|
|
|
|
|
TlsSetValue(tlsIndex,This);
|
|
|
|
@@ -1286,7 +1398,7 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
|
|
|
|
|
list_init(&This->ThreadMgrEventSink);
|
|
|
|
|
|
|
|
|
|
TRACE("returning %p\n", This);
|
|
|
|
|
*ppOut = (IUnknown *)&This->ITfThreadMgr_iface;
|
|
|
|
|
*ppOut = (IUnknown *)&This->ITfThreadMgrEx_iface;
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1437,7 +1549,7 @@ static HRESULT EnumTfDocumentMgr_Constructor(struct list* head, IEnumTfDocumentM
|
|
|
|
|
|
|
|
|
|
void ThreadMgr_OnDocumentMgrDestruction(ITfThreadMgr *iface, ITfDocumentMgr *mgr)
|
|
|
|
|
{
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
|
|
|
|
|
ThreadMgr *This = impl_from_ITfThreadMgrEx((ITfThreadMgrEx *)iface);
|
|
|
|
|
struct list *cursor;
|
|
|
|
|
LIST_FOR_EACH(cursor, &This->CreatedDocumentMgrs)
|
|
|
|
|
{
|
|
|
|
|