WebCore:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jun 2004 20:36:25 +0000 (20:36 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jun 2004 20:36:25 +0000 (20:36 +0000)
        Reviewed by Ken.

        - filled out execCommand a lot more
        - fixed <rdar://problem/3685231>: (execCommand italic is not implemented)
        - fixed <rdar://problem/3685232>: (execCommand bold is not implemented)
        - fixed <rdar://problem/3675899>: (Make queryCommandIndeterm work as specified in the Javascript execCommand Compatibility Plan)
        - fixed <rdar://problem/3675901>: (Make queryCommandState work as specified in the Javascript execCommand Compatibility Plan)
        - fixed <rdar://problem/3675904>: (Make queryCommandValue work as specified in the Javascript execCommand Compatibility Plan)

        * khtml/editing/jsediting.cpp:
        (DOM::JSEditor::queryCommandIndeterm): Changed to use KHTMLPart::TriState instead of CommandState.
        (DOM::JSEditor::queryCommandState): Ditto.
        (execStyleChange): Changed to use KHTMLPart::applyStyle.
        (stateStyle): Used KHTMLPart::selectionHasStyle for this.
        (selectionStartHasStyle): Use KHTMLPart::selectionStartHasStyle for this.
        (valueStyle): Used KHTMLPart::selectionStartStylePropertyValue for this.
        (execBold): Implemented toggling, using selectionStartHasStyle.
        (execItalic): Implemented toggling, using selectionStartHasStyle.
        (execPrint): Implemented.
        (enabledRedo): Implemented, using canRedo.
        (enabledUndo): Implemented, using canUndo.
        (stateNone): Renamed from stateNo.
        (valueBackColor): Implemented, using valueStyle.
        (valueFontName): Implemented, using valueStyle.
        (valueFontSize): Implemented, using valueStyle.
        (valueForeColor): Implemented, using valueStyle.
        (valueFontSize): Implemented, using valueStyle.

        * khtml/khtml_part.h: Added editing operations.
        * khtml/khtml_part.cpp:
        (KHTMLPart::copyToPasteboard): Added.
        (KHTMLPart::cutToPasteboard): Added.
        (KHTMLPart::redo): Added.
        (KHTMLPart::undo): Added.
        (KHTMLPart::applyStyle): Added.
        (updateState): Added.
        (KHTMLPart::selectionHasStyle): Added.
        (KHTMLPart::selectionStartHasStyle): Added.
        (KHTMLPart::selectionStartStylePropertyValue): Added.
        (KHTMLPart::selectionComputedStyle): Added.
        (KHTMLPart::print): Added.

        * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Call print() on plain old part, not KWQ(part).

        * kwq/KWQKHTMLPart.h: Removed print(), added _haveUndoRedoOperations.
        * kwq/KWQKHTMLPart.mm:
        (KHTMLPart::print): Moved from KWQKHTMLPart to KHTMLPart.
        (KWQKHTMLPart::registerCommandForUndo): Moved code here from bridge.
        (KWQKHTMLPart::registerCommandForRedo): Moved code here from bridge.
        (KWQKHTMLPart::clearUndoRedoOperations): Moved code here from bridge.
        (KWQKHTMLPart::issueUndoCommand): Moved code here from bridge.
        (KWQKHTMLPart::issueRedoCommand): Moved code here from bridge.
        (KWQKHTMLPart::issuePasteCommand): Moved code here from bridge.
        (KHTMLPart::canUndo): Added.
        (KHTMLPart::canRedo): Added.

        * kwq/WebCoreBridge.h: Added undoManager, removed undo-related methods.
        * kwq/WebCoreBridge.mm: (-[WebCoreBridge applyStyle:]): Changed to call
        KHTMLPart::applyStyle.

        * WebCore.pbproj/.cvsignore: Updated for new Xcode files.

WebKit:

        Reviewed by Ken.

        * WebCoreSupport.subproj/WebBridge.m: Removed undo-related methods.
        (-[WebBridge undoManager]): Added.

        * WebKit.pbproj/.cvsignore: Updated for new Xcode files.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@6808 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/WebCore.pbproj/.cvsignore
WebCore/khtml/ecma/kjs_window.cpp
WebCore/khtml/editing/jsediting.cpp
WebCore/khtml/khtml_part.cpp
WebCore/khtml/khtml_part.h
WebCore/kwq/KWQKHTMLPart.h
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/WebCoreBridge.h
WebCore/kwq/WebCoreBridge.mm
WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebKit.pbproj/.cvsignore

index 7d964b8a65a3ebe25d5080972f92f381ea072b8f..111812392088a15defb5cc0d75a271fd5c79fc41 100644 (file)
@@ -1,3 +1,67 @@
+2004-06-10  Darin Adler  <darin@apple.com>
+
+        Reviewed by Ken.
+
+        - filled out execCommand a lot more
+        - fixed <rdar://problem/3685231>: (execCommand italic is not implemented)
+        - fixed <rdar://problem/3685232>: (execCommand bold is not implemented)
+        - fixed <rdar://problem/3675899>: (Make queryCommandIndeterm work as specified in the Javascript execCommand Compatibility Plan)
+        - fixed <rdar://problem/3675901>: (Make queryCommandState work as specified in the Javascript execCommand Compatibility Plan)
+        - fixed <rdar://problem/3675904>: (Make queryCommandValue work as specified in the Javascript execCommand Compatibility Plan)
+
+        * khtml/editing/jsediting.cpp:
+        (DOM::JSEditor::queryCommandIndeterm): Changed to use KHTMLPart::TriState instead of CommandState.
+        (DOM::JSEditor::queryCommandState): Ditto.
+        (execStyleChange): Changed to use KHTMLPart::applyStyle.
+        (stateStyle): Used KHTMLPart::selectionHasStyle for this.
+        (selectionStartHasStyle): Use KHTMLPart::selectionStartHasStyle for this.
+        (valueStyle): Used KHTMLPart::selectionStartStylePropertyValue for this.
+        (execBold): Implemented toggling, using selectionStartHasStyle.
+        (execItalic): Implemented toggling, using selectionStartHasStyle.
+        (execPrint): Implemented.
+        (enabledRedo): Implemented, using canRedo.
+        (enabledUndo): Implemented, using canUndo.
+        (stateNone): Renamed from stateNo.
+        (valueBackColor): Implemented, using valueStyle.
+        (valueFontName): Implemented, using valueStyle.
+        (valueFontSize): Implemented, using valueStyle.
+        (valueForeColor): Implemented, using valueStyle.
+        (valueFontSize): Implemented, using valueStyle.
+
+        * khtml/khtml_part.h: Added editing operations.
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::copyToPasteboard): Added.
+        (KHTMLPart::cutToPasteboard): Added.
+        (KHTMLPart::redo): Added.
+        (KHTMLPart::undo): Added.
+        (KHTMLPart::applyStyle): Added.
+        (updateState): Added.
+        (KHTMLPart::selectionHasStyle): Added.
+        (KHTMLPart::selectionStartHasStyle): Added.
+        (KHTMLPart::selectionStartStylePropertyValue): Added.
+        (KHTMLPart::selectionComputedStyle): Added.
+        (KHTMLPart::print): Added.
+
+        * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Call print() on plain old part, not KWQ(part).
+
+        * kwq/KWQKHTMLPart.h: Removed print(), added _haveUndoRedoOperations.
+        * kwq/KWQKHTMLPart.mm:
+        (KHTMLPart::print): Moved from KWQKHTMLPart to KHTMLPart.
+        (KWQKHTMLPart::registerCommandForUndo): Moved code here from bridge.
+        (KWQKHTMLPart::registerCommandForRedo): Moved code here from bridge.
+        (KWQKHTMLPart::clearUndoRedoOperations): Moved code here from bridge.
+        (KWQKHTMLPart::issueUndoCommand): Moved code here from bridge.
+        (KWQKHTMLPart::issueRedoCommand): Moved code here from bridge.
+        (KWQKHTMLPart::issuePasteCommand): Moved code here from bridge.
+        (KHTMLPart::canUndo): Added.
+        (KHTMLPart::canRedo): Added.
+
+        * kwq/WebCoreBridge.h: Added undoManager, removed undo-related methods.
+        * kwq/WebCoreBridge.mm: (-[WebCoreBridge applyStyle:]): Changed to call
+        KHTMLPart::applyStyle.
+
+        * WebCore.pbproj/.cvsignore: Updated for new Xcode files.
+
 2004-06-09  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Dave.
