cedric pushed a commit to branch master.

commit 7396dc2d89453c1b21f87e23118384e512934fe4
Author: Cedric Bail <[email protected]>
Date:   Tue Sep 3 11:08:12 2013 +0900

    evas: simplify logic and API signature, thanks k-s.
---
 src/lib/evas/Evas_Eo.h           |  2 +-
 src/lib/evas/canvas/evas_focus.c | 18 +++++-------------
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index fc61c0a..e4b83e8 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -5232,7 +5232,7 @@ enum
  *
  * @see evas_object_focus_set
  */
-#define evas_obj_focus_set(focus, succeed) 
EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_FOCUS_SET), EO_TYPECHECK(Eina_Bool, focus), 
EO_TYPECHECK(Eina_Bool *, succeed)
+#define evas_obj_focus_set(focus) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_FOCUS_SET), 
EO_TYPECHECK(Eina_Bool, focus)
 
 /**
  * @def evas_obj_focus_get
diff --git a/src/lib/evas/canvas/evas_focus.c b/src/lib/evas/canvas/evas_focus.c
index 5294ee6..cac96b6 100644
--- a/src/lib/evas/canvas/evas_focus.c
+++ b/src/lib/evas/canvas/evas_focus.c
@@ -10,14 +10,13 @@
 EAPI void
 evas_object_focus_set(Evas_Object *eo_obj, Eina_Bool focus)
 {
-   eo_do(eo_obj, evas_obj_focus_set(focus, NULL));
+   eo_do(eo_obj, evas_obj_focus_set(focus));
 }
 
 void
 _focus_set(Eo *eo_obj, void *_pd, va_list *list)
 {
    Eina_Bool focus = va_arg(*list, int);
-   Eina_Bool *r = va_arg(*list, Eina_Bool *);
 
    int event_id = 0;
    MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
@@ -25,21 +24,17 @@ _focus_set(Eo *eo_obj, void *_pd, va_list *list)
    MAGIC_CHECK_END();
    Evas_Object_Protected_Data *obj = _pd;
 
-   if (r) *r = EINA_FALSE;
-
    _evas_object_event_new();
 
    event_id = _evas_event_counter;
-   if (obj->focused == focus) goto success_end;
+   if (obj->focused == focus) goto end;
    if (evas_object_intercept_call_focus_set(eo_obj, obj, focus)) goto end;
    if (focus)
      {
-        Eina_Bool success = EINA_TRUE;
-
         if (obj->layer->evas->focused)
-          eo_do(obj->layer->evas->focused,
-                evas_obj_focus_set(0, &success));
-        if (!success) goto end;
+         eo_do(obj->layer->evas->focused, evas_obj_focus_set(0));
+       
+        if (obj->layer->evas->focused) goto end;
         obj->focused = 1;
         obj->layer->evas->focused = eo_obj;
         evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_FOCUS_IN, 
NULL, event_id);
@@ -55,9 +50,6 @@ _focus_set(Eo *eo_obj, void *_pd, va_list *list)
                                  EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, 
eo_obj);
      }
 
- success_end:
-   if (r) *r = EINA_TRUE;
-
  end:
    _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
 }

-- 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk

Reply via email to