RIP elm_widget_focus_jump
authorTiago Rezende Campos Falcao <developer@tiagofalcao.com>
Thu, 9 Dec 2010 13:07:45 +0000 (13:07 +0000)
committerTiago Rezende Campos Falcao <developer@tiagofalcao.com>
Thu, 9 Dec 2010 13:07:45 +0000 (13:07 +0000)
The last call to this method was removed. This method broke the focus
tree and we don't need it anymore.

SVN revision: 55410

src/lib/elm_widget.c
src/lib/elm_widget.h

index 1fa4011..403ca3f 100644 (file)
@@ -1309,164 +1309,6 @@ elm_widget_focus_list_next_get(const Evas_Object *obj, const Eina_List *items, v
    return EINA_FALSE;
 }
 
-EAPI int
-elm_widget_focus_jump(Evas_Object *obj, int forward)
-{
-   API_ENTRY return 0;
-   if (!_is_focusable(obj)) return 0;
-
-   /* if it has a focus func its an end-point widget like a button */
-   if (sd->focus_func)
-     {
-       if (!sd->focused)
-          {
-             focus_order++;
-             sd->focus_order = focus_order;
-             sd->focused = EINA_TRUE;
-          }
-       else sd->focused = EINA_FALSE;
-       if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
-       sd->focus_func(obj);
-       return sd->focused;
-     }
-   /* its some container */
-   else
-     {
-       int focus_next;
-       int noloop = 0;
-        
-       focus_next = 0;
-       if (!sd->focused)
-         {
-            elm_widget_focus_set(obj, forward);
-            return 1;
-         }
-       else
-         {
-            if (forward)
-              {
-                 if (_is_focusable(sd->resize_obj))
-                   {
-                      if ((focus_next) &&
-                          (!elm_widget_disabled_get(sd->resize_obj)))
-                        {
-                           /* the previous focused item was unfocused - so focus
-                            * the next one (that can be focused) */
-                           if (elm_widget_focus_jump(sd->resize_obj, forward))
-                               return 1;
-                           else noloop = 1;
-                        }
-                      else
-                        {
-                           if (elm_widget_focus_get(sd->resize_obj))
-                             {
-                                /* jump to the next focused item or focus this item */
-                                if (elm_widget_focus_jump(sd->resize_obj, forward))
-                                    return 1;
-                                /* it returned 0 - it got to the last item and is past it */
-                                focus_next = 1;
-                             }
-                        }
-                   }
-                 if (!noloop)
-                   {
-                      const Eina_List *l;
-                      Evas_Object *child;
-                      EINA_LIST_FOREACH(sd->subobjs, l, child)
-                        {
-                           if (_is_focusable(child))
-                             {
-                                if ((focus_next) &&
-                                    (!elm_widget_disabled_get(child)))
-                                  {
-                                     /* the previous focused item was unfocused - so focus
-                                      * the next one (that can be focused) */
-                                     if (elm_widget_focus_jump(child, forward))
-                                         return 1;
-                                     else break;
-                                  }
-                                else
-                                  {
-                                     if (elm_widget_focus_get(child))
-                                       {
-                                          /* jump to the next focused item or focus this item */
-                                          if (elm_widget_focus_jump(child, forward))
-                                              return 1;
-                                          /* it returned 0 - it got to the last item and is past it */
-                                          focus_next = 1;
-                                       }
-                                  }
-                             }
-                        }
-                   }
-              }
-            else
-              {
-                 const Eina_List *l;
-                 Evas_Object *child;
-
-                 EINA_LIST_REVERSE_FOREACH(sd->subobjs, l, child)
-                   {
-                      if (_is_focusable(child))
-                        {
-                           if ((focus_next) &&
-                               (!elm_widget_disabled_get(child)))
-                             {
-                                /* the previous focused item was unfocused - so focus
-                                 * the next one (that can be focused) */
-                                if (elm_widget_focus_jump(child, forward))
-                                    return 1;
-                                else break;
-                             }
-                           else
-                             {
-                                if (elm_widget_focus_get(child))
-                                  {
-                                     /* jump to the next focused item or focus this item */
-                                     if (elm_widget_focus_jump(child, forward))
-                                         return 1;
-                                     /* it returned 0 - it got to the last item and is past it */
-                                     focus_next = 1;
-                                  }
-                             }
-                        }
-                   }
-                 if (!l)
-                   {
-                      if (_is_focusable(sd->resize_obj))
-                        {
-                           if ((focus_next) &&
-                               (!elm_widget_disabled_get(sd->resize_obj)))
-                             {
-                                /* the previous focused item was unfocused - so focus
-                                 * the next one (that can be focused) */
-                                if (elm_widget_focus_jump(sd->resize_obj, forward))
-                                    return 1;
-                             }
-                           else
-                             {
-                                if (elm_widget_focus_get(sd->resize_obj))
-                                  {
-                                     /* jump to the next focused item or focus this item */
-                                     if (elm_widget_focus_jump(sd->resize_obj, forward))
-                                         return 1;
-                                     /* it returned 0 - it got to the last item and is past it */
-                                  }
-                             }
-                        }
-                   }
-              }
-         }
-     }
-   /* no next item can be focused */
-   if (sd->focused)
-     {
-       sd->focused = EINA_FALSE;
-       if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
-     }
-   return 0;
-}
-
 EAPI void
 elm_widget_signal_emit(Evas_Object *obj, const char *emission, const char *source)
 {
index 618e6e7..37f2688 100644 (file)
@@ -259,7 +259,6 @@ EAPI void             elm_widget_focus_cycle(Evas_Object *obj, Elm_Focus_Directi
 EAPI void             elm_widget_focus_direction_go(Evas_Object *obj, int x, int y);
 EAPI Eina_Bool        elm_widget_focus_next_get(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next);
 EAPI Eina_Bool        elm_widget_focus_list_next_get(const Evas_Object *obj, const Eina_List *items, void *(*list_data_get) (const Eina_List *list), Elm_Focus_Direction dir, Evas_Object **next);
-EAPI int              elm_widget_focus_jump(Evas_Object *obj, int forward);
 EAPI void             elm_widget_focus_set(Evas_Object *obj, int first);
 EAPI void             elm_widget_focused_object_clear(Evas_Object *obj);
 EAPI Evas_Object     *elm_widget_parent_get(const Evas_Object *obj);