Mercurial > pidgin.yaz
annotate plugins/toc_commands.c @ 1122:889ca2b8697b
[gaim-migrate @ 1132]
wow. that wasn't exactly easy, now was it. i hope other plugins are easier cases to upgrade.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 22 Nov 2000 07:01:07 +0000 |
parents | ece2d1543b20 |
children | 94e81315be2a |
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 | |
22 window = gtk_window_new(GTK_WINDOW_DIALOG); | |
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 } |