Aric Stewart : imm32: Implement ImmGetRegisterWordStyle using loaded IME.

Alexandre Julliard julliard at winehq.org
Wed Apr 9 14:31:32 CDT 2008


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Wed Apr  9 09:42:00 2008 -0500

imm32: Implement ImmGetRegisterWordStyle using loaded IME.

---

 dlls/imm32/imm.c |   46 ++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index 7f17b6f..831f3d2 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -1294,9 +1294,26 @@ DWORD WINAPI ImmGetProperty(HKL hKL, DWORD fdwIndex)
 UINT WINAPI ImmGetRegisterWordStyleA(
   HKL hKL, UINT nItem, LPSTYLEBUFA lpStyleBuf)
 {
-  FIXME("(%p, %d, %p): stub\n", hKL, nItem, lpStyleBuf);
-  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-  return 0;
+    ImmHkl *immHkl = IMM_GetImmHkl(hKL);
+    TRACE("(%p, %d, %p):\n", hKL, nItem, lpStyleBuf);
+    if (immHkl->hIME && immHkl->pImeGetRegisterWordStyle)
+    {
+        if (!is_kbd_ime_unicode(immHkl))
+            return immHkl->pImeGetRegisterWordStyle(nItem,(LPSTYLEBUFW)lpStyleBuf);
+        else
+        {
+            STYLEBUFW sbw;
+            UINT rc;
+
+            rc = immHkl->pImeGetRegisterWordStyle(nItem,&sbw);
+            WideCharToMultiByte(CP_ACP, 0, sbw.szDescription, -1,
+                lpStyleBuf->szDescription, 32, NULL, NULL);
+            lpStyleBuf->dwStyle = sbw.dwStyle;
+            return rc;
+        }
+    }
+    else
+        return 0;
 }
 
 /***********************************************************************
@@ -1305,9 +1322,26 @@ UINT WINAPI ImmGetRegisterWordStyleA(
 UINT WINAPI ImmGetRegisterWordStyleW(
   HKL hKL, UINT nItem, LPSTYLEBUFW lpStyleBuf)
 {
-  FIXME("(%p, %d, %p): stub\n", hKL, nItem, lpStyleBuf);
-  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-  return 0;
+    ImmHkl *immHkl = IMM_GetImmHkl(hKL);
+    TRACE("(%p, %d, %p):\n", hKL, nItem, lpStyleBuf);
+    if (immHkl->hIME && immHkl->pImeGetRegisterWordStyle)
+    {
+        if (is_kbd_ime_unicode(immHkl))
+            return immHkl->pImeGetRegisterWordStyle(nItem,lpStyleBuf);
+        else
+        {
+            STYLEBUFA sba;
+            UINT rc;
+
+            rc = immHkl->pImeGetRegisterWordStyle(nItem,(LPSTYLEBUFW)&sba);
+            MultiByteToWideChar(CP_ACP, 0, sba.szDescription, -1,
+                lpStyleBuf->szDescription, 32);
+            lpStyleBuf->dwStyle = sba.dwStyle;
+            return rc;
+        }
+    }
+    else
+        return 0;
 }
 
 /***********************************************************************




More information about the wine-cvs mailing list