Aric Stewart : msctf: Implement ITfMessagePump.

Alexandre Julliard julliard at winehq.org
Wed May 6 10:33:13 CDT 2009


Module: wine
Branch: master
Commit: 1b92fcfa181c4cce4910057ff0ebea54bbf8feb5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1b92fcfa181c4cce4910057ff0ebea54bbf8feb5

Author: Aric Stewart <aric at codeweavers.com>
Date:   Tue May  5 10:52:00 2009 -0500

msctf: Implement ITfMessagePump.

---

 dlls/msctf/threadmgr.c |   85 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/msctf.idl      |   40 ++++++++++++++++++++++
 2 files changed, 125 insertions(+), 0 deletions(-)

diff --git a/dlls/msctf/threadmgr.c b/dlls/msctf/threadmgr.c
index 2d43a19..fa13a2f 100644
--- a/dlls/msctf/threadmgr.c
+++ b/dlls/msctf/threadmgr.c
@@ -60,6 +60,7 @@ typedef struct tagACLMulti {
     const ITfThreadMgrVtbl *ThreadMgrVtbl;
     const ITfSourceVtbl *SourceVtbl;
     const ITfKeystrokeMgrVtbl *KeystrokeMgrVtbl;
+    const ITfMessagePumpVtbl *MessagePumpVtbl;
     LONG refCount;
 
     const ITfThreadMgrEventSinkVtbl *ThreadMgrEventSinkVtbl; /* internal */
@@ -85,6 +86,11 @@ static inline ThreadMgr *impl_from_ITfKeystrokeMgrVtbl(ITfKeystrokeMgr *iface)
     return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,KeystrokeMgrVtbl));
 }
 
+static inline ThreadMgr *impl_from_ITfMessagePumpVtbl(ITfMessagePump *iface)
+{
+    return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,MessagePumpVtbl));
+}
+
 static inline ThreadMgr *impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink *iface)
 {
     return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,ThreadMgrEventSinkVtbl));
@@ -163,6 +169,10 @@ static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid,
     {
         *ppvOut = &This->KeystrokeMgrVtbl;
     }
