aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2017-05-31 17:15:56 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2017-06-02 15:24:28 +0200
commit36e883e89461480f765fdd2f94e250d3ba94205e (patch)
tree08665bcbfaaec015dd5b930c5d24d06122d0b63c
parentelementary: add atspi plug & socket classes (diff)
downloadefl-devs/stanluk/refactor.tar.gz
elementary: add accessibility observer abstractiondevs/stanluk/refactor
Change-Id: Ie3307522b49e3c73e76644e21ae12850524bc1e8
-rw-r--r--src/Makefile_Elementary.am9
-rw-r--r--src/bin/elementary/test_win_plug.c2
-rw-r--r--src/bin/elementary/test_win_socket.c6
-rw-r--r--src/examples/elementary/a11y/efl-gtk-integration/plug/efl-socket.c1
-rw-r--r--src/lib/elementary/elm_atspi_app_object.c14
-rw-r--r--src/lib/elementary/elm_atspi_app_object.eo8
-rw-r--r--src/lib/elementary/elm_atspi_bridge.c104
-rw-r--r--src/lib/elementary/elm_atspi_bridge.eo3
-rw-r--r--src/lib/elementary/elm_atspi_plug.c33
-rw-r--r--src/lib/elementary/elm_atspi_plug.eo46
-rw-r--r--src/lib/elementary/elm_atspi_socket.c14
-rw-r--r--src/lib/elementary/elm_atspi_socket.eo25
-rw-r--r--src/lib/elementary/elm_interface_accessible_observer.c8
-rw-r--r--src/lib/elementary/elm_interface_accessible_observer.eo20
-rw-r--r--src/lib/elementary/elm_interface_accessible_observer.h8
-rw-r--r--src/lib/elementary/elm_interface_atspi_accessible.c43
-rw-r--r--src/lib/elementary/elm_interface_atspi_accessible.eo16
-rw-r--r--src/lib/elementary/elm_interface_atspi_socket.c69
-rw-r--r--src/lib/elementary/elm_interface_atspi_socket.eo69
-rw-r--r--src/lib/elementary/elm_interfaces.h3
20 files changed, 257 insertions, 244 deletions
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 4a28d376db..3f57be8b8e 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -2,9 +2,8 @@
### Library
elm_public_eolian_files = \
- lib/elementary/elm_atspi_bridge.eo \
- lib/elementary/elm_atspi_app_object.eo \
lib/elementary/elm_atspi_plug.eo \
+ lib/elementary/elm_atspi_app_object.eo \
lib/elementary/elm_atspi_proxy.eo \
lib/elementary/elm_atspi_socket.eo \
lib/elementary/elm_bg.eo \
@@ -37,7 +36,6 @@ elm_public_eolian_files = \
lib/elementary/elm_interface_atspi_text_editable.eo \
lib/elementary/elm_interface_atspi_image.eo \
lib/elementary/elm_interface_atspi_selection.eo \
- lib/elementary/elm_interface_atspi_socket.eo \
lib/elementary/elm_interface_atspi_text.eo \
lib/elementary/elm_interface_atspi_value.eo \
lib/elementary/elm_interface_atspi_widget_action.eo \
@@ -130,6 +128,8 @@ elm_public_eolian_files = \
# Private classes (not exposed or shipped)
elm_private_eolian_files = \
+ lib/elementary/elm_atspi_bridge.eo \
+ lib/elementary/elm_interface_accessible_observer.eo \
lib/elementary/efl_ui_internal_text_interactive.eo \
lib/elementary/efl_ui_win_internal_part.eo \
tests/elementary/focus_test.eo \
@@ -211,6 +211,7 @@ includesunstable_HEADERS = \
lib/elementary/elm_atspi_plug.h \
lib/elementary/elm_atspi_proxy.h \
lib/elementary/elm_atspi_socket.h \
+ lib/elementary/elm_interface_accessible_observer.h \
lib/elementary/elm_interface_atspi_accessible.h \
lib/elementary/elm_interface_atspi_text.h \
lib/elementary/elm_interface_atspi_widget_action.h \
@@ -607,13 +608,13 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/elm_icon.c \
lib/elementary/efl_ui_image.c \
lib/elementary/elm_index.c \
+ lib/elementary/elm_interface_accessible_observer.c \
lib/elementary/elm_interface_atspi_accessible.c \
lib/elementary/elm_interface_atspi_action.c \
lib/elementary/elm_interface_atspi_component.c \
lib/elementary/elm_interface_atspi_text_editable.c \
lib/elementary/elm_interface_atspi_image.c \
lib/elementary/elm_interface_atspi_selection.c \
- lib/elementary/elm_interface_atspi_socket.c \
lib/elementary/elm_interface_atspi_text.c \
lib/elementary/elm_interface_atspi_value.c \
lib/elementary/elm_interface_atspi_widget_action.c \
diff --git a/src/bin/elementary/test_win_plug.c b/src/bin/elementary/test_win_plug.c
index 8c53f9bbdb..ee6c6cf406 100644
--- a/src/bin/elementary/test_win_plug.c
+++ b/src/bin/elementary/test_win_plug.c
@@ -186,7 +186,7 @@ a11y_init(Evas_Object *plug)
elm_interface_atspi_accessible_parent_set(proxy, socket);
// FIXME asume bridge is connected
- elm_interface_atspi_socket_embed(socket, proxy);
+ elm_atspi_socket_embed(socket, proxy);
}
void
diff --git a/src/bin/elementary/test_win_socket.c b/src/bin/elementary/test_win_socket.c
index ef488b46a2..0879870695 100644
--- a/src/bin/elementary/test_win_socket.c
+++ b/src/bin/elementary/test_win_socket.c
@@ -146,7 +146,7 @@ static void
_on_plug_id_changed(void *data, const Efl_Event *event)
{
Elm_Atspi_Plug *plug = event->object;
- plugid = elm_interface_atspi_socket_id_get(plug);
+ plugid = elm_atspi_plug_id_get(plug);
// send id using elementary IPC mechanism
}
@@ -160,9 +160,9 @@ a11y_init(Evas_Object *socket_window)
elm_interface_atspi_accessible_parent_set(socket_window, plug);
// get address when bridge gets connected
- efl_event_callback_add(plug, ELM_INTERFACE_ATSPI_SOCKET_EVENT_ID_CHANGED, _on_plug_id_changed, NULL);
+ efl_event_callback_add(plug, ELM_OBJ_ATSPI_PLUG_EVENT_ID_CHANGED, _on_plug_id_changed, NULL);
- plugid = elm_interface_atspi_socket_id_get(plug);
+ plugid = elm_atspi_plug_id_get(plug);
}
void
diff --git a/src/examples/elementary/a11y/efl-gtk-integration/plug/efl-socket.c b/src/examples/elementary/a11y/efl-gtk-integration/plug/efl-socket.c
index 5cb521ec39..082faada6f 100644
--- a/src/examples/elementary/a11y/efl-gtk-integration/plug/efl-socket.c
+++ b/src/examples/elementary/a11y/efl-gtk-integration/plug/efl-socket.c
@@ -24,6 +24,7 @@ static void a11y_init(void)
// fires accessible parent should be set to eo_parent (???)
elm_interface_atspi_accessible_parent_set(state.socket, state.container);
// following line shuold be not necessary:
+
elm_interface_atspi_accessible_parent_set(state.proxy, state.socket);
// FIXME order matters = should be fixed!!!
diff --git a/src/lib/elementary/elm_atspi_app_object.c b/src/lib/elementary/elm_atspi_app_object.c
index a64ac43d81..f957e629a1 100644
--- a/src/lib/elementary/elm_atspi_app_object.c
+++ b/src/lib/elementary/elm_atspi_app_object.c
@@ -65,21 +65,21 @@ _elm_atspi_app_object_elm_interface_atspi_accessible_role_get(Eo *obj EINA_UNUSE
}
EOLIAN static void
-_elm_atspi_app_object_elm_interface_atspi_socket_on_connected(Eo *obj, Elm_Atspi_App_Object_Data *_pd)
+_elm_atspi_app_object_elm_atspi_plug_on_connected(Eo *obj, Elm_Atspi_App_Object_Data *_pd)
{
- ERR("On Connected: %s", elm_interface_atspi_socket_id_get(obj));
- elm_interface_atspi_socket_embed_by(obj, _pd->desktop_proxy);
+ ERR("On Connected: %s", elm_atspi_plug_id_get(obj));
+ elm_atspi_plug_embed_by(obj, _pd->desktop_proxy);
}
EOLIAN static void
-_elm_atspi_app_object_elm_interface_atspi_socket_on_disconnected(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED)
+_elm_atspi_app_object_elm_atspi_plug_on_disconnected(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED)
{
- ERR("On Disconnected: %s", elm_interface_atspi_socket_id_get(obj));
- elm_interface_atspi_socket_unembed_by(obj, _pd->desktop_proxy);
+ ERR("On Disconnected: %s", elm_atspi_plug_id_get(obj));
+ elm_atspi_plug_unembed_by(obj, _pd->desktop_proxy);
}
EOLIAN static void
-_elm_atspi_app_object_elm_interface_atspi_socket_on_embedded(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED, Elm_Atspi_Proxy *proxy EINA_UNUSED)
+_elm_atspi_app_object_elm_atspi_plug_on_embedded(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED, Elm_Atspi_Proxy *proxy EINA_UNUSED)
{
ERR("Application successfully registered as desktop child");
}
diff --git a/src/lib/elementary/elm_atspi_app_object.eo b/src/lib/elementary/elm_atspi_app_object.eo
index a48697dae3..08f6c3a953 100644
--- a/src/lib/elementary/elm_atspi_app_object.eo
+++ b/src/lib/elementary/elm_atspi_app_object.eo
@@ -1,3 +1,5 @@
+import elm_general;
+
class Elm.Atspi.App.Object (Elm.Atspi.Plug, Elm.Interface.Atspi_Accessible)
{
[[AT-SPI application object class]]
@@ -10,8 +12,8 @@ class Elm.Atspi.App.Object (Elm.Atspi.Plug, Elm.Interface.Atspi_Accessible)
Elm.Interface.Atspi_Accessible.description { get; set; }
Elm.Interface.Atspi_Accessible.role { get; }
Elm.Interface.Atspi_Accessible.index_in_parent { get; }
- Elm.Interface.Atspi.Socket.on_embedded;
- Elm.Interface.Atspi.Socket.on_connected;
- Elm.Interface.Atspi.Socket.on_disconnected;
+ Elm.Atspi.Plug.on_embedded;
+ Elm.Atspi.Plug.on_connected;
+ Elm.Atspi.Plug.on_disconnected;
}
}
diff --git a/src/lib/elementary/elm_atspi_bridge.c b/src/lib/elementary/elm_atspi_bridge.c
index ff89370761..afddd74f0e 100644
--- a/src/lib/elementary/elm_atspi_bridge.c
+++ b/src/lib/elementary/elm_atspi_bridge.c
@@ -155,8 +155,8 @@ static void _elm_atspi_bridge_pending_add(Elm_Atspi_Bridge *obj, Eldbus_Pending
static void _elm_atspi_bridge_pending_del(Elm_Atspi_Bridge *obj, Eldbus_Pending *pending);
static void _elm_atspi_bridge_pending_cancel_all(Elm_Atspi_Bridge *obj);
-static void _elm_atspi_bridge_socket_hooks_uninstall(Elm_Interface_Atspi_Socket *socket);
-static void _elm_atspi_bridge_socket_hooks_install(Elm_Interface_Atspi_Socket *socket);
+static void _elm_atspi_bridge_plug_hooks_uninstall(Eo *socket);
+static void _elm_atspi_bridge_plug_hooks_install(Eo *socket);
// utility functions
static void _iter_interfaces_append(Eldbus_Message_Iter *iter, const Eo *obj);
@@ -1041,9 +1041,9 @@ _socket_embedded(const Eldbus_Service_Interface *iface, const Eldbus_Message *ms
Eo *obj = _bridge_object_from_path(bridge, obj_path);
ERR("Recieved embedded request");
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, ELM_INTERFACE_ATSPI_SOCKET_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, ELM_ATSPI_PLUG_CLASS, msg);
- elm_interface_atspi_socket_on_embedded(obj, NULL);
+ elm_atspi_plug_on_embedded(obj, NULL);
return eldbus_message_method_return_new(msg);
}
@@ -3648,9 +3648,9 @@ _on_elm_atspi_bridge_plug_register(void *data, const Eldbus_Message *msg, Eldbus
Eo *proxy = eldbus_pending_data_get(pending, "__proxy");
// check if object is still in cache, since it may be unregistered
- // before dbus request complete
+ // before dbus request completes
if (eina_hash_find(pd->cache, &obj))
- elm_interface_atspi_socket_on_embedded(obj, proxy);
+ elm_atspi_plug_on_embedded(obj, proxy);
}
EAPI void
@@ -3661,8 +3661,10 @@ _elm_atspi_bridge_plugs_register(Eo *bridge)
Eina_List *l;
Elm_Atspi_Plug *plug;
+
EINA_LIST_FOREACH(pd->plugs, l, plug)
{
+ ERR("Plug register %d", plug);
_bridge_object_register(bridge, plug);
}
}
@@ -4212,11 +4214,11 @@ _elm_atspi_bridge_on_object_unregistered(Elm_Atspi_Bridge *bridge, Eo *obj)
efl_event_callback_array_del(obj, event_handlers(), bridge);
_bridge_object_removed_signal_send(bridge, obj);
- if (efl_isa(obj, ELM_INTERFACE_ATSPI_SOCKET_MIXIN))
+ if (efl_isa(obj, ELM_ATSPI_PLUG_CLASS))
{
- elm_interface_atspi_socket_on_disconnected(obj);
- elm_interface_atspi_socket_id_set(obj, NULL);
- _elm_atspi_bridge_socket_hooks_uninstall(obj);
+ elm_atspi_plug_on_disconnected(obj);
+ elm_atspi_plug_id_set(obj, NULL);
+ _elm_atspi_bridge_plug_hooks_uninstall(obj);
}
}
@@ -4224,21 +4226,26 @@ static void
_elm_atspi_bridge_on_object_registered(Elm_Atspi_Bridge *bridge, Eo *obj)
{
struct dbus_address addr;
+
+ ERR("On object_registererd: %s", efl_class_name_get(obj));
if (!efl_isa(obj, ELM_ATSPI_PROXY_CLASS))
{
_bridge_object_added_signal_send(bridge, obj);
efl_event_callback_array_add(obj, event_handlers(), bridge);
}
-
- if (efl_isa(obj, ELM_INTERFACE_ATSPI_SOCKET_MIXIN))
+ if (efl_isa(obj, ELM_ATSPI_PLUG_CLASS))
{
- _elm_atspi_bridge_socket_hooks_install(obj);
+ ERR("pre hook install: %d", obj);
+ _elm_atspi_bridge_plug_hooks_install(obj);
addr = _elm_atspi_bridge_address_from_object(bridge, obj);
char *id = _elm_atspi_bridge_id_make(&addr);
- elm_interface_atspi_socket_id_set(obj, id);
- elm_interface_atspi_socket_on_connected(obj);
+ elm_atspi_plug_id_set(obj, id);
+ elm_atspi_plug_on_connected(obj);
free(id);
}
+ if (efl_isa(obj, ELM_ATSPI_SOCKET_CLASS))
+ {
+ }
}
static void
@@ -4485,10 +4492,9 @@ _elm_atspi_bridge_init(void)
if (!_instance)
{
_instance = efl_add(ELM_ATSPI_BRIDGE_CLASS, NULL);
+ elm_interface_atspi_accessible_observer_install(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, _instance);
Efl_Object *root = elm_interface_atspi_accessible_root_get(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN);
- elm_atspi_bridge_plug_register(_instance, root);
elm_atspi_bridge_root_set(_instance, root);
- elm_interface_atspi_accessible_observer_install(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN);
}
}
@@ -4503,7 +4509,7 @@ _elm_atspi_bridge_shutdown(void)
{
if (_instance)
{
- elm_interface_atspi_accessible_observer_uninstall(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN);
+ elm_interface_atspi_accessible_observer_uninstall(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, _instance);
efl_del(_instance);
_instance = NULL;
}
@@ -4847,22 +4853,23 @@ _elm_atspi_bridge_elm_interface_atspi_socket_unembed_by(Eo *obj, void *data, Elm
}
static void
-_elm_atspi_bridge_socket_hooks_uninstall(Elm_Interface_Atspi_Socket *socket)
+_elm_atspi_bridge_plug_hooks_uninstall(Eo *socket)
{
efl_object_override(socket, NULL);
}
static void
-_elm_atspi_bridge_socket_hooks_install(Elm_Interface_Atspi_Socket *socket)
+_elm_atspi_bridge_plug_hooks_install(Eo *plug)
{
- ERR("Install hooks for %s", efl_class_name_get(socket));
+ ERR("Install hooks for (%d), %s", plug, efl_class_name_get(plug));
EFL_OPS_DEFINE(_elm_atspi_bridge_hooks,
- EFL_OBJECT_OP_FUNC(elm_interface_atspi_socket_embed, _elm_atspi_bridge_elm_interface_atspi_socket_embed),
- EFL_OBJECT_OP_FUNC(elm_interface_atspi_socket_unembed, _elm_atspi_bridge_elm_interface_atspi_socket_unembed),
- EFL_OBJECT_OP_FUNC(elm_interface_atspi_socket_embed_by, _elm_atspi_bridge_elm_interface_atspi_socket_embed_by),
- EFL_OBJECT_OP_FUNC(elm_interface_atspi_socket_unembed_by, _elm_atspi_bridge_elm_interface_atspi_socket_unembed_by));
+ //EFL_OBJECT_OP_FUNC(elm_atspi_socket_embed, _elm_atspi_bridge_elm_interface_atspi_socket_embed),
+ //EFL_OBJECT_OP_FUNC(elm_atspi_socket_unembed, _elm_atspi_bridge_elm_interface_atspi_socket_unembed),
+ EFL_OBJECT_OP_FUNC(elm_atspi_plug_embed_by, _elm_atspi_bridge_elm_interface_atspi_socket_embed_by),
+ EFL_OBJECT_OP_FUNC(elm_atspi_plug_unembed_by, _elm_atspi_bridge_elm_interface_atspi_socket_unembed_by));
- efl_object_override(socket, &_elm_atspi_bridge_hooks);
+ efl_object_override(plug, &_elm_atspi_bridge_hooks);
+ ERR("Install hooks end");
}
EOLIAN Efl_Object*
@@ -5065,6 +5072,7 @@ _elm_atspi_bridge_plug_register(Eo *obj, Elm_Atspi_Bridge_Data *pd, Elm_Atspi_Pl
if (!eina_list_data_find(pd->plugs, plug))
{
+ ERR("Is connected: %d", pd->connected);
if (pd->connected)
_bridge_object_register(obj, plug);
efl_event_callback_add(plug, EFL_EVENT_DEL, _elm_atspi_bridge_plug_del, obj);
@@ -5087,44 +5095,46 @@ _elm_atspi_bridge_plug_unregister(Eo *obj, Elm_Atspi_Bridge_Data *pd, Elm_Atspi_
}
}
+EOLIAN void
+_elm_atspi_bridge_elm_interface_accessible_observer_on_created(Eo *obj, Elm_Atspi_Bridge_Data *pd, Elm_Interface_Atspi_Accessible *accessible)
+{
+ if (efl_isa(accessible, ELM_ATSPI_PLUG_CLASS)) {
+ ERR("added plug %d", accessible);
+ elm_atspi_bridge_plug_register(obj, accessible);
+ }
+}
+
static Eina_Bool
_elm_atspi_bridge_id_parse(const char *id, struct dbus_address *addr)
{
- int written;
- Eina_Bool ret = EINA_FALSE;
+ size_t source_len;
+ char *split;
+ int to_write;
if (!addr || !id)
return EINA_FALSE;
- char *copy = strdup(id);
- if (!copy)
- return EINA_FALSE;
-
- char *split = strrchr(copy, ':');
+ split = strrchr(id, ':');
if (!split)
- goto exit;
-
- *split = '\0';
+ return EINA_FALSE;
- written = snprintf(addr->bus, sizeof(addr->bus), "%s", copy);
- if ((written < 0) || (written >= (int)sizeof(addr->bus)))
- goto exit;
+ to_write = split - id + 1;
+ if (to_write > (int)sizeof(addr->bus))
+ return EINA_FALSE;
- written = snprintf(addr->path, sizeof(addr->path), "%s", split + 1);
- if ((written < 0) || (written >= (int)sizeof(addr->path)))
- goto exit;
+ eina_strlcpy(addr->bus, id, to_write);
- ret = EINA_TRUE;
+ source_len = eina_strlcpy(addr->path, split + 1, sizeof(addr->path));
+ if (source_len >= (int)sizeof(addr->path))
+ return EINA_FALSE;
-exit:
- free(copy);
- return ret;
+ return EINA_TRUE;
}
static char*
_elm_atspi_bridge_id_make(const struct dbus_address *address)
{
- char buf[256];
+ char buf[512];
int written = snprintf(buf, sizeof(buf), "%s:%s", address->bus, address->path);
if ((written < 0) || (written >= (int)sizeof(buf)))
diff --git a/src/lib/elementary/elm_atspi_bridge.eo b/src/lib/elementary/elm_atspi_bridge.eo
index a1fb6a1bfa..6256b3b44e 100644
--- a/src/lib/elementary/elm_atspi_bridge.eo
+++ b/src/lib/elementary/elm_atspi_bridge.eo
@@ -1,4 +1,4 @@
-class Elm.Atspi.Bridge (Efl.Object)
+class Elm.Atspi.Bridge (Efl.Object, Elm.Interface.Accessible_Observer)
{
[[AT-SPI bridge class]]
legacy_prefix: elm_atspi_bridge;
@@ -37,6 +37,7 @@ class Elm.Atspi.Bridge (Efl.Object)
implements {
Efl.Object.constructor;
Efl.Object.destructor;
+ Elm.Interface.Accessible_Observer.on_created;
}
events {
connected; [[Connected with AT-SPI2 bus]]
diff --git a/src/lib/elementary/elm_atspi_plug.c b/src/lib/elementary/elm_atspi_plug.c
index dbcd83339f..5cf2e3a23e 100644
--- a/src/lib/elementary/elm_atspi_plug.c
+++ b/src/lib/elementary/elm_atspi_plug.c
@@ -8,18 +8,13 @@
typedef struct _Elm_Atspi_Plug_Data {
- Elm_Atspi_Proxy *proxy_parent; // technical object for keep bridge coherent
+ const char *id;
} Elm_Atspi_Plug_Data;
EOLIAN Eo*
_elm_atspi_plug_efl_object_constructor(Eo *obj, Elm_Atspi_Plug_Data *pd)
{
efl_constructor(efl_super(obj, ELM_ATSPI_PLUG_CLASS));
-
- Elm_Atspi_Bridge *bridge = _elm_atspi_bridge_get();
- if (bridge)
- elm_atspi_bridge_plug_register(bridge, obj);
-
elm_interface_atspi_accessible_role_set(obj, ELM_ATSPI_ROLE_FRAME);
return obj;
}
@@ -30,16 +25,34 @@ _elm_atspi_plug_efl_object_destructor(Eo *obj EINA_UNUSED, Elm_Atspi_Plug_Data *
efl_destructor(efl_super(obj, ELM_ATSPI_PLUG_CLASS));
}
+EOLIAN const char*
+_elm_atspi_plug_id_get(Eo *plug EINA_UNUSED, Elm_Atspi_Plug_Data *pd)
+{
+ return pd->id;
+}
+
+EOLIAN void
+_elm_atspi_plug_id_set(Eo *plug, Elm_Atspi_Plug_Data *pd, const char *new_id)
+{
+ const char *id = eina_stringshare_add(new_id);
+ if (pd->id != id)
+ {
+ eina_stringshare_del(pd->id);
+ pd->id = id;
+ efl_event_callback_call(socket, ELM_OBJ_ATSPI_PLUG_EVENT_ID_CHANGED, NULL);
+ }
+ else
+ eina_stringshare_del(id);
+}
+
EOLIAN void
-_elm_atspi_plug_elm_interface_atspi_socket_on_embedded(Eo *obj EINA_UNUSED, Elm_Atspi_Plug_Data *pd, Elm_Atspi_Proxy *proxy)
+_elm_atspi_plug_on_connected(Eo *socket, Elm_Atspi_Plug_Data *pd EINA_UNUSED)
{
- ERR("On embedded");
}
EOLIAN void
-_elm_atspi_plug_elm_interface_atspi_socket_on_unembedded(Eo *obj EINA_UNUSED, Elm_Atspi_Plug_Data *pd, Elm_Atspi_Proxy *proxy)
+_elm_atspi_plug_on_disconnected(Eo *socket, Elm_Atspi_Plug_Data *pd EINA_UNUSED)
{
- ERR("On unembedded");
}
#include "elm_atspi_plug.eo.c"
diff --git a/src/lib/elementary/elm_atspi_plug.eo b/src/lib/elementary/elm_atspi_plug.eo
index e7c133f847..2f8d328ad7 100644
--- a/src/lib/elementary/elm_atspi_plug.eo
+++ b/src/lib/elementary/elm_atspi_plug.eo
@@ -1,13 +1,51 @@
-class Elm.Atspi.Plug (Efl.Object, Elm.Interface.Atspi_Accessible,
- Elm.Interface.Atspi.Socket)
+class Elm.Atspi.Plug (Efl.Object, Elm.Interface.Atspi_Accessible)
{
[[AT-SPI Plug class.]]
legacy_prefix: elm_atspi_plug;
eo_prefix: elm_obj_atspi_plug;
+ methods {
+ @property id {
+ get {
+ } set {
+ }
+ values {
+ ret: string;
+ }
+ }
+ embed_by {
+ [[ Embed accessible object as a child of remote object.]]
+ params {
+ @in proxy: Elm.Atspi.Proxy;
+ }
+ }
+ unembed_by {
+ // unembed
+ params {
+ @in proxy: Elm.Atspi.Proxy;
+ }
+ }
+ on_embedded {
+ params {
+ @in proxy: Elm.Atspi.Proxy;
+ }
+ }
+ on_unembedded {
+ params {
+ @in proxy: Elm.Atspi.Proxy;
+ }
+ }
+ on_connected {
+ }
+ on_disconnected {
+ }
+ }
implements {
Efl.Object.destructor;
Efl.Object.constructor;
- Elm.Interface.Atspi.Socket.on_embedded;
- Elm.Interface.Atspi.Socket.on_unembedded;
+ }
+ events {
+ embedded;
+ unembedded;
+ id,changed;
}
}
diff --git a/src/lib/elementary/elm_atspi_socket.c b/src/lib/elementary/elm_atspi_socket.c
index c925d1d6cb..232987cbec 100644
--- a/src/lib/elementary/elm_atspi_socket.c
+++ b/src/lib/elementary/elm_atspi_socket.c
@@ -6,6 +6,7 @@
#include <elm_priv.h>
typedef struct _Elm_Atspi_Socket_Data {
+ Eina_Bool occupied : 1;
} Elm_Atspi_Socket_Data;
EOLIAN void
@@ -22,4 +23,17 @@ _elm_atspi_socket_efl_object_constructor(Eo *obj, Elm_Atspi_Socket_Data *pd EINA
return obj;
}
+
+EOLIAN Eina_Bool
+_elm_atspi_socket_occupied_get(Eo *plug EINA_UNUSED, Elm_Atspi_Socket_Data *pd)
+{
+ return pd->occupied;
+}
+
+EOLIAN void
+_elm_atspi_socket_occupied_set(Eo *plug EINA_UNUSED, Elm_Atspi_Socket_Data *pd, Eina_Bool val)
+{
+ pd->occupied = val;
+}
+
#include "elm_atspi_socket.eo.c"
diff --git a/src/lib/elementary/elm_atspi_socket.eo b/src/lib/elementary/elm_atspi_socket.eo
index 12ccab0a72..68a02e29d5 100644
--- a/src/lib/elementary/elm_atspi_socket.eo
+++ b/src/lib/elementary/elm_atspi_socket.eo
@@ -1,8 +1,31 @@
-class Elm.Atspi.Socket (Efl.Object, Elm.Interface.Atspi_Accessible, Elm.Interface.Atspi.Socket)
+class Elm.Atspi.Socket (Efl.Object, Elm.Interface.Atspi_Accessible)
{
[[AT-SPI Socket class]]
legacy_prefix: elm_atspi_socket;
eo_prefix: elm_obj_atspi_socket;
+ methods {
+ @property occupied {
+ get {
+ }
+ set {
+ }
+ values {
+ ret: bool;
+ }
+ }
+ embed @pure_virtual {
+ [[ Embed remote accessible object as a child.]]
+ params {
+ @in proxy: Elm.Atspi.Proxy;
+ }
+ }
+ unembed @pure_virtual {
+ // unembed
+ params {
+ @in proxy: Elm.Atspi.Proxy;
+ }
+ }
+ }
implements {
Efl.Object.constructor;
Efl.Object.destructor;
diff --git a/src/lib/elementary/elm_interface_accessible_observer.c b/src/lib/elementary/elm_interface_accessible_observer.c
new file mode 100644
index 0000000000..a3da4a9aae
--- /dev/null
+++ b/src/lib/elementary/elm_interface_accessible_observer.c
@@ -0,0 +1,8 @@
+#ifdef HAVE_CONFIG_H
+ #include "elementary_config.h"
+#endif
+
+#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
+#include <Elementary.h>
+
+#include "elm_interface_accessible_observer.eo.c"
diff --git a/src/lib/elementary/elm_interface_accessible_observer.eo b/src/lib/elementary/elm_interface_accessible_observer.eo
new file mode 100644
index 0000000000..0075a96423
--- /dev/null
+++ b/src/lib/elementary/elm_interface_accessible_observer.eo
@@ -0,0 +1,20 @@
+import elm_general;
+
+interface Elm.Interface.Accessible_Observer ()
+{
+ methods {
+ @property root {
+ set {
+ }
+ values {
+ new_root: Efl.Object;
+ }
+ }
+ on_created {
+ params {
+ @in object: Efl.Object;
+ }
+ }
+ }
+}
+
diff --git a/src/lib/elementary/elm_interface_accessible_observer.h b/src/lib/elementary/elm_interface_accessible_observer.h
new file mode 100644
index 0000000000..3a3e0144b8
--- /dev/null
+++ b/src/lib/elementary/elm_interface_accessible_observer.h
@@ -0,0 +1,8 @@
+#ifndef ELM_INTERFACE_ACCESSIBLE_OBSERVER_H
+#define ELM_INTERFACE_ACCESSIBLE_OBSERVER_H
+
+#ifdef EFL_EO_API_SUPPORT
+#include "elm_interface_accessible_observer.eo.h"
+#endif
+
+#endif
diff --git a/src/lib/elementary/elm_interface_atspi_accessible.c b/src/lib/elementary/elm_interface_atspi_accessible.c
index 5537b1e19a..da27c07795 100644
--- a/src/lib/elementary/elm_interface_atspi_accessible.c
+++ b/src/lib/elementary/elm_interface_atspi_accessible.c
@@ -131,16 +131,11 @@ struct _Elm_Interface_Atspi_Accessible_Data
typedef struct _Elm_Interface_Atspi_Accessible_Data Elm_Interface_Atspi_Accessible_Data;
-struct Accessibility_Plugin
-{
- void *plugin_private_data;
-};
-
-static void _elm_interface_atspi_accessible_observers_notify(Eo *object);
+static void _elm_interface_atspi_accessible_observers_notify_created(Eo *object);
static Eo *root;
-static Eina_List *plugins;
+static Eina_List *observers;
EOLIAN static int
_elm_interface_atspi_accessible_index_in_parent_get(Eo *obj, Elm_Interface_Atspi_Accessible_Data *pd EINA_UNUSED)
@@ -515,6 +510,11 @@ _elm_interface_atspi_accessible_root_get(Eo *class EINA_UNUSED, void *pd EINA_UN
}
EOLIAN void
+_elm_interface_atspi_accessible_root_set(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Eo *root)
+{
+}
+
+EOLIAN void
_elm_interface_atspi_accessible_efl_object_destructor(Eo *obj, Elm_Interface_Atspi_Accessible_Data *pd)
{
efl_destructor(efl_super(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN));
@@ -534,33 +534,36 @@ EOLIAN Eo *
_elm_interface_atspi_accessible_efl_object_constructor(Eo *obj, Elm_Interface_Atspi_Accessible_Data *pd)
{
pd->self = obj;
- _elm_interface_atspi_accessible_observers_notify(obj);
+ _elm_interface_atspi_accessible_observers_notify_created(obj);
return efl_constructor(efl_super(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN));
}
-static void
-_elm_interface_atspi_accessible_observers_notify(Eo *object)
+static void _elm_interface_atspi_accessible_observers_notify_created(Eo *object)
{
- if (observers)
+ Eina_List *l;
+ Elm_Interface_Accessible_Observer *observer;
+
+ EINA_LIST_FOREACH(observers, l , observer)
{
- ERR("Query observer");
+ elm_interface_accessible_observer_on_created(observer, object);
}
}
EOLIAN void
-_elm_interface_atspi_accessible_observer_install(Eo *socket_class, void *data)
+_elm_interface_atspi_accessible_observer_install(Eo *socket_class, void *data,
+ Elm_Interface_Accessible_Observer *observer)
{
- ERR("Observer installed");
- observers = 0x1;
- if (!observers)
- observers = eina_array_new(1);
+ if (efl_isa(observer, ELM_INTERFACE_ACCESSIBLE_OBSERVER_INTERFACE))
+ observers = eina_list_append(observers, observer);
+ else
+ ERR("Incorrct type: (%s) do not implement %s",
+ efl_class_name_get(observer), efl_class_name_get(ELM_INTERFACE_ACCESSIBLE_OBSERVER_INTERFACE));
}
EOLIAN void
-_elm_interface_atspi_accessible_observer_uninstall(Eo *socket_class, void *data)
+_elm_interface_atspi_accessible_observer_uninstall(Eo *socket_class, void *data, Elm_Interface_Accessible_Observer *observer)
{
- ERR("Observer uninstalled");
- observers = NULL;
+ observers = eina_list_remove(observers, observer);
}
#include "elm_interface_atspi_accessible.eo.c"
diff --git a/src/lib/elementary/elm_interface_atspi_accessible.eo b/src/lib/elementary/elm_interface_atspi_accessible.eo
index 1999d59910..e1cf1186ff 100644
--- a/src/lib/elementary/elm_interface_atspi_accessible.eo
+++ b/src/lib/elementary/elm_interface_atspi_accessible.eo
@@ -384,12 +384,22 @@ mixin Elm.Interface.Atspi_Accessible (Efl.Interface, Efl.Object)
@property root @class {
get {
[[Get's default root object of accessible object hierarchy]]
- values {
- ret: Efl.Object; [[Root object]]
- }
}
set {
}
+ values {
+ ret: Efl.Object; [[Root object]]
+ }
+ }
+ observer_install @class {
+ params {
+ @in observer: Elm.Interface.Accessible_Observer;
+ }
+ }
+ observer_uninstall @class {
+ params {
+ @in observer: Elm.Interface.Accessible_Observer;
+ }
}
}
implements {
diff --git a/src/lib/elementary/elm_interface_atspi_socket.c b/src/lib/elementary/elm_interface_atspi_socket.c
deleted file mode 100644
index 0753306beb..0000000000
--- a/src/lib/elementary/elm_interface_atspi_socket.c
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifdef HAVE_CONFIG_H
- #include "elementary_config.h"
-#endif
-
-#include <Elementary.h>
-#include "elm_widget.h"
-#include "elm_priv.h"
-
-typedef struct _Elm_Inteface_Atspi_Socket_Data
-{
- const char *id;
- Eina_Bool occupied : 1;
-} Elm_Interface_Atspi_Socket_Data;
-
-EOLIAN const char*
-_elm_interface_atspi_socket_id_get(Eo *socket EINA_UNUSED, Elm_Interface_Atspi_Socket_Data *pd)
-{
- return pd->id;
-}
-
-EOLIAN void
-_elm_interface_atspi_socket_id_set(Eo *socket, Elm_Interface_Atspi_Socket_Data *pd, const char *new_id)
-{
- const char *id = eina_stringshare_add(new_id);
- if (pd->id != id)
- {
- eina_stringshare_del(pd->id);
- pd->id = id;
- efl_event_callback_call(socket, ELM_INTERFACE_ATSPI_SOCKET_EVENT_ID_CHANGED, NULL);
- }
- else
- eina_stringshare_del(id);
-}
-
-EOLIAN Eina_Bool
-_elm_interface_atspi_socket_occupied_get(Eo *socket EINA_UNUSED, Elm_Interface_Atspi_Socket_Data *pd)
-{
- return pd->occupied;
-}
-
-EOLIAN void
-_elm_interface_atspi_socket_occupied_set(Eo *socket EINA_UNUSED, Elm_Interface_Atspi_Socket_Data *pd, Eina_Bool val)
-{
- pd->occupied = val;
-}
-
-EOLIAN void
-_elm_interface_atspi_socket_on_embedded(Eo *socket, Elm_Interface_Atspi_Socket_Data *pd EINA_UNUSED, Elm_Atspi_Proxy *proxy)
-{
- efl_event_callback_call(socket, ELM_INTERFACE_ATSPI_SOCKET_EVENT_EMBEDDED, proxy);
-}
-
-EOLIAN void
-_elm_interface_atspi_socket_on_unembedded(Eo *socket, Elm_Interface_Atspi_Socket_Data *pd EINA_UNUSED, Elm_Atspi_Proxy *proxy)
-{
- efl_event_callback_call(socket, ELM_INTERFACE_ATSPI_SOCKET_EVENT_UNEMBEDDED, proxy);
-}
-
-EOLIAN void
-_elm_interface_atspi_socket_on_connected(Eo *socket, Elm_Interface_Atspi_Socket_Data *pd EINA_UNUSED)
-{
-}
-
-EOLIAN void
-_elm_interface_atspi_socket_on_disconnected(Eo *socket, Elm_Interface_Atspi_Socket_Data *pd EINA_UNUSED)
-{
-}
-
-#include "elm_interface_atspi_socket.eo.c"
diff --git a/src/lib/elementary/elm_interface_atspi_socket.eo b/src/lib/elementary/elm_interface_atspi_socket.eo
deleted file mode 100644
index 7efbfa4681..0000000000
--- a/src/lib/elementary/elm_interface_atspi_socket.eo
+++ /dev/null
@@ -1,69 +0,0 @@
-import elm_general;
-
-mixin Elm.Interface.Atspi.Socket(Efl.Interface, Efl.Object)
-{
- [[Elementary AT-SPI socket interface]]
- eo_prefix: elm_interface_atspi_socket;
- methods {
- @property id {
- get {
- } set {
- }
- values {
- ret: string;
- }
- }
- @property occupied {
- get {
- }
- set {
- }
- values {
- ret: bool;
- }
- }
- embed @pure_virtual {
- [[ Embed remote accessible object as a child.]]
- params {
- @in proxy: Elm.Atspi.Proxy;
- }
- }
- unembed @pure_virtual {
- // unembed
- params {
- @in proxy: Elm.Atspi.Proxy;
- }
- }
- embed_by @pure_virtual {
- [[ Embed accessible object as a child of remote object.]]
- params {
- @in proxy: Elm.Atspi.Proxy;
- }
- }
- unembed_by @pure_virtual {
- // unembed
- params {
- @in proxy: Elm.Atspi.Proxy;
- }
- }
- on_embedded {
- params {
- @in proxy: Elm.Atspi.Proxy;
- }
- }
- on_unembedded {
- params {
- @in proxy: Elm.Atspi.Proxy;
- }
- }
- on_connected {
- }
- on_disconnected {
- }
- }
- events {
- embedded;
- unembedded;
- id,changed;
- }
-}
diff --git a/src/lib/elementary/elm_interfaces.h b/src/lib/elementary/elm_interfaces.h
index c0c5a8bfdb..fa9e85b55a 100644
--- a/src/lib/elementary/elm_interfaces.h
+++ b/src/lib/elementary/elm_interfaces.h
@@ -1,3 +1,4 @@
+#include "elm_interface_accessible_observer.h"
#include "elm_interface_atspi_accessible.h"
#include "elm_interface_atspi_text.h"
#include "elm_interface_atspi_widget_action.h"
@@ -11,7 +12,6 @@
#include "elm_interface_atspi_text_editable.eo.h"
#include "elm_interface_atspi_image.eo.h"
#include "elm_interface_atspi_selection.eo.h"
-#include "elm_interface_atspi_socket.eo.h"
#include "elm_interface_atspi_value.eo.h"
#endif
#endif
@@ -22,7 +22,6 @@
#include "elm_interface_atspi_text_editable.eo.legacy.h"
#include "elm_interface_atspi_image.eo.legacy.h"
#include "elm_interface_atspi_selection.eo.legacy.h"
-#include "elm_interface_atspi_socket.eo.legacy.h"
#include "elm_interface_atspi_value.eo.legacy.h"
#endif
#endif