summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-08 14:35:13 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-08 14:35:13 +0000
commite25ae55151df86cdcf3d7b0ae7a259329a4994c5 (patch)
tree86b2bc3ac6337f7bfa2c484c25a38c0b498a4378 /src
parentb7c81581c51aa1d494d3ccfb2ec6c2098749d650 (diff)
efl/ecore_imf_xim: proper eina log usage.
it would be nice if someone could apply these to other IMF modules as well. SVN revision: 82418
Diffstat (limited to 'src')
-rw-r--r--src/modules/ecore/immodules/xim/ecore_imf_xim.c205
1 files changed, 105 insertions, 100 deletions
diff --git a/src/modules/ecore/immodules/xim/ecore_imf_xim.c b/src/modules/ecore/immodules/xim/ecore_imf_xim.c
index f2dfdbba23..c35a70bf37 100644
--- a/src/modules/ecore/immodules/xim/ecore_imf_xim.c
+++ b/src/modules/ecore/immodules/xim/ecore_imf_xim.c
@@ -16,7 +16,28 @@
16#include <langinfo.h> 16#include <langinfo.h>
17#include <assert.h> 17#include <assert.h>
18 18
19#define CLAMP(x, low, high) (x > high) ? high : (x < low) ? low : x 19static int _ecore_imf_xim_log_dom = -1;
20
21#ifdef CRITICAL
22#undef CRITICAL
23#endif
24#define CRITICAL(...) EINA_LOG_DOM_CRIT(_ecore_imf_xim_log_dom, __VA_ARGS__)
25
26#ifdef ERR
27#undef ERR
28#endif
29#define ERR(...) EINA_LOG_DOM_ERR(_ecore_imf_xim_log_dom, __VA_ARGS__)
30
31#ifdef WRN
32#undef WRN
33#endif
34#define WRN(...) EINA_LOG_DOM_WARN(_ecore_imf_xim_log_dom, __VA_ARGS__)
35
36#ifdef DBG
37#undef DBG
38#endif
39#define DBG(...) EINA_LOG_DOM_DBG(_ecore_imf_xim_log_dom, __VA_ARGS__)
40
20 41
21static Eina_List *open_ims = NULL; 42static Eina_List *open_ims = NULL;
22 43
@@ -125,11 +146,8 @@ _ecore_imf_xim_utf8_offset_to_index(const char *str, int offset)
125static void 146static void
126_ecore_imf_context_xim_add(Ecore_IMF_Context *ctx) 147_ecore_imf_context_xim_add(Ecore_IMF_Context *ctx)
127{ 148{
128 Ecore_IMF_Context_Data *imf_context_data = NULL; 149 Ecore_IMF_Context_Data *imf_context_data = _ecore_imf_xim_context_data_new();
129 150 DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
130 EINA_LOG_DBG("in");
131
132 imf_context_data = _ecore_imf_xim_context_data_new();
133 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 151 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
134 152
135 imf_context_data->use_preedit = EINA_TRUE; 153 imf_context_data->use_preedit = EINA_TRUE;
@@ -143,10 +161,8 @@ _ecore_imf_context_xim_add(Ecore_IMF_Context *ctx)
143static void 161static void
144_ecore_imf_context_xim_del(Ecore_IMF_Context *ctx) 162_ecore_imf_context_xim_del(Ecore_IMF_Context *ctx)
145{ 163{
146 Ecore_IMF_Context_Data *imf_context_data; 164 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
147 165 DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
148 EINA_LOG_DBG("in");
149 imf_context_data = ecore_imf_context_data_get(ctx);
150 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 166 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
151 167
152 imf_context_data->finalizing = EINA_TRUE; 168 imf_context_data->finalizing = EINA_TRUE;
@@ -181,7 +197,7 @@ static void
181_ecore_imf_context_xim_client_window_set(Ecore_IMF_Context *ctx, 197_ecore_imf_context_xim_client_window_set(Ecore_IMF_Context *ctx,
182 void *window) 198 void *window)
183{ 199{
184 EINA_LOG_DBG("in"); 200 DBG("ctx=%p, window=%p", ctx, window);
185 _ecore_imf_xim_ic_client_window_set(ctx, (Ecore_X_Window)((Ecore_Window)window)); 201 _ecore_imf_xim_ic_client_window_set(ctx, (Ecore_X_Window)((Ecore_Window)window));
186} 202}
187 203
@@ -190,13 +206,12 @@ _ecore_imf_context_xim_preedit_string_get(Ecore_IMF_Context *ctx,
190 char **str, 206 char **str,
191 int *cursor_pos) 207 int *cursor_pos)
192{ 208{
193 Ecore_IMF_Context_Data *imf_context_data; 209 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
194 char *utf8; 210 char *utf8;
195 int len; 211 int len;
196 212
197 EINA_LOG_DBG("in"); 213 DBG("ctx=%p, imf_context_data=%p, str=%p, cursor_pos=%p",
198 214 ctx, imf_context_data, str, cursor_pos);
199 imf_context_data = ecore_imf_context_data_get(ctx);
200 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 215 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
201 216
202 if (imf_context_data->preedit_chars) 217 if (imf_context_data->preedit_chars)
@@ -228,7 +243,8 @@ _ecore_imf_context_xim_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx
228{ 243{
229 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx); 244 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
230 245
231 EINA_LOG_DBG("in"); 246 DBG("ctx=%p, imf_context_data=%p, str=%p, attrs=%p, cursor_pos=%p",
247 ctx, imf_context_data, str, attrs, cursor_pos);
232 248
233 _ecore_imf_context_xim_preedit_string_get(ctx, str, cursor_pos); 249 _ecore_imf_context_xim_preedit_string_get(ctx, str, cursor_pos);
234 250
@@ -260,12 +276,10 @@ _ecore_imf_context_xim_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx
260static void 276static void
261_ecore_imf_context_xim_focus_in(Ecore_IMF_Context *ctx) 277_ecore_imf_context_xim_focus_in(Ecore_IMF_Context *ctx)
262{ 278{
279 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
263 XIC ic; 280 XIC ic;
264 Ecore_IMF_Context_Data *imf_context_data;
265 281
266 EINA_LOG_DBG("in"); 282 DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
267
268 imf_context_data = ecore_imf_context_data_get(ctx);
269 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 283 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
270 284
271 ic = imf_context_data->ic; 285 ic = imf_context_data->ic;
@@ -292,12 +306,10 @@ _ecore_imf_context_xim_focus_in(Ecore_IMF_Context *ctx)
292static void 306static void
293_ecore_imf_context_xim_focus_out(Ecore_IMF_Context *ctx) 307_ecore_imf_context_xim_focus_out(Ecore_IMF_Context *ctx)
294{ 308{
309 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
295 XIC ic; 310 XIC ic;
296 Ecore_IMF_Context_Data *imf_context_data;
297
298 EINA_LOG_DBG("%s in", __FUNCTION__);
299 311
300 imf_context_data = ecore_imf_context_data_get(ctx); 312 DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
301 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 313 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
302 314
303 if (imf_context_data->has_focus == EINA_TRUE) 315 if (imf_context_data->has_focus == EINA_TRUE)
@@ -315,18 +327,15 @@ _ecore_imf_context_xim_focus_out(Ecore_IMF_Context *ctx)
315static void 327static void
316_ecore_imf_context_xim_reset(Ecore_IMF_Context *ctx) 328_ecore_imf_context_xim_reset(Ecore_IMF_Context *ctx)
317{ 329{
330 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
318 XIC ic; 331 XIC ic;
319 Ecore_IMF_Context_Data *imf_context_data;
320 char *result; 332 char *result;
321
322 EINA_LOG_DBG("%s in", __FUNCTION__);
323
324 /* restore conversion state after resetting ic later */ 333 /* restore conversion state after resetting ic later */
325 XIMPreeditState preedit_state = XIMPreeditUnKnown; 334 XIMPreeditState preedit_state = XIMPreeditUnKnown;
326 XVaNestedList preedit_attr; 335 XVaNestedList preedit_attr;
327 Eina_Bool have_preedit_state = EINA_FALSE; 336 Eina_Bool have_preedit_state = EINA_FALSE;
328 337
329 imf_context_data = ecore_imf_context_data_get(ctx); 338 DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
330 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 339 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
331 340
332 ic = imf_context_data->ic; 341 ic = imf_context_data->ic;
@@ -392,11 +401,9 @@ static void
392_ecore_imf_context_xim_use_preedit_set(Ecore_IMF_Context *ctx, 401_ecore_imf_context_xim_use_preedit_set(Ecore_IMF_Context *ctx,
393 Eina_Bool use_preedit) 402 Eina_Bool use_preedit)
394{ 403{
395 Ecore_IMF_Context_Data *imf_context_data; 404 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
396
397 EINA_LOG_DBG("in");
398 405
399 imf_context_data = ecore_imf_context_data_get(ctx); 406 DBG("ctx=%p, imf_context_data=%p, use_preedit=%hhu", ctx, imf_context_data, use_preedit);
400 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 407 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
401 408
402 use_preedit = use_preedit != EINA_FALSE; 409 use_preedit = use_preedit != EINA_FALSE;
@@ -442,14 +449,14 @@ static void
442_ecore_imf_context_xim_cursor_location_set(Ecore_IMF_Context *ctx, 449_ecore_imf_context_xim_cursor_location_set(Ecore_IMF_Context *ctx,
443 int x, int y, int w, int h) 450 int x, int y, int w, int h)
444{ 451{
445 Ecore_IMF_Context_Data *imf_context_data; 452 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
446 XIC ic; 453 XIC ic;
447 XVaNestedList preedit_attr; 454 XVaNestedList preedit_attr;
448 XPoint spot; 455 XPoint spot;
449 456
450 EINA_LOG_DBG("%s in", __FUNCTION__); 457 DBG("ctx=%p, imf_context_data=%p, location=(%d, %d, %d, %d)",
458 ctx, imf_context_data, x, y, w, h);
451 459
452 imf_context_data = ecore_imf_context_data_get(ctx);
453 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 460 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
454 ic = imf_context_data->ic; 461 ic = imf_context_data->ic;
455 if (!ic) 462 if (!ic)
@@ -466,17 +473,13 @@ _ecore_imf_context_xim_cursor_location_set(Ecore_IMF_Context *ctx,
466 NULL); 473 NULL);
467 474
468 XFree(preedit_attr); 475 XFree(preedit_attr);
469 (void)(w); // yes w is unused, but only a bi-product of the algorithm
470} 476}
471 477
472static void 478static void
473_ecore_imf_context_xim_input_panel_show(Ecore_IMF_Context *ctx) 479_ecore_imf_context_xim_input_panel_show(Ecore_IMF_Context *ctx)
474{ 480{
475 Ecore_IMF_Context_Data *imf_context_data; 481 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
476 482 DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
477 EINA_LOG_DBG("%s in", __FUNCTION__);
478
479 imf_context_data = ecore_imf_context_data_get(ctx);
480 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 483 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
481 484
482 ecore_x_e_virtual_keyboard_state_set 485 ecore_x_e_virtual_keyboard_state_set
@@ -486,11 +489,8 @@ _ecore_imf_context_xim_input_panel_show(Ecore_IMF_Context *ctx)
486static void 489static void
487_ecore_imf_context_xim_input_panel_hide(Ecore_IMF_Context *ctx) 490_ecore_imf_context_xim_input_panel_hide(Ecore_IMF_Context *ctx)
488{ 491{
489 Ecore_IMF_Context_Data *imf_context_data; 492 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
490 493 DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
491 EINA_LOG_DBG("%s in", __FUNCTION__);
492
493 imf_context_data = ecore_imf_context_data_get(ctx);
494 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 494 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
495 495
496 ecore_x_e_virtual_keyboard_state_set 496 ecore_x_e_virtual_keyboard_state_set
@@ -544,12 +544,12 @@ _ecore_x_event_reverse_locks(unsigned int state)
544} 544}
545 545
546static KeyCode 546static KeyCode
547_keycode_get(Ecore_X_Display *dsp, 547_ecore_imf_xim_keycode_get(Ecore_X_Display *dsp,
548 const char *keyname) 548 const char *keyname)
549{ 549{
550 KeyCode keycode; 550 KeyCode keycode;
551 551
552 // EINA_LOG_DBG("keyname:%s keysym:%lu", keyname, XStringToKeysym(keyname)); 552 //DBG("keyname=%s keysym=%lu", keyname, XStringToKeysym(keyname));
553 if (strcmp(keyname, "Keycode-0") == 0) 553 if (strcmp(keyname, "Keycode-0") == 0)
554 keycode = 0; 554 keycode = 0;
555 else 555 else
@@ -563,9 +563,8 @@ _ecore_imf_context_xim_filter_event(Ecore_IMF_Context *ctx,
563 Ecore_IMF_Event_Type type, 563 Ecore_IMF_Event_Type type,
564 Ecore_IMF_Event *event) 564 Ecore_IMF_Event *event)
565{ 565{
566 Ecore_IMF_Context_Data *imf_context_data; 566 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
567 XIC ic; 567 XIC ic;
568
569 Ecore_X_Display *dsp; 568 Ecore_X_Display *dsp;
570 Ecore_X_Window win; 569 Ecore_X_Window win;
571 570
@@ -576,10 +575,9 @@ _ecore_imf_context_xim_filter_event(Ecore_IMF_Context *ctx,
576 char *tmp = NULL; 575 char *tmp = NULL;
577 Eina_Bool result = EINA_FALSE; 576 Eina_Bool result = EINA_FALSE;
578 577
579 EINA_LOG_DBG("%s in", __FUNCTION__); 578 DBG("ctx=%p, imf_context_data=%p, type=%d, event=%p",
580 579 ctx, imf_context_data, type, event);
581 imf_context_data = ecore_imf_context_data_get(ctx); 580 EINA_SAFETY_ON_NULL_RETURN_VAL(imf_context_data, EINA_FALSE);
582 if (!imf_context_data) return EINA_FALSE;
583 ic = imf_context_data->ic; 581 ic = imf_context_data->ic;
584 if (!ic) 582 if (!ic)
585 ic = _ecore_imf_xim_ic_get(ctx); 583 ic = _ecore_imf_xim_ic_get(ctx);
@@ -588,7 +586,7 @@ _ecore_imf_context_xim_filter_event(Ecore_IMF_Context *ctx,
588 { 586 {
589 XKeyPressedEvent xev; 587 XKeyPressedEvent xev;
590 Ecore_IMF_Event_Key_Down *ev = (Ecore_IMF_Event_Key_Down *)event; 588 Ecore_IMF_Event_Key_Down *ev = (Ecore_IMF_Event_Key_Down *)event;
591 EINA_LOG_DBG("ECORE_IMF_EVENT_KEY_DOWN"); 589 DBG("ECORE_IMF_EVENT_KEY_DOWN");
592 590
593 dsp = ecore_x_display_get(); 591 dsp = ecore_x_display_get();
594 win = imf_context_data->win; 592 win = imf_context_data->win;
@@ -606,7 +604,7 @@ _ecore_imf_context_xim_filter_event(Ecore_IMF_Context *ctx,
606 xev.state = 0; 604 xev.state = 0;
607 xev.state |= _ecore_x_event_reverse_modifiers(ev->modifiers); 605 xev.state |= _ecore_x_event_reverse_modifiers(ev->modifiers);
608 xev.state |= _ecore_x_event_reverse_locks(ev->locks); 606 xev.state |= _ecore_x_event_reverse_locks(ev->locks);
609 xev.keycode = _keycode_get(dsp, ev->keyname); 607 xev.keycode = _ecore_imf_xim_keycode_get(dsp, ev->keyname);
610 xev.same_screen = True; 608 xev.same_screen = True;
611 609
612 if (ic) 610 if (ic)
@@ -742,31 +740,32 @@ static Ecore_IMF_Context_Class xim_class = {
742static Ecore_IMF_Context * 740static Ecore_IMF_Context *
743xim_imf_module_create(void) 741xim_imf_module_create(void)
744{ 742{
745 EINA_LOG_DBG("%s in", __FUNCTION__); 743 Ecore_IMF_Context *ctx = ecore_imf_context_new(&xim_class);
746 Ecore_IMF_Context *ctx = NULL; 744 DBG("ctx=%p", ctx);
747
748 ctx = ecore_imf_context_new(&xim_class);
749 if (!ctx)
750 goto error;
751
752 return ctx; 745 return ctx;
753
754error:
755 free(ctx);
756 return NULL;
757} 746}
758 747
759static Ecore_IMF_Context * 748static Ecore_IMF_Context *
760xim_imf_module_exit(void) 749xim_imf_module_exit(void)
761{ 750{
751 DBG(" ");
762 return NULL; 752 return NULL;
763} 753}
764 754
765static Eina_Bool 755static Eina_Bool
766_ecore_imf_xim_init(void) 756_ecore_imf_xim_init(void)
767{ 757{
768 EINA_LOG_DBG("%s in", __FUNCTION__);
769 eina_init(); 758 eina_init();
759
760 _ecore_imf_xim_log_dom = eina_log_domain_register("ecore_imf_xim", NULL);
761 if (_ecore_imf_xim_log_dom < 0)
762 {
763 EINA_LOG_ERR("Could not register log domain: ecore_imf_xim");
764 return EINA_FALSE;
765 }
766
767 DBG(" ");
768
770 ecore_x_init(NULL); 769 ecore_x_init(NULL);
771 ecore_imf_module_register(&xim_info, 770 ecore_imf_module_register(&xim_info,
772 xim_imf_module_create, 771 xim_imf_module_create,
@@ -787,6 +786,13 @@ _ecore_imf_xim_shutdown(void)
787 } 786 }
788 787
789 ecore_x_shutdown(); 788 ecore_x_shutdown();
789
790 if (_ecore_imf_xim_log_dom > 0)
791 {
792 eina_log_domain_unregister(_ecore_imf_xim_log_dom);
793 _ecore_imf_xim_log_dom = -1;
794 }
795
790 eina_shutdown(); 796 eina_shutdown();
791} 797}
792 798
@@ -845,11 +851,11 @@ _ecore_imf_xim_preedit_start_call(XIC xic EINA_UNUSED,
845 XPointer client_data, 851 XPointer client_data,
846 XPointer call_data EINA_UNUSED) 852 XPointer call_data EINA_UNUSED)
847{ 853{
848 EINA_LOG_DBG("in");
849 Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)client_data; 854 Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)client_data;
850 Ecore_IMF_Context_Data *imf_context_data; 855 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
851 imf_context_data = ecore_imf_context_data_get(ctx); 856
852 if (!imf_context_data) return -1; 857 DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
858 EINA_SAFETY_ON_NULL_RETURN_VAL(imf_context_data, -1);
853 859
854 if (imf_context_data->finalizing == EINA_FALSE) 860 if (imf_context_data->finalizing == EINA_FALSE)
855 { 861 {
@@ -864,10 +870,10 @@ _ecore_imf_xim_preedit_done_call(XIC xic EINA_UNUSED,
864 XPointer client_data, 870 XPointer client_data,
865 XPointer call_data EINA_UNUSED) 871 XPointer call_data EINA_UNUSED)
866{ 872{
867 EINA_LOG_DBG("in");
868 Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)client_data; 873 Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)client_data;
869 Ecore_IMF_Context_Data *imf_context_data; 874 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
870 imf_context_data = ecore_imf_context_data_get(ctx); 875
876 DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
871 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 877 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
872 878
873 if (imf_context_data->preedit_length) 879 if (imf_context_data->preedit_length)
@@ -899,7 +905,7 @@ _ecore_imf_xim_text_to_utf8(Ecore_IMF_Context *ctx EINA_UNUSED,
899 { 905 {
900 if (xim_text->encoding_is_wchar) 906 if (xim_text->encoding_is_wchar)
901 { 907 {
902 EINA_LOG_WARN("Wide character return from Xlib not currently supported"); 908 WRN("Wide character return from Xlib not currently supported");
903 *text = NULL; 909 *text = NULL;
904 return 0; 910 return 0;
905 } 911 }
@@ -911,12 +917,13 @@ _ecore_imf_xim_text_to_utf8(Ecore_IMF_Context *ctx EINA_UNUSED,
911 text_length = eina_unicode_utf8_get_len(result); 917 text_length = eina_unicode_utf8_get_len(result);
912 if (text_length != xim_text->length) 918 if (text_length != xim_text->length)
913 { 919 {
914 EINA_LOG_WARN("Size mismatch when converting text from input method: supplied length = %d\n, result length = %d", xim_text->length, text_length); 920 WRN("Size mismatch when converting text from input method: supplied length = %d, result length = %d",
921 xim_text->length, text_length);
915 } 922 }
916 } 923 }
917 else 924 else
918 { 925 {
919 EINA_LOG_WARN("Error converting text from IM to UCS-4"); 926 WRN("Error converting text from IM to UCS-4");
920 *text = NULL; 927 *text = NULL;
921 return 0; 928 return 0;
922 } 929 }
@@ -936,7 +943,6 @@ _ecore_imf_xim_preedit_draw_call(XIC xic EINA_UNUSED,
936 XPointer client_data, 943 XPointer client_data,
937 XIMPreeditDrawCallbackStruct *call_data) 944 XIMPreeditDrawCallbackStruct *call_data)
938{ 945{
939 EINA_LOG_DBG("in");
940 Eina_Bool ret = EINA_FALSE; 946 Eina_Bool ret = EINA_FALSE;
941 Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)client_data; 947 Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)client_data;
942 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx); 948 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
@@ -947,6 +953,7 @@ _ecore_imf_xim_preedit_draw_call(XIC xic EINA_UNUSED,
947 int new_text_length; 953 int new_text_length;
948 int i = 0; 954 int i = 0;
949 955
956 DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
950 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 957 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
951 958
952 preedit_bufs = eina_ustrbuf_new(); 959 preedit_bufs = eina_ustrbuf_new();
@@ -1027,10 +1034,10 @@ _ecore_imf_xim_preedit_caret_call(XIC xic EINA_UNUSED,
1027 XPointer client_data, 1034 XPointer client_data,
1028 XIMPreeditCaretCallbackStruct *call_data) 1035 XIMPreeditCaretCallbackStruct *call_data)
1029{ 1036{
1030 EINA_LOG_DBG("in");
1031 Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)client_data; 1037 Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)client_data;
1032 Ecore_IMF_Context_Data *imf_context_data; 1038 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
1033 imf_context_data = ecore_imf_context_data_get(ctx); 1039
1040 DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
1034 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 1041 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
1035 1042
1036 if (call_data->direction == XIMAbsolutePosition) 1043 if (call_data->direction == XIMAbsolutePosition)
@@ -1094,7 +1101,7 @@ _ecore_imf_xim_ic_get(Ecore_IMF_Context *ctx)
1094 1101
1095 if (!im_info) 1102 if (!im_info)
1096 { 1103 {
1097 EINA_LOG_WARN("Doesn't open XIM."); 1104 WRN("Could not open XIM.");
1098 return NULL; 1105 return NULL;
1099 } 1106 }
1100 1107
@@ -1170,8 +1177,8 @@ _ecore_imf_xim_ic_get(Ecore_IMF_Context *ctx)
1170 1177
1171 if (!im_info->xim_styles) 1178 if (!im_info->xim_styles)
1172 { 1179 {
1173 EINA_LOG_WARN("No XIM styles supported! Wanted %#llx", 1180 WRN("No XIM styles supported! Wanted %#llx",
1174 (unsigned long long)im_style); 1181 (unsigned long long)im_style);
1175 im_style = 0; 1182 im_style = 0;
1176 } 1183 }
1177 else 1184 else
@@ -1193,17 +1200,15 @@ _ecore_imf_xim_ic_get(Ecore_IMF_Context *ctx)
1193 { 1200 {
1194 if (fallback) 1201 if (fallback)
1195 { 1202 {
1196 EINA_LOG_WARN("Wanted XIM style %#llx not found, " 1203 WRN("Wanted XIM style %#llx not found, using fallback %#llx instead.",
1197 "using fallback %#llx instead.", 1204 (unsigned long long)im_style,
1198 (unsigned long long)im_style, 1205 (unsigned long long)fallback);
1199 (unsigned long long)fallback);
1200 im_style = fallback; 1206 im_style = fallback;
1201 } 1207 }
1202 else 1208 else
1203 { 1209 {
1204 EINA_LOG_WARN("Wanted XIM style %#llx not found, " 1210 WRN("Wanted XIM style %#llx not found, no fallback supported.",
1205 "no fallback supported.", 1211 (unsigned long long)im_style);
1206 (unsigned long long)im_style);
1207 im_style = 0; 1212 im_style = 0;
1208 } 1213 }
1209 } 1214 }
@@ -1259,19 +1264,19 @@ _ecore_imf_xim_ic_reinitialize(Ecore_IMF_Context *ctx)
1259 1264
1260static void 1265static void
1261_ecore_imf_xim_ic_client_window_set(Ecore_IMF_Context *ctx, 1266_ecore_imf_xim_ic_client_window_set(Ecore_IMF_Context *ctx,
1262 Ecore_X_Window window) 1267 Ecore_X_Window window)
1263{ 1268{
1264 EINA_LOG_DBG("in");
1265 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx); 1269 Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
1266 Ecore_X_Window old_win; 1270 Ecore_X_Window old_win;
1267 1271
1272 DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
1268 EINA_SAFETY_ON_NULL_RETURN(imf_context_data); 1273 EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
1269 1274
1270 /* reinitialize IC */ 1275 /* reinitialize IC */
1271 _ecore_imf_xim_ic_reinitialize(ctx); 1276 _ecore_imf_xim_ic_reinitialize(ctx);
1272 1277
1273 old_win = imf_context_data->win; 1278 old_win = imf_context_data->win;
1274 EINA_LOG_DBG("old_win:%d window:%d ", old_win, window); 1279 DBG("old_win=%#x, window=%#x", old_win, window);
1275 if (old_win != 0 && old_win != window) /* XXX how do check window... */ 1280 if (old_win != 0 && old_win != window) /* XXX how do check window... */
1276 { 1281 {
1277 XIM_Im_Info *info; 1282 XIM_Im_Info *info;
@@ -1301,11 +1306,11 @@ static XIM_Im_Info *
1301_ecore_imf_xim_im_get(Ecore_X_Window window, 1306_ecore_imf_xim_im_get(Ecore_X_Window window,
1302 char *locale) 1307 char *locale)
1303{ 1308{
1304 EINA_LOG_DBG("in");
1305
1306 Eina_List *l; 1309 Eina_List *l;
1307 XIM_Im_Info *im_info = NULL; 1310 XIM_Im_Info *im_info = NULL;
1308 XIM_Im_Info *info = NULL; 1311 XIM_Im_Info *info = NULL;
1312
1313 DBG(" ");
1309 EINA_LIST_FOREACH (open_ims, l, im_info) 1314 EINA_LIST_FOREACH (open_ims, l, im_info)
1310 { 1315 {
1311 if (strcmp(im_info->locale, locale) == 0) 1316 if (strcmp(im_info->locale, locale) == 0)
@@ -1349,7 +1354,7 @@ _ecore_imf_xim_info_im_init(XIM_Im_Info *info)
1349 if (XSupportsLocale()) 1354 if (XSupportsLocale())
1350 { 1355 {
1351 if (!XSetLocaleModifiers("")) 1356 if (!XSetLocaleModifiers(""))
1352 EINA_LOG_WARN("Unable to set locale modifiers with XSetLocaleModifiers()"); 1357 WRN("Unable to set locale modifiers with XSetLocaleModifiers()");
1353 dsp = ecore_x_display_get(); 1358 dsp = ecore_x_display_get();
1354 info->im = XOpenIM(dsp, NULL, NULL, NULL); 1359 info->im = XOpenIM(dsp, NULL, NULL, NULL);
1355 if (!info->im) 1360 if (!info->im)