Граф коммитов

432 Коммитов

Автор SHA1 Сообщение Дата
buster%netscape.com b969da295c fixed keydown event processing to return NS_OK when a key is not handled. 1999-06-14 23:25:48 +00:00
tague%netscape.com 7640929c5a Turned on bug fix for #6896: Windows editorinterprets the period key as a forward delete. 1999-06-13 21:13:12 +00:00
tague%netscape.com 95bea389db More work on bug #6896 1999-06-11 20:32:09 +00:00
akkana%netscape.com e7a3465092 Implement InsertHTML.
Also, some minor fixes, like warning removal and addition of error checking
in files which needed it.
1999-06-10 21:31:42 +00:00
akkana%netscape.com f9aaca405d Add alt-X and alt-shift-x for debug output html and text 1999-06-09 19:12:28 +00:00
tague%netscape.com 3f79fc52e2 Conditional fix for #7629. Only builds with a conditional set in my environment 1999-06-09 03:17:56 +00:00
akkana%netscape.com f217743dce 5380: middle-mouse paste to correct position in the editor 1999-06-08 21:51:40 +00:00
buster%netscape.com 594211b55c * Added nsAutoSelectionReset, a tiny class that resets the selection to what it was before a block transformation.
* Added some code to restore selection after RemoveTextProperty.
* Made a tiny change to the way the editor holds onto the transaction manager, so client (like the ender text control) can
turn undo on and off effectively
* Fixed a bug in IsNodeInline that was causing GetBlockParent to return the wrong parent node (and who knows what
other mischief) where atom compares were being done on strings of different case, for <B>, "b" vs. "B".  The DOM
method nsIDOMElement::GetTagName forced the returned tag name to upper case.  I don't know how long that has
been true, but I assume it's a fairly recent change (or something on our side related to it changed recently) or this method
never would have worked.  I also found a few cases of nsString::Equals that I changed to EqualsIgnoreCase
* Made some general improvements to the interaction between editors and rules, so that the aCancel out param is always
intialized, and all rules with Will... are matched with a Did... call.  Added Will/DidSetTextProperty() and
Will/DidRemoveTextProperty().  This helps enable plain text mode.  Added a skeleton for max length support in text editor.
* fixed some warnings.
1999-06-08 06:04:51 +00:00
pinkerton%netscape.com 26fdcb06d3 changes so that transferable no longer takes ownership of dataflavor string, but correctly copies it. fix some memory leaks as well. 1999-06-07 20:43:23 +00:00
tague%netscape.com 9fbcbaf99a Fix for #6896: Windows editor interprests the '.' key as a forward delete. Not building by default -- will switch over once tested on Mac and Unix. 1999-06-04 05:14:01 +00:00
jfrancis%netscape.com 9cd009d527 groundwork for block transformation functionality 1999-06-03 06:01:08 +00:00
buster%netscape.com 87b3a69509 Preparation for ender-based text control
* added focus listener.  Doesn't do much yet, but when focus notifications start appearing, we'll be ready for them.  The code is in
place to hide selection when we lose focus and paint selection when we get focus.  That's probably not quite right, but it's a start.
We will need to be able to determine the distinction between losing focus to another control within our app, and losing focus to
another app.
* added support for disabled and readonly states in the editor.  This is accomplished by having flags set by the client, and letting the
rules system deal with those flags.  The flags I added are:
     TEXT_EDITOR_FLAG_PLAINTEXT   0x01   // only plain text editing is allowed
     TEXT_EDITOR_FLAG_SINGLELINE  0x02   // enter key and CR-LF handled specially
     TEXT_EDITOR_FLAG_PASSWORD    0x04   // text is not entered into content, only a representative character
     TEXT_EDITOR_FLAG_READONLY    0x08   // editing events are disabled.  Editor may still accept focus.
     TEXT_EDITOR_FLAG_DISALBED    0x10   // all events are disabled (like scrolling).  Editor will not accept focus.
