1117
|
1 /* gtkspell - a spell-checking addon for GtkText
|
|
2 * Copyright (c) 2000 Evan Martin.
|
|
3 *
|
|
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.
|
|
8 *
|
|
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.
|
|
13 *
|
|
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
|
|
17 */
|
|
18
|
|
19 #ifndef __gtkspell_h__
|
|
20 #define __gtkspell_h__
|
|
21
|
|
22 /* PLEASE NOTE that this API is unstable and subject to change. */
|
|
23 #define GTKSPELL_VERSION "0.3.2"
|
|
24
|
|
25 extern int gtkspell_start(char *path, char *args[]);
|
|
26 /* Spawns the spell checking program.
|
|
27 *
|
|
28 * Arguments:
|
|
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.
|
|
36 * Return:
|
|
37 * 0 on success, and -1 on error.
|
|
38 *
|
|
39 * Example:
|
|
40 * char *args[] = { "ispell", "-a", NULL };
|
|
41 * if (gtkspell_start(NULL, args) < 0) {
|
|
42 * fprintf(stderr, "Unable to start GtkSpell.\n");
|
|
43 * return -1;
|
|
44 * }
|
|
45 *
|
|
46 */
|
|
47
|
|
48
|
|
49 extern void gtkspell_stop();
|
|
50 /* Stop the spellchecking program.
|
|
51 * This kills the spell checker's process and frees memory.
|
|
52 */
|
|
53
|
|
54 extern int gtkspell_running();
|
|
55 /* Is gtkspell running?
|
|
56 *
|
|
57 * Returns:
|
|
58 * nonzero if it running
|
|
59 * zero if is not running
|
|
60 *
|
|
61 * Example:
|
|
62 * if (gtkspell_running())
|
|
63 * printf("gtkspell is running.\n");
|
|
64 */
|
|
65
|
|
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.
|
|
69 *
|
|
70 * Arguments:
|
|
71 * - "text" is the widget to which GtkSpell should attach.
|
|
72 *
|
|
73 * Example:
|
|
74 * GtkWidget *text;
|
|
75 * text = gtk_text_new(NULL, NULL);
|
|
76 * gtk_text_set_editable(GTK_TEXT(text), TRUE);
|
|
77 * gtkspell_attach(GTK_TEXT(text));
|
|
78 */
|
|
79
|
|
80 void gtkspell_detach(GtkText *gtktext);
|
|
81 /* Detach GtkSpell from a GtkText widget.
|
|
82 *
|
|
83 * Arguments:
|
|
84 * - "text" is the widget from which GtkSpell should detach.
|
|
85 *
|
|
86 */
|
|
87
|
|
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().
|
|
91 *
|
|
92 * Arguments:
|
|
93 * - "text" is the widget to check.
|
|
94 */
|
|
95
|
|
96 void gtkspell_uncheck_all(GtkText *gtktext);
|
|
97 /* Remove all of the highlighting from the widget.
|
|
98 *
|
|
99 * Arguments:
|
|
100 * - "text" is the widget to check.
|
|
101 */
|
|
102
|
|
103 #endif /* __gtkspell_h__ */
|