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
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));
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
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
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
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20 GtkWidget *entry;
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21
1956
c9c20663e05b [gaim-migrate @ 1966]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1943
diff changeset
22 window = gtk_window_new(GTK_WINDOW_DIALOG);
179
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23 gtk_window_set_title(GTK_WINDOW(window), "Gaim - SFLAP interface");
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 entry = gtk_entry_new();
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 gtk_signal_connect(GTK_OBJECT(entry), "activate",
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 (GtkSignalFunc)enter_callback,
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28 entry);
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29 gtk_container_add(GTK_CONTAINER(window), entry);
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 gtk_widget_show(entry);
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 }
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 void gaim_plugin_remove() {
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 gtk_widget_destroy(window);
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43 }
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45 char *name() {
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 return "TOC Interface";
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 }
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49 char *description() {
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50 return "Allows you to talk directly to the TOC server, bypassing gaim.";
8d8faeab01f6 [gaim-migrate @ 189]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51 }