[Bf-blender-cvs] [a677da8] input_method_editor: Finish support for CMake flag WITH_INPUT_IME
Severin
noreply at git.blender.org
Mon Nov 24 00:45:54 CET 2014
Commit: a677da8638c95422db21bf50cf71de092e3c3b59
Author: Severin
Date: Tue Nov 18 20:05:05 2014 +0100
Branches: input_method_editor
https://developer.blender.org/rBa677da8638c95422db21bf50cf71de092e3c3b59
Finish support for CMake flag WITH_INPUT_IME
Note: implementation not finished, needs a bit cleanup
===================================================================
M intern/ghost/intern/GHOST_ImeWin32.cpp
M source/blender/editors/interface/interface_widgets.c
M source/blender/editors/space_text/space_text.c
===================================================================
diff --git a/intern/ghost/intern/GHOST_ImeWin32.cpp b/intern/ghost/intern/GHOST_ImeWin32.cpp
index 3569af5..21e842a 100644
--- a/intern/ghost/intern/GHOST_ImeWin32.cpp
+++ b/intern/ghost/intern/GHOST_ImeWin32.cpp
@@ -208,10 +208,10 @@ void GHOST_ImeWin32::CleanupComposition(HWND window_handle)
void GHOST_ImeWin32::CheckFirst(HWND window_handle)
{
- if (is_first) {
- this->DisableIME(window_handle);
- is_first = false;
- }
+ if (is_first) {
+ this->EndIME(window_handle);
+ is_first = false;
+ }
}
@@ -428,7 +428,7 @@ void GHOST_ImeWin32::EndIME(HWND window_handle)
}
-void GHOST_ImeWin32::EnableIME(HWND window_handle, const GHOST_Rect& caret_rect, bool complete)
+void GHOST_ImeWin32::BeginIME(HWND window_handle, const GHOST_Rect &caret_rect, bool complete)
{
if (is_enable && complete) return;
is_enable = true;
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index e733366..457907b 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1273,6 +1273,9 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
* we rely on string being NULL terminated. */
drawstr_left_len = INT_MAX;
+#ifdef WITH_INPUT_IME
+ ime = ui_but_get_ime_data(but);
+
if (ime && ime->composite_len) {
/* insert composite string into cursor pos */
char *str;
@@ -1287,6 +1290,9 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
drawstr = drawstr_edit = str;
}
else {
+#else
+ if (1) {
+#endif
drawstr = but->editstr;
}
}
@@ -1320,6 +1326,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
}
}
+
/* text cursor */
vpos = but->pos;
#ifdef WITH_INPUT_IME
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 3131a12..daf5b3d 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -430,6 +430,12 @@ static void text_main_area_draw(const bContext *C, ARegion *ar)
{
/* draw entirely, view changes should be handled here */
SpaceText *st = CTX_wm_space_text(C);
+#ifdef WITH_INPUT_IME
+ wmWindow *win = CTX_wm_window(C);
+ wmImeData *ime = win->ime_data;
+ int ime_active = ime && ime->composite_len &&
+ BLI_rcti_isect_pt_v(&ar->winrct, &win->eventstate->x);
+#endif
//View2D *v2d = &ar->v2d;
/* clear and setup matrix */
More information about the Bf-blender-cvs
mailing list