annotate src/conversation.c @ 794:80274f969a09

[gaim-migrate @ 804] fa la la la la, la la la la committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 29 Aug 2000 22:50:42 +0000
parents 9d5e7e987103
children b4071be71eb4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 *
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * (at your option) any later version.
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 *
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * GNU General Public License for more details.
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 *
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 *
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 344
diff changeset
22 #ifdef HAVE_CONFIG_H
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 344
diff changeset
23 #include "../config.h"
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 344
diff changeset
24 #endif
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #include <string.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 #include <sys/time.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 #include <sys/types.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 #include <sys/stat.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 #include <unistd.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 #include <stdio.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31 #include <stdlib.h>
210
ec0686b3b03f [gaim-migrate @ 220]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 209
diff changeset
32 #include <ctype.h>
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include <gtk/gtk.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include "gtkhtml.h"
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include <gdk/gdkkeysyms.h>
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
36 #include "convo.h"
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
37
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
38 #include "pixmaps/underline.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
39 #include "pixmaps/bold.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
40 #include "pixmaps/italic.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
41 #include "pixmaps/small.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
42 #include "pixmaps/normal.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
43 #include "pixmaps/big.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
44 #include "pixmaps/fontface.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
45 #include "pixmaps/speaker.xpm"
790
9d5e7e987103 [gaim-migrate @ 800]
Rob Flynn <gaim@robflynn.com>
parents: 780
diff changeset
46 #include "pixmaps/smile_icon.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
47 #include "pixmaps/wood.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
48 #include "pixmaps/palette.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
49 #include "pixmaps/link.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
50 #include "pixmaps/strike.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
51
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
52 #include "pixmaps/angel.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
53 #include "pixmaps/bigsmile.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
54 #include "pixmaps/burp.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
55 #include "pixmaps/crossedlips.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
56 #include "pixmaps/cry.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
57 #include "pixmaps/embarrassed.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
58 #include "pixmaps/kiss.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
59 #include "pixmaps/moneymouth.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
60 #include "pixmaps/sad.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
61 #include "pixmaps/scream.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
62 #include "pixmaps/smile.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
63 #include "pixmaps/smile8.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
64 #include "pixmaps/think.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
65 #include "pixmaps/tongue.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
66 #include "pixmaps/wink.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
67 #include "pixmaps/yell.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
68 #include "pixmaps/luke03.xpm"
610
cadb51c068cb [gaim-migrate @ 620]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
69 #include "pixmaps/oneeye.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
70
623
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
71 #include "pixmaps/tmp_send.xpm"
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
72 #include "pixmaps/gnome_remove.xpm"
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
73 #include "pixmaps/gnome_add.xpm"
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
74 #include "pixmaps/cancel.xpm"
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
75 #include "pixmaps/warn.xpm"
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
76 #include "pixmaps/tb_search.xpm"
661
31384b25f7b6 [gaim-migrate @ 671]
Rob Flynn <gaim@robflynn.com>
parents: 654
diff changeset
77 #include "pixmaps/block.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
78
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
79 int state_lock=0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
80
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
81 GdkPixmap *dark_icon_pm = NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
82 GdkBitmap *dark_icon_bm = NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
83
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
84 char fontface[64];
697
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 688
diff changeset
85 GdkColor bgcolor;
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 688
diff changeset
86 GdkColor fgcolor;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
87
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
88 void check_everything(GtkWidget *entry);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
89 gboolean keypress_callback(GtkWidget *entry, GdkEventKey *event, struct conversation *c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
90
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
92 /* Helpers */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
93 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
94
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
95
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
96 void quiet_set(GtkWidget *tb, int state)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
97 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
98 state_lock=1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
99 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(tb), state);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
100 state_lock=0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
101 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
102
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
103
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
104 void set_state_lock(int i)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
105 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
106 state_lock = i;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
107 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
108
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
109 void toggle_sensitive(GtkWidget *widget, GtkWidget *to_toggle)
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
110 {
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
111 gboolean sensitivity = GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(to_toggle));
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
112
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
113 if (sensitivity == TRUE)
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
114 gtk_widget_set_sensitive(GTK_WIDGET(to_toggle), FALSE);
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
115 else
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
116 gtk_widget_set_sensitive(GTK_WIDGET(to_toggle), TRUE);
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
117
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
118 return;
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
119 }
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
120
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
121 struct conversation *new_conversation(char *name)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
122 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
124
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
125 c = find_conversation(name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
126
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
127 if (c != NULL)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
128 return c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
129
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
130 c = (struct conversation *)g_new0(struct conversation, 1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
131 g_snprintf(c->name, sizeof(c->name), "%s", name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
132
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
133 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
134 FILE *fd;
70
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 68
diff changeset
135
373
1d29321843b0 [gaim-migrate @ 383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 363
diff changeset
136 fd = open_log_file(c->name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
137 if (!(general_options & OPT_GEN_STRIP_HTML))
70
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 68
diff changeset
138 fprintf(fd, "<HR><BR><H3 Align=Center> ---- New Conversation @ %s ----</H3><BR>\n", full_date());
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
139 else
70
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 68
diff changeset
140 fprintf(fd, " ---- New Conversation @ %s ----\n", full_date());
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 68
diff changeset
141
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
142 fclose(fd);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
143 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
144
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
145 show_conv(c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
146 conversations = g_list_append(conversations, c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
147 return c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
148 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
149
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
150
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
151 struct conversation *find_conversation(char *name)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
152 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
153 char *cuser = g_malloc(64);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
154 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
155 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
156
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
157 strcpy(cuser, normalize(name));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
158
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
159 while(cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
160 c = (struct conversation *)cnv->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
161 if(!strcasecmp(cuser, normalize(c->name))) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
162 g_free(cuser);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
163 return c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
164 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
165 cnv = cnv->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
166 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
167 g_free(cuser);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
168 return NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
169 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
170
516
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
171 void make_direct(struct conversation *c, gboolean direct, struct aim_conn_t *conn, gint watcher)
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
172 {
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
173 char buf[BUF_LONG];
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
174 if (c == NULL) return;
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
175 c->is_direct = direct;
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
176 if (direct) {
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
177 c->conn = conn;
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
178 c->watcher = watcher;
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
179 g_snprintf(buf, sizeof buf, _("<HR><B>Direct Connection with %s established.</B><BR><HR>"),
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
180 c->name);
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
181 write_to_conv(c, buf, WFLAG_SYSTEM, NULL);
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
182 } else {
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
183 c->conn = NULL;
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
184 gdk_input_remove(c->watcher);
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
185 c->watcher = -1;
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
186 g_snprintf(buf, sizeof buf, _("<HR><B>Direct Connection with %s closed.</B><BR><HR>"),
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
187 c->name);
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
188 write_to_conv(c, buf, WFLAG_SYSTEM, NULL);
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
189 }
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
190 }
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
191
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
192 /* ---------------------------------------------------
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
193 * Function to remove a log file entry
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
194 * ---------------------------------------------------
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
195 */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
196
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
197 void rm_log(struct log_conversation *a)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
198 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
199 struct conversation *cnv = find_conversation(a->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
200 char buf[128];
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
201
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
202 log_conversations = g_list_remove(log_conversations, a);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
203
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
204 save_prefs();
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
205
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
206 if (cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
207 if (!(general_options & OPT_GEN_LOG_ALL))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
208 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, cnv->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
209 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
210 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, cnv->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
211 gtk_window_set_title(GTK_WINDOW(cnv->window), buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
212 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
213 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
214
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
215 struct log_conversation *find_log_info(char *name)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
216 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
217 char *pname = g_malloc(64);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
218 GList *lc = log_conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
219 struct log_conversation *l;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
220
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
221
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
222 strcpy(pname, normalize(name));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
223
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
224 while(lc) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
225 l = (struct log_conversation *)lc->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
226 if (!strcasecmp(pname, normalize(l->name))) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
227 g_free(pname);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
228 return l;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
229 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
230 lc = lc->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
231 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
232 g_free(pname);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
233 return NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
234 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
235
625
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
236 void delete_conversation(struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
237 {
625
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
238 conversations = g_list_remove(conversations, c);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
239 if (c->color_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
240 gtk_widget_destroy(c->color_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
241 if (c->font_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
242 gtk_widget_destroy(c->font_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
243 if (c->smiley_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
244 gtk_widget_destroy(c->smiley_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
245 if (c->link_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
246 gtk_widget_destroy(c->link_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
247 if (c->log_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
248 gtk_widget_destroy(c->log_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
249 g_free(c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
250 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
251
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
252 void update_log_convs()
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
253 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
254 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
255 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
256
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
257 while(cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
258 c = (struct conversation *)cnv->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
259
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
260 if (c->log_button)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
261 gtk_widget_set_sensitive(c->log_button, ((general_options & OPT_GEN_LOG_ALL)) ? FALSE : TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
262
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
263 cnv = cnv->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
264 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
265
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
266 cnv = buddy_chats;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
267 while(cnv) {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
268 c = (struct conversation *)cnv->data;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
269
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
270 if (c->log_button)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
271 gtk_widget_set_sensitive(c->log_button, ((general_options & OPT_GEN_LOG_ALL)) ? FALSE : TRUE);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
272
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
273 cnv = cnv->next;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
274 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
275 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
276
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
277 void update_font_buttons()
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
278 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
279 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
280 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
281
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
282 while (cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
283 c = (struct conversation *)cnv->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
284
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
285 if (c->bold)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
286 gtk_widget_set_sensitive(c->bold, ((font_options & OPT_FONT_BOLD)) ? FALSE : TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
287
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
288 if (c->italic)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
289 gtk_widget_set_sensitive(c->italic, ((font_options & OPT_FONT_ITALIC)) ? FALSE : TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
290
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
291 if (c->underline)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
292 gtk_widget_set_sensitive(c->underline, ((font_options & OPT_FONT_UNDERLINE)) ? FALSE : TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
293
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
294 if (c->strike)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
295 gtk_widget_set_sensitive(c->strike, ((font_options & OPT_FONT_STRIKE)) ? FALSE : TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
296
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
297 cnv = cnv->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
298 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
299 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
300
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
301 /*
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
302 void update_transparency()
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
303 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
304 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
305 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
306
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
307 This func should be uncalled!
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
308
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
309 while(cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
310 c = (struct conversation *)cnv->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
311
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
312 if (c->text)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
313 gtk_html_set_transparent(GTK_HTML(c->text),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
314 (transparent) ? TRUE : FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
315
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
316 cnv = cnv->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
317 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
318 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
319 */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
320
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
321
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
322 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
323 /* Callbacks */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
324 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
325
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
326 void toggle_loggle(GtkWidget *loggle, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
327 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
328 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
329 return;
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
330 if (find_log_info(c->name))
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
331 rm_log(find_log_info(c->name));
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
332 else if (GTK_TOGGLE_BUTTON(loggle)->active)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
333 show_log_dialog(c);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
334 else
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
335 cancel_log(NULL, c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
336 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
337
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
338 void insert_smiley(GtkWidget *smiley, struct conversation *c)
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
339 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
340 if (state_lock)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
341 return;
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
342 if (GTK_TOGGLE_BUTTON(smiley)->active)
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
343 show_smiley_dialog(c, smiley);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
344 else if (c->smiley_dialog)
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
345 close_smiley_dialog(smiley, c);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
346
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
347 return;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
348 }
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
349
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
350 int close_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
351 {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
352 if (c->window)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
353 gtk_widget_destroy(c->window);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
354 c->window = NULL;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
355
625
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
356 if (c->color_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
357 gtk_widget_destroy(c->color_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
358 c->color_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
359 if (c->font_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
360 gtk_widget_destroy(c->font_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
361 c->font_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
362 if (c->smiley_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
363 gtk_widget_destroy(c->smiley_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
364 c->smiley_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
365 if (c->link_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
366 gtk_widget_destroy(c->link_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
367 c->link_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
368 if (c->log_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
369 gtk_widget_destroy(c->log_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
370 c->log_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
371
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
372 if (c->is_chat) {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
373 serv_chat_leave(c->id);
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
374 } else {
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
375 if (c->is_direct) {
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
376 if (!USE_OSCAR) {
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
377 /* FIXME */
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
378 } else {
515
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
379 gdk_input_remove(c->watcher);
700
d904bf694bd7 [gaim-migrate @ 710]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
380 sprintf(debug_buff, "Closing DirectIM conversation (%p)\n", c->conn);
515
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
381 debug_print(debug_buff);
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
382 aim_conn_kill(gaim_sess, &c->conn);
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
383 }
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
384 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
385 delete_conversation(c);
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
386 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
387
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
388 return TRUE;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
389 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
390
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
391 void set_font_face(char *newfont, struct conversation *c)
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
392 {
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
393 char *pre_fontface;
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
394 int alloc = 1;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
395
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
396 pre_fontface = g_strconcat("<FONT FACE=\"", newfont, "\">", '\0');
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
397
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
398 if (!strcmp(pre_fontface, "<FONT FACE=\"\">"))
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
399 {
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
400 g_free(pre_fontface);
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
401 alloc--;
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
402 pre_fontface = "<FONT FACE=\"Helvetica\">";
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
403 }
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
404
687
02ef523db170 [gaim-migrate @ 697]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 666
diff changeset
405 sprintf(c->fontface, "%s", newfont ? (newfont[0] ? newfont : "Helvetica") : "Helvetica");
688
6b1345121dd3 [gaim-migrate @ 698]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 687
diff changeset
406 c->hasfont = 1;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
407 surround(c->entry, pre_fontface, "</FONT>");
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
408 gtk_widget_grab_focus(c->entry);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
409
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
410 if (alloc)
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
411 g_free(pre_fontface);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
412 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
413
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
414 static gint delete_event_convo(GtkWidget *w, GdkEventAny *e, struct conversation *c)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
415 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
416 delete_conversation(c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
417 return FALSE;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
418 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
419
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
420 void add_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
421 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
422 if (find_buddy(c->name) != NULL) {
769
c075cf268129 [gaim-migrate @ 779]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 756
diff changeset
423 gboolean dispstyle = (display_options & OPT_DISP_CONV_SHOW_TEXT) ? TRUE : FALSE;
654
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 650
diff changeset
424 GtkWidget *parent = c->add_button->parent;
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
425 sprintf(debug_buff,_("Removing '%s' from buddylist.\n"), c->name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
426 debug_print(debug_buff);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
427 remove_buddy(find_group_by_buddy(c->name), find_buddy(c->name));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
428 build_edit_tree();
654
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 650
diff changeset
429 gtk_widget_destroy(c->add_button);
769
c075cf268129 [gaim-migrate @ 779]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 756
diff changeset
430 c->add_button = picture_button2(c->window, _("Add"), gnome_add_xpm, dispstyle);
654
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 650
diff changeset
431 gtk_signal_connect(GTK_OBJECT(c->add_button), "clicked", GTK_SIGNAL_FUNC(add_callback), c);
769
c075cf268129 [gaim-migrate @ 779]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 756
diff changeset
432 gtk_box_pack_end(GTK_BOX(parent), c->add_button, dispstyle, dispstyle, 0);
654
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 650
diff changeset
433 gtk_box_reorder_child(GTK_BOX(parent), c->add_button, 1);
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 650
diff changeset
434 gtk_widget_show(c->add_button);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
435 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
436 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
437 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
438 show_add_buddy(c->name, NULL);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
439 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
440
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
441 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
442 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
443
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
444
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
445 void block_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
446 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
447 show_add_perm(c->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
448 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
449 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
450
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
451 void warn_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
452 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
453 show_warn_dialog(c->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
454 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
455 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
456
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
457 void info_callback(GtkWidget *w, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
458 {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
459 if (c->is_chat) {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
460 char *name;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
461 GList *i;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
462
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
463 i = GTK_LIST(c->list)->selection;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
464 if (i)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
465 name = (char *)gtk_object_get_user_data(GTK_OBJECT(i->data));
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
466 else
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
467 return;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
468
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
469 serv_get_info(name);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
470 } else {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
471 serv_get_info(c->name);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
472 gtk_widget_grab_focus(c->entry);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
473 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
474 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
475
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
476 gboolean keypress_callback(GtkWidget *entry, GdkEventKey *event, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
477 {
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
478 int pos;
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
479 if(event->keyval==GDK_Return) {
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
480 if(!(event->state & GDK_SHIFT_MASK)
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
481 && (general_options & OPT_GEN_ENTER_SENDS)) {
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
482 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c);
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
483 //to stop the putting in of the enter character
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
484 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
485 } else {
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
486 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
487 pos=gtk_editable_get_position(GTK_EDITABLE(entry));
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
488 gtk_editable_insert_text(GTK_EDITABLE(entry), "\n", 1, &pos);
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
489 }
575
a33616e4e48d [gaim-migrate @ 585]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 573
diff changeset
490 } else if ((event->state & GDK_CONTROL_MASK)
a33616e4e48d [gaim-migrate @ 585]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 573
diff changeset
491 && (general_options & OPT_GEN_CTL_CHARS)) {
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
492 switch (event->keyval) {
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
493 case 'i':
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
494 quiet_set(c->italic, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->italic)));
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
495 do_italic(c->italic, c->entry);
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
496 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
497 break;
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
498 case 'u': /* ctl-u is GDK_Clear, which clears the line */
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
499 quiet_set(c->underline, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->underline)));
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
500 do_underline(c->underline, c->entry);
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
501 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
502 break;
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
503 case 'b': /* ctl-b is GDK_Left, which moves backwards */
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
504 quiet_set(c->bold, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->bold)));
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
505 do_bold(c->bold, c->entry);
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
506 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
507 break;
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
508 case 's':
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
509 quiet_set(c->strike, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->strike)));
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
510 do_strike(c->strike, c->entry);
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
511 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
512 break;
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
513 }
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
514 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
515
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
516 return TRUE;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
517
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
518 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
519
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
520
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
521 void send_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
522 {
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
523 char *buf, *buf2, *buf3;
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
524 int hdrlen, limit;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
525
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
526 if (c->is_direct) limit = 0x1ffffff;
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
527 else if (c->is_chat && USE_OSCAR) limit = MAXCHATMSGLEN;
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
528 else if (USE_OSCAR) limit = MAXMSGLEN;
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
529 else limit = MSG_LEN;
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
530 limit <<= 2;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
531
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
532 buf = g_malloc(limit);
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
533
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
534 buf2 = gtk_editable_get_chars(GTK_EDITABLE(c->entry), 0, -1);
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
535 g_snprintf(buf, limit, "%s", buf2);
753
cd62f69d187e [gaim-migrate @ 763]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 745
diff changeset
536 g_free(buf2);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
537 gtk_editable_delete_text(GTK_EDITABLE(c->entry), 0, -1);
753
cd62f69d187e [gaim-migrate @ 763]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 745
diff changeset
538 if (!strlen(buf)) return;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
539
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
540 if (general_options & OPT_GEN_SEND_LINKS)
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
541 linkify_text(buf);
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
542
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
543 buf2 = g_malloc(limit);
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
544
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
545 /* Let us determine how long the message CAN be.
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
546 * toc_send_im is 11 chars long + 2 quotes.
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
547 * + 2 spaces + 6 for the header + 2 for good
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
548 * measure = 23 bytes + the length of normalize c->name */
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
549 if (!USE_OSCAR)
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
550 hdrlen = 23 + strlen(normalize(c->name));
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
551 else
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
552 hdrlen = 0;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
553
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
554 if (font_options & OPT_FONT_BOLD) {
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
555 g_snprintf(buf2, limit, "<B>%s</B>", buf);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
556 strcpy(buf, buf2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
557 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
558
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
559 if (font_options & OPT_FONT_ITALIC) {
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
560 g_snprintf(buf2, limit, "<I>%s</I>", buf);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
561 strcpy(buf, buf2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
562 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
563
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
564 if (font_options & OPT_FONT_UNDERLINE) {
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
565 g_snprintf(buf2, limit, "<U>%s</U>", buf);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
566 strcpy(buf, buf2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
567 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
568
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
569 if (font_options & OPT_FONT_STRIKE) {
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
570 g_snprintf(buf2, limit, "<STRIKE>%s</STRIKE>", buf);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
571 strcpy(buf, buf2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
572 }
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
573
688
6b1345121dd3 [gaim-migrate @ 698]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 687
diff changeset
574 if ((font_options & OPT_FONT_FACE) || c->hasfont) {
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
575 g_snprintf(buf2, limit, "<FONT FACE=\"%s\">%s</FONT>", c->fontface, buf);
488
0fcb7e7a263c [gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 474
diff changeset
576 strcpy(buf, buf2);
0fcb7e7a263c [gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 474
diff changeset
577 }
0fcb7e7a263c [gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 474
diff changeset
578
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
579 if ((font_options & OPT_FONT_FGCOL) || c->hasfg) {
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
580 g_snprintf(buf2, limit, "<FONT COLOR=\"#%02X%02X%02X\">%s</FONT>", c->fgcol.red, c->fgcol.green, c->fgcol.blue, buf);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
581 strcpy(buf, buf2);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
582 }
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
583
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
584 if ((font_options & OPT_FONT_BGCOL) || c->hasbg) {
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
585 g_snprintf(buf2, limit, "<BODY BGCOLOR=\"#%02X%02X%02X\">%s</BODY>", c->bgcol.red, c->bgcol.green, c->bgcol.blue, buf);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
586 strcpy(buf, buf2);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
587 }
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
588
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
589 {
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
590 char *buffy = g_strdup(buf);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
591 enum gaim_event evnt = c->is_chat ? event_chat_send : event_im_send;
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 773
diff changeset
592 plugin_event(evnt, c->name, &buffy, 0);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
593 if (!buffy) {
102
8c301530b2a3 [gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 101
diff changeset
594 g_free(buf2);
8c301530b2a3 [gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 101
diff changeset
595 return;
8c301530b2a3 [gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 101
diff changeset
596 }
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
597 g_snprintf(buf, limit, "%s", buffy);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
598 g_free(buffy);
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
599 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
600
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
601 if (!c->is_chat) {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
602 buf3 = g_strdup(buf);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
603 write_to_conv(c, buf3, WFLAG_SEND, NULL);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
604 g_free(buf3);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
605 escape_text(buf);
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
606 if (escape_message(buf) > limit/4 - hdrlen)
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
607 do_error_dialog(_("Message too long, some data truncated."), _("Error"));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
608
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
609 serv_send_im(c->name, buf, 0);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
610
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
611 if (c->makesound && (sound_options & OPT_SOUND_SEND))
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
612 play_sound(SEND);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
613 } else {
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
614 serv_chat_send(c->id, buf); /* this does escape_text for us */
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
615
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
616 /* no sound because we do that when we receive our message */
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
617 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
618
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
619 quiet_set(c->bold, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
620 quiet_set(c->strike, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
621 quiet_set(c->italic, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
622 quiet_set(c->underline, FALSE);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
623 quiet_set(c->font, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
624 quiet_set(c->palette, FALSE);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
625 quiet_set(c->link, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
626
375
1eae69f076d2 [gaim-migrate @ 385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 373
diff changeset
627 if ((general_options & OPT_GEN_BACK_ON_IM) && awaymessage != NULL) {
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
628 do_im_back();
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
629 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
630
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
631 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
632 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
633
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
634 static int
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
635 entry_key_pressed(GtkWidget *w, GtkWidget *entry)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
636 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
637 check_everything(w);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
638 return TRUE;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
639 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
640
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
641 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
642 /* HTML-type stuff */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
643 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
644
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
645 int count_tag(GtkWidget *entry, char *s1, char *s2)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
646 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
647 char *p1, *p2;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
648 int res=0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
649 char *tmp, *tmpo, h;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
650 tmpo = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
651 h = tmpo[GTK_EDITABLE(entry)->current_pos];
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
652 tmpo[GTK_EDITABLE(entry)->current_pos]='\0';
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
653 tmp=tmpo;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
654 do {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
655 p1 = strstr(tmp, s1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
656 p2 = strstr(tmp, s2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
657 if (p1 && p2) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
658 if (p1 < p2) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
659 res=1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
660 tmp = p1 +strlen(s1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
661 } else if (p2 < p1) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
662 res = 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
663 tmp = p2 + strlen(s2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
664 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
665 } else {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
666 if (p1) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
667 res = 1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
668 tmp = p1 + strlen(s1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
669 } else if (p2) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
670 res = 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
671 tmp = p2 + strlen(s2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
672 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
673 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
674 } while (p1 || p2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
675 tmpo[GTK_EDITABLE(entry)->current_pos]=h;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
676 g_free(tmpo);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
677 return res;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
678 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
679
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
680
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
681 int invert_tags(GtkWidget *entry, char *s1, char *s2, int really)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
682 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
683 int start = GTK_EDITABLE(entry)->selection_start_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
684 int finish = GTK_EDITABLE(entry)->selection_end_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
685 char *s;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
686
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
687 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
688 if (!strncasecmp(&s[start], s1, strlen(s1)) &&
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
689 !strncasecmp(&s[finish - strlen(s2)], s2, strlen(s2))) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
690 if (really) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
691 gtk_editable_delete_text(GTK_EDITABLE(entry), start, start + strlen(s1));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
692 gtk_editable_delete_text(GTK_EDITABLE(entry), finish - strlen(s2) - strlen(s1), finish - strlen(s1));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
693 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
694 g_free(s);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
695 return 1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
696 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
697 g_free(s);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
698 return 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
699 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
700
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
701
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
702 void remove_tags(GtkWidget *entry, char *tag)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
703 {
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
704 char *s, *t;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
705 int start = GTK_EDITABLE(entry)->selection_start_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
706 int finish = GTK_EDITABLE(entry)->selection_end_pos;
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
707 int temp;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
708 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
709 t = s;
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
710
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
711 if (start > finish)
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
712 {
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
713 temp = start;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
714 start = finish;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
715 finish = temp;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
716 }
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
717
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
718 if (strstr(tag, "<FONT SIZE="))
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
719 {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
720 while((t = strstr(t, "<FONT SIZE="))) {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
721 if (((t-s) < finish) && ((t-s) >= start)) {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
722 gtk_editable_delete_text(GTK_EDITABLE(entry), (t-s), (t-s) + strlen(tag));
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
723 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
724 t = s;
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
725 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
726 else t++;
68
03ec647d24e9 [gaim-migrate @ 78]
Rob Flynn <gaim@robflynn.com>
parents: 67
diff changeset
727 }
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
728 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
729 else
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
730 {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
731 while((t = strstr(t, tag))) {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
732 if (((t-s) < finish) && ((t-s) >= start)) {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
733 gtk_editable_delete_text(GTK_EDITABLE(entry), (t-s), (t-s) + strlen(tag));
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
734 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
735 t = s;
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
736 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
737 else t++;
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
738 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
739 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
740 g_free(s);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
741 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
742
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
743 void surround(GtkWidget *entry, char *pre, char *post)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
744 {
649
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
745 int temp, pos = GTK_EDITABLE(entry)->current_pos;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
746 int dummy;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
747 int start, finish;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
748 if (GTK_EDITABLE(entry)->has_selection) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
749 remove_tags(entry, pre);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
750 remove_tags(entry, post);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
751 start = GTK_EDITABLE(entry)->selection_start_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
752 finish = GTK_EDITABLE(entry)->selection_end_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
753 if (start > finish) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
754 dummy = finish;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
755 finish = start;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
756 start = dummy;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
757 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
758 dummy = start;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
759 gtk_editable_insert_text(GTK_EDITABLE(entry), pre, strlen(pre), &dummy);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
760 dummy = finish + strlen(pre);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
761 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
762 gtk_editable_select_region(GTK_EDITABLE(entry), start, finish + strlen(pre) + strlen(post));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
763 } else {
649
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
764 temp = pos;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
765 gtk_editable_insert_text(GTK_EDITABLE(entry), pre, strlen(pre), &pos);
649
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
766 if (temp == pos)
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
767 {
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
768 dummy = pos + strlen(pre);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
769 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
770 gtk_editable_set_position(GTK_EDITABLE(entry), dummy);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
771 }
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
772 else
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
773 {
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
774 dummy = pos;
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
775 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
776 gtk_editable_set_position(GTK_EDITABLE(entry), pos);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
777 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
778 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
779 gtk_widget_grab_focus(entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
780 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
781
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
782 void advance_past(GtkWidget *entry, char *pre, char *post)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
783 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
784 char *s, *s2;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
785 int pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
786 if (invert_tags(entry, pre, post, 1))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
787 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
788 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
789 pos = GTK_EDITABLE(entry)->current_pos;
523
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
790 sprintf(debug_buff, _("Currently at %d, "), pos);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
791 debug_print(debug_buff);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
792 s2= strstr(&s[pos], post);
523
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
793 if (s2) {
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
794 pos = s2 - s + strlen(post);
523
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
795 } else {
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
796 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &pos);
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
797 }
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
798 sprintf(debug_buff, _("Setting position to %d\n"), pos);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
799 debug_print(debug_buff);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
800 gtk_editable_set_position(GTK_EDITABLE(entry), pos);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
801 gtk_widget_grab_focus(entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
802 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
803
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
804 void toggle_color(GtkWidget *color, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
805 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
806 if (state_lock)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
807 return;
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
808 if (GTK_TOGGLE_BUTTON(color)->active)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
809 show_color_dialog(c, color);
563
8d6e2de1fb64 [gaim-migrate @ 573]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 557
diff changeset
810 else if (c->color_dialog)
8d6e2de1fb64 [gaim-migrate @ 573]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 557
diff changeset
811 cancel_color(color, c);
189
50dc3db25513 [gaim-migrate @ 199]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 187
diff changeset
812 else
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
813 advance_past(c->entry, "<FONT COLOR>", "</FONT>" );
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
814 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
815
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
816 void toggle_font(GtkWidget *font, struct conversation *c)
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
817 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
818 if (state_lock)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
819 return;
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
820 if (GTK_TOGGLE_BUTTON(font)->active)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
821 show_font_dialog(c, font);
563
8d6e2de1fb64 [gaim-migrate @ 573]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 557
diff changeset
822 else if (c->font_dialog)
8d6e2de1fb64 [gaim-migrate @ 573]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 557
diff changeset
823 cancel_font(font, c);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
824 else
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
825 advance_past(c->entry, "<FONT FACE>", "</FONT>");
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
826 }
611
0f7e5ff95f71 [gaim-migrate @ 621]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 610
diff changeset
827
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
828 void toggle_link(GtkWidget *linky, struct conversation *c)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
829 {
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
830 if (state_lock)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
831 return;
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
832 if (GTK_TOGGLE_BUTTON(linky)->active)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
833 show_add_link(linky, c);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
834 else if (c->link_dialog)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
835 cancel_link(linky, c);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
836 else
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
837 advance_past(c->entry, "<A HREF>", "</A>");
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
838 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
839
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
840 void do_strike(GtkWidget *strike, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
841 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
842 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
843 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
844 if (GTK_TOGGLE_BUTTON(strike)->active)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
845 surround(entry, "<STRIKE>","</STRIKE>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
846 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
847 advance_past(entry, "<STRIKE>", "</STRIKE>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
848 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
849
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
850 void do_bold(GtkWidget *bold, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
851 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
852 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
853 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
854 if (GTK_TOGGLE_BUTTON(bold)->active)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
855 surround(entry, "<B>","</B>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
856 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
857 advance_past(entry, "<B>", "</B>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
858 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
859
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
860 void do_underline(GtkWidget *underline, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
861 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
862 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
863 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
864 if (GTK_TOGGLE_BUTTON(underline)->active)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
865 surround(entry, "<U>","</U>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
866 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
867 advance_past(entry, "<U>", "</U>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
868 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
869
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
870 void do_italic(GtkWidget *italic, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
871 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
872 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
873 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
874 if (GTK_TOGGLE_BUTTON(italic)->active)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
875 surround(entry, "<I>","</I>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
876 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
877 advance_past(entry, "<I>", "</I>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
878 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
879
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
880 /* html code to modify font sizes must all be the same length, */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
881 /* currently set to 15 chars */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
882
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
883 void do_small(GtkWidget *small, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
884 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
885 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
886 return;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
887 surround(entry, "<FONT SIZE=\"1\">","</FONT>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
888 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
889
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
890 void do_normal(GtkWidget *normal, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
891 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
892 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
893 return;
88
78166fb457f1 [gaim-migrate @ 98]
Rob Flynn <gaim@robflynn.com>
parents: 81
diff changeset
894 surround(entry, "<FONT SIZE=\"3\">","</FONT>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
895 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
896
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
897 void do_big(GtkWidget *big, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
898 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
899 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
900 return;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
901 surround(entry, "<FONT SIZE=\"5\">","</FONT>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
902 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
903
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
904 void check_everything(GtkWidget *entry)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
905 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
906 struct conversation *c;
206
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
907
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
908 c = (struct conversation *)gtk_object_get_user_data(GTK_OBJECT(entry));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
909 if (!c) return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
910 if (invert_tags(entry, "<B>", "</B>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
911 quiet_set(c->bold, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
912 else if (count_tag(entry, "<B>", "</B>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
913 quiet_set(c->bold, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
914 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
915 quiet_set(c->bold,FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
916 if (invert_tags(entry, "<I>", "</I>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
917 quiet_set(c->italic, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
918 else if (count_tag(entry, "<I>", "</I>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
919 quiet_set(c->italic, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
920 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
921 quiet_set(c->italic, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
922
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
923 if (invert_tags(entry, "<FONT COLOR", "</FONT>", 0))
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
924 quiet_set(c->palette, TRUE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
925 else if (count_tag(entry, "<FONT COLOR", "</FONT>"))
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
926 quiet_set(c->palette, TRUE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
927 else
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
928 quiet_set(c->palette, FALSE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
929
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
930 if (invert_tags(entry, "<FONT FACE", "</FONT>", 0))
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
931 quiet_set(c->font, TRUE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
932 else if (count_tag(entry, "<FONT FACE", "</FONT>"))
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
933 quiet_set(c->font, TRUE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
934 else
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
935 quiet_set(c->font, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
936
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
937 if (invert_tags(entry, "<A HREF", "</A>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
938 quiet_set(c->link, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
939 else if (count_tag(entry, "<A HREF", "</A>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
940 quiet_set(c->link, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
941 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
942 quiet_set(c->link, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
943
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
944 if (invert_tags(entry, "<U>", "</U>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
945 quiet_set(c->underline, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
946 else if (count_tag(entry, "<U>", "</U>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
947 quiet_set(c->underline, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
948 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
949 quiet_set(c->underline, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
950
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
951 if (invert_tags(entry, "<STRIKE>", "</STRIKE>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
952 quiet_set(c->strike, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
953 else if (count_tag(entry, "<STRIKE>", "</STRIKE>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
954 quiet_set(c->strike, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
955 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
956 quiet_set(c->strike, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
957 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
958
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
959
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
960 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
961 /* Takin care of the window.. */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
962 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
963
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
964
602
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
965 static GdkPixmap *is_smiley(GtkWidget *window, char *m, int *len) {
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
966 GdkBitmap *mask;
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
967 GdkPixmap *face = NULL;
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
968
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
969 if (strlen(m) < 2) return face;
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
970 *len = 2;
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
971 if ( !strncmp(m, ":)", 2) ||
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
972 !strncmp(m, "=)", 2)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
973 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], smile_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
974 } else if (!strncmp(m, ":(", 2) ||
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
975 !strncmp(m, "=(", 2)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
976 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], sad_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
977 } else if (!strncmp(m, ";)", 2)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
978 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], wink_xpm);
629
ce8d8608d05b [gaim-migrate @ 639]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 628
diff changeset
979 } else if (!strncmp(m, ":p", 2) ||
ce8d8608d05b [gaim-migrate @ 639]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 628
diff changeset
980 !strncmp(m, ":P", 2)) {
ce8d8608d05b [gaim-migrate @ 639]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 628
diff changeset
981 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], tongue_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
982 }
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
983
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
984 if (face || strlen(m) < 3) return face;
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
985 *len = 3;
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
986 if ( !strncmp(m, ":-)", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
987 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], smile_xpm);
610
cadb51c068cb [gaim-migrate @ 620]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
988 } else if (!strncmp(m, "O-)", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
989 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], oneeye_xpm);
551
33f8d91a9e9c [gaim-migrate @ 561]
Rob Flynn <gaim@robflynn.com>
parents: 536
diff changeset
990 } else if (!strncmp(m, "C:)", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
991 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], luke03_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
992 } else if (!strncmp(m, ":-(", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
993 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], sad_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
994 } else if (!strncmp(m, ";-)", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
995 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], wink_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
996 } else if (!strncmp(m, ":-p", 3) ||
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
997 !strncmp(m, ":-P", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
998 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], tongue_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
999 } else if (!strncmp(m, "=-O", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1000 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], scream_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1001 } else if (!strncmp(m, ":-*", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1002 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], kiss_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1003 } else if (!strncmp(m, ">:o", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1004 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], yell_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1005 } else if (!strncmp(m, "8-)", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1006 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], smile8_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1007 } else if (!strncmp(m, ":-$", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1008 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], moneymouth_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1009 } else if (!strncmp(m, ":-!", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1010 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], burp_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1011 } else if (!strncmp(m, ":-[", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1012 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], embarrassed_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1013 } else if (!strncmp(m, ":'(", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1014 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], cry_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1015 } else if (!strncmp(m, ":-\\", 3) ||
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1016 !strncmp(m, ":-/", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1017 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], think_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1018 } else if (!strncmp(m, ":-X", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1019 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], crossedlips_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1020 } else if (!strncmp(m, ":-D", 3)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1021 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], bigsmile_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1022 }
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1023
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1024 if (face || strlen(m) < 4) return face;
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1025 *len = 4;
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1026 if ( !strncmp(m, "O:-)", 4)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1027 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], angel_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1028 }
551
33f8d91a9e9c [gaim-migrate @ 561]
Rob Flynn <gaim@robflynn.com>
parents: 536
diff changeset
1029 else if (!strncmp(m, "C:-)", 4)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1030 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], luke03_xpm);
551
33f8d91a9e9c [gaim-migrate @ 561]
Rob Flynn <gaim@robflynn.com>
parents: 536
diff changeset
1031 }
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1032
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1033 if (face || strlen(m) < 6) return face;
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1034 *len = 6;
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1035 if ( !strncmp(m, "&gt;:o", 6)) {
628
a46a68d46d2b [gaim-migrate @ 638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 625
diff changeset
1036 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, &window->style->base[GTK_STATE_NORMAL], yell_xpm);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1037 }
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1038
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1039 return face;
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1040 }
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1041
602
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1042 void write_html_with_smileys(GtkWidget *window, GtkWidget *html, char *what)
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1043 {
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1044 int y = 0;
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1045 char buf2[BUF_LONG];
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1046 int i;
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1047 GdkPixmap *face;
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1048
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1049 for (i = 0; i < strlen(what); i++)
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1050 {
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1051 int len;
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1052 if ((face = is_smiley(window, &what[i], &len)) != NULL) {
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1053 buf2[y] = 0;
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1054 gtk_html_append_text(GTK_HTML(html), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1055 gtk_html_add_pixmap(GTK_HTML(html), face, 0, 0);
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1056 y = 0;
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1057 i += len - 1;
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1058 } else {
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1059 buf2[y] = what[i];
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1060 y++;
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1061
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1062 }
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1063 }
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1064
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1065 if (y)
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1066 {
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1067 buf2[y] = 0;
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1068 gtk_html_append_text(GTK_HTML(html), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1069 }
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1070 }
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1071
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1072 /* this is going to be interesting since the conversation could either be a
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1073 * normal IM conversation or a chat window. but hopefully it won't matter */
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1074 void write_to_conv(struct conversation *c, char *what, int flags, char *who)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1075 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1076 char *buf = g_malloc(BUF_LONG);
636
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1077 char buf2[1024];
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1078 char *str;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1079 FILE *fd;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1080 char colour[10];
636
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1081 int colorv = -1;
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1082 char *clr;
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
1083 char *smiley = g_malloc(7);
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1084 struct buddy *b;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1085
474
7720d0f9da8e [gaim-migrate @ 484]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 473
diff changeset
1086 if (!who) {
745
d693b83e4933 [gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1087 if (flags & WFLAG_SEND) {
d693b83e4933 [gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1088 b = find_buddy(current_user->username);
d693b83e4933 [gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1089 if (b)
d693b83e4933 [gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1090 who = b->show;
d693b83e4933 [gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1091 else
d693b83e4933 [gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1092 who = current_user->username;
d693b83e4933 [gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1093 } else {
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1094 b = find_buddy(c->name);
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1095 if (b)
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1096 who = b->show;
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1097 else
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1098 who = c->name;
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1099 }
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1100 } else {
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1101 b = find_buddy(who);
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1102 if (b)
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1103 who = b->show;
474
7720d0f9da8e [gaim-migrate @ 484]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 473
diff changeset
1104 }
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1105
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1106 if (flags & WFLAG_SYSTEM) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1107
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1108 gtk_html_freeze(GTK_HTML(c->text));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1109
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1110 gtk_html_append_text(GTK_HTML(c->text), what, 0);
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1111
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1112 gtk_html_append_text(GTK_HTML(c->text), "<BR>", 0);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1113
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1114 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1115 char *t1;
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1116 char nm[256];
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1117
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1118 if (general_options & OPT_GEN_STRIP_HTML) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1119 t1 = strip_html(what);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1120 } else {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1121 t1 = what;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1122 }
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1123 if (c->is_chat)
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1124 g_snprintf(nm, 256, "%s.chat", c->name);
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1125 else
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1126 g_snprintf(nm, 256, "%s", c->name);
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1127 fd = open_log_file(nm);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1128 fprintf(fd, "%s\n", t1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1129 fclose(fd);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1130 if (general_options & OPT_GEN_STRIP_HTML) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1131 g_free(t1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1132 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1133 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1134
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1135 } else {
636
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1136 if ((clr = strstr(what, "<BODY BGCOLOR=\"#")) != NULL) {
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1137 sscanf(clr + strlen("<BODY BGCOLOR=\"#"), "%x", &colorv);
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1138 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1139
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1140 if (flags & WFLAG_WHISPER) {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1141 /* if we're whispering, it's not an autoresponse */
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1142 if (meify(what)) {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1143 str = g_malloc(64);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1144 g_snprintf(str, 62, "***%s", who);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1145 strcpy(colour, "#6C2585\0");
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1146 } else {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1147 str = g_malloc(64);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1148 g_snprintf(str, 62, "*%s*:", who);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1149 strcpy(colour, "#00ff00\0");
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1150 }
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1151 } else {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1152 if (meify(what)) {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1153 str = g_malloc(64);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1154 if (flags & WFLAG_AUTO)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1155 g_snprintf(str, 62, "%s ***%s", AUTO_RESPONSE, who);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1156 else
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1157 g_snprintf(str, 62, "***%s", who);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1158 strcpy(colour, "#062585\0");
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1159 } else {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1160 str = g_malloc(64);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1161 if (flags & WFLAG_AUTO)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1162 g_snprintf(str, 62, "%s %s", who, AUTO_RESPONSE);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1163 else
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1164 g_snprintf(str, 62, "%s:", who);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1165 if (flags & WFLAG_RECV)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1166 strcpy(colour, "#ff0000");
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1167 else if (flags & WFLAG_SEND)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1168 strcpy(colour, "#0000ff");
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1169 }
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1170 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1171
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1172 if (display_options & OPT_DISP_SHOW_TIME)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1173 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s %s</B></FONT> ", colour, date(), str);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1174 else
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1175 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s</B></FONT>", colour, str);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1176
473
f9bb7761c52b [gaim-migrate @ 483]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 472
diff changeset
1177 g_free(str);
f9bb7761c52b [gaim-migrate @ 483]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 472
diff changeset
1178
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1179 gtk_html_freeze(GTK_HTML(c->text));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1180
636
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1181 if (colorv != -1) {
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1182 sprintf(buf2, "<BODY BGCOLOR=\"#%x\">", colorv);
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1183 gtk_html_append_text(GTK_HTML(c->text), buf2, 0);
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1184 }
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1185
602
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1186 gtk_html_append_text(GTK_HTML(c->text), buf, 0);
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1187
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1188 if (display_options & OPT_DISP_SHOW_SMILEY)
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1189 {
602
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 575
diff changeset
1190 write_html_with_smileys(c->window, c->text, what);
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1191 }
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1192 else
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1193 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1194 gtk_html_append_text(GTK_HTML(c->text), what, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1195 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1196
636
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1197 if (colorv != -1) {
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1198 gtk_html_append_text(GTK_HTML(c->text), "</BODY>", 0);
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 629
diff changeset
1199 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1200 gtk_html_append_text(GTK_HTML(c->text), "<BR>", 0);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1201
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1202
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1203 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1204 char *t1, *t2;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1205 char *nm = g_malloc(256);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1206 if (c->is_chat)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1207 g_snprintf(nm, 256, "%s.chat", c->name);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1208 else
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1209 g_snprintf(nm, 256, "%s", c->name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1210
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1211 if (general_options & OPT_GEN_STRIP_HTML) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1212 t1 = strip_html(buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1213 t2 = strip_html(what);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1214 } else {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1215 t1 = buf;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1216 t2 = what;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1217 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1218 fd = open_log_file(nm);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1219 fprintf(fd, "%s%s\n", t1, t2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1220 fclose(fd);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1221 if (general_options & OPT_GEN_STRIP_HTML) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1222 g_free(t1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1223 g_free(t2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1224 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1225 g_free(nm);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1226 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1227 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1228
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1229 /* if (!GTK_WIDGET_MAPPED(c->window)) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1230
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1231 if (dark_icon_pm == NULL)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1232 dark_icon_pm = gdk_pixmap_create_from_xpm_d(c->window->window, &dark_icon_bm,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1233 NULL, (gchar **)aimicon2_xpm);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1234 gdk_window_set_icon(c->window->window, NULL, dark_icon_pm, dark_icon_bm);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1235 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1236 */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1237
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1238 if ((c->is_chat && (general_options & OPT_GEN_POPUP_CHAT)) ||
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1239 (!c->is_chat && (general_options & OPT_GEN_POPUP_WINDOWS)))
81
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1240 gdk_window_show(c->window->window);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1241
491
dcf5fe44396a [gaim-migrate @ 501]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
1242 gtk_html_thaw(GTK_HTML(c->text));
dcf5fe44396a [gaim-migrate @ 501]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
1243
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1244 g_free(smiley);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1245 g_free(buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1246 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1247
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1248
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1249
206
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1250 static void check_spelling( GtkEditable * editable, gchar * new_text,
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1251 gint length, gint * position,
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1252 gpointer data )
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1253 {
207
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1254 if (general_options & OPT_GEN_CHECK_SPELLING)
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1255 {
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1256 gtk_signal_handler_block_by_func(GTK_OBJECT(editable),
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1257 GTK_SIGNAL_FUNC(check_spelling), data);
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1258 gtk_text_set_point(GTK_TEXT(editable), *position);
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1259 gtk_text_insert(GTK_TEXT(editable), NULL, &(GTK_WIDGET(editable)->style->fg[0]), NULL, new_text, length );
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1260 if(isspace(new_text[0]))
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1261 {
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1262 gtk_text_freeze(GTK_TEXT(editable));
209
6e9b375e30e7 [gaim-migrate @ 219]
Rob Flynn <gaim@robflynn.com>
parents: 207
diff changeset
1263 spell_checker(GTK_WIDGET(editable));
207
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1264 gtk_text_thaw(GTK_TEXT(editable));
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1265 }
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1266 gtk_signal_handler_unblock_by_func(GTK_OBJECT(editable),
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1267 GTK_SIGNAL_FUNC(check_spelling), data);
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1268 gtk_signal_emit_stop_by_name(GTK_OBJECT(editable), "insert-text");
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1269 }
206
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1270 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1271
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1272
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1273 GtkWidget *build_conv_toolbar(struct conversation *c) {
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
1274 GdkPixmap *strike_i, *small_i, *normal_i, *big_i, *bold_i, *italic_i, *underline_i, *speaker_i, *wood_i, *palette_i, *link_i, *font_i, *smiley_i;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
1275 GtkWidget *strike_p, *small_p, *normal_p, *big_p, *bold_p, *italic_p, *underline_p, *speaker_p, *wood_p, *palette_p, *link_p, *font_p, *smiley_p;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
1276 GtkWidget *strike, *small, *normal, *big, *bold, *italic, *underline, *speaker, *wood, *palette, *link, *font, *smiley;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1277 GdkBitmap *mask;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1278 GtkWidget *toolbar;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1279 GtkWidget *win;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1280 GtkWidget *entry;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1281
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1282 toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1283 win = c->window;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1284 entry = c->entry;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1285
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1286 link_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
773
267ed2b889ee [gaim-migrate @ 783]
Rob Flynn <gaim@robflynn.com>
parents: 769
diff changeset
1287 &win->style->white, bold_xpm );
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1288 link_p = gtk_pixmap_new(link_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1289 gtk_widget_show(link_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1290
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1291 palette_i = gdk_pixmap_create_from_xpm_d (win->window, &mask,
773
267ed2b889ee [gaim-migrate @ 783]
Rob Flynn <gaim@robflynn.com>
parents: 769
diff changeset
1292 &win->style->white, bold_xpm );
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1293 palette_p = gtk_pixmap_new(palette_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1294 gtk_widget_show(palette_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1295
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1296 wood_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
773
267ed2b889ee [gaim-migrate @ 783]
Rob Flynn <gaim@robflynn.com>
parents: 769
diff changeset
1297 &win->style->white, bold_xpm );
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1298 wood_p = gtk_pixmap_new(wood_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1299 gtk_widget_show(wood_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1300 speaker_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
773
267ed2b889ee [gaim-migrate @ 783]
Rob Flynn <gaim@robflynn.com>
parents: 769
diff changeset
1301 &win->style->white, bold_xpm );
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1302 speaker_p = gtk_pixmap_new(speaker_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1303 gtk_widget_show(speaker_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1304 c->makesound=1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1305 strike_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1306 &win->style->white, strike_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1307 strike_p = gtk_pixmap_new(strike_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1308 gtk_widget_show(strike_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1309 bold_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1310 &win->style->white, bold_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1311 bold_p = gtk_pixmap_new(bold_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1312 gtk_widget_show(bold_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1313 italic_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1314 &win->style->white, italic_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1315 italic_p = gtk_pixmap_new(italic_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1316 gtk_widget_show(italic_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1317 underline_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1318 &win->style->white, underline_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1319 underline_p = gtk_pixmap_new(underline_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1320 gtk_widget_show(underline_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1321 small_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
790
9d5e7e987103 [gaim-migrate @ 800]
Rob Flynn <gaim@robflynn.com>
parents: 780
diff changeset
1322 &win->style->white, small_xpm );
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1323 small_p = gtk_pixmap_new(small_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1324 gtk_widget_show(small_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1325 normal_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
773
267ed2b889ee [gaim-migrate @ 783]
Rob Flynn <gaim@robflynn.com>
parents: 769
diff changeset
1326 &win->style->white, bold_xpm );
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1327 normal_p = gtk_pixmap_new(normal_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1328 gtk_widget_show(normal_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1329 big_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
790
9d5e7e987103 [gaim-migrate @ 800]
Rob Flynn <gaim@robflynn.com>
parents: 780
diff changeset
1330 &win->style->white, big_xpm );
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1331 big_p = gtk_pixmap_new(big_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1332 gtk_widget_show(big_p);
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1333 font_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
773
267ed2b889ee [gaim-migrate @ 783]
Rob Flynn <gaim@robflynn.com>
parents: 769
diff changeset
1334 &win->style->white, bold_xpm );
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1335 font_p = gtk_pixmap_new(font_i, mask);
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1336 gtk_widget_show(font_p);
790
9d5e7e987103 [gaim-migrate @ 800]
Rob Flynn <gaim@robflynn.com>
parents: 780
diff changeset
1337 smiley_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, smile_icon_xpm);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
1338 smiley_p = gtk_pixmap_new(smiley_i, mask);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
1339 gtk_widget_show(smiley_p);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1340
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1341 bold = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1342 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1343 _("Bold"), _("Bold Text"), _("Bold"), bold_p,
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1344 GTK_SIGNAL_FUNC(do_bold), entry);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1345 italic = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1346 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1347 NULL, _("Italics"), _("Italics Text"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1348 _("Italics"), italic_p, GTK_SIGNAL_FUNC(do_italic), entry);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1349 underline = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1350 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1351 NULL, _("Underline"), _("Underline Text"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1352 _("Underline"), underline_p, GTK_SIGNAL_FUNC(do_underline), entry);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1353 strike = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1354 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1355 NULL, _("Strike"), _("Strike through Text"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1356 _("Strike"), strike_p, GTK_SIGNAL_FUNC(do_strike), entry);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1357 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1358 small = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1359 _("Small"), _("Decrease font size"), _("Small"),
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1360 small_p, GTK_SIGNAL_FUNC(do_small), entry);
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1361 normal = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1362 _("Normal"), _("Normal font size"), _("Normal"),
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1363 normal_p, GTK_SIGNAL_FUNC(do_normal), entry);
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1364 big = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1365 _("Big"), _("Increase font size"), _("Big"),
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1366 big_p, GTK_SIGNAL_FUNC(do_big), entry);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1367 font = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1368 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1369 NULL, _("Font"), _("Select Font"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1370 _("Font"), font_p, GTK_SIGNAL_FUNC(toggle_font), c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1371 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1372 link = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1373 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
611
0f7e5ff95f71 [gaim-migrate @ 621]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 610
diff changeset
1374 NULL, _("Link"), _("Insert Link"),
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1375 _("Link"), link_p, GTK_SIGNAL_FUNC(toggle_link), c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1376 palette = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1377 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1378 NULL, _("Color"), _("Text Color"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1379 _("Color"), palette_p, GTK_SIGNAL_FUNC(toggle_color), c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1380 wood = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1381 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1382 NULL, _("Logging"), _("Enable logging"),
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1383 _("Logging"), wood_p, GTK_SIGNAL_FUNC(toggle_loggle), c);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
1384 smiley = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
1385 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
1386 NULL, _("Smiley"), _("Insert smiley face"), _("Smiley"),
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
1387 smiley_p, GTK_SIGNAL_FUNC(insert_smiley), c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1388 speaker = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1389 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1390 NULL, _("Sound"), _("Enable sounds"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1391 _("Sound"), speaker_p, GTK_SIGNAL_FUNC(set_option), &c->makesound);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1392 c->makesound=0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1393 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(speaker), TRUE);
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1394
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1395 state_lock = 1;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1396 if (find_log_info(c->name))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1397 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1398 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1399 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), FALSE);
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1400 state_lock = 0;
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1401
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1402 /* use a slicker look if the user wants to */
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1403 if (display_options & OPT_DISP_COOL_LOOK)
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1404 {
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1405 gtk_button_set_relief(GTK_BUTTON(strike), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1406 gtk_button_set_relief(GTK_BUTTON(normal), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1407 gtk_button_set_relief(GTK_BUTTON(big), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1408 gtk_button_set_relief(GTK_BUTTON(bold), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1409 gtk_button_set_relief(GTK_BUTTON(italic), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1410 gtk_button_set_relief(GTK_BUTTON(underline), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1411 gtk_button_set_relief(GTK_BUTTON(speaker), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1412 gtk_button_set_relief(GTK_BUTTON(wood), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1413 gtk_button_set_relief(GTK_BUTTON(palette), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1414 gtk_button_set_relief(GTK_BUTTON(link), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1415 gtk_button_set_relief(GTK_BUTTON(font), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1416 gtk_button_set_relief(GTK_BUTTON(small), GTK_RELIEF_NONE);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
1417 gtk_button_set_relief(GTK_BUTTON(smiley), GTK_RELIEF_NONE);
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1418 }
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1419
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1420 gtk_widget_show(toolbar);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1421
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1422 gdk_pixmap_unref(link_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1423 gdk_pixmap_unref(palette_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1424 gdk_pixmap_unref(wood_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1425 gdk_pixmap_unref(speaker_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1426 gdk_pixmap_unref(strike_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1427 gdk_pixmap_unref(bold_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1428 gdk_pixmap_unref(italic_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1429 gdk_pixmap_unref(underline_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1430 gdk_pixmap_unref(small_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1431 gdk_pixmap_unref(normal_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1432 gdk_pixmap_unref(big_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1433 gdk_pixmap_unref(font_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1434 gdk_pixmap_unref(smiley_i);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1435
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1436 c->bold = bold;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1437 c->strike = strike;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1438 c->italic = italic;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1439 c->underline = underline;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1440 c->log_button = wood;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1441 c->palette = palette;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1442 c->link = link;
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1443 c->wood = wood;
308
e5fa88351dc8 [gaim-migrate @ 318]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
1444 c->font = font;
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
1445 c->smiley = smiley;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1446
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1447 gtk_widget_set_sensitive(c->log_button, ((general_options & OPT_GEN_LOG_ALL)) ? FALSE : TRUE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1448
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1449 gtk_widget_set_sensitive(c->bold, ((font_options & OPT_FONT_BOLD)) ? FALSE : TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1450 gtk_widget_set_sensitive(c->italic, ((font_options & OPT_FONT_ITALIC)) ? FALSE : TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1451 gtk_widget_set_sensitive(c->underline, ((font_options & OPT_FONT_UNDERLINE)) ? FALSE : TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1452 gtk_widget_set_sensitive(c->strike, ((font_options & OPT_FONT_STRIKE)) ? FALSE : TRUE);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1453
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1454 return toolbar;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1455 }
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1456
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1457
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1458 void show_conv(struct conversation *c)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1459 {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1460 GtkWidget *win;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1461 char buf[256];
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1462 GtkWidget *text;
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1463 GtkWidget *sw;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1464 GtkWidget *send;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1465 GtkWidget *info;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1466 GtkWidget *warn;
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1467 GtkWidget *block;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1468 GtkWidget *close;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1469 GtkWidget *entry;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1470 GtkWidget *bbox;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1471 GtkWidget *vbox;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1472 GtkWidget *vbox2;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1473 GtkWidget *paned;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1474 GtkWidget *add;
623
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
1475 GtkWidget *toolbar;
754
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1476 int dispstyle;
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1477
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1478 win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1479 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1480
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1481 gtk_widget_realize(win);
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1482 aol_icon(win->window);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1483
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1484 c->window = win;
623
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
1485
754
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1486 if (display_options & OPT_DISP_CONV_SHOW_TEXT)
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1487 {
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1488 dispstyle = TRUE;
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1489 }
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1490 else
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1491 {
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1492 dispstyle = FALSE;
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1493 }
623
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
1494
754
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1495 send = picture_button2(win, _("Send"), tmp_send_xpm, dispstyle);
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1496 info = picture_button2(win, _("Info"), tb_search_xpm, dispstyle);
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1497 warn = picture_button2(win, _("Warn"), warn_xpm, dispstyle);
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1498 close = picture_button2(win, _("Close"), cancel_xpm, dispstyle);
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1499 if (find_buddy(c->name) != NULL)
754
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1500 add = picture_button2(win, _("Remove"), gnome_remove_xpm, dispstyle);
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1501 else
754
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1502 add = picture_button2(win, _("Add"), gnome_add_xpm, dispstyle);
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1503 block = picture_button2(win, _("Block"), block_xpm, dispstyle);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1504
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1505 /* use a slicker look if the user wants to */
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1506 if (display_options & OPT_DISP_COOL_LOOK)
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1507 {
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1508 gtk_button_set_relief(GTK_BUTTON(send), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1509 gtk_button_set_relief(GTK_BUTTON(info), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1510 gtk_button_set_relief(GTK_BUTTON(warn), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1511 gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1512 gtk_button_set_relief(GTK_BUTTON(add), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1513 gtk_button_set_relief(GTK_BUTTON(block), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1514 }
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1515
623
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
1516 bbox = gtk_hbox_new(FALSE, 5);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1517 vbox = gtk_vbox_new(FALSE, 0);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1518 vbox2 = gtk_vbox_new(FALSE, 0);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1519 paned = gtk_vpaned_new();
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1520
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1521 gtk_paned_pack1(GTK_PANED(paned), vbox, FALSE, TRUE);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1522 gtk_paned_pack2(GTK_PANED(paned), vbox2, FALSE, FALSE);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1523 gtk_widget_show(vbox2);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1524 gtk_widget_show(paned);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1525
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1526 entry = gtk_text_new(NULL, NULL);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1527 gtk_text_set_editable(GTK_TEXT(entry), TRUE);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1528 gtk_text_set_word_wrap(GTK_TEXT(entry), TRUE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1529 gtk_object_set_user_data(GTK_OBJECT(entry), c);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1530 c->entry = entry;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1531 gtk_signal_connect(GTK_OBJECT(entry), "activate", GTK_SIGNAL_FUNC(send_callback),c);
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1532 c->add_button = add;
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1533
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1534 /* Toolbar */
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1535 toolbar = build_conv_toolbar(c);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1536
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1537 /* Text box */
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1538 text = gtk_html_new(NULL, NULL);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1539 gtk_html_set_editable(GTK_HTML(text), FALSE);
623
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
1540 /*
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
1541 gtk_html_set_transparent(GTK_HTML(text), (transparent) ? TRUE : FALSE);
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
1542 */
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
1543
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1544 c->text = text;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1545
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1546 sw = gtk_scrolled_window_new (NULL, NULL);
623
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
1547 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
1548 GTK_POLICY_NEVER,
624
7911320aac0d [gaim-migrate @ 634]
Rob Flynn <gaim@robflynn.com>
parents: 623
diff changeset
1549 GTK_POLICY_ALWAYS);
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1550 gtk_widget_show(sw);
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1551 gtk_container_add(GTK_CONTAINER(sw), text);
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1552 gtk_widget_show(text);
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1553
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1554 GTK_HTML (text)->hadj->step_increment = 10.0;
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1555 GTK_HTML (text)->vadj->step_increment = 10.0;
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1556 gtk_widget_set_usize(sw, 320, 150);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1557
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1558 /* Ready and pack buttons */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1559 gtk_object_set_user_data(GTK_OBJECT(win), c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1560 gtk_object_set_user_data(GTK_OBJECT(close), c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1561 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(close_callback), c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1562 gtk_signal_connect(GTK_OBJECT(send), "clicked", GTK_SIGNAL_FUNC(send_callback), c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1563 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(add_callback), c);
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1564 gtk_signal_connect(GTK_OBJECT(info), "clicked", GTK_SIGNAL_FUNC(info_callback), c);
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1565 gtk_signal_connect(GTK_OBJECT(warn), "clicked", GTK_SIGNAL_FUNC(warn_callback), c);
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1566 gtk_signal_connect(GTK_OBJECT(block), "clicked", GTK_SIGNAL_FUNC(block_callback), c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1567
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1568 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(keypress_callback), c);
81
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1569 gtk_widget_set_usize(entry, 300, 25);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1570
754
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1571 gtk_box_pack_end(GTK_BOX(bbox), close, dispstyle, dispstyle, 0);
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1572 gtk_box_pack_end(GTK_BOX(bbox), add, dispstyle, dispstyle, 0);
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1573 gtk_box_pack_end(GTK_BOX(bbox), block, dispstyle, dispstyle, 0);
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1574 gtk_box_pack_end(GTK_BOX(bbox), warn, dispstyle, dispstyle, 0);
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1575 gtk_box_pack_end(GTK_BOX(bbox), info, dispstyle, dispstyle, 0);
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 753
diff changeset
1576 gtk_box_pack_end(GTK_BOX(bbox), send, dispstyle, dispstyle, 0);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1577
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1578 /* pack and fill the rest */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1579 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 5);
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1580 gtk_box_pack_start(GTK_BOX(vbox2), toolbar, FALSE, FALSE, 5);
81
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1581 gtk_box_pack_start(GTK_BOX(vbox2), entry, TRUE, TRUE, 5);
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1582 gtk_box_pack_start(GTK_BOX(vbox2), bbox, FALSE, FALSE, 5);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1583
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1584 gtk_widget_show(send);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1585 gtk_widget_show(info);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1586 gtk_widget_show(warn);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1587 gtk_widget_show(close);
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1588 gtk_widget_show(add);
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1589 gtk_widget_show(block);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1590 gtk_widget_show(bbox);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1591 gtk_widget_show(vbox);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1592 gtk_widget_show(entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1593 gtk_widget_show(text);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1594
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1595 c->font_dialog = NULL;
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1596 c->color_dialog = NULL;
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
1597 c->smiley_dialog = NULL;
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1598 c->link_dialog = NULL;
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1599 c->log_dialog = NULL;
687
02ef523db170 [gaim-migrate @ 697]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 666
diff changeset
1600 sprintf(c->fontface, "%s", fontface);
688
6b1345121dd3 [gaim-migrate @ 698]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 687
diff changeset
1601 c->hasfont = 0;
687
02ef523db170 [gaim-migrate @ 697]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 666
diff changeset
1602 c->bgcol = bgcolor;
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1603 c->hasbg = 0;
687
02ef523db170 [gaim-migrate @ 697]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 666
diff changeset
1604 c->fgcol = fgcolor;
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1605 c->hasfg = 0;
67
65a118affac1 [gaim-migrate @ 77]
Rob Flynn <gaim@robflynn.com>
parents: 66
diff changeset
1606
81
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1607 gtk_container_add(GTK_CONTAINER(win), paned);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1608 gtk_container_border_width(GTK_CONTAINER(win), 10);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1609
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1610 if ((find_log_info(c->name)) || ((general_options & OPT_GEN_LOG_ALL)))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1611 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, c->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1612 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1613 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, c->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1614 gtk_window_set_title(GTK_WINDOW(win), buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1615 gtk_window_set_focus(GTK_WINDOW(win),entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1616
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1617 gtk_signal_connect(GTK_OBJECT(win), "delete_event", GTK_SIGNAL_FUNC(delete_event_convo), c);
206
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1618 gtk_signal_connect(GTK_OBJECT(entry), "insert-text", GTK_SIGNAL_FUNC(check_spelling), entry);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1619 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed), entry);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
1620
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1621 gtk_widget_show(win);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1622 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1623
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1624