Hi. Recently had a look at cursors API and implementation in Textblock and was amazed by it baroqueness: there are prepend/append functions, lots of uncertainity of whether to include interval ends into the range or not etc.
Just for the reference for e-devel@: cursors in Textblock point _to_ characters in string, so you have to have e.g. function cursor_text_append to insert text after the character being pointed to, and cursor_text_prepend to insert text before the character being pointed to. I propose to change this part of API to make it easier to reason about stuff and simplify implementation, as follows: Cursors become zero-width entities that point _between_ characters in string. So cursor(offset=4) in text "abcdefgh" points between characters "d" and "e". This will allow to simplify text management (cursor_text_append()/cursor_text_prepend() becomes cursor_text_insert()), delete ambiguity (deletion of interval cursor(offset=2)..cursor(offset=4) will unambigously delete "cd" substring in previous example) and somehow simplify implementation of Textblock. Affected users of Textblock are edje_entry and ewl_text and at first glance it is not hard to adjust them. -- http://fossarchy.blogspot.com/
pgpH4LnHsif4P.pgp
Description: PGP signature
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev
_______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel