Fwd: MovingCursor + Ranges, Features

Christoph Cullmann cullmann at absint.de
Sat Apr 24 10:16:54 UTC 2010


Christoph Cullmann wrote:
> Niko Sams wrote:
>   
>> Hi,
>>
>> Could you (David?) take a look at this?
>> I think we should give some feedback....
>>   
>>     
> And all keep in mind: what is not in moving*.h in ktexteditor in KDE 4.5,
> will be away in KDE 4.6.
>
> smart*.h stuff won't be any longer implemented then in kate part.
>
> Therefore: what is missing for you there now (beside stuff like
> convenience non-virtual functions that for sure are still missing but
> can be added even after 4.5), should be said now.
>
> I still have enough spare time to implement missing stuff before 4.5,
> and if I won't be able to implement stuff crucial for you but feasible,
> I might relay the smart* purging to 4.7.
>
> (but please don't scream words like threadsafety, you are better off
> with your on BKL or some workqueue)
>   
Ping :P

More convenience stuff has come up thanks to Dominik, still I guess what
you miss is the ability to transpose one range from one revision of the
document to the current one?

If you need it, I could implement you the following:

virtual qint64 currentRevision() const = 0;
 = like at the moment, 0 after load/clear of document, ever increasing,
even over saves, but will not lock the revision automatically

virtual qint64 lastSavedRevision() const = 0;
 = revision after the last successful save of the document, will be -1
after load/clear of document, then will get value of revision at last
successful save of document, might be nice to know which revision is
last written on disc

void lockRevision(qint64 revision) = 0;
 = lock this revision, that it will not be expired, e.g. you can use it
later for translate

void releaseRevision(qint64 revision) = 0;
 = like at the moment, release a locked revision

KTextEditor::Cursor translateFromRevision (qint64 revision, const
KTextEditor::Cursor &cursor, InsertBehavior);
 = translate a cursor from the given revision to the current one, e.g.
for then using the cursor to create a movingcursor

KTextEditor::Range translateFromRevision (qint64 revision, const
KTextEditor::Cursor &range, InsertBehaviors, bool
invalidateOnContentChanged);
 = translate a range from the given revision to the current one, e.g.
for then using the range to create a movingrange,
     you will get invalid range back, if either that happens due to the
transformations or you tell it to invalidate the range if the range
content got changed, e.g. insert/remove/wrap/unwrap inside the range
boundaries, taking InsertBehaviors into account.

Would that be enough? There would be no way to get the text of old
revisions, just one is able to translate cursors and ranges.
Is any other API missing?

Btw., Milian :P You wanted to send me used API list :P

Greetings
Christoph

-- 
-------------------------------------- Christoph Cullmann ---------
AbsInt Angewandte Informatik GmbH      Email: cullmann at AbsInt.com
Science Park 1                         Tel:   +49-681-38360-22
66123 Saarbrücken                      Fax:   +49-681-38360-20
GERMANY                                WWW:   http://www.AbsInt.com
--------------------------------------------------------------------
Geschäftsführung: Dr.-Ing. Christian Ferdinand
Eingetragen im Handelsregister des Amtsgerichts Saarbrücken, HRB 11234





More information about the KDevelop-devel mailing list