annotate plugins/toc_commands.c @ 220:d25b1484011b

[gaim-migrate @ 230] Woo committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Sun, 07 May 2000 01:04:28 +0000
parents 8d8faeab01f6
children ae7c762775cd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
179
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 #define GAIM_PLUGINS
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 #include "gaim.h"
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 #include <gtk/gtk.h>
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6 void enter_callback(GtkWidget *widget, GtkWidget *entry) {
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 gchar *entry_text;
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 entry_text = gtk_entry_get_text(GTK_ENTRY(entry));
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 sflap_send(entry_text, strlen(entry_text), TYPE_DATA);
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10 }
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 GtkWidget *window;
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13 void gaim_plugin_init(void *h) {
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14 GtkWidget *entry;
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16 window = gtk_window_new(GTK_WINDOW_DIALOG);
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 gtk_window_set_title(GTK_WINDOW(window), "Gaim - SFLAP interface");
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19 entry = gtk_entry_new();
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20 gtk_signal_connect(GTK_OBJECT(entry), "activate",
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 (GtkSignalFunc)enter_callback,
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22 entry);
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23 gtk_container_add(GTK_CONTAINER(window), entry);
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24 gtk_widget_show(entry);
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 gtk_widget_show(window);
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 }
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29 void gaim_plugin_remove() {
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 gtk_widget_destroy(window);
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31 }
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33 char *name() {
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34 return "TOC Interface";
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 }
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37 char *description() {
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 return "Allows you to talk directly to the TOC server, bypassing gaim.";
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 }