Module: wine Branch: master Commit: 6e7145d64e773a6cf104884a08869e36d11e36d0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6e7145d64e773a6cf104884a08...
Author: Aric Stewart aric@codeweavers.com Date: Fri Jun 26 17:03:30 2009 +0900
msctf: Implement ITfInputProcessorProfiles::GetDefaultLanguageProfile.
---
dlls/msctf/inputprocessor.c | 41 +++++++++++++++++++++++++++++++++++++++-- dlls/msctf/msctf.c | 1 + dlls/msctf/msctf_internal.h | 1 + 3 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/dlls/msctf/inputprocessor.c b/dlls/msctf/inputprocessor.c index 765c3d5..239c9f9 100644 --- a/dlls/msctf/inputprocessor.c +++ b/dlls/msctf/inputprocessor.c @@ -47,6 +47,11 @@ static const WCHAR szwEnable[] = {'E','n','a','b','l','e',0}; static const WCHAR szwTipfmt[] = {'%','s','\','%','s',0}; static const WCHAR szwFullLangfmt[] = {'%','s','\','%','s','\','%','s','\','0','x','%','0','8','x','\','%','s',0};
+static const WCHAR szwAssemblies[] = {'A','s','s','e','m','b','l','i','e','s',0}; +static const WCHAR szwDefault[] = {'D','e','f','a','u','l','t',0}; +static const WCHAR szwProfile[] = {'P','r','o','f','i','l','e',0}; +static const WCHAR szwDefaultFmt[] = {'%','s','\','%','s','\','0','x','%','0','8','x','\','%','s',0}; + typedef struct tagInputProcessorProfilesSink { struct list entry; union { @@ -312,9 +317,41 @@ static HRESULT WINAPI InputProcessorProfiles_GetDefaultLanguageProfile( ITfInputProcessorProfiles *iface, LANGID langid, REFGUID catid, CLSID *pclsid, GUID *pguidProfile) { + WCHAR fullkey[168]; + WCHAR buf[39]; + HKEY hkey; + DWORD count; + ULONG res; InputProcessorProfiles *This = (InputProcessorProfiles*)iface; - FIXME("STUB:(%p)\n",This); - return E_NOTIMPL; + + TRACE("%p) %x %s %p %p\n",This, langid, debugstr_guid(catid),pclsid,pguidProfile); + + if (!catid || !pclsid || !pguidProfile) + return E_INVALIDARG; + + StringFromGUID2(catid, buf, 39); + sprintfW(fullkey, szwDefaultFmt, szwSystemCTFKey, szwAssemblies, langid, buf); + + if (RegOpenKeyExW(HKEY_CURRENT_USER, fullkey, 0, KEY_READ | KEY_WRITE, + &hkey ) != ERROR_SUCCESS) + return S_FALSE; + + count = sizeof(buf); + res = RegQueryValueExW(hkey, szwDefault, 0, NULL, (LPBYTE)buf, &count); + if (res != ERROR_SUCCESS) + { + RegCloseKey(hkey); + return S_FALSE; + } + CLSIDFromString(buf,pclsid); + + res = RegQueryValueExW(hkey, szwProfile, 0, NULL, (LPBYTE)buf, &count); + if (res == ERROR_SUCCESS) + CLSIDFromString(buf,pguidProfile); + + RegCloseKey(hkey); + + return S_OK; }
static HRESULT WINAPI InputProcessorProfiles_SetDefaultLanguageProfile( diff --git a/dlls/msctf/msctf.c b/dlls/msctf/msctf.c index 9729ef3..b0a1c54 100644 --- a/dlls/msctf/msctf.c +++ b/dlls/msctf/msctf.c @@ -77,6 +77,7 @@ TfClientId processId = 0; ITfCompartmentMgr *globalCompartmentMgr = NULL;
const WCHAR szwSystemTIPKey[] = {'S','O','F','T','W','A','R','E','\','M','i','c','r','o','s','o','f','t','\','C','T','F','\','T','I','P',0}; +const WCHAR szwSystemCTFKey[] = {'S','O','F','T','W','A','R','E','\','M','i','c','r','o','s','o','f','t','\','C','T','F',0};
typedef HRESULT (*LPFNCONSTRUCTOR)(IUnknown *pUnkOuter, IUnknown **ppvOut);
diff --git a/dlls/msctf/msctf_internal.h b/dlls/msctf/msctf_internal.h index eff30c9..928b046 100644 --- a/dlls/msctf/msctf_internal.h +++ b/dlls/msctf/msctf_internal.h @@ -63,4 +63,5 @@ extern HRESULT get_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown** sin extern HRESULT set_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown* sink);
extern const WCHAR szwSystemTIPKey[]; +extern const WCHAR szwSystemCTFKey[]; #endif /* __WINE_MSCTF_I_H */