Re: Default settings for GtkTextAttributes



Havoc Pennington writes:

>Brian Cameron <Brian Cameron Sun COM> writes:
>> Therefore it seems like we could save ourselves a *lot* of work by
>> not re-inventing the wheel. For our own purposes we need to know, for
>> most attributes, whether they were explicitly set (via tags) or simply
>> "inherited" from the default.
>
>This is to read text properties to blind users, etc., right?

Not exclusively, but that is a major use case.

>I would guess that what you actually want is simply:

[compare each attribute to the defaults... report diffs]

>I don't see why you'd want to report differences that aren't visible
>to sighted users. (i.e. if a sighted user can't tell that the text
>properties are changed from the default, why would a blind user want
>to know either? this is just some program implementation detail.)

Actually I don't entirely agree.  There is semantic information in knowing 
that a text attribute was "specified" as opposed to assigned from the default. 
 I agree that this information is not exposed to the sighted user, but I don't 
think we need to take the view that the accessibility API should only expose 
information that has an existing visual cue.

It is however a reasonable defense against providing such information, if 
someone asks why it's not provided ;-)

>>    We will also need a public accessor for
>>    view->layout->default_style
>
>We've agreed that we need gtk_text_view_get_default_attributes().

I agree with Havoc that get_text_attributes_new() needn't return a "default" 
set, probably the better way to get one would be to call 
gtk_text_attributes_copy(gtk_text_view_get_default_attributes(view))

I still would prefer adding enumerations as Brian mentioned, this would allow 
us to initialize a gtk_text_attributes structure to explicitly UNSPECIFIED 
values (if that's not a non-sequitur), and so could easily implement the 
behavior we initially requested.  If we add the enumerations to the end of the 
existing enums, it won't even break binary compatibility :-)

Of course we would be happy to provide this patch, including the public 
accessor for gtk_text_view_get_default_attributes().

Regards,

-Bill

>Havoc

------
Bill Haneman x19279
Gnome Accessibility / Batik SVG Toolkit
Sun Microsystems Ireland 





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