Re: Moving spellcheckers into the Gtk+ stack



Hi all,

>  - Move Enchant into glib as a new module called gspell.  Enchant is a
> small client-side library that loads modules that interface with
> spell-checking backends, like aspell, ispell, MySpell, etc.  It's
> written by Dom, uses glib, and KDE recently forked it and called it
> kspell2 or something.  So, I don't think it has a lot more 
> opportunities
> as a fd.o project, and all its users are using the GNOME stack 
> already.
> Other projects (OO.o, Mozilla), prefer to interface directly with
> backends or reinvent their own wrapper.  So, by moving Enchant to 
> glib,
> we bring spell-checking to the entire GNOME stack for free.  This is
> quite in par with the gregex and gvfs efforts going on.  Dom is pretty
> positive about this.

The Enchant API is nice but I think it should be more GObject like to be
included in glib/gtk+.
GeditSpellChecker[1] is a GObject-based class wrapping (together with
GeditSpellCheckerLanguage [2]) the most important functions of Enchants.

>  - Port automatic spell-checking from libsexy and GtkSpell to Gtk+
> editable text widgets.

GeditAutomaticSpellChecker[3] is a "fork" of GtkSpell using
GeditSpellChecker instead of direct calls to Enchant.

>  - Add properties and Gtk settings for turning on/off spell-checking
> globally, setting default languages, etc.  Possibly adding context 
> menu
> entries too.

GeditSpellChecker uses a simple heuristic algorithm to select the
default language based on installed dictionaries and user's locale.

>  - Develop a simple tool for control-center to adjust above settings.

>  - If popular enough, move some spell-checking dialogs from Gedit or
> other implementations to Gtk+.

gedit have two dialogs:
- the set language dialog: to select the language to use for spell
checking the document [5]
- the real spell checker dialog (it is gedit independent but with a very
ugly API)

Marco Barisione (of GRegex fame) and Emanuele Aina under my supervision
wrote a little library we never published to split out from gedit the
gedit independent part of the spell checker plugin [4].

So... what am I proposing?

I think we should put Enchant in glib but with a more object oriented
API, the gedit spell checker plugin and the lib by Marco and Emanuele
show two possible implementations of this idea.
I then propose to add to gtk+ an "automatic spell checker" interface and
implement it for at least GtkTextView and GtkEntry.
Eventually, we can add a standard "set language" and "check spelling"
dialog to gtk+.

Ciao,
Paolo


[1]
http://cvs.gnome.org/viewcvs/gedit/plugins/spell/gedit-spell-checker.h?view=markup
[2]
http://cvs.gnome.org/viewcvs/gedit/plugins/spell/gedit-spell-checker-language.h?view=markup
[3]
http://cvs.gnome.org/viewcvs/gedit/plugins/spell/gedit-automatic-spell-checker.h?view=markup
[4] http://bugzilla.gnome.org/attachment.cgi?id=76039&action=view
[5] Very old and outdated screenshot:
http://www.gnome.org/~paolo/screenshots/language-dialog.png
[6] Very old screenshot:
http://www.gnome.org/~paolo/screenshots/spell-checker.png





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