Re: Default settings for GtkTextAttributes
- From: Brian Cameron <Brian Cameron sun com>
- To: Brian Cameron sun com, otaylor redhat com
- Cc: hp redhat com, Oisin Boydell sun com, gtk-devel-list gnome org
- Subject: Re: Default settings for GtkTextAttributes
- Date: Fri, 8 Jun 2001 13:23:06 +0100 (BST)
Owen:
Fair enough. Thanks for entertaining the discussion. We'll go ahead
and use the public gtk_text_iter_get_tags() function, rewrite the sort
function and go from there.
Thanks again!
Brian
> > I didn't get a response to this email that I sent yesterday and since
> > the gtk freeze is coming up soon I wanted to hopefully come to a concensus
> > on what to do.
> >
> > Another option that I didn't mention in my previous email would be to
> > make the following gtktextiter.c functions public
> >
> > _gtk_text_btree_get_tags
> > _gtk_text_tag_array_sort
> >
> > It seems that it would be dangerous for us to rewrite these in ATK. Then
> > if the code in GTK changes it is necessary for us to keep ATK in sync. It
> > seems like an area that would become error prone.
>
> There is an equivalent public function gtk_text_iter_get_tags(),
> and the sort function is completely trivial:
>
> int
> tag_sort_func (gconstpointer a, gconstpointer b)
> {
> const GtkTextTag *taga = a;
> const GtkTextTag *tagb = b;
>
> return taga->priority < tagb->priority ? -1 :
> (taga->priority == tagb->priority ? 0 : 1)
> }
>
> tags = g_slist_sort (tags, tag_sort_func);
>
> I don't see making a public version of this function, since it is
> is simply a convenience function - there is no content to it
> other than 'sort the list of tags numerically by tag->priority'.
>
> > I think my earlier suggestion of just calling gtk_text_iter_get_attributes
> > with a callback function is a more clean solution...
>
> This struck me as being not generally useful and a bit clunky.
> Also, gtk_text_iter_get_attributes() is speed critical code.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]