[Bf-blender-cvs] [baee499] input_method_editor_partial_support: Ensure IME is _never_ used outside win32 platform

Campbell Barton noreply at git.blender.org
Sat Dec 6 14:00:26 CET 2014


Commit: baee4990715c64485280923c8b094947041faee9
Author: Campbell Barton
Date:   Sat Dec 6 14:00:01 2014 +0100
Branches: input_method_editor_partial_support
https://developer.blender.org/rBbaee4990715c64485280923c8b094947041faee9

Ensure IME is _never_ used outside win32 platform

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

M	source/blender/blenloader/intern/readfile.c
M	source/blender/editors/interface/interface_handlers.c
M	source/blender/makesdna/DNA_windowmanager_types.h
M	source/blender/windowmanager/WM_api.h
M	source/blender/windowmanager/WM_types.h
M	source/blender/windowmanager/wm_window.h

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 237321d..0950eda 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5677,7 +5677,9 @@ static void direct_link_windowmanager(FileData *fd, wmWindowManager *wm)
 		win->eventstate = NULL;
 		win->curswin = NULL;
 		win->tweak = NULL;
+#ifdef WIN32
 		win->ime_data = NULL;
+#endif
 		
 		BLI_listbase_clear(&win->queue);
 		BLI_listbase_clear(&win->handlers);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 39f8ea1..4f0d9bb 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -2466,7 +2466,7 @@ wmIMEData *ui_but_get_ime_data(uiBut *but)
 	else
 		return NULL;
 }
-#endif /* WITH_INPUT_IME */
+#endif  /* WITH_INPUT_IME */
 
 static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
 {
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index a9cb32f..1a0562a 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -165,6 +165,13 @@ enum {
 	WM_INIT_KEYMAP = (1<<1),
 };
 
+/* IME is win32 only! */
+#ifndef WIN32
+#  ifdef __GNUC__
+#    define ime_data ime_data __attribute__ ((deprecated))
+#  endif
+#endif
+
 /* the savable part, rest of data is local in ghostwinlay */
 typedef struct wmWindow {
 	struct wmWindow *next, *prev;
@@ -212,6 +219,10 @@ typedef struct wmWindow {
 	ListBase gesture;             /* gesture stuff */
 } wmWindow;
 
+#ifdef ime_data
+#  undef ime_data
+#endif
+
 /* These two Lines with # tell makesdna this struct can be excluded. */
 /* should be something like DNA_EXCLUDE 
  * but the preprocessor first removes all comments, spaces etc */
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 68eab58..d2abfd4 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -462,7 +462,9 @@ void        WM_event_ndof_to_quat(const struct wmNDOFMotionData *ndof, float q[4
 float       WM_event_tablet_data(const struct wmEvent *event, int *pen_flip, float tilt[2]);
 bool        WM_event_is_tablet(const struct wmEvent *event);
 
+#ifdef WITH_INPUT_IME
 bool        WM_event_is_ime_switch(const struct wmEvent *event);
+#endif
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index d04ce28..d9924cf 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -570,6 +570,7 @@ typedef struct wmOperatorType {
 
 } wmOperatorType;
 
+#ifdef WITH_INPUT_IME
 /* *********** Input Method Editor (IME) *********** */
 
 /* similar to GHOST_TEventImeData */
@@ -585,6 +586,7 @@ typedef struct wmIMEData {
 
 	bool is_ime_composing;
 } wmIMEData;
+#endif
 
 /* **************** Paint Cursor ******************* */
 
diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h
index e4ae722..833234b 100644
--- a/source/blender/windowmanager/wm_window.h
+++ b/source/blender/windowmanager/wm_window.h
@@ -69,9 +69,10 @@ wmWindow	*wm_window_copy			(bContext *C, wmWindow *winorig);
 
 void		wm_window_testbreak		(void);
 
-/* *************** window IME api ************** */
+#ifdef WITH_INPUT_IME
 void		wm_window_IME_begin	(wmWindow *win, int x, int y, int w, int h, bool complete);
 void		wm_window_IME_end	(wmWindow *win);
+#endif
 
 /* *************** window operators ************** */
 int			wm_window_duplicate_exec(bContext *C, struct wmOperator *op);




More information about the Bf-blender-cvs mailing list