summaryrefslogtreecommitdiffstats
path: root/WebKit/efl
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/efl')
-rw-r--r--WebKit/efl/EWebLauncher/main.c18
-rw-r--r--WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp28
-rw-r--r--WebKit/efl/WebCoreSupport/ChromeClientEfl.h4
-rw-r--r--WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp30
-rw-r--r--WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h4
-rw-r--r--WebKit/efl/WebCoreSupport/EditorClientEfl.cpp16
-rw-r--r--WebKit/efl/ewk/EWebKit.h1
-rw-r--r--WebKit/efl/ewk/ewk_contextmenu.cpp263
-rw-r--r--WebKit/efl/ewk/ewk_contextmenu.h147
-rw-r--r--WebKit/efl/ewk/ewk_frame.cpp17
-rw-r--r--WebKit/efl/ewk/ewk_main.cpp5
-rw-r--r--WebKit/efl/ewk/ewk_private.h17
-rw-r--r--WebKit/efl/ewk/ewk_settings.cpp37
-rw-r--r--WebKit/efl/ewk/ewk_settings.h2
-rw-r--r--WebKit/efl/ewk/ewk_view.cpp60
-rw-r--r--WebKit/efl/ewk/ewk_view.h4
-rw-r--r--WebKit/efl/ewk/ewk_view_single.c24
17 files changed, 640 insertions, 37 deletions
diff --git a/WebKit/efl/EWebLauncher/main.c b/WebKit/efl/EWebLauncher/main.c
index b0c64bf..d36c807 100644
--- a/WebKit/efl/EWebLauncher/main.c
+++ b/WebKit/efl/EWebLauncher/main.c
@@ -153,8 +153,8 @@ print_history(Eina_List *list)
Ewk_History_Item *item = (Ewk_History_Item*)d;
cairo_surface_t *cs = ewk_history_item_icon_surface_get(item);
char buf[PATH_MAX];
- ssize_t s = snprintf(buf, sizeof(buf), "/tmp/favicon-%s.png", ewk_history_item_uri_original_get(item));
- for (s--; s >= sizeof("/tmp/favicon-"); s--) {
+ int s = snprintf(buf, sizeof(buf), "/tmp/favicon-%s.png", ewk_history_item_uri_original_get(item));
+ for (s--; s >= (int)sizeof("/tmp/favicon-"); s--) {
if (!isalnum(buf[s]) && buf[s] != '.')
buf[s] = '_';
}
@@ -378,6 +378,12 @@ on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Evas_Event_Key_Down *ev = (Evas_Event_Key_Down*) event_info;
ELauncher *app = data;
+ static const char *encodings[] = {
+ "ISO-8859-1",
+ "UTF-8",
+ NULL
+ };
+ static int currentEncoding = -1;
if (!strcmp(ev->key, "Escape")) {
closeWindow(app->ee);
@@ -401,6 +407,11 @@ on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
ewk_view_forward(obj);
} else
info("Forward ignored: No forward history\n");
+ } else if (!strcmp(ev->key, "F3")) {
+ currentEncoding++;
+ currentEncoding %= (sizeof(encodings) / sizeof(encodings[0]));
+ info("Set encoding (F3) pressed. New encoding to %s", encodings[currentEncoding]);
+ ewk_view_setting_encoding_custom_set(obj, encodings[currentEncoding]);
} else if (!strcmp(ev->key, "F4")) {
Evas_Object *frame = ewk_view_frame_main_get(obj);
Evas_Coord x, y;
@@ -672,7 +683,7 @@ main(int argc, char *argv[])
Eina_Rectangle geometry = {0, 0, 0, 0};
char *url = NULL;
char *userAgent = NULL;
- char *tmp;
+ const char *tmp;
char path[PATH_MAX];
char *engine = NULL;
@@ -733,6 +744,7 @@ main(int argc, char *argv[])
snprintf(path, sizeof(path), "%s/.ewebkit-%u", tmp, getuid());
ecore_file_mkpath(path);
ewk_settings_icon_database_path_set(path);
+ ewk_settings_web_database_path_set(path);
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 92b95b6..c51befb 100644
--- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
@@ -34,6 +34,7 @@
#include "ChromeClientEfl.h"
#if ENABLE(DATABASE)
+#include "DatabaseDetails.h"
#include "DatabaseTracker.h"
#endif
#include "EWebKit.h"
@@ -188,6 +189,16 @@ bool ChromeClientEfl::menubarVisible()
return visible;
}
+void ChromeClientEfl::createSelectPopup(PopupMenuClient* client, int selected, const IntRect& rect)
+{
+ ewk_view_popup_new(m_view, client, selected, rect);
+}
+
+bool ChromeClientEfl::destroySelectPopup()
+{
+ return ewk_view_popup_destroy(m_view);
+}
+
void ChromeClientEfl::setResizable(bool)
{
notImplemented();
@@ -345,12 +356,21 @@ void ChromeClientEfl::reachedMaxAppCacheSize(int64_t spaceNeeded)
#if ENABLE(DATABASE)
void ChromeClientEfl::exceededDatabaseQuota(Frame* frame, const String& databaseName)
{
- uint64_t quota = ewk_settings_web_database_default_quota_get();
+ uint64_t quota;
+ SecurityOrigin* origin = frame->document()->securityOrigin();
+
+ DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(databaseName, origin);
+ quota = ewk_view_exceeded_database_quota(m_view,
+ kit(frame), databaseName.utf8().data(),
+ details.currentUsage(), details.expectedUsage());
- if (!DatabaseTracker::tracker().hasEntryForOrigin(frame->document()->securityOrigin()))
- DatabaseTracker::tracker().setQuota(frame->document()->securityOrigin(), quota);
+ /* if client did not set quota, and database is being created now, the
+ * default quota is applied
+ */
+ if (!quota && !DatabaseTracker::tracker().hasEntryForOrigin(origin))
+ quota = ewk_settings_web_database_default_quota_get();
- ewk_view_exceeded_database_quota(m_view, kit(frame), databaseName.utf8().data());
+ DatabaseTracker::tracker().setQuota(origin, quota);
}
#endif
diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
index 8df8483..399ef7f 100644
--- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
@@ -25,6 +25,7 @@
#include "ChromeClient.h"
#include "KURL.h"
+#include "PopupMenu.h"
#include <Evas.h>
namespace WebCore {
@@ -69,6 +70,9 @@ public:
virtual void setMenubarVisible(bool);
virtual bool menubarVisible();
+ virtual void createSelectPopup(PopupMenuClient*, int selected, const IntRect& rect);
+ virtual bool destroySelectPopup();
+
virtual void setResizable(bool);
virtual void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message,
diff --git a/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp b/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp
index aaa64d7..19c3705 100644
--- a/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp
@@ -29,9 +29,12 @@
#include "ContextMenuClientEfl.h"
#include "ContextMenu.h"
+#include "EWebKit.h"
+#include "ewk_private.h"
#include "HitTestResult.h"
#include "KURL.h"
#include "NotImplemented.h"
+#include "PlatformMenuDescription.h"
using namespace WebCore;
@@ -47,10 +50,11 @@ void ContextMenuClientEfl::contextMenuDestroyed()
delete this;
}
-PlatformMenuDescription ContextMenuClientEfl::getCustomMenuFromDefaultItems(ContextMenu*)
+PlatformMenuDescription ContextMenuClientEfl::getCustomMenuFromDefaultItems(ContextMenu* menu)
{
- notImplemented();
- return 0;
+ PlatformMenuDescription newmenu = ewk_context_menu_custom_get(static_cast<Ewk_Context_Menu*>(menu->releasePlatformDescription()));
+
+ return newmenu;
}
void ContextMenuClientEfl::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*)
@@ -89,4 +93,24 @@ void ContextMenuClientEfl::stopSpeaking()
notImplemented();
}
+PlatformMenuDescription ContextMenuClientEfl::createPlatformDescription(ContextMenu* menu)
+{
+ return (PlatformMenuDescription) ewk_context_menu_new(m_view, menu->controller());
+}
+
+void ContextMenuClientEfl::freePlatformDescription(PlatformMenuDescription menu)
+{
+ ewk_context_menu_free(static_cast<Ewk_Context_Menu*>(menu));
+}
+
+void ContextMenuClientEfl::appendItem(PlatformMenuDescription menu, ContextMenuItem& item)
+{
+ ewk_context_menu_item_append(static_cast<Ewk_Context_Menu*>(menu), item);
+}
+
+void ContextMenuClientEfl::show(PlatformMenuDescription menu)
+{
+ ewk_context_menu_show(static_cast<Ewk_Context_Menu*>(menu));
+}
+
}
diff --git a/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h b/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h
index 2c3818c..8a289a1 100644
--- a/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h
+++ b/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h
@@ -50,6 +50,10 @@ class ContextMenuClientEfl : public ContextMenuClient {
virtual bool isSpeaking();
virtual void stopSpeaking();
+ PlatformMenuDescription createPlatformDescription(ContextMenu*);
+ void freePlatformDescription(PlatformMenuDescription);
+ void appendItem(PlatformMenuDescription, ContextMenuItem&);
+ void show(PlatformMenuDescription menu);
private:
Evas_Object* m_view;
};
diff --git a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
index b87a91a..3c4016f 100644
--- a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
@@ -339,26 +339,26 @@ bool EditorClientEfl::handleEditingKeyboardEvent(KeyboardEvent* event)
if (caretBrowsing) {
switch (keyEvent->windowsVirtualKeyCode()) {
case VK_LEFT:
- frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE,
- SelectionController::LEFT,
+ frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove,
+ SelectionController::DirectionLeft,
keyEvent->ctrlKey() ? WordGranularity : CharacterGranularity,
true);
return true;
case VK_RIGHT:
- frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE,
- SelectionController::RIGHT,
+ frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove,
+ SelectionController::DirectionRight,
keyEvent->ctrlKey() ? WordGranularity : CharacterGranularity,
true);
return true;
case VK_UP:
- frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE,
- SelectionController::BACKWARD,
+ frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove,
+ SelectionController::DirectionBackward,
keyEvent->ctrlKey() ? ParagraphGranularity : LineGranularity,
true);
return true;
case VK_DOWN:
- frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE,
- SelectionController::FORWARD,
+ frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove,
+ SelectionController::DirectionForward,
keyEvent->ctrlKey() ? ParagraphGranularity : LineGranularity,
true);
return true;
diff --git a/WebKit/efl/ewk/EWebKit.h b/WebKit/efl/ewk/EWebKit.h
index d87d204..a61cc9d 100644
--- a/WebKit/efl/ewk/EWebKit.h
+++ b/WebKit/efl/ewk/EWebKit.h
@@ -22,6 +22,7 @@
#ifndef EWebKit_h
#define EWebKit_h
+#include "ewk_contextmenu.h"
#include "ewk_eapi.h"
#include "ewk_frame.h"
#include "ewk_history.h"
diff --git a/WebKit/efl/ewk/ewk_contextmenu.cpp b/WebKit/efl/ewk/ewk_contextmenu.cpp
new file mode 100644
index 0000000..9daf27c
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_contextmenu.cpp
@@ -0,0 +1,263 @@
+/*
+ Copyright (C) 2010 ProFUSION embedded systems
+ 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"
+#include "ewk_contextmenu.h"
+
+#include "ContextMenu.h"
+#include "ContextMenuController.h"
+#include "ContextMenuItem.h"
+#include "EWebKit.h"
+#include "ewk_private.h"
+
+#include <Eina.h>
+#include <eina_safety_checks.h>
+#include <wtf/text/CString.h>
+
+struct _Ewk_Context_Menu {
+ unsigned int __ref;
+ WebCore::ContextMenuController* controller;
+ Evas_Object* view;
+
+ Eina_List* items;
+};
+
+struct _Ewk_Context_Menu_Item {
+ Ewk_Context_Menu_Item_Type type;
+ Ewk_Context_Menu_Action action;
+
+ const char* title;
+ Ewk_Context_Menu* submenu;
+
+ Eina_Bool checked:1;
+ Eina_Bool enabled:1;
+};
+
+void ewk_context_menu_ref(Ewk_Context_Menu* menu)
+{
+ EINA_SAFETY_ON_NULL_RETURN(menu);
+ menu->__ref++;
+}
+
+void ewk_context_menu_unref(Ewk_Context_Menu* menu)
+{
+ EINA_SAFETY_ON_NULL_RETURN(menu);
+ void* item;
+
+ if (--menu->__ref)
+ return;
+
+ EINA_LIST_FREE(menu->items, item)
+ ewk_context_menu_item_free(static_cast<Ewk_Context_Menu_Item*>(item));
+
+ free(menu);
+}
+
+Eina_Bool ewk_context_menu_destroy(Ewk_Context_Menu* menu)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(menu, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(menu->controller, EINA_FALSE);
+
+ menu->controller->clearContextMenu();
+ return EINA_TRUE;
+}
+
+const Eina_List* ewk_context_menu_item_list_get(Ewk_Context_Menu* o)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0);
+
+ return o->items;
+}
+
+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)
+{
+ Ewk_Context_Menu_Item* item = (Ewk_Context_Menu_Item*) malloc(sizeof(*item));
+ if (!item)
+ return 0;
+
+ item->type = type;
+ item->action = action;
+ item->title = eina_stringshare_add(title);
+ item->submenu = submenu;
+ item->checked = checked;
+ item->enabled = enabled;
+
+ return item;
+}
+
+Eina_Bool ewk_context_menu_item_select(Ewk_Context_Menu* menu, Ewk_Context_Menu_Item* item)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(menu, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, EINA_FALSE);
+ WebCore::ContextMenuAction action = static_cast<WebCore::ContextMenuAction>(item->action);
+ WebCore::ContextMenuItemType type = static_cast<WebCore::ContextMenuItemType>(item->type);
+
+ // Don't care about title and submenu as they're not used after this point.
+ WebCore::ContextMenuItem core(type, action, WebCore::String());
+ menu->controller->contextMenuItemSelected(&core);
+ return EINA_TRUE;
+}
+
+void ewk_context_menu_item_free(Ewk_Context_Menu_Item* item)
+{
+ EINA_SAFETY_ON_NULL_RETURN(item);
+
+ eina_stringshare_del(item->title);
+ free(item);
+}
+
+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;
+}
+
+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);
+ o->type = type;
+ return EINA_TRUE;
+}
+
+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;
+}
+
+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);
+ o->action = action;
+ return EINA_TRUE;
+}
+
+const char* ewk_context_menu_item_title_get(Ewk_Context_Menu_Item* o)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0);
+ return o->title;
+}
+
+const char* ewk_context_menu_item_title_set(Ewk_Context_Menu_Item* o, const char* title)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0);
+ eina_stringshare_replace(&o->title, title);
+ return o->title;
+}
+
+Eina_Bool ewk_context_menu_item_checked_get(Ewk_Context_Menu_Item* o)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE);
+ return o->checked;
+}
+
+Eina_Bool ewk_context_menu_item_checked_set(Ewk_Context_Menu_Item* o, Eina_Bool checked)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE);
+ o->checked = checked;
+ return EINA_TRUE;
+}
+
+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;
+}
+
+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);
+ o->enabled = enabled;
+ return EINA_TRUE;
+}
+
+
+/* internal methods ****************************************************/
+
+/**
+ * @internal
+ *
+ * Creates context on view.
+ *
+ * @param view View.
+ * @param Controller Context Menu Controller.
+ *
+ * @return newly allocated context menu or @c 0 on errors.
+ */
+Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuController* controller)
+{
+ Ewk_Context_Menu* menu;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(view, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(controller, 0);
+
+ menu = static_cast<Ewk_Context_Menu*>(malloc(sizeof(*menu)));
+ if (!menu) {
+ CRITICAL("Could not allocate context menu memory.");
+ return 0;
+ }
+
+ menu->__ref = 1;
+ menu->view = view;
+ menu->controller = controller;
+ menu->items = 0;
+ evas_object_smart_callback_call(menu->view, "contextmenu,new", menu);
+
+ return menu;
+}
+
+Eina_Bool ewk_context_menu_free(Ewk_Context_Menu* o)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE);
+ evas_object_smart_callback_call(o->view, "contextmenu,free", o);
+ ewk_context_menu_unref(o);
+ return EINA_TRUE;
+}
+
+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());
+ Ewk_Context_Menu_Action action = static_cast<Ewk_Context_Menu_Action>(core.action());
+ Ewk_Context_Menu* submenu = static_cast<Ewk_Context_Menu*>(core.platformSubMenu());
+
+ Ewk_Context_Menu_Item* menu_item = ewk_context_menu_item_new
+ (type, action, submenu, core.title().utf8().data(), core.checked(),
+ core.enabled());
+ EINA_SAFETY_ON_NULL_RETURN(menu_item);
+
+ o->items = eina_list_append(o->items, menu_item);
+ evas_object_smart_callback_call(o->view, "contextmenu,item,appended", o);
+}
+
+Ewk_Context_Menu* ewk_context_menu_custom_get(Ewk_Context_Menu* o)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0);
+
+ evas_object_smart_callback_call(o->view, "contextmenu,customize", o->items);
+ return o;
+}
+
+void ewk_context_menu_show(Ewk_Context_Menu* o)
+{
+ EINA_SAFETY_ON_NULL_RETURN(o);
+
+ evas_object_smart_callback_call(o->view, "contextmenu,show", o);
+}
diff --git a/WebKit/efl/ewk/ewk_contextmenu.h b/WebKit/efl/ewk/ewk_contextmenu.h
new file mode 100644
index 0000000..c5adb48
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_contextmenu.h
@@ -0,0 +1,147 @@
+/*
+ Copyright (C) 2010 ProFUSION embedded systems
+ 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 ewk_contextmenu_h
+#define ewk_contextmenu_h
+
+#include "ewk_eapi.h"
+
+#include <Eina.h>
+#include <Evas.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// 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,
+ EWK_CONTEXT_MENU_ITEM_TAG_DOWNLOAD_LINK_TO_DISK,
+ EWK_CONTEXT_MENU_ITEM_TAG_COPY_LINK_TO_CLIPBOARD,
+ EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_NEW_WINDOW,
+ EWK_CONTEXT_MENU_ITEM_TAG_DOWNLOAD_IMAGE_TO_DISK,
+ EWK_CONTEXT_MENU_ITEM_TAG_COPY_IMAGE_TO_CLIPBOARD,
+ EWK_CONTEXT_MENU_ITEM_TAG_OPEN_FRAME_IN_NEW_WINDOW,
+ EWK_CONTEXT_MENU_ITEM_TAG_COPY,
+ EWK_CONTEXT_MENU_ITEM_TAG_GO_BACK,
+ EWK_CONTEXT_MENU_ITEM_TAG_GO_FORWARD,
+ EWK_CONTEXT_MENU_ITEM_TAG_STOP,
+ EWK_CONTEXT_MENU_ITEM_TAG_RELOAD,
+ EWK_CONTEXT_MENU_ITEM_TAG_CUT,
+ EWK_CONTEXT_MENU_ITEM_TAG_PASTE,
+ EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_GUESS,
+ EWK_CONTEXT_MENU_ITEM_TAG_NO_GUESSES_FOUND,
+ EWK_CONTEXT_MENU_ITEM_TAG_IGNORE_SPELLING,
+ EWK_CONTEXT_MENU_ITEM_TAG_LEARN_SPELLING,
+ EWK_CONTEXT_MENU_ITEM_TAG_OTHER,
+ EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_IN_SPOTLIGHT,
+ EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_WEB,
+ EWK_CONTEXT_MENU_ITEM_TAG_LOOK_UP_IN_DICTIONARY,
+ EWK_CONTEXT_MENU_ITEM_TAG_OPEN_WITH_DEFAULT_APPLICATION,
+ EWK_CONTEXT_MENU_ITEM_PDFACTUAL_SIZE,
+ EWK_CONTEXT_MENU_ITEM_PDFZOOM_IN,
+ EWK_CONTEXT_MENU_ITEM_PDFZOOM_OUT,
+ EWK_CONTEXT_MENU_ITEM_PDFAUTO_SIZE,
+ EWK_CONTEXT_MENU_ITEM_PDFSINGLE_PAGE,
+ EWK_CONTEXT_MENU_ITEM_PDFFACING_PAGES,
+ EWK_CONTEXT_MENU_ITEM_PDFCONTINUOUS,
+ EWK_CONTEXT_MENU_ITEM_PDFNEXT_PAGE,
+ 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_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_SHOW_FONTS,
+ EWK_CONTEXT_MENU_ITEM_TAG_BOLD,
+ EWK_CONTEXT_MENU_ITEM_TAG_ITALIC,
+ EWK_CONTEXT_MENU_ITEM_TAG_UNDERLINE,
+ 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_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_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_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
+};
+typedef enum _Ewk_Context_Menu_Action Ewk_Context_Menu_Action;
+
+// 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
+};
+typedef enum _Ewk_Context_Menu_Item_Type Ewk_Context_Menu_Item_Type;
+
+/**
+ * The structure to contain Context Menu data
+ */
+typedef struct _Ewk_Context_Menu Ewk_Context_Menu;
+
+/**
+ * Represents one item from Ewk_Context_Menu
+ */
+typedef struct _Ewk_Context_Menu_Item Ewk_Context_Menu_Item;
+
+
+
+/************************** Exported functions ***********************/
+
+EAPI void ewk_context_menu_ref(Ewk_Context_Menu* menu);
+EAPI void ewk_context_menu_unref(Ewk_Context_Menu* menu);
+EAPI Eina_Bool ewk_context_menu_destroy(Ewk_Context_Menu* menu);
+
+EAPI const Eina_List* ewk_context_menu_item_list_get(Ewk_Context_Menu* o);
+
+EAPI 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);
+EAPI void ewk_context_menu_item_free(Ewk_Context_Menu_Item* item);
+EAPI Eina_Bool ewk_context_menu_item_select(Ewk_Context_Menu* menu, Ewk_Context_Menu_Item* item);
+EAPI Ewk_Context_Menu_Item_Type ewk_context_menu_item_type_get(Ewk_Context_Menu_Item* o);
+EAPI Eina_Bool ewk_context_menu_item_type_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Item_Type type);
+EAPI Ewk_Context_Menu_Action ewk_context_menu_item_action_get(Ewk_Context_Menu_Item* o);
+EAPI Eina_Bool ewk_context_menu_item_action_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Action action);
+EAPI const char* ewk_context_menu_item_title_get(Ewk_Context_Menu_Item* o);
+EAPI const char* ewk_context_menu_item_title_set(Ewk_Context_Menu_Item* o, const char* title);
+EAPI Eina_Bool ewk_context_menu_item_checked_get(Ewk_Context_Menu_Item* o);
+EAPI Eina_Bool ewk_context_menu_item_checked_set(Ewk_Context_Menu_Item* o, Eina_Bool checked);
+EAPI Eina_Bool ewk_context_menu_item_enabled_get(Ewk_Context_Menu_Item* o);
+EAPI Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item* o, Eina_Bool enabled);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // ewk_contextmenu_h
diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp
index 5e93a05..6cbcefe 100644
--- a/WebKit/efl/ewk/ewk_frame.cpp
+++ b/WebKit/efl/ewk/ewk_frame.cpp
@@ -634,8 +634,6 @@ Eina_Bool ewk_frame_editable_set(Evas_Object* o, Eina_Bool editable)
return EINA_TRUE;
if (editable)
sd->frame->applyEditingStyleToBodyElement();
- else
- sd->frame->removeEditingStyleFromBodyElement();
return EINA_TRUE;
}
@@ -971,7 +969,10 @@ float ewk_frame_zoom_get(const Evas_Object* o)
{
EWK_FRAME_SD_GET_OR_RETURN(o, sd, -1.0);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, -1.0);
- return sd->frame->zoomFactor();
+ WebCore::FrameView* view = sd->frame->view();
+ if (!view)
+ return -1;
+ return view->zoomFactor();
}
/**
@@ -993,7 +994,10 @@ Eina_Bool ewk_frame_zoom_set(Evas_Object* o, float zoom)
zoomMode = WebCore::ZoomTextOnly;
else
zoomMode = WebCore::ZoomPage;
- sd->frame->setZoomFactor(zoom, zoomMode);
+ WebCore::FrameView* view = sd->frame->view();
+ if (!view)
+ return EINA_FALSE;
+ view->setZoomFactor(zoom, zoomMode);
return EINA_TRUE;
}
@@ -1032,7 +1036,10 @@ Eina_Bool ewk_frame_zoom_text_only_set(Evas_Object* o, Eina_Bool setting)
zoomMode = WebCore::ZoomTextOnly;
else
zoomMode = WebCore::ZoomPage;
- sd->frame->setZoomFactor(sd->frame->zoomFactor(), zoomMode);
+ WebCore::FrameView* view = sd->frame->view();
+ if (!view)
+ return EINA_FALSE;
+ view->setZoomFactor(view->zoomFactor(), zoomMode);
return EINA_TRUE;
}
diff --git a/WebKit/efl/ewk/ewk_main.cpp b/WebKit/efl/ewk/ewk_main.cpp
index 145357c..92346e7 100644
--- a/WebKit/efl/ewk/ewk_main.cpp
+++ b/WebKit/efl/ewk/ewk_main.cpp
@@ -26,6 +26,7 @@
#include "PageCache.h"
#include "PageGroup.h"
#include "ewk_private.h"
+#include "ewk_settings.h"
#include "runtime/InitializeThreading.h"
#include "wtf/Threading.h"
@@ -34,6 +35,7 @@
#include <Edje.h>
#include <Eina.h>
#include <Evas.h>
+#include <stdlib.h>
#ifdef ENABLE_GLIB_SUPPORT
#include <glib-object.h>
@@ -113,6 +115,9 @@ 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"));
+
// TODO: this should move to WebCore, already reported to webkit-gtk folks:
if (1) {
SoupSession* session = WebCore::ResourceHandle::defaultSession();
diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h
index 947bd79..5f66fd8 100644
--- a/WebKit/efl/ewk/ewk_private.h
+++ b/WebKit/efl/ewk/ewk_private.h
@@ -41,6 +41,13 @@ extern "C" {
// If defined, ewk will do type checking to ensure objects are of correct type
#define EWK_TYPE_CHECK 1
+// forward declarations
+namespace WebCore {
+struct PopupMenuClient;
+struct ContextMenu;
+struct ContextMenuItem;
+}
+
void ewk_view_ready(Evas_Object *o);
void ewk_view_title_set(Evas_Object *o, const char *title);
void ewk_view_uri_changed(Evas_Object *o);
@@ -74,7 +81,7 @@ void ewk_view_run_javascript_alert(Evas_Object *o, Evas_Object *fram
Eina_Bool ewk_view_run_javascript_confirm(Evas_Object *o, Evas_Object *frame, const char *message);
Eina_Bool ewk_view_run_javascript_prompt(Evas_Object *o, Evas_Object *frame, const char *message, const char *defaultValue, char **value);
Eina_Bool ewk_view_should_interrupt_javascript(Evas_Object *o);
-void ewk_view_exceeded_database_quota(Evas_Object *o, Evas_Object *frame, const char *databaseName);
+uint64_t ewk_view_exceeded_database_quota(Evas_Object *o, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size);
void ewk_view_repaint(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
void ewk_view_scroll(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch, Eina_Bool main_frame);
@@ -84,9 +91,17 @@ WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object *o, Evas_Objec
WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues, const WebCore::String& mimeType, bool loadManually);
+void ewk_view_popup_new(Evas_Object *o, WebCore::PopupMenuClient* client, int selected, const WebCore::IntRect& rect);
+
Ewk_History *ewk_history_new(WebCore::BackForwardList *history);
void ewk_history_free(Ewk_History *history);
+Ewk_Context_Menu *ewk_context_menu_new(Evas_Object *view, WebCore::ContextMenuController *controller);
+Eina_Bool ewk_context_menu_free(Ewk_Context_Menu *o);
+void ewk_context_menu_item_append(Ewk_Context_Menu *o, WebCore::ContextMenuItem& core);
+Ewk_Context_Menu *ewk_context_menu_custom_get(Ewk_Context_Menu *o);
+void ewk_context_menu_show(Ewk_Context_Menu *o);
+
Evas_Object *ewk_frame_add(Evas *e);
Eina_Bool ewk_frame_init(Evas_Object *o, Evas_Object *view, WebCore::Frame *frame);
Evas_Object *ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WebCore::String& name, const WebCore::KURL& url, const WebCore::String& referrer);
diff --git a/WebKit/efl/ewk/ewk_settings.cpp b/WebKit/efl/ewk/ewk_settings.cpp
index 0822dc2..b50cd75 100644
--- a/WebKit/efl/ewk/ewk_settings.cpp
+++ b/WebKit/efl/ewk/ewk_settings.cpp
@@ -22,6 +22,9 @@
#include "ewk_settings.h"
#include "EWebKit.h"
+#if ENABLE(DATABASE)
+#include "DatabaseTracker.h"
+#endif
#include "IconDatabase.h"
#include "Image.h"
#include "IntSize.h"
@@ -36,7 +39,7 @@
#include <sys/types.h>
#include <unistd.h>
-static uint64_t _ewk_default_web_database_quota = 1 * 1024;
+static uint64_t _ewk_default_web_database_quota = 1 * 1024 * 1024;
/**
* Returns the default quota for Web Database databases. By default
@@ -50,6 +53,38 @@ uint64_t ewk_settings_web_database_default_quota_get()
}
/**
+ * Sets the current path to the directory WebKit will write Web
+ * Database databases.
+ *
+ * @path: the new database directory path
+ *
+ */
+void ewk_settings_web_database_path_set(const char *path)
+{
+#if ENABLE(DATABASE)
+ WebCore::String corePath = WebCore::String::fromUTF8(path);
+ WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(corePath);
+#endif
+}
+
+/**
+ * Return directory path where web database is stored.
+ *
+ * @return newly allocated string with database path. Note that return must be
+ * freed with free() as it's a strdup()ed copy of the string due reference
+ * counting.
+ */
+const char *ewk_settings_web_database_path_get()
+{
+#if ENABLE(DATABASE)
+ WebCore::String path = WebCore::DatabaseTracker::tracker().databaseDirectoryPath();
+ return strdup(path.utf8().data());
+#else
+ return 0;
+#endif
+}
+
+/**
* Sets directory where to store icon database, opening database.
*
* @param directory where to store icon database, must be
diff --git a/WebKit/efl/ewk/ewk_settings.h b/WebKit/efl/ewk/ewk_settings.h
index e843fd1..87d015c 100644
--- a/WebKit/efl/ewk/ewk_settings.h
+++ b/WebKit/efl/ewk/ewk_settings.h
@@ -38,6 +38,8 @@ extern "C" {
*/
EAPI uint64_t ewk_settings_web_database_default_quota_get();
+EAPI void ewk_settings_web_database_path_set(const char *path);
+EAPI const char *ewk_settings_web_database_path_get();
EAPI Eina_Bool ewk_settings_icon_database_path_set(const char *path);
EAPI char *ewk_settings_icon_database_path_get(void);
diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp
index d981459..d5920e5 100644
--- a/WebKit/efl/ewk/ewk_view.cpp
+++ b/WebKit/efl/ewk/ewk_view.cpp
@@ -23,15 +23,18 @@
#include "ChromeClientEfl.h"
#include "ContextMenuClientEfl.h"
+#include "ContextMenuController.h"
#include "DocumentLoader.h"
#include "DragClientEfl.h"
#include "EWebKit.h"
#include "EditorClientEfl.h"
+#include "EventHandler.h"
#include "FocusController.h"
#include "FrameLoaderClientEfl.h"
#include "FrameView.h"
#include "GraphicsContext.h"
#include "InspectorClientEfl.h"
+#include "PlatformMouseEvent.h"
#include "PopupMenuClient.h"
#include "ProgressTracker.h"
#include "ewk_private.h"
@@ -514,6 +517,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd)
static_cast<WebCore::DragClient*>(new WebCore::DragClientEfl),
static_cast<WebCore::InspectorClient*>(new WebCore::InspectorClientEfl),
0,
+ 0,
0);
if (!priv->page) {
CRITICAL("Could not create WebKit Page");
@@ -1476,6 +1480,46 @@ Eina_Bool ewk_view_select_word(Evas_Object* o)
}
/**
+ * Forwards a request of new Context Menu to WebCore.
+ *
+ * @param o View.
+ * @param ev Event data.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_context_menu_forward_event(Evas_Object* o, const Evas_Event_Mouse_Down* ev)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+ EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+ Eina_Bool mouse_press_handled = EINA_FALSE;
+
+ priv->page->contextMenuController()->clearContextMenu();
+ WebCore::Frame* main_frame = priv->page->mainFrame();
+ Evas_Coord x, y;
+ evas_object_geometry_get(sd->self, &x, &y, 0, 0);
+
+ WebCore::PlatformMouseEvent event(ev, WebCore::IntPoint(x, y));
+
+ if (main_frame->view()) {
+ mouse_press_handled =
+ main_frame->eventHandler()->handleMousePressEvent(event);
+ }
+
+ if (main_frame->eventHandler()->sendContextMenuEvent(event))
+ return EINA_FALSE;
+
+ WebCore::ContextMenu* coreMenu =
+ priv->page->contextMenuController()->contextMenu();
+ if (!coreMenu) {
+ // WebCore decided not to create a context menu, return true if event
+ // was handled by handleMouseReleaseEvent
+ return mouse_press_handled;
+ }
+
+ return EINA_TRUE;
+}
+
+/**
* Get current load progress estimate from 0.0 to 1.0.
*
* @param o view object to get current progress.
@@ -3393,14 +3437,20 @@ Eina_Bool ewk_view_should_interrupt_javascript(Evas_Object* o)
* @param o View.
* @param frame The frame whose web page exceeded its database quota.
* @param databaseName Database name.
+ * @param current_size Current size of this database
+ * @param expected_size The expected size of this database in order to fulfill
+ * site's requirement.
*/
-void ewk_view_exceeded_database_quota(Evas_Object* o, Evas_Object* frame, const char* databaseName)
+uint64_t ewk_view_exceeded_database_quota(Evas_Object* o, Evas_Object* frame, const char* databaseName, uint64_t current_size, uint64_t expected_size)
{
DBG("o=%p", o);
- EWK_VIEW_SD_GET_OR_RETURN(o, sd);
- EINA_SAFETY_ON_NULL_RETURN(sd->api);
- EINA_SAFETY_ON_NULL_RETURN(sd->api->exceeded_database_quota);
- sd->api->exceeded_database_quota(sd, frame, databaseName);
+ EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, 0);
+ if (!sd->api->exceeded_database_quota)
+ return 0;
+
+ ERR("##### %lu %lu", current_size, expected_size);
+ return sd->api->exceeded_database_quota(sd, frame, databaseName, current_size, expected_size);
}
/**
diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h
index 20df601..b029a68 100644
--- a/WebKit/efl/ewk/ewk_view.h
+++ b/WebKit/efl/ewk/ewk_view.h
@@ -125,7 +125,7 @@ struct _Ewk_View_Smart_Class {
Eina_Bool (*run_javascript_confirm)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message);
Eina_Bool (*run_javascript_prompt)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message, const char *defaultValue, char **value);
Eina_Bool (*should_interrupt_javascript)(Ewk_View_Smart_Data *sd);
- void (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *databaseName);
+ uint64_t (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size);
Eina_Bool (*run_open_panel)(Ewk_View_Smart_Data *sd, Evas_Object *frame, Eina_Bool allows_multiple_files, const Eina_List *suggested_filenames, Eina_List **selected_filenames);
};
@@ -305,6 +305,8 @@ EAPI Eina_Bool ewk_view_select_sentence(Evas_Object *o);
EAPI Eina_Bool ewk_view_select_line(Evas_Object *o);
EAPI Eina_Bool ewk_view_select_word(Evas_Object *o);
+EAPI Eina_Bool ewk_view_context_menu_forward_event(Evas_Object *o, const Evas_Event_Mouse_Down *ev);
+
EAPI void ewk_view_popup_selected_set(Evas_Object *o, int index);
EAPI Eina_Bool ewk_view_popup_destroy(Evas_Object *o);
diff --git a/WebKit/efl/ewk/ewk_view_single.c b/WebKit/efl/ewk/ewk_view_single.c
index 4111370..803b219 100644
--- a/WebKit/efl/ewk/ewk_view_single.c
+++ b/WebKit/efl/ewk/ewk_view_single.c
@@ -36,17 +36,28 @@ static void _ewk_view_single_on_del(void *data, Evas *e, Evas_Object *o, void *e
evas_object_del(clip);
}
-static Evas_Object *_ewk_view_single_smart_backing_store_add(Ewk_View_Smart_Data *sd)
+static void _ewk_view_single_smart_add(Evas_Object *o)
{
- Evas_Object *bs = evas_object_image_add(sd->base.evas);
+ Ewk_View_Smart_Data *sd;
+
+ _parent_sc.sc.add(o);
+
+ sd = (Ewk_View_Smart_Data *)evas_object_smart_data_get(o);
+
Evas_Object *clip = evas_object_rectangle_add(sd->base.evas);
- evas_object_image_alpha_set(bs, EINA_FALSE);
- evas_object_image_smooth_scale_set(bs, sd->zoom_weak_smooth_scale);
- evas_object_clip_set(bs, clip);
+ evas_object_clip_set(sd->backing_store, clip);
+ evas_object_smart_member_add(clip, o);
evas_object_show(clip);
evas_object_event_callback_add
- (bs, EVAS_CALLBACK_DEL, _ewk_view_single_on_del, clip);
+ (sd->backing_store, EVAS_CALLBACK_DEL, _ewk_view_single_on_del, clip);
+}
+
+static Evas_Object *_ewk_view_single_smart_backing_store_add(Ewk_View_Smart_Data *sd)
+{
+ Evas_Object *bs = evas_object_image_add(sd->base.evas);
+ evas_object_image_alpha_set(bs, EINA_FALSE);
+ evas_object_image_smooth_scale_set(bs, sd->zoom_weak_smooth_scale);
return bs;
}
@@ -538,6 +549,7 @@ Eina_Bool ewk_view_single_smart_set(Ewk_View_Smart_Class *api)
if (EINA_UNLIKELY(!_parent_sc.sc.add))
ewk_view_base_smart_set(&_parent_sc);
+ api->sc.add = _ewk_view_single_smart_add;
api->sc.resize = _ewk_view_single_smart_resize;
api->backing_store_add = _ewk_view_single_smart_backing_store_add;