[Bf-blender-cvs] [07b702f8284] master: Win32 IME: Rename SetInputLanguage()

Harley Acheson noreply at git.blender.org
Wed Aug 4 23:31:44 CEST 2021


Commit: 07b702f82846322df4b0b6065db90d7e3ebf3eb1
Author: Harley Acheson
Date:   Wed Aug 4 14:30:16 2021 -0700
Branches: master
https://developer.blender.org/rB07b702f82846322df4b0b6065db90d7e3ebf3eb1

Win32 IME: Rename SetInputLanguage()

GHOST_ImeWin32::SetInputLanguage() has a confusing name because it does
not set the input language. It actually retrieves the current input
locale from the OS and caches the value of the current input language
ID. Therefore this patch renames it to "UpdateInputLanguage"

Differential Revision: https://developer.blender.org/D12134

Reviewed by Ray Molenkamp

===================================================================

M	intern/ghost/intern/GHOST_ImeWin32.cpp
M	intern/ghost/intern/GHOST_ImeWin32.h
M	intern/ghost/intern/GHOST_SystemWin32.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_ImeWin32.cpp b/intern/ghost/intern/GHOST_ImeWin32.cpp
index f6baa601db9..343f4d68078 100644
--- a/intern/ghost/intern/GHOST_ImeWin32.cpp
+++ b/intern/ghost/intern/GHOST_ImeWin32.cpp
@@ -46,13 +46,13 @@ GHOST_ImeWin32::~GHOST_ImeWin32()
 {
 }
 
-void GHOST_ImeWin32::SetInputLanguage()
+void GHOST_ImeWin32::UpdateInputLanguage()
 {
   /**
-   * Retrieve the current input language.
+   * Store the current input language.
    */
-  HKL keyboard_layout = ::GetKeyboardLayout(0);
-  input_language_id_ = LOWORD(keyboard_layout);
+  HKL input_locale = ::GetKeyboardLayout(0);
+  input_language_id_ = LOWORD(input_locale);
 }
 
 WORD GHOST_ImeWin32::GetInputLanguage()
diff --git a/intern/ghost/intern/GHOST_ImeWin32.h b/intern/ghost/intern/GHOST_ImeWin32.h
index 7ccb0cdfd06..d430a7d745d 100644
--- a/intern/ghost/intern/GHOST_ImeWin32.h
+++ b/intern/ghost/intern/GHOST_ImeWin32.h
@@ -88,7 +88,7 @@ class GHOST_EventIME : public GHOST_Event {
  *      An application CAN call ::DefWindowProc().
  * 2.5. WM_INPUTLANGCHANGE (0x0051)
  *      Call the functions listed below:
- *      - GHOST_ImeWin32::SetInputLanguage().
+ *      - GHOST_ImeWin32::UpdateInputLanguage().
  *      An application CAN call ::DefWindowProc().
  */
 
@@ -149,7 +149,7 @@ class GHOST_ImeWin32 {
   /**
    * Retrieves the input language from Windows and update it.
    */
-  void SetInputLanguage();
+  void UpdateInputLanguage();
 
   /* Returns the current input language id. */
   WORD GetInputLanguage();
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 60fd175dbf7..347067eae50 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -1424,7 +1424,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
         case WM_INPUTLANGCHANGE: {
           system->handleKeyboardChange();
 #ifdef WITH_INPUT_IME
-          window->getImeInput()->SetInputLanguage();
+          window->getImeInput()->UpdateInputLanguage();
           window->getImeInput()->UpdateConversionStatus(hwnd);
 #endif
           break;
@@ -1471,7 +1471,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
         }
         case WM_IME_SETCONTEXT: {
           GHOST_ImeWin32 *ime = window->getImeInput();
-          ime->SetInputLanguage();
+          ime->UpdateInputLanguage();
           ime->CreateImeWindow(hwnd);
           ime->CleanupComposition(hwnd);
           ime->CheckFirst(hwnd);



More information about the Bf-blender-cvs mailing list