Re: RFC: AtkText simplification (take 3)
Joanmarie Diggs <[email protected]> Tue, 06 Aug 2013 13:21:55 +0200
| Newsgroups | gmane.comp.gnome.accessibility.devel |
|---|---|
| Message-ID | <[email protected]> |
On 08/06/2013 11:36 AM, Mario Sanchez Prada wrote:
> typedef enum {
> ATK_TEXT_GRANULARITY_CHAR,
> ATK_TEXT_GRANULARITY_WORD,
> ATK_TEXT_GRANULARITY_LINE,
> ATK_TEXT_GRANULARITY_SENTENCE
> } AtkTextGranularity;
As long as we're at it.... How about ATK_TEXT_GRANULARITY_PARAGRAPH?
In some cases paragraphs are distinct objects; in other cases they are not.
> gchar* atk_text_get_text_for_offset (AtkText *text,
> gint offset,
> AtkTextGranularity granularity,
> gint *start_offset,
> gint *end_offset);
In a similar spirit, currently start_offset and end_offset wind up being
0 and 0 respectively in two cases:
1. There is not text at that offset for the specified
granularity/boundary.
2. Error, lack of implementation, etc.
We have traditionally used -1 elsewhere as an indication of errors, etc.
Any objection to doing so for this method (i.e. via adding it to the
documentation)?
> 7. Update documentation :)
Why? :P :P
> We believe that this is the best approach in the way that it allows a
> clean transition and a less confusing API.
Cool. Thanks for coming up with this and writing it up!
--joanie