Mercurial > pidgin.yaz
annotate plugins/spellchk.c @ 6485:70d5122bc3ff
[gaim-migrate @ 6999]
Removed the old event system and replaced it with a much better signal
system. There will most likely be some bugs in this, but it seems to be
working for now. Plugins can now generate their own signals, and other
plugins can find those plugins and connect to them. This could give
plugins a form of IPC. It's also useful for other things. It's rather
flexible, except for the damn marshalling, but there's no way around that
that I or the glib people can see.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 18 Aug 2003 01:03:43 +0000 |
parents | e9974608b319 |
children | b0913ab92893 |
rev | line source |
---|---|
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
1 /* |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
2 * A lot of this code (especially the config code) was taken directly |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
3 * or nearly directly from xchat, version 1.4.2 by Peter Zelezny and others. |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
4 */ |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
5 #include "internal.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
6 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
7 #include "debug.h" |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
8 #include "signals.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
9 #include "util.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
10 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
11 #include "gtkplugin.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
12 #include "gtkutils.h" |
4202
59751fe608c5
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4165
diff
changeset
|
13 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
14 #define SPELLCHECK_PLUGIN_ID "gtk-spellcheck" |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
15 |
4348 | 16 enum { |
17 BAD_COLUMN, | |
18 GOOD_COLUMN, | |
19 N_COLUMNS | |
103 | 20 }; |
21 | |
4348 | 22 static int num_words(const char *); |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
23 static int get_word(char *, int); |
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
24 static char *have_word(char *, int); |
4348 | 25 static void substitute(char **, int, int, const char *); |
26 static GtkListStore *model; | |
103 | 27 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
28 static void |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
29 substitute_words(GaimAccount *account, GaimConversation *conv, |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
30 char **message, void *data) |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
31 { |
103 | 32 int i, l; |
33 int word; | |
34 char *tmp; | |
35 | |
36 if (message == NULL || *message == NULL) | |
37 return; | |
38 | |
39 l = num_words(*message); | |
40 for (i = 0; i < l; i++) { | |
4348 | 41 GtkTreeIter iter; |
103 | 42 word = get_word(*message, i); |
4348 | 43 if(gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) { |
44 do { | |
45 GValue val0, val1; | |
46 const char *bad, *good; | |
47 memset(&val0, 0, sizeof(val0)); | |
48 memset(&val1, 0, sizeof(val1)); | |
49 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 0, &val0); | |
50 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 1, &val1); | |
51 tmp = have_word(*message, word); | |
52 bad = g_value_get_string(&val0); | |
53 good = g_value_get_string(&val1); | |
54 if (!strcmp(tmp, bad)) { | |
55 substitute(message, word, strlen(bad), | |
56 good); | |
57 l += num_words(good) - num_words(bad); | |
58 i += num_words(good) - num_words(bad); | |
59 } | |
60 free(tmp); | |
61 g_value_unset(&val0); | |
62 g_value_unset(&val1); | |
63 } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter)); | |
103 | 64 } |
65 } | |
66 } | |
67 | |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
68 static int buf_get_line(char *ibuf, char **buf, int *position, int len) { |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
69 int pos = *position, spos = pos; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
70 |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
71 if (pos == len) |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
72 return 0; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
73 |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
74 while (ibuf[pos++] != '\n') { |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
75 if (pos == len) |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
76 return 0; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
77 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
78 pos--; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
79 ibuf[pos] = 0; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
80 *buf = &ibuf[spos]; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
81 pos++; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
82 *position = pos; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
83 return 1; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
84 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
85 |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
86 static void load_conf() { |
4348 | 87 const char * const defaultconf = "BAD r\nGOOD are\n\n" |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
88 "BAD u\nGOOD you\n\n" |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
89 "BAD teh\nGOOD the\n\n"; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
90 char *buf, *ibuf; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
91 char name[82]; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
92 char cmd[256]; |
4348 | 93 int pnt = 0; |
94 gsize size; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
95 |
4348 | 96 model = gtk_list_store_new((gint)N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING); |
103 | 97 |
4348 | 98 buf = g_build_filename(gaim_home_dir(), ".gaim", "dict", NULL); |
99 g_file_get_contents(buf, &ibuf, &size, NULL); | |
100 free(buf); | |
101 if(!ibuf) { | |
102 ibuf = g_strdup(defaultconf); | |
103 size = strlen(defaultconf); | |
106
e05e6373ea5a
[gaim-migrate @ 116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
103
diff
changeset
|
104 } |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
105 |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
106 cmd[0] = 0; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
107 name[0] = 0; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
108 |
4348 | 109 while(buf_get_line(ibuf, &buf, &pnt, size)) { |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
110 if (*buf != '#') { |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
111 if (!strncasecmp(buf, "BAD ", 4)) |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
112 strncpy(name, buf + 4, 81); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
113 if (!strncasecmp(buf, "GOOD ", 5)) { |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
114 strncpy(cmd, buf + 5, 255); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
115 if (*name) { |
4348 | 116 GtkTreeIter iter; |
117 gtk_list_store_append(model, &iter); | |
118 gtk_list_store_set(model, &iter, | |
119 0, g_strdup(name), | |
120 1, g_strdup(cmd), | |
121 -1); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
122 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
123 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
124 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
125 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
126 free(ibuf); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
127 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
128 |
103 | 129 |
130 | |
4348 | 131 static int num_words(const char *m) { |
103 | 132 int count = 0; |
133 int pos; | |
134 int state = 0; | |
135 | |
136 for (pos = 0; pos < strlen(m); pos++) { | |
137 switch (state) { | |
138 case 0: /* expecting word */ | |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
139 if (!g_ascii_isspace(m[pos]) && !g_ascii_ispunct(m[pos])) { |
103 | 140 count++; |
141 state = 1; | |
142 } else if (m[pos] == '<') | |
143 state = 2; | |
144 break; | |
145 case 1: /* inside word */ | |
112
a57fd3390ee4
[gaim-migrate @ 122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
111
diff
changeset
|
146 if (m[pos] == '<') |
a57fd3390ee4
[gaim-migrate @ 122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
111
diff
changeset
|
147 state = 2; |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
148 else if (g_ascii_isspace(m[pos]) || g_ascii_ispunct(m[pos])) |
103 | 149 state = 0; |
150 break; | |
151 case 2: /* inside HTML tag */ | |
152 if (m[pos] == '>') | |
153 state = 0; | |
154 break; | |
155 } | |
156 } | |
157 return count; | |
158 } | |
159 | |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
160 static int get_word(char *m, int word) { |
103 | 161 int count = 0; |
162 int pos = 0; | |
163 int state = 0; | |
164 | |
165 for (pos = 0; pos < strlen(m) && count <= word; pos++) { | |
166 switch (state) { | |
167 case 0: | |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
168 if (!g_ascii_isspace(m[pos]) && !g_ascii_ispunct(m[pos])) { |
103 | 169 count++; |
170 state = 1; | |
171 } else if (m[pos] == '<') | |
172 state = 2; | |
173 break; | |
174 case 1: | |
112
a57fd3390ee4
[gaim-migrate @ 122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
111
diff
changeset
|
175 if (m[pos] == '<') |
a57fd3390ee4
[gaim-migrate @ 122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
111
diff
changeset
|
176 state = 2; |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
177 else if (g_ascii_isspace(m[pos]) || g_ascii_ispunct(m[pos])) |
103 | 178 state = 0; |
179 break; | |
180 case 2: | |
181 if (m[pos] == '>') | |
182 state = 0; | |
183 break; | |
184 } | |
185 } | |
186 return pos - 1; | |
187 } | |
188 | |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
189 static char *have_word(char *m, int pos) { |
3733 | 190 char *tmp = strpbrk(&m[pos], "' \t\f\r\n\"><.?!-,/"); |
103 | 191 int len = (int)(tmp - &m[pos]); |
192 | |
193 if (tmp == NULL) { | |
194 tmp = strdup(&m[pos]); | |
195 return tmp; | |
196 } | |
197 | |
198 tmp = malloc(len + 1); | |
199 tmp[0] = 0; | |
200 strncat(tmp, &m[pos], len); | |
201 | |
202 return tmp; | |
203 } | |
204 | |
4348 | 205 static void substitute(char **mes, int pos, int m, const char *text) { |
257
a93e273ca1d6
[gaim-migrate @ 267]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
206 char *new = g_malloc(strlen(*mes) + strlen(text) + 1); |
103 | 207 char *tmp; |
208 new[0] = 0; | |
209 | |
210 strncat(new, *mes, pos); | |
211 strcat(new, text); | |
212 | |
213 strcat(new, &(*mes)[pos + m]); | |
214 tmp = *mes; | |
215 *mes = new; | |
257
a93e273ca1d6
[gaim-migrate @ 267]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
216 g_free(tmp); |
103 | 217 } |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
218 |
4348 | 219 static GtkWidget *tree; |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
220 static GtkWidget *bad_entry; |
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
221 static GtkWidget *good_entry; |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
222 |
4348 | 223 static void save_list(); |
224 | |
225 static void on_edited(GtkCellRendererText *cellrenderertext, | |
6116 | 226 gchar *path, gchar *arg2, gpointer data) |
4348 | 227 { |
228 GtkTreeIter iter; | |
229 GValue val; | |
230 if(arg2[0] == '\0') { | |
231 gdk_beep(); | |
232 return; | |
233 } | |
234 memset(&val, 0, sizeof(val)); | |
235 g_return_if_fail(gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(model), &iter, path)); | |
236 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, GPOINTER_TO_INT(data), &val); | |
237 if(strcmp(arg2, g_value_get_string(&val))) { | |
238 gtk_list_store_set(model, &iter, GPOINTER_TO_INT(data), arg2, -1); | |
239 save_list(); | |
240 } | |
241 g_value_unset(&val); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
242 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
243 |
4348 | 244 static void list_add_new() |
245 { | |
246 GtkTreeIter iter; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
247 |
4348 | 248 gtk_list_store_append(model, &iter); |
249 gtk_list_store_set(model, &iter, | |
250 0, gtk_entry_get_text(GTK_ENTRY(bad_entry)), | |
251 1, gtk_entry_get_text(GTK_ENTRY(good_entry)), | |
252 -1); | |
253 gtk_editable_select_region(GTK_EDITABLE(bad_entry), 0, -1); | |
254 gtk_widget_grab_focus(bad_entry); | |
4601 | 255 |
256 save_list(); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
257 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
258 |
4348 | 259 static void add_selected_row_to_list(GtkTreeModel *model, GtkTreePath *path, |
260 GtkTreeIter *iter, gpointer data) | |
261 { | |
262 GSList **list = (GSList **)data; | |
263 *list = g_slist_append(*list, gtk_tree_path_copy(path) ); | |
264 } | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
265 |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
266 |
4348 | 267 static void remove_row(void *data1, gpointer data2) |
268 { | |
269 GtkTreePath *path = (GtkTreePath*)data1; | |
270 GtkTreeIter iter; | |
271 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path); | |
272 gtk_list_store_remove(model, &iter); | |
273 gtk_tree_path_free(path); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
274 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
275 |
4348 | 276 static void list_delete() |
277 { | |
278 GtkTreeSelection *sel; | |
279 GSList *list = NULL; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
280 |
4348 | 281 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); |
282 gtk_tree_selection_selected_foreach(sel, add_selected_row_to_list, &list); | |
283 | |
284 g_slist_foreach(list, remove_row, NULL); | |
285 g_slist_free(list); | |
4601 | 286 |
287 save_list(); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
288 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
289 |
4348 | 290 static void save_list() |
291 { | |
292 FILE *f; | |
293 char *name; | |
294 GtkTreeIter iter; | |
295 char tempfilename[BUF_LONG]; | |
296 int fd; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
297 |
4348 | 298 name = g_build_filename(gaim_home_dir(), ".gaim", "dict", NULL); |
299 strcpy(tempfilename, name); | |
300 strcat(tempfilename,".XXXXXX"); | |
301 fd = g_mkstemp(tempfilename); | |
302 if(fd<0) { | |
303 perror(tempfilename); | |
304 g_free(name); | |
305 return; | |
306 } | |
307 if (!(f = fdopen(fd, "w"))) { | |
308 perror("fdopen"); | |
309 close(fd); | |
310 g_free(name); | |
311 return; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
312 } |
4348 | 313 |
314 fchmod(fd, S_IRUSR | S_IWUSR); | |
4373
dcc6c130c6d9
[gaim-migrate @ 4639]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4363
diff
changeset
|
315 |
4348 | 316 if(gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) { |
317 do { | |
318 GValue val0, val1; | |
319 memset(&val0, 0, sizeof(val0)); | |
320 memset(&val1, 0, sizeof(val1)); | |
321 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 0, &val0); | |
322 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 1, &val1); | |
323 fprintf(f, "BAD %s\nGOOD %s\n\n", g_value_get_string(&val0), g_value_get_string(&val1)); | |
324 g_value_unset(&val0); | |
325 g_value_unset(&val1); | |
326 } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter)); | |
327 } | |
328 if(fclose(f)) { | |
5227
6d1707dc8c3d
[gaim-migrate @ 5597]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
329 gaim_debug(GAIM_DEBUG_ERROR, "spellchk", |
6d1707dc8c3d
[gaim-migrate @ 5597]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
330 "Error writing to %s: %m\n", tempfilename); |
4348 | 331 unlink(tempfilename); |
332 g_free(name); | |
333 return; | |
334 } | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
335 rename(tempfilename, name); |
4348 | 336 g_free(name); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
337 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
338 |
4348 | 339 static void |
340 check_if_something_is_selected(GtkTreeModel *model, | |
341 GtkTreePath *path, GtkTreeIter *iter, gpointer data) | |
342 { | |
343 *((gboolean*)data) = TRUE; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
344 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
345 |
4348 | 346 static void on_selection_changed(GtkTreeSelection *sel, |
347 gpointer data) | |
348 { | |
349 gboolean is = FALSE; | |
350 gtk_tree_selection_selected_foreach(sel, check_if_something_is_selected, &is); | |
351 gtk_widget_set_sensitive((GtkWidget*)data, is); | |
352 } | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
353 |
4348 | 354 static gboolean non_empty(const char *s) |
355 { | |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
356 while(*s && g_ascii_isspace(*s)) |
4348 | 357 s++; |
358 return *s; | |
359 } | |
360 | |
361 static void on_entry_changed(GtkEditable *editable, gpointer data) | |
362 { | |
363 gtk_widget_set_sensitive((GtkWidget*)data, | |
364 non_empty(gtk_entry_get_text(GTK_ENTRY(bad_entry))) && | |
365 non_empty(gtk_entry_get_text(GTK_ENTRY(good_entry)))); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
366 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
367 |
3630 | 368 /* |
369 * EXPORTED FUNCTIONS | |
370 */ | |
371 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
372 static gboolean |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
373 plugin_load(GaimPlugin *plugin) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
374 { |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
375 void *conv_handle = gaim_conversations_get_handle(); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
376 |
3630 | 377 load_conf(); |
378 | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
379 gaim_signal_connect(conv_handle, "sending-im-msg", |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
380 plugin, GAIM_CALLBACK(substitute_words), NULL); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
381 gaim_signal_connect(conv_handle, "sending-chat-msg", |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
382 plugin, GAIM_CALLBACK(substitute_words), NULL); |
3630 | 383 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
384 return TRUE; |
3630 | 385 } |
386 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
387 static GtkWidget * |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
388 get_config_frame(GaimPlugin *plugin) |
4348 | 389 { |
3565 | 390 GtkWidget *ret, *vbox, *win; |
4348 | 391 GtkWidget *hbox, *label; |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
392 GtkWidget *button; |
4348 | 393 GtkSizeGroup *sg; |
394 GtkCellRenderer *renderer; | |
395 GtkTreeViewColumn *column; | |
396 | |
397 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
3565 | 398 |
399 ret = gtk_vbox_new(FALSE, 18); | |
400 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
401 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5227
diff
changeset
|
402 vbox = gaim_gtk_make_frame(ret, _("Text Replacements")); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
403 gtk_container_set_border_width(GTK_CONTAINER(vbox), 4); |
4348 | 404 gtk_widget_set_size_request(vbox, 300, -1); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
405 gtk_widget_show (vbox); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
406 |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
407 win = gtk_scrolled_window_new(0, 0); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
408 gtk_container_add(GTK_CONTAINER(vbox), win); |
4750
03ea71acade3
[gaim-migrate @ 5065]
Christian Hammond <chipx86@chipx86.com>
parents:
4601
diff
changeset
|
409 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(win), |
03ea71acade3
[gaim-migrate @ 5065]
Christian Hammond <chipx86@chipx86.com>
parents:
4601
diff
changeset
|
410 GTK_SHADOW_IN); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
411 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (win), |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
412 GTK_POLICY_AUTOMATIC, |
4348 | 413 GTK_POLICY_AUTOMATIC); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
414 gtk_widget_show(win); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
415 |
4348 | 416 tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model)); |
417 /* gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(tree), TRUE); */ | |
418 gtk_widget_set_size_request(tree, 260,200); | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
419 |
4348 | 420 renderer = gtk_cell_renderer_text_new (); |
421 g_object_set (G_OBJECT (renderer), | |
422 "editable", TRUE, | |
423 NULL); | |
424 g_signal_connect(G_OBJECT(renderer), "edited", | |
425 G_CALLBACK(on_edited), GINT_TO_POINTER(0)); | |
426 column = gtk_tree_view_column_new_with_attributes (_("You type"), | |
427 renderer, "text", BAD_COLUMN, NULL); | |
428 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); | |
429 gtk_tree_view_column_set_fixed_width(column, 130); | |
430 /* gtk_tree_view_column_set_resizable(column, TRUE); */ | |
431 gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); | |
432 renderer = gtk_cell_renderer_text_new (); | |
433 g_object_set (G_OBJECT (renderer), | |
434 "editable", TRUE, | |
435 NULL); | |
436 g_signal_connect(G_OBJECT(renderer), "edited", | |
437 G_CALLBACK(on_edited), GINT_TO_POINTER(1)); | |
438 column = gtk_tree_view_column_new_with_attributes (_("You send"), | |
439 renderer, "text", GOOD_COLUMN, NULL); | |
440 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); | |
441 gtk_tree_view_column_set_fixed_width(column, 130); | |
442 /* gtk_tree_view_column_set_resizable(column, TRUE); */ | |
443 gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); | |
444 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)), | |
445 GTK_SELECTION_MULTIPLE); | |
446 gtk_container_add(GTK_CONTAINER(win), tree); | |
447 gtk_widget_show(tree); | |
448 | |
449 hbox = gtk_hbutton_box_new(); | |
450 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
451 gtk_widget_show(hbox); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
452 |
4348 | 453 button = gtk_button_new_from_stock(GTK_STOCK_DELETE); |
454 g_signal_connect(G_OBJECT(button), "clicked", | |
455 G_CALLBACK(list_delete), NULL); | |
456 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
457 gtk_widget_set_sensitive(button, FALSE); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
458 |
4348 | 459 g_signal_connect(G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree))), |
460 "changed", G_CALLBACK(on_selection_changed), button); | |
461 | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
462 gtk_widget_show(button); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
463 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5227
diff
changeset
|
464 vbox = gaim_gtk_make_frame(ret, _("Add a new text replacement")); |
4348 | 465 gtk_widget_set_size_request(vbox, 300, -1); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
466 |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
467 hbox = gtk_hbox_new(FALSE, 2); |
4348 | 468 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
469 gtk_widget_show(hbox); | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
470 |
4348 | 471 label = gtk_label_new_with_mnemonic(_("You _type:")); |
472 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
473 | |
474 bad_entry = gtk_entry_new(); | |
475 gtk_entry_set_max_length(GTK_ENTRY(bad_entry), 40); | |
476 gtk_box_pack_start(GTK_BOX(hbox), bad_entry, TRUE, TRUE, 0); | |
477 gtk_size_group_add_widget(sg, bad_entry); | |
478 gtk_label_set_mnemonic_widget(GTK_LABEL(label), bad_entry); | |
479 gtk_widget_show(bad_entry); | |
480 | |
481 hbox = gtk_hbox_new(FALSE, 2); | |
482 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
483 gtk_widget_show(hbox); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
484 |
4348 | 485 label = gtk_label_new_with_mnemonic(_("You _send:")); |
486 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
487 |
4348 | 488 good_entry = gtk_entry_new(); |
489 gtk_entry_set_max_length(GTK_ENTRY(good_entry), 255); | |
490 gtk_box_pack_start(GTK_BOX(hbox), good_entry, TRUE, TRUE, 0); | |
491 gtk_size_group_add_widget(sg, good_entry); | |
492 gtk_label_set_mnemonic_widget(GTK_LABEL(label), good_entry); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
493 gtk_widget_show(good_entry); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
494 |
4348 | 495 hbox = gtk_hbutton_box_new(); |
496 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
497 button = gtk_button_new_from_stock(GTK_STOCK_ADD); | |
498 g_signal_connect(G_OBJECT(button), "clicked", | |
499 G_CALLBACK(list_add_new), NULL); | |
500 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
501 g_signal_connect(G_OBJECT(bad_entry), "changed", G_CALLBACK(on_entry_changed), button); | |
502 g_signal_connect(G_OBJECT(good_entry), "changed", G_CALLBACK(on_entry_changed), button); | |
503 gtk_widget_set_sensitive(button, FALSE); | |
504 gtk_widget_show(button); | |
505 | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
506 |
3565 | 507 gtk_widget_show_all(ret); |
508 return ret; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
509 } |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
510 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
511 static GaimGtkPluginUiInfo ui_info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
512 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
513 get_config_frame |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
514 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
515 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
516 static GaimPluginInfo info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
517 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
518 2, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
519 GAIM_PLUGIN_STANDARD, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
520 GAIM_GTK_PLUGIN_TYPE, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
521 0, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
522 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
523 GAIM_PRIORITY_DEFAULT, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
524 SPELLCHECK_PLUGIN_ID, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
525 N_("Text replacement"), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
526 VERSION, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
527 N_("Replaces text in outgoing messages according to user-defined rules."), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
528 N_("Replaces text in outgoing messages according to user-defined rules."), |
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
529 "Eric Warmenhoven <eric@warmenhoven.org>", |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6250
diff
changeset
|
530 GAIM_WEBSITE, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
531 plugin_load, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
532 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
533 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
534 &ui_info, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
535 NULL |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
536 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
537 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
538 static void |
5920
7d385de2f9cd
[gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents:
5873
diff
changeset
|
539 init_plugin(GaimPlugin *plugin) |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
540 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
541 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
542 |
6063 | 543 GAIM_INIT_PLUGIN(spellcheck, init_plugin, info) |