forked from enlightenment/efl
efl_ui_focus_manager: split this of tinto a class and a interface
it turns out to be very handy to have a interface for the moving and border elements, that is unconnected to the way of how widgets are registering themself. This for example enables us to get a simple focus manager that just redirects the call into a internal 2 dimensional data struct
This commit is contained in:
parent
348a7084af
commit
d4cd85aa55
|
@ -126,6 +126,7 @@ elm_public_eolian_files = \
|
||||||
lib/elementary/efl_ui_cursor.eo \
|
lib/elementary/efl_ui_cursor.eo \
|
||||||
lib/elementary/efl_ui_image_factory.eo \
|
lib/elementary/efl_ui_image_factory.eo \
|
||||||
lib/elementary/efl_ui_focus_manager.eo \
|
lib/elementary/efl_ui_focus_manager.eo \
|
||||||
|
lib/elementary/efl_ui_focus_manager_calc.eo \
|
||||||
lib/elementary/efl_ui_focus_manager_sub.eo \
|
lib/elementary/efl_ui_focus_manager_sub.eo \
|
||||||
lib/elementary/efl_ui_focus_manager_root_focus.eo \
|
lib/elementary/efl_ui_focus_manager_root_focus.eo \
|
||||||
lib/elementary/efl_ui_focus_object.eo \
|
lib/elementary/efl_ui_focus_object.eo \
|
||||||
|
@ -681,6 +682,7 @@ lib_elementary_libelementary_la_SOURCES = \
|
||||||
lib/elementary/efl_ui_clock_private.h \
|
lib/elementary/efl_ui_clock_private.h \
|
||||||
lib/elementary/efl_ui_image_factory.c \
|
lib/elementary/efl_ui_image_factory.c \
|
||||||
lib/elementary/efl_ui_focus_manager.c \
|
lib/elementary/efl_ui_focus_manager.c \
|
||||||
|
lib/elementary/efl_ui_focus_manager_calc.c \
|
||||||
lib/elementary/efl_ui_focus_manager_sub.c \
|
lib/elementary/efl_ui_focus_manager_sub.c \
|
||||||
lib/elementary/efl_ui_focus_object.c \
|
lib/elementary/efl_ui_focus_object.c \
|
||||||
lib/elementary/efl_ui_focus_manager_root_focus.c \
|
lib/elementary/efl_ui_focus_manager_root_focus.c \
|
||||||
|
|
|
@ -146,6 +146,7 @@ EAPI extern Elm_Version *elm_version;
|
||||||
#if defined (EFL_EO_API_SUPPORT) && defined (EFL_BETA_API_SUPPORT)
|
#if defined (EFL_EO_API_SUPPORT) && defined (EFL_BETA_API_SUPPORT)
|
||||||
# include "efl_ui_focus_object.eo.h"
|
# include "efl_ui_focus_object.eo.h"
|
||||||
# include "efl_ui_focus_manager.eo.h"
|
# include "efl_ui_focus_manager.eo.h"
|
||||||
|
# include "efl_ui_focus_manager_calc.eo.h"
|
||||||
# include "efl_ui_focus_manager_sub.eo.h"
|
# include "efl_ui_focus_manager_sub.eo.h"
|
||||||
# include "efl_ui_focus_manager_root_focus.eo.h"
|
# include "efl_ui_focus_manager_root_focus.eo.h"
|
||||||
# include "efl_ui_focus_user.eo.h"
|
# include "efl_ui_focus_user.eo.h"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -29,7 +29,7 @@ struct Efl.Ui.Focus.Relations {
|
||||||
redirect : Efl.Ui.Focus.Manager; [[Redirect manager]]
|
redirect : Efl.Ui.Focus.Manager; [[Redirect manager]]
|
||||||
}
|
}
|
||||||
|
|
||||||
class Efl.Ui.Focus.Manager (Efl.Object) {
|
interface Efl.Ui.Focus.Manager {
|
||||||
[[Calculates the directions of Efl.Ui.Focus.Direction
|
[[Calculates the directions of Efl.Ui.Focus.Direction
|
||||||
|
|
||||||
Each registered item will get a other registered object into each
|
Each registered item will get a other registered object into each
|
||||||
|
@ -59,84 +59,6 @@ class Efl.Ui.Focus.Manager (Efl.Object) {
|
||||||
}
|
}
|
||||||
return : Efl.Ui.Focus.Object; [[Next object to focus]]
|
return : Efl.Ui.Focus.Object; [[Next object to focus]]
|
||||||
}
|
}
|
||||||
register {
|
|
||||||
[[Register a new item in the graph.
|
|
||||||
|
|
||||||
$parent can not be $null, it will be used as the parent in the
|
|
||||||
logical tree.
|
|
||||||
$redirect will be set as redirect property on that manager, once
|
|
||||||
$child gets focused.
|
|
||||||
]]
|
|
||||||
params {
|
|
||||||
child : Efl.Ui.Focus.Object @nonull; [[The object to register]]
|
|
||||||
parent : Efl.Ui.Focus.Object @nonull; [[The parent to use in
|
|
||||||
the logical tree]]
|
|
||||||
redirect : Efl.Ui.Focus.Manager; [[The redirect manager to set
|
|
||||||
once this child is focused can be NULL for no redirect]]
|
|
||||||
}
|
|
||||||
return : bool; [[$true if successful, $false otherwise]]
|
|
||||||
}
|
|
||||||
register_logical {
|
|
||||||
[[Register a new item just for the logical parent.
|
|
||||||
|
|
||||||
The item can never get focus, it just helps to build a tree out
|
|
||||||
of the items that are getting focus.
|
|
||||||
]]
|
|
||||||
params {
|
|
||||||
child : Efl.Ui.Focus.Object @nonull; [[The object to register]]
|
|
||||||
parent : Efl.Ui.Focus.Object @nonull; [[The parent to use in
|
|
||||||
the logical tree]]
|
|
||||||
redirect : Efl.Ui.Focus.Manager; [[The redirect manager to set
|
|
||||||
once this child is focused can be $null for no redirect]]
|
|
||||||
}
|
|
||||||
return : bool; [[$true if successful, $false otherwise]]
|
|
||||||
}
|
|
||||||
update_redirect {
|
|
||||||
[[Set a new redirect object for the given child.
|
|
||||||
|
|
||||||
Once $child is focused the redirect manager will be set
|
|
||||||
in the redirect property. Set redirect to $null if nothing should happen.
|
|
||||||
]]
|
|
||||||
params {
|
|
||||||
child : Efl.Ui.Focus.Object @nonull; [[The child to update]]
|
|
||||||
redirect : Efl.Ui.Focus.Manager; [[Once $child got focused this
|
|
||||||
element will be set as redirect]]
|
|
||||||
}
|
|
||||||
return : bool; [[$true if successful, $false otherwise]]
|
|
||||||
}
|
|
||||||
update_parent {
|
|
||||||
[[Set a new logical parent for the given child.]]
|
|
||||||
params {
|
|
||||||
child : Efl.Ui.Focus.Object @nonull; [[The child to update]]
|
|
||||||
parent : Efl.Ui.Focus.Object @nonull; [[The parent which now
|
|
||||||
will be the logical parent of child]]
|
|
||||||
}
|
|
||||||
return : bool; [[$true if successful, $false otherwise]]
|
|
||||||
}
|
|
||||||
update_children {
|
|
||||||
[[Give the list of children a different order.]]
|
|
||||||
params {
|
|
||||||
parent : Efl.Ui.Focus.Object @nonull; [[the parent to update]]
|
|
||||||
children : own(list<Efl.Ui.Focus.Object>); [[the list with the new order]]
|
|
||||||
}
|
|
||||||
return : bool; [[$true if successful, $false otherwise]]
|
|
||||||
}
|
|
||||||
update_order {
|
|
||||||
[[Give the given order to the parent's child.
|
|
||||||
|
|
||||||
Children from the list which are no real children are ignored.
|
|
||||||
]]
|
|
||||||
params {
|
|
||||||
parent : Efl.Ui.Focus.Object @nonull; [[the parent to update]]
|
|
||||||
children : list<Efl.Ui.Focus.Object>; [[the order of items]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unregister {
|
|
||||||
[[Unregister the given item from the focus graph.]]
|
|
||||||
params {
|
|
||||||
child : Efl.Ui.Focus.Object; [[The child to unregister.]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
focus {
|
focus {
|
||||||
[[Make the given object the currently focused object in this manager.
|
[[Make the given object the currently focused object in this manager.
|
||||||
|
|
||||||
|
@ -212,14 +134,6 @@ class Efl.Ui.Focus.Manager (Efl.Object) {
|
||||||
return : Efl.Ui.Focus.Object; [[Last object]]
|
return : Efl.Ui.Focus.Object; [[Last object]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
implements {
|
|
||||||
class.constructor;
|
|
||||||
class.destructor;
|
|
||||||
Efl.Object.constructor;
|
|
||||||
Efl.Object.finalize;
|
|
||||||
Efl.Object.provider_find;
|
|
||||||
Efl.Object.destructor;
|
|
||||||
}
|
|
||||||
events {
|
events {
|
||||||
redirect,changed : Efl.Ui.Focus.Manager; [[Emitted when the redirect
|
redirect,changed : Efl.Ui.Focus.Manager; [[Emitted when the redirect
|
||||||
object has changed, the old manager is passed as event info]]
|
object has changed, the old manager is passed as event info]]
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,107 @@
|
||||||
|
class Efl.Ui.Focus.Manager.Calc (Efl.Object, Efl.Ui.Focus.Manager) {
|
||||||
|
[[Calculates the directions of Efl.Ui.Focus.Direction
|
||||||
|
|
||||||
|
Each registered item will get a other registered object into each
|
||||||
|
direction, you can get those items for the currently focused item if
|
||||||
|
you call request move.
|
||||||
|
|
||||||
|
@since 1.20
|
||||||
|
]]
|
||||||
|
methods {
|
||||||
|
register {
|
||||||
|
[[Register a new item in the graph.
|
||||||
|
|
||||||
|
$parent can not be $null, it will be used as the parent in the
|
||||||
|
logical tree.
|
||||||
|
$redirect will be set as redirect property on that manager, once
|
||||||
|
$child gets focused.
|
||||||
|
]]
|
||||||
|
params {
|
||||||
|
child : Efl.Ui.Focus.Object @nonull; [[The object to register]]
|
||||||
|
parent : Efl.Ui.Focus.Object @nonull; [[The parent to use in
|
||||||
|
the logical tree]]
|
||||||
|
redirect : Efl.Ui.Focus.Manager; [[The redirect manager to set
|
||||||
|
once this child is focused can be NULL for no redirect]]
|
||||||
|
}
|
||||||
|
return : bool; [[$true if successful, $false otherwise]]
|
||||||
|
}
|
||||||
|
register_logical {
|
||||||
|
[[Register a new item just for the logical parent.
|
||||||
|
|
||||||
|
The item can never get focus, it just helps to build a tree out
|
||||||
|
of the items that are getting focus.
|
||||||
|
]]
|
||||||
|
params {
|
||||||
|
child : Efl.Ui.Focus.Object @nonull; [[The object to register]]
|
||||||
|
parent : Efl.Ui.Focus.Object @nonull; [[The parent to use in
|
||||||
|
the logical tree]]
|
||||||
|
redirect : Efl.Ui.Focus.Manager; [[The redirect manager to set
|
||||||
|
once this child is focused can be $null for no redirect]]
|
||||||
|
}
|
||||||
|
return : bool; [[$true if successful, $false otherwise]]
|
||||||
|
}
|
||||||
|
update_redirect {
|
||||||
|
[[Set a new redirect object for the given child.
|
||||||
|
|
||||||
|
Once $child is focused the redirect manager will be set
|
||||||
|
in the redirect property. Set redirect to $null if nothing should happen.
|
||||||
|
]]
|
||||||
|
params {
|
||||||
|
child : Efl.Ui.Focus.Object @nonull; [[The child to update]]
|
||||||
|
redirect : Efl.Ui.Focus.Manager; [[Once $child got focused this
|
||||||
|
element will be set as redirect]]
|
||||||
|
}
|
||||||
|
return : bool; [[$true if successful, $false otherwise]]
|
||||||
|
}
|
||||||
|
update_parent {
|
||||||
|
[[Set a new logical parent for the given child.]]
|
||||||
|
params {
|
||||||
|
child : Efl.Ui.Focus.Object @nonull; [[The child to update]]
|
||||||
|
parent : Efl.Ui.Focus.Object @nonull; [[The parent which now
|
||||||
|
will be the logical parent of child]]
|
||||||
|
}
|
||||||
|
return : bool; [[$true if successful, $false otherwise]]
|
||||||
|
}
|
||||||
|
update_children {
|
||||||
|
[[Give the list of children a different order.]]
|
||||||
|
params {
|
||||||
|
parent : Efl.Ui.Focus.Object @nonull; [[the parent to update]]
|
||||||
|
children : own(list<Efl.Ui.Focus.Object>); [[the list with the new order]]
|
||||||
|
}
|
||||||
|
return : bool; [[$true if successful, $false otherwise]]
|
||||||
|
}
|
||||||
|
update_order {
|
||||||
|
[[Give the given order to the parent's child.
|
||||||
|
|
||||||
|
Children from the list which are no real children are ignored.
|
||||||
|
]]
|
||||||
|
params {
|
||||||
|
parent : Efl.Ui.Focus.Object @nonull; [[the parent to update]]
|
||||||
|
children : list<Efl.Ui.Focus.Object>; [[the order of items]]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unregister {
|
||||||
|
[[Unregister the given item from the focus graph.]]
|
||||||
|
params {
|
||||||
|
child : Efl.Ui.Focus.Object; [[The child to unregister.]]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
implements {
|
||||||
|
class.constructor;
|
||||||
|
class.destructor;
|
||||||
|
Efl.Ui.Focus.Manager.move;
|
||||||
|
Efl.Ui.Focus.Manager.request_move;
|
||||||
|
Efl.Ui.Focus.Manager.focus;
|
||||||
|
Efl.Ui.Focus.Manager.focused;
|
||||||
|
Efl.Ui.Focus.Manager.redirect {set; get;}
|
||||||
|
Efl.Ui.Focus.Manager.border_elements {get;}
|
||||||
|
Efl.Ui.Focus.Manager.root {set; get;}
|
||||||
|
Efl.Ui.Focus.Manager.fetch;
|
||||||
|
Efl.Ui.Focus.Manager.logical_end;
|
||||||
|
Efl.Object.constructor;
|
||||||
|
Efl.Object.finalize;
|
||||||
|
Efl.Object.provider_find;
|
||||||
|
Efl.Object.destructor;
|
||||||
|
}
|
||||||
|
}
|
|
@ -29,20 +29,20 @@ _state_eval(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
|
||||||
{
|
{
|
||||||
if (!pd->none_logicals && pd->rect_registered)
|
if (!pd->none_logicals && pd->rect_registered)
|
||||||
{
|
{
|
||||||
efl_ui_focus_manager_unregister(obj, pd->rect);
|
efl_ui_focus_manager_calc_unregister(obj, pd->rect);
|
||||||
pd->rect_registered = EINA_FALSE;
|
pd->rect_registered = EINA_FALSE;
|
||||||
}
|
}
|
||||||
else if (pd->none_logicals && !pd->rect_registered)
|
else if (pd->none_logicals && !pd->rect_registered)
|
||||||
{
|
{
|
||||||
efl_ui_focus_manager_register(obj, pd->rect, pd->root, NULL);
|
efl_ui_focus_manager_calc_register(obj, pd->rect, pd->root, NULL);
|
||||||
pd->rect_registered = EINA_TRUE;
|
pd->rect_registered = EINA_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Bool
|
EOLIAN static Eina_Bool
|
||||||
_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_register(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *child, Efl_Ui_Focus_Object *parent, Efl_Ui_Focus_Manager *redirect)
|
_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_calc_register(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *child, Efl_Ui_Focus_Object *parent, Efl_Ui_Focus_Manager *redirect)
|
||||||
{
|
{
|
||||||
if (efl_ui_focus_manager_register(efl_super(obj, MY_CLASS), child, parent, redirect))
|
if (efl_ui_focus_manager_calc_register(efl_super(obj, MY_CLASS), child, parent, redirect))
|
||||||
{
|
{
|
||||||
pd->none_logicals = eina_list_append(pd->none_logicals, child);
|
pd->none_logicals = eina_list_append(pd->none_logicals, child);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
@ -53,9 +53,9 @@ _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_register(Eo *obj, Efl_Ui_F
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_unregister(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *child)
|
_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_calc_unregister(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *child)
|
||||||
{
|
{
|
||||||
efl_ui_focus_manager_unregister(efl_super(obj, MY_CLASS), child);
|
efl_ui_focus_manager_calc_unregister(efl_super(obj, MY_CLASS), child);
|
||||||
|
|
||||||
pd->none_logicals = eina_list_remove(pd->none_logicals, child);
|
pd->none_logicals = eina_list_remove(pd->none_logicals, child);
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
class Efl.Ui.Focus.Manager.Root_Focus(Efl.Ui.Focus.Manager) {
|
class Efl.Ui.Focus.Manager.Root_Focus(Efl.Ui.Focus.Manager.Calc) {
|
||||||
[[ This class ensures that the root is at least focusable, if nothing else is focusable]]
|
[[ This class ensures that the root is at least focusable, if nothing else is focusable]]
|
||||||
implements {
|
implements {
|
||||||
Efl.Ui.Focus.Manager.register;
|
Efl.Ui.Focus.Manager.Calc.register;
|
||||||
Efl.Ui.Focus.Manager.unregister;
|
Efl.Ui.Focus.Manager.Calc.unregister;
|
||||||
Efl.Ui.Focus.Manager.focus;
|
Efl.Ui.Focus.Manager.focus;
|
||||||
Efl.Ui.Focus.Manager.focused;
|
Efl.Ui.Focus.Manager.focused;
|
||||||
Efl.Ui.Focus.Manager.fetch;
|
Efl.Ui.Focus.Manager.fetch;
|
||||||
|
|
|
@ -51,14 +51,14 @@ _focus_changed(void *data, const Efl_Event *event)
|
||||||
static void
|
static void
|
||||||
_register(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node, Efl_Ui_Focus_Object *logical)
|
_register(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node, Efl_Ui_Focus_Object *logical)
|
||||||
{
|
{
|
||||||
efl_ui_focus_manager_register(par_m, node, logical, obj);
|
efl_ui_focus_manager_calc_register(par_m, node, logical, obj);
|
||||||
efl_event_callback_add(node, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _focus_changed, obj);
|
efl_event_callback_add(node, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _focus_changed, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_unregister(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node)
|
_unregister(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node)
|
||||||
{
|
{
|
||||||
efl_ui_focus_manager_unregister(par_m, node);
|
efl_ui_focus_manager_calc_unregister(par_m, node);
|
||||||
efl_event_callback_del(node, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _focus_changed, obj);
|
efl_event_callback_del(node, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _focus_changed, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ _logical_manager_change(void *data EINA_UNUSED, const Efl_Event *ev)
|
||||||
EINA_LIST_FOREACH(pd->current_border, n, b)
|
EINA_LIST_FOREACH(pd->current_border, n, b)
|
||||||
{
|
{
|
||||||
if (b == ev->object) continue;
|
if (b == ev->object) continue;
|
||||||
efl_ui_focus_manager_update_parent(manager, b, ev->info);
|
efl_ui_focus_manager_calc_update_parent(manager, b, ev->info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Efl.Ui.Focus.Manager.Sub (Efl.Ui.Focus.Manager, Efl.Object)
|
class Efl.Ui.Focus.Manager.Sub (Efl.Ui.Focus.Manager.Calc, Efl.Object)
|
||||||
{
|
{
|
||||||
[[A class that automatically registeres its border elements in the parent manager
|
[[A class that automatically registeres its border elements in the parent manager
|
||||||
|
|
||||||
|
|
|
@ -5338,7 +5338,7 @@ _efl_ui_win_elm_widget_focus_manager_factory(Eo *obj EINA_UNUSED, Efl_Ui_Win_Dat
|
||||||
{
|
{
|
||||||
Efl_Ui_Focus_Manager *manager;
|
Efl_Ui_Focus_Manager *manager;
|
||||||
|
|
||||||
manager = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, obj,
|
manager = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, obj,
|
||||||
efl_ui_focus_manager_root_set(efl_added, root)
|
efl_ui_focus_manager_root_set(efl_added, root)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ _focus_chain_update(Eo *obj, Elm_Fileselector_Data *pd)
|
||||||
|
|
||||||
#undef A
|
#undef A
|
||||||
|
|
||||||
efl_ui_focus_manager_update_order(efl_ui_focus_user_manager_get(obj), obj, tmp);
|
efl_ui_focus_manager_calc_update_order(efl_ui_focus_user_manager_get(obj), obj, tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -28,7 +28,7 @@ _focus_order_flush(Eo *obj, Elm_Box_Data *pd EINA_UNUSED)
|
||||||
Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_CLASS);
|
Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_CLASS);
|
||||||
Eina_List *order = evas_object_box_children_get(wpd->resize_obj);
|
Eina_List *order = evas_object_box_children_get(wpd->resize_obj);
|
||||||
|
|
||||||
efl_ui_focus_manager_update_order(wpd->focus.manager, obj, order);
|
efl_ui_focus_manager_calc_update_order(wpd->focus.manager, obj, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
|
|
@ -2693,7 +2693,7 @@ _anim_end(Elm_Gengrid_Data *sd)
|
||||||
{
|
{
|
||||||
sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it1));
|
sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it1));
|
||||||
sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it2));
|
sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it2));
|
||||||
|
|
||||||
if (it1_prev)
|
if (it1_prev)
|
||||||
{
|
{
|
||||||
tmp = eina_inlist_find(sd->items, EINA_INLIST_GET(it1_prev));
|
tmp = eina_inlist_find(sd->items, EINA_INLIST_GET(it1_prev));
|
||||||
|
@ -2702,7 +2702,7 @@ _anim_end(Elm_Gengrid_Data *sd)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sd->items = eina_inlist_prepend(sd->items, EINA_INLIST_GET(sd->reorder.it2));
|
sd->items = eina_inlist_prepend(sd->items, EINA_INLIST_GET(sd->reorder.it2));
|
||||||
|
|
||||||
if (it2_prev)
|
if (it2_prev)
|
||||||
{
|
{
|
||||||
tmp = eina_inlist_find(sd->items, EINA_INLIST_GET(it2_prev));
|
tmp = eina_inlist_find(sd->items, EINA_INLIST_GET(it2_prev));
|
||||||
|
@ -2726,16 +2726,16 @@ _anim_end(Elm_Gengrid_Data *sd)
|
||||||
{
|
{
|
||||||
sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it1));
|
sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it1));
|
||||||
sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it2));
|
sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it2));
|
||||||
|
|
||||||
if (it1_prev)
|
if (it1_prev)
|
||||||
{
|
{
|
||||||
tmp = eina_inlist_find(sd->items, EINA_INLIST_GET(it1_prev));
|
tmp = eina_inlist_find(sd->items, EINA_INLIST_GET(it1_prev));
|
||||||
sd->items = eina_inlist_append_relative(sd->items, EINA_INLIST_GET(sd->reorder.it2),
|
sd->items = eina_inlist_append_relative(sd->items, EINA_INLIST_GET(sd->reorder.it2),
|
||||||
tmp);
|
tmp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sd->items = eina_inlist_prepend(sd->items, EINA_INLIST_GET(sd->reorder.it2));
|
sd->items = eina_inlist_prepend(sd->items, EINA_INLIST_GET(sd->reorder.it2));
|
||||||
|
|
||||||
if (it2_prev)
|
if (it2_prev)
|
||||||
{
|
{
|
||||||
tmp = eina_inlist_find(sd->items, EINA_INLIST_GET(it2_prev));
|
tmp = eina_inlist_find(sd->items, EINA_INLIST_GET(it2_prev));
|
||||||
|
|
|
@ -19,7 +19,7 @@ _focus_order_flush(Eo *obj)
|
||||||
Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_CLASS);
|
Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_CLASS);
|
||||||
Eina_List *order = evas_object_grid_children_get(wpd->resize_obj);
|
Eina_List *order = evas_object_grid_children_get(wpd->resize_obj);
|
||||||
|
|
||||||
efl_ui_focus_manager_update_order(wpd->focus.manager, obj, order);
|
efl_ui_focus_manager_calc_update_order(wpd->focus.manager, obj, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -703,7 +703,7 @@ _elm_hover_elm_widget_focus_manager_factory(Eo *obj EINA_UNUSED, Elm_Hover_Data
|
||||||
{
|
{
|
||||||
Efl_Ui_Focus_Manager *manager;
|
Efl_Ui_Focus_Manager *manager;
|
||||||
|
|
||||||
manager = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, obj,
|
manager = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, obj,
|
||||||
efl_ui_focus_manager_root_set(efl_added, root)
|
efl_ui_focus_manager_root_set(efl_added, root)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -806,7 +806,7 @@ _elm_menu_elm_widget_focus_manager_factory(Eo *obj EINA_UNUSED, Elm_Menu_Data *p
|
||||||
{
|
{
|
||||||
Efl_Ui_Focus_Manager *manager;
|
Efl_Ui_Focus_Manager *manager;
|
||||||
|
|
||||||
manager = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, obj,
|
manager = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, obj,
|
||||||
efl_ui_focus_manager_root_set(efl_added, root)
|
efl_ui_focus_manager_root_set(efl_added, root)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1453,7 +1453,7 @@ _elm_scroller_elm_widget_focus_register(Eo *obj, Elm_Scroller_Data *pd EINA_UNUS
|
||||||
{
|
{
|
||||||
//undepended from logical or not we always reigster as full with ourself as redirect
|
//undepended from logical or not we always reigster as full with ourself as redirect
|
||||||
*logical_flag = EINA_TRUE;
|
*logical_flag = EINA_TRUE;
|
||||||
return efl_ui_focus_manager_register_logical(manager, obj, logical, obj);
|
return efl_ui_focus_manager_calc_register_logical(manager, obj, logical, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ _focus_order_flush(Eo *obj)
|
||||||
Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_CLASS);
|
Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_CLASS);
|
||||||
Eina_List *order = evas_object_table_children_get(wpd->resize_obj);
|
Eina_List *order = evas_object_table_children_get(wpd->resize_obj);
|
||||||
|
|
||||||
efl_ui_focus_manager_update_order(wpd->focus.manager, obj, order);
|
efl_ui_focus_manager_calc_update_order(wpd->focus.manager, obj, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Bool
|
EOLIAN static Eina_Bool
|
||||||
|
|
|
@ -87,12 +87,12 @@ _item_focus_eval(Elm_Toolbar_Item_Data *pd)
|
||||||
|
|
||||||
if (want)
|
if (want)
|
||||||
{
|
{
|
||||||
efl_ui_focus_manager_register(manager, EO_OBJ(pd), widget, NULL);
|
efl_ui_focus_manager_calc_register(manager, EO_OBJ(pd), widget, NULL);
|
||||||
pd->registered = manager;
|
pd->registered = manager;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
efl_ui_focus_manager_unregister(manager, EO_OBJ(pd));
|
efl_ui_focus_manager_calc_unregister(manager, EO_OBJ(pd));
|
||||||
pd->registered = NULL;
|
pd->registered = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ _item_focus_eval_all(Elm_Toolbar *obj, Elm_Toolbar_Data *pd)
|
||||||
order = eina_list_append(order, EO_OBJ(pd->more_item));
|
order = eina_list_append(order, EO_OBJ(pd->more_item));
|
||||||
}
|
}
|
||||||
|
|
||||||
efl_ui_focus_manager_update_order(wpd->focus.manager, obj, order);
|
efl_ui_focus_manager_calc_update_order(wpd->focus.manager, obj, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -2381,7 +2381,7 @@ _elm_toolbar_item_efl_object_destructor(Eo *eo_item, Elm_Toolbar_Item_Data *item
|
||||||
|
|
||||||
if (item->registered)
|
if (item->registered)
|
||||||
{
|
{
|
||||||
efl_ui_focus_manager_unregister(item->registered, eo_item);
|
efl_ui_focus_manager_calc_unregister(item->registered, eo_item);
|
||||||
item->registered = NULL;
|
item->registered = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3092,7 +3092,7 @@ EOLIAN static Eina_Bool
|
||||||
_elm_toolbar_elm_widget_focus_register(Eo *obj, Elm_Toolbar_Data *pd EINA_UNUSED, Efl_Ui_Focus_Manager *manager, Efl_Ui_Focus_Object *logical, Eina_Bool *logical_flag)
|
_elm_toolbar_elm_widget_focus_register(Eo *obj, Elm_Toolbar_Data *pd EINA_UNUSED, Efl_Ui_Focus_Manager *manager, Efl_Ui_Focus_Object *logical, Eina_Bool *logical_flag)
|
||||||
{
|
{
|
||||||
*logical_flag = EINA_TRUE;
|
*logical_flag = EINA_TRUE;
|
||||||
return efl_ui_focus_manager_register_logical(manager, obj, logical, NULL);
|
return efl_ui_focus_manager_calc_register_logical(manager, obj, logical, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eo *
|
EOLIAN static Eo *
|
||||||
|
|
|
@ -246,7 +246,7 @@ _focus_manager_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
|
||||||
Efl_Ui_Focus_Manager *new = NULL, *old = NULL;
|
Efl_Ui_Focus_Manager *new = NULL, *old = NULL;
|
||||||
|
|
||||||
parent = elm_widget_parent_get(obj);
|
parent = elm_widget_parent_get(obj);
|
||||||
if (efl_isa(parent, EFL_UI_FOCUS_MANAGER_CLASS))
|
if (efl_isa(parent, EFL_UI_FOCUS_MANAGER_INTERFACE))
|
||||||
{
|
{
|
||||||
new = parent;
|
new = parent;
|
||||||
}
|
}
|
||||||
|
@ -280,9 +280,9 @@ _elm_widget_focus_register(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED,
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!*logical_flag)
|
if (!*logical_flag)
|
||||||
return efl_ui_focus_manager_register(manager, obj, logical, NULL);
|
return efl_ui_focus_manager_calc_register(manager, obj, logical, NULL);
|
||||||
else
|
else
|
||||||
return efl_ui_focus_manager_register_logical(manager, obj, logical, NULL);
|
return efl_ui_focus_manager_calc_register_logical(manager, obj, logical, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ _focus_state_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
|
||||||
(pd->focus.manager && should && want_full == pd->focus.logical)
|
(pd->focus.manager && should && want_full == pd->focus.logical)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
efl_ui_focus_manager_unregister(pd->focus.manager, obj);
|
efl_ui_focus_manager_calc_unregister(pd->focus.manager, obj);
|
||||||
pd->focus.manager = NULL;
|
pd->focus.manager = NULL;
|
||||||
pd->focus.parent = NULL;
|
pd->focus.parent = NULL;
|
||||||
}
|
}
|
||||||
|
@ -355,7 +355,7 @@ _focus_state_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
|
||||||
}
|
}
|
||||||
else if (!should && pd->focus.manager)
|
else if (!should && pd->focus.manager)
|
||||||
{
|
{
|
||||||
efl_ui_focus_manager_unregister(pd->focus.manager, obj);
|
efl_ui_focus_manager_calc_unregister(pd->focus.manager, obj);
|
||||||
pd->focus.manager = NULL;
|
pd->focus.manager = NULL;
|
||||||
pd->focus.parent = NULL;
|
pd->focus.parent = NULL;
|
||||||
}
|
}
|
||||||
|
@ -4127,7 +4127,7 @@ _elm_widget_efl_object_dbg_info_get(Eo *eo_obj, Elm_Widget_Smart_Data *_pd EINA_
|
||||||
}
|
}
|
||||||
|
|
||||||
//if thats a focus manager, give useful information like the border elements
|
//if thats a focus manager, give useful information like the border elements
|
||||||
if (efl_isa(eo_obj, EFL_UI_FOCUS_MANAGER_CLASS))
|
if (efl_isa(eo_obj, EFL_UI_FOCUS_MANAGER_INTERFACE))
|
||||||
{
|
{
|
||||||
Efl_Dbg_Info *border;
|
Efl_Dbg_Info *border;
|
||||||
|
|
||||||
|
|
|
@ -6,15 +6,15 @@ START_TEST(focus_unregister_twice)
|
||||||
Efl_Ui_Focus_Object *r1 = efl_add(FOCUS_TEST_CLASS, NULL);
|
Efl_Ui_Focus_Object *r1 = efl_add(FOCUS_TEST_CLASS, NULL);
|
||||||
Efl_Ui_Focus_Object *r2 = efl_add(FOCUS_TEST_CLASS, NULL);
|
Efl_Ui_Focus_Object *r2 = efl_add(FOCUS_TEST_CLASS, NULL);
|
||||||
|
|
||||||
Efl_Ui_Focus_Manager *m = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, NULL,
|
Efl_Ui_Focus_Manager *m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
|
||||||
efl_ui_focus_manager_root_set(efl_added, r1)
|
efl_ui_focus_manager_root_set(efl_added, r1)
|
||||||
);
|
);
|
||||||
|
|
||||||
fail_if(!efl_ui_focus_manager_register(m, r2, r1, NULL));
|
fail_if(!efl_ui_focus_manager_calc_register(m, r2, r1, NULL));
|
||||||
|
|
||||||
efl_ui_focus_manager_unregister(m, r1);
|
efl_ui_focus_manager_calc_unregister(m, r1);
|
||||||
efl_ui_focus_manager_unregister(m, r1);
|
efl_ui_focus_manager_calc_unregister(m, r1);
|
||||||
efl_ui_focus_manager_unregister(m, r1);
|
efl_ui_focus_manager_calc_unregister(m, r1);
|
||||||
|
|
||||||
efl_del(r2);
|
efl_del(r2);
|
||||||
efl_del(r1);
|
efl_del(r1);
|
||||||
|
@ -31,12 +31,12 @@ START_TEST(focus_register_twice)
|
||||||
Efl_Ui_Focus_Object *r1 = elm_focus_test_object_new("r1", 0, 0, 10, 10);
|
Efl_Ui_Focus_Object *r1 = elm_focus_test_object_new("r1", 0, 0, 10, 10);
|
||||||
Efl_Ui_Focus_Object *r2 = elm_focus_test_object_new("r2", 0, 10, 10, 10);
|
Efl_Ui_Focus_Object *r2 = elm_focus_test_object_new("r2", 0, 10, 10, 10);
|
||||||
|
|
||||||
Efl_Ui_Focus_Manager *m = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, NULL,
|
Efl_Ui_Focus_Manager *m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
|
||||||
efl_ui_focus_manager_root_set(efl_added, r1)
|
efl_ui_focus_manager_root_set(efl_added, r1)
|
||||||
);
|
);
|
||||||
|
|
||||||
fail_if(!efl_ui_focus_manager_register(m, r2, r1, NULL));
|
fail_if(!efl_ui_focus_manager_calc_register(m, r2, r1, NULL));
|
||||||
fail_if(efl_ui_focus_manager_register(m, r2, r1, NULL));
|
fail_if(efl_ui_focus_manager_calc_register(m, r2, r1, NULL));
|
||||||
|
|
||||||
efl_del(r1);
|
efl_del(r1);
|
||||||
efl_del(m);
|
efl_del(m);
|
||||||
|
@ -55,11 +55,11 @@ START_TEST(pos_check)
|
||||||
elm_focus_test_setup_cross(&middle, &south, &north, &east, &west);
|
elm_focus_test_setup_cross(&middle, &south, &north, &east, &west);
|
||||||
|
|
||||||
m = elm_focus_test_manager_new(&root);
|
m = elm_focus_test_manager_new(&root);
|
||||||
efl_ui_focus_manager_register(m, middle, root, NULL);
|
efl_ui_focus_manager_calc_register(m, middle, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, north, root, NULL);
|
efl_ui_focus_manager_calc_register(m, north, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, south, root, NULL);
|
efl_ui_focus_manager_calc_register(m, south, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, west, root, NULL);
|
efl_ui_focus_manager_calc_register(m, west, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, east, root, NULL);
|
efl_ui_focus_manager_calc_register(m, east, root, NULL);
|
||||||
|
|
||||||
#define CHECK(obj, r,l,u,d) \
|
#define CHECK(obj, r,l,u,d) \
|
||||||
efl_ui_focus_manager_focus(m, obj); \
|
efl_ui_focus_manager_focus(m, obj); \
|
||||||
|
@ -97,16 +97,16 @@ START_TEST(redirect)
|
||||||
TEST_OBJ_NEW(one, 0, 0, 20, 20);
|
TEST_OBJ_NEW(one, 0, 0, 20, 20);
|
||||||
TEST_OBJ_NEW(two, 20, 0, 20, 20);
|
TEST_OBJ_NEW(two, 20, 0, 20, 20);
|
||||||
|
|
||||||
Efl_Ui_Focus_Manager *m = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, NULL,
|
Efl_Ui_Focus_Manager *m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
|
||||||
efl_ui_focus_manager_root_set(efl_added, root)
|
efl_ui_focus_manager_root_set(efl_added, root)
|
||||||
);
|
);
|
||||||
|
|
||||||
Efl_Ui_Focus_Manager *m2 = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, NULL,
|
Efl_Ui_Focus_Manager *m2 = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
|
||||||
efl_ui_focus_manager_root_set(efl_added, root2)
|
efl_ui_focus_manager_root_set(efl_added, root2)
|
||||||
);
|
);
|
||||||
|
|
||||||
efl_ui_focus_manager_register(m2, one, root2, NULL);
|
efl_ui_focus_manager_calc_register(m2, one, root2, NULL);
|
||||||
efl_ui_focus_manager_register(m2, two, root2, NULL);
|
efl_ui_focus_manager_calc_register(m2, two, root2, NULL);
|
||||||
|
|
||||||
efl_ui_focus_manager_redirect_set(m, m2);
|
efl_ui_focus_manager_redirect_set(m, m2);
|
||||||
efl_ui_focus_manager_focus(m2, one);
|
efl_ui_focus_manager_focus(m2, one);
|
||||||
|
@ -130,11 +130,11 @@ START_TEST(border_check)
|
||||||
elm_focus_test_setup_cross(&middle, &south, &north, &east, &west);
|
elm_focus_test_setup_cross(&middle, &south, &north, &east, &west);
|
||||||
|
|
||||||
m = elm_focus_test_manager_new(&root);
|
m = elm_focus_test_manager_new(&root);
|
||||||
efl_ui_focus_manager_register(m, middle, root, NULL);
|
efl_ui_focus_manager_calc_register(m, middle, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, south, root, NULL);
|
efl_ui_focus_manager_calc_register(m, south, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, north, root, NULL);
|
efl_ui_focus_manager_calc_register(m, north, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, east, root, NULL);
|
efl_ui_focus_manager_calc_register(m, east, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, west, root, NULL);
|
efl_ui_focus_manager_calc_register(m, west, root, NULL);
|
||||||
|
|
||||||
iter = efl_ui_focus_manager_border_elements_get(m);
|
iter = efl_ui_focus_manager_border_elements_get(m);
|
||||||
|
|
||||||
|
@ -192,16 +192,16 @@ START_TEST(logical_chain)
|
||||||
TEST_OBJ_NEW(subchild23, 0, i*20, 20, 20);
|
TEST_OBJ_NEW(subchild23, 0, i*20, 20, 20);
|
||||||
|
|
||||||
//register everything
|
//register everything
|
||||||
efl_ui_focus_manager_register(m, root, lroot, NULL);
|
efl_ui_focus_manager_calc_register(m, root, lroot, NULL);
|
||||||
efl_ui_focus_manager_register(m, child1, root, NULL);
|
efl_ui_focus_manager_calc_register(m, child1, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, child2, root, NULL);
|
efl_ui_focus_manager_calc_register(m, child2, root, NULL);
|
||||||
efl_ui_focus_manager_register_logical(m, child3, root, NULL);
|
efl_ui_focus_manager_calc_register_logical(m, child3, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, subchild11, child1, NULL);
|
efl_ui_focus_manager_calc_register(m, subchild11, child1, NULL);
|
||||||
efl_ui_focus_manager_register(m, subchild12, child1, NULL);
|
efl_ui_focus_manager_calc_register(m, subchild12, child1, NULL);
|
||||||
efl_ui_focus_manager_register(m, subchild13, child1, NULL);
|
efl_ui_focus_manager_calc_register(m, subchild13, child1, NULL);
|
||||||
efl_ui_focus_manager_register(m, subchild21, child3, NULL);
|
efl_ui_focus_manager_calc_register(m, subchild21, child3, NULL);
|
||||||
efl_ui_focus_manager_register(m, subchild22, child3, NULL);
|
efl_ui_focus_manager_calc_register(m, subchild22, child3, NULL);
|
||||||
efl_ui_focus_manager_register(m, subchild23, child3, NULL);
|
efl_ui_focus_manager_calc_register(m, subchild23, child3, NULL);
|
||||||
|
|
||||||
efl_ui_focus_manager_focus(m, root);
|
efl_ui_focus_manager_focus(m, root);
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ START_TEST(finalize_check)
|
||||||
|
|
||||||
elm_init(1, NULL);
|
elm_init(1, NULL);
|
||||||
|
|
||||||
m = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, NULL);
|
m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL);
|
||||||
fail_if(m);
|
fail_if(m);
|
||||||
|
|
||||||
elm_shutdown();
|
elm_shutdown();
|
||||||
|
@ -245,15 +245,15 @@ START_TEST(redirect_param)
|
||||||
TEST_OBJ_NEW(root2, 0, 20, 20, 20);
|
TEST_OBJ_NEW(root2, 0, 20, 20, 20);
|
||||||
TEST_OBJ_NEW(child, 0, 20, 20, 20);
|
TEST_OBJ_NEW(child, 0, 20, 20, 20);
|
||||||
|
|
||||||
m = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, NULL,
|
m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
|
||||||
efl_ui_focus_manager_root_set(efl_added, root)
|
efl_ui_focus_manager_root_set(efl_added, root)
|
||||||
);
|
);
|
||||||
|
|
||||||
m2 = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, NULL,
|
m2 = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
|
||||||
efl_ui_focus_manager_root_set(efl_added, root2)
|
efl_ui_focus_manager_root_set(efl_added, root2)
|
||||||
);
|
);
|
||||||
|
|
||||||
efl_ui_focus_manager_register(m, child, root, m2);
|
efl_ui_focus_manager_calc_register(m, child, root, m2);
|
||||||
efl_ui_focus_manager_focus(m, child);
|
efl_ui_focus_manager_focus(m, child);
|
||||||
|
|
||||||
ck_assert_ptr_eq(efl_ui_focus_manager_redirect_get(m), m2);
|
ck_assert_ptr_eq(efl_ui_focus_manager_redirect_get(m), m2);
|
||||||
|
@ -272,23 +272,23 @@ START_TEST(invalid_args_check)
|
||||||
TEST_OBJ_NEW(child, 0, 20, 20, 20);
|
TEST_OBJ_NEW(child, 0, 20, 20, 20);
|
||||||
TEST_OBJ_NEW(child2, 0, 20, 20, 20);
|
TEST_OBJ_NEW(child2, 0, 20, 20, 20);
|
||||||
|
|
||||||
m = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, NULL,
|
m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
|
||||||
efl_ui_focus_manager_root_set(efl_added, root)
|
efl_ui_focus_manager_root_set(efl_added, root)
|
||||||
);
|
);
|
||||||
|
|
||||||
//no child and no parent
|
//no child and no parent
|
||||||
ck_assert_int_eq(efl_ui_focus_manager_register(m, NULL, NULL, NULL), 0);
|
ck_assert_int_eq(efl_ui_focus_manager_calc_register(m, NULL, NULL, NULL), 0);
|
||||||
ck_assert_int_eq(efl_ui_focus_manager_register(m, child, NULL, NULL), 0);
|
ck_assert_int_eq(efl_ui_focus_manager_calc_register(m, child, NULL, NULL), 0);
|
||||||
ck_assert_int_eq(efl_ui_focus_manager_register(m, NULL, root, NULL), 0);
|
ck_assert_int_eq(efl_ui_focus_manager_calc_register(m, NULL, root, NULL), 0);
|
||||||
|
|
||||||
ck_assert_int_eq(efl_ui_focus_manager_register(m, child, root, NULL), 1);
|
ck_assert_int_eq(efl_ui_focus_manager_calc_register(m, child, root, NULL), 1);
|
||||||
|
|
||||||
ck_assert_int_eq(efl_ui_focus_manager_update_parent(m, child, NULL), 0);
|
ck_assert_int_eq(efl_ui_focus_manager_calc_update_parent(m, child, NULL), 0);
|
||||||
ck_assert_int_eq(efl_ui_focus_manager_update_parent(m, NULL, NULL), 0);
|
ck_assert_int_eq(efl_ui_focus_manager_calc_update_parent(m, NULL, NULL), 0);
|
||||||
ck_assert_int_eq(efl_ui_focus_manager_update_parent(m, child, child2), 0);
|
ck_assert_int_eq(efl_ui_focus_manager_calc_update_parent(m, child, child2), 0);
|
||||||
|
|
||||||
ck_assert_int_eq(efl_ui_focus_manager_register(m, child2, root, NULL), 1);
|
ck_assert_int_eq(efl_ui_focus_manager_calc_register(m, child2, root, NULL), 1);
|
||||||
ck_assert_int_eq(efl_ui_focus_manager_update_parent(m, child, child2), 1);
|
ck_assert_int_eq(efl_ui_focus_manager_calc_update_parent(m, child, child2), 1);
|
||||||
|
|
||||||
elm_shutdown();
|
elm_shutdown();
|
||||||
}
|
}
|
||||||
|
@ -306,27 +306,27 @@ START_TEST(order_check)
|
||||||
TEST_OBJ_NEW(child2, 0, 20, 20, 20);
|
TEST_OBJ_NEW(child2, 0, 20, 20, 20);
|
||||||
TEST_OBJ_NEW(child3, 0, 20, 20, 20);
|
TEST_OBJ_NEW(child3, 0, 20, 20, 20);
|
||||||
|
|
||||||
m = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, NULL,
|
m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
|
||||||
efl_ui_focus_manager_root_set(efl_added, root)
|
efl_ui_focus_manager_root_set(efl_added, root)
|
||||||
);
|
);
|
||||||
|
|
||||||
//no child and no parent
|
//no child and no parent
|
||||||
efl_ui_focus_manager_register(m, child1, root, NULL);
|
efl_ui_focus_manager_calc_register(m, child1, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, child2, root, NULL);
|
efl_ui_focus_manager_calc_register(m, child2, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, child3, root, NULL);
|
efl_ui_focus_manager_calc_register(m, child3, root, NULL);
|
||||||
|
|
||||||
//positiv check
|
//positiv check
|
||||||
order = eina_list_append(order, child2);
|
order = eina_list_append(order, child2);
|
||||||
order = eina_list_append(order, child3);
|
order = eina_list_append(order, child3);
|
||||||
order = eina_list_append(order, child1);
|
order = eina_list_append(order, child1);
|
||||||
ck_assert_int_eq(efl_ui_focus_manager_update_children(m, root, order), 1);
|
ck_assert_int_eq(efl_ui_focus_manager_calc_update_children(m, root, order), 1);
|
||||||
|
|
||||||
order = NULL;
|
order = NULL;
|
||||||
|
|
||||||
//negativ check
|
//negativ check
|
||||||
order = eina_list_append(order, child1);
|
order = eina_list_append(order, child1);
|
||||||
order = eina_list_append(order, child2);
|
order = eina_list_append(order, child2);
|
||||||
ck_assert_int_eq(efl_ui_focus_manager_update_children(m, root, order), 0);
|
ck_assert_int_eq(efl_ui_focus_manager_calc_update_children(m, root, order), 0);
|
||||||
|
|
||||||
elm_shutdown();
|
elm_shutdown();
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ elm_focus_test_manager_new(Efl_Ui_Focus_Object **middle)
|
||||||
Efl_Ui_Focus_Manager *m;
|
Efl_Ui_Focus_Manager *m;
|
||||||
|
|
||||||
root = elm_focus_test_object_new("middle", 40, 40, 20, 20);
|
root = elm_focus_test_object_new("middle", 40, 40, 20, 20);
|
||||||
m = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, NULL,
|
m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
|
||||||
efl_ui_focus_manager_root_set(efl_added, root)
|
efl_ui_focus_manager_root_set(efl_added, root)
|
||||||
);
|
);
|
||||||
if (middle)
|
if (middle)
|
||||||
|
|
|
@ -37,7 +37,7 @@ _register(Eo *eo, void* data EINA_UNUSED, Efl_Ui_Focus_Object *child, Efl_Ui_Foc
|
||||||
registered = eina_list_append(registered, child);
|
registered = eina_list_append(registered, child);
|
||||||
printf("REGISTERED %p %s\n", child, efl_name_get(child));
|
printf("REGISTERED %p %s\n", child, efl_name_get(child));
|
||||||
|
|
||||||
return efl_ui_focus_manager_register(efl_super(eo, EFL_OBJECT_OVERRIDE_CLASS) , child, parent, manager);
|
return efl_ui_focus_manager_calc_register(efl_super(eo, EFL_OBJECT_OVERRIDE_CLASS) , child, parent, manager);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -46,7 +46,7 @@ _unregister(Eo *eo, void* data EINA_UNUSED, Efl_Ui_Focus_Object *child)
|
||||||
unregistered = eina_list_append(unregistered, child);
|
unregistered = eina_list_append(unregistered, child);
|
||||||
printf("UNREGISTERED %p %s\n", child, efl_name_get(child));
|
printf("UNREGISTERED %p %s\n", child, efl_name_get(child));
|
||||||
|
|
||||||
efl_ui_focus_manager_unregister(efl_super(eo, EFL_OBJECT_OVERRIDE_CLASS) , child);
|
efl_ui_focus_manager_calc_unregister(efl_super(eo, EFL_OBJECT_OVERRIDE_CLASS) , child);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -74,11 +74,11 @@ _setup(Efl_Ui_Focus_Manager **m, Efl_Ui_Focus_Manager_Sub **sub, Efl_Ui_Focus_Ob
|
||||||
TEST_OBJ_NEW(root_manager, 0, 20, 20, 20);
|
TEST_OBJ_NEW(root_manager, 0, 20, 20, 20);
|
||||||
|
|
||||||
EFL_OPS_DEFINE(manager_tracker,
|
EFL_OPS_DEFINE(manager_tracker,
|
||||||
EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_register, _register),
|
EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_calc_register, _register),
|
||||||
EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_unregister, _unregister),
|
EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_calc_unregister, _unregister),
|
||||||
);
|
);
|
||||||
|
|
||||||
Efl_Ui_Focus_Manager *manager = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, NULL,
|
Efl_Ui_Focus_Manager *manager = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
|
||||||
efl_ui_focus_manager_root_set(efl_added, root_manager)
|
efl_ui_focus_manager_root_set(efl_added, root_manager)
|
||||||
);
|
);
|
||||||
//flush now all changes
|
//flush now all changes
|
||||||
|
@ -98,7 +98,7 @@ _setup(Efl_Ui_Focus_Manager **m, Efl_Ui_Focus_Manager_Sub **sub, Efl_Ui_Focus_Ob
|
||||||
);
|
);
|
||||||
|
|
||||||
efl_composite_attach(focus_main, subm);
|
efl_composite_attach(focus_main, subm);
|
||||||
efl_ui_focus_manager_register_logical(manager, focus_main, root_manager, subm);
|
efl_ui_focus_manager_calc_register_logical(manager, focus_main, root_manager, subm);
|
||||||
|
|
||||||
*sub = focus_main;
|
*sub = focus_main;
|
||||||
*m = manager;
|
*m = manager;
|
||||||
|
@ -125,17 +125,17 @@ START_TEST(correct_register)
|
||||||
set1 = eina_list_append(set1, child3);
|
set1 = eina_list_append(set1, child3);
|
||||||
|
|
||||||
//test register stuff
|
//test register stuff
|
||||||
efl_ui_focus_manager_register(sub, child1, root, NULL);
|
efl_ui_focus_manager_calc_register(sub, child1, root, NULL);
|
||||||
efl_ui_focus_manager_register(sub, child2, root, NULL);
|
efl_ui_focus_manager_calc_register(sub, child2, root, NULL);
|
||||||
efl_ui_focus_manager_register(sub, child3, root, NULL);
|
efl_ui_focus_manager_calc_register(sub, child3, root, NULL);
|
||||||
//now force submanager to flush things
|
//now force submanager to flush things
|
||||||
efl_event_callback_call(manager, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
|
efl_event_callback_call(manager, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
|
||||||
ck_assert_ptr_eq(unregistered, NULL);
|
ck_assert_ptr_eq(unregistered, NULL);
|
||||||
fail_if(!_set_equal(registered, set1));
|
fail_if(!_set_equal(registered, set1));
|
||||||
|
|
||||||
efl_ui_focus_manager_unregister(sub, child1);
|
efl_ui_focus_manager_calc_unregister(sub, child1);
|
||||||
efl_ui_focus_manager_unregister(sub, child2);
|
efl_ui_focus_manager_calc_unregister(sub, child2);
|
||||||
efl_ui_focus_manager_unregister(sub, child3);
|
efl_ui_focus_manager_calc_unregister(sub, child3);
|
||||||
efl_del(child1);
|
efl_del(child1);
|
||||||
efl_del(child2);
|
efl_del(child2);
|
||||||
efl_del(child3);
|
efl_del(child3);
|
||||||
|
@ -161,9 +161,9 @@ START_TEST(correct_unregister)
|
||||||
set = eina_list_append(set, child3);
|
set = eina_list_append(set, child3);
|
||||||
|
|
||||||
//test register stuff
|
//test register stuff
|
||||||
efl_ui_focus_manager_register(sub, child1, root, NULL);
|
efl_ui_focus_manager_calc_register(sub, child1, root, NULL);
|
||||||
efl_ui_focus_manager_register(sub, child2, root, NULL);
|
efl_ui_focus_manager_calc_register(sub, child2, root, NULL);
|
||||||
efl_ui_focus_manager_register(sub, child3, root, NULL);
|
efl_ui_focus_manager_calc_register(sub, child3, root, NULL);
|
||||||
efl_event_callback_call(manager, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
|
efl_event_callback_call(manager, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
|
||||||
eina_list_free(unregistered);
|
eina_list_free(unregistered);
|
||||||
unregistered = NULL;
|
unregistered = NULL;
|
||||||
|
@ -171,7 +171,7 @@ START_TEST(correct_unregister)
|
||||||
registered = NULL;
|
registered = NULL;
|
||||||
|
|
||||||
//test unregister stuff
|
//test unregister stuff
|
||||||
efl_ui_focus_manager_unregister(sub, child3);
|
efl_ui_focus_manager_calc_unregister(sub, child3);
|
||||||
efl_event_callback_call(manager, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
|
efl_event_callback_call(manager, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
|
||||||
ck_assert_ptr_eq(registered, NULL);
|
ck_assert_ptr_eq(registered, NULL);
|
||||||
fail_if(!_set_equal(unregistered, set));
|
fail_if(!_set_equal(unregistered, set));
|
||||||
|
@ -204,8 +204,8 @@ START_TEST(correct_un_register)
|
||||||
set_add = eina_list_append(set_add, child2);
|
set_add = eina_list_append(set_add, child2);
|
||||||
set_del = eina_list_append(set_del, child3);
|
set_del = eina_list_append(set_del, child3);
|
||||||
//test register stuff
|
//test register stuff
|
||||||
efl_ui_focus_manager_register(sub, child1, root, NULL);
|
efl_ui_focus_manager_calc_register(sub, child1, root, NULL);
|
||||||
efl_ui_focus_manager_register(sub, child3, root, NULL);
|
efl_ui_focus_manager_calc_register(sub, child3, root, NULL);
|
||||||
efl_event_callback_call(manager, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
|
efl_event_callback_call(manager, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
|
||||||
eina_list_free(unregistered);
|
eina_list_free(unregistered);
|
||||||
unregistered = NULL;
|
unregistered = NULL;
|
||||||
|
@ -213,8 +213,8 @@ START_TEST(correct_un_register)
|
||||||
registered = NULL;
|
registered = NULL;
|
||||||
|
|
||||||
//test unregister stuff
|
//test unregister stuff
|
||||||
efl_ui_focus_manager_unregister(sub, child3);
|
efl_ui_focus_manager_calc_unregister(sub, child3);
|
||||||
efl_ui_focus_manager_register(sub, child2, root, NULL);
|
efl_ui_focus_manager_calc_register(sub, child2, root, NULL);
|
||||||
efl_event_callback_call(manager, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
|
efl_event_callback_call(manager, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
|
||||||
fail_if(!_set_equal(registered, set_add));
|
fail_if(!_set_equal(registered, set_add));
|
||||||
fail_if(!_set_equal(unregistered, set_del));
|
fail_if(!_set_equal(unregistered, set_del));
|
||||||
|
|
Loading…
Reference in New Issue