]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.277 v7.3.277
authorBram Moolenaar <Bram@vim.org>
Wed, 10 Aug 2011 15:08:03 +0000 (17:08 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 10 Aug 2011 15:08:03 +0000 (17:08 +0200)
Problem:    MS-Windows: some characters do not show in dialogs.
Solution:   Use the wide methods when available. (Yanwei Jia)

src/gui_w32.c
src/gui_w48.c
src/os_mswin.c
src/os_win32.c
src/os_win32.h
src/version.c

index 0966afe4012b203daec6d5d62cae048e337d0a1e..4a34cb4f2dd36968023a9aa773033a7325457bd9 100644 (file)
@@ -1270,6 +1270,25 @@ gui_mch_prepare(int *argc, char **argv)
        pGetMonitorInfo = (TGetMonitorInfo)GetProcAddress(user32_lib,
                                                          "GetMonitorInfoA");
     }
+
+#ifdef FEAT_MBYTE
+    /* If the OS is Windows NT, use wide functions;
+     * this enables common dialogs input unicode from IME. */
+    if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
+    {
+       pDispatchMessage = DispatchMessageW;
+       pGetMessage = GetMessageW;
+       pIsDialogMessage = IsDialogMessageW;
+       pPeekMessage = PeekMessageW;
+    }
+    else
+    {
+       pDispatchMessage = DispatchMessageA;
+       pGetMessage = GetMessageA;
+       pIsDialogMessage = IsDialogMessageA;
+       pPeekMessage = PeekMessageA;
+    }
+#endif
 }
 
 /*
index 445104dae0dee662e4bbb314542f6c2fb4ac6251..4667dc7aad96ca8a7daf82fd9ce07a1ea9ef05f3 100644 (file)
@@ -390,7 +390,7 @@ _OnBlinkTimer(
     KillTimer(NULL, idEvent);
 
     /* Eat spurious WM_TIMER messages */
