Mercurial > pidgin.yaz
comparison src/gtkspell.h @ 1117:f3e0f41beddb
[gaim-migrate @ 1127]
Removed the old, crappy spellchecker code; replaced to use gtkspell. works much better. got gtkspell.[ch] out of gtkspell's cvs repository.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 21 Nov 2000 09:50:31 +0000 |
parents | |
children | 418b1738a9a7 |
comparison
equal
deleted
inserted
replaced
1116:35476475f794 | 1117:f3e0f41beddb |
---|---|
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 static gchar *ispell_cmd[] = { "ispell", "-a", NULL }; | |
26 | |
27 extern int gtkspell_start(char *path, char *args[]); | |
28 /* Spawns the spell checking program. | |
29 * | |
30 * Arguments: | |
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. | |
38 * Return: | |
39 * 0 on success, and -1 on error. | |
40 * | |
41 * Example: | |
42 * char *args[] = { "ispell", "-a", NULL }; | |
43 * if (gtkspell_start(NULL, args) < 0) { | |
44 * fprintf(stderr, "Unable to start GtkSpell.\n"); | |
45 * return -1; | |
46 * } | |
47 * | |
48 */ | |
49 | |
50 | |
51 extern void gtkspell_stop(); | |
52 /* Stop the spellchecking program. | |
53 * This kills the spell checker's process and frees memory. | |
54 */ | |
55 | |
56 extern int gtkspell_running(); | |
57 /* Is gtkspell running? | |
58 * | |
59 * Returns: | |
60 * nonzero if it running | |
61 * zero if is not running | |
62 * | |
63 * Example: | |
64 * if (gtkspell_running()) | |
65 * printf("gtkspell is running.\n"); | |
66 */ | |
67 | |
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. | |
71 * | |
72 * Arguments: | |
73 * - "text" is the widget to which GtkSpell should attach. | |
74 * | |
75 * Example: | |
76 * GtkWidget *text; | |
77 * text = gtk_text_new(NULL, NULL); | |
78 * gtk_text_set_editable(GTK_TEXT(text), TRUE); | |
79 * gtkspell_attach(GTK_TEXT(text)); | |
80 */ | |
81 | |
82 void gtkspell_detach(GtkText *gtktext); | |
83 /* Detach GtkSpell from a GtkText widget. | |
84 * | |
85 * Arguments: | |
86 * - "text" is the widget from which GtkSpell should detach. | |
87 * | |
88 */ | |
89 | |
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(). | |
93 * | |
94 * Arguments: | |
95 * - "text" is the widget to check. | |
96 */ | |
97 | |
98 void gtkspell_uncheck_all(GtkText *gtktext); | |
99 /* Remove all of the highlighting from the widget. | |
100 * | |
101 * Arguments: | |
102 * - "text" is the widget to check. | |
103 */ | |
104 | |
105 #endif /* __gtkspell_h__ */ |