WebCore:
authoraliceli1 <aliceli1@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Oct 2006 23:57:05 +0000 (23:57 +0000)
committeraliceli1 <aliceli1@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Oct 2006 23:57:05 +0000 (23:57 +0000)
commitb2e4ff2bd7fa75033e3ea90dd0205518ad9522be
tree7493fed143257480120898e3a3d28a596e24c70a
parentfe0009e0c1f010eb4605136926956e8f85e69bdd
WebCore:

        Reviewed by Maciej.

        This is the initial foundation for the EditingController class and
        everything else it needs to work.  The idea is that the Frame has an
        EditingController object that it calls to handle editing commands, the
        most simple examples being copy/paste.  This controller will handle
        these editing commands in WebCore, and only hand off to WebKit to call
        editing delegates (to the let the app intercept editing actions if it
        wants to).  Thus we need a platform-specific client to which the
        EditingController hands off the delegate calls,
        WebCoreEditingControllerClient.  On the WebCore side this is an
        abstract base class, and on the WebKit(Mac) side this is an ObjC++
        subclass, WebEditingControllerClient.  How does the EditingController
        get a handle to its platform-specific client?  In WebKit, the creator
        of a platform-specific Frame creates the client (which is ref-counted)
        and passes it down the chain of constructors until it gets back to the
        EditingController, which then refs it in its constructor and derefs in
        its destructor.

        No Layout tests needed.

        * WebCore.xcodeproj/project.pbxproj:
        Added files and made DomRangeInternal.h and EditingClient.h private headers, necessary for WebKit to compile

        * bridge/EditorClient.h: Added.
        (WebCore::EditorClient::~EditorClient):

        * bridge/mac/FrameMac.h:
        Added an EditingClient to the constructor, to pass down to Frame constructor

        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::FrameMac):
        Passed client down to Frame constructor

        * bridge/mac/WebCoreFrameBridge.h:
        Added an EditingClient to the constructor, to pass down to FrameMac constructor

        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge initMainFrameWithPage:withEditorClient:]):
        (-[WebCoreFrameBridge initSubframeWithOwnerElement:withEditorClient:]):
        Passed client down to FrameMac constructor

        * editing/Editor.cpp: Added.
        Mostly stuf implementations of the following functions, except for a couple.  These are all needed by cut, copy, paste, delete.
        (WebCore::generalPasteboard):
        (WebCore::Editor::canCopy):
        (WebCore::Editor::canCut):
        (WebCore::Editor::canDelete):
        (WebCore::Editor::canDeleteRange):
        (WebCore::Editor::canPaste):
        (WebCore::Editor::canSmartCopyOrDelete):
        (WebCore::Editor::deleteSelection):
        (WebCore::Editor::deleteSelectionWithSmartDelete):
        (WebCore::Editor::isSelectionRichlyEditable):
        (WebCore::Editor::pasteAsPlainTextWithPasteboard):
        (WebCore::Editor::pasteWithPasteboard):
        (WebCore::Editor::selectedRange):
        (WebCore::Editor::shouldDeleteRange):
        (WebCore::Editor::tryDHTMLCopy):
        (WebCore::Editor::tryDHTMLCut):
        (WebCore::Editor::tryDHTMLPaste):
        (WebCore::Editor::writeSelectionToPasteboard):
        (WebCore::Editor::Editor):
        (WebCore::Editor::~Editor):
        (WebCore::Editor::cut):
        (WebCore::Editor::copy):
        (WebCore::Editor::paste):
        (WebCore::Editor::performDelete):

        * editing/Editor.h: Added.

        * page/Frame.h:
        Added an EditingClient to the constructor, to pass down to Editor constructor

        * page/Frame.cpp:
        (WebCore::Frame::Frame):
        Passed down to Editor constructor
        (WebCore::Frame::editor):
        Accessfor for Editor stored in FramePrivate

        * page/FramePrivate.h:
        (WebCore::FramePrivate::FramePrivate):
        Added an Editor object to the FramePrivate data

        * platform/Sound.h: Added.
        Made a platform-independent accessor to a beep function

        * platform/mac/SoundMac.mm: Added.
        (WebCore::systemBeep):
        calls mac system beep

WebKit:

        Reviewed by Maciej.

        Adding knowledge of EditorClient to WebKit

        * WebCoreSupport/WebEditorClient.h: Added.

        * WebCoreSupport/WebEditorClient.mm: Added.
        (WebEditorClient::WebEditorClient):
        (WebEditorClient::~WebEditorClient):
        (WebEditorClient::shouldDeleteRange):
        Implementation of mac EditorClient

        * WebCoreSupport/WebFrameBridge.m:
        (-[WebFrameBridge initMainFrameWithPage:frameName:view:]):
        (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]):
        create an editor client to pass down the chain of constructors

        * WebKit.xcodeproj/project.pbxproj:
        Added related EditorClient files

        * WebKitPrefix.h:
        Added tiger build flag in order to make certain private headers from webcore compile successfully

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bridge/EditorClient.h [new file with mode: 0644]
WebCore/bridge/mac/FrameMac.h
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/editing/Editor.cpp [new file with mode: 0644]
WebCore/editing/Editor.h [new file with mode: 0644]
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/FramePrivate.h
WebCore/platform/Sound.h [new file with mode: 0644]
WebCore/platform/mac/SoundMac.mm [new file with mode: 0644]
WebKit/ChangeLog
WebKit/WebCoreSupport/WebEditorClient.h [new file with mode: 0644]
WebKit/WebCoreSupport/WebEditorClient.mm [new file with mode: 0644]
WebKit/WebCoreSupport/WebFrameBridge.m
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebKitPrefix.h