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)
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_
5702 return list; 5702 return list;
5703} 5703}
5704 5704
5705EOLIAN static void
5706_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)
5707{
5708 int ee_x, ee_y;
5709
5710 if (!sd->view)
5711 {
5712 if (x) *x = -1;
5713 if (y) *y = -1;
5714 if (w) *w = -1;
5715 if (h) *h = -1;
5716 return;
5717 }
5718
5719 evas_object_geometry_get(sd->view, x, y, w, h);
5720 if (screen_coords)
5721 {
5722 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(sd->view));
5723 if (!ee) return;
5724 ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
5725 if (x) *x += ee_x;
5726 if (y) *y += ee_y;
5727 }
5728}
5729
5730EOLIAN static Eina_Bool
5731_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)
5732{
5733 return EINA_FALSE;
5734}
5735
5736EOLIAN static int
5737_elm_widget_item_elm_interface_atspi_component_layer_get(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd EINA_UNUSED)
5738{
5739 if (!sd->view)
5740 return -1;
5741 return evas_object_layer_get(sd->view);
5742}
5743
5744EOLIAN static Eina_Bool
5745_elm_widget_item_elm_interface_atspi_component_focus_grab(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *_pd EINA_UNUSED)
5746{
5747 elm_object_item_focus_set(obj, EINA_TRUE);
5748 return elm_object_item_focus_get(obj);
5749}
5750
5751EOLIAN static double
5752_elm_widget_item_elm_interface_atspi_component_alpha_get(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd EINA_UNUSED)
5753{
5754 int alpha;
5755
5756 if (!sd->view) return -1.0;
5757 evas_object_color_get(sd->view, NULL, NULL, NULL, &alpha);
5758 return (double)alpha / 255.0;
5759}
5760
5705#include "elm_widget_item.eo.c" 5761#include "elm_widget_item.eo.c"
5706#include "elm_widget.eo.c" 5762#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 @@
1class Elm.Widget_Item(Eo.Base, Elm_Interface_Atspi_Accessible) 1class Elm.Widget_Item(Eo.Base, Elm_Interface_Atspi_Accessible,
2 Elm_Interface_Atspi_Component)
2{ 3{
3 eo_prefix: elm_wdg_item; 4 eo_prefix: elm_wdg_item;
4 legacy_prefix: elm_object_item; 5 legacy_prefix: elm_object_item;
@@ -729,5 +730,10 @@ class Elm.Widget_Item(Eo.Base, Elm_Interface_Atspi_Accessible)
729 Elm_Interface_Atspi_Accessible.role.set; 730 Elm_Interface_Atspi_Accessible.role.set;
730 Elm_Interface_Atspi_Accessible.state_set.get; 731 Elm_Interface_Atspi_Accessible.state_set.get;
731 Elm_Interface_Atspi_Accessible.parent.get; 732 Elm_Interface_Atspi_Accessible.parent.get;
733 Elm_Interface_Atspi_Component.extents.get;
734 Elm_Interface_Atspi_Component.extents.set;
735 Elm_Interface_Atspi_Component.alpha.get;
736 Elm_Interface_Atspi_Component.layer.get;
737 Elm_Interface_Atspi_Component.focus_grab;
732 } 738 }
733} 739}