summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2016-07-25 22:05:24 +0900
committerShinwoo Kim <cinoo.kim@samsung.com>2016-07-25 22:05:24 +0900
commit57d77c9041086ebbf84c2a30d93e95d47fc12705 (patch)
tree6944d9a9d50861481e7c6b70e5bbbcab3755b201
parent96fbea9daecf7040ac63203c4823722fa6d5d73f (diff)
access: add API to get access object of given part
-rw-r--r--NEWS1
-rw-r--r--src/lib/elementary/elc_popup.c6
-rw-r--r--src/lib/elementary/elm_main.c5
-rw-r--r--src/lib/elementary/elm_object.h11
-rw-r--r--src/lib/elementary/elm_popup.eo1
-rw-r--r--src/lib/elementary/elm_widget.c8
-rw-r--r--src/lib/elementary/elm_widget.eo9
-rw-r--r--src/tests/elementary/elm_test_popup.c20
8 files changed, 61 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 9ea2b6977d..c539e32f43 100644
--- a/NEWS
+++ b/NEWS
@@ -240,6 +240,7 @@ Features:
240 * eo base - add weak object refs as per jpeg needs 240 * eo base - add weak object refs as per jpeg needs
241 * elput: Add API function to return output name associated with input device 241 * elput: Add API function to return output name associated with input device
242 * Eo refcount: Split the refcount to private and public (user). 242 * Eo refcount: Split the refcount to private and public (user).
243 * access: Add API to get access object of given widget's part.
243 244
244Fixes: 245Fixes:
245 246
diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c
index 28836efc40..02c2745623 100644
--- a/src/lib/elementary/elc_popup.c
+++ b/src/lib/elementary/elc_popup.c
@@ -1482,6 +1482,12 @@ _elm_popup_elm_widget_event(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, Evas_Objec
1482 return EINA_TRUE; 1482 return EINA_TRUE;
1483} 1483}
1484 1484
1485EOLIAN static Evas_Object*
1486_elm_popup_elm_widget_part_access_object_get(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, const char *part)
1487{
1488 return _access_object_get(obj, part);
1489}
1490
1485EOLIAN static void 1491EOLIAN static void
1486_elm_popup_efl_canvas_group_group_add(Eo *obj, Elm_Popup_Data *priv) 1492_elm_popup_efl_canvas_group_group_add(Eo *obj, Elm_Popup_Data *priv)
1487{ 1493{
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index ccce58ac6a..f2033181ed 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -1925,3 +1925,8 @@ elm_object_focus_region_show_mode_get(const Evas_Object *obj)
1925 return elm_widget_focus_region_show_mode_get(obj); 1925 return elm_widget_focus_region_show_mode_get(obj);
1926} 1926}
1927 1927
1928EAPI Evas_Object *elm_object_part_access_object_get(const Evas_Object *obj, const char *part)
1929{
1930 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1931 return elm_widget_part_access_object_get(obj, part);
1932}
diff --git a/src/lib/elementary/elm_object.h b/src/lib/elementary/elm_object.h
index 935e6a7eb9..00f9ee1b56 100644
--- a/src/lib/elementary/elm_object.h
+++ b/src/lib/elementary/elm_object.h
@@ -508,3 +508,14 @@ EAPI void elm_object_orientation_mode_disabled_set(Evas_Object *obj, Eina
508 */ 508 */
509EAPI Eina_Bool elm_object_orientation_mode_disabled_get(const Evas_Object *obj); 509EAPI Eina_Bool elm_object_orientation_mode_disabled_get(const Evas_Object *obj);
510 510
511/**
512 * Get the access object which is registered to part
513 *
514 * @param obj The Elementary widget
515 * @param part The widget's part name to get access object
516 *
517 * @since 1.18
518 *
519 * @ingroup General
520 */
521EAPI Evas_Object *elm_object_part_access_object_get(const Evas_Object *obj, const char *part);
diff --git a/src/lib/elementary/elm_popup.eo b/src/lib/elementary/elm_popup.eo
index 93feda01d3..db33569fac 100644
--- a/src/lib/elementary/elm_popup.eo
+++ b/src/lib/elementary/elm_popup.eo
@@ -180,6 +180,7 @@ class Elm.Popup (Elm.Layout, Elm.Interface.Atspi_Widget_Action, Edje.Object)
180 Elm.Widget.translate; 180 Elm.Widget.translate;
181 Elm.Widget.sub_object_del; 181 Elm.Widget.sub_object_del;
182 Elm.Widget.event; 182 Elm.Widget.event;
183 Elm.Widget.part_access_object_get;
183 Elm.Layout.text.set; 184 Elm.Layout.text.set;
184 Elm.Layout.text.get; 185 Elm.Layout.text.get;
185 Elm.Layout.sizing_eval; 186 Elm.Layout.sizing_eval;
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index d347bdcc27..9338418567 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -3696,6 +3696,14 @@ _elm_widget_focus_reconfigure(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
3696 _elm_widget_focus_move_policy_reload(obj); 3696 _elm_widget_focus_move_policy_reload(obj);
3697} 3697}
3698 3698
3699EOLIAN static Evas_Object*
3700_elm_widget_part_access_object_get(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, const char *part)
3701{
3702 WRN("The %s widget does not implement the \"part_access_object_get\" functions.",
3703 eo_class_name_get(eo_class_get(obj)));
3704 return NULL;
3705}
3706
3699EAPI void 3707EAPI void
3700elm_widget_content_part_set(Evas_Object *obj, 3708elm_widget_content_part_set(Evas_Object *obj,
3701 const char *part, 3709 const char *part,
diff --git a/src/lib/elementary/elm_widget.eo b/src/lib/elementary/elm_widget.eo
index e495a4b405..3a181955da 100644
--- a/src/lib/elementary/elm_widget.eo
+++ b/src/lib/elementary/elm_widget.eo
@@ -837,6 +837,15 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible, Elm.Inter
837 } 837 }
838 focus_reconfigure { 838 focus_reconfigure {
839 } 839 }
840 part_access_object_get {
841 [[Get the access object of given part of the widget.
842
843 @since 1.18]]
844 return: Efl.Canvas.Object;
845 params {
846 @in part: string; [[The object's part name to get access object]]
847 }
848 }
840 } 849 }
841 implements { 850 implements {
842 class.constructor; 851 class.constructor;
diff --git a/src/tests/elementary/elm_test_popup.c b/src/tests/elementary/elm_test_popup.c
index b284475441..03526ceef8 100644
--- a/src/tests/elementary/elm_test_popup.c
+++ b/src/tests/elementary/elm_test_popup.c
@@ -24,7 +24,27 @@ START_TEST (elm_atspi_role_get)
24} 24}
25END_TEST 25END_TEST
26 26
27START_TEST (elm_object_part_access_object_get)
28{
29 Evas_Object *win, *popup, *access;
30
31 elm_init(1, NULL);
32 elm_config_access_set(EINA_TRUE);
33 win = elm_win_add(NULL, "popup", ELM_WIN_BASIC);
34
35 popup = elm_popup_add(win);
36 elm_object_part_text_set(popup, "title,text", "Title");
37 evas_object_show(popup);
38
39 access = elm_object_part_access_object_get(popup, "access.title");
40 ck_assert(access != NULL);
41
42 elm_shutdown();
43}
44END_TEST
45
27void elm_test_popup(TCase *tc) 46void elm_test_popup(TCase *tc)
28{ 47{
29 tcase_add_test(tc, elm_atspi_role_get); 48 tcase_add_test(tc, elm_atspi_role_get);
49 tcase_add_test(tc, elm_object_part_access_object_get);
30} 50}