Hi All,

I'm new to efl and trying to understand something about input method.

I found an example as follows, tried running it but failed.

Code:
... // some callbacks..
int main(int argc, char **argv)
{
   Eina_List *ids, *l;
   const char *id;
   Ecore_Evas *ee;
   Evas *evas;
   Evas_Object *rect;
   Ecore_IMF_Context *ctx;

   fprintf(stderr, "** initializing ecore\n");
   ecore_init();
   fprintf(stderr, "** initializing ecore_evas\n");
   ecore_evas_init();
   fprintf(stderr, "** initializing ecore_imf\n");
   ecore_imf_init();

   fprintf(stderr, "** retrieving ecore_imf_context_available_ids_get\n");
   ids = ecore_imf_context_available_ids_get();
   if (!ids)
     {
        // ecore_list_first_goto(ids);
        fprintf(stderr, "** available input methods:");
        EINA_LIST_FOREACH(ids, l, id) {
           fprintf(stderr, " %s", id);
        }
        fprintf(stderr, "\n");
     }

   ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 800, 480);
   ecore_evas_title_set(ee, "test");
   ecore_evas_name_class_set(ee, "test", "test");
   // ecore_evas_fullscreen_set(ee, 1);
   ecore_evas_show(ee);

   evas = ecore_evas_get(ee);
   evas_image_cache_set(evas, 8 * 1024 * 1024);

   rect = evas_object_rectangle_add(evas);
   evas_object_move(rect, 50, 50);
   evas_object_resize(rect, 50, 50);
   evas_object_show(rect);

   fprintf(stderr, "** creating context\n");
   ctx = ecore_imf_context_add("xim");
   if(!ctx)
     {
        printf("ctx is null\n");
        return 1;
     }

   ecore_imf_context_client_window_set(ctx,
                                       (void 
*)ecore_evas_software_x11_window_get(ee));
   ecore_imf_context_retrieve_surrounding_callback_set(ctx, 
_retrieve_surrounding_cb, NULL);
   ecore_imf_context_reset(ctx);
   ecore_imf_context_show(ctx);
   ecore_event_handler_add(ECORE_IMF_EVENT_COMMIT, _event_commit_cb, NULL);
   evas_object_event_callback_add(rect, EVAS_CALLBACK_FOCUS_IN,
                                  _e_entry_focus_in_cb, (void*)ctx);
   evas_object_event_callback_add(rect, EVAS_CALLBACK_FOCUS_OUT,
                                  _e_entry_focus_out_cb, (void*)ctx);
   evas_object_event_callback_add(rect, EVAS_CALLBACK_KEY_DOWN,
                                  _e_entry_key_down_cb, (void *)ctx);
   evas_object_focus_set (rect, EINA_TRUE);

   ecore_main_loop_begin();

   ecore_imf_context_hide(ctx);
   ecore_imf_context_del(ctx);

   ecore_imf_shutdown();
   ecore_evas_shutdown();
   ecore_shutdown();

   return 0;
} /* main */


When running it:

$ ./ecore_imf_test
** initializing ecore
** initializing ecore_evas
** initializing ecore_imf
** retrieving ecore_imf_context_available_ids_get
** available input methods:
** creating context
ctx is null

---------
It appears that I have no input method / context installed.

The question is, how do I configure imf context or input method module?

Thanks,
Devin

------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry® mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry® DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to