1 #include <Elementary.h>
4 #include "eail_test_utils.h"
6 #define EAIL_TEST_ENTRY_NAME "entry text"
8 /* used to determine if test code has been successfully called
9 * (sometimes may happen that ATK object to test in hierarchy cannot be found)*/
10 static gboolean eail_test_code_called = FALSE;
13 _on_done(void *data, Evas_Object *obj, void *event_info)
19 _test_focus_on_entry(AtkObject *obj)
21 AtkObject *focused_obj = NULL;
22 gboolean success = FALSE;
24 _printf("Testing focus....\n");
27 g_assert(ATK_IS_COMPONENT(obj));
28 success = atk_component_grab_focus(ATK_COMPONENT(obj));
31 /* now focus should point to our button*/
32 focused_obj = atk_get_focus_object();
33 g_assert(focused_obj);
35 g_assert(focused_obj == obj);
37 _printf("DONE. All focus test passed successfully \n");
38 eail_test_code_called = TRUE;
42 _on_focus_in(void *data, Evas_Object *obj, void *event_info)
44 AtkObject *aobj = atk_get_root();
47 eailu_traverse_children_for_type_call_cb
48 (aobj, "EailEntry", _test_focus_on_entry);
50 g_assert(eail_test_code_called);
55 _initialize_and_show_buttons(Evas_Object *win)
57 Evas_Object *bg = NULL, *entry = NULL;
60 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
61 elm_win_resize_object_add(win, bg);
64 entry = elm_entry_add(win);
65 elm_entry_entry_set(entry, EAIL_TEST_ENTRY_NAME);
66 evas_object_resize(entry, 100, 60);
67 evas_object_move(entry, 50, 20);
68 evas_object_show(entry);
72 elm_main(int argc, char **argv)
76 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
77 _initialize_and_show_buttons(win);
79 evas_object_show(win);