Hi all,

follows two patches that allow Eve to run using the newest WebKit/Efl API.

The first one just changes the names of some vars (all of them
regarding the load progress feature).

The second one removes the keyboard and mouse feed functions, which is
now a WebKit/Efl duty. We are now able to use mouse wheel in Google
Maps. :)

TODO:
* fix Eve theme. It can use the default WebKit/Efl theme (installed by
default in /usr/local/share/webkit-1.0/theme/default.edj) or can be
refactored according to the new theme architecture.
* fix plugins. Plugins area are shown, but content is just gray. It is
also bad positioned. So it seems to be a WebKit/Efl issue.

PS.: glima has approved the patches and asked me to send it to you all.

See you,

-- 
André Pedralho
Index: src/bin/eve_navigator.c
===================================================================
--- src/bin/eve_navigator.c	(revision 40872)
+++ src/bin/eve_navigator.c	(working copy)
@@ -112,7 +112,7 @@
    Eve_Navigator_Data *priv = data;
    EWebKit_Event_Load_Progress *ev = event_info;
    Edje_Message_Float msg;
-   msg.val = ev->load_progress / 100.0;
+   msg.val = ev->progress / 100.0;
    edje_object_message_send(priv->edje, EDJE_MESSAGE_FLOAT, 0, &msg);
 }
 
@@ -120,11 +120,7 @@
 _eve_navigator_on_load_started(void *data, Evas_Object *obj, void *event_info)
 {
    Eve_Navigator_Data *priv = data;
-   EWebKit_Event_Load_Started *ev = event_info;
-   if (ev->load_started)
-     edje_object_signal_emit(priv->edje, "eve,action,load", "");
-   else
-     fputs("DBG: load started, but flag is not set.\n", stderr);
+   edje_object_signal_emit(priv->edje, "eve,action,load", "");
 }
 
 static void
@@ -132,7 +128,7 @@
 {
    Eve_Navigator_Data *priv = data;
    EWebKit_Event_Load_Finished *ev = event_info;
-   if (ev->load_succeeded)
+   if (ev->success)
      edje_object_signal_emit(priv->edje, "eve,action,load,done", "");
    else
      fputs("DBG: load finished, but load succeeded flag is not set.\n", stderr);
Index: src/bin/eve_scrolled_webview.c
===================================================================
--- src/bin/eve_scrolled_webview.c	(revision 40872)
+++ src/bin/eve_scrolled_webview.c	(working copy)
@@ -54,59 +54,12 @@
       Evas_Coord x, y;
       Ecore_Animator *anim;
    } mouse_move;
-   struct
-   {
-      Evas_Coord dx, dy;
-      Ecore_Animator *anim;
-   } scroll_delayed;
 };
 
 static Evas_Smart_Class _parent_sc = {NULL};
 static const char EDJE_PART_CONTENT[] = "eve.swallow.content";
 
 static void
-_eve_scrolled_webview_scroll_by(Eve_Scrolled_Webview_Data *priv, int dx, int dy)
-{
-   EWebKit_Hit_Test_Contents contents;
-   Evas_Object *webframe = ewk_webpage_object_mainframe_get(priv->page);
-   ewk_webframe_object_hit_test(webframe, &contents, priv->mouse_move.x, priv->mouse_move.y);
-   ewk_webframe_object_scroll(contents.frame, dx, dy);
-}
-
-static int
-_eve_scrolled_webview_scroll_by_delayed_do(void *data)
-{
-   Eve_Scrolled_Webview_Data *priv = data;
-
-   if ((priv->scroll_delayed.dx == 0) && (priv->scroll_delayed.dy == 0))
-     {
-        priv->scroll_delayed.anim = NULL;
-        return 0;
-     }
-
-   _eve_scrolled_webview_scroll_by
-     (priv, priv->scroll_delayed.dx, priv->scroll_delayed.dy);
-   priv->scroll_delayed.dx = 0;
-   priv->scroll_delayed.dy = 0;
-   return 1;
-}
-
-static void
-_eve_scrolled_webview_scroll_by_delayed(Eve_Scrolled_Webview_Data *priv, Evas_Coord dx, Evas_Coord dy)
-{
-   if ((dx == 0) && (dy == 0))
-     return;
-
-   priv->scroll_delayed.dx += dx;
-   priv->scroll_delayed.dy += dy;
-
-   if (priv->scroll_delayed.anim)
-     return;
-   priv->scroll_delayed.anim = ecore_animator_add
-     (_eve_scrolled_webview_scroll_by_delayed_do, priv);
-}
-
-static void
 _eve_scrolled_webview_on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
    Eve_Scrolled_Webview_Data *priv = data;
@@ -121,36 +74,9 @@
 	return;
      }
 
-   if (!ewk_event_feed_key_press(priv->webview, ev))
-      return;
-
    ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
 
