diff options
author | Sébastien Wilmet <swilmet@gnome.org> | 2015-12-06 17:39:27 +0100 |
---|---|---|
committer | Sébastien Wilmet <swilmet@gnome.org> | 2015-12-08 19:55:53 +0100 |
commit | 1dcb3a0f887924793c86e9f5ee56fbd54a2a9b6e (patch) | |
tree | 22b11fe6f5a03510336902afe712701cca586f78 /gtk/gtktextiter.c | |
parent | 28ae8a3608776c225c1c751ee6ebee582fbd18a0 (diff) | |
download | gtk+-1dcb3a0f887924793c86e9f5ee56fbd54a2a9b6e.tar.gz |
textiter: add starts_tag() and deprecate begins_tag()
The name gtk_text_*_begins_* was used only for begins_tag(). All other
similar functions use "starts": starts_line(), starts_word(), etc.
So for consistency, add gtk_text_iter_starts_tag() and deprecate
gtk_text_iter_begins_tag().
Also change (allow-none) to (nullable), to use the new annotation.
https://bugzilla.gnome.org/show_bug.cgi?id=759092
Diffstat (limited to 'gtk/gtktextiter.c')
-rw-r--r-- | gtk/gtktextiter.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c index 2496ea85bc..c806237a58 100644 --- a/gtk/gtktextiter.c +++ b/gtk/gtktextiter.c @@ -1153,25 +1153,26 @@ gtk_text_iter_get_toggled_tags (const GtkTextIter *iter, } /** - * gtk_text_iter_begins_tag: + * gtk_text_iter_starts_tag: * @iter: an iterator - * @tag: (allow-none): a #GtkTextTag, or %NULL + * @tag: (nullable): a #GtkTextTag, or %NULL * * Returns %TRUE if @tag is toggled on at exactly this point. If @tag * is %NULL, returns %TRUE if any tag is toggled on at this point. * - * Note that if gtk_text_iter_begins_tag() returns %TRUE, it means that @iter is + * Note that if gtk_text_iter_starts_tag() returns %TRUE, it means that @iter is * at the beginning of the tagged range, and that the * character at @iter is inside the tagged range. In other - * words, unlike gtk_text_iter_ends_tag(), if gtk_text_iter_begins_tag() returns + * words, unlike gtk_text_iter_ends_tag(), if gtk_text_iter_starts_tag() returns * %TRUE, gtk_text_iter_has_tag() will also return %TRUE for the same * parameters. * * Returns: whether @iter is the start of a range tagged with @tag + * Since: 3.20 **/ gboolean -gtk_text_iter_begins_tag (const GtkTextIter *iter, - GtkTextTag *tag) +gtk_text_iter_starts_tag (const GtkTextIter *iter, + GtkTextTag *tag) { GtkTextRealIter *real; GtkTextLineSegment *seg; @@ -1202,6 +1203,31 @@ gtk_text_iter_begins_tag (const GtkTextIter *iter, } /** + * gtk_text_iter_begins_tag: + * @iter: an iterator + * @tag: (nullable): a #GtkTextTag, or %NULL + * + * Returns %TRUE if @tag is toggled on at exactly this point. If @tag + * is %NULL, returns %TRUE if any tag is toggled on at this point. + * + * Note that if gtk_text_iter_begins_tag() returns %TRUE, it means that @iter is + * at the beginning of the tagged range, and that the + * character at @iter is inside the tagged range. In other + * words, unlike gtk_text_iter_ends_tag(), if gtk_text_iter_begins_tag() returns + * %TRUE, gtk_text_iter_has_tag() will also return %TRUE for the same + * parameters. + * + * Returns: whether @iter is the start of a range tagged with @tag + * Deprecated: 3.20: Use gtk_text_iter_starts_tag() instead. + **/ +gboolean +gtk_text_iter_begins_tag (const GtkTextIter *iter, + GtkTextTag *tag) +{ + return gtk_text_iter_starts_tag (iter, tag); +} + +/** * gtk_text_iter_ends_tag: * @iter: an iterator * @tag: (allow-none): a #GtkTextTag, or %NULL |