From 83e2f8c993dc8068eb1145e9b8f4756a54f96144 Mon Sep 17 00:00:00 2001 From: Yuki Hashimoto Date: Mon, 5 Jul 2021 13:11:17 +0200 Subject: macOS: support Japanese input for text buttons Blender did not support to input East Asian characters (Chinese, Japanese, Korean) on macOS. This patch adds support for Japanese input, by implementing the appropriate processing for the NSTextInputClient protocol. Technical notes: * The conversion candidate window is drawn by the input method program calling `firstRectForCharacterRange`. * The string before confirmation (called `composite` in blender) is handled in the `setMarkedText` method called by the input method program. * The string after confirmation (called `result` in the blender) is processed in the `insertText` method called by the input method program. Ref T51283 Differential Revision: https://developer.blender.org/D11695 --- source/blender/makesdna/DNA_windowmanager_types.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/makesdna/DNA_windowmanager_types.h') diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index cb5c62e4507..94e89944f08 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -217,8 +217,8 @@ enum { #define WM_KEYCONFIG_STR_DEFAULT "Blender" -/* IME is win32 only! */ -#if !defined(WIN32) && !defined(DNA_DEPRECATED) +/* IME is win32 and apple only! */ +#if !(defined(WIN32) || defined(__APPLE__)) && !defined(DNA_DEPRECATED) # ifdef __GNUC__ # define ime_data ime_data __attribute__((deprecated)) # endif @@ -302,7 +302,7 @@ typedef struct wmWindow { struct wmGesture *tweak; /* Input Method Editor data - complex character input (especially for Asian character input) - * Currently WIN32, runtime-only data. */ + * Currently WIN32 and APPLE, runtime-only data. */ struct wmIMEData *ime_data; /** All events #wmEvent (ghost level events were handled). */ -- cgit v1.2.3