2014-03-23 23:19:06 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2014-04-03 08:20:32 -07:00
|
|
|
#define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED
|
2015-05-12 06:23:21 -07:00
|
|
|
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
|
2014-04-03 08:20:32 -07:00
|
|
|
|
2014-03-23 23:19:06 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
|
|
|
|
#include "elm_priv.h"
|
2014-04-20 20:46:11 -07:00
|
|
|
|
2014-03-23 23:19:06 -07:00
|
|
|
|
|
|
|
EOLIAN static void
|
2014-04-20 20:46:11 -07:00
|
|
|
_elm_interface_atspi_component_position_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_Bool type, int *x, int *y)
|
2014-03-23 23:19:06 -07:00
|
|
|
{
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_atspi_component_extents_get(obj, type, x, y, NULL, NULL);
|
2014-03-23 23:19:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2014-04-20 20:46:11 -07:00
|
|
|
_elm_interface_atspi_component_position_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_Bool type, int x, int y)
|
2014-03-23 23:19:06 -07:00
|
|
|
{
|
|
|
|
Eina_Bool ret = EINA_FALSE;
|
|
|
|
int c_w, c_h;
|
|
|
|
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_atspi_component_extents_get(obj, type, NULL, NULL, &c_w, &c_h);
|
|
|
|
ret = elm_interface_atspi_component_extents_set(obj, type, x, y, c_w, c_h);
|
2014-04-20 20:46:11 -07:00
|
|
|
|
2014-03-23 23:19:06 -07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_interface_atspi_component_size_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int w, int h)
|
|
|
|
{
|
2014-05-28 01:12:34 -07:00
|
|
|
Eina_Bool ret;
|
2014-04-03 08:20:32 -07:00
|
|
|
int c_x = 0, c_y = 0;
|
2014-03-23 23:19:06 -07:00
|
|
|
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_atspi_component_extents_get(obj, EINA_FALSE, &c_x, &c_y, NULL, NULL);
|
|
|
|
ret = elm_interface_atspi_component_extents_set(obj, EINA_FALSE, c_x, c_y, w, h);
|
2014-03-23 23:19:06 -07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_elm_interface_atspi_component_size_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int *w, int *h)
|
|
|
|
{
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_atspi_component_extents_get(obj, EINA_FALSE, NULL, NULL, w, h);
|
2014-03-23 23:19:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2014-04-20 20:46:11 -07:00
|
|
|
_elm_interface_atspi_component_contains(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_Bool type, int x, int y)
|
2014-03-23 23:19:06 -07:00
|
|
|
{
|
2014-04-03 08:20:32 -07:00
|
|
|
int w_x = 0, w_y = 0, w_w = 0, w_h = 0;
|
2014-03-23 23:19:06 -07:00
|
|
|
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_atspi_component_extents_get(obj, type, &w_x, &w_y, &w_w, &w_h);
|
2014-03-23 23:19:06 -07:00
|
|
|
|
|
|
|
if ((x >= w_x) && (x <= w_x + w_w) && (y >= w_y) && (y <= w_y + w_h))
|
|
|
|
return EINA_TRUE;
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2014-04-20 20:46:11 -07:00
|
|
|
EOLIAN static double
|
|
|
|
_elm_interface_atspi_component_alpha_get(Eo *obj, void *_pd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
int alpha;
|
|
|
|
|
|
|
|
evas_object_color_get(obj, NULL, NULL, NULL, &alpha);
|
|
|
|
return (double)alpha / 255.0;
|
|
|
|
}
|
|
|
|
|
2015-05-12 06:23:21 -07:00
|
|
|
EOLIAN static Eo *
|
2014-04-20 20:46:11 -07:00
|
|
|
_elm_interface_atspi_component_accessible_at_point_get(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords, int x, int y)
|
|
|
|
{
|
2015-05-12 06:23:21 -07:00
|
|
|
Eina_List *l, *children;
|
|
|
|
Eo *ret = NULL, *child;
|
2014-04-20 20:46:11 -07:00
|
|
|
|
2016-03-02 04:10:48 -08:00
|
|
|
children = elm_interface_atspi_accessible_children_get(obj);
|
2015-05-12 06:23:21 -07:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(children, l, child)
|
2014-04-20 20:46:11 -07:00
|
|
|
{
|
2015-05-12 06:23:21 -07:00
|
|
|
Eina_Bool contains;
|
2016-08-15 06:44:41 -07:00
|
|
|
if (efl_isa(child, ELM_INTERFACE_ATSPI_COMPONENT_MIXIN))
|
2014-04-20 20:46:11 -07:00
|
|
|
{
|
2016-03-02 04:10:48 -08:00
|
|
|
contains = elm_interface_atspi_component_contains(child, screen_coords, x, y);
|
2015-05-12 06:23:21 -07:00
|
|
|
if (contains)
|
|
|
|
{
|
|
|
|
ret = child;
|
|
|
|
break;
|
|
|
|
}
|
2014-04-20 20:46:11 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-12 06:23:21 -07:00
|
|
|
|
|
|
|
eina_list_free(children);
|
2014-04-20 20:46:11 -07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_elm_interface_atspi_component_extents_get(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords, int *x, int *y, int *w, int *h)
|
|
|
|
{
|
|
|
|
int ee_x, ee_y;
|
|
|
|
|
|
|
|
evas_object_geometry_get(obj, x, y, w, h);
|
|
|
|
if (screen_coords)
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
|
|
|
|
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_interface_atspi_component_extents_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords, int x, int y, int w, int h)
|
|
|
|
{
|
|
|
|
int wx, wy;
|
|
|
|
|
|
|
|
if ((x < 0) || (y < 0) || (w < 0) || (h < 0)) return EINA_FALSE;
|
|
|
|
|
|
|
|
if (screen_coords)
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
|
|
|
|
if (!ee) return EINA_FALSE;
|
|
|
|
evas_object_geometry_get(obj, &wx, &wy, NULL, NULL);
|
|
|
|
ecore_evas_move(ee, x - wx, y - wy);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
evas_object_move(obj, x, y);
|
|
|
|
|
|
|
|
evas_object_resize(obj, w, h);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static int
|
|
|
|
_elm_interface_atspi_component_layer_get(Eo *obj, void *_pd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
return evas_object_layer_get(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static int
|
|
|
|
_elm_interface_atspi_component_z_order_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
// Currently not used.
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_interface_atspi_component_focus_grab(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
evas_object_focus_set(obj, EINA_TRUE);
|
|
|
|
return evas_object_focus_get(obj);
|
|
|
|
}
|
|
|
|
|
2014-03-23 23:19:06 -07:00
|
|
|
#include "elm_interface_atspi_component.eo.c"
|