* added WillInsertBreak/DidInsertBreak into text rules, so flags could be checked.  This gets us readonly, disabled, and single line
behavior.
* cleaned up the code that allocates, registers, and destroys event listeners.  Thanks to Kin and Simon for cleaning up the
ownership model on the listeners, it was a big help.
* added support for a max text length.  You can now tell the text editor, be no bigger than n characters.
1999-05-28 21:24:18 +00:00
sfraser%netscape.com ac1db62e3f Fix the event listeners to no longer hold owning pointer to the editor. 1999-05-28 00:19:51 +00:00
rickg%netscape.com d647fbe409 changed to align with nsString2 1999-05-27 07:38:37 +00:00
sfraser%netscape.com d95af35b38 Remove the old key code function, and call the new unit test routine 1999-05-27 04:08:59 +00:00
akkana%netscape.com f4b48a2327 Insert / Paste as Quotation. 1999-05-27 00:08:15 +00:00
akkana%netscape.com 57f397d4de Add Internet and AOL style citers 1999-05-26 23:14:05 +00:00
pinkerton%netscape.com 5135f5d4a6 new multiple-item drag and drop apis. 1999-05-26 21:08:14 +00:00
joki%netscape.com 022a0e65af Breaking nsIDOMEvent out into nsIDOMEvent and nsIDOMUIEvent. 1999-05-18 23:51:04 +00:00
pinkerton%netscape.com 1ce155f6fa fix a d&d bug introduced in the transferable interface merging and add a SetCanDrop at the point of the drop for MacOS. 1999-05-14 18:44:28 +00:00
akkana%netscape.com 804d7dd182 Implementations for new fcn Get/SetBodyWrapWidth 1999-05-13 22:11:05 +00:00
rods%netscape.com b08406885d removed reference to nsIDataFlavor and merged nsITransferable and nsIGenericTransferable 1999-05-13 21:53:57 +00:00
rods%netscape.com 7c9e2a0004 Changed code to use the new DragSession interface 1999-05-07 19:42:27 +00:00
akkana%netscape.com e9829823f9 Middle-mouse paste; also, fix a bunch of warnings 1999-05-07 19:22:38 +00:00
akkana%netscape.com 4123eec5cf - Rename iDirection enum to ECollapsedSelectionAction
- Initial implementation of Insert HTML
1999-05-05 23:27:17 +00:00
buster%netscape.com 7803f612f1 1. block transformation infrastructure is now in place. We can go ahead and implement interesting
features like set paragraph style, set list type, indent, etc.  I'm sure there's holes in my
implementation that these high level features will make obvious.

2. I've factored a lot of utility methods from several modules into nsEditor as public static methods.
This makes them easily accessable to all, and will help Joe and I remove redundant methods.

3. I changed the HTML tags to lower case, and made all string compares case-insensitive.  No, this
isn't quite the right thing to do, but we don't have atoms from layout yet.  The Right Thing is for us
to reuse those atoms.
1999-05-05 04:05:19 +00:00
tague%netscape.com b23c932029 Fixed bug #5527 (Editor is not able to accumulate successive Japanese input) 1999-05-03 22:57:48 +00:00
buster%netscape.com 69dbf9b019 with permission from chofmann:
1. fix for bug 5796, crash on exit.  This was a bad, bad memory smudge on my part, easily fixed by doing the right ref counting in the
right places.

