yakov pushed a commit to branch master.

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

commit bdce97b88294d92df07aaac21cd14bee5471fed9
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Wed Feb 11 17:47:53 2015 +0200

    Refactoring: change old API to Eo API
---
 src/bin/egui_gui/editor.c | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/src/bin/egui_gui/editor.c b/src/bin/egui_gui/editor.c
index eb2fcf2..48efced 100644
--- a/src/bin/egui_gui/editor.c
+++ b/src/bin/egui_gui/editor.c
@@ -362,8 +362,8 @@ _wdg_border_draw(const Gui_Widget *wdg, Eina_Bool 
visibility, int border_type_co
 #undef MARKER
 #undef STR
 
-static void
-_frame_mouse_move(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object 
*fr, void *event_info)
+static Eina_Bool
+_frame_mouse_move(void *data EINA_UNUSED, Eo *fr, const Eo_Event_Description 
*desc EINA_UNUSED, void *event_info EINA_UNUSED)
 {
    Evas_Coord ox, oy;
    Evas_Event_Mouse_Move *ev = event_info;
@@ -389,6 +389,7 @@ _frame_mouse_move(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED, Evas_Object *fr,
         gui_value_int_set(val, oy);
         propview_item_update(prop);
      }
+   return EO_CALLBACK_CONTINUE;
 }
 
 const Gui_Widget*
@@ -557,8 +558,8 @@ _drag_widget_start(void *data)
 
 /* Callback, called on mouse_down on window image,
  * resolves widget under a cursor. */
-static void
-_mouse_down_main(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void 
*event_info)
+static Eina_Bool
+_mouse_down_main(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description 
*desc EINA_UNUSED, void *event_info)
 {
    drag_started = EINA_FALSE;
    Evas_Event_Mouse_Down *ev = event_info;
@@ -585,23 +586,24 @@ _mouse_down_main(void *data, Evas *e EINA_UNUSED, 
Evas_Object *obj, void *event_
    /* Start dragging only if mouse down on not main wdg. */
    if (wdg != wdg_main)
      _drag_timer_start = ecore_timer_add(0.1, _drag_widget_start, wdg);
+   return EO_CALLBACK_CONTINUE;
 }
 
 /* Callback, called when press mouse button */
-static void
-_mouse_up_main(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 
void *event_info EINA_UNUSED)
+static Eina_Bool
+_mouse_up_main(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const 
Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
 {
    if (_drag_timer_start)
      {
         ecore_timer_del(_drag_timer_start);
         _drag_timer_start = NULL;
      }
-   if (!drag_started) return;
+   if (!drag_started) return EO_CALLBACK_CONTINUE;
 
    if (!dnd_is_in_drop_target())
      {
         const Gui_Widget *drag_widget = dnd_drag_wdg_get();
-        if (!drag_widget) return;
+        if (!drag_widget) return EO_CALLBACK_CONTINUE;
 
         drag_stop();
         _wdg_border_draw(NULL, EINA_FALSE, BORDER_DROP_TARGET);
@@ -612,6 +614,7 @@ _mouse_up_main(void *data, Evas *e EINA_UNUSED, Evas_Object 
*obj EINA_UNUSED, vo
         objtree_build(wdg_context_get(drag_widget));
         objtree_item_selected_set(drag_widget);
      }
+   return EO_CALLBACK_CONTINUE;
 }
 
 static Eina_Bool
@@ -950,8 +953,8 @@ _marker_mouse_out(void *data EINA_UNUSED, Eo *obj 
EINA_UNUSED, const Eo_Event_De
    return EO_CALLBACK_CONTINUE;
 }
 
-static void
-_frame_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object 
*obj, void *event_info EINA_UNUSED)
+static Eina_Bool
+_frame_mouse_down(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description 
*desc EINA_UNUSED, void *event_info EINA_UNUSED)
 {
    Gui_Widget *wdg;
    drag_started = EINA_FALSE;
@@ -963,12 +966,13 @@ _frame_mouse_down(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED, Evas_Object *obj,
    /* Don't use dnd for dragging window around canvas. */
    if (IS_WIN(wdg))
      {
-        evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_MOVE, 
_frame_mouse_move, NULL);
+        eo_do(obj, eo_event_callback_add(EVAS_OBJECT_EVENT_MOUSE_MOVE, 
_frame_mouse_move, NULL));
      }
    else
      {
         _drag_timer_start = ecore_timer_add(0.1, _drag_widget_start, wdg);
      }
+   return EO_CALLBACK_CONTINUE;
 }
 
 static Eina_Bool
@@ -978,7 +982,7 @@ _frame_mouse_up(void *data EINA_UNUSED, Eo *obj, const 
Eo_Event_Description *des
    /* Don't use dnd for dragging window around canvas. */
    if (IS_WIN(wdg))
      {
-        evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_MOVE, 
_frame_mouse_move);
+        eo_do(obj, eo_event_callback_del(EVAS_OBJECT_EVENT_MOUSE_MOVE, 
_frame_mouse_move, NULL));
      }
    else
      {
@@ -2395,13 +2399,13 @@ _widget_add(Gui_Session *session, const Gui_Widget 
*wdg, void *data)
                    evas_obj_visibility_set(EINA_TRUE),
                    elm_obj_frame_autocollapse_set(EINA_TRUE));
 
-             evas_object_event_callback_add(fr, EVAS_CALLBACK_MOUSE_DOWN, 
_frame_mouse_down, NULL);
+             eo_do(fr, eo_event_callback_add(EVAS_OBJECT_EVENT_MOUSE_DOWN, 
_frame_mouse_down, NULL));
              eo_do(fr, eo_event_callback_add(EVAS_OBJECT_EVENT_MOUSE_UP, 
_frame_mouse_up, NULL));
              eo_do(fr, eo_key_data_set("winwdg", wdg, NULL));
           }
         fr = main_wdg_info_frame_get(wi);
-        evas_object_event_callback_add(iwin, EVAS_CALLBACK_MOUSE_DOWN, 
_mouse_down_main, wdg);
-        evas_object_event_callback_add(iwin, EVAS_CALLBACK_MOUSE_UP, 
_mouse_up_main, wdg);
+        eo_do(iwin, eo_event_callback_add(EVAS_OBJECT_EVENT_MOUSE_DOWN, 
_mouse_down_main, wdg));
+        eo_do(iwin, eo_event_callback_add(EVAS_OBJECT_EVENT_MOUSE_UP, 
_mouse_up_main, wdg));
 
         DnD_Info *di = calloc (1, sizeof(DnD_Info));
         wdg_data_set(wdg, EDITOR_DND_DATA, di);

-- 


Reply via email to