Re: Possible Pango 1.4 ideas



On Fri, Jan 24, 2003 at 07:36:57PM +0000, Damon Chaplin wrote: 
> I haven't thought about the data structure too much yet. I was thinking
> of cannibalizing GtkTextView (as that already does all the PangoLayout
> stuff) and using GtkTextBuffer initially, and then using something else
> if that isn't scalable. But I'll have a look at your code. I'd be
> interested in how it compares to GtkTextBuffer in terms of features,
> speed & scalability.

The main thing that's unscalable in GtkTextBuffer is paragraph length,
lots of things are O(n) in the length of the paragraph. But then, so
is PangoLayout.

Otherwise it's optimized for making most operations O(log n) or
better, more than anything else (memory or raw speed). That is, the
idea is that all the GtkTextBuffer/GtkTextIter API is "safe" to use
without accidentally creating an O(n) or O(n^2) situation.  This
avoids the need for crack like the old gtk_text_freeze() API and keeps
app developers from hosing themselves.

For a DTP app you may well want another data structure that supports
things like undo, since you can just say "well we won't do the dumb
O(n) stuff" perhaps. I don't really know how piece tables work, and we
didn't really consider them for GtkTextView since the strategy was
to port TkText.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]