+    else if (IsEqualIID(iid, &IID_ITfMessagePump))
+    {
+        *ppvOut = &This->MessagePumpVtbl;
+    }
 
     if (*ppvOut)
     {
@@ -576,6 +586,80 @@ static const ITfKeystrokeMgrVtbl ThreadMgr_KeystrokeMgrVtbl =
 };
 
 /*****************************************************
+ * ITfMessagePump functions
+ *****************************************************/
+
+static HRESULT WINAPI MessagePump_QueryInterface(ITfMessagePump *iface, REFIID iid, LPVOID *ppvOut)
+{
+    ThreadMgr *This = impl_from_ITfMessagePumpVtbl(iface);
+    return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut);
+}
+
+static ULONG WINAPI MessagePump_AddRef(ITfMessagePump *iface)
+{
+    ThreadMgr *This = impl_from_ITfMessagePumpVtbl(iface);
+    return ThreadMgr_AddRef((ITfThreadMgr*)This);
+}
+
+static ULONG WINAPI MessagePump_Release(ITfMessagePump *iface)
+{
+    ThreadMgr *This = impl_from_ITfMessagePumpVtbl(iface);
+    return ThreadMgr_Release((ITfThreadMgr *)This);
+}
+
+static HRESULT WINAPI MessagePump_PeekMessageA(ITfMessagePump *iface,
+        LPMSG pMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax,
+        UINT wRemoveMsg, BOOL *pfResult)
+{
+    if (!pfResult)
+        return E_INVALIDARG;
+    *pfResult = PeekMessageA(pMsg, hwnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
+    return S_OK;
+}
+
+static HRESULT WINAPI MessagePump_GetMessageA(ITfMessagePump *iface,
+        LPMSG pMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax,
+        BOOL *pfResult)
+{
+    if (!pfResult)
+        return E_INVALIDARG;
+    *pfResult = GetMessageA(pMsg, hwnd, wMsgFilterMin, wMsgFilterMax);
+    return S_OK;
+}
+
+static HRESULT WINAPI MessagePump_PeekMessageW(ITfMessagePump *iface,
+        LPMSG pMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax,
+        UINT wRemoveMsg, BOOL *pfResult)
+{
+    if (!pfResult)
+        return E_INVALIDARG;
+    *pfResult = PeekMessageW(pMsg, hwnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
+    return S_OK;
+}
+
+static HRESULT WINAPI MessagePump_GetMessageW(ITfMessagePump *iface,
+        LPMSG pMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax,
+        BOOL *pfResult)
+{
+    if (!pfResult)
+        return E_INVALIDARG;
+    *pfResult = GetMessageW(pMsg, hwnd, wMsgFilterMin, wMsgFilterMax);
+    return S_OK;
+}
+
+static const ITfMessagePumpVtbl ThreadMgr_MessagePumpVtbl =
+{
+    MessagePump_QueryInterface,
+    MessagePump_AddRef,
+    MessagePump_Release,
+
+    MessagePump_PeekMessageA,
+    MessagePump_GetMessageA,
+    MessagePump_PeekMessageW,
+    MessagePump_GetMessageW
+};
+
+/*****************************************************
  * ITfThreadMgrEventSink functions  (internal)
  *****************************************************/
 static HRESULT WINAPI ThreadMgrEventSink_QueryInterface(ITfThreadMgrEventSink *iface, REFIID iid, LPVOID *ppvOut)
@@ -718,6 +802,7 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
     This->ThreadMgrVtbl= &ThreadMgr_ThreadMgrVtbl;
     This->SourceVtbl = &ThreadMgr_SourceVtbl;
     This->KeystrokeMgrVtbl= &ThreadMgr_KeystrokeMgrVtbl;
+    This->MessagePumpVtbl= &ThreadMgr_MessagePumpVtbl;
     This->ThreadMgrEventSinkVtbl = &ThreadMgr_ThreadMgrEventSinkVtbl;
     This->refCount = 1;
     TlsSetValue(tlsIndex,This);
diff --git a/include/msctf.idl b/include/msctf.idl
index 9255fea..115e643 100644
--- a/include/msctf.idl
+++ b/include/msctf.idl
@@ -22,6 +22,7 @@ import "comcat.idl";
 import "textstor.idl";
 /* import "ctfutb.idl"; */
 #endif
+cpp_quote("#include <winuser.h>")
 
 cpp_quote("#define TF_E_STACKFULL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0501)")
 cpp_quote("#define TF_E_ALREADY_EXISTS  MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0506)")
@@ -646,3 +647,42 @@ interface ITfKeyEventSink : IUnknown
         [in] REFGUID rguid,
         [out] BOOL *pfEaten);
 };
+
+[
+  object,
+  local,
+  uuid(8f1b8ad8-0b6b-4874-90c5-bd76011e8f7c),
+  pointer_default(unique)
+]
+interface ITfMessagePump : IUnknown
+{
+    HRESULT PeekMessageA(
+        [out] LPMSG pMsg,
+        [in] HWND hwnd,
+        [in] UINT wMsgFilterMin,
+        [in] UINT wMsgFilterMax,
+        [in] UINT wRemoveMsg,
+        [out] BOOL *pfResult);
+
+    HRESULT GetMessageA(
+        [out] LPMSG pMsg,
+        [in] HWND hwnd,
+        [in] UINT wMsgFilterMin,
+        [in] UINT wMsgFilterMax,
+        [out] BOOL *pfResult);
+
+    HRESULT PeekMessageW(
+        [out] LPMSG pMsg,
+        [in] HWND hwnd,
+        [in] UINT wMsgFilterMin,
+        [in] UINT wMsgFilterMax,
+        [in] UINT wRemoveMsg,
+        [out] BOOL *pfResult);
+
+    HRESULT GetMessageW(
+        [out] LPMSG pMsg,
+        [in] HWND hwnd,
+        [in] UINT wMsgFilterMin,
+        [in] UINT wMsgFilterMax,
+        [out] BOOL *pfResult);
+};




More information about the wine-cvs mailing list