Module: wine Branch: master Commit: 4ccbcb02b27a72188c7bef50c0e2d078171b4827 URL: http://source.winehq.org/git/wine.git/?a=commit;h=4ccbcb02b27a72188c7bef50c0...
Author: Kusanagi Kouichi slash@ac.auone-net.jp Date: Tue Feb 16 18:51:43 2010 +0900
winex11.drv: Handle result string directly.
---
dlls/winex11.drv/ime.c | 17 +++++++++++++++-- dlls/winex11.drv/x11drv.h | 2 +- dlls/winex11.drv/xim.c | 4 +--- 3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c index cfb0110..affa435 100644 --- a/dlls/winex11.drv/ime.c +++ b/dlls/winex11.drv/ime.c @@ -1049,9 +1049,22 @@ BOOL IME_SetCompositionString(DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, lpRead, dwReadLen); }
-BOOL IME_NotifyIME(DWORD dwAction, DWORD dwIndex, DWORD dwValue) +void IME_SetResultString(LPWSTR lpResult, DWORD dwResultLen) { - return NotifyIME(FROM_X11, dwAction, dwIndex, dwValue); + LPINPUTCONTEXT lpIMC; + HIMCC newCompStr; + + lpIMC = LockRealIMC(FROM_X11); + if (lpIMC == NULL) + return; + + newCompStr = updateResultStr(lpIMC->hCompStr, lpResult, dwResultLen); + ImmDestroyIMCC(lpIMC->hCompStr); + lpIMC->hCompStr = newCompStr; + + GenerateIMEMessage(FROM_X11, WM_IME_COMPOSITION, 0, GCS_RESULTSTR); + + UnlockRealIMC(FROM_X11); }
/***** diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 03b3750..1173d31 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -307,7 +307,7 @@ extern void IME_UpdateAssociation(HWND focus); extern BOOL IME_SetCompositionString(DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen); -extern BOOL IME_NotifyIME(DWORD dwAction, DWORD dwIndex, DWORD dwValue); +extern void IME_SetResultString(LPWSTR lpResult, DWORD dwResultlen);
extern void X11DRV_XDND_EnterEvent( HWND hWnd, XClientMessageEvent *event ); extern void X11DRV_XDND_PositionEvent( HWND hWnd, XClientMessageEvent *event ); diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index 38b0a2c..0e32513 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -116,9 +116,7 @@ void X11DRV_XIMLookupChars( const char *str, DWORD count ) if ((focus = GetFocus())) IME_UpdateAssociation(focus);
- IME_SetCompositionString(SCS_SETSTR, wcOutput, - sizeof (WCHAR) * dwOutput, NULL, 0); - IME_NotifyIME(NI_COMPOSITIONSTR, CPS_COMPLETE, 0); + IME_SetResultString(wcOutput, dwOutput); HeapFree(GetProcessHeap(), 0, wcOutput); }