Mercurial > pidgin
annotate plugins/toc_commands.c @ 882:557a4a9cda3f
[gaim-migrate @ 892]
Just getting 0.10.1 ready :-P
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Mon, 11 Sep 2000 09:49:28 +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 } |