[gspell/wip/inline-checker: 1/3] Revert "Rename InlineCheckerText -> InlineCheckerTextView"



commit 8da00103fb66a4b8d250896012441d239f7f9681
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Jan 7 10:17:35 2016 +0100

    Revert "Rename InlineCheckerText -> InlineCheckerTextView"
    
    This reverts commit ad288a64b7a1be64c9748bf747c0bade19945e23.
    
    I've changed my mind and now I think it's better to make
    InlineCheckerText public, but differently. For a public class the name
    InlineCheckerText is better, because in the future there will maybe be
    InlineCheckerEntry. So have the suffix "Text" for GtkTextView and
    "Entry" for GtkEntry.

 docs/reference/Makefile.am                         |    2 +-
 gspell/Makefile.am                                 |    4 +-
 ...er-text-view.c => gspell-inline-checker-text.c} |   80 +++++++++-----------
 ...er-text-view.h => gspell-inline-checker-text.h} |   16 ++--
 gspell/gspell-text-view.c                          |    4 +-
 po/POTFILES.in                                     |    2 +-
 6 files changed, 51 insertions(+), 57 deletions(-)
---
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index d4576e1..4a3f74b 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -21,8 +21,8 @@ CFILE_GLOB = $(top_srcdir)/gspell/*.c
 # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code
 IGNORE_HFILES =                                        \
        gspell-buffer-notifier.h                \
+       gspell-inline-checker-text.h            \
        gspell-inline-checker-text-buffer.h     \
-       gspell-inline-checker-text-view.h       \
        gspell-osx.h                            \
        gspell-utils.h                          \
        gtktextregion.h
diff --git a/gspell/Makefile.am b/gspell/Makefile.am
index d2274bb..b717bca 100644
--- a/gspell/Makefile.am
+++ b/gspell/Makefile.am
@@ -43,16 +43,16 @@ gspell_public_c_files =                             \
 gspell_private_headers =                       \
        gconstructor.h                          \
        gspell-buffer-notifier.h                \
+       gspell-inline-checker-text.h            \
        gspell-inline-checker-text-buffer.h     \
-       gspell-inline-checker-text-view.h       \
        gspell-utils.h                          \
        gtktextregion.h
 
 gspell_private_c_files =                       \
        gspell-buffer-notifier.c                \
        gspell-init.c                           \
+       gspell-inline-checker-text.c            \
        gspell-inline-checker-text-buffer.c     \
-       gspell-inline-checker-text-view.c       \
        gspell-utils.c                          \
        gtktextregion.c
 
diff --git a/gspell/gspell-inline-checker-text-view.c b/gspell/gspell-inline-checker-text.c
similarity index 56%
rename from gspell/gspell-inline-checker-text-view.c
rename to gspell/gspell-inline-checker-text.c
index 02657e5..ce8ed11 100644
--- a/gspell/gspell-inline-checker-text-view.c
+++ b/gspell/gspell-inline-checker-text.c
@@ -17,14 +17,14 @@
  * along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "gspell-inline-checker-text-view.h"
+#include "gspell-inline-checker-text.h"
 #include "gspell-inline-checker-text-buffer.h"
 
 /* Inline spell checker for GtkTextView. Handles buffer changes. */
 
-typedef struct _GspellInlineCheckerTextViewPrivate GspellInlineCheckerTextViewPrivate;
+typedef struct _GspellInlineCheckerTextPrivate GspellInlineCheckerTextPrivate;
 
-struct _GspellInlineCheckerTextViewPrivate
+struct _GspellInlineCheckerTextPrivate
 {
        GtkTextView *view;
        GspellInlineCheckerTextBuffer *inline_checker;
@@ -36,17 +36,15 @@ enum
        PROP_VIEW,
 };
 
-G_DEFINE_TYPE_WITH_PRIVATE (GspellInlineCheckerTextView,
-                           _gspell_inline_checker_text_view,
-                           G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GspellInlineCheckerText, _gspell_inline_checker_text, G_TYPE_OBJECT)
 
 static void
