yakov pushed a commit to branch master.

http://git.enlightenment.org/tools/erigo.git/commit/?id=344ee93d12598f85d855c2674e84c8a97aa57a40

commit 344ee93d12598f85d855c2674e84c8a97aa57a40
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Sun Dec 6 14:44:09 2015 +0200

    Start using memento_focused_widget_add() API
    
    Add calls of of current function in appropriate places
---
 src/bin/gui/cbview.c   |  9 +++++++++
 src/bin/gui/descview.c |  2 ++
 src/bin/gui/editor.c   | 17 +++++++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/src/bin/gui/cbview.c b/src/bin/gui/cbview.c
index d98db3e..d37c2ba 100644
--- a/src/bin/gui/cbview.c
+++ b/src/bin/gui/cbview.c
@@ -74,6 +74,7 @@ _action_type_changed(void *data, Eo *obj EINA_UNUSED, const 
Eo_Event_Description
         memento_command_add(action_id, MEMENTO_ACTION, old_action, new_action);
         action_set(action_id, new_action);
      }
+   memento_focused_widget_add(wdg_eid_get(wdg));
 
    Action_Type action_type = action_type_get_from_string(type_as_string);
    switch (action_type)
@@ -117,6 +118,7 @@ _action_wdg_selected(void *data, Eo *obj EINA_UNUSED, void 
*event_info)
      {
         Gui_Action *new_action = action_copy(action_id);
         memento_command_add(action_id, MEMENTO_ACTION, action, new_action);
+        memento_focused_widget_add(wdg_eid_get(wdg));
         action_set(action_id, new_action);
 
         const char *wdg_name = elm_object_item_part_text_get(event_info, NULL);
@@ -147,6 +149,7 @@ _action_parent_selected(void *data, Eo *obj EINA_UNUSED, 
const Eo_Event_Descript
      {
         Gui_Action *new_action = action_copy(action_id);
         memento_command_add(action_id, MEMENTO_ACTION, action, new_action);
+        memento_focused_widget_add(wdg_eid_get(wdg));
         action_set(action_id, new_action);
 
         const char *parent_name = elm_object_item_part_text_get(event_info, 
NULL);
@@ -174,6 +177,7 @@ _action_user_cb_selected(void *data, Eo *obj EINA_UNUSED, 
const Eo_Event_Descrip
      {
         Gui_Action *new_action = action_copy(action_id);
         memento_command_add(action_id, MEMENTO_ACTION, action, new_action);
+        memento_focused_widget_add(wdg_eid_get(wdg));
         action_set(action_id, new_action);
 
         const char *cb_name = elm_object_item_part_text_get(event_info, NULL);
@@ -225,6 +229,7 @@ _action_prop_selected(void *data, Eo *obj EINA_UNUSED, 
const Eo_Event_Descriptio
 
         Gui_Action *new_action = action_copy(action_id);
         memento_command_add(action_id, MEMENTO_ACTION, action, new_action);
+        memento_focused_widget_add(wdg_eid_get(wdg));
 
         action_modif_set(new_action, wdg_id, prop);
         action_set(action_id, new_action);
@@ -269,6 +274,7 @@ _action_item_selected(void *data, Eo *obj, const 
Eo_Event_Description *desc EINA
    Eid *wdg_id = action_widget_id_get(action);
    Gui_Action *new_action = action_copy(action_id);
    memento_command_add(action_id, MEMENTO_ACTION, action, new_action);
+   memento_focused_widget_add(wdg_id);
 
    action_modif_set(new_action, wdg_id, new_prop);
    action_set(action_id, new_action);
@@ -386,6 +392,7 @@ _action_prop_update(void *data, Eo *obj, void *event_info)
    Eid *wdg_id = action_widget_id_get(action);
    Gui_Action *new_action = action_copy(action_id);
    memento_command_add(action_id, MEMENTO_ACTION, action, new_action);
+   memento_focused_widget_add(wdg_id);
    context_memento_finalize(_active_context_get());
 
    action_modif_set(new_action, wdg_id, new_prop);
@@ -708,6 +715,7 @@ _selected_callback_move(int dir)
              if (cb_container_cb_move(cc_new, cb, dir))
                {
                   memento_command_add(wdg_eid_get(wdg), 
MEMENTO_CALLBACK_ADD_DEL, (void *)cc_old, cc_new);
+                  memento_focused_widget_add(wdg_eid_get(wdg));
 
                   wdg_cb_container_unset((Gui_Widget *) wdg);
                   wdg_cb_container_set((Gui_Widget *) wdg, cc_new);
@@ -757,6 +765,7 @@ _callbacksview_del_btn_clicked(void *data EINA_UNUSED, Eo 
*obj EINA_UNUSED, cons
         cc_new = cb_container_copy(cc_old);
         cb_container_cb_remove(cc_new, cb);
         memento_command_add(wdg_eid_get(wdg), MEMENTO_CALLBACK_ADD_DEL, (void 
*)cc_old, cc_new);
+        memento_focused_widget_add(wdg_eid_get(wdg));
 
         wdg_cb_container_unset((Gui_Widget *) wdg);
         wdg_cb_container_set((Gui_Widget *) wdg, cc_new);
diff --git a/src/bin/gui/descview.c b/src/bin/gui/descview.c
index 3bd2528..6549ff3 100644
--- a/src/bin/gui/descview.c
+++ b/src/bin/gui/descview.c
@@ -39,6 +39,7 @@ _wdg_public_change_cb(void *data, Eo *obj, const 
Eo_Event_Description *desc EINA
    wdg_public_set(wdg, new_state);
 
    memento_command_add(wdg_eid_get(wdg), MEMENTO_WIDGET_PUBLIC, (void *) 
(intptr_t) old_state, (void *) (intptr_t) new_state);
+   memento_focused_widget_add(wdg_eid_get(wdg));
    context_memento_finalize(_active_context_get());
 
    return EO_CALLBACK_CONTINUE;
@@ -56,6 +57,7 @@ _wdg_name_change_cb(void *data, Eo *obj, const 
Eo_Event_Description *desc EINA_U
    if (eid_rename(wdg_eid_get(wdg), new_name))
      {
         memento_command_add(wdg_eid_get(wdg), MEMENTO_WIDGET_NAME, (void *) 
old_name, (void *) new_name);
+        memento_focused_widget_add(wdg_eid_get(wdg));
         context_memento_finalize(_active_context_get());
      }
    free(old_name);
diff --git a/src/bin/gui/editor.c b/src/bin/gui/editor.c
index 13f5cad..5052cc4 100644
--- a/src/bin/gui/editor.c
+++ b/src/bin/gui/editor.c
@@ -808,6 +808,7 @@ _marker_mouse_move(void *data, Eo *marker EINA_UNUSED, 
const Eo_Event_Descriptio
              prop = prop_create_for_op(op);
              wdg_prop_add((Gui_Widget *) wdg, prop);
              memento_command_add(wdg_eid_get(wdg), MEMENTO_PROPERTY, NULL, 
prop);
+             memento_focused_widget_add(wdg_eid_get(wdg));
 
              val = prop_value_nth_get(prop, 0);
              gui_value_int_set(val, new_w);
@@ -833,6 +834,7 @@ _marker_mouse_move(void *data, Eo *marker EINA_UNUSED, 
const Eo_Event_Descriptio
              prop = prop_create_for_op(op);
              wdg_prop_add((Gui_Widget *) wdg, prop);
              memento_command_add(wdg_eid_get(wdg), MEMENTO_PROPERTY, NULL, 
prop);
+             memento_focused_widget_add(wdg_eid_get(wdg));
 
              val = prop_value_nth_get(prop, 0);
              gui_value_int_set(val, new_x);
@@ -871,6 +873,7 @@ _marker_mouse_down(void *data, Eo *obj, const 
Eo_Event_Description *desc EINA_UN
      {
         new_prop = prop_copy(old_prop);
         memento_command_add(wdg_eid_get(wdg), MEMENTO_PROPERTY, old_prop, 
new_prop);
+        memento_focused_widget_add(wdg_eid_get(wdg));
         wdg_prop_remove((Gui_Widget *) wdg, old_prop);
         wdg_prop_add((Gui_Widget *) wdg, new_prop);
 
@@ -884,6 +887,7 @@ _marker_mouse_down(void *data, Eo *obj, const 
Eo_Event_Description *desc EINA_UN
           {
              new_prop = prop_copy(old_prop);
              memento_command_add(wdg_eid_get(wdg), MEMENTO_PROPERTY, old_prop, 
new_prop);
+             memento_focused_widget_add(wdg_eid_get(wdg));
              wdg_prop_remove((Gui_Widget *) wdg, old_prop);
              wdg_prop_add((Gui_Widget *) wdg, new_prop);
 
@@ -1744,6 +1748,8 @@ _drop_target_drop(Gui_Widget *drop_target_wdg, Eo 
*canvas_drop_target, const cha
           }
      }
 
+   memento_focused_widget_add(wdg_eid_get(new_wdg));
+
    /* Where to drop. */
    if (drop_to_wdg == DROP_TO_CANVAS)
      {
@@ -2787,6 +2793,7 @@ _drag_start_post(const Gui_Widget *wdg, const Eo *_wdg_eo)
      }
 
    /* Need to change parent to NULL, because parent is also changed in 
container unset. */
+   memento_focused_widget_add(wdg_eid_get(wdg));
    memento_command_add(wdg_eid_get(wdg), MEMENTO_WIDGET_PARENT, wdg_parent ? 
wdg_eid_get(wdg_parent) : NULL, NULL);
    wdg_parent_set((Gui_Widget *) wdg, NULL);
 }
@@ -3365,6 +3372,7 @@ _editor_selected_wdg_del_cb()
 
    eid_active_set(wdg_eid_get(wdg), EINA_FALSE);
    memento_command_add(wdg_eid_get(wdg), MEMENTO_WIDGET,  (void *) (intptr_t) 
EINA_TRUE, (void *) (intptr_t) EINA_FALSE);
+   memento_focused_widget_add(wdg_eid_get(wdg));
 
    /* if parent_wdg is not NULL, it's not window, so it has parent.
     * if parent wdg is NULL, wdg is window, so just delete it. */
@@ -3594,6 +3602,7 @@ _prop_update_from_propview(void *data EINA_UNUSED, Eo 
*obj, const Eo_Event_Descr
    if (prop_wdg_get(old_property))
      {
         memento_command_add(wdg_eid_get(wdg), MEMENTO_PROPERTY, old_property, 
prop);
+        memento_focused_widget_add(wdg_eid_get(wdg));
         wdg_prop_remove((Gui_Widget *) wdg, old_property);
      }
    /* If not, this prop is default property which was fetched from _ffi_eo_do, 
don't need to save it,
@@ -3606,6 +3615,7 @@ _prop_update_from_propview(void *data EINA_UNUSED, Eo 
*obj, const Eo_Event_Descr
         prop_unref(old_property);
         old_property = NULL;
         memento_command_add(wdg_eid_get(wdg), MEMENTO_PROPERTY, old_property, 
prop);
+        memento_focused_widget_add(wdg_eid_get(wdg));
      }
 
    /* Assign new prop to widget */
@@ -3662,6 +3672,7 @@ _drop_property_cb(void *data, Evas_Object *obj, void 
*event_info EINA_UNUSED)
         if (wdg)
           {
              memento_command_add(wdg_eid_get(wdg), MEMENTO_PROPERTY, prop, 
NULL);
+             memento_focused_widget_add(wdg_eid_get(wdg));
 
              wdg_prop_remove((Gui_Widget *) wdg, (Gui_Widget_Property *) prop);
              proplayout_build(NULL);
@@ -3713,6 +3724,7 @@ _item_public_update_cb(void *data, Eo *obj, const 
Eo_Event_Description *desc EIN
    item_container_item_public_set(new_item, state);
 
    memento_command_add(wdg_eid_get(wdg), MEMENTO_ITEM_CONTAINER_ITEM, item, 
new_item);
+   memento_focused_widget_add(wdg_eid_get(wdg));
 
    item_container_item_set_on_id(item_container_item_eid_get(item), new_item);
    context_memento_finalize(_active_context_get());
@@ -3849,6 +3861,7 @@ _field_update_from_itemview(void *data EINA_UNUSED, Eo 
*obj, const Eo_Event_Desc
    /* Create memento and unref prev item*/
    memento_command_add(wdg_eid_get(wdg), MEMENTO_ITEM_CONTAINER_ITEM, (void *) 
wit, new_wit);
    item_container_item_unref((Item_Container_Item *) wit);
+   memento_focused_widget_add(wdg_eid_get(wdg));
    context_memento_finalize(_active_context_get());
    return EO_CALLBACK_CONTINUE;
 }
@@ -3887,6 +3900,7 @@ _itemview_item_do_(unsigned int type)
    wit = item_container_item_get_from_id(selected_item_id);
 
    Item_Container_Item *it = NULL;
+   memento_focused_widget_add(wdg_eid_get(wdg));
    if ((type == ITEM_ADD) || (type == ITEM_ADD_NESTED) || (type == 
SEPARATOR_ADD))
      {
         if (wit)
@@ -4060,6 +4074,7 @@ _content_del_from_propview(void *data, Eo *obj 
EINA_UNUSED, const Eo_Event_Descr
         wdg_parent_set(param_wdg, wdg_name_get(parent_win));
         objtree_item_selected_set(wdg);
         memento_command_add(name_id, MEMENTO_WIDGET_PARENT, wdg_eid_get(wdg), 
wdg_eid_get(parent_win));
+        memento_focused_widget_add(wdg_eid_get(wdg));
 
         /* Reload window when unpacking something. */
         _editor_wdg_selected_set(wdg);
@@ -4097,6 +4112,7 @@ _content_reorder_from_propview(void *data, Eo *obj 
EINA_UNUSED, const Eo_Event_D
         if (wdg_obj_container_content_reorder(wdg, idx, button_dir))
           {
              memento_command_add(wdg_eid_get(wdg), MEMENTO_OBJ_CONTAINER, 
_old_container, _new_container);
+             memento_focused_widget_add(wdg_eid_get(wdg));
              context_memento_finalize(_active_context_get());
 
              /* Update propview. */
@@ -4331,6 +4347,7 @@ _content_change_from_propview(void *data EINA_UNUSED, Eo 
*obj, const Eo_Event_De
      }
 
    memento_command_add(wdg_eid_get(wdg), MEMENTO_OBJ_CONTAINER, 
_old_container, _new_container);
+   memento_focused_widget_add(wdg_eid_get(wdg));
    obj_container_unref(_old_container);
 
    /* If any object was packed before, create memento for it.  */

-- 


Reply via email to