comparison plugins/spellchk.c @ 3630:9682c0e022c6

[gaim-migrate @ 3753] Yeah this will probably break a lot of shit knowing my luck. But hey, I really don't care what people thnk. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Fri, 11 Oct 2002 03:14:01 +0000
parents 154c4a9d9b6d
children 73e06ba29015
comparison
equal deleted inserted replaced
3629:afc5bb164c5a 3630:9682c0e022c6
16 #include <stdlib.h> 16 #include <stdlib.h>
17 #include <sys/stat.h> 17 #include <sys/stat.h>
18 #include <sys/types.h> 18 #include <sys/types.h>
19 #include <unistd.h> 19 #include <unistd.h>
20 #include <fcntl.h> 20 #include <fcntl.h>
21 #ifdef _WIN32
22 #include "win32dep.h"
23 #endif
21 24
22 struct replace_words { 25 struct replace_words {
23 char *bad; 26 char *bad;
24 char *good; 27 char *good;
25 }; 28 };
134 } 137 }
135 } 138 }
136 free(ibuf); 139 free(ibuf);
137 } 140 }
138 141
139 char *gaim_plugin_init(GModule *handle) { 142
140 load_conf();
141
142 gaim_signal_connect(handle, event_im_send, substitute_words, NULL);
143 gaim_signal_connect(handle, event_chat_send, substitute_words, NULL);
144 return NULL;
145 }
146
147 void gaim_plugin_remove() {
148 }
149
150 struct gaim_plugin_description desc;
151 struct gaim_plugin_description *gaim_plugin_desc() {
152 desc.api_version = PLUGIN_API_VERSION;
153 desc.name = g_strdup("Text replacement");
154 desc.version = g_strdup(VERSION);
155 desc.description = g_strdup("Replaces text in outgoing messages according to user-defined rules.");
156 desc.authors = g_strdup("Eric Warmehoven &lt;eric@warmenhoven.org>");
157 desc.url = g_strdup(WEBSITE);
158 return &desc;
159 }
160
161 char *name() {
162 return "IM Spell Check";
163 }
164
165 char *description() {
166 return "Watches outgoing IM text and corrects common spelling errors.";
167 }
168 143
169 static int num_words(char *m) { 144 static int num_words(char *m) {
170 int count = 0; 145 int count = 0;
171 int pos; 146 int pos;
172 int state = 0; 147 int state = 0;
356 m = gtk_entry_get_text(GTK_ENTRY(good_entry)); 331 m = gtk_entry_get_text(GTK_ENTRY(good_entry));
357 gtk_clist_set_text(GTK_CLIST(list), row, 1, m); 332 gtk_clist_set_text(GTK_CLIST(list), row, 1, m);
358 } 333 }
359 } 334 }
360 335
361 GtkWidget *gaim_plugin_config_gtk() { 336 /*
337 * EXPORTED FUNCTIONS
338 */
339
340 G_MODULE_EXPORT char *gaim_plugin_init(GModule *handle) {
341 load_conf();
342
343 gaim_signal_connect(handle, event_im_send, substitute_words, NULL);
344 gaim_signal_connect(handle, event_chat_send, substitute_words, NULL);
345 return NULL;
346 }
347
348 G_MODULE_EXPORT void gaim_plugin_remove() {
349 }
350
351 struct gaim_plugin_description desc;
352 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() {
353 desc.api_version = PLUGIN_API_VERSION;
354 desc.name = g_strdup("Text replacement");
355 desc.version = g_strdup(VERSION);
356 desc.description = g_strdup("Replaces text in outgoing messages according to user-defined rules.");
357 desc.authors = g_strdup("Eric Warmehoven &lt;eric@warmenhoven.org>");
358 desc.url = g_strdup(WEBSITE);
359 return &desc;
360 }
361
362 G_MODULE_EXPORT char *name() {
363 return "IM Spell Check";
364 }
365
366 G_MODULE_EXPORT char *description() {
367 return "Watches outgoing IM text and corrects common spelling errors.";
368 }
369
370 G_MODULE_EXPORT GtkWidget *gaim_plugin_config_gtk() {
362 GtkWidget *ret, *vbox, *win; 371 GtkWidget *ret, *vbox, *win;
363 GtkWidget *hbox; 372 GtkWidget *hbox;
364 GtkWidget *button; 373 GtkWidget *button;
365 GList *w = words; 374 GList *w = words;
366 struct replace_words *r; 375 struct replace_words *r;