summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehwan Kim <jae.hwan.kim@samsung.com>2014-02-08 12:27:41 +0900
committerJaehwan Kim <jae.hwan.kim@samsung.com>2014-02-08 12:27:41 +0900
commit0b1fbd9cafab0491969db39a4016c5fe904350de (patch)
tree7553e5fa48ecd383052715c79cd4f725ee2d206c
parentbcb6872196aee0a516892871ea85452d384e8504 (diff)
access: Add elm_widget_access_highlight_in_theme_set/get.
This is for widget to draw the access highlight itself in theme.
-rw-r--r--src/lib/elm_access.c45
-rw-r--r--src/lib/elm_layout.c30
-rw-r--r--src/lib/elm_widget.c37
-rw-r--r--src/lib/elm_widget.h27
4 files changed, 130 insertions, 9 deletions
diff --git a/src/lib/elm_access.c b/src/lib/elm_access.c
index b9dd1de4a..4f315d272 100644
--- a/src/lib/elm_access.c
+++ b/src/lib/elm_access.c
@@ -773,11 +773,33 @@ _elm_access_object_get(const Evas_Object *obj)
773 return _elm_access_info_get(obj); 773 return _elm_access_info_get(obj);
774} 774}
775 775
776static Evas_Object *
777_elm_access_widget_target_get(Evas_Object *obj)
778{
779 Evas_Object *o = obj;
780
781 do
782 {
783 if (elm_widget_is(o))
784 break;
785 else
786 {
787 o = elm_widget_parent_widget_get(o);
788 if (!o)
789 o = evas_object_smart_parent_get(o);
790 }
791 }
792 while (o);
793
794 return o;
795}
796
776EAPI void 797EAPI void
777_elm_access_object_highlight(Evas_Object *obj) 798_elm_access_object_highlight(Evas_Object *obj)
778{ 799{
779 Evas_Object *o; 800 Evas_Object *o, *widget;
780 Evas_Coord x, y, w, h; 801 Evas_Coord x, y, w, h;
802 Eina_Bool in_theme = EINA_FALSE;
781 803
782 o = evas_object_name_find(evas_object_evas_get(obj), "_elm_access_disp"); 804 o = evas_object_name_find(evas_object_evas_get(obj), "_elm_access_disp");
783 if (!o) 805 if (!o)
@@ -802,6 +824,15 @@ _elm_access_object_highlight(Evas_Object *obj)
802 _access_obj_hilight_move_cb, NULL); 824 _access_obj_hilight_move_cb, NULL);
803 evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_RESIZE, 825 evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_RESIZE,
804 _access_obj_hilight_resize_cb, NULL); 826 _access_obj_hilight_resize_cb, NULL);
827
828 widget = _elm_access_widget_target_get(ptarget);
829 if (widget)
830 {
831 if (elm_widget_access_highlight_in_theme_get(widget))
832 {
833 elm_widget_signal_emit(widget, "elm,action,access_highlight,hide", "elm");
834 }
835 }
805 } 836 }
806 } 837 }
807 evas_object_data_set(o, "_elm_access_target", obj); 838 evas_object_data_set(o, "_elm_access_target", obj);
@@ -822,9 +853,19 @@ _elm_access_object_highlight(Evas_Object *obj)
822 evas_object_move(o, x, y); 853 evas_object_move(o, x, y);
823 evas_object_resize(o, w, h); 854 evas_object_resize(o, w, h);
824 855
856 widget = _elm_access_widget_target_get(obj);
857 if (widget)
858 {
859 if (elm_widget_access_highlight_in_theme_get(widget))
860 {
861 in_theme = EINA_TRUE;
862 elm_widget_signal_emit(widget, "elm,action,access_highlight,show", "elm");
863 }
864 }
825 /* use callback, should an access object do below every time when 865 /* use callback, should an access object do below every time when
826 * a window gets a client message ECORE_X_ATOM_E_ILLMUE_ACTION_READ? */ 866 * a window gets a client message ECORE_X_ATOM_E_ILLMUE_ACTION_READ? */
827 if (!_access_action_callback_call(obj, ELM_ACCESS_ACTION_HIGHLIGHT, NULL)) 867 if (!in_theme &&
868 !_access_action_callback_call(obj, ELM_ACCESS_ACTION_HIGHLIGHT, NULL))
828 evas_object_show(o); 869 evas_object_show(o);
829 else 870 else
830 evas_object_hide(o); 871 evas_object_hide(o);
diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c
index 515790ee1..f8560444e 100644
--- a/src/lib/elm_layout.c
+++ b/src/lib/elm_layout.c
@@ -320,10 +320,31 @@ _elm_layout_smart_disable(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
320 if (ret) *ret = EINA_TRUE; 320 if (ret) *ret = EINA_TRUE;
321} 321}
322 322
323static void
324_elm_layout_highlight_in_theme(Evas_Object *obj)
325{
326 const char *fh;
327
328 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
329
330 fh = edje_object_data_get
331 (wd->resize_obj, "focus_highlight");
332 if ((fh) && (!strcmp(fh, "on")))
333 elm_widget_highlight_in_theme_set(obj, EINA_TRUE);
334 else
335 elm_widget_highlight_in_theme_set(obj, EINA_FALSE);
336
337 fh = edje_object_data_get
338 (wd->resize_obj, "access_highlight");
339 if ((fh) && (!strcmp(fh, "on")))
340 elm_widget_access_highlight_in_theme_set(obj, EINA_TRUE);
341 else
342 elm_widget_access_highlight_in_theme_set(obj, EINA_FALSE);
343}
344
323static Eina_Bool 345static Eina_Bool
324_elm_layout_theme_internal(Eo *obj, Elm_Layout_Smart_Data *sd) 346_elm_layout_theme_internal(Eo *obj, Elm_Layout_Smart_Data *sd)
325{ 347{
326 const char *fh;
327 Eina_Bool ret = EINA_FALSE; 348 Eina_Bool ret = EINA_FALSE;
328 349
329 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); 350 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -340,12 +361,7 @@ _elm_layout_theme_internal(Eo *obj, Elm_Layout_Smart_Data *sd)
340 (wd->resize_obj, 361 (wd->resize_obj,
341 elm_widget_scale_get(obj) * elm_config_scale_get()); 362 elm_widget_scale_get(obj) * elm_config_scale_get());
342 363
343 fh = edje_object_data_get 364 _elm_layout_highlight_in_theme(obj);
344 (wd->resize_obj, "focus_highlight");
345 if ((fh) && (!strcmp(fh, "on")))
346 elm_widget_highlight_in_theme_set(obj, EINA_TRUE);
347 else
348 elm_widget_highlight_in_theme_set(obj, EINA_FALSE);
349 365
350 evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL); 366 evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL);
351 367
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 5671efb13..c96f9bc54 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -1622,6 +1622,39 @@ _elm_widget_highlight_in_theme_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list
1622 *ret = sd->highlight_in_theme; 1622 *ret = sd->highlight_in_theme;
1623} 1623}
1624 1624
1625EAPI void
1626elm_widget_access_highlight_in_theme_set(Evas_Object *obj,
1627 Eina_Bool highlight)
1628{
1629 ELM_WIDGET_CHECK(obj);
1630 eo_do(obj, elm_wdg_access_highlight_in_theme_set(highlight));
1631}
1632
1633static void
1634_elm_widget_access_highlight_in_theme_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1635{
1636 Eina_Bool highlight = va_arg(*list, int);
1637 Elm_Widget_Smart_Data *sd = _pd;
1638 sd->access_highlight_in_theme = !!highlight;
1639}
1640
1641EAPI Eina_Bool
1642elm_widget_access_highlight_in_theme_get(const Evas_Object *obj)
1643{
1644 ELM_WIDGET_CHECK(obj) EINA_FALSE;
1645 Eina_Bool ret = EINA_FALSE;
1646 eo_do((Eo *) obj, elm_wdg_access_highlight_in_theme_get(&ret));
1647 return ret;
1648}
1649
1650static void
1651_elm_widget_access_highlight_in_theme_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1652{
1653 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1654 Elm_Widget_Smart_Data *sd = _pd;
1655 *ret = sd->access_highlight_in_theme;
1656}
1657
1625EAPI Eina_Bool 1658EAPI Eina_Bool
1626elm_widget_focus_get(const Evas_Object *obj) 1659elm_widget_focus_get(const Evas_Object *obj)
1627{ 1660{
@@ -6468,6 +6501,8 @@ _class_constructor(Eo_Class *klass)
6468 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_GET), _elm_widget_highlight_ignore_get), 6501 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_GET), _elm_widget_highlight_ignore_get),
6469 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_SET), _elm_widget_highlight_in_theme_set), 6502 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_SET), _elm_widget_highlight_in_theme_set),
6470 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_GET), _elm_widget_highlight_in_theme_get), 6503 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_GET), _elm_widget_highlight_in_theme_get),
6504 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS_HIGHLIGHT_IN_THEME_SET), _elm_widget_access_highlight_in_theme_set),
6505 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS_HIGHLIGHT_IN_THEME_GET), _elm_widget_access_highlight_in_theme_get),
6471 6506
6472 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_HOLD_PUSH), _elm_widget_scroll_hold_push), 6507 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_HOLD_PUSH), _elm_widget_scroll_hold_push),
6473 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_HOLD_POP), _elm_widget_scroll_hold_pop), 6508 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_HOLD_POP), _elm_widget_scroll_hold_pop),
@@ -6615,6 +6650,8 @@ static const Eo_Op_Description op_desc[] = {
6615 EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_GET, "description here"), 6650 EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_GET, "description here"),
6616 EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_SET, "description here"), 6651 EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_SET, "description here"),
6617 EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_GET, "description here"), 6652 EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_GET, "description here"),
6653 EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_ACCESS_HIGHLIGHT_IN_THEME_SET, "Set the access highlight in widget theme."),
6654 EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_ACCESS_HIGHLIGHT_IN_THEME_GET, "Get the access highlight in widget theme."),
6618 6655
6619 EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCROLL_HOLD_PUSH, "description here"), 6656 EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCROLL_HOLD_PUSH, "description here"),
6620 EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCROLL_HOLD_POP, "description here"), 6657 EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCROLL_HOLD_POP, "description here"),
diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h
index d3fe1c380..085ac6115 100644
--- a/src/lib/elm_widget.h
+++ b/src/lib/elm_widget.h
@@ -426,6 +426,7 @@ typedef struct _Elm_Widget_Smart_Data
426 Eina_Bool tree_unfocusable : 1; 426 Eina_Bool tree_unfocusable : 1;
427 Eina_Bool highlight_ignore : 1; 427 Eina_Bool highlight_ignore : 1;
428 Eina_Bool highlight_in_theme : 1; 428 Eina_Bool highlight_in_theme : 1;
429 Eina_Bool access_highlight_in_theme : 1;
429 Eina_Bool disabled : 1; 430 Eina_Bool disabled : 1;
430 Eina_Bool is_mirrored : 1; 431 Eina_Bool is_mirrored : 1;
431 Eina_Bool mirrored_auto_mode : 1; /* This is 432 Eina_Bool mirrored_auto_mode : 1; /* This is
@@ -623,6 +624,8 @@ EAPI void elm_widget_highlight_ignore_set(Evas_Object *obj, Eina_Boo
623EAPI Eina_Bool elm_widget_highlight_ignore_get(const Evas_Object *obj); 624EAPI Eina_Bool elm_widget_highlight_ignore_get(const Evas_Object *obj);
624EAPI void elm_widget_highlight_in_theme_set(Evas_Object *obj, Eina_Bool highlight); 625EAPI void elm_widget_highlight_in_theme_set(Evas_Object *obj, Eina_Bool highlight);
625EAPI Eina_Bool elm_widget_highlight_in_theme_get(const Evas_Object *obj); 626EAPI Eina_Bool elm_widget_highlight_in_theme_get(const Evas_Object *obj);
627EAPI void elm_widget_access_highlight_in_theme_set(Evas_Object *obj, Eina_Bool highlight);
628EAPI Eina_Bool elm_widget_access_highlight_in_theme_get(const Evas_Object *obj);
626EAPI Eina_Bool elm_widget_focus_get(const Evas_Object *obj); 629EAPI Eina_Bool elm_widget_focus_get(const Evas_Object *obj);
627EAPI Eina_Bool elm_widget_highlight_get(const Evas_Object *obj); 630EAPI Eina_Bool elm_widget_highlight_get(const Evas_Object *obj);
628EAPI Evas_Object *elm_widget_focused_object_get(const Evas_Object *obj); 631EAPI Evas_Object *elm_widget_focused_object_get(const Evas_Object *obj);
@@ -1156,6 +1159,8 @@ enum
1156 ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_GET, 1159 ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_GET,
1157 ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_SET, 1160 ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_SET,
1158 ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_GET, 1161 ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_GET,
1162 ELM_WIDGET_SUB_ID_ACCESS_HIGHLIGHT_IN_THEME_SET,
1163 ELM_WIDGET_SUB_ID_ACCESS_HIGHLIGHT_IN_THEME_GET,
1159 1164
1160 ELM_WIDGET_SUB_ID_SCROLL_HOLD_PUSH, 1165 ELM_WIDGET_SUB_ID_SCROLL_HOLD_PUSH,
1161 ELM_WIDGET_SUB_ID_SCROLL_HOLD_POP, 1166 ELM_WIDGET_SUB_ID_SCROLL_HOLD_POP,
@@ -1597,6 +1602,28 @@ typedef void * (*list_data_get_func_type)(const Eina_List * l);
1597#define elm_wdg_highlight_in_theme_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_GET), EO_TYPECHECK(Eina_Bool *, ret) 1602#define elm_wdg_highlight_in_theme_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_GET), EO_TYPECHECK(Eina_Bool *, ret)
1598 1603
1599/** 1604/**
1605 * @def elm_wdg_access_highlight_in_theme_set
1606 * @since 1.9
1607 *
1608 * No description supplied by the EAPI.
1609 *
1610 * @param[in] access highlight
1611 *
1612 */
1613#define elm_wdg_access_highlight_in_theme_set(highlight) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS_HIGHLIGHT_IN_THEME_SET), EO_TYPECHECK(Eina_Bool, highlight)
1614
1615/**
1616 * @def elm_wdg_access_highlight_in_theme_get
1617 * @since 1.9
1618 *
1619 * No description supplied by the EAPI.
1620 *
1621 * @param[out] ret
1622 *
1623 */
1624#define elm_wdg_access_highlight_in_theme_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS_HIGHLIGHT_IN_THEME_GET), EO_TYPECHECK(Eina_Bool *, ret)
1625
1626/**
1600 * @def elm_wdg_scroll_hold_push 1627 * @def elm_wdg_scroll_hold_push
1601 * @since 1.8 1628 * @since 1.8
1602 * 1629 *