this class is a giant FIXME for anyone looking to do refactoring work.
the only reason it seems to exist is to provide wrappers around
efl.gfx functions and provide screen position adjustments--something
which isn't even viable under wayland
note that a test was removed here due to the corresponding method being
removed
Change-Id: I6ee1c14c6a56945ff7f551af4e89705d216018ed
EOLIAN static void
-_efl_access_component_position_get(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED, Eina_Bool type, int *x, int *y)
+_efl_access_component_screen_position_get(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED, int *x, int *y)
{
Eina_Rect r;
- r = efl_access_component_extents_get(obj, type);
+ r = efl_access_component_extents_get(obj, EINA_TRUE);
if (x) *x = r.x;
if (y) *y = r.y;
}
EOLIAN static Eina_Bool
-_efl_access_component_position_set(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED, Eina_Bool type, int x, int y)
+_efl_access_component_screen_position_set(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED, int x, int y)
{
Eina_Rect r;
- r = efl_access_component_extents_get(obj, type);
+ r = efl_access_component_extents_get(obj, EINA_TRUE);
r.x = x;
r.y = y;
- return efl_access_component_extents_set(obj, type, r);
-}
-EOLIAN static Eina_Bool
-_efl_access_component_size_set(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED, int w, int h)
-{
- Eina_Rect r;
-
- r = efl_access_component_extents_get(obj, EINA_FALSE);
- r.w = w;
- r.h = h;
- return efl_access_component_extents_set(obj, EINA_FALSE, r);
-}
-
-EOLIAN static void
-_efl_access_component_size_get(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED, int *w, int *h)
-{
- Eina_Rect r;
-
- r = efl_access_component_extents_get(obj, EINA_FALSE);
- if (w) *w = r.w;
- if (h) *h = r.h;
+ return efl_access_component_extents_set(obj, EINA_TRUE, r);
}
EOLIAN static Eina_Bool
return eina_rectangle_coords_inside(&r.rect, x, y);
}
-EOLIAN static double
-_efl_access_component_alpha_get(Eo *obj, Efl_Access_Component_Data *_pd EINA_UNUSED)
-{
- int alpha;
-
- evas_object_color_get(obj, NULL, NULL, NULL, &alpha);
- return (double)alpha / 255.0;
-}
-
EOLIAN static Eo *
_efl_access_component_accessible_at_point_get(Eo *obj, Efl_Access_Component_Data *_pd EINA_UNUSED, Eina_Bool screen_coords, int x, int y)
{
}
EOLIAN static int
-_efl_access_component_layer_get(Eo *obj, Efl_Access_Component_Data *_pd EINA_UNUSED)
-{
- return evas_object_layer_get(obj);
-}
-
-EOLIAN static int
_efl_access_component_z_order_get(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED)
{
// Currently not used.
import eina_types;
-mixin Efl.Access.Component ()
+mixin Efl.Access.Component (Efl.Gfx, Efl.Gfx.Stack)
{
[[AT-SPI component mixin]]
data: Efl_Access_Component_Data;
methods {
- @property size @protected @beta {
- [[Size of accessible widget.]]
- set {
- return: bool; [[$true if size was set, $false otherwise]]
- }
- get {
- }
- values {
- w: int; [[Width of the widget]]
- h: int; [[Height of the widget]]
- }
- }
- @property layer @protected @beta {
- [[Evas layer of accessible widget.]]
- get {
- }
- values {
- layer: int; [[Evas layer of the widget]]
- }
- }
- @property alpha @protected @beta {
- [[Gets alpha of accessible widget.]]
- get {
- }
- values {
- alpha: double; [[Alpha value in [0, 1] range.]]
- }
- }
@property z_order @protected @beta {
[[Gets the depth at which the component is shown in relation to other
components in the same container.]]
rect: Eina.Rect; [[The geometry.]]
}
}
- @property position @protected @beta {
+ @property screen_position @protected @beta {
[[Position of accessible widget.]]
set {
return: bool; [[$true if position was set, $false otherwise]]
}
get {
}
- keys {
- screen_coords: bool; [[If $true x and y values will be relative to
- screen origin, otherwise relative to canvas]]
- }
values {
x: int; [[X coordinate]]
y: int; [[Y coordinate]]
return EINA_FALSE;
}
-EOLIAN static int
-_elm_widget_item_efl_access_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_efl_access_component_focus_grab(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *_pd EINA_UNUSED)
{
}
//
-EOLIAN static double
-_elm_widget_item_efl_access_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;
-}
-
EOLIAN static Efl_Object *
_efl_ui_widget_efl_object_provider_find(const Eo *obj, Elm_Widget_Smart_Data *pd, const Efl_Object *klass)
{
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
Eina_Bool type = coord_type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE;
- efl_access_component_position_get(obj, type, &x, &y);
+ if (efl_gfx_visible_get(obj))
+ {
+ if (type)
+ efl_access_component_screen_position_get(obj, &x, &y);
+ else
+ evas_object_geometry_get(obj, &x, &y, NULL, NULL);
+ }
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_COMPONENT_MIXIN, msg);
- efl_access_component_size_get(obj, &x, &y);
+ if (efl_gfx_visible_get(obj))
+ evas_object_geometry_get(obj, NULL, NULL, &x, &y);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
const char *obj_path = eldbus_message_path_get(msg);
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- int layer = 0;
+ int layer = -1;
Eldbus_Message *ret;
AtspiComponentLayer atspi_layer;
ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_COMPONENT_MIXIN, msg);
- layer = efl_access_component_layer_get(obj);
+ if (efl_gfx_visible_get(obj))
+ layer = evas_object_layer_get(obj);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
Eldbus_Message *ret;
- double alpha = 0;
+ double alpha = -1;
+ int a;
if (!obj)
return _dbus_invalid_ref_error_new(msg);
- alpha = efl_access_component_alpha_get(obj);
+ if (efl_gfx_visible_get(obj))
+ {
+ evas_object_color_get(obj, NULL, NULL, NULL, &a);
+ alpha = a / 255.0;
+ }
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
const char *obj_path = eldbus_message_path_get(msg);
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- int x, y;
+ int x = -1, y = -1;
Eina_Bool result = EINA_FALSE;
AtspiCoordType coord_type;
Eldbus_Message *ret;
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
Eina_Bool type = coord_type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE;
- result = efl_access_component_position_set(obj, type, x, y);
+ if (efl_gfx_visible_get(obj))
+ {
+ if (type)
+ result = efl_access_component_screen_position_set(obj, x, y);
+ else
+ {
+ result = EINA_TRUE;
+ evas_object_move(obj, x, y);
+ }
+ }
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
int w, h;
- Eina_Bool result;
+ Eina_Bool result = EINA_TRUE;
Eldbus_Message *ret;
ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_COMPONENT_MIXIN, msg);
if (!eldbus_message_arguments_get(msg, "ii", &w, &h))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
- result = efl_access_component_size_set(obj, w, h);
+ evas_object_resize(obj, w, h);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
Efl.Access.translation_domain { set; get;}
//
Efl.Access.Component.extents { get; set; }
- Efl.Access.Component.alpha { get; }
- Efl.Access.Component.layer { get; }
Efl.Access.Component.focus_grab;
//TIZEN_ONLY(20150709) : atspi relations api
Efl.Access.relation_set { get; }
}
END_TEST
-START_TEST (elm_atspi_component_position)
+START_TEST (elm_atspi_component_screen_position)
{
Eina_Bool ret;
int x, y;
Eo *win = elm_win_add(NULL, "win", ELM_WIN_BASIC);
- ret = efl_access_component_position_set(win, EINA_TRUE, 45, 45);
+ ret = efl_access_component_screen_position_set(win, 45, 45);
ck_assert(ret == EINA_TRUE);
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(win));
}
END_TEST
-START_TEST (elm_atspi_component_size)
-{
- Eina_Bool ret;
- int w, h;
-
- elm_init(0, NULL);
-
- Eo *win = elm_win_add(NULL, "win", ELM_WIN_BASIC);
- evas_object_resize(win, 50, 50);
-
- ret = efl_access_component_size_set(win, 100, 100);
- ck_assert(ret == EINA_TRUE);
-
- evas_object_geometry_get(win, NULL, NULL, &w, &h);
- ck_assert((w == 100) && (h == 100));
-
- elm_shutdown();
-}
-END_TEST
-
START_TEST (elm_win_autohide)
{
elm_init(0, NULL);
{
tcase_add_test(tc, elm_win_legacy_type_check);
tcase_add_test(tc, elm_atspi_role_get);
- tcase_add_test(tc, elm_atspi_component_position);
- tcase_add_test(tc, elm_atspi_component_size);
+ tcase_add_test(tc, elm_atspi_component_screen_position);
tcase_add_test(tc, elm_win_policy_quit_last_window_hidden);
tcase_add_test(tc, efl_ui_win_multi_touch_inputs);
#ifdef HAVE_ELEMENTARY_X