annotate plugins/raw.c @ 5205:fefad67de2c7

[gaim-migrate @ 5573] I had a damn good commit message, but it was eaten. Let's try it again. Announcing, Gaim Plugin API version 2.0, or GPAPIV2.0 for short. There are lots'a cool thingies here. Okay now, this isn't as cool as the previous message, but: 1) There's now a single entry function for all plugin types. It returns a detailed information structure on the plugin. This removes a lot of the ugliness from old plugins. Oh yeah, libicq wasn't converted to this, so if you use it, well, you shouldn't have used it anyway, but now you can't! bwahahaha. Use AIM/ICQ. 2) There are now 3 types of plugins: Standard, Loader, and Protocol plugins. Standard plugins are, well, standard, compiled plugins. Loader plugins load other plugins. For example, the perl support is now a loader plugin. It loads perl scripts. In the future, we'll have Ruby and Python loader plugins. Protocol plugins are, well, protocol plugins... yeah... 3) Plugins have unique IDs, so they can be referred to or automatically updated from a plugin database in the future. Neat, huh? 4) Plugins will have dependency support in the future, and can be hidden, so if you have, say, a logging core plugin, it won't have to show up, but then you load the GTK+ logging plugin and it'll auto-load the core plugin. Core/UI split plugins! 5) There will eventually be custom plugin signals and RPC of some sort, for the core/ui split plugins. So, okay, back up .gaimrc. I'd like to thank my parents for their support, javabsp for helping convert a bunch of protocol plugins, and Etan for helping convert a bunch of standard plugins. Have fun. If you have any problems, please let me know, but you probably won't have anything major happen. You will have to convert your plugins, though, and I'm not guaranteeing that all perl scripts will still work. I'll end up changing the perl script API eventually, so I know they won't down the road. Don't worry, though. It'll be mass cool. faceprint wants me to just commit the damn code already. So, here we go!!! .. .. I need a massage. From a young, cute girl. Are there any young, cute girls in the audience? IM me plz k thx. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 25 Apr 2003 06:47:33 +0000
parents fac4c73dd5ad
children 6d1707dc8c3d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2495
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 #define GAIM_PLUGINS
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 #include "gaim.h"
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 #include "prpl.h"
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 #ifdef MAX
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5 #undef MAX
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6 #undef MIN
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 #endif
2824
2c39e70dd07c [gaim-migrate @ 2837]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2495
diff changeset
8 #include "protocols/jabber/jabber.h"
2495
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10 static GtkWidget *window = NULL;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11 static GtkWidget *optmenu = NULL;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 static struct gaim_connection *gc = NULL;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13 static GModule *me = NULL;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15 /* this is an evil hack.
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16 * gc->proto_data for Jabber connections can be cast to a jconn *.
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 * gc->proto_data for MSN, TOC, and IRC connections can be cast to an int *.
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18 */
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2824
diff changeset
20 struct gaim_plugin_description desc;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2824
diff changeset
21 struct gaim_plugin_description *gaim_plugin_desc() {
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4655
diff changeset
22 desc.api_version = GAIM_PLUGIN_API_VERSION;
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2824
diff changeset
23 desc.name = g_strdup("Raw Input");
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2824
diff changeset
24 desc.version = g_strdup(VERSION);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2824
diff changeset
25 desc.description = g_strdup("Lets you send raw input to text-vased protocols (Jabber, MSN, IRC, TOC). Hit 'Enter' in the entry box to send. Watch the debug window.");
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2824
diff changeset
26 desc.authors = g_strdup("Eric Warmehoven &lt;eric@warmenhoven.org>");
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2824
diff changeset
27 desc.url = g_strdup(WEBSITE);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2824
diff changeset
28 return &desc;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2824
diff changeset
29 }
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2824
diff changeset
30
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2824
diff changeset
31
2495
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32 char *name()
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33 {
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34 return "Raw";
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 }
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37 char *description()
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 {
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 return "Lets you send raw XML to Jabber, or raw commands to MSN, IRC, and TOC."
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40 " Not very useful except for debugging. Hit 'enter' in the entry to send."
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 " Watch the debug window.";
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 }
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44 static int goodbye()
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45 {
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4655
diff changeset
46 gaim_plugin_unload_self(me);
2495
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 return FALSE;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48 }
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50 static void send_it(GtkEntry *entry)
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51 {
4655
fac4c73dd5ad [gaim-migrate @ 4966]
Nathan Walp <nwalp@pidgin.im>
parents: 4165
diff changeset
52 const char *txt;
2495
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53 if (!gc) return;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
54 txt = gtk_entry_get_text(entry);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
55 switch (gc->protocol) {
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
56 case PROTO_TOC:
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 {
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
58 int *a = (int *)gc->proto_data;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
59 unsigned short seqno = htons(a[1]++ & 0xffff);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60 unsigned short len = htons(strlen(txt) + 1);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
61 write(*a, "*\002", 2);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62 write(*a, &seqno, 2);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63 write(*a, &len, 2);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64 write(*a, txt, ntohs(len));
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65 debug_printf("TOC C: %s\n", txt);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66 }
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67 break;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
68 case PROTO_MSN:
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
69 write(*(int *)gc->proto_data, txt, strlen(txt));
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70 write(*(int *)gc->proto_data, "\r\n", 2);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
71 debug_printf("MSN C: %s\n", txt);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
72 break;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
73 case PROTO_IRC:
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 write(*(int *)gc->proto_data, txt, strlen(txt));
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75 write(*(int *)gc->proto_data, "\r\n", 2);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76 debug_printf("IRC C: %s\n", txt);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77 break;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78 case PROTO_JABBER:
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
79 jab_send_raw(*(jconn *)gc->proto_data, txt);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
80 break;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
81 }
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
82 gtk_entry_set_text(entry, "");
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
83 }
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
84
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
85 static void set_gc(gpointer d, struct gaim_connection *c)
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
86 {
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
87 gc = c;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
88 }
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
89
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
90 static void redo_optmenu(struct gaim_connection *arg, gpointer x)
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
91 {
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
92 GtkWidget *menu;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
93 GSList *g = connections;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
94 struct gaim_connection *c;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
95
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
96 menu = gtk_menu_new();
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
97 gc = NULL;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
98
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
99 while (g) {
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
100 char buf[256];
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
101 GtkWidget *opt;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
102 c = (struct gaim_connection *)g->data;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
103 g = g->next;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
104 if (x && c == arg)
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
105 continue;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
106 if (c->protocol != PROTO_TOC && c->protocol != PROTO_MSN &&
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
107 c->protocol != PROTO_IRC && c->protocol != PROTO_JABBER)
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
108 continue;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109 if (!gc)
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
110 gc = c;
4655
fac4c73dd5ad [gaim-migrate @ 4966]
Nathan Walp <nwalp@pidgin.im>
parents: 4165
diff changeset
111 g_snprintf(buf, sizeof buf, "%s (%s)", c->username, c->prpl->name);
2495
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
112 opt = gtk_menu_item_new_with_label(buf);
4165
07a3d1fae88f [gaim-migrate @ 4394]
Christian Hammond <chipx86@chipx86.com>
parents: 3551
diff changeset
113 g_signal_connect(GTK_OBJECT(opt), "activate", G_CALLBACK(set_gc), c);
2495
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
114 gtk_widget_show(opt);
4655
fac4c73dd5ad [gaim-migrate @ 4966]
Nathan Walp <nwalp@pidgin.im>
parents: 4165
diff changeset
115 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
2495
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
116 }
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
117
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
118 gtk_option_menu_remove_menu(GTK_OPTION_MENU(optmenu));
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
119 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
120 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), 0);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
121 }
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
122
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
123 char *gaim_plugin_init(GModule *h)
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
124 {
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
125 GtkWidget *hbox;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
126 GtkWidget *entry;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
127
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
128 me = h;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
129
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
130 gaim_signal_connect(h, event_signon, redo_optmenu, NULL);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
131 gaim_signal_connect(h, event_signoff, redo_optmenu, me);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
132
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
133 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
4165
07a3d1fae88f [gaim-migrate @ 4394]
Christian Hammond <chipx86@chipx86.com>
parents: 3551
diff changeset
134 g_signal_connect(GTK_OBJECT(window), "delete_event", G_CALLBACK(goodbye), NULL);
2495
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
135
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
136 hbox = gtk_hbox_new(FALSE, 0);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
137 gtk_container_add(GTK_CONTAINER(window), hbox);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
138
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
139 optmenu = gtk_option_menu_new();
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
140 gtk_box_pack_start(GTK_BOX(hbox), optmenu, FALSE, FALSE, 5);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
141
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
142 redo_optmenu(NULL, NULL);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
143
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
144 entry = gtk_entry_new();
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
145 gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 5);
4165
07a3d1fae88f [gaim-migrate @ 4394]
Christian Hammond <chipx86@chipx86.com>
parents: 3551
diff changeset
146 g_signal_connect(GTK_OBJECT(entry), "activate", G_CALLBACK(send_it), NULL);
2495
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
147
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
148 gtk_widget_show_all(window);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
149
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
150 return NULL;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
151 }
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
152
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
153 void gaim_plugin_remove()
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
154 {
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
155 if (window)
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
156 gtk_widget_destroy(window);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
157 window = NULL;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
158 me = NULL;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
159 }