Commit db1e270a authored by kjk's avatar kjk

Reviewed by Adam Roben.

        Linux/gdk build fixes.

        * platform/gdk/EditorClientGdk.cpp: Added. Based on qt version.
        (WebCore::EditorClientGdk::shouldDeleteRange):
        (WebCore::EditorClientGdk::shouldShowDeleteInterface):
        (WebCore::EditorClientGdk::isContinuousSpellCheckingEnabled):
        (WebCore::EditorClientGdk::isGrammarCheckingEnabled):
        (WebCore::EditorClientGdk::spellCheckerDocumentTag):
        (WebCore::EditorClientGdk::shouldBeginEditing):
        (WebCore::EditorClientGdk::shouldEndEditing):
        (WebCore::EditorClientGdk::shouldInsertText):
        (WebCore::EditorClientGdk::shouldApplyStyle):
        (WebCore::EditorClientGdk::didBeginEditing):
        (WebCore::EditorClientGdk::respondToChangedContents):
        (WebCore::EditorClientGdk::didEndEditing):
        (WebCore::EditorClientGdk::didWriteSelectionToPasteboard):
        (WebCore::EditorClientGdk::didSetSelectionTypesForPasteboard):
        (WebCore::EditorClientGdk::selectWordBeforeMenuEvent):
        (WebCore::EditorClientGdk::isEditable):
        (WebCore::EditorClientGdk::registerCommandForUndo):
        (WebCore::EditorClientGdk::registerCommandForRedo):
        (WebCore::EditorClientGdk::clearUndoRedoOperations):
        (WebCore::EditorClientGdk::canUndo):
        (WebCore::EditorClientGdk::canRedo):
        (WebCore::EditorClientGdk::undo):
        (WebCore::EditorClientGdk::redo):
        (WebCore::EditorClientGdk::shouldInsertNode):
        (WebCore::EditorClientGdk::pageDestroyed):
        (WebCore::EditorClientGdk::smartInsertDeleteEnabled):
        (WebCore::EditorClientGdk::toggleContinuousSpellChecking):
        (WebCore::EditorClientGdk::toggleGrammarChecking):
        (WebCore::EditorClientGdk::handleKeyPress):
        (WebCore::EditorClientGdk::EditorClientGdk):
        (WebCore::EditorClientGdk::setPage):
        * platform/gdk/EditorClientGdk.h: Added. Ditto.
        * platform/gdk/FrameGdk.cpp: Add exitAfterLoading and dumpRenderTreeAfterLoading
        as small debugging features. Remove FrameGdkClient as no other platform has Frame*Client
        anymore. Adjust for new APIs.
        (WebCore::FrameGdk::FrameGdk):
        (WebCore::FrameGdk::onDidFinishLoad):
        (WebCore::FrameGdk::dumpRenderTree):
        (WebCore::FrameGdk::keyPress):
        (WebCore::FrameGdk::handleGdkEvent):
        (WebCore::FrameGdk::focusWindow):
        (WebCore::FrameGdk::unfocusWindow):
        (WebCore::FrameGdk::getObjectInstanceForWidget):
        (WebCore::FrameGdk::getEmbedInstanceForWidget):
        (WebCore::FrameGdk::bindingRootObject):
        (WebCore::FrameGdk::print):
        (WebCore::FrameGdk::getAppletInstanceForWidget):
        (WebCore::FrameGdk::issueCutCommand):
        (WebCore::FrameGdk::issueCopyCommand):
        (WebCore::FrameGdk::issuePasteCommand):
        (WebCore::FrameGdk::issueTransposeCommand):
        (WebCore::FrameGdk::issuePasteAndMatchStyleCommand):
        (WebCore::FrameGdk::markedTextRange):
        (WebCore::FrameGdk::shouldChangeSelection):
        (WebCore::FrameGdk::respondToChangedSelection):
        (WebCore::FrameGdk::mimeTypeForFileName):
        * platform/gdk/FrameGdk.h: Ditto.
        (WebCore::FrameGdk::setExitAfterLoading):
        (WebCore::FrameGdk::exitAfterLoading):
        (WebCore::FrameGdk::setDumpRenderTreeAfterLoading):
        (WebCore::FrameGdk::dumpRenderTreeAfterLoading):
        (WebCore::GdkFrame):
        * platform/gdk/TemporaryLinkStubs.cpp: Adjust to new APIs. Small cleanups.
        (FrameView::updateBorder):
        (Widget::setEnabled):
        (Widget::isEnabled):
        (Widget::enableFlushDrawing):
        (Widget::removeFromParent):
        (Widget::paint):
        (Widget::setIsSelected):
        (Widget::invalidate):
        (Widget::invalidateRect):
        (PlatformMouseEvent::PlatformMouseEvent):
        (WebCore::findWordBoundary):
        (ChromeClientGdk::chromeDestroyed):
        (ChromeClientGdk::closeWindowSoon):
        (ChromeClientGdk::canTakeFocus):
        (ChromeClientGdk::takeFocus):
        (ChromeClientGdk::canRunBeforeUnloadConfirmPanel):
        (ChromeClientGdk::addMessageToConsole):
        (ChromeClientGdk::runBeforeUnloadConfirmPanel):
        (ChromeClientGdk::runJavaScriptAlert):
        (ChromeClientGdk::runJavaScriptConfirm):
        (ChromeClientGdk::runJavaScriptPrompt):
        (ChromeClientGdk::setStatusbarText):
        (ChromeClientGdk::shouldInterruptJavaScript):
        (WebCore::inputElementAltText):
        (WebCore::resetButtonDefaultLabel):
        (WebCore::searchableIndexIntroduction):
        (WebCore::fileButtonChooseFileLabel):
        (WebCore::fileButtonNoFileSelectedLabel):
        (WebCore::contextMenuItemTagOpenLinkInNewWindow):
        (WebCore::contextMenuItemTagDownloadLinkToDisk):
        (WebCore::contextMenuItemTagCopyLinkToClipboard):
        (WebCore::contextMenuItemTagOpenImageInNewWindow):
        (WebCore::contextMenuItemTagDownloadImageToDisk):
        (WebCore::contextMenuItemTagCopyImageToClipboard):
        (WebCore::contextMenuItemTagOpenFrameInNewWindow):
        (WebCore::contextMenuItemTagCopy):
        (WebCore::contextMenuItemTagGoBack):
        (WebCore::contextMenuItemTagGoForward):
        (WebCore::contextMenuItemTagStop):
        (WebCore::contextMenuItemTagReload):
        (WebCore::contextMenuItemTagCut):
        (WebCore::contextMenuItemTagPaste):
        (WebCore::contextMenuItemTagNoGuessesFound):
        (WebCore::contextMenuItemTagIgnoreSpelling):
        (WebCore::contextMenuItemTagLearnSpelling):
        (WebCore::contextMenuItemTagSearchWeb):
        (WebCore::contextMenuItemTagLookUpInDictionary):
        (WebCore::contextMenuItemTagOpenLink):
        (WebCore::contextMenuItemTagIgnoreGrammar):
        (WebCore::contextMenuItemTagSpellingMenu):
        (WebCore::contextMenuItemTagShowSpellingPanel):
        (WebCore::contextMenuItemTagCheckSpelling):
        (WebCore::contextMenuItemTagCheckSpellingWhileTyping):
        (WebCore::contextMenuItemTagCheckGrammarWithSpelling):
        (WebCore::contextMenuItemTagFontMenu):
        (WebCore::contextMenuItemTagBold):
        (WebCore::contextMenuItemTagItalic):
        (WebCore::contextMenuItemTagUnderline):
        (WebCore::contextMenuItemTagOutline):
        (WebCore::contextMenuItemTagWritingDirectionMenu):
        (WebCore::contextMenuItemTagDefaultDirection):
        (WebCore::contextMenuItemTagLeftToRight):
        (WebCore::contextMenuItemTagRightToLeft):
        (PlugInInfoStore::createPluginInfoForPluginAtIndex):
        (PlugInInfoStore::pluginCount):
        (WebCore::PlugInInfoStore::supportsMIMEType):
        (WebCore::refreshPlugins):
        (SearchPopupMenu::saveRecentSearches):
        (SearchPopupMenu::loadRecentSearches):
        (SearchPopupMenu::SearchPopupMenu):
        (Path::apply):
        (PlatformScrollbar::PlatformScrollbar):
        (PlatformScrollbar::~PlatformScrollbar):
        (PlatformScrollbar::width):
        (PlatformScrollbar::height):
        (PlatformScrollbar::setEnabled):
        (PlatformScrollbar::paint):
        (PlatformScrollbar::updateThumbPosition):
        (PlatformScrollbar::updateThumbProportion):
        (PlatformScrollbar::setRect):
        (ResourceHandle::willLoadFromCache):
        (ResourceHandle::loadsBlocked):
        (ResourceHandle::loadResourceSynchronously):
        (PageCache::close):
        (Editor::ignoreSpelling):
        (Editor::learnSpelling):
        (Editor::isSelectionUngrammatical):
        (Editor::isSelectionMisspelled):
        (Editor::guessesForMisspelledSelection):
        (Editor::guessesForUngrammaticalSelection):
        (Editor::markMisspellingsAfterTypingToPosition):
        (Editor::newGeneralClipboard):
        (Pasteboard::generalPasteboard):
        (Pasteboard::writeSelection):
        (Pasteboard::writeURL):
        (Pasteboard::clear):
        (Pasteboard::canSmartReplace):
        (Pasteboard::documentFragment):
        (Pasteboard::plainText):
        (Pasteboard::Pasteboard):
        (Pasteboard::~Pasteboard):
        (ContextMenu::ContextMenu):
        (ContextMenu::~ContextMenu):
        (ContextMenu::appendItem):
        (ContextMenu::setPlatformDescription):
        (ContextMenu::platformDescription):
        (ContextMenuItem::ContextMenuItem):
        (ContextMenuItem::~ContextMenuItem):
        (ContextMenuItem::releasePlatformDescription):
        (ContextMenuItem::type):
        (ContextMenuItem::setType):
        (ContextMenuItem::action):
        (ContextMenuItem::setAction):
        (ContextMenuItem::title):
        (ContextMenuItem::setTitle):
        (ContextMenuItem::platformSubMenu):
        (ContextMenuItem::setSubMenu):
        (ContextMenuItem::setChecked):
        (ContextMenuItem::setEnabled):
        (WebCore::systemBeep):
        (WebCore::userIdleTime):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 55148981
