bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=132eaba8d359a00e4d47d2112dd286d12468af0c

commit 132eaba8d359a00e4d47d2112dd286d12468af0c
Author: Marcel Hollerbach <mar...@osg.samsung.com>
Date:   Sun Oct 15 16:02:39 2017 +0200

    efl_ui_focus_composition: introduce dirty and prepare
    
    this can be used in a container that has his own item management api,
    Each item management call results in a dirty call, once we are called to
    prepare for logical movement we can simply flush the order. So we reduce
    the spam of order calls, which also safes runtime.
---
 src/lib/elementary/efl_ui_focus_composition.c  | 21 +++++++++++++++++++++
 src/lib/elementary/efl_ui_focus_composition.eo | 12 ++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/src/lib/elementary/efl_ui_focus_composition.c 
b/src/lib/elementary/efl_ui_focus_composition.c
index 84ad2035c0..051777d020 100644
--- a/src/lib/elementary/efl_ui_focus_composition.c
+++ b/src/lib/elementary/efl_ui_focus_composition.c
@@ -2,6 +2,8 @@
 # include "elementary_config.h"
 #endif
 
+#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
+
 #include <Elementary.h>
 #include "elm_priv.h"
 #include "efl_ui_focus_composition_adapter.eo.h"
@@ -13,6 +15,7 @@ typedef struct {
    Eina_List *register_target, *registered_targets;
    Eina_List *adapters;
    Efl_Ui_Focus_Manager *registered;
+   Eina_Bool dirty;
 } Efl_Ui_Focus_Composition_Data;
 
 static void
@@ -134,6 +137,24 @@ _efl_ui_focus_composition_elm_widget_focus_state_apply(Eo 
*obj, Efl_Ui_Focus_Com
    return registered;
 }
 
+EOLIAN static void
+_efl_ui_focus_composition_dirty(Eo *obj EINA_UNUSED, 
Efl_Ui_Focus_Composition_Data *pd)
+{
+   pd->dirty = EINA_TRUE;
+}
+
+EOLIAN static void
+_efl_ui_focus_composition_efl_ui_focus_object_prepare_logical(Eo *obj, 
Efl_Ui_Focus_Composition_Data *pd)
+{
+   efl_ui_focus_object_prepare_logical(efl_super(obj, MY_CLASS));
+
+   if (!pd->dirty) return;
+
+   efl_ui_focus_composition_prepare(obj);
+
+   pd->dirty = EINA_FALSE;
+}
+
 #include "efl_ui_focus_composition.eo.c"
 
 typedef struct {
diff --git a/src/lib/elementary/efl_ui_focus_composition.eo 
b/src/lib/elementary/efl_ui_focus_composition.eo
index 2f7cb8efe0..5d0f23b200 100644
--- a/src/lib/elementary/efl_ui_focus_composition.eo
+++ b/src/lib/elementary/efl_ui_focus_composition.eo
@@ -19,8 +19,20 @@ mixin Efl.Ui.Focus.Composition (Efl.Interface, Elm.Widget ) {
             logical_order : list<Efl.Gfx> @owned; [[The order to use]]
          }
       }
+      dirty @protected {
+         [[ Mark this widget as dirty, the children can be considered to be 
changed after that call
+         ]]
+      }
+      prepare @protected {
+         [[A call to prepare the children of this element, called if marked as 
dirty
+
+           You can use this function to call composition_elements.
+         ]]
+      }
    }
    implements {
       Elm.Widget.focus_state_apply;
+      Efl.Ui.Focus.Object.prepare_logical;
+      @empty .prepare;
    }
 }

-- 


Reply via email to