Aric Stewart : msctf: Implement ITfInputProcessorProfiles:: ActivateLanguageProfile.

Alexandre Julliard julliard at winehq.org
Fri May 8 08:06:28 CDT 2009


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Thu May  7 14:27:41 2009 -0500

msctf: Implement ITfInputProcessorProfiles::ActivateLanguageProfile.

---

 dlls/msctf/inputprocessor.c       |   34 ++++++++++++++++++++++++++++++----
 dlls/msctf/tests/inputprocessor.c |    2 +-
 2 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/dlls/msctf/inputprocessor.c b/dlls/msctf/inputprocessor.c
index 7df5575..c32fcb3 100644
--- a/dlls/msctf/inputprocessor.c
+++ b/dlls/msctf/inputprocessor.c
@@ -288,9 +288,36 @@ static HRESULT WINAPI InputProcessorProfiles_ActivateLanguageProfile(
         ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
         REFGUID guidProfiles)
 {
+    HRESULT hr;
+    BOOL enabled;
+    TF_LANGUAGEPROFILE LanguageProfile;
     InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
-    FIXME("STUB:(%p)\n",This);
-    return E_NOTIMPL;
+
+    TRACE("(%p) %s %x %s\n",This,debugstr_guid(rclsid),langid,debugstr_guid(guidProfiles));
+
+    if (langid != This->currentLanguage) return E_INVALIDARG;
+
+    if (get_active_textservice(rclsid,NULL))
+    {
+        TRACE("Already Active\n");
+        return E_FAIL;
+    }
+
+    hr = ITfInputProcessorProfiles_IsEnabledLanguageProfile(iface, rclsid,
+            langid, guidProfiles, &enabled);
+    if (FAILED(hr) || !enabled)
+    {
+        TRACE("Not Enabled\n");
+        return E_FAIL;
+    }
+
+    LanguageProfile.clsid = *rclsid;
+    LanguageProfile.langid = langid;
+    LanguageProfile.guidProfile = *guidProfiles;
+
+    hr = add_active_textservice(&LanguageProfile);
+
+    return hr;
 }
 
 static HRESULT WINAPI InputProcessorProfiles_GetActiveLanguageProfile(
@@ -756,8 +783,7 @@ static INT next_LanguageProfile(EnumTfLanguageProfiles *This, CLSID clsid, TF_LA
 
         tflp->clsid = clsid;
         tflp->langid = This->langid;
-        /* FIXME */
-        tflp->fActive = FALSE;
+        tflp->fActive = get_active_textservice(&clsid, NULL);
         tflp->guidProfile = profile;
         if (ITfCategoryMgr_FindClosestCategory(This->catmgr, &clsid,
                 &tflp->catid, tipcats, 3) != S_OK)
diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c
index 2477ad8..39f58e6 100644
--- a/dlls/msctf/tests/inputprocessor.c
+++ b/dlls/msctf/tests/inputprocessor.c
@@ -444,7 +444,7 @@ static void test_Activate(void)
     HRESULT hr;
 
     hr = ITfInputProcessorProfiles_ActivateLanguageProfile(g_ipp,&CLSID_FakeService,gLangid,&CLSID_FakeService);
-    todo_wine ok(SUCCEEDED(hr),"Failed to Activate text service\n");
+    ok(SUCCEEDED(hr),"Failed to Activate text service\n");
 }
 
 static inline int check_context_refcount(ITfContext *iface)




More information about the wine-cvs mailing list