-update_inline_checker (GspellInlineCheckerTextView *self)
+update_inline_checker (GspellInlineCheckerText *self)
 {
-       GspellInlineCheckerTextViewPrivate *priv;
+       GspellInlineCheckerTextPrivate *priv;
        GtkTextBuffer *buffer;
 
-       priv = _gspell_inline_checker_text_view_get_instance_private (self);
+       priv = _gspell_inline_checker_text_get_instance_private (self);
 
        if (priv->view == NULL)
        {
@@ -67,22 +65,22 @@ update_inline_checker (GspellInlineCheckerTextView *self)
 }
 
 static void
-notify_buffer_cb (GtkTextView                 *view,
-                 GParamSpec                  *pspec,
-                 GspellInlineCheckerTextView *self)
+notify_buffer_cb (GtkTextView             *view,
+                 GParamSpec              *pspec,
+                 GspellInlineCheckerText *self)
 {
        update_inline_checker (self);
 }
 
 static void
-set_view (GspellInlineCheckerTextView *self,
-         GtkTextView                 *view)
+set_view (GspellInlineCheckerText *self,
+         GtkTextView             *view)
 {
-       GspellInlineCheckerTextViewPrivate *priv;
+       GspellInlineCheckerTextPrivate *priv;
 
        g_return_if_fail (GTK_IS_TEXT_VIEW (view));
 
-       priv = _gspell_inline_checker_text_view_get_instance_private (self);
+       priv = _gspell_inline_checker_text_get_instance_private (self);
 
        g_assert (priv->view == NULL);
        g_assert (priv->inline_checker == NULL);
@@ -99,16 +97,14 @@ set_view (GspellInlineCheckerTextView *self,
 }
 
 static void
-_gspell_inline_checker_text_view_get_property (GObject    *object,
-                                              guint       prop_id,
-                                              GValue     *value,
-                                              GParamSpec *pspec)
+_gspell_inline_checker_text_get_property (GObject    *object,
+                                         guint       prop_id,
+                                         GValue     *value,
+                                         GParamSpec *pspec)
 {
-       GspellInlineCheckerTextView *self;
-       GspellInlineCheckerTextViewPrivate *priv;
+       GspellInlineCheckerTextPrivate *priv;
 
-       self = GSPELL_INLINE_CHECKER_TEXT_VIEW (object);
-       priv = _gspell_inline_checker_text_view_get_instance_private (self);
+       priv = _gspell_inline_checker_text_get_instance_private (GSPELL_INLINE_CHECKER_TEXT (object));
 
        switch (prop_id)
        {
@@ -123,12 +119,12 @@ _gspell_inline_checker_text_view_get_property (GObject    *object,
 }
 
 static void
-_gspell_inline_checker_text_view_set_property (GObject      *object,
-                                              guint         prop_id,
-                                              const GValue *value,
-                                              GParamSpec   *pspec)
+_gspell_inline_checker_text_set_property (GObject      *object,
+                                         guint         prop_id,
+                                         const GValue *value,
+                                         GParamSpec   *pspec)
 {
-       GspellInlineCheckerTextView *self = GSPELL_INLINE_CHECKER_TEXT_VIEW (object);
+       GspellInlineCheckerText *self = GSPELL_INLINE_CHECKER_TEXT (object);
 
        switch (prop_id)
        {
@@ -143,13 +139,11 @@ _gspell_inline_checker_text_view_set_property (GObject      *object,
 }
 
 static void
-_gspell_inline_checker_text_view_dispose (GObject *object)
+_gspell_inline_checker_text_dispose (GObject *object)
 {
-       GspellInlineCheckerTextView *self;
-       GspellInlineCheckerTextViewPrivate *priv;
+       GspellInlineCheckerTextPrivate *priv;
 
-       self = GSPELL_INLINE_CHECKER_TEXT_VIEW (object);
-       priv = _gspell_inline_checker_text_view_get_instance_private (self);
+       priv = _gspell_inline_checker_text_get_instance_private (GSPELL_INLINE_CHECKER_TEXT (object));
 
        if (priv->view != NULL && priv->inline_checker != NULL)
        {
@@ -160,17 +154,17 @@ _gspell_inline_checker_text_view_dispose (GObject *object)
        priv->view = NULL;
        g_clear_object (&priv->inline_checker);
 
-       G_OBJECT_CLASS (_gspell_inline_checker_text_view_parent_class)->dispose (object);
+       G_OBJECT_CLASS (_gspell_inline_checker_text_parent_class)->dispose (object);
 }
 
 static void
-_gspell_inline_checker_text_view_class_init (GspellInlineCheckerTextViewClass *klass)
+_gspell_inline_checker_text_class_init (GspellInlineCheckerTextClass *klass)
 {
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-       object_class->get_property = _gspell_inline_checker_text_view_get_property;
-       object_class->set_property = _gspell_inline_checker_text_view_set_property;
-       object_class->dispose = _gspell_inline_checker_text_view_dispose;
+       object_class->get_property = _gspell_inline_checker_text_get_property;
+       object_class->set_property = _gspell_inline_checker_text_set_property;
+       object_class->dispose = _gspell_inline_checker_text_dispose;
 
        g_object_class_install_property (object_class,
                                         PROP_VIEW,
@@ -184,16 +178,16 @@ _gspell_inline_checker_text_view_class_init (GspellInlineCheckerTextViewClass *k
 }
 
 static void
-_gspell_inline_checker_text_view_init (GspellInlineCheckerTextView *self)
+_gspell_inline_checker_text_init (GspellInlineCheckerText *self)
 {
 }
 
-GspellInlineCheckerTextView *
-_gspell_inline_checker_text_view_new (GtkTextView *view)
+GspellInlineCheckerText *
+_gspell_inline_checker_text_new (GtkTextView *view)
 {
        g_return_val_if_fail (GTK_IS_TEXT_VIEW (view), NULL);
 
-       return g_object_new (GSPELL_TYPE_INLINE_CHECKER_TEXT_VIEW,
+       return g_object_new (GSPELL_TYPE_INLINE_CHECKER_TEXT,
                             "view", view,
                             NULL);
 }
diff --git a/gspell/gspell-inline-checker-text-view.h b/gspell/gspell-inline-checker-text.h
similarity index 65%
rename from gspell/gspell-inline-checker-text-view.h
rename to gspell/gspell-inline-checker-text.h
index a564937..b069c76 100644
--- a/gspell/gspell-inline-checker-text-view.h
+++ b/gspell/gspell-inline-checker-text.h
@@ -17,30 +17,30 @@
  * along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __GSPELL_INLINE_CHECKER_TEXT_VIEW_H__
-#define __GSPELL_INLINE_CHECKER_TEXT_VIEW_H__
+#ifndef __GSPELL_INLINE_CHECKER_TEXT_H__
+#define __GSPELL_INLINE_CHECKER_TEXT_H__
 
 #include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
-#define GSPELL_TYPE_INLINE_CHECKER_TEXT_VIEW (_gspell_inline_checker_text_view_get_type ())
+#define GSPELL_TYPE_INLINE_CHECKER_TEXT (_gspell_inline_checker_text_get_type ())
 
 G_GNUC_INTERNAL
-G_DECLARE_DERIVABLE_TYPE (GspellInlineCheckerTextView, _gspell_inline_checker_text_view,
-                         GSPELL, INLINE_CHECKER_TEXT_VIEW,
+G_DECLARE_DERIVABLE_TYPE (GspellInlineCheckerText, _gspell_inline_checker_text,
+                         GSPELL, INLINE_CHECKER_TEXT,
                          GObject)
 
-struct _GspellInlineCheckerTextViewClass
+struct _GspellInlineCheckerTextClass
 {
        GObjectClass parent_class;
 };
 
 G_GNUC_INTERNAL
-GspellInlineCheckerTextView *  _gspell_inline_checker_text_view_new            (GtkTextView *view);
+GspellInlineCheckerText *      _gspell_inline_checker_text_new         (GtkTextView *view);
 
 G_END_DECLS
 
-#endif /* __GSPELL_INLINE_CHECKER_TEXT_VIEW_H__ */
+#endif /* __GSPELL_INLINE_CHECKER_TEXT_H__ */
 
 /* ex:set ts=8 noet: */
diff --git a/gspell/gspell-text-view.c b/gspell/gspell-text-view.c
index 69e3696..faa9bd2 100644
--- a/gspell/gspell-text-view.c
+++ b/gspell/gspell-text-view.c
@@ -18,7 +18,7 @@
  */
 
 #include "gspell-text-view.h"
-#include "gspell-inline-checker-text-view.h"
+#include "gspell-inline-checker-text.h"
 
 /**
  * SECTION:text-view
@@ -66,7 +66,7 @@ gspell_text_view_set_inline_checking (GtkTextView *view,
 
                g_object_set_data_full (G_OBJECT (view),
                                        INLINE_CHECKER_KEY,
-                                       _gspell_inline_checker_text_view_new (view),
+                                       _gspell_inline_checker_text_new (view),
                                        g_object_unref);
        }
        else
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4bc1e0a..86b44c5 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,8 +2,8 @@
 gspell/gspell-buffer-notifier.c
 gspell/gspell-checker.c
 gspell/gspell-checker-dialog.c
+gspell/gspell-inline-checker-text.c
 gspell/gspell-inline-checker-text-buffer.c
-gspell/gspell-inline-checker-text-view.c
 gspell/gspell-language.c
 gspell/gspell-language-chooser.c
 gspell/gspell-language-chooser-button.c


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