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
This diff is collapsed.
......@@ -28,153 +28,66 @@
#ifndef FrameGdk_h
#define FrameGdk_h
#include "Frame.h"
#include "EditorClient.h"
#include "ResourceHandleClient.h"
#include "Frame.h"
#include <gdk/gdk.h>
#include "ResourceHandleClient.h"
namespace WebCore {
class Element;
class FrameGdk;
class FrameLoaderClientGdk;
class FormData;
class FrameGdkClient {
public:
virtual ~FrameGdkClient() {};
virtual void setFrame(const FrameGdk*) = 0;
virtual void openURL(const KURL&) = 0;
virtual void submitForm(const String& method, const KURL&, const FormData*) = 0;
};
class FrameGdkClientDefault : public FrameGdkClient,
public ResourceHandleClient
{
public:
FrameGdkClientDefault();
virtual ~FrameGdkClientDefault();
// FrameGdkClient
virtual void setFrame(const FrameGdk*);
virtual void openURL(const KURL&);
virtual void submitForm(const String& method, const KURL&, const FormData*);
// ResourceHandleClient
virtual void receivedResponse(ResourceHandle*, PlatformResponse);
virtual void didReceiveData(ResourceHandle*, const char*, int);
virtual void receivedAllData(ResourceHandle*, PlatformData);
private:
FrameGdk* m_frame;
bool m_beginCalled : 1;
};
class FrameGdk : public Frame {
public:
FrameGdk(Page*, Element*, PassRefPtr<EditorClient>);
FrameGdk(GdkDrawable*);
FrameGdk(Page*, HTMLFrameOwnerElement*, FrameLoaderClientGdk*);
virtual ~FrameGdk();
void handleGdkEvent(GdkEvent*);
virtual void submitForm(const FrameLoadRequest&, Event*);
virtual void urlSelected(const FrameLoadRequest&, Event*);
virtual void setTitle(const String&);
// from Frame
virtual void unfocusWindow();
virtual void focusWindow();
virtual void saveDocumentState();
virtual void restoreDocumentState();
virtual void addMessageToConsole(const String& message, unsigned lineNumber, const String& sourceID);
virtual void runJavaScriptAlert(const String& message);
virtual bool runJavaScriptConfirm(const String& message);
virtual bool runJavaScriptPrompt(const String& message, const String& defaultValue, String& result);
virtual bool locationbarVisible();
virtual bool menubarVisible();
virtual bool personalbarVisible();
virtual bool statusbarVisible();
virtual bool toolbarVisible();
virtual void createEmptyDocument();
virtual Range* markedTextRange() const;
virtual String incomingReferrer() const;
virtual String userAgent() const;
virtual String mimeTypeForFileName(const String&) const;
virtual void markMisspellingsInAdjacentWords(const VisiblePosition&);
virtual void markMisspellings(const Selection&);
virtual bool lastEventIsMouseUp() const;
virtual bool passSubframeEventToSubframe(MouseEventWithHitTestResults &, Frame* subframe = 0);
virtual bool passWheelEventToChildWidget(Node*);
virtual String overrideMediaType() const;
virtual KJS::Bindings::Instance* getEmbedInstanceForWidget(Widget*);
virtual KJS::Bindings::Instance* getObjectInstanceForWidget(Widget*);
virtual KJS::Bindings::Instance* getAppletInstanceForWidget(Widget*);
virtual KJS::Bindings::RootObject* bindingRootObject();
virtual void registerCommandForUndo(PassRefPtr<EditCommand>);
virtual void registerCommandForRedo(PassRefPtr<EditCommand>);
virtual void clearUndoRedoOperations();
virtual void issueUndoCommand();
virtual void issueRedoCommand();
virtual void issueCutCommand();
virtual void issueCopyCommand();
virtual void issuePasteCommand();
virtual void issuePasteAndMatchStyleCommand();
virtual void issueTransposeCommand();
virtual void respondToChangedSelection(const Selection& oldSelection, bool closeTyping);
virtual void respondToChangedContents(const Selection& endingSelection);
virtual bool shouldChangeSelection(const Selection& oldSelection, const Selection& newSelection, EAffinity affinity, bool stillSelecting) const;
bool shouldChangeSelection(const Selection&) const;
virtual void partClearedInBegin();
virtual bool canGoBackOrForward(int distance) const;
virtual void goBackOrForward(int distance);
virtual int getHistoryLength();
virtual KURL historyURL(int distance);
virtual void handledOnloadEvents();
virtual bool canPaste() const;
virtual bool canRedo() const;
virtual bool canUndo() const;
virtual void print();
virtual bool shouldInterruptJavaScript();
bool keyPress(const PlatformKeyboardEvent&);
virtual KURL originalRequestURL() const;