summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorLukasz Stanislawski <lukasz.stanislawski@gmail.com>2019-02-13 23:58:41 +0100
committerLukasz Stanislawski <lukasz.stanislawski@gmail.com>2019-02-13 23:58:41 +0100
commit12c94abf7a06a84632fa28eabb5d755eafd1270b (patch)
tree64090a60811bc1ddfedc7485f4365cdafa2ea001 /src/lib/elementary
parente18d8dd2ac345fd5ace76d6bf511a979339078f8 (diff)
efl_access: refactor Efl.Ui.Windevs/stanluk/access_refactor
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_access_ui_win.eo11
-rw-r--r--src/lib/elementary/efl_ui_win.c150
-rw-r--r--src/lib/elementary/efl_ui_win.eo9
-rw-r--r--src/lib/elementary/elm_access_provider.c2
-rw-r--r--src/lib/elementary/elm_priv.h1
5 files changed, 69 insertions, 104 deletions
diff --git a/src/lib/elementary/efl_access_ui_win.eo b/src/lib/elementary/efl_access_ui_win.eo
new file mode 100644
index 0000000000..8bfce6ce31
--- /dev/null
+++ b/src/lib/elementary/efl_access_ui_win.eo
@@ -0,0 +1,11 @@
1class Efl.Access.Ui.Win extends Efl.Access.Widget
2{
3 data: null;
4 implements {
5 Efl.Object.constructor;
6 Efl.Access.Object.state_set { get; }
7 Efl.Access.Object.i18n_name { get; }
8 Efl.Access.Component.extents { get; }
9 }
10}
11
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 256a315fcb..bcde4aae12 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -7242,56 +7242,6 @@ _elm_win_focus_auto_hide(Evas_Object *obj)
7242 } 7242 }
7243} 7243}
7244 7244
7245static void
7246_on_atspi_bus_connected(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
7247{
7248 Evas_Object *win;
7249 Eina_List *l;
7250
7251 EINA_LIST_FOREACH(_elm_win_list, l, win)
7252 {
7253 /**
7254 * Reemit accessibility events when AT-SPI2 connection is begin
7255 * established. This assures that Assistive Technology clients will
7256 * receive all org.a11y.window events and could keep track of active
7257 * windows whithin system.
7258 */
7259 efl_access_window_created_signal_emit(win);
7260 if (elm_win_focus_get(win))
7261 {
7262 Evas_Object *target;
7263 efl_access_window_activated_signal_emit(win);
7264 /** Reemit focused event to inform atspi clients about currently
7265 * focused object **/
7266 {
7267 Efl_Ui_Focus_Manager *m;
7268
7269 m = win;
7270
7271 while (efl_ui_focus_manager_redirect_get(m))
7272 m = efl_ui_focus_manager_redirect_get(m);
7273
7274 target = efl_ui_focus_manager_focus_get(m);
7275 }
7276 if (target)
7277 efl_access_state_changed_signal_emit(target, EFL_ACCESS_STATE_FOCUSED, EINA_TRUE);
7278 }
7279 else
7280 efl_access_window_deactivated_signal_emit(win);
7281 }
7282}
7283
7284EOLIAN static void
7285_efl_ui_win_class_constructor(Efl_Class *klass EINA_UNUSED)
7286{
7287 if (_elm_config->atspi_mode)
7288 {
7289 Eo *bridge = _elm_atspi_bridge_get();
7290 if (bridge)
7291 efl_event_callback_add(bridge, ELM_ATSPI_BRIDGE_EVENT_CONNECTED, _on_atspi_bus_connected, NULL);
7292 }
7293}
7294
7295EOLIAN static void 7245EOLIAN static void
7296_efl_ui_win_efl_object_debug_name_override(Eo *obj, Efl_Ui_Win_Data *pd, Eina_Strbuf *sb) 7246_efl_ui_win_efl_object_debug_name_override(Eo *obj, Efl_Ui_Win_Data *pd, Eina_Strbuf *sb)
7297{ 7247{
@@ -7314,49 +7264,6 @@ _efl_ui_win_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED,
7314 return &atspi_actions[0]; 7264 return &atspi_actions[0];
7315} 7265}
7316 7266
7317EOLIAN static Efl_Access_State_Set
7318_efl_ui_win_efl_access_object_state_set_get(const Eo *obj, Efl_Ui_Win_Data *sd EINA_UNUSED)
7319{
7320 Efl_Access_State_Set ret;
7321 ret = efl_access_object_state_set_get(efl_super(obj, MY_CLASS));
7322
7323 if (elm_win_focus_get(obj))
7324 STATE_TYPE_SET(ret, EFL_ACCESS_STATE_ACTIVE);
7325
7326 return ret;
7327}
7328
7329EOLIAN static const char*
7330_efl_ui_win_efl_access_object_i18n_name_get(const Eo *obj, Efl_Ui_Win_Data *sd EINA_UNUSED)
7331{
7332 const char *ret;
7333 ret = efl_access_object_i18n_name_get(efl_super(obj, EFL_UI_WIN_CLASS));
7334 if (ret) return ret;
7335 const char *name = elm_win_title_get(obj);
7336 return name;
7337}
7338
7339EOLIAN static Eina_Rect
7340_efl_ui_win_efl_access_component_extents_get(const Eo *obj, Efl_Ui_Win_Data *_pd EINA_UNUSED, Eina_Bool screen_coords)
7341{
7342 Eina_Rect r;
7343 int ee_x, ee_y;
7344
7345 r = efl_gfx_entity_geometry_get(obj);
7346 r.x = r.y = 0;
7347 if (screen_coords)
7348 {
7349 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
7350 if (ee)
7351 {
7352 ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
7353 r.x += ee_x;
7354 r.y += ee_y;
7355 }
7356 }
7357 return r;
7358}
7359
7360EOLIAN static Eina_Bool 7267EOLIAN static Eina_Bool
7361_efl_ui_win_efl_input_state_modifier_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, 7268_efl_ui_win_efl_input_state_modifier_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd,
7362 Efl_Input_Modifier mod, const Efl_Input_Device *seat) 7269 Efl_Input_Modifier mod, const Efl_Input_Device *seat)
@@ -9053,11 +8960,60 @@ elm_win_util_dialog_add(Evas_Object *parent, const char *name, const char *title
9053 return win; 8960 return win;
9054} 8961}
9055 8962
9056EOLIAN Efl_Access_Object* 8963EOLIAN static Efl_Access_State_Set
9057_efl_ui_win_efl_access_object_access_parent_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd EINA_UNUSED) 8964_efl_access_ui_win_efl_access_object_state_set_get(const Eo *obj, void *sd EINA_UNUSED)
8965{
8966 Efl_Access_State_Set ret;
8967 ret = efl_access_object_state_set_get(efl_super(obj, EFL_ACCESS_UI_WIN_CLASS));
8968
8969 Efl_Ui_Widget *win = efl_access_widget_real_widget_get(obj);
8970 if (win && elm_win_focus_get(win))
8971 STATE_TYPE_SET(ret, EFL_ACCESS_STATE_ACTIVE);
8972
8973 return ret;
8974}
8975
8976EOLIAN static const char*
8977_efl_access_ui_win_efl_access_object_i18n_name_get(const Eo *obj, void *sd EINA_UNUSED)
8978{
8979 const char *ret;
8980 ret = efl_access_object_i18n_name_get(efl_super(obj, EFL_ACCESS_UI_WIN_CLASS));
8981 if (ret) return ret;
8982 const char *name = elm_win_title_get(efl_access_widget_real_widget_get(obj));
8983 return name;
8984}
8985
8986EOLIAN static Eina_Rect
8987_efl_access_ui_win_efl_access_component_extents_get(const Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords)
9058{ 8988{
9059 // attach all kinds of windows directly to access root object 8989 Eina_Rect r = {0,};
9060 return elm_atspi_app_object_instance_get(ELM_ATSPI_APP_OBJECT_CLASS); 8990 int ee_x, ee_y;
8991
8992 Efl_Ui_Widget *win = efl_access_widget_real_widget_get(obj);
8993 if (!win) return r;
8994
8995 r = efl_gfx_entity_geometry_get(win);
8996 r.x = r.y = 0;
8997 if (screen_coords)
8998 {
8999 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
9000 if (ee)
9001 {
9002 ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
9003 r.x += ee_x;
9004 r.y += ee_y;
9005 }
9006 }
9007 return r;
9008}
9009
9010EOLIAN static Eo*
9011_efl_access_ui_win_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
9012{
9013 efl_access_widget_forced_parent_set(obj, elm_atspi_app_object_instance_get(ELM_ATSPI_APP_OBJECT_CLASS));
9014 efl_access_object_role_set(obj, EFL_ACCESS_ROLE_WINDOW);
9015 return efl_constructor(efl_super(obj, EFL_ACCESS_UI_WIN_CLASS));
9061} 9016}
9062 9017
9063#include "efl_ui_win_legacy.eo.c" 9018#include "efl_ui_win_legacy.eo.c"
9019#include "efl_access_ui_win.eo.c"
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index b96df4fccf..b467e2dcc8 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -154,8 +154,8 @@ enum Efl.Ui.Win_Move_Resize_Mode
154 right = (1 << 4) [[Start resizing window to the right]] 154 right = (1 << 4) [[Start resizing window to the right]]
155} 155}
156 156
157class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.Window, 157class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene,
158 Efl.Access.Component, Efl.Access.Widget.Action, 158 Efl.Access.Widget.Action,
159 Efl.Content, Efl.Input.State, Efl.Input.Interface, Efl.Screen, 159 Efl.Content, Efl.Input.State, Efl.Input.Interface, Efl.Screen,
160 Efl.Text, Efl.Config, 160 Efl.Text, Efl.Config,
161 Efl.Ui.Widget_Focus_Manager, Efl.Ui.Focus.Manager_Window_Root 161 Efl.Ui.Widget_Focus_Manager, Efl.Ui.Focus.Manager_Window_Root
@@ -823,7 +823,6 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
823 } 823 }
824 } 824 }
825 implements { 825 implements {
826 class.constructor;
827 Efl.Object.constructor; 826 Efl.Object.constructor;
828 Efl.Object.destructor; 827 Efl.Object.destructor;
829 Efl.Object.provider_find; 828 Efl.Object.provider_find;
@@ -843,10 +842,6 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
843 Efl.Ui.Focus.Object.on_focus_update; 842 Efl.Ui.Focus.Object.on_focus_update;
844 Efl.Ui.Widget.widget_event; 843 Efl.Ui.Widget.widget_event;
845 Efl.Ui.Widget_Focus_Manager.focus_manager_create; 844 Efl.Ui.Widget_Focus_Manager.focus_manager_create;
846 Efl.Access.Object.state_set { get; }
847 Efl.Access.Object.i18n_name { get; }
848 Efl.Access.Object.access_parent { get; }
849 Efl.Access.Component.extents { get; }
850 Efl.Access.Widget.Action.elm_actions { get; } 845 Efl.Access.Widget.Action.elm_actions { get; }
851 Efl.Input.State.modifier_enabled { get; } 846 Efl.Input.State.modifier_enabled { get; }
852 Efl.Input.State.lock_enabled { get; } 847 Efl.Input.State.lock_enabled { get; }
diff --git a/src/lib/elementary/elm_access_provider.c b/src/lib/elementary/elm_access_provider.c
index 4563b26be4..86e4749445 100644
--- a/src/lib/elementary/elm_access_provider.c
+++ b/src/lib/elementary/elm_access_provider.c
@@ -8,6 +8,8 @@
8static Efl_Access_Object* 8static Efl_Access_Object*
9_access_object_create(Efl_Object *obj) 9_access_object_create(Efl_Object *obj)
10{ 10{
11 if (efl_isa(obj, EFL_UI_WIN_CLASS))
12 return efl_add(EFL_ACCESS_UI_WIN_CLASS, obj);
11 if (efl_isa(obj, EFL_UI_WIDGET_CLASS)) 13 if (efl_isa(obj, EFL_UI_WIDGET_CLASS))
12 return efl_add(EFL_ACCESS_WIDGET_CLASS, obj); 14 return efl_add(EFL_ACCESS_WIDGET_CLASS, obj);
13 15
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 61a69463d6..7710ae3c01 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -74,6 +74,7 @@
74# include "efl_ui_exact_model.eo.h" 74# include "efl_ui_exact_model.eo.h"
75# include "efl_ui_average_model.eo.h" 75# include "efl_ui_average_model.eo.h"
76# include "elm_access_provider.eo.h" 76# include "elm_access_provider.eo.h"
77# include "efl_access_ui_win.eo.h"
77 78
78extern const char *_efl_model_property_itemw; 79extern const char *_efl_model_property_itemw;
79extern const char *_efl_model_property_itemh; 80extern const char *_efl_model_property_itemh;