-    while (PeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
+    while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
        ;
 
     if (blink_state == BLINK_ON)
@@ -418,7 +418,7 @@ gui_mswin_rm_blink_timer(void)
     {
        KillTimer(NULL, blink_timer);
        /* Eat spurious WM_TIMER messages */
-       while (PeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
+       while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
            ;
        blink_timer = 0;
     }
@@ -476,7 +476,7 @@ _OnTimer(
     s_timed_out = TRUE;
 
     /* Eat spurious WM_TIMER messages */
-    while (PeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
+    while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
        ;
     if (idEvent == s_wait_timer)
        s_wait_timer = 0;
@@ -1707,7 +1707,7 @@ process_message(void)
     static char_u k10[] = {K_SPECIAL, 'k', ';', 0};
 #endif
 
-    GetMessage(&msg, NULL, 0, 0);
+    pGetMessage(&msg, NULL, 0, 0);
 
 #ifdef FEAT_OLE
     /* Look after OLE Automation commands */
@@ -1718,7 +1718,7 @@ process_message(void)
        {
            /* Message can't be ours, forward it.  Fixes problem with Ultramon
             * 3.0.4 */
-           DispatchMessage(&msg);
+           pDispatchMessage(&msg);
        }
        else
        {
@@ -1749,14 +1749,14 @@ process_message(void)
     if (msg.message == WM_USER)
     {
        MyTranslateMessage(&msg);
-       DispatchMessage(&msg);
+       pDispatchMessage(&msg);
        return;
     }
 #endif
 
 #ifdef MSWIN_FIND_REPLACE
     /* Don't process messages used by the dialog */
-    if (s_findrep_hwnd != NULL && IsDialogMessage(s_findrep_hwnd, &msg))
+    if (s_findrep_hwnd != NULL && pIsDialogMessage(s_findrep_hwnd, &msg))
     {
        HandleMouseHide(msg.message, msg.lParam);
        return;
@@ -1928,7 +1928,7 @@ process_message(void)
     if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE,
                                                          NULL, NULL) == NULL)
 #endif
-       DispatchMessage(&msg);
+       pDispatchMessage(&msg);
 }
 
 /*
@@ -1943,7 +1943,7 @@ gui_mch_update(void)
     MSG            msg;
 
     if (!s_busy_processing)
-       while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)
+       while (pPeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)
                                                  && !vim_is_input_buf_full())
            process_message();
 }
@@ -2019,7 +2019,7 @@ gui_mch_wait_for_chars(int wtime)
                KillTimer(NULL, s_wait_timer);
 
                /* Eat spurious WM_TIMER messages */
-               while (PeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
+               while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
                    ;
                s_wait_timer = 0;
            }
index 1c1348a4e79bd5b21d3bad5773eb79c8d4b38f38..49b142895bdacb71f3c688a172fe784c715bfadc 100644 (file)
@@ -1856,12 +1856,12 @@ AbortProc(HDC hdcPrn, int iCode)
 {
     MSG msg;
 
-    while (!*bUserAbort && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+    while (!*bUserAbort && pPeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
     {
-       if (!hDlgPrint || !IsDialogMessage(hDlgPrint, &msg))
+       if (!hDlgPrint || !pIsDialogMessage(hDlgPrint, &msg))
        {
            TranslateMessage(&msg);
-           DispatchMessage(&msg);
+           pDispatchMessage(&msg);
        }
     }
     return !*bUserAbort;
@@ -3132,10 +3132,10 @@ serverProcessPendingMessages(void)
 {
     MSG msg;
 
-    while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+    while (pPeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
     {
        TranslateMessage(&msg);
-       DispatchMessage(&msg);
+       pDispatchMessage(&msg);
     }
 }
 
index 88ead6fd637c194757a8f09da85eddabaafc5a83..0d8bbf7d38f0c674a2491a563d6bc4445794b1b3 100644 (file)
@@ -152,6 +152,14 @@ static PFNGCKLN    s_pfnGetConsoleKeyboardLayoutName = NULL;
 # define wcsicmp(a, b) wcscmpi((a), (b))
 #endif
 
+/* Enable common dialogs input unicode from IME if posible. */
+#ifdef FEAT_MBYTE
+LRESULT (WINAPI *pDispatchMessage)(LPMSG) = DispatchMessage;
+BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT) = GetMessage;
+BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG) = IsDialogMessage;
+BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT) = PeekMessage;
+#endif
+
 #ifndef FEAT_GUI_W32
 /* Win32 Console handles for input and output */
 static HANDLE g_hConIn  = INVALID_HANDLE_VALUE;
@@ -3284,10 +3292,10 @@ mch_system_classic(char *cmd, int options)
        {
            MSG msg;
 
-           if (PeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE))
+           if (pPeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE))
            {
                TranslateMessage(&msg);
-               DispatchMessage(&msg);
+               pDispatchMessage(&msg);
            }
            if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT)
                break;
index 41a44bf0d703db6f6a20c32b43e06ec79afe4707..5303d6ddcc31fc8d527acc4a4d5c0e9497b92fcd 100644 (file)
@@ -193,3 +193,17 @@ Trace(char *pszFormat, ...);
 #else
 # define vim_mkdir(x, y) mch_mkdir(x)
 #endif
+
+/* Enable common dialogs input unicode from IME if posible. */
+#ifdef FEAT_MBYTE
+    /* The variables are defined in os_win32.c. */
+extern LRESULT (WINAPI *pDispatchMessage)(LPMSG);
+extern BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT);
+extern BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG);
+extern BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT);
+#else
+# define pDispatchMessage DispatchMessage
+# define pGetMessage GetMessage
+# define pIsDialogMessage IsDialogMessage
+# define pPeekMessage PeekMessage
+#endif
index cdbde1248e18acc6a0408e89493a38163abbab5c..517310e2cd2a28c4d535ed9baf32479d53de58bf 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    277,
 /**/
     276,
 /**/