1 /* gtkspell - a spell-checking addon for GtkText
2 * Copyright (c) 2000 Evan Martin.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __gtkspell_h__
20 #define __gtkspell_h__
24 /* PLEASE NOTE that this API is unstable and subject to change. */
25 #define GTKSPELL_VERSION "0.3.2"
27 extern int gtkspell_start(char *path, char *args[]);
28 /* Spawns the spell checking program.
31 * - "path" should be the full path to the spell checking program, or NULL
32 * if you want to search the PATH for args[0].
33 * - "args" should be a array of arguments to the spell checking program.
34 * The first element should be the name of the program.
35 * You should give the argument to run the spell checking program in the
36 * "embedded" mode. for ispell, this is "-a".
37 * The last element should be NULL.
39 * 0 on success, and -1 on error.
42 * char *args[] = { "ispell", "-a", NULL };
43 * if (gtkspell_start(NULL, args) < 0) {
44 * fprintf(stderr, "Unable to start GtkSpell.\n");
51 extern void gtkspell_stop();
52 /* Stop the spellchecking program.
53 * This kills the spell checker's process and frees memory.
56 extern int gtkspell_running();
57 /* Is gtkspell running?
60 * nonzero if it running
61 * zero if is not running
64 * if (gtkspell_running())
65 * printf("gtkspell is running.\n");
68 extern void gtkspell_attach(GtkText *text);
69 /* Attach GtkSpell to a GtkText Widget.
70 * This enables checking as you type and the popup menu.
73 * - "text" is the widget to which GtkSpell should attach.
77 * text = gtk_text_new(NULL, NULL);
78 * gtk_text_set_editable(GTK_TEXT(text), TRUE);
79 * gtkspell_attach(GTK_TEXT(text));
82 void gtkspell_detach(GtkText *gtktext);
83 /* Detach GtkSpell from a GtkText widget.
86 * - "text" is the widget from which GtkSpell should detach.
90 void gtkspell_check_all(GtkText *gtktext);
91 /* Check and highlight the misspelled words.
92 * Note that the popup menu will not work unless you gtkspell_attach().
95 * - "text" is the widget to check.
98 void gtkspell_uncheck_all(GtkText *gtktext);
99 /* Remove all of the highlighting from the widget.
102 * - "text" is the widget to check.
107 #endif /* __gtkspell_h__ */