[latexila] Use upstream GtkSpell, version >= 3.0.3 required



commit b187ed56d92b6b717aa8a1d2a62684f4fd1a3d8c
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Sep 24 15:20:41 2013 +0200

    Use upstream GtkSpell, version >= 3.0.3 required
    
    When developing LaTeXila 2.6 (first version with GTK+ 3), GtkSpell was
    not well maintained, there was no official version for GTK+ 3, GtkSpell
    was not GObjectified, etc. That's why there was a copy of the GtkSpell
    source code in latexila.
    
    Now GtkSpell is well maintained, it has been GObjectified, and several
    versions for GTK+ 3 have been released, including new features.

 README.in                |    4 +-
 configure.ac             |   15 +-
 src/Makefile.am          |    8 +-
 src/document_view.vala   |   16 +-
 src/gtkspell/Makefile.am |    5 -
 src/gtkspell/gtkspell.c  |  885 ----------------------------------------------
 src/gtkspell/gtkspell.h  |   41 ---
 vapi/gtkspell.vapi       |   16 -
 8 files changed, 23 insertions(+), 967 deletions(-)
---
diff --git a/README.in b/README.in
index 8069edf..b90c039 100644
--- a/README.in
+++ b/README.in
@@ -18,10 +18,10 @@ Requirements
 GLib >= @GLIB_REQUIRED_VERSION@
 GTK+ >= @GTK_REQUIRED_VERSION@
 GtkSourceView >= @GTKSOURCEVIEW_REQUIRED_VERSION@
-libgee
+GtkSpell >= @GTKSPELL_REQUIRED_VERSION@
+gee-1.0
 gettext
 gsettings-desktop-schemas
-enchant
 Latexmk >= 4.31 (optional, but strongly recommended)
 
 And for building the sources:
diff --git a/configure.ac b/configure.ac
index 0ec082b..7ee2f06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,11 +28,13 @@ LT_INIT
 GLIB_REQUIRED_VERSION="2.36"
 GTK_REQUIRED_VERSION="3.6"
 GTKSOURCEVIEW_REQUIRED_VERSION="3.10"
+GTKSPELL_REQUIRED_VERSION="3.0.3"
 VALA_REQUIRED_VERSION="0.20.0"
 
 AC_SUBST([GLIB_REQUIRED_VERSION])
 AC_SUBST([GTK_REQUIRED_VERSION])
 AC_SUBST([GTKSOURCEVIEW_REQUIRED_VERSION])
+AC_SUBST([GTKSPELL_REQUIRED_VERSION])
 AC_SUBST([VALA_REQUIRED_VERSION])
 
 # Some directories
@@ -92,6 +94,10 @@ if ! pkg-config --atleast-version=${GTKSOURCEVIEW_REQUIRED_VERSION} gtksourcevie
        AC_MSG_ERROR([gtksourceview-3.0 >= ${GTKSOURCEVIEW_REQUIRED_VERSION} required.])
 fi
 
+if ! pkg-config --atleast-version=${GTKSPELL_REQUIRED_VERSION} gtkspell3-3.0; then
+       AC_MSG_ERROR([gtkspell3-3.0 >= ${GTKSPELL_REQUIRED_VERSION} required.])
+fi
+
 if ! pkg-config gsettings-desktop-schemas; then
        AC_MSG_ERROR([gsettings-desktop-schemas required.])
 fi
@@ -100,18 +106,14 @@ if ! pkg-config gee-1.0; then
        AC_MSG_ERROR([gee-1.0 required.])
 fi
 
-if ! pkg-config enchant; then
-       AC_MSG_ERROR([enchant required.])
-fi
-
 dependencies="
        glib-2.0
        gio-2.0
        gtk+-3.0
        gtksourceview-3.0
+       gtkspell3-3.0
        gsettings-desktop-schemas
-       gee-1.0
-       enchant"
+       gee-1.0"
 
 CFLAGS="$CFLAGS `pkg-config --cflags ${dependencies}`"
 LIBS="$LIBS `pkg-config --libs ${dependencies}`"
@@ -159,7 +161,6 @@ AC_CONFIG_FILES([Makefile
                 po/Makefile.in
                  src/Makefile
                 src/gedit/Makefile
-                src/gtkspell/Makefile
                 src/ui/Makefile
                  README])
 
diff --git a/src/Makefile.am b/src/Makefile.am
index d633be4..db11658 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,10 +1,11 @@
-SUBDIRS = gedit gtkspell ui
+SUBDIRS = gedit ui
 
 bin_PROGRAMS = latexila
 
 VALAFLAGS =                    \
        --pkg gtk+-3.0          \
        --pkg gtksourceview-3.0 \
+       --pkg gtkspell3-3.0     \
        --pkg gee-1.0           \
        --pkg posix             \
        --target-glib=2.36
@@ -68,18 +69,15 @@ latexila_SOURCES =                  \
        $(vala_files)                   \
        $(vapidir)/config.vapi          \
        $(vapidir)/gedit.vapi           \
-       $(vapidir)/gtkspell.vapi        \
        $(vapidir)/menu_tool_action.vapi
 
 latexila_CPPFLAGS =            \
        -I$(top_srcdir)         \
        -I$(srcdir)/gedit       \
-       -I$(srcdir)/gtkspell    \
        -include config.h
 
 latexila_LDADD =               \
-       gedit/libgedit.la       \
-       gtkspell/libgtkspell.la
+       gedit/libgedit.la
 
 MAINTAINERCLEANFILES =         \
        $(vala_files:.vala=.c)  \
diff --git a/src/document_view.vala b/src/document_view.vala
index c54b71f..2d4e784 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -174,22 +174,26 @@ public class DocumentView : Gtk.SourceView
     {
         disable_spell_checking ();
 
+        GtkSpell.Checker checker = new GtkSpell.Checker ();
+        checker.attach (this);
+
         try
         {
             // Will try the best language depending on the LANG environment variable.
-            new GtkSpell.attach (this, null);
+            checker.set_language (null);
         }
-        catch (GtkspellError e)
+        catch (Error e)
         {
-            warning ("Spell error: %s", e.message);
+            warning ("GtkSpell error: %s", e.message);
         }
     }
 
     public void disable_spell_checking ()
     {
-        GtkSpell? spell = GtkSpell.get_from_text_view (this);
-        if (spell != null)
-            spell.detach ();
+        unowned GtkSpell.Checker checker = GtkSpell.Checker.get_from_text_view (this);
+
+        if (checker != null)
+            checker.detach ();
     }
 
     private bool on_button_release_event (Gdk.EventButton event)


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