annotate plugins/raw.c @ 4530:cbdc0fc5c3c6

[gaim-migrate @ 4808] Carl-Daniel Hailfinger (c-d_hailfinger) writes: "Currently, we abort if we encounter an empty line in the reply from the server. (My fault, I coded it) Since I do not know whether the original Gadu-gadu client will save buddy lists with an empty line in between, skip such a line and continue. Possible harm done: none" committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 05 Feb 2003 13:47:28 +0000
parents 07a3d1fae88f
children fac4c73dd5ad
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() {
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2824
diff changeset
22 desc.api_version = PLUGIN_API_VERSION;
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 {
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 gaim_plugin_unload(me);
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 {
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52 char *txt;
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;
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
111 g_snprintf(buf, sizeof buf, "%s (%s)", c->username, (*c->prpl->name)());
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);
b46e8a80da4f [gaim-migrate @ 2508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
115 gtk_menu_append(GTK_MENU(menu), opt);
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 }