forked from enlightenment/efl
elm_box: port to composition
This commit is contained in:
parent
132eaba8d3
commit
cb27a73968
|
@ -3,6 +3,7 @@
|
|||
#endif
|
||||
|
||||
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
|
||||
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
|
||||
|
||||
#include <Elementary.h>
|
||||
#include <elm_box.eo.h>
|
||||
|
@ -23,12 +24,12 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
|||
};
|
||||
|
||||
static void
|
||||
_focus_order_flush(Eo *obj, Elm_Box_Data *pd EINA_UNUSED)
|
||||
_elm_box_efl_ui_focus_composition_prepare(Eo *obj, Elm_Box_Data *pd EINA_UNUSED)
|
||||
{
|
||||
Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_CLASS);
|
||||
Eina_List *order = evas_object_box_children_get(wpd->resize_obj);
|
||||
|
||||
efl_ui_focus_manager_calc_update_order(wpd->focus.manager, obj, order);
|
||||
efl_ui_focus_composition_elements_set(obj, order);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -402,27 +403,27 @@ _elm_box_homogeneous_get(Eo *obj EINA_UNUSED, Elm_Box_Data *sd)
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_box_pack_start(Eo *obj, Elm_Box_Data *pd, Evas_Object *subobj)
|
||||
_elm_box_pack_start(Eo *obj, Elm_Box_Data *pd EINA_UNUSED, Evas_Object *subobj)
|
||||
{
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||
|
||||
elm_widget_sub_object_add(obj, subobj);
|
||||
evas_object_box_prepend(wd->resize_obj, subobj);
|
||||
_focus_order_flush(obj, pd);
|
||||
efl_ui_focus_composition_dirty(obj);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_box_pack_end(Eo *obj, Elm_Box_Data *pd, Evas_Object *subobj)
|
||||
_elm_box_pack_end(Eo *obj, Elm_Box_Data *pd EINA_UNUSED, Evas_Object *subobj)
|
||||
{
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||
|
||||
elm_widget_sub_object_add(obj, subobj);
|
||||
evas_object_box_append(wd->resize_obj, subobj);
|
||||
_focus_order_flush(obj, pd);
|
||||
efl_ui_focus_composition_dirty(obj);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_box_pack_before(Eo *obj, Elm_Box_Data *pd, Evas_Object *subobj, Evas_Object *before)
|
||||
_elm_box_pack_before(Eo *obj, Elm_Box_Data *pd EINA_UNUSED, Evas_Object *subobj, Evas_Object *before)
|
||||
{
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||
|
||||
|
@ -430,41 +431,41 @@ _elm_box_pack_before(Eo *obj, Elm_Box_Data *pd, Evas_Object *subobj, Evas_Object
|
|||
|
||||
evas_object_box_insert_before
|
||||
(wd->resize_obj, subobj, before);
|
||||
_focus_order_flush(obj, pd);
|
||||
efl_ui_focus_composition_dirty(obj);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_box_pack_after(Eo *obj, Elm_Box_Data *pd, Evas_Object *subobj, Evas_Object *after)
|
||||
_elm_box_pack_after(Eo *obj, Elm_Box_Data *pd EINA_UNUSED, Evas_Object *subobj, Evas_Object *after)
|
||||
{
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||
|
||||
elm_widget_sub_object_add(obj, subobj);
|
||||
evas_object_box_insert_after
|
||||
(wd->resize_obj, subobj, after);
|
||||
_focus_order_flush(obj, pd);
|
||||
efl_ui_focus_composition_dirty(obj);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_box_clear(Eo *obj, Elm_Box_Data *pd)
|
||||
_elm_box_clear(Eo *obj, Elm_Box_Data *pd EINA_UNUSED)
|
||||
{
|
||||
/* EINA_TRUE means to delete objects as well */
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||
evas_object_box_remove_all(wd->resize_obj, EINA_TRUE);
|
||||
_focus_order_flush(obj, pd);
|
||||
efl_ui_focus_composition_dirty(obj);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_box_unpack(Eo *obj, Elm_Box_Data *pd, Evas_Object *subobj)
|
||||
_elm_box_unpack(Eo *obj, Elm_Box_Data *pd EINA_UNUSED, Evas_Object *subobj)
|
||||
{
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||
|
||||
if (evas_object_box_remove(wd->resize_obj, subobj))
|
||||
_elm_widget_sub_object_redirect_to_top(obj, subobj);
|
||||
_focus_order_flush(obj, pd);
|
||||
efl_ui_focus_composition_dirty(obj);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_box_unpack_all(Eo *obj, Elm_Box_Data *pd)
|
||||
_elm_box_unpack_all(Eo *obj, Elm_Box_Data *pd EINA_UNUSED)
|
||||
{
|
||||
Evas_Object_Box_Data *bd;
|
||||
Evas_Object_Box_Option *opt;
|
||||
|
@ -488,7 +489,7 @@ _elm_box_unpack_all(Eo *obj, Elm_Box_Data *pd)
|
|||
_elm_widget_sub_object_redirect_to_top(obj, c);
|
||||
/* update size hints */
|
||||
_sizing_eval(obj);
|
||||
_focus_order_flush(obj, pd);
|
||||
efl_ui_focus_composition_dirty(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -651,18 +652,6 @@ _elm_box_class_constructor(Efl_Class *klass)
|
|||
{
|
||||
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
||||
}
|
||||
EOLIAN Eina_Bool
|
||||
_elm_box_elm_widget_focus_state_apply(Eo *obj, Elm_Box_Data *pd, Elm_Widget_Focus_State current_state, Elm_Widget_Focus_State *configured_state, Elm_Widget *redirect)
|
||||
{
|
||||
Eina_Bool result = elm_obj_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, redirect);
|
||||
|
||||
//later registering children are automatically set into the order of the internal table
|
||||
if (configured_state->manager)
|
||||
_focus_order_flush(obj, pd);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_BOX_EXTRA_OPS \
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import evas_box;
|
||||
|
||||
class Elm.Box (Elm.Widget)
|
||||
class Elm.Box (Elm.Widget, Efl.Ui.Focus.Composition)
|
||||
{
|
||||
[[Elementary box class]]
|
||||
legacy_prefix: elm_box;
|
||||
|
@ -251,7 +251,7 @@ class Elm.Box (Elm.Widget)
|
|||
Efl.Canvas.Group.group_calculate;
|
||||
Elm.Widget.theme_apply;
|
||||
Elm.Widget.widget_sub_object_del;
|
||||
Elm.Widget.focus_state_apply;
|
||||
Efl.Ui.Focus.Composition.prepare;
|
||||
}
|
||||
events {
|
||||
child,added; [[Called when child was added]]
|
||||
|
|
Loading…
Reference in New Issue