diff options
Diffstat (limited to 'WebKit/efl')
-rw-r--r-- | WebKit/efl/CMakeListsEfl.txt | 148 | ||||
-rw-r--r-- | WebKit/efl/ChangeLog | 92 | ||||
-rw-r--r-- | WebKit/efl/EWebLauncher/main.c | 21 | ||||
-rw-r--r-- | WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp | 2 | ||||
-rw-r--r-- | WebKit/efl/WebCoreSupport/EditorClientEfl.cpp | 2 | ||||
-rw-r--r-- | WebKit/efl/ewk/ewk_cookies.cpp | 22 | ||||
-rw-r--r-- | WebKit/efl/ewk/ewk_main.cpp | 8 | ||||
-rw-r--r-- | WebKit/efl/ewk/ewk_private.h | 2 | ||||
-rw-r--r-- | WebKit/efl/ewk/ewk_settings.cpp | 24 | ||||
-rw-r--r-- | WebKit/efl/ewk/ewk_settings.h | 1 | ||||
-rw-r--r-- | WebKit/efl/ewk/ewk_view.cpp | 97 | ||||
-rw-r--r-- | WebKit/efl/ewk/ewk_view.h | 15 |
12 files changed, 418 insertions, 16 deletions
diff --git a/WebKit/efl/CMakeListsEfl.txt b/WebKit/efl/CMakeListsEfl.txt new file mode 100644 index 0000000..0701d22 --- /dev/null +++ b/WebKit/efl/CMakeListsEfl.txt @@ -0,0 +1,148 @@ +INCLUDE(WebKitEfl) + +LIST(APPEND WebKit_LINK_FLAGS + ${ECORE_X_LDFLAGS} + ${EDJE_LDFLAGS} + ${EFLDEPS_LDFLAGS} + ${EVAS_LDFLAGS} +) + +LIST(APPEND WebKit_INCLUDE_DIRECTORIES + "${WEBKIT_DIR}/efl/ewk" + "${WEBKIT_DIR}/efl/WebCoreSupport" + ${Cairo_INCLUDE_DIRS} + ${ECORE_X_INCLUDE_DIRS} + ${EDJE_INCLUDE_DIRS} + ${EFLDEPS_INCLUDE_DIRS} + ${EVAS_INCLUDE_DIRS} + ${LIBXML2_INCLUDE_DIRS} + ${LIBXSLT_INCLUDE_DIRS} + ${SQLITE_INCLUDE_DIRS} +) + +LIST(APPEND WebKit_SOURCES + efl/WebCoreSupport/ChromeClientEfl.cpp + efl/WebCoreSupport/ContextMenuClientEfl.cpp + efl/WebCoreSupport/DragClientEfl.cpp + efl/WebCoreSupport/EditorClientEfl.cpp + efl/WebCoreSupport/FrameLoaderClientEfl.cpp + efl/WebCoreSupport/InspectorClientEfl.cpp + + efl/ewk/ewk_contextmenu.cpp + efl/ewk/ewk_cookies.cpp + efl/ewk/ewk_frame.cpp + efl/ewk/ewk_history.cpp + efl/ewk/ewk_main.cpp + efl/ewk/ewk_settings.cpp + efl/ewk/ewk_util.cpp + efl/ewk/ewk_view.cpp + efl/ewk/ewk_view_single.c + efl/ewk/ewk_window_features.cpp +) + +LIST(APPEND WebKit_LIBRARIES + ${Cairo_LIBRARIES} + ${ECORE_X_LIBRARIES} + ${EFLDEPS_LIBRARIES} + ${Freetype_LIBRARIES} + ${LIBXML2_LIBRARIES} + ${Pango_LIBRARIES} + ${SQLITE_LIBRARIES} +) + +IF (ENABLE_GLIB_SUPPORT) + LIST(APPEND WebKit_INCLUDE_DIRECTORIES + ${Gdk_INCLUDE_DIRS} + ${Glib_INCLUDE_DIRS} + ) + LIST(APPEND WebKit_LIBRARIES + ${Glib_LIBRARIES} + ${Gdk_LIBRARIES} + ) +ENDIF () + +IF (WTF_USE_SOUP) + LIST(APPEND WebKit_INCLUDE_DIRECTORIES ${LIBSOUP24_INCLUDE_DIRS}) + LIST(APPEND WebKit_LIBRARIES ${LIBSOUP24_LIBRARIES}) +ENDIF () + +IF (WTF_USE_CURL) + LIST(APPEND WebKit_INCLUDE_DIRECTORIES ${CURL_INCLUDE_DIRS}) + LIST(APPEND WebKit_LIBRARIES ${CURL_LIBRARIES}) +ENDIF () + +FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme) +GENERATE_EDJ( + ${WEBKIT_DIR}/efl/DefaultTheme/default.edc + ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme/default.edj + "-id;${WEBKIT_DIR}/efl/DefaultTheme" +) + +SET(EWebLauncher_SOURCES + efl/DefaultTheme/default.edj + efl/EWebLauncher/main.c +) + +SET(EWebLauncher_LIBRARIES + ${JavaScriptCore_LIBRARY_NAME} + ${WebCore_LIBRARY_NAME} + ${WebKit_LIBRARY_NAME} + ${Cairo_LIBRARIES} + ${ECORE_X_LIBRARIES} + ${EDJE_LIBRARIES} + ${EFLDEPS_LIBRARIES} + ${EVAS_LIBRARIES} + ${LIBXML2_LIBRARIES} + ${LIBXSLT_LIBRARIES} + ${SQLITE_LIBRARIES} +) + +SET(EWebLauncher_LINK_FLAGS + ${ECORE_X_LDFLAGS} + ${EDJE_LDFLAGS} + ${EFLDEPS_LDFLAGS} + ${EVAS_LDFLAGS} +) + +IF (ENABLE_GLIB_SUPPORT) + LIST(APPEND EWebLauncher_LIBRARIES + ${Gdk_LIBRARIES} + ${Glib_LIBRARIES} + ${GTHREAD_LIBRARIES} + ) +ENDIF () + +IF (WTF_USE_SOUP) + LIST(APPEND EWebLauncher_LIBRARIES ${LIBSOUP24_LIBRARIES}) + LIST(APPEND EWebLauncher_LINK_FLAGS ${LIBSOUP24_LDFLAGS}) +ENDIF () + +IF (WTF_USE_CURL) + LIST(APPEND EWebLauncher_LIBRARIES ${CURL_LIBRARIES}) + LIST(APPEND EWebLauncher_LINK_FLAGS ${CURL_LDFLAGS}) +ENDIF () + +ADD_EXECUTABLE(../Programs/EWebLauncher ${EWebLauncher_SOURCES}) +TARGET_LINK_LIBRARIES(../Programs/EWebLauncher ${EWebLauncher_LIBRARIES}) +ADD_TARGET_PROPERTIES(../Programs/EWebLauncher LINK_FLAGS "${EWebLauncher_LINK_FLAGS}") + +IF (SHARED_CORE) + SET(LIBS_PRIVATE "-l${WTF_LIBRARY_NAME} -l${JavaScriptCore_LIBRARY_NAME} -l${WebCore_LIBRARY_NAME}") +ELSE () + SET(LIBS_PRIVATE "") +ENDIF () + +CONFIGURE_FILE( + efl/ewebkit.pc.in + ${CMAKE_BINARY_DIR}/WebKit/efl/ewebkit.pc + @ONLY) +INSTALL(FILES ${CMAKE_BINARY_DIR}/WebKit/efl/ewebkit.pc + DESTINATION lib/pkgconfig) + +UNSET(LIBS_PRIVATE) + +FILE(GLOB EWebKit_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/*.h") +LIST(REMOVE_ITEM EWebKit_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_private.h") + +INSTALL(FILES ${EWebKit_HEADERS} + DESTINATION include/EWebKit) diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog index b5ad1d7..ad44392 100644 --- a/WebKit/efl/ChangeLog +++ b/WebKit/efl/ChangeLog @@ -1,3 +1,95 @@ +2010-07-26 Steve Block <steveblock@google.com> + + Reviewed by Jeremy Orlow. + + Page clients should be passed to Page constructor via structure of pointers + https://bugs.webkit.org/show_bug.cgi?id=42834 + + * ewk/ewk_view.cpp: + (_ewk_view_priv_new): + +2010-07-26 Rafael Antognolli <antognolli@profusion.mobi> + + Reviewed by Antonio Gomes. + + [EFL] Move CMakeListsEfl.txt to WebKit/efl/ + https://bugs.webkit.org/show_bug.cgi?id=43002 + + This should reduce the noise in WebKit/ChangeLog that comes from EFL + port. Most of the changes on EFL port should be logged in + WebKit/efl/ChangeLog. + + * CMakeListsEfl.txt: Renamed from WebKit/CMakeListsEfl.txt. + +2010-07-23 Rafael Antognolli <antognolli@profusion.mobi> + + Reviewed by Antonio Gomes. + + [EFL] Cleanup glib support (make it optional) + https://bugs.webkit.org/show_bug.cgi?id=42480 + + Put some ifdefs on glib calls. + + * ewk/ewk_main.cpp: + (ewk_init): + +2010-07-23 Rafael Antognolli <antognolli@profusion.mobi> + + Reviewed by Antonio Gomes. + + [EFL] Add support for using libcurl network backend. + https://bugs.webkit.org/show_bug.cgi?id=42286 + + Put some ifdefs around soup calls. + + * ewk/ewk_cookies.cpp: + (ewk_cookies_file_set): + (ewk_cookies_clear): + (ewk_cookies_get_all): + (ewk_cookies_cookie_del): + (ewk_cookies_cookie_free): + (ewk_cookies_policy_set): + (ewk_cookies_policy_get): + * ewk/ewk_main.cpp: + (ewk_init): + +2010-07-23 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + Notify browser when window shall be closed. + + This is used for window.close() events Javascript, though it would be + triggered for any event on WebCore that might ask for the window to be + closed. + + https://bugs.webkit.org/show_bug.cgi?id=42890 + + * WebCoreSupport/ChromeClientEfl.cpp: + (WebCore::ChromeClientEfl::closeWindowSoon): call new function and moves its + previous functionality there. + * ewk/ewk_private.h: + * ewk/ewk_view.cpp: + (ewk_view_window_close): stop all loaders as was being done previously and + notify browser afterwards. + * ewk/ewk_view.h: declare new virtual method. + +2010-07-23 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Set proxy address for Soup + https://bugs.webkit.org/show_bug.cgi?id=42721 + + Sets the given proxy URI for libsoup network backend. This method will + support libcurl network backend later. + + * EWebLauncher/main.c: + (main): Invoke proxy set method + * ewk/ewk_settings.cpp: + (ewk_settings_proxy_uri_set): Sets proxy URI. + * ewk/ewk_settings.h: + 2010-07-16 Leandro Pereira <leandro@profusion.mobi> Reviewed by Gustavo Noronha Silva. diff --git a/WebKit/efl/EWebLauncher/main.c b/WebKit/efl/EWebLauncher/main.c index 6980a58..c1956a2 100644 --- a/WebKit/efl/EWebLauncher/main.c +++ b/WebKit/efl/EWebLauncher/main.c @@ -373,6 +373,21 @@ on_tooltip_text_set(void* user_data, Evas_Object* webview, void* event_info) info("%s\n", text); } +static void +on_inputmethod_changed(void* user_data, Evas_Object* webview, void* event_info) +{ + Eina_Bool active = (Eina_Bool)(long)event_info; + unsigned int imh; + info("Keyboard changed: %d\n", active); + + if (!active) + return; + + imh = ewk_view_imh_get(webview); + info(" Keyboard flags: %#.2x\n", imh); + +} + /** * "viewport,changed" signal will be always emitted regardless of the viewport existence. * @@ -661,6 +676,7 @@ browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Re evas_object_smart_callback_add(app->browser, "menubar,visible,set", on_menubar_visible_set, app); evas_object_smart_callback_add(app->browser, "menubar,visible,get", on_menubar_visible_get, app); evas_object_smart_callback_add(app->browser, "tooltip,text,set", on_tooltip_text_set, app); + evas_object_smart_callback_add(app->browser, "inputmethod,changed", on_inputmethod_changed, app); /* ewk_callback_resize_requested_add(app->browser, on_resize_requested, app->ee); */ @@ -756,6 +772,7 @@ main(int argc, char *argv[]) char *url = NULL; char *userAgent = NULL; const char *tmp; + const char *proxyUri; char path[PATH_MAX]; char *engine = NULL; @@ -818,6 +835,10 @@ main(int argc, char *argv[]) ewk_settings_icon_database_path_set(path); ewk_settings_web_database_path_set(path); + proxyUri = getenv("http_proxy"); + if (proxyUri) + ewk_settings_proxy_uri_set(proxyUri); + browserCreate(url, theme, userAgent, geometry, engine, isFullscreen); ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, &windows); diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp index 4b01b75..ffbd642 100644 --- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp @@ -231,7 +231,7 @@ void ChromeClientEfl::setResizable(bool) void ChromeClientEfl::closeWindowSoon() { - ewk_view_stop(m_view); + ewk_view_window_close(m_view); } bool ChromeClientEfl::canTakeFocus(FocusDirection) diff --git a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp index cf672eb..a63b712 100644 --- a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp @@ -47,7 +47,7 @@ void EditorClientEfl::willSetInputMethodState() void EditorClientEfl::setInputMethodState(bool active) { - notImplemented(); + ewk_view_input_method_state_set(m_view, active); } bool EditorClientEfl::shouldDeleteRange(Range*) diff --git a/WebKit/efl/ewk/ewk_cookies.cpp b/WebKit/efl/ewk/ewk_cookies.cpp index 3b4949e..421f8dc 100644 --- a/WebKit/efl/ewk/ewk_cookies.cpp +++ b/WebKit/efl/ewk/ewk_cookies.cpp @@ -21,14 +21,18 @@ #include "config.h" #include "ewk_cookies.h" +#ifdef WTF_USE_SOUP #include "CookieJarSoup.h" +#endif #include "EWebKit.h" #include "ResourceHandle.h" #include <Eina.h> #include <eina_safety_checks.h> +#ifdef WTF_USE_SOUP #include <glib.h> #include <libsoup/soup.h> +#endif #include <wtf/text/CString.h> @@ -43,6 +47,7 @@ */ EAPI Eina_Bool ewk_cookies_file_set(const char *filename) { +#ifdef WTF_USE_SOUP SoupCookieJar* cookieJar = 0; if (filename) cookieJar = soup_cookie_jar_text_new(filename, FALSE); @@ -65,6 +70,9 @@ EAPI Eina_Bool ewk_cookies_file_set(const char *filename) soup_session_add_feature(session, SOUP_SESSION_FEATURE(cookieJar)); return EINA_TRUE; +#else + return EINA_FALSE; +#endif } /** @@ -72,6 +80,7 @@ EAPI Eina_Bool ewk_cookies_file_set(const char *filename) */ EAPI void ewk_cookies_clear() { +#ifdef WTF_USE_SOUP GSList* l; GSList* p; SoupCookieJar* cookieJar = WebCore::defaultCookieJar(); @@ -81,6 +90,7 @@ EAPI void ewk_cookies_clear() soup_cookie_jar_delete_cookie(cookieJar, (SoupCookie*)p->data); soup_cookies_free(l); +#endif } /** @@ -90,9 +100,10 @@ EAPI void ewk_cookies_clear() */ EAPI Eina_List* ewk_cookies_get_all(void) { + Eina_List* el = 0; +#ifdef WTF_USE_SOUP GSList* l; GSList* p; - Eina_List* el = 0; SoupCookieJar* cookieJar = WebCore::defaultCookieJar(); l = soup_cookie_jar_all_cookies(cookieJar); @@ -110,6 +121,7 @@ EAPI Eina_List* ewk_cookies_get_all(void) } soup_cookies_free(l); +#endif return el; } @@ -123,6 +135,7 @@ EAPI Eina_List* ewk_cookies_get_all(void) */ EAPI void ewk_cookies_cookie_del(Ewk_Cookie *cookie) { +#ifdef WTF_USE_SOUP EINA_SAFETY_ON_NULL_RETURN(cookie); GSList* l; GSList* p; @@ -141,6 +154,7 @@ EAPI void ewk_cookies_cookie_del(Ewk_Cookie *cookie) soup_cookie_free(c1); soup_cookies_free(l); +#endif } /* @@ -150,12 +164,14 @@ EAPI void ewk_cookies_cookie_del(Ewk_Cookie *cookie) */ EAPI void ewk_cookies_cookie_free(Ewk_Cookie *cookie) { +#ifdef WTF_USE_SOUP EINA_SAFETY_ON_NULL_RETURN(cookie); free(cookie->name); free(cookie->value); free(cookie->domain); free(cookie->path); free(cookie); +#endif } /* @@ -170,6 +186,7 @@ EAPI void ewk_cookies_cookie_free(Ewk_Cookie *cookie) */ EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p) { +#ifdef WTF_USE_SOUP #ifdef HAVE_LIBSOUP_2_29_90 SoupCookieJar* cookieJar = WebCore::defaultCookieJar(); SoupCookieJarAcceptPolicy policy; @@ -189,6 +206,7 @@ EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p) soup_cookie_jar_set_accept_policy(cookieJar, policy); #endif +#endif } /* @@ -199,6 +217,7 @@ EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p) EAPI Ewk_Cookie_Policy ewk_cookies_policy_get() { Ewk_Cookie_Policy ewk_policy = EWK_COOKIE_JAR_ACCEPT_ALWAYS; +#ifdef WTF_USE_SOUP #ifdef HAVE_LIBSOUP_2_29_90 SoupCookieJar* cookieJar = WebCore::defaultCookieJar(); SoupCookieJarAcceptPolicy policy; @@ -216,6 +235,7 @@ EAPI Ewk_Cookie_Policy ewk_cookies_policy_get() break; } #endif +#endif return ewk_policy; } diff --git a/WebKit/efl/ewk/ewk_main.cpp b/WebKit/efl/ewk/ewk_main.cpp index 92346e7..5742766 100644 --- a/WebKit/efl/ewk/ewk_main.cpp +++ b/WebKit/efl/ewk/ewk_main.cpp @@ -37,7 +37,7 @@ #include <Evas.h> #include <stdlib.h> -#ifdef ENABLE_GLIB_SUPPORT +#if ENABLE(GLIB_SUPPORT) #include <glib-object.h> #include <glib.h> @@ -47,9 +47,11 @@ #endif +#ifdef WTF_USE_SOUP // REMOVE-ME: see todo below #include "ResourceHandle.h" #include <libsoup/soup.h> +#endif static int _ewk_init_count = 0; int _ewk_log_dom = -1; @@ -88,7 +90,7 @@ int ewk_init(void) goto error_edje; } -#ifdef ENABLE_GLIB_SUPPORT +#if ENABLE(GLIB_SUPPORT) g_type_init(); if (!g_thread_supported()) @@ -119,10 +121,12 @@ int ewk_init(void) ewk_settings_web_database_path_set(getenv("HOME")); // TODO: this should move to WebCore, already reported to webkit-gtk folks: +#ifdef WTF_USE_SOUP if (1) { SoupSession* session = WebCore::ResourceHandle::defaultSession(); soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_SNIFFER); } +#endif return ++_ewk_init_count; diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h index c549ad7..2096e76 100644 --- a/WebKit/efl/ewk/ewk_private.h +++ b/WebKit/efl/ewk/ewk_private.h @@ -49,6 +49,7 @@ struct ContextMenuItem; } void ewk_view_ready(Evas_Object *o); +void ewk_view_input_method_state_set(Evas_Object* o, Eina_Bool active); void ewk_view_title_set(Evas_Object *o, const char *title); void ewk_view_uri_changed(Evas_Object *o); void ewk_view_load_started(Evas_Object *o); @@ -62,6 +63,7 @@ void ewk_view_load_progress_changed(Evas_Object *o); void ewk_view_load_show(Evas_Object* o); void ewk_view_restore_state(Evas_Object *o, Evas_Object *frame); Evas_Object *ewk_view_window_create(Evas_Object *o, Eina_Bool javascript, const WebCore::WindowFeatures* coreFeatures); +void ewk_view_window_close(Evas_Object *o); void ewk_view_mouse_link_hover_in(Evas_Object *o, void *data); void ewk_view_mouse_link_hover_out(Evas_Object *o); diff --git a/WebKit/efl/ewk/ewk_settings.cpp b/WebKit/efl/ewk/ewk_settings.cpp index b50cd75..e775ac9 100644 --- a/WebKit/efl/ewk/ewk_settings.cpp +++ b/WebKit/efl/ewk/ewk_settings.cpp @@ -39,6 +39,11 @@ #include <sys/types.h> #include <unistd.h> +#if USE(SOUP) +#include "ResourceHandle.h" +#include <libsoup/soup.h> +#endif + static uint64_t _ewk_default_web_database_quota = 1 * 1024 * 1024; /** @@ -223,3 +228,22 @@ Evas_Object* ewk_settings_icon_database_icon_object_add(const char* url, Evas* c surface = icon->nativeImageForCurrentFrame(); return ewk_util_image_from_cairo_surface_add(canvas, surface); } + +/** + * Sets the given proxy URI to network backend. + * + * @param proxy URI. + */ +void ewk_settings_proxy_uri_set(const char* proxy) +{ +#if USE(SOUP) + SoupURI* uri = soup_uri_new(proxy); + EINA_SAFETY_ON_NULL_RETURN(uri); + + SoupSession* session = WebCore::ResourceHandle::defaultSession(); + g_object_set(session, SOUP_SESSION_PROXY_URI, uri, NULL); + soup_uri_free(uri); +#elif USE(CURL) + EINA_SAFETY_ON_TRUE_RETURN(1); +#endif +} diff --git a/WebKit/efl/ewk/ewk_settings.h b/WebKit/efl/ewk/ewk_settings.h index 87d015c..f2d77f7 100644 --- a/WebKit/efl/ewk/ewk_settings.h +++ b/WebKit/efl/ewk/ewk_settings.h @@ -48,6 +48,7 @@ EAPI Eina_Bool ewk_settings_icon_database_clear(void); EAPI cairo_surface_t *ewk_settings_icon_database_icon_surface_get(const char *url); EAPI Evas_Object *ewk_settings_icon_database_icon_object_add(const char *url, Evas *canvas); +EAPI void ewk_settings_proxy_uri_set(const char* proxy); #ifdef __cplusplus } diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp index 1707a7d..ed6fb4d 100644 --- a/WebKit/efl/ewk/ewk_view.cpp +++ b/WebKit/efl/ewk/ewk_view.cpp @@ -34,6 +34,9 @@ #include "FrameLoaderClientEfl.h" #include "FrameView.h" #include "GraphicsContext.h" +#include "HTMLElement.h" +#include "HTMLInputElement.h" +#include "HTMLNames.h" #include "InspectorClientEfl.h" #include "PlatformMouseEvent.h" #include "PopupMenuClient.h" @@ -79,6 +82,7 @@ struct _Ewk_View_Private_Data { size_t count; size_t allocated; } scrolls; + unsigned int imh; /**< input method hints */ struct { const char* user_agent; const char* user_stylesheet; @@ -525,16 +529,14 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd) CRITICAL("could not allocate Ewk_View_Private_Data"); return 0; } - priv->page = new WebCore::Page( - static_cast<WebCore::ChromeClient*>(new WebCore::ChromeClientEfl(sd->self)), - static_cast<WebCore::ContextMenuClient*>(new WebCore::ContextMenuClientEfl(sd->self)), - static_cast<WebCore::EditorClient*>(new WebCore::EditorClientEfl(sd->self)), - static_cast<WebCore::DragClient*>(new WebCore::DragClientEfl), - static_cast<WebCore::InspectorClient*>(new WebCore::InspectorClientEfl), - 0, - 0, - 0, - 0); + + WebCore::Page::PageClients pageClients; + pageClients.chromeClient = static_cast<WebCore::ChromeClient*>(new WebCore::ChromeClientEfl(sd->self)); + pageClients.contextMenuClient = static_cast<WebCore::ContextMenuClient*>(new WebCore::ContextMenuClientEfl(sd->self)); + pageClients.editorClient = static_cast<WebCore::EditorClient*>(new WebCore::EditorClientEfl(sd->self)); + pageClients.dragClient = static_cast<WebCore::DragClient*>(new WebCore::DragClientEfl); + pageClients.inspectorClient = static_cast<WebCore::InspectorClient*>(new WebCore::InspectorClientEfl); + priv->page = new WebCore::Page(pageClients); if (!priv->page) { CRITICAL("Could not create WebKit Page"); goto error_page; @@ -2150,6 +2152,20 @@ Eina_Bool ewk_view_pre_render_region(Evas_Object* o, Evas_Coord x, Evas_Coord y, } /** + * Get input method hints + * + * @param o View. + * + * @return input method hints + */ +unsigned int ewk_view_imh_get(Evas_Object *o) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0); + EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); + return priv->imh; +} + +/** * Cancel (clear) previous pre-render requests. * * @param o view to clear pre-render requests. @@ -3026,6 +3042,46 @@ void ewk_view_ready(Evas_Object* o) /** * @internal + * Reports the state of input method changed. This is triggered, for example + * when a input field received/lost focus + * + * Emits signal: "inputmethod,changed" with a boolean indicating whether it's + * enabled or not. + */ +void ewk_view_input_method_state_set(Evas_Object* o, Eina_Bool active) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd); + EWK_VIEW_PRIV_GET(sd, priv); + WebCore::Frame* focusedFrame = priv->page->focusController()->focusedOrMainFrame(); + + if (focusedFrame + && focusedFrame->document() + && focusedFrame->document()->focusedNode() + && focusedFrame->document()->focusedNode()->hasTagName(WebCore::HTMLNames::inputTag)) { + WebCore::HTMLInputElement* inputElement; + + inputElement = static_cast<WebCore::HTMLInputElement*>(focusedFrame->document()->focusedNode()); + if (inputElement) { + priv->imh = 0; + // for password fields, active == false + if (!active) { + active = inputElement->isPasswordField(); + priv->imh = inputElement->isPasswordField() * EWK_IMH_PASSWORD; + } else { + // Set input method hints for "number", "tel", "email", and "url" input elements. + priv->imh |= inputElement->isTelephoneField() * EWK_IMH_TELEPHONE; + priv->imh |= inputElement->isNumberField() * EWK_IMH_NUMBER; + priv->imh |= inputElement->isEmailField() * EWK_IMH_EMAIL; + priv->imh |= inputElement->isUrlField() * EWK_IMH_URL; + } + } + } + + evas_object_smart_callback_call(o, "inputmethod,changed", (void*)active); +} + +/** + * @internal * The view title was changed by the frame loader. * * Emits signal: "title,changed" with pointer to new title string. @@ -3234,6 +3290,27 @@ Evas_Object* ewk_view_window_create(Evas_Object* o, Eina_Bool javascript, const /** * @internal + * Reports a window should be closed. It's client responsibility to decide if + * the window should in fact be closed. So, if only windows created by javascript + * are allowed to be closed by this call, browser needs to save the javascript + * flag when the window is created. Since a window can close itself (for example + * with a 'self.close()' in Javascript) browser must postpone the deletion to an + * idler. + * + * @param o View to be closed. + */ +void ewk_view_window_close(Evas_Object* o) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd); + + ewk_view_stop(o); + if (!sd->api->window_close) + return; + sd->api->window_close(sd); +} + +/** + * @internal * Reports mouse has moved over a link. * * Emits signal: "link,hover,in" diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h index 209beff..19a3588 100644 --- a/WebKit/efl/ewk/ewk_view.h +++ b/WebKit/efl/ewk/ewk_view.h @@ -86,6 +86,7 @@ extern "C" { * and as arguments gives its details. * - "icon,received", void: main frame received an icon. * - "viewport,changed", void: Report that viewport has changed. + * - "inputmethods,changed" with a boolean indicating whether it's enabled or not. */ typedef struct _Ewk_View_Smart_Data Ewk_View_Smart_Data; @@ -99,6 +100,7 @@ struct _Ewk_View_Smart_Class { unsigned long version; Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd, Eina_Bool javascript, const Ewk_Window_Features *window_features); /**< creates a new window, requested by webkit */ + void (*window_close)(Ewk_View_Smart_Data *sd); /**< creates a new window, requested by webkit */ // hooks to allow different backing stores Evas_Object *(*backing_store_add)(Ewk_View_Smart_Data *sd); /**< must be defined */ Eina_Bool (*scrolls_process)(Ewk_View_Smart_Data *sd); /**< must be defined */ @@ -145,7 +147,7 @@ struct _Ewk_View_Smart_Class { * @see EWK_VIEW_SMART_CLASS_INIT_VERSION * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION */ -#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} /** * Initializer to zero a whole Ewk_View_Smart_Class structure. @@ -186,6 +188,15 @@ struct _Ewk_View_Smart_Class { */ #define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION(name) EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name)) +enum _Ewk_Imh { + EWK_IMH_TELEPHONE = (1 << 0), + EWK_IMH_NUMBER = (1 << 1), + EWK_IMH_EMAIL = (1 << 2), + EWK_IMH_URL = (1 << 3), + EWK_IMH_PASSWORD = (1 << 4) +}; +typedef enum _Ewk_Imh Ewk_Imh; + /** * @internal * @@ -357,6 +368,8 @@ EAPI Eina_Bool ewk_view_zoom_text_only_set(Evas_Object *o, Eina_Bool setting) EAPI Eina_Bool ewk_view_pre_render_region(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom); EAPI void ewk_view_pre_render_cancel(Evas_Object *o); +EAPI unsigned int ewk_view_imh_get(Evas_Object *o); + /* settings */ EAPI const char *ewk_view_setting_user_agent_get(const Evas_Object *o); EAPI Eina_Bool ewk_view_setting_user_agent_set(Evas_Object *o, const char *user_agent); |