[MSCTF]
authorChristoph von Wittich <christoph_vw@reactos.org>
Sun, 7 Mar 2010 09:48:42 +0000 (09:48 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Sun, 7 Mar 2010 09:48:42 +0000 (09:48 +0000)
sync msctf to wine 1.1.40

svn path=/trunk/; revision=45982

13 files changed:
reactos/dll/win32/msctf/langbarmgr.c [new file with mode: 0644]
reactos/dll/win32/msctf/msctf.c
reactos/dll/win32/msctf/msctf.rbuild
reactos/dll/win32/msctf/msctf.spec
reactos/dll/win32/msctf/msctf_internal.h
reactos/dll/win32/msctf/msctf_local.idl [deleted file]
reactos/dll/win32/msctf/regsvr.c
reactos/dll/win32/msctf/textstor_local.idl [deleted file]
reactos/dll/win32/msctf/threadmgr.c
reactos/include/psdk/ctfutb.idl [new file with mode: 0644]
reactos/include/psdk/msctf.idl
reactos/include/psdk/psdk.rbuild
reactos/lib/sdk/uuid/uuid.c

diff --git a/reactos/dll/win32/msctf/langbarmgr.c b/reactos/dll/win32/msctf/langbarmgr.c
new file mode 100644 (file)
index 0000000..272a816
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+ *  ITfLangBarMgr implementation
+ *
+ *  Copyright 2010 Justin Chevrier
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define COBJMACROS
+
+#include "wine/debug.h"
+#include "winbase.h"
+#include "winreg.h"
+#include "shlwapi.h"
+
+#include "msctf.h"
+#include "msctf_internal.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(msctf);
+
+typedef struct tagLangBarMgr {
+    const ITfLangBarMgrVtbl *LangBarMgrVtbl;
+
+    LONG refCount;
+
+} LangBarMgr;
+
+static void LangBarMgr_Destructor(LangBarMgr *This)
+{
+    TRACE("destroying %p\n", This);
+
+    HeapFree(GetProcessHeap(),0,This);
+}
+
+static HRESULT WINAPI LangBarMgr_QueryInterface(ITfLangBarMgr *iface, REFIID iid, LPVOID *ppvOut)
+{
+    LangBarMgr *This = (LangBarMgr *)iface;
+    *ppvOut = NULL;
+
+    if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfLangBarMgr))
+    {
+        *ppvOut = This;
+    }
+
+    if (*ppvOut)
+    {
+        IUnknown_AddRef(iface);
+        return S_OK;
+    }
+
+    WARN("unsupported interface: %s\n", debugstr_guid(iid));
+    return E_NOINTERFACE;
+}
+
+static ULONG WINAPI LangBarMgr_AddRef(ITfLangBarMgr *iface)
+{
+    LangBarMgr *This = (LangBarMgr *)iface;
+    return InterlockedIncrement(&This->refCount);
+}
+
+static ULONG WINAPI LangBarMgr_Release(ITfLangBarMgr *iface)
+{
+    LangBarMgr *This = (LangBarMgr *)iface;
+    ULONG ret;
+
+    ret = InterlockedDecrement(&This->refCount);
+    if (ret == 0)
+        LangBarMgr_Destructor(This);
+    return ret;
+}
+
+/*****************************************************
+ * ITfLangBarMgr functions
+ *****************************************************/
+
+static HRESULT WINAPI LangBarMgr_AdviseEventSink( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, HWND hwnd, DWORD dwflags, DWORD *pdwCookie)
+{
+    LangBarMgr *This = (LangBarMgr *)iface;
+
+    FIXME("STUB:(%p)\n",This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI LangBarMgr_UnAdviseEventSink( ITfLangBarMgr* iface, DWORD dwCookie)
+{
+    LangBarMgr *This = (LangBarMgr *)iface;
+
+    FIXME("STUB:(%p)\n",This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI LangBarMgr_GetThreadMarshalInterface( ITfLangBarMgr* iface, DWORD dwThreadId, DWORD dwType, REFIID riid, IUnknown **ppunk)
+{
+    LangBarMgr *This = (LangBarMgr *)iface;
+
+    FIXME("STUB:(%p)\n",This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI LangBarMgr_GetThreadLangBarItemMgr( ITfLangBarMgr* iface, DWORD dwThreadId, ITfLangBarItemMgr **pplbi, DWORD *pdwThreadid)
+{
+    LangBarMgr *This = (LangBarMgr *)iface;
+
+    FIXME("STUB:(%p)\n",This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI LangBarMgr_GetInputProcessorProfiles( ITfLangBarMgr* iface, DWORD dwThreadId, ITfInputProcessorProfiles **ppaip, DWORD *pdwThreadid)
+{
+    LangBarMgr *This = (LangBarMgr *)iface;
+
+    FIXME("STUB:(%p)\n",This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI LangBarMgr_RestoreLastFocus( ITfLangBarMgr* iface, DWORD *dwThreadId, BOOL fPrev)
+{
+    LangBarMgr *This = (LangBarMgr *)iface;
+
+    FIXME("STUB:(%p)\n",This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI LangBarMgr_SetModalInput( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, DWORD dwThreadId, DWORD dwFlags)
+{
+    LangBarMgr *This = (LangBarMgr *)iface;
+
+    FIXME("STUB:(%p)\n",This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI LangBarMgr_ShowFloating( ITfLangBarMgr* iface, DWORD dwFlags)
+{
+    LangBarMgr *This = (LangBarMgr *)iface;
+
+    FIXME("STUB:(%p)\n",This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI LangBarMgr_GetShowFloatingStatus( ITfLangBarMgr* iface, DWORD *pdwFlags)
+{
+    LangBarMgr *This = (LangBarMgr *)iface;
+
+    FIXME("STUB:(%p)\n",This);
+    return E_NOTIMPL;
+}
+
+static const ITfLangBarMgrVtbl LangBarMgr_LangBarMgrVtbl =
+{
+    LangBarMgr_QueryInterface,
+    LangBarMgr_AddRef,
+    LangBarMgr_Release,
+
+    LangBarMgr_AdviseEventSink,
+    LangBarMgr_UnAdviseEventSink,
+    LangBarMgr_GetThreadMarshalInterface,
+    LangBarMgr_GetThreadLangBarItemMgr,
+    LangBarMgr_GetInputProcessorProfiles,
+    LangBarMgr_RestoreLastFocus,
+    LangBarMgr_SetModalInput,
+    LangBarMgr_ShowFloating,
+    LangBarMgr_GetShowFloatingStatus
+};
+
+HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
+{
+    LangBarMgr *This;
+    if (pUnkOuter)
+        return CLASS_E_NOAGGREGATION;
+
+    This = HeapAlloc(GetProcessHeap(),0,sizeof(LangBarMgr));
+    if (This == NULL)
+        return E_OUTOFMEMORY;
+
+    This->LangBarMgrVtbl= &LangBarMgr_LangBarMgrVtbl;
+    This->refCount = 1;
+
+    TRACE("returning %p\n", This);
+    *ppOut = (IUnknown *)This;
+    return S_OK;
+}
index 8277278..62d1ff2 100644 (file)
@@ -87,6 +87,7 @@ static const struct {
     {&CLSID_TF_ThreadMgr, ThreadMgr_Constructor},
     {&CLSID_TF_InputProcessorProfiles, InputProcessorProfiles_Constructor},
     {&CLSID_TF_CategoryMgr, CategoryMgr_Constructor},
+    {&CLSID_TF_LangBarMgr, LangBarMgr_Constructor},
     {NULL, NULL}
 };
 
@@ -351,7 +352,7 @@ HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp)
     ActivatedTextService *actsvr;
     ITfCategoryMgr *catmgr;
     AtsEntry *entry;
-    ITfThreadMgr *tm = (ITfThreadMgr*)TlsGetValue(tlsIndex);
+    ITfThreadMgr *tm = TlsGetValue(tlsIndex);
     ITfClientId *clientid;
 
     if (!tm) return E_UNEXPECTED;
@@ -608,3 +609,21 @@ HRESULT WINAPI TF_CreateInputProcessorProfiles(
 {
     return InputProcessorProfiles_Constructor(NULL,(IUnknown**)ppipr);
 }
+
+/***********************************************************************
+ *              TF_InvalidAssemblyListCacheIfExist(MSCTF.@)
+ */
+HRESULT WINAPI TF_InvalidAssemblyListCacheIfExist(void)
+{
+    FIXME("Stub\n");
+    return S_OK;
+}
+
+/***********************************************************************
+ *              TF_CreateLangBarMgr (MSCTF.@)
+ */
+HRESULT WINAPI TF_CreateLangBarMgr(ITfLangBarMgr **pppbm)
+{
+    TRACE("\n");
+    return LangBarMgr_Constructor(NULL,(IUnknown**)pppbm);
+}
index d6c531e..de8f52b 100644 (file)
@@ -13,6 +13,7 @@
        <file>context.c</file>
        <file>documentmgr.c</file>
        <file>inputprocessor.c</file>
+       <file>langbarmgr.c</file>
        <file>msctf.c</file>
        <file>range.c</file>
        <file>regsvr.c</file>
        <library>oleaut32</library>
        <library>user32</library>
        <library>advapi32</library>
-       <library>msctf_local_interface</library>
-       <library>textstor_local_interface</library>
        <library>ntdll</library>
 </module>
-<module name="msctf_local_interface" type="idlinterface">
-       <file>msctf_local.idl</file>
-</module>
-<module name="textstor_local_interface" type="idlinterface">
-       <file>textstor_local.idl</file>
-</module>
 </group>
index f7c35a3..387af57 100644 (file)
@@ -13,7 +13,7 @@
 @ stub TF_CreateDisplayAttributeMgr
 @ stdcall TF_CreateInputProcessorProfiles(ptr)
 @ stub TF_CreateLangBarItemMgr
-@ stub TF_CreateLangBarMgr
+@ stdcall TF_CreateLangBarMgr(ptr)
 @ stdcall TF_CreateThreadMgr(ptr)
 @ stub TF_DllDetachInOther
 @ stub TF_GetGlobalCompartment
@@ -27,7 +27,7 @@
 @ stub TF_InitMlngInfo
 @ stub TF_InitSystem
 @ stub TF_InvalidAssemblyListCache
-@ stub TF_InvalidAssemblyListCacheIfExist
+@ stdcall TF_InvalidAssemblyListCacheIfExist()
 @ stub TF_IsCtfmonRunning
 @ stub TF_IsInMarshaling
 @ stub TF_MlngInfoCount
index 3bb0baa..57423e9 100644 (file)
@@ -40,6 +40,7 @@ extern HRESULT CategoryMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut);
 extern HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut);
 extern HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut);
 extern HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *This);
+extern HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut);
 
 extern HRESULT Context_Initialize(ITfContext *cxt, ITfDocumentMgr *manager);
 extern HRESULT Context_Uninitialize(ITfContext *cxt);
diff --git a/reactos/dll/win32/msctf/msctf_local.idl b/reactos/dll/win32/msctf/msctf_local.idl
deleted file mode 100644 (file)
index cc8b7e6..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-#include "msctf.idl"
index a47d984..2af1f24 100644 (file)
@@ -462,6 +462,13 @@ static struct regsvr_coclass const coclass_list[] = {
         "msctf.dll",
         "Apartment"
     },
+    {
+        &CLSID_TF_LangBarMgr,
+        "TF_LangBarMgr",
+        NULL,
+        "msctf.dll",
+        "Apartment"
+    },
     { NULL }                   /* list terminator */
 };
 
@@ -474,7 +481,7 @@ static struct regsvr_interface const interface_list[] = {
 };
 
 /***********************************************************************
- *             DllRegisterServer (HHCTRL.@)
+ *             DllRegisterServer (MSCTF.@)
  */
 HRESULT WINAPI DllRegisterServer(void)
 {
@@ -489,7 +496,7 @@ HRESULT WINAPI DllRegisterServer(void)
 }
 
 /***********************************************************************
- *             DllUnregisterServer (HHCTRL.@)
+ *             DllUnregisterServer (MSCTF.@)
  */
 HRESULT WINAPI DllUnregisterServer(void)
 {
diff --git a/reactos/dll/win32/msctf/textstor_local.idl b/reactos/dll/win32/msctf/textstor_local.idl
deleted file mode 100644 (file)
index a665b25..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-#include "textstor.idl"
index b77e0f2..5f3a90a 100644 (file)
@@ -88,7 +88,7 @@ typedef struct tagACLMulti {
     /* const ITfConfigureSystemKeystrokeFeedVtbl *ConfigureSystemKeystrokeFeedVtbl; */
     /* const ITfLangBarItemMgrVtbl *LangBarItemMgrVtbl; */
     /* const ITfUIElementMgrVtbl *UIElementMgrVtbl; */
-    /* const ITfSourceSingleVtbl *SourceSingleVtbl; */
+    const ITfSourceSingleVtbl *SourceSingleVtbl;
     LONG refCount;
 
     /* Aggregation */
@@ -126,7 +126,6 @@ typedef struct tagEnumTfDocumentMgr {
 } EnumTfDocumentMgr;
 
 static HRESULT EnumTfDocumentMgr_Constructor(struct list* head, IEnumTfDocumentMgrs **ppOut);
-LRESULT CALLBACK ThreadFocusHookProc(int nCode, WPARAM wParam, LPARAM lParam);
 
 static inline ThreadMgr *impl_from_ITfSourceVtbl(ITfSource *iface)
 {
@@ -153,20 +152,10 @@ static inline ThreadMgr *impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink *
     return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,ThreadMgrEventSinkVtbl));
 }
 
-static HRESULT SetupWindowsHook(ThreadMgr *This)
+static inline ThreadMgr *impl_from_ITfSourceSingleVtbl(ITfSourceSingle* iface)
+
 {
-    if (!This->focusHook)
-    {
-        This->focusHook = SetWindowsHookExW(WH_CBT, ThreadFocusHookProc, 0,
-                             GetCurrentThreadId());
-        if (!This->focusHook)
-        {
-            ERR("Unable to set focus hook\n");
-            return E_FAIL;
-        }
-        return S_OK;
-    }
-    return S_FALSE;
+    return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,SourceSingleVtbl));
 }
 
 static void free_sink(ThreadMgrSink *sink)
@@ -283,6 +272,10 @@ static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid,
     {
         *ppvOut = This->CompartmentMgr;
     }
+    else if (IsEqualIID(iid, &IID_ITfSourceSingle))
+    {
+        *ppvOut = &This->SourceSingleVtbl;
+    }
 
     if (*ppvOut)
     {
@@ -441,6 +434,58 @@ static HRESULT WINAPI ThreadMgr_SetFocus( ITfThreadMgr* iface, ITfDocumentMgr *p
     return S_OK;
 }
 
+static LRESULT CALLBACK ThreadFocusHookProc(int nCode, WPARAM wParam, LPARAM lParam)
+{
+    ThreadMgr *This;
+
+    This = TlsGetValue(tlsIndex);
+    if (!This)
+    {
+        ERR("Hook proc but no ThreadMgr for this thread. Serious Error\n");
+        return 0;
+    }
+    if (!This->focusHook)
+    {
+        ERR("Hook proc but no ThreadMgr focus Hook. Serious Error\n");
+        return 0;
+    }
+
+    if (nCode == HCBT_SETFOCUS) /* focus change within our thread */
+    {
+        struct list *cursor;
+
+        LIST_FOR_EACH(cursor, &This->AssociatedFocusWindows)
+        {
+            AssociatedWindow *wnd = LIST_ENTRY(cursor,AssociatedWindow,entry);
+            if (wnd->hwnd == (HWND)wParam)
+            {
+                TRACE("Triggering Associated window focus\n");
+                if (This->focus != wnd->docmgr)
+                    ThreadMgr_SetFocus((ITfThreadMgr*)This, wnd->docmgr);
+                break;
+            }
+        }
+    }
+
+    return CallNextHookEx(This->focusHook, nCode, wParam, lParam);
+}
+
+static HRESULT SetupWindowsHook(ThreadMgr *This)
+{
+    if (!This->focusHook)
+    {
+        This->focusHook = SetWindowsHookExW(WH_CBT, ThreadFocusHookProc, 0,
+                             GetCurrentThreadId());
+        if (!This->focusHook)
+        {
+            ERR("Unable to set focus hook\n");
+            return E_FAIL;
+        }
+        return S_OK;
+    }
+    return S_FALSE;
+}
+
 static HRESULT WINAPI ThreadMgr_AssociateFocus( ITfThreadMgr* iface, HWND hwnd,
 ITfDocumentMgr *pdimNew, ITfDocumentMgr **ppdimPrev)
 {
@@ -838,6 +883,7 @@ static HRESULT WINAPI KeystrokeMgr_PreserveKey(ITfKeystrokeMgr *iface,
     newkey->guid  = *rguid;
     newkey->prekey = *prekey;
     newkey->tid = tid;
+    newkey->description = NULL;
     if (cchDesc)
     {
         newkey->description = HeapAlloc(GetProcessHeap(),0,cchDesc * sizeof(WCHAR));
@@ -1172,6 +1218,53 @@ static const ITfThreadMgrEventSinkVtbl ThreadMgr_ThreadMgrEventSinkVtbl =
     ThreadMgrEventSink_OnPopContext
 };
 
+/*****************************************************
+ * ITfSourceSingle functions
+ *****************************************************/
+static HRESULT WINAPI ThreadMgrSourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut)
+{
+    ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface);
+    return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut);
+}
+
+static ULONG WINAPI ThreadMgrSourceSingle_AddRef(ITfSourceSingle *iface)
+{
+    ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface);
+    return ThreadMgr_AddRef((ITfThreadMgr *)This);
+}
+
+static ULONG WINAPI ThreadMgrSourceSingle_Release(ITfSourceSingle *iface)
+{
+    ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface);
+    return ThreadMgr_Release((ITfThreadMgr *)This);
+}
+
+static HRESULT WINAPI ThreadMgrSourceSingle_AdviseSingleSink( ITfSourceSingle *iface,
+    TfClientId tid, REFIID riid, IUnknown *punk)
+{
+    ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface);
+    FIXME("STUB:(%p) %i %s %p\n",This, tid, debugstr_guid(riid),punk);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ThreadMgrSourceSingle_UnadviseSingleSink( ITfSourceSingle *iface,
+    TfClientId tid, REFIID riid)
+{
+    ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface);
+    FIXME("STUB:(%p) %i %s\n",This, tid, debugstr_guid(riid));
+    return E_NOTIMPL;
+}
+
+static const ITfSourceSingleVtbl ThreadMgr_SourceSingleVtbl =
+{
+    ThreadMgrSourceSingle_QueryInterface,
+    ThreadMgrSourceSingle_AddRef,
+    ThreadMgrSourceSingle_Release,
+
+    ThreadMgrSourceSingle_AdviseSingleSink,
+    ThreadMgrSourceSingle_UnadviseSingleSink,
+};
+
 HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
 {
     ThreadMgr *This;
@@ -1197,6 +1290,7 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
     This->MessagePumpVtbl= &ThreadMgr_MessagePumpVtbl;
     This->ClientIdVtbl = &ThreadMgr_ClientIdVtbl;
     This->ThreadMgrEventSinkVtbl = &ThreadMgr_ThreadMgrEventSinkVtbl;
+    This->SourceSingleVtbl = &ThreadMgr_SourceSingleVtbl;
     This->refCount = 1;
     TlsSetValue(tlsIndex,This);
 
@@ -1378,39 +1472,3 @@ void ThreadMgr_OnDocumentMgrDestruction(ITfThreadMgr *tm, ITfDocumentMgr *mgr)
     }
     FIXME("ITfDocumenMgr %p not found in this thread\n",mgr);
 }
-
-LRESULT CALLBACK ThreadFocusHookProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
-    ThreadMgr *This;
-
-    This = TlsGetValue(tlsIndex);
-    if (!This)
-    {
-        ERR("Hook proc but no ThreadMgr for this thread. Serious Error\n");
-        return 0;
-    }
-    if (!This->focusHook)
-    {
-        ERR("Hook proc but no ThreadMgr focus Hook. Serious Error\n");
-        return 0;
-    }
-
-    if (nCode == HCBT_SETFOCUS) /* focus change within our thread */
-    {
-        struct list *cursor;
-
-        LIST_FOR_EACH(cursor, &This->AssociatedFocusWindows)
-        {
-            AssociatedWindow *wnd = LIST_ENTRY(cursor,AssociatedWindow,entry);
-            if (wnd->hwnd == (HWND)wParam)
-            {
-                TRACE("Triggering Associated window focus\n");
-                if (This->focus != wnd->docmgr)
-                    ThreadMgr_SetFocus((ITfThreadMgr*)This, wnd->docmgr);
-                break;
-            }
-        }
-    }
-
-    return CallNextHookEx(This->focusHook, nCode, wParam, lParam);
-}
diff --git a/reactos/include/psdk/ctfutb.idl b/reactos/include/psdk/ctfutb.idl
new file mode 100644 (file)
index 0000000..6d80b38
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2010 Justin Chevrier
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef DO_NO_IMPORTS
+import "oaidl.idl";
+#endif
+
+interface ITfLangBarEventSink;
+interface ITfLangBarItemMgr;
+interface ITfInputProcessorProfiles;
+
+[
+    object,
+    uuid(87955690-e627-11d2-8ddb-00105a2799b5),
+    pointer_default(unique)
+]
+interface ITfLangBarMgr: IUnknown
+{
+    HRESULT AdviseEventSink(
+        [in] ITfLangBarEventSink *pSink,
+        [in] HWND hwnd,
+        [in] DWORD dwflags,
+        [in] DWORD *pdwCookie);
+
+    HRESULT UnAdviseEventSink(
+        [in] DWORD dwCookie);
+
+    HRESULT GetThreadMarshalInterface(
+        [in] DWORD dwThreadId,
+        [in] DWORD dwType,
+        [in] REFIID riid,
+        [out] IUnknown **ppunk);
+
+    HRESULT GetThreadLangBarItemMgr(
+        [in] DWORD dwThreadId,
+        [out] ITfLangBarItemMgr **pplbie,
+        [out] DWORD *pdwThreadid);
+
+    HRESULT GetInputProcessorProfiles(
+        [in] DWORD dwThreadId,
+        [out] ITfInputProcessorProfiles **ppaip,
+        [out] DWORD *pdwThreadid);
+
+    HRESULT RestoreLastFocus(
+        [out] DWORD *dwThreadId,
+        [in] BOOL fPrev);
+
+    HRESULT SetModalInput(
+        [in] ITfLangBarEventSink *pSink,
+        [in] DWORD dwThreadId,
+        [in] DWORD dwFlags);
+
+    HRESULT ShowFloating(
+        [in] DWORD dwFlags);
+
+    HRESULT GetShowFloatingStatus(
+        [out] DWORD *pdwFlags);
+};
index 5d8cb2a..e98df4d 100644 (file)
@@ -20,7 +20,7 @@
 import "oaidl.idl";
 import "comcat.idl";
 import "textstor.idl";
-/* import "ctfutb.idl"; */
+import "ctfutb.idl";
 #endif
 cpp_quote("#include <winuser.h>")
 
@@ -37,6 +37,7 @@ cpp_quote("#define TF_E_NOLOCK          MAKE_HRESULT(SEVERITY_ERROR, FACILITY_IT
 cpp_quote("HRESULT WINAPI TF_CreateThreadMgr(ITfThreadMgr **pptim);")
 cpp_quote("HRESULT WINAPI TF_GetThreadMgr(ITfThreadMgr **pptim);")
 cpp_quote("HRESULT WINAPI TF_CreateInputProcessorProfiles(ITfInputProcessorProfiles **ppipr);")
+cpp_quote("HRESULT WINAPI TF_CreateLangBarMgr(ITfLangBarMgr **pppbm);")
 
 cpp_quote("EXTERN_C const GUID GUID_PROP_TEXTOWNER;")
 cpp_quote("DEFINE_GUID(GUID_PROP_ATTRIBUTE,0x34b45670,0x7526,0x11d2,0xa1,0x47,0x00,0x10,0x5a,0x27,0x99,0xb5);")
@@ -46,6 +47,7 @@ cpp_quote("EXTERN_C const GUID GUID_PROP_COMPOSING;")
 
 cpp_quote("EXTERN_C const CLSID CLSID_TF_ThreadMgr;")
 cpp_quote("EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles;")
+cpp_quote("EXTERN_C const CLSID CLSID_TF_LangBarMgr;")
 cpp_quote("EXTERN_C const CLSID CLSID_TF_CategoryMgr;")
 cpp_quote("DEFINE_GUID(CLSID_TF_DisplayAttributeMgr,0x3ce74de4,0x53d3,0x4d74,0x8b,0x83,0x43,0x1b,0x38,0x28,0xba,0x53);")
 
@@ -1349,3 +1351,16 @@ interface ITfSourceSingle : IUnknown
         [in] TfClientId tid,
         [in] REFIID riid);
 };
+
+[
+  object,
+  local,
+  uuid(c0f1db0c-3a20-405c-a303-96b6010a885f),
+  pointer_default(unique)
+]
+interface ITfThreadFocusSink : IUnknown
+{
+    HRESULT OnSetThreadFocus();
+
+    HRESULT OnKillThreadFocus();
+};
index 6d5cc78..02256eb 100644 (file)
@@ -10,6 +10,7 @@
        <file>bits.idl</file>
        <file>commoncontrols.idl</file>
        <file>control.idl</file>
+       <file>ctfutb.idl</file>
        <file>ctxtcall.idl</file>
        <file>dimm.idl</file>
        <file>dispex.idl</file>
index bd43f62..cfa5b6e 100644 (file)
@@ -155,6 +155,7 @@ DEFINE_GUID(CLSID_InProcFreeMarshaler,    0x0000033a,0x0000,0x0000,0xc0,0x00,0x0
 DEFINE_GUID(CLSID_TF_ThreadMgr,           0x529a9e6b,0x6587,0x4f23,0xab,0x9e,0x9c,0x7d,0x68,0x3e,0x3c,0x50);
 DEFINE_GUID(CLSID_TF_InputProcessorProfiles, 0x33c53a50,0xf456,0x4884,0xb0,0x49,0x85,0xfd,0x64,0x3e,0xcf,0xed);
 DEFINE_GUID(CLSID_TF_CategoryMgr,         0xA4B544A1,0x438D,0x4B41,0x93,0x25,0x86,0x95,0x23,0xE2,0xD6,0xC7);
+DEFINE_GUID(CLSID_TF_LangBarMgr,          0xebb08c45,0x6c4a,0x4fdc,0xae,0x53,0x4e,0xb8,0xc4,0xc7,0xdb,0x8e);
 DEFINE_GUID(CLSID_TaskbarList,            0x56fdf344,0xfd6d,0x11d0,0x95,0x8a,0x00,0x60,0x97,0xc9,0xa0,0x90);
 DEFINE_GUID(GUID_TFCAT_TIP_KEYBOARD,     0x34745c63,0xb2f0,0x4784,0x8b,0x67,0x5e,0x12,0xc8,0x70,0x1a,0x31);
 DEFINE_GUID(GUID_TFCAT_TIP_SPEECH,       0xB5A73CD1,0x8355,0x426B,0xA1,0x61,0x25,0x98,0x08,0xF2,0x6B,0x14);