summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2015-05-12 15:30:52 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2015-05-12 15:31:20 +0200
commitfb4608d9dae9123f451dd1ebc4c10c2b2c996884 (patch)
treec4d1b92905b5aa9a1097a7bf760288a6e4e4f160
parentadf9c5cb9292746549d15daf3fe568a4990c0906 (diff)
downloadelementary-fb4608d9dae9123f451dd1ebc4c10c2b2c996884.tar.gz
atspi: add component interface to elm_widget_item objects.
-rw-r--r--src/lib/elm_widget.c56
-rw-r--r--src/lib/elm_widget_item.eo8
2 files changed, 63 insertions, 1 deletions
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 4bb2a5956..1763bc505 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 c40ce2811..771edac5b 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;
}
}