Re: gtktextbtree.h public?



Mark <jamess1 wwnet com> writes:
> Owen Taylor wrote:
> > 
> > Mark <jamess1 wwnet com> writes:
> > 
> > > Hello,
> > >   I would like to make a new text view seperate from gtk+. Should
> > > gtktextbtree.h be public? It seems pretty important for making new views
> > > of the text buffer.
> > 
> > gtktextview.[ch] does not include gtktextbree.h - in theory, anything
> > you need to write a view should be wrapped either in GtkTextLayout
> > or GtkTextBuffer, (GtkTextBuffer is public, GtkTextLayout,
> > "semi-public" - we install it, we will guarantee binary compatability
> > during stable releases, but probably won't be as careful about
> > breaking source compatibility between releases.)
> 
> So the GtkTextView class is intended as the base class for all text
> views? I started from the existing text view, but if it is possible to
> derive I would much prefer that.

No, shared functionality for views is in gtktextlayout.[hc] and
gtktextdisplay.[hc], which are as Owen says semi-public,
i.e. installed but nasty unsupported APIs we might change a lot in the
future.

I wouldn't expect a new view to use GtkTextView as a base class,
unless your new view is just adding some features to the basic widget,
such as syntax highlighting. If your new view is fundamentally
different (zooming, or a canvas item, or whatever) it will share only
layout.h and display.h with the GtkTextView implementation.

Unfortunately if your new view is a widget you'll have to duplicate
some code such as the keybindings. I don't know a good solution to
that problem, really.
 
> I'm not sure if you remember, but I discussed a zooming text view with
> you on irc. Looking at the pango and gtk+ modules, I'm not entirely sure
> that this type of view is possible. In pango, I think I would need a
> transform function (similar to the freetype one would be nice) to apply
> to the font when rendering the layout. If pango had this it would be a
> big help, otherwise I think I could use freetype, but nice
> internationalization features would be lost.
> 
> I'm going to keep digging though the source, I will keep you informed if
> I encounter any obstacles.
> 

Let us know.

Havoc




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