summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2017-10-12 21:25:49 +0200
committerMarcel Hollerbach <marcel@osg.samsung.com>2017-10-13 12:31:47 +0200
commit75f5ea686fb6475cdbb9d8106c696c4d52fefe69 (patch)
tree9920fc63ea34e084592a633039f44495a2eede34 /src/lib
parent441776f7cfe4eba2a4d257312ddbb554224bc858 (diff)
efl_ui_focus: add parent_provider
thats just a little helper, where the logic to find and fetch the provider is bound to the position in the widget tree, this means that for example gengrid could change the way the logical parent is evalulated. (For example to map the logical parent to a item)
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_ui_focus_parent_provider.c8
-rw-r--r--src/lib/elementary/efl_ui_focus_parent_provider.eo11
-rw-r--r--src/lib/elementary/efl_ui_focus_parent_provider_standard.c19
-rw-r--r--src/lib/elementary/efl_ui_focus_parent_provider_standard.eo5
-rw-r--r--src/lib/elementary/efl_ui_win.c6
-rw-r--r--src/lib/elementary/elm_priv.h2
-rw-r--r--src/lib/elementary/elm_widget.c6
-rw-r--r--src/lib/elementary/elm_widget.h2
8 files changed, 57 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_focus_parent_provider.c b/src/lib/elementary/efl_ui_focus_parent_provider.c
new file mode 100644
index 0000000000..97de15a451
--- /dev/null
+++ b/src/lib/elementary/efl_ui_focus_parent_provider.c
@@ -0,0 +1,8 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include <Elementary.h>
6#include "elm_priv.h"
7
8#include "efl_ui_focus_parent_provider.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_parent_provider.eo b/src/lib/elementary/efl_ui_focus_parent_provider.eo
new file mode 100644
index 0000000000..13d4638cf2
--- /dev/null
+++ b/src/lib/elementary/efl_ui_focus_parent_provider.eo
@@ -0,0 +1,11 @@
1interface Efl.Ui.Focus.Parent_Provider {
2 methods {
3 find_logical_parent {
4 [[Called to get the logical parent of widget]]
5 params {
6 widget : Efl.Ui.Focus.Object;
7 }
8 return : Efl.Ui.Focus.Object;
9 }
10 }
11}
diff --git a/src/lib/elementary/efl_ui_focus_parent_provider_standard.c b/src/lib/elementary/efl_ui_focus_parent_provider_standard.c
new file mode 100644
index 0000000000..821d812463
--- /dev/null
+++ b/src/lib/elementary/efl_ui_focus_parent_provider_standard.c
@@ -0,0 +1,19 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include <Elementary.h>
6#include "elm_priv.h"
7
8typedef struct {
9
10} Efl_Ui_Focus_Parent_Provider_Standard_Data;
11
12EOLIAN static Efl_Ui_Focus_Object*
13_efl_ui_focus_parent_provider_standard_efl_ui_focus_parent_provider_find_logical_parent(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Parent_Provider_Standard_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *widget)
14{
15 return elm_object_parent_widget_get(widget);
16}
17
18
19#include "efl_ui_focus_parent_provider_standard.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_parent_provider_standard.eo b/src/lib/elementary/efl_ui_focus_parent_provider_standard.eo
new file mode 100644
index 0000000000..9daa4aef98
--- /dev/null
+++ b/src/lib/elementary/efl_ui_focus_parent_provider_standard.eo
@@ -0,0 +1,5 @@
1class Efl.Ui.Focus.Parent_Provider.Standard(Efl.Object, Efl.Ui.Focus.Parent_Provider) {
2 implements {
3 Efl.Ui.Focus.Parent_Provider.find_logical_parent;
4 }
5}
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index bc66ecedf0..af94426b3f 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -176,6 +176,7 @@ struct _Efl_Ui_Win_Data
176 Evas_Object *main_menu; 176 Evas_Object *main_menu;
177 177
178 Efl_Ui_Focus_Manager *manager; 178 Efl_Ui_Focus_Manager *manager;
179 Efl_Ui_Focus_Parent_Provider_Standard *provider;
179 180
180 struct 181 struct
181 { 182 {
@@ -5361,6 +5362,7 @@ _efl_ui_win_efl_object_constructor(Eo *obj, Efl_Ui_Win_Data *pd)
5361 5362
5362 pd->obj = obj; 5363 pd->obj = obj;
5363 pd->manager = elm_obj_widget_focus_manager_create(obj, obj); 5364 pd->manager = elm_obj_widget_focus_manager_create(obj, obj);
5365 pd->provider = efl_add(EFL_UI_FOCUS_PARENT_PROVIDER_STANDARD_CLASS, obj);
5364 pd->profile.available = eina_array_new(4); 5366 pd->profile.available = eina_array_new(4);
5365 5367
5366 efl_composite_attach(obj, pd->manager); 5368 efl_composite_attach(obj, pd->manager);
@@ -6756,6 +6758,10 @@ _efl_ui_win_efl_object_provider_find(Eo *obj, Efl_Ui_Win_Data *pd EINA_UNUSED,
6756{ 6758{
6757 if (klass == EFL_UI_WIN_CLASS) 6759 if (klass == EFL_UI_WIN_CLASS)
6758 return obj; 6760 return obj;
6761
6762 if (klass == EFL_UI_FOCUS_PARENT_PROVIDER_INTERFACE)
6763 return pd->provider;
6764
6759 return efl_provider_find(efl_super(obj, MY_CLASS), klass); 6765 return efl_provider_find(efl_super(obj, MY_CLASS), klass);
6760} 6766}
6761 6767
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 8d905ca913..03051baa3f 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -53,6 +53,8 @@
53#include "elm_widget.h" 53#include "elm_widget.h"
54#include "elm_access.eo.h" 54#include "elm_access.eo.h"
55#include "elm_code_private.h" 55#include "elm_code_private.h"
56#include "efl_ui_focus_parent_provider.eo.h"
57#include "efl_ui_focus_parent_provider_standard.eo.h"
56 58
57#ifdef HAVE_LANGINFO_H 59#ifdef HAVE_LANGINFO_H
58# include <langinfo.h> 60# include <langinfo.h>
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 5d5dc62863..880e291dc3 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -453,7 +453,10 @@ static Efl_Ui_Focus_Object*
453_logical_parent_eval(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd) 453_logical_parent_eval(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd)
454{ 454{
455 Elm_Widget *parent; 455 Elm_Widget *parent;
456 parent = pd->parent_obj; 456 Efl_Ui_Focus_Parent_Provider *provider;
457
458 parent = efl_ui_focus_parent_provider_find_logical_parent(pd->provider, obj);
459
457 if (pd->logical.parent != parent) 460 if (pd->logical.parent != parent)
458 { 461 {
459 Efl_Ui_Focus_Object *old = NULL; 462 Efl_Ui_Focus_Object *old = NULL;
@@ -5081,6 +5084,7 @@ _elm_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSE
5081 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); 5084 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
5082 parent = efl_parent_get(obj); 5085 parent = efl_parent_get(obj);
5083 elm_obj_widget_parent_set(obj, parent); 5086 elm_obj_widget_parent_set(obj, parent);
5087 sd->provider = efl_provider_find(obj, EFL_UI_FOCUS_PARENT_PROVIDER_INTERFACE);
5084 sd->on_create = EINA_FALSE; 5088 sd->on_create = EINA_FALSE;
5085 5089
5086 elm_interface_atspi_accessible_role_set(obj, ELM_ATSPI_ROLE_UNKNOWN); 5090 elm_interface_atspi_accessible_role_set(obj, ELM_ATSPI_ROLE_UNKNOWN);
diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h
index 0f0caca7b1..4f2f0df6a6 100644
--- a/src/lib/elementary/elm_widget.h
+++ b/src/lib/elementary/elm_widget.h
@@ -416,7 +416,7 @@ typedef struct _Elm_Widget_Smart_Data
416 Eina_Inlist *translate_strings; 416 Eina_Inlist *translate_strings;
417 Eina_List *focus_chain; 417 Eina_List *focus_chain;
418 Eina_List *event_cb; 418 Eina_List *event_cb;
419 419 Eo *provider;
420 /* this is a hook to be set on-the-fly on widgets. this is code 420 /* this is a hook to be set on-the-fly on widgets. this is code
421 * handling the request of showing a specific region from an inner 421 * handling the request of showing a specific region from an inner
422 * widget (mainly issued by entries, on cursor moving) */ 422 * widget (mainly issued by entries, on cursor moving) */