diff options
Diffstat (limited to 'Source/WebKit/efl')
26 files changed, 779 insertions, 158 deletions
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog index a781c80..35da09c 100644 --- a/Source/WebKit/efl/ChangeLog +++ b/Source/WebKit/efl/ChangeLog @@ -1,3 +1,263 @@ +2011-03-29 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Reviewed by Antonio Gomes. + + [EFL] Remove unnecessary ewk_view_viewport_attributes_set() invocation + https://bugs.webkit.org/show_bug.cgi?id=57222 + + WebCore sends viewport signal whenever viewport is changed by Page::updateViewportArguments(). + Thus, we don't need to call ewk_view_viewport_attributes_set() with dummy viewport data + anymore. + + * WebCoreSupport/FrameLoaderClientEfl.cpp: + (WebCore::FrameLoaderClientEfl::dispatchDidCommitLoad): + +2011-03-27 Patrick Gansterer <paroga@webkit.org> + + Reviewed by Andreas Kling. + + Fix agentOS() in FrameLoaderClientEfl + https://bugs.webkit.org/show_bug.cgi?id=57177 + + Replace old PLATFORM macro with OS and CPU. + + * WebCoreSupport/FrameLoaderClientEfl.cpp: + (WebCore::agentOS): + +2011-03-27 Patrick Gansterer <paroga@webkit.org> + + Reviewed by Andreas Kling. + + [EFL] Use an appropriate user agent string + https://bugs.webkit.org/show_bug.cgi?id=57176 + + * WebCoreSupport/FrameLoaderClientEfl.cpp: + (WebCore::composeUserAgent): + +2011-03-25 Andy Estes <aestes@apple.com> + + Reviewed by Adele Peterson. + + REGRESSION (r70748): latest nightly builds kills AC_QuickTime.js + https://bugs.webkit.org/show_bug.cgi?id=49016 + + Update objectContentType() implementation to handle the + shouldPreferPlugInsForImages flag. + + * WebCoreSupport/FrameLoaderClientEfl.cpp: + (WebCore::FrameLoaderClientEfl::objectContentType): + * WebCoreSupport/FrameLoaderClientEfl.h: + +2011-03-24 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Reviewed by Antonio Gomes. + + [EFL] Add sound / mute button to MediaControl UI + https://bugs.webkit.org/show_bug.cgi?id=56726 + + Add sound / mute button to MediaControl UI. + + * DefaultTheme/default.edc: + * DefaultTheme/widget/mediacontrol/mutebutton/mute_button.edc: Added. + * DefaultTheme/widget/mediacontrol/mutebutton/mutebutton.png: Added. + * DefaultTheme/widget/mediacontrol/mutebutton/unmutebutton.png: Added. + +2011-03-24 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r81916 and r81917. + http://trac.webkit.org/changeset/81916 + http://trac.webkit.org/changeset/81917 + https://bugs.webkit.org/show_bug.cgi?id=57071 + + broke a test on platforms that do not have QuickTime installed + (Requested by estes on #webkit). + + * WebCoreSupport/FrameLoaderClientEfl.cpp: + (WebCore::FrameLoaderClientEfl::objectContentType): + * WebCoreSupport/FrameLoaderClientEfl.h: + +2011-03-24 Andy Estes <aestes@apple.com> + + Reviewed by Darin Adler. + + REGRESSION (r70748): latest nightly builds kills AC_QuickTime.js + https://bugs.webkit.org/show_bug.cgi?id=49016 + + Update objectContentType() implementation to handle the + shouldPreferPlugInsForImages flag. + + * WebCoreSupport/FrameLoaderClientEfl.cpp: + (WebCore::FrameLoaderClientEfl::objectContentType): + * WebCoreSupport/FrameLoaderClientEfl.h: + +2011-03-23 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + Change IconDatabase opening to allow for arbitrary filenames + https://bugs.webkit.org/show_bug.cgi?id=56977 + + * ewk/ewk_settings.cpp: + (ewk_settings_icon_database_path_set): + +2011-03-23 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Reviewed by Antonio Gomes. + + [EFL] Add play / pause button to media control + https://bugs.webkit.org/show_bug.cgi?id=55463 + + Add play|pause button to media control. + + * DefaultTheme/default.edc: + * DefaultTheme/widget/mediacontrol/playpausebutton/pausebutton.png: Added. + * DefaultTheme/widget/mediacontrol/playpausebutton/playbutton.png: Added. + * DefaultTheme/widget/mediacontrol/playpausebutton/playpause_button.edc: Added. + +2011-03-22 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Reviewed by Antonio Gomes. + + [EFL] Change return values with better one in ewk_setting's functions + https://bugs.webkit.org/show_bug.cgi?id=56819 + + In ewk_settings_cache_directory_path_set_xxx, they return false value + when soup is disabled. It is better to use EINA_SAFETY_ON_TRUE_RETURN_XXX. + + * ewk/ewk_settings.cpp: + (ewk_settings_proxy_uri_get): + (ewk_settings_cache_directory_path_set): + (ewk_settings_cache_directory_path_get): + +2011-03-22 Grzegorz Czajkowski <g.czajkowski@samsung.com> + + Reviewed by Kent Tamura. + + Add void to function without parameters + https://bugs.webkit.org/show_bug.cgi?id=56821 + + * ewk/ewk_cookies.cpp: + (ewk_cookies_clear): + (ewk_cookies_policy_get): + * ewk/ewk_cookies.h: + * ewk/ewk_private.h: + * ewk/ewk_settings.cpp: + (ewk_settings_web_database_default_quota_get): + (ewk_settings_web_database_path_get): + (ewk_settings_proxy_uri_get): + (ewk_settings_default_user_agent_get): + * ewk/ewk_settings.h: + * ewk/ewk_view.cpp: + (ewk_view_dpi_get): + +2011-03-17 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=56425 + More groundwork for WebKit2 IconDatabase + + Update already-used function names: + * ewk/ewk_history.cpp: + (ewk_history_item_icon_surface_get): + (ewk_history_item_icon_object_add): + * ewk/ewk_settings.cpp: + (ewk_settings_icon_database_icon_surface_get): + (ewk_settings_icon_database_icon_object_add): + +2011-03-16 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + Viewport no longer allows an auto value for "user-scalable" + https://bugs.webkit.org/show_bug.cgi?id=55416 + + Make the default value for userScalable be true. + + * ewk/ewk_view.cpp: + (ewk_view_viewport_attributes_get): + +2011-03-14 Brady Eidson <beidson@apple.com> + + Try to fix the EFL build-bustage that their EWS bot did not see, but their core-builder did. (sigh) + + * ewk/ewk_history.cpp: + (ewk_history_item_icon_surface_get): + (ewk_history_item_icon_object_add): + +2011-03-14 Brady Eidson <beidson@apple.com> + + Reviewed by Anders Carlsson. + + https://bugs.webkit.org/show_bug.cgi?id=56320 + Remove HistoryItem::icon() and the WebCore dependency on "IconDatabaseBase::defaultIcon()" + + * ewk/ewk_history.cpp: + (ewk_history_item_icon_surface_get): Use IconDatabase directly. + +2011-03-14 Ryuan Choi <ryuan.choi@samsung.com> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Move cache_directory api + https://bugs.webkit.org/show_bug.cgi?id=52139 + + Move cache directory related apis from ewk_view to ewk_settings because + those are not related to ewk_view. + + * ewk/ewk_main.cpp: + (_ewk_init_body): + * ewk/ewk_settings.cpp: + (ewk_settings_cache_directory_path_set): + (ewk_settings_cache_directory_path_get): + * ewk/ewk_settings.h: + * ewk/ewk_view.cpp: + (_ewk_view_priv_new): + (_ewk_view_priv_del): + * ewk/ewk_view.h: + +2011-03-12 Ryuan Choi <ryuan.choi@samsung.com> + + Unreviewed build fix. + + [EFL] Fix build break because of several reason. + https://bugs.webkit.org/show_bug.cgi?id=56244 + + * ewk/ewk_settings.cpp: + (ewk_settings_icon_database_path_set): + +2011-03-10 Ryuan Choi <ryuan.choi@samsung.com> + + Reviewed by Antonio Gomes. + + [EFL] Limit touch events when only page required touch events. + https://bugs.webkit.org/show_bug.cgi?id=54857 + + Block touch events when ChromeClient::needTouchEvents got false. + + * WebCoreSupport/ChromeClientEfl.cpp: + (WebCore::ChromeClientEfl::needTouchEvents): + * WebCoreSupport/ChromeClientEfl.h: + * ewk/ewk_frame.cpp: + (ewk_frame_feed_touch_event): + * ewk/ewk_private.h: + * ewk/ewk_view.cpp: + (ewk_view_need_touch_events_set): + (ewk_view_need_touch_events_get): + +2011-03-08 Grzegorz Czajkowski <g.czajkowski@samsung.com> + + Reviewed by Kent Tamura. + + [EFL] Doxygen documentation for ewk_window_features and ewk_context_menu + https://bugs.webkit.org/show_bug.cgi?id=55026 + + * ewk/ewk_contextmenu.cpp: + (ewk_context_menu_item_select): returns EINA_FALSE when CONTEXT_MENU is disabled + * ewk/ewk_contextmenu.h: + * ewk/ewk_window_features.cpp: + * ewk/ewk_window_features.h: + 2011-03-07 Sam Weinig <sam@webkit.org> Reviewed by Anders Carlsson. diff --git a/Source/WebKit/efl/DefaultTheme/default.edc b/Source/WebKit/efl/DefaultTheme/default.edc index 7d750f4..f77bd86 100644 --- a/Source/WebKit/efl/DefaultTheme/default.edc +++ b/Source/WebKit/efl/DefaultTheme/default.edc @@ -76,4 +76,6 @@ collections { #include "widget/search/cancel/search_cancel.edc" #include "widget/search/decoration/search_decoration.edc" #include "widget/slider/slider.edc" +#include "widget/mediacontrol/playpausebutton/playpause_button.edc" +#include "widget/mediacontrol/mutebutton/mute_button.edc" } diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/mutebutton/mute_button.edc b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/mutebutton/mute_button.edc new file mode 100644 index 0000000..3219f2d --- /dev/null +++ b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/mutebutton/mute_button.edc @@ -0,0 +1,60 @@ +/* + Copyright (C) 2008,2009 INdT - Instituto Nokia de Tecnologia + Copyright (C) 2009,2010 ProFUSION embedded systems + Copyright (C) 2011 Samsung Electronics + + This file 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 file 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. +*/ + + group { + name: "webkit/widget/mediacontrol/mute_button"; + + images { + image: "widget/mediacontrol/mutebutton/mutebutton.png" COMP; + image: "widget/mediacontrol/mutebutton/unmutebutton.png" COMP; + } + + parts { + part { + name: "mute_button"; + type: IMAGE; + description { state: "default" 0.0; + min: 25 25; + } + description { state: "mute" 0.0; + inherit: "default" 0.0; + image.normal: "widget/mediacontrol/mutebutton/mutebutton.png"; + } + description { state: "sound" 0.0; + inherit: "default" 0.0; + image.normal: "widget/mediacontrol/mutebutton/unmutebutton.png"; + } + } + } + + programs { + program { + signal: "mute"; + action: STATE_SET "mute" 0.0; + target: "mute_button"; + } + program { + signal: "sound"; + action: STATE_SET "sound" 0.0; + target: "mute_button"; + } + } + } diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/mutebutton/mutebutton.png b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/mutebutton/mutebutton.png Binary files differnew file mode 100644 index 0000000..575acd6 --- /dev/null +++ b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/mutebutton/mutebutton.png diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/mutebutton/unmutebutton.png b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/mutebutton/unmutebutton.png Binary files differnew file mode 100644 index 0000000..4282017 --- /dev/null +++ b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/mutebutton/unmutebutton.png diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/pausebutton.png b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/pausebutton.png Binary files differnew file mode 100755 index 0000000..b40cfea --- /dev/null +++ b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/pausebutton.png diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playbutton.png b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playbutton.png Binary files differnew file mode 100755 index 0000000..b4bc661 --- /dev/null +++ b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playbutton.png diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playpause_button.edc b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playpause_button.edc new file mode 100644 index 0000000..86b7bca --- /dev/null +++ b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/playpausebutton/playpause_button.edc @@ -0,0 +1,60 @@ +/* + Copyright (C) 2008,2009 INdT - Instituto Nokia de Tecnologia + Copyright (C) 2009,2010 ProFUSION embedded systems + Copyright (C) 2011 Samsung Electronics + + This file 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 file 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. +*/ + + group { + name: "webkit/widget/mediacontrol/playpause_button"; + + images { + image: "widget/mediacontrol/playpausebutton/playbutton.png" COMP; + image: "widget/mediacontrol/playpausebutton/pausebutton.png" COMP; + } + + parts { + part { + name: "playpause_button"; + type: IMAGE; + description { state: "default" 0.0; + min: 25 25; + } + description { state: "play" 0.0; + inherit: "default" 0.0; + image.normal: "widget/mediacontrol/playpausebutton/playbutton.png"; + } + description { state: "pause" 0.0; + inherit: "default" 0.0; + image.normal: "widget/mediacontrol/playpausebutton/pausebutton.png"; + } + } + } + + programs { + program { + signal: "play"; + action: STATE_SET "play" 0.0; + target: "playpause_button"; + } + program { + signal: "pause"; + action: STATE_SET "pause" 0.0; + target: "playpause_button"; + } + } + } diff --git a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp index a1851c5..ce2ac1b 100644 --- a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp +++ b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp @@ -396,6 +396,13 @@ void ChromeClientEfl::reachedApplicationCacheOriginQuota(SecurityOrigin*) } #endif +#if ENABLE(TOUCH_EVENTS) +void ChromeClientEfl::needTouchEvents(bool needed) +{ + ewk_view_need_touch_events_set(m_view, needed); +} +#endif + #if ENABLE(DATABASE) void ChromeClientEfl::exceededDatabaseQuota(Frame* frame, const String& databaseName) { diff --git a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h index 09b0f4f..3d276e5 100644 --- a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h +++ b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h @@ -121,7 +121,7 @@ public: #endif #if ENABLE(TOUCH_EVENTS) - virtual void needTouchEvents(bool) { } + virtual void needTouchEvents(bool); #endif virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); diff --git a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp index 3ea8c2a..fa34ac9 100644 --- a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp +++ b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2006 Zack Rusin <zack@kde.org> - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2006, 2011 Apple Inc. All rights reserved. * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * Copyright (C) 2008 Collabora Ltd. All rights reserved. * Copyright (C) 2008 Holger Hans Peter Freyther @@ -50,13 +50,15 @@ #include "ProgressTracker.h" #include "RenderPart.h" #include "ResourceRequest.h" -#include "ViewportArguments.h" +#include "WebKitVersion.h" #include "ewk_private.h" #include <wtf/text/CString.h> #include <wtf/text/StringConcatenate.h> -#if PLATFORM(UNIX) +#if OS(UNIX) #include <sys/utsname.h> +#elif OS(WINDOWS) +#include "SystemInfo.h" #endif #include <Ecore_Evas.h> @@ -75,29 +77,22 @@ FrameLoaderClientEfl::FrameLoaderClientEfl(Evas_Object *view) { } -static String agentPlatform() -{ - notImplemented(); - return "Unknown"; -} - static String agentOS() { -#if PLATFORM(DARWIN) -#if PLATFORM(X86) +#if OS(DARWIN) +#if CPU(X86) return "Intel Mac OS X"; #else return "PPC Mac OS X"; #endif -#elif PLATFORM(UNIX) +#elif OS(UNIX) struct utsname name; if (uname(&name) != -1) return makeString(name.sysname, ' ', name.machine); return "Unknown"; -#elif PLATFORM(WIN_OS) - // FIXME: Compute the Windows version - return "Windows"; +#elif OS(WINDOWS) + return windowsVersionForUAString(); #else notImplemented(); return "Unknown"; @@ -106,35 +101,8 @@ static String agentOS() static String composeUserAgent() { - // This is a liberal interpretation of http://www.mozilla.org/build/revised-user-agent-strings.html - // See also http://developer.apple.com/internet/safari/faq.html#anchor2 - - String ua; - - // Product - ua += "Mozilla/5.0"; - - // Comment - ua += " ("; - ua += agentPlatform(); // Platform - ua += "; "; - ua += agentOS(); // OS-or-CPU - ua += ") "; - - // WebKit Product - // FIXME: The WebKit version is hardcoded - static const String webKitVersion = "525.1+"; - ua += "AppleWebKit/" + webKitVersion; - ua += " (KHTML, like Gecko, "; - // We mention Safari since many broken sites check for it (OmniWeb does this too) - // We re-use the WebKit version, though it doesn't seem to matter much in practice - ua += "Safari/" + webKitVersion; - ua += ") "; - - // Vendor Product - // ua += g_get_prgname(); - - return ua; + String webKitVersion = String::format("%d.%d", WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION); + return makeString("Mozilla/5.0 (", agentOS(), ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko) Safari/", webKitVersion); } void FrameLoaderClientEfl::setCustomUserAgent(const String &agent) @@ -399,8 +367,12 @@ PassRefPtr<Widget> FrameLoaderClientEfl::createJavaAppletWidget(const IntSize&, return 0; } -ObjectContentType FrameLoaderClientEfl::objectContentType(const KURL& url, const String& mimeType) +ObjectContentType FrameLoaderClientEfl::objectContentType(const KURL& url, const String& mimeType, bool shouldPreferPlugInsForImages) { + // FIXME: once plugin support is enabled, this method needs to correctly handle the 'shouldPreferPlugInsForImages' flag. See + // WebCore::FrameLoader::defaultObjectContentType() for an example. + UNUSED_PARAM(shouldPreferPlugInsForImages); + if (url.isEmpty() && mimeType.isEmpty()) return ObjectContentNone; @@ -626,9 +598,6 @@ void FrameLoaderClientEfl::dispatchDidCommitLoad() return; ewk_view_title_set(m_view, 0); ewk_view_uri_changed(m_view); - - ViewportArguments arguments; - ewk_view_viewport_attributes_set(m_view, arguments); } void FrameLoaderClientEfl::dispatchDidFinishDocumentLoad() diff --git a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h index 424c66b..5ea4e8c 100644 --- a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h +++ b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2006 Zack Rusin <zack@kde.org> - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2006, 2011 Apple Inc. All rights reserved. * Copyright (C) 2008 Collabora Ltd. All rights reserved. * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia * Copyright (C) 2009-2010 ProFUSION embedded systems @@ -149,7 +149,7 @@ class FrameLoaderClientEfl : public FrameLoaderClient { virtual void registerForIconNotification(bool); - virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType); + virtual ObjectContentType objectContentType(const KURL&, const String& mimeType, bool shouldPreferPlugInsForImages); virtual void setMainFrameDocumentReady(bool); diff --git a/Source/WebKit/efl/ewk/ewk_contextmenu.cpp b/Source/WebKit/efl/ewk/ewk_contextmenu.cpp index 40bd2ba..128208d 100644 --- a/Source/WebKit/efl/ewk/ewk_contextmenu.cpp +++ b/Source/WebKit/efl/ewk/ewk_contextmenu.cpp @@ -31,33 +31,53 @@ #include <eina_safety_checks.h> #include <wtf/text/CString.h> +/** + * \struct _Ewk_Context_Menu + * @brief Contains the context menu data. + */ struct _Ewk_Context_Menu { - unsigned int __ref; + unsigned int __ref; /**< the reference count of the object */ #if ENABLE(CONTEXT_MENUS) - WebCore::ContextMenuController* controller; + WebCore::ContextMenuController* controller; /**< the WebCore's object which is responsible for the context menu */ #endif - Evas_Object* view; + Evas_Object* view; /**< the view object */ - Eina_List* items; + Eina_List* items; /**< the list of items */ }; +/** + * \struct _Ewk_Context_Menu_Item + * @brief Represents one item of the context menu object. + */ struct _Ewk_Context_Menu_Item { - Ewk_Context_Menu_Item_Type type; - Ewk_Context_Menu_Action action; + Ewk_Context_Menu_Item_Type type; /**< contains the type of the item */ + Ewk_Context_Menu_Action action; /**< contains the action of the item */ - const char* title; - Ewk_Context_Menu* submenu; + const char* title; /**< contains the title of the item */ + Ewk_Context_Menu* submenu; /**< contains the pointer to the submenu of the item */ Eina_Bool checked:1; Eina_Bool enabled:1; }; +/** + * Increases the reference count of the given object. + * + * @param menu the context menu object to increase the reference count + */ void ewk_context_menu_ref(Ewk_Context_Menu* menu) { EINA_SAFETY_ON_NULL_RETURN(menu); menu->__ref++; } +/** + * Decreases the reference count of the given object, possibly freeing it. + * + * When the reference count it's reached 0, the menu with all items are freed. + * + * @param menu the context menu object to decrease the reference count + */ void ewk_context_menu_unref(Ewk_Context_Menu* menu) { EINA_SAFETY_ON_NULL_RETURN(menu); @@ -72,6 +92,14 @@ void ewk_context_menu_unref(Ewk_Context_Menu* menu) free(menu); } +/** + * Destroys the context menu object. + * + * @param menu the context menu object to destroy + * @return @c EINA_TRUE on success, @c EINA_FALSE on failure + * + * @see ewk_context_menu_item_free + */ Eina_Bool ewk_context_menu_destroy(Ewk_Context_Menu* menu) { EINA_SAFETY_ON_NULL_RETURN_VAL(menu, EINA_FALSE); @@ -84,6 +112,12 @@ Eina_Bool ewk_context_menu_destroy(Ewk_Context_Menu* menu) return EINA_TRUE; } +/** + * Gets the list of items. + * + * @param o the context menu object to get list of the items + * @return the list of the items on success or @c 0 on failure + */ const Eina_List* ewk_context_menu_item_list_get(Ewk_Context_Menu* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0); @@ -91,6 +125,19 @@ const Eina_List* ewk_context_menu_item_list_get(Ewk_Context_Menu* o) return o->items; } +/** + * Creates a new item of the context menu. + * + * @param type specifies a type of the item + * @param action specifies a action of the item + * @param submenu specifies a submenu of the item + * @param title specifies a title of the item + * @param checked + * @param enabled @c EINA_TRUE to enable the item or @c EINA_FALSE to disable + * @return the pointer to the new item on success or @c 0 on failure + * + * @note The return value @b should @b be freed after use. + */ Ewk_Context_Menu_Item* ewk_context_menu_item_new(Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Action action, Ewk_Context_Menu* submenu, const char* title, Eina_Bool checked, Eina_Bool enabled) @@ -109,6 +156,13 @@ Ewk_Context_Menu_Item* ewk_context_menu_item_new(Ewk_Context_Menu_Item_Type type return item; } +/** + * Selects the item from the context menu object. + * + * @param menu the context menu object + * @param item the item is selected + * @return @c EINA_TRUE on success or @c EINA_FALSE on failure + */ Eina_Bool ewk_context_menu_item_select(Ewk_Context_Menu* menu, Ewk_Context_Menu_Item* item) { #if ENABLE(CONTEXT_MENUS) @@ -120,11 +174,20 @@ Eina_Bool ewk_context_menu_item_select(Ewk_Context_Menu* menu, Ewk_Context_Menu_ // Don't care about title and submenu as they're not used after this point. WebCore::ContextMenuItem core(type, action, WTF::String()); menu->controller->contextMenuItemSelected(&core); -#endif - return EINA_TRUE; +#else + return EINA_FALSE; +#endif } +/** + * Destroys the item of the context menu object. + * + * @param item the item to destroy + * + * @see ewk_context_menu_destroy + * @see ewk_context_menu_unref + */ void ewk_context_menu_item_free(Ewk_Context_Menu_Item* item) { EINA_SAFETY_ON_NULL_RETURN(item); @@ -133,12 +196,29 @@ void ewk_context_menu_item_free(Ewk_Context_Menu_Item* item) free(item); } +/** + * Gets type of the item. + * + * @param o the item to get the type + * @return type of the item on success or @c EWK_ACTION_TYPE on failure + * + * @see ewk_context_menu_item_type_set + */ Ewk_Context_Menu_Item_Type ewk_context_menu_item_type_get(Ewk_Context_Menu_Item* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EWK_ACTION_TYPE); return o->type; } +/** + * Sets the type of item. + * + * @param o the item to set the type + * @param type a new type for the item object + * @return @c EINA_TRUE on success, or @c EINA_FALSE on failure + * + * @see ewk_context_menu_item_type_get + */ Eina_Bool ewk_context_menu_item_type_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Item_Type type) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); @@ -146,12 +226,29 @@ Eina_Bool ewk_context_menu_item_type_set(Ewk_Context_Menu_Item* o, Ewk_Context_M return EINA_TRUE; } +/** + * Gets an action of the item. + * + * @param o the item to get the action + * @return an action of the item on success or @c EWK_CONTEXT_MENU_ITEM_TAG_NO_ACTION on failure + * + * @see ewk_context_menu_item_action_set + */ Ewk_Context_Menu_Action ewk_context_menu_item_action_get(Ewk_Context_Menu_Item* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EWK_CONTEXT_MENU_ITEM_TAG_NO_ACTION); return o->action; } +/** + * Sets an action of the item. + * + * @param o the item to set the action + * @param action a new action for the item object + * @return @c EINA_TRUE on success, or @c EINA_FALSE on failure + * + * @see ewk_context_menu_item_action_get + */ Eina_Bool ewk_context_menu_item_action_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Action action) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); @@ -159,12 +256,29 @@ Eina_Bool ewk_context_menu_item_action_set(Ewk_Context_Menu_Item* o, Ewk_Context return EINA_TRUE; } +/** + * Gets a title of the item. + * + * @param o the item to get the title + * @return a title of the item on success, or @c 0 on failure + * + * @see ewk_context_menu_item_title_set + */ const char* ewk_context_menu_item_title_get(Ewk_Context_Menu_Item* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0); return o->title; } +/** + * Sets a title of the item. + * + * @param o the item to set the title + * @param title a new title for the item object + * @return a new title of the item on success or @c 0 on failure + * + * @see ewk_context_menu_item_title_get + */ const char* ewk_context_menu_item_title_set(Ewk_Context_Menu_Item* o, const char* title) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0); @@ -185,12 +299,29 @@ Eina_Bool ewk_context_menu_item_checked_set(Ewk_Context_Menu_Item* o, Eina_Bool return EINA_TRUE; } +/** + * Gets if the item is enabled. + * + * @param o the item to get enabled state + * @return @c EINA_TRUE if it's enabled, @c EINA_FALSE if not or on failure + * + * @see ewk_context_menu_item_enabled_set + */ Eina_Bool ewk_context_menu_item_enabled_get(Ewk_Context_Menu_Item* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); return o->enabled; } +/** + * Enables/disables the item. + * + * @param o the item to enable/disable + * @param enabled @c EINA_TRUE to enable the item or @c EINA_FALSE to disable + * @return @c EINA_TRUE on success, or @c EINA_FALSE on failure + * + * @see ewk_context_menu_item_enabled_get + */ Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item *o, Eina_Bool enabled) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); @@ -205,12 +336,13 @@ Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item *o, Eina_Bool /** * @internal * - * Creates context on view. + * Creates an empty context menu on view. * - * @param view View. - * @param Controller Context Menu Controller. + * @param view the view object + * @param controller the WebCore's context menu controller + * @return newly allocated the context menu on success or @c 0 on errors * - * @return newly allocated context menu or @c 0 on errors. + * @note emits a signal "contextmenu,new" */ Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuController* controller) { @@ -233,6 +365,19 @@ Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuCo return menu; } +/** + * @internal + * + * Frees the context menu. + * + * @param o the view object + * @return @c EINA_TRUE on success, or @c EINA_FALSE on failure + * + * @note emits a signal "contextmenu,free" + * + * @see ewk_context_menu_unref + * @see ewk_context_menu_destroy + */ Eina_Bool ewk_context_menu_free(Ewk_Context_Menu* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); @@ -241,6 +386,17 @@ Eina_Bool ewk_context_menu_free(Ewk_Context_Menu* o) return EINA_TRUE; } +/** + * @internal + * + * Appends the WebCore's item to the context menu object. + * + * @param o the context menu object + * @param core the WebCore's context menu item that will be added to the context menu + * @note emits a signal "contextmenu,item,appended" + * + * @see ewk_context_menu_item_new + */ void ewk_context_menu_item_append(Ewk_Context_Menu* o, WebCore::ContextMenuItem& core) { Ewk_Context_Menu_Item_Type type = static_cast<Ewk_Context_Menu_Item_Type>(core.type()); @@ -255,6 +411,18 @@ void ewk_context_menu_item_append(Ewk_Context_Menu* o, WebCore::ContextMenuItem& evas_object_smart_callback_call(o->view, "contextmenu,item,appended", o); } +/** + * @internal + * + * Emits a signal with the items of the context menu. + * + * @param o the context menu object + * @return the same context menu object that was given through parameter + * + * @note emits a signal "contextmenu,customize" + * + * @see ewk_context_menu_item_list_get + */ Ewk_Context_Menu* ewk_context_menu_custom_get(Ewk_Context_Menu* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0); @@ -263,6 +431,13 @@ Ewk_Context_Menu* ewk_context_menu_custom_get(Ewk_Context_Menu* o) return o; } +/** + * @internal + * + * Emits a signal "contextmenu,show" + * + * @param o the context menu object + */ void ewk_context_menu_show(Ewk_Context_Menu* o) { EINA_SAFETY_ON_NULL_RETURN(o); diff --git a/Source/WebKit/efl/ewk/ewk_contextmenu.h b/Source/WebKit/efl/ewk/ewk_contextmenu.h index c5adb48..7b60410 100644 --- a/Source/WebKit/efl/ewk/ewk_contextmenu.h +++ b/Source/WebKit/efl/ewk/ewk_contextmenu.h @@ -18,6 +18,11 @@ Boston, MA 02110-1301, USA. */ +/** + * @file ewk_contextmenu.h + * @brief Describes the context menu API. + */ + #ifndef ewk_contextmenu_h #define ewk_contextmenu_h @@ -30,7 +35,11 @@ extern "C" { #endif -// keep this in sync with ContextMenuItem.h +/** + * \enum _Ewk_Context_Menu_Action + * @brief Provides the actions of items for the context menu. + * @info Keep this in sync with ContextMenuItem.h + */ enum _Ewk_Context_Menu_Action { EWK_CONTEXT_MENU_ITEM_TAG_NO_ACTION = 0, // this item is not actually in web_uidelegate.h EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW = 1, @@ -67,12 +76,12 @@ enum _Ewk_Context_Menu_Action { EWK_CONTEXT_MENU_ITEM_PDFPREVIOUS_PAGE, EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK = 2000, EWK_CONTEXT_MENU_ITEM_TAG_IGNORE_GRAMMAR, - EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_MENU, // spelling or spelling/grammar sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_MENU, /**< spelling or spelling/grammar sub-menu */ EWK_CONTEXT_MENU_ITEM_TAG_SHOW_SPELLING_PANEL, EWK_CONTEXT_MENU_ITEM_TAG_CHECK_SPELLING, EWK_CONTEXT_MENU_ITEM_TAG_CHECK_SPELLING_WHILE_TYPING, EWK_CONTEXT_MENU_ITEM_TAG_CHECK_GRAMMAR_WITH_SPELLING, - EWK_CONTEXT_MENU_ITEM_TAG_FONT_MENU, // font sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_FONT_MENU, /**< font sub-menu */ EWK_CONTEXT_MENU_ITEM_TAG_SHOW_FONTS, EWK_CONTEXT_MENU_ITEM_TAG_BOLD, EWK_CONTEXT_MENU_ITEM_TAG_ITALIC, @@ -80,41 +89,43 @@ enum _Ewk_Context_Menu_Action { EWK_CONTEXT_MENU_ITEM_TAG_OUTLINE, EWK_CONTEXT_MENU_ITEM_TAG_STYLES, EWK_CONTEXT_MENU_ITEM_TAG_SHOW_COLORS, - EWK_CONTEXT_MENU_ITEM_TAG_SPEECH_MENU, // speech sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_SPEECH_MENU, /**< speech sub-menu */ EWK_CONTEXT_MENU_ITEM_TAG_START_SPEAKING, EWK_CONTEXT_MENU_ITEM_TAG_STOP_SPEAKING, - EWK_CONTEXT_MENU_ITEM_TAG_WRITING_DIRECTION_MENU, // writing direction sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_WRITING_DIRECTION_MENU, /**< writing direction sub-menu */ EWK_CONTEXT_MENU_ITEM_TAG_DEFAULT_DIRECTION, EWK_CONTEXT_MENU_ITEM_TAG_LEFT_TO_RIGHT, EWK_CONTEXT_MENU_ITEM_TAG_RIGHT_TO_LEFT, EWK_CONTEXT_MENU_ITEM_TAG_PDFSINGLE_PAGE_SCROLLING, EWK_CONTEXT_MENU_ITEM_TAG_PDFFACING_PAGES_SCROLLING, - EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_MENU, // text direction sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_MENU, /**< text direction sub-menu */ EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_DEFAULT, EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_LEFT_TO_RIGHT, EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_RIGHT_TO_LEFT, EWK_CONTEXT_MENU_ITEM_BASE_CUSTOM_TAG = 5000, EWK_CONTEXT_MENU_ITEM_BASE_APPLICATION_TAG = 10000 }; +/** Creates a type name for _Ewk_Context_Menu_Action */ typedef enum _Ewk_Context_Menu_Action Ewk_Context_Menu_Action; -// keep this in sync with ContextMenuItem.h +/** + * \enum _Ewk_Context_Menu_Item_Type + * @brief Defines the types of the items for the context menu. + * @info Keep this in sync with ContextMenuItem.h + */ enum _Ewk_Context_Menu_Item_Type { EWK_ACTION_TYPE, EWK_CHECKABLE_ACTION_TYPE, EWK_SEPARATOR_TYPE, EWK_SUBMENU_TYPE }; +/** Creates a type name for _Ewk_Context_Menu_Item_Type */ typedef enum _Ewk_Context_Menu_Item_Type Ewk_Context_Menu_Item_Type; -/** - * The structure to contain Context Menu data - */ +/** Creates a type name for _Ewk_Context_Menu */ typedef struct _Ewk_Context_Menu Ewk_Context_Menu; -/** - * Represents one item from Ewk_Context_Menu - */ +/** Creates a type name for _Ewk_Context_Menu_Item */ typedef struct _Ewk_Context_Menu_Item Ewk_Context_Menu_Item; diff --git a/Source/WebKit/efl/ewk/ewk_cookies.cpp b/Source/WebKit/efl/ewk/ewk_cookies.cpp index 7558154..048886b 100644 --- a/Source/WebKit/efl/ewk/ewk_cookies.cpp +++ b/Source/WebKit/efl/ewk/ewk_cookies.cpp @@ -76,7 +76,7 @@ EAPI Eina_Bool ewk_cookies_file_set(const char *filename) /** * Clears all the cookies from the cookie jar. */ -EAPI void ewk_cookies_clear() +EAPI void ewk_cookies_clear(void) { #if USE(SOUP) GSList* l; @@ -207,7 +207,7 @@ EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p) * @return the current acceptance policy * @see Ewk_Cookie_Policy */ -EAPI Ewk_Cookie_Policy ewk_cookies_policy_get() +EAPI Ewk_Cookie_Policy ewk_cookies_policy_get(void) { Ewk_Cookie_Policy ewk_policy = EWK_COOKIE_JAR_ACCEPT_ALWAYS; #if USE(SOUP) diff --git a/Source/WebKit/efl/ewk/ewk_cookies.h b/Source/WebKit/efl/ewk/ewk_cookies.h index 19eac0f..ec0e84f 100644 --- a/Source/WebKit/efl/ewk/ewk_cookies.h +++ b/Source/WebKit/efl/ewk/ewk_cookies.h @@ -76,12 +76,12 @@ typedef enum _Ewk_Cookie_Policy Ewk_Cookie_Policy; /************************** Exported functions ***********************/ EAPI Eina_Bool ewk_cookies_file_set(const char *filename); -EAPI void ewk_cookies_clear(); -EAPI Eina_List* ewk_cookies_get_all(); +EAPI void ewk_cookies_clear(void); +EAPI Eina_List* ewk_cookies_get_all(void); EAPI void ewk_cookies_cookie_del(Ewk_Cookie *cookie); EAPI void ewk_cookies_cookie_free(Ewk_Cookie *cookie); EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p); -EAPI Ewk_Cookie_Policy ewk_cookies_policy_get(); +EAPI Ewk_Cookie_Policy ewk_cookies_policy_get(void); #ifdef __cplusplus } diff --git a/Source/WebKit/efl/ewk/ewk_frame.cpp b/Source/WebKit/efl/ewk/ewk_frame.cpp index 0e2f903..4e52b56 100644 --- a/Source/WebKit/efl/ewk/ewk_frame.cpp +++ b/Source/WebKit/efl/ewk/ewk_frame.cpp @@ -1484,9 +1484,14 @@ Eina_Bool ewk_frame_feed_touch_event(Evas_Object* o, Ewk_Touch_Event_Type action Eina_Bool ret = EINA_FALSE; #if ENABLE(TOUCH_EVENTS) - EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(points, EINA_FALSE); + EWK_FRAME_SD_GET(o, sd); + + if (!sd || !sd->frame || !ewk_view_need_touch_events_get(sd->view)) { + void* point; + EINA_LIST_FREE(points, point); + return EINA_FALSE; + } Evas_Coord x, y; evas_object_geometry_get(sd->view, &x, &y, 0, 0); diff --git a/Source/WebKit/efl/ewk/ewk_history.cpp b/Source/WebKit/efl/ewk/ewk_history.cpp index 0a9d349..fb70903 100644 --- a/Source/WebKit/efl/ewk/ewk_history.cpp +++ b/Source/WebKit/efl/ewk/ewk_history.cpp @@ -24,7 +24,9 @@ #include "BackForwardListImpl.h" #include "EWebKit.h" #include "HistoryItem.h" +#include "IconDatabaseBase.h" #include "Image.h" +#include "IntSize.h" #include "ewk_private.h" #include <wtf/text/CString.h> @@ -578,7 +580,8 @@ double ewk_history_item_time_last_visited_get(const Ewk_History_Item* item) cairo_surface_t* ewk_history_item_icon_surface_get(const Ewk_History_Item* item) { EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); - WebCore::Image* icon = core->icon(); + + WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(core->url(), WebCore::IntSize(16, 16)); if (!icon) { ERR("icon is NULL."); return 0; @@ -606,7 +609,7 @@ Evas_Object* ewk_history_item_icon_object_add(const Ewk_History_Item* item, Evas { EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0); - WebCore::Image* icon = core->icon(); + WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(core->url(), WebCore::IntSize(16, 16)); cairo_surface_t* surface; if (!icon) { diff --git a/Source/WebKit/efl/ewk/ewk_main.cpp b/Source/WebKit/efl/ewk/ewk_main.cpp index c1c8e02..0c7cc70 100644 --- a/Source/WebKit/efl/ewk/ewk_main.cpp +++ b/Source/WebKit/efl/ewk/ewk_main.cpp @@ -26,7 +26,6 @@ #include "Logging.h" #include "PageCache.h" #include "PageGroup.h" -#include "appcache/ApplicationCacheStorage.h" #include "ewk_private.h" #include "ewk_settings.h" #include "runtime/InitializeThreading.h" @@ -175,7 +174,9 @@ Eina_Bool _ewk_init_body(void) ewk_settings_web_database_path_set(wkdir.utf8().data()); ewk_settings_icon_database_path_set(wkdir.utf8().data()); - WebCore::cacheStorage().setCacheDirectory(wkdir); +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + ewk_settings_cache_directory_path_set(wkdir.utf8().data()); +#endif } // TODO: this should move to WebCore, already reported to webkit-gtk folks: diff --git a/Source/WebKit/efl/ewk/ewk_private.h b/Source/WebKit/efl/ewk/ewk_private.h index 496efdb..114c39e 100644 --- a/Source/WebKit/efl/ewk/ewk_private.h +++ b/Source/WebKit/efl/ewk/ewk_private.h @@ -106,7 +106,12 @@ void ewk_view_viewport_attributes_set(Evas_Object *o, const WebCore::ViewportArg void ewk_view_download_request(Evas_Object *o, Ewk_Download *download); -int ewk_view_dpi_get(); +int ewk_view_dpi_get(void); + +#if ENABLE(TOUCH_EVENTS) +void ewk_view_need_touch_events_set(Evas_Object*, bool needed); +Eina_Bool ewk_view_need_touch_events_get(Evas_Object*); +#endif Ewk_History *ewk_history_new(WebCore::BackForwardListImpl *history); void ewk_history_free(Ewk_History *history); @@ -160,7 +165,7 @@ void ewk_view_contents_size_changed(Evas_Object *o, Evas_Coord w, Evas_Coord h); WebCore::FloatRect ewk_view_page_rect_get(Evas_Object *o); -const char* ewk_settings_default_user_agent_get(); +const char* ewk_settings_default_user_agent_get(void); #ifdef __cplusplus diff --git a/Source/WebKit/efl/ewk/ewk_settings.cpp b/Source/WebKit/efl/ewk/ewk_settings.cpp index 69934c0..3a185d9 100644 --- a/Source/WebKit/efl/ewk/ewk_settings.cpp +++ b/Source/WebKit/efl/ewk/ewk_settings.cpp @@ -47,6 +47,12 @@ #include <libsoup/soup.h> #endif +#if ENABLE(OFFLINE_WEB_APPLICATIONS) +#include "appcache/ApplicationCacheStorage.h" + +static const char* _ewk_cache_directory_path = 0; +#endif + static const char* _ewk_default_web_database_path = 0; static const char* _ewk_icon_database_path = 0; static uint64_t _ewk_default_web_database_quota = 1 * 1024 * 1024; @@ -81,7 +87,7 @@ static WTF::String _ewk_settings_webkit_os_version_get() * * @return the current default database quota in bytes */ -uint64_t ewk_settings_web_database_default_quota_get() +uint64_t ewk_settings_web_database_default_quota_get(void) { return _ewk_default_web_database_quota; } @@ -114,7 +120,7 @@ void ewk_settings_web_database_path_set(const char *path) * * @return database path or @c 0 if none or web database is not supported */ -const char *ewk_settings_web_database_path_get() +const char *ewk_settings_web_database_path_get(void) { #if ENABLE(DATABASE) return _ewk_default_web_database_path; @@ -133,7 +139,7 @@ const char *ewk_settings_web_database_path_get() */ Eina_Bool ewk_settings_icon_database_path_set(const char *directory) { - WebCore::iconDatabase().delayDatabaseCleanup(); + WebCore::IconDatabase::delayDatabaseCleanup(); if (directory) { struct stat st; @@ -155,7 +161,7 @@ Eina_Bool ewk_settings_icon_database_path_set(const char *directory) } WebCore::iconDatabase().setEnabled(true); - WebCore::iconDatabase().open(WTF::String::fromUTF8(directory)); + WebCore::iconDatabase().open(WTF::String::fromUTF8(directory), WebCore::IconDatabase::defaultDatabaseFilename()); if (!_ewk_icon_database_path) _ewk_icon_database_path = eina_stringshare_add(directory); else @@ -225,7 +231,7 @@ cairo_surface_t* ewk_settings_icon_database_icon_surface_get(const char *url) EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0); WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(url)); - WebCore::Image *icon = WebCore::iconDatabase().iconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); + WebCore::Image *icon = WebCore::iconDatabase().synchronousIconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); if (!icon) { ERR("no icon for url %s", url); @@ -257,7 +263,7 @@ Evas_Object* ewk_settings_icon_database_icon_object_add(const char* url, Evas* c EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0); WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(url)); - WebCore::Image* icon = WebCore::iconDatabase().iconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); + WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); cairo_surface_t* surface; if (!icon) { @@ -300,7 +306,7 @@ void ewk_settings_proxy_uri_set(const char* proxy) * * @return current proxy URI or @c 0 if it's not set */ -const char* ewk_settings_proxy_uri_get() +const char* ewk_settings_proxy_uri_get(void) { #if USE(SOUP) SoupURI* uri; @@ -315,7 +321,7 @@ const char* ewk_settings_proxy_uri_get() WTF::String proxy = soup_uri_to_string(uri, EINA_FALSE); return eina_stringshare_add(proxy.utf8().data()); #elif USE(CURL) - EINA_SAFETY_ON_TRUE_RETURN_VAL(1, NULL); + EINA_SAFETY_ON_TRUE_RETURN_VAL(1, 0); #endif } @@ -326,10 +332,53 @@ const char* ewk_settings_proxy_uri_get() * * @return a pointer to an eina_stringshare containing the user agent string */ -const char* ewk_settings_default_user_agent_get() +const char* ewk_settings_default_user_agent_get(void) { WTF::String ua_version = makeString(String::number(WEBKIT_USER_AGENT_MAJOR_VERSION), '.', String::number(WEBKIT_USER_AGENT_MINOR_VERSION), '+'); WTF::String static_ua = makeString("Mozilla/5.0 (", _ewk_settings_webkit_platform_get(), "; ", _ewk_settings_webkit_os_version_get(), ") AppleWebKit/", ua_version) + makeString(" (KHTML, like Gecko) Version/5.0 Safari/", ua_version); return eina_stringshare_add(static_ua.utf8().data()); } + +/** + * Sets cache directory. + * + * @param path where to store cache, must be write-able. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE if path is NULL or offline + * web application is not supported. + */ +Eina_Bool ewk_settings_cache_directory_path_set(const char *path) +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + if (!path) + return EINA_FALSE; + + WebCore::cacheStorage().setCacheDirectory(WTF::String::fromUTF8(path)); + if (!_ewk_cache_directory_path) + _ewk_cache_directory_path = eina_stringshare_add(path); + else + eina_stringshare_replace(&_ewk_cache_directory_path, path); + return EINA_TRUE; +#else + EINA_SAFETY_ON_TRUE_RETURN_VAL(1, EINA_FALSE); +#endif +} + +/** + * Return cache directory path. + * + * This is guaranteed to be eina_stringshare, so whenever possible + * save yourself some cpu cycles and use eina_stringshare_ref() + * instead of eina_stringshare_add() or strdup(). + * + * @return cache directory path. + */ +const char *ewk_settings_cache_directory_path_get() +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + return _ewk_cache_directory_path; +#else + EINA_SAFETY_ON_TRUE_RETURN_VAL(1, 0); +#endif +} diff --git a/Source/WebKit/efl/ewk/ewk_settings.h b/Source/WebKit/efl/ewk/ewk_settings.h index 0a495da..3e5ca47 100644 --- a/Source/WebKit/efl/ewk/ewk_settings.h +++ b/Source/WebKit/efl/ewk/ewk_settings.h @@ -37,9 +37,9 @@ extern "C" { * @brief General purpose settings, not tied to any view object. */ -EAPI uint64_t ewk_settings_web_database_default_quota_get(); +EAPI uint64_t ewk_settings_web_database_default_quota_get(void); EAPI void ewk_settings_web_database_path_set(const char *path); -EAPI const char *ewk_settings_web_database_path_get(); +EAPI const char *ewk_settings_web_database_path_get(void); EAPI Eina_Bool ewk_settings_icon_database_path_set(const char *path); EAPI const char *ewk_settings_icon_database_path_get(void); @@ -48,8 +48,11 @@ 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); -EAPI const char* ewk_settings_proxy_uri_get(); +EAPI Eina_Bool ewk_settings_cache_directory_path_set(const char *path); +EAPI const char *ewk_settings_cache_directory_path_get(void); + +EAPI void ewk_settings_proxy_uri_set(const char* proxy); +EAPI const char* ewk_settings_proxy_uri_get(void); #ifdef __cplusplus } diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp index ab0629a..8a3b04d 100644 --- a/Source/WebKit/efl/ewk/ewk_view.cpp +++ b/Source/WebKit/efl/ewk/ewk_view.cpp @@ -43,7 +43,6 @@ #include "PlatformMouseEvent.h" #include "PopupMenuClient.h" #include "ProgressTracker.h" -#include "appcache/ApplicationCacheStorage.h" #include "ewk_private.h" #include <Ecore.h> @@ -95,13 +94,13 @@ struct _Ewk_View_Private_Data { unsigned int imh; /**< input method hints */ struct { Eina_Bool view_cleared:1; + Eina_Bool need_touch_events:1; } flags; struct { const char* user_agent; const char* user_stylesheet; const char* encoding_default; const char* encoding_custom; - const char* cache_directory; const char* theme; const char* local_storage_database_path; int font_minimum_size; @@ -584,9 +583,6 @@ 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()); - s = priv->page_settings->localStorageDatabasePath(); priv->settings.local_storage_database_path = eina_stringshare_add(s.string().utf8().data()); @@ -672,7 +668,6 @@ 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); @@ -2723,22 +2718,6 @@ Eina_Bool ewk_view_setting_encoding_detector_get(Evas_Object* o) return priv->settings.encoding_detector; } -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(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); @@ -4305,7 +4284,7 @@ void ewk_view_viewport_attributes_get(Evas_Object *o, float* w, float* h, float* if (device_pixel_ratio) *device_pixel_ratio = attributes.devicePixelRatio; if (user_scalable) - *user_scalable = attributes.userScalable; + *user_scalable = static_cast<bool>(attributes.userScalable); } /** @@ -4508,7 +4487,7 @@ WebCore::FloatRect ewk_view_page_rect_get(Evas_Object *o) * * @return device's dpi value. */ -int ewk_view_dpi_get() +int ewk_view_dpi_get(void) { #ifdef HAVE_ECORE_X return ecore_x_dpi_get(); @@ -4516,3 +4495,20 @@ int ewk_view_dpi_get() return 160; #endif } + +#if ENABLE(TOUCH_EVENTS) +void ewk_view_need_touch_events_set(Evas_Object* o, bool needed) +{ + EWK_VIEW_SD_GET(o, sd); + EWK_VIEW_PRIV_GET(sd, priv); + + priv->flags.need_touch_events = needed; +} + +Eina_Bool ewk_view_need_touch_events_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->flags.need_touch_events; +} +#endif diff --git a/Source/WebKit/efl/ewk/ewk_view.h b/Source/WebKit/efl/ewk/ewk_view.h index e487f5e..84beecd 100644 --- a/Source/WebKit/efl/ewk/ewk_view.h +++ b/Source/WebKit/efl/ewk/ewk_view.h @@ -450,8 +450,6 @@ 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); diff --git a/Source/WebKit/efl/ewk/ewk_window_features.cpp b/Source/WebKit/efl/ewk/ewk_window_features.cpp index 3855e89..4a311dc 100644 --- a/Source/WebKit/efl/ewk/ewk_window_features.cpp +++ b/Source/WebKit/efl/ewk/ewk_window_features.cpp @@ -26,17 +26,21 @@ #include <Eina.h> +/** + * \struct _Ewk_Window_Features + * @brief Contains the window features data. + */ struct _Ewk_Window_Features { unsigned int __ref; WebCore::WindowFeatures* core; }; /** - * Decrease the ref count of an Ewk_Window_Features, possibly freeing it. + * Decreases the referece count of an Ewk_Window_Features, possibly freeing it. * - * When its ref count reaches 0, @param window_features is freed. + * When the reference count of the object reaches 0, the one is freed. * - * @param window_features The window's features. + * @param window_features the object to decrease reference count */ EAPI void ewk_window_features_unref(Ewk_Window_Features* window_features) { @@ -52,9 +56,9 @@ EAPI void ewk_window_features_unref(Ewk_Window_Features* window_features) } /** - * Increase the ref count of an Ewk_Window_Features + * Increases the reference count of an Ewk_Window_Features. * - * @param window_features The window's features. + * @param window_features the object to increase reference count */ EAPI void ewk_window_features_ref(Ewk_Window_Features* window_features) { @@ -63,15 +67,20 @@ EAPI void ewk_window_features_ref(Ewk_Window_Features* window_features) } /** - * Get boolean properties + * Gets boolean properties of an Ewk_Window_Features. + * + * Properties are returned in the respective pointers. Passing @c 0 to any of + * these pointers will make that property to not be returned. * - * @param window_features A window_features. - * @param toolbar_visible pointer to store if toolbar is visible. - * @param statusbar_visible pointer to store if statusbar is visible. - * @param scrollbars_visible pointer to store if scrollbars is visible. - * @param menubar_visible pointer to store if menubar is visible. - * @param locationbar_visible pointer to store if locationbar is visible. - * @param fullscreen pointer to store if fullscreen is enabled. + * @param window_features the object to get boolean properties + * @param toolbar_visible the pointer to store if toolbar is visible + * @param statusbar_visible the pointer to store if statusbar is visible + * @param scrollbars_visible the pointer to store if scrollbars is visible + * @param menubar_visible the pointer to store if menubar is visible + * @param locationbar_visible the pointer to store if locationbar is visible + * @param fullscreen the pointer to store if fullscreen is enabled + * + * @see ewk_window_features_int_property_get */ EAPI void ewk_window_features_bool_property_get(Ewk_Window_Features* window_features, Eina_Bool* toolbar_visible, Eina_Bool* statusbar_visible, Eina_Bool* scrollbars_visible, Eina_Bool* menubar_visible, Eina_Bool* locationbar_visible, Eina_Bool* fullscreen) { @@ -98,18 +107,21 @@ EAPI void ewk_window_features_bool_property_get(Ewk_Window_Features* window_feat } /** - * Get int properties + * Gets int properties of an Ewk_Window_Features. + * + * Properties are returned in the respective pointers. Passing @c 0 to any of + * these pointers will make that property to not be returned. + * + * Make sure to check if the value returned is less than 0 before using it, since in + * that case it means that property was not set in winwdow_features object. * - * Properties are returned in the respective pointers. Passing NULL to any of - * these pointers will make that property to not be returned. Make sure to check - * if the value returned is less than 0 before using it, since in that case it - * means that property was not set in @param winwdow_features. + * @param window_features the window's features + * @param x the pointer to store x position + * @param y the pointer to store y position + * @param w the pointer to store width + * @param h the pointer to store height * - * @param window_features A window_features. - * @param x pointer to store x position or -1 if it's not set in window_features. - * @param y pointer to store y position or-1 if it's not set in window_features. - * @param w pointer to store width or-1 if it's not set in window_features. - * @param h pointer to store height or-1 if it's not set in window_features. + * @see ewk_window_features_bool_property_get */ EAPI void ewk_window_features_int_property_get(Ewk_Window_Features* window_features, int* x, int* y, int* w, int* h) { @@ -133,13 +145,12 @@ EAPI void ewk_window_features_int_property_get(Ewk_Window_Features* window_featu /** * @internal - * Create a new Ewk_Window_Features from a WebCore::WindowFeatures if @param - * core is not NULL or a new one with default features. * - * A new WebCore::WindowFeatures is allocated copying @param core features and - * it is embedded inside an Ewk_Window_Features whose ref count is initialized. + * Creates a new Ewk_Window_Features object. * - * @returns a new allocated Ewk_Window_Features + * @param core if not @c 0 a new WebCore::WindowFeatures is allocated copying core features and + * it is embedded inside the Ewk_Window_Features whose ref count is initialized, if core is @c 0 a new one is created with the default features. + * @returns a new allocated the Ewk_Window_Features object */ Ewk_Window_Features* ewk_window_features_new_from_core(const WebCore::WindowFeatures* core) { diff --git a/Source/WebKit/efl/ewk/ewk_window_features.h b/Source/WebKit/efl/ewk/ewk_window_features.h index b579dc4..0501881 100644 --- a/Source/WebKit/efl/ewk/ewk_window_features.h +++ b/Source/WebKit/efl/ewk/ewk_window_features.h @@ -18,6 +18,11 @@ Boston, MA 02110-1301, USA. */ +/** + * @file ewk_window_features.h + * @brief Access to the features of window. + */ + #ifndef ewk_window_features_h #define ewk_window_features_h @@ -29,6 +34,7 @@ extern "C" { #endif +/** Creates a type name for _Ewk_Window_Features. */ typedef struct _Ewk_Window_Features Ewk_Window_Features; EAPI void ewk_window_features_unref(Ewk_Window_Features* window_features); |