stanluk pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=fb4608d9dae9123f451dd1ebc4c10c2b2c996884

commit fb4608d9dae9123f451dd1ebc4c10c2b2c996884
Author: Lukasz Stanislawski <l.stanisl...@samsung.com>
Date:   Tue May 12 15:30:52 2015 +0200

    atspi: add component interface to elm_widget_item objects.
---
 src/lib/elm_widget.c       | 56 ++++++++++++++++++++++++++++++++++++++++++++++
 src/lib/elm_widget_item.eo |  8 ++++++-
 2 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 4bb2a59..1763bc5 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -5702,5 +5702,61 @@ 
_elm_widget_elm_interface_atspi_accessible_relation_set_get(Eo *obj, Elm_Widget_
    return list;
 }
 
+EOLIAN static void
+_elm_widget_item_elm_interface_atspi_component_extents_get(Eo *obj 
EINA_UNUSED, Elm_Widget_Item_Data *sd EINA_UNUSED, Eina_Bool screen_coords, int 
*x, int *y, int *w, int *h)
+{
+   int ee_x, ee_y;
+
+   if (!sd->view)
+     {
+        if (x) *x = -1;
+        if (y) *y = -1;
+        if (w) *w = -1;
+        if (h) *h = -1;
+        return;
+     }
+
+   evas_object_geometry_get(sd->view, x, y, w, h);
+   if (screen_coords)
+     {
+        Ecore_Evas *ee = 
ecore_evas_ecore_evas_get(evas_object_evas_get(sd->view));
+        if (!ee) return;
+        ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
+        if (x) *x += ee_x;
+        if (y) *y += ee_y;
+     }
+}
+
+EOLIAN static Eina_Bool
+_elm_widget_item_elm_interface_atspi_component_extents_set(Eo *obj 
EINA_UNUSED, Elm_Widget_Item_Data *sd EINA_UNUSED, Eina_Bool screen_coords 
EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h 
EINA_UNUSED)
+{
+   return EINA_FALSE;
+}
+
+EOLIAN static int
+_elm_widget_item_elm_interface_atspi_component_layer_get(Eo *obj EINA_UNUSED, 
Elm_Widget_Item_Data *sd EINA_UNUSED)
+{
+   if (!sd->view)
+     return -1;
+   return evas_object_layer_get(sd->view);
+}
+
+EOLIAN static Eina_Bool
+_elm_widget_item_elm_interface_atspi_component_focus_grab(Eo *obj EINA_UNUSED, 
Elm_Widget_Item_Data *_pd EINA_UNUSED)
+{
+   elm_object_item_focus_set(obj, EINA_TRUE);
+   return elm_object_item_focus_get(obj);
+}
+
+EOLIAN static double
+_elm_widget_item_elm_interface_atspi_component_alpha_get(Eo *obj EINA_UNUSED, 
Elm_Widget_Item_Data *sd EINA_UNUSED)
+{
+   int alpha;
+
+   if (!sd->view) return -1.0;
+   evas_object_color_get(sd->view, NULL, NULL, NULL, &alpha);
+   return (double)alpha / 255.0;
+}
+
 #include "elm_widget_item.eo.c"
 #include "elm_widget.eo.c"
diff --git a/src/lib/elm_widget_item.eo b/src/lib/elm_widget_item.eo
index c40ce28..771edac 100644
--- a/src/lib/elm_widget_item.eo
+++ b/src/lib/elm_widget_item.eo
@@ -1,4 +1,5 @@
-class Elm.Widget_Item(Eo.Base, Elm_Interface_Atspi_Accessible)
+class Elm.Widget_Item(Eo.Base, Elm_Interface_Atspi_Accessible,
+                      Elm_Interface_Atspi_Component)
 {
       eo_prefix: elm_wdg_item;
       legacy_prefix: elm_object_item;
@@ -729,5 +730,10 @@ class Elm.Widget_Item(Eo.Base, 
Elm_Interface_Atspi_Accessible)
            Elm_Interface_Atspi_Accessible.role.set;
            Elm_Interface_Atspi_Accessible.state_set.get;
            Elm_Interface_Atspi_Accessible.parent.get;
+           Elm_Interface_Atspi_Component.extents.get;
+           Elm_Interface_Atspi_Component.extents.set;
+           Elm_Interface_Atspi_Component.alpha.get;
+           Elm_Interface_Atspi_Component.layer.get;
+           Elm_Interface_Atspi_Component.focus_grab;
       }
 }

-- 


Reply via email to