summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <chuneon.park@samsung.com>2013-02-23 19:52:57 +0900
committerChunEon Park <chuneon.park@samsung.com>2013-02-23 19:52:57 +0900
commit029d539a85306019608e27a611ace500b313dd71 (patch)
treefc270bcf558d53bddfe599196076aa43d8e19d35
parent9c950e4a8d6e57802540b0ff211c9427fc1ff9b5 (diff)
parent161a78466b5e3b1545ca2290a2e0e1b6c5ccf69e (diff)
Merge branch 'master' of ssh://git.enlightenment.org/core/efl
-rw-r--r--src/examples/ecore/ecore_imf_example.c44
1 files changed, 36 insertions, 8 deletions
diff --git a/src/examples/ecore/ecore_imf_example.c b/src/examples/ecore/ecore_imf_example.c
index bc03db9ca2..406dcc66df 100644
--- a/src/examples/ecore/ecore_imf_example.c
+++ b/src/examples/ecore/ecore_imf_example.c
@@ -13,6 +13,9 @@
13#include <Evas.h> 13#include <Evas.h>
14#include <stdio.h> 14#include <stdio.h>
15 15
16#define WIDTH 480
17#define HEIGHT 800
18
16typedef struct _Entry Entry; 19typedef struct _Entry Entry;
17 20
18struct _Entry 21struct _Entry
@@ -33,11 +36,21 @@ static void
33_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)
34{ 37{
35 Entry *en = data; 38 Entry *en = data;
39 Evas_Event_Mouse_Down *ev = event_info;
36 if (!en) return; 40 if (!en) return;
37 41
38 // ecore_imf_context_reset should be called before calculating new cursor position
39 if (en->imf_context) 42 if (en->imf_context)
40 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 }
41 54
42 // calculate new cursor position 55 // calculate new cursor position
43} 56}
@@ -46,8 +59,25 @@ static void
46_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)
47{ 60{
48 Entry *en = data; 61 Entry *en = data;
62 Evas_Event_Mouse_Up *ev = event_info;
49 if (!en) return; 63 if (!en) return;
50 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
51 if (evas_object_focus_get(en->rect)) 81 if (evas_object_focus_get(en->rect))
52 { 82 {
53 // notify cursor information 83 // notify cursor information
@@ -161,7 +191,7 @@ _ecore_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx, char **te
161 Entry *en = data; 191 Entry *en = data;
162 const char *str; 192 const char *str;
163 193
164 if (!en) return; 194 if (!en) return EINA_FALSE;
165 195
166 str = evas_object_textblock_text_markup_get(en->txt_obj); 196 str = evas_object_textblock_text_markup_get(en->txt_obj);
167 197
@@ -317,8 +347,6 @@ _key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
317 Entry *en = data; 347 Entry *en = data;
318 Evas_Event_Key_Down *ev = event_info; 348 Evas_Event_Key_Down *ev = event_info;
319 Eina_Bool control, alt, shift; 349 Eina_Bool control, alt, shift;
320 Eina_Bool multiline;
321 Eina_Bool cursor_changed;
322 if ((!en) || (!ev->key)) return; 350 if ((!en) || (!ev->key)) return;
323 351
324 if (en->imf_context) 352 if (en->imf_context)
@@ -560,8 +588,8 @@ main(int argc, char *argv[])
560 588
561 ecore_imf_init(); 589 ecore_imf_init();
562 590
563 // create a new window, with size=480x800 and default engine 591 // create a new window, with size=WIDTHxHEIGHT and default engine
564 ee = ecore_evas_new(NULL, 0, 0, 480, 800, NULL); 592 ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
565 593
566 if (!ee) 594 if (!ee)
567 { 595 {
@@ -582,7 +610,7 @@ main(int argc, char *argv[])
582 // create input field rectangle 610 // create input field rectangle
583 Evas_Object *bg = evas_object_rectangle_add(evas); 611 Evas_Object *bg = evas_object_rectangle_add(evas);
584 evas_object_move(bg, 0, 0); 612 evas_object_move(bg, 0, 0);
585 evas_object_resize(bg, 480, 800); 613 evas_object_resize(bg, WIDTH, HEIGHT);
586 evas_object_color_set(bg, 255, 255, 255, 255); 614 evas_object_color_set(bg, 255, 255, 255, 255);
587 evas_object_show(bg); 615 evas_object_show(bg);
588 616