[Bf-blender-cvs] [151f246] input_method_editor: IME: Add Missing #ifdef WITH_INPUT_IMEs
Severin
noreply at git.blender.org
Thu Dec 4 20:33:38 CET 2014
Commit: 151f2467a4c42d787d6d26869dbe402ccb725679
Author: Severin
Date: Thu Dec 4 20:32:10 2014 +0100
Branches: input_method_editor
https://developer.blender.org/rB151f2467a4c42d787d6d26869dbe402ccb725679
IME: Add Missing #ifdef WITH_INPUT_IMEs
===================================================================
M source/blender/editors/space_console/console_draw.c
M source/blender/editors/space_console/console_ops.c
M source/blender/editors/space_info/textview.c
M source/blender/editors/space_text/text_draw.c
M source/blender/editors/space_text/text_ops.c
M source/blender/windowmanager/intern/wm_event_system.c
===================================================================
diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c
index a8ee10d..5340b70 100644
--- a/source/blender/editors/space_console/console_draw.c
+++ b/source/blender/editors/space_console/console_draw.c
@@ -181,6 +181,7 @@ static int console_textview_line_color(struct TextViewContext *tvc, wmImeData *i
pen[0] = tvc->cwidth * offc;
pen[1] = -2 - tvc->lheight * offl;
+#ifdef WITH_INPUT_IME
/* consider the effect of composition string */
if (ime_data && ime_data->composite_len) {
char *end = NULL;
@@ -196,7 +197,7 @@ static int console_textview_line_color(struct TextViewContext *tvc, wmImeData *i
if (end != NULL)
console_cursor_wrap_offset(end, tvc->console_width, &offl, &offc, NULL);
}
-
+#endif /* WITH_INPUT_IME */
console_cursor_wrap_offset(cl->line + cl->cursor, tvc->console_width, &offl, &offc, NULL);
pen[1] += tvc->lheight * offl;
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index 4f1e5e3..b2e5b4d 100644
--- a/source/blender/editors/space_console/console_ops.c
+++ b/source/blender/editors/space_console/console_ops.c
@@ -396,6 +396,7 @@ static int console_insert_exec(bContext *C, wmOperator *op)
static int console_insert_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
+#ifdef WITH_INPUT_IME
wmWindow *win = CTX_wm_window(C);
wmImeData *ime = win->ime_data;
ARegion *ar = CTX_wm_region(C);
@@ -417,6 +418,9 @@ static int console_insert_modal(bContext *C, wmOperator *op, const wmEvent *even
if (event->type == WM_IME_COMPOSITE_END)
return OPERATOR_FINISHED;
+#else
+ (void)C; (void)op; (void)event;
+#endif /* WITH_INPUT_IME */
return OPERATOR_RUNNING_MODAL;
}
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c
index 592a2dd..c6440bf 100644
--- a/source/blender/editors/space_info/textview.c
+++ b/source/blender/editors/space_info/textview.c
@@ -93,6 +93,7 @@ static void console_draw_sel(const char *str, const int sel[2], const int xy[2],
}
}
+#ifdef WITH_INPUT_IME
static void console_draw_underline(const char *str, const int sel[2], const int xy[2], const int str_len_draw,
const int cwidth, const int height, const unsigned char bg_sel[4])
{
@@ -109,6 +110,7 @@ static void console_draw_underline(const char *str, const int sel[2], const int
UI_text_draw_underline(x, y, width, height);
}
}
+#endif /* WITH_INPUT_IME */
/* warning: allocated memory for 'offsets' must be freed by caller */
static int console_wrap_offsets(const char *str, int len, int width, int *lines, int **offsets)
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 91b1a0d..8301db4 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -421,6 +421,8 @@ static int text_draw_wrapped(SpaceText *st, const char *str, int x, int y, int w
if (fmt_prev != format[a]) format_draw_color(fmt_prev = format[a]);
}
len = text_font_draw_character_utf8(st, x, y, str + ma);
+
+#ifdef WITH_INPUT_IME
/* draw underline */
if (format && format[a] == FMT_TYPE_ULINE)
UI_text_draw_underline(x, y, len, 1);
@@ -428,6 +430,7 @@ static int text_draw_wrapped(SpaceText *st, const char *str, int x, int y, int w
if (format && format[a] == FMT_TYPE_TULINE)
UI_text_draw_underline(x, y, len, 2);
x += len;
+#endif
fpos++;
}
y -= st->lheight_dpi + TXT_LINE_SPACING;
@@ -454,6 +457,7 @@ static int text_draw_wrapped(SpaceText *st, const char *str, int x, int y, int w
len = text_font_draw_character_utf8(st, x, y, str + ma);
+#ifdef WITH_INPUT_IME
/* draw underline */
if (format && format[a] == FMT_TYPE_ULINE)
UI_text_draw_underline(x, y, len, 1);
@@ -461,6 +465,7 @@ static int text_draw_wrapped(SpaceText *st, const char *str, int x, int y, int w
if (format && format[a] == FMT_TYPE_TULINE)
UI_text_draw_underline(x, y, len, 2);
x += len;
+#endif
}
flatten_string_free(&fs);
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 1531ec5..999e9e7 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -2916,6 +2916,7 @@ static int text_insert_exec(bContext *C, wmOperator *op)
static int text_insert_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
+#ifdef WITH_INPUT_IME
wmWindow *win = CTX_wm_window(C);
wmImeData *ime_data = win->ime_data;
Text *text = CTX_data_edit_text(C);
@@ -2941,6 +2942,9 @@ static int text_insert_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* only redraw, don't clean away format */
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_TEXT, text);
}
+#else
+ (void)C; (void)op; (void)event;
+#endif /* WITH_INPUT_IME */
return OPERATOR_RUNNING_MODAL;
}
@@ -2958,6 +2962,7 @@ static int text_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event)
if ((event->ctrl || event->oskey) && !event->utf8_buf[0]) {
return OPERATOR_PASS_THROUGH;
}
+#ifdef WITH_INPUT_IME
/* most IME shortcut for switch IME, fullwidth/halfwidth and so on */
if (WM_event_is_ime_switch(event))
{
@@ -2970,6 +2975,7 @@ static int text_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event)
txt_delete_selected(text);
return text_insert_modal(C, op, event);
}
+#endif /* WITH_INPUT_IME */
else {
char str[BLI_UTF8_MAX + 1];
size_t len;
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 76fe419..5eec18d 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -3373,6 +3373,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
break;
}
+#ifdef WITH_INPUT_IME
case GHOST_kEventImeCompositionStart:
{
event.val = KM_PRESS;
@@ -3397,6 +3398,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
wm_event_add(win, &event);
break;
}
+#endif /* WITH_INPUT_IME */
}
More information about the Bf-blender-cvs
mailing list