#include "elm_priv.h"
+//TIZEN_ONLY(20161114): make atspi proxy work for more than two sockets created in one process
+struct _Efl_Access_Component_Data
+{
+ Evas_Point socket_offset;
+};
+
+typedef struct _Efl_Access_Component_Data Efl_Access_Component_Data;
+//
+
EOLIAN static void
-_efl_access_component_position_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_Bool type, int *x, int *y)
+_efl_access_component_position_get(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED, Eina_Bool type, int *x, int *y)
{
Eina_Rect r;
}
EOLIAN static Eina_Bool
-_efl_access_component_position_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_Bool type, int x, int y)
+_efl_access_component_position_set(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED, Eina_Bool type, int x, int y)
{
Eina_Rect r;
}
EOLIAN static Eina_Bool
-_efl_access_component_size_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int w, int h)
+_efl_access_component_size_set(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED, int w, int h)
{
Eina_Rect r;
}
EOLIAN static void
-_efl_access_component_size_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int *w, int *h)
+_efl_access_component_size_get(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED, int *w, int *h)
{
Eina_Rect r;
}
EOLIAN static Eina_Bool
-_efl_access_component_contains(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_Bool type, int x, int y)
+_efl_access_component_contains(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED, Eina_Bool type, int x, int y)
{
Eina_Rect r;
}
EOLIAN static double
-_efl_access_component_alpha_get(Eo *obj, void *_pd EINA_UNUSED)
+_efl_access_component_alpha_get(Eo *obj, Efl_Access_Component_Data *_pd EINA_UNUSED)
{
int alpha;
}
EOLIAN static Eo *
-_efl_access_component_accessible_at_point_get(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords, int x, int y)
+_efl_access_component_accessible_at_point_get(Eo *obj, Efl_Access_Component_Data *_pd EINA_UNUSED, Eina_Bool screen_coords, int x, int y)
{
Eina_List *l, *children;
Eo *ret = NULL, *child;
}
EOLIAN static Eina_Rect
-_efl_access_component_extents_get(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords)
+_efl_access_component_extents_get(Eo *obj, Efl_Access_Component_Data *_pd EINA_UNUSED, Eina_Bool screen_coords)
{
Eina_Rect r;
}
EOLIAN static Eina_Bool
-_efl_access_component_extents_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords, Eina_Rect r)
+_efl_access_component_extents_set(Eo *obj, Efl_Access_Component_Data *_pd EINA_UNUSED, Eina_Bool screen_coords, Eina_Rect r)
{
int wx, wy;
}
EOLIAN static int
-_efl_access_component_layer_get(Eo *obj, void *_pd EINA_UNUSED)
+_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, void *_pd EINA_UNUSED)
+_efl_access_component_z_order_get(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED)
{
// Currently not used.
return 0;
}
EOLIAN static Eina_Bool
-_efl_access_component_focus_grab(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+_efl_access_component_focus_grab(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED)
{
evas_object_focus_set(obj, EINA_TRUE);
return evas_object_focus_get(obj);
//TIZEN_ONLY(20171108): bring HIGHLIGHT related changes
EOLIAN static Eina_Bool
-_efl_access_component_highlight_grab(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+_efl_access_component_highlight_grab(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED)
{
WRN("The %s object does not implement the \"component_highlight_grab\" function.",
efl_class_name_get(efl_class_get(obj)));
}
EOLIAN static Eina_Bool
-_efl_access_component_highlight_clear(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+_efl_access_component_highlight_clear(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd EINA_UNUSED)
{
WRN("The %s object does not implement the \"component_highlight_clear\" function.",
efl_class_name_get(efl_class_get(obj)));
}
//
+//TIZEN_ONLY(20161114): make atspi proxy work for more than two sockets created in one process
+EOLIAN static void
+_efl_access_component_socket_offset_set(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd, int x, int y)
+{
+ _pd->socket_offset.x = x;
+ _pd->socket_offset.y = y;
+}
+
+EOLIAN static void
+_efl_access_component_socket_offset_get(Eo *obj EINA_UNUSED, Efl_Access_Component_Data *_pd, int *x, int *y)
+{
+ *x = _pd->socket_offset.x;
+ *y = _pd->socket_offset.y;
+}
+//
+
#include "efl_access_component.eo.c"
_socket_offset_set(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
int x, y;
- Eo *bridge = _elm_atspi_bridge_get();
- ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN_VAL(bridge, pd, NULL);
+ Eo *parent;
+ Eo *obj = eldbus_service_object_data_get(iface, "_atspi_obj");
+ parent = efl_parent_get(obj);
+ Evas_Object *top = elm_object_top_widget_get(parent);
if (!eldbus_message_arguments_get(msg, "ii", &x, &y))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
- pd->socket_offset.x = x;
- pd->socket_offset.y = y;
+ efl_access_component_socket_offset_set(top, x, y);
return eldbus_message_method_return_new(msg);
}
if (!eldbus_message_arguments_get(msg, "iiu", &x, &y, &coord_type))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
+
// TIZEN_ONLY(20160705) - enable atspi_proxy to work
- x = x - pd->socket_offset.x;
- y = y - pd->socket_offset.y;
+ Evas_Object *top = elm_object_top_widget_get(obj);
+ int sx = 0;
+ int sy = 0;
+
+ efl_access_component_socket_offset_get(top, &sx, &sy);
+
+ x = x - sx;
+ y = y - sy;
//
+
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
};
static const Eldbus_Service_Interface_Desc _proxy_iface_desc = {
- ELM_ATSPI_DBUS_INTERFACE_PROXY, NULL, NULL, proxy_properties, NULL, NULL
+ ELM_ATSPI_DBUS_INTERFACE_PROXY, socket_methods, NULL, proxy_properties, NULL, NULL
};
static void _embedded_reply_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
efl_event_callback_call(proxy, ELM_ATSPI_PROXY_EVENT_DISCONNECTED, NULL);
}
-// TIZEN_ONLY(20160705) - enable atspi_proxy to work
-static void
-_offset_set_reply_cb(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
-{
- const char *err, *txt;
-
- if (eldbus_message_error_get(msg, &err, &txt))
- {
- ERR("AT-SPI: SetOffset method call failed: %s %s", err, txt);
- return;
- }
-}
-
-static void
-_plug_offset_set_send(Eldbus_Connection *conn, const char *bus, const char *path, int x, int y)
-{
- Eldbus_Message *msg = NULL;
-
- msg = eldbus_message_method_call_new(bus, path, ATSPI_DBUS_INTERFACE_SOCKET, "SetOffset");
- if (!msg) goto fail;
-
- if (!eldbus_message_arguments_append(msg, "i", x))
- goto fail;
-
- if (!eldbus_message_arguments_append(msg, "i", y))
- goto fail;
-
- if (!eldbus_connection_send(conn, msg, _offset_set_reply_cb, NULL, 100))
- goto fail;
-
- return;
-
-fail:
- ERR("AT-SPI: Unable to send SetOffset request.");
- if (msg) eldbus_message_unref(msg);
-}
-//
-
static void _socket_addr_get_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
Eo *proxy = data;
if (eldbus_message_error_get(msg, &err, &txt))
{
ERR("Unable to connect to socket: %s %s", err, txt);
- goto fail;
+ goto retry;
}
iter = eldbus_message_iter_get(msg);
fail:
efl_event_callback_call(proxy, ELM_ATSPI_PROXY_EVENT_DISCONNECTED, NULL);
+ return;
+
+retry:
+ elm_obj_atspi_proxy_address_get_retry_timer_add(proxy);
}
static void
//
// TIZEN_ONLY(20160705) - enable atspi_proxy to work
+static void
+_offset_set_reply_cb(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ const char *err, *txt;
+
+ if (eldbus_message_error_get(msg, &err, &txt))
+ {
+ ERR("AT-SPI: SetOffset method call failed: %s %s", err, txt);
+ return;
+ }
+}
+
+// TIZEN_ONLY(20160705) - enable atspi_proxy to work
void elm_atspi_bridge_utils_proxy_offset_set(Eo *proxy, int x, int y)
{
const char *bus, *path;
if (!pd->a11y_bus) return;
- elm_obj_atspi_proxy_address_get(proxy, &bus, &path);
- if (!bus || !path)
- {
- ERR("AT-SPI: Elm_Atspi_Proxy bus or path not set.");
- return;
- }
- _plug_offset_set_send(pd->a11y_bus, bus, path, x, y);
+ bus = efl_key_data_get(proxy, "__svc_bus");
+ path = efl_key_data_get(proxy, "__svc_path");
+
+ Eldbus_Message *msg = NULL;
+
+ msg = eldbus_message_method_call_new(bus, path, ELM_ATSPI_DBUS_INTERFACE_PROXY, "SetOffset");
+ if (!msg) goto fail;
+
+ if (!eldbus_message_arguments_append(msg, "i", x))
+ goto fail;
+
+ if (!eldbus_message_arguments_append(msg, "i", y))
+ goto fail;
+
+ if (!eldbus_connection_send(pd->a11y_bus, msg, _offset_set_reply_cb, NULL, 100))
+ goto fail;
+
+ return;
+
+fail:
+ ERR("AT-SPI: Unable to send SetOffset request.");
+ if (msg) eldbus_message_unref(msg);
}
//