aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukasz Stanislawski <lukasz.stanislawski@gmail.com>2019-02-13 23:42:08 +0100
committerLukasz Stanislawski <lukasz.stanislawski@gmail.com>2019-02-13 23:42:08 +0100
commitc9bd71d92614a18b6d0f3c7330a123712849f1b6 (patch)
treef1b88ca582f4706e7ebb31c8c1117ba0e2a2c381
parentelementary: add Efl.Access.Widget and Efl.Access.Widget_Item classes (diff)
downloadefl-c9bd71d92614a18b6d0f3c7330a123712849f1b6.tar.gz
efl_access: add Elm.Access.Provider class
-rw-r--r--src/Makefile_Elementary.am2
-rw-r--r--src/lib/elementary/elm_access_provider.c34
-rw-r--r--src/lib/elementary/elm_access_provider.eo7
-rw-r--r--src/lib/elementary/elm_main.c7
-rw-r--r--src/lib/elementary/elm_priv.h1
5 files changed, 51 insertions, 0 deletions
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 595c71ad88..5bb3000c02 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -120,6 +120,7 @@ elm_public_eolian_files = \
lib/elementary/efl_access_window.eo \
lib/elementary/efl_ui_theme.eo \
lib/elementary/efl_config_global.eo \
+ lib/elementary/elm_access_provider.eo \
lib/elementary/elm_code_widget.eo \
lib/elementary/efl_ui_selection.eo \
lib/elementary/efl_ui_dnd.eo \
@@ -712,6 +713,7 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/elm_calendar.c \
lib/elementary/efl_ui_calendar.c \
lib/elementary/efl_ui_check.c \
+ lib/elementary/elm_access_provider.c \
lib/elementary/elm_clock.c \
lib/elementary/elm_code_line.c \
lib/elementary/elm_code_text.c \
diff --git a/src/lib/elementary/elm_access_provider.c b/src/lib/elementary/elm_access_provider.c
new file mode 100644
index 0000000000..4563b26be4
--- /dev/null
+++ b/src/lib/elementary/elm_access_provider.c
@@ -0,0 +1,34 @@
+#ifdef HAVE_CONFIG_H
+ #include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include <elm_priv.h>
+
+static Efl_Access_Object*
+_access_object_create(Efl_Object *obj)
+{
+ if (efl_isa(obj, EFL_UI_WIDGET_CLASS))
+ return efl_add(EFL_ACCESS_WIDGET_CLASS, obj);
+
+ return NULL;
+}
+
+static EOLIAN Efl_Access_Object*
+_elm_access_provider_efl_access_provider_access_object_get(const Elm_Access_Provider *self EINA_UNUSED, void *ptr EINA_UNUSED, Efl_Object *object)
+{
+ if (!efl_isa(object, EFL_UI_WIDGET_CLASS))
+ return NULL;
+
+ Efl_Access_Object *access = efl_ui_widget_access_object_get(object);
+ if (!access)
+ {
+ access = _access_object_create(object);
+ efl_ui_widget_access_object_set(object, access);
+ efl_access_widget_real_widget_set(access, object);
+ }
+
+ return access;
+}
+
+#include "elm_access_provider.eo.c"
diff --git a/src/lib/elementary/elm_access_provider.eo b/src/lib/elementary/elm_access_provider.eo
new file mode 100644
index 0000000000..38ea682392
--- /dev/null
+++ b/src/lib/elementary/elm_access_provider.eo
@@ -0,0 +1,7 @@
+class Elm.Access.Provider extends Efl.Object implements Efl.Access.Provider
+{
+ data: null;
+ implements {
+ Efl.Access.Provider.access_object { get; }
+ }
+}
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index b4c83e3105..58b2d850ec 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -397,6 +397,13 @@ _sys_lang_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA
return ECORE_CALLBACK_PASS_ON;
}
+static void _elm_access_init()
+{
+ Elm_Access_Provider *provider = efl_add_ref(ELM_ACCESS_PROVIDER_CLASS, NULL);
+ efl_access_object_access_provider_add(EFL_ACCESS_OBJECT_MIXIN, provider);
+ efl_unref(provider);
+}
+
// This is necessary to keep backward compatibility
static const char *bcargv[] = { "exe" };
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 1e268dd68a..61a69463d6 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -73,6 +73,7 @@
# include "efl_ui_homogeneous_model.eo.h"
# include "efl_ui_exact_model.eo.h"
# include "efl_ui_average_model.eo.h"
+# include "elm_access_provider.eo.h"
extern const char *_efl_model_property_itemw;
extern const char *_efl_model_property_itemh;