-   if (strcmp(value,"Left") == 0)
-     _eve_scrolled_webview_scroll_by_delayed(priv, -10, 0);
-   else if (strcmp(value,"Right") == 0)
-     _eve_scrolled_webview_scroll_by_delayed(priv, 10, 0);
-   else if (strcmp(value,"Up") == 0)
-     _eve_scrolled_webview_scroll_by_delayed(priv, 0, -10);
-   else if (strcmp(value, "Down") == 0)
-     _eve_scrolled_webview_scroll_by_delayed(priv, 0, 10);
-   else if (strcmp(value, "Prior") == 0)
-     {
-        int offset;
-	edje_object_part_geometry_get
-	  (priv->edje, EDJE_PART_CONTENT, NULL, NULL, NULL, &offset);
-        offset = (offset * 9) / 10;
-        _eve_scrolled_webview_scroll_by_delayed(priv, 0, -offset);
-     }
-   else if (strcmp(value, "Next") == 0)
-     {
-        int offset;
-	edje_object_part_geometry_get
-	  (priv->edje, EDJE_PART_CONTENT, NULL, NULL, NULL, &offset);
-        offset = (offset * 9) / 10;
-        _eve_scrolled_webview_scroll_by_delayed(priv, 0, offset);
-     }
-   else if (strcmp(value, "Home") == 0)
+   if (strcmp(value, "Home") == 0)
      printf("Command:home\n");
    else if (strcmp(value, "End") == 0)
      printf("Command:end\n");
@@ -180,24 +106,12 @@
 }
 
 static void
-_eve_scrolled_webview_on_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
-{
-   Eve_Scrolled_Webview_Data *priv = data;
-   Evas_Event_Mouse_Move *ev = event_info;
-   ewk_event_feed_mouse_move(priv->webview, ev);
-}
-
-static void
 _eve_scrolled_webview_pan_anim_start(Eve_Scrolled_Webview_Data *priv)
 {
    if (priv->mouse_move.anim)
      return;
    priv->mouse_move.anim = ecore_animator_add
      (_eve_scrolled_webview_pan_anim, priv);
-
-   evas_object_event_callback_del
-     (priv->webview, EVAS_CALLBACK_MOUSE_MOVE,
-      _eve_scrolled_webview_on_mouse_move);
 }
 
 static void
@@ -207,15 +121,6 @@
      return;
    ecore_animator_del(priv->mouse_move.anim);
    priv->mouse_move.anim = NULL;
-
-   /* make sure it's not there already */
-   evas_object_event_callback_del
-     (priv->webview, EVAS_CALLBACK_MOUSE_MOVE,
-      _eve_scrolled_webview_on_mouse_move);
-
-   evas_object_event_callback_add
-     (priv->webview, EVAS_CALLBACK_MOUSE_MOVE,
-      _eve_scrolled_webview_on_mouse_move, priv);
 }
 
 static void
@@ -227,43 +132,14 @@
 
    evas_object_focus_set(priv->webview, 1);
 
-   ewk_event_feed_mouse_down(priv->webview, ev);
-
    _eve_scrolled_webview_pan_anim_stop(priv);
 }
 
 static void
-_eve_scrolled_webview_on_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
-{
-   Eve_Scrolled_Webview_Data *priv = data;
-   Evas_Event_Mouse_Up *ev = event_info;
-
-   ewk_event_feed_mouse_up(obj, ev);
-}
-
-static void
-_eve_scrolled_webview_on_mouse_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info)
-{
-   Eve_Scrolled_Webview_Data *priv = data;
-   Evas_Event_Mouse_Wheel *ev = event_info;
-   int offset = ev->z * 20;
-
-   if (offset == 0)
-     return;
-
-   if (ev->direction == 0)
-     _eve_scrolled_webview_scroll_by_delayed(priv, 0, offset);
-   else if (ev->direction == 1)
-     _eve_scrolled_webview_scroll_by_delayed(priv, offset, 0);
-}
-
-static void
 _eve_scrolled_webview_smart_del(Evas_Object *o)
 {
    EVE_SCROLLED_WEBVIEW_DATA_GET(o, priv);
 
-   if (priv->scroll_delayed.anim)
-     ecore_animator_del(priv->scroll_delayed.anim);
    _eve_scrolled_webview_pan_anim_stop(priv);
 
    evas_object_del(priv->webview); /* edje does not delete its children */
@@ -340,10 +216,7 @@
       void (*cb)(void *, Evas *, Evas_Object *, void *);
    } *itr, map[] = {
      {EVAS_CALLBACK_KEY_DOWN, _eve_scrolled_webview_on_key_down},
-     {EVAS_CALLBACK_MOUSE_MOVE, _eve_scrolled_webview_on_mouse_move},
      {EVAS_CALLBACK_MOUSE_DOWN, _eve_scrolled_webview_on_mouse_down},
-     {EVAS_CALLBACK_MOUSE_UP, _eve_scrolled_webview_on_mouse_up},
-     {EVAS_CALLBACK_MOUSE_WHEEL, _eve_scrolled_webview_on_mouse_wheel},
      {-1, NULL}
    };
    for (itr = map; itr->cb != NULL; itr++)
Index: src/bin/eve_navigator.c
===================================================================
--- src/bin/eve_navigator.c	(revision 40872)
+++ src/bin/eve_navigator.c	(working copy)
@@ -165,7 +165,7 @@
 
    printf("TODO: scroll requested: %dx%d %d,%d+%dx%d\n",
 	  ev->width, ev->height,
-	  ev->view.x, ev->view.y, ev->view.w, ev->view.h);
+	  ev->area.x, ev->area.y, ev->area.w, ev->area.h);
 }
 
 static void
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to