2. some preliminary code for M6 block transformations has leaked into this checkin.  It's safer than trying to re-code the fix above into
a fresh tree.  Unless you're making calls to do block transformations, you won't see any difference.
1999-04-30 22:40:18 +00:00
joki%netscape.com 91c2b2ba1f Adding scrolling fixes to fix bug #3999, A: chofmann 1999-04-30 19:38:39 +00:00
jfrancis%netscape.com cad36f972d more html typing rules implementation 1999-04-26 14:08:52 +00:00
rickg%netscape.com cc64c0dc7a sync with nsString2 1999-04-24 01:39:50 +00:00
rods%netscape.com 10cc323ee6 Switch Drag&Drop over to nsCOMPtr and fixed service release 1999-04-23 14:43:30 +00:00
buster%netscape.com d00b8638a3 vastly improved type-in state handling. smaller and faster 1999-04-22 14:46:53 +00:00
mcafee%netscape.com e38466806a Removing NEW_CLIPBOARD_SUPPORT ifdef. 1999-04-22 05:41:51 +00:00
buster%netscape.com 58c31945cb added the notion of contain vs. replace for block transformations. 1999-04-21 21:01:59 +00:00
buster%netscape.com d22eb4ef29 factoring of text property code for reuse.
extended APIs to handle fonts -- the trick here is to allow attributes and values
to effectively describe independent properties.
1999-04-20 17:49:34 +00:00
buster%netscape.com 58a3efa649 added tests for fonts and block transformations 1999-04-20 17:43:26 +00:00
rickg%netscape.com 0d1b06ca19 sync with nsString2 API 1999-04-20 07:20:21 +00:00
rods%netscape.com 9997e91d0d Switched over nsIGenericTransferable
and added D&D Support
1999-04-17 13:52:28 +00:00
buster%netscape.com ef58aa2474 factored out re-parenting of content into MoveContentIntoNewParent
WIP on font handling.
1999-04-16 18:29:12 +00:00
sfraser%netscape.com 0bab494a8a Adapt to fixed selection interface 1999-04-15 20:20:12 +00:00
buster%netscape.com 9dbd182db1 * beginnings of font handling. WIP, I did a big merge today and I'm checking in to synch up, not to announce new functionality here.
* added TextEditorTest.cpp, a unit test module for nsTextEditor.  It's use is actually commented out since my checkin is happening so late due
to all-day build bustage, and I don't have a Mac handy to verify.  With someone's Mac help tomorrow, I can turn it on.
* some minor bug fixes to property handling
1999-04-15 06:06:33 +00:00
jfrancis%netscape.com 849b6f7f33 merging in rules work with Simon's selection changes 1999-04-13 13:35:08 +00:00
sfraser%netscape.com e9f94ca763 Updated to conform to new IDL-ized selection interfaces. 1999-04-13 01:33:32 +00:00
jfrancis%netscape.com 36a0cbad9e checkpointing html typing rules 1999-04-12 12:01:32 +00:00
mcafee%netscape.com 8f9574792d Removing clipboard define comment. 1999-04-07 06:54:15 +00:00
rods%netscape.com edfd55e9b0 Commented out the NEW_CLIPBOARD_SUPPORT 1999-04-07 01:35:49 +00:00
rods%netscape.com 81b6a86d87 Turning on new Clipboard support 1999-04-06 23:01:55 +00:00
rods%netscape.com 5641718c90 Upgraded to implement new methods in D&D interface 1999-04-06 20:24:09 +00:00
buster%netscape.com e879c875d9 fixed bug 4517
WIP on remove text attributes
1999-04-05 20:52:29 +00:00
jfrancis%netscape.com 26aece12e6 redoing rules architecture 1999-04-05 17:21:59 +00:00
buster%netscape.com f51ac88437 Improved setting text property for next type-in (that is, setting text properties with a collapsed selection.) Bold, italic, and underline
all work.  Better error checking, and factored out some common code.
1999-04-04 20:10:39 +00:00
buster%netscape.com 2246607975 implemented simple cases of RemoveTextProperty. other cases are no-op'd now.
added aFirst out param to GetTextProperty, so the caller can know if the first character has the property in the case of aAny=true and aAll=false.
fixed a bunch of places where result was being used incorrectly as a return val from do_QueryInterface
some minor undo/redo fixes to split and join of interior nodes.
1999-04-04 18:01:35 +00:00
buster%netscape.com 4c59bda1d7 As a reminder, we decided to do this based strictly content. Some support for style-based text properties is written, but not used
anywhere any more.

