summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2014-09-29 15:34:34 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2014-09-29 15:34:34 +0200
commitada4c082beb20cb584a8997d9cd4658605480ecf (patch)
tree71446b2716483207541e4f7110ec8fda7f8276a5
parent989b193d98ef0fb6d81adfe97faa6628b7ca699c (diff)
atspi: make eo_widget_item accessible object
-rw-r--r--src/lib/elm_widget.c52
-rw-r--r--src/lib/elm_widget.h4
-rw-r--r--src/lib/elm_widget_item.eo7
3 files changed, 62 insertions, 1 deletions
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index c7a7796a2..687bed7ea 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -10,6 +10,14 @@
10#include "elm_interface_scrollable.h" 10#include "elm_interface_scrollable.h"
11#include "elm_interface_atspi_widget.eo.h" 11#include "elm_interface_atspi_widget.eo.h"
12 12
13#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
14
15#include "elm_interface_atspi_accessible.h"
16#include "elm_interface_atspi_accessible.eo.h"
17
18#define ELM_INTERFACE_ATPSI_COMPONENT_PROTECTED
19#include "elm_interface_atspi_component.eo.h"
20
13#define MY_CLASS ELM_WIDGET_CLASS 21#define MY_CLASS ELM_WIDGET_CLASS
14 22
15#define MY_CLASS_NAME "Elm_Widget" 23#define MY_CLASS_NAME "Elm_Widget"
@@ -4174,6 +4182,9 @@ _elm_widget_item_eo_base_destructor(Eo *eo_item, Elm_Widget_Item_Data *item)
4174 } 4182 }
4175 eina_hash_free(item->labels); 4183 eina_hash_free(item->labels);
4176 4184
4185 if (item->description)
4186 eina_stringshare_del(item->description);
4187
4177 EINA_MAGIC_SET(item, EINA_MAGIC_NONE); 4188 EINA_MAGIC_SET(item, EINA_MAGIC_NONE);
4178 4189
4179 eo_do_super(eo_item, ELM_WIDGET_ITEM_CLASS, eo_destructor()); 4190 eo_do_super(eo_item, ELM_WIDGET_ITEM_CLASS, eo_destructor());
@@ -4296,6 +4307,47 @@ _elm_widget_item_widget_get(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
4296 return item->widget; 4307 return item->widget;
4297} 4308}
4298 4309
4310EOLIAN static const char*
4311_elm_widget_item_elm_interface_atspi_accessible_description_get(Eo *eo_item EINA_UNUSED,
4312 Elm_Widget_Item_Data *item)
4313{
4314 return item->description;
4315}
4316
4317EOLIAN static void
4318_elm_widget_item_elm_interface_atspi_accessible_description_set(Eo *eo_item EINA_UNUSED,
4319 Elm_Widget_Item_Data *item,
4320 const char *descr)
4321{
4322 eina_stringshare_replace(&item->description, descr);
4323}
4324
4325EOLIAN static Elm_Atspi_Role
4326_elm_widget_item_elm_interface_atspi_accessible_role_get(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
4327{
4328 return item->role;
4329}
4330
4331EOLIAN static void
4332_elm_widget_item_elm_interface_atspi_accessible_role_set(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item,
4333 Elm_Atspi_Role role)
4334{
4335 item->role = role;
4336}
4337
4338EOLIAN static Elm_Atspi_State_Set
4339_elm_widget_item_elm_interface_atspi_accessible_state_set_get(Eo *eo_item EINA_UNUSED,
4340 Elm_Widget_Item_Data *item EINA_UNUSED)
4341{
4342 Elm_Atspi_State_Set states = 0;
4343
4344 if (elm_object_item_focus_get(eo_item))
4345 STATE_TYPE_SET(states, ELM_ATSPI_STATE_FOCUSED);
4346 if (!elm_object_item_disabled_get(eo_item))
4347 STATE_TYPE_SET(states, ELM_ATSPI_STATE_ENABLED);
4348
4349 return states;
4350}
4299 4351
4300EAPI void 4352EAPI void
4301elm_object_item_data_set(Elm_Object_Item *it, void *data) 4353elm_object_item_data_set(Elm_Object_Item *it, void *data)
diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h
index 48561cec9..7659e502e 100644
--- a/src/lib/elm_widget.h
+++ b/src/lib/elm_widget.h
@@ -611,6 +611,10 @@ struct _Elm_Widget_Item_Data
611 Eina_Hash *labels; 611 Eina_Hash *labels;
612 Evas_Object *track_obj; 612 Evas_Object *track_obj;
613 613
614 /**< A11Y info */
615 const char *description;
616 int role;
617
614 Eina_Bool disabled : 1; 618 Eina_Bool disabled : 1;
615 Eina_Bool on_deletion : 1; 619 Eina_Bool on_deletion : 1;
616 Eina_Bool on_translate : 1; 620 Eina_Bool on_translate : 1;
diff --git a/src/lib/elm_widget_item.eo b/src/lib/elm_widget_item.eo
index 1c6de725c..e2d1577cf 100644
--- a/src/lib/elm_widget_item.eo
+++ b/src/lib/elm_widget_item.eo
@@ -1,4 +1,4 @@
1class Elm_Widget_Item(Eo.Base) 1class Elm_Widget_Item(Eo.Base, Elm_Interface_Atspi_Accessible, Elm_Interface_Atspi_Component)
2{ 2{
3 eo_prefix: elm_wdg_item; 3 eo_prefix: elm_wdg_item;
4 legacy_prefix: elm_object_item; 4 legacy_prefix: elm_object_item;
@@ -726,5 +726,10 @@ class Elm_Widget_Item(Eo.Base)
726 implements { 726 implements {
727 Eo.Base.constructor; 727 Eo.Base.constructor;
728 Eo.Base.destructor; 728 Eo.Base.destructor;
729 Elm_Interface_Atspi_Accessible.description.get;
730 Elm_Interface_Atspi_Accessible.description.set;
731 Elm_Interface_Atspi_Accessible.role.get;
732 Elm_Interface_Atspi_Accessible.role.set;
733 Elm_Interface_Atspi_Accessible.state_set.get;
729 } 734 }
730} 735}