msctf: Add ITfKeystrokeMgr framework to ThreadMgr.
This commit is contained in:
parent
9ae14c8e3a
commit
987387c7c8
@ -59,6 +59,7 @@ typedef struct tagThreadMgrSink {
|
|||||||
typedef struct tagACLMulti {
|
typedef struct tagACLMulti {
|
||||||
const ITfThreadMgrVtbl *ThreadMgrVtbl;
|
const ITfThreadMgrVtbl *ThreadMgrVtbl;
|
||||||
const ITfSourceVtbl *SourceVtbl;
|
const ITfSourceVtbl *SourceVtbl;
|
||||||
|
const ITfKeystrokeMgrVtbl *KeystrokeMgrVtbl;
|
||||||
LONG refCount;
|
LONG refCount;
|
||||||
|
|
||||||
const ITfThreadMgrEventSinkVtbl *ThreadMgrEventSinkVtbl; /* internal */
|
const ITfThreadMgrEventSinkVtbl *ThreadMgrEventSinkVtbl; /* internal */
|
||||||
@ -79,6 +80,11 @@ static inline ThreadMgr *impl_from_ITfSourceVtbl(ITfSource *iface)
|
|||||||
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,SourceVtbl));
|
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,SourceVtbl));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline ThreadMgr *impl_from_ITfKeystrokeMgrVtbl(ITfKeystrokeMgr *iface)
|
||||||
|
{
|
||||||
|
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,KeystrokeMgrVtbl));
|
||||||
|
}
|
||||||
|
|
||||||
static inline ThreadMgr *impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink *iface)
|
static inline ThreadMgr *impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink *iface)
|
||||||
{
|
{
|
||||||
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,ThreadMgrEventSinkVtbl));
|
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,ThreadMgrEventSinkVtbl));
|
||||||
@ -153,6 +159,10 @@ static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid,
|
|||||||
{
|
{
|
||||||
*ppvOut = &This->SourceVtbl;
|
*ppvOut = &This->SourceVtbl;
|
||||||
}
|
}
|
||||||
|
else if (IsEqualIID(iid, &IID_ITfKeystrokeMgr))
|
||||||
|
{
|
||||||
|
*ppvOut = &This->KeystrokeMgrVtbl;
|
||||||
|
}
|
||||||
|
|
||||||
if (*ppvOut)
|
if (*ppvOut)
|
||||||
{
|
{
|
||||||
@ -408,6 +418,163 @@ static const ITfSourceVtbl ThreadMgr_SourceVtbl =
|
|||||||
ThreadMgrSource_UnadviseSink,
|
ThreadMgrSource_UnadviseSink,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*****************************************************
|
||||||
|
* ITfKeystrokeMgr functions
|
||||||
|
*****************************************************/
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_QueryInterface(ITfKeystrokeMgr *iface, REFIID iid, LPVOID *ppvOut)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI KeystrokeMgr_AddRef(ITfKeystrokeMgr *iface)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
return ThreadMgr_AddRef((ITfThreadMgr*)This);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI KeystrokeMgr_Release(ITfKeystrokeMgr *iface)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
return ThreadMgr_Release((ITfThreadMgr *)This);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_AdviseKeyEventSink(ITfKeystrokeMgr *iface,
|
||||||
|
TfClientId tid, ITfKeyEventSink *pSink, BOOL fForeground)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_UnadviseKeyEventSink(ITfKeystrokeMgr *iface,
|
||||||
|
TfClientId tid)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_GetForeground(ITfKeystrokeMgr *iface,
|
||||||
|
CLSID *pclsid)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_TestKeyDown(ITfKeystrokeMgr *iface,
|
||||||
|
WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_TestKeyUp(ITfKeystrokeMgr *iface,
|
||||||
|
WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_KeyDown(ITfKeystrokeMgr *iface,
|
||||||
|
WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_KeyUp(ITfKeystrokeMgr *iface,
|
||||||
|
WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_GetPreservedKey(ITfKeystrokeMgr *iface,
|
||||||
|
ITfContext *pic, const TF_PRESERVEDKEY *pprekey, GUID *pguid)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_IsPreservedKey(ITfKeystrokeMgr *iface,
|
||||||
|
REFGUID rguid, const TF_PRESERVEDKEY *pprekey, BOOL *pfRegistered)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_PreserveKey(ITfKeystrokeMgr *iface,
|
||||||
|
TfClientId tid, REFGUID rguid, const TF_PRESERVEDKEY *prekey,
|
||||||
|
const WCHAR *pchDesc, ULONG cchDesc)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_UnpreserveKey(ITfKeystrokeMgr *iface,
|
||||||
|
REFGUID rguid, const TF_PRESERVEDKEY *pprekey)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_SetPreservedKeyDescription(ITfKeystrokeMgr *iface,
|
||||||
|
REFGUID rguid, const WCHAR *pchDesc, ULONG cchDesc)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_GetPreservedKeyDescription(ITfKeystrokeMgr *iface,
|
||||||
|
REFGUID rguid, BSTR *pbstrDesc)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI KeystrokeMgr_SimulatePreservedKey(ITfKeystrokeMgr *iface,
|
||||||
|
ITfContext *pic, REFGUID rguid, BOOL *pfEaten)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
|
||||||
|
FIXME("STUB:(%p)\n",This);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const ITfKeystrokeMgrVtbl ThreadMgr_KeystrokeMgrVtbl =
|
||||||
|
{
|
||||||
|
KeystrokeMgr_QueryInterface,
|
||||||
|
KeystrokeMgr_AddRef,
|
||||||
|
KeystrokeMgr_Release,
|
||||||
|
|
||||||
|
KeystrokeMgr_AdviseKeyEventSink,
|
||||||
|
KeystrokeMgr_UnadviseKeyEventSink,
|
||||||
|
KeystrokeMgr_GetForeground,
|
||||||
|
KeystrokeMgr_TestKeyDown,
|
||||||
|
KeystrokeMgr_TestKeyUp,
|
||||||
|
KeystrokeMgr_KeyDown,
|
||||||
|
KeystrokeMgr_KeyUp,
|
||||||
|
KeystrokeMgr_GetPreservedKey,
|
||||||
|
KeystrokeMgr_IsPreservedKey,
|
||||||
|
KeystrokeMgr_PreserveKey,
|
||||||
|
KeystrokeMgr_UnpreserveKey,
|
||||||
|
KeystrokeMgr_SetPreservedKeyDescription,
|
||||||
|
KeystrokeMgr_GetPreservedKeyDescription,
|
||||||
|
KeystrokeMgr_SimulatePreservedKey
|
||||||
|
};
|
||||||
|
|
||||||
/*****************************************************
|
/*****************************************************
|
||||||
* ITfThreadMgrEventSink functions (internal)
|
* ITfThreadMgrEventSink functions (internal)
|
||||||
*****************************************************/
|
*****************************************************/
|
||||||
@ -550,6 +717,7 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
|
|||||||
|
|
||||||
This->ThreadMgrVtbl= &ThreadMgr_ThreadMgrVtbl;
|
This->ThreadMgrVtbl= &ThreadMgr_ThreadMgrVtbl;
|
||||||
This->SourceVtbl = &ThreadMgr_SourceVtbl;
|
This->SourceVtbl = &ThreadMgr_SourceVtbl;
|
||||||
|
This->KeystrokeMgrVtbl= &ThreadMgr_KeystrokeMgrVtbl;
|
||||||
This->ThreadMgrEventSinkVtbl = &ThreadMgr_ThreadMgrEventSinkVtbl;
|
This->ThreadMgrEventSinkVtbl = &ThreadMgr_ThreadMgrEventSinkVtbl;
|
||||||
This->refCount = 1;
|
This->refCount = 1;
|
||||||
TlsSetValue(tlsIndex,This);
|
TlsSetValue(tlsIndex,This);
|
||||||
|
@ -56,6 +56,7 @@ interface ITfRangeBackup;
|
|||||||
interface IEnumTfLanguageProfiles;
|
interface IEnumTfLanguageProfiles;
|
||||||
interface ITfEditRecord;
|
interface ITfEditRecord;
|
||||||
interface ITfCompositionView;
|
interface ITfCompositionView;
|
||||||
|
interface ITfKeyEventSink;
|
||||||
|
|
||||||
typedef [uuid(e1b5808d-1e46-4c19-84dc-68c5f5978cc8)] struct TF_LANGUAGEPROFILE
|
typedef [uuid(e1b5808d-1e46-4c19-84dc-68c5f5978cc8)] struct TF_LANGUAGEPROFILE
|
||||||
{
|
{
|
||||||
@ -66,6 +67,12 @@ typedef [uuid(e1b5808d-1e46-4c19-84dc-68c5f5978cc8)] struct TF_LANGUAGEPROFILE
|
|||||||
GUID guidProfile;
|
GUID guidProfile;
|
||||||
} TF_LANGUAGEPROFILE;
|
} TF_LANGUAGEPROFILE;
|
||||||
|
|
||||||
|
typedef [uuid(77c12f95-b783-450d-879f-1cd2362c6521)] struct TF_PRESERVEDKEY
|
||||||
|
{
|
||||||
|
UINT uVKey;
|
||||||
|
UINT uModifiers;
|
||||||
|
} TF_PRESERVEDKEY;
|
||||||
|
|
||||||
[
|
[
|
||||||
object,
|
object,
|
||||||
uuid(aa80e801-2021-11d2-93e0-0060b067b86e),
|
uuid(aa80e801-2021-11d2-93e0-0060b067b86e),
|
||||||
@ -510,3 +517,78 @@ interface ITfThreadMgrEventSink : IUnknown
|
|||||||
HRESULT OnPopContext(
|
HRESULT OnPopContext(
|
||||||
[in] ITfContext *pic);
|
[in] ITfContext *pic);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[
|
||||||
|
object,
|
||||||
|
local,
|
||||||
|
uuid(aa80e7f0-2021-11d2-93e0-0060b067b86e),
|
||||||
|
pointer_default(unique)
|
||||||
|
]
|
||||||
|
interface ITfKeystrokeMgr : IUnknown
|
||||||
|
{
|
||||||
|
HRESULT AdviseKeyEventSink(
|
||||||
|
[in] TfClientId tid,
|
||||||
|
[in] ITfKeyEventSink *pSink,
|
||||||
|
[in] BOOL fForeground);
|
||||||
|
|
||||||
|
HRESULT UnadviseKeyEventSink(
|
||||||
|
[in] TfClientId tid);
|
||||||
|
|
||||||
|
HRESULT GetForeground(
|
||||||
|
[out] CLSID *pclsid);
|
||||||
|
|
||||||
|
HRESULT TestKeyDown(
|
||||||
|
[in] WPARAM wParam,
|
||||||
|
[in] LPARAM lParam,
|
||||||
|
[out] BOOL *pfEaten);
|
||||||
|
|
||||||
|
HRESULT TestKeyUp(
|
||||||
|
[in] WPARAM wParam,
|
||||||
|
[in] LPARAM lParam,
|
||||||
|
[out] BOOL *pfEaten);
|
||||||
|
|
||||||
|
HRESULT KeyDown(
|
||||||
|
[in] WPARAM wParam,
|
||||||
|
[in] LPARAM lParam,
|
||||||
|
[out] BOOL *pfEaten);
|
||||||
|
|
||||||
|
HRESULT KeyUp(
|
||||||
|
[in] WPARAM wParam,
|
||||||
|
[in] LPARAM lParam,
|
||||||
|
[out] BOOL *pfEaten);
|
||||||
|
|
||||||
|
HRESULT GetPreservedKey(
|
||||||
|
[in] ITfContext *pic,
|
||||||
|
[in] const TF_PRESERVEDKEY *pprekey,
|
||||||
|
[out] GUID *pguid);
|
||||||
|
|
||||||
|
HRESULT IsPreservedKey(
|
||||||
|
[in] REFGUID rguid,
|
||||||
|
[in] const TF_PRESERVEDKEY *pprekey,
|
||||||
|
[out] BOOL *pfRegistered);
|
||||||
|
|
||||||
|
HRESULT PreserveKey(
|
||||||
|
[in] TfClientId tid,
|
||||||
|
[in] REFGUID rguid,
|
||||||
|
[in] const TF_PRESERVEDKEY *prekey,
|
||||||
|
[in, size_is(cchDesc)] const WCHAR *pchDesc,
|
||||||
|
[in] ULONG cchDesc);
|
||||||
|
|
||||||
|
HRESULT UnpreserveKey(
|
||||||
|
[in] REFGUID rguid,
|
||||||
|
[in] const TF_PRESERVEDKEY *pprekey);
|
||||||
|
|
||||||
|
HRESULT SetPreservedKeyDescription(
|
||||||
|
[in] REFGUID rguid,
|
||||||
|
[in, size_is(cchDesc)] const WCHAR *pchDesc,
|
||||||
|
[in] ULONG cchDesc);
|
||||||
|
|
||||||
|
HRESULT GetPreservedKeyDescription(
|
||||||
|
[in] REFGUID rguid,
|
||||||
|
[out] BSTR *pbstrDesc);
|
||||||
|
|
||||||
|
HRESULT SimulatePreservedKey(
|
||||||
|
[in] ITfContext *pic,
|
||||||
|
[in] REFGUID rguid,
|
||||||
|
[out] BOOL *pfEaten);
|
||||||
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user