summaryrefslogtreecommitdiff
path: root/src/lib/elm_toolbar.c
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2014-10-09 10:14:38 +0200
committerLukasz Stanislawski <lukasz.stanislawski@gmail.com>2015-04-06 10:24:58 +0200
commit142aee84d83490ee65b4e7d3033dbca4ba1e2999 (patch)
tree475ca06b1c6dd3995e3f33898552d00c5f7d81f8 /src/lib/elm_toolbar.c
parentf75d21e557999ce37c9a99fefe127529670115bc (diff)
atspi: add AT-SPI support for elm_toolbar_items
Diffstat (limited to 'src/lib/elm_toolbar.c')
-rw-r--r--src/lib/elm_toolbar.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c
index e62276d39..07d12a717 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -631,6 +631,8 @@ _elm_toolbar_item_focused(Elm_Object_Item *eo_it)
631 evas_object_raise(VIEW(it)); 631 evas_object_raise(VIEW(it));
632 evas_object_smart_callback_call 632 evas_object_smart_callback_call
633 (obj, SIG_ITEM_FOCUSED, EO_OBJ(it)); 633 (obj, SIG_ITEM_FOCUSED, EO_OBJ(it));
634 if (_elm_config->atspi_mode)
635 elm_interface_atspi_accessible_state_changed_signal_emit(EO_OBJ(it), ELM_ATSPI_STATE_FOCUSED, EINA_TRUE);
634} 636}
635 637
636static void 638static void
@@ -656,6 +658,8 @@ _elm_toolbar_item_unfocused(Elm_Object_Item *eo_it)
656 sd->focused_item = NULL; 658 sd->focused_item = NULL;
657 evas_object_smart_callback_call 659 evas_object_smart_callback_call
658 (obj, SIG_ITEM_UNFOCUSED, eo_it); 660 (obj, SIG_ITEM_UNFOCUSED, eo_it);
661 if (_elm_config->atspi_mode)
662 elm_interface_atspi_accessible_state_changed_signal_emit(eo_it, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE);
659} 663}
660 664
661/* 665/*
@@ -2294,6 +2298,7 @@ _elm_toolbar_item_eo_base_constructor(Eo *eo_it, Elm_Toolbar_Item_Data *it)
2294{ 2298{
2295 eo_do_super(eo_it, ELM_TOOLBAR_ITEM_CLASS, eo_constructor()); 2299 eo_do_super(eo_it, ELM_TOOLBAR_ITEM_CLASS, eo_constructor());
2296 it->base = eo_data_scope_get(eo_it, ELM_WIDGET_ITEM_CLASS); 2300 it->base = eo_data_scope_get(eo_it, ELM_WIDGET_ITEM_CLASS);
2301 eo_do(eo_it, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_MENU_ITEM));
2297} 2302}
2298 2303
2299static Elm_Toolbar_Item_Data * 2304static Elm_Toolbar_Item_Data *
@@ -3733,6 +3738,30 @@ _elm_toolbar_item_bring_in(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
3733 (x, y, w, h)); 3738 (x, y, w, h));
3734} 3739}
3735 3740
3741EOLIAN static char*
3742_elm_toolbar_item_elm_interface_atspi_accessible_name_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
3743{
3744 return item->label ? strdup(item->label) : NULL;
3745}
3746
3747EOLIAN static Elm_Atspi_State_Set
3748_elm_toolbar_item_elm_interface_atspi_accessible_state_set_get(Eo *eo_it, Elm_Toolbar_Item_Data *item EINA_UNUSED)
3749{
3750 Elm_Atspi_State_Set ret;
3751 Eina_Bool sel;
3752
3753 eo_do_super(eo_it, ELM_TOOLBAR_ITEM_CLASS, ret = elm_interface_atspi_accessible_state_set_get());
3754
3755 eo_do(eo_it, sel = elm_obj_toolbar_item_selected_get());
3756
3757 STATE_TYPE_SET(ret, ELM_ATSPI_STATE_SELECTABLE);
3758
3759 if (sel)
3760 STATE_TYPE_SET(ret, ELM_ATSPI_STATE_SELECTED);
3761
3762 return ret;
3763}
3764
3736EOLIAN static Elm_Object_Item * 3765EOLIAN static Elm_Object_Item *
3737_elm_toolbar_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) 3766_elm_toolbar_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
3738{ 3767{
@@ -3759,5 +3788,29 @@ _elm_toolbar_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUS
3759 return &atspi_actions[0]; 3788 return &atspi_actions[0];
3760} 3789}
3761 3790
3791EOLIAN static Eina_List*
3792_elm_toolbar_elm_interface_atspi_accessible_children_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
3793{
3794 Eina_List *ret = NULL;
3795 Elm_Toolbar_Item_Data *it;
3796
3797 EINA_INLIST_FOREACH(sd->items, it)
3798 ret = eina_list_append(ret, EO_OBJ(it));
3799
3800 return ret;
3801}
3802
3803EOLIAN static Elm_Atspi_State_Set
3804_elm_toolbar_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Toolbar_Data *sd EINA_UNUSED)
3805{
3806 Elm_Atspi_State_Set ret;
3807
3808 eo_do_super(obj, ELM_TOOLBAR_CLASS, ret = elm_interface_atspi_accessible_state_set_get());
3809
3810 STATE_TYPE_SET(ret, ELM_ATSPI_STATE_MANAGES_DESCENDANTS);
3811
3812 return ret;
3813}
3814
3762#include "elm_toolbar.eo.c" 3815#include "elm_toolbar.eo.c"
3763#include "elm_toolbar_item.eo.c" 3816#include "elm_toolbar_item.eo.c"