diff options
Diffstat (limited to 'WebKit/gtk/WebCoreSupport')
-rw-r--r-- | WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp | 404 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/ChromeClientGtk.h | 109 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp | 195 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h | 61 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/DragClientGtk.cpp | 64 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/DragClientGtk.h | 51 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp | 549 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/EditorClientGtk.h | 118 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp | 794 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h | 181 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp | 186 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/InspectorClientGtk.h | 78 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp | 50 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h | 49 |
14 files changed, 0 insertions, 2889 deletions
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp deleted file mode 100644 index 18ca5b3..0000000 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Copyright (C) 2007 Holger Hans Peter Freyther - * Copyright (C) 2007, 2008 Christian Dywan <christian@imendio.com> - * Copyright (C) 2008 Nuanti Ltd. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "ChromeClientGtk.h" - -#include "FileSystem.h" -#include "FileChooser.h" -#include "FloatRect.h" -#include "IntRect.h" -#include "PlatformString.h" -#include "CString.h" -#include "HitTestResult.h" -#include "KURL.h" -#include "webkitwebview.h" -#include "webkitprivate.h" -#include "NotImplemented.h" -#include "WindowFeatures.h" -#if ENABLE(DATABASE) -#include "DatabaseTracker.h" -#endif - -#include <glib.h> -#include <glib/gi18n.h> -#include <gtk/gtk.h> - -using namespace WebCore; - -namespace WebKit { - -ChromeClient::ChromeClient(WebKitWebView* webView) - : m_webView(webView) -{ -} - -void ChromeClient::chromeDestroyed() -{ - delete this; -} - -FloatRect ChromeClient::windowRect() -{ - if (!m_webView) - return FloatRect(); - GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView)); - if (window) { - gint left, top, width, height; - gtk_window_get_position(GTK_WINDOW(window), &left, &top); - gtk_window_get_size(GTK_WINDOW(window), &width, &height); - return IntRect(left, top, width, height); - } - return FloatRect(); -} - -void ChromeClient::setWindowRect(const FloatRect& r) -{ - notImplemented(); -} - -FloatRect ChromeClient::pageRect() -{ - if (!m_webView) - return FloatRect(); - GtkAllocation allocation = GTK_WIDGET(m_webView)->allocation; - return IntRect(allocation.x, allocation.y, allocation.width, allocation.height); -} - -float ChromeClient::scaleFactor() -{ - // Not implementable - return 1.0; -} - -void ChromeClient::focus() -{ - if (!m_webView) - return; - gtk_widget_grab_focus(GTK_WIDGET(m_webView)); -} - -void ChromeClient::unfocus() -{ - if (!m_webView) - return; - GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView)); - if (window) - gtk_window_set_focus(GTK_WINDOW(window), NULL); -} - -Page* ChromeClient::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures& features) -{ - if (features.dialog) { - notImplemented(); - return 0; - } else { - /* TODO: FrameLoadRequest is not used */ - WebKitWebView* webView = WEBKIT_WEB_VIEW_GET_CLASS(m_webView)->create_web_view(m_webView); - if (!webView) - return 0; - - WebKitWebViewPrivate* privateData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView); - return privateData->corePage; - } -} - -void ChromeClient::show() -{ - notImplemented(); -} - -bool ChromeClient::canRunModal() -{ - notImplemented(); - return false; -} - -void ChromeClient::runModal() -{ - notImplemented(); -} - -void ChromeClient::setToolbarsVisible(bool) -{ - notImplemented(); -} - -bool ChromeClient::toolbarsVisible() -{ - notImplemented(); - return false; -} - -void ChromeClient::setStatusbarVisible(bool) -{ - notImplemented(); -} - -bool ChromeClient::statusbarVisible() -{ - notImplemented(); - return false; -} - -void ChromeClient::setScrollbarsVisible(bool) -{ - notImplemented(); -} - -bool ChromeClient::scrollbarsVisible() { - notImplemented(); - return false; -} - -void ChromeClient::setMenubarVisible(bool) -{ - notImplemented(); -} - -bool ChromeClient::menubarVisible() -{ - notImplemented(); - return false; -} - -void ChromeClient::setResizable(bool) -{ - notImplemented(); -} - -void ChromeClient::closeWindowSoon() -{ - notImplemented(); -} - -bool ChromeClient::canTakeFocus(FocusDirection) -{ - if (!m_webView) - return false; - return GTK_WIDGET_CAN_FOCUS(m_webView); -} - -void ChromeClient::takeFocus(FocusDirection) -{ - unfocus(); -} - -bool ChromeClient::canRunBeforeUnloadConfirmPanel() -{ - return true; -} - -bool ChromeClient::runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame) -{ - return runJavaScriptConfirm(frame, message); -} - -void ChromeClient::addMessageToConsole(const WebCore::String& message, unsigned int lineNumber, const WebCore::String& sourceId) -{ - gboolean retval; - g_signal_emit_by_name(m_webView, "console-message", message.utf8().data(), lineNumber, sourceId.utf8().data(), &retval); -} - -void ChromeClient::runJavaScriptAlert(Frame* frame, const String& message) -{ - gboolean retval; - g_signal_emit_by_name(m_webView, "script-alert", kit(frame), message.utf8().data(), &retval); -} - -bool ChromeClient::runJavaScriptConfirm(Frame* frame, const String& message) -{ - gboolean retval; - gboolean didConfirm; - g_signal_emit_by_name(m_webView, "script-confirm", kit(frame), message.utf8().data(), &didConfirm, &retval); - return didConfirm == TRUE; -} - -bool ChromeClient::runJavaScriptPrompt(Frame* frame, const String& message, const String& defaultValue, String& result) -{ - gboolean retval; - gchar* value = 0; - g_signal_emit_by_name(m_webView, "script-prompt", kit(frame), message.utf8().data(), defaultValue.utf8().data(), &value, &retval); - if (value) { - result = String::fromUTF8(value); - g_free(value); - return true; - } - return false; -} - -void ChromeClient::setStatusbarText(const String& string) -{ - CString stringMessage = string.utf8(); - g_signal_emit_by_name(m_webView, "status-bar-text-changed", stringMessage.data()); -} - -bool ChromeClient::shouldInterruptJavaScript() -{ - notImplemented(); - return false; -} - -bool ChromeClient::tabsToLinks() const -{ - return true; -} - -IntRect ChromeClient::windowResizerRect() const -{ - notImplemented(); - return IntRect(); -} - -void ChromeClient::repaint(const IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly) -{ - if (!m_webView) - return; - - GdkRectangle rect = windowRect; - GdkWindow* window = GTK_WIDGET(m_webView)->window; - - if (window) { - if (contentChanged) - gdk_window_invalidate_rect(window, &rect, FALSE); - // We don't currently do immediate updates since they delay other UI elements. - //if (immediate) - // gdk_window_process_updates(window, FALSE); - } -} - -void ChromeClient::scroll(const IntSize& delta, const IntRect& rectToScroll, const IntRect& clipRect) -{ - if (!m_webView) - return; - - GdkWindow* window = GTK_WIDGET(m_webView)->window; - if (!window) - return; - - GdkRectangle area = clipRect; - GdkRectangle moveRect; - - GdkRectangle sourceRect = area; - sourceRect.x -= delta.width(); - sourceRect.y -= delta.height(); - - GdkRegion* invalidRegion = gdk_region_rectangle(&area); - - if (gdk_rectangle_intersect(&area, &sourceRect, &moveRect)) { - GdkRegion* moveRegion = gdk_region_rectangle(&moveRect); - gdk_window_move_region(window, moveRegion, delta.width(), delta.height()); - gdk_region_offset(moveRegion, delta.width(), delta.height()); - gdk_region_subtract(invalidRegion, moveRegion); - gdk_region_destroy(moveRegion); - } - - gdk_window_invalidate_region(window, invalidRegion, FALSE); - gdk_region_destroy(invalidRegion); -} - -IntRect ChromeClient::windowToScreen(const IntRect& rect) const -{ - notImplemented(); - return rect; -} - -IntPoint ChromeClient::screenToWindow(const IntPoint& point) const -{ - notImplemented(); - return point; -} - -PlatformWidget ChromeClient::platformWindow() const -{ - return m_webView ? GTK_WIDGET(m_webView) : 0; -} - -void ChromeClient::mouseDidMoveOverElement(const HitTestResult& hit, unsigned modifierFlags) -{ - // check if the element is a link... - bool isLink = hit.isLiveLink(); - if (isLink) { - KURL url = hit.absoluteLinkURL(); - if (!url.isEmpty() && url != m_hoveredLinkURL) { - CString titleString = hit.title().utf8(); - CString urlString = url.prettyURL().utf8(); - g_signal_emit_by_name(m_webView, "hovering-over-link", titleString.data(), urlString.data()); - m_hoveredLinkURL = url; - } - } else if (!isLink && !m_hoveredLinkURL.isEmpty()) { - g_signal_emit_by_name(m_webView, "hovering-over-link", 0, 0); - m_hoveredLinkURL = KURL(); - } -} - -void ChromeClient::setToolTip(const String& toolTip) -{ -#if GTK_CHECK_VERSION(2,12,0) - if (toolTip.isEmpty()) - g_object_set(G_OBJECT(m_webView), "has-tooltip", FALSE, NULL); - else - gtk_widget_set_tooltip_text(GTK_WIDGET(m_webView), toolTip.utf8().data()); -#else - // TODO: Support older GTK+ versions - // See http://bugs.webkit.org/show_bug.cgi?id=15793 - notImplemented(); -#endif -} - -void ChromeClient::print(Frame* frame) -{ - webkit_web_frame_print(kit(frame)); -} - -void ChromeClient::exceededDatabaseQuota(Frame* frame, const String&) -{ -#if ENABLE(DATABASE) - // Set to 5M for testing - // FIXME: Make this configurable - notImplemented(); - const unsigned long long defaultQuota = 5 * 1024 * 1024; - DatabaseTracker::tracker().setQuota(frame->document()->securityOrigin(), defaultQuota); -#endif -} - -void ChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser) -{ - // FIXME: Support multiple files. - - RefPtr<FileChooser> fileChooser = prpFileChooser; - - GtkWidget* dialog = gtk_file_chooser_dialog_new(_("Upload File"), - GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(platformWindow()))), - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, - NULL); - - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { - gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); - if (filename) - fileChooser->chooseFile(filenameToString(filename)); - g_free(filename); - } - gtk_widget_destroy(dialog); -} - -} diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h deleted file mode 100644 index 04b3a26..0000000 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2007 Holger Hans Peter Freyther - * - * 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 ChromeClientGtk_h -#define ChromeClientGtk_h - -#include "ChromeClient.h" -#include "KURL.h" - -typedef struct _WebKitWebView WebKitWebView; - -namespace WebKit { - - class ChromeClient : public WebCore::ChromeClient { - public: - ChromeClient(WebKitWebView*); - WebKitWebView* webView() const { return m_webView; } - - virtual void chromeDestroyed(); - - virtual void setWindowRect(const WebCore::FloatRect&); - virtual WebCore::FloatRect windowRect(); - - virtual WebCore::FloatRect pageRect(); - - virtual float scaleFactor(); - - virtual void focus(); - virtual void unfocus(); - - virtual bool canTakeFocus(WebCore::FocusDirection); - virtual void takeFocus(WebCore::FocusDirection); - - virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&); - virtual void show(); - - virtual bool canRunModal(); - virtual void runModal(); - - virtual void setToolbarsVisible(bool); - virtual bool toolbarsVisible(); - - virtual void setStatusbarVisible(bool); - virtual bool statusbarVisible(); - - virtual void setScrollbarsVisible(bool); - virtual bool scrollbarsVisible(); - - virtual void setMenubarVisible(bool); - virtual bool menubarVisible(); - - virtual void setResizable(bool); - - virtual void addMessageToConsole(const WebCore::String& message, unsigned int lineNumber, - const WebCore::String& sourceID); - - virtual bool canRunBeforeUnloadConfirmPanel(); - virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame); - - virtual void closeWindowSoon(); - - virtual void runJavaScriptAlert(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptConfirm(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptPrompt(WebCore::Frame*, const WebCore::String& message, const WebCore::String& defaultValue, WebCore::String& result); - virtual void setStatusbarText(const WebCore::String&); - virtual bool shouldInterruptJavaScript(); - virtual bool tabsToLinks() const; - - virtual WebCore::IntRect windowResizerRect() const; - - virtual void repaint(const WebCore::IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false); - virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect); - virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const; - virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const; - virtual PlatformWidget platformWindow() const; - - virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags); - - virtual void setToolTip(const WebCore::String&); - - virtual void print(WebCore::Frame*); - - virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String&); - - virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); - - private: - WebKitWebView* m_webView; - WebCore::KURL m_hoveredLinkURL; - }; -} - -#endif // ChromeClient_h diff --git a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp deleted file mode 100644 index 490370c..0000000 --- a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (C) 2008 Nuanti Ltd. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "ContextMenu.h" -#include "ContextMenuClientGtk.h" - -#include "HitTestResult.h" -#include "KURL.h" -#include "NotImplemented.h" - -#include <glib-object.h> -#include <glib/gi18n.h> -#include <gtk/gtk.h> -#include "webkitprivate.h" - -using namespace WebCore; - -namespace WebKit { - -ContextMenuClient::ContextMenuClient(WebKitWebView *webView) - : m_webView(webView) -{ -} - -void ContextMenuClient::contextMenuDestroyed() -{ - delete this; -} - -static GtkWidget* inputMethodsMenuItem (WebKitWebView* webView) -{ - if (gtk_major_version > 2 || (gtk_major_version == 2 && gtk_minor_version >= 10)) { - GtkSettings* settings = webView ? gtk_widget_get_settings(GTK_WIDGET(webView)) : gtk_settings_get_default(); - - gboolean showMenu = TRUE; - if (settings) - g_object_get(settings, "gtk-show-input-method-menu", &showMenu, NULL); - if (!showMenu) - return 0; - } - - GtkWidget* menuitem = gtk_image_menu_item_new_with_mnemonic( - _("Input _Methods")); - - WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView); - GtkWidget* imContextMenu = gtk_menu_new(); - gtk_im_multicontext_append_menuitems(GTK_IM_MULTICONTEXT(priv->imContext), GTK_MENU_SHELL(imContextMenu)); - - gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), imContextMenu); - - return menuitem; -} - -// Values taken from gtktextutil.c -typedef struct { - const char *label; - gunichar ch; -} GtkUnicodeMenuEntry; -static const GtkUnicodeMenuEntry bidi_menu_entries[] = { - { N_("LRM _Left-to-right mark"), 0x200E }, - { N_("RLM _Right-to-left mark"), 0x200F }, - { N_("LRE Left-to-right _embedding"), 0x202A }, - { N_("RLE Right-to-left e_mbedding"), 0x202B }, - { N_("LRO Left-to-right _override"), 0x202D }, - { N_("RLO Right-to-left o_verride"), 0x202E }, - { N_("PDF _Pop directional formatting"), 0x202C }, - { N_("ZWS _Zero width space"), 0x200B }, - { N_("ZWJ Zero width _joiner"), 0x200D }, - { N_("ZWNJ Zero width _non-joiner"), 0x200C } -}; - -static void insertControlCharacter(GtkWidget* widget) -{ - // GtkUnicodeMenuEntry* entry = (GtkUnicodeMenuEntry*)g_object_get_data(G_OBJECT(widget), "gtk-unicode-menu-entry"); - notImplemented(); -} - -static GtkWidget* unicodeMenuItem(WebKitWebView* webView) -{ - if (gtk_major_version > 2 || (gtk_major_version == 2 && gtk_minor_version >= 10)) { - GtkSettings* settings = webView ? gtk_widget_get_settings(GTK_WIDGET(webView)) : gtk_settings_get_default(); - - gboolean showMenu = TRUE; - if (settings) - g_object_get(settings, "gtk-show-unicode-menu", &showMenu, NULL); - if (!showMenu) - return 0; - } - - GtkWidget* menuitem = gtk_image_menu_item_new_with_mnemonic( - _("_Insert Unicode Control Character")); - - GtkWidget* unicodeContextMenu = gtk_menu_new(); - unsigned i; - for (i = 0; i < G_N_ELEMENTS(bidi_menu_entries); i++) { - GtkWidget* menuitem = gtk_menu_item_new_with_mnemonic(_(bidi_menu_entries[i].label)); - g_object_set_data(G_OBJECT(menuitem), "gtk-unicode-menu-entry", (gpointer)&bidi_menu_entries[i]); - g_signal_connect(menuitem, "activate", G_CALLBACK(insertControlCharacter), 0); - gtk_widget_show(menuitem); - gtk_menu_shell_append(GTK_MENU_SHELL(unicodeContextMenu), menuitem); - // FIXME: Make the item sensitive as insertControlCharacter() is implemented - gtk_widget_set_sensitive(menuitem, FALSE); - } - - gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), unicodeContextMenu); - - return menuitem; -} - -PlatformMenuDescription ContextMenuClient::getCustomMenuFromDefaultItems(ContextMenu* menu) -{ - GtkMenu* gtkmenu = menu->releasePlatformDescription(); - - HitTestResult result = menu->hitTestResult(); - WebKitWebView* webView = m_webView; - - if (result.isContentEditable()) { - - GtkWidget* imContextMenu = inputMethodsMenuItem(webView); - GtkWidget* unicodeContextMenu = unicodeMenuItem(webView); - - if (imContextMenu || unicodeContextMenu) { - GtkWidget* separator = gtk_separator_menu_item_new(); - gtk_menu_shell_append(GTK_MENU_SHELL(gtkmenu), separator); - gtk_widget_show(separator); - } - - if (imContextMenu) { - gtk_menu_shell_append(GTK_MENU_SHELL(gtkmenu), imContextMenu); - gtk_widget_show(imContextMenu); - } - - if (unicodeContextMenu) { - gtk_menu_shell_append(GTK_MENU_SHELL(gtkmenu), unicodeContextMenu); - gtk_widget_show(unicodeContextMenu); - } - - } - - return gtkmenu; -} - -void ContextMenuClient::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*) -{ - notImplemented(); -} - -void ContextMenuClient::downloadURL(const KURL& url) -{ - notImplemented(); -} - -void ContextMenuClient::copyImageToClipboard(const HitTestResult&) -{ - notImplemented(); -} - -void ContextMenuClient::searchWithGoogle(const Frame*) -{ - notImplemented(); -} - -void ContextMenuClient::lookUpInDictionary(Frame*) -{ - notImplemented(); -} - -void ContextMenuClient::speak(const String&) -{ - notImplemented(); -} - -void ContextMenuClient::stopSpeaking() -{ - notImplemented(); -} - -} - diff --git a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h deleted file mode 100644 index 52f7ad7..0000000 --- a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2006 Zack Rusin <zack@kde.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef ContextMenuClientGtk_h -#define ContextMenuClientGtk_h - -#include "ContextMenuClient.h" - -typedef struct _WebKitWebView WebKitWebView; - -namespace WebCore { - class ContextMenu; -} - -namespace WebKit { - - class ContextMenuClient : public WebCore::ContextMenuClient - { - public: - ContextMenuClient(WebKitWebView*); - - virtual void contextMenuDestroyed(); - - virtual WebCore::PlatformMenuDescription getCustomMenuFromDefaultItems(WebCore::ContextMenu*); - virtual void contextMenuItemSelected(WebCore::ContextMenuItem*, const WebCore::ContextMenu*); - - virtual void downloadURL(const WebCore::KURL& url); - virtual void copyImageToClipboard(const WebCore::HitTestResult&); - virtual void searchWithGoogle(const WebCore::Frame*); - virtual void lookUpInDictionary(WebCore::Frame*); - virtual void speak(const WebCore::String&); - virtual void stopSpeaking(); - - private: - WebKitWebView* m_webView; - }; -} - -#endif diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp deleted file mode 100644 index f55b6ea..0000000 --- a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "DragClientGtk.h" - -#include "NotImplemented.h" - -using namespace WebCore; - -namespace WebKit { - -void DragClient::willPerformDragDestinationAction(DragDestinationAction, DragData*) -{ - notImplemented(); -} - -void DragClient::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*) -{ - notImplemented(); -} - -DragDestinationAction DragClient::actionMaskForDrag(DragData*) -{ - notImplemented(); - return DragDestinationActionAny; -} - -DragSourceAction DragClient::dragSourceActionMaskForPoint(const IntPoint&) -{ - notImplemented(); - return DragSourceActionAny; -} - -void DragClient::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard*, Frame*, bool) -{ - notImplemented(); -} - -DragImageRef DragClient::createDragImageForLink(KURL&, const String& label, Frame*) -{ - notImplemented(); - return 0; -} - -void DragClient::dragControllerDestroyed() -{ - delete this; -} -} - diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.h b/WebKit/gtk/WebCoreSupport/DragClientGtk.h deleted file mode 100644 index 4367c68..0000000 --- a/WebKit/gtk/WebCoreSupport/DragClientGtk.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007 Holger Hans Peter Freyther - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DragClientGtk_h -#define DragClientGtk_h - -#include "DragClient.h" - -namespace WebKit { - class DragClient : public WebCore::DragClient { - public: - virtual void willPerformDragDestinationAction(WebCore::DragDestinationAction, WebCore::DragData*); - virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*); - virtual WebCore::DragDestinationAction actionMaskForDrag(WebCore::DragData*); - - virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint); - - virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragImageOrigin, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag = false); - virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WebCore::String& label, WebCore::Frame*); - - virtual void dragControllerDestroyed(); - }; -} - -#endif diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp deleted file mode 100644 index 62f1f27..0000000 --- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp +++ /dev/null @@ -1,549 +0,0 @@ -/* - * Copyright (C) 2007 Alp Toker <alp@atoker.com> - * Copyright (C) 2008 Nuanti Ltd. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "EditorClientGtk.h" - -#include "CString.h" -#include "EditCommand.h" -#include "Editor.h" -#include "FocusController.h" -#include "Frame.h" -#include "KeyboardCodes.h" -#include "KeyboardEvent.h" -#include "NotImplemented.h" -#include "Page.h" -#include "PlatformKeyboardEvent.h" -#include "markup.h" -#include "webkitprivate.h" - -using namespace WebCore; - -namespace WebKit { - -static void imContextCommitted(GtkIMContext* context, const gchar* str, EditorClient* client) -{ - Frame* targetFrame = core(client->m_webView)->focusController()->focusedOrMainFrame(); - - if (!targetFrame || !targetFrame->editor()->canEdit()) - return; - - Editor* editor = targetFrame->editor(); - - String commitString = String::fromUTF8(str); - editor->confirmComposition(commitString); -} - -static void imContextPreeditChanged(GtkIMContext* context, EditorClient* client) -{ - Frame* frame = core(client->m_webView)->focusController()->focusedOrMainFrame(); - Editor* editor = frame->editor(); - - gchar* preedit = NULL; - gint cursorPos = 0; - // We ignore the provided PangoAttrList for now. - gtk_im_context_get_preedit_string(context, &preedit, NULL, &cursorPos); - String preeditString = String::fromUTF8(preedit); - g_free(preedit); - - // setComposition() will replace the user selection if passed an empty - // preedit. We don't want this to happen. - if (preeditString.isEmpty() && !editor->hasComposition()) - return; - - Vector<CompositionUnderline> underlines; - underlines.append(CompositionUnderline(0, preeditString.length(), Color(0, 0, 0), false)); - editor->setComposition(preeditString, underlines, cursorPos, 0); -} - -void EditorClient::setInputMethodState(bool active) -{ - WebKitWebViewPrivate* priv = m_webView->priv; - - if (active) - gtk_im_context_focus_in(priv->imContext); - else - gtk_im_context_focus_out(priv->imContext); - -#ifdef MAEMO_CHANGES - if (active) - hildon_gtk_im_context_show(priv->imContext); - else - hildon_gtk_im_context_hide(priv->imContext); -#endif -} - -bool EditorClient::shouldDeleteRange(Range*) -{ - notImplemented(); - return true; -} - -bool EditorClient::shouldShowDeleteInterface(HTMLElement*) -{ - return false; -} - -bool EditorClient::isContinuousSpellCheckingEnabled() -{ - notImplemented(); - return false; -} - -bool EditorClient::isGrammarCheckingEnabled() -{ - notImplemented(); - return false; -} - -int EditorClient::spellCheckerDocumentTag() -{ - notImplemented(); - return 0; -} - -bool EditorClient::shouldBeginEditing(WebCore::Range*) -{ - notImplemented(); - return true; -} - -bool EditorClient::shouldEndEditing(WebCore::Range*) -{ - notImplemented(); - return true; -} - -bool EditorClient::shouldInsertText(const String&, Range*, EditorInsertAction) -{ - notImplemented(); - return true; -} - -bool EditorClient::shouldChangeSelectedRange(Range*, Range*, EAffinity, bool) -{ - notImplemented(); - return true; -} - -bool EditorClient::shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*) -{ - notImplemented(); - return true; -} - -bool EditorClient::shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*) -{ - notImplemented(); - return true; -} - -void EditorClient::didBeginEditing() -{ - notImplemented(); -} - -void EditorClient::respondToChangedContents() -{ - notImplemented(); -} - -#if GTK_CHECK_VERSION(2,10,0) -static void clipboard_get_contents_cb(GtkClipboard* clipboard, GtkSelectionData* selection_data, guint info, gpointer data) -{ - WebKitWebView* webView = reinterpret_cast<WebKitWebView*>(data); - Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); - PassRefPtr<Range> selectedRange = frame->selection()->toRange(); - - if (static_cast<gint>(info) == WEBKIT_WEB_VIEW_TARGET_INFO_HTML) { - String markup = createMarkup(selectedRange.get(), 0, AnnotateForInterchange); - gtk_selection_data_set(selection_data, selection_data->target, 8, - reinterpret_cast<const guchar*>(markup.utf8().data()), markup.utf8().length()); - } else { - String text = selectedRange->text(); - gtk_selection_data_set_text(selection_data, text.utf8().data(), text.utf8().length()); - } -} - -static void clipboard_clear_contents_cb(GtkClipboard* clipboard, gpointer data) -{ - WebKitWebView* webView = reinterpret_cast<WebKitWebView*>(data); - Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); - - // Collapse the selection without clearing it - frame->selection()->setBase(frame->selection()->extent(), frame->selection()->affinity()); -} -#endif - -void EditorClient::respondToChangedSelection() -{ - WebKitWebViewPrivate* priv = m_webView->priv; - Frame* targetFrame = core(m_webView)->focusController()->focusedOrMainFrame(); - - if (!targetFrame) - return; - - if (targetFrame->editor()->ignoreCompositionSelectionChange()) - return; - -#if GTK_CHECK_VERSION(2,10,0) - GtkClipboard* clipboard = gtk_widget_get_clipboard(GTK_WIDGET(m_webView), GDK_SELECTION_PRIMARY); - if (targetFrame->selection()->isRange()) { - GtkTargetList* targetList = webkit_web_view_get_copy_target_list(m_webView); - gint targetCount; - GtkTargetEntry* targets = gtk_target_table_new_from_list(targetList, &targetCount); - gtk_clipboard_set_with_owner(clipboard, targets, targetCount, - clipboard_get_contents_cb, clipboard_clear_contents_cb, G_OBJECT(m_webView)); - gtk_target_table_free(targets, targetCount); - } else if (gtk_clipboard_get_owner(clipboard) == G_OBJECT(m_webView)) - gtk_clipboard_clear(clipboard); -#endif - - if (!targetFrame->editor()->hasComposition()) - return; - - unsigned start; - unsigned end; - if (!targetFrame->editor()->getCompositionSelection(start, end)) { - // gtk_im_context_reset() clears the composition for us. - gtk_im_context_reset(priv->imContext); - targetFrame->editor()->confirmCompositionWithoutDisturbingSelection(); - } -} - -void EditorClient::didEndEditing() -{ - notImplemented(); -} - -void EditorClient::didWriteSelectionToPasteboard() -{ - notImplemented(); -} - -void EditorClient::didSetSelectionTypesForPasteboard() -{ - notImplemented(); -} - -bool EditorClient::isEditable() -{ - return webkit_web_view_get_editable(m_webView); -} - -void EditorClient::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand>) -{ - notImplemented(); -} - -void EditorClient::registerCommandForRedo(WTF::PassRefPtr<WebCore::EditCommand>) -{ - notImplemented(); -} - -void EditorClient::clearUndoRedoOperations() -{ - notImplemented(); -} - -bool EditorClient::canUndo() const -{ - notImplemented(); - return false; -} - -bool EditorClient::canRedo() const -{ - notImplemented(); - return false; -} - -void EditorClient::undo() -{ - notImplemented(); -} - -void EditorClient::redo() -{ - notImplemented(); -} - -bool EditorClient::shouldInsertNode(Node*, Range*, EditorInsertAction) -{ - notImplemented(); - return true; -} - -void EditorClient::pageDestroyed() -{ - delete this; -} - -bool EditorClient::smartInsertDeleteEnabled() -{ - notImplemented(); - return false; -} - -void EditorClient::toggleContinuousSpellChecking() -{ - notImplemented(); -} - -void EditorClient::toggleGrammarChecking() -{ -} - -void EditorClient::handleKeyboardEvent(KeyboardEvent* event) -{ - Frame* frame = core(m_webView)->focusController()->focusedOrMainFrame(); - if (!frame || !frame->document()->focusedNode()) - return; - - const PlatformKeyboardEvent* kevent = event->keyEvent(); - if (!kevent || kevent->type() == PlatformKeyboardEvent::KeyUp) - return; - - Node* start = frame->selection()->start().node(); - if (!start) - return; - - // FIXME: Use GtkBindingSet instead of this hard-coded switch - // http://bugs.webkit.org/show_bug.cgi?id=15911 - - if (start->isContentEditable()) { - switch (kevent->windowsVirtualKeyCode()) { - case VK_BACK: - frame->editor()->deleteWithDirection(SelectionController::BACKWARD, - kevent->ctrlKey() ? WordGranularity : CharacterGranularity, false, true); - break; - case VK_DELETE: - frame->editor()->deleteWithDirection(SelectionController::FORWARD, - kevent->ctrlKey() ? WordGranularity : CharacterGranularity, false, true); - break; - case VK_LEFT: - frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::LEFT, - kevent->ctrlKey() ? WordGranularity : CharacterGranularity, - true); - break; - case VK_RIGHT: - frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::RIGHT, - kevent->ctrlKey() ? WordGranularity : CharacterGranularity, - true); - break; - case VK_UP: - frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::BACKWARD, - kevent->ctrlKey() ? ParagraphGranularity : LineGranularity, - true); - break; - case VK_DOWN: - frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::FORWARD, - kevent->ctrlKey() ? ParagraphGranularity : LineGranularity, - true); - break; - case VK_PRIOR: // PageUp - frame->editor()->command(kevent->shiftKey() ? "MovePageUpAndModifySelection" : "MovePageUp").execute(); - break; - case VK_NEXT: // PageDown - frame->editor()->command(kevent->shiftKey() ? "MovePageDownAndModifySelection" : "MovePageDown").execute(); - break; - case VK_HOME: - if (kevent->ctrlKey() && kevent->shiftKey()) - frame->editor()->command("MoveToBeginningOfDocumentAndModifySelection").execute(); - else if (kevent->ctrlKey()) - frame->editor()->command("MoveToBeginningOfDocument").execute(); - else if (kevent->shiftKey()) - frame->editor()->command("MoveToBeginningOfLineAndModifySelection").execute(); - else - frame->editor()->command("MoveToBeginningOfLine").execute(); - break; - case VK_END: - if (kevent->ctrlKey() && kevent->shiftKey()) - frame->editor()->command("MoveToEndOfDocumentAndModifySelection").execute(); - else if (kevent->ctrlKey()) - frame->editor()->command("MoveToEndOfDocument").execute(); - else if (kevent->shiftKey()) - frame->editor()->command("MoveToEndOfLineAndModifySelection").execute(); - else - frame->editor()->command("MoveToEndOfLine").execute(); - break; - case VK_RETURN: - frame->editor()->command("InsertLineBreak").execute(); - break; - case VK_TAB: - return; - default: - if (!kevent->ctrlKey() && !kevent->altKey() && !kevent->text().isEmpty()) { - if (kevent->text().length() == 1) { - UChar ch = kevent->text()[0]; - // Don't insert null or control characters as they can result in unexpected behaviour - if (ch < ' ') - break; - } - frame->editor()->insertText(kevent->text(), event); - } else if (kevent->ctrlKey()) { - switch (kevent->windowsVirtualKeyCode()) { - case VK_B: - frame->editor()->command("ToggleBold").execute(); - break; - case VK_I: - frame->editor()->command("ToggleItalic").execute(); - break; - case VK_Y: - frame->editor()->command("Redo").execute(); - break; - case VK_Z: - frame->editor()->command("Undo").execute(); - break; - default: - return; - } - } else return; - } - } else { - switch (kevent->windowsVirtualKeyCode()) { - case VK_UP: - frame->editor()->command("MoveUp").execute(); - break; - case VK_DOWN: - frame->editor()->command("MoveDown").execute(); - break; - case VK_PRIOR: // PageUp - frame->editor()->command("MovePageUp").execute(); - break; - case VK_NEXT: // PageDown - frame->editor()->command("MovePageDown").execute(); - break; - case VK_HOME: - if (kevent->ctrlKey()) - frame->editor()->command("MoveToBeginningOfDocument").execute(); - break; - case VK_END: - if (kevent->ctrlKey()) - frame->editor()->command("MoveToEndOfDocument").execute(); - break; - default: - return; - } - } - event->setDefaultHandled(); -} - -void EditorClient::handleInputMethodKeydown(KeyboardEvent* event) -{ - WebKitWebViewPrivate* priv = m_webView->priv; - - // TODO: Dispatch IE-compatible text input events for IM events. - if (gtk_im_context_filter_keypress(priv->imContext, event->keyEvent()->gdkEventKey())) - event->setDefaultHandled(); -} - -EditorClient::EditorClient(WebKitWebView* webView) - : m_webView(webView) -{ - WebKitWebViewPrivate* priv = m_webView->priv; - g_signal_connect(priv->imContext, "commit", G_CALLBACK(imContextCommitted), this); - g_signal_connect(priv->imContext, "preedit-changed", G_CALLBACK(imContextPreeditChanged), this); -} - -EditorClient::~EditorClient() -{ - WebKitWebViewPrivate* priv = m_webView->priv; - g_signal_handlers_disconnect_by_func(priv->imContext, (gpointer)imContextCommitted, this); - g_signal_handlers_disconnect_by_func(priv->imContext, (gpointer)imContextPreeditChanged, this); -} - -void EditorClient::textFieldDidBeginEditing(Element*) -{ -} - -void EditorClient::textFieldDidEndEditing(Element*) -{ -} - -void EditorClient::textDidChangeInTextField(Element*) -{ -} - -bool EditorClient::doTextFieldCommandFromEvent(Element*, KeyboardEvent*) -{ - return false; -} - -void EditorClient::textWillBeDeletedInTextField(Element*) -{ - notImplemented(); -} - -void EditorClient::textDidChangeInTextArea(Element*) -{ - notImplemented(); -} - -void EditorClient::ignoreWordInSpellDocument(const String&) -{ - notImplemented(); -} - -void EditorClient::learnWord(const String&) -{ - notImplemented(); -} - -void EditorClient::checkSpellingOfString(const UChar*, int, int*, int*) -{ - notImplemented(); -} - -void EditorClient::checkGrammarOfString(const UChar*, int, Vector<GrammarDetail>&, int*, int*) -{ - notImplemented(); -} - -void EditorClient::updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) -{ - notImplemented(); -} - -void EditorClient::updateSpellingUIWithMisspelledWord(const String&) -{ - notImplemented(); -} - -void EditorClient::showSpellingUI(bool) -{ - notImplemented(); -} - -bool EditorClient::spellingUIIsShowing() -{ - notImplemented(); - return false; -} - -void EditorClient::getGuessesForWord(const String&, Vector<String>&) -{ - notImplemented(); -} - -} diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h deleted file mode 100644 index de31842..0000000 --- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> - * Copyright (C) 2006 Zack Rusin <zack@kde.org> - * Copyright (C) 2006 Apple Computer, Inc. - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef EditorClientGtk_h -#define EditorClientGtk_h - -#include "EditorClient.h" - -#include <wtf/Forward.h> - -typedef struct _WebKitWebView WebKitWebView; - -namespace WebCore { - class Page; -} - -namespace WebKit { - - class EditorClient : public WebCore::EditorClient { - public: - EditorClient(WebKitWebView*); - ~EditorClient(); - - // from EditorClient - virtual void pageDestroyed(); - - virtual bool shouldDeleteRange(WebCore::Range*); - virtual bool shouldShowDeleteInterface(WebCore::HTMLElement*); - virtual bool smartInsertDeleteEnabled(); - virtual bool isContinuousSpellCheckingEnabled(); - virtual void toggleContinuousSpellChecking(); - virtual bool isGrammarCheckingEnabled(); - virtual void toggleGrammarChecking(); - virtual int spellCheckerDocumentTag(); - - virtual bool isEditable(); - - virtual bool shouldBeginEditing(WebCore::Range*); - virtual bool shouldEndEditing(WebCore::Range*); - virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction); - virtual bool shouldInsertText(const WebCore::String&, WebCore::Range*, WebCore::EditorInsertAction); - virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting); - - virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*); - - virtual bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*); - - virtual void didBeginEditing(); - virtual void respondToChangedContents(); - virtual void respondToChangedSelection(); - virtual void didEndEditing(); - virtual void didWriteSelectionToPasteboard(); - virtual void didSetSelectionTypesForPasteboard(); - - virtual void registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand>); - virtual void registerCommandForRedo(WTF::PassRefPtr<WebCore::EditCommand>); - virtual void clearUndoRedoOperations(); - - virtual bool canUndo() const; - virtual bool canRedo() const; - - virtual void undo(); - virtual void redo(); - - virtual void handleKeyboardEvent(WebCore::KeyboardEvent*); - virtual void handleInputMethodKeydown(WebCore::KeyboardEvent*); - - virtual void textFieldDidBeginEditing(WebCore::Element*); - virtual void textFieldDidEndEditing(WebCore::Element*); - virtual void textDidChangeInTextField(WebCore::Element*); - virtual bool doTextFieldCommandFromEvent(WebCore::Element*, WebCore::KeyboardEvent*); - virtual void textWillBeDeletedInTextField(WebCore::Element*); - virtual void textDidChangeInTextArea(WebCore::Element*); - - virtual void ignoreWordInSpellDocument(const WebCore::String&); - virtual void learnWord(const WebCore::String&); - virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); - virtual void checkGrammarOfString(const UChar*, int length, WTF::Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); - virtual void updateSpellingUIWithGrammarString(const WebCore::String&, const WebCore::GrammarDetail&); - virtual void updateSpellingUIWithMisspelledWord(const WebCore::String&); - virtual void showSpellingUI(bool show); - virtual bool spellingUIIsShowing(); - virtual void getGuessesForWord(const WebCore::String&, WTF::Vector<WebCore::String>& guesses); - virtual void setInputMethodState(bool enabled); - - WebKitWebView* m_webView; - }; -} - -#endif - -// vim: ts=4 sw=4 et diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp deleted file mode 100644 index 8cea58f..0000000 --- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp +++ /dev/null @@ -1,794 +0,0 @@ -/* - * Copyright (C) 2007, 2008 Alp Toker <alp@atoker.com> - * Copyright (C) 2007, 2008 Holger Hans Peter Freyther - * Copyright (C) 2007 Christian Dywan <christian@twotoasts.de> - * Copyright (C) 2008 Collabora Ltd. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "FrameLoaderClientGtk.h" - -#include "DocumentLoader.h" -#include "FrameLoader.h" -#include "FrameView.h" -#include "FrameTree.h" -#include "HTMLFormElement.h" -#include "HTMLFrameElement.h" -#include "HTMLFrameOwnerElement.h" -#include "HTMLNames.h" -#include "JSDOMWindow.h" -#include "Language.h" -#include "MIMETypeRegistry.h" -#include "NotImplemented.h" -#include "PlatformString.h" -#include "PluginDatabase.h" -#include "RenderPart.h" -#include "ResourceRequest.h" -#include "CString.h" -#include "ProgressTracker.h" -#include "JSDOMBinding.h" -#include "ScriptController.h" -#include "webkitwebview.h" -#include "webkitwebframe.h" -#include "webkitprivate.h" - -#include <JavaScriptCore/APICast.h> -#include <stdio.h> -#if PLATFORM(UNIX) -#include <sys/utsname.h> -#endif - -using namespace WebCore; - -namespace WebKit { - -FrameLoaderClient::FrameLoaderClient(WebKitWebFrame* frame) - : m_frame(frame) - , m_userAgent("") - , m_pluginView(0) - , m_hasSentResponseToPlugin(false) -{ - ASSERT(m_frame); -} - -static String agentPlatform() -{ -#ifdef GDK_WINDOWING_X11 - return "X11"; -#elif defined(GDK_WINDOWING_WIN32) - return "Windows"; -#elif defined(GDK_WINDOWING_QUARTZ) - return "Macintosh"; -#elif defined(GDK_WINDOWING_DIRECTFB) - return "DirectFB"; -#else - notImplemented(); - return "Unknown"; -#endif -} - -static String agentOS() -{ -#if PLATFORM(DARWIN) -#if PLATFORM(X86) - return "Intel Mac OS X"; -#else - return "PPC Mac OS X"; -#endif -#elif PLATFORM(UNIX) - struct utsname name; - if (uname(&name) != -1) - return String::format("%s %s", name.sysname, name.machine); - else - return "Unknown"; -#elif PLATFORM(WIN_OS) - // FIXME: Compute the Windows version - return "Windows"; -#else - notImplemented(); - return "Unknown"; -#endif -} - -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 += "; U; "; // Security - ua += agentOS(); // OS-or-CPU - ua += "; "; - ua += defaultLanguage(); // Localization information - ua += ") "; - - // WebKit Product - // FIXME: The WebKit version is hardcoded - static const String webKitVersion = "528.5+"; - 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 FrameLoaderClient::userAgent(const KURL&) -{ - if (m_userAgent.isEmpty()) - m_userAgent = composeUserAgent(); - - return m_userAgent; -} - -WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClient::createDocumentLoader(const WebCore::ResourceRequest& request, const SubstituteData& substituteData) -{ - return DocumentLoader::create(request, substituteData); -} - -void FrameLoaderClient::dispatchWillSubmitForm(FramePolicyFunction policyFunction, PassRefPtr<FormState>) -{ - // FIXME: This is surely too simple - ASSERT(policyFunction); - if (!policyFunction) - return; - (core(m_frame)->loader()->*policyFunction)(PolicyUse); -} - - -void FrameLoaderClient::committedLoad(DocumentLoader* loader, const char* data, int length) -{ - if (!m_pluginView) { - ASSERT(loader->frame()); - // Setting the encoding on the frame loader is our way to get work done that is normally done - // when the first bit of data is received, even for the case of a document with no data (like about:blank). - String encoding = loader->overrideEncoding(); - bool userChosen = !encoding.isNull(); - if (!userChosen) - encoding = loader->response().textEncodingName(); - - FrameLoader* frameLoader = loader->frameLoader(); - frameLoader->setEncoding(encoding, userChosen); - if (data) - frameLoader->addData(data, length); - } - - if (m_pluginView) { - if (!m_hasSentResponseToPlugin) { - m_pluginView->didReceiveResponse(loader->response()); - m_hasSentResponseToPlugin = true; - } - m_pluginView->didReceiveData(data, length); - } -} - -void FrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&) -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&) -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&) -{ - notImplemented(); -} - -void FrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&) -{ - notImplemented(); -} - -void FrameLoaderClient::postProgressStartedNotification() -{ - WebKitWebView* webView = getViewFromFrame(m_frame); - g_signal_emit_by_name(webView, "load-started", m_frame); -} - -void FrameLoaderClient::postProgressEstimateChangedNotification() -{ - WebKitWebView* webView = getViewFromFrame(m_frame); - Page* corePage = core(webView); - - g_signal_emit_by_name(webView, "load-progress-changed", lround(corePage->progress()->estimatedProgress()*100)); -} - -void FrameLoaderClient::postProgressFinishedNotification() -{ - WebKitWebView* webView = getViewFromFrame(m_frame); - - g_signal_emit_by_name(webView, "load-finished", m_frame); -} - -void FrameLoaderClient::frameLoaderDestroyed() -{ - g_object_unref(m_frame); - m_frame = 0; - delete this; -} - -void FrameLoaderClient::dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse& response) -{ - m_response = response; -} - -void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction policyFunction, const String&, const ResourceRequest&) -{ - // FIXME: we need to call directly here (comment copied from Qt version) - ASSERT(policyFunction); - if (!policyFunction) - return; - (core(m_frame)->loader()->*policyFunction)(PolicyUse); -} - -void FrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction policyFunction, const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>, const String&) -{ - ASSERT(policyFunction); - if (!policyFunction) - return; - // FIXME: I think Qt version marshals this to another thread so when we - // have multi-threaded download, we might need to do the same - (core(m_frame)->loader()->*policyFunction)(PolicyIgnore); -} - -void FrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunction policyFunction, const NavigationAction& action, const ResourceRequest& resourceRequest, PassRefPtr<FormState>) -{ - ASSERT(policyFunction); - if (!policyFunction) - return; - - WebKitWebView* webView = getViewFromFrame(m_frame); - WebKitNetworkRequest* request = webkit_network_request_new(resourceRequest.url().string().utf8().data()); - WebKitNavigationResponse response; - - g_signal_emit_by_name(webView, "navigation-requested", m_frame, request, &response); - - g_object_unref(request); - - if (response == WEBKIT_NAVIGATION_RESPONSE_IGNORE) { - (core(m_frame)->loader()->*policyFunction)(PolicyIgnore); - return; - } - - (core(m_frame)->loader()->*policyFunction)(PolicyUse); -} - -Widget* FrameLoaderClient::createPlugin(const IntSize& pluginSize, Element* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually) -{ - PluginView* pluginView = PluginView::create(core(m_frame), pluginSize, element, url, paramNames, paramValues, mimeType, loadManually); - - if (pluginView->status() == PluginStatusLoadedSuccessfully) - return pluginView; - - return 0; -} - -PassRefPtr<Frame> FrameLoaderClient::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, - const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) -{ - Frame* coreFrame = core(webFrame()); - - ASSERT(core(getViewFromFrame(webFrame())) == coreFrame->page()); - WebKitWebFrame* gtkFrame = WEBKIT_WEB_FRAME(webkit_web_frame_init_with_web_view(getViewFromFrame(webFrame()), ownerElement)); - RefPtr<Frame> childFrame(adoptRef(core(gtkFrame))); - - coreFrame->tree()->appendChild(childFrame); - - childFrame->tree()->setName(name); - childFrame->init(); - childFrame->loader()->loadURL(url, referrer, String(), FrameLoadTypeRedirectWithLockedHistory, 0, 0); - - // The frame's onload handler may have removed it from the document. - if (!childFrame->tree()->parent()) - return 0; - - return childFrame.release(); -} - -void FrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget) -{ - ASSERT(!m_pluginView); - m_pluginView = static_cast<PluginView*>(pluginWidget); - m_hasSentResponseToPlugin = false; -} - -Widget* FrameLoaderClient::createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL, - const Vector<String>& paramNames, const Vector<String>& paramValues) -{ - notImplemented(); - return 0; -} - -ObjectContentType FrameLoaderClient::objectContentType(const KURL& url, const String& mimeType) -{ - String type = mimeType; - // We don't use MIMETypeRegistry::getMIMETypeForPath() because it returns "application/octet-stream" upon failure - if (type.isEmpty()) - type = MIMETypeRegistry::getMIMETypeForExtension(url.path().substring(url.path().reverseFind('.') + 1)); - - if (type.isEmpty()) - return WebCore::ObjectContentFrame; - - if (MIMETypeRegistry::isSupportedImageMIMEType(type)) - return WebCore::ObjectContentImage; - - if (PluginDatabase::installedPlugins()->isMIMETypeRegistered(mimeType)) - return WebCore::ObjectContentNetscapePlugin; - - if (MIMETypeRegistry::isSupportedNonImageMIMEType(type)) - return WebCore::ObjectContentFrame; - - return WebCore::ObjectContentNone; -} - -String FrameLoaderClient::overrideMediaType() const -{ - notImplemented(); - return String(); -} - -void FrameLoaderClient::windowObjectCleared() -{ - // Is this obsolete now? - g_signal_emit_by_name(m_frame, "cleared"); - - Frame* coreFrame = core(webFrame()); - ASSERT(coreFrame); - - Settings* settings = coreFrame->settings(); - if (!settings || !settings->isJavaScriptEnabled()) - return; - - // TODO: Consider using g_signal_has_handler_pending() to avoid the overhead - // when there are no handlers. - JSGlobalContextRef context = toGlobalRef(coreFrame->script()->globalObject()->globalExec()); - JSObjectRef windowObject = toRef(coreFrame->script()->globalObject()); - ASSERT(windowObject); - - WebKitWebView* webView = getViewFromFrame(m_frame); - g_signal_emit_by_name(webView, "window-object-cleared", m_frame, context, windowObject); - - // TODO: Re-attach debug clients if present. - // The Win port has an example of how we might do this. -} - -void FrameLoaderClient::didPerformFirstNavigation() const -{ -} - -void FrameLoaderClient::registerForIconNotification(bool) -{ - notImplemented(); -} - -void FrameLoaderClient::setMainFrameDocumentReady(bool) -{ - // this is only interesting once we provide an external API for the DOM -} - -bool FrameLoaderClient::hasWebView() const -{ - notImplemented(); - return true; -} - -void FrameLoaderClient::dispatchDidFinishLoad() -{ - g_signal_emit_by_name(m_frame, "load-done", true); -} - -void FrameLoaderClient::frameLoadCompleted() -{ - notImplemented(); -} - -void FrameLoaderClient::saveViewStateToItem(HistoryItem*) -{ - notImplemented(); -} - -void FrameLoaderClient::restoreViewState() -{ - notImplemented(); -} - -bool FrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const -{ - // FIXME: This is a very simple implementation. More sophisticated - // implementation would delegate the decision to a PolicyDelegate. - // See mac implementation for example. - return item != 0; -} - -void FrameLoaderClient::makeRepresentation(DocumentLoader*) -{ - notImplemented(); -} - -void FrameLoaderClient::forceLayout() -{ - core(m_frame)->forceLayout(true); -} - -void FrameLoaderClient::forceLayoutForNonHTML() -{ - notImplemented(); -} - -void FrameLoaderClient::setCopiesOnScroll() -{ - notImplemented(); -} - -void FrameLoaderClient::detachedFromParent2() -{ - notImplemented(); -} - -void FrameLoaderClient::detachedFromParent3() -{ - notImplemented(); -} - -void FrameLoaderClient::loadedFromCachedPage() -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchDidHandleOnloadEvents() -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad() -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchDidCancelClientRedirect() -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchWillPerformClientRedirect(const KURL&, double, double) -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchDidChangeLocationWithinPage() -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchWillClose() -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchDidReceiveIcon() -{ - WebKitWebView* webView = getViewFromFrame(m_frame); - - g_signal_emit_by_name(webView, "icon-loaded", m_frame); -} - -void FrameLoaderClient::dispatchDidStartProvisionalLoad() -{ -} - -void FrameLoaderClient::dispatchDidReceiveTitle(const String& title) -{ - g_signal_emit_by_name(m_frame, "title-changed", title.utf8().data()); - - WebKitWebView* webView = getViewFromFrame(m_frame); - if (m_frame == webkit_web_view_get_main_frame(webView)) - g_signal_emit_by_name(webView, "title-changed", m_frame, title.utf8().data()); -} - -void FrameLoaderClient::dispatchDidCommitLoad() -{ - /* Update the URI once first data has been received. - * This means the URI is valid and successfully identify the page that's going to be loaded. - */ - WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(m_frame); - g_free(frameData->uri); - frameData->uri = g_strdup(core(m_frame)->loader()->url().prettyURL().utf8().data()); - - g_signal_emit_by_name(m_frame, "load-committed"); - - WebKitWebView* webView = getViewFromFrame(m_frame); - if (m_frame == webkit_web_view_get_main_frame(webView)) - g_signal_emit_by_name(webView, "load-committed", m_frame); -} - -void FrameLoaderClient::dispatchDidFinishDocumentLoad() -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchDidFirstLayout() -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchShow() -{ - notImplemented(); -} - -void FrameLoaderClient::cancelPolicyCheck() -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchDidLoadMainResource(DocumentLoader*) -{ - notImplemented(); -} - -void FrameLoaderClient::revertToProvisionalState(DocumentLoader*) -{ - notImplemented(); -} - -void FrameLoaderClient::willChangeTitle(DocumentLoader*) -{ - notImplemented(); -} - -void FrameLoaderClient::didChangeTitle(DocumentLoader *l) -{ - setTitle(l->title(), l->url()); -} - -bool FrameLoaderClient::canHandleRequest(const ResourceRequest&) const -{ - notImplemented(); - return true; -} - -bool FrameLoaderClient::canShowMIMEType(const String&) const -{ - notImplemented(); - return true; -} - -bool FrameLoaderClient::representationExistsForURLScheme(const String&) const -{ - notImplemented(); - return false; -} - -String FrameLoaderClient::generatedMIMETypeForURLScheme(const String&) const -{ - notImplemented(); - return String(); -} - -void FrameLoaderClient::finishedLoading(DocumentLoader* documentLoader) -{ - if (!m_pluginView) - committedLoad(documentLoader, 0, 0); - else { - m_pluginView->didFinishLoading(); - m_pluginView = 0; - m_hasSentResponseToPlugin = false; - } -} - - -void FrameLoaderClient::provisionalLoadStarted() -{ - notImplemented(); -} - -void FrameLoaderClient::didFinishLoad() { - notImplemented(); -} - -void FrameLoaderClient::prepareForDataSourceReplacement() { notImplemented(); } - -void FrameLoaderClient::setTitle(const String& title, const KURL& url) -{ - WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(m_frame); - g_free(frameData->title); - frameData->title = g_strdup(title.utf8().data()); -} - -void FrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived) -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier) -{ - notImplemented(); -} - -void FrameLoaderClient::dispatchDidFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError&) -{ - notImplemented(); -} - -bool FrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length) -{ - notImplemented(); - return false; -} - -void FrameLoaderClient::dispatchDidFailProvisionalLoad(const ResourceError&) -{ - g_signal_emit_by_name(m_frame, "load-done", false); -} - -void FrameLoaderClient::dispatchDidFailLoad(const ResourceError&) -{ - g_signal_emit_by_name(m_frame, "load-done", false); -} - -void FrameLoaderClient::download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&) -{ - notImplemented(); -} - -ResourceError FrameLoaderClient::cancelledError(const ResourceRequest&) -{ - notImplemented(); - return ResourceError(); -} - -ResourceError FrameLoaderClient::blockedError(const ResourceRequest&) -{ - notImplemented(); - return ResourceError(); -} - -ResourceError FrameLoaderClient::cannotShowURLError(const ResourceRequest&) -{ - notImplemented(); - return ResourceError(); -} - -ResourceError FrameLoaderClient::interruptForPolicyChangeError(const ResourceRequest&) -{ - notImplemented(); - return ResourceError(); -} - -ResourceError FrameLoaderClient::cannotShowMIMETypeError(const ResourceResponse&) -{ - notImplemented(); - return ResourceError(); -} - -ResourceError FrameLoaderClient::fileDoesNotExistError(const ResourceResponse&) -{ - notImplemented(); - return ResourceError(); -} - -ResourceError FrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse&) -{ - notImplemented(); - return ResourceError(); -} - -bool FrameLoaderClient::shouldFallBack(const ResourceError&) -{ - notImplemented(); - return false; -} - -bool FrameLoaderClient::canCachePage() const -{ - return true; -} - -Frame* FrameLoaderClient::dispatchCreatePage() -{ - notImplemented(); - return 0; -} - -void FrameLoaderClient::dispatchUnableToImplementPolicy(const ResourceError&) -{ - notImplemented(); -} - -void FrameLoaderClient::setMainDocumentError(DocumentLoader*, const ResourceError& error) -{ - if (m_pluginView) { - m_pluginView->didFail(error); - m_pluginView = 0; - m_hasSentResponseToPlugin = false; - } -} - -void FrameLoaderClient::startDownload(const ResourceRequest&) -{ - notImplemented(); -} - -void FrameLoaderClient::updateGlobalHistory(const KURL&) -{ - notImplemented(); -} - -void FrameLoaderClient::savePlatformDataToCachedPage(CachedPage*) -{ -} - -void FrameLoaderClient::transitionToCommittedFromCachedPage(CachedPage*) -{ -} - -void FrameLoaderClient::transitionToCommittedForNewPage() -{ - Frame* frame = core(m_frame); - ASSERT(frame); - - Page* page = frame->page(); - ASSERT(page); - - WebKitWebView* containingWindow = getViewFromFrame(m_frame); - bool isMainFrame = frame == page->mainFrame(); - - if (isMainFrame && frame->view()) - frame->view()->setParentVisible(false); - - frame->setView(0); - - FrameView* frameView; - if (isMainFrame) { - IntSize size = IntSize(GTK_WIDGET(containingWindow)->allocation.width, - GTK_WIDGET(containingWindow)->allocation.height); - frameView = new FrameView(frame, size); - WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(containingWindow); - frameView->setGtkAdjustments(priv->horizontalAdjustment, priv->verticalAdjustment); - } else - frameView = new FrameView(frame); - - frame->setView(frameView); - // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame. - frameView->deref(); - - if (isMainFrame) - frameView->setParentVisible(true); - - if (frame->ownerRenderer()) - frame->ownerRenderer()->setWidget(frameView); - - if (HTMLFrameOwnerElement* owner = frame->ownerElement()) - frame->view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff); -} - -} diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h deleted file mode 100644 index 8f63b53..0000000 --- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (C) 2006 Zack Rusin <zack@kde.org> - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2008 Collabora Ltd. All rights reserved. - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FrameLoaderClientGtk_h -#define FrameLoaderClientGtk_h - -#include "FrameLoaderClient.h" -#include "ResourceResponse.h" -#include "PluginView.h" - -typedef struct _WebKitWebFrame WebKitWebFrame; - -namespace WebKit { - - class FrameLoaderClient : public WebCore::FrameLoaderClient { - public: - FrameLoaderClient(WebKitWebFrame*); - virtual ~FrameLoaderClient() { } - virtual void frameLoaderDestroyed(); - - WebKitWebFrame* webFrame() const { return m_frame; } - - virtual bool hasWebView() const; - - virtual void makeRepresentation(WebCore::DocumentLoader*); - virtual void forceLayout(); - virtual void forceLayoutForNonHTML(); - - virtual void setCopiesOnScroll(); - - virtual void detachedFromParent2(); - virtual void detachedFromParent3(); - - virtual void loadedFromCachedPage(); - - virtual void assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest&); - - virtual void dispatchWillSendRequest(WebCore::DocumentLoader*, unsigned long identifier, WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse); - virtual void dispatchDidReceiveAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); - virtual void dispatchDidCancelAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); - virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&); - virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived); - virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier); - virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&); - virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length); - - virtual void dispatchDidHandleOnloadEvents(); - virtual void dispatchDidReceiveServerRedirectForProvisionalLoad(); - virtual void dispatchDidCancelClientRedirect(); - virtual void dispatchWillPerformClientRedirect(const WebCore::KURL&, double, double); - virtual void dispatchDidChangeLocationWithinPage(); - virtual void dispatchWillClose(); - virtual void dispatchDidReceiveIcon(); - virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WebCore::String&); - virtual void dispatchDidCommitLoad(); - virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); - virtual void dispatchDidFailLoad(const WebCore::ResourceError&); - virtual void dispatchDidFinishDocumentLoad(); - virtual void dispatchDidFinishLoad(); - virtual void dispatchDidFirstLayout(); - - virtual WebCore::Frame* dispatchCreatePage(); - virtual void dispatchShow(); - - virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, const WebCore::String& MIMEType, const WebCore::ResourceRequest&); - virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WTF::PassRefPtr<WebCore::FormState>, const WebCore::String& frameName); - virtual void dispatchDecidePolicyForNavigationAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WTF::PassRefPtr<WebCore::FormState>); - virtual void cancelPolicyCheck(); - - virtual void dispatchUnableToImplementPolicy(const WebCore::ResourceError&); - - virtual void dispatchWillSubmitForm(WebCore::FramePolicyFunction, WTF::PassRefPtr<WebCore::FormState>); - - virtual void dispatchDidLoadMainResource(WebCore::DocumentLoader*); - virtual void revertToProvisionalState(WebCore::DocumentLoader*); - virtual void setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&); - - virtual void postProgressStartedNotification(); - virtual void postProgressEstimateChangedNotification(); - virtual void postProgressFinishedNotification(); - - virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, - const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); - virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::Element*, const WebCore::KURL&, const WTF::Vector<WebCore::String>&, const WTF::Vector<WebCore::String>&, const WebCore::String&, bool); - virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); - virtual WebCore::Widget* createJavaAppletWidget(const WebCore::IntSize&, WebCore::Element*, const WebCore::KURL& baseURL, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues); - virtual WebCore::String overrideMediaType() const; - virtual void windowObjectCleared(); - virtual void didPerformFirstNavigation() const; - - virtual void registerForIconNotification(bool); - - virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WebCore::String& mimeType); - - virtual void setMainFrameDocumentReady(bool); - - virtual void startDownload(const WebCore::ResourceRequest&); - - virtual void willChangeTitle(WebCore::DocumentLoader*); - virtual void didChangeTitle(WebCore::DocumentLoader*); - - virtual void committedLoad(WebCore::DocumentLoader*, const char*, int); - virtual void finishedLoading(WebCore::DocumentLoader*); - - virtual void updateGlobalHistory(const WebCore::KURL&); - virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const; - - virtual WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&); - virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&); - virtual WebCore::ResourceError cannotShowURLError(const WebCore::ResourceRequest&); - virtual WebCore::ResourceError interruptForPolicyChangeError(const WebCore::ResourceRequest&); - - virtual WebCore::ResourceError cannotShowMIMETypeError(const WebCore::ResourceResponse&); - virtual WebCore::ResourceError fileDoesNotExistError(const WebCore::ResourceResponse&); - virtual WebCore::ResourceError pluginWillHandleLoadError(const WebCore::ResourceResponse&); - - virtual bool shouldFallBack(const WebCore::ResourceError&); - - virtual bool canHandleRequest(const WebCore::ResourceRequest&) const; - virtual bool canShowMIMEType(const WebCore::String&) const; - virtual bool representationExistsForURLScheme(const WebCore::String&) const; - virtual WebCore::String generatedMIMETypeForURLScheme(const WebCore::String&) const; - - virtual void frameLoadCompleted(); - virtual void saveViewStateToItem(WebCore::HistoryItem*); - virtual void restoreViewState(); - virtual void provisionalLoadStarted(); - virtual void didFinishLoad(); - virtual void prepareForDataSourceReplacement(); - - virtual WTF::PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WebCore::String& title, const WebCore::KURL&); - - virtual WebCore::String userAgent(const WebCore::KURL&); - - virtual void savePlatformDataToCachedPage(WebCore::CachedPage*); - virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*); - virtual void transitionToCommittedForNewPage(); - - virtual bool canCachePage() const; - virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); - private: - WebKitWebFrame* m_frame; - WebCore::ResourceResponse m_response; - WebCore::String m_userAgent; - - // Plugin view to redirect data to - WebCore::PluginView* m_pluginView; - bool m_hasSentResponseToPlugin; - }; - -} - -#endif diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp deleted file mode 100644 index 210995a..0000000 --- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (C) 2008 Gustavo Noronha Silva - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "InspectorClientGtk.h" - -#include "webkitwebview.h" -#include "webkitwebinspector.h" -#include "webkitprivate.h" -#include "CString.h" -#include "InspectorController.h" -#include "NotImplemented.h" -#include "PlatformString.h" - -using namespace WebCore; - -namespace WebKit { - -static void notifyWebViewDestroyed(WebKitWebView* webView, InspectorClient* inspectorClient) -{ - inspectorClient->webViewDestroyed(); -} - -InspectorClient::InspectorClient(WebKitWebView* webView) - : m_webView(0) - , m_inspectedWebView(webView) - , m_webInspector(0) -{} - -void InspectorClient::inspectorDestroyed() -{ - if (m_webView) { - gboolean handled = FALSE; - g_signal_emit_by_name(m_webInspector, "destroy", &handled); - - /* we can now dispose our own reference */ - g_object_unref(m_webInspector); - } - - delete this; -} - -void InspectorClient::webViewDestroyed() -{ - m_webView = 0; - core(m_inspectedWebView)->inspectorController()->pageDestroyed(); - - // createPage will be called again, if the user chooses to inspect - // something else, and the inspector will be referenced again, - // there. - g_object_unref(m_webInspector); -} - -Page* InspectorClient::createPage() -{ - if (m_webView) - return core(m_webView); - - // This g_object_get will ref the inspector. We're not doing an - // unref if this method succeeds because the inspector object must - // be alive even after the inspected WebView is destroyed - the - // close-window and destroy signals still need to be - // emitted. - WebKitWebInspector* webInspector; - g_object_get(G_OBJECT(m_inspectedWebView), "web-inspector", &webInspector, NULL); - m_webInspector = webInspector; - - g_signal_emit_by_name(m_webInspector, "inspect-web-view", m_inspectedWebView, &m_webView); - - if (!m_webView) { - g_object_unref(m_webInspector); - return 0; - } - - webkit_web_inspector_set_web_view(m_webInspector, m_webView); - - g_signal_connect(G_OBJECT(m_webView), "destroy", - G_CALLBACK(notifyWebViewDestroyed), (gpointer)this); - - webkit_web_view_open(m_webView, "file://"DATA_DIR"/webkit-1.0/webinspector/inspector.html"); - gtk_widget_show(GTK_WIDGET(m_webView)); - - return core(m_webView); -} - -String InspectorClient::localizedStringsURL() -{ - notImplemented(); - return String(); -} - -void InspectorClient::showWindow() -{ - if (!m_webView) - return; - - gboolean handled = FALSE; - g_signal_emit_by_name(m_webInspector, "show-window", &handled); - - core(m_inspectedWebView)->inspectorController()->setWindowVisible(true); -} - -void InspectorClient::closeWindow() -{ - if (!m_webView) - return; - - gboolean handled = FALSE; - g_signal_emit_by_name(m_webInspector, "close-window", &handled); - - core(m_inspectedWebView)->inspectorController()->setWindowVisible(false); -} - -void InspectorClient::attachWindow() -{ - if (!m_webView) - return; - - gboolean handled = FALSE; - g_signal_emit_by_name(m_webInspector, "attach-window", &handled); -} - -void InspectorClient::detachWindow() -{ - if (!m_webView) - return; - - gboolean handled = FALSE; - g_signal_emit_by_name(m_webInspector, "detach-window", &handled); -} - -void InspectorClient::setAttachedWindowHeight(unsigned height) -{ - notImplemented(); -} - -void InspectorClient::highlight(Node* node) -{ - notImplemented(); -} - -void InspectorClient::hideHighlight() -{ - notImplemented(); -} - -void InspectorClient::inspectedURLChanged(const String& newURL) -{ - if (!m_webView) - return; - - webkit_web_inspector_set_inspected_uri(m_webInspector, newURL.utf8().data()); -} - -void InspectorClient::populateSetting(const String& key, InspectorController::Setting& setting) -{ - notImplemented(); -} - -void InspectorClient::storeSetting(const String& key, const InspectorController::Setting& setting) -{ - notImplemented(); -} - -void InspectorClient::removeSetting(const String& key) -{ - notImplemented(); -} - -} - diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h deleted file mode 100644 index 4fba55d..0000000 --- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef InspectorClientGtk_h -#define InspectorClientGtk_h - -#include "InspectorClient.h" -#include "webkitwebview.h" -#include "webkitwebinspector.h" - -namespace WebCore { - class Node; - class Page; - class String; -} - -namespace WebKit { - - class InspectorClient : public WebCore::InspectorClient { - public: - InspectorClient(WebKitWebView* webView); - - virtual void inspectorDestroyed(); - void webViewDestroyed(); - - virtual WebCore::Page* createPage(); - - virtual WebCore::String localizedStringsURL(); - - virtual void showWindow(); - virtual void closeWindow(); - - virtual void attachWindow(); - virtual void detachWindow(); - - virtual void setAttachedWindowHeight(unsigned height); - - virtual void highlight(WebCore::Node*); - virtual void hideHighlight(); - virtual void inspectedURLChanged(const WebCore::String& newURL); - - virtual void populateSetting(const WebCore::String& key, WebCore::InspectorController::Setting&); - virtual void storeSetting(const WebCore::String& key, const WebCore::InspectorController::Setting&); - virtual void removeSetting(const WebCore::String& key); - - private: - WebKitWebView* m_webView; - WebKitWebView* m_inspectedWebView; - WebKitWebInspector* m_webInspector; - }; -} - -#endif diff --git a/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp b/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp deleted file mode 100644 index ad8b077..0000000 --- a/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2007 Luca Bruno <lethalman88@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "PasteboardHelperGtk.h" - -#include "Frame.h" -#include "webkitwebframe.h" -#include "webkitwebview.h" -#include "webkitprivate.h" - -#include <gtk/gtk.h> - -using namespace WebCore; - -namespace WebKit -{ - -GtkClipboard* PasteboardHelperGtk::getClipboard(Frame* frame) const { - WebKitWebView* webView = webkit_web_frame_get_web_view(kit(frame)); - return gtk_widget_get_clipboard(GTK_WIDGET (webView), - GDK_SELECTION_CLIPBOARD); -} - -GtkTargetList* PasteboardHelperGtk::getCopyTargetList(Frame* frame) const { - WebKitWebView* webView = webkit_web_frame_get_web_view(kit(frame)); - return webkit_web_view_get_copy_target_list(webView); -} - -GtkTargetList* PasteboardHelperGtk::getPasteTargetList(Frame* frame) const { - WebKitWebView* webView = webkit_web_frame_get_web_view(kit(frame)); - return webkit_web_view_get_paste_target_list(webView); -} - -} diff --git a/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h b/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h deleted file mode 100644 index 77e0457..0000000 --- a/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2007 Luca Bruno <lethalman88@gmail.com> - * All rights reserved. - * - * 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 PasteboardHelperGtk_h -#define PasteboardHelperGtk_h - -/* - * FIXME: this is for WebCore support and must be removed once - * a better solution is found - */ - -#include "Frame.h" -#include "PasteboardHelper.h" - -#include <gtk/gtk.h> - -using namespace WebCore; - -namespace WebKit { - -class PasteboardHelperGtk : public PasteboardHelper { -public: - PasteboardHelperGtk() { } - virtual GtkClipboard* getClipboard(Frame*) const; - virtual GtkTargetList* getCopyTargetList(Frame*) const; - virtual GtkTargetList* getPasteTargetList(Frame*) const; -}; - -} - -#endif // PasteboardHelperGtk_h |