index 0857ac37b56ebae718f6cdec84b0c6dc2a5bb026..c5cb297b364192b02adf8018c0750b89661e9ccc 100644 (file)
@@ -1 +1,3 @@
+*.mode1
 *.pbxuser
+*.perspective
index 166cda09436118fc91b37688d3a8453da23d77d4..bc3587a0c5eea8de51c5a0d6c6f922d3faf211e3 100644 (file)
@@ -1421,7 +1421,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
   }
 #if APPLE_CHANGES
   case Window::Print:
-    KWQ(part)->print();
+    part->print();
     return Undefined();
 #endif
   case Window::ScrollBy:
index 14e08933d3e5dcea7521bb45b2b72b438e2075aa..edd14b523f41812ca053bd605278588818b4dd08 100644 (file)
 #include "KWQKHTMLPart.h"
 #include "qstring.h"
 
-#if APPLE_CHANGES
-#include "KWQAssertions.h"
-#include "KWQLogging.h"
-#else
-#define ASSERT(assertion) ((void)0)
-#define ASSERT_WITH_MESSAGE(assertion, formatAndArgs...) ((void)0)
-#define ASSERT_NOT_REACHED() ((void)0)
-#define LOG(channel, formatAndArgs...) ((void)0)
-#define ERROR(formatAndArgs...) ((void)0)
-#endif
-
-using khtml::ApplyStyleCommand;
 using khtml::TypingCommand;
 
 namespace DOM {
@@ -52,12 +40,10 @@ class DocumentImpl;
 
 namespace {
 
-enum CommandState { no, yes, partial };
-
 struct CommandImp {
     bool (*execFn)(KHTMLPart *part, bool userInterface, const DOMString &value);
     bool (*enabledFn)(KHTMLPart *part);
-    CommandState (*stateFn)(KHTMLPart *part);
+    KHTMLPart::TriState (*stateFn)(KHTMLPart *part);
     DOMString (*valueFn)(KHTMLPart *part);
 };
 
@@ -79,7 +65,6 @@ bool JSEditor::execCommand(const DOMString &command, bool userInterface, const D
     KHTMLPart *part = m_doc->part();
     if (!part)
         return false;
-    ASSERT(cmd->enabledFn);
     m_doc->updateLayout();
     return cmd->enabledFn(part) && cmd->execFn(part, userInterface, value);
 }
@@ -105,7 +90,7 @@ bool JSEditor::queryCommandIndeterm(const DOMString &command)
     if (!part)
         return false;
     m_doc->updateLayout();
-    return cmd->stateFn(part) == partial;
+    return cmd->stateFn(part) == KHTMLPart::mixedTriState;
 }
 
 bool JSEditor::queryCommandState(const DOMString &command)
@@ -117,7 +102,7 @@ bool JSEditor::queryCommandState(const DOMString &command)
     if (!part)
         return false;
     m_doc->updateLayout();
-    return cmd->stateFn(part) != no;
+    return cmd->stateFn(part) != KHTMLPart::falseTriState;
 }
 
 bool JSEditor::queryCommandSupported(const DOMString &command)
@@ -148,18 +133,7 @@ bool execStyleChange(KHTMLPart *part, int propertyID, const DOMString &propertyV
     CSSStyleDeclarationImpl *style = new CSSStyleDeclarationImpl(0);
     style->setProperty(propertyID, propertyValue);
     style->ref();
-    // FIXME: This should share code with WebCoreBridge applyStyle: -- maybe a method on KHTMLPart?
-    switch (part->selection().state()) {
-        case Selection::NONE:
-            // do nothing
-            break;
-        case Selection::CARET:
-            part->setTypingStyle(style);
-            break;
-        case Selection::RANGE:
-            ApplyStyleCommand(part->xmlDocImpl(), style).apply();
-            break;
-    }
+    part->applyStyle(style);
     style->deref();
     return true;
 }
@@ -169,19 +143,35 @@ bool execStyleChange(KHTMLPart *part, int propertyID, const char *propertyValue)
     return execStyleChange(part, propertyID, DOMString(propertyValue));
 }
 
