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__
22 /* PLEASE NOTE that this API is unstable and subject to change. */
23 #define GTKSPELL_VERSION "0.3.2"
25 extern int gtkspell_start(char *path
, char *args
[]);
26 /* Spawns the spell checking program.
29 * - "path" should be the full path to the spell checking program, or NULL
30 * if you want to search the PATH for args[0].
31 * - "args" should be a array of arguments to the spell checking program.
32 * The first element should be the name of the program.
33 * You should give the argument to run the spell checking program in the
34 * "embedded" mode. for ispell, this is "-a".
35 * The last element should be NULL.
37 * 0 on success, and -1 on error.
40 * char *args[] = { "ispell", "-a", NULL };
41 * if (gtkspell_start(NULL, args) < 0) {
42 * fprintf(stderr, "Unable to start GtkSpell.\n");
49 extern void gtkspell_stop();
50 /* Stop the spellchecking program.
51 * This kills the spell checker's process and frees memory.
54 extern int gtkspell_running();
55 /* Is gtkspell running?
58 * nonzero if it running
59 * zero if is not running
62 * if (gtkspell_running())
63 * printf("gtkspell is running.\n");
66 extern void gtkspell_attach(GtkText
*text
);
67 /* Attach GtkSpell to a GtkText Widget.
68 * This enables checking as you type and the popup menu.
71 * - "text" is the widget to which GtkSpell should attach.
75 * text = gtk_text_new(NULL, NULL);
76 * gtk_text_set_editable(GTK_TEXT(text), TRUE);
77 * gtkspell_attach(GTK_TEXT(text));
80 void gtkspell_detach(GtkText
*gtktext
);
81 /* Detach GtkSpell from a GtkText widget.
84 * - "text" is the widget from which GtkSpell should detach.
88 void gtkspell_check_all(GtkText
*gtktext
);
89 /* Check and highlight the misspelled words.
90 * Note that the popup menu will not work unless you gtkspell_attach().
93 * - "text" is the widget to check.
96 void gtkspell_uncheck_all(GtkText
*gtktext
);
97 /* Remove all of the highlighting from the widget.
100 * - "text" is the widget to check.
103 #endif /* __gtkspell_h__ */