Commit: 0b7ec42ccf0849b0a8461aa6805df2664f3bf1ec Author: Tamito Kajiyama Date: Mon Sep 8 01:49:38 2014 +0900 Branches: testbuild https://developer.blender.org/rB0b7ec42ccf0849b0a8461aa6805df2664f3bf1ec
Revert "Applied D765: Blender input method editor support for windows (diff #6)." This reverts commit a78c75cab2166f8c93356ca6aa24378c6fdb5901. =================================================================== M intern/ghost/CMakeLists.txt M intern/ghost/GHOST_C-api.h M intern/ghost/GHOST_IWindow.h M intern/ghost/GHOST_Types.h M intern/ghost/intern/GHOST_C-api.cpp D intern/ghost/intern/GHOST_ImeWin32.cpp D intern/ghost/intern/GHOST_ImeWin32.h M intern/ghost/intern/GHOST_SystemWin32.cpp M intern/ghost/intern/GHOST_SystemWin32.h M intern/ghost/intern/GHOST_Window.h M intern/ghost/intern/GHOST_WindowWin32.cpp M intern/ghost/intern/GHOST_WindowWin32.h M source/blender/editors/interface/interface.c M source/blender/editors/interface/interface_handlers.c M source/blender/editors/interface/interface_intern.h M source/blender/editors/interface/interface_widgets.c M source/blender/editors/screen/screen_edit.c M source/blender/editors/space_console/console_draw.c M source/blender/editors/space_console/console_ops.c M source/blender/editors/space_console/space_console.c M source/blender/editors/space_info/textview.c M source/blender/editors/space_info/textview.h M source/blender/editors/space_text/space_text.c M source/blender/editors/space_text/text_draw.c M source/blender/editors/space_text/text_format.h M source/blender/editors/space_text/text_ops.c M source/blender/makesdna/DNA_space_types.h M source/blender/windowmanager/WM_types.h M source/blender/windowmanager/intern/wm_event_system.c M source/blender/windowmanager/intern/wm_window.c M source/blender/windowmanager/wm_event_types.h M source/blender/windowmanager/wm_window.h =================================================================== diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index 2b0d664..cfa2f54 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -28,7 +28,6 @@ set(INC ../string ../../source/blender/imbuf ../../source/blender/makesdna - ../../source/blender/blenlib ) set(INC_SYS @@ -278,7 +277,6 @@ elseif(WIN32) intern/GHOST_SystemPathsWin32.cpp intern/GHOST_WindowWin32.cpp intern/GHOST_DropTargetWin32.cpp - intern/GHOST_ImeWin32.cpp intern/GHOST_DisplayManagerWin32.h intern/GHOST_DropTargetWin32.h @@ -286,7 +284,6 @@ elseif(WIN32) intern/GHOST_SystemPathsWin32.h intern/GHOST_WindowWin32.h intern/GHOST_TaskbarWin32.h - intern/GHOST_ImeWin32.h ) if(WITH_INPUT_NDOF) diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h index f78a853..c877a3b 100644 --- a/intern/ghost/GHOST_C-api.h +++ b/intern/ghost/GHOST_C-api.h @@ -889,38 +889,6 @@ extern int GHOST_UseNativePixels(void); */ extern float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle); -/** - * Enable the IME attached to the given window, i.e. allows user-input - * events to be dispatched to the IME. - * \param window_handle - * Represents the window handle of the caller. - * \param x requested x-coordinate of the rectangle - * \param y requested y-coordinate of the rectangle - * \param w requested width of the rectangle - * \param h requested height of the rectangle - * \param complete - * Represents whether or not to complete the ongoing composition. - * + true - * After finishing the ongoing composition and close its IME windows, - * start another composition and display its IME windows to the given - * position. - * + false - * Just move the IME windows of the ongoing composition to the given - * position without finishing it. - */ -extern void GHOST_enableIME(GHOST_WindowHandle windowhandle, - GHOST_TInt32 x, - GHOST_TInt32 y, - GHOST_TInt32 w, - GHOST_TInt32 h, - int complete); -/** - * Disable the IME attached to the given window, i.e. prohibits any user-input - * events from being dispatched to the IME. - * \param window_handle - * Represents the window handle of the caller. - */ -extern void GHOST_disableIME(GHOST_WindowHandle windowhandle); #ifdef __cplusplus } diff --git a/intern/ghost/GHOST_IWindow.h b/intern/ghost/GHOST_IWindow.h index 51265e5..c6befff 100644 --- a/intern/ghost/GHOST_IWindow.h +++ b/intern/ghost/GHOST_IWindow.h @@ -323,34 +323,6 @@ public: virtual float getNativePixelSize(void) = 0; - /** - * Enable the IME attached to the given window, i.e. allows user-input - * events to be dispatched to the IME. - * \param x requested x-coordinate of the rectangle - * \param y requested y-coordinate of the rectangle - * \param w requested width of the rectangle - * \param h requested height of the rectangle - * \param complete - * Represents whether or not to complete the ongoing composition. - * + true - * After finishing the ongoing composition and close its IME windows, - * start another composition and display its IME windows to the given - * position. - * + false - * Just move the IME windows of the ongoing composition to the given - * position without finishing it. - */ - virtual void enableIME(GHOST_TInt32 x, - GHOST_TInt32 y, - GHOST_TInt32 w, - GHOST_TInt32 h, - int completed) = 0; - - /** - * Disable the IME attached to the given window, i.e. prohibits any user-input - * events from being dispatched to the IME. - */ - virtual void disableIME() = 0; #ifdef WITH_CXX_GUARDEDALLOC MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_IWindow") diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index 6a7d6f0..7333ba0 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -190,10 +190,6 @@ typedef enum { GHOST_kEventTimer, - GHOST_kEventImeCompositionStart, - GHOST_kEventImeComposition, - GHOST_kEventImeCompositionEnd, - GHOST_kNumEventTypes } GHOST_TEventType; @@ -440,13 +436,6 @@ typedef struct { GHOST_TEventDataPtr data; } GHOST_TEventDragnDropData; -/** same with wmImeData */ -typedef struct { - GHOST_TUserDataPtr result_len, composite_len; /** size_t */ - GHOST_TUserDataPtr result, composite; /** char * utf8 encoding */ - GHOST_TUserDataPtr tmp; /* custom temporal data */ -} GHOST_TEventImeData; - typedef struct { int count; GHOST_TUns8 **strings; diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp index eba9fdc..eaa59f0 100644 --- a/intern/ghost/intern/GHOST_C-api.cpp +++ b/intern/ghost/intern/GHOST_C-api.cpp @@ -914,19 +914,3 @@ float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle) return 1.0f; } -void GHOST_enableIME(GHOST_WindowHandle windowhandle, - GHOST_TInt32 x, - GHOST_TInt32 y, - GHOST_TInt32 w, - GHOST_TInt32 h, - int complete) -{ - GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; - window->enableIME(x, y, w, h, complete); -} - -void GHOST_disableIME(GHOST_WindowHandle windowhandle) -{ - GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; - window->disableIME(); -} \ No newline at end of file diff --git a/intern/ghost/intern/GHOST_ImeWin32.cpp b/intern/ghost/intern/GHOST_ImeWin32.cpp deleted file mode 100644 index d4a0876..0000000 --- a/intern/ghost/intern/GHOST_ImeWin32.cpp +++ /dev/null @@ -1,444 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// -// ***** BEGIN BSD LICENSE BLOCK ***** -// -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// ***** END BSD LICENSE BLOCK ***** -// - -/** \file ghost/intern/GHOST_ImeWin32.cpp -* \ingroup GHOST -* \date Aug 27, 2014 -*/ - -#include "GHOST_C-api.h" -#include "GHOST_ImeWin32.h" -#include "GHOST_WindowWin32.h" -#include "BLI_string_utf8.h" - -IME_Rect::IME_Rect(int _x, int _y, int _width, int _height) - : x(_x), y(_y), width(_width), height(_height) { -} - -// "imm32.lib" is required by IMM32 APIs used in this file. -// NOTE(hbono): To comply with a comment from Darin, I have added -// this #pragma directive instead of adding "imm32.lib" to a project file. -#pragma comment(lib, "imm32.lib") - -/////////////////////////////////////////////////////////////////////////////// -// GHOST_ImeWin32 - -GHOST_ImeWin32::GHOST_ImeWin32() - : ime_status_(false), - input_language_id_(LANG_USER_DEFAULT), - is_composing_(false), - system_caret_(false), - caret_rect_(-1, -1, 0, 0), - is_first(true), - is_enable(true) -{ -} - -GHOST_ImeWin32::~GHOST_ImeWin32() { -} - -bool GHOST_ImeWin32::SetInputLanguage() { - // Retrieve the current keyboard layout from Windows and determine whether - // or not the current input context has IMEs. - // Also save its input language for language-specific operations required - // while composing a text. - HKL keyboard_layout = ::GetKeyboardLayout(0); - input_language_id_ = reinterpret_cast<LANGID>(keyboard_layout); - ime_status_ = (::ImmIsIME(keyboard_layout) == TRUE) ? true : false; - return ime_status_; -} - - -void GHOST_ImeWin32::CreateImeWindow(HWND window_handle) { - // When a user disables TSF (Text Service Framework) and CUAS (Cicero - // Unaware Application Support), Chinese IMEs somehow ignore function calls - // to ::ImmSetCandidateWindow(), i.e. they do not move their candidate - // window to the position given as its parameters, and use the position - // of the current system caret instead, i.e. it uses ::GetCaretPos() to - // retrieve the position of their IME candidate window. - // Therefore, we create a temporary system caret for Chinese IMEs and use - // it during this input context. - // Since some third-party Japanese IME also uses ::GetCaretPos() to determine - // their window position, we also create a caret for Japanese IMEs. - if (PRIMARYLANGID(input_language_id_) == LANG_CHINESE || - PRIMARYLANGID(input_language_id_) == LANG_JAPANESE) { - if (!system_caret_) { - if (::CreateCaret(window_handle, NULL, 1, 1)) { - system_caret_ = true; - } - } - } - // Restore the positions of the IME windows. - UpdateImeWindow(window_handle); -} - -void GHOST_ImeWin32::SetImeWindowStyle(HWND window_handle, UINT message, - WPARAM wparam, LPARAM lparam, - BOOL* handled) { - // To prevent the IMM (Input Method Manager) from displaying the IME - // composition window, Update the styles of the IME windows and EXPLI @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs