[gtksourceview] region: rename Iterator -> Iter
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] region: rename Iterator -> Iter
- Date: Fri, 1 Apr 2016 18:08:09 +0000 (UTC)
commit 98afc7550ca211a83fb20cfb68db91eb44677f0b
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Apr 1 19:32:28 2016 +0200
region: rename Iterator -> Iter
To be consistent with the GtkTextIter name.
.../words/gtksourcecompletionwordsbuffer.c | 64 ++++++++++----------
gtksourceview/gtksourcecontextengine.c | 10 ++--
gtksourceview/gtksourceregion.c | 38 ++++++------
gtksourceview/gtksourceregion.h | 24 ++++----
gtksourceview/gtksourcesearchcontext.c | 52 ++++++++--------
testsuite/test-region.c | 16 +++---
6 files changed, 102 insertions(+), 102 deletions(-)
---
diff --git a/gtksourceview/completion-providers/words/gtksourcecompletionwordsbuffer.c
b/gtksourceview/completion-providers/words/gtksourcecompletionwordsbuffer.c
index c6e4f94..363777b 100644
--- a/gtksourceview/completion-providers/words/gtksourcecompletionwordsbuffer.c
+++ b/gtksourceview/completion-providers/words/gtksourcecompletionwordsbuffer.c
@@ -311,25 +311,25 @@ scan_region (GtkSourceCompletionWordsBuffer *buffer,
static gboolean
is_text_region_empty (GtkSourceRegion *region)
{
- GtkSourceRegionIterator region_iter;
+ GtkSourceRegionIter region_iter;
- gtk_source_region_get_iterator (region, ®ion_iter, 0);
+ gtk_source_region_get_region_iter (region, ®ion_iter, 0);
- while (!gtk_source_region_iterator_is_end (®ion_iter))
+ while (!gtk_source_region_iter_is_end (®ion_iter))
{
GtkTextIter region_start;
GtkTextIter region_end;
- gtk_source_region_iterator_get_subregion (®ion_iter,
- ®ion_start,
- ®ion_end);
+ gtk_source_region_iter_get_subregion (®ion_iter,
+ ®ion_start,
+ ®ion_end);
if (!gtk_text_iter_equal (®ion_start, ®ion_end))
{
return FALSE;
}
- gtk_source_region_iterator_next (®ion_iter);
+ gtk_source_region_iter_next (®ion_iter);
}
return TRUE;
@@ -339,26 +339,26 @@ static gboolean
idle_scan_regions (GtkSourceCompletionWordsBuffer *buffer)
{
guint nb_remaining_lines = buffer->priv->scan_batch_size;
- GtkSourceRegionIterator region_iter;
+ GtkSourceRegionIter region_iter;
GtkTextIter start;
GtkTextIter stop;
gtk_text_buffer_get_start_iter (buffer->priv->buffer, &start);
stop = start;
- gtk_source_region_get_iterator (buffer->priv->scan_region,
- ®ion_iter,
- 0);
+ gtk_source_region_get_region_iter (buffer->priv->scan_region,
+ ®ion_iter,
+ 0);
while (nb_remaining_lines > 0 &&
- !gtk_source_region_iterator_is_end (®ion_iter))
+ !gtk_source_region_iter_is_end (®ion_iter))
{
GtkTextIter region_start;
GtkTextIter region_end;
- gtk_source_region_iterator_get_subregion (®ion_iter,
- ®ion_start,
- ®ion_end);
+ gtk_source_region_iter_get_subregion (®ion_iter,
+ ®ion_start,
+ ®ion_end);
nb_remaining_lines -= scan_region (buffer,
®ion_start,
@@ -366,7 +366,7 @@ idle_scan_regions (GtkSourceCompletionWordsBuffer *buffer)
nb_remaining_lines,
&stop);
- gtk_source_region_iterator_next (®ion_iter);
+ gtk_source_region_iter_next (®ion_iter);
}
gtk_source_region_subtract (buffer->priv->scan_region,
@@ -440,24 +440,24 @@ static void
remove_words_in_region (GtkSourceCompletionWordsBuffer *buffer,
GtkSourceRegion *region)
{
- GtkSourceRegionIterator region_iter;
+ GtkSourceRegionIter region_iter;
- gtk_source_region_get_iterator (region, ®ion_iter, 0);
+ gtk_source_region_get_region_iter (region, ®ion_iter, 0);
- while (!gtk_source_region_iterator_is_end (®ion_iter))
+ while (!gtk_source_region_iter_is_end (®ion_iter))
{
GtkTextIter subregion_start;
GtkTextIter subregion_end;
- gtk_source_region_iterator_get_subregion (®ion_iter,
- &subregion_start,
- &subregion_end);
+ gtk_source_region_iter_get_subregion (®ion_iter,
+ &subregion_start,
+ &subregion_end);
remove_words_in_subregion (buffer,
&subregion_start,
&subregion_end);
- gtk_source_region_iterator_next (®ion_iter);
+ gtk_source_region_iter_next (®ion_iter);
}
}
@@ -467,28 +467,28 @@ compute_remove_region (GtkSourceCompletionWordsBuffer *buffer,
const GtkTextIter *end)
{
GtkSourceRegion *remove_region = gtk_source_region_new (buffer->priv->buffer);
- GtkSourceRegionIterator region_iter;
+ GtkSourceRegionIter region_iter;
gtk_source_region_add (remove_region, start, end);
- gtk_source_region_get_iterator (buffer->priv->scan_region,
- ®ion_iter,
- 0);
+ gtk_source_region_get_region_iter (buffer->priv->scan_region,
+ ®ion_iter,
+ 0);
- while (!gtk_source_region_iterator_is_end (®ion_iter))
+ while (!gtk_source_region_iter_is_end (®ion_iter))
{
GtkTextIter scan_start;
GtkTextIter scan_end;
- gtk_source_region_iterator_get_subregion (®ion_iter,
- &scan_start,
- &scan_end);
+ gtk_source_region_iter_get_subregion (®ion_iter,
+ &scan_start,
+ &scan_end);
gtk_source_region_subtract (remove_region,
&scan_start,
&scan_end);
- gtk_source_region_iterator_next (®ion_iter);
+ gtk_source_region_iter_next (®ion_iter);
}
return remove_region;
diff --git a/gtksourceview/gtksourcecontextengine.c b/gtksourceview/gtksourcecontextengine.c
index a5fecb1..09da0eb 100644
--- a/gtksourceview/gtksourcecontextengine.c
+++ b/gtksourceview/gtksourcecontextengine.c
@@ -946,7 +946,7 @@ ensure_highlighted (GtkSourceContextEngine *ce,
const GtkTextIter *end)
{
GtkSourceRegion *region;
- GtkSourceRegionIterator reg_iter;
+ GtkSourceRegionIter reg_iter;
/* Get the subregions not yet highlighted. */
region = gtk_source_region_intersect (ce->priv->refresh_region, start, end);
@@ -954,16 +954,16 @@ ensure_highlighted (GtkSourceContextEngine *ce,
if (region == NULL)
return;
- gtk_source_region_get_iterator (region, ®_iter, 0);
+ gtk_source_region_get_region_iter (region, ®_iter, 0);
/* Highlight all subregions from the intersection.
* hopefully this will only be one subregion. */
- while (!gtk_source_region_iterator_is_end (®_iter))
+ while (!gtk_source_region_iter_is_end (®_iter))
{
GtkTextIter s, e;
- gtk_source_region_iterator_get_subregion (®_iter, &s, &e);
+ gtk_source_region_iter_get_subregion (®_iter, &s, &e);
highlight_region (ce, &s, &e);
- gtk_source_region_iterator_next (®_iter);
+ gtk_source_region_iter_next (®_iter);
}
gtk_source_region_destroy (region);
diff --git a/gtksourceview/gtksourceregion.c b/gtksourceview/gtksourceregion.c
index a558da4..a9d3059 100644
--- a/gtksourceview/gtksourceregion.c
+++ b/gtksourceview/gtksourceregion.c
@@ -46,9 +46,9 @@ struct _GtkSourceRegion
guint32 time_stamp;
};
-typedef struct _GtkSourceRegionIteratorReal GtkSourceRegionIteratorReal;
+typedef struct _GtkSourceRegionIterReal GtkSourceRegionIterReal;
-struct _GtkSourceRegionIteratorReal
+struct _GtkSourceRegionIterReal
{
GtkSourceRegion *region;
guint32 region_time_stamp;
@@ -690,7 +690,7 @@ gtk_source_region_intersect (GtkSourceRegion *region,
}
static gboolean
-check_iterator (GtkSourceRegionIteratorReal *real)
+check_iterator (GtkSourceRegionIterReal *real)
{
if ((real->region == NULL) ||
(real->region_time_stamp != real->region->time_stamp))
@@ -707,16 +707,16 @@ check_iterator (GtkSourceRegionIteratorReal *real)
}
void
-gtk_source_region_get_iterator (GtkSourceRegion *region,
- GtkSourceRegionIterator *iter,
- guint start)
+gtk_source_region_get_region_iter (GtkSourceRegion *region,
+ GtkSourceRegionIter *iter,
+ guint start)
{
- GtkSourceRegionIteratorReal *real;
+ GtkSourceRegionIterReal *real;
g_return_if_fail (region != NULL);
g_return_if_fail (iter != NULL);
- real = (GtkSourceRegionIteratorReal *)iter;
+ real = (GtkSourceRegionIterReal *)iter;
/* region->subregions may be NULL, -> end iter */
@@ -726,26 +726,26 @@ gtk_source_region_get_iterator (GtkSourceRegion *region,
}
gboolean
-gtk_source_region_iterator_is_end (GtkSourceRegionIterator *iter)
+gtk_source_region_iter_is_end (GtkSourceRegionIter *iter)
{
- GtkSourceRegionIteratorReal *real;
+ GtkSourceRegionIterReal *real;
g_return_val_if_fail (iter != NULL, FALSE);
- real = (GtkSourceRegionIteratorReal *)iter;
+ real = (GtkSourceRegionIterReal *)iter;
g_return_val_if_fail (check_iterator (real), FALSE);
return real->subregions == NULL;
}
gboolean
-gtk_source_region_iterator_next (GtkSourceRegionIterator *iter)
+gtk_source_region_iter_next (GtkSourceRegionIter *iter)
{
- GtkSourceRegionIteratorReal *real;
+ GtkSourceRegionIterReal *real;
g_return_val_if_fail (iter != NULL, FALSE);
- real = (GtkSourceRegionIteratorReal *)iter;
+ real = (GtkSourceRegionIterReal *)iter;
g_return_val_if_fail (check_iterator (real), FALSE);
if (real->subregions != NULL)
@@ -758,16 +758,16 @@ gtk_source_region_iterator_next (GtkSourceRegionIterator *iter)
}
gboolean
-gtk_source_region_iterator_get_subregion (GtkSourceRegionIterator *iter,
- GtkTextIter *start,
- GtkTextIter *end)
+gtk_source_region_iter_get_subregion (GtkSourceRegionIter *iter,
+ GtkTextIter *start,
+ GtkTextIter *end)
{
- GtkSourceRegionIteratorReal *real;
+ GtkSourceRegionIterReal *real;
Subregion *sr;
g_return_val_if_fail (iter != NULL, FALSE);
- real = (GtkSourceRegionIteratorReal *)iter;
+ real = (GtkSourceRegionIterReal *)iter;
g_return_val_if_fail (check_iterator (real), FALSE);
g_return_val_if_fail (real->subregions != NULL, FALSE);
diff --git a/gtksourceview/gtksourceregion.h b/gtksourceview/gtksourceregion.h
index 3af4572..8bd4459 100644
--- a/gtksourceview/gtksourceregion.h
+++ b/gtksourceview/gtksourceregion.h
@@ -29,12 +29,12 @@
G_BEGIN_DECLS
typedef struct _GtkSourceRegion GtkSourceRegion;
-typedef struct _GtkSourceRegionIterator GtkSourceRegionIterator;
+typedef struct _GtkSourceRegionIter GtkSourceRegionIter;
-struct _GtkSourceRegionIterator
+struct _GtkSourceRegionIter
{
- /* GtkSourceRegionIterator is an opaque datatype; ignore all these fields.
- * Initialize the iter with gtk_source_region_get_iterator
+ /* GtkSourceRegionIter is an opaque datatype; ignore all these fields.
+ * Initialize the iter with gtk_source_region_get_region_iter
* function
*/
/*< private >*/
@@ -77,21 +77,21 @@ GtkSourceRegion * gtk_source_region_intersect (GtkSourceRegion *region,
const GtkTextIter *_end);
GTK_SOURCE_INTERNAL
-void gtk_source_region_get_iterator (GtkSourceRegion *region,
- GtkSourceRegionIterator *iter,
- guint start);
+void gtk_source_region_get_region_iter (GtkSourceRegion *region,
+ GtkSourceRegionIter *iter,
+ guint start);
GTK_SOURCE_INTERNAL
-gboolean gtk_source_region_iterator_is_end (GtkSourceRegionIterator *iter);
+gboolean gtk_source_region_iter_is_end (GtkSourceRegionIter *iter);
/* Returns FALSE if iterator is the end iterator */
GTK_SOURCE_INTERNAL
-gboolean gtk_source_region_iterator_next (GtkSourceRegionIterator *iter);
+gboolean gtk_source_region_iter_next (GtkSourceRegionIter *iter);
GTK_SOURCE_INTERNAL
-gboolean gtk_source_region_iterator_get_subregion (GtkSourceRegionIterator *iter,
- GtkTextIter *start,
- GtkTextIter *end);
+gboolean gtk_source_region_iter_get_subregion (GtkSourceRegionIter *iter,
+ GtkTextIter *start,
+ GtkTextIter *end);
GTK_SOURCE_INTERNAL
void gtk_source_region_debug_print (GtkSourceRegion *region);
diff --git a/gtksourceview/gtksourcesearchcontext.c b/gtksourceview/gtksourcesearchcontext.c
index ea49ee0..080346b 100644
--- a/gtksourceview/gtksourcesearchcontext.c
+++ b/gtksourceview/gtksourcesearchcontext.c
@@ -426,23 +426,23 @@ text_tag_set_highest_priority (GtkTextTag *tag,
static gboolean
is_text_region_empty (GtkSourceRegion *region)
{
- GtkSourceRegionIterator region_iter;
+ GtkSourceRegionIter region_iter;
if (region == NULL)
{
return TRUE;
}
- gtk_source_region_get_iterator (region, ®ion_iter, 0);
+ gtk_source_region_get_region_iter (region, ®ion_iter, 0);
- while (!gtk_source_region_iterator_is_end (®ion_iter))
+ while (!gtk_source_region_iter_is_end (®ion_iter))
{
GtkTextIter region_start;
GtkTextIter region_end;
- if (!gtk_source_region_iterator_get_subregion (®ion_iter,
- ®ion_start,
- ®ion_end))
+ if (!gtk_source_region_iter_get_subregion (®ion_iter,
+ ®ion_start,
+ ®ion_end))
{
return TRUE;
}
@@ -452,7 +452,7 @@ is_text_region_empty (GtkSourceRegion *region)
return FALSE;
}
- gtk_source_region_iterator_next (®ion_iter);
+ gtk_source_region_iter_next (®ion_iter);
}
return TRUE;
@@ -466,18 +466,18 @@ get_first_subregion (GtkSourceRegion *region,
GtkTextIter *start,
GtkTextIter *end)
{
- GtkSourceRegionIterator region_iter;
+ GtkSourceRegionIter region_iter;
if (region == NULL)
{
return FALSE;
}
- gtk_source_region_get_iterator (region, ®ion_iter, 0);
+ gtk_source_region_get_region_iter (region, ®ion_iter, 0);
- while (!gtk_source_region_iterator_is_end (®ion_iter))
+ while (!gtk_source_region_iter_is_end (®ion_iter))
{
- if (!gtk_source_region_iterator_get_subregion (®ion_iter, start, end))
+ if (!gtk_source_region_iter_get_subregion (®ion_iter, start, end))
{
return FALSE;
}
@@ -487,7 +487,7 @@ get_first_subregion (GtkSourceRegion *region,
return TRUE;
}
- gtk_source_region_iterator_next (®ion_iter);
+ gtk_source_region_iter_next (®ion_iter);
}
return FALSE;
@@ -501,7 +501,7 @@ get_last_subregion (GtkSourceRegion *region,
GtkTextIter *start,
GtkTextIter *end)
{
- GtkSourceRegionIterator region_iter;
+ GtkSourceRegionIter region_iter;
gboolean found = FALSE;
if (region == NULL)
@@ -509,16 +509,16 @@ get_last_subregion (GtkSourceRegion *region,
return FALSE;
}
- gtk_source_region_get_iterator (region, ®ion_iter, 0);
+ gtk_source_region_get_region_iter (region, ®ion_iter, 0);
- while (!gtk_source_region_iterator_is_end (®ion_iter))
+ while (!gtk_source_region_iter_is_end (®ion_iter))
{
GtkTextIter start_subregion;
GtkTextIter end_subregion;
- if (!gtk_source_region_iterator_get_subregion (®ion_iter,
- &start_subregion,
- &end_subregion))
+ if (!gtk_source_region_iter_get_subregion (®ion_iter,
+ &start_subregion,
+ &end_subregion))
{
return FALSE;
}
@@ -530,7 +530,7 @@ get_last_subregion (GtkSourceRegion *region,
*end = end_subregion;
}
- gtk_source_region_iterator_next (®ion_iter);
+ gtk_source_region_iter_next (®ion_iter);
}
return found;
@@ -1824,7 +1824,7 @@ regex_search_handle_high_priority_region (GtkSourceSearchContext *search)
GtkTextIter start;
GtkTextIter end;
GtkSourceRegion *region;
- GtkSourceRegionIterator region_iter;
+ GtkSourceRegionIter region_iter;
gint nb_subregions = gtk_source_region_subregions (search->priv->high_priority_region);
if (nb_subregions == 0)
@@ -1852,16 +1852,16 @@ regex_search_handle_high_priority_region (GtkSourceSearchContext *search)
&start,
&end);
- gtk_source_region_get_iterator (region, ®ion_iter, 0);
+ gtk_source_region_get_region_iter (region, ®ion_iter, 0);
- while (!gtk_source_region_iterator_is_end (®ion_iter))
+ while (!gtk_source_region_iter_is_end (®ion_iter))
{
GtkTextIter subregion_start;
GtkTextIter subregion_end;
- if (!gtk_source_region_iterator_get_subregion (®ion_iter,
- &subregion_start,
- &subregion_end))
+ if (!gtk_source_region_iter_get_subregion (®ion_iter,
+ &subregion_start,
+ &subregion_end))
{
return;
}
@@ -1871,7 +1871,7 @@ regex_search_handle_high_priority_region (GtkSourceSearchContext *search)
&subregion_start,
&subregion_end);
- gtk_source_region_iterator_next (®ion_iter);
+ gtk_source_region_iter_next (®ion_iter);
}
gtk_source_region_destroy (region);
diff --git a/testsuite/test-region.c b/testsuite/test-region.c
index 3ef2793..b9fab71 100644
--- a/testsuite/test-region.c
+++ b/testsuite/test-region.c
@@ -29,7 +29,7 @@ test_region (void)
{
GtkTextBuffer *buffer;
GtkSourceRegion *region, *intersection;
- GtkSourceRegionIterator reg_iter;
+ GtkSourceRegionIter reg_iter;
GtkTextIter iter1, iter2;
gint i;
@@ -96,8 +96,8 @@ test_region (void)
gtk_text_buffer_get_start_iter (buffer, &iter1);
gtk_text_buffer_insert (buffer, &iter1, "This is a test of GtkSourceRegion", -1);
- gtk_source_region_get_iterator (region, ®_iter, 0);
- if (!gtk_source_region_iterator_is_end (®_iter)) {
+ gtk_source_region_get_region_iter (region, ®_iter, 0);
+ if (!gtk_source_region_iter_is_end (®_iter)) {
g_print ("problem fetching iterator for an empty region\n");
g_assert_not_reached ();
}
@@ -135,14 +135,14 @@ test_region (void)
}
i = 0;
- gtk_source_region_get_iterator (region, ®_iter, 0);
+ gtk_source_region_get_region_iter (region, ®_iter, 0);
- while (!gtk_source_region_iterator_is_end (®_iter))
+ while (!gtk_source_region_iter_is_end (®_iter))
{
GtkTextIter s, e, s1, e1;
- gtk_source_region_iterator_get_subregion (®_iter,
- &s, &e);
+ gtk_source_region_iter_get_subregion (®_iter,
+ &s, &e);
gtk_source_region_nth_subregion (region, i, &s1, &e1);
if (!gtk_text_iter_equal (&s, &s1) ||
@@ -153,7 +153,7 @@ test_region (void)
}
++i;
- gtk_source_region_iterator_next (®_iter);
+ gtk_source_region_iter_next (®_iter);
}
if (i != gtk_source_region_subregions (region))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]