-CommandState stateStyle(KHTMLPart *part, int propertyID, const char *desiredValue)
+KHTMLPart::TriState stateStyle(KHTMLPart *part, int propertyID, const char *desiredValue)
+{
+    CSSStyleDeclarationImpl *style = new CSSStyleDeclarationImpl(0);
+    style->setProperty(propertyID, desiredValue);
+    style->ref();
+    KHTMLPart::TriState state = part->selectionHasStyle(style);
+    style->deref();
+    return state;
+}
+
+bool selectionStartHasStyle(KHTMLPart *part, int propertyID, const char *desiredValue)
+{
+    CSSStyleDeclarationImpl *style = new CSSStyleDeclarationImpl(0);
+    style->setProperty(propertyID, desiredValue);
+    style->ref();
+    bool hasStyle = part->selectionStartHasStyle(style);
+    style->deref();
+    return hasStyle;
+}
+
+DOMString valueStyle(KHTMLPart *part, int propertyID)
 {
-    // FIXME: Needs implementation.
-    return no;
+    return part->selectionStartStylePropertyValue(propertyID);
 }
 
 // =============================================================================================
 //
 // execCommand implementations
 //
-// EDIT FIXME: All these responses should be tested against the behavior
-// of Microsoft browsers to ensure we are as compatible with their
-// behavior as is sensible.
 
 bool execBackColor(KHTMLPart *part, bool userInterface, const DOMString &value)
 {
@@ -190,21 +180,19 @@ bool execBackColor(KHTMLPart *part, bool userInterface, const DOMString &value)
 
 bool execBold(KHTMLPart *part, bool userInterface, const DOMString &value)
 {
-    bool isBold = false; // FIXME: Needs implementation.
+    bool isBold = selectionStartHasStyle(part, CSS_PROP_FONT_WEIGHT, "bold");
     return execStyleChange(part, CSS_PROP_FONT_WEIGHT, isBold ? "normal" : "bold");
 }
 
 bool execCopy(KHTMLPart *part, bool userInterface, const DOMString &value)
 {
-    // FIXME: Should have a non-KWQ-specific way to do this.
-    KWQ(part)->issueCopyCommand();
+    part->copyToPasteboard();
     return true;
 }
 
 bool execCut(KHTMLPart *part, bool userInterface, const DOMString &value)
 {
-    // FIXME: Should have a non-KWQ-specific way to do this.
-    KWQ(part)->issueCutCommand();
+    part->cutToPasteboard();
     return true;
 }
 
@@ -249,7 +237,7 @@ bool execInsertText(KHTMLPart *part, bool userInterface, const DOMString &value)
 
 bool execItalic(KHTMLPart *part, bool userInterface, const DOMString &value)
 {
-    bool isItalic = false; // FIXME: Needs implementation.
+    bool isItalic = selectionStartHasStyle(part, CSS_PROP_FONT_STYLE, "italic");
     return execStyleChange(part, CSS_PROP_FONT_STYLE, isItalic ? "normal" : "italic");
 }
 
@@ -283,8 +271,7 @@ bool execOutdent(KHTMLPart *part, bool userInterface, const DOMString &value)
 
 bool execPaste(KHTMLPart *part, bool userInterface, const DOMString &value)
 {
-    // FIXME: Should have a non-KWQ-specific way to do this.
-    KWQ(part)->issuePasteCommand();
+    part->pasteFromPasteboard();
     return true;
 }
 
@@ -292,14 +279,13 @@ bool execPaste(KHTMLPart *part, bool userInterface, const DOMString &value)
 
 bool execPrint(KHTMLPart *part, bool userInterface, const DOMString &value)
 {
-    // FIXME: Implement.
-    return false;
+    part->print();
+    return true;
 }
 
 bool execRedo(KHTMLPart *part, bool userInterface, const DOMString &value)
 {
-    // FIXME: Should have a non-KWQ-specific way to do this.
-    KWQ(part)->issueRedoCommand();
+    part->redo();
     return true;
 }
 
@@ -321,8 +307,7 @@ bool execSuperscript(KHTMLPart *part, bool userInterface, const DOMString &value
 
 bool execUndo(KHTMLPart *part, bool userInterface, const DOMString &value)
 {
-    // FIXME: Should have a non-KWQ-specific way to do this.
-    KWQ(part)->issueUndoCommand();
+    part->undo();
     return true;
 }
 
@@ -336,20 +321,11 @@ bool execUnselect(KHTMLPart *part, bool userInterface, const DOMString &value)
 //
 // queryCommandEnabled implementations
 //
-// EDIT FIXME: All these responses should be tested against the behavior
-// of Microsoft browsers to ensure we are as compatible with their
-// behavior as is sensible. For now, the returned values are just my best
-// guesses.
-//
-// It's a bit confusing to get a clear notion of the difference between
+// It's a bit difficult to get a clear notion of the difference between
 // "supported" and "enabled" from reading the Microsoft documentation, but
 // what little I could glean from that seems to make some sense.
 //     Supported = The command is supported by this object.
 //     Enabled =   The command is available and enabled.
-//
-// With this definition, the different commands return true or false
-// based on simple, and for now incomplete, checks on the part and
-// selection.
 
 bool enabled(KHTMLPart *part)
 {
@@ -365,8 +341,7 @@ bool enabledAnySelection(KHTMLPart *part)
 
 bool enabledPaste(KHTMLPart *part)
 {
-    // FIXME: Should also check if there is something on the pasteboard to paste
-    return part->selection().notEmpty();
+    return part->canPaste();
 }
 
 #endif
@@ -378,51 +353,19 @@ bool enabledRangeSelection(KHTMLPart *part)
 
 bool enabledRedo(KHTMLPart *part)
 {
-    // EDIT FIXME: Should check if the undo manager has something to undo
-    return true;
+    return part->canRedo();
 }
 
 bool enabledUndo(KHTMLPart *part)
 {
-    // EDIT FIXME: Should check if the undo manager has something to redo
-    return true;
+    return part->canUndo();
 }
 
 // =============================================================================================
 //
-// queryCommandIndeterm implementations
-//
-// EDIT FIXME: All these responses should be tested against the behavior
-// of Microsoft browsers to ensure we are as compatible with their
-// behavior as is sensible. For now, the returned values are just my best
-// guesses.
-//
-// It's a bit confusing to get a clear notion of what this method is supposed
-// to do from reading the Microsoft documentation, but my current guess is this:
-//
-//     queryCommandState and queryCommandIndeterm work in concert to return
-//     the two bits of information that are needed to tell, for instance,
-//     if the text of a selection is bold. The answer can be "yes", "no", or
-//     "partially".
-//
-// If this is so, then queryCommandState should return "yes" in the case where
-// all the text is bold and "no" for non-bold or partially-bold text.
-// Then, queryCommandIndeterm should return "no" in the case where
-// all the text is either all bold or not-bold and and "yes" for partially-bold
-// text.
-//
-// Note that, for now, the returned values are just place-holders.
-
-// =============================================================================================
-//
-// queryCommandState implementations
-//
-// EDIT FIXME: All these responses should be tested against the behavior
-// of Microsoft browsers to ensure we are as compatible with their
-// behavior as is sensible. For now, the returned values are just my best
-// guesses.
+// queryCommandIndeterm/State implementations
 //
-// It's a bit confusing to get a clear notion of what this method is supposed
+// It's a bit difficult to get a clear notion of what these methods are supposed
 // to do from reading the Microsoft documentation, but my current guess is this:
 //
 //     queryCommandState and queryCommandIndeterm work in concert to return
@@ -433,32 +376,29 @@ bool enabledUndo(KHTMLPart *part)
 // If this is so, then queryCommandState should return "yes" in the case where
 // all the text is bold and "no" for non-bold or partially-bold text.
 // Then, queryCommandIndeterm should return "no" in the case where
-// all the text is either all bold or not-bold and and "yes" for partially-bold
-// text.
-//
-// Note that, for now, the returned values are just place-holders.
+// all the text is either all bold or not-bold and and "yes" for partially-bold text.
 
-CommandState stateNo(KHTMLPart *part)
+KHTMLPart::TriState stateNone(KHTMLPart *part)
 {
-    return no;
+    return KHTMLPart::falseTriState;
 }
 
-CommandState stateBold(KHTMLPart *part)
+KHTMLPart::TriState stateBold(KHTMLPart *part)
 {
     return stateStyle(part, CSS_PROP_FONT_WEIGHT, "bold");
 }
 
-CommandState stateItalic(KHTMLPart *part)
+KHTMLPart::TriState stateItalic(KHTMLPart *part)
 {
     return stateStyle(part, CSS_PROP_FONT_STYLE, "italic");
 }
 
-CommandState stateSubscript(KHTMLPart *part)
+KHTMLPart::TriState stateSubscript(KHTMLPart *part)
 {
     return stateStyle(part, CSS_PROP_VERTICAL_ALIGN, "sub");
 }
 
-CommandState stateSuperscript(KHTMLPart *part)
+KHTMLPart::TriState stateSuperscript(KHTMLPart *part)
 {
     return stateStyle(part, CSS_PROP_VERTICAL_ALIGN, "super");
 }
@@ -467,9 +407,6 @@ CommandState stateSuperscript(KHTMLPart *part)
 //
 // queryCommandValue implementations
 //
-// EDIT FIXME: All these responses should be tested against the behavior
-// of Microsoft browsers to ensure we are as compatible with their
-// behavior as is sensible. For now, the returned values are just place-holders.
 
 DOMString valueNull(KHTMLPart *part)
 {
@@ -478,128 +415,113 @@ DOMString valueNull(KHTMLPart *part)
 
 DOMString valueBackColor(KHTMLPart *part)
 {
-    // FIXME: Implement.
-    return DOMString();
+    return valueStyle(part, CSS_PROP_BACKGROUND_COLOR);
 }
 
 DOMString valueFontName(KHTMLPart *part)
 {
-    // FIXME: Implement.
-    return DOMString();
+    return valueStyle(part, CSS_PROP_FONT_FAMILY);
 }
 
 DOMString valueFontSize(KHTMLPart *part)
 {
-    // FIXME: Implement.
-    return DOMString();
+    return valueStyle(part, CSS_PROP_FONT_SIZE);
 }
 
 DOMString valueForeColor(KHTMLPart *part)
 {
-    // FIXME: Implement.
-    return DOMString();
+    return valueStyle(part, CSS_PROP_COLOR);
 }
 
 // =============================================================================================
 
 QDict<CommandImp> createCommandDictionary()
 {
-    //
-    // All commands are listed with a "supported" or "not supported" label.
-    //
-    // The "supported" commands need to have all their functions implemented. These bugs
-    // correspond to this work.
-    // <rdar://problem/3675867>: "Make execCommand work as specified in the Javascript execCommand Compatibility Plan"
-    // <rdar://problem/3675898>: "Make queryCommandEnabled work as specified in the Javascript execCommand Compatibility Plan"
-    // <rdar://problem/3675899>: "Make queryCommandIndeterm work as specified in the Javascript execCommand Compatibility Plan"
-    // <rdar://problem/3675901>: "Make queryCommandState work as specified in the Javascript execCommand Compatibility Plan"
-    // <rdar://problem/3675903>: "Make queryCommandSupported work as specified in the Javascript execCommand Compatibility Plan"
-    // <rdar://problem/3675904>: "Make queryCommandValue work as specified in the Javascript execCommand Compatibility Plan"
-    //
-    // The "unsupported" commands are listed here since they appear in the Microsoft
-    // documentation used as the basis for the list.
-    //
-
     struct EditorCommand { const char *name; CommandImp imp; };
 
     static const EditorCommand commands[] = {
 
-        { "backColor", { execBackColor, enabled, stateNo, valueBackColor } },
+        { "backColor", { execBackColor, enabled, stateNone, valueBackColor } },
         { "bold", { execBold, enabledAnySelection, stateBold, valueNull } },
-        { "copy", { execCopy, enabledRangeSelection, stateNo, valueNull } },
-        { "cut", { execCut, enabledRangeSelection, stateNo, valueNull } },
-        { "delete", { execDelete, enabledAnySelection, stateNo, valueNull } },
-        { "fontName", { execFontName, enabledAnySelection, stateNo, valueFontName } },
-        { "fontSize", { execFontSize, enabledAnySelection, stateNo, valueFontSize } },
-        { "foreColor", { execForeColor, enabledAnySelection, stateNo, valueForeColor } },
-        { "indent", { execIndent, enabledAnySelection, stateNo, valueNull } },
-        { "insertParagraph", { execInsertParagraph, enabledAnySelection, stateNo, valueNull } },
-        { "insertText", { execInsertText, enabledAnySelection, stateNo, valueNull } },
+        { "copy", { execCopy, enabledRangeSelection, stateNone, valueNull } },
+        { "cut", { execCut, enabledRangeSelection, stateNone, valueNull } },
+        { "delete", { execDelete, enabledAnySelection, stateNone, valueNull } },
+        { "fontName", { execFontName, enabledAnySelection, stateNone, valueFontName } },
+        { "fontSize", { execFontSize, enabledAnySelection, stateNone, valueFontSize } },
+        { "foreColor", { execForeColor, enabledAnySelection, stateNone, valueForeColor } },
+        { "indent", { execIndent, enabledAnySelection, stateNone, valueNull } },
+        { "insertParagraph", { execInsertParagraph, enabledAnySelection, stateNone, valueNull } },
+        { "insertText", { execInsertText, enabledAnySelection, stateNone, valueNull } },
         { "italic", { execItalic, enabledAnySelection, stateItalic, valueNull } },
-        { "justifyCenter", { execJustifyCenter, enabledAnySelection, stateNo, valueNull } },
-        { "justifyFull", { execJustifyFull, enabledAnySelection, stateNo, valueNull } },
-        { "justifyLeft", { execJustifyLeft, enabledAnySelection, stateNo, valueNull } },
-        { "justifyNone", { execJustifyLeft, enabledAnySelection, stateNo, valueNull } },
-        { "justifyRight", { execJustifyRight, enabledAnySelection, stateNo, valueNull } },
-        { "outdent", { execOutdent, enabledAnySelection, stateNo, valueNull } },
+        { "justifyCenter", { execJustifyCenter, enabledAnySelection, stateNone, valueNull } },
+        { "justifyFull", { execJustifyFull, enabledAnySelection, stateNone, valueNull } },
+        { "justifyLeft", { execJustifyLeft, enabledAnySelection, stateNone, valueNull } },
+        { "justifyNone", { execJustifyLeft, enabledAnySelection, stateNone, valueNull } },
+        { "justifyRight", { execJustifyRight, enabledAnySelection, stateNone, valueNull } },
+        { "outdent", { execOutdent, enabledAnySelection, stateNone, valueNull } },
 #if SUPPORT_PASTE
-        { "paste", { execPaste, enabledPaste, stateNo, valueNull } },
+        { "paste", { execPaste, enabledPaste, stateNone, valueNull } },
 #endif
-        { "print", { execPrint, enabled, stateNo, valueNull } },
-        { "redo", { execRedo, enabledRedo, stateNo, valueNull } },
-        { "selectAll", { execSelectAll, enabled, stateNo, valueNull } },
+        { "print", { execPrint, enabled, stateNone, valueNull } },
+        { "redo", { execRedo, enabledRedo, stateNone, valueNull } },
+        { "selectAll", { execSelectAll, enabled, stateNone, valueNull } },
         { "subscript", { execSubscript, enabledAnySelection, stateSubscript, valueNull } },
         { "superscript", { execSuperscript, enabledAnySelection, stateSuperscript, valueNull } },
-        { "undo", { execUndo, enabledUndo, stateNo, valueNull } },
-        { "unselect", { execUnselect, enabledAnySelection, stateNo, valueNull } }
+        { "undo", { execUndo, enabledUndo, stateNone, valueNull } },
+        { "unselect", { execUnselect, enabledAnySelection, stateNone, valueNull } }
+
+        //
+        // The "unsupported" commands are listed here since they appear in the Microsoft
+        // documentation used as the basis for the list.
+        //
 
         // 2d-position (not supported)
-        // absoluteposition (not supported)
-        // blockdirltr (not supported)
-        // blockdirrtl (not supported)
-        // browsemode (not supported)
-        // clearauthenticationcache (not supported)
-        // createbookmark (not supported)
-        // createlink (not supported)
-        // dirltr (not supported)
-        // dirrtl (not supported)
-        // editmode (not supported)
-        // formatblock (not supported)
-        // inlinedirltr (not supported)
-        // inlinedirrtl (not supported)
-        // insertbutton (not supported)
-        // insertfieldset (not supported)
-        // inserthorizontalrule (not supported)
-        // insertiframe (not supported)
-        // insertimage (not supported)
-        // insertinputbutton (not supported)
-        // insertinputcheckbox (not supported)
-        // insertinputfileupload (not supported)
-        // insertinputhidden (not supported)
-        // insertinputimage (not supported)
-        // insertinputpassword (not supported)
-        // insertinputradio (not supported)
-        // insertinputreset (not supported)
-        // insertinputsubmit (not supported)
-        // insertinputtext (not supported)
-        // insertmarquee (not supported)
-        // insertorderedlist (not supported)
-        // insertselectdropdown (not supported)
-        // insertselectlistbox (not supported)
-        // inserttextarea (not supported)
-        // insertunorderedlist (not supported)
-        // liveresize (not supported)
-        // multipleselection (not supported)
+        // absolutePosition (not supported)
+        // blockDirLTR (not supported)
+        // blockDirRTL (not supported)
+        // browseMode (not supported)
+        // clearAuthenticationCache (not supported)
+        // createBookmark (not supported)
+        // createLink (not supported)
+        // dirLTR (not supported)
+        // dirRTL (not supported)
+        // editMode (not supported)
+        // formatBlock (not supported)
+        // inlineDirLTR (not supported)
+        // inlineDirRTL (not supported)
+        // insertButton (not supported)
+        // insertFieldSet (not supported)
+        // insertHorizontalRule (not supported)
+        // insertIFrame (not supported)
+        // insertImage (not supported)
+        // insertInputButton (not supported)
+        // insertInputCheckbox (not supported)
+        // insertInputFileUpload (not supported)
+        // insertInputHidden (not supported)
+        // insertInputImage (not supported)
+        // insertInputPassword (not supported)
+        // insertInputRadio (not supported)
+        // insertInputReset (not supported)
+        // insertInputSubmit (not supported)
+        // insertInputText (not supported)
+        // insertMarquee (not supported)
+        // insertOrderedList (not supported)
+        // insertSelectDropDown (not supported)
+        // insertSelectListBox (not supported)
+        // insertTextArea (not supported)
+        // insertUnorderedList (not supported)
+        // liveResize (not supported)
+        // multipleSelection (not supported)
         // open (not supported)
         // overwrite (not supported)
-        // playimage (not supported)
+        // playImage (not supported)
         // refresh (not supported)
-        // removeformat (not supported)
-        // removeparaformat (not supported)
-        // saveas (not supported)
-        // sizetocontrol (not supported)
-        // sizetocontrolheight (not supported)
-        // sizetocontrolwidth (not supported)
+        // removeFormat (not supported)
+        // removeParaFormat (not supported)
+        // saveAs (not supported)
+        // sizeToControl (not supported)
+        // sizeToControlHeight (not supported)
+        // sizeToControlWidth (not supported)
         // stop (not supported)
         // stopimage (not supported)
         // strikethrough (not supported)
index 630174c3f441053a7e52c0554ce51b009733c900..8ac2a265589b9c149acee1544d4ad1c3bdcd7229 100644 (file)
@@ -54,6 +54,7 @@
 #include "css/cssstyleselector.h"
 #include "css/csshelper.h"
 #include "misc/khtml_text_operations.h"
+#include "css/css_computedstyle.h"
 
 using namespace DOM;
 
@@ -101,6 +102,7 @@ using namespace DOM;
 #include <CoreServices/CoreServices.h>
 #endif
 
+using khtml::ApplyStyleCommand;
 using khtml::Decoder;
 using khtml::DeleteSelectionCommand;
 using khtml::EditCommand;
@@ -5224,6 +5226,219 @@ bool KHTMLPart::tabsToAllControls() const
     return true;
 }
 
+void KHTMLPart::copyToPasteboard()
+{
+#if APPLE_CHANGES
+    KWQ(this)->issueCopyCommand();
+#endif
+}
+
+void KHTMLPart::cutToPasteboard()
+{
+#if APPLE_CHANGES
+    KWQ(this)->issueCutCommand();
+#endif
+}
+
+void KHTMLPart::redo()
+{
+#if APPLE_CHANGES
+    KWQ(this)->issueRedoCommand();
+#endif
+}
+
+void KHTMLPart::undo()
+{
+#if APPLE_CHANGES
+    KWQ(this)->issueUndoCommand();
+#endif
+}
+
+#if !APPLE_CHANGES
+
+bool KHTMLPart::canRedo() const
+{
+    // FIXME: Implement.
+    return true;
+}
+
+bool KHTMLPart::canUndo() const
+{
+    // FIXME: Implement.
+    return true;
+}
+
+#endif
+
+void KHTMLPart::applyStyle(CSSStyleDeclarationImpl *style)
+{
+    switch (selection().state()) {
+        case Selection::NONE:
+            // do nothing
+            break;
+        case Selection::CARET:
+            // FIXME: This blows away all the other properties of the typing style.
+            setTypingStyle(style);
+            break;
+        case Selection::RANGE:
+            if (xmlDocImpl() && style) {
+                ApplyStyleCommand cmd(xmlDocImpl(), style);
+                cmd.apply();
+            }
+            break;
+    }
+}
+
+static void updateState(CSSStyleDeclarationImpl *desiredStyle, CSSStyleDeclarationImpl *computedStyle, bool &atStart, KHTMLPart::TriState &state)
+{
+    for (QPtrListIterator<CSSProperty> it(*desiredStyle->values()); it.current(); ++it) {
+        int propertyID = it.current()->id();
+        DOMString desiredProperty = desiredStyle->getPropertyValue(propertyID);
+        DOMString computedProperty = computedStyle->getPropertyValue(propertyID);
+        KHTMLPart::TriState propertyState = strcasecmp(desiredProperty, computedProperty) == 0
+            ? KHTMLPart::trueTriState : KHTMLPart::falseTriState;
+        if (atStart) {
+            state = propertyState;
+            atStart = false;
+        } else if (state != propertyState) {
+            state = KHTMLPart::mixedTriState;
+            break;
+        }
+    }
+}
+
+KHTMLPart::TriState KHTMLPart::selectionHasStyle(CSSStyleDeclarationImpl *style) const
+{
+    bool atStart = true;
+    TriState state = falseTriState;
+
+    if (d->m_selection.state() != Selection::RANGE) {
+        NodeImpl *nodeToRemove;
+        CSSStyleDeclarationImpl *selectionStyle = selectionComputedStyle(nodeToRemove);
+        if (!selectionStyle)
+            return falseTriState;
+        selectionStyle->ref();
+        updateState(style, selectionStyle, atStart, state);
+        selectionStyle->deref();
+        if (nodeToRemove) {
+            int exceptionCode = 0;
+            nodeToRemove->remove(exceptionCode);
+            assert(exceptionCode == 0);
+        }
+    } else {
+        for (NodeImpl *node = d->m_selection.start().node(); node; node = node->traverseNextNode()) {
+            if (node->isHTMLElement()) {
+                CSSStyleDeclarationImpl *computedStyle = new CSSComputedStyleDeclarationImpl(node);
+                computedStyle->ref();
+                updateState(style, computedStyle, atStart, state);
+                computedStyle->deref();
+                if (state == mixedTriState)
+                    break;
+            }
+            if (node == d->m_selection.end().node())
+                break;
+        }
+    }
+
+    return state;
+}
+
+bool KHTMLPart::selectionStartHasStyle(CSSStyleDeclarationImpl *style) const
+{
+    NodeImpl *nodeToRemove;
+    CSSStyleDeclarationImpl *selectionStyle = selectionComputedStyle(nodeToRemove);
+    if (!selectionStyle)
+        return false;
+
+    selectionStyle->ref();
+
+    bool match = true;
+    for (QPtrListIterator<CSSProperty> it(*style->values()); it.current(); ++it) {
+        int propertyID = it.current()->id();
+        DOMString desiredProperty = style->getPropertyValue(propertyID);
+        DOMString selectionProperty = selectionStyle->getPropertyValue(propertyID);
+        if (strcasecmp(selectionProperty, desiredProperty) != 0) {
+            match = false;
+            break;
+        }
+    }
+
+    selectionStyle->deref();
+
+    if (nodeToRemove) {
+        int exceptionCode = 0;
+        nodeToRemove->remove(exceptionCode);
+        assert(exceptionCode == 0);
+    }
+
+    return match;
+}
+
+DOMString KHTMLPart::selectionStartStylePropertyValue(int stylePropertyID) const
+{
+    NodeImpl *nodeToRemove;
+    CSSStyleDeclarationImpl *selectionStyle = selectionComputedStyle(nodeToRemove);
+    if (!selectionStyle)
+        return DOMString();
+
+    selectionStyle->ref();
+    DOMString value = selectionStyle->getPropertyValue(stylePropertyID);
+    selectionStyle->deref();
+
+    if (nodeToRemove) {
+        int exceptionCode = 0;
+        nodeToRemove->remove(exceptionCode);
+        assert(exceptionCode == 0);
+    }
+
+    return value;
+}
+
+CSSStyleDeclarationImpl *KHTMLPart::selectionComputedStyle(NodeImpl *&nodeToRemove) const
+{
+    nodeToRemove = 0;
+
+    if (!xmlDocImpl())
+        return 0;
+
+    if (d->m_selection.state() == Selection::NONE)
+        return 0;
+
+    Range range(d->m_selection.toRange());
+    Position pos(range.startContainer().handle(), range.startOffset());
+    assert(pos.notEmpty());
+    ElementImpl *elem = pos.element();
+    ElementImpl *styleElement = elem;
+    int exceptionCode = 0;
+
+    if (d->m_typingStyle) {
+        styleElement = xmlDocImpl()->createHTMLElement("SPAN", exceptionCode);
+        assert(exceptionCode == 0);
+        
+        styleElement->setAttribute(ATTR_STYLE, d->m_typingStyle->cssText().implementation(), exceptionCode);
+        assert(exceptionCode == 0);
+        
+        TextImpl *text = xmlDocImpl()->createEditingTextNode("");
+        styleElement->appendChild(text, exceptionCode);
+        assert(exceptionCode == 0);
+
+        elem->appendChild(styleElement, exceptionCode);
+        assert(exceptionCode == 0);
+
+        nodeToRemove = styleElement;
+    }
+
+    return new CSSComputedStyleDeclarationImpl(styleElement);
+}
+
+#if !APPLE_CHANGES
+
+void KHTMLPart::print()
+{
+    // needs implementation
+}
+
+#endif
+
 using namespace KParts;
 #include "khtml_part.moc"
-
index 470284ed97d458d8c63e7ad75fd1d01df967527c..c151b45b34ac7c761f3edfc156c54ad591f00e00 100644 (file)
@@ -7,7 +7,7 @@
  *                     2000-2001 Simon Hausmann <hausmann@kde.org>
  *                     2000-2001 Dirk Mueller <mueller@kde.org>
  *                     2000 Stefan Schimanski <1Stein@gmx.de>
- * Copyright (C) 2003 Apple Computer, Inc.
+ * Copyright (C) 2004 Apple Computer, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -846,6 +846,25 @@ public:
   void decrementFrameCount();
   int topLevelFrameCount();
 
+  // Editing operations.
+  // Not clear if these will be wanted in KHTMLPart by KDE,
+  // but for now these bridge so we don't have to pepper the
+  // KHTML code with WebCore-specific stuff.
+  enum TriState { falseTriState, trueTriState, mixedTriState };
+  void copyToPasteboard();
+  void cutToPasteboard();
+  void pasteFromPasteboard();
+  bool canPaste() const;
+  void redo();
+  void undo();
+  bool canRedo() const;
+  bool canUndo() const;
+  void applyStyle(DOM::CSSStyleDeclarationImpl *);
+  TriState selectionHasStyle(DOM::CSSStyleDeclarationImpl *) const;
+  bool selectionStartHasStyle(DOM::CSSStyleDeclarationImpl *) const;
+  DOM::DOMString selectionStartStylePropertyValue(int stylePropertyID) const;
+  void print();
+
 signals:
   /**
    * Emitted if the cursor is moved over an URL.
@@ -1260,6 +1279,8 @@ private:
   void handleMousePressEventTripleClick(khtml::MousePressEvent *event);
 #endif
 
+  DOM::CSSStyleDeclarationImpl *selectionComputedStyle(DOM::NodeImpl *&nodeToRemove) const;
+
   KHTMLPartPrivate *d;
   friend class KHTMLPartPrivate;
   friend class DOM::Selection;
index 2cf1305474beaf83bb359b077c3cad81d7139ea2..d9dc3016c826e2020e93621d3dca7cbd7f843b53 100644 (file)
@@ -277,7 +277,6 @@ public:
 
     void didTellBridgeAboutLoad(const QString &urlString);
     bool haveToldBridgeAboutLoad(const QString &urlString);
-    void print();
 
     KJS::Bindings::Instance *getAppletInstanceForView (NSView *aView);
     void addPluginRootObject(const KJS::Bindings::RootObject *root);
@@ -362,6 +361,7 @@ private:
     bool _usesInactiveTextBackgroundColor;
     bool _showsFirstResponder;
     mutable bool _drawSelectionOnly;
+    bool _haveUndoRedoOperations;
     
     QDict<char> urlsBridgeKnowsAbout;
 
index 3d2a2136ced771458cb82d15f4c73727369aa486..d1ce67867f063ba351a9b9bb629e0d51981d06ba 100644 (file)
@@ -3159,9 +3159,9 @@ void KWQKHTMLPart::clear()
     KHTMLPart::clear();
 }
 
-void KWQKHTMLPart::print()
+void KHTMLPart::print()
 {
-    [_bridge print];
+    [KWQ(this)->_bridge print];
 }
 
 KJS::Bindings::Instance *KWQKHTMLPart::getAppletInstanceForView (NSView *aView)
@@ -3194,22 +3194,25 @@ void KWQKHTMLPart::cleanupPluginRootObjects()
 void KWQKHTMLPart::registerCommandForUndo(const khtml::EditCommand &cmd)
 {
     ASSERT(cmd.handle());
-
     KWQEditCommand *kwq = [KWQEditCommand commandWithEditCommandImpl:cmd.handle()];
-    [_bridge registerCommandForUndo:kwq];
+    [[_bridge undoManager] registerUndoWithTarget:_bridge selector:@selector(undoEditing:) object:kwq];
+    _haveUndoRedoOperations = YES;
 }
 
 void KWQKHTMLPart::registerCommandForRedo(const khtml::EditCommand &cmd)
 {
     ASSERT(cmd.handle());
-
     KWQEditCommand *kwq = [KWQEditCommand commandWithEditCommandImpl:cmd.handle()];
-    [_bridge registerCommandForRedo:kwq];
+    [[_bridge undoManager] registerUndoWithTarget:_bridge selector:@selector(redoEditing:) object:kwq];
+    _haveUndoRedoOperations = YES;
 }
 
 void KWQKHTMLPart::clearUndoRedoOperations()
 {
-    [_bridge clearUndoRedoOperations];
+    if (_haveUndoRedoOperations) {
+       [[_bridge undoManager] removeAllActionsWithTarget:_bridge];
+       _haveUndoRedoOperations = NO;
+    }
 }
 
 bool KWQKHTMLPart::interceptEditingKeyEvent()
@@ -3219,12 +3222,14 @@ bool KWQKHTMLPart::interceptEditingKeyEvent()
 
 void KWQKHTMLPart::issueUndoCommand()
 {
-    [_bridge issueUndoCommand];
+    if (canUndo())
+        [[_bridge undoManager] undo];
 }
 
 void KWQKHTMLPart::issueRedoCommand()
 {
-    [_bridge issueRedoCommand];
+    if (canRedo())
+        [[_bridge undoManager] redo];
 }
 
 void KWQKHTMLPart::issueCutCommand()
@@ -3242,6 +3247,16 @@ void KWQKHTMLPart::issuePasteCommand()
     [_bridge issuePasteCommand];
 }
 
+bool KHTMLPart::canUndo() const
+{
+    return [[KWQ(this)->_bridge undoManager] canUndo];
+}
+
+bool KHTMLPart::canRedo() const
+{
+    return [[KWQ(this)->_bridge undoManager] canRedo];
+}
+
 void KWQKHTMLPart::respondToChangedSelection()
 {
     [_bridge respondToChangedSelection];
index 59bfd256a1c5402a3b79a65ee78cf5a83d4e6afb..6e7f619e137d934d6e355a5794b5854101ecf785 100644 (file)
@@ -460,11 +460,7 @@ typedef enum {
 
 - (jobject)pollForAppletInView:(NSView *)view;
 
-- (void)registerCommandForUndo:(id)arg;
-- (void)registerCommandForRedo:(id)arg;
-- (void)clearUndoRedoOperations;
-- (void)issueUndoCommand;
-- (void)issueRedoCommand;
+- (NSUndoManager *)undoManager;
 - (void)issueCutCommand;
 - (void)issueCopyCommand;
 - (void)issuePasteCommand;
index 4c62ddbe43f4681dc8513b54326ecba4ebc82b56..7842d0b57a0a54e54ffd062b36d4113ad4281651 100644 (file)
@@ -1511,23 +1511,9 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (void)applyStyle:(DOMCSSStyleDeclaration *)style
 {
-    if (!_part || !_part->xmlDocImpl() || !style)
+    if (!_part)
         return;
-    
-    Selection selection(_part->selection());
-    switch (selection.state()) {
-        case Selection::NONE:
-            // do nothing
-            break;
-        case Selection::CARET:
-            _part->setTypingStyle([style _styleDeclarationImpl]);
-            break;
-        case Selection::RANGE: {
-            ApplyStyleCommand cmd(_part->xmlDocImpl(), [style _styleDeclarationImpl]);
-            cmd.apply();
-            break;
-        }
-    }
+    _part->applyStyle([style _styleDeclarationImpl]);
 }
 
 - (NSFont *)fontForCurrentPosition
index d996b721bc7486fc184d595ae89b4e0040ced830..2dac2e46a33f5618cbb4584c925097b9a24aa46d 100644 (file)
@@ -1,3 +1,12 @@
+2004-06-10  Darin Adler  <darin@apple.com>
+
+        Reviewed by Ken.
+
+        * WebCoreSupport.subproj/WebBridge.m: Removed undo-related methods.
+        (-[WebBridge undoManager]): Added.
+
+        * WebKit.pbproj/.cvsignore: Updated for new Xcode files.
+
 2004-06-09  Ken Kocienda  <kocienda@apple.com>
 
         Reviewed by Darin
index 612f145e076488386476adaa2ae28a38d4aaab57..6d43beae6d7f8bc6e9940f9576697c85063efb33 100644 (file)
@@ -1228,27 +1228,9 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     [[NSNotificationCenter defaultCenter] postNotificationName:WebViewDidChangeSelectionNotification object:[_frame webView]];
 }
 
-- (void)registerCommandForUndo:(id)arg
+- (NSUndoManager *)undoManager
 {
-    NSUndoManager *undoManager = [[_frame webView] undoManager];
-    [undoManager registerUndoWithTarget:self selector:@selector(undoEditing:) object:arg];
-    _haveUndoRedoOperations = YES;
-}
-
-- (void)registerCommandForRedo:(id)arg
-{
-    NSUndoManager *undoManager = [[_frame webView] undoManager];
-    [undoManager registerUndoWithTarget:self selector:@selector(redoEditing:) object:arg];
-    _haveUndoRedoOperations = YES;
-}
-
-- (void)clearUndoRedoOperations
-{
-    if (_haveUndoRedoOperations) {
-       NSUndoManager *undoManager = [[_frame webView] undoManager];
-       [undoManager removeAllActionsWithTarget:self];
-       _haveUndoRedoOperations = NO;
-    }
+    return [[_frame webView] undoManager];
 }
 
 - (BOOL)interceptEditingKeyEvent:(NSEvent *)event
@@ -1256,20 +1238,6 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     return [[_frame webView] _interceptEditingKeyEvent:event];
 }
 
-- (void)issueUndoCommand
-{
-    NSUndoManager *undoManager = [[_frame webView] undoManager];
-    if ([undoManager canUndo])
-        [undoManager undo];
-}
-
-- (void)issueRedoCommand
-{
-    NSUndoManager *undoManager = [[_frame webView] undoManager];
-    if ([undoManager canRedo])
-        [undoManager redo];
-}
-
 - (void)issueCutCommand
 {
     [[_frame webView] cut:nil];
index 857c138c2beab992c233276ee7638f00cd911f5a..c5cb297b364192b02adf8018c0750b89661e9ccc 100644 (file)
@@ -1,2 +1,3 @@
+*.mode1
 *.pbxuser
-
+*.perspective