[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: MovingCursor + Ranges, Features
From:       Christoph Cullmann <cullmann () absint ! com>
Date:       2010-04-25 11:10:44
Message-ID: 201004251310.45145.cullmann () absint ! com
[Download RAW message or body]

On Sunday 25 April 2010 12:19:29 Michel Ludwig wrote:
> Hi all,
> 
> On Thu 22 Apr 2010 08:11:13 Christoph Cullmann wrote:
> > On Wednesday 21 April 2010 23:39:21 Michel Ludwig wrote:
> > > I think it would also be good to add some debugging output functions as
> > > it is done in the attached patch (copied from range.h/cursor.h).
> > > Moreover, some range comparisons like the following would be good to
> > > have as well (eliminating the need to convert moving ranges to simple
> > > ranges)
> > > 
> > > bool 	boundaryAtCursor (const Cursor &cursor) const
> > > bool 	boundaryOnColumn (int column) const
> > > bool 	boundaryOnLine (int line) const
> > > bool 	contains (const Cursor &cursor) const
> > > bool 	contains (const Range &range) const
> > > bool 	containsColumn (int column) const
> > > bool 	containsLine (int line) const
> > > bool 	overlaps (const Range &range) const
> > > bool 	overlapsColumn (int column) const
> > > bool 	overlapsLine (int line) const
> > > int 	positionRelativeToCursor (const Cursor &cursor) const
> > > int 	positionRelativeToLine (int line) const
> > 
> > I am all for it, all this can be implemented in KTE as non-virtuals,
> > Dominik came up with similar list, too, for comparison operators and so
> > on.
> 
> Attached is a patch which adds some of these. Now, one could also add a
> second set which operate on MovingRanges.
Have commited your patch, thanks ;) Will merge it to SVN this evening.

> 
> In the patch the equality operator on MovingCursor is implemented directly.
> However, it would also be possible to define it as purely virtual method,
> but that's up for discussion :-)
Inline is ok, users will anyway assume that cursors with equal line/column are 
equal ;)

-- 
-------------------------------------- Christoph Cullmann ---------
AbsInt Angewandte Informatik GmbH      Email: cullmann@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
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic