viking

webkit based web browser for Enlightenment
Log | Files | Refs | LICENSE

commit 56657f51e7989c5c9c6c3d0a5c8b08b37ad58658
parent b6117be5b1d39f730560b172cca4a2b2401e0f9b
Author: Kyle Milz <kmilz@ucalgary.ca>
Date:   Wed, 17 Oct 2012 22:05:34 -0600

hook up mouse wheel to scroll_cb

Diffstat:
Msrc/buffer.c | 11++++++-----
Msrc/utilities.c | 2++
2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/buffer.c b/src/buffer.c @@ -637,14 +637,14 @@ notify_event_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) ewk_frame_hit_test_free(result); return FALSE; } +*/ static void -webview_mousewheel_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +mousewheel_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { Buffer_Data *bd = data; - update_state(bd->window); + gui_scroll_update(bd->window); } -*/ Buffer_Data* buffer_add(const unsigned char flags, Window_Data *wd, const char *url, Session_Item *session_item) @@ -653,7 +653,8 @@ buffer_add(const unsigned char flags, Window_Data *wd, const char *url, Session_ Ewk_Settings *settings; bd = calloc(1, sizeof(Buffer_Data)); - if (!bd) return NULL; + if (!bd) + return NULL; /* if the InNewWindow flag is set, create the buffer in a new window */ if (flags & InNewWindow) @@ -729,7 +730,7 @@ buffer_add(const unsigned char flags, Window_Data *wd, const char *url, Session_ evas_object_event_callback_add(v, EVAS_CALLBACK_FREE, webview_free_cb, bd); evas_object_event_callback_add(v, EVAS_CALLBACK_KEY_DOWN, webview_keypress_cb, bd); // evas_object_event_callback_add(v, EVAS_CALLBACK_MOUSE_UP, notify_event_cb, bd); - // evas_object_event_callback_add(v, EVAS_CALLBACK_MOUSE_WHEEL, webview_mousewheel_cb, bd); + evas_object_event_callback_add(v, EVAS_CALLBACK_MOUSE_WHEEL, mousewheel_cb, bd); if (url) ewk_view_url_set(bd->view, url); diff --git a/src/utilities.c b/src/utilities.c @@ -662,6 +662,8 @@ gui_scroll_update(Window_Data *wd) Eina_Strbuf *buf = eina_strbuf_new(); int x, y, w, h, val; + evas_object_geometry_get(wd->cur_buf->view, &x, &y, &w, &h); + printf("scroll_update() %i, %i, %i, %i\n", x, y, w, h); ewk_frame_scroll_pos_get(frame, &x, &y); ewk_frame_scroll_size_get(frame, &w, &h);