diff options
Diffstat (limited to 'WebKit/efl')
-rw-r--r-- | WebKit/efl/CMakeListsEfl.txt | 11 | ||||
-rw-r--r-- | WebKit/efl/ChangeLog | 147 | ||||
-rw-r--r-- | WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.cpp | 197 | ||||
-rw-r--r-- | WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.h | 91 | ||||
-rw-r--r-- | WebKit/efl/ewk/ewk_frame.cpp | 62 | ||||
-rw-r--r-- | WebKit/efl/ewk/ewk_frame.h | 1 | ||||
-rw-r--r-- | WebKit/efl/ewk/ewk_main.cpp | 94 | ||||
-rw-r--r-- | WebKit/efl/ewk/ewk_view.cpp | 83 | ||||
-rw-r--r-- | WebKit/efl/ewk/ewk_view.h | 8 |
9 files changed, 651 insertions, 43 deletions
diff --git a/WebKit/efl/CMakeListsEfl.txt b/WebKit/efl/CMakeListsEfl.txt index cdb24ff..7b5865b 100644 --- a/WebKit/efl/CMakeListsEfl.txt +++ b/WebKit/efl/CMakeListsEfl.txt @@ -21,12 +21,23 @@ LIST(APPEND WebKit_INCLUDE_DIRECTORIES ${SQLITE_INCLUDE_DIRS} ) +IF (ENABLE_VIDEO) +LIST(APPEND WebKit_INCLUDE_DIRECTORIES + "${WEBCORE_DIR}/platform/graphics/gstreamer" + ${Gstreamer-App_INCLUDE_DIRS} + ${Gstreamer-Interfaces_INCLUDE_DIRS} + ${Gstreamer-Pbutils_INCLUDE_DIRS} + ${Gstreamer-Video_INCLUDE_DIRS} +) +ENDIF() + 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/FullscreenVideoControllerEfl.cpp efl/WebCoreSupport/InspectorClientEfl.cpp efl/ewk/ewk_contextmenu.cpp diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog index e1ce89a..bafa48d 100644 --- a/WebKit/efl/ChangeLog +++ b/WebKit/efl/ChangeLog @@ -1,3 +1,150 @@ +2010-08-31 Dave Hyatt <hyatt@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=44863, disentangle style recalc from layout, so that + the former can occur in more places without having to do the latter. + + * ewk/ewk_view.cpp: + (ewk_view_layout_if_needed_recursive): + +2010-08-31 Sam Weinig <sam@webkit.org> + + Reviewed by Darin Adler. + + Add ability to count text matches without marking + https://bugs.webkit.org/show_bug.cgi?id=43996 + + * ewk/ewk_frame.cpp: + (ewk_frame_text_matches_mark): Switched to call + countMatchesForText() instead of markAllMatchesForText(). + +2010-08-31 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Unreviewed build fix. + + [EFL] Build break for r66456 + https://bugs.webkit.org/post_bug.cgi + + Replace firstRectsForMarkers with renderedRectsForMarkers. + + * ewk/ewk_frame.cpp: + (ewk_frame_text_matches_nth_pos_get): + +2010-08-30 Kamil Blank <k.blank@samsung.com> + + Reviewed by Adam Barth. + + [EFL] Added API which returns position of n-th text matches mark + https://bugs.webkit.org/show_bug.cgi?id=44258 + + * ewk/ewk_frame.cpp: + (_ewk_frame_rect_cmp_less_than): Private. + (_ewk_frame_rect_is_negative_value): Private. + (ewk_frame_text_matches_nth_pos_get): Added. Function returns position of + n-th text match in frame. + * ewk/ewk_frame.h: + +2010-08-30 Ryuan Choi <ryuan.choi@samsung.com> + + Reviewed by Adam Barth. + + [EFL]Url of HistoryItem was broken for special character like korean + https://bugs.webkit.org/show_bug.cgi?id=44495 + + Remove unnecessary code. This makes a bug with complicated URL. + + * ewk/ewk_frame.cpp: + (ewk_frame_view_state_save): + +2010-08-30 Mikołaj Małecki <m.malecki@samsung.com> + + Reviewed by Kenneth Rohde Christiansen + + [EFL] Added initial setting to turn on offline pages. + https://bugs.webkit.org/show_bug.cgi?id=44239 + + * ewk/ewk_main.cpp: Torn off non-EFL init to _ewk_init_body + (ewk_init): Changed non-EFL init to call _ewk_init_body + (_ewk_init_body): Moved internal init here and added cache directory path setting. + * ewk/ewk_view.cpp: Added new config items: offline_app_cache and cache_directory + (_ewk_view_priv_new): creating cache_directory string + (_ewk_view_priv_del): deleting cache_directory string + (ewk_view_setting_offline_app_cache_get): + (ewk_view_setting_offline_app_cache_set): + (ewk_view_setting_cache_directory_get): + (ewk_view_setting_cache_directory_set): + * ewk/ewk_view.h: added offline_app_cache and cache_directory props to ewk API + +2010-08-26 Miroslaw Szymanski <miroslaw.s@samsung.com> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Added new callback when view's size is changed to fix issue with changing layout size + https://bugs.webkit.org/show_bug.cgi?id=44337 + + * ewk/ewk_view.cpp: + (_ewk_view_smart_calculate): + +2010-08-25 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Reviewed by Antonio Gomes. + + [EFL] Add dummy FullScreenVideoControllerEfl to WebKit EFL + https://bugs.webkit.org/show_bug.cgi?id=44590 + + Add FullScreenVideoControllerEfl to WebCoreSupport. However, + this is not implemented yet. + + * CMakeListsEfl.txt: + * WebCoreSupport/FullscreenVideoControllerEfl.cpp: Added. + (FullscreenVideoController::FullscreenVideoController): + (FullscreenVideoController::~FullscreenVideoController): + (FullscreenVideoController::setMediaElement): + (FullscreenVideoController::showHud): + (FullscreenVideoController::hideHud): + (FullscreenVideoController::enterFullscreen): + (FullscreenVideoController::updateHudPosition): + (FullscreenVideoController::exitOnUserRequest): + (FullscreenVideoController::exitFullscreen): + (FullscreenVideoController::canPlay): + (FullscreenVideoController::play): + (FullscreenVideoController::pause): + (FullscreenVideoController::playStateChanged): + (FullscreenVideoController::togglePlay): + (FullscreenVideoController::volume): + (FullscreenVideoController::muted): + (FullscreenVideoController::setVolume): + (FullscreenVideoController::volumeChanged): + (FullscreenVideoController::muteChanged): + (FullscreenVideoController::currentTime): + (FullscreenVideoController::setCurrentTime): + (FullscreenVideoController::duration): + (FullscreenVideoController::percentLoaded): + (FullscreenVideoController::beginSeek): + (FullscreenVideoController::doSeek): + (FullscreenVideoController::endSeek): + (timeToString): + (FullscreenVideoController::updateHudProgressBar): + (FullscreenVideoController::createHud): + * WebCoreSupport/FullscreenVideoControllerEfl.h: Added. + (FullscreenVideoController::mediaElement): + +2010-08-25 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Reviewed by Antonio Gomes. + + [EFL] Add setting API for enabling local storage. + https://bugs.webkit.org/show_bug.cgi?id=44319 + + Add API for enabling/disabling local storage. + + * ewk/ewk_view.cpp: + (_ewk_view_priv_new): + (ewk_view_setting_local_storage_get): Added + (ewk_view_setting_local_storage_set): Added + * ewk/ewk_view.h: + 2010-08-25 Jaehun Lim <ljaehun.lim@samsung.com> Reviewed by Antonio Gomes. diff --git a/WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.cpp b/WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.cpp new file mode 100644 index 0000000..6e5d599 --- /dev/null +++ b/WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.cpp @@ -0,0 +1,197 @@ +/* + * Copyright (C) 2010 Igalia S.L + * Copyright (C) 2010 Samsung Electronics + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "config.h" + +#if ENABLE(VIDEO) + +#include "FullscreenVideoControllerEfl.h" + +#include "MediaPlayer.h" +#include "NotImplemented.h" + +#include <gst/gst.h> + +using namespace std; +using namespace WebCore; + +FullscreenVideoController::FullscreenVideoController() + : m_hudTimeoutId(0) + , m_progressBarUpdateId(0) + , m_seekLock(false) + , m_window(0) + , m_hudWindow(0) +{ +} + +FullscreenVideoController::~FullscreenVideoController() +{ + exitFullscreen(); +} + +void FullscreenVideoController::setMediaElement(HTMLMediaElement* mediaElement) +{ + if (mediaElement == m_mediaElement) + return; + + m_mediaElement = mediaElement; + if (!m_mediaElement) { + // Can't do full-screen, just get out + exitFullscreen(); + } +} + +void FullscreenVideoController::showHud(bool autoHide) +{ + notImplemented(); +} + +void FullscreenVideoController::hideHud() +{ + notImplemented(); +} + +void FullscreenVideoController::enterFullscreen() +{ + notImplemented(); +} + +void FullscreenVideoController::updateHudPosition() +{ + notImplemented(); +} + +void FullscreenVideoController::exitOnUserRequest() +{ + notImplemented(); +} + +void FullscreenVideoController::exitFullscreen() +{ + notImplemented(); +} + +bool FullscreenVideoController::canPlay() const +{ + notImplemented(); +} + +void FullscreenVideoController::play() +{ + notImplemented(); +} + +void FullscreenVideoController::pause() +{ + notImplemented(); +} + +void FullscreenVideoController::playStateChanged() +{ + notImplemented(); +} + +void FullscreenVideoController::togglePlay() +{ + notImplemented(); +} + +float FullscreenVideoController::volume() const +{ + notImplemented(); + return 0; +} + +bool FullscreenVideoController::muted() const +{ + notImplemented(); + return false; +} + +void FullscreenVideoController::setVolume(float volume) +{ + notImplemented(); +} + +void FullscreenVideoController::volumeChanged() +{ + notImplemented(); +} + +void FullscreenVideoController::muteChanged() +{ + notImplemented(); +} + +float FullscreenVideoController::currentTime() const +{ + notImplemented(); + return 0; +} + +void FullscreenVideoController::setCurrentTime(float value) +{ + notImplemented(); +} + +float FullscreenVideoController::duration() const +{ + notImplemented(); + return 0; +} + +float FullscreenVideoController::percentLoaded() const +{ + notImplemented(); + return 0; +} + +void FullscreenVideoController::beginSeek() +{ + notImplemented(); +} + +void FullscreenVideoController::doSeek() +{ + notImplemented(); +} + +void FullscreenVideoController::endSeek() +{ + notImplemented(); +} + +static String timeToString(float time) +{ + notImplemented(); +} + +bool FullscreenVideoController::updateHudProgressBar() +{ + notImplemented(); + return false; +} + +void FullscreenVideoController::createHud() +{ + notImplemented(); +} + +#endif diff --git a/WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.h b/WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.h new file mode 100644 index 0000000..4bbae25 --- /dev/null +++ b/WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.h @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2010 Igalia S.L + * Copyright (C) 2010 Samsung Electronics + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef FullscreenVideoControllerEfl_h +#define FullscreenVideoControllerEfl_h + +#if ENABLE(VIDEO) + +#include "GStreamerGWorld.h" +#include "HTMLMediaElement.h" +#include <wtf/RefPtr.h> + +class FullscreenVideoController : public Noncopyable { +public: + FullscreenVideoController(); + virtual ~FullscreenVideoController(); + + void setMediaElement(WebCore::HTMLMediaElement*); + WebCore::HTMLMediaElement* mediaElement() const { return m_mediaElement.get(); } + + void enterFullscreen(); + void exitFullscreen(); + + void exitOnUserRequest(); + void togglePlay(); + void beginSeek(); + void doSeek(); + void endSeek(); + + void hideHud(); + void showHud(bool); + bool updateHudProgressBar(); + + float volume() const; + void setVolume(float); + void volumeChanged(); + void muteChanged(); + +private: + bool canPlay() const; + void play(); + void pause(); + void playStateChanged(); + + bool muted() const; + + float currentTime() const; + void setCurrentTime(float); + + float duration() const; + float percentLoaded() const; + + void createHud(); + void updateHudPosition(); + + RefPtr<WebCore::HTMLMediaElement> m_mediaElement; + RefPtr<WebCore::GStreamerGWorld> m_gstreamerGWorld; + + uint m_hudTimeoutId; + uint m_progressBarUpdateId; + uint m_progressBarFillUpdateId; + uint m_hscaleUpdateId; + uint m_volumeUpdateId; + bool m_seekLock; + PlatformWidget* m_window; + PlatformWidget* m_hudWindow; + PlatformWidget* m_timeHScale; + PlatformWidget* m_timeLabel; + PlatformWidget* m_volumeButton; +}; + +#endif + +#endif // FullscreenVideoControllerEfl_h diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp index 7a2af5a..a7ce1ff 100644 --- a/WebKit/efl/ewk/ewk_frame.cpp +++ b/WebKit/efl/ewk/ewk_frame.cpp @@ -44,14 +44,15 @@ #include "ScriptValue.h" #include "SharedBuffer.h" #include "SubstituteData.h" -#include "ZoomMode.h" #include "WindowsKeyboardCodes.h" +#include "ZoomMode.h" #include "ewk_private.h" -#include <wtf/text/CString.h> #include <Eina.h> #include <Evas.h> +#include <algorithm> #include <eina_safety_checks.h> +#include <wtf/text/CString.h> static const char EWK_FRAME_TYPE_STR[] = "EWK_Frame"; @@ -771,7 +772,7 @@ unsigned int ewk_frame_text_matches_mark(Evas_Object* o, const char* string, Ein EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0); sd->frame->setMarkedTextMatchesAreHighlighted(highlight); - return sd->frame->markAllMatchesForText(WTF::String::fromUTF8(string), case_sensitive, limit); + return sd->frame->countMatchesForText(WTF::String::fromUTF8(string), case_sensitive, limit, true); } /** @@ -820,6 +821,55 @@ Eina_Bool ewk_frame_text_matches_highlight_get(const Evas_Object* o) return sd->frame->markedTextMatchesAreHighlighted(); } +/** + * Comparison function used by ewk_frame_text_matches_nth_pos_get + */ +static bool _ewk_frame_rect_cmp_less_than(const WebCore::IntRect& i, const WebCore::IntRect& j) +{ + return (i.y() < j.y() || (i.y() == j.y() && i.x() < j.x())); +} + +/** + * Predicate used by ewk_frame_text_matches_nth_pos_get + */ +static bool _ewk_frame_rect_is_negative_value(const WebCore::IntRect& i) +{ + return (i.x() < 0 || i.y() < 0); +} + +/** + * Get x, y position of n-th text match in frame + * + * @param o frame object where matches are highlighted. + * @param n index of element + * @param x where to return x position. May be @c NULL. + * @param y where to return y position. May be @c NULL. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE for failure - when no matches found or + * n bigger than search results. + */ +Eina_Bool ewk_frame_text_matches_nth_pos_get(Evas_Object* o, int n, int* x, int* y) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + + Vector<WebCore::IntRect> intRects = sd->frame->document()->markers()->renderedRectsForMarkers(WebCore::DocumentMarker::TextMatch); + + /* remove useless values */ + std::remove_if(intRects.begin(), intRects.end(), _ewk_frame_rect_is_negative_value); + + if (intRects.isEmpty() || n > intRects.size()) + return EINA_FALSE; + + std::sort(intRects.begin(), intRects.end(), _ewk_frame_rect_cmp_less_than); + + if (x) + *x = intRects[n - 1].x(); + if (y) + *y = intRects[n - 1].y(); + return EINA_TRUE; +} + /** * Ask frame to stop loading. * @@ -1687,12 +1737,6 @@ void ewk_frame_did_perform_first_navigation(Evas_Object *o) */ void ewk_frame_view_state_save(Evas_Object *o, WebCore::HistoryItem* item) { - const char *title = ewk_frame_title_get(o); - const char *uri = ewk_frame_uri_get(o); - - item->setTitle(WTF::String::fromUTF8(title)); - item->setURLString(WTF::String::fromUTF8(uri)); - evas_object_smart_callback_call(o, "state,save", 0); } diff --git a/WebKit/efl/ewk/ewk_frame.h b/WebKit/efl/ewk/ewk_frame.h index 1a9fe81..9394446 100644 --- a/WebKit/efl/ewk/ewk_frame.h +++ b/WebKit/efl/ewk/ewk_frame.h @@ -160,6 +160,7 @@ EAPI unsigned int ewk_frame_text_matches_mark(Evas_Object *o, const char *string EAPI Eina_Bool ewk_frame_text_matches_unmark_all(Evas_Object *o); EAPI Eina_Bool ewk_frame_text_matches_highlight_set(Evas_Object *o, Eina_Bool highlight); EAPI Eina_Bool ewk_frame_text_matches_highlight_get(const Evas_Object *o); +EAPI Eina_Bool ewk_frame_text_matches_nth_pos_get(Evas_Object *o, int n, int *x, int *y); EAPI Eina_Bool ewk_frame_stop(Evas_Object *o); EAPI Eina_Bool ewk_frame_reload(Evas_Object *o); diff --git a/WebKit/efl/ewk/ewk_main.cpp b/WebKit/efl/ewk/ewk_main.cpp index 1cd5e42..8c27478 100644 --- a/WebKit/efl/ewk/ewk_main.cpp +++ b/WebKit/efl/ewk/ewk_main.cpp @@ -21,6 +21,7 @@ #include "config.h" #include "ewk_main.h" +#include "appcache/ApplicationCacheStorage.h" #include "EWebKit.h" #include "Logging.h" #include "PageCache.h" @@ -36,6 +37,7 @@ #include <Eina.h> #include <Evas.h> #include <stdlib.h> +#include <sys/stat.h> #if ENABLE(GLIB_SUPPORT) #include <glib-object.h> @@ -56,6 +58,8 @@ static int _ewk_init_count = 0; int _ewk_log_dom = -1; +static Eina_Bool _ewk_init_body(void); + int ewk_init(void) { if (_ewk_init_count) @@ -90,6 +94,44 @@ int ewk_init(void) goto error_edje; } + _ewk_init_body(); + + return ++_ewk_init_count; + +error_edje: + ecore_evas_shutdown(); +error_ecore_evas: + ecore_shutdown(); +error_ecore: + evas_shutdown(); +error_evas: + eina_log_domain_unregister(_ewk_log_dom); + _ewk_log_dom = -1; +error_log_domain: + eina_shutdown(); +error_eina: + return 0; +} + +int ewk_shutdown(void) +{ + _ewk_init_count--; + if (_ewk_init_count) + return _ewk_init_count; + + ecore_evas_shutdown(); + ecore_shutdown(); + evas_shutdown(); + eina_log_domain_unregister(_ewk_log_dom); + _ewk_log_dom = -1; + eina_shutdown(); + + return 0; +} + +Eina_Bool _ewk_init_body(void) +{ + #if ENABLE(GLIB_SUPPORT) g_type_init(); @@ -117,8 +159,24 @@ int ewk_init(void) WebCore::pageCache()->setCapacity(3); WebCore::PageGroup::setShouldTrackVisitedLinks(true); - // set default location of web database path - ewk_settings_web_database_path_set(getenv("HOME")); + // set default location of web database path and appcache dir + const char* home = getenv("HOME"); + if (!home) // don't forget about the homeless + home = "/tmp"; // this directory must always exist + + // anyway, check it first + struct stat state; + if (stat(home, &state) == -1) { + // Exit now - otherwise you may have some crash later + int errnowas = errno; + CRITICAL("Can't access HOME dir (or /tmp) - no place to save databases: %s", strerror(errnowas)); + return EINA_FALSE; + } + + WTF::String wkdir = WTF::String(home) + "/.webkit"; + ewk_settings_web_database_path_set(wkdir.utf8().data()); + + WebCore::cacheStorage().setCacheDirectory(wkdir); // TODO: this should move to WebCore, already reported to webkit-gtk folks: #ifdef WTF_USE_SOUP @@ -129,36 +187,6 @@ int ewk_init(void) } #endif - return ++_ewk_init_count; - -error_edje: - ecore_evas_shutdown(); -error_ecore_evas: - ecore_shutdown(); -error_ecore: - evas_shutdown(); -error_evas: - eina_log_domain_unregister(_ewk_log_dom); - _ewk_log_dom = -1; -error_log_domain: - eina_shutdown(); -error_eina: - return 0; -} - -int ewk_shutdown(void) -{ - _ewk_init_count--; - if (_ewk_init_count) - return _ewk_init_count; - - ecore_evas_shutdown(); - ecore_shutdown(); - evas_shutdown(); - eina_log_domain_unregister(_ewk_log_dom); - _ewk_log_dom = -1; - eina_shutdown(); - - return 0; + return EINA_TRUE; } diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp index 4a100d7..ea54167 100644 --- a/WebKit/efl/ewk/ewk_view.cpp +++ b/WebKit/efl/ewk/ewk_view.cpp @@ -22,6 +22,7 @@ #include "config.h" #include "ewk_view.h" +#include "appcache/ApplicationCacheStorage.h" #include "ChromeClientEfl.h" #include "ContextMenuClientEfl.h" #include "ContextMenuController.h" @@ -88,6 +89,7 @@ struct _Ewk_View_Private_Data { const char* user_stylesheet; const char* encoding_default; const char* encoding_custom; + const char* cache_directory; int font_minimum_size; int font_minimum_logical_size; int font_default_size; @@ -108,6 +110,8 @@ struct _Ewk_View_Private_Data { Eina_Bool private_browsing:1; Eina_Bool caret_browsing:1; Eina_Bool spatial_navigation:1; + Eina_Bool local_storage:1; + Eina_Bool offline_app_cache: 1; struct { float w; float h; @@ -560,6 +564,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd) priv->page_settings->setJavaScriptEnabled(true); priv->page_settings->setPluginsEnabled(true); priv->page_settings->setLocalStorageEnabled(true); + priv->page_settings->setOfflineWebApplicationCacheEnabled(true); url = priv->page_settings->userStyleSheetLocation(); priv->settings.user_stylesheet = eina_stringshare_add(url.prettyURL().utf8().data()); @@ -568,6 +573,9 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd) (priv->page_settings->defaultTextEncodingName().utf8().data()); priv->settings.encoding_custom = 0; + priv->settings.cache_directory = eina_stringshare_add + (WebCore::cacheStorage().cacheDirectory().utf8().data()); + priv->settings.font_minimum_size = priv->page_settings->minimumFontSize(); priv->settings.font_minimum_logical_size = priv->page_settings->minimumLogicalFontSize(); priv->settings.font_default_size = priv->page_settings->defaultFontSize(); @@ -595,6 +603,8 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd) priv->settings.resizable_textareas = priv->page_settings->textAreasAreResizable(); priv->settings.private_browsing = priv->page_settings->privateBrowsingEnabled(); priv->settings.caret_browsing = priv->page_settings->caretBrowsingEnabled(); + priv->settings.local_storage = priv->page_settings->localStorageEnabled(); + priv->settings.offline_app_cache = true; // XXX no function to read setting; this keeps the original setting // Since there's no scale separated from zooming in webkit-efl, this functionality of // viewport meta tag is implemented using zoom. When scale zoom is supported by webkit-efl, @@ -641,6 +651,7 @@ static void _ewk_view_priv_del(Ewk_View_Private_Data* priv) eina_stringshare_del(priv->settings.user_stylesheet); eina_stringshare_del(priv->settings.encoding_default); eina_stringshare_del(priv->settings.encoding_custom); + eina_stringshare_del(priv->settings.cache_directory); eina_stringshare_del(priv->settings.font_standard); eina_stringshare_del(priv->settings.font_cursive); eina_stringshare_del(priv->settings.font_monospace); @@ -794,6 +805,9 @@ static void _ewk_view_smart_calculate(Evas_Object* o) sd->changed.frame_rect = EINA_TRUE; sd->view.w = w; sd->view.h = h; + + // This callback is a good place e.g. to change fixed layout size (ewk_view_fixed_layout_size_set). + evas_object_smart_callback_call(o, "view,resized", 0); } sd->changed.size = EINA_FALSE; @@ -2385,6 +2399,26 @@ Eina_Bool ewk_view_setting_private_browsing_set(Evas_Object* o, Eina_Bool enable return EINA_TRUE; } +Eina_Bool ewk_view_setting_offline_app_cache_get(const Evas_Object* o) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); + return priv->settings.offline_app_cache; +} + +Eina_Bool ewk_view_setting_offline_app_cache_set(Evas_Object* o, Eina_Bool enable) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); + enable = !!enable; + if (priv->settings.offline_app_cache != enable) { + priv->page_settings->setOfflineWebApplicationCacheEnabled(enable); + priv->settings.offline_app_cache = enable; + } + return EINA_TRUE; +} + + Eina_Bool ewk_view_setting_caret_browsing_get(const Evas_Object* o) { EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); @@ -2465,6 +2499,22 @@ Eina_Bool ewk_view_setting_encoding_default_set(Evas_Object* o, const char* enco return EINA_TRUE; } +const char* ewk_view_setting_cache_directory_get(const Evas_Object* o) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0); + EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); + return priv->settings.cache_directory; +} + +Eina_Bool ewk_view_setting_cache_directory_set(Evas_Object* o, const char* path) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); + if (eina_stringshare_replace(&priv->settings.cache_directory, path)) + WebCore::cacheStorage().setCacheDirectory(WTF::String::fromUTF8(path)); + return EINA_TRUE; +} + int ewk_view_setting_font_minimum_size_get(const Evas_Object* o) { EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0); @@ -2665,6 +2715,37 @@ Eina_Bool ewk_view_setting_spatial_navigation_set(Evas_Object* o, Eina_Bool enab } /** + * Gets if the local storage is enabled. + * + * @param o view object to set if local storage is enabled. + * @return @c EINA_TRUE if local storage is enabled, @c EINA_FALSE if not. + */ +Eina_Bool ewk_view_setting_local_storage_get(Evas_Object* o) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); + return priv->settings.local_storage; +} + +/** + * Sets the local storage of HTML5. + * + * @param o view object to set if local storage is enabled. + * @return @c EINA_TRUE on success and @c EINA_FALSE on failure + */ +Eina_Bool ewk_view_setting_local_storage_set(Evas_Object* o, Eina_Bool enable) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); + enable = !!enable; + if (priv->settings.local_storage != enable) { + priv->page_settings->setLocalStorageEnabled(enable); + priv->settings.local_storage = enable; + } + return EINA_TRUE; +} + +/** * Similar to evas_object_smart_data_get(), but does type checking. * * @param o view object to query internal data. @@ -2769,7 +2850,7 @@ void ewk_view_layout_if_needed_recursive(Ewk_View_Private_Data* priv) ERR("no main frame view"); return; } - v->layoutIfNeededRecursive(); + v->updateLayoutAndStyleIfNeededRecursive(); } void ewk_view_scrolls_process(Ewk_View_Smart_Data* sd) diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h index 9d5997c..c5d2d45 100644 --- a/WebKit/efl/ewk/ewk_view.h +++ b/WebKit/efl/ewk/ewk_view.h @@ -88,6 +88,7 @@ extern "C" { * - "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. + * - "view,resized", void: view object's size has changed. */ typedef struct _Ewk_View_Smart_Data Ewk_View_Smart_Data; @@ -403,6 +404,8 @@ EAPI Eina_Bool ewk_view_setting_user_stylesheet_set(Evas_Object *o, const cha EAPI Eina_Bool ewk_view_setting_private_browsing_get(const Evas_Object *o); EAPI Eina_Bool ewk_view_setting_private_browsing_set(Evas_Object *o, Eina_Bool enable); +EAPI Eina_Bool ewk_view_setting_offline_app_cache_get(const Evas_Object *o); +EAPI Eina_Bool ewk_view_setting_offline_app_cache_set(Evas_Object *o, Eina_Bool enable); EAPI Eina_Bool ewk_view_setting_caret_browsing_get(const Evas_Object *o); EAPI Eina_Bool ewk_view_setting_caret_browsing_set(Evas_Object *o, Eina_Bool enable); @@ -411,6 +414,8 @@ EAPI const char *ewk_view_setting_encoding_custom_get(const Evas_Object *o); EAPI Eina_Bool ewk_view_setting_encoding_custom_set(Evas_Object *o, const char *encoding); EAPI const char *ewk_view_setting_encoding_default_get(const Evas_Object *o); EAPI Eina_Bool ewk_view_setting_encoding_default_set(Evas_Object *o, const char *encoding); +EAPI const char *ewk_view_setting_cache_directory_get(const Evas_Object *o); +EAPI Eina_Bool ewk_view_setting_cache_directory_set(Evas_Object *o, const char *path); EAPI int ewk_view_setting_font_minimum_size_get(const Evas_Object *o); EAPI Eina_Bool ewk_view_setting_font_minimum_size_set(Evas_Object *o, int size); @@ -442,6 +447,9 @@ EAPI Eina_Bool ewk_view_setting_font_sans_serif_set(Evas_Object *o, const cha EAPI Eina_Bool ewk_view_setting_spatial_navigation_get(Evas_Object* o); EAPI Eina_Bool ewk_view_setting_spatial_navigation_set(Evas_Object* o, Eina_Bool enable); +EAPI Eina_Bool ewk_view_setting_local_storage_get(Evas_Object* o); +EAPI Eina_Bool ewk_view_setting_local_storage_set(Evas_Object* o, Eina_Bool enable); + /* to be used by subclass implementations */ EAPI Ewk_View_Smart_Data *ewk_view_smart_data_get(const Evas_Object *o); |