* Cleaned up split and join undo/redo.
* Added TypeInState, a data struct that remembers things about text properties for collapsed selections, so you can type
* Ctrl-B with an insertion point and the next character will be bold.
* Added all the logic to handle inline vs. block elements when setting text properties.
* Added some support for italic and underline as well.  Adding these things is pretty easy now.  Ctrl-B, Ctrl-I, Ctrl-U for testing bold, italic, underline.
* Added all the logic to make sure we only add style tags where they're needed, so you should never get the same style tag nested within itself, except as needed for block elements.
* Added methods for testing a node to see if a particular style is set.  This isn't 100% done yet, but with very little work we could have toolbar buttons that respond to selection changed notification that show the state of bold, italic, underline, etc. in real time.  Supports tri-state:  whole selection is bold, some of selection is bold, none of selection is bold, ...
* Fully undoable and redoable.
* Added some debug printfs to transactions and editors.  all controlled by a gNoisy static in each module.  helps me track down undo/redo problems.  if the output bugs people enough, I'll shut it off and re-enable it in my local tree.

Noticably missing:  make un-bold, make un-italic, etc.  This is coming soon.
1999-04-01 17:58:07 +00:00
akkana%netscape.com c1f9238feb Editor: Add Insert Link and Image 1999-03-29 22:01:26 +00:00
jfrancis%netscape.com 807ebf0894 don't drop tab keys 1999-03-29 08:02:50 +00:00
jfrancis%netscape.com f538386093 seperating out html edit rules from text edit rules 1999-03-29 08:02:05 +00:00
joki%netscape.com 5abbeab8a7 Changing api uses in editor, rdf, and xpfe to match DOM2 api name/param changes. 1999-03-28 22:27:38 +00:00
akkana%netscape.com eec13f4b56 Add hard-coded alt-I for testing insert html 1999-03-22 22:10:29 +00:00
jfrancis%netscape.com 709b2b5918 bug 4057: fix is in layout; here I'm removing the old workaround code 1999-03-22 09:04:06 +00:00
tague%netscape.com 21fe067546 Added support for basic Japanese input on Win32 1999-03-19 23:36:20 +00:00
buster%netscape.com 5e09828b42 fixed join.
made a special case for typing with BR as the selection (as after an InsertBreak.)
made DEL and BACKSPACE at the beginning and end of a text node
fixes bugs 3742 and 3756 (with permission from choff and gkostello)
1999-03-16 16:38:09 +00:00
buster%netscape.com 6d531f533f added WillUndo, DidUndo, WillRedo, DidRedo and some supporting code so
the text edit rule object can maintain it's own state more efficiently and correctly.
1999-03-15 05:08:30 +00:00
buster%netscape.com 2b8c73f66e added PlaceholderTxn. This is an aggregate transaction that sits on the undo stack
and merges in subsequent transactions indiscriminately until it's told to stop.
It also gives the last transaction in its child list a chance to merge the
next transaction.
All this is in support of complex transactions that result in text insertion
being able to collapse into a single undoable event.
Also improved tracking of bogus content node used when document is empty.
1999-03-15 00:57:32 +00:00
rods%netscape.com acc73f7d27 Added DragListener for Drag & Drop (it's not turned on) 1999-03-14 04:45:00 +00:00
buster%netscape.com d4224521f3 added checks for DOM Key event returning 0x0 key code. If we get 0, we bail. 1999-03-14 04:12:21 +00:00
buster%netscape.com 06f218e889 InsertBreak now works at the beginning of a line. Plus a trivial bug fix. 1999-03-13 05:31:22 +00:00
buster%netscape.com 240da85e33 added delegate code for InsertText (WillInsertText, DidInsertText)
which calls generic WillInsert, DidInsert to test for magic bogus
content and does the right thing.
You now can't delete magic content with user gestures, and when you
insert anything the magic kludgy &nbsp; is deleted first.
1999-03-13 04:53:21 +00:00
sfraser%netscape.com 84473f96fa Throw the switch so we now pay attention to the charCode in the key event. 1999-03-12 05:28:22 +00:00
buster%netscape.com e7be453ae5 deleting the last editable object in a document now causes a bogus placeholder <P>&nbsp;</P> to be added to the document. This node has the
attribute MOZ_EDITOR_BOGUS_NODE set to TRUE.  this solves the problem of when you do a SelectAll then a DEL, you don't have a cursor
or any way to set selection in the document. You do still have the problem that the nbsp is pretty narrow and the frame containing it is hard to hit
with the mouse.  We really need the "set selection to frame nearest the mouse down point" operation.

the intent is for all inserts to look for this node, and if found delete it before the insert.  likewise, all deletes will be no-ops if this node is found.
1999-03-12 02:28:24 +00:00
sfraser%netscape.com 1f8973c082 Fix the key handling, and fix my macro for the charCode stuff 1999-03-11 19:34:28 +00:00
sfraser%netscape.com 97a6619823 Adapted key listener to get char code directly from event, rather than trying to do a key code conversion (#ifdeffed out until char code is there on all platforms). 1999-03-11 06:42:09 +00:00
akkana%netscape.com 2920383dee Implement editor cut/copy/paste 1999-03-10 22:46:15 +00:00
sfraser%netscape.com 40c939125e Add static to remove warning 1999-03-10 21:26:33 +00:00
buster%netscape.com cd54a83c26 first cut at rules delegate for text editor, will change drastically in the next week or two 1999-03-10 19:53:26 +00:00
buster%netscape.com f436abdcd6 SelectAll wired to Ctrl-A. 1999-03-10 19:49:43 +00:00
buster%netscape.com a1a725cf0e implemented GetTextProperty -- only works for bold and italic now,
trivial to add more properties
finished first cut at SetTextProperty.  This triggers lots of crashes in
range/selection code where we're holding onto a stale frame pointer (at
least, that's my best guess.)
synched with Charlie's change-o-rama
added an assert in DeleteTextTxn::Init() checking aNumCharsToDelete vs.
0
  NS_ASSERTION(0!=aNumCharsToDelete, "bad arg, numCharsToDelete");
if the number of chars to delete is 0, we shouldn't be creating a
transaction at all.  I had never seen this condition arise before
Charlie's checkin, I don't know if he introduced it or if it was a
latent bug I just never tripped over before.
1999-03-02 07:52:41 +00:00
buster%netscape.com 42654a1a8d added InsertElementTxn
added nsEditProperty
beginning of implementation for SetTextProperties.  Currently, it only works if the selection is entirely within a single text node.  Currently only
supports bold and italic (mapped to ctrl-b and ctrl-i for testing purposes.)
changed a bunch of interfaces to make things easier, like CreateElement now returns (as an out-param) the element created.
1999-02-24 17:24:37 +00:00
brade%netscape.com b34fa3c18c move local variable into comment block to reduce warnings on Macintosh compiler 1999-02-19 16:11:23 +00:00
mcafee%netscape.com 6fad4bf023 Solaris: adding do_QueryInterface() wrappers to finish scc's nsCOMPtr carpool. a=scc 1999-02-19 11:30:31 +00:00
danm%netscape.com aa7476884e fixing compilation problems with new nsCOMPtr. part of the carpool. 1999-02-17 06:18:11 +00:00
buster%netscape.com 6b1dd3a628 * the viewer test app now instantiates an nsITextEditor via nsRepository for "Editor mode"
* the TxnMgr is invoked by the editor via nsRepository
* editor.h|cpp have been renamed nsEditor.h|cpp for consistency
* editorInterfaces.h|cpp have been renamed nsEditorEventListeners.c|hpp
* added nsITextEditor.h, nsTextEditor.h|cpp.  The text editor is a placeholder for the rules unique to text
editing.  It invokes the nsIEditor to do core editing operations.
* reworked nsIEditor and related interfaces as per emerging design.
* nsEditor::BeginTransaction and EndTransaction call nsTransactionManager::BeginBatch and EndBatch.
1999-02-12 17:18:58 +00:00