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