Enlightenment CVS committal Author : andrunko Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_entry.c Log Message: Added Ecore_IMF_Evas. Removed Evas dependency from Ecore_IMF, that was requested by Ewl developers in order to be able to integrate Ecore_IMF on it. Added Ecore_IMF_Evas, a library with helper functions to use Ecore_IMF together with Evas. Now everybody should be happy. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_entry.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -3 -r1.50 -r1.51 --- e_entry.c 21 Nov 2007 01:33:50 -0000 1.50 +++ e_entry.c 21 Nov 2007 22:20:15 -0000 1.51 @@ -4,6 +4,7 @@ #include "e.h" #include <Ecore_IMF.h> +#include <Ecore_IMF_Evas.h> typedef struct _E_Entry_Smart_Data E_Entry_Smart_Data; @@ -327,9 +328,16 @@ if ((!obj) || (!(sd = evas_object_smart_data_get(obj)))) return; - if (sd->imf_context && - ecore_imf_context_filter_event(sd->imf_context, EVAS_CALLBACK_KEY_DOWN, event_info)) - return; + if (sd->imf_context) + { + Ecore_IMF_Event_Key_Down ev; + + ecore_imf_evas_event_key_down_wrap(event_info, &ev); + if (ecore_imf_context_filter_event(sd->imf_context, + ECORE_IMF_EVENT_KEY_DOWN, + (Ecore_IMF_Event *) &ev)) + return; + } if (_e_entry_emacs_keybindings) _e_entry_key_down_emacs(obj, event_info); @@ -347,7 +355,15 @@ return; if (sd->imf_context) - ecore_imf_context_filter_event(sd->imf_context, EVAS_CALLBACK_KEY_UP, event_info); + { + Ecore_IMF_Event_Key_Up ev; + + ecore_imf_evas_event_key_up_wrap(event_info, &ev); + if (ecore_imf_context_filter_event(sd->imf_context, + ECORE_IMF_EVENT_KEY_UP, + (Ecore_IMF_Event *) &ev)) + return; + } } /* Called when the entry object is pressed by the mouse */ @@ -364,9 +380,16 @@ if (!(event = event_info)) return; - if (sd->imf_context && - ecore_imf_context_filter_event(sd->imf_context, EVAS_CALLBACK_MOUSE_DOWN, event_info)) - return; + if (sd->imf_context) + { + Ecore_IMF_Event_Mouse_Down ev; + + ecore_imf_evas_event_mouse_down_wrap(event_info, &ev); + if (ecore_imf_context_filter_event(sd->imf_context, + ECORE_IMF_EVENT_MOUSE_DOWN, + (Ecore_IMF_Event *) &ev)) + return; + } evas_object_geometry_get(sd->editable_object, &ox, &oy, NULL, NULL); pos = e_editable_pos_get_from_coords(sd->editable_object, @@ -517,9 +540,16 @@ if ((!obj) || (!(sd = evas_object_smart_data_get(obj)))) return; - if (sd->imf_context && - ecore_imf_context_filter_event(sd->imf_context, EVAS_CALLBACK_MOUSE_UP, event_info)) - return; + if (sd->imf_context) + { + Ecore_IMF_Event_Mouse_Up ev; + + ecore_imf_evas_event_mouse_up_wrap(event_info, &ev); + if (ecore_imf_context_filter_event(sd->imf_context, + ECORE_IMF_EVENT_MOUSE_UP, + (Ecore_IMF_Event *) &ev)) + return; + } if (sd->selection_dragging) { @@ -542,9 +572,16 @@ if (!(event = event_info)) return; - if (sd->imf_context && - ecore_imf_context_filter_event(sd->imf_context, EVAS_CALLBACK_MOUSE_MOVE, event_info)) - return; + if (sd->imf_context) + { + Ecore_IMF_Event_Mouse_Move ev; + + ecore_imf_evas_event_mouse_move_wrap(event_info, &ev); + if (ecore_imf_context_filter_event(sd->imf_context, + ECORE_IMF_EVENT_MOUSE_MOVE, + (Ecore_IMF_Event *) &ev)) + return; + } if (sd->selection_dragging) { @@ -963,6 +1000,8 @@ E_Entry_Smart_Data *sd; Evas_Object *o; int cw, ch; + const char *ctx_id; + const Ecore_IMF_Context_Info *ctx_info; if ((!object) || !(evas = evas_object_evas_get(object))) return; @@ -972,10 +1011,25 @@ evas_object_smart_data_set(object, sd); - sd->imf_context = ecore_imf_context_add(ecore_imf_context_default_id_get()); + ctx_id = ecore_imf_context_default_id_get(); + ctx_info = ecore_imf_context_info_by_id_get(ctx_id); + if (!ctx_info->canvas_type || + strcmp(ctx_info->canvas_type, "evas") == 0) + sd->imf_context = ecore_imf_context_add(ctx_id); + else + { + ctx_id = ecore_imf_context_default_id_by_canvas_type_get("evas"); + if (ctx_id) + sd->imf_context = ecore_imf_context_add(ctx_id); + else + sd->imf_context = NULL; + } + if (sd->imf_context) { - ecore_imf_context_client_window_set(sd->imf_context, evas); + ecore_imf_context_client_window_set(sd->imf_context, + ecore_evas_window_get(ecore_evas_ecore_evas_get(evas))); + ecore_imf_context_client_canvas_set(sd->imf_context, evas); ecore_imf_context_retrieve_surrounding_callback_set(sd->imf_context, _e_entry_cb_imf_retrieve_surrounding, sd); ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs