[gtksourceview/wip/search] Add gtk_source_buffer_get_search_occurrences_count()



commit a0caf61ddc3a6848dce7bb143c99dba69022865d
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Jun 22 13:57:46 2013 +0200

    Add gtk_source_buffer_get_search_occurrences_count()

 docs/reference/gtksourceview-3.0-sections.txt |    1 +
 gtksourceview/gtksourcebuffer.c               |   17 +++++++++++++++++
 gtksourceview/gtksourcebuffer.h               |    3 +++
 3 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gtksourceview-3.0-sections.txt b/docs/reference/gtksourceview-3.0-sections.txt
index f87c569..43f06e3 100644
--- a/docs/reference/gtksourceview-3.0-sections.txt
+++ b/docs/reference/gtksourceview-3.0-sections.txt
@@ -40,6 +40,7 @@ gtk_source_buffer_set_search_text
 gtk_source_buffer_get_search_text
 gtk_source_buffer_set_search_flags
 gtk_source_buffer_get_search_flags
+gtk_source_buffer_get_search_occurrences_count
 <SUBSECTION Standard>
 GtkSourceBufferClass
 GTK_SOURCE_IS_BUFFER
diff --git a/gtksourceview/gtksourcebuffer.c b/gtksourceview/gtksourcebuffer.c
index d096640..a8f3e01 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -2656,3 +2656,20 @@ gtk_source_buffer_get_search_flags (GtkSourceBuffer *buffer)
 
        return _gtk_source_search_get_flags (buffer->priv->search);
 }
+
+/**
+ * gtk_source_buffer_get_search_occurrences_count:
+ * @buffer: a #GtkSourceBuffer.
+ *
+ * Gets the total number of search occurrences.
+ *
+ * Returns: the total number of search occurrences.
+ * Since: 3.10
+ */
+guint
+gtk_source_buffer_get_search_occurrences_count (GtkSourceBuffer *buffer)
+{
+       g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (buffer), 0);
+
+       return _gtk_source_search_get_occurrences_count (buffer->priv->search);
+}
diff --git a/gtksourceview/gtksourcebuffer.h b/gtksourceview/gtksourcebuffer.h
index 95447d9..3e8ea71 100644
--- a/gtksourceview/gtksourcebuffer.h
+++ b/gtksourceview/gtksourcebuffer.h
@@ -185,6 +185,9 @@ void                         gtk_source_buffer_set_search_flags     (GtkSourceBuffer      
  *buffer,
 
 GtkTextSearchFlags      gtk_source_buffer_get_search_flags     (GtkSourceBuffer        *buffer);
 
+guint                   gtk_source_buffer_get_search_occurrences_count
+                                                               (GtkSourceBuffer        *buffer);
+
 /* private */
 void                    _gtk_source_buffer_update_highlight    (GtkSourceBuffer        *buffer,
                                                                 const GtkTextIter      *start,


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