1/* gtkspell - a spell-checking addon for GTK's TextView widget 2 * Copyright (c) 2002 Evan Martin 3 * Copyright (c) 2012-2013 Sandro Mani 4 */ 5 6Introduction 7------------ 8GtkSpell is a library which provides MSWord/MacOSX-style highlighting of 9misspelled words in a GtkTextView widget. Right-clicking a misspelled word pops 10up a menu of suggested replacements. 11 12GtkSpell depends on 13 * GTK+3 14 * Enchant 15 * GObject Introspection 16 * GTK-Doc (optional) 17 * GTK+2 (optional) 18 19For more information, see http://sourceforge.net/projects/gtkspell/ . 20 21 22Use of the C API 23---------------- 24The easiest way to learn is to look at the provided example programs. 25It's pretty simple. 26 27Use gtk_spell_checker_new() and gtk_spell_checker_attach() to attach a new 28GtkSpellChecker to a GtkTextView. 29 30For convenience, gtk_spell_checker_new() is created as GInitiallyUnowned 31and gtk_spell_checker_attach() will sink the floating reference. 32gtk_spell_checker_attach() also connects the 'destroy' signal of the 33passed-in GObject to g_object_unref() the GtkSpellChecker, so in the most 34common use-case, you need not worry about cleaning it up, see 35examples/simple.c. 36 37However, if you want to detach and later reattach the GtkSpellChecker to a 38(possibly different) GtkTextView, you must get a pointer to it with 39gtk_spell_checker_get_from_text_view(), call g_object_ref() on the 40resulting pointer, call gtk_spell_checker_detach() on it, call 41gtk_spell_checker_attach() with the new GtkTextView, and finally call 42g_object_unref() to release the reference that you took at the beginning. 43 44Alternatively, you can sink the GtkSpellChecker immediately upon construction 45with g_object_ref_sink(), in which case you will retain the ownership of the 46GtkSpellChecker throughout the lifetime of the program, and you must remember 47to call g_object_unref() when you don't need it any more, see 48examples/advanced.c. 49 50You don't need to keep a pointer to an attached GtkSpellChecker object around, 51but you can retrieve it from a GtkTextView with 52gtk_spell_checker_get_from_text_view() when necessary. 53 54Once you have a pointer to a GtkSpellChecker, you can change the language it 55uses with gtk_spell_checker_set_language(). Use gtk_spell_checker_detach() 56to remove the GtkSpellChecker from its attached GtkTextView. Note that the 57GtkSpellChecker will get destroyed when gtk_spell_checker_detach() is called 58unless a reference is taken before via g_object_ref(). Finally, 59gtk_spell_checker_recheck_all() is provided to re-spellcheck the entire buffer, 60but it shouldn't be necessary. 61 62An API reference can be found in the documentation. It the documentation was 63not installed, gtkspell.h serves as an API reference. 64 65Available bindings 66------------------ 67The package also includes python-bindings via GObject typelibs as well as vala 68bindings, if they were compiled. 69 70Original Author 71--------------- 72Evan Martin <martine@danga.com> - http://neugierig.org/ 73 74Previous Maintainers 75-------------------- 76Nathan Fredrickson <nathan@silverorange.com> 77Eduardo Pérez Ureta <eperez@users.sourceforge.net> - http://edpeur.blogspot.com/ 78 79Current Maintainers 80------------------ 81Sandro Mani <manisandro@gmail.com> 82Daniel Atallah 83 84Thanks 85------ 86Ari Pollak <ari@debian.org> - Debian packages. 87Alex <hansolo@rochester.rr.com> - Redhat packages. 88Evan Nemerson - Vala bindings. 89 90vim: tw=72 91