viking

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

commit d136e09ecaacdd38295784850af5167929a799a9
parent d982a98f2c4d754e8f5381a344646052a36ad3a1
Author: Kyle Milz <kmilz@ucalgary.ca>
Date:   Mon,  8 Oct 2012 11:44:52 -0600

port text search to webkit2 functions

Diffstat:
Msrc/callbacks.c | 16++++++----------
Msrc/commands.c | 11+++++------
2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/src/callbacks.c b/src/callbacks.c @@ -487,12 +487,10 @@ inputbox_activate_cb(void *data, Evas_Object *obj, void *event_info) if (length > 1 && text[0] == ':') { process_line((text + 1), data); } else if (length > 1 && ((forward = text[0] == '/') || text[0] == '?')) { - // webkit_web_view_unmark_text_matches(webview); - // ewk_view_text_matches_unmark_all(wd->cur_buf->view); + ewk_view_text_find_highlight_clear(wd->cur_buf->view); - // webkit_web_view_mark_text_matches(webview, &text[1], FALSE, 0); - // webkit_web_view_set_highlight_text_matches(webview, TRUE); - // ewk_view_text_matches_mark(wd->cur_buf->view, &text[1], EINA_FALSE, EINA_TRUE, 0); + ewk_view_text_find(wd->cur_buf->view, &text[1], + EWK_FIND_OPTIONS_SHOW_HIGHLIGHT | EWK_FIND_OPTIONS_CASE_INSENSITIVE, 1000); wd->count = 0; wd->search_direction = forward; @@ -819,11 +817,9 @@ inputbox_changed_cb(void *data, Evas_Object *obj, void *event_info) // if (gtk_widget_is_focus(GTK_WIDGET(entry)) && length > 1 && ((forward = text[0] == '/') || text[0] == '?')) { if (elm_object_focus_get(wd->url) && length > 1 && ((forward = text[0] == '/') || text[0] == '?')) { - // webkit_web_view_unmark_text_matches(webview); - // ewk_view_text_matches_unmark_all(wd->cur_buf->view); - - // webkit_web_view_search_text(webview, &text[1], searchoptions & CaseSensitive, forward, searchoptions & Wrapping); - // ewk_view_text_search(wd->cur_buf->view, &text[1], EINA_TRUE, forward, EINA_FALSE); + ewk_view_text_find_highlight_clear(wd->cur_buf->view); + ewk_view_text_find(wd->cur_buf->view, &text[1], + EWK_FIND_OPTIONS_SHOW_HIGHLIGHT | EWK_FIND_OPTIONS_CASE_INSENSITIVE, 1000); return; // } else if (gtk_widget_is_focus(GTK_WIDGET(entry)) && length >= 1 && } else if (elm_object_focus_get(wd->url) && length >= 1 && diff --git a/src/commands.c b/src/commands.c @@ -689,6 +689,7 @@ search(const Arg *arg, void *data) ad->count = ad->count ? ad->count : 1; Eina_Bool success, direction = arg->i & DirectionPrev; Arg a; + char flags = EWK_FIND_OPTIONS_SHOW_HIGHLIGHT | EWK_FIND_OPTIONS_CASE_INSENSITIVE; if (arg->s) { free(ad->search_handle); @@ -701,12 +702,11 @@ search(const Arg *arg, void *data) else direction ^= ad->search_direction; do { - // success = webkit_web_view_search_text(webview, search_handle, arg->i & CaseSensitive, direction, FALSE); - // success = ewk_view_text_search(ad->cur_buf->view, ad->search_handle, arg->i & CaseSensitive, direction, FALSE); + success = ewk_view_text_find(ad->cur_buf->view, ad->search_handle, flags, 1000); if (!success) { if (arg->i & Wrapping) { - // success = webkit_web_view_search_text(webview, search_handle, arg->i & CaseSensitive, direction, TRUE); - // success = ewk_view_text_search(ad->cur_buf->view, ad->search_handle, arg->i & CaseSensitive, direction, EINA_TRUE); + success = ewk_view_text_find(ad->cur_buf->view, ad->search_handle, + flags | EWK_FIND_OPTIONS_WRAP_AROUND, 1000); if (success) { a.i = Warning; a.s = strdup_printf("search hit %s, continuing at %s", @@ -739,8 +739,7 @@ set(const Arg *arg, void *data) case ModeNormal: if (ad->search_handle) { ad->search_handle = NULL; - // webkit_web_view_unmark_text_matches(webview); - // ewk_view_text_matches_unmark_all(ad->cur_buf->view); + ewk_view_text_find_highlight_clear(ad->cur_buf->view); } // gtk_entry_set_text(GTK_ENTRY(inputbox), ""); // gtk_widget_grab_focus(GTK_WIDGET(webview));