summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2013-02-23 18:01:10 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2013-02-23 18:01:10 +0900
commit161a78466b5e3b1545ca2290a2e0e1b6c5ccf69e (patch)
tree620c4bf0659508eb26777c12e14c64a67b30ef09
parent2ea7ddfdcbaff15db5564b892110e42b501fcf93 (diff)
ecore_imf_example: call ecore_imf_context_filter_event in mouse up/down event
-rw-r--r--src/examples/ecore/ecore_imf_example.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/examples/ecore/ecore_imf_example.c b/src/examples/ecore/ecore_imf_example.c
index f4099ce994..406dcc66df 100644
--- a/src/examples/ecore/ecore_imf_example.c
+++ b/src/examples/ecore/ecore_imf_example.c
@@ -36,11 +36,21 @@ static void
36_mouse_down_cb(void *data, Evas *e, Evas_Object *o, void *event_info) 36_mouse_down_cb(void *data, Evas *e, Evas_Object *o, void *event_info)
37{ 37{
38 Entry *en = data; 38 Entry *en = data;
39 Evas_Event_Mouse_Down *ev = event_info;
39 if (!en) return; 40 if (!en) return;
40 41
41 // ecore_imf_context_reset should be called before calculating new cursor position
42 if (en->imf_context) 42 if (en->imf_context)
43 ecore_imf_context_reset(en->imf_context); 43 {
44 Ecore_IMF_Event_Mouse_Down ecore_ev;
45 ecore_imf_evas_event_mouse_down_wrap(ev, &ecore_ev);
46 if (ecore_imf_context_filter_event(en->imf_context,
47 ECORE_IMF_EVENT_MOUSE_DOWN,
48 (Ecore_IMF_Event *)&ecore_ev))
49 return;
50
51 // ecore_imf_context_reset should be called before calculating new cursor position
52 ecore_imf_context_reset(en->imf_context);
53 }
44 54
45 // calculate new cursor position 55 // calculate new cursor position
46} 56}
@@ -49,8 +59,25 @@ static void
49_mouse_up_cb(void *data, Evas *e, Evas_Object *o, void *event_info) 59_mouse_up_cb(void *data, Evas *e, Evas_Object *o, void *event_info)
50{ 60{
51 Entry *en = data; 61 Entry *en = data;
62 Evas_Event_Mouse_Up *ev = event_info;
52 if (!en) return; 63 if (!en) return;
53 64
65 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
66 {
67 _imf_cursor_info_set(en);
68 return;
69 }
70
71 if (en->imf_context)
72 {
73 Ecore_IMF_Event_Mouse_Up ecore_ev;
74 ecore_imf_evas_event_mouse_up_wrap(ev, &ecore_ev);
75 if (ecore_imf_context_filter_event(en->imf_context,
76 ECORE_IMF_EVENT_MOUSE_UP,
77 (Ecore_IMF_Event *)&ecore_ev))
78 return;
79 }
80
54 if (evas_object_focus_get(en->rect)) 81 if (evas_object_focus_get(en->rect))
55 { 82 {
56 // notify cursor information 83 // notify cursor information