2007-02-08 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
Reviewed by Adam Roben.
Linux/gdk build fixes.
* platform/gdk/EditorClientGdk.cpp: Added. Based on qt version.
(WebCore::EditorClientGdk::shouldDeleteRange):
(WebCore::EditorClientGdk::shouldShowDeleteInterface):
(WebCore::EditorClientGdk::isContinuousSpellCheckingEnabled):
(WebCore::EditorClientGdk::isGrammarCheckingEnabled):
(WebCore::EditorClientGdk::spellCheckerDocumentTag):
(WebCore::EditorClientGdk::shouldBeginEditing):
(WebCore::EditorClientGdk::shouldEndEditing):
(WebCore::EditorClientGdk::shouldInsertText):
(WebCore::EditorClientGdk::shouldApplyStyle):
(WebCore::EditorClientGdk::didBeginEditing):
(WebCore::EditorClientGdk::respondToChangedContents):
(WebCore::EditorClientGdk::didEndEditing):
(WebCore::EditorClientGdk::didWriteSelectionToPasteboard):
(WebCore::EditorClientGdk::didSetSelectionTypesForPasteboard):
(WebCore::EditorClientGdk::selectWordBeforeMenuEvent):
(WebCore::EditorClientGdk::isEditable):
(WebCore::EditorClientGdk::registerCommandForUndo):
(WebCore::EditorClientGdk::registerCommandForRedo):
(WebCore::EditorClientGdk::clearUndoRedoOperations):
(WebCore::EditorClientGdk::canUndo):
(WebCore::EditorClientGdk::canRedo):
(WebCore::EditorClientGdk::undo):
(WebCore::EditorClientGdk::redo):
(WebCore::EditorClientGdk::shouldInsertNode):
(WebCore::EditorClientGdk::pageDestroyed):
(WebCore::EditorClientGdk::smartInsertDeleteEnabled):
(WebCore::EditorClientGdk::toggleContinuousSpellChecking):
(WebCore::EditorClientGdk::toggleGrammarChecking):
(WebCore::EditorClientGdk::handleKeyPress):
(WebCore::EditorClientGdk::EditorClientGdk):
(WebCore::EditorClientGdk::setPage):
* platform/gdk/EditorClientGdk.h: Added. Ditto.
* platform/gdk/FrameGdk.cpp: Add exitAfterLoading and dumpRenderTreeAfterLoading
as small debugging features. Remove FrameGdkClient as no other platform has Frame*Client
anymore. Adjust for new APIs.
(WebCore::FrameGdk::FrameGdk):
(WebCore::FrameGdk::onDidFinishLoad):
(WebCore::FrameGdk::dumpRenderTree):
(WebCore::FrameGdk::keyPress):
(WebCore::FrameGdk::handleGdkEvent):
(WebCore::FrameGdk::focusWindow):
(WebCore::FrameGdk::unfocusWindow):
(WebCore::FrameGdk::getObjectInstanceForWidget):
(WebCore::FrameGdk::getEmbedInstanceForWidget):
(WebCore::FrameGdk::bindingRootObject):
(WebCore::FrameGdk::print):
(WebCore::FrameGdk::getAppletInstanceForWidget):
(WebCore::FrameGdk::issueCutCommand):
(WebCore::FrameGdk::issueCopyCommand):
(WebCore::FrameGdk::issuePasteCommand):
(WebCore::FrameGdk::issueTransposeCommand):
(WebCore::FrameGdk::issuePasteAndMatchStyleCommand):
(WebCore::FrameGdk::markedTextRange):
(WebCore::FrameGdk::shouldChangeSelection):
(WebCore::FrameGdk::respondToChangedSelection):
(WebCore::FrameGdk::mimeTypeForFileName):
* platform/gdk/FrameGdk.h: Ditto.
(WebCore::FrameGdk::setExitAfterLoading):
(WebCore::FrameGdk::exitAfterLoading):
(WebCore::FrameGdk::setDumpRenderTreeAfterLoading):
(WebCore::FrameGdk::dumpRenderTreeAfterLoading):
(WebCore::GdkFrame):
* platform/gdk/TemporaryLinkStubs.cpp: Adjust to new APIs. Small cleanups.
(FrameView::updateBorder):
(Widget::setEnabled):
(Widget::isEnabled):
(Widget::enableFlushDrawing):
(Widget::removeFromParent):
(Widget::paint):
(Widget::setIsSelected):
(Widget::invalidate):
(Widget::invalidateRect):
(PlatformMouseEvent::PlatformMouseEvent):
(WebCore::findWordBoundary):
(ChromeClientGdk::chromeDestroyed):
(ChromeClientGdk::closeWindowSoon):
(ChromeClientGdk::canTakeFocus):
(ChromeClientGdk::takeFocus):
(ChromeClientGdk::canRunBeforeUnloadConfirmPanel):
(ChromeClientGdk::addMessageToConsole):
(ChromeClientGdk::runBeforeUnloadConfirmPanel):
(ChromeClientGdk::runJavaScriptAlert):
(ChromeClientGdk::runJavaScriptConfirm):
(ChromeClientGdk::runJavaScriptPrompt):
(ChromeClientGdk::setStatusbarText):
(ChromeClientGdk::shouldInterruptJavaScript):
(WebCore::inputElementAltText):
(WebCore::resetButtonDefaultLabel):
(WebCore::searchableIndexIntroduction):
(WebCore::fileButtonChooseFileLabel):
(WebCore::fileButtonNoFileSelectedLabel):
(WebCore::contextMenuItemTagOpenLinkInNewWindow):
(WebCore::contextMenuItemTagDownloadLinkToDisk):
(WebCore::contextMenuItemTagCopyLinkToClipboard):
(WebCore::contextMenuItemTagOpenImageInNewWindow):
(WebCore::contextMenuItemTagDownloadImageToDisk):
(WebCore::contextMenuItemTagCopyImageToClipboard):
(WebCore::contextMenuItemTagOpenFrameInNewWindow):
(WebCore::contextMenuItemTagCopy):
(WebCore::contextMenuItemTagGoBack):
(WebCore::contextMenuItemTagGoForward):
(WebCore::contextMenuItemTagStop):
(WebCore::contextMenuItemTagReload):
(WebCore::contextMenuItemTagCut):
(WebCore::contextMenuItemTagPaste):
(WebCore::contextMenuItemTagNoGuessesFound):
(WebCore::contextMenuItemTagIgnoreSpelling):
(WebCore::contextMenuItemTagLearnSpelling):
(WebCore::contextMenuItemTagSearchWeb):
(WebCore::contextMenuItemTagLookUpInDictionary):
(WebCore::contextMenuItemTagOpenLink):
(WebCore::contextMenuItemTagIgnoreGrammar):
(WebCore::contextMenuItemTagSpellingMenu):
(WebCore::contextMenuItemTagShowSpellingPanel):
(WebCore::contextMenuItemTagCheckSpelling):
(WebCore::contextMenuItemTagCheckSpellingWhileTyping):
(WebCore::contextMenuItemTagCheckGrammarWithSpelling):
(WebCore::contextMenuItemTagFontMenu):
(WebCore::contextMenuItemTagBold):
(WebCore::contextMenuItemTagItalic):
(WebCore::contextMenuItemTagUnderline):
(WebCore::contextMenuItemTagOutline):
(WebCore::contextMenuItemTagWritingDirectionMenu):
(WebCore::contextMenuItemTagDefaultDirection):
(WebCore::contextMenuItemTagLeftToRight):
(WebCore::contextMenuItemTagRightToLeft):
(PlugInInfoStore::createPluginInfoForPluginAtIndex):
(PlugInInfoStore::pluginCount):
(WebCore::PlugInInfoStore::supportsMIMEType):
(WebCore::refreshPlugins):
(SearchPopupMenu::saveRecentSearches):
(SearchPopupMenu::loadRecentSearches):
(SearchPopupMenu::SearchPopupMenu):
(Path::apply):
(PlatformScrollbar::PlatformScrollbar):
(PlatformScrollbar::~PlatformScrollbar):
(PlatformScrollbar::width):
(PlatformScrollbar::height):
(PlatformScrollbar::setEnabled):
(PlatformScrollbar::paint):
(PlatformScrollbar::updateThumbPosition):
(PlatformScrollbar::updateThumbProportion):
(PlatformScrollbar::setRect):
(ResourceHandle::willLoadFromCache):
(ResourceHandle::loadsBlocked):
(ResourceHandle::loadResourceSynchronously):
(PageCache::close):
(Editor::ignoreSpelling):
(Editor::learnSpelling):
(Editor::isSelectionUngrammatical):
(Editor::isSelectionMisspelled):
(Editor::guessesForMisspelledSelection):
(Editor::guessesForUngrammaticalSelection):
(Editor::markMisspellingsAfterTypingToPosition):
(Editor::newGeneralClipboard):
(Pasteboard::generalPasteboard):
(Pasteboard::writeSelection):
(Pasteboard::writeURL):
(Pasteboard::clear):
(Pasteboard::canSmartReplace):
(Pasteboard::documentFragment):
(Pasteboard::plainText):
(Pasteboard::Pasteboard):
(Pasteboard::~Pasteboard):
(ContextMenu::ContextMenu):
(ContextMenu::~ContextMenu):
(ContextMenu::appendItem):
(ContextMenu::setPlatformDescription):
(ContextMenu::platformDescription):
(ContextMenuItem::ContextMenuItem):
(ContextMenuItem::~ContextMenuItem):
(ContextMenuItem::releasePlatformDescription):
(ContextMenuItem::type):
(ContextMenuItem::setType):
(ContextMenuItem::action):
(ContextMenuItem::setAction):
(ContextMenuItem::title):
(ContextMenuItem::setTitle):
(ContextMenuItem::platformSubMenu):
(ContextMenuItem::setSubMenu):
(ContextMenuItem::setChecked):
(ContextMenuItem::setEnabled):
(WebCore::systemBeep):
(WebCore::userIdleTime):
2007-02-08 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
Reviewed by Adam Roben.
......
/*
* 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.
*/
#include "config.h"
#include "EditorClientGdk.h"
#include "EditCommand.h"
#include "Editor.h"
#include "FocusController.h"
#include "Frame.h"
#include "KeyboardCodes.h"
#include "KeyboardEvent.h"
#include "Page.h"
#include "PlatformKeyboardEvent.h"
#include <stdio.h>
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED %s %s:%d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__); } while(0)
namespace WebCore {
bool EditorClientGdk::shouldDeleteRange(Range*)
{
notImplemented();
return false;
}
bool EditorClientGdk::shouldShowDeleteInterface(HTMLElement*)
{
return false;
}
bool EditorClientGdk::isContinuousSpellCheckingEnabled()
{
notImplemented();
return false;
}
bool EditorClientGdk::isGrammarCheckingEnabled()
{
notImplemented();
return false;
}
int EditorClientGdk::spellCheckerDocumentTag()
{
notImplemented();
return 0;
}
bool EditorClientGdk::shouldBeginEditing(WebCore::Range*)
{
notImplemented();
return false;
}
bool EditorClientGdk::shouldEndEditing(WebCore::Range*)
{
notImplemented();
return false;
}
bool EditorClientGdk::shouldInsertText(String, Range*, EditorInsertAction)
{
notImplemented();
return false;
}
bool EditorClientGdk::shouldApplyStyle(WebCore::CSSStyleDeclaration*,
WebCore::Range*)
{
notImplemented();
return false;
}
void EditorClientGdk::didBeginEditing()
{
notImplemented();
}
void EditorClientGdk::respondToChangedContents()
{
notImplemented();
}
void EditorClientGdk::didEndEditing()
{
notImplemented();
}
void EditorClientGdk::didWriteSelectionToPasteboard()
{
notImplemented();
}
void EditorClientGdk::didSetSelectionTypesForPasteboard()
{
notImplemented();
}
bool EditorClientGdk::selectWordBeforeMenuEvent()
{
notImplemented();
return false;
}
bool EditorClientGdk::isEditable()
{
Frame* frame = m_page->focusController()->focusedOrMainFrame();
if (!frame)
return false;
return frame->selectionController()->isContentEditable();
}
void EditorClientGdk::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand>)
{
notImplemented();
}
void EditorClientGdk::registerCommandForRedo(WTF::PassRefPtr<WebCore::EditCommand>)
{
notImplemented();
}
void EditorClientGdk::clearUndoRedoOperations()
{
notImplemented();
}
bool EditorClientGdk::canUndo() const
{
notImplemented();
return false;
}
bool EditorClientGdk::canRedo() const
{
notImplemented();
return false;
}
void EditorClientGdk::undo()
{
notImplemented();
}
void EditorClientGdk::redo()
{
notImplemented();
}
bool EditorClientGdk::shouldInsertNode(Node*, Range*, EditorInsertAction)
{
notImplemented();
return false;
}
void EditorClientGdk::pageDestroyed()
{
notImplemented();
}
bool EditorClientGdk::smartInsertDeleteEnabled()
{
notImplemented();
return false;
}
void EditorClientGdk::toggleContinuousSpellChecking()
{
notImplemented();
}
void EditorClientGdk::toggleGrammarChecking()
{
EditorClientGdk();
}
void EditorClientGdk::handleKeyPress(KeyboardEvent* event)
{
Frame* frame = m_page->focusController()->focusedOrMainFrame();
if (!frame)
return;
const PlatformKeyboardEvent* kevent = event->keyEvent();
if (!kevent->isKeyUp()) {
Node* start = frame->selectionController()->start().node();
if (start && start->isContentEditable()) {
switch (kevent->WindowsKeyCode()) {
case VK_BACK:
frame->editor()->deleteWithDirection(SelectionController::BACKWARD,
CharacterGranularity, false, true);
break;
case VK_DELETE:
frame->editor()->deleteWithDirection(SelectionController::FORWARD,
CharacterGranularity, false, true);
break;
case VK_LEFT:
frame->editor()->execCommand("MoveLeft");
break;
case VK_RIGHT:
frame->editor()->execCommand("MoveRight");
break;
case VK_UP:
frame->editor()->execCommand("MoveUp");
break;
case VK_DOWN:
frame->editor()->execCommand("MoveDown");
break;
default:
frame->editor()->insertText(kevent->text(), false, event);
}
event->setDefaultHandled();
}
}
}
EditorClientGdk::EditorClientGdk()
{
}
void EditorClientGdk::setPage(Page* page)
{
m_page = page;
}
}
// vim: ts=4 sw=4 et
/*
* 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 EditorClientGdk_h
#define EditorClientGdk_h
#include "EditorClient.h"
#include <wtf/Forward.h>
namespace WebCore {
class Page;
class EditorClientGdk : public EditorClient {
public:
EditorClientGdk();
// from EditorClient
virtual void pageDestroyed();
virtual bool shouldDeleteRange(Range*);
virtual bool shouldShowDeleteInterface(HTMLElement*);
virtual bool smartInsertDeleteEnabled();
virtual bool isContinuousSpellCheckingEnabled();
virtual void toggleContinuousSpellChecking();
virtual bool isGrammarCheckingEnabled();
virtual void toggleGrammarChecking();
virtual int spellCheckerDocumentTag();
virtual bool selectWordBeforeMenuEvent();
virtual bool isEditable();
virtual bool shouldBeginEditing(Range*);
virtual bool shouldEndEditing(Range*);
virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction);
virtual bool shouldInsertText(String, Range*, EditorInsertAction);
virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*);
virtual void didBeginEditing();
virtual void respondToChangedContents();
virtual void didEndEditing();
virtual void didWriteSelectionToPasteboard();
virtual void didSetSelectionTypesForPasteboard();
virtual void registerCommandForUndo(PassRefPtr<EditCommand>);
virtual void registerCommandForRedo(PassRefPtr<EditCommand>);
virtual void clearUndoRedoOperations();
virtual bool canUndo() const;
virtual bool canRedo() const;
virtual void undo();
virtual void redo();
virtual void handleKeyPress(KeyboardEvent*);
// EditorClientGdk only
void setPage(Page*);
private:
Page* m_page;
};
}
#endif
// vim: ts=4 sw=4 et
......@@ -28,37 +28,35 @@
#include "config.h"
#include "FrameGdk.h"
#include "ChromeClientGdk.h"
#include "DOMImplementation.h"
#include "DOMWindow.h"
#include "CString.h"
#include "Document.h"
#include "EditorClient.h"
#include "Element.h"
#include "FrameLoadRequest.h"
#include "DocumentLoader.h"
#include "EventHandler.h"
#include "FrameLoader.h"
#include "FrameLoaderClientGdk.h"
#include "FramePrivate.h"
#include "FrameView.h"
#include "GraphicsContext.h"
#include "HTMLDocument.h"
#include "HitTestRequest.h"
#include "HitTestResult.h"
#include "KeyboardCodes.h"
#include "MouseEventWithHitTestResults.h"
#include "Page.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformMouseEvent.h"
#include "PlatformString.h"
#include "PlatformWheelEvent.h"
#include "Plugin.h"
#include "RenderLayer.h"
#include "RenderObject.h"
#include "RenderWidget.h"
#include "RenderTreeAsText.h"
#include "ResourceHandle.h"
#include "ResourceHandleInternal.h"
#include "SSLKeyGenerator.h"
#include "ResourceResponse.h"
#include "SelectionController.h"
#include "Settings.h"
#include "TypingCommand.h"
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED %s %s:%d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__); } while(0)
// This function loads resources from WebKit
// This does not belong here and I'm not sure where
......@@ -75,73 +73,6 @@ Vector<char> loadResourceIntoArray(const char* resourceName)
namespace WebCore {
FrameGdkClientDefault::FrameGdkClientDefault()
: ResourceHandleClient()
, m_frame(0)
, m_beginCalled(false)
{
}
FrameGdkClientDefault::~FrameGdkClientDefault()
{
}
void FrameGdkClientDefault::setFrame(const FrameGdk* frame)
{
m_frame = const_cast<FrameGdk*>(frame);
}
void FrameGdkClientDefault::openURL(const KURL& url)
{
m_frame->loader()->didOpenURL(url);
m_beginCalled = false;
ResourceRequest request(url);
RefPtr<ResourceHandle> loader = ResourceHandle::create(request, this, 0);
}
void FrameGdkClientDefault::submitForm(const String& method, const KURL& url, const FormData* postData)
{
m_beginCalled = false;
ResourceRequest request(url);
request.setHTTPMethod(method);
request.setHTTPBody(*postData);
RefPtr<ResourceHandle> loader = ResourceHandle::create(request, this, 0);
}
void FrameGdkClientDefault::receivedResponse(ResourceHandle*, PlatformResponse)
{
// no-op
}
void FrameGdkClientDefault::didReceiveData(ResourceHandle* job, const char* data, int length)
{
if (!m_beginCalled) {
m_beginCalled = true;
#if 0 // FIXME: This is from Qt version, need to be removed or Gdk equivalent written
// Assign correct mimetype _before_ calling begin()!
ResourceHandleInternal* d = job->getInternal();
if (d) {