Mercurial > pidgin
annotate plugins/toc_commands.c @ 2473:3860817b32af
[gaim-migrate @ 2486]
this probably won't fix anything but it doesn't break things that weren't broken, i think
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 10 Oct 2001 18:12:09 +0000 |
parents | c9c20663e05b |
children |
rev | line source |
---|---|
179 | 1 #define GAIM_PLUGINS |
2 #include "gaim.h" | |
3 | |
4 #include <gtk/gtk.h> | |
5 | |
6 void enter_callback(GtkWidget *widget, GtkWidget *entry) { | |
7 gchar *entry_text; | |
8 entry_text = gtk_entry_get_text(GTK_ENTRY(entry)); | |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
425
diff
changeset
|
9 /* this is bad, but you really shouldn't be using this plugin */ |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
425
diff
changeset
|
10 sflap_send(connections->data, entry_text, strlen(entry_text), TYPE_DATA); |
179 | 11 } |
12 | |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
13 void destroy_callback(GtkWidget *widget, void *handle) { |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
14 gtk_widget_destroy(widget); |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
15 gaim_plugin_unload(handle); |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
16 } |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
17 |
179 | 18 GtkWidget *window; |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
425
diff
changeset
|
19 char *gaim_plugin_init(GModule *h) { |
179 | 20 GtkWidget *entry; |
21 | |
1956
c9c20663e05b
[gaim-migrate @ 1966]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1943
diff
changeset
|
22 window = gtk_window_new(GTK_WINDOW_DIALOG); |
179 | 23 gtk_window_set_title(GTK_WINDOW(window), "Gaim - SFLAP interface"); |
24 | |
25 entry = gtk_entry_new(); | |
26 gtk_signal_connect(GTK_OBJECT(entry), "activate", | |
27 (GtkSignalFunc)enter_callback, | |
28 entry); | |
29 gtk_container_add(GTK_CONTAINER(window), entry); | |
30 gtk_widget_show(entry); | |
31 | |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
32 gtk_signal_connect(GTK_OBJECT(window), "destroy", |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
33 (GtkSignalFunc)destroy_callback, |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
34 h); |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
35 |
179 | 36 gtk_widget_show(window); |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
425
diff
changeset
|
37 |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
425
diff
changeset
|
38 return NULL; |
179 | 39 } |
40 | |
41 void gaim_plugin_remove() { | |
42 gtk_widget_destroy(window); | |
43 } | |
44 | |
45 char *name() { | |
46 return "TOC Interface"; | |
47 } | |
48 | |
49 char *description() { | |
50 return "Allows you to talk directly to the TOC server, bypassing gaim."; | |
51 } |