Mercurial > pidgin
annotate plugins/toc_commands.c @ 648:07165959309b
[gaim-migrate @ 658]
just for the record, it did break my system.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 09 Aug 2000 04:09:10 +0000 |
parents | ae7c762775cd |
children | ece2d1543b20 |
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)); | |
9 sflap_send(entry_text, strlen(entry_text), TYPE_DATA); | |
10 } | |
11 | |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
12 void destroy_callback(GtkWidget *widget, void *handle) { |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
13 gtk_widget_destroy(widget); |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
14 gaim_plugin_unload(handle); |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
15 } |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
16 |
179 | 17 GtkWidget *window; |
18 void gaim_plugin_init(void *h) { | |
19 GtkWidget *entry; | |
20 | |
21 window = gtk_window_new(GTK_WINDOW_DIALOG); | |
22 gtk_window_set_title(GTK_WINDOW(window), "Gaim - SFLAP interface"); | |
23 | |
24 entry = gtk_entry_new(); | |
25 gtk_signal_connect(GTK_OBJECT(entry), "activate", | |
26 (GtkSignalFunc)enter_callback, | |
27 entry); | |
28 gtk_container_add(GTK_CONTAINER(window), entry); | |
29 gtk_widget_show(entry); | |
30 | |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
31 gtk_signal_connect(GTK_OBJECT(window), "destroy", |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
32 (GtkSignalFunc)destroy_callback, |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
33 h); |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
179
diff
changeset
|
34 |
179 | 35 gtk_widget_show(window); |
36 } | |
37 | |
38 void gaim_plugin_remove() { | |
39 gtk_widget_destroy(window); | |
40 } | |
41 | |
42 char *name() { | |
43 return "TOC Interface"; | |
44 } | |
45 | |
46 char *description() { | |
47 return "Allows you to talk directly to the TOC server, bypassing gaim."; | |
48 } |