[gspell] navigator-text-view: add get_view()



commit ba8e81c4550f4b5d0f3507611687962df5d86b8b
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Mar 12 16:42:59 2016 +0100

    navigator-text-view: add get_view()

 docs/reference/gspell-1.0-sections.txt |    1 +
 gspell/gspell-navigator-text-view.c    |   23 +++++++++++++++++++----
 gspell/gspell-navigator-text-view.h    |    2 ++
 3 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/docs/reference/gspell-1.0-sections.txt b/docs/reference/gspell-1.0-sections.txt
index 45ce4ed..7217eb3 100644
--- a/docs/reference/gspell-1.0-sections.txt
+++ b/docs/reference/gspell-1.0-sections.txt
@@ -90,6 +90,7 @@ GSPELL_TYPE_NAVIGATOR
 <TITLE>GspellNavigatorTextView</TITLE>
 GspellNavigatorTextView
 gspell_navigator_text_view_new
+gspell_navigator_text_view_get_view
 <SUBSECTION Standard>
 GSPELL_TYPE_NAVIGATOR_TEXT_VIEW
 GspellNavigatorTextViewClass
diff --git a/gspell/gspell-navigator-text-view.c b/gspell/gspell-navigator-text-view.c
index 0eea56c..892c256 100644
--- a/gspell/gspell-navigator-text-view.c
+++ b/gspell/gspell-navigator-text-view.c
@@ -136,14 +136,12 @@ gspell_navigator_text_view_get_property (GObject    *object,
                                         GValue     *value,
                                         GParamSpec *pspec)
 {
-       GspellNavigatorTextViewPrivate *priv;
-
-       priv = gspell_navigator_text_view_get_instance_private (GSPELL_NAVIGATOR_TEXT_VIEW (object));
+       GspellNavigatorTextView *navigator = GSPELL_NAVIGATOR_TEXT_VIEW (object);
 
        switch (prop_id)
        {
                case PROP_VIEW:
-                       g_value_set_object (value, priv->view);
+                       g_value_set_object (value, gspell_navigator_text_view_get_view (navigator));
                        break;
 
                default:
@@ -532,4 +530,21 @@ gspell_navigator_text_view_new (GtkTextView *view)
                             NULL);
 }
 
+/**
+ * gspell_navigator_text_view_get_view:
+ * @navigator: a #GspellNavigatorTextView.
+ *
+ * Returns: (transfer none): the #GtkTextView.
+ */
+GtkTextView *
+gspell_navigator_text_view_get_view (GspellNavigatorTextView *navigator)
+{
+       GspellNavigatorTextViewPrivate *priv;
+
+       g_return_val_if_fail (GSPELL_IS_NAVIGATOR_TEXT_VIEW (navigator), NULL);
+
+       priv = gspell_navigator_text_view_get_instance_private (navigator);
+       return priv->view;
+}
+
 /* ex:set ts=8 noet: */
diff --git a/gspell/gspell-navigator-text-view.h b/gspell/gspell-navigator-text-view.h
index 405b499..e6bc8e6 100644
--- a/gspell/gspell-navigator-text-view.h
+++ b/gspell/gspell-navigator-text-view.h
@@ -45,6 +45,8 @@ struct _GspellNavigatorTextViewClass
 
 GspellNavigator *      gspell_navigator_text_view_new          (GtkTextView *view);
 
+GtkTextView *          gspell_navigator_text_view_get_view     (GspellNavigatorTextView *navigator);
+
 G_END_DECLS
 
 #endif /* __GSPELL_NAVIGATOR_TEXT_VIEW_H__ */


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