[gedit] Make gedit_document_get/set_search_context() public



commit db4ffd2e333db1194e769886ce331c68865f72ad
Author: Oliver Gerlich <oliver gerlich gmx de>
Date:   Sat Mar 15 23:08:55 2014 +0100

    Make gedit_document_get/set_search_context() public
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726408

 gedit/gedit-commands-search.c |   10 +++++-----
 gedit/gedit-document.c        |   20 +++++++++++++++++---
 gedit/gedit-document.h        |    4 ++--
 gedit/gedit-replace-dialog.c  |    4 ++--
 gedit/gedit-view-frame.c      |    6 +++---
 5 files changed, 29 insertions(+), 15 deletions(-)
---
diff --git a/gedit/gedit-commands-search.c b/gedit/gedit-commands-search.c
index fdab446..bccb6cf 100644
--- a/gedit/gedit-commands-search.c
+++ b/gedit/gedit-commands-search.c
@@ -238,7 +238,7 @@ run_forward_search (GeditWindow *window,
 
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
 
-       search_context = _gedit_document_get_search_context (GEDIT_DOCUMENT (buffer));
+       search_context = gedit_document_get_search_context (GEDIT_DOCUMENT (buffer));
 
        if (search_context == NULL)
        {
@@ -343,7 +343,7 @@ run_backward_search (GeditWindow *window,
 
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
 
-       search_context = _gedit_document_get_search_context (GEDIT_DOCUMENT (buffer));
+       search_context = gedit_document_get_search_context (GEDIT_DOCUMENT (buffer));
 
        if (search_context == NULL)
        {
@@ -403,7 +403,7 @@ do_replace (GeditReplaceDialog *dialog,
                return;
        }
 
-       search_context = _gedit_document_get_search_context (doc);
+       search_context = gedit_document_get_search_context (doc);
 
        if (search_context == NULL)
        {
@@ -454,7 +454,7 @@ do_replace_all (GeditReplaceDialog *dialog,
                return;
        }
 
-       search_context = _gedit_document_get_search_context (doc);
+       search_context = gedit_document_get_search_context (doc);
 
        if (search_context == NULL)
        {
@@ -651,7 +651,7 @@ _gedit_cmd_search_clear_highlight (GSimpleAction *action,
        gedit_view_frame_clear_search (frame);
 
        doc = gedit_view_frame_get_document (frame);
-       _gedit_document_set_search_context (doc, NULL);
+       gedit_document_set_search_context (doc, NULL);
 }
 
 void
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index e0a3030..b960bb8 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -2529,9 +2529,16 @@ connect_search_settings (GeditDocument *doc)
                                 G_CONNECT_SWAPPED);
 }
 
+/**
+ * gedit_document_set_search_context:
+ * @doc: a #GeditDocument
+ * @search_context: (allow-none): the new #GtkSourceSearchContext
+ *
+ * Sets the new search context for the document.
+ */
 void
-_gedit_document_set_search_context (GeditDocument          *doc,
-                                   GtkSourceSearchContext *search_context)
+gedit_document_set_search_context (GeditDocument          *doc,
+                                  GtkSourceSearchContext *search_context)
 {
        g_return_if_fail (GEDIT_IS_DOCUMENT (doc));
 
@@ -2566,8 +2573,15 @@ _gedit_document_set_search_context (GeditDocument          *doc,
        update_empty_search (doc);
 }
 
+/**
+ * gedit_document_get_search_context:
+ * @doc: a #GeditDocument
+ *
+ * Returns: the current search context of the document,
+ * or NULL if there is no current search context
+ */
 GtkSourceSearchContext *
-_gedit_document_get_search_context (GeditDocument *doc)
+gedit_document_get_search_context (GeditDocument *doc)
 {
        g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL);
 
diff --git a/gedit/gedit-document.h b/gedit/gedit-document.h
index d47abcb..c9b2507 100644
--- a/gedit/gedit-document.h
+++ b/gedit/gedit-document.h
@@ -295,10 +295,10 @@ GMountOperation
                *_gedit_document_create_mount_operation
                                                (GeditDocument       *doc);
 
-void                    _gedit_document_set_search_context     (GeditDocument          *doc,
+void                    gedit_document_set_search_context      (GeditDocument          *doc,
                                                                 GtkSourceSearchContext *search_context);
 
-GtkSourceSearchContext *_gedit_document_get_search_context     (GeditDocument          *doc);
+GtkSourceSearchContext *gedit_document_get_search_context      (GeditDocument          *doc);
 
 gboolean                _gedit_document_get_empty_search       (GeditDocument          *doc);
 
diff --git a/gedit/gedit-replace-dialog.c b/gedit/gedit-replace-dialog.c
index 0700338..77a48a9 100644
--- a/gedit/gedit-replace-dialog.c
+++ b/gedit/gedit-replace-dialog.c
@@ -66,7 +66,7 @@ get_search_context (GeditReplaceDialog *dialog,
                return NULL;
        }
 
-       search_context = _gedit_document_get_search_context (doc);
+       search_context = gedit_document_get_search_context (doc);
 
        if (search_context != NULL &&
            g_object_get_data (G_OBJECT (search_context), GEDIT_SEARCH_CONTEXT_KEY) == dialog)
@@ -441,7 +441,7 @@ connect_active_document (GeditReplaceDialog *dialog)
                                   GEDIT_SEARCH_CONTEXT_KEY,
                                   dialog);
 
-               _gedit_document_set_search_context (doc, search_context);
+               gedit_document_set_search_context (doc, search_context);
 
                g_object_unref (settings);
                g_object_unref (search_context);
diff --git a/gedit/gedit-view-frame.c b/gedit/gedit-view-frame.c
index 605037f..02f3b41 100644
--- a/gedit/gedit-view-frame.c
+++ b/gedit/gedit-view-frame.c
@@ -251,7 +251,7 @@ get_search_context (GeditViewFrame *frame)
        GtkSourceSearchSettings *search_settings;
 
        doc = gedit_view_frame_get_document (frame);
-       search_context = _gedit_document_get_search_context (doc);
+       search_context = gedit_document_get_search_context (doc);
 
        if (search_context == NULL)
        {
@@ -1258,8 +1258,8 @@ init_search_entry (GeditViewFrame *frame)
                        search_context = gtk_source_search_context_new (GTK_SOURCE_BUFFER (buffer),
                                                                        frame->priv->search_settings);
 
-                       _gedit_document_set_search_context (GEDIT_DOCUMENT (buffer),
-                                                           search_context);
+                       gedit_document_set_search_context (GEDIT_DOCUMENT (buffer),
+                                                          search_context);
 
                        g_signal_connect_swapped (search_context,
                                                  "notify::occurrences-count",


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