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

List:       kde-kant
Subject:    About dyn. Word Wrap
From:       Christoph Cullmann <cullmann () babylon2k ! de>
Date:       2002-01-13 17:56:58
[Download RAW message or body]

Hi,
just got an idea how to do the dyn. word wrap efficient and hopefully without 
too much changes (no real changes to katedocument.*, mosty some stuff for 
painting the kateviewinternal + cursor position code). I just started to add 
some additional parameters to paintTextLine in katedocument (to let paint a 
line from startcol to endcol) and a textWidth functions which says you if you 
give it a startcol until which endcol the text will fit into a given width 
(it takes into account a given width of a wrapping symbol which we should 
display after each wrapped page).

The way I want to get it working (the important word is "want" ;):
- the updateView function off kateviewinternal should setup a list of which 
lines are in the current view and which are wrapped and at which col a 
wrapped line continous (a list of a struct containing: uint linenumer, bool 
isWrapped, uint startcol if isWrapped = yes) and the endline of the current 
view is the last line fitting in the view area calculated this way. This 
should be easy, as it is just call my textWidth function for each lines as 
long until you come to the end of a line + update the list after each 
docGeometry changed in kateviewinternal'S updateview(). The hard stuff seems 
to be to get the cursor position working right :( I hope I get some stuff 
working to just display the lines wrapped tomorrow (without right cursor 
managment + scrollbar man.), but can't promise to get the rest working soon.
Any help is very welcome ;) (hehe)
(To test the stuff (which is not working at the mom) you would just need to 
set the variable _hasWrap in kateview manually to true.)

If somebody gets an much better (and perhaps even faster) idea, just drop a 
mail and stop me ;)))

cu
Christoph

-- 
| Christoph Cullmann
| KDE developer
| cullmann@kde.org
| http://www.kde.org

_______________________________________________
kde-kant mailing list
kde-kant@
http://mail.kde.org/mailman/listinfo/kde-kant
[prev in list] [next in list] [prev in thread] [next in thread] 

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